From 4a9b45dc01fc2a9194c998f72c87aeaf2392cd61 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期五, 20 九月 2024 12:04:16 +0800 Subject: [PATCH] 一些更改 --- src/views/tigerprojects/system/lowcode/high/dtl.vue | 35 +++++++++++++++++++++++------------ 1 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/high/dtl.vue b/src/views/tigerprojects/system/lowcode/high/dtl.vue index 7cab36d..4dd220c 100644 --- a/src/views/tigerprojects/system/lowcode/high/dtl.vue +++ b/src/views/tigerprojects/system/lowcode/high/dtl.vue @@ -173,18 +173,20 @@ function createActions(record, index, item) { const params = { record, - isUpdate: true, - ifSave: true, - 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: props.crudColSlots, + crudColSlots: isNullOrUnDef(objParams.value['crudColSlots']) + ? [] + : objParams.value['crudColSlots'][item['name']], //鎻掓Ы鍒楄〃 data, name: item.name, //drawers鍒楄〃閲岄潰鐨刵ame锛岃〃绀烘槸鍝竴涓疄浣擄紝涔熷氨鏄珮绾ц〃鍗曚腑琛ㄦ牸鐨勫悕瀛� - keyName: item.keyName, + keyName: item.keyName, //瀹為檯鐢ㄦ潵纭畾鍔ㄦ�佸紩鍏ュ疄浣�.ts鐨勫疄浣撳悕绉� }; const actionItem = [ { @@ -266,16 +268,25 @@ 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, - ifSave: true, + ifSave: objParams.value['ifSave'], entityName: item['name'], //props.entityName, // formJson: GetCrudForm(item, data), //鑾峰彇澧炲垹鏀硅〃鍗曞瓧娈� - crudColSlots: props.crudColSlots, + crudColSlots: isNullOrUnDef(objParams.value['crudColSlots']) + ? [] + : objParams.value['crudColSlots'][item['name']], keyFieldValues: keyFieldValues.value, data, name: item['name'], //drawers鍒楄〃閲岄潰鐨刵ame锛岃〃绀烘槸鍝竴涓疄浣擄紝涔熷氨鏄珮绾ц〃鍗曚腑琛ㄦ牸鐨勫悕瀛� -- Gitblit v1.9.3