From 81bb7fc2ad7dcb015844ab5defb0b8a11d34d83a Mon Sep 17 00:00:00 2001
From: wjt <1797368093@qq.com>
Date: 星期三, 19 六月 2024 16:06:04 +0800
Subject: [PATCH] 修改企业管理

---
 src/views/infomanger/banner/index.vue |   30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/views/infomanger/banner/index.vue b/src/views/infomanger/banner/index.vue
index f44a038..65f8afc 100644
--- a/src/views/infomanger/banner/index.vue
+++ b/src/views/infomanger/banner/index.vue
@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <div class="form-content">
-      <el-form inline :model="form.questionList" label-width="75px" :rules="rules">
+      <el-form inline :model="form.questionList" ref="formRef" label-width="75px" :rules="rules">
         <div
           class="border"
           v-for="(item, index) in form.questionList"
@@ -11,7 +11,9 @@
             璇勪环椤箋{ index + 1 }}
           </div> -->
           <div class="close-icon" @click="removeList(index)">
-            <el-icon><Close /></el-icon>
+            <el-tooltip content="绉婚櫎璇勪环椤�">
+              <el-icon><Close color="red"/></el-icon>
+            </el-tooltip>
           </div>
           <el-row>
             <el-col :span="12">
@@ -81,7 +83,7 @@
       </el-form>
       <div class="center mt20 fixed">
         <el-button type="primary" @click="addContent">娣诲姞璇勪环椤�</el-button>
-        <el-button @click="save" type="primary" >淇濆瓨鍐呭</el-button>
+        <el-button @click="save()" type="primary" >淇濆瓨鍐呭</el-button>
       </div>
     </div>
   </div>
@@ -92,15 +94,16 @@
 import { ElMessage, ElMessageBox} from 'element-plus'
 const tableData = ref([])
 const addNewRef = ref()
+const formRef = ref()
 const form: any = ref({
   questionList: []
 })
 const rules = ref({
   questionName: [
     {
-      required: true,
-      message: '璇疯緭鍏ラ棶棰�',
-      trigger: 'blur'
+        required: true,
+        message: '璇疯緭鍏ラ棶棰�',
+        trigger: 'blur'
     }
   ]
 })
@@ -117,7 +120,7 @@
     answerList: []
   })
 }
-function addOptions(index: number, name){
+function addOptions(index: number, name: any){
   if(!form.value.questionList[index].answerList) {
     form.value.questionList[index].answerList = []
   }
@@ -125,10 +128,16 @@
     questionName: name
   })
 }
-function save() {
-  saveEvaluate({questionList: form.value.questionList}).then(val => {
-    ElMessage.success('淇濆瓨鎴愬姛')
+function save(item?: string) {
+  formRef.value.validate((valid) => {
+    console.log(valid)
+    if(valid) {
+      // saveEvaluate({questionList: form.value.questionList}).then(val => {
+      //   ElMessage.success(item||'淇濆瓨鎴愬姛')
+      // })
+    }
   })
+
 }
 function changeValue(event, index, childIndex) {
   // form.value.questionList[index].isScore = event.target.
@@ -144,6 +153,7 @@
       type: 'danger',
     }).then(val => {
       form.value.questionList.splice(index, 1)
+      save('鍒犻櫎鎴愬姛')
     })
  
 }

--
Gitblit v1.9.1