Commit 9d78a339 authored by tianhongyang's avatar tianhongyang

fix

parent 6a7365db
......@@ -42,7 +42,8 @@ export const defaultComOptions = [
label: "单行文本",
// 组件宽度
width: 100,
isError: false
isError: false,
allowDefaultValue: true
},
// 组件属性
componentAttribute: {
......@@ -72,7 +73,8 @@ export const defaultComOptions = [
label: "多行文本",
// 组件宽度
width: 100,
isError: false
isError: false,
allowDefaultValue: true
},
// 组件属性
componentAttribute: {
......@@ -109,7 +111,8 @@ export const defaultComOptions = [
selectOptions: [],
// 是否多选
isMultiple: false,
isError: false
isError: false,
allowDefaultValue: false
},
// 组件属性
componentAttribute: {
......@@ -139,7 +142,8 @@ export const defaultComOptions = [
label: "日期/时间",
// 组件宽度
width: 100,
isError: false
isError: false,
allowDefaultValue: false
},
// 组件属性
componentAttribute: {
......@@ -191,7 +195,8 @@ export const defaultComOptions = [
label: "电话",
// 组件宽度
width: 100,
isError: false
isError: false,
allowDefaultValue: false
},
// 组件属性
componentAttribute: {
......@@ -242,7 +247,8 @@ export const defaultComOptions = [
label: "电子邮箱",
// 组件宽度
width: 100,
isError: false
isError: false,
allowDefaultValue: false
},
// 组件属性
componentAttribute: {
......@@ -273,7 +279,8 @@ export const defaultComOptions = [
width: 100,
limit: -1,
astrict: false,
isError: false
isError: false,
allowDefaultValue: false
},
// 组件属性
componentAttribute: {
......@@ -284,7 +291,7 @@ export const defaultComOptions = [
}
},
{
// 图片类型
// 文件类型
comType: "file",
// 组件展示图标
comShowIcon: "icon_attachments@2x.png",
......@@ -304,7 +311,8 @@ export const defaultComOptions = [
width: 100,
limit: -1,
astrict: false,
isError: false
isError: false,
allowDefaultValue: false
},
// 组件属性
componentAttribute: {
......
......@@ -89,6 +89,7 @@ import { v4 } from 'uuid';
import { getCustomFormDetailApi, addCustomFormDataApi } from "@/api/consultingOrgManagement";
import { cloneDeep } from "lodash-es";
import serialize from "serialize-javascript";
import Schema from "async-validator";
export default {
name: "customFormDesign",
components: {
......@@ -105,6 +106,7 @@ export default {
// 中间编辑的模块
subfieldModuleList: [],
},
olduSbfieldModuleList: [],
// 删除分栏提示
removeSubFiledModuleDialog: false,
// 要删除的分栏信息
......@@ -144,11 +146,54 @@ export default {
},
//方法集
methods: {
saveOptions() {
async saveOptions() {
try {
if (this.activeUid && !this.activeItemData?.checkedAllow) {
elementMessageSingleton("warning", "请先保存字段设置");
return false;
}
/**
* @type {Array<{
* defaultSubfieldModuleName : string;
* subfieldModuleName : string;
* edit : boolean;
* children : Array<any>
* }>}
*/
const _templateTemp = cloneDeep(this.subfieldModuleForm);
let finllyRules = {
subfieldModuleList: {
type: "array",
required: true,
defaultField: {
type: "object",
fields: {
subfieldModuleName: { type: "string", required: true, message: "分栏名称不能为空" },
edit: { type: "enum", enum: [true], required: true, message: "请先保存芬兰名称,当前不能处于编辑状态" },
children: {
type: "array",
required: true,
defaultField: {
formAttribute: {
type: "object",
fields: {
fieldName: { type: "string", required: true }
}
}
}
}
}
}
}
};
const validatorIns = new Schema(finllyRules);
const flag = await validatorIns.validate(_templateTemp);
} catch (error) {
console.log(error);
}
},
cancelCreate() {
this.$set(this.subfieldModuleForm, "subfieldModuleList", cloneDeep(this.olduSbfieldModuleList));
},
generateRandomLowerCaseLetter() {
const alphabet = 'abcdefghijklmnopqrstuvwxyz';
......@@ -168,11 +213,11 @@ export default {
},
async initModule() {
try {
const result = await this.getCustomFormDetail();
if (result.length) {
// 有模板数据 进行回显
return;
}
// const result = await this.getCustomFormDetail();
// if (result.length) {
// // 有模板数据 进行回显
// return;
// }
// 模块初始化
this.addSubfieldModule();
const component = cloneDeep(defaultComOptions[0]);
......@@ -183,6 +228,7 @@ export default {
this.activeModuleId = this.subfieldModuleForm.subfieldModuleList[0].uid;
this.activeUid = component.uid;
this.subfieldModuleForm.subfieldModuleList[0].children.push(component);
this.olduSbfieldModuleList = cloneDeep(this.subfieldModuleForm.subfieldModuleList);
} catch (error) {
}
......
......@@ -35,7 +35,7 @@
</template>
<!-- 默认值 -->
<template v-if="defaultValueContain.includes(comActiveFieldData.comType)">
<template v-if="comActiveFieldData.formAttribute.allowDefaultValue">
<el-form-item label="默认值" class="set-field-option-item" prop="componentAttribute.value" v-if="comActiveFieldData.componentAttribute">
<el-input v-model="comActiveFieldData.componentAttribute.value" placeholder="请输入默认值" clearable></el-input>
</el-form-item>
......@@ -182,7 +182,6 @@ export default {
fieldName: [{ required: true, trigger: ["blur", "change"], validator: fieldNameValidor }],
limit: [{ required: true, type: "number", trigger: ["blur", "change"], validator: limitValidor }]
},
defaultValueContain: ["text", "textarea"],
placeholderContain: ["text", "textarea", "select", "date", "phone", "email"],
limitContain: ["photo", "file"]
};
......
......@@ -36,8 +36,8 @@
<!-- 工程基本信息 -->
<basic-engineering-information v-if="currentList === 'project'" :projectDetailInfo="projectDetailInfo"></basic-engineering-information>
<!-- 咨询机构结算信息 -->
<consulting-agency v-if="currentList === 'consultingAgency'" :projectKey="projectKey" :projectDetailInfo="projectDetailInfo" :isModify="isModify"
ref="consultingAgency" @editComProjectDetailSuccess="editComProjectDetailSuccess"
<consulting-agency v-if="currentList === 'consultingAgency'" :projectKey="projectKey" :projectDetailInfo="projectDetailInfo"
:isModify="isModify" ref="consultingAgency" @editComProjectDetailSuccess="editComProjectDetailSuccess"
@searchLoadingChange="searchLoadingChange"></consulting-agency>
</div>
......@@ -126,7 +126,7 @@ export default {
if (result.code) {
this.$message.success("更新咨询机构结算信息成功");
this.isModify = false;
this.$router.push({
this.$tab.closeOpenPage({
path: `/redirect/${"consultingOrgManagement/projectDetail"}`,
query: {
projectKey: this.projectKey,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment