optimize(manage): replace Object.assign with jsonClone for safer data handling in model initialization

This commit is contained in:
Soybean
2025-10-27 18:18:33 +08:00
parent 93cbde737a
commit 0919dd0743
4 changed files with 14 additions and 20 deletions

View File

@ -1,4 +1,6 @@
<script setup lang="ts">
import { toRaw } from 'vue';
import { jsonClone } from '@sa/utils';
import { enableStatusOptions } from '@/constants/business';
import { translateOptions } from '@/utils/common';
import { $t } from '@/locales';
@ -15,14 +17,10 @@ const emit = defineEmits<Emits>();
const model = defineModel<Api.SystemManage.RoleSearchParams>('model', { required: true });
const defaultModel = jsonClone(toRaw(model.value));
function resetModel() {
model.value = {
current: 1,
size: 10,
roleName: null,
roleCode: null,
status: null
};
Object.assign(model.value, defaultModel);
}
function search() {