|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<el-form-item
|
|
<el-form-item
|
|
- v-if="showStatus && !widget.hidden"
|
|
|
|
|
|
+ v-if="showStatus && hidden"
|
|
:label-width="
|
|
:label-width="
|
|
isLabel === false || !widget.options.labelWidthStatus ? '0px' : 150 + 'px'
|
|
isLabel === false || !widget.options.labelWidthStatus ? '0px' : 150 + 'px'
|
|
"
|
|
"
|
|
@@ -34,7 +34,7 @@
|
|
v-for="(uploadUrlItem, uploadUrlIndex) of dataModel"
|
|
v-for="(uploadUrlItem, uploadUrlIndex) of dataModel"
|
|
:key="uploadUrlIndex"
|
|
:key="uploadUrlIndex"
|
|
>
|
|
>
|
|
- <i style="color: #909399;" class="el-icon-document" />
|
|
|
|
|
|
+ <i style="color: #909399" class="el-icon-document" />
|
|
<span>{{ uploadUrlItem.name || uploadUrlItem.url }}</span>
|
|
<span>{{ uploadUrlItem.name || uploadUrlItem.url }}</span>
|
|
<el-button
|
|
<el-button
|
|
round
|
|
round
|
|
@@ -81,7 +81,7 @@
|
|
'font-size': widget.options.font_size,
|
|
'font-size': widget.options.font_size,
|
|
'font-family': widget.options.font_family,
|
|
'font-family': widget.options.font_family,
|
|
'font-weight': widget.options.font_weight,
|
|
'font-weight': widget.options.font_weight,
|
|
- color: widget.options.font_color
|
|
|
|
|
|
+ color: widget.options.font_color,
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
{{ widget.options.defaultValue }}
|
|
{{ widget.options.defaultValue }}
|
|
@@ -130,8 +130,8 @@
|
|
<el-input
|
|
<el-input
|
|
v-if="
|
|
v-if="
|
|
widget.options.dataType === 'number' ||
|
|
widget.options.dataType === 'number' ||
|
|
- widget.options.dataType === 'integer' ||
|
|
|
|
- widget.options.dataType === 'float'
|
|
|
|
|
|
+ widget.options.dataType === 'integer' ||
|
|
|
|
+ widget.options.dataType === 'float'
|
|
"
|
|
"
|
|
v-model="dataModel"
|
|
v-model="dataModel"
|
|
:type="widget.options.dataType"
|
|
:type="widget.options.dataType"
|
|
@@ -185,7 +185,7 @@
|
|
: widget.options.options"
|
|
: widget.options.options"
|
|
:key="index"
|
|
:key="index"
|
|
:style="{
|
|
:style="{
|
|
- display: widget.options.inline ? 'inline-block' : 'block'
|
|
|
|
|
|
+ display: widget.options.inline ? 'inline-block' : 'block',
|
|
}"
|
|
}"
|
|
:label="item.value"
|
|
:label="item.value"
|
|
>
|
|
>
|
|
@@ -209,7 +209,7 @@
|
|
: widget.options.options"
|
|
: widget.options.options"
|
|
:key="index"
|
|
:key="index"
|
|
:style="{
|
|
:style="{
|
|
- display: widget.options.inline ? 'inline-block' : 'block'
|
|
|
|
|
|
+ display: widget.options.inline ? 'inline-block' : 'block',
|
|
}"
|
|
}"
|
|
:label="item.value"
|
|
:label="item.value"
|
|
>
|
|
>
|
|
@@ -415,7 +415,7 @@
|
|
'font-size': widget.options.font_size,
|
|
'font-size': widget.options.font_size,
|
|
'font-family': widget.options.font_family,
|
|
'font-family': widget.options.font_family,
|
|
'font-weight': widget.options.font_weight,
|
|
'font-weight': widget.options.font_weight,
|
|
- color: widget.options.font_color
|
|
|
|
|
|
+ color: widget.options.font_color,
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
{{ widget.options.defaultValue }}
|
|
{{ widget.options.defaultValue }}
|
|
@@ -432,7 +432,7 @@
|
|
'font-size': widget.options.font_size,
|
|
'font-size': widget.options.font_size,
|
|
'font-family': widget.options.font_family,
|
|
'font-family': widget.options.font_family,
|
|
'font-weight': widget.options.font_weight,
|
|
'font-weight': widget.options.font_weight,
|
|
- color: widget.options.font_color
|
|
|
|
|
|
+ color: widget.options.font_color,
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
{{ widget.options.defaultValue }}
|
|
{{ widget.options.defaultValue }}
|
|
@@ -461,7 +461,7 @@ export default {
|
|
name: "GenetateFormItem",
|
|
name: "GenetateFormItem",
|
|
components: {
|
|
components: {
|
|
FmUpload,
|
|
FmUpload,
|
|
- FileUpload
|
|
|
|
|
|
+ FileUpload,
|
|
},
|
|
},
|
|
/* eslint-disable */
|
|
/* eslint-disable */
|
|
props: [
|
|
props: [
|
|
@@ -476,7 +476,7 @@ export default {
|
|
"isLabel",
|
|
"isLabel",
|
|
"subformIndex",
|
|
"subformIndex",
|
|
"subformModel",
|
|
"subformModel",
|
|
- "organList"
|
|
|
|
|
|
+ "organList",
|
|
],
|
|
],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -493,9 +493,15 @@ export default {
|
|
tableData: [],
|
|
tableData: [],
|
|
cooperationList: [],
|
|
cooperationList: [],
|
|
selectLoading: true,
|
|
selectLoading: true,
|
|
- previewUrl: ""
|
|
|
|
|
|
+ previewUrl: "",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ hidden() {
|
|
|
|
+ console.log(this.subformModel, this.widget.hidden);
|
|
|
|
+ return this.subformModel ? true : !this.widget.hidden;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
watch: {
|
|
watch: {
|
|
dataModel: {
|
|
dataModel: {
|
|
deep: true,
|
|
deep: true,
|
|
@@ -508,19 +514,19 @@ export default {
|
|
] = newValue;
|
|
] = newValue;
|
|
this.$emit("update:models", {
|
|
this.$emit("update:models", {
|
|
...this.models,
|
|
...this.models,
|
|
- [this.subformModel]: this.models[this.subformModel]
|
|
|
|
|
|
+ [this.subformModel]: this.models[this.subformModel],
|
|
});
|
|
});
|
|
// this.$emit('input-change', val, this.widget.model, this.subformIndex)
|
|
// this.$emit('input-change', val, this.widget.model, this.subformIndex)
|
|
} else {
|
|
} else {
|
|
this.models[this.widget.model] = newValue;
|
|
this.models[this.widget.model] = newValue;
|
|
this.$emit("update:models", {
|
|
this.$emit("update:models", {
|
|
...this.models,
|
|
...this.models,
|
|
- [this.widget.model]: newValue
|
|
|
|
|
|
+ [this.widget.model]: newValue,
|
|
});
|
|
});
|
|
// this.$emit('input-change', val, this.widget.model)
|
|
// this.$emit('input-change', val, this.widget.model)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
models: {
|
|
models: {
|
|
deep: true,
|
|
deep: true,
|
|
@@ -536,29 +542,29 @@ export default {
|
|
}
|
|
}
|
|
delete this.models.status;
|
|
delete this.models.status;
|
|
this.handleDisplayVerifiy();
|
|
this.handleDisplayVerifiy();
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
cooperationList: {
|
|
cooperationList: {
|
|
deep: true,
|
|
deep: true,
|
|
handler(val) {
|
|
handler(val) {
|
|
if (this.widget.type == "school" && this.preview) {
|
|
if (this.widget.type == "school" && this.preview) {
|
|
let tempStr = null;
|
|
let tempStr = null;
|
|
- val.forEach(item => {
|
|
|
|
|
|
+ val.forEach((item) => {
|
|
if (item.id == this.dataModel) {
|
|
if (item.id == this.dataModel) {
|
|
tempStr = item.name;
|
|
tempStr = item.name;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
this.dataModelStr = tempStr;
|
|
this.dataModelStr = tempStr;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
// 判断当前元素是否是分部表单()
|
|
// 判断当前元素是否是分部表单()
|
|
// console.log(this.widget, 'widget subform')
|
|
// console.log(this.widget, 'widget subform')
|
|
if (this.widget.type == "organ" && this.preview) {
|
|
if (this.widget.type == "organ" && this.preview) {
|
|
let tempStr = null;
|
|
let tempStr = null;
|
|
- this.organList.forEach(item => {
|
|
|
|
|
|
+ this.organList.forEach((item) => {
|
|
if (item.id == this.dataModel) {
|
|
if (item.id == this.dataModel) {
|
|
tempStr = item.name;
|
|
tempStr = item.name;
|
|
}
|
|
}
|
|
@@ -581,19 +587,19 @@ export default {
|
|
this.widget.options.remote &&
|
|
this.widget.options.remote &&
|
|
this.remote[this.widget.options.remoteFunc]
|
|
this.remote[this.widget.options.remoteFunc]
|
|
) {
|
|
) {
|
|
- this.remote[this.widget.options.remoteFunc](data => {
|
|
|
|
- this.widget.options.remoteOptions = data.map(item => {
|
|
|
|
|
|
+ this.remote[this.widget.options.remoteFunc]((data) => {
|
|
|
|
+ this.widget.options.remoteOptions = data.map((item) => {
|
|
return {
|
|
return {
|
|
value: item[this.widget.options.props.value],
|
|
value: item[this.widget.options.props.value],
|
|
label: item[this.widget.options.props.label],
|
|
label: item[this.widget.options.props.label],
|
|
- children: item[this.widget.options.props.children]
|
|
|
|
|
|
+ children: item[this.widget.options.props.children],
|
|
};
|
|
};
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
if (this.widget.type === "imgupload" && this.widget.options.isQiniu) {
|
|
if (this.widget.type === "imgupload" && this.widget.options.isQiniu) {
|
|
- this.remote[this.widget.options.tokenFunc](data => {
|
|
|
|
|
|
+ this.remote[this.widget.options.tokenFunc]((data) => {
|
|
this.widget.options.token = data;
|
|
this.widget.options.token = data;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -613,7 +619,17 @@ export default {
|
|
|
|
|
|
this.handleDisplayVerifiy();
|
|
this.handleDisplayVerifiy();
|
|
},
|
|
},
|
|
- mounted() {},
|
|
|
|
|
|
+ mounted() {
|
|
|
|
+ console.log(this.widget, "12121", this.dataModel);
|
|
|
|
+ if (
|
|
|
|
+ this.preview &&
|
|
|
|
+ this.widget.type == "select" &&
|
|
|
|
+ this.widget.options.relationStatus
|
|
|
|
+ ) {
|
|
|
|
+ console.log(true, "false");
|
|
|
|
+ this.onChangeSelect();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
// 获取学校列表
|
|
// 获取学校列表
|
|
onDownload(item, type) {
|
|
onDownload(item, type) {
|
|
@@ -655,12 +671,12 @@ export default {
|
|
}
|
|
}
|
|
return returnUrl;
|
|
return returnUrl;
|
|
},
|
|
},
|
|
- readWorkbookFromRemoteFile: function(url) {
|
|
|
|
|
|
+ readWorkbookFromRemoteFile: function (url) {
|
|
var xhr = new XMLHttpRequest();
|
|
var xhr = new XMLHttpRequest();
|
|
xhr.open("get", url, true);
|
|
xhr.open("get", url, true);
|
|
xhr.responseType = "arraybuffer";
|
|
xhr.responseType = "arraybuffer";
|
|
let _this = this;
|
|
let _this = this;
|
|
- xhr.onload = function(e) {
|
|
|
|
|
|
+ xhr.onload = function (e) {
|
|
var binary = "";
|
|
var binary = "";
|
|
console.log(xhr);
|
|
console.log(xhr);
|
|
if (xhr.status === 200) {
|
|
if (xhr.status === 200) {
|
|
@@ -690,19 +706,19 @@ export default {
|
|
// rotate: function (evt) { //实现旋转
|
|
// rotate: function (evt) { //实现旋转
|
|
// element.rotateZ += evt.angle;
|
|
// element.rotateZ += evt.angle;
|
|
// },
|
|
// },
|
|
- multipointStart: function() {
|
|
|
|
|
|
+ multipointStart: function () {
|
|
initScale = element.scaleX;
|
|
initScale = element.scaleX;
|
|
},
|
|
},
|
|
- pinch: function(evt) {
|
|
|
|
|
|
+ pinch: function (evt) {
|
|
//实现缩放
|
|
//实现缩放
|
|
element.scaleX = element.scaleY = initScale * evt.zoom;
|
|
element.scaleX = element.scaleY = initScale * evt.zoom;
|
|
},
|
|
},
|
|
- pressMove: function(evt) {
|
|
|
|
|
|
+ pressMove: function (evt) {
|
|
//实现移动
|
|
//实现移动
|
|
element.translateX += evt.deltaX;
|
|
element.translateX += evt.deltaX;
|
|
element.translateY += evt.deltaY;
|
|
element.translateY += evt.deltaY;
|
|
evt.preventDefault();
|
|
evt.preventDefault();
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
checkFileSuffix(url) {
|
|
checkFileSuffix(url) {
|
|
@@ -724,16 +740,41 @@ export default {
|
|
onChangeSelect() {
|
|
onChangeSelect() {
|
|
let relationArray = [];
|
|
let relationArray = [];
|
|
// console.log(this.widget.options.options)
|
|
// console.log(this.widget.options.options)
|
|
|
|
+ let allArray = [];
|
|
this.widget.options &&
|
|
this.widget.options &&
|
|
- this.widget.options.options.forEach(item => {
|
|
|
|
- if (this.dataModel == item.value) {
|
|
|
|
- let tempRelation = item.relationOptions || [];
|
|
|
|
- relationArray.push(...tempRelation);
|
|
|
|
|
|
+ this.widget.options.options.forEach((item) => {
|
|
|
|
+ // 判断是否是多选
|
|
|
|
+ let tempRelation = item.relationOptions || [];
|
|
|
|
+ allArray.push(...tempRelation);
|
|
|
|
+ if (this.widget.options.multiple) {
|
|
|
|
+ if (this.dataModel.includes(item.value)) {
|
|
|
|
+ relationArray.push(...tempRelation);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (this.dataModel == item.value) {
|
|
|
|
+ let tempRelation = item.relationOptions || [];
|
|
|
|
+ relationArray.push(...tempRelation);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- if (relationArray.length > 0) {
|
|
|
|
- this.$emit("relationFormChange", relationArray);
|
|
|
|
- }
|
|
|
|
|
|
+ console.log(relationArray, "111", this.dataModel, this.widget.options);
|
|
|
|
+ // if (relationArray.length > 0) {
|
|
|
|
+ this.$emit("relationFormChange", relationArray, allArray);
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // this.dataModel = this.selectValue.join(",");
|
|
|
|
+ // this.showSelect = false;
|
|
|
|
+ // let relationArray = [];
|
|
|
|
+ // let allArray = [];
|
|
|
|
+ // this.options?.options?.forEach((item) => {
|
|
|
|
+ // let tempRelation = item.relationOptions || [];
|
|
|
|
+ // allArray.push(...tempRelation);
|
|
|
|
+ // if (this.selectValue.includes(item.value)) {
|
|
|
|
+ // relationArray.push(...tempRelation);
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // let uniqueArr = [...new Set(relationArray)];
|
|
|
|
+ // this.$emit("relationFormChange", uniqueArr, allArray);
|
|
},
|
|
},
|
|
fileCheckRequired(state) {
|
|
fileCheckRequired(state) {
|
|
this.$emit("fileCheckRequired", state);
|
|
this.$emit("fileCheckRequired", state);
|
|
@@ -747,9 +788,10 @@ export default {
|
|
let organId = null;
|
|
let organId = null;
|
|
this.selectLoading = true;
|
|
this.selectLoading = true;
|
|
if (this.subformModel) {
|
|
if (this.subformModel) {
|
|
- organId = this.models[this.subformModel][this.subformIndex][
|
|
|
|
- this.widget.options.displayRelation
|
|
|
|
- ];
|
|
|
|
|
|
+ organId =
|
|
|
|
+ this.models[this.subformModel][this.subformIndex][
|
|
|
|
+ this.widget.options.displayRelation
|
|
|
|
+ ];
|
|
} else {
|
|
} else {
|
|
organId = this.models[this.widget.options.displayRelation];
|
|
organId = this.models[this.widget.options.displayRelation];
|
|
}
|
|
}
|
|
@@ -784,10 +826,7 @@ export default {
|
|
// 保证第一位只能是数字,不能是点
|
|
// 保证第一位只能是数字,不能是点
|
|
v = v.replace(/^\./g, "");
|
|
v = v.replace(/^\./g, "");
|
|
// 小数只能出现1位
|
|
// 小数只能出现1位
|
|
- v = v
|
|
|
|
- .replace(".", "$#$")
|
|
|
|
- .replace(/\./g, "")
|
|
|
|
- .replace("$#$", ".");
|
|
|
|
|
|
+ v = v.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
|
// 小数点后面保留2位
|
|
// 小数点后面保留2位
|
|
v = v.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
|
|
v = v.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
|
|
if (t == "-") {
|
|
if (t == "-") {
|
|
@@ -855,8 +894,8 @@ export default {
|
|
},
|
|
},
|
|
dataFormatBr(str) {
|
|
dataFormatBr(str) {
|
|
return str ? str.replace(/\n/gi, "<br />") : str;
|
|
return str ? str.replace(/\n/gi, "<br />") : str;
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|