From 5297adade8894798bb44ee2a02dc0351eaf60c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com> Date: Thu, 16 Jun 2022 15:25:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(CRUD):=E4=BF=AE=E5=A4=8D=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E5=9C=A8=E6=B7=BB=E5=8A=A0=E6=97=B6?= =?UTF-8?q?=E6=9D=83=E9=87=8D=E5=AD=97=E6=AE=B5=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/command/Crud/stubs/mixins/modeAfterInsert.stub | 6 ++++-- web/src/components/baInput/index.vue | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/admin/command/Crud/stubs/mixins/modeAfterInsert.stub b/app/admin/command/Crud/stubs/mixins/modeAfterInsert.stub index 6eb1db42..f67f48be 100644 --- a/app/admin/command/Crud/stubs/mixins/modeAfterInsert.stub +++ b/app/admin/command/Crud/stubs/mixins/modeAfterInsert.stub @@ -1,6 +1,8 @@ protected static function onAfterInsert($model) { - $pk = $model->getPk(); - $model->where($pk, $model[$pk])->update(['{%order%}' => $model[$pk]]); + if ($model->weigh == 0) { + $pk = $model->getPk(); + $model->where($pk, $model[$pk])->update(['{%order%}' => $model[$pk]]); + } } \ No newline at end of file diff --git a/web/src/components/baInput/index.vue b/web/src/components/baInput/index.vue index 314bddab..46961e54 100644 --- a/web/src/components/baInput/index.vue +++ b/web/src/components/baInput/index.vue @@ -90,6 +90,7 @@ export default defineComponent({ return () => { const valueComputed = computed(() => { if (props.type == 'radio') { + if (props.modelValue == undefined) return '' return '' + props.modelValue } else { let modelValueArr: anyObj = [] @@ -129,6 +130,7 @@ export default defineComponent({ return () => { const valueComputed = computed(() => { if (props.type == 'select') { + if (props.modelValue == undefined) return '' return '' + props.modelValue } else { let modelValueArr: anyObj = []