修改看板\

标签管理和标签内容管理中新增字段或配置字典时,禁止输入逗号
This commit is contained in:
qq787203167
2022-06-16 12:04:06 +08:00
parent 314311275d
commit b940ae67c5
6 changed files with 759 additions and 700 deletions
+3 -2
View File
@@ -554,8 +554,8 @@ module.exports = {
newNode: 'New node', newNode: 'New node',
modifyNode: 'Modify Node', modifyNode: 'Modify Node',
deleteNode: 'Delete Node', deleteNode: 'Delete Node',
ImplementationDate: 'New Type Execute Date', ImplementationDate: 'New Type Execution Date',
vehicleInProductionDate: 'New Vehicle Execute Date', vehicleInProductionDate: 'New Vehicle Execution Date',
deleteNodes: 'If there are child nodes under this node, they will be deleted synchronously. Are you sure to delete this data?', deleteNodes: 'If there are child nodes under this node, they will be deleted synchronously. Are you sure to delete this data?',
leastTwo: 'Please Select at Least two pieces of data', leastTwo: 'Please Select at Least two pieces of data',
mergeTerms: 'Determine Merger Terms', mergeTerms: 'Determine Merger Terms',
@@ -937,5 +937,6 @@ module.exports = {
documentLibraryDetails: 'Document library details', documentLibraryDetails: 'Document library details',
question:'Question', question:'Question',
ConfirmQuestion:'Confirm Question', ConfirmQuestion:'Confirm Question',
disableInput:'Disable input',
OnlyOrTaskconfirmationOut:'Only when the list confirmation status or task confirmation status is to be confirmed can the reminder be carried out', OnlyOrTaskconfirmationOut:'Only when the list confirmation status or task confirmation status is to be confirmed can the reminder be carried out',
} }
+1
View File
@@ -943,4 +943,5 @@ module.exports = {
question: '催办', question: '催办',
ConfirmQuestion: '确认催办?', ConfirmQuestion: '确认催办?',
OnlyOrTaskconfirmationOut:'只有清单确认状态或任务确认状态为待确认时才可以进行催办', OnlyOrTaskconfirmationOut:'只有清单确认状态或任务确认状态为待确认时才可以进行催办',
disableInput:'禁止输入',
} }
@@ -1,73 +1,80 @@
<template> <template>
<div class="dic-list"> <div class="dic-list">
<div class="dic-list-content"> <div class="dic-list-content">
<div class="dic-list-header"> <div class="dic-list-header">
<a-form :model="queryParams" :label-col="labelCol" :wrapper-col="wrapperCol"> <a-form :model="queryParams" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item :label="$t('name')+':'"> <a-form-item :label="$t('name')+':'">
<a-input v-if="dictVal=='tree'" v-model="queryParams.name" :placeholder="$t('enterName')" /> <a-input v-if="dictVal=='tree'" v-model="queryParams.name" :placeholder="$t('enterName')"/>
<j-input v-if="dictVal=='list'" v-model="queryParams.itemText" :placeholder="$t('enterName')" /> <j-input v-if="dictVal=='list'" v-model="queryParams.itemText" :placeholder="$t('enterName')"/>
</a-form-item> </a-form-item>
</a-form> </a-form>
<div class="form-btn"> <div class="form-btn">
<a-button class="form-btn-search" type="primary" @click="search">{{$t('query')}}</a-button> <a-button class="form-btn-search" type="primary" @click="search">{{$t('query')}}</a-button>
<a-button class="form-btn-reset" @click="reset">{{$t('reset')}}</a-button> <a-button class="form-btn-reset" @click="reset">{{$t('reset')}}</a-button>
</div>
</div> </div>
<div class="table-operator">
<div class="operator-text" @click="dicAdd">
<a-icon type="plus" />
{{$t('add')}}
</div>
<div class="operator-text" @click="batDelete" v-has="dictVal=='list'?'dictItem:logicDeleteBatch':'sys:category:logicDeleteBatch'">
<a-icon type="delete" />
{{$t('BatchDelete')}}
</div>
</div>
<div class="dic-list-table">
<list-table v-if="dictVal=='list'&&dataFlag" :tableData="tableData" @editDict="editDict" @deleteDict="deleteDict" :total="total" :queryParams="queryParams" @selected="selectedKeys" @ok="ok"></list-table>
<tree-table v-if="dictVal=='tree'&&dataFlag" :tabletreeData="tabletreeData" :record="record" :queryParams="queryParams" @editDict="editTreeDict" @selectedKeys="selectedKeys" @ok="ok" :total="total" :isPagination="false"></tree-table>
</div>
<a-modal class="dict-module" v-model="newVisible" :title="title" :ok-text="$t('preservation')" :cancel-text="$t('cancel')" @ok="hideModal" @cancel="cancelModel" v-if="newVisible">
<a-form-model
v-if="newVisible"
class="dic-form-module"
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item :label="$t('name')" prop="itemText" v-if="dictVal=='list'">
<a-input v-model.trim="form.itemText" :placeholder="$t('enterName')" />
</a-form-model-item>
<a-form-model-item :label="$t('name')" prop="name" v-if="dictVal=='tree'">
<a-input v-model.trim="form.name" :placeholder="$t('enterName')" />
</a-form-model-item>
<!-- <a-form-model-item :label="$t('DataValue')" prop="itemValue">-->
<!-- <a-input v-model="form.itemValue" :placeholder="$t('enterDataValue')" />-->
<!-- </a-form-model-item>-->
<a-form-model-item :label="$t('enName')" prop="enName">
<a-input v-model.trim="form.enName" :placeholder="$t('PleaseEnterYourEnglishName')" />
</a-form-model-item>
<a-form-model-item :label="$t('ParentName')" prop="pid" v-if="parentVisible">
<a-select v-model="form.pid" @change="handleChange" :placeholder="$t('pleaseSelect')" allowClear>
<a-select-option :value="item.id" v-for="(item, index) in parentDataPid" :key="item.id">
{{item.name}}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item :label="$t('DisplayOrder')" prop="sortOrder">
<a-input-number v-model="form.sortOrder" :placeholder="$t('PleaseEnterDisplayOrder')" style="width: 100%" :min="1" :max="99999" :formatter="limitNumber" :parser="limitNumber" />
</a-form-model-item>
<a-form-model-item :label="$t('describe')" prop="description">
<a-input v-model.trim="form.description" :placeholder="$t('PleaseEnterDescription')" />
</a-form-model-item>
</a-form-model>
</a-modal>
</div> </div>
<div class="table-operator">
<div class="operator-text" @click="dicAdd">
<a-icon type="plus"/>
{{$t('add')}}
</div>
<div class="operator-text" @click="batDelete"
v-has="dictVal=='list'?'dictItem:logicDeleteBatch':'sys:category:logicDeleteBatch'">
<a-icon type="delete"/>
{{$t('BatchDelete')}}
</div>
</div>
<div class="dic-list-table">
<list-table v-if="dictVal=='list'&&dataFlag" :tableData="tableData" @editDict="editDict"
@deleteDict="deleteDict" :total="total" :queryParams="queryParams" @selected="selectedKeys"
@ok="ok"></list-table>
<tree-table v-if="dictVal=='tree'&&dataFlag" :tabletreeData="tabletreeData" :record="record"
:queryParams="queryParams" @editDict="editTreeDict" @selectedKeys="selectedKeys" @ok="ok"
:total="total" :isPagination="false"></tree-table>
</div>
<a-modal class="dict-module" v-model="newVisible" :title="title" :ok-text="$t('preservation')"
:cancel-text="$t('cancel')" @ok="hideModal" @cancel="cancelModel" v-if="newVisible">
<a-form-model
v-if="newVisible"
class="dic-form-module"
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item :label="$t('name')" prop="itemText" v-if="dictVal=='list'">
<a-input v-model.trim="form.itemText" :placeholder="$t('enterName')"/>
</a-form-model-item>
<a-form-model-item :label="$t('name')" prop="name" v-if="dictVal=='tree'">
<a-input v-model.trim="form.name" :placeholder="$t('enterName')"/>
</a-form-model-item>
<!-- <a-form-model-item :label="$t('DataValue')" prop="itemValue">-->
<!-- <a-input v-model="form.itemValue" :placeholder="$t('enterDataValue')" />-->
<!-- </a-form-model-item>-->
<a-form-model-item :label="$t('enName')" prop="enName">
<a-input v-model.trim="form.enName" :placeholder="$t('PleaseEnterYourEnglishName')"/>
</a-form-model-item>
<a-form-model-item :label="$t('ParentName')" prop="pid" v-if="parentVisible">
<a-select v-model="form.pid" @change="handleChange" :placeholder="$t('pleaseSelect')" allowClear>
<a-select-option :value="item.id" v-for="(item, index) in parentDataPid" :key="item.id">
{{item.name}}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item :label="$t('DisplayOrder')" prop="sortOrder">
<a-input-number v-model="form.sortOrder" :placeholder="$t('PleaseEnterDisplayOrder')" style="width: 100%"
:min="1" :max="99999" :formatter="limitNumber" :parser="limitNumber"/>
</a-form-model-item>
<a-form-model-item :label="$t('describe')" prop="description">
<a-input v-model.trim="form.description" :placeholder="$t('PleaseEnterDescription')"/>
</a-form-model-item>
</a-form-model>
</a-modal>
</div> </div>
</div>
</template> </template>
<script> <script>
@@ -76,67 +83,71 @@
import ListTable from './ListTable' import ListTable from './ListTable'
import TreeTable from './TreeTable' import TreeTable from './TreeTable'
import Vue from 'vue' import Vue from 'vue'
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types" import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
export default { export default {
name: 'dicList', name: 'dicList',
components:{ components: {
ListTable, ListTable,
TreeTable TreeTable
}, },
props:{ props: {
dictVal:String, dictVal: String,
record:Object record: Object
}, },
data(){ data() {
return{ return {
selected:[], selected: [],
title:this.$t('add'), title: this.$t('add'),
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
queryParams:{ queryParams: {
pageNo:1, pageNo: 1,
pageSize:10 pageSize: 10
},//查询条件 },//查询条件
form:{}, form: {},
newVisible:false, newVisible: false,
rules:{ rules: {
name:[ name: [
{ required: true, message: this.$t('enterName'), trigger: 'blur' }, { required: true, message: this.$t('enterName'), trigger: 'blur' },
{ min:1, max: 100, message: this.$t('cantExeed')+'100'+this.$t('characters'), trigger: 'blur' }, { min: 1, max: 100, message: this.$t('cantExeed') + '100' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
itemText: [
{ required: true, message: this.$t('enterName'), trigger: 'blur' },
{ min: 1, max: 100, message: this.$t('cantExeed') + '100' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
], ],
itemText:[
{ required: true, message: this.$t('enterName'), trigger: 'blur' },
{ min:1, max: 100, message: this.$t('cantExeed')+'100'+this.$t('characters'), trigger: 'blur' },
],
sortOrder: [ sortOrder: [
{ required: true, message: this.$t('PleaseEnterDisplayOrder'),trigger: 'blur'}, { required: true, message: this.$t('PleaseEnterDisplayOrder'), trigger: 'blur' }
], ],
// itemValue:[ // itemValue:[
// { required: true, message: this.$t('enterDataValue'), trigger: 'blur' }, // { required: true, message: this.$t('enterDataValue'), trigger: 'blur' },
// { min:1, max: 30, message: this.$t('cantExeed')+'30'+this.$t('characters'), trigger: 'blur' }, // { min:1, max: 30, message: this.$t('cantExeed')+'30'+this.$t('characters'), trigger: 'blur' },
// ], // ],
enName:[ enName: [
{ required: true, message: this.$t('PleaseEnterYourEnglishName'), trigger: 'blur' }, { required: true, message: this.$t('PleaseEnterYourEnglishName'), trigger: 'blur' },
{ min:1, max: 100, message: this.$t('cantExeed')+'100'+this.$t('characters'), trigger: 'blur' }, { min: 1, max: 100, message: this.$t('cantExeed') + '100' + this.$t('characters'), trigger: 'blur' },
], { validator: this.test }
description:[ ],
description: [
// { required: true, message: this.$t('PleaseEnterDescription'), trigger: 'blur' }, // { required: true, message: this.$t('PleaseEnterDescription'), trigger: 'blur' },
{ min:1, max: 200, message: this.$t('cantExeed')+'200'+this.$t('characters'), trigger: 'blur' }, { min: 1, max: 200, message: this.$t('cantExeed') + '200' + this.$t('characters'), trigger: 'blur' }
] ]
}, },
tableData:[], tableData: [],
tabletreeData:[], tabletreeData: [],
parentName:undefined, parentName: undefined,
treeData:[], treeData: [],
parentVisible:false, parentVisible: false,
dataFlag:false, dataFlag: false,
total:0, total: 0,
isEdit:false, isEdit: false,
selectedIds:[], //树形选中的id selectedIds: [], //树形选中的id
parentData:[], parentData: [],
editPId:'', editPId: '',
tabletreeDataSource:[], tabletreeDataSource: [],
flag:false, //提交表单标识 flag: false, //提交表单标识
parentDataPid: [] parentDataPid: []
} }
}, },
@@ -144,60 +155,68 @@
parentName(value) { parentName(value) {
// console.log(value); // console.log(value);
}, },
editPId(){ editPId() {
this.parentData=this.getParents this.parentData = this.getParents
}, }
}, },
mounted() { mounted() {
this.loadData() this.loadData()
}, },
computed:{ computed: {
//获取父级名称 //获取父级名称
getParents(){ getParents() {
let parents=[] let parents = []
if(this.tabletreeDataSource&&this.tabletreeDataSource.length>0){ if (this.tabletreeDataSource && this.tabletreeDataSource.length > 0) {
this.tabletreeDataSource.forEach((item)=>{ this.tabletreeDataSource.forEach((item) => {
if(item.pid=='0'&&item.id!=this.editPId){ if (item.pid == '0' && item.id != this.editPId) {
parents.push(item) parents.push(item)
}
})
}
return parents
},
},
methods:{
//获取列表数据
loadData(){
this.dataFlag=false
if(this.dictVal=='list'){
let params={
...this.queryParams,
dictId:this.record.id
}
getAction(`sys/dictItem/page`,params).then(res=>{
if(res.success){
this.total=res.result.total
this.tableData=[...res.result.records]
this.dataFlag=true
} }
}) })
}else if(this.dictVal=='tree'){ }
return parents
}
},
methods: {
test(rule, value, callback) {
var money = /[,]|[,]/g
if (money.test(value)) {
callback(new Error(this.$t('disableInput') + ','))
} else {
callback()
}
},
//获取列表数据
loadData() {
this.dataFlag = false
if (this.dictVal == 'list') {
let params = {
...this.queryParams,
dictId: this.record.id
}
getAction(`sys/dictItem/page`, params).then(res => {
if (res.success) {
this.total = res.result.total
this.tableData = [...res.result.records]
this.dataFlag = true
}
})
} else if (this.dictVal == 'tree') {
//sys/category/queryBySysDictId //sys/category/queryBySysDictId
// sys/category/queryPageList // sys/category/queryPageList
postAction(`sys/category/queryPageList`,{ postAction(`sys/category/queryPageList`, {
...this.queryParams, ...this.queryParams,
// name:this.queryParams.itemText, // name:this.queryParams.itemText,
sysDictId:this.record.id, sysDictId: this.record.id,
isTagDict:1 isTagDict: 1
}).then(res=>{ }).then(res => {
this.tabletreeDataSource=[...res.result.records] this.tabletreeDataSource = [...res.result.records]
this.total=res.result.total this.total = res.result.total
let data = this.toTree(this.tabletreeDataSource) let data = this.toTree(this.tabletreeDataSource)
this.tabletreeData=data this.tabletreeData = data
this.parentData=this.getParents this.parentData = this.getParents
this.dataFlag=true this.dataFlag = true
}) })
} }
}, },
@@ -214,150 +233,150 @@
//将数据拼成树形结构 //将数据拼成树形结构
toTree(config) { toTree(config) {
config.forEach(function(item) { config.forEach(function(item) {
delete item.children; delete item.children
}); })
// 将数据存储为 以 id 为 KEY 的 map 索引数据列 // 将数据存储为 以 id 为 KEY 的 map 索引数据列
let map = {}; let map = {}
config.forEach((item) => { config.forEach((item) => {
// 树 的label // 树 的label
item.label = item.name; item.label = item.name
item.key=item.id; item.key = item.id
map[item.id] = item; map[item.id] = item
}); })
let val = []; let val = []
config.forEach((item) => { config.forEach((item) => {
// 以当前遍历项,的pid,去map对象中找到索引的id // 以当前遍历项,的pid,去map对象中找到索引的id
let parent = map[item.pid]; let parent = map[item.pid]
// 如果找到索引,那么说明此项不在顶级当中,那么需要把此项添加到,他对应的父级中 // 如果找到索引,那么说明此项不在顶级当中,那么需要把此项添加到,他对应的父级中
if (parent) { if (parent) {
(parent.children || (parent.children = [])).push(item); (parent.children || (parent.children = [])).push(item)
} else { } else {
//如果没有在map中找到对应的索引ID,那么直接把 当前的item添加到 val结果集中,作为顶级 //如果没有在map中找到对应的索引ID,那么直接把 当前的item添加到 val结果集中,作为顶级
val.push(item); val.push(item)
} }
}); })
return val; return val
}, },
//搜索 //搜索
search(){ search() {
this.queryParams.pageNo=1 this.queryParams.pageNo = 1
this.loadData() this.loadData()
}, },
//重置 //重置
reset(){ reset() {
this.queryParams={ this.queryParams = {
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
} }
this.loadData() this.loadData()
}, },
//新增 //新增
dicAdd(){ dicAdd() {
this.title=this.$t('add') this.title = this.$t('add')
this.isEdit=false this.isEdit = false
this.newVisible=true; this.newVisible = true
this.form={} this.form = {}
if(this.dictVal=='list'){ if (this.dictVal == 'list') {
this.parentVisible=false this.parentVisible = false
}else if(this.dictVal='tree'){ } else if (this.dictVal = 'tree') {
this.parentVisible=true this.parentVisible = true
this.editPId='' this.editPId = ''
// //
this.getAllTree() this.getAllTree()
} }
}, },
getAllTree() { getAllTree() {
getAction(`sys/category/queryPid`,{ getAction(`sys/category/queryPid`, {
sysDictId:this.record.id, sysDictId: this.record.id,
isTagDict:1 isTagDict: 1
}).then(res=>{ }).then(res => {
this.parentDataPid = res.result this.parentDataPid = res.result
}) })
}, },
//保存 //保存
hideModal(){ hideModal() {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
if(!this.flag) { if (!this.flag) {
this.flag = true this.flag = true
if (this.dictVal == 'list') { if (this.dictVal == 'list') {
let params = { let params = {
...this.form, ...this.form,
dictId: this.record.id, dictId: this.record.id,
isTagDict: 1 isTagDict: 1
} }
if (this.isEdit) { if (this.isEdit) {
putAction(`sys/dictItem/edit`, params).then(res => { putAction(`sys/dictItem/edit`, params).then(res => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.reFresh() this.reFresh()
this.form = {} this.form = {}
this.loadData() this.loadData()
this.newVisible = false this.newVisible = false
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(()=>{ }).finally(() => {
this.flag=false this.flag = false
}) })
} else { } else {
postAction(`sys/dictItem/add`, params).then(res => { postAction(`sys/dictItem/add`, params).then(res => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.reFresh() this.reFresh()
this.form = {} this.form = {}
this.loadData() this.loadData()
this.newVisible = false this.newVisible = false
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(()=>{ }).finally(() => {
this.flag=false this.flag = false
}) })
} }
} else if (this.dictVal == 'tree') { } else if (this.dictVal == 'tree') {
let params = { let params = {
...this.form, ...this.form,
sysDictId: this.record.id sysDictId: this.record.id
} }
if (this.isEdit) { if (this.isEdit) {
putAction(`sys/category/edit`, params).then(res => { putAction(`sys/category/edit`, params).then(res => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.form = {} this.form = {}
this.loadData() this.loadData()
this.newVisible = false this.newVisible = false
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}).finally(()=>{ }).finally(() => {
this.flag=false this.flag = false
}) })
} else { } else {
//新增 //新增
postAction(`sys/category/add`, params).then(res => { postAction(`sys/category/add`, params).then(res => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.form = {} this.form = {}
this.loadData() this.loadData()
this.newVisible = false this.newVisible = false
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(()=>{ }).finally(() => {
this.flag=false this.flag = false
}) })
}
} }
} }
}
} }
}) })
}, },
//刷新缓存 //刷新缓存
reFresh(){ reFresh() {
getAction('sys/dict/refleshCache').then((res) => { getAction('sys/dict/refleshCache').then((res) => {
if (res.success) { if (res.success) {
//重新加载缓存 //重新加载缓存
@@ -373,34 +392,34 @@
}) })
}, },
//取消 //取消
cancelModel(){ cancelModel() {
this.newVisible=false; this.newVisible = false
}, },
//列表编辑 //列表编辑
editDict(rec,val){ editDict(rec, val) {
this.title=this.$t('edit') this.title = this.$t('edit')
this.isEdit=true this.isEdit = true
this.form={...rec} this.form = { ...rec }
this.newVisible=val this.newVisible = val
this.parentVisible=false this.parentVisible = false
}, },
//树状编辑 //树状编辑
editTreeDict(val,form){ editTreeDict(val, form) {
this.title=this.$t('edit') this.title = this.$t('edit')
this.editPId=form.id this.editPId = form.id
// console.log('dictId',form) // console.log('dictId',form)
this.isEdit=true this.isEdit = true
this.form={...form} this.form = { ...form }
if(form.pid=='0'){ if (form.pid == '0') {
this.form.pid='' this.form.pid = ''
} }
this.newVisible=val this.newVisible = val
this.parentVisible=true this.parentVisible = true
}, },
//列表删除 //列表删除
deleteDict(val){ deleteDict(val) {
let params={ let params = {
id:val id: val
} }
this.$confirm({ this.$confirm({
@@ -408,83 +427,83 @@
content: '', content: '',
onOk: onOk:
async () => { async () => {
//sys/dictItem/logicDelete //sys/dictItem/logicDelete
// sys/dictItem/delete // sys/dictItem/delete
getAction(`sys/dictItem/logicDelete`, params).then(res => { getAction(`sys/dictItem/logicDelete`, params).then(res => {
if(res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')); this.$message.success(this.$t('OperationSuccessful'))
this.reFresh() this.reFresh()
if(this.tableData&&this.tableData.length==1&&this.queryParams.pageNo!=1){ if (this.tableData && this.tableData.length == 1 && this.queryParams.pageNo != 1) {
this.queryParams.pageNo=this.queryParams.pageNo-1 this.queryParams.pageNo = this.queryParams.pageNo - 1
} }
this.loadData() this.loadData()
}else{ } else {
this.$message.warning(res.message); this.$message.warning(res.message)
} }
}) })
} }
}) })
}, },
handleChange(){ handleChange() {
}, },
//树形选中行 //树形选中行
selectedKeys(val){ selectedKeys(val) {
this.selectedIds=val this.selectedIds = val
// console.log('seleVal',val) // console.log('seleVal',val)
}, },
//批量删除 //批量删除
batDelete(){ batDelete() {
let params={ let params = {
ids:this.selectedIds.join(',') ids: this.selectedIds.join(',')
} }
if(this.selectedIds && this.selectedIds.length>0){ if (this.selectedIds && this.selectedIds.length > 0) {
this.$confirm({ this.$confirm({
title: this.$t('ConfirmDelete'), title: this.$t('ConfirmDelete'),
content: '', content: '',
onOk: onOk:
async () => { async () => {
if(this.dictVal=='list'){ if (this.dictVal == 'list') {
// sys/dictItem/logicDeleteBatch // sys/dictItem/logicDeleteBatch
getAction(`sys/dictItem/logicDeleteBatch`, params).then(res => { getAction(`sys/dictItem/logicDeleteBatch`, params).then(res => {
if(res.success){ if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.reFresh() this.reFresh()
if(this.selectedIds.length==this.tableData.length&&this.queryParams.pageNo!=1){ if (this.selectedIds.length == this.tableData.length && this.queryParams.pageNo != 1) {
this.queryParams.pageNo=this.queryParams.pageNo-1 this.queryParams.pageNo = this.queryParams.pageNo - 1
} }
this.loadData() this.loadData()
}else{ } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}) })
}else if(this.dictVal=='tree'){ } else if (this.dictVal == 'tree') {
// sys/category/deleteBatch // sys/category/deleteBatch
// sys/category/logicDeleteBatch // sys/category/logicDeleteBatch
getAction(`sys/category/logicDeleteBatch`, params).then(res => { getAction(`sys/category/logicDeleteBatch`, params).then(res => {
if(res.success){ if (res.success) {
if(this.selectedIds.length==this.tableData.length&&this.queryParams.pageNo!=1){ if (this.selectedIds.length == this.tableData.length && this.queryParams.pageNo != 1) {
this.queryParams.pageNo=this.queryParams.pageNo-1 this.queryParams.pageNo = this.queryParams.pageNo - 1
} }
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.loadData() this.loadData()
}else{ } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}) })
} }
} }
}) })
}else{ } else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
} }
}, },
ok(val){ ok(val) {
this.queryParams.pageNo=val.pageNo this.queryParams.pageNo = val.pageNo
this.queryParams.pageSize=val.pageSize this.queryParams.pageSize = val.pageSize
this.loadData() this.loadData()
} }
} }
@@ -493,41 +512,47 @@
<style lang="less" scoped> <style lang="less" scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.dic-list{
.dic-list-content{ .dic-list {
.dic-list-header{ .dic-list-content {
.dic-list-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.form-btn{
.form-btn-search{ .form-btn {
.form-btn-search {
margin-right: 10px; margin-right: 10px;
} }
} }
} }
.dic-list-module{
.dic-list-module {
margin-bottom: 20px; margin-bottom: 20px;
} }
.dic-list-table{
.dic-list-table {
margin-top: 20px; margin-top: 20px;
} }
} }
} }
.dict-module{
.ant-modal-footer{ .dict-module {
align:center; .ant-modal-footer {
} align: center;
}
</style>
<style lang="less">
.dict-module{
.ant-modal-footer{
text-align:center;
} }
} }
.dic-list{ </style>
.dic-list-content{ <style lang="less">
.table-operator{ .dict-module {
.ant-modal-footer {
text-align: center;
}
}
.dic-list {
.dic-list-content {
.table-operator {
text-align: right; text-align: right;
} }
} }
@@ -13,12 +13,12 @@
> >
<a-row> <a-row>
<p class="tag-info">{{$t('essentialInformation')}}</p> <p class="tag-info">{{$t('essentialInformation')}}</p>
<a-divider dashed /> <a-divider dashed/>
<!-- 所属模块--> <!-- 所属模块-->
<a-col :span="24" v-if="submitKey == 1"> <a-col :span="24" v-if="submitKey == 1">
<a-form-model-item :label="$t('Module')" prop="isModel"> <a-form-model-item :label="$t('Module')" prop="isModel">
<a-select :placeholder="$t('PleaseSelectModule')" v-model="form.isModel"> <a-select :placeholder="$t('PleaseSelectModule')" v-model="form.isModel">
<a-select-option :key="'1'" :value="'1'" > <a-select-option :key="'1'" :value="'1'">
{{$t('DocumentLibrary')}} {{$t('DocumentLibrary')}}
</a-select-option> </a-select-option>
</a-select> </a-select>
@@ -36,19 +36,22 @@
<!-- 属性名称--> <!-- 属性名称-->
<a-col :span="24"> <a-col :span="24">
<a-form-model-item :label="$t('AttributeName')" prop="dbFieldTxt"> <a-form-model-item :label="$t('AttributeName')" prop="dbFieldTxt">
<a-input v-model="form.dbFieldTxt" :placeholder="$t('PleaseEnterPropertyName')" :maxLength="120" ></a-input> <a-input v-model="form.dbFieldTxt" :placeholder="$t('PleaseEnterPropertyName')"
:maxLength="120"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<!-- 英文名称--> <!-- 英文名称-->
<a-col :span="24"> <a-col :span="24">
<a-form-model-item :label="$t('enName')" prop="dbFieldEnName"> <a-form-model-item :label="$t('enName')" prop="dbFieldEnName">
<a-input v-model="form.dbFieldEnName" :placeholder="$t('PleaseEnterYourEnglishName')" :maxLength="120" ></a-input> <a-input v-model="form.dbFieldEnName" :placeholder="$t('PleaseEnterYourEnglishName')"
:maxLength="120"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<!-- 属性类型--> <!-- 属性类型-->
<a-col :span="24"> <a-col :span="24">
<a-form-model-item :label="$t('AttributeType')" prop="fieldShowType" > <a-form-model-item :label="$t('AttributeType')" prop="fieldShowType">
<j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="field_show_type" :placeholder="$t('PleaseSelectAttributeType')" :disabled="disabledEdit" /> <j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="field_show_type"
:placeholder="$t('PleaseSelectAttributeType')" :disabled="disabledEdit"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24" v-if="isTagContent"> <a-col :span="24" v-if="isTagContent">
@@ -65,30 +68,33 @@
</a-col> </a-col>
<a-col :span="24" v-if="isLength"> <a-col :span="24" v-if="isLength">
<a-form-model-item :label="$t('FieldLength')" prop="dbLength"> <a-form-model-item :label="$t('FieldLength')" prop="dbLength">
<a-input-number v-model="form.dbLength" :min="1" :max="200" :placeholder="$t('PleaseEnterFieldLength')" style="width: 100%" :formatter="limitNumber" :parser="limitNumber" /> <a-input-number v-model="form.dbLength" :min="1" :max="200" :placeholder="$t('PleaseEnterFieldLength')"
style="width: 100%" :formatter="limitNumber" :parser="limitNumber"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item :label="$t('DisplayOrder')" prop="orderNum"> <a-form-model-item :label="$t('DisplayOrder')" prop="orderNum">
<a-input-number v-model="form.orderNum" :placeholder="$t('PleaseEnterDisplayOrder')" style="width: 100%" :min="1" :max="99999" :formatter="limitNumber" :parser="limitNumber" /> <a-input-number v-model="form.orderNum" :placeholder="$t('PleaseEnterDisplayOrder')" style="width: 100%"
:min="1" :max="99999" :formatter="limitNumber" :parser="limitNumber"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item :label="$t('Required')" prop="fieldMustInput"> <a-form-model-item :label="$t('Required')" prop="fieldMustInput">
<j-dict-select-tag type="list" v-model="form.fieldMustInput" dictCode="yn" :placeholder="$t('selectWhetherRequired')" /> <j-dict-select-tag type="list" v-model="form.fieldMustInput" dictCode="yn"
:placeholder="$t('selectWhetherRequired')"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<p class="tag-info">{{submitKey == 1?$t('DocumentLibraryModuleDisplay'):$t('documentSplitDisplay')}}</p> <p class="tag-info">{{submitKey == 1?$t('DocumentLibraryModuleDisplay'):$t('documentSplitDisplay')}}</p>
<a-divider dashed /> <a-divider dashed/>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item :label="$t('DocumentLibraryListDisplay')" prop="isShowList" v-if="submitKey == 1"> <a-form-model-item :label="$t('DocumentLibraryListDisplay')" prop="isShowList" v-if="submitKey == 1">
<j-dict-select-tag type="list" v-model="form.isShowList" dictCode="yn" <j-dict-select-tag type="list" v-model="form.isShowList" dictCode="yn"
:placeholder="$t('selectDisplayList')" /> :placeholder="$t('selectDisplayList')"/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item :label="$t('documentSplitList')" prop="isShowList" v-if="submitKey == 2"> <a-form-model-item :label="$t('documentSplitList')" prop="isShowList" v-if="submitKey == 2">
<j-dict-select-tag type="list" v-model="form.isShowList" dictCode="yn" <j-dict-select-tag type="list" v-model="form.isShowList" dictCode="yn"
:placeholder="$t('selectDisplayList')" /> :placeholder="$t('selectDisplayList')"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24" v-if="submitKey == 1"> <a-col :span="24" v-if="submitKey == 1">
@@ -103,20 +109,23 @@
</a-col> </a-col>
<a-col :span="24" v-if="isSearch"> <a-col :span="24" v-if="isSearch">
<a-form-model-item :label="$t('Search')" prop="isQuery"> <a-form-model-item :label="$t('Search')" prop="isQuery">
<j-dict-select-tag type="list" v-model="form.isQuery" dictCode="yn" :placeholder="$t('SelectWhetherToSearch')" /> <j-dict-select-tag type="list" v-model="form.isQuery" dictCode="yn"
:placeholder="$t('SelectWhetherToSearch')"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<p class="tag-info" v-if="submitKey == 1">{{$t('DisplayOtherModules')}}</p> <p class="tag-info" v-if="submitKey == 1">{{$t('DisplayOtherModules')}}</p>
<a-divider dashed v-if="submitKey == 1" /> <a-divider dashed v-if="submitKey == 1"/>
<a-col :span="24" v-if="submitKey == 1"> <a-col :span="24" v-if="submitKey == 1">
<a-form-model-item :label="$t('RegulationsListDisplay')" prop="isShowLawsList"> <a-form-model-item :label="$t('RegulationsListDisplay')" prop="isShowLawsList">
<j-dict-select-tag type="list" v-model="form.isShowLawsList" dictCode="yn" :placeholder="$t('selectDisplayListRegulations')" /> <j-dict-select-tag type="list" v-model="form.isShowLawsList" dictCode="yn"
:placeholder="$t('selectDisplayListRegulations')"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24" v-if="submitKey == 1"> <a-col :span="24" v-if="submitKey == 1">
<a-form-model-item :label="$t('SearchCenterDisplay')" prop="isShowSearch"> <a-form-model-item :label="$t('SearchCenterDisplay')" prop="isShowSearch">
<j-dict-select-tag type="list" v-model="form.isShowSearch" dictCode="yn" :placeholder="$t('selectSearchCenterDisplayed')" /> <j-dict-select-tag type="list" v-model="form.isShowSearch" dictCode="yn"
:placeholder="$t('selectSearchCenterDisplayed')"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<!-- <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">--> <!-- <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">-->
@@ -132,383 +141,394 @@
<script> <script>
import { httpAction, getAction, postAction } from '@/api/manage' import { httpAction, getAction, postAction } from '@/api/manage'
import pick from 'lodash.pick' import pick from 'lodash.pick'
import { validateDuplicateValue } from '@/utils/util' import { validateDuplicateValue } from '@/utils/util'
export default { export default {
name: 'TagForm', name: 'TagForm',
components: { components: {},
}, props: {
props: { //流程表单data
//流程表单data formData: {
formData: { type: Object,
type: Object, default: () => {
default: ()=>{}, },
required: false required: false
},
//表单模式:true流程表单 false普通表单
formBpm: {
type: Boolean,
default: false,
required: false
},
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
},
drawerVisible:{
type: Boolean,
default: false,
},
editData:{
type: Object,
default:{}
},
editId:{
type:String,
default:''
},
submitEdit:{
type:String,
default:''
},
disableEdit:{
type:Boolean,
default:false
},
submitKey:{
type:String,
default:'1'
}
},
data () {
return {
form: {},
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 },
}, },
wrapperCol: { //表单模式:true流程表单 false普通表单
xs: { span: 24 }, formBpm: {
sm: { span: 16 }, type: Boolean,
default: false,
required: false
}, },
confirmLoading: false, //表单禁用
validatorRules: { disabled: {
isModel: [ type: Boolean,
{ required: true, message: this.$t('PleaseSelectModule'),trigger: 'change'}, default: false,
], required: false
dbFieldTxt: [
{ required: true, message: this.$t('PleaseEnterPropertyName'),trigger: 'blur'},
{ min:1, max: 20, message: this.$t('cantExeed')+'20'+this.$t('characters'), trigger: 'blur' },
],
dbFieldName: [
{ required: true, message: this.$t('PleaseEnterYourEnglishName'),trigger: 'blur'},
{ min:1, max: 20, message: this.$t('cantExeed')+'20'+this.$t('characters'), trigger: 'blur' },
],
dbFieldEnName:[
{ required: true, message: this.$t('PleaseEnterYourEnglishName'),trigger: 'change'},
{ max: 50, message: this.$t('cantExeed')+'50'+this.$t('characters'), trigger: 'blur' },
],
fieldShowType: [
{ required: true, message: this.$t('PleaseSelectAttributeType'),trigger: 'change'},
],
dictId: [
{ required: true, message: this.$t('PleaseSelectOptionContent'),trigger: 'change'},
],
dbLength: [
{ required: true, message: this.$t('PleaseEnterFieldLength'),trigger: 'blur'},
],
orderNum: [
{ required: true, message: this.$t('PleaseEnterDisplayOrder'),trigger: 'blur'},
],
fieldMustInput: [
{ required: true, message: this.$t('selectWhetherRequired'),trigger: 'change'},
],
isShowList: [
{ required: true, message: this.$t('selectDisplayList'),trigger: 'change'},
],
showArea: [
{ required: true, message: this.$t('SelectDisplayArea'),trigger: 'change'},
],
isQuery: [
{ required: true, message: this.$t('SelectWhetherToSearch'),trigger: 'change'},
],
isShowLawsList: [
{ required: true, message: this.$t('selectDisplayListRegulations'),trigger: 'change'},
],
isShowSearch: [
{ required: true, message: this.$t('selectSearchCenterDisplayed'),trigger: 'change'},
],
}, },
addVisible:false, drawerVisible: {
url: { type: Boolean,
add: "tag/onlCgformTag/add", default: false
edit: "tag/onlCgformTag/edit",
queryById: "tag/onlCgformTag/queryById"
}, },
//展示区域选项内容 editData: {
areaOptions:[], type: Object,
//选项内容选项 default: {}
contentOption:[], },
contentFlag:3, editId: {
contentOption1:[], type: String,
contentOption2:[], default: ''
isTagContent:false, },
isSearch:true, submitEdit: {
isLength:true, type: String,
flag:false, //表单提交标识 default: ''
disabledEdit:false, },
moduleShow:true disableEdit: {
} type: Boolean,
}, default: false
watch:{ },
'form.fieldShowType'(val){ submitKey: {
// this.contentFlag=val type: String,
if(val==0){ default: '1'
this.contentOption=[...this.contentOption2]
this.isTagContent=true
}else if(val==3||val==4){
this.contentOption=[...this.contentOption1]
this.isTagContent=true
}else{
this.isTagContent=false
}
if(val==7){
this.isSearch=false
this.form.isQuery=0
}else{
this.isSearch=true
}
if(val==1||val==8||val==9||val==10||val==11||val=='sel_user'){
this.isLength=true
}else{
this.isLength=false
} }
}, },
submitEdit(){ data() {
return {
form: {},
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
confirmLoading: false,
validatorRules: {
isModel: [
{ required: true, message: this.$t('PleaseSelectModule'), trigger: 'change' }
],
dbFieldTxt: [
{ required: true, message: this.$t('PleaseEnterPropertyName'), trigger: 'blur' },
{ min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
dbFieldName: [
{ required: true, message: this.$t('PleaseEnterYourEnglishName'), trigger: 'blur' },
{ min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
dbFieldEnName: [
{ required: true, message: this.$t('PleaseEnterYourEnglishName'), trigger: 'change' },
{ max: 50, message: this.$t('cantExeed') + '50' + this.$t('characters'), trigger: 'blur' }
],
fieldShowType: [
{ required: true, message: this.$t('PleaseSelectAttributeType'), trigger: 'change' }
],
dictId: [
{ required: true, message: this.$t('PleaseSelectOptionContent'), trigger: 'change' }
],
dbLength: [
{ required: true, message: this.$t('PleaseEnterFieldLength'), trigger: 'blur' }
],
orderNum: [
{ required: true, message: this.$t('PleaseEnterDisplayOrder'), trigger: 'blur' }
],
fieldMustInput: [
{ required: true, message: this.$t('selectWhetherRequired'), trigger: 'change' }
],
isShowList: [
{ required: true, message: this.$t('selectDisplayList'), trigger: 'change' }
],
showArea: [
{ required: true, message: this.$t('SelectDisplayArea'), trigger: 'change' }
],
isQuery: [
{ required: true, message: this.$t('SelectWhetherToSearch'), trigger: 'change' }
],
isShowLawsList: [
{ required: true, message: this.$t('selectDisplayListRegulations'), trigger: 'change' }
],
isShowSearch: [
{ required: true, message: this.$t('selectSearchCenterDisplayed'), trigger: 'change' }
]
},
addVisible: false,
url: {
add: 'tag/onlCgformTag/add',
edit: 'tag/onlCgformTag/edit',
queryById: 'tag/onlCgformTag/queryById'
},
//展示区域选项内容
areaOptions: [],
//选项内容选项
contentOption: [],
contentFlag: 3,
contentOption1: [],
contentOption2: [],
isTagContent: false,
isSearch: true,
isLength: true,
flag: false, //表单提交标识
disabledEdit: false,
moduleShow: true
}
}, },
disableEdit(){ watch: {
'form.fieldShowType'(val) {
}, // this.contentFlag=val
if (val == 0) {
}, this.contentOption = [...this.contentOption2]
computed: { this.isTagContent = true
changeType(val){ } else if (val == 3 || val == 4) {
// console.log('changtType',val) this.contentOption = [...this.contentOption1]
}, this.isTagContent = true
formDisabled(){ } else {
if(this.formBpm===true){ this.isTagContent = false
if(this.formData.disabled===false){
return false
} }
return true if (val == 7) {
this.isSearch = false
this.form.isQuery = 0
} else {
this.isSearch = true
}
if (val == 1 || val == 8 || val == 9 || val == 10 || val == 11 || val == 'sel_user') {
this.isLength = true
} else {
this.isLength = false
}
},
submitEdit() {
},
disableEdit() {
} }
return this.disabled
}, },
showFlowSubmitButton(){ computed: {
if(this.formBpm===true){ changeType(val) {
if(this.formData.disabled===false){ // console.log('changtType',val)
},
formDisabled() {
if (this.formBpm === true) {
if (this.formData.disabled === false) {
return false
}
return true return true
} }
return this.disabled
},
showFlowSubmitButton() {
if (this.formBpm === true) {
if (this.formData.disabled === false) {
return true
}
}
return false
} }
return false },
} created() {
}, //如果是流程中表单,则需要加载流程表单data
created () { this.showFlowData()
//如果是流程中表单,则需要加载流程表单data },
this.showFlowData(); mounted() {
}, // console.log('disableEdit',this.disableEdit)
mounted() { this.loadContent()
// console.log('disableEdit',this.disableEdit) this.loadShowArea()
this.loadContent() // console.log('edit',this.submitKey)
this.loadShowArea() if (this.submitEdit === 'add') {
// console.log('edit',this.submitKey) if (this.submitKey === '1') {
if(this.submitEdit==='add'){ this.form.isModel = '1'
if(this.submitKey==='1'){ this.moduleShow = true
this.form.isModel='1' } else if (this.submitKey == '2') {
this.moduleShow=true this.form.isModel = '0'
}else if(this.submitKey=='2'){ this.moduleShow = false
this.form.isModel='0' }
this.moduleShow=false this.disabledEdit = false
} } else if (this.submitEdit === 'edit') {
this.disabledEdit=false if (this.submitKey === '1') {
}else if(this.submitEdit==='edit'){ this.form.isModel = '1'
if(this.submitKey==='1'){ this.moduleShow = true
this.form.isModel='1' } else if (this.submitKey == '2') {
this.moduleShow=true this.form.isModel = '0'
}else if(this.submitKey=='2'){ this.moduleShow = false
this.form.isModel='0' }
this.moduleShow=false this.disabledEdit = true
}
this.disabledEdit=true
} }
this.form={...this.editData} this.form = { ...this.editData }
// console.log('this.form.isModel',this.form.isModel) // console.log('this.form.isModel',this.form.isModel)
}, },
methods: { methods: {
//获取选项内容 test(rule, value, callback) {
loadContent(){ var money = /[,]|[,]/g
let params = {}; if (money.test(value)) {
getAction(`sys/dict/queryDictName`,params).then((res)=>{ callback(new Error(this.$t('disableInput') + ','))
if(res.success){ } else {
let data=[...res.result] callback()
this.contentOption1=[] }
this.contentOption2=[] },
data.map(res=>{ //获取选项内容
if(res.attributeType=='1'){ loadContent() {
this.contentOption1.push(res) let params = {}
}else if(res.attributeType=='2'){ getAction(`sys/dict/queryDictName`, params).then((res) => {
this.contentOption2.push(res) if (res.success) {
let data = [...res.result]
this.contentOption1 = []
this.contentOption2 = []
data.map(res => {
if (res.attributeType == '1') {
this.contentOption1.push(res)
} else if (res.attributeType == '2') {
this.contentOption2.push(res)
}
})
if (this.form.fieldShowType == 0) {
this.contentOption = [...this.contentOption2]
this.isTagContent = true
} else if (this.form.fieldShowType == 3 || this.form.fieldShowType == '4') {
this.contentOption = [...this.contentOption1]
this.isTagContent = true
} else {
this.isTagContent = false
}
}
})
},
//获取展示区域
loadShowArea() {
let params = {}
getAction(`tag/onlCgformArea/queryShowArea`, params).then((res) => {
if (res.success) {
this.areaOptions = res.result
}
})
},
add() {
this.edit({})
},
edit(record) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
// this.form.setFieldsValue(pick(this.model,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowList','showArea','isQuery','isShowLawsList','isShowSearch'))
})
},
//渲染流程表单数据
showFlowData() {
if (this.formBpm === true) {
let params = { id: this.formData.dataId }
getAction(this.url.queryById, params).then((res) => {
if (res.success) {
this.edit(res.result)
} }
}) })
if(this.form.fieldShowType==0){
this.contentOption=[...this.contentOption2]
this.isTagContent=true
}else if(this.form.fieldShowType==3||this.form.fieldShowType=='4'){
this.contentOption=[...this.contentOption1]
this.isTagContent=true
}else{
this.isTagContent=false
}
} }
}); },
}, submitForm() {
//获取展示区域 // const that = this;
loadShowArea(){ // 触发表单验证
let params = {}; this.form.dbFieldTxt = this.form.dbFieldTxt.trim()
getAction(`tag/onlCgformArea/queryShowArea`,params).then((res)=>{ this.form.dbFieldEnName = this.form.dbFieldEnName.trim()
if(res.success){ this.form.dbFieldTxt = this.form.dbFieldTxt.trim()
this.areaOptions=res.result // console.log(this.$refs.tagform)
} this.$refs.tagEditForm.validate((valid) => {
}); // console.log('valid',valid)
}, if (valid) {
add () { if (!this.flag) {
this.edit({}); this.flag = true
this.confirmLoading = true
let httpurl = ''
let method = ''
// console.log('this.editId',this.editId)
if (this.submitEdit == 'add') {
httpurl += this.url.add
method = 'post'
this.form.id = ''
this.form.isReadOnly = 0
} else if (this.submitEdit == 'edit') {
httpurl += this.url.edit
method = 'put'
this.form.id = this.editId
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
// this.form.setFieldsValue(pick(this.model,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowList','showArea','isQuery','isShowLawsList','isShowSearch'))
})
},
//渲染流程表单数据
showFlowData(){
if(this.formBpm === true){
let params = {id:this.formData.dataId};
getAction(this.url.queryById,params).then((res)=>{
if(res.success){
this.edit (res.result);
}
});
}
},
submitForm () {
// const that = this;
// 触发表单验证
this.form.dbFieldTxt = this.form.dbFieldTxt.trim()
this.form.dbFieldEnName = this.form.dbFieldEnName.trim()
this.form.dbFieldTxt = this.form.dbFieldTxt.trim()
// console.log(this.$refs.tagform)
this.$refs.tagEditForm.validate((valid)=>{
// console.log('valid',valid)
if (valid) {
if(!this.flag){
this.flag=true
this.confirmLoading = true;
let httpurl = '';
let method = '';
// console.log('this.editId',this.editId)
if(this.submitEdit=='add'){
httpurl+=this.url.add;
method = 'post';
this.form.id=''
this.form.isReadOnly=0
}else if(this.submitEdit=='edit'){
httpurl+=this.url.edit;
method = 'put';
this.form.id=this.editId
}
this.form.dbIsKey='0'
this.form.dbIsNull='1'
this.form.dbPointLength='0'
this.form.isShowForm='1'
this.form.dbFieldName=this.form.dbFieldTxt
this.contentOption.forEach(item=>{
if(item.id==this.form.dictId){
// console.log('11111')
this.form.dictField=item.dictCode
this.form.dictText=item.dictName
} }
}) this.form.dbIsKey = '0'
// console.log('form',this.form) this.form.dbIsNull = '1'
// console.log('model',this.form.isModel) this.form.dbPointLength = '0'
let onlineId='' this.form.isShowForm = '1'
let url='' this.form.dbFieldName = this.form.dbFieldTxt
if(this.form.isModel=='1'){ this.contentOption.forEach(item => {
onlineId='48308196e7b04761b533dc31bc899707' if (item.id == this.form.dictId) {
}else if(this.form.isModel=='0'){ // console.log('11111')
onlineId='c998a34ea4b84089932197ed0705c757' this.form.dictField = item.dictCode
} this.form.dictText = item.dictName
httpAction(httpurl,this.form,method).then((res)=>{ }
if(res.success){ })
this.$message.success(this.$t('OperationSuccessful')); // console.log('form',this.form)
postAction(`online/cgform/api/doDbSynch/${onlineId}/normal // console.log('model',this.form.isModel)
`,{}).then(res=>{ let onlineId = ''
}) let url = ''
this.$emit('ok',false); if (this.form.isModel == '1') {
}else{ onlineId = '48308196e7b04761b533dc31bc899707'
this.$message.warning(res.message); } else if (this.form.isModel == '0') {
onlineId = 'c998a34ea4b84089932197ed0705c757'
} }
}).finally(() => { httpAction(httpurl, this.form, method).then((res) => {
this.confirmLoading = false; if (res.success) {
this.flag=false this.$message.success(this.$t('OperationSuccessful'))
}) postAction(`online/cgform/api/doDbSynch/${onlineId}/normal
`, {}).then(res => {
})
this.$emit('ok', false)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
this.flag = false
})
}
} }
})
},
popupCallback(row) {
this.form.setFieldsValue(pick(row, 'isModel', 'dbFieldTxt', 'dbFieldName', 'fieldShowType', 'dictName', 'dbLength', 'orderNum', 'fieldMustInput', 'isShowForm', 'areaId', 'isQuery', 'isShowLawsList', 'isShowSearch'))
},
//正则替换小数点
limitNumber(value) {
if (typeof value === 'string') {
return !isNaN(Number(value)) ? value.replace(/\./g, '') : 0
} else if (typeof value === 'number') {
return !isNaN(value) ? String(value).replace(/\./g, '') : 0
} else {
return 0
} }
}) },
}, handleChange(value) {
popupCallback(row){ // console.log(`selected ${value}`);
this.form.setFieldsValue(pick(row,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowForm','areaId','isQuery','isShowLawsList','isShowSearch'))
},
//正则替换小数点
limitNumber(value) {
if (typeof value === 'string') {
return !isNaN(Number(value)) ? value.replace(/\./g, '') : 0
} else if (typeof value === 'number') {
return !isNaN(value) ? String(value).replace(/\./g, '') : 0
} else {
return 0
} }
}, }
handleChange(value) {
// console.log(`selected ${value}`);
},
} }
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.form-tag{ .form-tag {
.tag-content{ .tag-content {
}
}
.tag-info {
margin-left: 30px;
} }
}
.tag-info{
margin-left: 30px;
}
</style> </style>
<style lang="less"> <style lang="less">
.tag-content{ .tag-content {
.ant-select-selection-selected-value{ .ant-select-selection-selected-value {
color:rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
}
} }
}
</style> </style>
@@ -53,7 +53,8 @@
:placeholder="$t('PleaseSelectLabelType')"/> :placeholder="$t('PleaseSelectLabelType')"/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item :label="$t('DisplayOrder')" prop="orderNum" class="tag-item"> <a-form-model-item :label="$t('DisplayOrder')" prop="orderNum" class="tag-item">
<a-input-number v-model="form.orderNum" :placeholder="$t('PleaseEnterDisplayOrder')" style="width: 100%" :min="1" :max="99999" :formatter="limitNumber" :parser="limitNumber" /> <a-input-number v-model="form.orderNum" :placeholder="$t('PleaseEnterDisplayOrder')" style="width: 100%"
:min="1" :max="99999" :formatter="limitNumber" :parser="limitNumber"/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item ref="describe" :label="$t('describe')" prop="description" class="tag-item"> <a-form-model-item ref="describe" :label="$t('describe')" prop="description" class="tag-item">
<a-input <a-input
@@ -174,14 +175,16 @@
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
form: {}, form: {},
rules: { rules: {
dictName: [{ required: true, message: this.$t('PleaseEnterLabelName'), trigger: 'change' }, dictName: [
{ min: 1, max: 100, message: this.$t('cantExeed') + '100' + this.$t('characters'), trigger: 'blur' }], { required: true, message: this.$t('PleaseEnterLabelName'), trigger: 'change' },
{ min: 1, max: 100, message: this.$t('cantExeed') + '100' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
attributeType: [ attributeType: [
{ required: true, message: this.$t('PleaseSelectLabelType'), trigger: 'blur' } { required: true, message: this.$t('PleaseSelectLabelType'), trigger: 'blur' }
], ],
orderNum: [ orderNum: [
{ required: true, message: this.$t('PleaseEnterDisplayOrder'),trigger: 'blur'}, { required: true, message: this.$t('PleaseEnterDisplayOrder'), trigger: 'blur' }
], ],
description: [ description: [
{ min: 1, max: 200, message: this.$t('cantExeed') + '200' + this.$t('characters'), trigger: 'blur' } { min: 1, max: 200, message: this.$t('cantExeed') + '200' + this.$t('characters'), trigger: 'blur' }
@@ -200,6 +203,14 @@
this.loadData() this.loadData()
}, },
methods: { methods: {
test(rule, value, callback) {
var money = /[,]|[,]/g
if (money.test(value)) {
callback(new Error(this.$t('disableInput') + ','))
} else {
callback()
}
},
//正则替换小数点 //正则替换小数点
limitNumber(value) { limitNumber(value) {
if (typeof value === 'string') { if (typeof value === 'string') {
@@ -476,6 +487,7 @@
width: 100%; width: 100%;
} }
} }
.box-title-text { .box-title-text {
line-height: 1.4; line-height: 1.4;
display: flex; display: flex;
@@ -54,7 +54,8 @@
<img v-else-if="val.status == 2" src="../../../../assets/open.svg" <img v-else-if="val.status == 2" src="../../../../assets/open.svg"
class="process-content-left" class="process-content-left"
alt=""> alt="">
<img v-else-if="val.status == 3" src="../../../../assets/inprogress.svg" class="process-content-left" <img v-else-if="val.status == 3" src="../../../../assets/inprogress.svg"
class="process-content-left"
alt=""> alt="">
</a-tooltip> </a-tooltip>
<!-- <div class="process-content-right-button">{{val.time.slice(0,11)}}</div>--> <!-- <div class="process-content-right-button">{{val.time.slice(0,11)}}</div>-->
@@ -228,8 +229,8 @@
} }
contentRightText[0].style = 'display:none' contentRightText[0].style = 'display:none'
contentRightXian[0].style = 'display:none' contentRightXian[0].style = 'display:none'
let clientWidthOne = dataList[0].clientWidth * dataList.length let clientWidthOne = dataList[0].clientWidth
clientWidthOne = clientWidthOne / timeList.length clientWidthOne = clientWidthOne / length
let num = Math.ceil(clientWidthOne / 31) * parseInt(this.handlingTime.slice(8, 10)) let num = Math.ceil(clientWidthOne / 31) * parseInt(this.handlingTime.slice(8, 10))
timeList.forEach((res, index) => { timeList.forEach((res, index) => {
if (res.slice(0, 7) == this.handlingTime.slice(0, 7)) { if (res.slice(0, 7) == this.handlingTime.slice(0, 7)) {
@@ -389,7 +390,6 @@
border-bottom: 1px #EAEAEC solid; border-bottom: 1px #EAEAEC solid;
flex: 1; flex: 1;
height: 36px; height: 36px;
padding-left: 10px;
color: #54565A; color: #54565A;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 14px;