【修改】增加图标 修改删除10个的关键字 修改日期显示格式
This commit is contained in:
@@ -20,14 +20,15 @@
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="报告所属部门:" prop="department">
|
||||
<el-input readonly :disabled="formControl" v-model="form.departmentName" @click.native="handleClick" placeholder="请选择报告所属部门"
|
||||
<el-input readonly :disabled="formControl" v-model="form.departmentName" @click.native="handleClick"
|
||||
placeholder="请选择报告所属部门"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-form-item label="标签:" >
|
||||
<el-form-item label="标签:">
|
||||
<el-cascader :disabled="formControl" width="100%" v-model="form.labelList" :options="cascaderOptions"
|
||||
filterable collapse-tags
|
||||
filterable collapse-tags
|
||||
:props="{ checkStrictly: true ,multiple: true }" clearable placeholder="请选择标签">
|
||||
<template slot-scope="{ node, data }">
|
||||
<span :title="data.label">{{ data.label }}</span>
|
||||
@@ -37,9 +38,10 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10" >
|
||||
<el-col :span="10">
|
||||
<el-form-item label="报告涉密等级:" prop="confidentialLevel">
|
||||
<el-select :disabled="formControl" v-model="form.confidentialLevel" placeholder="请选择报告涉密等级" @change="reportLevel">
|
||||
<el-select :disabled="formControl" v-model="form.confidentialLevel" placeholder="请选择报告涉密等级"
|
||||
@change="reportLevel">
|
||||
<el-option v-for="item in privacyLevelOptions " :key="item.value" :label="item.value"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
@@ -48,15 +50,15 @@
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4" v-if="isShowTime">
|
||||
<el-form-item label="保密到期日期:" prop="secrecyLast">
|
||||
<el-date-picker :disabled="formControl" v-model="form.secrecyLast" type="date" value-format="yyyy-mm-dd"
|
||||
placeholder="请选择保密到期日期"
|
||||
prefix-icon="null" />
|
||||
<el-date-picker :disabled="formControl" v-model="form.secrecyLast" type="date" value-format="yyyy-mm-dd"
|
||||
placeholder="请选择保密到期日期"
|
||||
prefix-icon="null"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
||||
<el-col :span="10" >
|
||||
<el-col :span="10">
|
||||
<el-form-item label="报告隐私等级:" prop="privacyLevel">
|
||||
<el-select :disabled="formControl" v-model="form.privacyLevel" placeholder="请选择报告隐私等级">
|
||||
<el-option v-for="item in confidentialLevelOptions" :key="item.value" :label="item.value"
|
||||
@@ -69,21 +71,9 @@
|
||||
<el-form-item label="关键词:" prop="tags">
|
||||
<vue-tags-input :disabled="formControl" :class="{'is-diable':formControl}" placeholder="请输入关键词"
|
||||
v-model="form.tags" :tags="tags"
|
||||
:avoid-adding-duplicates="false" @tags-changed="newTags =>{
|
||||
if(newTags[newTags.length - 1].text.length <= 20){
|
||||
if(tags.length < 10){
|
||||
tags = newTags
|
||||
}else{
|
||||
this.$message({type:'error',message:'关键词数量不能超过10个'})
|
||||
tags = newTags.slice(0,-1)
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.$message({type:'error',message:'单个关键词不能超过20个字'})
|
||||
tags = newTags.slice(0,-1)
|
||||
}
|
||||
|
||||
}"/>
|
||||
@before-deleting-tag="delTag"
|
||||
@before-adding-tag="addTags"
|
||||
:avoid-adding-duplicates="false" @tags-changed="newTags => tags=newTags"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -110,9 +100,13 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<span class="uploadFile" v-if="form.fileName">
|
||||
<span :class="{'fontColor':formControl}" :title="form.fileName">{{form.fileName}}</span>
|
||||
<i :class="{'fontColor':formControl}" class="el-icon-cloudy iconstyle" @click="downFile(form.fileId)"></i>
|
||||
<i :class="{'fontColor':formControl}" class="el-icon-delete iconstyle" @click="delFile"></i>
|
||||
<span :class="{'fontColor':formControl}" :title="form.fileName" class="juli">{{ form.fileName }}</span>
|
||||
<svg-icon icon-class="cloud" @click="downFile(form.fileId)" style="font-size: 20px"
|
||||
class-name="icon" :class="{'fontColor':formControl}"></svg-icon>
|
||||
<svg-icon icon-class="del" @click="delFile" style="font-size: 20px"
|
||||
class-name="icon" :class="{'fontColor':formControl}"></svg-icon>
|
||||
<!-- <i class="el-icon-cloudy iconstyle" ></i>-->
|
||||
<!-- <i :class="{'fontColor':formControl}" class="el-icon-delete iconstyle" @click="delFile"></i>-->
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -129,8 +123,9 @@ import {fileType} from '@/utils/fileType'
|
||||
import newTranslate from "../../../components/newTranslate";
|
||||
import VueTagsInput from '@johmun/vue-tags-input';
|
||||
import orgTable from '@/components/OrgTable'
|
||||
import {privacyLevelOptions,confidentialLevelOptions} from '@/utils/Enum/enum'
|
||||
import { downloadFile } from '@/utils/downloadFile'
|
||||
import {privacyLevelOptions, confidentialLevelOptions} from '@/utils/Enum/enum'
|
||||
import {downloadFile} from '@/utils/downloadFile'
|
||||
|
||||
export default {
|
||||
dicts: ['classified_level', 'privacy_level'],
|
||||
components: {
|
||||
@@ -156,10 +151,10 @@ export default {
|
||||
return {
|
||||
privacyLevelOptions,
|
||||
confidentialLevelOptions,
|
||||
orgTableVal:'',
|
||||
orgTableVal: '',
|
||||
orgTableValName: '',
|
||||
visibleOrgTable:false,
|
||||
isShowTime:false, //是否显示日期
|
||||
visibleOrgTable: false,
|
||||
isShowTime: false, //是否显示日期
|
||||
loadingMore: false,
|
||||
listTwo: [], //存储下载预览的
|
||||
allUser: [], //存储全部的
|
||||
@@ -225,19 +220,19 @@ export default {
|
||||
|
||||
}
|
||||
],
|
||||
privacyLevel:[
|
||||
privacyLevel: [
|
||||
{
|
||||
required: true,
|
||||
message: "报告隐私等级不能为空", trigger: 'change'
|
||||
}
|
||||
],
|
||||
confidentialLevel:[
|
||||
confidentialLevel: [
|
||||
{
|
||||
required: true,
|
||||
message: "报告涉密等级不能为空", trigger: 'change'
|
||||
}
|
||||
],
|
||||
secrecyLast:[
|
||||
secrecyLast: [
|
||||
{
|
||||
required: true,
|
||||
message: "保密到期日期不能为空", trigger: 'change'
|
||||
@@ -254,43 +249,58 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
processForm:{
|
||||
processForm: {
|
||||
handler(val) {
|
||||
this.form = this.processForm
|
||||
console.log("变化了",this.form)
|
||||
if(this.form.secrecyLast){
|
||||
this.isShowTime=true
|
||||
this.form.secrecyLast=new Date(this.form.secrecyLast)
|
||||
console.log("变化了", this.form)
|
||||
if (this.form.secrecyLast) {
|
||||
this.isShowTime = true
|
||||
this.form.secrecyLast = new Date(this.form.secrecyLast)
|
||||
}
|
||||
if(this.processForm.keyContent){
|
||||
this.tags=JSON.parse(this.processForm.keyContent)
|
||||
if (this.processForm.keyContent) {
|
||||
this.tags = JSON.parse(this.processForm.keyContent)
|
||||
}
|
||||
if(this.processForm.labelList && typeof this.processForm.labelList[0]=='string'){
|
||||
this.form.labelList= this.processForm.labelList.map(item=>{
|
||||
if (this.processForm.labelList && typeof this.processForm.labelList[0] == 'string') {
|
||||
this.form.labelList = this.processForm.labelList.map(item => {
|
||||
|
||||
return JSON.parse(item)
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate:true
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
delTag(obj) {
|
||||
console.log("我我我")
|
||||
obj.deleteTag()
|
||||
},
|
||||
addTags(obj) {
|
||||
if (obj.tag.text.length <= 20) {
|
||||
if (this.tags.length < 10) {
|
||||
obj.addTag();
|
||||
} else {
|
||||
this.$message({type: 'error', message: '关键词数量不能超过10个'})
|
||||
}
|
||||
} else {
|
||||
this.$message({type: 'error', message: '单个关键词不能超过20个字'})
|
||||
}
|
||||
|
||||
downFile(id){
|
||||
this.$api.report.reportDownload({reportId:null,fileId:id}).then(res=>{
|
||||
},
|
||||
downFile(id) {
|
||||
this.$api.report.reportDownload({reportId: null, fileId: id}).then(res => {
|
||||
downloadFile(res)
|
||||
})
|
||||
},
|
||||
handleClick(){
|
||||
if(this.formControl) return
|
||||
if(this.form.departmentName){
|
||||
this.orgTableVal=this.form.department
|
||||
this.orgTableValName=this.form.departmentName
|
||||
handleClick() {
|
||||
if (this.formControl) return
|
||||
if (this.form.departmentName) {
|
||||
this.orgTableVal = this.form.department
|
||||
this.orgTableValName = this.form.departmentName
|
||||
}
|
||||
this.visibleOrgTable=true
|
||||
this.visibleOrgTable = true
|
||||
},
|
||||
isTreeOk(checkedList){
|
||||
isTreeOk(checkedList) {
|
||||
|
||||
const parts = []
|
||||
const partsName = []
|
||||
@@ -305,28 +315,28 @@ export default {
|
||||
|
||||
},
|
||||
delFile() {
|
||||
if(this.formControl) return
|
||||
this.fileList=[]
|
||||
if (this.formControl) return
|
||||
this.fileList = []
|
||||
this.form.fileName = '';
|
||||
this.form.fileId = '';
|
||||
},
|
||||
reportLevel(item){
|
||||
let imList=['普通商密','核心商密']
|
||||
reportLevel(item) {
|
||||
let imList = ['普通商密', '核心商密']
|
||||
|
||||
if( imList.indexOf(this.form.confidentialLevel)>-1){
|
||||
let currentDate=new Date()
|
||||
let futureDate
|
||||
if(item=='普通商密')
|
||||
futureDate= new Date(currentDate.getFullYear() + 5, currentDate.getMonth(), currentDate.getDate());
|
||||
if (imList.indexOf(this.form.confidentialLevel) > -1) {
|
||||
let currentDate = new Date()
|
||||
let futureDate
|
||||
if (item == '普通商密')
|
||||
futureDate = new Date(currentDate.getFullYear() + 5, currentDate.getMonth(), currentDate.getDate());
|
||||
else
|
||||
futureDate = new Date(currentDate.getFullYear() + 10, currentDate.getMonth(), currentDate.getDate());
|
||||
futureDate = new Date(currentDate.getFullYear() + 10, currentDate.getMonth(), currentDate.getDate());
|
||||
|
||||
this.isShowTime=true
|
||||
this.form.secrecyLast = futureDate
|
||||
}else{
|
||||
this.isShowTime=false
|
||||
this.form.secrecyLast = ''
|
||||
}
|
||||
this.isShowTime = true
|
||||
this.form.secrecyLast = futureDate
|
||||
} else {
|
||||
this.isShowTime = false
|
||||
this.form.secrecyLast = ''
|
||||
}
|
||||
},
|
||||
loadMore() {
|
||||
this.q.pageNo++
|
||||
@@ -525,33 +535,40 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.uploadBtn {
|
||||
vertical-align: super;
|
||||
}
|
||||
.uploadFile{
|
||||
|
||||
.uploadFile {
|
||||
margin-left: -35px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
display: inline-block;
|
||||
span{
|
||||
|
||||
.juli {
|
||||
display: inline-block;
|
||||
color:#555;
|
||||
color: #555;
|
||||
max-width: 200px;
|
||||
font-size: 15px;
|
||||
word-break: keep-all;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.iconstyle{
|
||||
margin-left: 5px;
|
||||
font-size: 25px;
|
||||
vertical-align: center;
|
||||
line-height: 40px;
|
||||
color: #555;
|
||||
|
||||
svg {
|
||||
margin-left: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.fontColor{
|
||||
|
||||
.svg-icon {
|
||||
vertical-align: super;
|
||||
}
|
||||
|
||||
.fontColor {
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user