Browse Source

新增控件“当前用户”,“当前部门”

jbb 2 years ago
parent
commit
760610b57d
1 changed files with 58 additions and 3 deletions
  1. 58 3
      examples/main.js

+ 58 - 3
examples/main.js

@@ -21,14 +21,15 @@ import Cmp from "./components/CustomComponent/index.vue";
 //   }
 // };
 KFormDesign.setFormDesignConfig({
-  title: "测试自定义字段",
+  title: "数据字段",
   list: [
     {
-      type: "demo", // 表单类型
+      type: "input", // 表单类型
       label: "自定义组件", // 标题文字
       icon: "icon-gallery",
       component: Cmp,
       options: {
+        type:'CustomComponents',
         defaultValue: undefined,
         multiple: false,
         disabled: false,
@@ -45,7 +46,61 @@ KFormDesign.setFormDesignConfig({
           message: "必填项"
         }
       ]
-    }
+    },
+    {
+      type: "input", // 表单类型
+      label: "当前用户", // 标题文字
+      icon: "icon-write",
+      options: {
+        type: "CurrentUser",
+        width: "100%", // 宽度
+        defaultValue: "", // 默认值
+        placeholder: "请输入", // 没有输入时,提示文字
+        clearable: false,
+        maxLength: null,
+        addonBefore: "",
+        addonAfter: "",
+        hidden: false, // 是否隐藏,false显示,true隐藏
+        disabled: true // 是否禁用,false不禁用,true禁用
+      },
+      model: "", // 数据字段
+      key: "",
+      help: "",
+      rules: [
+        //验证规则
+        {
+          required: false, // 必须填写
+          message: "必填项"
+        }
+      ]
+    },
+    {
+      type: "input", // 表单类型
+      label: "当前部门", // 标题文字
+      icon: "icon-write",
+      options: {
+        type: "CurrentDepartment",
+        width: "100%", // 宽度
+        defaultValue: "", // 默认值
+        placeholder: "请输入", // 没有输入时,提示文字
+        clearable: false,
+        maxLength: null,
+        addonBefore: "",
+        addonAfter: "",
+        hidden: false, // 是否隐藏,false显示,true隐藏
+        disabled: true // 是否禁用,false不禁用,true禁用
+      },
+      model: "", // 数据字段
+      key: "",
+      help: "",
+      rules: [
+        //验证规则
+        {
+          required: false, // 必须填写
+          message: "必填项"
+        }
+      ]
+    },
   ],
   uploadFile: "",
   uploadImage: "",