From deb9457cbf67185699de2cd6dbc1ec5690584da0 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 06 九月 2024 12:30:41 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue | 135 +++++++++++++++++++++++++--------------------
1 files changed, 75 insertions(+), 60 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 67688b6..8ef3a18 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
@@ -21,8 +21,8 @@
<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>
+ <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">瀵煎嚭</el-button>
</template>
<template slot="menu" slot-scope="scope">
@@ -84,9 +84,9 @@
</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-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="rowSaveHandler">纭� 瀹�</el-button>
+ </span>
</el-dialog>
<!-- 鏌ョ湅浣跨敤鑼冨洿 -->
@@ -97,7 +97,7 @@
append-to-body="true"
class="avue-dialog"
title="鏌ョ湅浣跨敤鑼冨洿"
- width="70%"
+ width="60%"
>
<avue-crud
ref="checkViewCrud"
@@ -243,6 +243,7 @@
dialogData: [],
dialogOption: {
...basicOption,
+ calcHeight: 50,
refreshBtn: false,
selection: false,
column: [
@@ -320,7 +321,8 @@
},
tableLoading: false,
selectList: [],
- searchParams: {}
+ searchParams: {},
+ lastIndex: null
}
},
computed: {
@@ -366,13 +368,22 @@
// 閫夋嫨妗�
selectChange(row) {
- console.log(row)
this.selectList = row;
},
// 鐐瑰嚮琛�
rowClickHandler(row) {
- this.$refs.userCrud.toggleRowSelection(row);
+ func.rowClickHandler(
+ row,
+ this.$refs.userCrud,
+ this.lastIndex,
+ (newIndex) => {
+ this.lastIndex = newIndex;
+ },
+ () => {
+ this.selectList = [];
+ }
+ );
},
// 鍏抽棴瀵硅瘽妗�
@@ -462,67 +473,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();
- }
- })
- }
+ });
},
// 鏋氫妇椤规柊澧�
--
Gitblit v1.9.3