Commit 9d78a339 authored by tianhongyang's avatar tianhongyang

fix

parent 6a7365db
...@@ -42,7 +42,8 @@ export const defaultComOptions = [ ...@@ -42,7 +42,8 @@ export const defaultComOptions = [
label: "单行文本", label: "单行文本",
// 组件宽度 // 组件宽度
width: 100, width: 100,
isError: false isError: false,
allowDefaultValue: true
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -72,7 +73,8 @@ export const defaultComOptions = [ ...@@ -72,7 +73,8 @@ export const defaultComOptions = [
label: "多行文本", label: "多行文本",
// 组件宽度 // 组件宽度
width: 100, width: 100,
isError: false isError: false,
allowDefaultValue: true
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -109,7 +111,8 @@ export const defaultComOptions = [ ...@@ -109,7 +111,8 @@ export const defaultComOptions = [
selectOptions: [], selectOptions: [],
// 是否多选 // 是否多选
isMultiple: false, isMultiple: false,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -139,7 +142,8 @@ export const defaultComOptions = [ ...@@ -139,7 +142,8 @@ export const defaultComOptions = [
label: "日期/时间", label: "日期/时间",
// 组件宽度 // 组件宽度
width: 100, width: 100,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -191,7 +195,8 @@ export const defaultComOptions = [ ...@@ -191,7 +195,8 @@ export const defaultComOptions = [
label: "电话", label: "电话",
// 组件宽度 // 组件宽度
width: 100, width: 100,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -242,7 +247,8 @@ export const defaultComOptions = [ ...@@ -242,7 +247,8 @@ export const defaultComOptions = [
label: "电子邮箱", label: "电子邮箱",
// 组件宽度 // 组件宽度
width: 100, width: 100,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -273,7 +279,8 @@ export const defaultComOptions = [ ...@@ -273,7 +279,8 @@ export const defaultComOptions = [
width: 100, width: 100,
limit: -1, limit: -1,
astrict: false, astrict: false,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
...@@ -284,7 +291,7 @@ export const defaultComOptions = [ ...@@ -284,7 +291,7 @@ export const defaultComOptions = [
} }
}, },
{ {
// 图片类型 // 文件类型
comType: "file", comType: "file",
// 组件展示图标 // 组件展示图标
comShowIcon: "icon_attachments@2x.png", comShowIcon: "icon_attachments@2x.png",
...@@ -304,7 +311,8 @@ export const defaultComOptions = [ ...@@ -304,7 +311,8 @@ export const defaultComOptions = [
width: 100, width: 100,
limit: -1, limit: -1,
astrict: false, astrict: false,
isError: false isError: false,
allowDefaultValue: false
}, },
// 组件属性 // 组件属性
componentAttribute: { componentAttribute: {
......
...@@ -89,6 +89,7 @@ import { v4 } from 'uuid'; ...@@ -89,6 +89,7 @@ import { v4 } from 'uuid';
import { getCustomFormDetailApi, addCustomFormDataApi } from "@/api/consultingOrgManagement"; import { getCustomFormDetailApi, addCustomFormDataApi } from "@/api/consultingOrgManagement";
import { cloneDeep } from "lodash-es"; import { cloneDeep } from "lodash-es";
import serialize from "serialize-javascript"; import serialize from "serialize-javascript";
import Schema from "async-validator";
export default { export default {
name: "customFormDesign", name: "customFormDesign",
components: { components: {
...@@ -105,6 +106,7 @@ export default { ...@@ -105,6 +106,7 @@ export default {
// 中间编辑的模块 // 中间编辑的模块
subfieldModuleList: [], subfieldModuleList: [],
}, },
olduSbfieldModuleList: [],
// 删除分栏提示 // 删除分栏提示
removeSubFiledModuleDialog: false, removeSubFiledModuleDialog: false,
// 要删除的分栏信息 // 要删除的分栏信息
...@@ -144,11 +146,54 @@ export default { ...@@ -144,11 +146,54 @@ export default {
}, },
//方法集 //方法集
methods: { 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() { cancelCreate() {
this.$set(this.subfieldModuleForm, "subfieldModuleList", cloneDeep(this.olduSbfieldModuleList));
}, },
generateRandomLowerCaseLetter() { generateRandomLowerCaseLetter() {
const alphabet = 'abcdefghijklmnopqrstuvwxyz'; const alphabet = 'abcdefghijklmnopqrstuvwxyz';
...@@ -168,11 +213,11 @@ export default { ...@@ -168,11 +213,11 @@ export default {
}, },
async initModule() { async initModule() {
try { try {
const result = await this.getCustomFormDetail(); // const result = await this.getCustomFormDetail();
if (result.length) { // if (result.length) {
// 有模板数据 进行回显 // // 有模板数据 进行回显
return; // return;
} // }
// 模块初始化 // 模块初始化
this.addSubfieldModule(); this.addSubfieldModule();
const component = cloneDeep(defaultComOptions[0]); const component = cloneDeep(defaultComOptions[0]);
...@@ -183,6 +228,7 @@ export default { ...@@ -183,6 +228,7 @@ export default {
this.activeModuleId = this.subfieldModuleForm.subfieldModuleList[0].uid; this.activeModuleId = this.subfieldModuleForm.subfieldModuleList[0].uid;
this.activeUid = component.uid; this.activeUid = component.uid;
this.subfieldModuleForm.subfieldModuleList[0].children.push(component); this.subfieldModuleForm.subfieldModuleList[0].children.push(component);
this.olduSbfieldModuleList = cloneDeep(this.subfieldModuleForm.subfieldModuleList);
} catch (error) { } catch (error) {
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</template> </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-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-input v-model="comActiveFieldData.componentAttribute.value" placeholder="请输入默认值" clearable></el-input>
</el-form-item> </el-form-item>
...@@ -182,7 +182,6 @@ export default { ...@@ -182,7 +182,6 @@ export default {
fieldName: [{ required: true, trigger: ["blur", "change"], validator: fieldNameValidor }], fieldName: [{ required: true, trigger: ["blur", "change"], validator: fieldNameValidor }],
limit: [{ required: true, type: "number", trigger: ["blur", "change"], validator: limitValidor }] limit: [{ required: true, type: "number", trigger: ["blur", "change"], validator: limitValidor }]
}, },
defaultValueContain: ["text", "textarea"],
placeholderContain: ["text", "textarea", "select", "date", "phone", "email"], placeholderContain: ["text", "textarea", "select", "date", "phone", "email"],
limitContain: ["photo", "file"] limitContain: ["photo", "file"]
}; };
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
<!-- 工程基本信息 --> <!-- 工程基本信息 -->
<basic-engineering-information v-if="currentList === 'project'" :projectDetailInfo="projectDetailInfo"></basic-engineering-information> <basic-engineering-information v-if="currentList === 'project'" :projectDetailInfo="projectDetailInfo"></basic-engineering-information>
<!-- 咨询机构结算信息 --> <!-- 咨询机构结算信息 -->
<consulting-agency v-if="currentList === 'consultingAgency'" :projectKey="projectKey" :projectDetailInfo="projectDetailInfo" :isModify="isModify" <consulting-agency v-if="currentList === 'consultingAgency'" :projectKey="projectKey" :projectDetailInfo="projectDetailInfo"
ref="consultingAgency" @editComProjectDetailSuccess="editComProjectDetailSuccess" :isModify="isModify" ref="consultingAgency" @editComProjectDetailSuccess="editComProjectDetailSuccess"
@searchLoadingChange="searchLoadingChange"></consulting-agency> @searchLoadingChange="searchLoadingChange"></consulting-agency>
</div> </div>
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
if (result.code) { if (result.code) {
this.$message.success("更新咨询机构结算信息成功"); this.$message.success("更新咨询机构结算信息成功");
this.isModify = false; this.isModify = false;
this.$router.push({ this.$tab.closeOpenPage({
path: `/redirect/${"consultingOrgManagement/projectDetail"}`, path: `/redirect/${"consultingOrgManagement/projectDetail"}`,
query: { query: {
projectKey: this.projectKey, 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