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