From 388daad59d20da84118067593fc88a89e3f8c9d8 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 07 七月 2023 17:59:50 +0800
Subject: [PATCH] 主题库7-7完善发现bug
---
Source/UBCS-WEB/src/views/modeling/Business.vue | 701 +++++++++++++++++++++++++++-------------------------------
1 files changed, 324 insertions(+), 377 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue
index 189885b..35923fd 100644
--- a/Source/UBCS-WEB/src/views/modeling/Business.vue
+++ b/Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -1,74 +1,166 @@
<template>
-
<el-container>
- <el-aside width="240px">
- <basic-container>
- <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick">
- </avue-tree>
- </basic-container>
- </el-aside>
- <el-main>
- <!-- 鍩烘湰淇℃伅-->
- <basic-container>
- <p style="margin-top: 10px;font-weight: 570;font-size: 19px">鍩烘湰淇℃伅</p>
- <avue-crud
- v-model="objs"
- :data="basicData"
- :option="basicOption"
- @row-save="basicSave"
- >
- <!-- 鐗堟湰瑙勫垯-->
- <template slot="rulesForm" slot-scope="{disabled,size}">
- <div>
- <el-input v-if="rulesFalg==false" v-model="objs.tex" :size="size" placeholder="璇疯緭鍏ョ増鏈彿瑙勫垯"
- style="width: 290px"></el-input>
- <el-select v-if="rulesFalg" v-model="objs.select" placeholder="璇烽�夋嫨鐗堟湰鍙疯鍒�" style="max-width: 300px">
- <el-option label="娴嬭瘯1" value="1"></el-option>
- <el-option label="娴嬭瘯2" value="2"></el-option>
- <el-option label="娴嬭瘯3" value="3"></el-option>
- </el-select>
- <el-button style="margin-bottom: 5px;margin-left: 10px" type="primary" @click="handelRules">
- {{ rulesFalg == false ? "閫夋嫨鐗堟湰鍙疯鍒�" : "鎵嬪姩杈撳叆" }}
- </el-button>
- </div>
- </template>
- <!-- 鐢熷懡鍛ㄦ湡-->
- <template slot="lifeCycleForm">
- <el-select v-model="objs.select" placeholder="璇烽�夋嫨鐢熷懡鍛ㄦ湡" style="max-width: 300px">
- <el-option label="娴嬭瘯1" value="1"></el-option>
- <el-option label="娴嬭瘯2" value="2"></el-option>
- <el-option label="娴嬭瘯3" value="3"></el-option>
- </el-select>
- <el-button style="margin-bottom: 5px;display: inline-block;margin-left: 10px" type="primary"
- @click="handelLife">鐢熷懡鍛ㄦ湡鍒楄〃
- </el-button>
- </template>
- </avue-crud>
- <el-dialog :visible.sync="packageLifeBox"
- append-to-body
- title="鏌ョ湅浣跨敤鑼冨洿"
- width="1000px">
- <Businpackage></Businpackage>
+ <el-header class="businessHeader" style="height: 40px;">
+ <el-button-group>
+ <el-button type="primary" @click="businessAdd" size="small"> <i class="el-icon-plus"></i> 鏂板</el-button>
+ <el-button type="primary" @click="businessEdit" size="small"><i class="el-icon-edit"></i> 淇敼</el-button>
+ <el-button type="primary" @click="selectFromTable" size="small"><i class="el-icon-thumb"></i>
+ 浠庡凡鏈変腑鑾峰彇</el-button>
+ </el-button-group>
+ </el-header>
+ <el-container>
+ <el-aside width="240px">
+ <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" @node-click="nodeClick" class="businessTree">
+ <span class="el-tree-node__label" slot-scope="{ node, data }">
+ <span>
+ <i class="el-icon-star-on"></i>
+ {{ (node || {}).label }}
+ </span>
+ </span>
+ </avue-tree>
+ </basic-container>
+ </el-aside>
+ <el-container>
+ <el-main>
+ <!--鍩烘湰淇℃伅-->
+ <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 :labelStyle="descriptionOption.labelStyle"
+ :contentStyle="descriptionOption.contentStyle">
+ <template slot="label">
+ <i :class="icons.key"></i>
+ 鑻辨枃鍚嶇О
+ </template>
+ {{ obj.id }}
+ </el-descriptions-item>
+ <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
+ :contentStyle="descriptionOption.contentStyle">
+ <template slot="label">
+ <i :class="icons.name"></i>
+ 涓枃鍚嶇О
+ </template>
+ {{ obj.name }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label" :labelStyle="descriptionOption.labelStyle"
+ :contentStyle="descriptionOption.contentStyle">
+ <i :class="icons.tableName"></i>
+ 鏁版嵁搴撹〃鍚�
+ </template>
+ {{ obj.tableName }}
+ </el-descriptions-item>
+ <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
+ :contentStyle="descriptionOption.contentStyle">
+ <template slot="label">
+ <i :class="icons.domain"></i>
+ 鎵�灞為鍩�
+ </template>
+ <el-tag size="small">
+ {{ obj.domainText }}
+ </el-tag>
+ </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 :labelStyle="descriptionOption.labelStyle"
+ :contentStyle="descriptionOption.contentStyle">
+ <template slot="label">
+ <i :class="icons.revisionRule"></i>
+ 鐗堟湰瑙勫垯
+ </template>
+ {{ obj.versionRule }}
+ </el-descriptions-item>
+ <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
+ :contentStyle="descriptionOption.contentStyle">
+ <template slot="label">
+ <i :class="icons.lifeCycle"></i>
+ 鐢熷懡鍛ㄦ湡
+ </template>
+ {{ obj.lifeCycleId }}
+ </el-descriptions-item>
+ <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
+ :contentStyle="descriptionOption.contentStyle">
+ <template slot="label">
+ <i :class="icons.view"></i>
+ 瑙嗗浘
+ </template>
+ <el-tag size="small">
+ {{ obj.viewText }}
+ </el-tag>
+ </el-descriptions-item>
+ <!-- <el-descriptions-item>
+ <template slot="label">
+ <i class="el-icon-arrow-down"></i>
+ 瀹炵幇绫�
+ </template>
+ {{ obj.implClass }}
+ </el-descriptions-item> -->
+ <el-descriptions-item :labelStyle="descriptionOption.labelStyle"
+ :contentStyle="descriptionOption.contentStyle">
+ <template slot="label">
+ <i :class="icons.desc"></i>
+ 鎻忚堪
+ </template>
+ {{ obj.description }}
+ </el-descriptions-item>
+ </el-descriptions>
+ </basic-container>
+ <!-- 灞炴�у垪琛�-->
+ <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="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-select v-model="domain" placeholder="璇烽�夋嫨" @change="refOnLoad" size="small">
+ <el-option v-for="item in domainOptions" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ <div class="sep" style="height:7px">
+
+ </div>
+ <avue-crud class="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data"
+ @selection-change="selectionChange">
+ </avue-crud>
<span slot="footer" class="dialog-footer">
<el-button @click="dialoghandelfalse">鍙� 娑�</el-button>
<el-button type="primary" @click="dialoghandeltrue">纭� 瀹�</el-button>
- </span>
+ </span>
</el-dialog>
- </basic-container>
- <!-- 灞炴�у垪琛�-->
- <basic-container>
- <p style="margin-top: 10px;font-weight: 570;font-size: 19px">灞炴�у垪琛�</p>
- <avue-crud
- v-model="obj"
- :data="loadData"
- :option="loadOption"
- @row-save="loadSave"
- ></avue-crud>
- </basic-container>
- </el-main>
+ </el-container>
+ </el-container>
+ <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons"
+ @refreshTable="initTreeOnLoad">
+ </business-add>
</el-container>
</template>
<script>
+import {
+ initTree,
+ refOnLoad,
+ getDomain,
+ saveFromTable,
+ getDetail
+} from "@/api/omd/btmType"
export default {
name: "Business",
data() {
@@ -78,350 +170,195 @@
//鐗堟湰瑙勫垯鐘舵��
rulesFalg: false,
obj: {},
- treeData: [{
- value: 0,
- label: '涓氬姟绫诲瀷鏍�',
- children: [
- {
- value: 1,
- label: 'A',
- },
- {
- value: 2,
- label: 'B',
- },
- {
- value: 3,
- label: 'C',
- },
- {
- value: 4,
- label: 'D',
- },
- {
- value: 5,
- label: 'E',
- }
- ]
- }],
+ selectionList: [],
+ treeData: [],
treeOption: {
defaultExpandAll: true,
+ title: '涓氬姟绫诲瀷鏍�',
+ addBtn: false,
+ props: {
+ labelText: '',
+ label: 'label',
+ value: 'oid',
+ children: 'childList',
+ }
},
- loadData: [],
- loadData1: [
- {
- name: '寮犱笁',
- business: '娴嬭瘯',
- attrType: "娴嬭瘯",
- default: "娴嬭瘯",
- explain: "娴嬭瘯璇存槑"
- },
- {
- name: '鏉庡洓',
- business: '娴嬭瘯',
- attrType: "娴嬭瘯",
- default: "娴嬭瘯",
- explain: "娴嬭瘯璇存槑"
- }
- ],
- loadData2: [
- {
- name: '鐜嬩簲',
- business: '娴嬭瘯',
- attrType: "娴嬭瘯",
- default: "娴嬭瘯",
- explain: "娴嬭瘯璇存槑"
- },
- {
- name: '瀹嬪叚',
- business: '娴嬭瘯',
- attrType: "娴嬭瘯",
- default: "娴嬭瘯",
- explain: "娴嬭瘯璇存槑"
- }
- ],
+ addOption: {
+ btmType: {},
+ },
loadOption: {
border: true,
- height: 422,
+ height: 466,
editBtn: false,
+ addBtn: false,
+ menu: false,
+ highlightCurrentRow: true,
+ refreshBtn: false,
+ columnBtn: false,
column: [
{
- label: '灞炴�у悕',
- prop: 'name'
+ label: '鑻辨枃鍚嶇О',
+ prop: 'id',
+ align: 'center'
+ }, {
+ label: '涓枃鍚嶇О',
+ prop: 'name',
+ align: 'center'
},
{
- label: '涓氬姟绫诲瀷',
- prop: 'business'
- },
- {
- label: "灞炴�х被鍨�",
- prop: "attrType"
+ label: "绫诲瀷",
+ prop: "attrDataTypeText",
+ align: 'center',
+ slot: true
},
{
label: "榛樿鍊�",
- prop: "default",
+ prop: "defaultValue",
+ align: 'center'
},
{
label: "璇存槑",
- prop: "explain"
+ prop: "description",
+ align: 'center'
}
]
},
- //鍩烘湰淇℃伅
- objs: {
- tex: "",
- select: "",
- lifeTex: ""
+ descriptionOption: {
+ labelStyle: 'text-align:center;width:120px',
+ contentStyle: 'width:240px;text-align:center;word-break;break-all;'
},
- basicData: [],
- basicData1: [
- {
- typeName: "娴嬭瘯1",
- tag: "瀹㈡埛",
- inherit: "娴嬭瘯",
- implement: "娴嬭瘯",
- lifeCycle: "鍛ㄦ湡",
- desc: "杩欐槸涓�涓弿杩�"
- }
- ],
- basicData2: [
- {
- typeName: "娴嬭瘯2",
- tag: "瀹㈡埛",
- inherit: "娴嬭瘯",
- implement: "娴嬭瘯",
- lifeCycle: "鍛ㄦ湡",
- desc: "杩欐槸涓�涓弿杩�"
- }
- ],
- basicOption: {
- border: true,
- height: 88,
- tabs: true,
- column: [
- {
- label: "绫诲瀷鍚嶇О",
- prop: "typeName",
- display: false
- },
- {
- label: "鏍囩",
- prop: "tag",
- display: false
- },
- {
- label: "缁ф壙鑷�",
- prop: "inherit",
- display: false
- },
- {
- label: "瀹炵幇绫�",
- prop: "implement",
- display: false
- },
- {
- label: "鎻忚堪",
- prop: "desc",
- display: false
- }
- ],
- group: [
- {
- label: "鍩烘湰淇℃伅",
- column: [
- {
- label: "绫诲瀷鍚嶇О",
- prop: "typeName"
- },
- {
- label: "鏍囩",
- prop: "tag"
- },
- {
- label: "缁ф壙鑷�",
- prop: "inherit"
- },
- {
- label: "鏄惁瀹炰緥鍖�",
- prop: "case",
- type: "switch",
- align: "center",
- hide: true,
- labelWidth: 90,
- dicData: [
- {
- label: "鍚�",
- value: 0
- },
- {
- label: "鏄�",
- value: 1
- }
- ],
- },
- {
- label: "鎻忚堪",
- prop: "desc",
- type: "textarea"
- },
- {
- label: "瀹炵幇绫�",
- prop: "implement"
- },
-
- ]
- },
- {
- label: "鐗堟湰瑙勫垯",
- column: [
- {
- label: '鐗堟湰瑙勫垯',
- prop: 'radio',
- type: 'radio',
- button: true,
- change: this.radioChange,
- value: 0,
- dicData: [{
- label: '涓嶅彲淇',
- value: 0
- }, {
- label: '閲囩敤涓�绾х増鏈鐞�',
- value: 1
- }, {
- label: '閲囩敤浜岀骇鐗堟湰绠$悊',
- value: 2
- }]
- },
- {
- label: "鐗堟湰鍙疯鍒�",
- prop: "rules",
- display: true,
- formslot: true,
- },
- {
- label: "鍒嗛殧绗�",
- prop: "interval",
- type: "select",
- display: true,
- dicData: [
- {
- label: ".",
- value: 0
- },
- {
- label: "-",
- value: 1
- },
- {
- label: " ",
- value: 2
- }
- ]
- },
- {
- label: '鐗堟鍙疯鍒�',
- prop: 'radioRules',
- type: 'radio',
- display: true,
- dicData: [{
- label: '1.2.3...',
- value: 0
- }, {
- label: 'a.b.c...',
- value: 1
- }, {
- label: '0.1.2...',
- value: 2
- }]
- },
- ]
- },
- {
- label: "鐢熷懡鍛ㄦ湡",
- column: [
- {
- label: "鐢熷懡鍛ㄦ湡",
- prop: "lifeCycle"
- }
- ]
- }
- ]
+ 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'
},
-
+ ref: {
+ // 浠庤〃涓�夋嫨dialog鐘舵��
+ visible: false,
+ form: {},
+ option: {
+ height: "550px",
+ selection: true,
+ headerAlign: 'center',
+ border: true,
+ index: true,
+ rowKey: 'id',
+ tabs: true,
+ addBtn: false,
+ menu: false,
+ highlightCurrentRow: true,
+ column: [
+ {
+ label: '琛ㄥ悕',
+ prop: 'tableName',
+ align: 'center',
+ display: false
+ },
+ {
+ label: '鎻忚堪',
+ prop: 'description',
+ align: 'center',
+ display: false
+ }
+ ]
+ },
+ data: [],
+ }
}
},
created() {
- this.loadData = this.loadData1;
- this.basicData = this.basicData1
+ this.initTreeOnLoad();
+ this.initDomainOption();
},
methods: {
- //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗗彇娑堢偣鍑讳簨浠�
- dialoghandelfalse() {
- this.packageLifeBox = false
- },
- //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗙‘瀹氱偣鍑讳簨浠�
- dialoghandeltrue() {
- this.packageLifeBox = false
- },
- //閫夋嫨鐢熷懡鍛ㄦ湡瀵硅瘽妗�
- handelLife() {
- this.packageLifeBox = true
- },
- //鐗堟湰瑙勫垯鎵嬪姩杈撳叆鍜岄�夋嫨妗嗙殑鐘舵�佸彇鍙�
- handelRules() {
- this.rulesFalg = !this.rulesFalg
- },
- //鐗堟湰瑙勫垯涓変釜鎸夐挳鐨勬樉绀洪殣钘�
- radioChange(val) {
- if (val.value == 0) {
- this.basicOption.group[1].column[1].display = false;
- this.basicOption.group[1].column[2].display = false;
- this.basicOption.group[1].column[3].display = false;
- } else if (val.value == 1) {
- this.basicOption.group[1].column[1].display = true;
- this.basicOption.group[1].column[2].display = true;
- this.basicOption.group[1].column[3].display = false;
- } else if (val.value == 2) {
- this.basicOption.group[1].column[1].display = true;
- this.basicOption.group[1].column[2].display = true;
- this.basicOption.group[1].column[3].display = true;
- }
- },
nodeClick(data) {
- if (data.value == 1) {
- this.loadData = this.loadData1;
- this.basicData = this.basicData1
- } else if (data.value == 2) {
- this.loadData = this.loadData2;
- this.basicData = this.basicData2
+ if (data.oid) {
+ getDetail(data.oid).then(res => {
+ this.obj = res.data.data;
+ })
+ }else{
+ this.$message.warning('璇风偣鍑诲瓙鑺傜偣');
}
- this.$message.success(JSON.stringify(data))
+ },
+ // 鍩烘湰淇℃伅娣诲姞
+ basicSave(row, done, loading) {
+ add(Object.assign({
+ createUser: this.userInfo.name
+ }, row)).then(() => {
+ this.$message.success('鏂板鎴愬姛')
+ done();
+ this.getList();
+ }).catch(() => {
+ loading()
+ })
+ },
+ //灞炴�ф坊鍔�
+ loadSave(row, done, loading) {
+ add(Object.assign({
+ createUser: this.userInfo.name
+ }, row)).then(() => {
+ this.$message.success('鏂板鎴愬姛')
+ done();
+ this.getList();
+ }).catch(() => {
+ loading()
+ })
+ },
+ selectFromTable() {
+ console.log('鑾峰彇');
+ this.ref.visible = true;
+ },
+ refOnLoad(domain) {
+ refOnLoad(domain).then(res => {
+ this.ref.data = res.data.data;
+ })
+ },
+ initTreeOnLoad() {
+ initTree().then(res => {
+ this.treeData = res.data.data;
+ });
+ },
+ initDomainOption() {
+ getDomain().then(res => {
+ this.domainOptions = res.data.data;
+ })
+ },
+ selectionChange(list) {
+ this.selectionList = list;
+ },
+ dialoghandelfalse() {
+ this.ref.visible = false;
+ this.selectionList = [];
+ this.domain = null;
+ },
+ dialoghandeltrue() {
+ saveFromTable(this.selectionList, this.domain).then(res => {
+ this.$message.success('淇濆瓨鎴愬姛');
+ this.dialoghandelfalse();
+ this.initTreeOnLoad();
+ })
+ },
+ businessAdd() {
+ this.$refs.btmAdd.showSubmitDialog = true;
+ this.ifRefreshBtmAddRefresh();
+ },
+ businessEdit() {
+ var json = JSON.stringify(this.obj);
+ this.$refs.btmAdd.btmType = JSON.parse(json);
+ this.$refs.btmAdd.showSubmitDialog = true;
+ this.ifRefreshBtmAddRefresh();
+ },
+ ifRefreshBtmAddRefresh() {
+ // this.$refs.btmAdd.refreshAttrTable();
}
},
-// 鍩烘湰淇℃伅娣诲姞
- basicSave(row, done, loading) {
- add(Object.assign({
- createUser: this.userInfo.name
- }, row)).then(() => {
- this.$message.success('鏂板鎴愬姛')
- done();
- this.getList();
- }).catch(() => {
- loading()
- })
- },
- //灞炴�ф坊鍔�
- loadSave(row, done, loading) {
- add(Object.assign({
- createUser: this.userInfo.name
- }, row)).then(() => {
- this.$message.success('鏂板鎴愬姛')
- done();
- this.getList();
- }).catch(() => {
- loading()
- })
- }
}
</script>
@@ -431,4 +368,14 @@
border-radius: 10px;
}
-</style>
+.businessCrud>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu {
+ display: none !important;
+}
+
+.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