|
|
@@ -1,12 +1,17 @@
|
|
|
<script lang="ts" setup>
|
|
|
import type { OnActionClickParams, VxeTableGridOptions } from '#/adapter';
|
|
|
|
|
|
+import { watch } from 'vue';
|
|
|
+
|
|
|
import { Page, useVbenModal } from '@vben/common-ui';
|
|
|
+import { useWatermark } from '@vben/hooks';
|
|
|
+import { preferences } from '@vben/preferences';
|
|
|
|
|
|
import { Button, message } from 'ant-design-vue';
|
|
|
|
|
|
import { useTableGridOptions, useVbenVxeGrid } from '#/adapter';
|
|
|
import { ConfigApi } from '#/api';
|
|
|
+import { useAppStore } from '#/store';
|
|
|
|
|
|
import FormEdit from './components/edit.vue';
|
|
|
import { useColumns, useSearchSchema } from './data.config';
|
|
|
@@ -16,8 +21,28 @@ const [FormEditModal, formEditApi] = useVbenModal({
|
|
|
destroyOnClose: true,
|
|
|
});
|
|
|
|
|
|
-const handelSuccess = () => {
|
|
|
- reload();
|
|
|
+const appStore = useAppStore();
|
|
|
+const { destroyWatermark, updateWatermark } = useWatermark();
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => preferences.app.watermark,
|
|
|
+ async (enable) => {
|
|
|
+ if (enable) {
|
|
|
+ await updateWatermark({
|
|
|
+ content: appStore.appInfo?.webWatermark,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ destroyWatermark();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
+);
|
|
|
+
|
|
|
+const handelSuccess = async () => {
|
|
|
+ await reload();
|
|
|
+ await appStore.loadAppInfo();
|
|
|
};
|
|
|
const handleDelete = async (id: number) => {
|
|
|
await ConfigApi.deleteDetail(id);
|