From 6f7f3834f66b08bed7af331ce1a168d6cd89292d Mon Sep 17 00:00:00 2001
From: wangting <wangting@vci-tech.com>
Date: 星期五, 03 一月 2025 18:14:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue | 458 ++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 291 insertions(+), 167 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue
index 1c5aea5..871e58d 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue
@@ -1,117 +1,173 @@
<template>
- <basic-container>
- <avue-crud
- ref="userCrud"
- :data="tableData"
- :option="option"
- :table-loading="tableLoading"
- @on-load="getTableList"
- @refresh-change="handleRefresh"
- @search-change="handleSearch"
- @search-reset="handleReset"
- @selection-change="selectChange"
- @row-click="rowClickHandler"
- >
+ <el-container>
+ <el-main>
+ <basic-container>
+ <avue-crud
+ ref="userCrud"
+ :data="tableData"
+ :option="option"
+ :table-loading="tableLoading"
+ @on-load="getTableList"
+ @refresh-change="handleRefresh"
+ @search-change="handleSearch"
+ @search-reset="handleReset"
+ @selection-change="selectChange"
+ @row-click="rowClickHandler"
+ >
- <template slot="menuLeft" slot-scope="scope">
- <el-button icon="el-icon-plus" size="small" type="primary" @click="rowSaveHandlerClick">鍒涘缓</el-button>
- <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">鍒犻櫎</el-button>
- <el-button icon="el-icon-view" plain size="small" type="primary" @click="chekView">鏌ョ湅浣跨敤鑼冨洿</el-button>
- <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">涓嬭浇瀵煎叆妯℃澘
- </el-button>
- <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">瀵煎嚭</el-button>
- <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadUser">瀵煎叆</el-button>
- </template>
+ <template slot="menuLeft" slot-scope="scope">
+ <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary"
+ @click="rowSaveHandlerClick">鍒涘缓
+ </el-button>
+ <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger"
+ @click="allDelHandler">鍒犻櫎
+ </el-button>
+ <el-button v-if="permissionList.viewTheScopeBtn" icon="el-icon-view" plain size="small" type="primary"
+ @click="chekView">鏌ョ湅浣跨敤鑼冨洿
+ </el-button>
+ <el-button v-if="permissionList.downloadImportTemplateBtn" icon="el-icon-download" plain size="small"
+ type="primary" @click="downloadTemplateHandler">涓嬭浇瀵煎叆妯℃澘
+ </el-button>
+ <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary"
+ @click="uploadUser">瀵煎叆
+ </el-button>
+ <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary"
+ @click="downloadHandler">瀵煎嚭
+ </el-button>
+ </template>
- <template slot="menu" slot-scope="scope">
- <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">缂栬緫
- </el-button>
- <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎
- </el-button>
- </template>
+ <template slot="menu" slot-scope="scope">
+ <el-button v-if="permissionList.editBtn" icon="el-icon-edit" size="small" type="text"
+ @click="editBtnClick(scope.row)">缂栬緫
+ </el-button>
+ <el-button v-if="permissionList.delBtn" icon="el-icon-delete" size="small" type="text"
+ @click="rowDeleteHandler(scope.row)">鍒犻櫎
+ </el-button>
+ </template>
- </avue-crud>
- <!-- 鍒涘缓缂栬緫鑷畾涔夊璇濇 -->
- <el-dialog
- v-dialogDrag
- v-loading="dialogLoading"
- :title="dialogType === 'add' ? ' 鍒涘缓' : '缂栬緫'"
- :visible.sync="dialogVisible"
- append-to-body="true"
- class="avue-dialog"
- width="70%"
- @close="dialogClose"
- >
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
- <el-row>
- <el-col :span="12">
- <el-form-item label="鍚嶇О锛�" prop="id">
- <el-input v-model="form.id"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鏍囩锛�">
- <el-input v-model="form.name"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="绫诲瀷锛�">
- <el-select v-model="form.enumValueDataType" placeholder="璇烽�夋嫨绫诲瀷">
- <el-option label="String" value="String"></el-option>
- <el-option label="Integer" value="Integer"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="闀垮害锛�">
- <el-input-number v-model="form.length" :max="999" :min="1" label="鎻忚堪鏂囧瓧"></el-input-number>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <avue-crud
- ref="dialogCrud"
- :data="dialogData"
- :option="dialogOption"
- @row-save="rowSaveDialogHandler"
- @row-update="rowUpdateDialogHandler"
- @row-del="rowDeleteDialogHandler"
- >
- </avue-crud>
- </el-col>
- </el-row>
- </el-form>
+ </avue-crud>
+ <!-- 鍒涘缓缂栬緫鑷畾涔夊璇濇 -->
+ <el-dialog
+ v-dialogDrag
+ v-loading="dialogLoading"
+ :title="dialogType === 'add' ? ' 鍒涘缓' : '缂栬緫'"
+ :visible.sync="dialogVisible"
+ append-to-body="true"
+ class="avue-dialog"
+ width="1000px"
+ @close="dialogClose"
+ >
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px" size="small">
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="鏋氫妇鍚嶇О锛�" prop="id">
+ <el-input v-model="form.id"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏍囩锛�">
+ <el-input v-model="form.name"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="绫诲瀷锛�">
+ <el-select v-model="form.enumValueDataType" placeholder="璇烽�夋嫨绫诲瀷" style="width: 376px;">
+ <el-option label="String" value="String"></el-option>
+ <el-option label="Integer" value="Integer"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="闀垮害锛�">
+ <el-input-number v-model="form.length" :max="999" :min="1" label="鎻忚堪鏂囧瓧"
+ style="width: 376px;"></el-input-number>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <avue-crud
+ ref="dialogCrud"
+ :data="dialogData"
+ :option="dialogOption"
+ @row-save="rowSaveDialogHandler"
+ @row-update="rowUpdateDialogHandler"
+ @row-del="rowDeleteDialogHandler"
+ >
+ </avue-crud>
+ </el-col>
+ </el-row>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="rowSaveHandler">纭� 瀹�</el-button>
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ </span>
+ </el-dialog>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="rowSaveHandler">纭� 瀹�</el-button>
- <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
- </span>
- </el-dialog>
+ <!-- 鏌ョ湅浣跨敤鑼冨洿 -->
+ <el-dialog
+ v-dialogDrag
+ v-loading="checkViewLoading"
+ :visible.sync="checkViewVisible"
+ append-to-body="true"
+ class="avue-dialog"
+ title="鏌ョ湅浣跨敤鑼冨洿"
+ width="60%"
+ >
+ <avue-crud
+ ref="checkViewCrud"
+ :data="checkViewData"
+ :option="checkViewOption"
+ @search-change="checkHandleSearch"
+ @search-reset="checkHandleReset"
+ >
+ </avue-crud>
+ </el-dialog>
- <!-- 鏌ョ湅浣跨敤鑼冨洿 -->
- <el-dialog
- v-dialogDrag
- v-loading="checkViewLoading"
- :visible.sync="checkViewVisible"
- append-to-body="true"
- class="avue-dialog"
- title="鏌ョ湅浣跨敤鑼冨洿"
- width="70%"
- >
- <avue-crud
- ref="checkViewCrud"
- :data="checkViewData"
- :option="checkViewOption"
- @search-change="checkHandleSearch"
- @search-reset="checkHandleReset"
- >
+ <!--瀵煎叆 -->
+ <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
+ @updata="getTableList"></upload-file>
+ </basic-container>
+ </el-main>
- </avue-crud>
- </el-dialog>
+ <el-aside width="35%">
+ <basic-container>
+ <el-descriptions :column="1" :labelStyle="{width:'150px'}" border size="medium" style="margin-bottom: 20px"
+ title="鏋氫妇淇℃伅">
+ <el-descriptions-item>
+ <template slot="label">
+ 鍚嶇О
+ </template>
+ {{ this.lastItem.id }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 鏍囩
+ </template>
+ {{ this.lastItem.name }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 绫诲瀷
+ </template>
+ {{ this.lastItem.enumValueDataType || 'String' }}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ 闀垮害
+ </template>
+ <el-tag> {{ this.lastItem.length || 50 }}</el-tag>
+ </el-descriptions-item>
- <!--瀵煎叆 -->
- <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
- @updata="getTableList"></upload-file>
- </basic-container>
+ </el-descriptions>
+
+ <p style="font-weight: bold">鏋氫妇椤�</p>
+ <avue-crud
+ :data="asideData"
+ :option="asideOption"
+ >
+ </avue-crud>
+ </basic-container>
+ </el-aside>
+ </el-container>
</template>
<script>
@@ -126,12 +182,40 @@
downloadEnumTemplate
} from "@/api/modeling/enumType/api";
import func from "@/util/func";
+import {mapGetters} from "vuex";
import {deleteUser} from "@/api/system/user/api";
export default {
name: "index",
data() {
return {
+ asideOption: {
+ ...basicOption,
+ addBtn: false,
+ editBtn: false,
+ menu: false,
+ refreshBtn: false,
+ selection: false,
+ index: false,
+ header: false,
+ calcHeight: -40,
+ column: [
+ {
+ label: '鏋氫妇椤瑰悕绉�',
+ prop: 'name',
+ sortable: true,
+ },
+ {
+ label: '鏋氫妇鍊�',
+ prop: 'value',
+ sortable: true,
+ },
+ {
+ label: '鎻忚堪',
+ prop: 'description',
+ },
+ ]
+ },
tipList: [
"瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」",
"*娉ㄦ剰*:绗簩琛屽紑濮嬬殑鏁版嵁涓虹ず渚嬫暟鎹紝瀵煎叆鍓嶈灏嗗叾鍒犻櫎锛屽綋瀵煎叆鐨勬灇涓句笅鍏峰澶氫釜鏋氫妇椤规椂锛屽簲鎸夌収绀轰緥enum2鐨勫啓娉�",
@@ -175,13 +259,16 @@
dialogData: [],
dialogOption: {
...basicOption,
+ calcHeight: 50,
refreshBtn: false,
selection: false,
+ dialogWidth: 500,
column: [
{
label: '鏋氫妇椤瑰悕',
prop: 'name',
sortable: true,
+ span: 24,
rules: [
{
required: true,
@@ -194,6 +281,7 @@
label: '鏋氫妇鍊�',
prop: 'value',
sortable: true,
+ span: 24,
rules: [
{
required: true,
@@ -205,13 +293,13 @@
{
label: '鎻忚堪',
prop: 'description',
- sortable: true,
+ span: 24
},
]
},
rules: {
id: [
- {required: true, message: '璇疯緭鍏ユ灇涓鹃」鍚�', trigger: 'blur'},
+ {required: true, message: '璇疯緭鍏ユ灇涓惧悕绉�', trigger: 'blur'},
{validator: this.validateEnglishOnly, trigger: 'blur'}
],
},
@@ -226,11 +314,12 @@
tableData: [],
option: {
...basicOption,
- calcHeight: -60,
+ calcHeight: -40,
searchMenuSpan: 8,
addBtn: false,
editBtn: false,
delBtn: false,
+ menuWidth: 160,
column: [
{
label: '鏋氫妇鍚嶇О',
@@ -247,12 +336,37 @@
label: '杩斿洖绫诲瀷',
prop: 'enumValueDataTypeText',
sortable: true,
+ width: 130
}
]
},
tableLoading: false,
selectList: [],
- searchParams: {}
+ searchParams: {},
+ lastIndex: null
+ }
+ },
+ created() {
+ console.log(this.$route);
+ },
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
+ delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
+ editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
+ exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
+ importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
+ downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].downloadImportTemplate, false),
+ viewTheScopeBtn: this.vaildData(this.permission[this.$route.query.id].viewTheScope, false),
+ };
+ },
+ lastItem() {
+ return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1] : {};
+ },
+ asideData() {
+ return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1].items : [];
}
},
methods: {
@@ -264,7 +378,6 @@
this.tableData = data;
this.tableLoading = false;
}).catch(err => {
- this.$message.error(err)
});
},
@@ -295,7 +408,17 @@
// 鐐瑰嚮琛�
rowClickHandler(row) {
- this.$refs.userCrud.toggleRowSelection(row);
+ func.rowClickHandler(
+ row,
+ this.$refs.userCrud,
+ this.lastIndex,
+ (newIndex) => {
+ this.lastIndex = newIndex;
+ },
+ () => {
+ this.selectList = [row];
+ }
+ );
},
// 鍏抽棴瀵硅瘽妗�
@@ -330,7 +453,6 @@
this.dialogData = row.items;
this.dialogVisible = true;
this.editRow = row;
- console.log(row);
},
// 鍒犻櫎鎸夐挳鐐瑰嚮
@@ -386,67 +508,71 @@
message: '宸插彇娑堝垹闄�'
});
});
-
-
},
// 瀵硅瘽妗嗘灇涓句繚瀛�
rowSaveHandler() {
- const lengthStatus = this.dialogData.some(item => item.value.length > this.form.length)
- if (lengthStatus) {
- this.$message.error('璇锋鏌ユ灇涓惧�兼槸鍚﹁秴杩囨渶澶ч暱搴︼紒')
- return;
- }
-
- if (this.form.enumValueDataType === "Integer") {
- // 鍒ゆ柇鏄惁鍖呭惈闈炴暟瀛楀瓧绗�
- const integerStatus = this.dialogData.some(item => {
- if (!/^\-?\d+$/.test(item.value)) {
- return true;
+ const lengthStatus = this.dialogData.some(item => item.value.length > this.form.length);
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ if (lengthStatus) {
+ this.$message.error('璇锋鏌ユ灇涓惧�兼槸鍚﹁秴杩囨渶澶ч暱搴︼紒')
+ return;
}
- })
- // 鍒ゆ柇鏄惁鏄痠nteger鏍煎紡
- const integerNumStatus = this.dialogData.some(item => {
- let numValue = parseInt(item.value);
- if (isNaN(numValue) || !Number.isInteger(numValue)) {
- return true;
+ if (this.form.enumValueDataType === "Integer") {
+ // 鍒ゆ柇鏄惁鍖呭惈闈炴暟瀛楀瓧绗�
+ const integerStatus = this.dialogData.some(item => {
+ if (!/^\-?\d+$/.test(item.value)) {
+ return true;
+ }
+ })
+
+ // 鍒ゆ柇鏄惁鏄痠nteger鏍煎紡
+ const integerNumStatus = this.dialogData.some(item => {
+ let numValue = parseInt(item.value);
+ if (isNaN(numValue) || !Number.isInteger(numValue)) {
+ return true;
+ }
+ })
+
+ if (integerStatus || integerNumStatus) {
+ this.$message.error('鏋氫妇鍊煎繀椤绘槸Integer绫诲瀷');
+ return;
+ }
}
- })
- if (integerStatus || integerNumStatus) {
- this.$message.error('鏋氫妇鍊煎繀椤绘槸Integer绫诲瀷');
- return;
+ if (this.dialogType === 'add') {
+ let params = {
+ ...this.form,
+ items: this.dialogData
+ }
+ addEnumType(params).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.dialogVisible = false;
+ this.getTableList();
+ }
+ })
+ } else if (this.dialogType === 'edit') {
+ let params = {
+ ...this.form,
+ items: this.dialogData,
+ oid: this.editRow.oid,
+ ts: this.editRow.ts
+ }
+ updateEnumType(params).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.dialogVisible = false;
+ this.getTableList();
+ }
+ })
+ }
+ } else {
+ return false;
}
- }
-
- if (this.dialogType === 'add') {
- let params = {
- ...this.form,
- items: this.dialogData
- }
- addEnumType(params).then(res => {
- if (res.data.code === 200) {
- this.$message.success(res.data.obj);
- this.dialogVisible = false;
- this.getTableList();
- }
- })
- } else if (this.dialogType === 'edit') {
- let params = {
- ...this.form,
- items: this.dialogData,
- oid: this.editRow.oid,
- ts: this.editRow.ts
- }
- updateEnumType(params).then(res => {
- if (res.data.code === 200) {
- this.$message.success(res.data.obj);
- this.dialogVisible = false;
- this.getTableList();
- }
- })
- }
+ });
},
// 鏋氫妇椤规柊澧�
@@ -567,7 +693,6 @@
func.downloadFileByBlobHandler(res);
this.$message.success('瀵煎嚭鎴愬姛');
}).catch(err => {
- this.$message.error(err);
})
},
@@ -577,7 +702,6 @@
func.downloadFileByBlobHandler(res);
this.$message.success('涓嬭浇鎴愬姛');
}).catch(err => {
- this.$message.error(err);
})
},
--
Gitblit v1.9.3