From c7bd6db3190ff5c4b55d004db0b9fa944604925f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 18 十月 2024 11:09:15 +0800
Subject: [PATCH] Merge branch 'lsf-topTask'

---
 src/components/search-option/FYOptionUserType.vue |   48 ++++++++++++++++--------------------------------
 1 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/src/components/search-option/FYOptionUserType.vue b/src/components/search-option/FYOptionUserType.vue
index f127187..050f772 100644
--- a/src/components/search-option/FYOptionUserType.vue
+++ b/src/components/search-option/FYOptionUserType.vue
@@ -1,16 +1,12 @@
 <template>
   <el-form-item label="鐢ㄦ埛绫诲瀷" :prop="prop">
     <el-select
-      v-model="selectedOptions"
+      :model-value="value"
+      @change="handleChange"
       placeholder="鐢ㄦ埛绫诲瀷"
       style="width: 150px"
     >
-      <el-option
-        v-for="s in userTypes"
-        :key="s.value"
-        :label="s.label"
-        :value="s"
-      />
+      <el-option v-for="s in userTypes" :key="s.value" :label="s.label" :value="s" />
     </el-select>
   </el-form-item>
 </template>
@@ -23,47 +19,35 @@
     // 鏄惁鍦ㄩ閫夐」澶勬坊鍔犫�滃叏閮ㄢ�濋�夐」
     allOption: {
       type: Boolean,
-      default: true,
+      default: true
     },
     // 杩斿洖缁撴灉
     value: Object,
     // 鏄惁榛樿杩斿洖鍒濆閫夐」
     initValue: {
       type: Boolean,
-      default: true,
+      default: true
     },
-    prop: String
+    prop: {
+      type: String,
+      default: '_usertype'
+    }
   },
   emits: ['update:value'],
   data() {
     return {
-      userTypes: enumUser(this.allOption),
-      selectedOptions: {},
+      userTypes: enumUser(this.allOption)
     };
   },
-  watch: {
-    selectedOptions: {
-      handler(nVal, oVal) {
-        if (nVal != oVal) {
-          this.$emit('update:value', nVal);
-        }
-      },
-      deep: true,
-    },
-    value: {
-      handler(nVal, oVal) {
-        if (nVal != oVal) {
-          this.selectedOptions = nVal;
-        }
-      },
-      deep: true,
-      immediate: true
-    },
+  methods: {
+    handleChange(value) {
+      this.$emit('update:value', value);
+    }
   },
   mounted() {
     if (this.initValue) {
-      this.selectedOptions = this.userTypes[0];
+      this.handleChange(this.userTypes[0]);
     }
-  },
+  }
 };
 </script>

--
Gitblit v1.9.3