| | |
| | | @row-del="CrudRowDel" |
| | | @row-update="CrudRowUpdata" |
| | | :before-close="beforeClose" |
| | | @select="selectHandle" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button plain size="small" type="primary" @click="FindFormVisible = true;">查询</el-button> |
| | |
| | | </avue-crud> |
| | | |
| | | </basic-container> |
| | | <templatePro :ProData="this.ProData"></templatePro> |
| | | <templatePro :ProData="this.ProData" :crudOid="this.crudOid" :crudArray="this.crudArray" :Formlist="this.Formlist"></templatePro> |
| | | </span> |
| | | </basic-container> |
| | | </el-main> |
| | |
| | | TreeObjcet, |
| | | TreeEnable, |
| | | TreeDeactivate, |
| | | importClassify, |
| | | gridCodeClassifyTemplate, |
| | | getObjectByOid, |
| | | gridCodeClassifyTemplateAttr, |
| | |
| | | editSave, |
| | | copy |
| | | } from "@/api/template/templateAttr"; |
| | | import done from "@/views/work/done"; |
| | | |
| | | export default { |
| | | name: "classifyTrees.vue", |
| | | //使用inject接收参数 |
| | | //Treeoption左侧树新增表单项 Treedata左侧树节点 配置项 crudTreeOption右侧表格配置项 crudTreeData右侧表格显示内容 |
| | | //Treeform右侧表单配置项 |
| | | inject: ['crudTreeOption', "crudTreeData"], |
| | | inject: [, "crudTreeData"], |
| | | data() { |
| | | return { |
| | | //表格option配置项 |
| | | crudTreeOption: { |
| | | index: true, |
| | | border: true, |
| | | height:180, |
| | | selection:true, |
| | | addBtn:this.addFlag, |
| | | column: [ |
| | | { |
| | | label: "模板编号", |
| | | prop: "id" |
| | | }, |
| | | { |
| | | label:"模板名称", |
| | | prop:"name" |
| | | }, |
| | | { |
| | | label: "模板描述", |
| | | prop:"description" |
| | | }, |
| | | { |
| | | label:"版本号", |
| | | prop:"revisionSeq" |
| | | }, |
| | | { |
| | | label:"状态", |
| | | prop:"lcStatusText" |
| | | } |
| | | ] |
| | | }, |
| | | addFlag:false, |
| | | // 表格当前行id |
| | | crudOid:"", |
| | | //表格当前选择数组 |
| | | crudArray:[], |
| | | //模板属性展示内容 |
| | | ProData: [], |
| | | //回车键搜索绑定值 |
| | |
| | | this.getAttr(); |
| | | }, |
| | | methods: { |
| | | //行单选事件 |
| | | selectHandle(selection,row){ |
| | | this.crudOid=row.oid |
| | | this.crudArray=selection |
| | | }, |
| | | //分类树数据处理 |
| | | getAttr() { |
| | | getAtrrList().then(res => { |
| | | this.Treedata = res.data; |
| | | this.CloneTreedata = res.data; |
| | | this.Treedata.forEach((item) => { |
| | | this.Treedata.forEach(() => { |
| | | for (let i = 0; i < this.Treedata.length; i++) { |
| | | this.Treedata[i].value = i; |
| | | } |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | TreeEnable(this.nodeClickList).then((res) => { |
| | | TreeEnable(this.nodeClickList).then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '启用成功!' |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | TreeDeactivate(this.nodeClickList).then((res) => { |
| | | TreeDeactivate(this.nodeClickList).then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '停用成功!' |
| | |
| | | return item.codeclassifyoid == this.nodeClickList.oid |
| | | } |
| | | }) |
| | | gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.Formlist[0].oid}).then(res => { |
| | | this.ProData = res.data.data |
| | | console.log(this.ProData) |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | | if(this.Formlist.length >0){ |
| | | gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.Formlist[0].oid}).then(res => { |
| | | this.ProData = res.data.data; |
| | | console.log(this.ProData) |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | | } |
| | | }).catch(res => { |
| | | console.log(res) |
| | | }) |
| | | // 基本信息表单数据 |
| | | await getObjectByOid(this.nodeClickList.oid).then(res => { |
| | | this.TreeList = res.data.data |
| | | // eslint-disable-next-line no-const-assig |
| | | this.TreeList = res.data.data; |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | |
| | | } else { |
| | | let codeClassifyOid = this.codeClassifyOid |
| | | this.$set(row, "codeclassifyoid", codeClassifyOid) |
| | | addSave(row).then(res => { |
| | | addSave(row).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "添加成功!" |
| | |
| | | }, |
| | | //模板管理修改 |
| | | CrudRowUpdata(row,index,done) { |
| | | editSave(row).then((res) => { |
| | | editSave(row).then(() => { |
| | | this.CrudRend() |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | }, |
| | | //模板管理删除 |
| | | CrudRowDel(row) { |
| | | deleteData(row).then(res => { |
| | | deleteData(row).then(()=> { |
| | | this.CrudRend() |
| | | }).catch(res => { |
| | | this.$message({ |
| | |
| | | //重新赋值CloneSelect传递的数据为输入框可以修改的数据,CloneModel提交表单输入框双向绑定数据 |
| | | this.CloneSelect[0].id=this.CloneModel.id; |
| | | this.CloneSelect[0].name=this.CloneModel.name; |
| | | copy(this.CloneSelect[0]).then(res=>{ |
| | | copy(this.CloneSelect[0]).then(()=>{ |
| | | //因为是嵌套弹窗所以手动关闭CloneinnerVisible,CloneVisible两个弹窗。 |
| | | this.CloneinnerVisible=false |
| | | this.CloneVisible=false |