pull/370/head
xiaojunnuo 2025-04-08 23:36:50 +08:00
parent 64e5449ab3
commit 4bb0918e27
24 changed files with 113 additions and 91 deletions

View File

@ -95,6 +95,7 @@ export const certdResources = [
meta: { meta: {
icon: "ion:link-outline", icon: "ion:link-outline",
auth: true, auth: true,
keepAlive: true,
}, },
}, },
{ {
@ -105,6 +106,7 @@ export const certdResources = [
meta: { meta: {
icon: "mdi:format-list-group", icon: "mdi:format-list-group",
auth: true, auth: true,
keepAlive: true,
}, },
}, },
@ -198,6 +200,7 @@ export const certdResources = [
}, },
icon: "ion:bag-check-outline", icon: "ion:bag-check-outline",
auth: true, auth: true,
keepAlive: true,
}, },
}, },
{ {

View File

@ -87,6 +87,7 @@ export const sysResources = [
}, },
icon: "ion:menu", icon: "ion:menu",
permission: "sys:settings:view", permission: "sys:settings:view",
keepAlive: true,
}, },
}, },
{ {
@ -101,6 +102,7 @@ export const sysResources = [
}, },
icon: "ion:disc-outline", icon: "ion:disc-outline",
permission: "sys:settings:view", permission: "sys:settings:view",
keepAlive: true,
}, },
}, },
{ {
@ -160,6 +162,7 @@ export const sysResources = [
icon: "ion:list-outline", icon: "ion:list-outline",
//需要校验权限 //需要校验权限
permission: "sys:auth:per:view", permission: "sys:auth:per:view",
keepAlive: true,
}, },
}, },
{ {
@ -170,6 +173,7 @@ export const sysResources = [
meta: { meta: {
icon: "ion:people-outline", icon: "ion:people-outline",
permission: "sys:auth:role:view", permission: "sys:auth:role:view",
keepAlive: true,
}, },
}, },
{ {
@ -180,6 +184,7 @@ export const sysResources = [
meta: { meta: {
icon: "ion:person-outline", icon: "ion:person-outline",
permission: "sys:auth:user:view", permission: "sys:auth:user:view",
keepAlive: true,
}, },
}, },
@ -195,6 +200,7 @@ export const sysResources = [
const settingStore = useSettingStore(); const settingStore = useSettingStore();
return settingStore.isComm; return settingStore.isComm;
}, },
keepAlive: true,
}, },
children: [ children: [
{ {
@ -223,6 +229,7 @@ export const sysResources = [
}, },
icon: "ion:bag-check", icon: "ion:bag-check",
permission: "sys:settings:edit", permission: "sys:settings:edit",
keepAlive: true,
}, },
}, },
{ {
@ -237,6 +244,7 @@ export const sysResources = [
}, },
icon: "ion:gift-outline", icon: "ion:gift-outline",
auth: true, auth: true,
keepAlive: true,
}, },
}, },
], ],

View File

@ -32,8 +32,8 @@ export default defineComponent({
return { return {
crudBinding, crudBinding,
crudRef crudRef,
}; };
} },
}); });
</script> </script>

View File

@ -19,14 +19,14 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from "vue"; import { onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue"; import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api"; import { DeleteBatch } from "./api";
defineOptions({ defineOptions({
name: "CnameRecord" name: "CnameRecord",
}); });
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions }); const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
@ -41,7 +41,7 @@ const handleBatchDelete = () => {
message.info("删除成功"); message.info("删除成功");
crudExpose.doRefresh(); crudExpose.doRefresh();
selectedRowKeys.value = []; selectedRowKeys.value = [];
} },
}); });
} else { } else {
message.error("请先勾选记录"); message.error("请先勾选记录");
@ -52,7 +52,8 @@ const handleBatchDelete = () => {
onMounted(() => { onMounted(() => {
crudExpose.doRefresh(); crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
</script> </script>
<style lang="less"> <style lang="less"></style>
</style>

View File

@ -14,14 +14,14 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {onActivated, onMounted} from "vue"; import { onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue"; import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api"; import { DeleteBatch } from "./api";
defineOptions({ defineOptions({
name: "PipelineHistory" name: "PipelineHistory",
}); });
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions }); const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
@ -36,7 +36,7 @@ const handleBatchDelete = () => {
message.info("删除成功"); message.info("删除成功");
crudExpose.doRefresh(); crudExpose.doRefresh();
selectedRowKeys.value = []; selectedRowKeys.value = [];
} },
}); });
} else { } else {
message.error("请先勾选记录"); message.error("请先勾选记录");

View File

@ -24,7 +24,7 @@ import { siteInfoApi } from "./api";
import { Modal, notification } from "ant-design-vue"; import { Modal, notification } from "ant-design-vue";
import { useSettingStore } from "/@/store/modules/settings"; import { useSettingStore } from "/@/store/modules/settings";
defineOptions({ defineOptions({
name: "SiteCertMonitor" name: "SiteCertMonitor",
}); });
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} }); const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
const settingStore = useSettingStore(); const settingStore = useSettingStore();
@ -36,9 +36,9 @@ function checkAll() {
await siteInfoApi.CheckAll(); await siteInfoApi.CheckAll();
notification.success({ notification.success({
message: "检查任务已提交", message: "检查任务已提交",
description: "请稍后刷新页面查看结果" description: "请稍后刷新页面查看结果",
}); });
} },
}); });
} }

