fix(CRUD):修复生成的代码在添加时权重字段无效的问题

This commit is contained in:
妙码生花 2022-06-16 15:25:29 +08:00
parent c5c0451c05
commit 5297adade8
2 changed files with 6 additions and 2 deletions

View File

@ -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]]);
}
}

View File

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