<template>
	<el-form ref="form" :model="form" label-width="0px">
		<el-row :gutter="15">
			<el-col :span="item.span || 24" v-if="!hideHandle(item)" :style="getActiveWidthAndHorizontal(item, 1)">
				<sc-title  v-if="item.name=='title'"  :title="item.label"></sc-title>
				<el-form-item v-else :prop="item.field" :rules="rulesHandle(item)" :style="getActiveWidthAndHorizontal(item, 0)">
					<!-- input -->
					<template v-if="item.name=='input'" >
						<el-input v-model="form[item.id]" :input-style="getActiveModuleStyle(item)" clearable :maxlength="item.maxlength" show-word-limit>
							<template #suffix>
								<el-icon class="el-input__icon" v-if="showFeatureTag(item, 'SpeechInput')"><sc-icon-voice /></el-icon>
								<el-icon class="el-input__icon" v-if="showFeatureTag(item, 'MeasuringResult')"><sc-icon-ruler /></el-icon>
							</template>
						</el-input>
					</template>
					<!-- textarea -->
					<template v-else-if="item.name=='textarea'">
						<el-input type="textarea" v-model="form[item.id]" suffix-icon="el-icon-date" :rows="item.result.pattern.rows" :input-style="getActiveModuleStyle(item)" clearable ></el-input>
						<span class="el-input__suffix" style="top:45%;">
							<span class="el-input__suffix-inner">
								<el-icon class="el-input__icon" v-if="showFeatureTag(item, 'SpeechInput')"><sc-icon-voice /></el-icon>
								<el-icon class="el-input__icon" v-if="showFeatureTag(item, 'MeasuringResult')"><sc-icon-ruler /></el-icon>
							</span>
						</span>
					</template>
					<!-- label -->
					<template v-else-if="item.name=='label' || item.name === 'pageNumber'">
						<div v-text="$t(item.result.property.placeholder)" contenteditable="true" :style="getActiveModuleStyle(item)"></div>
					</template>
					<!-- radio -->
					<template v-else-if="item.name=='radio'" >
						<!-- 设置横向排列和纵向排列 -->
						<el-radio-group v-model="form[item.id]" :style="setArrangementStyle(item)">
							<el-radio v-for="_item in setOptionsData(item)" :style="getActiveModuleStyle(item)" :key="_item" :label="$t(_item)">{{$t(_item)}}</el-radio>
						</el-radio-group>
					</template>
					<!-- checkbox -->
					<template v-else-if="item.name=='checkbox'" >
						<!-- 设置横向排列和纵向排列 -->
						<!-- <div :style="setArrangementStyle(item)"> -->
						<el-checkbox-group v-model="form[item.id]" :style="setArrangementStyle(item)">
							<el-checkbox :label="$t(_item)" :style="getActiveModuleStyle(item)" v-for="(_item, _index) in setOptionsData(item)" :key="_index"></el-checkbox>
						</el-checkbox-group>
						<!-- </div> -->
						<!-- <template v-if="item.name" >
							<el-checkbox v-model="form[item.name][_item.name]" :label="_item.label"  v-for="(_item, _index) in item.options.items" :key="_index"></el-checkbox>
						</template>
						<template v-else >
							<el-checkbox v-model="form[_item.name]" :label="_item.label"  v-for="(_item, _index) in item.options.items" :key="_index"></el-checkbox>
						</template> -->
					</template>
					<!-- checkboxGroup -->
					<template v-else-if="item.name=='checkboxGroup'" >
						<el-checkbox-group v-model="form[item.name]">
							<el-checkbox v-for="_item in item.options.items" :key="_item.value" :label="_item.value">{{_item.label}}</el-checkbox>
						</el-checkbox-group>
					</template>
					<!-- image -->
					<template v-else-if="item.name=='image'" >
						<el-image v-model="form[item.id]" :src="item.result.property.imageFile" :style="getActiveModuleStyle(item)" :fit="fit"/>
					</template>
					<!-- imageList -->
					<template v-else-if="item.name=='imageList'" >
						<div style="display:flex;justify-content:left;" >
							<el-image v-for="(_item, _index) in item.result.property.valueList" :key="_index" :src="_item" :style="getActiveModuleStyle(item)" />
						</div>
					</template>
					<!-- ultrasoundImage -->
					<template v-else-if="item.name=='ultrasoundImage'" >
						<el-image v-model="form[item.id]" :src="item.result.property.value" :style="getActiveModuleStyle(item)" />
					</template>
					<!-- divider -->
					<template v-else-if="item.name=='divider'" >
						<el-divider v-model="form[item.id]" :style="getActiveModuleStyle(item)"/>
					</template>
					<!-- space -->
					<template v-else-if="item.name=='space'" >
						<span :style="getActiveModuleStyle(item)"></span>
					</template>
					<!-- upload -->
					<template v-else-if="item.name=='upload'" >
						<el-col v-for="(_item, _index) in item.options.items" :key="_index">
							<el-form-item :prop="_item.name">
								<sc-upload v-model="form[_item.name]" :title="_item.label"></sc-upload>
							</el-form-item>
						</el-col>
					</template>
					<!-- switch -->
					<template v-else-if="item.name=='switch'" >
						<el-switch v-model="form[item.name]" />
					</template>
					<!-- select -->
					<template v-else-if="item.name=='select'" >
						<!-- <el-select v-model="form[item.name]" :multiple="item.options.multiple" :placeholder="item.options.placeholder" clearable filterable style="width: 100%;">
							<el-option v-for="option in item.options.items" :key="option.value" :label="option.label" :value="option.value"></el-option>
						</el-select> -->
						<el-select v-model="form[item.id]" :id="item.id" :style="getActiveModuleStyle(item)" suffix-icon="el-icon-date" clearable filterable>
							<el-option v-for="option in setOptionsData(item)" :key="option" :label="option" :value="option"></el-option>
						</el-select>
					</template>
					<!-- cascader -->
					<template v-else-if="item.name=='cascader'" >
						<el-cascader v-model="form[item.name]" :options="item.options.items" clearable></el-cascader>
					</template>
					<!-- date -->
					<template v-else-if="item.name=='datetime'" >
						<div v-text="item.result.property.placeholder" contenteditable="true" :style="getActiveModuleStyle(item)"></div>
					</template>
					<!-- number -->
					<!-- <template v-else-if="item.name=='number'" >
						<el-input-number v-model="form[item.name]" controls-position="right"></el-input-number>
					</template> -->
					<!-- color -->
					<template v-else-if="item.name=='color'" >
						<el-color-picker v-model="form[item.name]" />
					</template>
					<!-- rate -->
					<template v-else-if="item.name=='rate'" >
						<el-rate style="margin-top: 6px;" v-model="form[item.name]"></el-rate>
					</template>
					<!-- slider -->
					<template v-else-if="item.name=='slider'" >
						<el-slider v-model="form[item.name]" :marks="item.options.marks"></el-slider>
					</template>
					<!-- noComponent -->
					<template v-else>
						<el-tag name="danger">[{{item.name}}] Component not found</el-tag>
					</template>
					<div v-if="item.message" class="el-form-item-msg">{{item.message}}</div>
				</el-form-item>
			</el-col>
		</el-row>
	</el-form>
