mirror of https://github.com/jeecgboot/jeecg-boot
parent
a47d0984dc
commit
4a857680d0
|
@ -132,8 +132,14 @@
|
||||||
function edit(record) {
|
function edit(record) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resetFields();
|
resetFields();
|
||||||
|
const tmpData = {};
|
||||||
|
Object.keys(formData).forEach((key) => {
|
||||||
|
if(record.hasOwnProperty(key)){
|
||||||
|
tmpData[key] = record[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
//赋值
|
//赋值
|
||||||
Object.assign(formData, record);
|
Object.assign(formData, tmpData);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,9 +157,15 @@
|
||||||
resetFields();
|
resetFields();
|
||||||
expandedRowKeys.value = [];
|
expandedRowKeys.value = [];
|
||||||
treeData.value = await loadTreeData({ async: false, pcode: '' });
|
treeData.value = await loadTreeData({ async: false, pcode: '' });
|
||||||
|
const tmpData = {};
|
||||||
|
Object.keys(formData).forEach((key) => {
|
||||||
|
if(record.hasOwnProperty(key)){
|
||||||
|
tmpData[key] = record[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
//赋值
|
//赋值
|
||||||
Object.assign(formData, record);
|
Object.assign(formData,tmpData);
|
||||||
model = record
|
model = tmpData
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,8 +131,14 @@
|
||||||
function edit(record) {
|
function edit(record) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resetFields();
|
resetFields();
|
||||||
|
const tmpData = {};
|
||||||
|
Object.keys(formData).forEach((key) => {
|
||||||
|
if(record.hasOwnProperty(key)){
|
||||||
|
tmpData[key] = record[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
//赋值
|
//赋值
|
||||||
Object.assign(formData, record);
|
Object.assign(formData,tmpData);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,8 +100,14 @@
|
||||||
function edit(record) {
|
function edit(record) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resetFields();
|
resetFields();
|
||||||
|
const tmpData = {};
|
||||||
|
Object.keys(formData).forEach((key) => {
|
||||||
|
if(record.hasOwnProperty(key)){
|
||||||
|
tmpData[key] = record[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
//赋值
|
//赋值
|
||||||
Object.assign(formData, record);
|
Object.assign(formData,tmpData);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,9 +241,14 @@
|
||||||
|
|
||||||
async function queryMainData(id) {
|
async function queryMainData(id) {
|
||||||
const row = await queryDataById(id);
|
const row = await queryDataById(id);
|
||||||
Object.keys(row).map(k => {
|
const tmpData = {};
|
||||||
formData[k] = row[k];
|
Object.keys(formData).forEach((key) => {
|
||||||
});
|
if(row.hasOwnProperty(key)){
|
||||||
|
tmpData[key] = row[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData,tmpData);
|
||||||
}
|
}
|
||||||
|
|
||||||
const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
|
const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
|
||||||
|
|
|
@ -93,15 +93,20 @@
|
||||||
|
|
||||||
async function initFormData(mainId) {
|
async function initFormData(mainId) {
|
||||||
resetFields();
|
resetFields();
|
||||||
|
let tmpData = {}
|
||||||
if(mainId){
|
if(mainId){
|
||||||
let list = await query${sub.entityName}ListByMainId(mainId);
|
let list = await query${sub.entityName}ListByMainId(mainId);
|
||||||
if(list && list.length>0){
|
if(list && list.length>0){
|
||||||
let temp = list[0];
|
let temp = list[0];
|
||||||
Object.keys(temp).map(k=>{
|
Object.keys(formData).forEach((key) => {
|
||||||
formData[k] = temp[k];
|
if(temp.hasOwnProperty(key)){
|
||||||
|
tmpData[key] = temp[key]
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData,tmpData);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getFormData() {
|
async function getFormData() {
|
||||||
|
|
Loading…
Reference in New Issue