From b46e6d2306515f94bf77c06e8d80ac76267e3ddb Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期日, 02 六月 2024 21:44:23 +0800
Subject: [PATCH] 搜索

---
 src/views/configuration/custom/planSettings.vue |   43 ++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/src/views/configuration/custom/planSettings.vue b/src/views/configuration/custom/planSettings.vue
index 368eb9a..a82571e 100644
--- a/src/views/configuration/custom/planSettings.vue
+++ b/src/views/configuration/custom/planSettings.vue
@@ -2,7 +2,7 @@
  * @Author: lzhe lzhe@example.com
  * @Date: 2024-03-26 10:28:33
  * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-05-29 17:32:55
+ * @LastEditTime: 2024-05-30 18:17:23
  * @FilePath: /smart-web/src/views/master/person/main/index.vue
  * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
@@ -12,7 +12,16 @@
 			<div class="title">璁″垝鏄剧ず璁剧疆</div>
 			<div class="type">
 				<div class="item last" @click="openPlan">鏂板缓璁″垝绫诲瀷妯$増</div>
-				<div :class="{item:true, activeTab:index == 0?true:false}" v-for="(item,index) in planData">{{item.templateName}}<span>...</span></div>
+				<div :class="{item:true, activeTab: item.active}" v-for="(item,index) in planData" @click="changePlanData(item,index)">
+					<span style="margin-right: 12px;cursor: pointer;">{{item.templateName}}</span>
+					<el-popover placement="right-start" :width="30" trigger="click" :hide-after="0" :show-after="0">
+						<template #reference>...</template>
+						<template #default>
+							<span class="popvoer-title" @click="table_edit(item,index)">缂栬緫</span>
+							<span  class="popvoer-title" style="margin-left: 12px" v-if="index != 0" @click="del_tab(item)">鍒犻櫎</span>
+						</template>
+					</el-popover>
+				</div>
 			</div>
 		</div>
 	    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
@@ -69,6 +78,7 @@
 		name: "custom",
 		data(){
 			return {
+				id: "",
 				dialog: {
 					save: false
 				},
@@ -101,14 +111,38 @@
 				this.$HTTP.get(`/api/blade-system/custom-template/list?businessType=${this.$route.query.type}`).then(res=> {
 					if(res.code == 200) {
 						this.planData = res.data.reverse();
+						this.id = this.planData[0].id;
+						this.planData[0].active = true;
 						this.getTableList();
 					}
 				})
 			},
+			changePlanData(row,index) {
+				this.id = row.id;
+				this.planData.forEach(item=> {
+					item.active = false;
+				})
+				this.planData[index].active = true;
+				this.getTableList();
+			},
 			getTableList() {
-				this.$HTTP.get(`/api/blade-system/custom-template-field/listField?configType=1&templateId=${this.planData[0].id}`).then(res=> {
+				this.$HTTP.get(`/api/blade-system/custom-template-field/listField?configType=1&templateId=${this.id}`).then(res=> {
 					if(res.code == 200) {
 						this.tableData0 = res.data.systemFieldList;
+					}
+				})
+			},
+			table_edit(row) {
+				this.dialog.save = true
+				this.$nextTick(() => {
+					this.$refs.saveDialog.open(this.productList,this.planData,'edit').setData(row);
+				})
+			},
+			del_tab(row) {
+				this.$HTTP.delete(`/api/blade-system/custom-template/remove`,[row.id]).then(res=> {
+					if(res.code == 200) {
+						this.$message.success("鎿嶄綔鎴愬姛");
+						this.getBaseData();
 					}
 				})
 			},
@@ -183,4 +217,7 @@
     color: #000;
     margin: 14px 0;
 }
+.popvoer-title {
+	cursor: pointer;
+} 
 </style>

--
Gitblit v1.9.3