View File

@ -34,8 +34,8 @@ export default defineComponent({
return { return {
crudBinding, crudBinding,
crudRef crudRef,
}; };
} },
}); });
</script> </script>

View File

@ -17,7 +17,7 @@ import createCrudOptions from "./crud";
import { OPEN_API_DOC } from "/@/views/certd/open/openkey/api"; import { OPEN_API_DOC } from "/@/views/certd/open/openkey/api";
defineOptions({ defineOptions({
name: "OpenKey" name: "OpenKey",
}); });
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} }); const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });

View File

@ -31,8 +31,8 @@ export default defineComponent({
return { return {
crudBinding, crudBinding,
crudRef crudRef,
}; };
} },
}); });
</script> </script>

View File

@ -34,13 +34,7 @@
<div class="duration flex-between mt-5"> <div class="duration flex-between mt-5">
<div class="flex-o duration-label">时长</div> <div class="flex-o duration-label">时长</div>
<div class="duration-list"> <div class="duration-list">
<div <div v-for="dp of product.durationPrices" :key="dp.duration" class="duration-item" :class="{ active: selected.duration === dp.duration }" @click="selected = dp">
v-for="dp of product.durationPrices"
:key="dp.duration"
class="duration-item"
:class="{ active: selected.duration === dp.duration }"
@click="selected = dp"
>
{{ durationDict.dataMap[dp.duration]?.label }} {{ durationDict.dataMap[dp.duration]?.label }}
</div> </div>
</div> </div>
@ -74,8 +68,8 @@ const selected = ref(props.product.durationPrices[0]);
const productTypeDictRef = dict({ const productTypeDictRef = dict({
data: [ data: [
{ value: "suite", label: "套餐", color: "green" }, { value: "suite", label: "套餐", color: "green" },
{ value: "addon", label: "加量包", color: "blue" } { value: "addon", label: "加量包", color: "blue" },
] ],
}); });
const emit = defineEmits(["order"]); const emit = defineEmits(["order"]);

View File

