页面优化3

This commit is contained in:
zzyuan 2026-01-30 10:38:11 +08:00
parent 9dbebf4f05
commit f2ec0f7ae4
1 changed files with 13 additions and 4 deletions

View File

@ -34,15 +34,21 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="标题" align="center" prop="title" :show-overflow-tooltip="true"/>
<el-table-column label="标题" align="center" prop="title" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="内容" align="center" prop="content" :show-overflow-tooltip="true"/>
<el-table-column label="是否启用" align="center" prop="state" :show-overflow-tooltip="true" width="100">
<el-table-column label="是否启用" align="center" prop="type" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span v-if="scope.row.type==1">文本内容</span>
<span v-if="scope.row.type==2">附件内容</span>
</template>
</el-table-column>
<el-table-column label="是否启用" align="center" prop="state" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span v-if="scope.row.state==1" style="font-size: 18px;color: rgb(3, 223, 109);"></span>
<span v-if="scope.row.state==0" style="font-size: 18px;color: red;"></span>
</template>
</el-table-column>
<el-table-column label="附件" align="center" prop="" :show-overflow-tooltip="true" width="150">
<el-table-column label="附件" align="center" prop="" :show-overflow-tooltip="true" width="200">
<template slot-scope="scope">
<span v-if="scope.row.fileUrl!=''" @click="downloadFile(scope.row)" style="cursor: pointer;color: #46a6ff;">{{scope.row.fileName}}</span>
<span v-else>无附件</span>
@ -100,7 +106,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="附件上传" prop="fileList" :rules="[{ required: baseForm.type==2,message: '附件不能为空', trigger: 'change' }]">
<el-form-item label="附件上传" prop="fileUrl" :rules="[{ required: baseForm.type==2,message: '附件不能为空', trigger: 'change' }]">
<el-upload
ref="upload"
:limit="1"
@ -323,8 +329,10 @@
handleFileSuccess(response, file, fileList) {
this.upload.isUploading = false;
if(response.code==200){
// this.fileList.push({url:response.data.url,name:response.data.name})
this.fileUrl.push(response.data.url)
this.fileName.push(response.data.name)
this.$set(this.baseForm,"fileUrl",response.data.url)
this.$modal.msgSuccess(response.msg);
}else{
this.$modal.msgError(response.msg);
@ -339,6 +347,7 @@
})
this.fileUrl.splice(sum, 1)
this.fileName.splice(sum, 1)
this.$set(this.baseForm,"fileUrl",null)
},
async handlePreviewDownloadFile(file) {
if (file.url != null && file.url !== '') {