wujingjing
2025-01-19 1113ced19c32c1b9b65571c48491d9435dbaf085
src/components/chat/chatComponents/summaryCom/components/recordSetTable/components/StringInput.vue
@@ -1,24 +1,38 @@
<template>
    <div class="flex-items-center">
        <span class="flex-0 mr-2" v-if="data?.title">{{ data?.title }}</span>
        <el-input v-model="modelValue" @input="stringInputInput"></el-input>
    </div>
   <div class="flex-items-center">
      <span class="flex-0 mr-2" v-if="data?.title">{{ data?.title }}</span>
      <el-input v-if="!isSelect" :disabled="disabled" v-model="modelValue" @input="stringInputInput" clearable></el-input>
      <el-select class="w-[268px]"  v-else :disabled="disabled" v-model="modelValue" @change="stringInputInput" filterable multiple clearable collapse-tags collapse-tags-tooltip>
         <el-option v-for="item in data?.origin?.value_list" :key="item" :value="item" :label="item"></el-option>
      </el-select>
   </div>
</template>
<script setup lang="ts">
import { computed } from 'vue';
defineOptions({
    inheritAttrs:true
})
   inheritAttrs: true,
});
const emit = defineEmits(['change'])
const props = defineProps(['data'])
const modelValue = defineModel({
    type:String,
    default:''
})
const emit = defineEmits(['change']);
const props = defineProps(['data', 'disabled']);
const isSelect = computed(() => {
   return props.data?.origin?.value_list?.length > 0;
});
const modelValue = defineModel();
const stringInputInput = (val) => {
    emit('change',val)
   let finalValue;
   if (!val) {
      finalValue = '';
   } else {
      finalValue = val.join(',');
   }
   emit('change', finalValue);
};
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
:deep(.el-select__tags-text){
   // max-width: 82px !important;
}
</style>