@ -14,14 +14,14 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from "vue"; import { onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue"; import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api"; import { DeleteBatch } from "./api";
defineOptions({ defineOptions({
name: "MyTrade" name: "MyTrade",
}); });
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions }); const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
@ -36,7 +36,7 @@ const handleBatchDelete = () => {
message.info("删除成功"); message.info("删除成功");
crudExpose.doRefresh(); crudExpose.doRefresh();
selectedRowKeys.value = []; selectedRowKeys.value = [];
} },
}); });
} else { } else {
message.error("请先勾选记录"); message.error("请先勾选记录");
@ -47,5 +47,8 @@ const handleBatchDelete = () => {
onMounted(() => { onMounted(() => {
crudExpose.doRefresh(); crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
</script> </script>
<style lang="less"></style> <style lang="less"></style>

View File

@ -11,7 +11,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, onMounted } from "vue"; import { defineComponent, onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "../../certd/access/crud"; import createCrudOptions from "../../certd/access/crud";
import { createAccessApi } from "/@/views/certd/access/api"; import { createAccessApi } from "/@/views/certd/access/api";
@ -27,10 +27,14 @@ export default defineComponent({
crudExpose.doRefresh(); crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
return { return {
crudBinding, crudBinding,
crudRef crudRef,
}; };
} },
}); });
</script> </script>

View File

@ -20,7 +20,7 @@ import * as api from "./api";
import { notification } from "ant-design-vue"; import { notification } from "ant-design-vue";
defineOptions({ defineOptions({
name: "AccountBind" name: "AccountBind",
}); });
const iframeRef = ref(); const iframeRef = ref();
@ -44,7 +44,7 @@ onMounted(() => {
const iframeClient = new IframeClient(iframeRef.value, (e: any) => { const iframeClient = new IframeClient(iframeRef.value, (e: any) => {
notification.error({ notification.error({
message: " error", message: " error",
description: e.message description: e.message,
}); });
}); });
iframeClient.register("getSubjectInfo", async (req: any) => { iframeClient.register("getSubjectInfo", async (req: any) => {
@ -52,33 +52,33 @@ onMounted(() => {
subjectId: settingStore.installInfo.siteId, subjectId: settingStore.installInfo.siteId,
installAt: settingStore.installInfo.installTime, installAt: settingStore.installInfo.installTime,
vipType: settingStore.plusInfo.vipType || "free", vipType: settingStore.plusInfo.vipType || "free",
expiresAt: settingStore.plusInfo.expireTime expiresAt: settingStore.plusInfo.expireTime,
}; };
return subjectInfo; return subjectInfo;
}); });
let preBindUserId: any = null; let preBindUserId: any = null;
iframeClient.register("preBindUser", async (req) => { iframeClient.register("preBindUser", async req => {
const userId = req.data.userId; const userId = req.data.userId;
preBindUserId = userId; preBindUserId = userId;
await api.PreBindUser(userId); await api.PreBindUser(userId);
}); });
iframeClient.register("onBoundUser", async (req) => { iframeClient.register("onBoundUser", async req => {
await api.BindUser(preBindUserId); await api.BindUser(preBindUserId);
}); });
iframeClient.register("unbindUser", async (req) => { iframeClient.register("unbindUser", async req => {
const userId = req.data.userId; const userId = req.data.userId;
await api.UnbindUser(userId); await api.UnbindUser(userId);
}); });
iframeClient.register("updateLicense", async (req) => { iframeClient.register("updateLicense", async req => {
await api.UpdateLicense(req.data); await api.UpdateLicense(req.data);
await settingStore.init(); await settingStore.init();
notification.success({ notification.success({
message: "更新成功", message: "更新成功",
description: "专业版/商业版已激活" description: "专业版/商业版已激活",
}); });
}); });
}); });

View File