</template>

<script>
	import tool from '@/utils/tool';
	export default {
		props: {
			item: { type: Object, default: () => {} },
		},
		data() {
			return {
				form: {}
			}
		},
		watch:{
			item(){
				this.render()
			},
			// form:{
			// 	handler(val){
			// 		this.$emit("update:modelValue", val)
			// 	},
			// 	deep: true
			// }
		},
		computed: {
			hasItem(){
				return Object.keys(this.item).length>0
			},
		},
		mounted() {
			if(this.hasItem){
				this.render()
			}
		},
		methods: {
			//是否显示功能标签
			showFeatureTag(itemData, tagName) {
				if (itemData && itemData.result && itemData.result.property) 
				{
					var featureTag = itemData.result.property.featureTag;
					if (featureTag && featureTag.length > 0) 
					{
						var res = featureTag.some(c => {
							if (c === tagName)
							{
								return true;
							}
							return false;
						});
						return res;
					}
					else 
					{
						return false;
					}
				}
				return false;
			},
			//构建form对象
			render() {
				this.loadData(this.item);
			},
			//导入数据
			loadData(item) {
				if (item.name == 'input' || item.name == 'textarea' || item.name == 'select' || item.name == 'datetime') {
					this.form[this.item.id] = this.$t(item.result.property.placeholder);
				}
				else if (item.name === "divider") {
					this.form[this.item.id] = item.result.property.editable;
				}
				else if (item.name === "image") {
					this.form[this.item.id] = "";
				}
				else {
					if (item.result.property.value && item.result.property.value.length > 0) {
						this.form[this.item.id] = this.$t(item.result.property.value);
					}
					else {
						this.form[this.item.id] = item.result.property.value;
					}
				}
			},
			//设置当前组件宽度和水平位置
			getActiveWidthAndHorizontal(item, type) {
				if (type === 0) {//当前组件宽度
					var widthStyle = "width:100%;margin-bottom:0px;";
					return widthStyle;
				}
				else if (type === 1) {//当前组件水平位置
					var colStyle = "width:100%;padding-left: 5px;padding-right: 6px;";
					return colStyle;
				}
			},
			//设置排列方式样式
			setArrangementStyle(item) {
				var styleModel = {
				};
				if (item.name === "checkbox") {
					if (item.result.property.arrangement) {
						//纵向排列
						if (item.result) 
						{
							var tempList = this.setOptionsData(item);
							if (tempList && tempList.length > 1)
							{
								item.result.offsetHeight = 25 * tempList.length;
							}
							else
							{
								item.result.offsetHeight = 25;
							}
						}
					}
					else {
						//横向排列
						styleModel["display"] = "flex";
						if (item.result) 
						{
							item.result.offsetHeight = 25;
						}
					}
				}
				else if (item.name === "radio") {
					if (item.result.property.arrangement) {
						//横向排列
						styleModel["flex-wrap"] = "nowrap";
						if (item.result) 
						{
							item.result.offsetHeight = 25;
						}
					}
					else {
						styleModel["flex-wrap"] = "wrap";
						if (item.result) 
						{
							var tempRList = this.setOptionsData(item);
							if (tempRList && tempRList.length > 1)
							{
								item.result.offsetHeight = 25 * tempRList.length;
							}
							else
							{
								item.result.offsetHeight = 25;
							}
						}
					}
				}
				return styleModel;
			},
			//设置当前字体样式
			getActiveModuleStyle(item) {
				this.loadData(this.item);
				if (item.name === "input" || item.name == 'textarea' || item.name === "label" || item.name === "select" || item.name === "datetime"
					|| item.name === "checkbox" || item.name === "radio" || item.name === "pageNumber") {
					return this.setGeneralModuleStyle(item);
				}
				else if (item.name === "space") {
					var styleModel = {
						height: "35px",
					};
					if (item.result.pattern.width > 0 || item.result.pattern.width.length > 0) {
						styleModel["width"] = tool.mmToPx(item.result.pattern.width) + "px";
					}
					if (item.result)
					{
						item.result.offsetHeight = 20;
					}
					return styleModel;
				}
				else if (item.name === "divider") {
					return this.setDividerModuleStyle(item);
				}
				else if (item.name === "image" || item.name === "ultrasoundImage" || item.name === "imageList") {
					return this.setImageModuleStyle(item);
				}
			},
			//设置分割线样式
			setDividerModuleStyle(item) {
				var styleModel = {
					height: "2px",
					border: "none",
					margin: "5px"
				};
				var borderTop = "";
				if (item.result.pattern.borderWeight > 0 || item.result.pattern.borderWeight.length > 0) {
					borderTop += item.result.pattern.borderWeight + "px ";
				}
				else {
					borderTop += "1px ";
				}
				if (item.result.pattern.borderStyle.length > 0) {
					borderTop += item.result.pattern.borderStyle + " ";
				}
				else {
					borderTop += "solid ";
				}
				if (item.result.pattern.borderColor.length > 0) {
					borderTop += item.result.pattern.borderColor + " ";
				}
				else {
					borderTop += "#747474;";
				}
				styleModel["border-top"] = borderTop;
				if (item.result.pattern.borderWidth > 0 || item.result.pattern.borderWidth.length > 0) {
					styleModel["width"] = tool.mmToPx(item.result.pattern.borderWidth) + "px";
				}
				else {
					styleModel["width"] = "100%";
				}
				if (item.result)
				{
					item.result.offsetHeight = 12;
				}
				return styleModel;
			},
			//设置输入组件样式
			setGeneralModuleStyle(item) {
				var styleModel = {
					width: "100%",
					height: "auto"
				};
				var selectDom = null;
				//if (item.name === "select" || item.name === "datetime") {
				if (item.name === "select") {
					selectDom = document.getElementById(item.id);
					if (selectDom) {
						selectDom.style.width = styleModel["width"];
					}
				}
				if (item.name === "checkbox" || item.name === "radio") {
					//height:25px;display:block;
					styleModel["height"] = "25px";
					if (item.name === "checkbox") {
						styleModel["display"] = "block";
					}
				}
				if (item.result.pattern && item.result.pattern.fontColor && item.result.pattern.fontColor.length > 0) {
					styleModel["color"] = item.result.pattern.fontColor;
					if (selectDom) {
						selectDom.style.color = styleModel["color"];
					}
				}
				if (item.result.pattern.width > 0 || item.result.pattern.width.length > 0) {
					if (item.name === "input" || item.name === "select") {
						styleModel["max-width"] = tool.mmToPx(item.result.pattern.width - 1) + "px";
						if (selectDom) {
							selectDom.style.maxWidth = styleModel["max-width"];
						}
					}
					else if (item.name === "datetime")
					{
						var widthValue = 0;
						var displayFormat = item.result.property.displayFormat;
						if (displayFormat === "yyyy-MM-dd" || displayFormat === "yyyy/MM/dd" || displayFormat === "yyyy.MM.dd")
						{
							widthValue = 20;
						}
						else if (displayFormat === "yyyy年MM月dd日")
						{
							widthValue = 27;
						}
						else if (displayFormat === "yyyy-MM-dd hh:mm")
						{
							widthValue = 30;
						}
						else
						{
							widthValue = 37;
						}
						styleModel["max-width"] = tool.mmToPx(widthValue) + "px";
						if (selectDom) {
							selectDom.style.maxWidth = styleModel["max-width"];
						}
					}
					else if (item.name === "label") {
						if (parseInt(item.result.pattern.width) <= 0) {
							styleModel["min-width"] = "10px";
							if (selectDom) {
								selectDom.style.minWidth = styleModel["min-width"];
							}
						}
						else {
							styleModel["max-width"] = tool.mmToPx(item.result.pattern.width - 1) + "px";
							if (selectDom) {
								selectDom.style.maxWidth = styleModel["max-width"];
							}
						}
					}
					else {
						styleModel["max-width"] = tool.mmToPx(item.result.pattern.width) + "px";
						if (selectDom) {
							selectDom.style.maxWidth = styleModel["max-width"];
						}
					}
				}
				if (item.result.pattern.fontName.length > 0) {
					styleModel["font-family"] = item.result.pattern.fontName;
					if (selectDom) {
						selectDom.style.fontFamily = styleModel["font-family"];
					}
				}
				if (item.result.pattern.fontSize.length > 0 || item.result.pattern.fontSize > 0) {
					var upperFontSize = this.upperNextFontSize(item.result.pattern.fontSize);
					if (parseFloat(upperFontSize) >= 12)
					{
						styleModel["font-Size"] = upperFontSize + 'px';
					}
					else if (parseFloat(upperFontSize) === 10)
					{
						styleModel["font-Size"] = '12px';
						styleModel["-webkit-transform-origin-x"] = "0";
						styleModel["-webkit-transform"] = "scale(0.925)";
					}
					else if (parseFloat(upperFontSize) === 10.5)
					{
						styleModel["font-Size"] = '12px';
						styleModel["-webkit-transform-origin-x"] = "0";
						styleModel["-webkit-transform"] = "scale(0.95)";
					}
					else if (parseFloat(upperFontSize) === 11)
					{
						styleModel["font-Size"] = '12px';
						styleModel["-webkit-transform-origin-x"] = "0";
						styleModel["-webkit-transform"] = "scale(0.98)";
					}
					else 
					{
						styleModel["font-Size"] = '12px';
						styleModel["-webkit-transform-origin-x"] = "0";
						styleModel["-webkit-transform"] = "scale(0." + upperFontSize.toString().replace(".", "") + ")";
					}
					if (selectDom) {
						selectDom.style.fontSize = styleModel["font-Size"];
					}
					if (parseFloat(upperFontSize) > 32) {
						if (item.name === "label") {
							styleModel["line-height"] = upperFontSize + 'px';
							if (selectDom) {
								selectDom.style.lineHeight = styleModel["line-height"];
							}
						}
					}
					if (item.name === "checkbox" || item.name === "radio") {
						//其他地方已处理
					}
					else if (item.name === "label") {
						//其他地方已处理
						if (item.result.offsetHeight > 20)
						{
							//不处理
						}
						else
						{
							if (item.result) 
							{
								item.result["offsetHeight"] = this.setTextOffsetHeight(upperFontSize);
							}
						}
					}
					else if (item.name === "textarea") {
						if (item.result) 
						{
							item.result["offsetHeight"] = 95;
						}
					}
					else
					{
						if (item.result) 
						{
							if (item.result.pattern && upperFontSize)
							{
								item.result["offsetHeight"] = this.setTextOffsetHeight(upperFontSize);
							}
						}
					}
				}
				if (item.result["offsetHeight"] < 20)
				{
					item.result["offsetHeight"] = 20;
				}
				if (item.result.pattern.fontItalic) {
					styleModel["font-style"] = "italic";
					if (selectDom) {
						selectDom.style.fontStyle = styleModel["font-style"];
					}
				}
				if (item.result.pattern.fontUnderLine) {
					styleModel["text-decoration"] = "underline ";
					if (item.result.pattern.fontColor.length > 0) {
						styleModel["text-decoration"] += item.result.pattern.fontColor;
					}
					if (selectDom) {
						selectDom.style.textDecoration = styleModel["text-decoration"];
					}
				}
				if (item.result.pattern.horizontalAlignment.length > 0) {
					switch (item.result.pattern.horizontalAlignment) {
						case "Center":
							styleModel["text-align"] = "center";
							break;
						case "Right":
						case "Bothends":
							styleModel["text-align"] = "right";
							break;
						default:
							styleModel["text-align"] = "left";
							break;
					}
					if (selectDom) {
						selectDom.style.textAlign = styleModel["text-align"];
					}
				}
				if (item.result.pattern.verticalAlignment.length > 0) {
					switch (item.result.pattern.verticalAlignment) {
						case "Top":
							styleModel["vertical-align"] = "top";
							break;
						case "Bottom":
							styleModel["vertical-align"] = "bottom";
							break;
						default:
							styleModel["vertical-align"] = "middle";
							break;
					}
					if (selectDom) {
						selectDom.style.verticalAlign = styleModel["vertical-align"];
					}
				}
				if (item.result.pattern.fontWeight > 0) {
					styleModel["font-weight"] = item.result.pattern.fontWeight;
					if (selectDom) {
						selectDom.style.fontWeight = styleModel["font-weight"];
					}
				}
				return styleModel;
			},
			upperNextFontSize(fontSize)
			{
				var resValue = 0;
				switch(fontSize)
				{
					case 48:
					case "48":
						resValue = 56
						break;
					case "56":
					case 56:
						resValue = 72
						break;
					case "72":
					case 72:
						resValue = 90
						break;
					case "42.0":
					case 42:
					case 42.0:
						resValue = 48
						break;
					case "36.0":
					case "36":
					case 36.0:
					case 36:
						resValue = 42
						break;
					case "28":
					case 28:
					case 28.0:
						resValue = 36
						break;
					case "26.0":
					case "26":
					case 26.0:
					case 26:
						resValue = 28
						break;
					case "24.0":
					case 24.0:
					case 24:
						resValue = 26
						break;
					case "22.0":
					case "22":
					case 22.0:
					case 22:
						resValue = 24
						break;										
					case "20":									
					case 20:								
					case 20.0:
						resValue = 22
						break;
					case "18.0":
					case "18":
					case 18.0:
					case 18:
						resValue = 20
						break;
					case "16.0":
					case "16":
					case 16.0:
					case 16:
						resValue = 18
						break;
					case "15.0":
					case 15.0:
					case 15:
						resValue = 16
						break;
					case "14.0":
					case 14.0:
					case 14:
						resValue = 15
						break;
					case "12.0":
					case 12.0:
					case 12:
						resValue = 14
						break;
					case "11.0":
					case 11.0:
					case 11:
						resValue = 12
						break;
					case "10.5":
					case 10.5:
						resValue = 11
						break;
					case "10.0":
					case "10":
					case 10.0:
					case 10:
						resValue = 10.5
						break;
					case "9.0":
					case 9.0:
					case 9:
						resValue = 10
						break;
					case "8.5":
					case 8.5:
						resValue = 9
						break;
					case "8.0":
					case "8":
					case 8.0:
					case 8:
						resValue = 8.5
						break;
					case "7.5":
					case 7.5:
						resValue = 8
						break;
					case "7.0":
					case "7":
					case 7.0:
					case 7:
						resValue = 7.5
						break;
					case "6.5":
					case 6.5:
						resValue = 7
						break;
					case "6.0":
					case "6":
					case 6.0:
					case 6:
						resValue = 6.5
						break;
					case "5.5":
					case 5.5:
						resValue = 6
						break;
					default:
						resValue = 11
						break;
				}
				return resValue;
			},
			setTextOffsetHeight(item) 
			{
				var resValue = 0;
				switch(item)
				{
					case 48:
					case "48":
						resValue = 54
						break;
					case "56":
					case 56:
						resValue = 62
						break;
					case "72":
					case 72:
						resValue = 78
						break;
					case "90.0":
					case "90":
					case 90:
						resValue = 96
						break;
					case "42.0":
					case 42:
					case 42.0:
						resValue = 48
						break;
					case "36.0":
					case "36":
					case 36.0:
					case 36:
						resValue = 42
						break;
					case "28":
					case 28:
					case 28.0:
						resValue = 34
						break;
					case "26.0":
					case "26":
					case 26.0:
					case 26:
						resValue = 32
						break;
					case "24.0":
					case 24.0:
					case 24:
						resValue = 30
						break;
					case "22.0":
					case "22":
					case 22.0:
					case 22:
						resValue = 28
						break;										
					case "20":									
					case 20:								
					case 20.0:
						resValue = 26
						break;
					case "18.0":
					case "18":
					case 18.0:
					case 18:
						resValue = 24
						break;
					case "16.0":
					case "16":
					case 16.0:
					case 16:
						resValue = 22
						break;
					case "15.0":
					case 15.0:
					case 15:
						resValue = 21
						break;
					default:
						resValue = 20
						break;
				}
				return resValue;
			},
			//设置图片组件样式
			setImageModuleStyle(item) {
				var imageStyle = {
					width: "100%",
					border: "0px",
					padding: "0px 15px",
					height: "100%",
					background: "black"
				};
				if (item.result.pattern.width < 80) {
					imageStyle["padding"] = "0px 5px";
				}
				if (item.name === "image") {
					imageStyle.padding = "0px";
				}
				var height = 200;
				if (item.name === "imageList") {
					if (item.result.base.gridWidth > 0) {
						imageStyle.width = tool.mmToPx(item.result.base.gridWidth) + "px";
					}
					if (item.result.base.gridHeight > 0) {
						height = tool.mmToPx(item.result.base.gridHeight);
						imageStyle.height = height + "px";
					}
					if (item.result.pattern.showImageBorder) {
						imageStyle.border = "2px solid #727272";
					}
					if (item.result.pattern.backgroundShadow) {
						imageStyle.background = "white";
					}
					if (item.result.pattern.showImageInterval) {
						imageStyle["margin-left"] = "3px";
					}
				}
				else {
					if (item.result.pattern.width > 0) {
						imageStyle.width = tool.mmToPx(item.result.pattern.width) + "px";
					}
					if (item.result.pattern.border) {
						imageStyle.border = "2px solid #727272";
						imageStyle.padding = "4px";
					}
					if (item.result.pattern.height > 0) {
						height = tool.mmToPx(item.result.pattern.height);
						imageStyle.height = height + "px";
					}
					if (item.result.pattern.backgroundShadow) {
						imageStyle.background = "white";
					}
				}
				if (item.result) 
				{
					item.result.offsetHeight = height + 6;
				}
				return imageStyle;
			},
			//设置checkbox和select等options的动态数据
			setOptionsData(item) {
				var dataItems = [];
				if (item.result.property && item.result.property.dataSourceType) {
					if (item.result.property.dataSourceType.value === "0") {
						//静态数据
						dataItems = item.result.property.staticOptions;
					}
					else {
						//动态数据
						dataItems = item.result.property.dynamicOptions;
					}
				}
				return dataItems;
			},
			//处理动态隐藏
			hideHandle(item){
				if(item.hideHandle){
					const exp = eval(item.hideHandle.replace(/\$/g,"this.form"))
					return exp
				}
				return false
			},
			//处理动态必填
			rulesHandle(item){
				if(item.requiredHandle){
					const exp = eval(item.requiredHandle.replace(/\$/g,"this.form"))
					var requiredRule = item.rules.find(t => 'required' in t)
					requiredRule.required = exp
				}
				return item.rules
			},
		}
	}
</script>

<style scoped>
	.divItem {
		width: 100%;
		padding: 0px;
	}
	.select-popper {
		color:red;
	}
</style>
