|
|
@@ -2,13 +2,61 @@
|
|
|
<div class="timeline-container">
|
|
|
<div class="timeline-content">
|
|
|
<div class="timeline-entry-list">
|
|
|
-
|
|
|
<div class="entry-list-container">
|
|
|
-
|
|
|
+ <div class="tab-header">
|
|
|
+ <span class="tab-title">证书列表</span>
|
|
|
+ </div>
|
|
|
+ <div class="content-body">
|
|
|
+ <el-button size="small" type="primary" @click="dialogVisible = true">上传证书</el-button>
|
|
|
+ <el-table size="small" :data="dataList" border style="margin-top: 20px;width: 100%">
|
|
|
+ <el-table-column align="center" type="index" width="50" label="序号"></el-table-column>
|
|
|
+ <el-table-column width="80" align="center" prop="type" label="类型"></el-table-column>
|
|
|
+ <el-table-column align="center" prop="title" label="证书">
|
|
|
+ <template slot-scope="props">
|
|
|
+ <a style="color: #1e80ff;" target="_blank" :href="props.row.file">{{ props.row.title }}</a>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="150" align="center" prop="createTime" label="上传时间"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<SiderInfo></SiderInfo>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ title="上传证书"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="40%">
|
|
|
+ <el-form ref="dataForm" :model="dataForm" label-width="50px">
|
|
|
+ <el-form-item label="类型:">
|
|
|
+ <el-select style="width: 95%;" size="small" v-model="dataForm.type"
|
|
|
+ placeholder="请选择证书类型">
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="名称:">
|
|
|
+ <el-input placeholder="请填写证名称" size="small" style="width: 95%;" v-model="dataForm.title"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="证书:">
|
|
|
+ <el-upload
|
|
|
+ :action="fileUrl"
|
|
|
+ :file-list="dataForm.files"
|
|
|
+ :on-success="handleAvatarSuccess"
|
|
|
+ :before-upload="beforeUploadFile"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <!-- <el-button size="small" @click="dialogVisible = false">取 消</el-button> -->
|
|
|
+ <el-button size="small" type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -20,41 +68,113 @@ export default{
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- dataList:[],
|
|
|
- page:1,
|
|
|
- pages:1,
|
|
|
+ fileUrl: this.baseUrl,
|
|
|
+ dataList:[
|
|
|
+ {
|
|
|
+ title:'英语四级证书',
|
|
|
+ file: "https://xiaoyou.dgtis.com/images/image/2023/05/08/5hibpn5vzqr1i3z1cm3b.jpg",
|
|
|
+ fileName: "微信图片_20230217092706.jpg",
|
|
|
+ type: "类别1",
|
|
|
+ createTime: "2023-5-8",
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ dialogVisible: false,
|
|
|
+ options: [{
|
|
|
+ value: '类别1',
|
|
|
+ label: '类别1'
|
|
|
+ }, {
|
|
|
+ value: '类别2',
|
|
|
+ label: '类别2'
|
|
|
+ }, {
|
|
|
+ value: '类别3',
|
|
|
+ label: '类别3'
|
|
|
+ }, {
|
|
|
+ value: '类别4',
|
|
|
+ label: '类别4'
|
|
|
+ }, {
|
|
|
+ value: '类别5',
|
|
|
+ label: '类别5'
|
|
|
+ }],
|
|
|
+ dataForm: {
|
|
|
+ title:'',
|
|
|
+ files:[],
|
|
|
+ fileName: '',
|
|
|
+ file:'',
|
|
|
+ createTime:'2023-5-8'
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
created(){
|
|
|
// this.getDataList();
|
|
|
},
|
|
|
methods:{
|
|
|
- handleClickMag(id) {
|
|
|
- this.$router.push({
|
|
|
- path: '/home/index/msgDetail',
|
|
|
- query: {
|
|
|
- id: id,
|
|
|
- }
|
|
|
- });
|
|
|
+ beforeRemove(file, fileList) {
|
|
|
+ return this.$confirm(`确定移除 ${file.name}?`);
|
|
|
+ },
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ console.log(file, fileList);
|
|
|
+ let files = [];
|
|
|
+ let names = [];
|
|
|
+ for (let i in fileList) {
|
|
|
+ let response = fileList[i].response;
|
|
|
+ let name = fileList[i].name;
|
|
|
+ let url = response.data.url;
|
|
|
+ files.push(url);
|
|
|
+ names.push(name);
|
|
|
+ }
|
|
|
+ this.dataForm.file = files.join(",");
|
|
|
+ this.dataForm.fileName = names.join(",");
|
|
|
+ },
|
|
|
+ beforeUploadFile(file){
|
|
|
+ console.log(file);
|
|
|
+ const size = file.size / 1024 / 1024;
|
|
|
+ console.log(size);
|
|
|
+ // if(size > 10 ){
|
|
|
+ // this.$message.error("文件大小不能超过10MB!");
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ handleAvatarSuccess(res, file, fileList) {
|
|
|
+ console.log(file, fileList);
|
|
|
+ console.log("------", "==========");
|
|
|
+ console.log("res = " , res);
|
|
|
+
|
|
|
+ let files = [];
|
|
|
+ let names = [];
|
|
|
+ for (let i in fileList) {
|
|
|
+ let response = fileList[i].response;
|
|
|
+ if (response.errno && response.errno != "0") {
|
|
|
+ this.$message.error("该文件上传失败,已被移除,请重新上传!");
|
|
|
+ // 上传失败移除该 file 对象
|
|
|
+ fileList.splice(i, 1);
|
|
|
+ } else {
|
|
|
+ let name = fileList[i].name;
|
|
|
+ let url = fileList[i].response.data.url;
|
|
|
+ files.push(url);
|
|
|
+ names.push(name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.dataForm.file = files.join(",");
|
|
|
+ this.dataForm.fileName = names.join(",");
|
|
|
+ },
|
|
|
+ resetForm() {
|
|
|
+ this.$refs['dataForm'].resetFields();
|
|
|
},
|
|
|
+ submitForm() {
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.dataList.push(this.dataForm);
|
|
|
+ console.log(this.dataList);
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.resetForm();
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getDataList(){
|
|
|
- let data = {
|
|
|
- limit:10,
|
|
|
- page:this.page,
|
|
|
- type:0,
|
|
|
- };
|
|
|
- msgList(data).then(response=>{
|
|
|
- if(this.page==1){
|
|
|
- this.dataList = response.data.data.list;
|
|
|
- this.page = response.data.data.pageNum;
|
|
|
- this.pages = response.data.data.pages;
|
|
|
- }else{
|
|
|
- this.dataList = [
|
|
|
- ...this.dataList,
|
|
|
- ...response.data.data.list
|
|
|
- ]
|
|
|
- }
|
|
|
- ++this.page
|
|
|
+ msgList().then(response=>{
|
|
|
+ this.dataList = response.data.data.list;
|
|
|
})
|
|
|
},
|
|
|
|
|
|
@@ -76,6 +196,9 @@ export default{
|
|
|
border-radius: 4px;
|
|
|
min-height: 500px;
|
|
|
}
|
|
|
+.content-body {
|
|
|
+ padding: 10px 20px 16px;
|
|
|
+}
|
|
|
.entry-list-container .tab-header {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
@@ -90,85 +213,4 @@ export default{
|
|
|
font-size: 18px;
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
-.entry-list{
|
|
|
- width: 100%;
|
|
|
- background-color: #fff;
|
|
|
- position: relative;
|
|
|
-}
|
|
|
-.list-item:hover {
|
|
|
- background: #fafafa;
|
|
|
-}
|
|
|
-.list-item{
|
|
|
- position: relative;
|
|
|
- cursor: pointer;
|
|
|
- padding: 12px 20px 0;
|
|
|
-}
|
|
|
-.list-item .meta-container{
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
-}
|
|
|
-.list-item .meta-container .user-message{
|
|
|
- max-width: 162px;
|
|
|
- font-size: 13px;
|
|
|
- line-height: 22px;
|
|
|
- color: #4e5969;
|
|
|
- white-space: nowrap;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- word-break: break-all;
|
|
|
-}
|
|
|
-.list-item .meta-container .dividing{
|
|
|
- line-height: 22px;
|
|
|
- width: 1px;
|
|
|
- height: 14px;
|
|
|
- background: #e5e6eb;
|
|
|
- margin: 0 8px;
|
|
|
-}
|
|
|
-.list-item .meta-container .date{
|
|
|
- line-height: 22px;
|
|
|
- font-size: 13px;
|
|
|
- color: #86909c;
|
|
|
-}
|
|
|
-.list-item .main{
|
|
|
- margin-top: 6px;
|
|
|
- padding-bottom: 12px;
|
|
|
- display: flex;
|
|
|
- border-bottom: 1px solid #e5e6eb;
|
|
|
-}
|
|
|
-.list-item .main .info-box{
|
|
|
- flex-grow: 1;
|
|
|
-}
|
|
|
-.list-item .main .info-box .title:visited {
|
|
|
- color: #86909c;
|
|
|
-}
|
|
|
-.list-item .main .info-box .title{
|
|
|
- font-weight: 700;
|
|
|
- font-size: 16px;
|
|
|
- line-height: 24px;
|
|
|
- color: #1d2129;
|
|
|
- margin-bottom: 8px;
|
|
|
- display: -webkit-box;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
- -webkit-line-clamp: 1;
|
|
|
-}
|
|
|
-.list-item .main .info-box .description{
|
|
|
- font-weight: 400;
|
|
|
- font-size: 13px;
|
|
|
- line-height: 22px;
|
|
|
- color: #86909c;
|
|
|
- display: -webkit-box;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
- -webkit-line-clamp: 2;
|
|
|
-}
|
|
|
-.list-item .thumb{
|
|
|
- flex: 0 0 auto;
|
|
|
- width: 120px;
|
|
|
- height: 80px;
|
|
|
- margin-left: 24px;
|
|
|
- border-radius: 2px;
|
|
|
-}
|
|
|
</style>
|