@ -8,21 +8,13 @@
<fs-icon :icon="ui.icons.add"></fs-icon> <fs-icon :icon="ui.icons.add"></fs-icon>
添加 添加
</a-button> </a-button>
<fs-permission-tree <fs-permission-tree class="permission-tree mt-10" :tree="crudBinding.data" :checkable="false" :actions="permission" @add="addHandle" @edit="editHandle" @remove="removeHandle"></fs-permission-tree>
class="permission-tree mt-10"
:tree="crudBinding.data"
:checkable="false"
:actions="permission"
@add="addHandle"
@edit="editHandle"
@remove="removeHandle"
></fs-permission-tree>
</fs-crud> </fs-crud>
</fs-page> </fs-page>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, onMounted, ref } from "vue"; import { defineComponent, onActivated, onMounted, ref } from "vue";
import createCrudOptions from "./crud.js"; import createCrudOptions from "./crud.js";
import FsPermissionTree from "./fs-permission-tree.vue"; import FsPermissionTree from "./fs-permission-tree.vue";
import { usePermission } from "/src/plugin/permission"; import { usePermission } from "/src/plugin/permission";
@ -40,6 +32,9 @@ export default defineComponent({
onMounted(async () => { onMounted(async () => {
await crudExpose.doRefresh(); await crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
const { ui } = useUi(); const { ui } = useUi();
@ -59,7 +54,7 @@ export default defineComponent({
const permission = ref({ const permission = ref({
add: hasPermissions("1sys:auth:per:add"), add: hasPermissions("1sys:auth:per:add"),
edit: hasPermissions("1sys:auth:per:edit"), edit: hasPermissions("1sys:auth:per:edit"),
remove: hasPermissions("1sys:auth:per:remove") remove: hasPermissions("1sys:auth:per:remove"),
}); });
return { return {
@ -69,9 +64,9 @@ export default defineComponent({
addHandle, addHandle,
editHandle, editHandle,
removeHandle, removeHandle,
permission permission,
}; };
} },
}); });
</script> </script>
<style lang="less"> <style lang="less">

View File

@ -5,21 +5,13 @@
</template> </template>
<fs-crud ref="crudRef" v-bind="crudBinding" /> <fs-crud ref="crudRef" v-bind="crudBinding" />
<a-modal v-model:open="authzDialogVisible" width="860px" title="分配权限" @ok="updatePermission"> <a-modal v-model:open="authzDialogVisible" width="860px" title="分配权限" @ok="updatePermission">
<fs-permission-tree <fs-permission-tree ref="permissionTreeRef" v-model:checked-keys="checkedKeys" :tree="permissionTreeData" :editable="false" checkable :replace-fields="{ key: 'id', label: 'title' }"> </fs-permission-tree>
ref="permissionTreeRef"
v-model:checked-keys="checkedKeys"
:tree="permissionTreeData"
:editable="false"
checkable
:replace-fields="{ key: 'id', label: 'title' }"
>
</fs-permission-tree>
</a-modal> </a-modal>
</fs-page> </fs-page>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, onMounted, ref } from "vue"; import { defineComponent, onActivated, onMounted, ref } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
import * as permissionApi from "../permission/api"; import * as permissionApi from "../permission/api";
@ -87,7 +79,7 @@ function useAuthz() {
authzDialogVisible, authzDialogVisible,
permissionTreeData, permissionTreeData,
checkedKeys, checkedKeys,
permissionTreeRef permissionTreeRef,
}; };
} }
@ -102,7 +94,7 @@ export default defineComponent({
extra: ({ hasActionPermission }: UseCrudPermissionExtraProps): any => { extra: ({ hasActionPermission }: UseCrudPermissionExtraProps): any => {
// //
return { rowHandle: { buttons: { authz: { show: hasActionPermission("authz") } } } }; return { rowHandle: { buttons: { authz: { show: hasActionPermission("authz") } } } };
} },
}; };
// crud // crud
@ -116,11 +108,14 @@ export default defineComponent({
crudExpose.doRefresh(); crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
return { return {
crudBinding, crudBinding,
crudRef, crudRef,
...authz ...authz,
}; };
} },
}); });
</script> </script>

View File

