|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<template >
|
|
|
|
|
<div @dragover="dragOver" style="width: 100%">
|
|
|
|
|
<div v-if="!isLoading" @dragover="dragOver" style="width: 100%">
|
|
|
|
|
<a-row class="formTitle" type='flex' align='middle'>
|
|
|
|
|
{{data.form_name}}
|
|
|
|
|
</a-row>
|
|
|
|
@ -51,10 +51,11 @@
|
|
|
|
|
<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 auto',minHeight:draggableMinHeight}" handle=".move"
|
|
|
|
|
:style="{width:form_width !== 100 ? form_width + '%':'calc(100% - 1rem)',margin: '0 auto',paddingBottom:'1rem',
|
|
|
|
|
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" @addCol="onAddCol"/>
|
|
|
|
|
<div v-if="fieldsList.length <= 0" class="no-field">请拖拽或者点击左侧字段添加表单内容</div>
|
|
|
|
|
<div v-if="fieldsList.length <= 0" class="no-field">请拖拽或者点击左侧字段添加类目内容</div>
|
|
|
|
|
</draggable>
|
|
|
|
|
</vue-scroll>
|
|
|
|
|
|
|
|
|
@ -68,18 +69,19 @@
|
|
|
|
|
<div v-else :style="{height: innerItemContainerHeight,display:'flex',justifyContent:'center',alignItems:'center',fontSize:'1rem'}">
|
|
|
|
|
请选择显示属性字段</div>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
<a-tab-pane key="tab2" tab="表单属性">
|
|
|
|
|
<a-tab-pane key="tab2" tab="类目属性">
|
|
|
|
|
<FormAttributeConfig :dataConfig="getFormConfigData" ref="formAttributeCom"/>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</div>
|
|
|
|
|
<a-spin v-else tip="正在加载,请稍候..." size="large" style="padding-top: 20%"/>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import draggable from 'vuedraggable'
|
|
|
|
|
import { Row, Col, Tabs, Icon} from 'ant-design-vue'
|
|
|
|
|
import { Row, Col, Tabs, Icon,Spin} from 'ant-design-vue'
|
|
|
|
|
import { baseFields, advancedFields, businessFields, layoutFields,formConfig,commonConfig,curItem} from "./fieldAndFormConfig"
|
|
|
|
|
import _ from 'lodash'
|
|
|
|
|
import Common from '../../../utils/common'
|
|
|
|
@ -92,6 +94,7 @@ import { Modal } from 'ant-design-vue'
|
|
|
|
|
import StaticParams from '../../../global-llibs/staticParams'
|
|
|
|
|
import TypesCheck from '../../../global-llibs/under-score/types-check'
|
|
|
|
|
import CommonOperate from '../utils/commonOperate';
|
|
|
|
|
import CommonInterfaceConfig from '../../../commonInterface/interfaceConfig'
|
|
|
|
|
// import Upload from '../../components/common/uploader/Upload'
|
|
|
|
|
// import RichEditor from '../../components/common/richEditor/RichEditor'
|
|
|
|
|
const MyIcon = Icon.createFromIconfontCN({
|
|
|
|
@ -121,9 +124,10 @@ export default {
|
|
|
|
|
{title : '业务字段',list: businessFields},
|
|
|
|
|
{title : '布局字段',list: layoutFields}
|
|
|
|
|
],
|
|
|
|
|
is_spinning:true,//是否为加载总的状态,
|
|
|
|
|
// is_spinning:true,//是否为加载总的状态,
|
|
|
|
|
form_width:100,
|
|
|
|
|
submitList:[]
|
|
|
|
|
submitList:[],
|
|
|
|
|
isLoading:true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
@ -149,12 +153,15 @@ export default {
|
|
|
|
|
if (result && result[0]){
|
|
|
|
|
let data = result[0].data
|
|
|
|
|
if (data.code === 2000){
|
|
|
|
|
this.is_spinning = false;
|
|
|
|
|
// this.is_spinning = false;
|
|
|
|
|
// this.data = data.data;
|
|
|
|
|
this.data.form_json = data.data.form_json
|
|
|
|
|
this.data.form_config_json = data.data.form_config_json
|
|
|
|
|
this.fieldsList = this.data.form_json && this.data.form_json !== ""?JSON.parse(this.data.form_json): []
|
|
|
|
|
|
|
|
|
|
if (this.data.form_config_json && this.data.form_config_json !== ""){
|
|
|
|
|
this.data.formConfig = this.$set(this.data,"formConfig",JSON.parse(this.data.form_config_json))
|
|
|
|
|
this.form_width = this.data.formConfig.form_width
|
|
|
|
|
}
|
|
|
|
|
if(this.fieldsList.length === 0){
|
|
|
|
|
let person_num_data = _.cloneDeep(baseFields.filter((item)=>{return item.tag === "input"})[0])
|
|
|
|
|
Object.keys(this.commonConfig).forEach((prop)=>{
|
|
|
|
@ -188,14 +195,16 @@ export default {
|
|
|
|
|
this.fieldsList.push(person_num_data);
|
|
|
|
|
this.fieldsList.push(person_name_data);
|
|
|
|
|
this.fieldsList.push(person_org_dept);
|
|
|
|
|
}else{//去掉实际在布局字段中的数据
|
|
|
|
|
this.fieldsList = this.fieldsList.filter((item)=>{return item.is_main !== false})
|
|
|
|
|
this.isLoading = false;
|
|
|
|
|
}else{//获取数据字典字典的内容并去掉实际在布局字段中的数据
|
|
|
|
|
this.getDicKeys()
|
|
|
|
|
// this.fieldsList = this.fieldsList.filter((item)=>{return item.is_main !== false})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.data.form_config_json && this.data.form_config_json !== ""){
|
|
|
|
|
this.data.formConfig = this.$set(this.data,"formConfig",JSON.parse(this.data.form_config_json))
|
|
|
|
|
this.form_width = this.data.formConfig.form_width
|
|
|
|
|
}
|
|
|
|
|
// if (this.data.form_config_json && this.data.form_config_json !== ""){
|
|
|
|
|
// this.data.formConfig = this.$set(this.data,"formConfig",JSON.parse(this.data.form_config_json))
|
|
|
|
|
// this.form_width = this.data.formConfig.form_width
|
|
|
|
|
// }
|
|
|
|
|
// this.data.formConfig = this.data.form_config_json && this.data.form_config_json !== ""?JSON.parse(this.data.form_config_json):{}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -206,6 +215,126 @@ export default {
|
|
|
|
|
this.$bus.off("clickItem",this.selectItem)
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getDicKeys:function(){
|
|
|
|
|
let keys = [];
|
|
|
|
|
this.fieldsList.forEach((item)=>{
|
|
|
|
|
if (item.tag === "son_form"){//检测子类目中需要获取的数据字典
|
|
|
|
|
item.props.data.forEach((data)=>{
|
|
|
|
|
if ([3,4,6].some((num)=>{return num === data.field_type})){//检测单选,复选,下拉选需要获取的数据字典
|
|
|
|
|
if (parseInt(data.data_resource) === 1){
|
|
|
|
|
keys.push(data.data_resource_info)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}else if ([3,4,6].some((num)=>{return num === item.field_type})){//检测单选,复选,下拉选需要获取的数据字典
|
|
|
|
|
if (parseInt(item.data_resource) === 1){
|
|
|
|
|
if (keys.every((code)=>{return code !== item.data_resource_info})){
|
|
|
|
|
keys.push(item.data_resource_info)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (keys.length === 0){
|
|
|
|
|
this.deleteNotMainField();
|
|
|
|
|
this.isLoading = false;
|
|
|
|
|
}else {
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url:CommonInterfaceConfig.getIntellioaDicByCodes.url,
|
|
|
|
|
method:CommonInterfaceConfig.getIntellioaDicByCodes.method,
|
|
|
|
|
params:{
|
|
|
|
|
dic_codes:keys.join(",")
|
|
|
|
|
},
|
|
|
|
|
isTestLogin:CommonInterfaceConfig.getIntellioaDicByCodes.isTestLogin
|
|
|
|
|
}],(data)=>{
|
|
|
|
|
let result = data[0].data;
|
|
|
|
|
if (result.code === 2000){
|
|
|
|
|
let keyCodes = Object.keys(result.data);
|
|
|
|
|
keyCodes.forEach((code)=>{
|
|
|
|
|
this.fieldsList.forEach((item)=>{
|
|
|
|
|
if (item.tag === "son_form"){//检测子类目中需要获取的数据字典
|
|
|
|
|
item.props.data.forEach((data)=>{
|
|
|
|
|
if ([3,4,6].some((num)=>{return num === data.field_type})){//检测单选,复选,下拉选需要获取的数据字典
|
|
|
|
|
if (data.data_resource_info === code){
|
|
|
|
|
data.props.datas = result.data[code];
|
|
|
|
|
if (item.props.tableData && item.props.tableData.length > 0){
|
|
|
|
|
item.props.tableData.forEach((table)=>{
|
|
|
|
|
table[data.id+"_json"].props.datas = result.data[code];
|
|
|
|
|
table[data.id+"_json_copy"].props.datas = result.data[code];
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}else if ([3,4,6].some((num)=>{return num === item.field_type})){//检测单选,复选,下拉选需要获取的数据字典
|
|
|
|
|
if (code === item.data_resource_info){
|
|
|
|
|
item.props.datas = result.data[code];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
this.deleteNotMainField();
|
|
|
|
|
this.isLoading = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
deleteNotMainField:function(){
|
|
|
|
|
for (let j = this.fieldsList.length - 1; j >= 0; j--){
|
|
|
|
|
let item = this.fieldsList[j];
|
|
|
|
|
if (item.is_main === false){
|
|
|
|
|
for (let i = 0; i < this.fieldsList.length; i ++){
|
|
|
|
|
let find = false;
|
|
|
|
|
let fieldJSON = this.fieldsList[i];
|
|
|
|
|
if (fieldJSON.tag === "grid" || fieldJSON.tag === "table"){//找到布局字段
|
|
|
|
|
find = this.findAndReplaceData(item,fieldJSON);
|
|
|
|
|
}
|
|
|
|
|
if (find === true){
|
|
|
|
|
this.fieldsList.splice(j,1);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
findAndReplaceData:function(json,targetFiled){
|
|
|
|
|
if (targetFiled.tag === "grid"){
|
|
|
|
|
for (let j = 0; j < targetFiled.props.cols.length; j++){
|
|
|
|
|
let col = targetFiled.props.cols[j];
|
|
|
|
|
for (let k = 0; k < col.data.length; k++){
|
|
|
|
|
let item = col.data[k];
|
|
|
|
|
if (item.tag === "grid" || item.tag === "table"){//布局字段中嵌套布局字段
|
|
|
|
|
return this.findAndReplaceData(json,item);
|
|
|
|
|
}else{
|
|
|
|
|
if(json.id === item.id){//找到布局字段中对应的字段
|
|
|
|
|
targetFiled.props.cols[j].data[k] = json;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else if(targetFiled.tag === "table"){
|
|
|
|
|
for (let i = 0; i < targetFiled.props.tr.length; i++){
|
|
|
|
|
let tr = targetFiled.props.tr[i];
|
|
|
|
|
for (let j = 0; j < tr.td.length; j++){
|
|
|
|
|
let td = tr.td[j];
|
|
|
|
|
for(let k = 0; k < td.data.length; k++){
|
|
|
|
|
let item = td.data[k];
|
|
|
|
|
if (item.tag === "grid" || item.tag === "table"){//布局字段中嵌套布局字段
|
|
|
|
|
return this.findAndReplaceData(json,item);
|
|
|
|
|
}else{
|
|
|
|
|
if(json.id === item.id){//找到布局字段中对应的字段
|
|
|
|
|
targetFiled.props.tr[i].td[j].data[k] = json;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
fieldClick:function(field){
|
|
|
|
|
this.curItem.item = _.cloneDeep(field);
|
|
|
|
|
this.curItem.item.id = this.curItem.item.tag + "_" + Common.getRandom(12);
|
|
|
|
@ -222,7 +351,7 @@ export default {
|
|
|
|
|
if (this.curItem.item.field_type <=24 && this.curItem.item.field_type >= 21){
|
|
|
|
|
this.curItem.item.props.show_title = false;
|
|
|
|
|
|
|
|
|
|
if (this.curItem.item.field_type === 23){//子表单对于标题特殊处理
|
|
|
|
|
if (this.curItem.item.field_type === 23){//子类目对于标题特殊处理
|
|
|
|
|
this.curItem.item.props.label_alignment = "center"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -242,7 +371,7 @@ export default {
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title:"预览失败",
|
|
|
|
|
centered:true,
|
|
|
|
|
content:"当前表单没有字段,无法预览",
|
|
|
|
|
content:"当前类目没有字段,无法预览",
|
|
|
|
|
okText:'我知道了'
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
@ -311,7 +440,7 @@ export default {
|
|
|
|
|
if (this.curItem.item.field_type <=24 && this.curItem.item.field_type >= 21){
|
|
|
|
|
this.curItem.item.props.show_title = false;
|
|
|
|
|
|
|
|
|
|
if (this.curItem.item.field_type === 23){//子表单对于标题特殊处理
|
|
|
|
|
if (this.curItem.item.field_type === 23){//子类目对于标题特殊处理
|
|
|
|
|
this.curItem.item.props.label_alignment = "center"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -362,7 +491,7 @@ export default {
|
|
|
|
|
if (item.tag === "grid"){//栅格
|
|
|
|
|
if(item.props.cols.length === 0 || item.props.cols.every((col)=>{return !col.data || col.data.length === 0})){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
title: '类目提交失败',
|
|
|
|
|
content:"栅格布局字段中最少要包含一个字段",
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
@ -378,7 +507,7 @@ export default {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
son.is_main = false;//不在主表单内,在布局字段内
|
|
|
|
|
son.is_main = false;//不在主类目内,在布局字段内
|
|
|
|
|
this.submitList.push(son)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -387,7 +516,7 @@ export default {
|
|
|
|
|
}else{
|
|
|
|
|
if (item.props.tr.every((tr)=>{ return tr.td.every((td)=>{ return !td.data || td.data.length === 0})})){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
title: '类目提交失败',
|
|
|
|
|
content:"表格布局字段中最少要包含一个字段",
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
@ -405,7 +534,7 @@ export default {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
data.is_main = false;//不在主表单内,在布局字段内
|
|
|
|
|
data.is_main = false;//不在主类目内,在布局字段内
|
|
|
|
|
this.submitList.push(data)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -416,17 +545,8 @@ export default {
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
submitData:function () {//提交表单信息
|
|
|
|
|
submitData:function () {//提交类目信息
|
|
|
|
|
this.submitList = _.cloneDeep(this.fieldsList);
|
|
|
|
|
if (this.submitList.length === 3){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content:"表单中最少要包含一个除默认字段(教师编号、教师姓名、单位(部门))的字段",
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let extract = true;
|
|
|
|
|
for (let i = 0; i < this.submitList.length; i++){
|
|
|
|
|
let item = this.submitList[i];
|
|
|
|
@ -451,7 +571,23 @@ export default {
|
|
|
|
|
|
|
|
|
|
let fom_config = this.$refs.formAttributeCom?this.$refs.formAttributeCom.config:this.formConfig
|
|
|
|
|
fom_config.include_certificate = has_certificate
|
|
|
|
|
|
|
|
|
|
if (JSON.stringify(this.submitList).length > 16777215){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '类目提交失败',
|
|
|
|
|
content:"类目内容过多无法提交,请精简类目内容后再提交",
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}else if(this.submitList.length === 3 && this.submitList.every((item)=>{return item.field_input_type === 2})){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '类目提交失败',
|
|
|
|
|
content:"类目中最少要包含一个除默认字段(教师编号、教师姓名、单位(部门))的字段",
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let params = {
|
|
|
|
|
org_id:this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
form_id:this.data.form_id,
|
|
|
|
@ -470,7 +606,7 @@ export default {
|
|
|
|
|
if (result && result[0]){
|
|
|
|
|
this.curItem.item = {}
|
|
|
|
|
if (result[0].data.code === 2000){
|
|
|
|
|
this.$toast("表单提交成功")
|
|
|
|
|
this.$toast("类目提交成功")
|
|
|
|
|
this.$emit("back")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -515,12 +651,16 @@ export default {
|
|
|
|
|
// field.data_resource = parseInt(field.props.data_resource);
|
|
|
|
|
if (parseInt(field.data_resource) === 2){
|
|
|
|
|
field.data_resource_info = JSON.stringify(field.props.datas);
|
|
|
|
|
}else{
|
|
|
|
|
field.props.datas = [];//把设置时的数据字典选项内容清空
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else if (curType === 4){//多选框组特殊处理
|
|
|
|
|
field.is_multiple_choice = 1
|
|
|
|
|
if (parseInt(field.data_resource) === 2){
|
|
|
|
|
field.data_resource_info = JSON.stringify(field.props.datas);
|
|
|
|
|
}else{
|
|
|
|
|
field.props.datas = [];//把设置时的数据字典选项内容清空
|
|
|
|
|
}
|
|
|
|
|
}else if (curType === 5){//时间日期组件特殊处理
|
|
|
|
|
field.date_format = field.props.format
|
|
|
|
@ -528,6 +668,8 @@ export default {
|
|
|
|
|
// field.data_resource = parseInt(field.props.data_resource);
|
|
|
|
|
if (parseInt(field.data_resource) === 2){
|
|
|
|
|
field.data_resource_info = JSON.stringify(field.props.datas);
|
|
|
|
|
}else{
|
|
|
|
|
field.props.datas = [];//把设置时的数据字典选项内容清空
|
|
|
|
|
}
|
|
|
|
|
if(field.props.mode === "default"){
|
|
|
|
|
field.is_multiple_choice = 0
|
|
|
|
@ -584,7 +726,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}else {//处理非输入场字段数据
|
|
|
|
|
field.is_input_field = 0;
|
|
|
|
|
if (curType !== 20 && curType !== 22){//字段为子表单 栅格 表格
|
|
|
|
|
if (curType !== 20 && curType !== 22){//字段为子类目 栅格 表格
|
|
|
|
|
if(field.props.data && field.props.data.length > 0){//有子字段
|
|
|
|
|
field.field_type = parseInt(field.field_type.toString().substr(0,2) + "1")
|
|
|
|
|
this.organizeData(field.props.data,true);
|
|
|
|
@ -613,13 +755,13 @@ export default {
|
|
|
|
|
for(let m = 0; m < ary.length; m++){
|
|
|
|
|
let item = ary[m];
|
|
|
|
|
if (item.tag === "son_form"){
|
|
|
|
|
//子表单
|
|
|
|
|
//子类目
|
|
|
|
|
index += 1
|
|
|
|
|
let result = true;
|
|
|
|
|
if (!item.props.data || item.props.data.length === 0){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content:"子表单中至少包含一个字段",
|
|
|
|
|
title: '类目提交失败',
|
|
|
|
|
content:"子类目中至少包含一个字段",
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|
})
|
|
|
|
@ -635,7 +777,7 @@ export default {
|
|
|
|
|
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
|
|
|
|
@ -646,7 +788,7 @@ export default {
|
|
|
|
|
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 + "”字段的数据更新来源表单";
|
|
|
|
|
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){
|
|
|
|
@ -655,7 +797,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
if (tips !== ""){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
title: '类目提交失败',
|
|
|
|
|
content:tips,
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
@ -682,24 +824,24 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
if (i > 80){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content:(isChild?'子表单' + index:"") + '字段值最大限制为1-50(包含50)的字段不能超过80个,请更改后再试',
|
|
|
|
|
title: '类目提交失败',
|
|
|
|
|
content:(isChild?'子类目' + index:"") + '字段值最大限制为1-50(包含50)的字段不能超过80个,请更改后再试',
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|
})
|
|
|
|
|
return false;
|
|
|
|
|
}else if(j > 20){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content:(isChild?'子表单' + index:"") + '字段值最大限制为51-200(包含200)的字段不能超过20个,请更改后再试',
|
|
|
|
|
title: '类目提交失败',
|
|
|
|
|
content:(isChild?'子类目' + index:"") + '字段值最大限制为51-200(包含200)的字段不能超过20个,请更改后再试',
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|
})
|
|
|
|
|
return false;
|
|
|
|
|
}else if (k > 20){
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: '表单提交失败',
|
|
|
|
|
content: (isChild?'子表单' + index:"") + '字段值最大限制为200(包含不限制)以外的字段不能超过20个,请更改后再试',
|
|
|
|
|
title: '类目提交失败',
|
|
|
|
|
content: (isChild?'子类目' + index:"") + '字段值最大限制为200(包含不限制)以外的字段不能超过20个,请更改后再试',
|
|
|
|
|
okText:'我知道了',
|
|
|
|
|
centered:true
|
|
|
|
|
})
|
|
|
|
@ -718,8 +860,15 @@ export default {
|
|
|
|
|
FieldItem,
|
|
|
|
|
FormAttributeConfig,
|
|
|
|
|
FieldAttributeConfig,
|
|
|
|
|
MyIcon
|
|
|
|
|
MyIcon,
|
|
|
|
|
ASpin:Spin
|
|
|
|
|
},
|
|
|
|
|
// watch:{
|
|
|
|
|
// fieldsList:function () {
|
|
|
|
|
// // eslint-disable-next-line no-debugger
|
|
|
|
|
// debugger
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|