From 949b3dfe9912f46c79ce7754e5faf61135ec4d6a Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期四, 24 十月 2024 10:47:51 +0800
Subject: [PATCH] 调整action弹窗
---
/dev/null | 433 ------------------------------------------------
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue | 8
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/components/dialog.vue | 42 +--
Source/plt-web/plt-web-ui/src/views/authority/ui/typeAction/index.vue | 15 +
4 files changed, 30 insertions(+), 468 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/typeAction/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/typeAction/index.vue
index d5c3180..2306f80 100644
--- a/Source/plt-web/plt-web-ui/src/views/authority/ui/typeAction/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/typeAction/index.vue
@@ -33,7 +33,7 @@
<el-button 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>
@@ -44,7 +44,7 @@
import basicOption from "@/util/basic-option";
import { delUIContextData, getBizTree, gridUIContextData} from "@/api/UI/uiDefine";
import func from "@/util/func";
-import actionDialog from "@/views/modelingMenu/ui/Aciton/dialog"
+import actionDialog from "@/views/modelingMenu/ui/Aciton/components/dialog"
export default {
name: "index",
@@ -183,11 +183,20 @@
//鍒涘缓
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) {
+ addAction(val).then(res => {
+ if(res.data.code == 200){
+ this.$message.success(res.data.obj);
+
+ }
+ })
+ },
delHandler() {
if (this.selectList.length <= 0) {
this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/dialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/components/dialog.vue
similarity index 91%
rename from Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/dialog.vue
rename to Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/components/dialog.vue
index 1f9f60c..c47afba 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/dialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/components/dialog.vue
@@ -62,27 +62,13 @@
</template>
<script>
-import {
- getActionTree,
- getActionTableData,
- saveAction,
- updateAction,
- exportAction,
- deleteAction,
- getPLActionParam,
- savePLActionParam,
- updatePLActionParam,
- deletePLActionParam,
- saveActionCls,
- updateActionCls,
- deleteActionCls
-} from '@/api/UI/Action/api'
+import { getActionTree, getActionTableData} from '@/api/UI/Action/api'
import func from "@/util/func";
import basicOption from "@/util/basic-option";
-import {clonePageDef, cloneTabButton, clonetabPage} from "@/api/UI/uiDefine";
export default {
name: "index",
+ props:['isMuti'],
data() {
return {
dialog: {
@@ -168,7 +154,7 @@
created() {
},
methods: {
- openDialog(data) {
+ openDialog() {
this.dialog.showDialog = true;
this.getTreeList()
this.data = [];
@@ -176,21 +162,25 @@
cancelDialog() {
this.dialog.loading = false;
this.dialog.showDialog = false;
+ this.$refs.tree.setCurrentKey(null);
},
submitDialog() {
if (this.selectList.length==0) {
this.$message.error('璇烽�夋嫨Action');
return;
}
- const saveFunction = {
- 'pageDef': ''
- };
- saveFunction[this.type](params).then(res => {
- if(res.data.code == 200){
- this.$message.success(res.data.obj);
- this.cancelDialog();
+ if(this.isMuti){
+ this.$emit('updataAction', this.selectList);
+ }else {
+ if(this.selectList.length>1){
+ this.$message.error('璇烽�夋嫨涓�鏉ction');
+ return;
}
- })
+ this.$emit('updataAction', this.selectList[0]);
+ }
+
+ this.cancelDialog();
+
},
// 宸︿晶鏍戣姹�
getTreeList(status) {
@@ -207,7 +197,6 @@
nodeClick(row) {
this.treeNodeRow = row;
this.getRightTableList(row);
- this.bottomData = [];
},
// 澶撮儴鍒锋柊鎸夐挳
@@ -228,6 +217,7 @@
const data = res.data.data;
this.data = data;
this.tableLoading = false;
+
})
},
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
deleted file mode 100644
index 20b15b6..0000000
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue
+++ /dev/null
@@ -1,433 +0,0 @@
-<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>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
index a3aab36..00148aa 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
@@ -209,10 +209,6 @@
import basicOption from "@/util/basic-option";
import func from "@/util/func";
import {
- getBtmDatasByPage,
- getPortalVIDatasByPage,
- getQTInfoDatasByPage,
- getLinkDatasByPage,
getPLPageDefinations,
getTabButtons,
addTapButton,
@@ -223,7 +219,7 @@
joinBtn,
exitBtn
} from "@/api/UI/uiDefine";
-import actionDialog from '@/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action';
+import actionDialog from '@/views/modelingMenu/ui/Aciton/components/dialog';
import cloneDialog from "@/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog";
export default {
@@ -1195,7 +1191,7 @@
// 閫夋嫨action
actionFoucus() {
- this.$refs.actionDialog.btnActionVisible = true;
+ this.$refs.actionDialog.openDialog();
},
// 淇濆瓨action
--
Gitblit v1.9.3