perf: 调整
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user