| | |
| | | <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="ImportExcel">导入</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> |
| | | </div> |
| | | <!-- 树节点添加对话框--> |
| | | <el-dialog :title="this.TreeFlag ? '添加分类' :'添加主题库'" :visible.sync="TreeAddFormVisible" append-to-body |
| | | <el-dialog :title="this.TreeFlag ? '添加分类' :'添加主题库'" :before-close="TreeEscHandler" :visible.sync="TreeAddFormVisible" v-loading="AddLoading" append-to-body |
| | | style="width: 1700px;margin: auto"> |
| | | <el-form :model="TreeAddform" :rules="rules"> |
| | | <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==false" prop="btmTypeName"> |
| | | <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-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="TreeAddFormVisible = false">取 消</el-button> |
| | | <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="TreeFlagCode" ::nodeClickList="nodeClickList" @referTreeForm="referTreeForm" @flushed="flushed"></classifyTreeform> |
| | | <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" |
| | |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 模板克隆 --> |
| | | <el-dialog :visible.sync="CloneVisible" append-to-body title="克隆模板"> |
| | | <el-dialog :visible.sync="CloneVisible" append-to-body title="克隆模板" :before-close="cloneClose"> |
| | | <el-container> |
| | | <el-aside width="300px"> |
| | | <div style="margin-bottom: 5px"><el-tag>主题库分类</el-tag></div> |
| | | <!-- 克隆模板的树 沿用首页树的loading和option,但是data和v-model绑定的数据创建一个新的变量,另外点击方法也是重新获取来操作克隆模板的数据--> |
| | | <avue-tree v-model="TreeAvueform" v-loading="loading" :data="Treedata" |
| | | <avue-tree ref="cloneTree" v-model="TreeAvueform" v-loading="loading" :data="Treedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | style="height: 50.5vh;margin-right: 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="CloneVisible=false" >取消</el-button> |
| | | <el-button size="small" @click="cloneClose" >取消</el-button> |
| | | </div> |
| | | <el-dialog |
| | | width="30%" |
| | |
| | | <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> |
| | | </template> |
| | | <avue-crud :data="masterData" :option="masterOption" @select="masterSelect"></avue-crud> |
| | | <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> |
| | | </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-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> |
| | | </template> |
| | | <avue-crud :data="KeyData" :option="masterOption" @select="KeySelect"></avue-crud> |
| | | <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> |
| | | </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-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> |
| | | </template> |
| | | <avue-crud :data="simData" :option="masterOption" @select="simSelect"></avue-crud> |
| | | <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> |
| | | </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-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> |
| | | </template> |
| | | <avue-crud :data="BtmData" :option="masterOption" @select="btmSelect"></avue-crud> |
| | | <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> |
| | | </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" > |
| | |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <ThemeImport :visible.sync="ThemeImportVisible"></ThemeImport> |
| | | <!-- 导出--> |
| | | <ThemeImport :visible.sync="ThemeImportVisible" :codeClassifyOid="this.codeClassifyOid"></ThemeImport> |
| | | </basic-container> |
| | | </el-main> |
| | | </el-container> |
| | |
| | | inject: ["crudTreeData"], |
| | | data() { |
| | | return { |
| | | masterRow:null, |
| | | AddLoading:false, |
| | | // 定义一个变量来保存树请求的数量 |
| | | requestCount:null, |
| | | //导入状态框 |
| | | ThemeImportVisible:false, |
| | | selectRow:'', |
| | | selectList:[], |
| | | //树节点显示隐藏 |
| | | TreeFlagCode:false, |
| | | TreeFlagCode:true, |
| | | //修改节点显示隐藏 |
| | | editTreeFLagCode:false, |
| | | //编码规则 |
| | | MasterdialogVisible:false, |
| | | masterData:[], |
| | |
| | | addBtn:false, |
| | | index:true, |
| | | border:true, |
| | | selection:true, |
| | | menu:false, |
| | | height:380, |
| | | column:[ |
| | | { |
| | | label: '', |
| | | prop: 'radio', |
| | | width: 60, |
| | | display: false |
| | | }, |
| | | { |
| | | label:'英文名称', |
| | | prop:'id' |
| | |
| | | label: '英文名称' |
| | | } |
| | | ], |
| | | SelectValue:"", |
| | | SelectValue:"id", |
| | | SelectFInd:"", |
| | | addFlag:false, |
| | | // 表格当前行id |
| | |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: '请输入名称', trigger: 'blur' }, |
| | | { required: true, message: '请输入编号', trigger: 'blur' }, |
| | | ], |
| | | name:[ |
| | | { required: true, message: '请输入编号', trigger: 'blur' }, |
| | | { required: true, message: '请输入名称', trigger: 'blur' }, |
| | | ], |
| | | btmTypeName:[ |
| | | { required: true, message: '请选择业务类型', trigger: 'blur' }, |
| | |
| | | showEditBtn:false, |
| | | } |
| | | }, |
| | | watch:{ |
| | | |
| | | }, |
| | | //tab栏默认是表格 |
| | | mounted() { |
| | | this.type = this.tabOption.column[0]; |
| | |
| | | this.$refs.tree.setCurrentKey(null) |
| | | this.nodeClickList = {} |
| | | this.TreeList=[] |
| | | this.TreeFlagCode=false; |
| | | this.TreeFlagCode=true; |
| | | } |
| | | }, true) |
| | | }, |
| | |
| | | label: '', |
| | | prop: 'radio', |
| | | width: 60, |
| | | hide: false, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "模板编号", |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | // 关闭弹窗 |
| | | |
| | | /** 导入 */ |
| | | ImportExcel(){ |
| | | // debugger |
| | | // this.batchImportData.visible = true |
| | | // this.batchImportData.codeClassifyOid = this.codeClassifyOid |
| | | this.ThemeImportVisible=true; |
| | | console.log('ThemeImportVisible',this.ThemeImportVisible) |
| | | }, |
| | | /** 导出 */ |
| | | ExportExcel(){ |
| | | if(this.nodeClickList){ |
| | | exportClassify({oid:this.nodeClickList.oid}).then(res=>{ |
| | | console.log(res) |
| | | func.downloadFileByBlob(res); |
| | | func.downloadFileByBlobHandler(res); |
| | | }) |
| | | }else { |
| | | this.$message.warning('请先选择要导出的主题库分类') |
| | | } |
| | | }, |
| | | //模板管理已发布编辑 |
| | | // checkShowEditBtn() { |
| | | // this.showEditBtn = this.Formlist.some(item => item.lcStatus === 'Released'); |
| | | // }, |
| | | //编码规则失焦 |
| | | CodeFoucus(){ |
| | | this.MasterdialogVisible=true; |
| | |
| | | }, |
| | | //编码多选 |
| | | masterSelect(row){ |
| | | if(row.length>0){ |
| | | this.masterRow=row.$index; |
| | | this.masterSelectList=row; |
| | | this.masterName=row[0].name; |
| | | this.masterOid=row[0].oid; |
| | | } |
| | | this.masterName=row.name; |
| | | this.masterOid=row.oid; |
| | | |
| | | }, |
| | | //编码规则查询 |
| | | SelectFindeHandler(){ |
| | |
| | | 'conditionMap[id]':this.SelectFInd |
| | | } |
| | | this.MasterdefaultRend(masterParameter); |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } |
| | | this.MasterdefaultRend(masterParameter) |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | } |
| | | }, |
| | | //编码规则确定 |
| | |
| | | 'conditionMap[id]':this.SelectFInd |
| | | } |
| | | this.KeydefaultRend(masterParameter); |
| | | this.SelectValue=""; |
| | | this.SelectFInd=""; |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } |
| | | this.KeydefaultRend(masterParameter) |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | } |
| | | }, |
| | | //关键属性接口 |
| | |
| | | }, |
| | | // 关键多选 |
| | | KeySelect(row){ |
| | | this.masterRow=row.$index; |
| | | this.KeySelectLIst=row; |
| | | this.KeyName=row[0].name; |
| | | this.KeyOid=row[0].oid; |
| | | this.KeyName=row.name; |
| | | this.KeyOid=row.oid; |
| | | }, |
| | | //关键失焦 |
| | | simFouce(){ |
| | |
| | | 'conditionMap[id]':this.SelectFInd |
| | | } |
| | | this.simdefaultRend(masterParameter); |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } |
| | | this.simdefaultRend(masterParameter) |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | } |
| | | }, |
| | | // 相似项多选 |
| | | simSelect(row){ |
| | | this.masterRow=row.$index; |
| | | this.simSelectList=row; |
| | | this.simName=row[0].name; |
| | | this.simOid=row[0].oid; |
| | | this.simName=row.name; |
| | | this.simOid=row.oid; |
| | | }, |
| | | //相似项项接口 |
| | | simdefaultRend(){ |
| | |
| | | 'conditionMap[id]':this.SelectFInd |
| | | } |
| | | this.btmdefaultRend(masterParameter); |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } |
| | | this.btmdefaultRend(masterParameter); |
| | | this.SelectValue=""; |
| | | this.SelectFInd=""; |
| | | } |
| | | }, |
| | | //业务类型多选 |
| | | btmSelect(row){ |
| | | this.masterRow=row.$index; |
| | | this.btmSelectList=row; |
| | | this.btmName=row[0].name; |
| | | this.btmOid=row[0].id; |
| | | this.btmName=row.name; |
| | | this.btmOid=row.id; |
| | | }, |
| | | //业务类型接口 |
| | | btmdefaultRend(masterParameter){ |
| | |
| | | this.crudOid=row.oid; |
| | | this.crudLCStatus=row.lcStatus; |
| | | this.crudArray.push(row); |
| | | console.log(row.$index) |
| | | gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': row.oid}).then(res => { |
| | | this.ProData = res.data.data; |
| | | //分类注入数据格式 |
| | | this.ProData = res.data.data.map((item) => { |
| | | //如果分类注入classifyInvokeAttr为空说明是初始状态 |
| | | if(item.classifyInvokeAttr !== ''){ |
| | | if (!item.hasOwnProperty('classifyInvokeText')) { // 检查classifyInvokeText属性是否存在 |
| | | item = { |
| | | ...item, |
| | | classifyInvokeText: { |
| | | "注入类型": item.classifyInvokeAttr, |
| | | "注入类型名称": item.classifyInvokeAttrName, |
| | | "层级设置": item.classifyInvokeLevel, |
| | | "是否可修改": item.classifyInvokeEditFlag |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | return item; |
| | | }); |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | | this.gridCode() |
| | | }, |
| | | //分类树数据处理 |
| | | getAttr() { |
| | |
| | | }) |
| | | //调用修改属性名方法 |
| | | this.ModifyProperties(this.CloneTreedata, 'name', 'label'); |
| | | console.log(this.CloneTreedata) |
| | | this.CloneTreedata = this.CloneTreedata.map(item => { |
| | | if (item.attributes.lcStatus === "Disabled") { |
| | | item.label += '【停用】'; |
| | | } |
| | | return item; |
| | | }); |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | |
| | | }) |
| | | }, |
| | | //定义一个修改数据属性名的方法 |
| | |
| | | } |
| | | }, |
| | | //树节点添加按钮 |
| | | TreeAdd() { |
| | | this.TreeAddFormVisible = true; |
| | | // 判断当前是否有点击子项 |
| | | if (this.nodeClickList !== "") { |
| | | this.TreeFlag = true |
| | | async TreeAdd() { |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: 'Loading', |
| | | spinner: 'el-icon-loading', |
| | | background: 'rgba(0, 0, 0, 0.3)' |
| | | }); |
| | | try { |
| | | //新增表头名称 |
| | | this.TreeFlag=!this.nodeClickList |
| | | await new Promise(resolve => setTimeout(resolve, 500)); |
| | | this.TreeAddFormVisible = true; |
| | | loading.close(); |
| | | } catch (error) { |
| | | this.$message.error(error); |
| | | loading.close(); |
| | | } |
| | | }, |
| | | //树节点取消事件 |
| | | TreeEscHandler(){ |
| | | this.TreeAddform={}; |
| | | this.TreeAddFormVisible=false; |
| | | // 关闭弹窗清空校验 |
| | | this.$refs.myForm.clearValidate(); |
| | | }, |
| | | //树节点添加事件 |
| | | TreeAddHandler() { |
| | | const data = this.TreeAddform; |
| | | // data.btmtypename= this.TreeList.btmtypename |
| | | this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid); |
| | | TreeSave(data) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "添加成功!", |
| | | if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) { |
| | | this.$message.warning('请输入内容!'); |
| | | }else { |
| | | const data = this.TreeAddform; |
| | | // data.btmtypename= this.TreeList.btmtypename |
| | | this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid); |
| | | TreeSave(data) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "添加成功!", |
| | | }); |
| | | Object.keys(this.TreeAddform).forEach(key => { |
| | | this.TreeAddform[key] = ""; |
| | | }); |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false; |
| | | //添加完成后右侧清空 |
| | | this.ProData=[]; |
| | | this.Formlist=[]; |
| | | }) |
| | | .catch((res) => { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res, |
| | | }); |
| | | }); |
| | | Object.keys(this.TreeAddform).forEach(key => { |
| | | this.TreeAddform[key] = ""; |
| | | }); |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false; |
| | | }) |
| | | .catch((res) => { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res, |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | //树节点删除按钮 |
| | | TreeDel() { |
| | |
| | | }, |
| | | //树点击事件 |
| | | async nodeClick(data) { |
| | | //定义一个模板属性id,数据是模板管理表格里面的oid |
| | | if(data.parentId == ""){ |
| | | this.TreeFlagCode=true; |
| | | } |
| | | this.nodeClickList = data |
| | | this.ProData=[] |
| | | console.log(data); |
| | | //操作新增和修改的业务类型隐藏 |
| | | this.TreeFlagCode = !data; |
| | | this.editTreeFLagCode = !data.parentId; |
| | | this.nodeClickList = data; |
| | | this.selectRow = 0; |
| | | this.crudArray=[] |
| | | try { |
| | | await TreeObjcet(data.oid).then(res => { |
| | | this.FlagObj = res.data.data |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | | //模板管理表格数据 |
| | | await gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}).then(res => { |
| | | this.Formlist = res.data.data.filter(item => { |
| | | if (item.codeclassifyoid != "") { |
| | | this.codeClassifyOid = item.codeclassifyoid |
| | | return item.codeclassifyoid == this.nodeClickList.oid |
| | | } |
| | | }) |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | | // 基本信息表单数据 |
| | | await getObjectByOid(this.nodeClickList.oid).then(res => { |
| | | this.TreeList = res.data.data; |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | | this.requestCount += 1; |
| | | const [res1, res2, res3] = await Promise.all([ |
| | | TreeObjcet(data.oid), |
| | | gridCodeClassifyTemplate({ 'conditionMap[codeclassifyoid]': data.oid }), |
| | | getObjectByOid(data.oid) |
| | | ]); |
| | | this.FlagObj = res1.data.data; |
| | | this.Formlist = res2.data.data.filter(item => { |
| | | if (item.codeclassifyoid != "") { |
| | | this.codeClassifyOid = item.codeclassifyoid; |
| | | return item.codeclassifyoid == this.nodeClickList.oid; |
| | | } |
| | | }); |
| | | if (this.Formlist.length >= 1) { |
| | | this.crudLCStatus = this.Formlist[this.selectRow].lcStatus; |
| | | this.crudArray.push(this.Formlist[this.selectRow]); |
| | | this.crudOid = this.Formlist[this.selectRow].oid; |
| | | await this.gridCode(); |
| | | } else { |
| | | this.ProData = []; |
| | | this.crudOid='' |
| | | } |
| | | this.TreeList = res3.data.data; |
| | | } catch (error) { |
| | | this.$message.error(error) |
| | | this.$message.error(error); |
| | | } |
| | | }, |
| | | |
| | | async gridCode() { |
| | | try { |
| | | 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')) { |
| | | item.classifyInvokeText = { |
| | | '注入类型': item.classifyInvokeAttr, |
| | | '注入类型名称': item.classifyInvokeAttrName, |
| | | '层级设置': item.classifyInvokeLevel, |
| | | '是否可修改': item.classifyInvokeEditFlag |
| | | }; |
| | | } |
| | | } |
| | | return item; |
| | | }); |
| | | } catch (error) { |
| | | this.$message.error(error); |
| | | } |
| | | }, |
| | | treeClick(e) { |
| | |
| | | }); |
| | | } else { |
| | | this.$set(row, "codeclassifyoid", this.nodeClickList.oid) |
| | | console.log(this.nodeClickList) |
| | | addSave(row).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "添加成功!" |
| | | }); |
| | | done(row) |
| | | this.CrudRend() |
| | | this.TemRefresh(); |
| | | }).catch(res => { |
| | | this.$message({ |
| | | type: 'info', |
| | |
| | | //模板管理修改 |
| | | CrudRowUpdata(row,index,done) { |
| | | editSave(row).then(() => { |
| | | this.CrudRend() |
| | | this.TemRefresh(); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | |
| | | //模板管理删除 |
| | | CrudRowDel(row) { |
| | | deleteData(row).then(()=> { |
| | | this.CrudRend() |
| | | this.TemRefresh(); |
| | | }).catch(res => { |
| | | this.$message({ |
| | | type: 'info', |
| | |
| | | }); |
| | | }) |
| | | }, |
| | | //模板管理表格查询,只有一条数据没必要做搜索 |
| | | /*nterFind() { |
| | | if (this.findText == "") { |
| | | gridCodeClassifyTemplate().then(res => { |
| | | this.Formlist = res.data.data |
| | | }) |
| | | } else { |
| | | gridCodeClassifyTemplate().then(res => { |
| | | this.Formlist = res.data.data.filter(item => { |
| | | return item.name.includes(this.findText) |
| | | }) |
| | | }) |
| | | } |
| | | },*/ |
| | | //克隆取消 |
| | | cloneClose(){ |
| | | this.$refs.cloneTree.setCurrentKey(null) |
| | | this.ClonenodeClickList = {} |
| | | this.CloneFormlist=[] |
| | | this.CloneVisible=false; |
| | | }, |
| | | //克隆模板查询 |
| | | CloneEnterFind(){ |
| | | gridCodeClassifyTemplate().then(res => { |
| | |
| | | } |
| | | }, |
| | | //克隆模板单选框改变 |
| | | selectionChange(row){ |
| | | this.CloneSelect=row; |
| | | //双向绑定,提交表单输入框回填上当前选择的数据 |
| | | this.CloneModel.id=row[0].id; |
| | | this.CloneModel.name=row[0].name; |
| | | //这里有点绕,CloneSelect是我选择框选择的数据。等于this.nodeClickList.oid是因为,克隆模板传递数据要把当前选择树的oid传递给后端。而不是当前要克隆模板的oid |
| | | this.CloneSelect[0].codeclassifyoid=this.nodeClickList.oid |
| | | selectionChange(row) { |
| | | this.CloneSelect = row; |
| | | 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) |
| | | }, |
| | | //克隆表单提交 |
| | | Clonesubmit(row,done){ |
| | | //重新赋值CloneSelect传递的数据为输入框可以修改的数据,CloneModel提交表单输入框双向绑定数据 |
| | | this.CloneSelect[0].id=this.CloneModel.id; |
| | | this.CloneSelect[0].name=this.CloneModel.name; |
| | | copy(this.CloneSelect[0]).then(()=>{ |
| | | //因为是嵌套弹窗所以手动关闭CloneinnerVisible,CloneVisible两个弹窗。 |
| | | this.CloneinnerVisible=false |
| | | this.CloneVisible=false |
| | | this.$message.success("复制成功") |
| | | this.CrudRend() |
| | | done(row) |
| | | }).catch(res=>{ |
| | | done(res) |
| | | }) |
| | | Clonesubmit(row, done) { |
| | | // 重新赋值CloneSelect传递的数据为输入框可以修改的数据,CloneModel提交表单输入框双向绑定数据 |
| | | Object.assign(this.CloneSelect[0], this.CloneModel); |
| | | // CloneSelect数组第一项 匹配CloneModel对象 |
| | | copy(this.CloneSelect[0]) |
| | | .then(() => { |
| | | // 因为是嵌套弹窗所以手动关闭CloneinnerVisible,CloneVisible两个弹窗。 |
| | | this.CloneinnerVisible = false; |
| | | this.CloneVisible = false; |
| | | this.$message.success("复制成功"); |
| | | this.TemRefresh(); |
| | | done(row); |
| | | }) |
| | | .catch((error) => { |
| | | done(error); |
| | | }); |
| | | }, |
| | | //刷新 |
| | | TemRefresh() { |
| | | this.FormLoing = true |
| | | this.FormLoing = true; |
| | | if (this.nodeClickList.oid != "") { |
| | | gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': this.nodeClickList.oid}).then(res => { |
| | | this.Formlist = res.data.data.filter(item => { |
| | | return item.codeclassifyoid == this.nodeClickList.oid |
| | | }) |
| | | 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 => { |
| | | this.ProData = res.data.data; |
| | | //分类注入数据格式 |
| | | this.ProData = res.data.data.map((item) => { |
| | | //如果分类注入classifyInvokeAttr为空说明是初始状态 |
| | | if(item.classifyInvokeAttr !== ''){ |
| | | if (!item.hasOwnProperty('classifyInvokeText')) { // 检查classifyInvokeText属性是否存在 |
| | | item = { |
| | | ...item, |
| | | classifyInvokeText: { |
| | | "注入类型": item.classifyInvokeAttr, |
| | | "注入类型名称": item.classifyInvokeAttrName, |
| | | "层级设置": item.classifyInvokeLevel, |
| | | "是否可修改": item.classifyInvokeEditFlag |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | return item; |
| | | }); |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | | }) |
| | | } else { |
| | | this.FormLoing = true |