| | |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | <div class="descBox" style="width: 25%;"> |
| | | <div class="descBox" style="width: 24%;"> |
| | | <el-descriptions :column="1" border class="margin-top" size="medium" title="版本规则"> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | |
| | | |
| | | </el-descriptions> |
| | | </div> |
| | | <div class="descBox" style="width: calc(35% - 40px);margin-right: 0"> |
| | | <div class="descBox" style="width: calc(36% - 40px);margin-right: 0"> |
| | | <el-descriptions :column="1" border class="margin-top" size="medium" title="生命周期"> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | |
| | | 生命周期 |
| | | </template> |
| | | <el-tag v-if="nodeRow.lifeCycleId">{{ nodeRow.lifeCycleId }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | 备选生命周期 |
| | | </template> |
| | | <div v-if="nodeRow.lifeCycleIds"> |
| | | <el-tag v-for="item in nodeRow.lifeCycleIds.split(',')" style="margin-right: 5px;">{{ item }}</el-tag> |
| | | </div> |
| | | |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | |
| | | :props="{label: 'id', value: 'id'}" |
| | | :dic="lifeData"></avue-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="备选生命周期列表:" label-width="138px"> |
| | | <avue-select multiple |
| | | :filterable="true" |
| | | v-model="form.subLifeCycleId" |
| | | v-model="form.subLifeCycleIdList" |
| | | placeholder="请选择生命周期" |
| | | :props="{label: 'id', value: 'id'}" |
| | | type="tree" |
| | | :dic="lifeData"></avue-select> |
| | | :dic="subLifeData" |
| | | @change="subLifeChange"></avue-select> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | | <div class="bottomForm"> |
| | | <h3 style="margin-bottom: 10px;">属性池列表</h3> |
| | | <avue-crud |
| | | size="mini" |
| | | :data="dialogAttrData" |
| | | :option="dialogAttrOption" |
| | | @row-del="dialogBottomAttrDel"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addDialogClickHandler">创建</el-button> |
| | | <h3 style="display: inline-block;margin-right: 20px;margin-bottom: 10px;">属性池列表</h3> |
| | | <el-button icon="el-icon-plus" size="mini" type="primary" @click="addDialogClickHandler">创建</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer avue-dialog__footer"> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="addDialogSavaHandler">确 定</el-button> |
| | | <el-button @click="addDialogClose">取 消</el-button> |
| | | </span> |
| | |
| | | > |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogAttrClose">取 消</el-button> |
| | | <el-button type="primary" @click="dialogAttrAddClickHandler">确 定</el-button> |
| | | <el-button @click="dialogAttrClose">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | |
| | | index: false, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | header:false, |
| | | column: [ |
| | | { |
| | | label: '类型名', |
| | |
| | | versionAddFlag: false, |
| | | inheritTreeData: [], |
| | | lifeData: [],//生命周期下拉数据 |
| | | subLifeData:[],//备选生命周期下拉数据 |
| | | allLifeData:[], |
| | | versionData: [],//版本规则数据 |
| | | dialogAttrSelectList: [], |
| | | searchAttrParams: {}, |
| | |
| | | height: 450, |
| | | searchMenuSpan: 8, |
| | | header: false, |
| | | selectable:function(row){ |
| | | return row.selectable; |
| | | }, |
| | | column: [ |
| | | { |
| | | label: '属性名', |
| | | prop: 'id', |
| | | sortable: true, |
| | | search: true, |
| | | width:260 |
| | | }, |
| | | { |
| | | label: '属性类型', |
| | |
| | | label: '初始值', |
| | | prop: 'defaultValue', |
| | | sortable: true, |
| | | width: 200 |
| | | }, |
| | | { |
| | | label: '说明', |
| | |
| | | editBtn: false, |
| | | refreshBtn: false, |
| | | selection: false, |
| | | height: 210, |
| | | height: 220, |
| | | addBtn: false, |
| | | gridBtn:false, |
| | | columnBtn:false, |
| | | menuWidth:100, |
| | | // index:false, |
| | | column: [ |
| | |
| | | label: '属性名', |
| | | prop: 'id', |
| | | sortable: true, |
| | | width:260, |
| | | }, |
| | | { |
| | | |
| | | prop: 'btmTypeId', |
| | | label: '业务类型', |
| | | sortable: true |
| | | sortable: true, |
| | | width: 200 |
| | | }, |
| | | { |
| | | label: '属性类型', |
| | |
| | | label: '初始值', |
| | | prop: 'defaultValue', |
| | | sortable: true, |
| | | width:150, |
| | | width:200, |
| | | }, |
| | | { |
| | | label: '说明', |
| | |
| | | { |
| | | prop: 'id', |
| | | label: '属性名', |
| | | sortable: true |
| | | sortable: true, |
| | | width:260 |
| | | }, |
| | | { |
| | | prop: 'btmTypeId', |
| | | label: '业务类型', |
| | | sortable: true |
| | | sortable: true, |
| | | width:200 |
| | | }, |
| | | { |
| | | prop: 'attributeDataType', |
| | | label: '属性类型', |
| | | sortable: true |
| | | sortable: true, |
| | | width:150 |
| | | }, |
| | | { |
| | | prop: 'defaultValue', |
| | | label: '默认值', |
| | | sortable: true |
| | | sortable: true, |
| | | width: 200 |
| | | }, |
| | | { |
| | | prop: 'description', |
| | |
| | | delimiter: '', // 分隔符 |
| | | versionRule: '0', // 版次号规则 |
| | | lifeCycleId: '', // 生命周期 |
| | | subLifeCycleId: [], // 生命周期备选列表, |
| | | subLifeCycleId: '', // 生命周期备选列表, |
| | | subLifeCycleIdList:[], |
| | | apNameArray: "", // 属性池列表’,‘分隔 |
| | | }, |
| | | nodeRow: {}, |
| | |
| | | } |
| | | ], |
| | | descriptionOption: { |
| | | labelStyle: 'text-align:center;width:100px;', |
| | | contentStyle: 'max-width:200px;text-align:center;word-break;break-all;' |
| | | labelStyle: 'text-align:center;width:110px;', |
| | | contentStyle: 'min-width:200px;text-align:center;word-break:break-all;' |
| | | }, |
| | | icons: { |
| | | id: 'el-icon-finished', |
| | |
| | | this.getLifeCycle(); |
| | | }, |
| | | mounted() { |
| | | }, |
| | | watch:{ |
| | | 'form.lifeCycleId':{ |
| | | handler(newval) { |
| | | if(this.form.lifeCycleId){ |
| | | this.subLifeData = this.allLifeData.filter(item=>{ |
| | | return item.id!=this.form.lifeCycleId |
| | | }); |
| | | }else { |
| | | this.subLifeData = this.allLifeData |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | //树表查询 |
| | |
| | | //获取生命周期数据 |
| | | getLifeCycle(){ |
| | | gridLifeCycle().then(res => { |
| | | this.lifeData = res.data.data; |
| | | this.allLifeData=res.data.data; |
| | | }); |
| | | }, |
| | | // 创建按钮 |
| | |
| | | } |
| | | this.title = 'add'; |
| | | this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id; |
| | | this.lifeData = this.allLifeData; |
| | | this.subLifeData = this.allLifeData; |
| | | this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 字符串false转换为布尔值 |
| | | this.visible = true; |
| | | }, |
| | | |
| | | // 新增编辑保存 |
| | | addDialogSavaHandler() { |
| | | if (this.form.revLevel !== '0' &&!this.form.inputRevisionFlag && (!this.form.revisionRuleId || this.form.revisionRuleId === "")) { |
| | | this.$message.error('请检查版本号规则不能为空'); |
| | | return; |
| | | } |
| | | this.form.lifeCycleIds=this.form.subLifeCycleIdList.join(','); |
| | | this.form.subLifeCycleId=this.form.subLifeCycleIdList.join(','); |
| | | this.form.apNameArray = this.dialogAttrData ? this.dialogAttrData.map(item => item.id).join(',') : ""; |
| | | this.$refs.form.validate((valid) => { |
| | | const saveFunction = this.title === 'add' ? addLifeCycle : updateLifeCycle; |
| | | if (valid) { |
| | | if (this.form.revLevel === 0) { |
| | | this.form.versionRule = ""; |
| | | } |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.resetForm(); |
| | | this.visible = false; |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 编辑按钮点击事件 |
| | | editClickHandler() { |
| | | /** |
| | | * id 名称 |
| | | * name 标签 |
| | | * implClass 实现类 |
| | | * fName 继承自 |
| | | * description 描述 |
| | | * revLevel 版本规则 |
| | | * revisionRuleId 版本号规则 |
| | | * inputRevisionFlag 手工输入 |
| | | * delimiter 分隔符 |
| | | * versionRule 版次号规则 |
| | | * lifeCycleId 生命周期 |
| | | * lifeCycleIds 生命周期列表 |
| | | * attributes 属性池列表 |
| | | */ |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | if (this.nodeRow.id === 'topNode') { |
| | | this.$message.error('请选择子节点进行修改') |
| | | return; |
| | | } |
| | | this.form = {...this.nodeRow}; |
| | | this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 字符串false转换为布尔值 |
| | | // this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id; |
| | | this.form.subLifeCycleIdList = this.nodeRow.lifeCycleIds?this.nodeRow.lifeCycleIds.split(','):[]; |
| | | this.dialogAttrData = this.nodeRow.attributes ? JSON.parse(this.nodeRow.attributes) : []; |
| | | function processChildren(item,fName) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children = item.children.map(child => { |
| | | processChildren(child,fName); // 递归处理每个子节点 |
| | | if(fName==child.id){ |
| | | child.disabled=true; |
| | | }else { |
| | | child.disabled=false; |
| | | } |
| | | return child; |
| | | }); |
| | | } |
| | | }; |
| | | const inheritTreeData=this.inheritTreeData.map(item => { |
| | | processChildren(item,this.form.id); // 处理每个节点 |
| | | if(this.form.id==item.id){ |
| | | item.disabled=true; |
| | | }else { |
| | | item.disabled=false; |
| | | } |
| | | return item; |
| | | }); |
| | | this.inheritTreeData=inheritTreeData |
| | | this.title = 'edit'; |
| | | this.visible = true; |
| | | }, |
| | | |
| | | subLifeChange(data){ |
| | | if (data.value.length == 0) { |
| | | this.lifeData = this.allLifeData |
| | | } else { |
| | | this.lifeData = this.allLifeData.filter(item => { |
| | | return !data.value.includes(item.id) |
| | | }); |
| | | } |
| | | }, |
| | | // 对话框 属性池列表增加按钮 |
| | | addDialogClickHandler() { |
| | | this.dialogAttrLoading = true; |
| | |
| | | // 查询属性池列表数据 |
| | | getAttrDialogDta() { |
| | | gridAttribute(this.attrPage.currentPage, this.attrPage.pageSize, this.searchAttrParams).then(res => { |
| | | const data = res.data.data; |
| | | this.dialogAttrSaveData = data; |
| | | const data = res.data.data.map(item=>{ |
| | | item.selectable=!this.dialogAttrData.some(existingItem => existingItem.id === item.id); |
| | | return item; |
| | | }); |
| | | this.dialogAttrSaveData=data; |
| | | this.attrPage.total = res.data.total; |
| | | this.dialogAttrLoading = false; |
| | | }).catch(err => { |
| | |
| | | |
| | | // 添加属性池 行点击 |
| | | dialogAttrRowClickHandler(row) { |
| | | |
| | | if(!row.selectable){ |
| | | return; |
| | | } |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.dialogAttrCrud, |
| | |
| | | |
| | | // 添加属性池 保存 |
| | | dialogAttrAddClickHandler() { |
| | | let hasDuplicate = false; |
| | | |
| | | // 先创建一个临时数组来存储不重复的项 |
| | | const newItems = []; |
| | | |
| | | this.dialogAttrSelectList.forEach(item => { |
| | | const exists = this.dialogAttrData.some(existingItem => existingItem.id === item.id); |
| | | |
| | | if (exists) { |
| | | hasDuplicate = true; |
| | | return; |
| | | } |
| | | |
| | | // 如果没有重复项,则将该项添加到临时数组中 |
| | | newItems.push({ |
| | | this.dialogAttrData.push({ |
| | | id: item.id, |
| | | attributeDataType: item.attributeDataType, |
| | | defaultValue: item.defaultValue, |
| | | description: item.description |
| | | }); |
| | | }); |
| | | |
| | | if (hasDuplicate) { |
| | | this.$message.error('请检查是否有添加重复项!'); |
| | | } else { |
| | | // 如果没有重复项,将新项添加到 dialogAttrData |
| | | this.dialogAttrData.push(...newItems); |
| | | this.attrPollDialogVisible = false; |
| | | } |
| | | this.attrPollDialogVisible = false; |
| | | }, |
| | | |
| | | // 属性池删除 |
| | |
| | | delimiter: '', // 分隔符 |
| | | versionRule: '0', // 版次号规则 |
| | | lifeCycleId: '', // 生命周期 |
| | | subLifeCycleId: [], // 生命周期备选列表, |
| | | subLifeCycleId: '', // 生命周期备选列表, |
| | | subLifeCycleIdList:[], |
| | | lifeCycleIds:'', |
| | | apNameArray: "", // 属性池列表’,‘分隔 |
| | | }; |
| | |
| | | this.form.delimiter = ""; |
| | | this.form.versionRule = "0"; |
| | | this.form.revisionRuleId = ""; |
| | | }, |
| | | |
| | | // 新增编辑保存 |
| | | addDialogSavaHandler() { |
| | | if (this.form.revLevel !== '0' &&!this.form.inputRevisionFlag && (!this.form.revisionRuleId || this.form.revisionRuleId === "")) { |
| | | this.$message.error('请检查版本号规则不能为空'); |
| | | return; |
| | | } |
| | | this.form.lifeCycleIds=this.form.subLifeCycleId.join(','); |
| | | this.form.apNameArray = this.dialogAttrData ? this.dialogAttrData.map(item => item.id).join(',') : ""; |
| | | this.$refs.form.validate((valid) => { |
| | | const saveFunction = this.title === 'add' ? addLifeCycle : updateLifeCycle; |
| | | if (valid) { |
| | | if (this.form.revLevel === 0) { |
| | | this.form.versionRule = ""; |
| | | } |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.resetForm(); |
| | | this.visible = false; |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 编辑按钮点击事件 |
| | | editClickHandler() { |
| | | /** |
| | | * id 名称 |
| | | * name 标签 |
| | | * implClass 实现类 |
| | | * fName 继承自 |
| | | * description 描述 |
| | | * revLevel 版本规则 |
| | | * revisionRuleId 版本号规则 |
| | | * inputRevisionFlag 手工输入 |
| | | * delimiter 分隔符 |
| | | * versionRule 版次号规则 |
| | | * lifeCycleId 生命周期 |
| | | * lifeCycleIds 生命周期列表 |
| | | * attributes 属性池列表 |
| | | */ |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | if (this.nodeRow.id === 'topNode') { |
| | | this.$message.error('请选择子节点进行修改') |
| | | return; |
| | | }debugger; |
| | | this.form = {...this.nodeRow}; |
| | | this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 字符串false转换为布尔值 |
| | | // this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id; |
| | | this.form.subLifeCycleId = (this.nodeRow.lifeCycleIds && this.nodeRow.lifeCycleIds.trim()) |
| | | ? this.nodeRow.lifeCycleIds.split(',').map(item => ({id: item.trim()})) |
| | | : []; |
| | | this.dialogAttrData = this.nodeRow.attributes ? JSON.parse(this.nodeRow.attributes) : []; |
| | | function processChildren(item,fName) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children = item.children.map(child => { |
| | | processChildren(child,fName); // 递归处理每个子节点 |
| | | if(fName==child.id){ |
| | | child.disabled=true; |
| | | }else { |
| | | child.disabled=false; |
| | | } |
| | | return child; |
| | | }); |
| | | } |
| | | }; |
| | | const inheritTreeData=this.inheritTreeData.map(item => { |
| | | processChildren(item,this.form.id); // 处理每个节点 |
| | | if(this.form.id==item.id){ |
| | | item.disabled=true; |
| | | }else { |
| | | item.disabled=false; |
| | | } |
| | | return item; |
| | | }); |
| | | this.inheritTreeData=inheritTreeData |
| | | this.title = 'edit'; |
| | | this.visible = true; |
| | | }, |
| | | |
| | | // 删除按钮 |
| | |
| | | .dialogForm > div { |
| | | border: 1px solid #EBEEF5; |
| | | border-radius: 2px; |
| | | padding: 25px 20px 5px 10px; /* 上 右 下 左 */ |
| | | padding: 15px 20px 0 10px; /* 上 右 下 左 */ |
| | | box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */ |
| | | } |
| | | |