Merge remote-tracking branch 'origin/master'

This commit is contained in:
zer0Black
2022-06-16 13:27:22 +08:00
8 changed files with 765 additions and 705 deletions
@@ -4399,10 +4399,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (fileList.size() != 0) { if (fileList.size() != 0) {
//文件 //文件
if(CutEnum.CN.getValue().equals(cut)){ if(CutEnum.CN.getValue().equals(cut)){
String file = StringUtils.join(fileList, ",") + "字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.pdf,则应填写AAA/B.pdf\n"; String file = StringUtils.join(fileList, ",") + "字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件且该文件夹下只能有一层级,假设在AAA标准号下放置了B.pdf,则应填写AAA/B.pdf\n";
sbTwo.append(count++ + "." + file); sbTwo.append(count++ + "." + file);
}else{ }else{
String file = StringUtils.join(fileList, ",") + " When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder. Assume that the file is saved in the AAA standard numberB.pdf,Should fill inAAA/B.pdf\n"; String file = StringUtils.join(fileList, ",") + " When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder and can be only one level under this folder, Assume that the file is saved in the AAA standard numberB.pdf,Should fill inAAA/B.pdf\n";
sbTwo.append(count++ + "." + file); sbTwo.append(count++ + "." + file);
} }
} }
@@ -5280,7 +5280,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,cut,errorMsg,null,key,key); List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,cut,errorMsg,null,key,key);
if (nowFileList.size() == 0) { if (nowFileList.size() == 0) {
if(CutEnum.CN.getValue().equals(cut)){ if(CutEnum.CN.getValue().equals(cut)){
errorMsg += key + "压缩包中没有" + fileName + "文件, "; errorMsg += key + " 压缩包中没有" + fileName + "文件, ";
}else{ }else{
errorMsg += key + " Not in the zip package" + fileName + "file, "; errorMsg += key + " Not in the zip package" + fileName + "file, ";
} }
@@ -136,8 +136,8 @@ public class FileUnZip {
String filenameOne = ""; String filenameOne = "";
String filenameTwo = ""; String filenameTwo = "";
if(filename.contains("/")){ if(filename.contains("/")){
filenameOne = filename.split("/")[0]; filenameOne = filename.split("/")[1];
filenameTwo = filename.split("/")[1]; filenameTwo = filename.split("/")[2];
} }
List<File> resultlist = new ArrayList<>(); List<File> resultlist = new ArrayList<>();
if (StringUtil.isNotEmpty(path)){ if (StringUtil.isNotEmpty(path)){
+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:'禁止输入',
} }
@@ -4,8 +4,8 @@
<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>
@@ -16,19 +16,25 @@
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div class="operator-text" @click="dicAdd"> <div class="operator-text" @click="dicAdd">
<a-icon type="plus" /> <a-icon type="plus"/>
{{$t('add')}} {{$t('add')}}
</div> </div>
<div class="operator-text" @click="batDelete" v-has="dictVal=='list'?'dictItem:logicDeleteBatch':'sys:category:logicDeleteBatch'"> <div class="operator-text" @click="batDelete"
<a-icon type="delete" /> v-has="dictVal=='list'?'dictItem:logicDeleteBatch':'sys:category:logicDeleteBatch'">
<a-icon type="delete"/>
{{$t('BatchDelete')}} {{$t('BatchDelete')}}
</div> </div>
</div> </div>
<div class="dic-list-table"> <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> <list-table v-if="dictVal=='list'&&dataFlag" :tableData="tableData" @editDict="editDict"
<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> @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> </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-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 <a-form-model
v-if="newVisible" v-if="newVisible"
class="dic-form-module" class="dic-form-module"
@@ -39,16 +45,16 @@
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-form-model-item :label="$t('name')" prop="itemText" v-if="dictVal=='list'"> <a-form-model-item :label="$t('name')" prop="itemText" v-if="dictVal=='list'">
<a-input v-model.trim="form.itemText" :placeholder="$t('enterName')" /> <a-input v-model.trim="form.itemText" :placeholder="$t('enterName')"/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item :label="$t('name')" prop="name" v-if="dictVal=='tree'"> <a-form-model-item :label="$t('name')" prop="name" v-if="dictVal=='tree'">
<a-input v-model.trim="form.name" :placeholder="$t('enterName')" /> <a-input v-model.trim="form.name" :placeholder="$t('enterName')"/>
</a-form-model-item> </a-form-model-item>
<!-- <a-form-model-item :label="$t('DataValue')" prop="itemValue">--> <!-- <a-form-model-item :label="$t('DataValue')" prop="itemValue">-->
<!-- <a-input v-model="form.itemValue" :placeholder="$t('enterDataValue')" />--> <!-- <a-input v-model="form.itemValue" :placeholder="$t('enterDataValue')" />-->
<!-- </a-form-model-item>--> <!-- </a-form-model-item>-->
<a-form-model-item :label="$t('enName')" prop="enName"> <a-form-model-item :label="$t('enName')" prop="enName">
<a-input v-model.trim="form.enName" :placeholder="$t('PleaseEnterYourEnglishName')" /> <a-input v-model.trim="form.enName" :placeholder="$t('PleaseEnterYourEnglishName')"/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item :label="$t('ParentName')" prop="pid" v-if="parentVisible"> <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 v-model="form.pid" @change="handleChange" :placeholder="$t('pleaseSelect')" allowClear>
@@ -58,10 +64,11 @@
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item :label="$t('DisplayOrder')" prop="sortOrder"> <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-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>
<a-form-model-item :label="$t('describe')" prop="description"> <a-form-model-item :label="$t('describe')" prop="description">
<a-input v-model.trim="form.description" :placeholder="$t('PleaseEnterDescription')" /> <a-input v-model.trim="form.description" :placeholder="$t('PleaseEnterDescription')"/>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
@@ -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:[ itemText: [
{ 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 }
], ],
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 return parents
}
}, },
methods: {
test(rule, value, callback) {
var money = /[,]|[,]/g
if (money.test(value)) {
callback(new Error(this.$t('disableInput') + ','))
} else {
callback()
}
}, },
methods:{
//获取列表数据 //获取列表数据
loadData(){ loadData() {
this.dataFlag=false this.dataFlag = false
if(this.dictVal=='list'){ if (this.dictVal == 'list') {
let params={ let params = {
...this.queryParams, ...this.queryParams,
dictId:this.record.id dictId: this.record.id
} }
getAction(`sys/dictItem/page`,params).then(res=>{ getAction(`sys/dictItem/page`, params).then(res => {
if(res.success){ if (res.success) {
this.total=res.result.total this.total = res.result.total
this.tableData=[...res.result.records] this.tableData = [...res.result.records]
this.dataFlag=true this.dataFlag = true
} }
}) })
}else if(this.dictVal=='tree'){ } 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,73 +233,73 @@
//将数据拼成树形结构 //将数据拼成树形结构
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') {
@@ -300,8 +319,8 @@
} 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 => {
@@ -314,8 +333,8 @@
} 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') {
@@ -333,8 +352,8 @@
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}).finally(()=>{ }).finally(() => {
this.flag=false this.flag = false
}) })
} else { } else {
//新增 //新增
@@ -347,8 +366,8 @@
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(()=>{ }).finally(() => {
this.flag=false this.flag = false
}) })
} }
} }
@@ -357,7 +376,7 @@
}) })
}, },
//刷新缓存 //刷新缓存
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({
@@ -411,80 +430,80 @@
//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>
<style lang="less"> <style lang="less">
.dict-module{ .dict-module {
.ant-modal-footer{ .ant-modal-footer {
text-align:center; text-align: center;
} }
} }
.dic-list{
.dic-list-content{ .dic-list {
.table-operator{ .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,19 +141,19 @@
<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普通表单 //表单模式:true流程表单 false普通表单
@@ -159,326 +168,337 @@ export default {
default: false, default: false,
required: false required: false
}, },
drawerVisible:{ drawerVisible: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
editData:{ editData: {
type: Object, type: Object,
default:{} default: {}
}, },
editId:{ editId: {
type:String, type: String,
default:'' default: ''
}, },
submitEdit:{ submitEdit: {
type:String, type: String,
default:'' default: ''
}, },
disableEdit:{ disableEdit: {
type:Boolean, type: Boolean,
default:false default: false
}, },
submitKey:{ submitKey: {
type:String, type: String,
default:'1' default: '1'
} }
}, },
data () { data() {
return { return {
form: {}, form: {},
model: {}, model: {},
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 6 }, sm: { span: 6 }
}, },
wrapperCol: { wrapperCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 16 }, sm: { span: 16 }
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
isModel: [ isModel: [
{ required: true, message: this.$t('PleaseSelectModule'),trigger: 'change'}, { required: true, message: this.$t('PleaseSelectModule'), trigger: 'change' }
], ],
dbFieldTxt: [ dbFieldTxt: [
{ required: true, message: this.$t('PleaseEnterPropertyName'),trigger: 'blur'}, { required: true, message: this.$t('PleaseEnterPropertyName'), trigger: 'blur' },
{ min:1, max: 20, message: this.$t('cantExeed')+'20'+this.$t('characters'), trigger: 'blur' }, { min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
], ],
dbFieldName: [ dbFieldName: [
{ required: true, message: this.$t('PleaseEnterYourEnglishName'),trigger: 'blur'}, { required: true, message: this.$t('PleaseEnterYourEnglishName'), trigger: 'blur' },
{ min:1, max: 20, message: this.$t('cantExeed')+'20'+this.$t('characters'), trigger: 'blur' }, { min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
], ],
dbFieldEnName:[ dbFieldEnName: [
{ required: true, message: this.$t('PleaseEnterYourEnglishName'),trigger: 'change'}, { required: true, message: this.$t('PleaseEnterYourEnglishName'), trigger: 'change' },
{ max: 50, message: this.$t('cantExeed')+'50'+this.$t('characters'), trigger: 'blur' }, { max: 50, message: this.$t('cantExeed') + '50' + this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
], ],
fieldShowType: [ fieldShowType: [
{ required: true, message: this.$t('PleaseSelectAttributeType'),trigger: 'change'}, { required: true, message: this.$t('PleaseSelectAttributeType'), trigger: 'change' }
], ],
dictId: [ dictId: [
{ required: true, message: this.$t('PleaseSelectOptionContent'),trigger: 'change'}, { required: true, message: this.$t('PleaseSelectOptionContent'), trigger: 'change' }
], ],
dbLength: [ dbLength: [
{ required: true, message: this.$t('PleaseEnterFieldLength'),trigger: 'blur'}, { required: true, message: this.$t('PleaseEnterFieldLength'), trigger: 'blur' }
], ],
orderNum: [ orderNum: [
{ required: true, message: this.$t('PleaseEnterDisplayOrder'),trigger: 'blur'}, { required: true, message: this.$t('PleaseEnterDisplayOrder'), trigger: 'blur' }
], ],
fieldMustInput: [ fieldMustInput: [
{ required: true, message: this.$t('selectWhetherRequired'),trigger: 'change'}, { required: true, message: this.$t('selectWhetherRequired'), trigger: 'change' }
], ],
isShowList: [ isShowList: [
{ required: true, message: this.$t('selectDisplayList'),trigger: 'change'}, { required: true, message: this.$t('selectDisplayList'), trigger: 'change' }
], ],
showArea: [ showArea: [
{ required: true, message: this.$t('SelectDisplayArea'),trigger: 'change'}, { required: true, message: this.$t('SelectDisplayArea'), trigger: 'change' }
], ],
isQuery: [ isQuery: [
{ required: true, message: this.$t('SelectWhetherToSearch'),trigger: 'change'}, { required: true, message: this.$t('SelectWhetherToSearch'), trigger: 'change' }
], ],
isShowLawsList: [ isShowLawsList: [
{ required: true, message: this.$t('selectDisplayListRegulations'),trigger: 'change'}, { required: true, message: this.$t('selectDisplayListRegulations'), trigger: 'change' }
], ],
isShowSearch: [ isShowSearch: [
{ required: true, message: this.$t('selectSearchCenterDisplayed'),trigger: 'change'}, { required: true, message: this.$t('selectSearchCenterDisplayed'), trigger: 'change' }
], ]
}, },
addVisible:false, addVisible: false,
url: { url: {
add: "tag/onlCgformTag/add", add: 'tag/onlCgformTag/add',
edit: "tag/onlCgformTag/edit", edit: 'tag/onlCgformTag/edit',
queryById: "tag/onlCgformTag/queryById" queryById: 'tag/onlCgformTag/queryById'
}, },
//展示区域选项内容 //展示区域选项内容
areaOptions:[], areaOptions: [],
//选项内容选项 //选项内容选项
contentOption:[], contentOption: [],
contentFlag:3, contentFlag: 3,
contentOption1:[], contentOption1: [],
contentOption2:[], contentOption2: [],
isTagContent:false, isTagContent: false,
isSearch:true, isSearch: true,
isLength:true, isLength: true,
flag:false, //表单提交标识 flag: false, //表单提交标识
disabledEdit:false, disabledEdit: false,
moduleShow:true moduleShow: true
} }
}, },
watch:{ watch: {
'form.fieldShowType'(val){ 'form.fieldShowType'(val) {
// this.contentFlag=val // this.contentFlag=val
if(val==0){ if (val == 0) {
this.contentOption=[...this.contentOption2] this.contentOption = [...this.contentOption2]
this.isTagContent=true this.isTagContent = true
}else if(val==3||val==4){ } else if (val == 3 || val == 4) {
this.contentOption=[...this.contentOption1] this.contentOption = [...this.contentOption1]
this.isTagContent=true this.isTagContent = true
}else{ } else {
this.isTagContent=false this.isTagContent = false
} }
if(val==7){ if (val == 7) {
this.isSearch=false this.isSearch = false
this.form.isQuery=0 this.form.isQuery = 0
}else{ } else {
this.isSearch=true this.isSearch = true
} }
if(val==1||val==8||val==9||val==10||val==11||val=='sel_user'){ if (val == 1 || val == 8 || val == 9 || val == 10 || val == 11 || val == 'sel_user') {
this.isLength=true this.isLength = true
}else{ } else {
this.isLength=false this.isLength = false
} }
}, },
submitEdit(){ submitEdit() {
}, },
disableEdit(){ disableEdit() {
}, }
}, },
computed: { computed: {
changeType(val){ changeType(val) {
// console.log('changtType',val) // console.log('changtType',val)
}, },
formDisabled(){ formDisabled() {
if(this.formBpm===true){ if (this.formBpm === true) {
if(this.formData.disabled===false){ if (this.formData.disabled === false) {
return false return false
} }
return true return true
} }
return this.disabled return this.disabled
}, },
showFlowSubmitButton(){ showFlowSubmitButton() {
if(this.formBpm===true){ if (this.formBpm === true) {
if(this.formData.disabled===false){ if (this.formData.disabled === false) {
return true return true
} }
} }
return false return false
} }
}, },
created () { created() {
//如果是流程中表单,则需要加载流程表单data //如果是流程中表单,则需要加载流程表单data
this.showFlowData(); this.showFlowData()
}, },
mounted() { mounted() {
// console.log('disableEdit',this.disableEdit) // console.log('disableEdit',this.disableEdit)
this.loadContent() this.loadContent()
this.loadShowArea() this.loadShowArea()
// console.log('edit',this.submitKey) // console.log('edit',this.submitKey)
if(this.submitEdit==='add'){ if (this.submitEdit === 'add') {
if(this.submitKey==='1'){ if (this.submitKey === '1') {
this.form.isModel='1' this.form.isModel = '1'
this.moduleShow=true this.moduleShow = true
}else if(this.submitKey=='2'){ } else if (this.submitKey == '2') {
this.form.isModel='0' this.form.isModel = '0'
this.moduleShow=false this.moduleShow = false
} }
this.disabledEdit=false this.disabledEdit = false
}else if(this.submitEdit==='edit'){ } else if (this.submitEdit === 'edit') {
if(this.submitKey==='1'){ if (this.submitKey === '1') {
this.form.isModel='1' this.form.isModel = '1'
this.moduleShow=true this.moduleShow = true
}else if(this.submitKey=='2'){ } else if (this.submitKey == '2') {
this.form.isModel='0' this.form.isModel = '0'
this.moduleShow=false 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) {
var money = /[,]|[,]/g
if (money.test(value)) {
callback(new Error(this.$t('disableInput') + ','))
} else {
callback()
}
},
//获取选项内容 //获取选项内容
loadContent(){ loadContent() {
let params = {}; let params = {}
getAction(`sys/dict/queryDictName`,params).then((res)=>{ getAction(`sys/dict/queryDictName`, params).then((res) => {
if(res.success){ if (res.success) {
let data=[...res.result] let data = [...res.result]
this.contentOption1=[] this.contentOption1 = []
this.contentOption2=[] this.contentOption2 = []
data.map(res=>{ data.map(res => {
if(res.attributeType=='1'){ if (res.attributeType == '1') {
this.contentOption1.push(res) this.contentOption1.push(res)
}else if(res.attributeType=='2'){ } else if (res.attributeType == '2') {
this.contentOption2.push(res) this.contentOption2.push(res)
} }
}) })
if(this.form.fieldShowType==0){ if (this.form.fieldShowType == 0) {
this.contentOption=[...this.contentOption2] this.contentOption = [...this.contentOption2]
this.isTagContent=true this.isTagContent = true
}else if(this.form.fieldShowType==3||this.form.fieldShowType=='4'){ } else if (this.form.fieldShowType == 3 || this.form.fieldShowType == '4') {
this.contentOption=[...this.contentOption1] this.contentOption = [...this.contentOption1]
this.isTagContent=true this.isTagContent = true
}else{ } else {
this.isTagContent=false this.isTagContent = false
} }
} }
}); })
}, },
//获取展示区域 //获取展示区域
loadShowArea(){ loadShowArea() {
let params = {}; let params = {}
getAction(`tag/onlCgformArea/queryShowArea`,params).then((res)=>{ getAction(`tag/onlCgformArea/queryShowArea`, params).then((res) => {
if(res.success){ if (res.success) {
this.areaOptions=res.result this.areaOptions = res.result
} }
}); })
}, },
add () { add() {
this.edit({}); this.edit({})
}, },
edit (record) { edit(record) {
this.form.resetFields(); this.form.resetFields()
this.model = Object.assign({}, record); this.model = Object.assign({}, record)
this.visible = true; this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
// this.form.setFieldsValue(pick(this.model,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowList','showArea','isQuery','isShowLawsList','isShowSearch')) // this.form.setFieldsValue(pick(this.model,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowList','showArea','isQuery','isShowLawsList','isShowSearch'))
}) })
}, },
//渲染流程表单数据 //渲染流程表单数据
showFlowData(){ showFlowData() {
if(this.formBpm === true){ if (this.formBpm === true) {
let params = {id:this.formData.dataId}; let params = { id: this.formData.dataId }
getAction(this.url.queryById,params).then((res)=>{ getAction(this.url.queryById, params).then((res) => {
if(res.success){ if (res.success) {
this.edit (res.result); this.edit(res.result)
} }
}); })
} }
}, },
submitForm () { submitForm() {
// const that = this; // const that = this;
// 触发表单验证 // 触发表单验证
this.form.dbFieldTxt = this.form.dbFieldTxt.trim() this.form.dbFieldTxt = this.form.dbFieldTxt.trim()
this.form.dbFieldEnName = this.form.dbFieldEnName.trim() this.form.dbFieldEnName = this.form.dbFieldEnName.trim()
this.form.dbFieldTxt = this.form.dbFieldTxt.trim() this.form.dbFieldTxt = this.form.dbFieldTxt.trim()
// console.log(this.$refs.tagform) // console.log(this.$refs.tagform)
this.$refs.tagEditForm.validate((valid)=>{ this.$refs.tagEditForm.validate((valid) => {
// console.log('valid',valid) // console.log('valid',valid)
if (valid) { if (valid) {
if(!this.flag){ if (!this.flag) {
this.flag=true this.flag = true
this.confirmLoading = true; this.confirmLoading = true
let httpurl = ''; let httpurl = ''
let method = ''; let method = ''
// console.log('this.editId',this.editId) // console.log('this.editId',this.editId)
if(this.submitEdit=='add'){ if (this.submitEdit == 'add') {
httpurl+=this.url.add; httpurl += this.url.add
method = 'post'; method = 'post'
this.form.id='' this.form.id = ''
this.form.isReadOnly=0 this.form.isReadOnly = 0
}else if(this.submitEdit=='edit'){ } else if (this.submitEdit == 'edit') {
httpurl+=this.url.edit; httpurl += this.url.edit
method = 'put'; method = 'put'
this.form.id=this.editId this.form.id = this.editId
} }
this.form.dbIsKey='0' this.form.dbIsKey = '0'
this.form.dbIsNull='1' this.form.dbIsNull = '1'
this.form.dbPointLength='0' this.form.dbPointLength = '0'
this.form.isShowForm='1' this.form.isShowForm = '1'
this.form.dbFieldName=this.form.dbFieldTxt this.form.dbFieldName = this.form.dbFieldTxt
this.contentOption.forEach(item=>{ this.contentOption.forEach(item => {
if(item.id==this.form.dictId){ if (item.id == this.form.dictId) {
// console.log('11111') // console.log('11111')
this.form.dictField=item.dictCode this.form.dictField = item.dictCode
this.form.dictText=item.dictName this.form.dictText = item.dictName
} }
}) })
// console.log('form',this.form) // console.log('form',this.form)
// console.log('model',this.form.isModel) // console.log('model',this.form.isModel)
let onlineId='' let onlineId = ''
let url='' let url = ''
if(this.form.isModel=='1'){ if (this.form.isModel == '1') {
onlineId='48308196e7b04761b533dc31bc899707' onlineId = '48308196e7b04761b533dc31bc899707'
}else if(this.form.isModel=='0'){ } else if (this.form.isModel == '0') {
onlineId='c998a34ea4b84089932197ed0705c757' onlineId = 'c998a34ea4b84089932197ed0705c757'
} }
httpAction(httpurl,this.form,method).then((res)=>{ httpAction(httpurl, this.form, method).then((res) => {
if(res.success){ if (res.success) {
this.$message.success(this.$t('OperationSuccessful')); this.$message.success(this.$t('OperationSuccessful'))
postAction(`online/cgform/api/doDbSynch/${onlineId}/normal postAction(`online/cgform/api/doDbSynch/${onlineId}/normal
`,{}).then(res=>{ `, {}).then(res => {
}) })
this.$emit('ok',false); this.$emit('ok', false)
}else{ } else {
this.$message.warning(res.message); this.$message.warning(res.message)
} }
}).finally(() => { }).finally(() => {
this.confirmLoading = false; this.confirmLoading = false
this.flag=false this.flag = false
}) })
} }
} }
}) })
}, },
popupCallback(row){ popupCallback(row) {
this.form.setFieldsValue(pick(row,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowForm','areaId','isQuery','isShowLawsList','isShowSearch')) this.form.setFieldsValue(pick(row, 'isModel', 'dbFieldTxt', 'dbFieldName', 'fieldShowType', 'dictName', 'dbLength', 'orderNum', 'fieldMustInput', 'isShowForm', 'areaId', 'isQuery', 'isShowLawsList', 'isShowSearch'))
}, },
//正则替换小数点 //正则替换小数点
limitNumber(value) { limitNumber(value) {
@@ -492,23 +512,24 @@ export default {
}, },
handleChange(value) { handleChange(value) {
// console.log(`selected ${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{
.tag-info {
margin-left: 30px; 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;