| | |
| | | <template> |
| | | <el-dialog :visible.sync="dialogPush" append-to-body :close-on-click-modal="false" @close="escHandler" title="导出" style="width: 1550px; margin: auto"> |
| | | <div style="margin-bottom: 20px;"> |
| | | <div> |
| | | <span>导出方式:</span> |
| | | <el-radio-group v-model="radio"> |
| | | <el-radio :label="0">选择</el-radio> |
| | | <el-radio :label="1">全部</el-radio> |
| | | <el-radio :label="2">页码</el-radio> |
| | | </el-radio-group> |
| | | <span v-if="radio === 2" style="margin-left: 20px;"><el-input style="width: 150px" v-model="pageExport"></el-input> (输入页码或者页面范围,如:1-10))</span> |
| | | <el-dialog :close-on-click-modal="false" :visible.sync="dialogPush" append-to-body style="width: 1550px; margin: auto" title="导出" |
| | | @close="escHandler"> |
| | | <div style="margin-bottom: 20px;"> |
| | | <div> |
| | | <span>导出方式:</span> |
| | | <el-radio-group v-model="radio"> |
| | | <el-radio :label="0">选择</el-radio> |
| | | <el-radio :label="1">全部</el-radio> |
| | | <el-radio :label="2">页码</el-radio> |
| | | </el-radio-group> |
| | | <span v-if="radio === 2" style="margin-left: 20px;"><el-input v-model="pageExport" |
| | | style="width: 150px"></el-input> (输入页码或者页面范围,如:1-10))</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="text-align: center"> |
| | | <el-transfer |
| | | style="text-align: left; display: inline-block;height: 400px" |
| | | filterable |
| | | :filter-method="filterMethod" |
| | | filter-placeholder="关键词搜索" |
| | | v-model="value" |
| | | :titles="['未选属性', '已选属性']" |
| | | :data="data"> |
| | | </el-transfer> |
| | | </div> |
| | | <div style="display: flex;justify-content: flex-end;"> |
| | | <el-button size="small" plain type="success" @click="handleExcel">确定</el-button> |
| | | <el-button size="small" plain @click="escHandler">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <div style="text-align: center"> |
| | | <el-transfer |
| | | v-model="value" |
| | | :data="data" |
| | | :filter-method="filterMethod" |
| | | :titles="['未选属性', '已选属性']" |
| | | filter-placeholder="关键词搜索" |
| | | filterable |
| | | style="text-align: left; display: inline-block;height: 400px"> |
| | | </el-transfer> |
| | | </div> |
| | | <div style="display: flex;justify-content: flex-end;"> |
| | | <el-button plain size="small" type="success" @click="handleExcel">确定</el-button> |
| | | <el-button plain size="small" @click="escHandler">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {exportCode,FindData} from '@/api/GetItem' |
| | | import {exportCode, FindData} from '@/api/GetItem' |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "MasterTransfer", |
| | | props:['visible','tableHeadData','codeClassifyOid','tableData','selectRow','templateOid','limit'], |
| | | data(){ |
| | | name: "MasterTransfer", |
| | | props: ['visible', 'tableHeadData', 'codeClassifyOid', 'tableData', 'selectRow', 'templateOid', 'limit'], |
| | | data() { |
| | | return { |
| | | pageExport:"", |
| | | pageExport: "", |
| | | data: [], |
| | | value: [], |
| | | filterMethod(query, item) { |
| | | return item.label.indexOf(query) > -1; |
| | | }, |
| | | dialogPush:this.visible, |
| | | radio:0, |
| | | tableHeadFindData:[], |
| | | tableExportData:[], |
| | | option:{ |
| | | dialogPush: this.visible, |
| | | radio: 0, |
| | | tableHeadFindData: [], |
| | | tableExportData: [], |
| | | option: { |
| | | title: '文档标题', |
| | | column: [{ |
| | | label: '主数据', |
| | |
| | | }], |
| | | data: [] |
| | | }, |
| | | exportArr:{}, |
| | | exportArrTwo:{}, |
| | | ids:"" |
| | | exportArr: {}, |
| | | exportArrTwo: {}, |
| | | ids: "" |
| | | }; |
| | | }, |
| | | watch:{ |
| | | watch: { |
| | | //监听初始化 |
| | | visible (){ |
| | | visible() { |
| | | this.dialogPush = this.visible; |
| | | }, |
| | | //表头数据 用来渲染穿梭框 |
| | |
| | | } |
| | | } |
| | | }, |
| | | tableData(){ |
| | | tableData() { |
| | | // 将值里面的true或false改变为是或否 |
| | | this.option.data = this.tableData.map(obj => { |
| | | for (let prop in obj) { |
| | | if (obj[prop] === "true") { |
| | | obj[prop] = "是"; |
| | | } else if (obj[prop] === "false") { |
| | | obj[prop] = "否"; |
| | | } |
| | | for (let prop in obj) { |
| | | if (obj[prop] === "true") { |
| | | obj[prop] = "是"; |
| | | } else if (obj[prop] === "false") { |
| | | obj[prop] = "否"; |
| | | } |
| | | } |
| | | return obj; |
| | | }); |
| | | }, |
| | | codeClassifyOid:{ |
| | | handler(newval,oldval){ |
| | | codeClassifyOid: { |
| | | handler(newval, oldval) { |
| | | } |
| | | }, |
| | | value:{ |
| | | handler(newval,oldval){ |
| | | console.log('value',newval) |
| | | value: { |
| | | handler(newval, oldval) { |
| | | console.log('value', newval) |
| | | } |
| | | } |
| | | }, |
| | | computed:{ |
| | | |
| | | }, |
| | | computed: {}, |
| | | mounted() { |
| | | }, |
| | | methods:{ |
| | | escHandler(){ |
| | | methods: { |
| | | escHandler() { |
| | | this.$emit('update:visible', false); |
| | | this.value=[]; |
| | | this.radio=0 |
| | | this.value = []; |
| | | this.radio = 0 |
| | | }, |
| | | //关闭页面 |
| | | recoverPage(){ |
| | | recoverPage() { |
| | | this.$emit('update:visible', false); |
| | | }, |
| | | handleExcel(){ |
| | | this.value.map(index => this.tableHeadData[index].prop).forEach((item, index) => { |
| | | this.exportArr[`attrIdIndexMap[${index}]`] = item |
| | | }) |
| | | if(this.radio === 0){ |
| | | if(this.selectRow.length<=0){ |
| | | this.$message.warning('请选择要导出的模板') |
| | | }else { |
| | | //已选择多选 |
| | | const selectList=[] |
| | | //已选择属性 |
| | | let exportArr={} |
| | | this.ids = this.selectRow.map(item => item.oid).join(',') |
| | | this.selectRow.forEach(item=>{ |
| | | selectList.push( |
| | | item.oid |
| | | ) |
| | | }) |
| | | if(this.value <= 0){ |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArrTwo,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | }else { |
| | | |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArr}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }else if(this.radio === 1){ |
| | | if(this.value <= 0){ |
| | | handleExcel() { |
| | | this.value.map(index => this.tableHeadData[index].prop).forEach((item, index) => { |
| | | this.exportArr[`attrIdIndexMap[${index}]`] = item |
| | | }) |
| | | if (this.radio === 0) { |
| | | if (this.selectRow.length <= 0) { |
| | | this.$message.warning('请选择要导出的模板') |
| | | } else { |
| | | //已选择多选 |
| | | const selectList = [] |
| | | //已选择属性 |
| | | let exportArr = {} |
| | | this.ids = this.selectRow.map(item => item.oid).join(',') |
| | | this.selectRow.forEach(item => { |
| | | selectList.push( |
| | | item.oid |
| | | ) |
| | | }) |
| | | if (this.value <= 0) { |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | }else { |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{ |
| | | // console.log('res',res) |
| | | if(res){ |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | } |
| | | }else if(this.radio === 2){ |
| | | const input = this.pageExport.trim(); |
| | | let start, end; |
| | | if (input.includes('-')) { |
| | | if (input.indexOf('-') !== input.lastIndexOf('-')) { |
| | | this.$message.warning('输入格式错误:只能输入一个 - 号隔开'); |
| | | return; |
| | | } |
| | | //包含-解析 |
| | | const range = input.split('-'); |
| | | start = Number(range[0]); |
| | | end = Number(range[1]); |
| | | if (isNaN(start) || isNaN(end)) { |
| | | this.$message.warning('输入格式错误'); |
| | | return; |
| | | } |
| | | } else { |
| | | //不包含-解析 |
| | | start = Number(input); |
| | | end = start; |
| | | if (isNaN(start)) { |
| | | this.$message.warning('输入格式错误'); |
| | | return; |
| | | } |
| | | } |
| | | if(this.value >=1 ){ |
| | | exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => { |
| | | exportCode({ |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | 'conditionMap[oid]': this.ids, ...this.exportArrTwo, |
| | | limit: -1 |
| | | }).then(res => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }); |
| | | }else { |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:this.limit,page: start, endPage: end}).then(res=>{ |
| | | }) |
| | | } else { |
| | | |
| | | exportCode({ |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | 'conditionMap[oid]': this.ids, ...this.exportArr |
| | | }).then(res => { |
| | | // console.log('res',res) |
| | | if(res){ |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | } else if (this.radio === 1) { |
| | | if (this.value <= 0) { |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArrTwo, limit: -1}).then(res => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | } else { |
| | | exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: -1}).then(res => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | } |
| | | } else if (this.radio === 2) { |
| | | const input = this.pageExport.trim(); |
| | | let start, end; |
| | | if (input.includes('-')) { |
| | | if (input.indexOf('-') !== input.lastIndexOf('-')) { |
| | | this.$message.warning('输入格式错误:只能输入一个 - 号隔开'); |
| | | return; |
| | | } |
| | | //包含-解析 |
| | | const range = input.split('-'); |
| | | start = Number(range[0]); |
| | | end = Number(range[1]); |
| | | if (isNaN(start) || isNaN(end)) { |
| | | this.$message.warning('输入格式错误'); |
| | | return; |
| | | } |
| | | } else { |
| | | //不包含-解析 |
| | | start = Number(input); |
| | | end = start; |
| | | if (isNaN(start)) { |
| | | this.$message.warning('输入格式错误'); |
| | | return; |
| | | } |
| | | } |
| | | if (this.value >= 1) { |
| | | exportCode({ |
| | | codeClassifyOid: this.codeClassifyOid, ...this.exportArr, |
| | | limit: this.limit, |
| | | page: start, |
| | | endPage: end |
| | | }).then((res) => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }); |
| | | } else { |
| | | this.tableHeadData.map(item => item.prop) |
| | | .forEach((prop, index) => { |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({ |
| | | codeClassifyOid: this.codeClassifyOid, ...this.exportArrTwo, |
| | | limit: this.limit, |
| | | page: start, |
| | | endPage: end |
| | | }).then(res => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | <style lang="scss" scoped> |
| | | |
| | | </style> |
| | |
| | | }} |
| | | </el-button> |
| | | <span v-if="tableHeadFindData.length > 0"> |
| | | <el-select v-model="keyWordFind" slot="prepend" placeholder="请选择" size="small"> |
| | | <el-select slot="prepend" v-model="keyWordFind" placeholder="请选择" size="small"> |
| | | <el-option v-for="item in tableHeadFindData" :label="item.label" :value="item.prop"></el-option> |
| | | </el-select> |
| | | <el-input v-model="WupinFindValue" placeholder="请输入关键字按回车查询" |
| | |
| | | <FormTemplateDialog :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid" |
| | | :disabledProp="disabledProp" :rowOid="rowOid" :templateOid="templateOid" |
| | | :title="'已发布数据更改'" |
| | | type="edit" |
| | | :visible.sync="DataVisible" @submit="updataSumbit"></FormTemplateDialog> |
| | | :visible.sync="DataVisible" |
| | | type="edit" @submit="updataSumbit"></FormTemplateDialog> |
| | | <!-- 发布--> |
| | | <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleFlow" |
| | | @onLoad="onLoad"></set-personnel> |
| | |
| | | tableHeadBtnData: { |
| | | type: Array, |
| | | }, |
| | | Treedata:{ |
| | | type:Array |
| | | Treedata: { |
| | | type: Array |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | // 状态搜索 |
| | | statusSelect: "all", |
| | | // 关键字查询 |
| | | keyWordFind:"", |
| | | keyWordFind: "", |
| | | searchResults: [], |
| | | //首页右侧搜索 |
| | | WupinFindValue: "", |
| | |
| | | //发布 |
| | | parameter: { |
| | | ids: [], |
| | | btmtype:'', |
| | | btmtype: '', |
| | | code: "", |
| | | type: '', |
| | | // this.visibleDeactivate ?'ENABLE':this.visibleEnable ? 'DISABLE' :this.visibleRecovery ? 'ROLLBACK' :'PUBLIC' |
| | |
| | | created() { |
| | | // const index = this.$route.query.id.indexOf('@name=') + '@name='.length; |
| | | // this.result = this.$route.query.id.substring(index); |
| | | getUserInfo().then(res=>{ |
| | | getUserInfo().then(res => { |
| | | console.log(res.data.data) |
| | | this.result=res.data.data.realName |
| | | this.result = res.data.data.realName |
| | | }) |
| | | }, |
| | | mounted() { |
| | |
| | | } |
| | | } |
| | | |
| | | if(_index==0){ |
| | | this.keyWordFind=record.field |
| | | if (_index == 0) { |
| | | this.keyWordFind = record.field |
| | | } |
| | | }) |
| | | this.tableHeadFindDatas = newval; |
| | | this.WupinFindValue='' |
| | | this.WupinFindValue = '' |
| | | }, |
| | | }, |
| | | total: { |
| | |
| | | }, |
| | | // 发布 |
| | | setHandler() { |
| | | console.log('Treedata',this.Treedata) |
| | | console.log('Treedata', this.Treedata) |
| | | if (this.selectRow.length > 0) { |
| | | let hasEditing = this.selectRow.some(item => item.lcstatus !== 'Editing'); |
| | | let showMessage = true; |
| | |
| | | this.parameter.processName = this.result + '-申请[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']'; |
| | | this.parameter.type = 'PUBLIC'; |
| | | this.parameter.code = this.templateOid; |
| | | this.parameter.btmtype=this.selectRow[0].btmname || this.selectRow[0].btmtype; |
| | | this.parameter.btmtype = this.selectRow[0].btmname || this.selectRow[0].btmtype; |
| | | this.title = '流程审批' |
| | | this.visibleFlow = true; |
| | | } else { |
| | |
| | | this.parameter.processName = this.result + '-停用[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']'; |
| | | this.parameter.type = 'DISABLE'; |
| | | this.parameter.code = this.templateOid |
| | | this.parameter.btmtype=this.selectRow[0].btmname || this.selectRow[0].btmtype; |
| | | this.parameter.btmtype = this.selectRow[0].btmname || this.selectRow[0].btmtype; |
| | | this.title = '停用(冻结)编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | |
| | | } |
| | | } |
| | | }); |
| | | } else if(this.selectRow.length == 1 && !hasEditing && showMessage ) { |
| | | } else if (this.selectRow.length == 1 && !hasEditing && showMessage) { |
| | | this.$message.warning('您选择的数据为【发布状态】才可以发起流程') |
| | | } |
| | | }); |
| | |
| | | this.parameter.processName = this.result + '-启用[' + this.Treedata[0].name + '-' + this.selectRow[0].name + ']'; |
| | | this.parameter.type = 'Released'; |
| | | this.parameter.code = this.templateOid |
| | | this.parameter.btmtype=this.selectRow[0].btmname || this.selectRow[0].btmtype; |
| | | this.parameter.btmtype = this.selectRow[0].btmname || this.selectRow[0].btmtype; |
| | | this.title = '启用编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | |
| | | this.parameter.processName = this.result + '-回收[' + this.selectRow[0].btmname + '-' + this.selectRow[0].name + ']'; |
| | | this.parameter.type = 'TakeBack'; |
| | | this.parameter.code = this.templateOid |
| | | this.parameter.btmtype=this.selectRow[0].btmname || this.selectRow[0].btmtype; |
| | | this.parameter.btmtype = this.selectRow[0].btmname || this.selectRow[0].btmtype; |
| | | this.title = '回收编码数据' |
| | | this.visibleDeactivate = true; |
| | | } else { |
| | |
| | | }) |
| | | }, |
| | | //数据更改回调 |
| | | updataSumbit(val){ |
| | | updataSumbit(val) { |
| | | this.DataVisible = false; |
| | | val.copyFromVersion = this.rowOid; |
| | | val.oid='' |
| | | val.oid = ''; |
| | | console.log(val) |
| | | upSaveCode(val).then(res=>{ |
| | | upSaveCode(val).then(res => { |
| | | console.log(res) |
| | | this.$nextTick(() => { |
| | | this.onLoad() |
| | |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | page: this.page.currentPage, |
| | | limit: this.page.pageSize, |
| | | [ 'conditionMap[' + this.keyWordFind + ']']: '*' + this.WupinFindValue + '*' |
| | | ['conditionMap[' + this.keyWordFind + ']']: '*' + this.WupinFindValue + '*' |
| | | }).then(res => { |
| | | this.tableData = res.data.data |
| | | }) |
| | |
| | | <template> |
| | | <div> |
| | | <div style="display: flex;flex-wrap: wrap; display: inline-block" v-if="this.crudArrayFlag" class="app" > |
| | | <div v-if="this.crudArrayFlag" class="app" style="display: flex;flex-wrap: wrap; display: inline-block"> |
| | | <el-button-group> |
| | | <!--新增--> |
| | | <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag && (!checkStatus || crudLCStatus=='Editing' )" size="small" type="primary" icon="el-icon-plus" plain @click="busineHandle">添加 {{ msg }}</el-button> |
| | | <!-- 全屏编辑--> |
| | | <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">全屏编辑</el-button> |
| | | <!-- 验证规则--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" @click="ruleAddHandler">验证规则</el-button> |
| | | <!-- 属性分组--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" @click="attrVisibleHandle">属性分组</el-button> |
| | | <!--新增--> |
| | | <el-button |
| | | v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag && (!checkStatus || crudLCStatus=='Editing' )" |
| | | icon="el-icon-plus" plain size="small" type="primary" @click="busineHandle">添加 {{ msg }} |
| | | </el-button> |
| | | <!-- 全屏编辑--> |
| | | <el-button |
| | | v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')" |
| | | icon="el-icon-full-screen" size="small" @click="fullscreenHandle">全屏编辑 |
| | | </el-button> |
| | | <!-- 验证规则--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" |
| | | @click="ruleAddHandler">验证规则 |
| | | </el-button> |
| | | <!-- 属性分组--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" |
| | | @click="attrVisibleHandle">属性分组 |
| | | </el-button> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <!-- 保存--> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" type="success" plain @click.prevent="addsHandler" icon="el-icon-check">保存</el-button> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-check" plain size="small" |
| | | type="success" @click.prevent="addsHandler">保存 |
| | | </el-button> |
| | | <!-- 预览排序--> |
| | | <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">预览排序</el-button> |
| | | <el-button icon="el-icon-arrow-down" size="small" @click="orderHandle">预览排序</el-button> |
| | | <!-- 删除--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" @click="CrudRemove" icon="el-icon-delete">删除</el-button> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-delete" size="small" |
| | | @click="CrudRemove">删除 |
| | | </el-button> |
| | | <!-- 重置--> |
| | | <el-button size="small" @click="reset" icon="el-icon-refresh-right">重置</el-button> |
| | | <el-button icon="el-icon-refresh-right" size="small" @click="reset">重置</el-button> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <!--新增--> |
| | | <!-- 分类注入--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-magic-stick" size="small" @click="injectBtn">分类注入</el-button> |
| | | <!-- 分类注入--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-magic-stick" |
| | | size="small" @click="injectBtn">分类注入 |
| | | </el-button> |
| | | <!-- 组合规则--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-film" size="small" @click="isShowHandler">组合规则</el-button> |
| | | <!-- 枚举注入--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-c-scale-to-original" size="small" @click="enmuVisHandle">枚举注入</el-button> |
| | | <!-- 级联属性--> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" @click="CascadeHandle">级联属性</el-button> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-film" size="small" |
| | | @click="isShowHandler">组合规则 |
| | | </el-button> |
| | | <!-- 枚举注入--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-c-scale-to-original" |
| | | size="small" @click="enmuVisHandle">枚举注入 |
| | | </el-button> |
| | | <!-- 级联属性--> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" |
| | | @click="CascadeHandle">级联属性 |
| | | </el-button> |
| | | </el-button-group> |
| | | |
| | | <el-button-group> |
| | | <!-- 同步到其他模板--> |
| | | <el-button size="small"@click="syncHandle" icon="el-icon-share">同步到其他模板</el-button> |
| | | <!-- 同步到其他模板--> |
| | | <el-button icon="el-icon-share" size="small" @click="syncHandle">同步到其他模板</el-button> |
| | | </el-button-group> |
| | | |
| | | <el-button-group> |
| | | <!-- 编码申请预览--> |
| | | <el-button size="small" icon="el-icon-view" @click="applicationHandle" style="">编码申请预览</el-button> |
| | | <!-- 编码申请预览--> |
| | | <el-button icon="el-icon-view" size="small" style="" @click="applicationHandle">编码申请预览</el-button> |
| | | |
| | | </el-button-group> |
| | | <!-- 是否开启编辑 --> |
| | | <el-button-group> |
| | | <el-button size="small" plain icon="el-icon-view" v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag && attrEditVisible == false && attrFlagChiledren==false" @click="editOpen" >开启编辑</el-button> |
| | | </el-button-group> |
| | | <el-select v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" v-model="selectvalue" placeholder="请选择"> |
| | | <el-button-group> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag && attrEditVisible == false && attrFlagChiledren==false" icon="el-icon-view" plain |
| | | size="small" |
| | | @click="editOpen">开启编辑 |
| | | </el-button> |
| | | </el-button-group> |
| | | <el-select v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="selectvalue" placeholder="请选择" |
| | | size="small"> |
| | | <el-option |
| | | v-for="item in selectoptions" |
| | | :key="item.value" |
| | |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-switch v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="switchvalue" @change="batchSetFlag" active-value="true" style="margin:6px 0 0 10px"> |
| | | <el-switch v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" v-model="switchvalue" |
| | | active-value="true" style="margin:6px 0 0 10px" @change="batchSetFlag"> |
| | | </el-switch> |
| | | </div> |
| | | <!-- 弹窗--> |
| | | <!-- 弹窗--> |
| | | <div> |
| | | <!-- 编码申请预览--> |
| | | <FormTemplateDialog |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 枚举注入--> |
| | | <el-dialog :visible.sync="enumVisible" append-to-body title="枚举注入" :before-close="this.enumBeforeClose"> |
| | | <el-dialog :before-close="this.enumBeforeClose" :visible.sync="enumVisible" append-to-body title="枚举注入"> |
| | | <!-- 渲染表格及按钮 --> |
| | | <!-- 渲染表格及按钮 --> |
| | | <el-alert |
| | | title="请新增后点击单元格输入枚举数据" |
| | | type="success" |
| | | :closable="false" |
| | | style="margin-bottom: 10px;display: inline-block" |
| | | :closable="false"> |
| | | title="请新增后点击单元格输入枚举数据" |
| | | type="success"> |
| | | </el-alert> |
| | | <div> |
| | | <el-button icon="el-icon-plus" type="primary" @click="addRow">新增</el-button> |
| | |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="small" type="text" plain @click="enumDeleteRow"> |
| | | <el-button plain size="small" type="text" @click="enumDeleteRow"> |
| | | 移除 |
| | | </el-button> |
| | | </template> |
| | |
| | | <el-radio-group v-model="injectOption.classifyInvokeLevel"> |
| | | <el-radio label="min">最小层</el-radio> |
| | | <el-radio label="max">指定层</el-radio> |
| | | <el-input-number v-if="this.injectOption.classifyInvokeLevel == 'max'" v-model="injectOption.classifyNumber" :max="10" :min="0" |
| | | <el-input-number v-if="this.injectOption.classifyInvokeLevel == 'max'" |
| | | v-model="injectOption.classifyNumber" :max="10" :min="0" |
| | | controls-position="right"></el-input-number> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 属性分组--> |
| | | <el-dialog :visible.sync="attrVisible" append-to-body :before-close="attrClose" style="width: 800px; left:30vw;top: 10vh ;" |
| | | <el-dialog :before-close="attrClose" :visible.sync="attrVisible" append-to-body |
| | | style="width: 800px; left:30vw;top: 10vh ;" |
| | | title="输入分组的名称"> |
| | | <el-form ref="form" label-width="70px"> |
| | | <el-form-item label="属性分组"> |
| | |
| | | </el-container> |
| | | </el-dialog> |
| | | <!-- 全屏编辑--> |
| | | <el-dialog :visible.sync="attrEditVisible" append-to-body fullscreen="true" :before-close="escEdit" > |
| | | <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" @editCloseChildren="editClose" :editStyleFlag="editStyleFlag" :editOpenFlag="editOpenFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud> |
| | | <el-dialog :before-close="escEdit" :visible.sync="attrEditVisible" append-to-body fullscreen="true"> |
| | | <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :crudArrayFlag="this.crudArrayFlag" |
| | | :editOpenFlag="editOpenFlag" :editStyleFlag="editStyleFlag" |
| | | @editCloseChildren="editClose"></attrCrud> |
| | | </el-dialog> |
| | | <!-- 组合规则--> |
| | | <formula-editor :systemVariableTableData="systemVariableTableData" |
| | | <formula-editor :componentRuleText="componentRuleText" |
| | | :systemVariableTableData="systemVariableTableData" |
| | | :thisSceneTableData="thisSceneTableData" |
| | | :visible.sync="isShowformulaEdit" |
| | | @updateFormulaContent="updataFormlaContent" |
| | | :componentRuleText="componentRuleText" |
| | | ></formula-editor> |
| | | <!-- 新增 --> |
| | | <el-dialog :visible.sync="addVisible" append-to-body title="从业务类型中选择属性"> |
| | | <avue-crud ref="AddOriginPlace" :data="businessData" :option="businessOption" @selection-change="businessSelect"> |
| | | <avue-crud ref="AddOriginPlace" :data="businessData" :option="businessOption" |
| | | @selection-change="businessSelect"> |
| | | <template slot="menuLeft"> |
| | | <div style="display: flex;"> |
| | | <el-select v-model="SelectValue" placeholder="请选择" style="width: 150px !important;"> |
| | |
| | | style="width: 150px"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="width: 400px;margin-left: 20px" v-model="SelectFInd"></el-input> |
| | | <el-input v-model="SelectFInd" style="width: 400px;margin-left: 20px"></el-input> |
| | | <el-button size="small" style="margin-left: 10px" @click="AddFindHandler">查询</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- 参照配置--> |
| | | <refer-config-dialog |
| | | :display="referConfigVisble" |
| | | @setReferConfigValue="setReferConfigValue" |
| | | :referConfigOption="referConfigOption" |
| | | ></refer-config-dialog> |
| | | <refer-config-dialog |
| | | :display="referConfigVisble" |
| | | :referConfigOption="referConfigOption" |
| | | @setReferConfigValue="setReferConfigValue" |
| | | ></refer-config-dialog> |
| | | |
| | | </div> |
| | | <el-table :data="ProData" |
| | | style="width: 100%" |
| | | :height="this.editStyleFlag? 800 : 343" |
| | | @cell-click="handleCellClicks" |
| | | @select="selectHandle" |
| | | @selection-change="selectionChange" |
| | | @row-click="rowClick" |
| | | v-if="this.crudArrayFlag" |
| | | <el-table v-if="this.crudArrayFlag" |
| | | ref="referAttrCrud" |
| | | v-loading="loading" |
| | | :data="ProData" |
| | | :height="this.editStyleFlag? 800 : 343" |
| | | style="width: 100%" |
| | | @select="selectHandle" |
| | | @cell-click="handleCellClicks" |
| | | @selection-change="selectionChange" |
| | | @row-click="rowClick" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | | width="55" fixed> |
| | | fixed |
| | | type="selection" width="55"> |
| | | </el-table-column> |
| | | <!--<el-table-column fixed label="序号" type="index" width="55"></el-table-column>--> |
| | | <el-table-column v-for="(item,index) in this.option.column" :key="item.id" |
| | | <el-table-column v-for="(item,index) in this.option.column" v-if="item.edit !='referName'" |
| | | :key="item.id" |
| | | :fixed="item.fixed" |
| | | :formatter="formAttr" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :formatter="formAttr" |
| | | :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')" |
| | | :show-overflow-tooltip="true" |
| | | :sortable="item.sortable" |
| | | :fixed="item.fixed" |
| | | :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')" |
| | | align="center" |
| | | v-if="item.edit !='referName'" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-input ref="inputRef" v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" v-model="row[item.prop]" |
| | | @blur="saveRows" autofocus ></el-input> |
| | | <el-input-number size="small" controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]" |
| | | @blur="saveRows" :style="{width:(item.width-10)+'px'}"></el-input-number> |
| | | <el-select v-model="row[item.prop]" filterable allow-create default-first-option slot="prepend" v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " @blur="selectChangeHandler(item.editConfig,index)"> |
| | | <el-input v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" |
| | | ref="inputRef" |
| | | v-model="row[item.prop]" |
| | | autofocus @blur="saveRows"></el-input> |
| | | <el-input-number v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]" |
| | | :style="{width:(item.width-10)+'px'}" |
| | | controls-position="right" |
| | | size="small" @blur="saveRows"></el-input-number> |
| | | <el-select v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " slot="prepend" v-model="row[item.prop]" allow-create default-first-option |
| | | filterable |
| | | @blur="selectChangeHandler(item.editConfig,index)"> |
| | | <el-option |
| | | v-for="optionItem in item.data" |
| | | :key="optionItem.dictValue" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | <el-switch |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" :disabled="!editOpenFlag" |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true" |
| | | inactive-value="false"> |
| | | </el-switch> |
| | | <span v-else>{{ row[item.prop] }}</span> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto,listByFlag} from '@/api/template/templateAttr' |
| | | import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto, listByFlag} from '@/api/template/templateAttr' |
| | | import {getList} from "@/api/refer/table"; |
| | | import func from "@/util/func"; |
| | | |
| | |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | checkStatus:{ |
| | | checkStatus: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | //控制是否开启编辑 |
| | | editOpenFlag:{ |
| | | editOpenFlag: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | editStyleFlag:{ |
| | | editStyleFlag: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | crudArrayFlag:{ |
| | | crudArrayFlag: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | }, |
| | | watch:{ |
| | | crudOid:{ |
| | | handler(newval,oldval){ |
| | | if(newval){ |
| | | this.editOpenFlag=false |
| | | watch: { |
| | | crudOid: { |
| | | handler(newval, oldval) { |
| | | if (newval) { |
| | | this.editOpenFlag = false |
| | | } |
| | | } |
| | | }, |
| | | crudArrayFlag:{ |
| | | handler(newval,olaval){ |
| | | console.log('crudArrayFlag',newval) |
| | | crudArrayFlag: { |
| | | handler(newval, olaval) { |
| | | console.log('crudArrayFlag', newval) |
| | | } |
| | | }, |
| | | crudArray:{ |
| | | handler(newval,oldval){ |
| | | if(newval != undefined){ |
| | | if(newval.length>=1){ |
| | | this.crudArrayFlag=true |
| | | }else{ |
| | | this.crudArrayFlag=false |
| | | crudArray: { |
| | | handler(newval, oldval) { |
| | | if (newval != undefined) { |
| | | if (newval.length >= 1) { |
| | | this.crudArrayFlag = true |
| | | } else { |
| | | this.crudArrayFlag = false |
| | | } |
| | | } |
| | | }, |
| | | deep:true, |
| | | immediate:true |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | Formlist:{ |
| | | handler(newval,oldval){ |
| | | if(newval.length === 0){ |
| | | this.crudArrayFlag=false |
| | | Formlist: { |
| | | handler(newval, oldval) { |
| | | if (newval.length === 0) { |
| | | this.crudArrayFlag = false |
| | | return |
| | | } |
| | | } |
| | | }, |
| | | ProData:{ |
| | | handler(newval,oldval){ |
| | | if(newval){ |
| | | this.loading=true; |
| | | ProData: { |
| | | handler(newval, oldval) { |
| | | if (newval) { |
| | | this.loading = true; |
| | | setTimeout(() => { |
| | | this.loading=false |
| | | this.loading = false |
| | | }, 1000); |
| | | } |
| | | } |
| | | }, |
| | | 'injectOption.classifyInvokeAttr': function(newVal) { |
| | | 'injectOption.classifyInvokeAttr': function (newVal) { |
| | | if (newVal === "name") { |
| | | this.injectOption.classifyInvokeAttrName='分类名称' |
| | | this.injectOption.classifyInvokeAttrName = '分类名称' |
| | | } else if (newVal === "id") { |
| | | this.injectOption.classifyInvokeAttrName='分类代号' |
| | | this.injectOption.classifyInvokeAttrName = '分类代号' |
| | | } |
| | | return ''; |
| | | }, |
| | | editOpenFlag:{ |
| | | handler(newval,oldval){ |
| | | console.log('editOpenFlag',newval) |
| | | editOpenFlag: { |
| | | handler(newval, oldval) { |
| | | console.log('editOpenFlag', newval) |
| | | }, |
| | | deep:true, |
| | | immediate:true |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | //全屏编辑高度状态 |
| | | editStyleFlag:false, |
| | | loading:false, |
| | | referConfigText:"", |
| | | referConfigVisble:false, |
| | | referConfigOption:{ |
| | | referConfig:'', |
| | | editStyleFlag: false, |
| | | loading: false, |
| | | referConfigText: "", |
| | | referConfigVisble: false, |
| | | referConfigOption: { |
| | | referConfig: '', |
| | | }, |
| | | screenWidth: document.documentElement.clientWidth, // 屏幕宽度 |
| | | //当前单元格 |
| | | CurrentCell:'', |
| | | CurrentCell: '', |
| | | // 新增 |
| | | SelectValue:"", |
| | | SelectFInd:"", |
| | | SelectOption:[ |
| | | SelectValue: "", |
| | | SelectFInd: "", |
| | | SelectOption: [ |
| | | { |
| | | value: 'name', |
| | | label: '属性中文名称' |
| | |
| | | } |
| | | ], |
| | | //参照 |
| | | referVisible:false, |
| | | crudArrayFlag:false, |
| | | referVisible: false, |
| | | crudArrayFlag: false, |
| | | editingRows: null, |
| | | editShows:"", |
| | | editShows: "", |
| | | attrFlag: false, |
| | | referObject:{}, |
| | | referObject: {}, |
| | | //编码申请预览option |
| | | applicationoption: { |
| | | column: [] |
| | |
| | | // 级联单选 |
| | | selectRow: '', |
| | | //级联单选数组 |
| | | selectRowArr:[], |
| | | selectRowArr: [], |
| | | // 级联data |
| | | CascadeData: [], |
| | | // 级联option |
| | |
| | | addvisible: false, |
| | | //分类注入option |
| | | injectOption: { |
| | | classifyInvokeAttrName:'分类名称', |
| | | classifyInvokeAttrName: '分类名称', |
| | | classifyInvokeAttr: "name", |
| | | classifyInvokeEditFlag: "true", |
| | | classifyInvokeLevel:'min', |
| | | classifyInvokeLevel: 'min', |
| | | //分类注入计数器 |
| | | classifyNumber:0, |
| | | classifyNumber: 0, |
| | | }, |
| | | // 属性验证输入框 |
| | | RulesForm: { |
| | | expressionText: "", |
| | | TestContent: "", |
| | | ruleRowBds:"" |
| | | ruleRowBds: "" |
| | | }, |
| | | //属性验证规则配置 |
| | | rulesOption: { |
| | |
| | | { |
| | | label: "数据类型", |
| | | prop: "attrDataType", |
| | | formatter:function(row,column){ |
| | | formatter: function (row, column) { |
| | | let vciFieldTypeMap = { |
| | | VTBoolean: "布尔型", |
| | | VTClob: "长文本", |
| | |
| | | { |
| | | label: "可空", |
| | | prop: "nullableFlag", |
| | | formatter:function(row,column){return row.nullableFlag=='true' || row.nullableFlag=='1'?'是':'否'} |
| | | formatter: function (row, column) { |
| | | return row.nullableFlag == 'true' || row.nullableFlag == '1' ? '是' : '否' |
| | | } |
| | | }, |
| | | { |
| | | label: "默认值", |
| | |
| | | width: 90, |
| | | fixed: true |
| | | }, { |
| | | label: "属性英文编号", |
| | | prop: "id", |
| | | fixed: true, |
| | | cell: false, |
| | | labelWidth: 110, |
| | | width: 125, |
| | | sortable: false, |
| | | }, |
| | | label: "属性英文编号", |
| | | prop: "id", |
| | | fixed: true, |
| | | cell: false, |
| | | labelWidth: 110, |
| | | width: 125, |
| | | sortable: false, |
| | | }, |
| | | { |
| | | label: "属性中文名称", |
| | | prop: "name", |
| | |
| | | ], |
| | | List: [] |
| | | }, |
| | | vciFieldTypeMap : { |
| | | vciFieldTypeMap: { |
| | | VTBoolean: "布尔型", |
| | | VTClob: "长文本", |
| | | VTDate: "日期", |
| | |
| | | VTString: "字符串" |
| | | }, |
| | | //时间格式下拉框 |
| | | codeDataFlag:false, |
| | | // 组合规单元格编辑回填 |
| | | componentRuleText:"", |
| | | codeDataFlag: false, |
| | | // 组合规单元格编辑回填 |
| | | componentRuleText: "", |
| | | //模板属性下拉设置switch |
| | | selectoptions: [{ |
| | | value: 'keyAttrFlag', |
| | |
| | | }], |
| | | //模板属性下拉选中值 |
| | | selectvalue: 'keyAttrFlag', |
| | | switchvalue:'false' |
| | | switchvalue: 'false' |
| | | } |
| | | }, |
| | | computed:{ |
| | | computed: { |
| | | attrOids() { |
| | | let oids = []; |
| | | this.attrSelectList.forEach(ele => { |
| | |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | this.option.column.forEach((item,index) => { |
| | | this.option.column.forEach((item, index) => { |
| | | if (item.edit == 'select') { |
| | | this.selectChangeHandler(item.editConfig,index) |
| | | this.selectChangeHandler(item.editConfig, index) |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | //新增搜索 |
| | | AddFindHandler(){ |
| | | if(this.SelectValue == 'id'){ |
| | | const masterParameter={ |
| | | 'conditionMap[id]':this.SelectFInd |
| | | AddFindHandler() { |
| | | if (this.SelectValue == 'id') { |
| | | const masterParameter = { |
| | | 'conditionMap[id]': this.SelectFInd |
| | | } |
| | | this.BuineAttrByBtm(masterParameter); |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | this.SelectValue = "" |
| | | this.SelectFInd = "" |
| | | } else if (this.SelectValue == 'name') { |
| | | const masterParameter = { |
| | | 'conditionMap[name]': this.SelectFInd |
| | | } |
| | | this.BuineAttrByBtm(masterParameter) |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | this.SelectValue = "" |
| | | this.SelectFInd = "" |
| | | } |
| | | }, |
| | | //参照配置子组件 |
| | | echoReferConfig(val){ |
| | | this.referObject=val |
| | | this.$set(this.CurrentCell,'referConfig',JSON.stringify(val)) |
| | | echoReferConfig(val) { |
| | | this.referObject = val |
| | | this.$set(this.CurrentCell, 'referConfig', JSON.stringify(val)) |
| | | |
| | | }, |
| | | //可输可选下拉 |
| | | selectChangeHandler(editConfig,index){ |
| | | let that=this; |
| | | selectChangeHandler(editConfig, index) { |
| | | let that = this; |
| | | /*if(that.option.column[index].data && that.option.column[index].data.length>=0){ |
| | | return; |
| | | }*/ |
| | | listByFlag(editConfig.extraParams).then(res=>{ |
| | | that.option.column[index].data=res.data.data; |
| | | listByFlag(editConfig.extraParams).then(res => { |
| | | that.option.column[index].data = res.data.data; |
| | | }) |
| | | }, |
| | | //属性分组按钮 |
| | | attrVisibleHandle() { |
| | | if (this.attrSelectList < 1) { |
| | | if (this.attrSelectList < 1) { |
| | | this.$message.warning('请选择模板属性') |
| | | } else { |
| | | } else { |
| | | this.attrVisible = true; |
| | | } |
| | | }, |
| | | //属性分组提交 |
| | | attrHandle() { |
| | | this.attrSelectList.forEach(item=>{ |
| | | item.attributeGroup=this.attrModel |
| | | this.attrSelectList.forEach(item => { |
| | | item.attributeGroup = this.attrModel |
| | | }) |
| | | if(this.CurrentCell){ |
| | | if (this.CurrentCell) { |
| | | this.$set(this.CurrentCell, 'attributeGroup', this.attrModel) |
| | | }else { |
| | | } else { |
| | | this.$set(this.attrSelectList[0], 'attributeGroup', this.attrModel) |
| | | } |
| | | this.attrClose() |
| | |
| | | attrRemove() { |
| | | this.attrModel = "" |
| | | }, |
| | | attrClose(){ |
| | | attrClose() { |
| | | this.attrModel = ""; |
| | | this.attrVisible=false |
| | | this.attrVisible = false |
| | | }, |
| | | //表格数据 |
| | | CrudRend() { |
| | | if (this.crudOid != '') { |
| | | gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid,limit:-1}).then(res => { |
| | | this.loading=true |
| | | gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid, limit: -1}).then(res => { |
| | | this.loading = true |
| | | setTimeout(() => { |
| | | this.ProData = res.data.data; |
| | | this.loading=false |
| | | this.loading = false |
| | | }, 1000); |
| | | |
| | | }).catch(res => { |
| | |
| | | }) |
| | | if (!isCopy) { |
| | | citem.oid = '' |
| | | this.busineAddList=Object.assign(citem, { |
| | | this.busineAddList = Object.assign(citem, { |
| | | orderNum: ++ordernum, |
| | | attributeDataType: citem.attrDataType, |
| | | attributeDataTypeText: this.vciFieldTypeMap[citem.attrDataType], |
| | |
| | | queryAttrFlag: 'true', |
| | | seniorQueryAttrFlag: 'true', |
| | | attrTableWidth: 120, |
| | | ts:"" |
| | | ts: "" |
| | | }) |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) |
| | | } |
| | |
| | | }) |
| | | }, |
| | | //业务类型数据 |
| | | BuineAttrByBtm(masterParameter){ |
| | | AttrByBtm({'conditionMap[oid]': this.crudOid,...masterParameter}).then(res => { |
| | | BuineAttrByBtm(masterParameter) { |
| | | AttrByBtm({'conditionMap[oid]': this.crudOid, ...masterParameter}).then(res => { |
| | | this.businessData = res.data.data; |
| | | }) |
| | | }, |
| | |
| | | CascadeAddHandle() { |
| | | let CascadeString = ""; |
| | | CascadeString = this.selectRowArr.id + (this.selectRowArr.name); |
| | | if(this.CurrentCell){ |
| | | if (this.CurrentCell) { |
| | | this.$set(this.CurrentCell, 'parentCode', CascadeString) |
| | | }else { |
| | | } else { |
| | | this.$set(this.attrSelectList[0], 'parentCode', CascadeString) |
| | | } |
| | | this.CascadeVisible = false; |
| | | }, |
| | | //级联属性清除 |
| | | casRemove() { |
| | | this.selectRow = "" |
| | | this.selectRow = ""; |
| | | this.$set(this.CurrentCell, 'parentCode', this.selectRow); |
| | | this.CascadeVisible = false; |
| | | |
| | | }, |
| | | // 级联属性行单选 |
| | | CascaderowClick(row) { |
| | | this.selectRow = row.$index; |
| | | this.selectRowArr=row |
| | | this.selectRowArr = row |
| | | }, |
| | | // 排序预览按钮 |
| | | orderHandle(){ |
| | | orderHandle() { |
| | | this.$refs.referAttrCrud.sort("orderNum"); |
| | | }, |
| | | //表格单选 |
| | |
| | | selectionChange(list) { |
| | | this.attrSelectList = list; |
| | | }, |
| | | rowClick(row){ |
| | | rowClick(row) { |
| | | this.$refs.referAttrCrud.clearSelection(); |
| | | this.attrSelectList = [row]; |
| | | this.$refs.referAttrCrud.setCurrentRow(row); |
| | |
| | | this.$refs.referAttrCrud.sort("orderNum"); |
| | | var ischeck = true; |
| | | console.log(this.ProData) |
| | | this.ProData.forEach((item,index)=>{ |
| | | if((item.requireFlag && item.requireFlag.toString()=='true') && (item.readOnlyFlag && item.readOnlyFlag.toString()=='true')){ |
| | | this.$message.warning(item.name+"("+item.id+")必输的属性不能是只读"); |
| | | this.ProData.forEach((item, index) => { |
| | | if ((item.requireFlag && item.requireFlag.toString() == 'true') && (item.readOnlyFlag && item.readOnlyFlag.toString() == 'true')) { |
| | | this.$message.warning(item.name + "(" + item.id + ")必输的属性不能是只读"); |
| | | console.log(item) |
| | | ischeck=false; |
| | | ischeck = false; |
| | | return; |
| | | } |
| | | var num=0; |
| | | if(item.componentRule){ |
| | | var num = 0; |
| | | if (item.componentRule) { |
| | | //组合规则 |
| | | num++ |
| | | console.log('componentRule',num) |
| | | console.log('componentRule', num) |
| | | } |
| | | if(item.enumString || item.enumId){ |
| | | if (item.enumString || item.enumId) { |
| | | //枚举 |
| | | num++ |
| | | console.log('enumString',num) |
| | | console.log('enumString', num) |
| | | } |
| | | if(item.referConfig || item.referBtmId){ |
| | | if (item.referConfig || item.referBtmId) { |
| | | //参照 |
| | | num++ |
| | | console.log('referConfig',num) |
| | | console.log('referConfig', num) |
| | | } |
| | | if(item.codeDateFormat){ |
| | | if (item.codeDateFormat) { |
| | | //时间格式 |
| | | num++ |
| | | console.log('codeDateFormat',num) |
| | | console.log('codeDateFormat', num) |
| | | } |
| | | //如果空后台返回none |
| | | if(item.classifyInvokeLevel && item.classifyInvokeLevel != 'none'){ |
| | | if (item.classifyInvokeLevel && item.classifyInvokeLevel != 'none') { |
| | | //分类注入 |
| | | num++ |
| | | console.log('classifyInvokeLevel',num) |
| | | console.log('classifyInvokeLevel', num) |
| | | console.log(item.classifyInvokeLevel) |
| | | } |
| | | if(num>1 && ischeck){ |
| | | if (num > 1 && ischeck) { |
| | | this.$message({ |
| | | showClose: true, |
| | | message: item.name+"("+item.id+") 属性只能是组合规则,枚举,参照,时间格式,分类注入中的一种", |
| | | message: item.name + "(" + item.id + ") 属性只能是组合规则,枚举,参照,时间格式,分类注入中的一种", |
| | | type: 'warning' |
| | | }); |
| | | ischeck=false; |
| | | ischeck = false; |
| | | return; |
| | | } |
| | | }) |
| | | if(!ischeck){ |
| | | return ; |
| | | if (!ischeck) { |
| | | return; |
| | | } |
| | | // 新函数用于执行batchAddSave方法 |
| | | const executeBatchAddSave = () => { |
| | | batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => { |
| | | this.$message.success('保存成功') |
| | | this.editOpenFlag=false; |
| | | this.editOpenFlag = false; |
| | | // 调用父组件修改按钮状态 |
| | | this.$emit('editCloseChildren') |
| | | }).catch(()=>{ |
| | | }).catch(() => { |
| | | this.$message.warning('保存失败,请查看控制台输出!') |
| | | }); |
| | | } |
| | |
| | | }, |
| | | //表格行编辑 |
| | | handleCellClicks(row, column) { |
| | | if(this.editOpenFlag){ |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | this.CurrentCell=row; |
| | | if(column.property == 'referConfig' ){ |
| | | this.referConfigVisble= true; |
| | | this.referConfigOption = { |
| | | referConfig: this.CurrentCell.referConfig || '', |
| | | } |
| | | if(this.CurrentCell.referConfig == ''){ |
| | | this.referConfigOption = { |
| | | referConfig:'', |
| | | } |
| | | } |
| | | // this.$refs.referConfigFormDialog.onloadAttrData(); |
| | | }else if(column.property == 'classifyInvokeText'){ |
| | | this.injectVisible=true; |
| | | if (this.CurrentCell.classifyInvokeAttr != '') { |
| | | this.injectOption = { |
| | | classifyInvokeAttr: this.CurrentCell.classifyInvokeAttr, |
| | | classifyInvokeAttrName: this.CurrentCell.classifyInvokeAttrName, |
| | | classifyInvokeEditFlag: this.CurrentCell.classifyInvokeEditFlag, |
| | | classifyInvokeLevel: this.CurrentCell.classifyInvokeLevel == 'min' ? 'min' : 'max', |
| | | classifyNumber: this.CurrentCell.classifyInvokeLevel == 'min' ? '' : this.CurrentCell.classifyInvokeLevel |
| | | }; |
| | | } else { |
| | | this.injectHandleReset(); |
| | | } |
| | | }else if(column.property == 'componentRule'){ |
| | | if(this.CurrentCell){ |
| | | this.CurrentCell.componentRule=this.componentRuleText; |
| | | } |
| | | this.isShowformulaEdit = true; |
| | | }else if(column.property == 'enumString'){ |
| | | this.enumVisible=true; |
| | | if(this.attrSelectList[0].enumString != ""){ |
| | | this.tableData=JSON.parse(this.attrSelectList[0].enumString) |
| | | return |
| | | } |
| | | }else if(column.property == 'parentCode'){ |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.CurrentCell.oid, |
| | | limit:-1 |
| | | }).then(res => { |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | | this.CascadeVisible=true; |
| | | }else if(column.property == 'verifyRule'){ |
| | | this.RulesForm.expressionTextt=this.CurrentCell.verifyRule; |
| | | this.rulesVisible=true; |
| | | }else if(column.property == 'attributeGroup'){ |
| | | this.attrVisible = true; |
| | | if(this.CurrentCell.attributeGroup !== ''){ |
| | | this.attrModel=this.CurrentCell.attributeGroup |
| | | } |
| | | } |
| | | } |
| | | if (this.editOpenFlag) { |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | this.CurrentCell = row; |
| | | if (column.property == 'referConfig') { |
| | | this.referConfigVisble = true; |
| | | this.referConfigOption = { |
| | | referConfig: this.CurrentCell.referConfig || '', |
| | | } |
| | | if (this.CurrentCell.referConfig == '') { |
| | | this.referConfigOption = { |
| | | referConfig: '', |
| | | } |
| | | } |
| | | // this.$refs.referConfigFormDialog.onloadAttrData(); |
| | | } else if (column.property == 'classifyInvokeText') { |
| | | this.injectVisible = true; |
| | | if (this.CurrentCell.classifyInvokeAttr != '') { |
| | | this.injectOption = { |
| | | classifyInvokeAttr: this.CurrentCell.classifyInvokeAttr, |
| | | classifyInvokeAttrName: this.CurrentCell.classifyInvokeAttrName, |
| | | classifyInvokeEditFlag: this.CurrentCell.classifyInvokeEditFlag, |
| | | classifyInvokeLevel: this.CurrentCell.classifyInvokeLevel == 'min' ? 'min' : 'max', |
| | | classifyNumber: this.CurrentCell.classifyInvokeLevel == 'min' ? '' : this.CurrentCell.classifyInvokeLevel |
| | | }; |
| | | } else { |
| | | // this.injectHandleReset(); |
| | | } |
| | | } else if (column.property == 'componentRule') { |
| | | if (this.CurrentCell) { |
| | | this.CurrentCell.componentRule = this.componentRuleText; |
| | | } |
| | | this.isShowformulaEdit = true; |
| | | } else if (column.property == 'enumString') { |
| | | this.enumVisible = true; |
| | | if (this.attrSelectList[0].enumString != "") { |
| | | this.tableData = JSON.parse(this.attrSelectList[0].enumString) |
| | | return |
| | | } |
| | | } else if (column.property == 'parentCode') { |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.CurrentCell.oid, |
| | | limit: -1 |
| | | }).then(res => { |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | | this.CascadeVisible = true; |
| | | } else if (column.property == 'verifyRule') { |
| | | this.RulesForm.expressionTextt = this.CurrentCell.verifyRule; |
| | | this.rulesVisible = true; |
| | | } else if (column.property == 'attributeGroup') { |
| | | this.attrVisible = true; |
| | | if (this.CurrentCell.attributeGroup !== '') { |
| | | this.attrModel = this.CurrentCell.attributeGroup |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | saveRows() { |
| | | this.editingRows = null; |
| | |
| | | this.$message.warning('请选择一条模板属性') |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.enumVisible = true; |
| | | if(this.attrSelectList[0].enumString != ""){ |
| | | this.tableData=JSON.parse(this.attrSelectList[0].enumString) |
| | | if (this.attrSelectList[0].enumString != "") { |
| | | this.tableData = JSON.parse(this.attrSelectList[0].enumString) |
| | | return |
| | | } |
| | | |
| | | } |
| | | }, |
| | | enumBeforeClose(done){ |
| | | this.tableData=[] |
| | | enumBeforeClose(done) { |
| | | this.tableData = [] |
| | | done() |
| | | }, |
| | | enumCancell(){ |
| | | this.tableData=[] |
| | | this.enumVisible=false; |
| | | enumCancell() { |
| | | this.tableData = [] |
| | | this.enumVisible = false; |
| | | }, |
| | | //枚举注入多选框 |
| | | handleSelectionChange(row) { |
| | |
| | | }, |
| | | //枚举注入保存 |
| | | enumAddHandle() { |
| | | if(this.tableData.length>=1){ |
| | | let hasError = false; // 添加一个变量 |
| | | this.tableData.forEach((item, index) => { |
| | | if (item.key === '') { |
| | | this.$message.warning(`第${index + 1}行的选项值不能为空`); |
| | | hasError = true; |
| | | return; |
| | | } else if (item.value === '') { |
| | | this.$message.warning(`第${index + 1}行的选项中文标签不能为空`); |
| | | hasError = true; |
| | | return; |
| | | } |
| | | }); |
| | | // 保存执行逻辑 |
| | | if (!hasError) { |
| | | if (this.CurrentCell) { |
| | | this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.tableData)); |
| | | this.enumVisible = false; |
| | | } else { |
| | | this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.tableData)); |
| | | this.tableData=[]; |
| | | this.enumVisible = false; |
| | | } |
| | | } |
| | | }else { |
| | | this.$message.warning('请添加枚举注入数据!') |
| | | } |
| | | if (this.tableData.length >= 1) { |
| | | let hasError = false; // 添加一个变量 |
| | | this.tableData.forEach((item, index) => { |
| | | if (item.key === '') { |
| | | this.$message.warning(`第${index + 1}行的选项值不能为空`); |
| | | hasError = true; |
| | | return; |
| | | } else if (item.value === '') { |
| | | this.$message.warning(`第${index + 1}行的选项中文标签不能为空`); |
| | | hasError = true; |
| | | return; |
| | | } |
| | | }); |
| | | // 保存执行逻辑 |
| | | if (!hasError) { |
| | | if (this.CurrentCell) { |
| | | this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.tableData)); |
| | | this.enumVisible = false; |
| | | } else { |
| | | this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.tableData)); |
| | | this.tableData = []; |
| | | this.enumVisible = false; |
| | | } |
| | | } |
| | | } else { |
| | | this.$message.warning('请添加枚举注入数据!') |
| | | } |
| | | }, |
| | | // 将正在编辑的行的状态变为 null,即退出编辑状态 |
| | | saveRow() { |
| | | this.editingRow = null; |
| | | }, |
| | | //验证规则按钮 |
| | | ruleAddHandler(){ |
| | | ruleAddHandler() { |
| | | if (this.attrSelectList < 1) { |
| | | this.$message.warning('请选择模板属性') |
| | | } else{ |
| | | this.rulesVisible=true |
| | | } else { |
| | | this.rulesVisible = true |
| | | } |
| | | |
| | | }, |
| | | //规则校验,双击表单事件 |
| | | handleRulesRowDBLClick(row) { |
| | | this.ruleRowBds=row.bds |
| | | this.ruleRowBds = row.bds |
| | | this.RulesForm.expressionText = row.bds |
| | | }, |
| | | // 验证规则清除内容 |
| | | rulesremove() { |
| | | this.RulesForm.expressionText = "" |
| | | this.RulesForm.TestContent = "" |
| | | this.$set(this.CurrentCell, 'verifyRule', '') |
| | | this.rulesVisible = false |
| | | }, |
| | | // 验证规则确定 |
| | | rulesHandle() { |
| | | if(this.CurrentCell){ |
| | | this.$set(this.CurrentCell,'verifyRule',this.RulesForm.expressionText) |
| | | }else { |
| | | this.attrSelectList.forEach((item)=>{ |
| | | this.$set(item,'verifyRule',this.RulesForm.expressionText) |
| | | }) |
| | | this.rulesremove() |
| | | } |
| | | if (this.CurrentCell) { |
| | | this.$set(this.CurrentCell, 'verifyRule', this.RulesForm.expressionText) |
| | | } else { |
| | | this.attrSelectList.forEach((item) => { |
| | | this.$set(item, 'verifyRule', this.RulesForm.expressionText) |
| | | }) |
| | | this.rulesremove() |
| | | } |
| | | this.rulesVisible = false |
| | | }, |
| | | //验证规则检查 |
| | | rulesExamine() { |
| | | const regex = new RegExp(this.rulesData.ruleRowBds); |
| | | if(regex.test(this.RulesForm.TestContent)){ |
| | | if (regex.test(this.RulesForm.TestContent)) { |
| | | this.$message.success('校验成功') |
| | | } |
| | | }, |
| | |
| | | let data = { |
| | | "注入类型": this.injectOption.classifyInvokeAttr, |
| | | "注入类型名称": this.injectOption.classifyInvokeAttrName, |
| | | "层级设置": this.injectOption.classifyInvokeLevel=='max'?this.injectOption.classifyNumber :'min', |
| | | "层级设置": this.injectOption.classifyInvokeLevel == 'max' ? this.injectOption.classifyNumber : 'min', |
| | | "是否可修改": this.injectOption.classifyInvokeEditFlag |
| | | } |
| | | //勾选操作 |
| | | for (const key in this.injectOption) { |
| | | this.attrSelectList[0][key] = this.injectOption[key]; |
| | | //如果是指定层赋值为数字 |
| | | if(this.injectOption.classifyInvokeLevel !== 'min'){ |
| | | this.attrSelectList[0].classifyInvokeLevel=this.injectOption.classifyNumber |
| | | }else { |
| | | this.attrSelectList[0].classifyInvokeLevel='min' |
| | | } |
| | | this.$set(this.attrSelectList[0],'classifyInvokeText',data) |
| | | //勾选操作 |
| | | for (const key in this.injectOption) { |
| | | this.attrSelectList[0][key] = this.injectOption[key]; |
| | | //如果是指定层赋值为数字 |
| | | if (this.injectOption.classifyInvokeLevel !== 'min') { |
| | | this.attrSelectList[0].classifyInvokeLevel = this.injectOption.classifyNumber |
| | | } else { |
| | | this.attrSelectList[0].classifyInvokeLevel = 'min' |
| | | } |
| | | this.injectHandleReset() |
| | | this.$set(this.attrSelectList[0], 'classifyInvokeText', data) |
| | | } |
| | | // this.injectHandleReset() |
| | | |
| | | if(this.injectOption.classifyInvokeLevel !== 'min'){ |
| | | this.injectOption.classifyInvokeLevel=this.injectOption.classifyNumber; |
| | | }else { |
| | | this.injectOption.classifyNumber=0; |
| | | if (this.injectOption.classifyInvokeLevel !== 'min') { |
| | | this.injectOption.classifyInvokeLevel = this.injectOption.classifyNumber; |
| | | } else { |
| | | this.injectOption.classifyNumber = 0; |
| | | } |
| | | this.injectVisible = false; |
| | | |
| | | }, |
| | | //分类注入清空 |
| | | injectHandleReset() { |
| | | this.injectOption.classifyInvokeAttrName = "分类名称"; |
| | | this.injectOption.classifyInvokeAttr = "name"; |
| | | this.injectOption.classifyInvokeLevel = "min"; |
| | | this.injectOption.classifyInvokeEditFlag = "true"; |
| | | this.injectOption.classifyNumber = "0"; |
| | | // this.injectOption.classifyInvokeAttrName = "分类名称"; |
| | | // this.injectOption.classifyInvokeAttr = "name"; |
| | | // this.injectOption.classifyInvokeLevel = "min"; |
| | | // this.injectOption.classifyInvokeEditFlag = "true"; |
| | | // this.injectOption.classifyNumber = "0"; |
| | | this.$set(this.CurrentCell, 'classifyInvokeText', '') |
| | | this.injectVisible = false; |
| | | }, |
| | | // 分类注入取消 |
| | | injectRemove() { |
| | |
| | | }, |
| | | //表格删除 |
| | | CrudRemove() { |
| | | this.attrSelectList.forEach((item)=>{ |
| | | this.attrSelectList.forEach((item) => { |
| | | const index = this.ProData.indexOf(item); |
| | | this.ProData.splice(index, 1) |
| | | }) |
| | |
| | | } else if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('请选择一条模板属性数据') |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.isShowformulaEdit=true |
| | | this.isShowformulaEdit = true |
| | | } |
| | | }, |
| | | //全屏编辑 |
| | |
| | | if (this.crudArray.length < 1) { |
| | | this.$message.warning('请选择一个模板') |
| | | } else { |
| | | this.editStyleFlag=true; |
| | | this.editStyleFlag = true; |
| | | this.attrEditVisible = true; |
| | | this.attrFlag = true; |
| | | } |
| | |
| | | escEdit() { |
| | | this.attrFlagChiledren = false; |
| | | this.attrEditVisible = false; |
| | | this.editStyleFlag=false; |
| | | this.editStyleFlag = false; |
| | | }, |
| | | //组合规则确定 |
| | | updataFormlaContent(val) { |
| | | if(this.CurrentCell){ |
| | | if (this.CurrentCell) { |
| | | this.$set(this.CurrentCell, 'componentRule', val.replace(/"/g, '')) |
| | | }else { |
| | | } else { |
| | | this.$set(this.attrRow, 'componentRule', val.replace(/"/g, '')) |
| | | } |
| | | |
| | | }, |
| | | setReferConfigValue(content){ |
| | | setReferConfigValue(content) { |
| | | let submitFormJson = JSON.stringify(content); |
| | | this.referConfigText=submitFormJson |
| | | if(this.CurrentCell){ |
| | | this.referConfigText = submitFormJson |
| | | if (this.CurrentCell) { |
| | | this.$set(this.CurrentCell, 'referConfig', JSON.stringify(content)) |
| | | }else { |
| | | } else { |
| | | this.$set(this.attrRow, 'referConfig', JSON.stringify(content)) |
| | | } |
| | | }, |
| | |
| | | console.log(val) |
| | | }, |
| | | //开启编辑 |
| | | editOpen(){ |
| | | this.editOpenFlag=true; |
| | | editOpen() { |
| | | this.editOpenFlag = true; |
| | | }, |
| | | //定义一个关闭编辑的方法供子组件使用 |
| | | editClose(){ |
| | | this.editOpenFlag=false; |
| | | editClose() { |
| | | this.editOpenFlag = false; |
| | | }, |
| | | //批量设置switch |
| | | batchSetFlag(value){ |
| | | this.attrSelectList.forEach(item=>{ |
| | | item[this.selectvalue]=value; |
| | | batchSetFlag(value) { |
| | | this.attrSelectList.forEach(item => { |
| | | item[this.selectvalue] = value; |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss" > |
| | | <style lang="scss" scoped> |
| | | .app { |
| | | /deep/ .el-button { |
| | | //margin: 0 10px 10px 0; |
| | | } |
| | | /deep/ .el-button { |
| | | //margin: 0 10px 10px 0; |
| | | } |
| | | } |
| | | |
| | | .el-button-group { |
| | | margin-right: 10px; |
| | | margin-bottom: 10px; |
| | |
| | | <template> |
| | | <el-container> |
| | | <!-- 左侧菜单--> |
| | | <el-aside > |
| | | <el-aside> |
| | | <basic-container style="overflow:hidden;"> |
| | | <div> |
| | | <div> |
| | | <div style="display: flex; flex-direction: column;"> |
| | | <div style="display: flex;"> |
| | | <el-button plain size="small" type="primary" @click="TreeAdd">添加</el-button> |
| | | <el-button plain size="small" type="primary" @click="TreeEdit">修改</el-button> |
| | | <el-button plain size="small" type="primary" @click="TreeDel">删除</el-button> |
| | | <el-button plain size="small" type="primary" @click="flushed">刷新</el-button> |
| | | <div> |
| | | <div style="display: flex; flex-direction: column;"> |
| | | <div style="display: flex;"> |
| | | <el-button plain size="small" type="primary" @click="TreeAdd">添加</el-button> |
| | | <el-button plain size="small" type="primary" @click="TreeEdit">修改</el-button> |
| | | <el-button plain size="small" type="primary" @click="TreeDel">删除</el-button> |
| | | <el-button plain size="small" type="primary" @click="flushed">刷新</el-button> |
| | | </div> |
| | | <div style="display: flex; margin-top: 10px"> |
| | | <el-button plain size="small" type="primary" @click="Enable">启用</el-button> |
| | | <el-button plain size="small" type="primary" @click="Deactivate">停用</el-button> |
| | | <el-button plain size="small" type="primary" @click.native="ImportExcel">导入</el-button> |
| | | <el-button plain size="small" type="primary" @click="ExportExcel">导出</el-button> |
| | | </div> |
| | | </div> |
| | | <div style="display: flex; margin-top: 10px"> |
| | | <el-button plain size="small" type="primary" @click="Enable">启用</el-button> |
| | | <el-button plain size="small" type="primary" @click="Deactivate">停用</el-button> |
| | | <el-button plain size="small" type="primary" @click.native="ImportExcel">导入</el-button> |
| | | <el-button plain size="small" type="primary" @click="ExportExcel">导出</el-button> |
| | | <div style="display: flex;justify-content: space-around;margin-top: 5px;margin-bottom: 5px"> |
| | | </div> |
| | | </div> |
| | | <div style="display: flex;justify-content: space-around;margin-top: 5px;margin-bottom: 5px"> |
| | | </div> |
| | | </div> |
| | | <!-- 树节点添加对话框--> |
| | | <el-dialog :title="this.TreeFlag ? '添加分类' :'添加主题库'" :before-close="TreeEscHandler" :visible.sync="TreeAddFormVisible" v-loading="AddLoading" append-to-body |
| | | style="width: 1700px;margin: auto"> |
| | | <el-form ref="myForm" :model="TreeAddform" :rules="rules"> |
| | | <el-form-item :label="this.TreeFlag ? '分类编号:' :'主题库编号:'" label-width="150px" style="display: inline-block" prop="id"> |
| | | <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item :label="this.TreeFlag ? '分类名称:' :'主题库名称:'" label-width="110px" style="display: inline-block" prop="name"> |
| | | <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="存储的业务类型:" label-width="150px" v-if="TreeFlagCode" prop="btmTypeName"> |
| | | <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" @focus="btmFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="描述:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="编码规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px" @focus="CodeFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="关键属性查询规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" @focus="Keyfouce" |
| | | style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="相似查询规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" @focus="simFouce" |
| | | style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="TreeEscHandler">取 消</el-button> |
| | | <el-button type="primary" @click="TreeAddHandler">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 修改对话框--> |
| | | <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="修改分类"> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'" @MasterHandler="MasterHandler" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode" :nodeClickList="nodeClickList" @referTreeForm="referTreeForm" @flushed="flushed"></classifyTreeform> |
| | | </el-dialog> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | style="height: calc(100vh - 230px);" |
| | | @node-click="nodeClick" |
| | | class="classifyTree" |
| | | > |
| | | </avue-tree> |
| | | <!-- 树节点添加对话框--> |
| | | <el-dialog v-loading="AddLoading" :before-close="TreeEscHandler" |
| | | :title="this.TreeFlag ? '添加分类' :'添加主题库'" :visible.sync="TreeAddFormVisible" append-to-body |
| | | style="width: 1700px;margin: auto"> |
| | | <el-form ref="myForm" :model="TreeAddform" :rules="rules"> |
| | | <el-form-item :label="this.TreeFlag ? '分类编号:' :'主题库编号:'" label-width="150px" prop="id" |
| | | style="display: inline-block"> |
| | | <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item :label="this.TreeFlag ? '分类名称:' :'主题库名称:'" label-width="110px" prop="name" |
| | | style="display: inline-block"> |
| | | <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="TreeFlagCode" label="存储的业务类型:" label-width="150px" prop="btmTypeName"> |
| | | <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" |
| | | @focus="btmFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="描述:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="编码规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px" |
| | | @focus="CodeFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="关键属性查询规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" style="width: 585px" |
| | | @focus="Keyfouce"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="相似查询规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" style="width: 585px" |
| | | @focus="simFouce"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="TreeEscHandler">取 消</el-button> |
| | | <el-button type="primary" @click="TreeAddHandler">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 修改对话框--> |
| | | <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="修改分类"> |
| | | <classifyTreeform ref="childForm" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode" :flag="'edit'" |
| | | :loneTreeNewForm="TreeList" :nodeClickList="nodeClickList" |
| | | :nodeList="nodeList" @MasterHandler="MasterHandler" @flushed="flushed" |
| | | @referTreeForm="referTreeForm"></classifyTreeform> |
| | | </el-dialog> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | class="classifyTree" |
| | | style="height: calc(100vh - 230px);" |
| | | @node-click="nodeClick" |
| | | > |
| | | </avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | |
| | | <!-- 右侧表格--> |
| | | <avue-tabs :option="tabOption" @change="handleChange"></avue-tabs> |
| | | <span v-if="type.prop==='tab1'"> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'renonly'" ></classifyTreeform> |
| | | <classifyTreeform ref="childForm" :flag="'renonly'" :loneTreeNewForm="TreeList" |
| | | :nodeList="nodeList"></classifyTreeform> |
| | | </span> |
| | | <span v-else-if="type.prop==='tab2'"> |
| | | <basic-container> |
| | | <avue-crud ref="textCrud" v-model="crudForm" v-loading="FormLoing" :data="this.Formlist" :option="this.crudTreeOption" |
| | | <avue-crud ref="textCrud" v-model="crudForm" v-loading="FormLoing" :data="this.Formlist" |
| | | :option="this.crudTreeOption" |
| | | @row-save="CrudRowSave" |
| | | @row-del="CrudRowDel" |
| | | @row-update="CrudRowUpdata" |
| | | @row-click="rowHandle" |
| | | > |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="selectRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio> |
| | | <el-radio v-model="selectRow" :label="row.$index" |
| | | style="padding-left: 10px !important;">{{ '' }}</el-radio> |
| | | </template> |
| | | |
| | | <template slot="menuLeft"> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 模板克隆 --> |
| | | <el-dialog :visible.sync="CloneVisible" append-to-body title="克隆模板" :before-close="cloneClose"> |
| | | <el-dialog :before-close="cloneClose" :visible.sync="CloneVisible" append-to-body title="克隆模板"> |
| | | <el-container> |
| | | <el-aside width="300px"> |
| | | <div style="margin-bottom: 5px"><el-tag>主题库分类</el-tag></div> |
| | | <!-- 克隆模板的树 沿用首页树的loading和option,但是data和v-model绑定的数据创建一个新的变量,另外点击方法也是重新获取来操作克隆模板的数据--> |
| | | <avue-tree ref="cloneTree" v-model="TreeAvueform" v-loading="loading" :data="Treedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | style="height: 50.5vh;margin-right: 10px" |
| | | @node-click="ClonenodeClick" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | style="height: 50.5vh;margin-right: 10px" |
| | | @node-click="ClonenodeClick" |
| | | > |
| | | </avue-tree> |
| | | </el-aside> |
| | |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input v-model="CloneFind" size="small" style="width: 40%;margin-left: 15px" placeholder="输入值后按回车进行模糊查询"></el-input> |
| | | <el-button size="small" type="primary" plain style="margin-left: 10px" @click="CloneEnterFind" @keyup.enter.native="CloneEnterFind">查询</el-button> |
| | | <el-input v-model="CloneFind" placeholder="输入值后按回车进行模糊查询" size="small" |
| | | style="width: 40%;margin-left: 15px"></el-input> |
| | | <el-button plain size="small" style="margin-left: 10px" type="primary" |
| | | @click="CloneEnterFind" @keyup.enter.native="CloneEnterFind">查询</el-button> |
| | | </div> |
| | | <avue-crud v-model="ClonecrudForm" v-loading="FormLoing" :data="this.CloneFormlist" |
| | | :option="this.ClonecrudTreeOption" |
| | |
| | | </div> |
| | | </el-main> |
| | | </el-container> |
| | | </el-container > |
| | | <div style="display: flex; justify-content: flex-end; align-items: center;margin-top: 10px" > |
| | | </el-container> |
| | | <div style="display: flex; justify-content: flex-end; align-items: center;margin-top: 10px"> |
| | | <el-button size="small " type="primary" @click="Clonehandler">确定</el-button> |
| | | <el-button size="small" @click="cloneClose" >取消</el-button> |
| | | <el-button size="small" @click="cloneClose">取消</el-button> |
| | | </div> |
| | | <el-dialog |
| | | width="30%" |
| | | title="克隆模板" |
| | | :visible.sync="CloneinnerVisible" |
| | | append-to-body> |
| | | append-to-body |
| | | title="克隆模板" |
| | | width="30%"> |
| | | <div> |
| | | <avue-form :option="CloneOption" @submit="Clonesubmit" v-model="CloneModel"></avue-form> |
| | | <avue-form v-model="CloneModel" :option="CloneOption" @submit="Clonesubmit"></avue-form> |
| | | </div> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | | <template #menu="{ size, row ,index}"> |
| | | <el-button type="text" |
| | | v-if="row.lcStatus == 'Editing'" |
| | | <el-button v-if="row.lcStatus == 'Editing'" |
| | | :size="size" |
| | | icon="el-icon-edit-outline " |
| | | :size="size" |
| | | type="text" |
| | | @click="$refs.textCrud.rowEdit(row)">编辑</el-button> |
| | | <el-button type="text" |
| | | v-if="row.lcStatus == 'Editing'" |
| | | icon="el-icon-delete" |
| | | <el-button v-if="row.lcStatus == 'Editing'" |
| | | :size="size" |
| | | icon="el-icon-delete" |
| | | type="text" |
| | | @click="$refs.textCrud.rowDel(row,index)">删除</el-button> |
| | | <el-button |
| | | v-show="row.lcStatus === 'Released'" |
| | | @click="upAndStopAndStart(row, 'upVersion')" |
| | | :loading="row.upVersionLoad" |
| | | :size="size" |
| | | icon="el-icon-upload2" |
| | | type="text" |
| | | :size="size" |
| | | @click="upAndStopAndStart(row, 'upVersion')" |
| | | >升版</el-button |
| | | > |
| | | <el-button |
| | | v-show="row.lcStatus === 'Released'" |
| | | @click="upAndStopAndStart(row, 'stopLose')" |
| | | :loading="row.stopLoseLoad" |
| | | :size="size" |
| | | icon="el-icon-circle-close" |
| | | type="text" |
| | | :size="size" |
| | | @click="upAndStopAndStart(row, 'stopLose')" |
| | | >停用/失效</el-button |
| | | > |
| | | <el-button |
| | | v-show="['Disabled', 'Editing'].includes(row.lcStatus)" |
| | | @click="upAndStopAndStart(row, 'startRelease')" |
| | | :loading="row.startReleaseLoad" |
| | | :size="size" |
| | | icon="el-icon-circle-check" |
| | | type="text" |
| | | :size="size" |
| | | @click="upAndStopAndStart(row, 'startRelease')" |
| | | >启用/发布</el-button |
| | | > |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | <templatePro :ProData="this.ProData" :rowIndex="this.selectRow" :crudOid="this.crudOid" :crudLCStatus="this.crudLCStatus" :crudArray="this.crudArray" :Formlist="this.Formlist" :codeClassifyOid="this.codeClassifyOid"></templatePro> |
| | | <templatePro :Formlist="this.Formlist" :ProData="this.ProData" :codeClassifyOid="this.codeClassifyOid" |
| | | :crudArray="this.crudArray" :crudLCStatus="this.crudLCStatus" :crudOid="this.crudOid" |
| | | :rowIndex="this.selectRow"></templatePro> |
| | | </span> |
| | | <!-- 编码规则--> |
| | | <el-dialog :visible.sync="MasterdialogVisible" title="为【编码规则】选取值" append-to-body> |
| | | <el-dialog :visible.sync="MasterdialogVisible" append-to-body title="为【编码规则】选取值"> |
| | | <template> |
| | | <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px"> |
| | | <el-option |
| | |
| | | style="width: 150px"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input> |
| | | <el-button size="small" type="primary" plain @click="SelectFindeHandler" style="margin-left: 20px">查询</el-button> |
| | | <el-input v-model="SelectFInd" placeholder="输入值后进行模糊查询" style="width: 260px;margin-left: 15px"></el-input> |
| | | <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SelectFindeHandler">查询 |
| | | </el-button> |
| | | </template> |
| | | <avue-crud :data="masterData" :option="masterOption" @row-click="masterSelect"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio> |
| | | <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }} |
| | | </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | | <div style="height: 30px"> |
| | | <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.TreeAddform.coderuleoidName ==''?'未设置值':this.TreeAddform.coderuleoidName}}]</div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > |
| | | <el-button type="primary" size="small" @click="MasterHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="MasterdialogVisible=false">取消</el-button> |
| | | <div |
| | | style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px "> |
| | | 已设置的值为:[{{ this.TreeAddform.coderuleoidName == '' ? '未设置值' : this.TreeAddform.coderuleoidName }}] |
| | | </div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden"> |
| | | <el-button size="small" type="primary" @click="MasterHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="MasterdialogVisible=false">取消</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 关键属性查询规则--> |
| | | <el-dialog :visible.sync="KeydialogVisible" title="为【关键属性查询规则】选取值" append-to-body> |
| | | <el-dialog :visible.sync="KeydialogVisible" append-to-body title="为【关键属性查询规则】选取值"> |
| | | <template> |
| | | <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px"> |
| | | <el-option |
| | |
| | | style="width: 150px"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input> |
| | | <el-button size="small" type="primary" plain @click="KeySelectFindeHandler" style="margin-left: 20px">查询</el-button> |
| | | <el-input v-model="SelectFInd" placeholder="输入值后进行模糊查询" style="width: 260px;margin-left: 15px"></el-input> |
| | | <el-button plain size="small" style="margin-left: 20px" type="primary" @click="KeySelectFindeHandler">查询 |
| | | </el-button> |
| | | </template> |
| | | <avue-crud :data="KeyData" :option="masterOption" @row-click="KeySelect"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio> |
| | | <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }} |
| | | </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | | <div style="height: 30px"> |
| | | <div style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.TreeAddform.codeKeyAttrRepeatOidName ==''?'未设置值':this.TreeAddform.codekeyattrrepeatoidName}}]</div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > |
| | | <el-button type="primary" size="small" @click="KeyHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="KeydialogVisible=false">取消</el-button> |
| | | <div |
| | | style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px "> |
| | | 已设置的值为:[{{ this.TreeAddform.codeKeyAttrRepeatOidName == '' ? '未设置值' : this.TreeAddform.codekeyattrrepeatoidName }}] |
| | | </div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden"> |
| | | <el-button size="small" type="primary" @click="KeyHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="KeydialogVisible=false">取消</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 相似项查询规则--> |
| | | <el-dialog :visible.sync="SimidialogVisible" title="为【相似项查询规则】选取值" append-to-body> |
| | | <el-dialog :visible.sync="SimidialogVisible" append-to-body title="为【相似项查询规则】选取值"> |
| | | <template> |
| | | <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px"> |
| | | <el-option |
| | |
| | | style="width: 150px"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input> |
| | | <el-button size="small" type="primary" plain @click="SimSelectFindeHandler" style="margin-left: 20px">查询</el-button> |
| | | <el-input v-model="SelectFInd" placeholder="输入值后进行模糊查询" style="width: 260px;margin-left: 15px"></el-input> |
| | | <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SimSelectFindeHandler">查询 |
| | | </el-button> |
| | | </template> |
| | | <avue-crud :data="simData" :option="masterOption" @row-click="simSelect"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio> |
| | | <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }} |
| | | </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | | <div style="height: 30px"> |
| | | <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.TreeAddform.codeResembleRuleOidName ==''?'未设置值':this.TreeAddform.codeResembleRuleOidName}}]</div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > |
| | | <el-button type="primary" size="small" @click="simHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="SimidialogVisible=false">取消</el-button> |
| | | <div |
| | | style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px "> |
| | | 已设置的值为:[{{ this.TreeAddform.codeResembleRuleOidName == '' ? '未设置值' : this.TreeAddform.codeResembleRuleOidName }}] |
| | | </div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden"> |
| | | <el-button size="small" type="primary" @click="simHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="SimidialogVisible=false">取消</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 业务类型--> |
| | | <el-dialog :visible.sync="BtmdialogVisible" title="为【业务类型规则】选取值" append-to-body> |
| | | <!-- 业务类型--> |
| | | <el-dialog :visible.sync="BtmdialogVisible" append-to-body title="为【业务类型规则】选取值"> |
| | | <template> |
| | | <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px !important;"> |
| | | <el-option |
| | |
| | | style="width: 130px"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input> |
| | | <el-button size="small" type="primary" plain @click="BtmSelectFindeHandler" style="margin-left: 20px">查询</el-button> |
| | | <el-input v-model="SelectFInd" placeholder="输入值后进行模糊查询" style="width: 260px;margin-left: 15px"></el-input> |
| | | <el-button plain size="small" style="margin-left: 20px" type="primary" @click="BtmSelectFindeHandler">查询 |
| | | </el-button> |
| | | </template> |
| | | <avue-crud :data="BtmData" :option="masterOption" @row-click="btmSelect"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio> |
| | | <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }} |
| | | </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | | <div style="height: 30px"> |
| | | <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.TreeAddform.btmTypeName}}]</div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > |
| | | <el-button type="primary" size="small" @click="btmHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="BtmdialogVisible=false">取消</el-button> |
| | | <div |
| | | style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px "> |
| | | 已设置的值为:[{{ this.TreeAddform.btmTypeName }}] |
| | | </div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden"> |
| | | <el-button size="small" type="primary" @click="btmHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="BtmdialogVisible=false">取消</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 导出--> |
| | | <ThemeImport :visible.sync="ThemeImportVisible" :codeClassifyOid="this.codeClassifyOid"></ThemeImport> |
| | | <!-- 导出--> |
| | | <ThemeImport :codeClassifyOid="this.codeClassifyOid" :visible.sync="ThemeImportVisible"></ThemeImport> |
| | | </basic-container> |
| | | </el-main> |
| | | </el-container> |
| | |
| | | startRelease, |
| | | exportClassify |
| | | } from "@/api/template/templateAttr"; |
| | | import {defaultReferDataGrid,referDataGrid} from '@/api/MasterData/master' |
| | | import {defaultReferDataGrid, referDataGrid} from '@/api/MasterData/master' |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "classifyTrees.vue", |
| | | //使用inject接收参数 |
| | |
| | | inject: ["crudTreeData"], |
| | | data() { |
| | | return { |
| | | masterRow:null, |
| | | AddLoading:false, |
| | | masterRow: null, |
| | | AddLoading: false, |
| | | // 定义一个变量来保存树请求的数量 |
| | | requestCount:null, |
| | | requestCount: null, |
| | | //导入状态框 |
| | | ThemeImportVisible:false, |
| | | selectRow:'', |
| | | selectList:[], |
| | | ThemeImportVisible: false, |
| | | selectRow: '', |
| | | selectList: [], |
| | | //树节点显示隐藏 |
| | | TreeFlagCode:true, |
| | | TreeFlagCode: true, |
| | | //修改节点显示隐藏 |
| | | editTreeFLagCode:false, |
| | | editTreeFLagCode: false, |
| | | //编码规则 |
| | | MasterdialogVisible:false, |
| | | masterData:[], |
| | | masterSelectList:[], |
| | | masterName:"", |
| | | masterOid:"", |
| | | MasterdialogVisible: false, |
| | | masterData: [], |
| | | masterSelectList: [], |
| | | masterName: "", |
| | | masterOid: "", |
| | | //关键属性btmTypeId |
| | | KeydialogVisible:false, |
| | | KeyName:"", |
| | | KeyOid:"", |
| | | KeyData:[], |
| | | KeySelectLIst:[], |
| | | KeydialogVisible: false, |
| | | KeyName: "", |
| | | KeyOid: "", |
| | | KeyData: [], |
| | | KeySelectLIst: [], |
| | | //相似项 |
| | | simName:"", |
| | | simOid:"", |
| | | simData:[], |
| | | SimidialogVisible:false, |
| | | simSelectList:[], |
| | | simName: "", |
| | | simOid: "", |
| | | simData: [], |
| | | SimidialogVisible: false, |
| | | simSelectList: [], |
| | | //业务类型 |
| | | btmName:"", |
| | | btmOid:"", |
| | | BtmData:[], |
| | | BtmdialogVisible:false, |
| | | btmSelectList:[], |
| | | masterOption:{ |
| | | addBtn:false, |
| | | index:true, |
| | | border:true, |
| | | menu:false, |
| | | height:380, |
| | | column:[ |
| | | btmName: "", |
| | | btmOid: "", |
| | | BtmData: [], |
| | | BtmdialogVisible: false, |
| | | btmSelectList: [], |
| | | masterOption: { |
| | | addBtn: false, |
| | | index: true, |
| | | border: true, |
| | | menu: false, |
| | | height: 380, |
| | | column: [ |
| | | { |
| | | label: '', |
| | | prop: 'radio', |
| | |
| | | display: false |
| | | }, |
| | | { |
| | | label:'英文名称', |
| | | prop:'id' |
| | | label: '英文名称', |
| | | prop: 'id' |
| | | }, |
| | | { |
| | | label:'中文名称', |
| | | prop:'name' |
| | | label: '中文名称', |
| | | prop: 'name' |
| | | }, |
| | | { |
| | | label:'描述', |
| | | prop:'description' |
| | | label: '描述', |
| | | prop: 'description' |
| | | } |
| | | ] |
| | | }, |
| | | SelectOption:[ |
| | | SelectOption: [ |
| | | { |
| | | value: 'name', |
| | | label: '中文名称' |
| | |
| | | label: '英文名称' |
| | | } |
| | | ], |
| | | SelectValue:"id", |
| | | SelectFInd:"", |
| | | addFlag:false, |
| | | SelectValue: "id", |
| | | SelectFInd: "", |
| | | addFlag: false, |
| | | // 表格当前行id |
| | | crudOid:"", |
| | | crudOid: "", |
| | | //当前选中模板状态 |
| | | crudLCStatus:'', |
| | | crudLCStatus: '', |
| | | //表格当前选择数组 |
| | | crudArray:[], |
| | | crudArray: [], |
| | | //模板属性展示内容 |
| | | ProData: [], |
| | | //回车键搜索绑定值 |
| | |
| | | searchCondition: 'id', |
| | | findText: "", |
| | | }, |
| | | |
| | | //高级查询对话框 |
| | | FindFormVisible: false, |
| | | //克隆模板对话框 |
| | | CloneVisible: false, |
| | | CloneinnerVisible:false, |
| | | CloneinnerVisible: false, |
| | | //高级查询下拉框 |
| | | FindSelect: { |
| | | id: "0", |
| | |
| | | TreeAddFormVisible: false, |
| | | //当前点击项 |
| | | nodeClickList: "", |
| | | ClonenodeClickList:"", |
| | | ClonenodeClickList: "", |
| | | //分类和主题库状态 |
| | | TreeFlag: false, |
| | | //树加载 |
| | |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: '请输入编号', trigger: 'blur' }, |
| | | {required: true, message: '请输入编号', trigger: 'blur'}, |
| | | ], |
| | | name:[ |
| | | { required: true, message: '请输入名称', trigger: 'blur' }, |
| | | name: [ |
| | | {required: true, message: '请输入名称', trigger: 'blur'}, |
| | | ], |
| | | btmTypeName:[ |
| | | { required: true, message: '请选择业务类型', trigger: 'blur' }, |
| | | btmTypeName: [ |
| | | {required: true, message: '请选择业务类型', trigger: 'blur'}, |
| | | ] |
| | | }, |
| | | //avue-tree数据,暂时没有作用,里面功能用element写了,只用avue的一个树组件不用内置表单了。 |
| | | TreeAvueform: {}, |
| | | //克隆树 |
| | | CloneTreeAvueform:{}, |
| | | CloneTreeAvueform: {}, |
| | | Treedata: [], |
| | | CloneTreedata:[], |
| | | CloneTreedata: [], |
| | | Treeoption: { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | defaultExpandAll: false, |
| | | menu: false, |
| | | // //这个是多选 |
| | | // multiple: true, |
| | | }, |
| | | //模板管理form |
| | | crudForm: "", |
| | |
| | | //克隆模板下拉框value |
| | | Clonevalue: "0", |
| | | //克隆模板搜索输入框 |
| | | CloneFind:"", |
| | | CloneFind: "", |
| | | //克隆模板下拉框数据 |
| | | CloneSelectOptions: [{ |
| | | value: '0', |
| | |
| | | }, |
| | | ], |
| | | //克隆模板确认表单数据 |
| | | CloneOption:{ |
| | | column:[ |
| | | CloneOption: { |
| | | column: [ |
| | | { |
| | | label:'模板编号', |
| | | prop:'id', |
| | | label: '模板编号', |
| | | prop: 'id', |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入模板编号", |
| | | trigger: "blur" |
| | | }] |
| | | }, { |
| | | label:'模板名称', |
| | | prop:'name', |
| | | label: '模板名称', |
| | | prop: 'name', |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入模板名称", |
| | |
| | | }] |
| | | }, |
| | | { |
| | | label:'描述', |
| | | prop:'desc', |
| | | type:'textarea', |
| | | span:24 |
| | | label: '描述', |
| | | prop: 'desc', |
| | | type: 'textarea', |
| | | span: 24 |
| | | } |
| | | ] |
| | | }, |
| | | //克隆模板双向绑定数据 |
| | | CloneModel:[], |
| | | CloneSelect:[], |
| | | CloneModel: [], |
| | | CloneSelect: [], |
| | | //克隆模板option |
| | | ClonecrudTreeOption: { |
| | | index: true, |
| | |
| | | } |
| | | }, |
| | | //模板管理编辑 |
| | | showEditBtn:false, |
| | | showEditBtn: false, |
| | | } |
| | | }, |
| | | watch:{ |
| | | |
| | | }, |
| | | watch: {}, |
| | | //tab栏默认是表格 |
| | | mounted() { |
| | | this.type = this.tabOption.column[0]; |
| | |
| | | if (e.target.nodeName !== 'SPAN') { |
| | | this.$refs.tree.setCurrentKey(null) |
| | | this.nodeClickList = {} |
| | | this.TreeList=[] |
| | | this.TreeFlagCode=true; |
| | | this.TreeList = [] |
| | | this.TreeFlagCode = true; |
| | | } |
| | | }, true) |
| | | }, |
| | | computed:{ |
| | | crudTreeOption(){ |
| | | return{ |
| | | computed: { |
| | | crudTreeOption() { |
| | | return { |
| | | index: true, |
| | | border: true, |
| | | height:180, |
| | | addBtn:this.Formlist.length<=0 && this.nodeClickList != "", |
| | | editBtn:false, |
| | | delBtn:false, |
| | | height: 180, |
| | | addBtn: this.Formlist.length <= 0 && this.nodeClickList != "", |
| | | editBtn: false, |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: '', |
| | |
| | | }, |
| | | { |
| | | label: "模板描述", |
| | | prop:"description" |
| | | prop: "description" |
| | | }, |
| | | { |
| | | label:"版本号", |
| | | prop:"revisionSeq", |
| | | display:false |
| | | label: "版本号", |
| | | prop: "revisionSeq", |
| | | display: false |
| | | }, |
| | | { |
| | | label:"状态", |
| | | prop:"lcStatusText", |
| | | display:false |
| | | label: "状态", |
| | | prop: "lcStatusText", |
| | | display: false |
| | | } |
| | | ], |
| | | batchImportData: { |
| | |
| | | }, |
| | | methods: { |
| | | // 关闭弹窗 |
| | | |
| | | /** 导入 */ |
| | | ImportExcel(){ |
| | | this.ThemeImportVisible=true; |
| | | ImportExcel() { |
| | | this.ThemeImportVisible = true; |
| | | }, |
| | | /** 导出 */ |
| | | ExportExcel(){ |
| | | if(this.nodeClickList){ |
| | | exportClassify({oid:this.nodeClickList.oid}).then(res=>{ |
| | | ExportExcel() { |
| | | if (this.nodeClickList) { |
| | | exportClassify({oid: this.nodeClickList.oid}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | }) |
| | | }else { |
| | | } else { |
| | | this.$message.warning('请先选择要导出的主题库分类') |
| | | } |
| | | }, |
| | | //编码规则失焦 |
| | | CodeFoucus(){ |
| | | this.MasterdialogVisible=true; |
| | | CodeFoucus() { |
| | | this.MasterdialogVisible = true; |
| | | this.MasterdefaultRend() |
| | | }, |
| | | //编码多选 |
| | | masterSelect(row){ |
| | | this.masterRow=row.$index; |
| | | this.masterSelectList=row; |
| | | this.masterName=row.name; |
| | | this.masterOid=row.oid; |
| | | masterSelect(row) { |
| | | this.masterRow = row.$index; |
| | | this.masterSelectList = row; |
| | | this.masterName = row.name; |
| | | this.masterOid = row.oid; |
| | | |
| | | }, |
| | | //编码规则查询 |
| | | SelectFindeHandler(){ |
| | | if(this.SelectValue == 'id'){ |
| | | const masterParameter={ |
| | | 'conditionMap[id]':this.SelectFInd |
| | | SelectFindeHandler() { |
| | | if (this.SelectValue == 'id') { |
| | | const masterParameter = { |
| | | 'conditionMap[id]': this.SelectFInd |
| | | } |
| | | this.MasterdefaultRend(masterParameter); |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } else if (this.SelectValue == 'name') { |
| | | const masterParameter = { |
| | | 'conditionMap[name]': this.SelectFInd |
| | | } |
| | | this.MasterdefaultRend(masterParameter) |
| | | } |
| | | }, |
| | | //编码规则确定 |
| | | MasterHandlerClick(){ |
| | | if(this.masterSelectList.length>1){ |
| | | MasterHandlerClick() { |
| | | if (this.masterSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.masterSelectList.length<=0){ |
| | | } else if (this.masterSelectList.length <= 0) { |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | this.MasterdialogVisible=false; |
| | | this.masterSelectList=[] |
| | | this.$set(this.TreeAddform,'codeRuleOidName',this.masterName) |
| | | this.$set(this.TreeAddform,'codeRuleOid',this.masterOid) |
| | | this.$emit('MasterHandler',this.loneTreeNewForm) |
| | | } else { |
| | | this.MasterdialogVisible = false; |
| | | this.masterSelectList = [] |
| | | this.$set(this.TreeAddform, 'codeRuleOidName', this.masterName) |
| | | this.$set(this.TreeAddform, 'codeRuleOid', this.masterOid) |
| | | this.$emit('MasterHandler', this.loneTreeNewForm) |
| | | } |
| | | }, |
| | | //编码接口 |
| | | MasterdefaultRend(){ |
| | | MasterdefaultRend() { |
| | | defaultReferDataGrid({ |
| | | referType:'coderule', |
| | | isMuti:'false', |
| | | 'conditionMap["lcstatus"]':'Released' |
| | | }).then(res=>{ |
| | | this.masterData=res.data.records; |
| | | referType: 'coderule', |
| | | isMuti: 'false', |
| | | 'conditionMap["lcstatus"]': 'Released' |
| | | }).then(res => { |
| | | this.masterData = res.data.records; |
| | | }) |
| | | }, |
| | | Keyfouce(){ |
| | | this.KeydialogVisible=true; |
| | | Keyfouce() { |
| | | this.KeydialogVisible = true; |
| | | this.KeydefaultRend() |
| | | }, |
| | | //关键属性确定 |
| | | KeyHandlerClick(){ |
| | | if(this.KeySelectLIst.length>1){ |
| | | KeyHandlerClick() { |
| | | if (this.KeySelectLIst.length > 1) { |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.KeySelectLIst.length<=0){ |
| | | } else if (this.KeySelectLIst.length <= 0) { |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | this.KeydialogVisible=false; |
| | | this.KeySelectLIst=[] |
| | | this.$set(this.TreeAddform,'codeKeyAttrRepeatOidName',this.KeyName) |
| | | this.$set(this.TreeAddform,'codeKeyAttrRepeatOid',this.KeyOid) |
| | | } else { |
| | | this.KeydialogVisible = false; |
| | | this.KeySelectLIst = [] |
| | | this.$set(this.TreeAddform, 'codeKeyAttrRepeatOidName', this.KeyName) |
| | | this.$set(this.TreeAddform, 'codeKeyAttrRepeatOid', this.KeyOid) |
| | | } |
| | | }, |
| | | //关键属性查询 |
| | | KeySelectFindeHandler(){ |
| | | if(this.SelectValue == 'id'){ |
| | | const masterParameter={ |
| | | 'conditionMap[id]':this.SelectFInd |
| | | KeySelectFindeHandler() { |
| | | if (this.SelectValue == 'id') { |
| | | const masterParameter = { |
| | | 'conditionMap[id]': this.SelectFInd |
| | | } |
| | | this.KeydefaultRend(masterParameter); |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } else if (this.SelectValue == 'name') { |
| | | const masterParameter = { |
| | | 'conditionMap[name]': this.SelectFInd |
| | | } |
| | | this.KeydefaultRend(masterParameter) |
| | | } |
| | | }, |
| | | //关键属性接口 |
| | | KeydefaultRend(){ |
| | | KeydefaultRend() { |
| | | defaultReferDataGrid({ |
| | | referType:'codekeyattrrepeat', |
| | | isMuti:'false', |
| | | 'conditionMap["lcstatus"]':'Enabled' |
| | | }).then(res=>{ |
| | | this.KeyData=res.data.records; |
| | | referType: 'codekeyattrrepeat', |
| | | isMuti: 'false', |
| | | 'conditionMap["lcstatus"]': 'Enabled' |
| | | }).then(res => { |
| | | this.KeyData = res.data.records; |
| | | }) |
| | | }, |
| | | // 关键多选 |
| | | KeySelect(row){ |
| | | this.masterRow=row.$index; |
| | | this.KeySelectLIst=row; |
| | | this.KeyName=row.name; |
| | | this.KeyOid=row.oid; |
| | | KeySelect(row) { |
| | | this.masterRow = row.$index; |
| | | this.KeySelectLIst = row; |
| | | this.KeyName = row.name; |
| | | this.KeyOid = row.oid; |
| | | }, |
| | | //关键失焦 |
| | | simFouce(){ |
| | | this.SimidialogVisible=true; |
| | | simFouce() { |
| | | this.SimidialogVisible = true; |
| | | this.simdefaultRend() |
| | | }, |
| | | //相似项确定 |
| | | simHandlerClick(){ |
| | | if(this.simSelectList.length>1){ |
| | | simHandlerClick() { |
| | | if (this.simSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.simSelectList.length<=0){ |
| | | } else if (this.simSelectList.length <= 0) { |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | this.SimidialogVisible=false; |
| | | this.simSelectList=[] |
| | | this.$set(this.TreeAddform,'codeResembleRuleOidName',this.simName) |
| | | this.$set(this.TreeAddform,'codeResembleRuleOid',this.simOid) |
| | | this.$emit('MasterHandler',this.loneTreeNewForm) |
| | | } else { |
| | | this.SimidialogVisible = false; |
| | | this.simSelectList = [] |
| | | this.$set(this.TreeAddform, 'codeResembleRuleOidName', this.simName) |
| | | this.$set(this.TreeAddform, 'codeResembleRuleOid', this.simOid) |
| | | this.$emit('MasterHandler', this.loneTreeNewForm) |
| | | } |
| | | }, |
| | | //相似项查询 |
| | | SimSelectFindeHandler(){ |
| | | if(this.SelectValue == 'id'){ |
| | | const masterParameter={ |
| | | 'conditionMap[id]':this.SelectFInd |
| | | SimSelectFindeHandler() { |
| | | if (this.SelectValue == 'id') { |
| | | const masterParameter = { |
| | | 'conditionMap[id]': this.SelectFInd |
| | | } |
| | | this.simdefaultRend(masterParameter); |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } else if (this.SelectValue == 'name') { |
| | | const masterParameter = { |
| | | 'conditionMap[name]': this.SelectFInd |
| | | } |
| | | this.simdefaultRend(masterParameter) |
| | | } |
| | | }, |
| | | // 相似项多选 |
| | | simSelect(row){ |
| | | this.masterRow=row.$index; |
| | | this.simSelectList=row; |
| | | this.simName=row.name; |
| | | this.simOid=row.oid; |
| | | simSelect(row) { |
| | | this.masterRow = row.$index; |
| | | this.simSelectList = row; |
| | | this.simName = row.name; |
| | | this.simOid = row.oid; |
| | | }, |
| | | //相似项项接口 |
| | | simdefaultRend(){ |
| | | simdefaultRend() { |
| | | defaultReferDataGrid({ |
| | | referType:'coderesemblerule', |
| | | isMuti:'false', |
| | | 'conditionMap["lcstatus"]':'Enabled' |
| | | }).then(res=>{ |
| | | this.simData=res.data.records; |
| | | referType: 'coderesemblerule', |
| | | isMuti: 'false', |
| | | 'conditionMap["lcstatus"]': 'Enabled' |
| | | }).then(res => { |
| | | this.simData = res.data.records; |
| | | }) |
| | | }, |
| | | //业务类型失焦 |
| | | btmFoucus(){ |
| | | this.BtmdialogVisible=true; |
| | | btmFoucus() { |
| | | this.BtmdialogVisible = true; |
| | | this.btmdefaultRend() |
| | | }, |
| | | //业务类型确定 |
| | | btmHandlerClick(){ |
| | | if(this.btmSelectList.length>1){ |
| | | btmHandlerClick() { |
| | | if (this.btmSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.btmSelectList.length<=0){ |
| | | } else if (this.btmSelectList.length <= 0) { |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | this.BtmdialogVisible=false; |
| | | this.btmSelectList=[] |
| | | this.$set(this.TreeAddform,'btmTypeName',this.btmName) |
| | | this.$set(this.TreeAddform,'btmTypeId',this.btmOid) |
| | | this.$emit('MasterHandler',this.loneTreeNewForm) |
| | | } else { |
| | | this.BtmdialogVisible = false; |
| | | this.btmSelectList = [] |
| | | this.$set(this.TreeAddform, 'btmTypeName', this.btmName) |
| | | this.$set(this.TreeAddform, 'btmTypeId', this.btmOid) |
| | | this.$emit('MasterHandler', this.loneTreeNewForm) |
| | | } |
| | | }, |
| | | //业务类型查询 |
| | | BtmSelectFindeHandler(){ |
| | | if(this.SelectValue == 'id'){ |
| | | const masterParameter={ |
| | | 'conditionMap[id]':this.SelectFInd |
| | | } |
| | | BtmSelectFindeHandler() { |
| | | const masterParameter = {}; |
| | | masterParameter[`conditionMap['${this.SelectValue}']`] = `*${this.SelectFInd}*`; |
| | | this.btmdefaultRend(masterParameter); |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } |
| | | this.btmdefaultRend(masterParameter); |
| | | } |
| | | }, |
| | | //业务类型多选 |
| | | btmSelect(row){ |
| | | this.masterRow=row.$index; |
| | | this.btmSelectList=row; |
| | | this.btmName=row.name; |
| | | this.btmOid=row.id; |
| | | btmSelect(row) { |
| | | this.masterRow = row.$index; |
| | | this.btmSelectList = row; |
| | | this.btmName = row.name; |
| | | this.btmOid = row.id; |
| | | }, |
| | | //业务类型接口 |
| | | btmdefaultRend(masterParameter){ |
| | | referDataGrid({valueField:'id',isMuti:'false',...masterParameter}).then(res=>{ |
| | | this.BtmData=res.data.data.records |
| | | btmdefaultRend(masterParameter) { |
| | | referDataGrid({valueField: 'id', isMuti: 'false', ...masterParameter}).then(res => { |
| | | this.BtmData = res.data.data.records |
| | | }) |
| | | }, |
| | | //子传父 |
| | | MasterHandler(val){ |
| | | this.TreeList=val; |
| | | MasterHandler(val) { |
| | | this.TreeList = val; |
| | | }, |
| | | rowHandle(row, column){ |
| | | this.selectRow=row.$index; |
| | | this.crudOid=row.oid; |
| | | this.crudLCStatus=row.lcStatus; |
| | | rowHandle(row, column) { |
| | | this.selectRow = row.$index; |
| | | this.crudOid = row.oid; |
| | | this.crudLCStatus = row.lcStatus; |
| | | this.crudArray.push(row); |
| | | this.gridCode() |
| | | }, |
| | |
| | | }); |
| | | try { |
| | | //新增表头名称 |
| | | this.TreeFlag=!this.nodeClickList |
| | | this.TreeFlag = !this.nodeClickList |
| | | await new Promise(resolve => setTimeout(resolve, 500)); |
| | | this.TreeAddFormVisible = true; |
| | | loading.close(); |
| | |
| | | } |
| | | }, |
| | | //树节点取消事件 |
| | | TreeEscHandler(){ |
| | | this.TreeAddform={}; |
| | | this.TreeAddFormVisible=false; |
| | | TreeEscHandler() { |
| | | this.TreeAddform = {}; |
| | | this.TreeAddFormVisible = false; |
| | | // 关闭弹窗清空校验 |
| | | this.$refs.myForm.clearValidate(); |
| | | }, |
| | |
| | | TreeAddHandler() { |
| | | if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) { |
| | | this.$message.warning('请输入内容!'); |
| | | }else { |
| | | } else { |
| | | const data = this.TreeAddform; |
| | | // data.btmtypename= this.TreeList.btmtypename |
| | | this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid); |
| | |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false; |
| | | //添加完成后右侧清空 |
| | | this.ProData=[]; |
| | | this.Formlist=[]; |
| | | this.ProData = []; |
| | | this.Formlist = []; |
| | | }) |
| | | .catch((res) => { |
| | | this.$message({ |
| | |
| | | }, |
| | | //修改回填 |
| | | TreeEdit() { |
| | | if ( Object.keys(this.nodeClickList).length<1) { |
| | | if (Object.keys(this.nodeClickList).length < 1) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '请先从树上选择一条数据!' |
| | |
| | | //启用和停用都先判断状态 |
| | | //启用 |
| | | Enable() { |
| | | if(Object.keys(this.nodeClickList).length<1){ |
| | | if (Object.keys(this.nodeClickList).length < 1) { |
| | | this.$message.warning('请先从树上选择一条数据') |
| | | }else { |
| | | } else { |
| | | if (this.FlagObj.lcStatus == "Enabled") { |
| | | this.$message({ |
| | | type: 'warning', |
| | |
| | | }, |
| | | //停用 |
| | | Deactivate() { |
| | | if(Object.keys(this.nodeClickList).length<1){ |
| | | if (Object.keys(this.nodeClickList).length < 1) { |
| | | this.$message.warning('请先从树上选择一条数据') |
| | | }else { |
| | | } else { |
| | | if (this.FlagObj.lcStatus === "Disabled") { |
| | | this.$message({ |
| | | type: 'warning', |
| | |
| | | this.editTreeFLagCode = !data.parentId; |
| | | this.nodeClickList = data; |
| | | this.selectRow = 0; |
| | | this.crudArray=[] |
| | | this.crudArray = [] |
| | | try { |
| | | this.requestCount += 1; |
| | | const [res1, res2, res3] = await Promise.all([ |
| | | TreeObjcet(data.oid), |
| | | gridCodeClassifyTemplate({ 'conditionMap[codeclassifyoid]': data.oid }), |
| | | gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}), |
| | | getObjectByOid(data.oid) |
| | | ]); |
| | | this.FlagObj = res1.data.data; |
| | |
| | | await this.gridCode(); |
| | | } else { |
| | | this.ProData = []; |
| | | this.crudOid='' |
| | | this.crudOid = '' |
| | | } |
| | | this.TreeList = res3.data.data; |
| | | } catch (error) { |
| | |
| | | |
| | | async gridCode() { |
| | | try { |
| | | const res = await gridCodeClassifyTemplateAttr({ 'conditionMap[classifyTemplateOid]': this.Formlist[this.selectRow].oid, limit: -1 }); |
| | | const res = await gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[this.selectRow].oid, |
| | | limit: -1 |
| | | }); |
| | | this.ProData = res.data.data.map(item => { |
| | | if (item.classifyInvokeAttr !== '') { |
| | | if (!item.hasOwnProperty('classifyInvokeText')) { |
| | |
| | | console.log(e); |
| | | }, |
| | | //基本信息表单刷新 |
| | | referTreeForm(){ |
| | | getObjectByOid(this.nodeClickList.oid).then(res => { |
| | | referTreeForm() { |
| | | getObjectByOid(this.nodeClickList.oid).then(res => { |
| | | this.TreeList = res.data.data; |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | | }, |
| | | //克隆模板树的点击切换数据 |
| | | async ClonenodeClick(data){ |
| | | this.ClonenodeClickList=data; |
| | | await gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}).then(res=>{ |
| | | async ClonenodeClick(data) { |
| | | this.ClonenodeClickList = data; |
| | | await gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}).then(res => { |
| | | this.CloneFormlist = res.data.data.filter(item => { |
| | | if (item.codeclassifyoid != "") { |
| | | this.codeClassifyOid = item.codeclassifyoid |
| | |
| | | }, |
| | | |
| | | //模板管理表格添加 |
| | | CrudRowSave(row,done) { |
| | | CrudRowSave(row, done) { |
| | | if (this.nodeClickList.length <= 0) { |
| | | this.$message({ |
| | | type: 'warning', |
| | |
| | | } |
| | | }, |
| | | //模板管理修改 |
| | | CrudRowUpdata(row,index,done) { |
| | | CrudRowUpdata(row, index, done) { |
| | | editSave(row).then(() => { |
| | | this.TemRefresh(); |
| | | this.$message({ |
| | |
| | | }, |
| | | //模板管理删除 |
| | | CrudRowDel(row) { |
| | | deleteData(row).then(()=> { |
| | | deleteData(row).then(() => { |
| | | this.TemRefresh(); |
| | | }).catch(res => { |
| | | this.$message({ |
| | |
| | | }) |
| | | }, |
| | | //克隆取消 |
| | | cloneClose(){ |
| | | cloneClose() { |
| | | this.$refs.cloneTree.setCurrentKey(null) |
| | | this.ClonenodeClickList = {} |
| | | this.CloneFormlist=[] |
| | | this.CloneVisible=false; |
| | | this.CloneFormlist = [] |
| | | this.CloneVisible = false; |
| | | }, |
| | | //克隆模板查询 |
| | | CloneEnterFind(){ |
| | | CloneEnterFind() { |
| | | gridCodeClassifyTemplate().then(res => { |
| | | this.CloneFormlist = res.data.data.filter(item => { |
| | | if(this.Clonevalue == 0){ |
| | | if (this.Clonevalue == 0) { |
| | | return item.id.includes(this.CloneFind) |
| | | }else if(this.Clonevalue == 1){ |
| | | } else if (this.Clonevalue == 1) { |
| | | return item.name.includes(this.CloneFind) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | // 查询 |
| | | FindeHanler(){ |
| | | if(this.nodeClickList != ""){ |
| | | this.FindFormVisible=true |
| | | }else { |
| | | FindeHanler() { |
| | | if (this.nodeClickList != "") { |
| | | this.FindFormVisible = true |
| | | } else { |
| | | this.$message.warning('请从树上选择一条数据') |
| | | } |
| | | }, |
| | | //克隆模板选择确定 |
| | | Clonehandler(){ |
| | | if(this.CloneSelect.length <= 0){ |
| | | Clonehandler() { |
| | | if (this.CloneSelect.length <= 0) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '请选择要克隆的模板!' |
| | | }); |
| | | }else if(this.CloneSelect.length >1){ |
| | | } else if (this.CloneSelect.length > 1) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '只能选择一条数据!' |
| | | }); |
| | | } else { |
| | | this.CloneinnerVisible=true; |
| | | this.CloneinnerVisible = true; |
| | | } |
| | | }, |
| | | //点击从其它模板克隆 |
| | | CloneBtn(){ |
| | | if(this.nodeClickList.length <= 0){ |
| | | CloneBtn() { |
| | | if (this.nodeClickList.length <= 0) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '请先从[主题库分类】树上选择一条数据!' |
| | | }); |
| | | }else { |
| | | this.CloneVisible=true; |
| | | } else { |
| | | this.CloneVisible = true; |
| | | } |
| | | }, |
| | | //克隆模板单选框改变 |
| | | selectionChange(row) { |
| | | this.CloneSelect = row; |
| | | const { id, name } = row[0]; |
| | | this.CloneModel = { id, name }; |
| | | const {id, name} = row[0]; |
| | | this.CloneModel = {id, name}; |
| | | this.CloneSelect[0].codeclassifyoid = this.nodeClickList.oid; |
| | | console.log('row',row) |
| | | console.log('CloneSelect',this.CloneSelect) |
| | | console.log('CloneModel',this.CloneModel) |
| | | console.log('row', row) |
| | | console.log('CloneSelect', this.CloneSelect) |
| | | console.log('CloneModel', this.CloneModel) |
| | | }, |
| | | //克隆表单提交 |
| | | Clonesubmit(row, done) { |
| | |
| | | this.Formlist = res.data.data.filter(item => { |
| | | return item.codeclassifyoid == this.nodeClickList.oid |
| | | }) |
| | | this.crudLCStatus=this.Formlist[this.selectRow].lcStatus; |
| | | this.crudLCStatus = this.Formlist[this.selectRow].lcStatus; |
| | | this.crudArray.push(this.Formlist[this.selectRow]); |
| | | gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': res.data.data[this.selectRow].oid,limit:-1}).then(res => { |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': res.data.data[this.selectRow].oid, |
| | | limit: -1 |
| | | }).then(res => { |
| | | this.ProData = res.data.data; |
| | | //分类注入数据格式 |
| | | this.ProData = res.data.data.map((item) => { |
| | | this.ProData = res.data.data.map((item) => { |
| | | //如果分类注入classifyInvokeAttr为空说明是初始状态 |
| | | if(item.classifyInvokeAttr !== ''){ |
| | | if (item.classifyInvokeAttr !== '') { |
| | | if (!item.hasOwnProperty('classifyInvokeText')) { // 检查classifyInvokeText属性是否存在 |
| | | item = { |
| | | ...item, |
| | |
| | | type: "warning", |
| | | }).then(() => { |
| | | this.$set(row, this.upAndStopAndStartData[type]["load"], true) |
| | | const { ts, oid } = row; |
| | | this.upAndStopAndStartData[type]['funAPi']({ ts, oid }).then((res) => { |
| | | const {ts, oid} = row; |
| | | this.upAndStopAndStartData[type]['funAPi']({ts, oid}).then((res) => { |
| | | if (res.data.code === 200) { |
| | | this.$set(row, this.upAndStopAndStartData[type]["load"], false) |
| | | this.TemRefresh(); |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .el-container{ |
| | | .el-container { |
| | | height: 100%; |
| | | } |
| | | |
| | | .el-aside { |
| | | height: calc(100% - 30px); |
| | | } |
| | | |
| | | .el-main { |
| | | height: calc(100% - 30px); |
| | | } |
| | | |
| | | .el-form { |
| | | display: flex; |
| | | flex-wrap: wrap; /* 设置可换行,以便在小屏幕设备上使用多行布局 */ |
| | |
| | | <template> |
| | | <avue-crud ref="crud" :table-loading="loading" :data="data" v-model="form" :option="option" :page.sync="page" |
| | | :search.sync="search" @on-load="getDataList" @row-save="handleSave" @row-del="handleDelete" |
| | | @row-update="handleEdit" @refresh-change="handleRefresh" @size-change="handleSizePage" |
| | | @current-change="handleCurrentPage" v-if="Formlist.length>0"> |
| | | </avue-crud> |
| | | <avue-crud v-if="Formlist.length>0" ref="crud" v-model="form" :data="data" :option="option" :page.sync="page" |
| | | :search.sync="search" :table-loading="loading" @on-load="getDataList" @row-save="handleSave" |
| | | @row-del="handleDelete" @row-update="handleEdit" @refresh-change="handleRefresh" |
| | | @size-change="handleSizePage" @current-change="handleCurrentPage"> |
| | | </avue-crud> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getFlowpathList, getStartList, flowpathSave, flowpathDelete } from '@/api/template/flowpath.js' |
| | | import {getFlowpathList, getStartList, flowpathSave, flowpathDelete} from '@/api/template/flowpath.js' |
| | | |
| | | export default { |
| | | name: 'FlowPath', |
| | | props: { |
| | | checkStatus: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | crudLCStatus: { |
| | | type: String, |
| | | default: 'Editing' |
| | | }, |
| | | code: { |
| | | typeof: String, |
| | | required: true, |
| | | default: "" |
| | | }, |
| | | Formlist:{ |
| | | type:Array, |
| | | default:[] |
| | | } |
| | | name: 'FlowPath', |
| | | props: { |
| | | checkStatus: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | crudLCStatus: { |
| | | type: String, |
| | | default: 'Editing' |
| | | }, |
| | | code: { |
| | | typeof: String, |
| | | required: true, |
| | | default: "" |
| | | }, |
| | | Formlist: { |
| | | type: Array, |
| | | default: [] |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | }, |
| | | search: {}, |
| | | delIds: [], |
| | | data: [], |
| | | startData: [], |
| | | form: {}, |
| | | option: { |
| | | height: 340, |
| | | border: true, |
| | | align: 'center', |
| | | menu: !this.checkStatus || this.crudLCStatus == 'Editing', |
| | | menuAlign: 'center', |
| | | index: true, |
| | | searchMenuSpan: 8, |
| | | searchBtn: false, |
| | | refreshBtn: false, |
| | | emptyBtn: false, |
| | | columnBtn: false, |
| | | editBtn: !this.checkStatus || this.crudLCStatus == 'Editing', |
| | | delBtn: !this.checkStatus || this.crudLCStatus == 'Editing', |
| | | addBtn: !this.checkStatus || this.crudLCStatus == 'Editing', |
| | | defaultSort: { |
| | | prop: 'id,name,description,version', |
| | | order: 'descending' |
| | | }, |
| | | column: [ |
| | | { |
| | | label: '模板key', |
| | | prop: 'modelKey', |
| | | width: 120, |
| | | sortable: true, |
| | | type: 'tree', |
| | | dicData: [], |
| | | props: { |
| | | label: "key", |
| | | value: "key" |
| | | }, |
| | | search: {}, |
| | | delIds: [], |
| | | data: [], |
| | | startData: [], |
| | | form: {}, |
| | | option: { |
| | | height: 340, |
| | | border: true, |
| | | align: 'center', |
| | | menu:!this.checkStatus || this.crudLCStatus == 'Editing', |
| | | menuAlign: 'center', |
| | | index: true, |
| | | searchMenuSpan: 8, |
| | | searchBtn: false, |
| | | refreshBtn:false, |
| | | emptyBtn: false, |
| | | columnBtn: false, |
| | | editBtn:!this.checkStatus || this.crudLCStatus == 'Editing', |
| | | delBtn:!this.checkStatus || this.crudLCStatus == 'Editing', |
| | | addBtn: !this.checkStatus || this.crudLCStatus == 'Editing', |
| | | defaultSort: { |
| | | prop: 'id,name,description,version', |
| | | order: 'descending' |
| | | }, |
| | | column: [ |
| | | { |
| | | label: '模板key', |
| | | prop: 'modelKey', |
| | | width: 120, |
| | | sortable: true, |
| | | type: 'tree', |
| | | dicData: [], |
| | | props: { |
| | | label: "key", |
| | | value: "key" |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: '模板key不能为空', |
| | | trigger: 'blur' |
| | | }], |
| | | nodeClick: (data) => { |
| | | console.log(data) |
| | | // 节点点击的时候会获取到数据 |
| | | this.form.modelName = data.name |
| | | } |
| | | }, { |
| | | label: '模板名称', |
| | | prop: 'modelName', |
| | | sortable: true, |
| | | width: 220, |
| | | addDisabled: true, |
| | | editDisabled: true, |
| | | }, |
| | | { |
| | | label: '模板用途', |
| | | prop: 'buttonTypeKey', |
| | | type: 'tree', |
| | | width: 120, |
| | | dicUrl: '/api/ubcs-flow/processTS/tt', |
| | | dicMethod: 'post', |
| | | props: { |
| | | value: "codee", |
| | | label: "namee", |
| | | }, |
| | | }, |
| | | { |
| | | label: '模板描述', |
| | | prop: 'description', |
| | | type: 'textarea' |
| | | }, |
| | | ] |
| | | rules: [{ |
| | | required: true, |
| | | message: '模板key不能为空', |
| | | trigger: 'blur' |
| | | }], |
| | | nodeClick: (data) => { |
| | | console.log(data) |
| | | // 节点点击的时候会获取到数据 |
| | | this.form.modelName = data.name |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getStart() |
| | | }, |
| | | }, { |
| | | label: '模板名称', |
| | | prop: 'modelName', |
| | | sortable: true, |
| | | width: 220, |
| | | addDisabled: true, |
| | | editDisabled: true, |
| | | }, |
| | | { |
| | | label: '模板用途', |
| | | prop: 'buttonTypeKey', |
| | | type: 'tree', |
| | | width: 120, |
| | | dicUrl: '/api/ubcs-flow/processTS/tt', |
| | | dicMethod: 'post', |
| | | props: { |
| | | value: "codee", |
| | | label: "namee", |
| | | }, |
| | | }, |
| | | { |
| | | label: '模板描述', |
| | | prop: 'description', |
| | | type: 'textarea' |
| | | }, |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getStart() |
| | | }, |
| | | watch: { |
| | | code: { |
| | | handler(newval, oldval) { |
| | |
| | | }, |
| | | checkStatus: { |
| | | handler(newval, oldval) { |
| | | this.option.delBtn=!this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.editBtn=!this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.addBtn=!this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.delBtn = !this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.editBtn = !this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.addBtn = !this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | } |
| | | }, |
| | | crudLCStatus: { |
| | | handler(newval, oldval) { |
| | | this.option.delBtn=!this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.editBtn=!this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.addBtn=!this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.delBtn = !this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.editBtn = !this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | this.option.addBtn = !this.checkStatus || this.crudLCStatus == 'Editing'; |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | async getStart() { |
| | | const response = await getStartList() |
| | | if (response.status === 200) { |
| | | console.log(response.data.data.records) |
| | | const data = response.data.data.records |
| | | let newData = data.map(item => { |
| | | const { key, name, version } = item |
| | | return { key, name, version } |
| | | }) |
| | | this.option.column[0].dicData = newData |
| | | methods: { |
| | | async getStart() { |
| | | const response = await getStartList() |
| | | if (response.status === 200) { |
| | | console.log(response.data.data.records) |
| | | const data = response.data.data.records |
| | | let newData = data.map(item => { |
| | | const {key, name, version} = item |
| | | return {key, name, version} |
| | | }) |
| | | this.option.column[0].dicData = newData |
| | | |
| | | } |
| | | }, |
| | | // 获取列表 |
| | | async getDataList() { |
| | | } |
| | | }, |
| | | // 获取列表 |
| | | async getDataList() { |
| | | this.loading = false |
| | | if (this.code) { |
| | | const {pageSize, currentPage} = this.page |
| | | let param = {size: pageSize, current: currentPage} |
| | | const response = await getFlowpathList({...param, ...{templateId: this.code}}) |
| | | if (response.status === 200) { |
| | | this.loading = false |
| | | if(this.code){ |
| | | const { pageSize, currentPage } = this.page |
| | | let param = { size: pageSize, current: currentPage } |
| | | const response = await getFlowpathList({ ...param, ...{ templateId: this.code } }) |
| | | if (response.status === 200) { |
| | | this.loading = false |
| | | const data = response.data.data |
| | | this.data = data.records |
| | | this.page.total = data.total |
| | | } else this.loading = false |
| | | }else { |
| | | this.data=[] |
| | | } |
| | | const data = response.data.data |
| | | this.data = data.records |
| | | this.page.total = data.total |
| | | } else this.loading = false |
| | | } else { |
| | | this.data = [] |
| | | } |
| | | |
| | | }, |
| | | // 新增 |
| | | async handleSave(row, done, loading) { |
| | | console.log(row) |
| | | await flowpathSave({ ...row, ...{ templateId: this.code } }).then(response=>{ |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '新增数据成功!' |
| | | }) |
| | | done() |
| | | this.getDataList() |
| | | } |
| | | }).catch(res=>{ |
| | | loading() |
| | | }) |
| | | }, |
| | | // 新增 |
| | | async handleSave(row, done, loading) { |
| | | console.log(row) |
| | | await flowpathSave({...row, ...{templateId: this.code}}).then(response => { |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '新增数据成功!' |
| | | }) |
| | | done() |
| | | this.getDataList() |
| | | } |
| | | }).catch(res => { |
| | | loading() |
| | | }) |
| | | |
| | | }, |
| | | // 编辑 |
| | | async handleEdit(row, index, done, loading) { |
| | | console.log(row) |
| | | const { modelName, modelKey, buttonTypeKey, id ,description} = row |
| | | let param = { modelName, modelKey, buttonTypeKey, id,description } |
| | | await flowpathSave({ ...param, ...{ templateId: this.code } }).then(response=>{ |
| | | if (response.status === 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '修改数据成功!' |
| | | }) |
| | | done() |
| | | this.getDataList() |
| | | } |
| | | }).catch(()=>{ |
| | | //loading控制禁用 默认是开启 |
| | | loading() |
| | | }) |
| | | }, |
| | | // 编辑 |
| | | async handleEdit(row, index, done, loading) { |
| | | console.log(row) |
| | | const {modelName, modelKey, buttonTypeKey, id, description} = row |
| | | let param = {modelName, modelKey, buttonTypeKey, id, description} |
| | | await flowpathSave({...param, ...{templateId: this.code}}).then(response => { |
| | | if (response.status === 200) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '修改数据成功!' |
| | | }) |
| | | done() |
| | | this.getDataList() |
| | | } |
| | | }).catch(() => { |
| | | //loading控制禁用 默认是开启 |
| | | loading() |
| | | }) |
| | | |
| | | }, |
| | | // 删除单条 |
| | | handleDelete(row) { |
| | | console.log(row) |
| | | const { id } = row |
| | | this.deleteSysInfo({ id: id }) |
| | | }, |
| | | // 删除接口 |
| | | deleteSysInfo(param) { |
| | | this.$confirm('是否确定删除选择的模板流程?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | // 接口 |
| | | const response = await flowpathDelete(param) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功!' |
| | | }); |
| | | this.getDataList() |
| | | } |
| | | }) |
| | | }, |
| | | // enter搜索 |
| | | handleEnter() { |
| | | if (this.search[this.selectValue] === '') return |
| | | else this.getDataList() |
| | | }, |
| | | // 输入框清空 |
| | | handleClear() { |
| | | }, |
| | | // 删除单条 |
| | | handleDelete(row) { |
| | | console.log(row) |
| | | const {id} = row |
| | | this.deleteSysInfo({id: id}) |
| | | }, |
| | | // 删除接口 |
| | | deleteSysInfo(param) { |
| | | this.$confirm('是否确定删除选择的模板流程?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | // 接口 |
| | | const response = await flowpathDelete(param) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功!' |
| | | }); |
| | | this.getDataList() |
| | | } |
| | | }) |
| | | }, |
| | | // enter搜索 |
| | | handleEnter() { |
| | | if (this.search[this.selectValue] === '') return |
| | | else this.getDataList() |
| | | }, |
| | | // 输入框清空 |
| | | handleClear() { |
| | | |
| | | }, |
| | | // 刷新按钮 |
| | | handleRefresh() { |
| | | this.getDataList() |
| | | }, |
| | | handleSizePage(event) { |
| | | this.page.pageSize = event |
| | | }, |
| | | handleCurrentPage(event) { |
| | | this.page.currentPage = event |
| | | }, |
| | | } |
| | | }, |
| | | // 刷新按钮 |
| | | handleRefresh() { |
| | | this.getDataList() |
| | | }, |
| | | handleSizePage(event) { |
| | | this.page.pageSize = event |
| | | }, |
| | | handleCurrentPage(event) { |
| | | this.page.currentPage = event |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <div v-if="Formlist.length>0"> |
| | | <avue-crud ref="crud" :table-loading="loading" :data="data" :option="option" :page.sync="page" |
| | | @on-load="getDataList" @size-change="handleSizePage" @current-change="handleCurrentPage" |
| | | @row-click="handleRowClick"> |
| | | <template slot-scope="{type,size,row,index}" slot="menu"> |
| | | <el-button icon="el-icon-check" :size="size" :type="type" |
| | | @click="handleMaintenance(row, index)">维护</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="模板阶段" width="50%" append-to-body="true" :visible.sync="dialogNode"> |
| | | <avue-crud ref="crud" :table-loading="loading" :data="stageData" :option="stageOption" @on-load="getStagelist" |
| | | @row-click="handleRowStageClick"> |
| | | <template slot-scope="{type,size,row,index}" slot="menu"> |
| | | <el-button icon="el-icon-check" :size="size" :type="type" |
| | | @click="handleMaintenanceTransfer(row, index)">维护</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </el-dialog> |
| | | <table-transfer v-if="flag" :visible.sync="dialogTransfer" v-model="attributeValue" :dataList="attributeData" |
| | | :columns="columns" keyName="oid" @save="handleSave" @close="handelClose"></table-transfer> |
| | | </div> |
| | | <div v-if="Formlist.length>0"> |
| | | <avue-crud ref="crud" :data="data" :option="option" :page.sync="page" :table-loading="loading" |
| | | @on-load="getDataList" @size-change="handleSizePage" @current-change="handleCurrentPage" |
| | | @row-click="handleRowClick"> |
| | | <template slot="menu" slot-scope="{type,size,row,index}"> |
| | | <el-button :size="size" :type="type" icon="el-icon-check" |
| | | @click="handleMaintenance(row, index)">维护 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog :visible.sync="dialogNode" append-to-body="true" title="模板阶段" width="50%"> |
| | | <avue-crud ref="crud" :data="stageData" :option="stageOption" :table-loading="loading" @on-load="getStagelist" |
| | | @row-click="handleRowStageClick"> |
| | | <template slot="menu" slot-scope="{type,size,row,index}"> |
| | | <el-button :size="size" :type="type" icon="el-icon-check" |
| | | @click="handleMaintenanceTransfer(row, index)">维护 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </el-dialog> |
| | | <table-transfer v-if="flag" v-model="attributeValue" :columns="columns" :dataList="attributeData" |
| | | :visible.sync="dialogTransfer" keyName="oid" @close="handelClose" @save="handleSave"></table-transfer> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getFlowpathList, stagelist, attributeListRight, attributeList, attributeSave } from '@/api/template/flowpath.js' |
| | | import {getFlowpathList, stagelist, attributeListRight, attributeList, attributeSave} from '@/api/template/flowpath.js' |
| | | import TableTransfer from '@/components/template/TableTransfer' |
| | | |
| | | export default { |
| | | name: 'Stage', |
| | | components: { |
| | | TableTransfer |
| | | name: 'Stage', |
| | | components: { |
| | | TableTransfer |
| | | }, |
| | | props: { |
| | | code: { |
| | | typeof: String, |
| | | required: true, |
| | | default: "" |
| | | }, |
| | | props: { |
| | | code: { |
| | | typeof: String, |
| | | required: true, |
| | | default: "" |
| | | }, |
| | | Formlist:{ |
| | | type:Array, |
| | | default:[] |
| | | } |
| | | }, |
| | | watch: { |
| | | code: { |
| | | handler(newval, oldval) { |
| | | this.getDataList() |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | const options = { |
| | | height: "auto", |
| | | border: true, |
| | | addBtn: false, |
| | | align: 'center', |
| | | menuAlign: 'center', |
| | | index: true, |
| | | searchMenuSpan: 8, |
| | | searchBtn: false, |
| | | emptyBtn: false, |
| | | columnBtn: false, |
| | | delBtn: false, |
| | | refreshBtn: false, |
| | | header: false, |
| | | editBtn: false, |
| | | } |
| | | return { |
| | | attributeData: [], |
| | | attributeValue: [], |
| | | flag: false, |
| | | dialogTransfer: false, |
| | | dialogNode: false, |
| | | visibleTable: false, |
| | | loading: false, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | }, |
| | | modelKey: '', |
| | | data: [], |
| | | stageData: [], |
| | | saveParam: {}, |
| | | columns: [ |
| | | { |
| | | key: "oid", |
| | | label: "oid", |
| | | visible: false, |
| | | }, |
| | | { |
| | | key: "id", |
| | | label: "属性编号", |
| | | visible: true, |
| | | }, |
| | | { |
| | | key: "name", |
| | | label: "属性名称", |
| | | visible: true, |
| | | }, |
| | | { |
| | | key: "attributeGroup", |
| | | label: "属性分组", |
| | | visible: true, |
| | | }, |
| | | ], |
| | | option: { |
| | | ...options, |
| | | height: 383, |
| | | column: [ |
| | | { label: '模板编号', prop: 'modelKey' }, |
| | | { label: '模板名称', prop: 'modelName' }, |
| | | { label: '描述', prop: 'buttonTypeValue' }, |
| | | ] |
| | | }, |
| | | stageOption: { |
| | | ...options, |
| | | height:620, |
| | | column: [ |
| | | { label: '阶段编号', prop: 'taskId' }, |
| | | { label: '阶段名称', prop: 'taskName' }, |
| | | ] |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | setTable(data, list) { |
| | | return data.map(item => { |
| | | if (list.length !== 0) { |
| | | list.forEach(element => { |
| | | if (item.id === element.attrId) item.checked = true |
| | | }); |
| | | } |
| | | return item |
| | | }) |
| | | }, |
| | | // 获取列表 |
| | | async getDataList() { |
| | | this.loading = false |
| | | if (this.code) { |
| | | const {pageSize, currentPage} = this.page |
| | | let param = {size: pageSize, current: currentPage} |
| | | const response = await getFlowpathList({...param, ...{templateId: this.code}}) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.loading = false |
| | | const data = response.data.data |
| | | this.data = data.records |
| | | this.page.total = data.total |
| | | } else this.loading = false |
| | | }else { |
| | | this.data=[] |
| | | } |
| | | }, |
| | | // 获取阶段列表 |
| | | async getStagelist() { |
| | | this.loading = false |
| | | console.log(this.modelKey) |
| | | const response = await stagelist({ modelKey: this.modelKey }) |
| | | if (response.status === 200) { |
| | | this.loading = false |
| | | console.log(response.data) |
| | | this.stageData = response.data.data |
| | | } else this.loading = false |
| | | }, |
| | | // 获取全部属性 |
| | | async getAttributeList() { |
| | | const response = await attributeList({ 'conditionMap[classifyTemplateOid]': this.code }) |
| | | const responseRight = await attributeListRight({ templateId: this.code, modelKey: this.modelKey, taskId: this.saveParam.taskId }) |
| | | if (response.status === 200 && responseRight.status === 200) { |
| | | let datas = response.data.data.records |
| | | let dataRight = responseRight.data.data |
| | | datas = datas.map(item => { |
| | | const { oid, id, name, attributeGroup } = item |
| | | item = { oid, id, name, attributeGroup, ...{ checked: false } } |
| | | if (dataRight.length !== 0) { |
| | | dataRight.forEach(element => { if (item.id === element.attrId) item.checked = true }); |
| | | } |
| | | return item |
| | | }) |
| | | console.log(datas) |
| | | let dataValue = datas.map(item => item.checked ? item.oid : undefined) |
| | | this.attributeValue = dataValue.filter(item => item) |
| | | this.attributeData = datas |
| | | this.flag = true |
| | | } |
| | | }, |
| | | // 获取已保存属性 |
| | | async getAttributeListRight() { |
| | | const response = await attributeListRight({ templateId: this.code, modelKey: this.modelKey, taskId: this.saveParam.taskId }) |
| | | if (response.status === 200) { |
| | | let data = response.data.data |
| | | data = data.map(item => { |
| | | const { attrId, attrName, attrGroup } = item |
| | | return { attrId, attrName, attrGroup } |
| | | }) |
| | | this.listRight = data |
| | | } |
| | | }, |
| | | // 维护 |
| | | handleMaintenance(row) { |
| | | console.log(row) |
| | | this.dialogNode = true |
| | | this.modelKey = row.modelKey |
| | | this.saveParam.modelKey = row.modelKey |
| | | this.getStagelist() |
| | | }, |
| | | // 维护 |
| | | handleMaintenanceTransfer(row) { |
| | | this.saveParam.taskId = row.taskId |
| | | this.saveParam.taskName = row.taskName |
| | | this.getAttributeList() |
| | | this.$nextTick(() => { |
| | | this.dialogTransfer = true |
| | | }) |
| | | }, |
| | | handleRowClick(row) { |
| | | console.log(row) |
| | | this.modelKey = row.modelKey |
| | | this.saveParam.modelKey = row.modelKey |
| | | this.dialogNode = true |
| | | }, |
| | | handleRowStageClick(row) { |
| | | this.saveParam.taskId = row.taskId |
| | | this.saveParam.taskName = row.taskName |
| | | this.getAttributeList() |
| | | this.$nextTick(() => { |
| | | this.dialogTransfer = true |
| | | }) |
| | | }, |
| | | async handleSave(event) { |
| | | console.log(event) |
| | | const data = event.map(item => { |
| | | const { id, name, attributeGroup } = item |
| | | return { attrId: id, attrName: name, attrGroup: attributeGroup } |
| | | }) |
| | | let param = { |
| | | templateId: this.code, |
| | | processStageAttr: data, |
| | | ...this.saveParam |
| | | } |
| | | console.log(this.saveParam) |
| | | console.log(data) |
| | | const response = await attributeSave(param) |
| | | if (response.status === 200) { |
| | | // loading() |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '新增数据成功!' |
| | | }) |
| | | this.flag = false |
| | | // done() |
| | | // this.getDataList() |
| | | } |
| | | }, |
| | | handelClose() { |
| | | this.flag = false |
| | | } |
| | | Formlist: { |
| | | type: Array, |
| | | default: [] |
| | | } |
| | | }, |
| | | watch: { |
| | | code: { |
| | | handler(newval, oldval) { |
| | | this.getDataList() |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | const options = { |
| | | height: "auto", |
| | | border: true, |
| | | addBtn: false, |
| | | align: 'center', |
| | | menuAlign: 'center', |
| | | index: true, |
| | | searchMenuSpan: 8, |
| | | searchBtn: false, |
| | | emptyBtn: false, |
| | | columnBtn: false, |
| | | delBtn: false, |
| | | refreshBtn: false, |
| | | header: false, |
| | | editBtn: false, |
| | | } |
| | | return { |
| | | attributeData: [], |
| | | attributeValue: [], |
| | | flag: false, |
| | | dialogTransfer: false, |
| | | dialogNode: false, |
| | | visibleTable: false, |
| | | loading: false, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0 |
| | | }, |
| | | modelKey: '', |
| | | data: [], |
| | | stageData: [], |
| | | saveParam: {}, |
| | | columns: [ |
| | | { |
| | | key: "oid", |
| | | label: "oid", |
| | | visible: false, |
| | | }, |
| | | { |
| | | key: "id", |
| | | label: "属性编号", |
| | | visible: true, |
| | | }, |
| | | { |
| | | key: "name", |
| | | label: "属性名称", |
| | | visible: true, |
| | | }, |
| | | { |
| | | key: "attributeGroup", |
| | | label: "属性分组", |
| | | visible: true, |
| | | }, |
| | | ], |
| | | option: { |
| | | ...options, |
| | | height: 383, |
| | | column: [ |
| | | {label: '模板编号', prop: 'modelKey'}, |
| | | {label: '模板名称', prop: 'modelName'}, |
| | | {label: '描述', prop: 'buttonTypeValue'}, |
| | | ] |
| | | }, |
| | | stageOption: { |
| | | ...options, |
| | | height: 620, |
| | | column: [ |
| | | {label: '阶段编号', prop: 'taskId'}, |
| | | {label: '阶段名称', prop: 'taskName'}, |
| | | ] |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | setTable(data, list) { |
| | | return data.map(item => { |
| | | if (list.length !== 0) { |
| | | list.forEach(element => { |
| | | if (item.id === element.attrId) item.checked = true |
| | | }); |
| | | } |
| | | return item |
| | | }) |
| | | }, |
| | | // 获取列表 |
| | | async getDataList() { |
| | | this.loading = false |
| | | if (this.code) { |
| | | const {pageSize, currentPage} = this.page |
| | | let param = {size: pageSize, current: currentPage} |
| | | const response = await getFlowpathList({...param, ...{templateId: this.code}}) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.loading = false |
| | | const data = response.data.data |
| | | this.data = data.records |
| | | this.page.total = data.total |
| | | } else this.loading = false |
| | | } else { |
| | | this.data = [] |
| | | } |
| | | }, |
| | | // 获取阶段列表 |
| | | async getStagelist() { |
| | | this.loading = false |
| | | console.log(this.modelKey) |
| | | const response = await stagelist({modelKey: this.modelKey}) |
| | | if (response.status === 200) { |
| | | this.loading = false |
| | | console.log(response.data) |
| | | this.stageData = response.data.data |
| | | } else this.loading = false |
| | | }, |
| | | // 获取全部属性 |
| | | async getAttributeList() { |
| | | const response = await attributeList({'conditionMap[classifyTemplateOid]': this.code}) |
| | | const responseRight = await attributeListRight({ |
| | | templateId: this.code, |
| | | modelKey: this.modelKey, |
| | | taskId: this.saveParam.taskId |
| | | }) |
| | | if (response.status === 200 && responseRight.status === 200) { |
| | | let datas = response.data.data.records |
| | | let dataRight = responseRight.data.data |
| | | datas = datas.map(item => { |
| | | const {oid, id, name, attributeGroup} = item |
| | | item = {oid, id, name, attributeGroup, ...{checked: false}} |
| | | if (dataRight.length !== 0) { |
| | | dataRight.forEach(element => { |
| | | if (item.id === element.attrId) item.checked = true |
| | | }); |
| | | } |
| | | return item |
| | | }) |
| | | console.log(datas) |
| | | let dataValue = datas.map(item => item.checked ? item.oid : undefined) |
| | | this.attributeValue = dataValue.filter(item => item) |
| | | this.attributeData = datas |
| | | this.flag = true |
| | | } |
| | | }, |
| | | // 获取已保存属性 |
| | | async getAttributeListRight() { |
| | | const response = await attributeListRight({ |
| | | templateId: this.code, |
| | | modelKey: this.modelKey, |
| | | taskId: this.saveParam.taskId |
| | | }) |
| | | if (response.status === 200) { |
| | | let data = response.data.data |
| | | data = data.map(item => { |
| | | const {attrId, attrName, attrGroup} = item |
| | | return {attrId, attrName, attrGroup} |
| | | }) |
| | | this.listRight = data |
| | | } |
| | | }, |
| | | // 维护 |
| | | handleMaintenance(row) { |
| | | console.log(row) |
| | | this.dialogNode = true |
| | | this.modelKey = row.modelKey |
| | | this.saveParam.modelKey = row.modelKey |
| | | this.getStagelist() |
| | | }, |
| | | // 维护 |
| | | handleMaintenanceTransfer(row) { |
| | | this.saveParam.taskId = row.taskId |
| | | this.saveParam.taskName = row.taskName |
| | | this.getAttributeList() |
| | | this.$nextTick(() => { |
| | | this.dialogTransfer = true |
| | | }) |
| | | }, |
| | | handleRowClick(row) { |
| | | console.log(row) |
| | | this.modelKey = row.modelKey |
| | | this.saveParam.modelKey = row.modelKey |
| | | this.dialogNode = true |
| | | }, |
| | | handleRowStageClick(row) { |
| | | this.saveParam.taskId = row.taskId |
| | | this.saveParam.taskName = row.taskName |
| | | this.getAttributeList() |
| | | this.$nextTick(() => { |
| | | this.dialogTransfer = true |
| | | }) |
| | | }, |
| | | async handleSave(event) { |
| | | console.log(event) |
| | | const data = event.map(item => { |
| | | const {id, name, attributeGroup} = item |
| | | return {attrId: id, attrName: name, attrGroup: attributeGroup} |
| | | }) |
| | | let param = { |
| | | templateId: this.code, |
| | | processStageAttr: data, |
| | | ...this.saveParam |
| | | } |
| | | console.log(this.saveParam) |
| | | console.log(data) |
| | | const response = await attributeSave(param) |
| | | if (response.status === 200) { |
| | | // loading() |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '新增数据成功!' |
| | | }) |
| | | this.flag = false |
| | | // done() |
| | | // this.getDataList() |
| | | } |
| | | }, |
| | | handelClose() { |
| | | this.flag = false |
| | | } |
| | | } |
| | | } |
| | | </script> |