From e1b028d486713eaf55aaf35fbf334aa568059c0d Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期二, 14 四月 2026 15:46:54 +0800
Subject: [PATCH] 项目复制

---
 src/views/components/OccupationJobLevel.vue |   89 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 89 insertions(+), 0 deletions(-)

diff --git a/src/views/components/OccupationJobLevel.vue b/src/views/components/OccupationJobLevel.vue
new file mode 100644
index 0000000..cafc089
--- /dev/null
+++ b/src/views/components/OccupationJobLevel.vue
@@ -0,0 +1,89 @@
+<template>
+  <el-select 
+    v-model="occupationJobId" 
+    filterable 
+    style="flex: 1" 
+    class="pr-2" 
+    placeholder="鍏ㄩ儴鑱屼笟锛堝伐绉嶏級"
+    @change="changeOccupation()"
+  >
+    <el-option
+      v-for="(item,index) in newOccupationItems"
+      :key="`occupation${index}`"
+      :label="item.occupationJob"
+      :value="item.id"
+    />
+  </el-select>
+  <el-select
+    v-model="level" 
+    :disabled="!occupationJobId" 
+    style="flex: 1" class="pr-2" 
+    placeholder="鍏ㄩ儴绛夌骇"
+    multiple
+  >
+    <el-option
+      v-for="(item,index) in levelItems"
+      :key="`level${index}`"
+      :label="item.label"
+      :value="item.value"
+    />
+  </el-select>
+</template>
+
+<script>
+import { useOptionItemsStore } from '@/stores/optionItems.js'
+
+export default {
+  setup() {
+    const { occupationItems } = useOptionItemsStore()
+    return { occupationItems }
+  },
+  data() {
+    return {
+      occupationJobId: '',
+      level: [],
+      levelItems: []
+    }
+  },
+  props: {
+    modelValue: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    },
+  },
+  computed: {
+    newOccupationItems() {
+      return [{ occupationJob: '鍏ㄩ儴鑱屼笟锛堝伐绉嶏級', id: '' }, ...this.occupationItems]
+    }
+  },
+  watch: {
+    occupationJobId: function() {
+      this.$emit('update:modelValue', {...this.modelValue, occupationJobId: this.occupationJobId})
+    },
+    level: function() {
+      this.$emit('update:modelValue', {...this.modelValue, level: this.level } )
+    }
+  },
+  methods: {
+    changeOccupation() {
+      this.level = []
+      const id = this.occupationJobId
+      if (id) {
+        let list = []
+        const obj = this.occupationItems.find(ele => ele.id == id)
+        let levelStr = obj.levelStr
+        levelStr?.split(',').forEach(ele => {
+          list.push({
+            label: this.$getLevelName(ele),
+            value: ele
+          })
+        })
+        this.levelItems = list
+      }
+    }
+  }
+}
+
+</script>
\ No newline at end of file

--
Gitblit v1.8.0