wangting
2024-04-24 ad34a291db00bc4df1620b82221b7dcb22328f57
Source/ProjectWeb/src/components/PLT-basic-component/BasicForm.vue
@@ -22,6 +22,7 @@
import vciWebRefer from "@/components/refer/vciWebRefer.vue";
import { formatMilliseconds } from "@/util/formatTime";
import { validatenull } from "@/util/validate";
import { getDicts } from "@/api/system/dict";
export default {
  name: "basicForm",
@@ -74,6 +75,7 @@
        datetime: "datetime",
        date: "date",
        refer: "refer",
        multiFile:"upload"
      }
    };
  },
@@ -148,14 +150,15 @@
      this.option.group = group;
    },
    initItem(item){
      const type=this.columnType[this.type] || this.type
      const type=this.columnType[item.type] || item.type
      const col= {
        ...item,
        label: item.text,
        prop: item.field,
        showProp:item.showField,
        type: type,
        labelWidth: this.labelWidth || (item.text.length >= 6 ? 115 : 90),
        disabled: item.disabled || this.disabled,
        disabled: item.readOnly || this.disabled,
        span: item.span
          ? item.span
          : item.type === "textarea"
@@ -174,16 +177,20 @@
          trigger: "blur"
        }]
      }
      if (col.propType === "dict") {
      if (col.type === "select") {
        if(!validatenull(col.dictCode)) {
          /*this.getDicts(col.dictCode).then((res) => {
            if (res.success) {
              const dic = res.obj.data;
          /*getDicts(col.dictCode).then((res) => {
            if (res.data.success){
              if(res.data.data && res.data.obj == null){
                res.data.obj = res.data.data
              }
              const dic = res.data.obj;
              col.dicData = dic.map((d) => {
                return {
                  label: d.name,
                  key: d.code,
                  value: d.code,
                  label: d.value,
                  key: d.key,
                  value: d.key,
                  attributes:d.attributes
                };
              });
            }