perf: 调整

This commit is contained in:
rd
2025-07-17 09:58:49 +08:00
parent 0f94c630b6
commit 123f2ce3db
4 changed files with 19 additions and 59 deletions

View File

@ -48,7 +48,9 @@ const form = reactive({
name: '',
});
const enterpriseInfo = store.enterpriseInfo;
const enterpriseInfo = computed(() => {
return store.enterpriseInfo ?? {};
});
const columns = [
{
@ -65,11 +67,13 @@ const infoVisible = ref(false);
const customerServiceVisible = ref(false);
const dataSource = computed(() => {
return enterpriseInfo ? [enterpriseInfo] : [];
return enterpriseInfo.value ? [enterpriseInfo.value] : [];
});
console.log({ dataSource });
const canUpdate = computed(() => {
if (!enterpriseInfo) return false;
return enterpriseInfo.update_name_quota > enterpriseInfo.used_update_name_count;
if (!enterpriseInfo.value) return false;
return enterpriseInfo.value.update_name_quota > enterpriseInfo.value.used_update_name_count;
});
const okText = computed(() => {
@ -81,7 +85,7 @@ const okText = computed(() => {
function handleUpdate() {
if (!canUpdate.value) {
form.name = enterpriseInfo!.name;
form.name = enterpriseInfo.value?.name;
}
infoVisible.value = true;
}