| | |
| | | <!--类型Action--> |
| | | <el-container> |
| | | <el-aside> |
| | | <basic-container> |
| | | <basic-container v-loadng="treeLoading"> |
| | | <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> |
| | | <!-- 左侧树 --> |
| | | <div style="height: calc(100vh - 190px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <span> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | |
| | | :data="data" |
| | | :option="option" |
| | | :table-loading="tableLoading" |
| | | @refresh-change="handleRefresh" |
| | | @search-change="handleSearch" |
| | | @search-reset="handleReset" |
| | | @selection-change="selectChangeHandler" |
| | | @row-click="rowClickHandler"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">添加</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">移除</el-button> |
| | | <el-button v-if="permissionList.addBtn" icon="el-icon-plus" size="small" type="primary" @click="addHandler">添加</el-button> |
| | | <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">移除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <action-dialog ref="actionDialog"></action-dialog> |
| | | <action-dialog ref="actionDialog" :is-muti="true" @updataAction="actionSaveHandler"></action-dialog> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | |
| | | |
| | | <script> |
| | | import basicOption from "@/util/basic-option"; |
| | | import { delUIContextData, getBizTree, gridUIContextData} from "@/api/UI/uiDefine"; |
| | | import { getBizTree} from "@/api/UI/uiDefine"; |
| | | import {getTypeActionByType,savePLTypeAction,delPLTypeActions} from "@/api/authority/ui/typeAction" |
| | | import func from "@/util/func"; |
| | | import actionDialog from "@/views/modelingMenu/ui/Aciton/dialog" |
| | | import actionDialog from "@/views/modelingMenu/ui/Aciton/components/dialog" |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components:{actionDialog}, |
| | | data() { |
| | | return { |
| | | treeLoading:false, |
| | | treeOption: { |
| | | height: 'auto', |
| | | defaultExpandAll: true, |
| | |
| | | selectList: [], |
| | | option: { |
| | | ...basicOption, |
| | | calcHeight: -50, |
| | | calcHeight: -35, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | |
| | | { |
| | | label: 'C/S类路径', |
| | | prop: 'plCSClass', |
| | | search: true, |
| | | searchLabelWidth:120, |
| | | overHidden: true, |
| | | }, |
| | | { |
| | | label: 'B/S链接地址', |
| | | prop: 'plBSUrl', |
| | | search: true, |
| | | searchLabelWidth:120, |
| | | overHidden: true, |
| | | }, |
| | | { |
| | | label: '类型', |
| | | prop: 'plTypeType', |
| | | search: true, |
| | | type: 'select', |
| | | width:100, |
| | | dicData: [{ |
| | |
| | | { |
| | | label: '描述', |
| | | prop: 'plDesc', |
| | | search: true, |
| | | overHidden: true, |
| | | }, |
| | | ] |
| | | }, |
| | | allData: [], |
| | | data: [], |
| | | } |
| | | }, |
| | | computed:{ |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false), |
| | | delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false), |
| | | }; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | |
| | | methods: { |
| | | //树表查询 |
| | | getTreeList() { |
| | | const loading = this.$loading({}); |
| | | this.treeLoading = true; |
| | | getBizTree().then(res => { |
| | | this.treeData = [res.data.obj]; |
| | | loading.close(); |
| | | this.treeLoading = false; |
| | | }).catch(error => { |
| | | loading.close(); |
| | | this.treeLoading = false; |
| | | }) |
| | | }, |
| | | // 树点击 |
| | |
| | | } |
| | | }, |
| | | getTableList() { |
| | | const params = Object.assign(this.searchParams, { |
| | | 'conditionMap[btmName]': this.nodeRow.attributes.name, |
| | | }) |
| | | gridUIContextData(1, 50, params).then(res => { |
| | | getTypeActionByType({ |
| | | 'typeName': this.nodeRow.attributes.name, |
| | | }).then(res => { |
| | | this.data = res.data.data; |
| | | this.allData = res.data.data; |
| | | this.$refs.crud.clearSelection(); |
| | | this.tableLoading = false; |
| | | }) |
| | |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = []; |
| | | this.selectList = [row]; |
| | | } |
| | | ); |
| | | }, |
| | | handleRefresh() { |
| | | this.getTableList(); |
| | | }, |
| | | // 搜索查询 |
| | | handleSearch(params, done) { |
| | | const data=this.allData.filter(item=>{ |
| | | if(item.plCode.includes(params.plCode ||'') && item.plName.includes(params.plName || '')){ |
| | | return true; |
| | | }else { |
| | | return false; |
| | | } |
| | | }) |
| | | this.data=data; |
| | | done(); |
| | | }, |
| | | |
| | | // 重置搜索条件 |
| | | handleReset() { |
| | | this.data=this.allData; |
| | | }, |
| | | //创建 |
| | | addHandler() { |
| | | if (this.nodeRow && this.nodeRow.oid && this.nodeRow.oid!='') { |
| | | this.$refs.actionDialog.openDialog(this.nodeRow); |
| | | this.$refs.actionDialog.openDialog(); |
| | | } else { |
| | | this.$message.error('请选择业务类型'); |
| | | } |
| | | }, |
| | | // 保存action |
| | | actionSaveHandler(val) { |
| | | const params = { |
| | | plTypeName: this.nodeRow.attributes.name, |
| | | actions:val |
| | | } |
| | | savePLTypeAction(params).then(res => { |
| | | if(res.data.code == 200){ |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | } |
| | | }) |
| | | }, |
| | | delHandler() { |
| | | if (this.selectList.length <= 0) { |
| | |
| | | return; |
| | | } |
| | | const params = { |
| | | oids: this.selectList.map(item => item.plOId).join(',') |
| | | typeName: this.nodeRow.attributes.name, |
| | | typeActionOIds: this.selectList.map(item => item.plOId).join(',') |
| | | } |
| | | this.$confirm('是否移除选中的Action?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delUIContextData(params).then(res => { |
| | | delPLTypeActions(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success('删除成功'); |
| | | this.getTableList(); |