/** 表单和组件的配置类 * @author zhusy * @date 2021/2/2 */ import _ from 'lodash' /* * 当前选中的field * */ export const curItem = { item:{} } export const formConfig = { label_alignment:"flex-end", //标签对齐方式 left:左对齐,right:右对齐,center:中间对齐,top:顶部对齐 label_width:6, //标签字段宽度 默认人为6rem 最大是10rem 最小是1rem label_prefix:"",//标签前缀 label_suffix:"",//标签后缀 form_width:100,//表单宽度百分比 } export const commonConfig = { show_title:true, //是否显示标题 content_width:100,//内容宽度 label_alignment:"flex-end",//标题布局 label_width:6,//标题宽度 label_prefix:"",//标题前缀 label_suffix:"",//标题后缀 is_must:false,//是否必填 is_read_only:false,//只读 is_disabled:false,//禁用 is_hidden:false//隐藏 } export const defaultDic = [{dic_code:"item1",dic_value:"选项一"},{dic_code:"item2",dic_value:"选项二"},{dic_code:"item3",dic_value:"选项三"}] /* * 基本字段 * */ export const baseFields = [ { field_type: 20, field_name: '文本标签',tag:"label",el:"Label.vue",attributeUrl:"LabelAttribute.vue", props:{value:"文本标签",label_width:0,content_width:100,text_alignment:"center",is_read_only:false,is_disabled:false,is_hidden:false,can_search:false, label_prefix:"",label_suffix:"",label_alignment:"flex-end"}}, { field_type: 1, field_name: '单行文本',tag:"input",el:"Input.vue",attributeUrl:"InputAreaAttribute.vue", props:{placeholder:"请输入",value:"",can_search:true,is_search:true,field_input_type:1,filed_auto_input_info:"",max_length:50, data_source_form_id:undefined,data_source_field_id:undefined,compare_standard:undefined}}, { field_type: 2, field_name: '多行文本',tag:"area",el:"TextArea.vue",attributeUrl:"InputAreaAttribute.vue", props:{placeholder:"请输入",value:"",can_search:true,is_search:true,max_length:200}}, { field_type: 3, field_name: '单选框组',tag:"radio",el:"Radio.vue",attributeUrl:"RadioAttribute.vue",data_resource:2,data_resource_info:JSON.stringify(_.cloneDeep(defaultDic)), props:{max_length:50,can_search:true,is_search:true,value:"",datas:_.cloneDeep(defaultDic),show_item_label:true}}, { field_type: 4, field_name: '多选框组',tag:"check",el:"Checkbox.vue",attributeUrl:"RadioAttribute.vue",data_resource:2,data_resource_info:JSON.stringify(_.cloneDeep(defaultDic)), props:{max_length:"text",can_search:true,is_search:true,value:[],datas:_.cloneDeep(defaultDic),show_item_label:true,}}, { field_type: 5, field_name: '日期/时间',tag:"datetime",el:"DatePicker.vue",attributeUrl:"DateTimeAttribute.vue", props:{max_length:50,can_search:true,is_search:true,showType:"date",value:undefined,placeholder:"",format:"YYYY-MM-DD"}}, { field_type: 6, field_name: '下拉选择',tag:"drop",el:"DropDown.vue",attributeUrl:"DropDownAttribute.vue",data_resource:2,data_resource_info:JSON.stringify(_.cloneDeep(defaultDic)), props:{max_length:50,can_search:true,is_search:true,mode:"default",placeholder:"请选择",value:undefined,allowClear:true,showSearch:false,datas:_.cloneDeep(defaultDic),}}, { field_type: 12, field_name: '计数器',tag:"count",el:"NumberCount.vue",attributeUrl:"NumberCountAttribute", props:{max_length:50,can_search:true,is_search:true,value:null,min:null,max:null,step:1}}, { field_type: 13, field_name: '评价',tag:"evaluate",el:"Rate.vue",attributeUrl:"RateAttribute", props:{max_length:50,can_search:true,is_search:true,count:5,value:undefined,allowHalf:true}}, { field_type: 14, field_name: '滑块',tag:"slider",el:"Slider.vue",attributeUrl:"SliderAttribute", props:{max_length:50,can_search:true,is_search:true,value:undefined,showInput:false,max:100,min:0,step:1}} ] export const advancedFields = [ { field_type: 8, field_name: '头像(照片)',tag:"portrait",showTitle:true,content_width:100,props:{max_length:"text"}}, { field_type: 9, field_name: '图片上传',tag:"img",el:"FileUpload.vue",attributeUrl:"FileUploadAttribute", props:{value:[],max_length:"text",can_search:false,is_search:false,type:2,title:'上传图片',option:{no_user:""},can_downLoad:true,multiple:true,is_certificate:false,can_delete:true}}, { field_type: 10, field_name: '附件上传',tag:"enclosure",el:"FileUpload.vue",attributeUrl:"FileUploadAttribute", props:{value:[],max_length:"text",can_search:false,is_search:false,type:1,title:'附件上传',option:{no_user:""},can_downLoad:true,multiple:true,typeFilter:"",can_delete:true}}, { field_type: 11, field_name: '富文本编辑器',tag:"rich",el:"RichEditorDom.vue",attributeUrl:"RichEditorDomAttribute", props:{max_length:"text",height:300,placeholder:"请输入内容",value:"",editorId:""}}, { field_type: 15, field_name: '地区选择',tag:"region",el:"RegionalChoice.vue",attributeUrl:"RegionalChoiceAttribute", props:{max_length:50,can_search:true,is_search:true,placeholder:"请选择",value:[],data_range:3,default_value_name:""}}, //data_range是数据范围 1:省市区 2:省市 3:省 { field_type: 23, field_name: '子表单',tag:"son_form",el:"SonForm.vue",attributeUrl:"SonFormAttribute", props:{defaultLineCount:0,data:[],add:true,son_label_alignment:"center",showLineNum:true,multiple:true,value:[]}} ] export const businessFields = [ /* { field_type: 16, field_name: '机构选择',tag:"org_select",el:"OrganizationSelection.vue",attributeUrl:"OrganizationAttribute", props:{max_length:"text",can_search:true,is_search:true}},*/ { field_type: 17, field_name: '部门选择',tag:"dept_select",el:"DepartmentSelection.vue",attributeUrl:"PersonnelAttribute", props:{max_length:"text",can_search:true,is_search:true,value:[],is_multiple_choice:true,placeholder:"请选择部门"}}, { field_type: 18, field_name: '人员选择',tag:"person_select",el:"PersonnelSelection.vue",attributeUrl:"PersonnelAttribute", props:{max_length:"text",can_search:true,is_search:true,value:[],is_multiple_choice:true,placeholder:"请选择人员"}}, { field_type: 25, field_name: '学段学科',tag:"stage_subject",el:"StageAndSubjectSelection.vue",attributeUrl:"StageAndSubjectAttribute", props:{max_length:50,can_search:true,is_search:true,placeholder:"请选择",value:[],default_value_name:"",data_range:2}}, { field_type: 26, field_name: '专业',tag:"major",el:"MajorSelection.vue",attributeUrl:"MajorAttribute", props:{max_length:50,can_search:true,is_search:true,placeholder:"请选择",value:[],default_value_name:""}}, { field_type:27, field_name: '关联其它表单',tag:"associate",el:"Input.vue",attributeUrl:"InputAreaAttribute.vue", props:{placeholder:"",value:"",can_search:false,is_search:false,max_length:50, data_source_form_id:undefined,data_source_field_id:undefined,compare_standard:undefined}}, ] export const layoutFields = [ { field_type: 24, field_name: '栅格',tag:"grid",content_width:100,el:"FieldRowItem.vue",attributeUrl:"FieldRowItemAttribute", props:{type:"flex",align:"top",justify:"start",gutter:[0,0],cols:[]}}, { field_type: 21, field_name: '表格',tag:"table",content_width:100}, { field_type: 22, field_name: '分隔线/符',tag:"divider",el:"Divider.vue",attributeUrl:"DividerAttribute", props:{value:"",can_search:false,is_search:false,dashed:false,orientation:"center",type:1,marginTop:8,marginBottom:8,height:40}} ]