From 6c170b6b427f0882da35957e73f385d318970a06 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 25 十月 2024 17:59:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue | 252 +++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 228 insertions(+), 24 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
index 017da53..db8d1af 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/formDialog.vue
@@ -30,12 +30,15 @@
<div style="display: flex;justify-content: center">
<span style="display: flex;align-items: center; margin-right: 5px;">
<p class="tableTopLabel">鍚嶇О锛�</p>
- <el-input v-model="topForm.viName" placeholder="璇疯緭鍏ュ唴瀹�" size="mini"></el-input>
+ <el-input v-model="topForm.viName" placeholder="璇疯緭鍏ュ悕绉�" size="mini"></el-input>
</span>
<span style="display: flex;align-items: center; margin-right: 5px;">
<p class="tableTopLabel">鏌ヨ妯℃澘鍚嶇О锛�</p>
- <el-input v-model="form.itemQtName" placeholder="璇疯緭鍏ユ煡璇㈡ā鏉垮悕绉�" size="mini"></el-input>
+ <el-select v-model="form.itemQtName" placeholder="璇烽�夋嫨鏌ヨ妯℃澘" size="mini">
+ <el-option v-for="(item,index) in searchQtNameList" :key="index" :label="item.qtName"
+ :value="item.qtName"></el-option>
+ </el-select>
</span>
<span style="display: flex;align-items: center; margin-right: 5px;">
@@ -129,7 +132,8 @@
</el-button>
<el-button icon="el-icon-plus" plain size="small" type="primary" @click="addCustomClickHandler">娣诲姞鑷畾涔夌粍浠�
</el-button>
- <el-button icon="el-icon-zoom-in" plain size="small" type="primary">棰勮</el-button>
+ <el-button icon="el-icon-zoom-in" plain size="small" type="primary" @click="checkViewHandler">棰勮
+ </el-button>
</div>
</basic-container>
</el-main>
@@ -408,7 +412,7 @@
append-to-body="true"
class="avue-dialog"
title="琛ㄥ崟"
- width="40%"
+ width="50%"
@close="closeCustomDialog">
<el-form ref="form" :model="customForm" :rules="rules" label-position="left" label-width="85px">
<el-row style="border-bottom: 1px solid #878585;padding-bottom: 10px">
@@ -436,7 +440,7 @@
<el-col :span="12">
<el-form-item class="rightLabel" label="鏄剧ず绫诲瀷">
- <el-select v-model="customForm.itemType" placeholder="璇烽�夋嫨绫诲瀷" size="mini">
+ <el-select v-model="customForm.itemType" placeholder="璇烽�夋嫨绫诲瀷" size="mini" @change="customItemTypeChange">
<el-option v-for="(item,index) in showSelectList" :key="index" :label="item.label"
:value="item.value"></el-option>
</el-select>
@@ -668,12 +672,113 @@
<el-button type="primary" @click="customSaveHandler">纭� 瀹�</el-button>
</span>
</el-dialog>
+ <!-- 娣诲姞鑷畾涔夌粍浠堕�夋嫨灞炴�ф睜灞炴�у璇濇 -->
+ <el-dialog
+ v-dialogDrag
+ :visible.sync="customAttrVisible"
+ append-to-body="true"
+ class="avue-dialog"
+ title="閫夋嫨灞炴��"
+ width="50%">
+ <avue-crud
+ ref="userCrud"
+ :data="customAttrData"
+ :option="customAttrOption"
+ :page.sync="page"
+ :table-loading="customAttrLoading"
+ @row-click="customAttrRowClickHandler"
+ >
+ </avue-crud>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="customAttrVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="customAttrSaveHandler">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <!-- 棰勮 -->
+ <el-dialog
+ v-dialogDrag
+ :visible.sync="checkViewVisible"
+ append-to-body="true"
+ class="avue-dialog"
+ title="棰勮"
+ width="80%">
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+ <el-row>
+ <el-col v-for="(item,index) in formList" :key="index" :span="topForm.columnNumber">
+ <el-form-item :class="['hiddenLabel', { 'active-border': activeItem.text === item.text }]"
+ :label="item.itemName + '锛�'"
+ style="padding-left: 5px" @click.native="formItemClick(item,index)">
+ <el-input
+ v-if="item.itemType === 'text' ||
+ item.itemType === 'custom' ||
+ item.itemType === 'customform'||
+ item.itemType === 'hidden' ||
+ item.itemType === 'specialCharacter'"
+ v-model="item.value" :placeholder="item.text"
+ size="mini"></el-input>
+
+ <div v-if="item.itemType === 'textbtn'" style="display: flex;align-items: center">
+ <el-input v-model="item.value" :placeholder="item.text" size="mini"></el-input>
+ <el-button icon="el-icon-edit" plain size="mini" style="height: 28px;"
+ type="primary"></el-button>
+ </div>
+
+ <el-input
+ v-if="item.itemType === 'textarea' || item.itemType === 'richtext' || item.itemType === 'webeditor'"
+ v-model="item.value"
+ :placeholder="item.text"
+ :rows="2"
+ type="textarea">
+ </el-input>
+
+ <el-input-number v-if="item.itemType === 'number'" v-model="item.value" :max="99999"
+ :min="1"></el-input-number>
+ <el-input v-if="item.itemType === 'password'" v-model="input" placeholder="璇疯緭鍏ュ瘑鐮�"
+ show-password></el-input>
+ <el-radio v-if="item.itemType === 'radio'" v-model="item.value"></el-radio>
+ <el-checkbox v-if="item.itemType === 'checkbox'" v-model="item.value"></el-checkbox>
+ <el-select v-if="item.itemType === 'select' || item.itemType === 'multiselect'"
+ v-model="item.value" :disabled="true" placeholder="璇烽�夋嫨" size="mini">
+ </el-select>
+ <el-date-picker
+ v-if="item.itemType === 'date' || item.itemType === 'datetime'"
+ v-model="item.value"
+ :placeholder="item.itemType === 'date' ? '璇烽�夋嫨鏃ユ湡' : '璇烽�夋嫨鏃ユ湡鏃堕棿'"
+ type="date">
+ </el-date-picker>
+
+ <el-time-select
+ v-if="item.itemType === 'time'"
+ v-model="item.value"
+ :picker-options="{
+ start: '08:30',
+ step: '00:15',
+ end: '18:30'
+ }"
+ placeholder="閫夋嫨鏃堕棿">
+ </el-time-select>
+ <el-button v-if="item.itemType === 'file'"
+ v-model="item.value" plain size="mini" type="primary">
+ 涓婁紶鏂囦欢
+ </el-button>
+ <el-button v-if="item.itemType === 'multiFile'"
+ v-model="item.value" plain size="mini" type="primary">
+ 澶氭枃浠朵笂浼�
+ </el-button>
+
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </el-dialog>
</el-dialog>
</template>
<script>
-import {getTreeAttributes, savePortalVI} from "@/api/UI/formDefine/api";
+import {getObjTypeQTs, getTreeAttributes, savePortalVI} from "@/api/UI/formDefine/api";
import func from "@/util/func";
+import basicOption from "@/util/basic-option";
+import {gridAttribute} from "@/api/modeling/attributePool/api";
export default {
name: "formDialog",
@@ -695,6 +800,52 @@
},
data() {
return {
+ searchQtNameList: [],
+ customAttrRow: {},
+ customAttrOption: {
+ ...basicOption,
+ calcHeight: -60,
+ addBtn: false,
+ editBtn: false,
+ delBtn: false,
+ menu: false,
+ refreshBtn: false,
+ highlightCurrentRow: true,
+ selection: false,
+ column: [
+ {
+ label: '灞炴�у悕',
+ prop: 'id',
+ sortable: true,
+ },
+ {
+ label: '鏍囩',
+ prop: 'name',
+ sortable: true,
+ },
+ {
+ label: '绫诲瀷',
+ prop: 'attributeDataTypeText',
+ sortable: true,
+ width: 100
+ },
+ {
+ label: '榛樿鍊�',
+ prop: 'defaultValue',
+ sortable: true,
+ width: 120
+ },
+ {
+ label: '鎻忚堪',
+ prop: 'description',
+ overHidden: true,
+ },
+ ]
+ },
+ customAttrData: [],
+ customAttrLoading: false,
+ customAttrVisible: false,
+ checkViewVisible: false,
optionObj: {
optionName: '',
optionValue: ''
@@ -877,6 +1028,7 @@
this.treeLoading = false;
}
})
+ this.getSearchSelectList();
},
// 寮�濮嬫嫋鎷芥爲鑺傜偣浜嬩欢
@@ -892,8 +1044,10 @@
const params = {
text: data.text,
oid: data.oid,
- itemType: 'text'
+ itemType: 'text',
+ itemName:data.data.name
}
+ console.log(data);
const isDuplicate = this.formList.some(item => item.text === data.text);
if (isDuplicate) {
@@ -908,6 +1062,8 @@
this.activeItem = item;
this.activeItemIndex = index;
this.form = {...item};
+ console.log(item);
+
// console.log(item,index);
this.topForm.position = index += 1;
},
@@ -1061,11 +1217,11 @@
// 淇濆瓨鎸夐挳
saveClickHandler() {
if (!this.topForm.viName) {
- this.$message.error('鍚嶇О涓嶈兘涓虹┖');
+ this.$message.error('琛ㄥ崟鍚嶇О涓嶈兘涓虹┖');
return;
}
if (this.formList.length <= 0) {
- this.$message.error('椤甸潰涓嶈兘涓虹┖');
+ this.$message.error('椤甸潰瀹氫箟涓嶈兘涓虹┖');
return;
}
this.formList = this.formList.map(item => {
@@ -1088,10 +1244,8 @@
prmItemList: this.formList
},
}
- console.log(params);
savePortalVI(params).then(res => {
- console.log(res);
- if(res.data.code === 200){
+ if (res.data.code === 200) {
this.$message.success(res.data.obj);
this.visible = false;
this.closeDialog();
@@ -1110,12 +1264,14 @@
this.$message.error('璇峰湪鍙充晶閫夋嫨鏁版嵁鍚庤繘琛屾搷浣滐紒');
return;
}
- const targetObject = this.formList.find(item => item.text === this.form.text);
- if (targetObject) {
- targetObject.itemType = val;
+ },
+
+ // 鑷畾涔夌粍浠朵慨鏀规樉绀虹被鍨�
+ customItemTypeChange(val) {
+ if (val) {
+ this.customClearFormBottom();
}
- this.form.itemType = val;
},
// 鑷畾涔夌粍浠朵繚瀛�
@@ -1126,6 +1282,11 @@
}
if (!this.customForm.itemType) {
this.$message.error('璇烽�夋嫨鏄剧ず绫诲瀷');
+ return;
+ }
+ const status = this.formList.some(item => item.text === this.customForm.text);
+ if (status) {
+ this.$message.error('璇锋鏌ユ槸鍚︽坊鍔犵浉鍚岄」');
return;
}
this.formList.push(this.customForm);
@@ -1148,24 +1309,67 @@
this.form.itemListTable = this.form.itemListTxt = this.form.itemListVal = this.form.itemStyle = "";
},
+ // 鑷畾涔夌粍浠舵竻绌轰笉鍚岀被鍨嬭〃鍗曚笅鏂圭粦瀹氬��
+ customClearFormBottom() {
+ this.customOptionObj = {};
+ this.customForm.itemKeyValueList = [];
+ this.customForm.itemListTable = this.customForm.itemListTxt = this.customForm.itemListVal = this.customForm.itemStyle = "";
+ },
+
+ // 鑷畾涔夎〃鍗曚娇鐢ㄥ瓧娈佃〃鏍艰鐐瑰嚮
+ customAttrRowClickHandler(row) {
+ this.customAttrRow = row;
+ },
+
// 鑷畾涔夎〃鍗曚娇鐢ㄥ瓧娈甸�夋嫨
customTextHandler() {
+ this.customAttrVisible = true;
+ this.customAttrLoading = true
+ gridAttribute().then(res => {
+ const data = res.data.data;
+ this.customAttrData = data;
+ this.customAttrLoading = false;
+ }).catch(err => {
+ this.$message.error(err)
+ });
+ },
+ // 鑷畾涔夎〃鍗曚娇鐢ㄥ瓧娈典繚瀛�
+ customAttrSaveHandler() {
+ if (func.isEmptyObject(this.customAttrRow)) {
+ this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹繘琛屼繚瀛�');
+ return;
+ }
+ // console.log(this.customAttrRow)
+ this.customForm.text = this.customAttrRow.id;
+ this.customAttrVisible = false;
},
// 鍙充晶琛ㄥ崟搴旂敤鎸夐挳
asideFormHandler() {
+ if (!this.form.text) {
+ this.$message.error('璇锋坊鍔犱竴鏉℃暟鎹繘琛屼繚瀛橈紒');
+ return;
+ }
+ this.formList = this.formList.map(item =>
+ item.text === this.form.text ? this.form : item
+ );
+ this.$message.success('搴旂敤鎴愬姛');
},
- customClearFormBottom() {
- this.optionObj = {};
- this.form.itemKeyValueList = [];
- this.form.itemListTable = "";
- this.form.itemListTxt = "";
- this.form.itemListVal = "";
- this.form.itemStyle = "";
- }
+ // 棰勮鎸夐挳
+ checkViewHandler() {
+ this.checkViewVisible = true;
+ },
+
+ // 鏌ヨ妯℃澘涓嬫媺鎺ュ彛鏌ヨ
+ getSearchSelectList() {
+ getObjTypeQTs({btName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name}).then(res => {
+ this.searchQtNameList = res.data.data;
+ })
+ },
+
}
}
</script>
--
Gitblit v1.9.3