|
|
|
@ -47,17 +47,17 @@
|
|
|
|
|
</div>
|
|
|
|
|
</a-row>
|
|
|
|
|
<!-- <a-spin tip="正在加载中,请稍候..." size="large" :spinning="is_spinning" wrapperClassName="spin-self-style">-->
|
|
|
|
|
<!-- <div class="itemOuterContainer" style="min-height: 100%">-->
|
|
|
|
|
<vue-scroll :ops="ops" style="height: calc(100% - 4rem)">
|
|
|
|
|
<div class="itemOuterContainer" style="height: calc(100% - 3rem);padding: 0.5rem 0;background-color: #f2f2f2">
|
|
|
|
|
<vue-scroll :ops="ops" style="height:100%">
|
|
|
|
|
<draggable group="itemGroup" v-model="fieldsList" class="itemInnerContainer"
|
|
|
|
|
:style="{width:form_width !== 100 ? form_width + '%':'calc(100% - 1rem)',margin: '0.5rem auto'}" handle=".move"
|
|
|
|
|
:style="{width:form_width !== 100 ? form_width + '%':'calc(100% - 1rem)',margin: '0 0.5rem',minHeight:draggableMinHeight}" handle=".move"
|
|
|
|
|
filter=".no-field" forceFallback="true" chosenClass="chosen" ghostClass="ghost" @add="onAdd">
|
|
|
|
|
<FieldItem v-for="field in fieldsList" :key="field.id" :item="field" @delete="deleteRowData" @copy="copyRowData" :design="true"/>
|
|
|
|
|
<div v-if="fieldsList.length <= 0" class="no-field">请拖拽或者点击左侧字段添加表单内容</div>
|
|
|
|
|
</draggable>
|
|
|
|
|
</vue-scroll>
|
|
|
|
|
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
</div>
|
|
|
|
|
<!-- </a-spin>-->
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span='4' class="colStyle">
|
|
|
|
@ -98,6 +98,7 @@ export default {
|
|
|
|
|
props:['formData'],
|
|
|
|
|
data: function () {
|
|
|
|
|
return {
|
|
|
|
|
draggableMinHeight:document.body.clientHeight - 8 * 16 + "px",
|
|
|
|
|
ops:StaticParams.scrollOption,
|
|
|
|
|
selectedItem:{},
|
|
|
|
|
commonConfig,
|
|
|
|
@ -301,7 +302,7 @@ export default {
|
|
|
|
|
submitData:function () {//提交表单信息
|
|
|
|
|
if (this.fieldsList.length === 3){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单保存失败',
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content:"表单中最少要包含一个除默认字段(教师编号、教师姓名、单位(部门))的字段",
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
@ -404,6 +405,10 @@ export default {
|
|
|
|
|
field.is_certificate = field.props.is_certificate === true ? 1 : 0
|
|
|
|
|
}else if(curType === 17 || curType === 18){
|
|
|
|
|
field.is_multiple_choice = field.props.is_multiple_choice === true?1:0;
|
|
|
|
|
}else if(curType === 27){
|
|
|
|
|
field.data_source_form_id = field.props.data_source_form_id;
|
|
|
|
|
field.data_source_field_id = field.props.data_source_field_id;
|
|
|
|
|
field.compare_standard = field.props.compare_standard;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(field.is_input_field === 1){
|
|
|
|
@ -472,25 +477,47 @@ export default {
|
|
|
|
|
let j = 0;//51到200的字段个数
|
|
|
|
|
let k = 0;//200个字符以上的字段个数
|
|
|
|
|
let stopTest = false;
|
|
|
|
|
ary.forEach((item)=>{
|
|
|
|
|
if (item.data){//子表单
|
|
|
|
|
for(let m = 0; m < ary.length; m++){
|
|
|
|
|
let item = ary[m];
|
|
|
|
|
if (item.props.data){//子表单
|
|
|
|
|
index += 1
|
|
|
|
|
let result = this.testData(item.data,true,index)
|
|
|
|
|
let result = this.testData(item.props.data,true,index)
|
|
|
|
|
if (result === false){
|
|
|
|
|
stopTest = true;
|
|
|
|
|
return false
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if ([3,4,6].some((type)=>{return type === item.field_type}) && (item.props.datas === null || item.props.datas === undefined ||
|
|
|
|
|
(TypesCheck.isString(item.props.datas) && item.props.datas === "") || (TypesCheck.isArray(item.props.datas) && item.props.datas.length === 0))){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单保存失败',
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content:"请设置“" + item.field_name + "”字段的数据源",
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|
})
|
|
|
|
|
stopTest = true;
|
|
|
|
|
return false
|
|
|
|
|
break;
|
|
|
|
|
}else if(item.field_type === 27){
|
|
|
|
|
let tips = "";
|
|
|
|
|
if (!item.props.data_source_form_id || item.props.data_source_form_id === ""){
|
|
|
|
|
// eslint-disable-next-line no-debugger
|
|
|
|
|
tips = "请选择“" + item.field_name + "”字段的数据更新来源表单";
|
|
|
|
|
}else if (!item.props.data_source_field_id || item.props.data_source_field_id === ""){
|
|
|
|
|
tips = "请选择“" + item.field_name + "”字段的数据更新来源字段";
|
|
|
|
|
}else if (!item.props.compare_standard){
|
|
|
|
|
tips = "请选择“" + item.field_name + "”字段的更新关联数据规则";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tips !== ""){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content:tips,
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|
})
|
|
|
|
|
stopTest = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.props.max_length){
|
|
|
|
@ -503,14 +530,14 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stopTest){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (i > 80){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单保存失败',
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content:(isChild?'子表单' + index:"") + '字段值最大限制为1-50(包含50)的字段不能超过80个,请更改后再试',
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
@ -518,7 +545,7 @@ export default {
|
|
|
|
|
return false;
|
|
|
|
|
}else if(j > 20){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单保存失败',
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content:(isChild?'子表单' + index:"") + '字段值最大限制为51-200(包含200)的字段不能超过20个,请更改后再试',
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
@ -526,7 +553,7 @@ export default {
|
|
|
|
|
return false;
|
|
|
|
|
}else if (k > 20){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单保存失败',
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content: (isChild?'子表单' + index:"") + '字段值最大限制为200(包含不限制)以外的字段不能超过20个,请更改后再试',
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|