123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- /*
- * @Descripttion:
- * @Author: kcz
- * @Date: 2021-05-02 16:04:02
- * @LastEditors: kcz
- * @LastEditTime: 2021-05-21 13:55:46
- */
- // 引入@babel/polyfill处理兼容
- import "@babel/polyfill";
- import Vue from "vue";
- import App from "./App.vue";
- import router from "./router/";
- import KFormDesign from "../packages/index";
- import Cmp from "./components/CustomComponent/index.vue";
- // const Cmp = {
- // name: "cmp",
- // render: function(h) {
- // return h("div", "我是自定义组件");
- // }
- // };
- KFormDesign.setFormDesignConfig({
- title: "数据字段",
- list: [
- {
- type: "input", // 表单类型
- label: "自定义组件", // 标题文字
- icon: "icon-gallery",
- component: Cmp,
- options: {
- type:'CustomComponents',
- defaultValue: undefined,
- multiple: false,
- disabled: false,
- width: "100%",
- clearable: true,
- placeholder: "请选择",
- showSearch: false
- },
- model: "",
- key: "",
- rules: [
- {
- required: false,
- 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: "",
- uploadFileName: "",
- uploadImageName: "",
- uploadFileData: { data: 1545 },
- uploadImageData: { data: 1545 },
- uploadFileHeaders: { data: 1545 },
- uploadImageHeaders: { data: 1545 }
- });
- Vue.use(KFormDesign);
- // KFormDesign.setFormBuildConfig({
- // dynamicData: {
- // test: [
- // { label: "test", value: "1" },
- // { label: "test1", value: "2" }
- // ]
- // }
- // });
- Vue.config.productionTip = false;
- new Vue({
- router,
- render: h => h(App)
- }).$mount("#app");
|