From 68994735dddb8d2be65149aa605ec0ac12e8775a Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期二, 10 九月 2024 15:26:59 +0800
Subject: [PATCH] 未滑动到底部 bug;多次点开对话测试 bug;数据对接SQL为选项之一

---
 src/views/project/yw/lowCode/sqlAmis/optDlg/OptDlg.vue |   74 +++---------------------------------
 1 files changed, 7 insertions(+), 67 deletions(-)

diff --git a/src/views/project/yw/lowCode/sqlAmis/optDlg/OptDlg.vue b/src/views/project/yw/lowCode/sqlAmis/optDlg/OptDlg.vue
index a1254a7..4241bf2 100644
--- a/src/views/project/yw/lowCode/sqlAmis/optDlg/OptDlg.vue
+++ b/src/views/project/yw/lowCode/sqlAmis/optDlg/OptDlg.vue
@@ -18,44 +18,6 @@
 			<el-form-item label="澶囨敞" prop="note">
 				<el-input v-model="dialogFormValue.note" type="textarea" :rows="3"></el-input>
 			</el-form-item>
-			<div class="flex max-h-80">
-				<span class="flex-0 ml-2.5">椤甸潰鍙傛暟</span>
-				<div class="ml-3 flex-auto flex-col flex">
-					<el-table :data="dialogFormValue.args" border>
-						<el-table-column prop="name" label="鍚嶇О" show-overflow-tooltip>
-							<template #default="scope">
-								<el-input v-model="scope.row.name"></el-input>
-							</template>
-						</el-table-column>
-						<el-table-column prop="title" label="鏍囬" show-overflow-tooltip>
-							<template #default="scope">
-								<el-input v-model="scope.row.title"></el-input>
-							</template>
-						</el-table-column>
-						<el-table-column label="" width="55" fixed="right" show-overflow-tooltip>
-							<template #default="scope">
-								<el-tooltip effect="dark" content="鍒犻櫎" placement="top">
-									<i class="ywifont ywicon-shanchu !text-[17px] text-red-400 cursor-pointer" @click="deleteArg(scope.$index)"></i>
-								</el-tooltip>
-							</template>
-						</el-table-column>
-					</el-table>
-					<el-button class="flex-0 mt-1" @click="addArg">娣诲姞</el-button>
-				</div>
-
-				<!-- <el-table class="ml-3 h-80" border row-class-name="cursor-pointer" :data="dialogFormValue.args" highlight-current-row>
-					<el-table-column prop="name" label="鍚嶇О" width="300" fixed="left" show-overflow-tooltip>
-						<template #default="scope">
-							<el-input v-model="dialogFormValue.args[scope.$index].name"></el-input>
-						</template>
-					</el-table-column>
-					<el-table-column prop="title" label="鎻愮ず" show-overflow-tooltip>
-						<template #default="scope">
-							<el-input v-model="dialogFormValue.args[scope.$index].title"></el-input>
-						</template>
-					</el-table-column>
-				</el-table> -->
-			</div>
 		</el-form>
 	</ywDialog>
 </template>
@@ -81,7 +43,7 @@
 import { useUserInfo } from '/@/stores/userInfo';
 import { storeToRefs } from 'pinia';
 
-const props = defineProps(['item']);
+const props = defineProps(['item', 'groupId']);
 const emit = defineEmits(['update', 'insert']);
 //#region ====================== 澧炲姞銆佷慨鏀硅褰曟搷浣�, dialog init======================
 const isEditDialog = ref(false);
@@ -104,13 +66,12 @@
 const openOperateDialog = (row?) => {
 	if (row) {
 		isEditDialog.value = true;
-		const { id, note, prompt, title, args } = row;
-		const formArgs = args ? args : [];
-		dialogFormValue.value = deepClone({ id, note, prompt, title, args: formArgs });
+		const { id, note, prompt, title } = row;
+		dialogFormValue.value = deepClone({ id, note, prompt, title });
 	} else {
 		isEditDialog.value = false;
 
-		dialogFormValue.value = { title: null, prompt: null, note: null, args: [] };
+		dialogFormValue.value = { group: props.groupId, title: null, prompt: null, note: null };
 	}
 };
 const closeDialog = () => {
@@ -123,14 +84,12 @@
 const submitFormValue = async () => {
 	const valid = await dialogFormRef.value.validate().catch(() => {});
 	if (!valid) return;
-	const args =
-		!dialogFormValue.value.args || dialogFormValue.value.args.length === 0 ? null : JSON.stringify(dialogFormValue.value.args);
-	const sendForm = { ...dialogFormValue.value, args };
-	const updateArgs = args && JSON.parse(args);
+
+	const sendForm = { ...dialogFormValue.value };
 	const updateTime = formatDate(new Date());
 	if (isEditDialog.value) {
 		const res = await supervisorAdminApi.updateSupervisor(sendForm);
-		emit('update', { ...dialogFormValue.value, args: updateArgs, update_time: updateTime.slice(0, 10) });
+		emit('update', { ...dialogFormValue.value, update_time: updateTime.slice(0, 10) });
 
 		closeDialog();
 		ElMessage.success('淇敼椤甸潰鎴愬姛');
@@ -139,7 +98,6 @@
 		const newData = {
 			id: res.agent_id,
 			...dialogFormValue.value,
-			args: updateArgs,
 			create_time: updateTime.slice(0, 10),
 			update_time: updateTime.slice(0, 10),
 			creator: userInfos.value.userName,
@@ -153,24 +111,6 @@
 
 //#endregion
 
-//#region ====================== 鍙紪杈戣〃鏍� ======================
-const addArg = () => {
-	const args = dialogFormValue.value.args;
-	const initData = {
-		name: '',
-		title: '',
-	};
-	if (!args || args.length === 0) {
-		dialogFormValue.value.args = [initData];
-		return;
-	}
-	dialogFormValue.value.args.push(initData);
-};
-
-const deleteArg = (index) => {
-	dialogFormValue.value.args.splice(index, 1);
-};
-//#endregion
 
 watch(
 	() => dialogIsShow.value,

--
Gitblit v1.9.3