Merge branch 'main' of http://123.132.248.154:10000/HC_YFZX/CaiYuanYiTiHua
commit
baa6ea9afb
|
|
@ -20,6 +20,12 @@
|
||||||
@click="codeClickFunction('beforeSetData', beforeSetData)"
|
@click="codeClickFunction('beforeSetData', beforeSetData)"
|
||||||
@change="codeClickFunction('changeDataEvent', changeDataEvent)"
|
@change="codeClickFunction('changeDataEvent', changeDataEvent)"
|
||||||
/>
|
/>
|
||||||
|
<CardGourp
|
||||||
|
v-if="cardGroupData.length > 0 && cardGroupData[index]"
|
||||||
|
:data="cardGroupData[index]"
|
||||||
|
:formData="cardGourpFormData"
|
||||||
|
:parentValue="cardGroupData[index].field"
|
||||||
|
/>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -51,6 +57,14 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="tabsColumns.length < 1">
|
||||||
|
<CardGourp
|
||||||
|
v-if="cardGroupData.length > 0"
|
||||||
|
:data="cardGroupData[0]"
|
||||||
|
:formData="cardGourpFormData"
|
||||||
|
:parentValue="cardGroupData[0].field"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
<template v-for="(item, index) in buttonLayout" :key="index">
|
<template v-for="(item, index) in buttonLayout" :key="index">
|
||||||
<a-row style="width: 100%">
|
<a-row style="width: 100%">
|
||||||
<a-col :span="item?.colProps?.span || 24" style="padding: 10px">
|
<a-col :span="item?.colProps?.span || 24" style="padding: 10px">
|
||||||
|
|
@ -107,6 +121,10 @@
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import FormItem from './ShowFormModal/FormItem/index.vue';
|
import FormItem from './ShowFormModal/FormItem/index.vue';
|
||||||
import CallModalFormItem from './CallModalFormItem/index.vue';
|
import CallModalFormItem from './CallModalFormItem/index.vue';
|
||||||
|
import { CardGourp } from '@/components/FormViewer/index.ts'
|
||||||
|
import { subTableStore } from '@/store/modules/subTable';
|
||||||
|
|
||||||
|
const subTableDataStore = subTableStore();
|
||||||
|
|
||||||
// import FormRender from '@/views/demo/form-design/components/VFormCreate/components/FormRender.vue';
|
// import FormRender from '@/views/demo/form-design/components/VFormCreate/components/FormRender.vue';
|
||||||
|
|
||||||
|
|
@ -127,6 +145,9 @@
|
||||||
userId: userInfo.id,
|
userId: userInfo.id,
|
||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
const cardGroupData = ref([]);
|
||||||
|
const cardGourpFormData = ref({});
|
||||||
|
const cardGroupValues = ref({})
|
||||||
const subTableId = ref(null);
|
const subTableId = ref(null);
|
||||||
const subTableColumns: any = ref([]);
|
const subTableColumns: any = ref([]);
|
||||||
const subTableData = ref([]);
|
const subTableData = ref([]);
|
||||||
|
|
@ -153,8 +174,22 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const getCardGroupLayoutKey = (dataList) => {
|
||||||
|
console.log('dataList',dataList)
|
||||||
|
dataList.children.forEach((item?) => {
|
||||||
|
if (['CardGroup'].includes(item.component)) {
|
||||||
|
cardGroupValues.value[item.field] = ""
|
||||||
|
item.componentProps.options.forEach(childItem => {
|
||||||
|
getCardGroupLayoutKey(childItem);
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
cardGroupValues.value[item.field] = "";
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner((data: any) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner((data: any) => {
|
||||||
cardLayout.value = [];
|
cardLayout.value = [];
|
||||||
|
subTableDataStore.clearGoupData();
|
||||||
console.log('daaaaa', data);
|
console.log('daaaaa', data);
|
||||||
// 脚本
|
// 脚本
|
||||||
beforeSetData.value = data?.beforeSetData;
|
beforeSetData.value = data?.beforeSetData;
|
||||||
|
|
@ -181,6 +216,12 @@
|
||||||
if (opt.component === 'Card') {
|
if (opt.component === 'Card') {
|
||||||
cardLayout.value.push(opt);
|
cardLayout.value.push(opt);
|
||||||
}
|
}
|
||||||
|
if (opt.component === 'CardGroup') {
|
||||||
|
if(cardGroupData.value.length !== index){
|
||||||
|
cardGroupData.value.push(null)
|
||||||
|
}
|
||||||
|
cardGroupData.value.push(opt);
|
||||||
|
}
|
||||||
if (opt.component === 'Button') {
|
if (opt.component === 'Button') {
|
||||||
buttonLayout.value.push(opt);
|
buttonLayout.value.push(opt);
|
||||||
}
|
}
|
||||||
|
|
@ -279,6 +320,13 @@
|
||||||
if (item.component === 'Card') {
|
if (item.component === 'Card') {
|
||||||
cardLayout.value.push(item);
|
cardLayout.value.push(item);
|
||||||
}
|
}
|
||||||
|
if (item.component === 'CardGroup') {
|
||||||
|
cardGroupValues.value[item.field] = "";
|
||||||
|
item.componentProps.options.forEach(childItem => {
|
||||||
|
getCardGroupLayoutKey(childItem)
|
||||||
|
})
|
||||||
|
cardGroupData.value.push(item);
|
||||||
|
}
|
||||||
if (item.component === 'Button') {
|
if (item.component === 'Button') {
|
||||||
buttonLayout.value.push(item);
|
buttonLayout.value.push(item);
|
||||||
}
|
}
|
||||||
|
|
@ -350,6 +398,10 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Object.keys(cardGroupValues.value).forEach(item => {
|
||||||
|
cardGroupValues.value[item] = data.infoUseMainTableData[item]
|
||||||
|
})
|
||||||
|
subTableDataStore.setGroupData(cardGroupValues.value)
|
||||||
}
|
}
|
||||||
if (!unref(isUpdate) && unref(isDetail)) {
|
if (!unref(isUpdate) && unref(isDetail)) {
|
||||||
getTitle.value = '详情';
|
getTitle.value = '详情';
|
||||||
|
|
@ -369,6 +421,10 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Object.keys(cardGroupValues.value).forEach(item => {
|
||||||
|
cardGroupValues.value[item] = data.infoUseMainTableData[item]
|
||||||
|
})
|
||||||
|
subTableDataStore.setGroupData(cardGroupValues.value)
|
||||||
}
|
}
|
||||||
formModalVisible.value = true;
|
formModalVisible.value = true;
|
||||||
primaryQuery.value = data.query;
|
primaryQuery.value = data.query;
|
||||||
|
|
@ -504,6 +560,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
query = {...query, ...subTableDataStore.getGroupData}
|
||||||
params.data = JSON.stringify(query);
|
params.data = JSON.stringify(query);
|
||||||
console.log('query222', query);
|
console.log('query222', query);
|
||||||
console.log('params222', params);
|
console.log('params222', params);
|
||||||
|
|
|
||||||
|
|
@ -573,7 +573,7 @@
|
||||||
let formObj = JSON.parse(res.formScheme.scheme);
|
let formObj = JSON.parse(res.formScheme.scheme);
|
||||||
console.log('formObj', formObj);
|
console.log('formObj', formObj);
|
||||||
// 将card嵌套起来
|
// 将card嵌套起来
|
||||||
if (formObj.formInfo.tabList && formObj.formInfo.tabList.length > 1) {
|
if (formObj.formInfo.tabList && formObj.formInfo.tabList.length > 0) {
|
||||||
formObj.formInfo.tabList = cardNestStructure(formObj.formInfo.tabList);
|
formObj.formInfo.tabList = cardNestStructure(formObj.formInfo.tabList);
|
||||||
const arr: any = [];
|
const arr: any = [];
|
||||||
formObj.formInfo.tabList.forEach((item, index) => {
|
formObj.formInfo.tabList.forEach((item, index) => {
|
||||||
|
|
@ -730,24 +730,24 @@
|
||||||
};
|
};
|
||||||
getFormData(params)
|
getFormData(params)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let childTableName = designData.value.db.find((item) => item.type === 'chlid').name;
|
let childTableName = designData.value.db.find((item) => item.type === 'chlid')?.name;
|
||||||
let mainTableName = designData.value.db.find((item) => item.type === 'main').name;
|
let mainTableName = designData.value.db.find((item) => item.type === 'main').name;
|
||||||
let subTableData = res[childTableName].map((item) => {
|
let subTableData = res[childTableName]? res[childTableName].map((item) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
key: uuidv4(),
|
key: uuidv4(),
|
||||||
MapGeom: item.mapgeom,
|
MapGeom: item.mapgeom,
|
||||||
};
|
};
|
||||||
});
|
}): [];
|
||||||
|
|
||||||
formData.value = [...subTableData];
|
formData.value = [...subTableData];
|
||||||
|
|
||||||
infoUseSubTableData.value = res[childTableName].map((item) => {
|
infoUseSubTableData.value = res[childTableName]? res[childTableName].map((item) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
key: uuidv4(),
|
key: uuidv4(),
|
||||||
};
|
};
|
||||||
});
|
}): [];
|
||||||
|
|
||||||
res[mainTableName].forEach((item) => {
|
res[mainTableName].forEach((item) => {
|
||||||
infoUseMainTableData.value = { ...infoUseMainTableData.value, ...item };
|
infoUseMainTableData.value = { ...infoUseMainTableData.value, ...item };
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue