feat: 统一detailVisible使用useBoolean hook
This commit is contained in:
parent
564d18f6b7
commit
f70d061e2a
@ -1,6 +1,7 @@
|
||||
<script setup lang="tsx">
|
||||
import { NButton, NTag } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useBoolean } from '@sa/hooks';
|
||||
import { fetchGetGroupConfigList, fetchUpdateGroupStatus } from '@/service/api';
|
||||
import { $t } from '@/locales';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
@ -17,7 +18,7 @@ const appStore = useAppStore();
|
||||
/** 详情页属性数据 */
|
||||
const detailData = ref<Api.GroupConfig.GroupConfig | null>();
|
||||
/** 详情页可见状态 */
|
||||
const detailVisible = ref(false);
|
||||
const { bool: detailVisible, setTrue: openDetail } = useBoolean(false);
|
||||
|
||||
const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({
|
||||
apiFn: fetchGetGroupConfigList,
|
||||
@ -41,7 +42,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
render: row => {
|
||||
function showDetailDrawer() {
|
||||
detailData.value = row || null;
|
||||
detailVisible.value = true;
|
||||
openDetail();
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -1,6 +1,7 @@
|
||||
<script setup lang="tsx">
|
||||
import { NButton, NPopconfirm, NTag } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useBoolean } from '@sa/hooks';
|
||||
import { fetchGetNotifyRecipientPageList } from '@/service/api';
|
||||
import { $t } from '@/locales';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
@ -11,10 +12,11 @@ import NotifyRecipientSearch from './modules/notify-recipient-search.vue';
|
||||
import NotifyRecipientDetailDrawer from './modules/notify-recipient-detail-drawer.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const detailData = ref();
|
||||
const detailVisible = defineModel<boolean>('detailVisible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
/** 详情页属性数据 */
|
||||
const detailData = ref<Api.NotifyRecipient.NotifyRecipient | null>();
|
||||
/** 详情页可见状态 */
|
||||
const { bool: detailVisible, setTrue: openDetail } = useBoolean(false);
|
||||
|
||||
const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({
|
||||
apiFn: fetchGetNotifyRecipientPageList,
|
||||
@ -46,7 +48,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
render: row => {
|
||||
function showDetailDrawer() {
|
||||
detailData.value = row || null;
|
||||
detailVisible.value = true;
|
||||
openDetail();
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -1,6 +1,7 @@
|
||||
<script setup lang="tsx">
|
||||
import { NButton, NPopconfirm, NTag } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useBoolean } from '@sa/hooks';
|
||||
import { fetchGetNotifyConfigList, fetchUpdateNotifyStatus } from '@/service/api';
|
||||
import { $t } from '@/locales';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
@ -13,10 +14,11 @@ import { jobNotifyScene, retryNotifyScene, systemTaskType } from '@/constants/bu
|
||||
import { tagColor } from '@/utils/common';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const detailData = ref();
|
||||
const detailVisible = defineModel<boolean>('detailVisible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
/** 详情页属性数据 */
|
||||
const detailData = ref<Api.NotifyConfig.NotifyConfig | null>();
|
||||
/** 详情页可见状态 */
|
||||
const { bool: detailVisible, setTrue: openDetail } = useBoolean(false);
|
||||
|
||||
const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({
|
||||
apiFn: fetchGetNotifyConfigList,
|
||||
@ -49,7 +51,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
render: row => {
|
||||
function showDetailDrawer() {
|
||||
detailData.value = row || null;
|
||||
detailVisible.value = true;
|
||||
openDetail();
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -1,6 +1,7 @@
|
||||
<script setup lang="tsx">
|
||||
import { NButton, NPopconfirm, NTag } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useBoolean } from '@sa/hooks';
|
||||
import {
|
||||
fetchDeleteRetryDeadLetter,
|
||||
fetchGetRetryDeadLetterById,
|
||||
@ -16,10 +17,11 @@ import RetryDeadLetterSearch from './modules/dead-letter-search.vue';
|
||||
import RetryDeadLetterDetailDrawer from './modules/retry-letter-detail-drawer.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const detailData = ref();
|
||||
const detailVisible = defineModel<boolean>('detailVisible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
/** 详情页属性数据 */
|
||||
const detailData = ref<Api.RetryDeadLetter.DeadLetter | null>();
|
||||
/** 详情页可见状态 */
|
||||
const { bool: detailVisible, setTrue: openDetail } = useBoolean(false);
|
||||
|
||||
const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({
|
||||
apiFn: fetchGetRetryDeadLetterPageList,
|
||||
@ -49,7 +51,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
render: row => {
|
||||
async function showDetailDrawer() {
|
||||
await loadRetryInfo(row);
|
||||
detailVisible.value = true;
|
||||
openDetail();
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -1,6 +1,7 @@
|
||||
<script setup lang="tsx">
|
||||
import { NButton, NPopconfirm, NTag } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useBoolean } from '@sa/hooks';
|
||||
import { fetchBatchDeleteRetryLog, fetchDeleteRetryLog, fetchRetryLogById, fetchRetryLogPageList } from '@/service/api';
|
||||
import { $t } from '@/locales';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
@ -11,10 +12,11 @@ import RetryLogSearch from './modules/retry-log-search.vue';
|
||||
import RetryLogDetailDrawer from './modules/retry-log-detail-drawer.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const detailData = ref();
|
||||
const detailVisible = defineModel<boolean>('detailVisible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
/** 详情页属性数据 */
|
||||
const detailData = ref<Api.RetryLog.RetryLog | null>();
|
||||
/** 详情页可见状态 */
|
||||
const { bool: detailVisible, setTrue: openDetail } = useBoolean(false);
|
||||
|
||||
const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({
|
||||
apiFn: fetchRetryLogPageList,
|
||||
@ -50,7 +52,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
render: row => {
|
||||
async function showDetailDrawer() {
|
||||
await loadRetryInfo(row);
|
||||
detailVisible.value = true;
|
||||
openDetail();
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -1,6 +1,7 @@
|
||||
<script setup lang="tsx">
|
||||
import { NButton, NTag } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useBoolean } from '@sa/hooks';
|
||||
import { fetchGetRetryScenePageList, fetchUpdateSceneStatus } from '@/service/api';
|
||||
import { $t } from '@/locales';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
@ -12,10 +13,11 @@ import SceneSearch from './modules/scene-search.vue';
|
||||
import SceneDetailDrawer from './modules/scene-detail-drawer.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const detailData = ref();
|
||||
const detailVisible = defineModel<boolean>('detailVisible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
/** 详情页属性数据 */
|
||||
const detailData = ref<Api.RetryScene.Scene | null>();
|
||||
/** 详情页可见状态 */
|
||||
const { bool: detailVisible, setTrue: openDetail } = useBoolean(false);
|
||||
|
||||
const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({
|
||||
apiFn: fetchGetRetryScenePageList,
|
||||
@ -37,7 +39,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
render: row => {
|
||||
function showDetailDrawer() {
|
||||
detailData.value = row || null;
|
||||
detailVisible.value = true;
|
||||
openDetail();
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -19,10 +19,11 @@ import RetryTaskOperateDrawer from './modules/retry-task-operate-drawer.vue';
|
||||
import RetryTaskBatchAddDrawer from './modules/retry-task-batch-add-drawer.vue';
|
||||
import RetryTaskSearch from './modules/retry-task-search.vue';
|
||||
import RetryTaskDetailDrawerVue from './modules/retry-task-detail-drawer.vue';
|
||||
const detailData = ref();
|
||||
const detailVisible = defineModel<boolean>('detailVisible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
/** 详情页属性数据 */
|
||||
const detailData = ref<Api.RetryTask.RetryTask | null>();
|
||||
/** 详情页可见状态 */
|
||||
const { bool: detailVisible, setTrue: openDetail } = useBoolean(false);
|
||||
|
||||
const appStore = useAppStore();
|
||||
|
||||
@ -52,7 +53,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
render: row => {
|
||||
async function showDetailDrawer() {
|
||||
await loadRetryInfo(row);
|
||||
detailVisible.value = true;
|
||||
openDetail();
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -1,6 +1,7 @@
|
||||
<script setup lang="tsx">
|
||||
import { NButton, NPopconfirm, NTag } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useBoolean } from '@sa/hooks';
|
||||
import { fetchDelUser, fetchGetUserPageList } from '@/service/api';
|
||||
import { $t } from '@/locales';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
@ -11,10 +12,11 @@ import UserManagerSearch from './modules/user-manager-search.vue';
|
||||
import UserManagerDetailDrawer from './modules/user-manager-detail-drawer.vue';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const detailData = ref();
|
||||
const detailVisible = defineModel<boolean>('detailVisible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
/** 详情页属性数据 */
|
||||
const detailData = ref<Api.UserManager.UserManager | null>();
|
||||
/** 详情页可见状态 */
|
||||
const { bool: detailVisible, setTrue: openDetail } = useBoolean(false);
|
||||
|
||||
const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({
|
||||
apiFn: fetchGetUserPageList,
|
||||
@ -63,7 +65,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
render: row => {
|
||||
function showDetailDrawer() {
|
||||
detailData.value = row || null;
|
||||
detailVisible.value = true;
|
||||
openDetail();
|
||||
}
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user