<!--
@ 作者: 秦东
@ 时间: 2024-12-03 14:29:45
@ 备注: 树型组件
-->
<script lang="ts" setup>
import { stringToObj } from "@/utils/DesignForm/form";
const props = withDefaults(
  defineProps<{
    modelValue?: string;
    disabled?: boolean;
    action?: string;
    name?: string;
    fileList?: Object;
    control?: Object;
    config?: Object;
    data?: Object;
    options?: Object;
    isEdit?: boolean;
  }>(),
  {}
);
const emits = defineEmits<{
  (e: "update:modelValue", value: string): void;
}>();
const value = computed({
  get: () => {
    console.log("图片上传处理-112->", props.modelValue, stringToObj(props.modelValue));
    return stringToObj(props.modelValue);
  },
  set: (newVal: any) => {
    emits("update:modelValue", newVal);
    return newVal;
  },
});
const handleChange = () => {};
const cascaderProps = {
  label: "label",
  value: "value",
  children: "children",
};
</script>
<template>
  <el-tree-select
    v-model="value"
    :data="props.data"
    clearable
    :render-after-expand="false"
    :disabled="props.isEdit"
  />
</template>
<style lang="scss" scoped></style>
