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 = []