From 0c81362850314afd2a6cb5f5d6b332d7ad33058b Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 22 十月 2024 23:29:47 +0800 Subject: [PATCH] 模板生成预览 --- src/views/tigerprojects/system/lowcode/high/dtl.vue | 31 +++++++++++++++++++------------ 1 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/high/dtl.vue b/src/views/tigerprojects/system/lowcode/high/dtl.vue index 282eac1..4dd220c 100644 --- a/src/views/tigerprojects/system/lowcode/high/dtl.vue +++ b/src/views/tigerprojects/system/lowcode/high/dtl.vue @@ -173,20 +173,20 @@ function createActions(record, index, item) { const params = { record, - isUpdate: true, - ifSave: objParams.value['ifSave'], - entityName: props.entityName, - formJson: [], //getFormSchema(`${entityName.value}_Crud`), - cType, + isUpdate: true, //鏄洿鏂拌繕鏄柊澧� + ifSave: objParams.value['ifSave'], //鏄惁鐩存帴淇濆瓨琛ㄥ崟鍒版暟鎹簱锛宖alse鐨勮瘽瑕佹渶鍚庝竴璧锋彁浜� + entityName: props.entityName, //瀹炰綋鍚嶇О + formJson: [], //getFormSchema(`${entityName.value}_Crud`), //琛ㄥ崟缁撴瀯 + cType, //绫诲瀷锛屼互姝ゆ潵纭畾鏄摢绉嶆柟娉曟垨鑰呯粨鏋勶紝鏍规嵁瀹為檯鎯呭喌鑰屽畾 dtlSlots, useModalData, useFormData, crudColSlots: isNullOrUnDef(objParams.value['crudColSlots']) - ? {} - : objParams.value['crudColSlots'][item['name']], + ? [] + : objParams.value['crudColSlots'][item['name']], //鎻掓Ы鍒楄〃 data, name: item.name, //drawers鍒楄〃閲岄潰鐨刵ame锛岃〃绀烘槸鍝竴涓疄浣擄紝涔熷氨鏄珮绾ц〃鍗曚腑琛ㄦ牸鐨勫悕瀛� - keyName: item.keyName, + keyName: item.keyName, //瀹為檯鐢ㄦ潵纭畾鍔ㄦ�佸紩鍏ュ疄浣�.ts鐨勫疄浣撳悕绉� }; const actionItem = [ { @@ -268,9 +268,16 @@ validate().then((res) => { const Keys = Object.getOwnPropertyNames(useFormData.value); for (const i in Keys) { - keyFieldValues.value[item['code']] = objParams.value['IsID'] - ? res[Keys[i]]['ID'] - : res[Keys[i]][item['code']]; + const _Keys = Object.getOwnPropertyNames(res[Keys[i]]); + for (const j in _Keys) { + if (_Keys[j] == item['code']) { + keyFieldValues.value[item['code']] = objParams.value['IsID'] + ? res[Keys[i]]['ID'] + : res[Keys[i]][item['code']]; + } else if (_Keys[j] != 'ID') { + keyFieldValues.value[_Keys[j]] = res[Keys[i]][_Keys[j]]; + } + } } useDrawers[index][item['name']][1].openDrawer(true, { isUpdate: false, @@ -278,7 +285,7 @@ entityName: item['name'], //props.entityName, // formJson: GetCrudForm(item, data), //鑾峰彇澧炲垹鏀硅〃鍗曞瓧娈� crudColSlots: isNullOrUnDef(objParams.value['crudColSlots']) - ? {} + ? [] : objParams.value['crudColSlots'][item['name']], keyFieldValues: keyFieldValues.value, data, -- Gitblit v1.9.3