@ -8,7 +8,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, ref, onMounted } from "vue"; import { defineComponent, ref, onMounted, onActivated } from "vue";
import { useCrud, useExpose, useFs } from "@fast-crud/fast-crud"; import { useCrud, useExpose, useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
export default defineComponent({ export default defineComponent({
@ -23,11 +23,14 @@ export default defineComponent({
onMounted(() => { onMounted(() => {
crudExpose.doRefresh(); crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
return { return {
crudBinding, crudBinding,
crudRef crudRef,
}; };
} },
}); });
</script> </script>

View File

@ -20,14 +20,14 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from "vue"; import { onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue"; import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api"; import { DeleteBatch } from "./api";
defineOptions({ defineOptions({
name: "CnameProvider" name: "CnameProvider",
}); });
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions }); const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
@ -42,7 +42,7 @@ const handleBatchDelete = () => {
message.info("删除成功"); message.info("删除成功");
crudExpose.doRefresh(); crudExpose.doRefresh();
selectedRowKeys.value = []; selectedRowKeys.value = [];
} },
}); });
} else { } else {
message.error("请先勾选记录"); message.error("请先勾选记录");
@ -53,5 +53,8 @@ const handleBatchDelete = () => {
onMounted(() => { onMounted(() => {
crudExpose.doRefresh(); crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
</script> </script>
<style lang="less"></style> <style lang="less"></style>

View File

@ -14,7 +14,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from "vue"; import { onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue"; import { message, Modal } from "ant-design-vue";
@ -25,6 +25,10 @@ defineOptions({
}); });
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions }); const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
onActivated(async () => {
await crudExpose.doRefresh();
});
const selectedRowKeys = context.selectedRowKeys; const selectedRowKeys = context.selectedRowKeys;
const handleBatchDelete = () => { const handleBatchDelete = () => {
if (selectedRowKeys.value?.length > 0) { if (selectedRowKeys.value?.length > 0) {

View File

@ -8,13 +8,13 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from "vue"; import { onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
import { useSettingStore } from "/@/store/modules/settings"; import { useSettingStore } from "/@/store/modules/settings";
defineOptions({ defineOptions({
name: "SettingsHeaderMenus" name: "SettingsHeaderMenus",
}); });
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions }); const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
@ -23,5 +23,8 @@ const settingStore = useSettingStore();
onMounted(() => { onMounted(() => {
crudExpose.doRefresh(); crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
</script> </script>
<style lang="less"></style> <style lang="less"></style>

View File

@ -27,7 +27,7 @@ import { useRoute, useRouter } from "vue-router";
import { ref } from "vue"; import { ref } from "vue";
import { useSettingStore } from "/@/store/modules/settings"; import { useSettingStore } from "/@/store/modules/settings";
defineOptions({ defineOptions({
name: "SysSettings" name: "SysSettings",
}); });
const settingsStore = useSettingStore(); const settingsStore = useSettingStore();
const activeKey = ref(""); const activeKey = ref("");

View File

@ -47,7 +47,7 @@ import { useUserStore } from "/@/store/modules/user";
import { merge } from "lodash-es"; import { merge } from "lodash-es";
defineOptions({ defineOptions({
name: "SiteSetting" name: "SiteSetting",
}); });
interface FormState { interface FormState {
@ -78,7 +78,7 @@ const onFinish = async (form: any) => {
await loadSysSiteSettings(); await loadSysSiteSettings();
await settingsStore.loadSysSettings(); await settingsStore.loadSysSettings();
notification.success({ notification.success({
message: "保存成功" message: "保存成功",
}); });
} finally { } finally {
saveLoading.value = false; saveLoading.value = false;
@ -91,11 +91,11 @@ const uploaderConfig = ref({
action: "/basic/file/upload", action: "/basic/file/upload",
name: "file", name: "file",
headers: { headers: {
Authorization: "Bearer " + userStore.getToken Authorization: "Bearer " + userStore.getToken,
}, },
successHandle(res: any) { successHandle(res: any) {
return res; return res;
} },
}); });
function buildUrl(key: string) { function buildUrl(key: string) {
@ -109,12 +109,12 @@ function onFinishFailed(err: any) {
const cropperOptions = ref({ const cropperOptions = ref({
aspectRatio: 1, aspectRatio: 1,
autoCropArea: 1, autoCropArea: 1,
viewMode: 0 viewMode: 0,
}); });
const loginLogoCropperOptions = ref({ const loginLogoCropperOptions = ref({
aspectRatio: 3, aspectRatio: 3,
autoCropArea: 1, autoCropArea: 1,
viewMode: 0 viewMode: 0,
}); });
</script> </script>

View File

@ -3,12 +3,12 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { defineEmits, onMounted, ref } from "vue"; import { defineEmits, onActivated, onMounted, ref } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
defineOptions({ defineOptions({
name: "ProductManager" name: "ProductManager",
}); });
const emit = defineEmits(["refreshed"]); const emit = defineEmits(["refreshed"]);
@ -19,5 +19,8 @@ const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context
onMounted(() => { onMounted(() => {
crudExpose.doRefresh(); crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
</script> </script>
<style lang="less"></style> <style lang="less"></style>

View File

@ -17,14 +17,14 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from "vue"; import { onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud"; import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue"; import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api"; import { DeleteBatch } from "./api";
defineOptions({ defineOptions({
name: "TradeManager" name: "TradeManager",
}); });
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions }); const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
@ -39,7 +39,7 @@ const handleBatchDelete = () => {
message.info("删除成功"); message.info("删除成功");
crudExpose.doRefresh(); crudExpose.doRefresh();
selectedRowKeys.value = []; selectedRowKeys.value = [];
} },
}); });
} else { } else {
message.error("请先勾选记录"); message.error("请先勾选记录");
@ -50,5 +50,8 @@ const handleBatchDelete = () => {
onMounted(() => { onMounted(() => {
crudExpose.doRefresh(); crudExpose.doRefresh();
}); });
onActivated(async () => {
await crudExpose.doRefresh();
});
</script> </script>
<style lang="less"></style> <style lang="less"></style>

View File

@ -16,7 +16,7 @@ import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud"; import createCrudOptions from "./crud";
defineOptions({ defineOptions({
name: "UserSuites" name: "UserSuites",
}); });
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} }); const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });