From e8992a5bd384b7695747e36eaab709b75de32da2 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 29 十一月 2023 10:41:00 +0800
Subject: [PATCH] 用户管理所属角色-禁用
---
Source/UBCS-WEB/src/views/modeling/Business.vue | 237 +++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 143 insertions(+), 94 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue
index eca59a8..c9fcc0e 100644
--- a/Source/UBCS-WEB/src/views/modeling/Business.vue
+++ b/Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -1,17 +1,26 @@
<template>
<el-container>
- <el-header>
- <el-button type="primary" @click="businessAdd">鏂板</el-button>
- <el-button type="primary" @click="businessEdit">淇敼</el-button>
- <el-button type="primary" @click="selectFromTable">浠庡凡鏈変腑鑾峰彇</el-button>
+ <el-header class="businessHeader" style="height: 40px;padding:0 8px">
+ <div>
+ <el-button v-if="permissionList.addBtn" icon="el-icon-plus" size="small" type="primary" @click="businessAdd" plain>
+ 鏂板
+ </el-button>
+ <el-button v-if="permissionList.editBtn" icon="el-icon-edit" size="small" type="primary" @click="businessEdit" plain>
+ 淇敼
+ </el-button>
+ <el-button v-if="permissionList.table" icon="el-icon-thumb" size="small" type="primary"
+ @click="selectFromTable" plain> 浠庡凡鏈変腑鑾峰彇
+ </el-button>
+ </div>
</el-header>
<el-container>
<el-aside width="240px">
- <basic-container>
- <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick">
- <span class="el-tree-node__label" slot-scope="{ node, data }">
+ <basic-container class="businessTreeContainer">
+ <p style="margin-top: 10px;font-weight: 570;font-size: 19px">{{ treeOption.title }}</p>
+ <avue-tree id="basic" :data="treeData" :option="treeOption" class="businessTree" @node-click="nodeClick">
+ <span slot-scope="{ node, data }" class="el-tree-node__label">
<span>
- <i class="el-icon-star-on"></i>
+ <i :class="(node || {}).level === 2 ? 'el-icon-star-off' : 'el-icon-folder-opened'"></i>
{{ (node || {}).label }}
</span>
</span>
@@ -23,74 +32,69 @@
<!--鍩烘湰淇℃伅-->
<basic-container>
<p style="margin-top: 10px;font-weight: 570;font-size: 19px">鍩烘湰淇℃伅</p>
- <el-descriptions class="margin-top" :column="3" :size="size" border>
- <el-descriptions-item>
+ <el-descriptions :column="3" :size="size" border class="margin-top">
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
<template slot="label">
- <i class="el-icon-finished"></i>
+ <i :class="icons.key"></i>
鑻辨枃鍚嶇О
</template>
{{ obj.id }}
</el-descriptions-item>
- <el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
<template slot="label">
- <i class="el-icon-info"></i>
+ <i :class="icons.name"></i>
涓枃鍚嶇О
</template>
{{ obj.name }}
</el-descriptions-item>
<el-descriptions-item>
- <template slot="label">
- <i class="el-icon-date"></i>
+ <template slot="label" :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
+ <i :class="icons.tableName"></i>
鏁版嵁搴撹〃鍚�
</template>
{{ obj.tableName }}
</el-descriptions-item>
- <el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
<template slot="label">
- <i class="el-icon-folder-opened"></i>
+ <i :class="icons.domain"></i>
鎵�灞為鍩�
</template>
- <el-tag size="small">
- {{ obj.domainText }}
- </el-tag>
+ <el-tag v-if="obj.domainText" size="small">
+ {{ obj.domainText }}
+ </el-tag>
+ <span v-else></span>
</el-descriptions-item>
- <!-- <el-descriptions-item>
- <template slot="label">
- <i class="el-icon-s-ticket"></i>
- 鏍囩
- </template>
- {{obj.hashtag}}
- </el-descriptions-item> -->
- <!-- <el-descriptions-item>
- <template slot="label">
- <i class="el-icon-arrow-up"></i>
- 缁ф壙鑷�
- </template>
- {{ obj.sss }}
- </el-descriptions-item> -->
- <el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
<template slot="label">
- <i class="el-icon-s-check"></i>
+ <i :class="icons.revisionRule"></i>
鐗堟湰瑙勫垯
</template>
- {{ obj.versionRule }}
+ {{ obj.revisionRuleName ? obj.revisionRuleName + '(' + obj.revisionRuleId + ')' : '' }}
</el-descriptions-item>
- <el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
<template slot="label">
- <i class="el-icon-refresh-right"></i>
+ <i :class="icons.lifeCycle"></i>
鐢熷懡鍛ㄦ湡
</template>
- {{ obj.lifeCycleId }}
+ {{ obj.lifeCycleName ? obj.lifeCycleName + '(' + obj.lifeCycleId + ')' : '' }}
</el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- <i class="el-icon-view"></i>
- 瑙嗗浘
- </template>
- <el-tag size="small">
- {{ obj.viewText }}
- </el-tag>
- </el-descriptions-item>
+<!-- <el-descriptions-item :contentStyle="descriptionOption.contentStyle"-->
+<!-- :labelStyle="descriptionOption.labelStyle">-->
+<!-- <template slot="label">-->
+<!-- <i :class="icons.view"></i>-->
+<!-- 瑙嗗浘-->
+<!-- </template>-->
+<!-- <el-tag v-if="obj.viewText" size="small">-->
+<!-- {{ obj.viewText }}-->
+<!-- </el-tag>-->
+<!-- <span v-else></span>-->
+<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>
<template slot="label">
<i class="el-icon-arrow-down"></i>
@@ -98,9 +102,10 @@
</template>
{{ obj.implClass }}
</el-descriptions-item> -->
- <el-descriptions-item>
+ <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+ :labelStyle="descriptionOption.labelStyle">
<template slot="label">
- <i class="el-icon-chat-line-square"></i>
+ <i :class="icons.desc"></i>
鎻忚堪
</template>
{{ obj.description }}
@@ -110,37 +115,35 @@
<!-- 灞炴�у垪琛�-->
<basic-container>
<p style="margin-top: 10px;font-weight: 570;font-size: 19px">灞炴�у垪琛�</p>
- <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption">
- <template slot="attrDataType" slot-scope="{row}" >
- <el-tag>{{row.attrDataType}}</el-tag>
- </template>
+ <avue-crud v-model="obj" :data="obj.attributes" :option="loadOption" class="attributeCrud">
+ <template slot="attrDataTypeText" slot-scope="{row}">
+ <el-tag>{{ row.attrDataTypeText }}</el-tag>
+ </template>
</avue-crud>
</basic-container>
</el-main>
- <el-dialog :visible="ref.visible" title="浠庢暟鎹簱涓坊鍔�" width="700px" append-to-body @close="dialoghandelfalse">
+ <el-dialog :visible="ref.visible" append-to-body title="浠庢暟鎹簱涓坊鍔�" width="700px" @close="dialoghandelfalse" top="9vh">
閫夋嫨棰嗗煙锛�
- <el-select v-model="domain" placeholder="璇烽�夋嫨" @change="refOnLoad">
+ <el-select v-model="domain" placeholder="璇烽�夋嫨" size="small" @change="refOnLoad">
<el-option v-for="item in domainOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
- <avue-crud class="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data" @selection-change="selectionChange">
+ <div class="sep" style="height:7px">
+
+ </div>
+ <avue-crud ref="businessCrud" v-model="ref.form" :data="ref.data" :option="ref.option" class="businessCrud"
+ @selection-change="selectionChange">
</avue-crud>
-<<<<<<< Updated upstream
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialoghandeltrue">纭畾</el-button>
- <el-button @click="dialoghandelfalse">鍙栨秷</el-button>
- </div>
-=======
<span slot="footer" class="dialog-footer">
<el-button @click="dialoghandelfalse">鍙� 娑�</el-button>
<el-button type="primary" @click="dialoghandeltrue">纭� 瀹�</el-button>
</span>
->>>>>>> Stashed changes
</el-dialog>
</el-container>
</el-container>
- <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions">
- </business-add>
+ <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons"
+ @refreshTable="initTreeOnLoad">
+ </business-add>
</el-container>
</template>
<script>
@@ -151,6 +154,8 @@
saveFromTable,
getDetail
} from "@/api/omd/btmType"
+import {mapGetters} from "vuex";
+
export default {
name: "Business",
data() {
@@ -165,25 +170,27 @@
treeOption: {
defaultExpandAll: true,
title: '涓氬姟绫诲瀷鏍�',
+ addBtn: false,
+ menu: false,
props: {
labelText: '',
- label: 'name',
+ label: 'label',
value: 'oid',
children: 'childList',
}
},
- addOption:{
- btmType:{},
+ addOption: {
+ btmType: {},
},
loadOption: {
border: true,
- height: 466,
+ height: 478,
editBtn: false,
addBtn: false,
menu: false,
highlightCurrentRow: true,
- refreshBtn:false,
- columnBtn:false,
+ refreshBtn: false,
+ columnBtn: false,
column: [
{
label: '鑻辨枃鍚嶇О',
@@ -196,7 +203,7 @@
},
{
label: "绫诲瀷",
- prop: "attrDataType",
+ prop: "attrDataTypeText",
align: 'center',
slot: true
},
@@ -212,8 +219,23 @@
}
]
},
+ descriptionOption: {
+ labelStyle: 'text-align:center;width:120px',
+ contentStyle: 'width:240px;text-align:center;word-break;break-all;'
+ },
domain: null,
domainOptions: [],
+ icons: {
+ key: 'el-icon-finished',
+ name: 'el-icon-tickets',
+ tableName: 'el-icon-date',
+ domain: 'el-icon-folder-opened',
+ revisionRule: 'el-icon-s-check',
+ lifeCycle: 'el-icon-refresh-right',
+ view: 'el-icon-view',
+ desc: 'el-icon-chat-line-square',
+ referType: 'el-icon-search'
+ },
ref: {
// 浠庤〃涓�夋嫨dialog鐘舵��
visible: false,
@@ -244,10 +266,17 @@
}
]
},
- data: [{
- tableName: '1',
- description: '2'
- }]
+ data: [],
+ }
+ }
+ },
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.modeling_Business.Business_add, false),
+ table: this.vaildData(this.permission.modeling_Business.Business_table, false),
+ editBtn: this.vaildData(this.permission.modeling_Business.Business_edit, false),
}
}
},
@@ -256,10 +285,14 @@
this.initDomainOption();
},
methods: {
- nodeClick(data) {
- getDetail(data.oid).then(res => {
- this.obj = res.data.data;
- })
+ nodeClick(data, node, leaf) {
+ if (data.oid) {
+ getDetail(data.oid).then(res => {
+ this.obj = res.data.data;
+ })
+ } else {
+ this.$message.warning('璇风偣鍑诲瓙鑺傜偣');
+ }
},
// 鍩烘湰淇℃伅娣诲姞
basicSave(row, done, loading) {
@@ -286,7 +319,6 @@
})
},
selectFromTable() {
- console.log('鑾峰彇');
this.ref.visible = true;
},
refOnLoad(domain) {
@@ -309,27 +341,38 @@
},
dialoghandelfalse() {
this.ref.visible = false;
+ this.$refs.businessCrud.toggleSelection()
this.selectionList = [];
this.domain = null;
},
dialoghandeltrue() {
+ if (this.selectionList.length < 1) {
+ this.$message.warning('璇烽�夋嫨鏁版嵁');
+ return false;
+ }
saveFromTable(this.selectionList, this.domain).then(res => {
this.$message.success('淇濆瓨鎴愬姛');
this.dialoghandelfalse();
this.initTreeOnLoad();
})
},
- businessAdd(){
+ businessAdd() {
+ this.$refs.btmAdd.showSubmitDialog = true;
+ this.$refs.btmAdd.btmType = {};
+ this.ifRefreshBtmAddRefresh();
+ },
+ businessEdit() {
+ if (!this.obj.oid) {
+ this.$message.warning("璇烽�夋嫨涓�鏉″彾瀛愯妭鐐圭殑涓氬姟绫诲瀷");
+ return;
+ }
+ const json = JSON.stringify(this.obj);
+ this.$refs.btmAdd.btmType = JSON.parse(json);
this.$refs.btmAdd.showSubmitDialog = true;
this.ifRefreshBtmAddRefresh();
},
- businessEdit(){
- this.$refs.btmAdd.btmType = this.obj;
- this.$refs.btmAdd.showSubmitDialog = true;
- this.ifRefreshBtmAddRefresh();
- },
- ifRefreshBtmAddRefresh(){
- this.$refs.btmAdd.refreshAttrTable();
+ ifRefreshBtmAddRefresh() {
+ // this.$refs.btmAdd.refreshAttrTable();
}
},
}
@@ -341,8 +384,14 @@
border-radius: 10px;
}
-.businessCrud > .el-card > .el-card__body > .avue-crud_menu{
- display: none!important;
+.businessCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
+ display: none !important;
}
-</style>
+.attributeCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
+ display: none !important;
+}
+
+.businessTreeContainer > .el-card > .el-card__body {
+ height: 775px;
+}</style>
--
Gitblit v1.9.3