From 0f4bac6483639a3be54d8fa311e005a2a3c99885 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 27 九月 2024 17:45:55 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue | 433 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 433 insertions(+), 0 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue new file mode 100644 index 0000000..952ab1a --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue @@ -0,0 +1,433 @@ +<template> + <el-dialog + v-dialogDrag + :visible.sync="btnActionVisible" + append-to-body="true" + class="avue-dialog" + title="閫夋嫨Action" + width="70%" + @close="dialogClose"> + <el-container> + <el-aside> + <basic-container> + <!-- 宸︿晶鏍� --> + <div> + <avue-tree + ref="tree" + v-model="treeForm" + :data="treeData" + :option="treeOption" + node-key="value" + @node-click="nodeClick"> + <span slot-scope="{ node, data }" class="el-tree-node__label"> + <span style="font-size: 15px"> + <i class="el-icon-s-promotion"></i> + {{ (node || {}).label }} + </span> + </span> + </avue-tree> + </div> + </basic-container> + </el-aside> + + <el-main> + <basic-container> + <div> + <avue-crud + ref="crud" + v-model="form" + :data="data" + :option="option" + :page.sync="page" + :table-loading="tableLoading" + @search-change="handleSearch" + @search-reset="handleReset" + @refresh-change="handleRefresh" + @selection-change="selectChangeHandler" + @row-click="rowClickHandler"> + <template slot="plTypeType" slot-scope="{row}"> + <el-tag :type="row.plTypeType === 'business' ? '' : 'success'"> + {{ row.plTypeType === 'business' ? '涓氬姟绫诲瀷' : '閾炬帴绫诲瀷' }} + </el-tag> + </template> + + </avue-crud> + </div> + </basic-container> + </el-main> + + + </el-container> + <span slot="footer" class="dialog-footer"> + <el-button @click="btnActionVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="actionSaveHandler">纭� 瀹�</el-button> + </span> + </el-dialog> +</template> + +<script> +import { + getActionTree, + getActionTableData, +} from '@/api/UI/Action/api' +import func from "@/util/func"; +import basicOption from "@/util/basic-option"; + +export default { + name: "index", + data() { + return { + btnActionVisible: false, + currenRow: {}, // action褰撳墠琛屼俊鎭� + topMethodsObj: { + select: true, + all: true, + page: false + }, + transferTitle: ['鏈�夋嫨', '宸查�夋嫨'], + leftRoleData: [], + rightRoleData: [], + form: {}, + bottomTableLoading: false, + bottomData: [], + bottomOption: { + ...basicOption, + addBtn: false, + calcHeight: -30, + selection: false, + refreshBtn: false, + // height:'auto', + column: [ + { + label: '鍙傛暟鍚嶇О', + prop: 'name', + rules: [ + { + required: true, + message: '璇疯緭鍏ュ弬鏁板悕绉�', + trigger: 'blur' + } + ] + }, + { + label: '榛樿鍊�', + prop: 'defaultValue', + }, + { + label: '鎻愮ず淇℃伅', + prop: 'description', + span: 24, + type: 'textarea', + rows: 4 + }, + ], + }, + tableLoading: false, + lastIndex: null, + selectList: [], + data: [], + option: { + ...basicOption, + addBtn: false, + height: 500, + highlightCurrentRow: true, + menu:false, + column: [ + { + label: '缂栧彿', + prop: 'plCode', + search: true, + rules: [ + { + required: true, + message: '璇疯緭鍏ョ紪鍙�', + trigger: 'blur' + } + ] + }, + { + label: '鍚嶇О', + prop: 'plName', + search: true, + rules: [ + { + required: true, + message: '璇疯緭鍏ュ悕绉�', + trigger: 'blur' + } + ] + }, + { + label: '绫昏矾寰�', + prop: 'plCSClass', + search: true, + overHidden: true, + }, + { + label: '鍒嗙被', + prop: 'plActionCls', + type: 'tree', + hide: true, + props: { + label: 'name', + value: 'id', + children: 'childs' + }, + rules: [ + { + required: true, + message: '璇烽�夋嫨鍒嗙被', + trigger: 'blur' + } + ], + dicData: [] + }, + { + label: '閾炬帴鍦板潃', + prop: 'plBSUrl', + search: true, + }, + { + label: '绫诲瀷', + prop: 'plTypeType', + search: true, + type: 'select', + dicData: [{ + label: '涓氬姟绫诲瀷', + value: 'business' + }, { + label: '閾炬帴绫诲瀷', + value: 'link' + }], + rules: [ + { + required: true, + message: '璇烽�夋嫨绫诲瀷', + trigger: 'blur' + } + ] + }, + { + label: '鎻忚堪', + prop: 'plDesc', + search: true, + overHidden: true, + }, + ] + }, + treeNodeRow: {}, + treeForm: {}, + treeOption: { + addBtn: false, + defaultExpandedKeys: ['root'], + props: { + label: 'name', + value: 'id', + children: 'childs' + }, + formOption: { + column: [ + { + label: '鍒嗙被鍚嶇О', + prop: 'name', + rules: [ + { + required: true, + message: '璇疯緭鍏ュ垎绫诲悕绉�', + trigger: 'blur' + } + ] + }, + { + label: '鍒嗙被搴忓彿', + prop: 'serialno', + rules: [ + { + required: true, + message: '璇疯緭鍏ュ垎绫诲簭鍙�', + trigger: 'blur' + } + ] + }, + { + label: '鍒涘缓鑰�', + prop: 'creator', + readonly: true, + }, + { + label: '鍒涘缓鏃堕棿', + prop: 'createTime', + readonly: true, + }, + { + label: '鐖朵富绫�', + prop: 'pidName', + readonly: true, + }, + { + label: '澶囨敞', + prop: 'description' + }, + ], + } + }, + treeData: [], + } + }, + created() { + this.getTreeList(); + }, + methods: { + // 宸︿晶鏍戣姹� + getTreeList(status) { + const params = { + isExp: status ? true : false + } + getActionTree(params).then(res => { + const data = res.data.obj; + this.treeData = [data]; + const selectTreeData = this.option.column.find(item => item.prop === 'plActionCls'); // 鎵惧埌action娣诲姞鍒嗙被鏍� + selectTreeData.dicData = [data]; + }) + }, + + // 宸︿晶鏍戣鐐瑰嚮 + nodeClick(row) { + this.treeNodeRow = row; + this.getRightTableList(row); + this.bottomData = []; + }, + + // 澶撮儴鍒锋柊鎸夐挳 + handleRefresh() { + if (func.isEmptyObject(this.treeNodeRow)) { + return; + } + this.getRightTableList(this.treeNodeRow); + }, + + // 鍙充晶琛ㄦ牸淇℃伅 + getRightTableList(row) { + this.tableLoading = true; + const params = { + plactioncls: row.id + } + getActionTableData(params).then(res => { + const data = res.data.data; + this.data = data; + this.tableLoading = false; + }) + }, + + // 琛ㄦ牸澶氶�� + selectChangeHandler(row) { + this.selectList = row; + }, + + // 琛岀偣鍑� + rowClickHandler(row) { + this.currenRow = row; + func.rowClickHandler( + row, + this.$refs.crud, + this.lastIndex, + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.selectList = []; + } + ); + }, + + // 鎼滅储 + handleSearch(params, done) { + if (func.isEmptyObject(this.treeNodeRow)) { + this.$message.error('璇峰厛鍦ㄥ乏渚ч�夋嫨鑺傜偣鍚庢搷浣�'); + return done(); + } + this.tableLoading = true; + const apiParams = { + plactioncls: this.treeNodeRow.id === 'root' ? '' : this.treeNodeRow.id, + ...params + } + + getActionTableData(apiParams).then(res => { + const data = res.data.data; + this.data = data; + this.tableLoading = false; + }) + done(); + }, + + // 閲嶇疆鎼滅储鏉′欢 + handleReset() { + if (func.isEmptyObject(this.treeNodeRow)) { + this.$message.error('璇峰厛鍦ㄥ乏渚ч�夋嫨鑺傜偣鍚庢搷浣�'); + return; + } + this.getRightTableList(this.treeNodeRow); + }, + + // 淇濆瓨action + actionSaveHandler() { + if (this.selectList.length != 1) { + this.$message.error('鍙兘閫夋嫨涓�鏉℃暟鎹�'); + return; + } + this.$emit('updataAction', this.selectList[0]); + this.dialogClose(); + }, + + dialogClose(){ + this.btnActionVisible = false; + this.data = []; + this.$refs.tree.setCurrentKey(null); + } + + } +} +</script> + +<style lang="scss" scoped> +::v-deep { + .el-scrollbar__wrap { + overflow: auto !important; + } + + .headerCon { + .el-button { + width: 82px; + } + } +} + +.headerCon { + display: flex; + flex-wrap: wrap; + margin-bottom: 5px; + + .el-button + .el-button { + margin-left: 5px; + } + + .el-button { + margin-top: 5px; + } +} + +.headerCon > .el-button:nth-child(4) { + margin-left: 0; +} + +.headerCon > .el-button:nth-child(7) { + margin-left: 0; +} + +.smallBtn { + width: 82px; + text-align: center; + padding-left: 4.5px; +} + +</style> -- Gitblit v1.9.3