| | |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // 列表查询 |
| | | export function gridUIContextData(page, limit, params) { |
| | | return request({ |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | export const saveUIContextData = (row) => { |
| | | return request({ |
| | | url: '/api/uiManagerController/saveUIContextData', |
| | |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | // 通过oid删除 |
| | | export function delUIContextData(params) { |
| | | return request({ |
| | |
| | | params |
| | | }) |
| | | } |
| | | |
| | | //克隆 |
| | | export const cloneUIContextData = (params) => { |
| | | return request({ |
| | |
| | | params: params |
| | | }); |
| | | } |
| | | |
| | | // 导出 |
| | | export function expUIContextData (params) { |
| | | return request({ |
| | |
| | | params |
| | | }); |
| | | } |
| | | |
| | | export const addTabData = (row) => { |
| | | return request({ |
| | | url: '/api/uiManagerController/addTabData', |
| | |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | // 通过oid删除 |
| | | export function deleteTabData(params) { |
| | | return request({ |
| | |
| | | params |
| | | }) |
| | | } |
| | | |
| | | //下方表格数据 |
| | | export function getPLPageDefinations(params){ |
| | | return request({ |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 克隆树查询接口 |
| | | export function getAllLevelTreeByBtm(params) { |
| | | return request({ |
| | | url: "/api/uiManagerController/getAllLevelTreeByBtm", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // 页面定义克隆 |
| | | export function clonePageDef(params) { |
| | | return request({ |
| | | url: "/api/uiManagerController/clonePageDef", |
| | | method: "post", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // 页签定义克隆 |
| | | export function clonetabPage(params) { |
| | | return request({ |
| | | url: "/api/uiManagerController/clonetabPage", |
| | | method: "post", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // 按钮定义克隆 |
| | | export function cloneTabButton(params) { |
| | | return request({ |
| | | url: "/api/uiManagerController/cloneTabButton", |
| | | method: "post", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | |
| | | </el-container> |
| | | </el-dialog> |
| | | <action-dialog ref="actionDialog" @updataAction="actionSaveHandler"></action-dialog> |
| | | <clone-dialog ref="cloneDialog"></clone-dialog> |
| | | <clone-dialog ref="cloneDialog" :fromOid="fromOid" :sourceOId="sourceOId" type="pageDef" paramsType="tab"></clone-dialog> |
| | | <clone-dialog ref="cloneBtnDialog" :fromOid="formBtnOid" :sourceOId="sourceBtnOid" type="tabButton" paramsType="pageDef"></clone-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | formBtnOid:'', |
| | | sourceBtnOid:'', |
| | | sourceOId:'', |
| | | fromOid:'', |
| | | paramsForm: {}, |
| | | eventOption: { |
| | | ...basicOption, |
| | |
| | | return; |
| | | } |
| | | this.btnDesignVisible = true; |
| | | this.formBtnOid = this.selectList[0].id; |
| | | this.getTabBtnTree(); |
| | | }, |
| | | |
| | |
| | | this.$message.error('顶层节点不允许复制'); |
| | | return; |
| | | } |
| | | this.$refs.cloneDialog.openDialog(this.nodeTreeRow); |
| | | this.sourceBtnOid = this.nodeTreeRow.oId; |
| | | this.$refs.cloneBtnDialog.openDialog(this.nodeTreeRow); |
| | | }, |
| | | |
| | | // 选择action |
| | |
| | | |
| | | // 打开克隆对话框 |
| | | rowCloneHandler(row) { |
| | | console.log(row); |
| | | this.fromOid = this.sourceData.plOId; |
| | | this.sourceOId = row.id; |
| | | this.$refs.cloneDialog.openDialog(row); |
| | | }, |
| | | |
| | |
| | | <template> |
| | | <el-dialog v-dialogDrag |
| | | :append-to-body="true" |
| | | :close-on-click-modal="false" |
| | | :destroy-on-close="true" |
| | | :title="dialog.title" |
| | | :visible.sync="dialog.showDialog" |
| | | width="1200px" |
| | | :append-to-body="true" |
| | | class="avue-dialog" |
| | | :destroy-on-close="true" |
| | | :close-on-click-modal="false" |
| | | width="1200px" |
| | | @close="cancelDialog"> |
| | | <el-container style="height: 580px"> |
| | | <el-aside style="width: 380px"> |
| | | <basic-container style="height: 530px"> |
| | | <basic-container v-loading="leftLoading" style="height: 530px"> |
| | | <h3 style="margin: 0 0 10px 0">业务类型</h3> |
| | | <div style="height: 435px"> |
| | | <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | |
| | | </el-aside> |
| | | |
| | | <el-main> |
| | | <basic-container style="height: 530px"> |
| | | <div style="height: 520px;"> |
| | | <avue-tree ref="uiTree" :data="uiTreeData" :option="uiTreeOption"> |
| | | <basic-container v-loading="rightLoading" style="height: 530px"> |
| | | <div style="height: 490px;"> |
| | | <avue-tree ref="uiTree" :data="uiTreeData" :option="uiTreeOption" @check-change="checkChange"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i :class="data.icon"></i> |
| | |
| | | </el-main> |
| | | </el-container> |
| | | <div class="dialog-footer avue-dialog__footer"> |
| | | <el-button type="primary" plain size="small" @click="submitDialog" >保 存</el-button> |
| | | <el-button plain size="small" type="primary" @click="submitDialog">保 存</el-button> |
| | | <el-button size="small" @click="cancelDialog">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | |
| | | <script> |
| | | import {getUIAuthor} from "@/api/authority/ui/uiAuthor"; |
| | | import {getBizTree} from "@/api/UI/uiDefine"; |
| | | import {getBizTree, getAllLevelTreeByBtm, clonePageDef, clonetabPage, cloneTabButton} from "@/api/UI/uiDefine"; |
| | | |
| | | export default { |
| | | name: "cloneDialog", |
| | | props: ['fromOid', 'type', 'sourceOId','paramsType'], |
| | | data(){ |
| | | return { |
| | | leftLoading: false, |
| | | rightLoading: false, |
| | | dialog: { |
| | | showDialog: false, |
| | | title: "克隆目标", |
| | |
| | | uiTreeOption: { |
| | | nodeKey:'oid', |
| | | checkOnClickNode:true, |
| | | defaultExpandedKeys:this.defaultExpandKeys, |
| | | multiple: true, |
| | | defaultExpandedKeys: [], |
| | | multiple: false, |
| | | menu: false, |
| | | addBtn: false, |
| | | filter:false, |
| | | props: { |
| | | label: 'label', |
| | | label: 'text', |
| | | value: 'oid', |
| | | children: 'children' |
| | | } |
| | |
| | | this.dialog.showDialog = false; |
| | | }, |
| | | submitDialog() { |
| | | linkSave({}).then(res => { |
| | | if (res.data.success) { |
| | | this.$message.success("克隆成功"); |
| | | this.cancelDialog(); |
| | | this.$emit("refresh"); |
| | | const node = this.$refs.uiTree.getCurrentNode(); |
| | | console.log(node); |
| | | if (!node.leaf) { |
| | | this.$message.error('请选择最下层子节点进行克隆'); |
| | | return; |
| | | } |
| | | }); |
| | | let params = {}; |
| | | if (node) { |
| | | params = { |
| | | fromOid: this.fromOid, |
| | | toOid: node.oid, |
| | | cloneParam: { |
| | | sourceOId: this.sourceOId |
| | | } |
| | | } |
| | | } |
| | | console.log(params); |
| | | const saveFunction = { |
| | | 'pageDef': clonePageDef, |
| | | 'tabPage': clonetabPage, |
| | | 'tabButton': cloneTabButton |
| | | }; |
| | | saveFunction[this.type](params).then(res => { |
| | | if(res.data.code == 200){ |
| | | this.$message.success(res.data.obj); |
| | | this.cancelDialog(); |
| | | } |
| | | }) |
| | | }, |
| | | getTreeList() { |
| | | const loading = this.$loading({}); |
| | | this.leftLoading = true; |
| | | getBizTree().then(res => { |
| | | this.treeData =res.data.obj.children; |
| | | loading.close(); |
| | | this.leftLoading = false; |
| | | }).catch(error=>{ |
| | | loading.close(); |
| | | this.leftLoading = false; |
| | | }) |
| | | }, |
| | | // 角色点击 |
| | | nodeClick(row,node) { |
| | | this.nodeRow = row; |
| | | const loading = this.$loading({}); |
| | | this.rightLoading = true; |
| | | const params = { |
| | | 'conditionMap[roleId]': this.nodeRow.oid, |
| | | 'conditionMap[type]': this.type, |
| | | 'conditionMap[context]': this.context |
| | | btmName: this.nodeRow.attributes.name, |
| | | level: this.paramsType |
| | | } |
| | | this.defaultExpandKeys=['root']; |
| | | getUIAuthor(params).then(res => { |
| | | this.processChildren(res.data.data[0]); // 处理每个节点 |
| | | this.uiTreeOption.defaultExpandedKeys=this.defaultExpandKeys; |
| | | this.uiTreeData = [{ |
| | | attributes: {}, |
| | | checked: false, |
| | | expanded: true, |
| | | data: "root", |
| | | level: 0, |
| | | icon: 'el-icon-s-home', |
| | | oid: res.data.data[0].oid, |
| | | label: 'UI上下文选项', |
| | | children: res.data.data[0].children |
| | | }]; |
| | | loading.close(); |
| | | console.log(row); |
| | | getAllLevelTreeByBtm(params).then(res => { |
| | | this.uiTreeOption.defaultExpandedKeys = [res.data.obj.oid]; |
| | | this.uiTreeData = [res.data.obj]; |
| | | console.log(res); |
| | | this.rightLoading = false; |
| | | }).catch(error => { |
| | | loading.close(); |
| | | this.rightLoading = false; |
| | | }) |
| | | }, |
| | | |
| | | //处理树 |
| | | processChildren(item) { |
| | | if (item.children && item.children.length > 0) { |
| | |
| | | <el-button type="primary" @click="saveHandler">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <clone-dialog ref="cloneDialog"></clone-dialog> |
| | | <clone-dialog ref="cloneDialog" :fromOid="fromOid" :sourceOId="sourceOId" type="tabPage" paramsType="ui"></clone-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | components:{bottomTable,cloneDialog}, |
| | | data() { |
| | | return { |
| | | fromOid:'', |
| | | sourceOId:'', |
| | | uiDefineOid:'', |
| | | areaType: '', |
| | | tableLoading: false, |
| | |
| | | }); |
| | | }, |
| | | rowCloneHandler(row) { |
| | | this.fromOid = this.uiDefineData.plOId; |
| | | this.sourceOId = row.plOId; |
| | | this.$refs.cloneDialog.openDialog(row); |
| | | }, |
| | | } |