Pārlūkot izejas kodu

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 11 mēneši atpakaļ
vecāks
revīzija
a4899a209e

+ 13 - 3
src/components/FormUI/TextInput/index.vue

@@ -7,15 +7,15 @@
       :type="item.type"
       :rules="item.rules"
       :disabled="item.disabled"
-      :dense="item.dense"
       :style="{width: item.width}"
-      color="primary"
+      :color="item.color || 'primary'"
       :label="item.label"
       :placeholder="item.placeholder || item.label"
       :autofocus="item.autofocus"
       :required="item.required"
       :class="item.class"
       :suffix="item.suffix"
+      :append-icon="item.appendIcon"
       :append-inner-icon="item.appendInnerIcon"
       :clearable="item.clearable"
       :readonly="item.readonly"
@@ -25,6 +25,8 @@
       :hide-details="item.hideDetails || false"
       @wheel="$event => handleWheel($event, item)"
       @update:modelValue="modelValueUpDate"
+      @click:append="appendClick"
+      @click:append-inner="appendInnerClick"
     ></v-text-field>
   </div>
 </template>
@@ -33,7 +35,7 @@ import { defineEmits, ref, watch } from 'vue';
 defineOptions({ name:'FormUI-v-text-field'})
 
 const props = defineProps({item: Object, modelValue: [String, Number]})
-const emit = defineEmits(['update:modelValue', 'change'])
+const emit = defineEmits(['update:modelValue', 'change', 'appendClick', 'appendInnerClick'])
 const item = props.item
 const value = ref(props.modelValue)
 
@@ -45,6 +47,14 @@ const modelValueUpDate = (val) => {
   emit('update:modelValue', value.value)
   emit('change', value.value)
 }
+const appendClick = () => {
+  if (item.appendClick) item.appendClick()
+  emit('appendClick', value.value)
+}
+const appendInnerClick = () => {
+  if (item.appendInnerClick) item.appendInnerClick()
+  emit('appendInnerClick', value.value)
+}
 
 const handleWheel = (event, item) => {
   if (item.type !== 'number') return

+ 26 - 3
src/views/enterprise/systemManagement/informationSettingsComponents/welfareLabel.vue

@@ -5,18 +5,24 @@
   <div class="mb-15">
     <v-chip
       v-for="(item, index) in chosenChipList" :key="index"
-      class="mx-2 mt-4"
+      class="chip mx-2 mt-4"
       label closable color="primary"
     >{{ item.name }}</v-chip>
     <div>
-      <v-chip class="mx-2 mt-4" label color="orange"><v-icon icon="mdi-plus" start></v-icon>自定义标签</v-chip>
+      <div v-if="customTag" class="d-flex align-center mx-2 mt-4">
+        <TextUI class="mr-2" :item="textItem"></TextUI>
+        <!-- <v-btn prepend-icon="mdi-content-save-outline" color="warning" variant="tonal" @click="appendInnerClick">{{ $t('common.save') }}</v-btn> -->
+      </div>
+      <div v-else @click="customTag = true">
+        <v-chip class="chip mx-2 mt-4" label color="orange"><v-icon icon="mdi-plus" start></v-icon>自定义标签</v-chip>
+      </div>
     </div>
   </div>
   <span style="font-size: 16px;">推荐标签</span>
   <div>
     <v-chip
       v-for="(item, index) in chipList" :key="index"
-      class="mx-2 mt-4"
+      class="chip mx-2 mt-4"
       label color="primary"
       :disabled="chosenChipIds.includes(item.name)"
     >
@@ -27,8 +33,22 @@
 </template>
 
 <script setup>
+import TextUI from '@/components/FormUI/TextInput'
 import { ref } from 'vue';
 defineOptions({name: 'informationSettingsComponents-welfareLabel'})
+const customTag = ref(false)
+const appendInnerClick = () => {
+  customTag.value = false
+}
+const textItem = ref({
+  type: 'text',
+  width: 250,
+  hideDetails: true,
+  value: '',
+  label: '请输入自定义标签',
+  appendInnerIcon: 'mdi-content-save-outline',
+  appendInnerClick: appendInnerClick,
+})
 let chosenChipIds = ref([])
 const chosenChipList = ref([
   { name: '五险一金' },
@@ -74,4 +94,7 @@ const chipList = ref([
 ])
 </script>
 <style lang="scss" scoped>
+.chip {
+  cursor: pointer;
+}
 </style>