| | |
| | | <!-- 左侧菜单--> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="height: calc(100vh - 142px);!important;"> |
| | | <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> |
| | | <div class="headerCon" style="display: flex; flex-wrap: wrap;margin-bottom: 5px"> |
| | | <el-button v-if="permissionList.TreeAddStatus" plain size="small" type="primary" @click="TreeAdd">添加 |
| | | </el-button> |
| | | <el-button v-if="permissionList.TreeEditStatus" plain size="small" type="primary" @click="TreeEdit">修改 |
| | | <el-button v-if="permissionList.TreeEditStatus" v-show="allButtons" plain size="small" type="primary" |
| | | @click="TreeEdit">修改 |
| | | </el-button> |
| | | <el-button v-if="permissionList.TreeDelStatus" plain size="small" type="primary" @click="TreeDel">删除 |
| | | <el-button v-if="permissionList.TreeDelStatus" v-show="allButtons" plain size="small" type="primary" |
| | | @click="TreeDel">删除 |
| | | </el-button> |
| | | <el-button v-if="permissionList.flushedStatus" plain size="small" type="primary" @click="flushed">刷新 |
| | | <el-button v-if="permissionList.flushedStatus" v-show="allButtons" plain size="small" type="primary" |
| | | @click="flushed">刷新 |
| | | </el-button> |
| | | <el-button v-if="permissionList.EnableStatus" plain size="small" type="primary" @click="Enable">启用 |
| | | <el-button v-if="permissionList.EnableStatus" v-show="allButtons" plain size="small" type="primary" |
| | | @click="Enable">启用 |
| | | </el-button> |
| | | <el-button v-if="permissionList.DeactivateStatus" plain size="small" type="primary" @click="Deactivate">停用 |
| | | <el-button v-if="permissionList.DeactivateStatus" v-show="allButtons" plain size="small" type="primary" |
| | | @click="Deactivate">停用 |
| | | </el-button> |
| | | <el-button v-if="permissionList.ImportExcelStatus" plain size="small" type="primary" |
| | | <el-button v-if="permissionList.ImportExcelStatus" v-show="allButtons" plain size="small" type="primary" |
| | | @click.native="ImportExcel">导入 |
| | | </el-button> |
| | | <el-button v-if="permissionList.ExportExcelStatus" plain size="small" type="primary" @click="ExportExcel"> |
| | | <el-button v-if="permissionList.ExportExcelStatus" v-show="allButtons" plain size="small" type="primary" |
| | | @click="ExportExcel"> |
| | | 导出 |
| | | </el-button> |
| | | <el-button v-if="permissionList.flowingBtnStuatus" plain |
| | | <el-button v-if="permissionList.flowingBtnStuatus" v-show="allButtons" plain |
| | | size="small" style="width: 56px;text-align: center;padding-left: 3px" type="primary" |
| | | @click="flowingDependHandler">流水处理 |
| | | </el-button> |
| | | <el-button v-if="permissionList.classifyAuth" plain size="small" |
| | | <el-button v-if="permissionList.classifyAuth" v-show="allButtons" plain size="small" |
| | | style="width: 56px;text-align: center;padding-left: 3px" type="primary" |
| | | @click="classifyAuthHandler">分类授权 |
| | | </el-button> |
| | | <el-button v-if="permissionList.classifyAuth" v-show="allButtons" plain size="small" |
| | | style="width: 56px;text-align: center;padding-left: 3px" type="primary" |
| | | @click="dataAuthHandler">数据授权 |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧树--> |
| | | |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | class="classifyTree" |
| | | style="height: 690px" |
| | | @node-click="nodeClick" |
| | | > |
| | | <template slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" |
| | | effect="dark" |
| | | open-delay="500" |
| | | placement="right-start"> |
| | | <div style="height: calc(100vh - 242px);overflow: auto"> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | class="classifyTree" |
| | | @node-click="nodeClick" |
| | | > |
| | | <template slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" |
| | | effect="dark" |
| | | open-delay="500" |
| | | placement="right-start"> |
| | | <span style="font-size: 14px;"> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </el-tooltip> |
| | | </template> |
| | | </avue-tree> |
| | | </el-tooltip> |
| | | </template> |
| | | </avue-tree> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 树节点添加对话框--> |
| | |
| | | </el-dialog> |
| | | <!-- 分类授权对话框--> |
| | | <classify-auth-dialog |
| | | :TreeNode="TreeEditObj" |
| | | :classifyData="classifyData" |
| | | :visible.sync="classifyAuthVisible" |
| | | ></classify-auth-dialog> |
| | | <!-- 数据授权对话框 --> |
| | | <data-auth-dialog |
| | | :TreeNode="TreeEditObj" |
| | | :classifyData="classifyData" |
| | | :visible.sync="dataAuthVisible" |
| | | ></data-auth-dialog> |
| | | </basic-container> |
| | | </el-aside> |
| | | <el-main> |
| | | <basic-container style="height: calc(100vh - 150px);"> |
| | | <basic-container> |
| | | <!-- 右侧表格--> |
| | | <avue-tabs :option="tabOption" @change="handleChange"></avue-tabs> |
| | | <span v-if="type.prop==='tab1'"> |
| | |
| | | @click="TemRefresh">刷新</el-button> |
| | | <el-button v-if="permissionList.CloneBtnStuatus" plain size="small" type="primary" @click="CloneBtn">从其它模板克隆</el-button> |
| | | <!-- 查询对话框--> |
| | | <el-dialog :visible.sync="FindFormVisible" append-to-body title="高级查询"> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="AdvQueries">查询</el-button> |
| | | <el-button size="small" type="primary">重置</el-button> |
| | | </div> |
| | | <div style="padding-left: 80px;margin-top: 15px;"> |
| | | <template v-for="(value, key) in FindSelect"> |
| | | <div style="display: flex; justify-content: space-around; width: 85%; margin-bottom: 15px"> |
| | | <el-select v-model="FindSelect[key]" placeholder="请选择" style="width: 28%" |
| | | @change="handleSelectChange(key)"> |
| | | <el-option label="模板编号" value="0"></el-option> |
| | | <el-option label="模板名称" value="1"></el-option> |
| | | <el-option label="模板描述" value="2"></el-option> |
| | | <el-option label="版本号" value="3"></el-option> |
| | | <el-option label="状态" value="4"></el-option> |
| | | </el-select> |
| | | <el-select v-model="condition[0]" placeholder="请选择" style="width: 15%"> |
| | | <el-option label="包含" value="0"></el-option> |
| | | <el-option label="等于" value="1"></el-option> |
| | | </el-select> |
| | | <el-input v-model="QueryArray[key]" style="width: 49%"></el-input> |
| | | <span> <i class="el-icon-delete" style="font-size: 22px;margin-top:8px;margin-left: 10px"/></span> |
| | | <el-dialog :visible.sync="FindFormVisible" append-to-body title="高级查询" width="30%" @close="searchReset"> |
| | | <div style="text-align: center; margin-top: 5px;"> |
| | | <el-select v-model="searchSelect" style="width: 35%"> |
| | | <el-option v-for="item in crudFindTreeArray" :key="item.field" :label="item.title" |
| | | :value="item.queryField"></el-option> |
| | | </el-select> |
| | | <el-input v-model="SearchValue" |
| | | placeholder="请输入关键字进行查询" style="width: 45%; margin-left: 5px;"></el-input> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="advQueries">查询</el-button> |
| | | <el-button type="danger" @click="searchReset">重置</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- 模板克隆 --> |
| | | <el-dialog :before-close="cloneClose" :visible.sync="CloneVisible" append-to-body title="克隆模板"> |
| | |
| | | TreeSave, |
| | | TreeDel, |
| | | TreeCheckDel, |
| | | TreeObjcet, |
| | | TreeEnable, |
| | | TreeDeactivate, |
| | | gridCodeClassifyTemplate, |
| | |
| | | name: "classifyTrees.vue", |
| | | data() { |
| | | return { |
| | | crudFindTreeArray: [ |
| | | { |
| | | title: '模板编号', |
| | | field: 'id', |
| | | fieldType: 'text', |
| | | queryField: 'id' |
| | | }, |
| | | { |
| | | title: '模板名称', |
| | | field: 'name', |
| | | fieldType: 'text', |
| | | queryField: 'name' |
| | | }, |
| | | { |
| | | title: '模板描述', |
| | | field: 'description', |
| | | fieldType: 'text', |
| | | queryField: 'description' |
| | | }, |
| | | { |
| | | title: '版本号', |
| | | field: 'revisionSeq', |
| | | fieldType: 'text', |
| | | queryField: 'revisionSeq' |
| | | }, |
| | | { |
| | | title: '状态', |
| | | field: 'lcStatusText', |
| | | fieldType: 'text', |
| | | queryField: 'lcStatusText' |
| | | }, |
| | | ], |
| | | searchSelect: 'id', |
| | | SearchValue: '', |
| | | allButtons: Boolean, |
| | | btnAuthList: [], |
| | | activeName: 'first', |
| | | masterRow: null, |
| | |
| | | BtmdialogVisible: false, |
| | | SelectOption: [ |
| | | { |
| | | value: 'name', |
| | | label: '中文名称' |
| | | value: 'id', |
| | | label: '英文名称', |
| | | }, |
| | | { |
| | | value: 'id', |
| | | label: '英文名称' |
| | | value: 'name', |
| | | label: '中文名称' |
| | | } |
| | | |
| | | ], |
| | | btmSelectOption: [ |
| | | { |
| | |
| | | TreeAddFormVisible: false, |
| | | //分类授权对话框 |
| | | classifyAuthVisible: false, |
| | | //数据授权对话框 |
| | | dataAuthVisible: false, |
| | | //当前点击项 |
| | | nodeClickList: "", |
| | | ClonenodeClickList: "", |
| | |
| | | Treedata: [], |
| | | CloneTreedata: [], |
| | | Treeoption: { |
| | | height: 'auto', |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | |
| | | }, |
| | | { |
| | | label: '描述', |
| | | prop: 'desc', |
| | | prop: 'description', |
| | | type: 'textarea', |
| | | span: 24 |
| | | } |
| | |
| | | showEditBtn: false, |
| | | //传递给分类授权子组件对话框的当前选中的分类节点信息 |
| | | classifyData: "", |
| | | |
| | | } |
| | | }, |
| | | watch: {}, |
| | | mounted() { |
| | | this.type = this.tabOption.column[0]; |
| | | this.type = this.tabOption.column[0] || {label: '基本信息', prop: 'tab1'}; |
| | | this.getAttr(); |
| | | const treeEle = this.$refs.tree.$el |
| | | treeEle.addEventListener('click', (e) => { |
| | | if (e.target.nodeName !== 'SPAN') { |
| | | // const treeEle = this.$refs.tree.$el; |
| | | const TreeBox = this.$refs.TreeBox; |
| | | // console.log(this.$refs.TreeBox) |
| | | // treeEle.addEventListener('click', (e) => { |
| | | // console.log('2') |
| | | // if (e.target.nodeName !== 'SPAN') { |
| | | // this.$refs.tree.setCurrentKey(null); |
| | | // this.nodeClickList = {}; |
| | | // this.TreeFlagCode = true; |
| | | // this.allButtons = false; |
| | | // } |
| | | // }, true) |
| | | TreeBox.addEventListener('click', (e) => { |
| | | if (e.target.nodeName !== 'SPAN' && e.target.nodeName !== 'BUTTON') { |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.nodeClickList = {}; |
| | | this.TreeFlagCode = true; |
| | | // this.$nextTick(()=>{ |
| | | // this.btnAuthList = []; |
| | | // }) |
| | | this.allButtons = false; |
| | | } |
| | | }, true) |
| | | }, |
| | |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | TreeAddStatus: this.vaildData(this.btnAuthList.tree_add, false), |
| | | TreeAddStatus: this.vaildData(this.permission.classifyTree.tree_add, false), |
| | | TreeEditStatus: this.vaildData(this.btnAuthList.tree_edit, false), |
| | | TreeDelStatus: this.vaildData(this.btnAuthList.tree_delete, false), |
| | | flushedStatus: this.vaildData(this.btnAuthList.tree_break, false), |
| | |
| | | }, |
| | | treeStyle() { |
| | | return { |
| | | height: this.btnAuthList.length > 0 ? '620px' : '785px', |
| | | height: this.allButtons ? '610px' : '690px', |
| | | }; |
| | | }, |
| | | crudTreeOption() { |
| | |
| | | index: true, |
| | | border: true, |
| | | columnBtn: false, |
| | | height: 180, |
| | | height: 150, |
| | | refreshBtn: false, |
| | | addBtn: this.Formlist.length <= 0 && this.nodeClickList != "", |
| | | editBtn: false, |
| | | delBtn: false, |
| | |
| | | codeClassifyOid: '' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | |
| | | this.$message.warning('请至少选择一条数据!') |
| | | return; |
| | | } |
| | | this.classifyData = this.nodeClickList; |
| | | // this.classifyData = this.nodeClickList; |
| | | this.classifyAuthVisible = true; |
| | | }, |
| | | // 数据授权对话框打开 |
| | | dataAuthHandler() { |
| | | if (this.nodeClickList.oid === '' || this.nodeClickList.oid === undefined) { |
| | | this.$message.warning('请至少选择一条数据!') |
| | | return; |
| | | } |
| | | // this.classifyData = this.nodeClickList; |
| | | this.dataAuthVisible = true; |
| | | }, |
| | | flowingDependHandler() { |
| | | if (this.nodeClickList.length <= 0) { |
| | |
| | | getAttr() { |
| | | this.loading = true; |
| | | return new Promise((resolve, reject) => { |
| | | getAtrrList() |
| | | let conditionMaps = {}; |
| | | conditionMaps["conditionMap[authType]"] = "classify_auth"; |
| | | conditionMaps["conditionMap[buttonCode]"] = "classifyTree"; |
| | | // 分类授权中是否具备查看权限 |
| | | conditionMaps["conditionMap[menuCode]"] = "classify_view"; |
| | | getAtrrList(conditionMaps) |
| | | .then(res => { |
| | | this.Treedata = res.data; |
| | | this.CloneTreedata = res.data; |
| | |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | |
| | | async Deactivate() { |
| | | if (Object.keys(this.nodeClickList).length < 1) { |
| | | this.$message.warning('请先从树上选择一条数据'); |
| | |
| | | }, |
| | | //树点击事件 |
| | | async nodeClick(data) { |
| | | getAuthButtonList({classifyId: data.oid}).then(res => { |
| | | const response = this.findTheTopLevelNode(data, this.Treedata) |
| | | this.classifyData = response; |
| | | // console.log(response) |
| | | // console.log('response',response.attributes.id) |
| | | this.allButtons = true; |
| | | getAuthButtonList({classifyId: data.oid, code: "classifyTree", authType: "classify_auth"}).then(res => { |
| | | this.btnAuthList = res.data.data; |
| | | }).catch(error => { |
| | | console.log(error) |
| | |
| | | this.crudArray = [] |
| | | try { |
| | | this.requestCount += 1; |
| | | const [res1, res2, res3] = await Promise.all([ |
| | | TreeObjcet(data.oid), |
| | | const [res1, res2] = await Promise.all([ |
| | | getObjectByOid(data.oid), |
| | | gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}), |
| | | getObjectByOid(data.oid) |
| | | ]); |
| | | this.FlagObj = res1.data.data; |
| | | this.Formlist = res2.data.data.filter(item => { |
| | |
| | | this.ProData = []; |
| | | this.crudOid = '' |
| | | } |
| | | this.TreeEditObj = res3.data.data; |
| | | this.TreeEditObj = res1.data.data; |
| | | if (this.TreeEditObj.isParticipateCheck === null || this.TreeEditObj.isParticipateCheck === undefined || this.TreeEditObj.isParticipateCheck === "") { |
| | | this.$set(this.TreeEditObj, "isParticipateCheck", 1) |
| | | return |
| | |
| | | this.$message.error(error); |
| | | } |
| | | }, |
| | | |
| | | // 递归查找顶层节点Id |
| | | findTheTopLevelNode(data, TreeData) { |
| | | if (data.parentId === "") { |
| | | return data; |
| | | } |
| | | const parentNode = this.findParentNode(data.parentId, TreeData); |
| | | if (parentNode) { |
| | | return this.findTheTopLevelNode(parentNode, TreeData); // 继续查找父节点 |
| | | } |
| | | }, |
| | | // 递归查找出来多层节点的父节点 |
| | | findParentNode(parentId, TreeData) { |
| | | for (const node of TreeData) { |
| | | if (node.oid === parentId) { |
| | | return node; |
| | | } |
| | | // 如果当前节点还有子节点,继续去查子节点的父节点 |
| | | if (node.children) { |
| | | const parentNode = this.findParentNode(parentId, node.children); |
| | | if (parentNode) { |
| | | return parentNode; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | }, |
| | | async gridCode() { |
| | | try { |
| | | const res = await gridCodeClassifyTemplateAttr({ |
| | |
| | | handleChange(column) { |
| | | this.type = column; |
| | | }, |
| | | AdvQueries() { |
| | | this.FindFormVisible = false |
| | | //如果全部为空 allEmpty为true |
| | | const allEmpty = Object.values(this.QueryArray).every(value => !value); |
| | | //如果全部为空,点击查询出现所有数据 |
| | | if (allEmpty) { |
| | | gridCodeClassifyTemplate().then(res => { |
| | | this.Formlist = res.data.data |
| | | }) |
| | | advQueries() { |
| | | if (this.SearchValue === "") { |
| | | this.$message.warning('请输入要查询的内容!'); |
| | | } else { |
| | | //默认是等于 |
| | | gridCodeClassifyFindTemplate({'conditionMap[id]': this.QueryArray.id}, |
| | | {'conditionMap[name]': this.QueryArray.name}, |
| | | {'conditionMap[description]': this.QueryArray.description}, |
| | | {'conditionMap[revisionValue]': this.QueryArray.revisionValue}, |
| | | {'conditionMap[lcStatus]': this.QueryArray.lcStatus} |
| | | ).then(res => { |
| | | this.Formlist = res.data.data |
| | | }) |
| | | const condition = { |
| | | 'conditionMap[codeclassifyoid]': this.nodeClickList.oid, |
| | | [`conditionMap[${this.searchSelect}]`]: this.SearchValue |
| | | }; |
| | | gridCodeClassifyFindTemplate(condition).then(res => { |
| | | if (res.data.data.length > 0) { |
| | | this.Formlist = res.data.data; |
| | | } else { |
| | | this.$message.error('暂未查询到相关模板!') |
| | | } |
| | | this.FindFormVisible = false; |
| | | }); |
| | | } |
| | | }, |
| | | //模板管理渲染 |
| | | CrudRend() { |
| | | gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': this.nodeClickList.oid}).then(res => { |
| | | this.Formlist = res.data.data |
| | | }) |
| | | searchReset() { |
| | | this.SearchValue = ""; |
| | | this.searchSelect = 'id' |
| | | }, |
| | | |
| | | //模板管理表格添加 |
| | | CrudRowSave(row, done) { |
| | | if (this.nodeClickList.length <= 0) { |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .el-container { |
| | | height: 100%; |
| | | } |
| | | //.el-container { |
| | | // height: 100%; |
| | | //} |
| | | |
| | | .el-aside { |
| | | //height: calc(100% - 30px); |
| | |
| | | .headerCon > .el-button:nth-child(9) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | ///deep/.el-scrollbar__bar.is-vertical{ |
| | | // width: 8px; |
| | | //} |
| | | |
| | | </style> |