@chenghongyu/xpt-file-viewer 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/extensions.json +3 -0
- package/README.md +5 -0
- package/auto-imports.d.ts +12 -0
- package/components.d.ts +45 -0
- package/dist.zip +0 -0
- package/index.html +13 -0
- package/package.json +100 -0
- package/presets/eslint/.eslintrc-auto-import.json +462 -0
- package/presets/plugins/html.ts +14 -0
- package/presets/shared/env.ts +46 -0
- package/presets/shared/resolvers.ts +29 -0
- package/presets/tov.ts +132 -0
- package/presets/types/auto-imports.d.ts +806 -0
- package/presets/types/components.d.ts +164 -0
- package/presets/types/env.d.ts +17 -0
- package/public/favicon.svg +1 -0
- package/public/icons.svg +24 -0
- package/public/testfile/README.md +5 -0
- package/public/testfile/useFileContextMenu.js +74 -0
- package/public/testfile//345/217/221/347/245/250.pdf +0 -0
- package/public/testfile//346/216/245/346/224/266/345/207/275.docx +0 -0
- package/public/testfile//350/247/204/346/240/274/345/236/213/345/217/2671.txt +263 -0
- package/public/testfile//350/247/206/351/242/2211.mp4 +0 -0
- package/public/testfile//351/237/263/351/242/2211.mp3 +0 -0
- package/src/App.vue +8 -0
- package/src/api/admin/admin-2fa.js +18 -0
- package/src/api/admin/admin-download-log.js +37 -0
- package/src/api/admin/admin-login-log.js +9 -0
- package/src/api/admin/admin-permission.js +9 -0
- package/src/api/admin/admin-setting.js +121 -0
- package/src/api/admin/admin-share.js +20 -0
- package/src/api/admin/admin-short-link.js +49 -0
- package/src/api/admin/admin-sso.js +38 -0
- package/src/api/admin/admin-storage.js +189 -0
- package/src/api/admin/admin-user.js +61 -0
- package/src/api/home/common.js +9 -0
- package/src/api/home/file-operator.js +89 -0
- package/src/api/home/home.js +87 -0
- package/src/api/home/install.js +18 -0
- package/src/api/home/login.js +9 -0
- package/src/api/home/only-office.js +10 -0
- package/src/api/home/share.js +115 -0
- package/src/api/home/user.js +74 -0
- package/src/api/tools/tools-115.js +17 -0
- package/src/api/tools/tools-gd.js +13 -0
- package/src/api/tools/tools-s3.js +25 -0
- package/src/api/tools/tools-sharepoint.js +19 -0
- package/src/assets/hero.png +0 -0
- package/src/assets/icons/401.svg +1 -0
- package/src/assets/icons/403.svg +45 -0
- package/src/assets/icons/404.svg +1 -0
- package/src/assets/icons/500.svg +1 -0
- package/src/assets/icons/admin-login.svg +1 -0
- package/src/assets/icons/document.svg +1 -0
- package/src/assets/icons/empty.svg +145 -0
- package/src/assets/icons/file-type-apk.svg +1 -0
- package/src/assets/icons/file-type-archive.svg +1 -0
- package/src/assets/icons/file-type-audio.svg +1 -0
- package/src/assets/icons/file-type-back.svg +1 -0
- package/src/assets/icons/file-type-css.svg +1 -0
- package/src/assets/icons/file-type-deb.svg +1 -0
- package/src/assets/icons/file-type-dll.svg +1 -0
- package/src/assets/icons/file-type-doc.svg +1 -0
- package/src/assets/icons/file-type-document.svg +1 -0
- package/src/assets/icons/file-type-docx.svg +1 -0
- package/src/assets/icons/file-type-exe.svg +1 -0
- package/src/assets/icons/file-type-expression.svg +1 -0
- package/src/assets/icons/file-type-file.svg +1 -0
- package/src/assets/icons/file-type-folder.svg +1 -0
- package/src/assets/icons/file-type-html.svg +1 -0
- package/src/assets/icons/file-type-image.svg +1 -0
- package/src/assets/icons/file-type-java.svg +1 -0
- package/src/assets/icons/file-type-js.svg +1 -0
- package/src/assets/icons/file-type-less.svg +1 -0
- package/src/assets/icons/file-type-md.svg +1 -0
- package/src/assets/icons/file-type-office.svg +1 -0
- package/src/assets/icons/file-type-pdf.svg +1 -0
- package/src/assets/icons/file-type-php.svg +1 -0
- package/src/assets/icons/file-type-ppt.svg +1 -0
- package/src/assets/icons/file-type-pptx.svg +1 -0
- package/src/assets/icons/file-type-py.svg +1 -0
- package/src/assets/icons/file-type-rb.svg +1 -0
- package/src/assets/icons/file-type-root.svg +1 -0
- package/src/assets/icons/file-type-rpm.svg +1 -0
- package/src/assets/icons/file-type-rust.svg +1 -0
- package/src/assets/icons/file-type-script.svg +1 -0
- package/src/assets/icons/file-type-text.svg +1 -0
- package/src/assets/icons/file-type-three3d.svg +5 -0
- package/src/assets/icons/file-type-vbs.svg +1 -0
- package/src/assets/icons/file-type-video.svg +1 -0
- package/src/assets/icons/file-type-xls.svg +1 -0
- package/src/assets/icons/file-type-xlsx.svg +1 -0
- package/src/assets/icons/file-type-xml.svg +1 -0
- package/src/assets/icons/file-type-yaml.svg +1 -0
- package/src/assets/icons/file-upload.svg +1 -0
- package/src/assets/icons/github.svg +1 -0
- package/src/assets/icons/install-step.svg +40 -0
- package/src/assets/icons/reset-password.svg +1 -0
- package/src/assets/icons/storage-aliyun.svg +1 -0
- package/src/assets/icons/storage-baidu.svg +1 -0
- package/src/assets/icons/storage-doge-cloud.svg +207 -0
- package/src/assets/icons/storage-ftp.svg +13 -0
- package/src/assets/icons/storage-google-drive.svg +8 -0
- package/src/assets/icons/storage-huawei.svg +1 -0
- package/src/assets/icons/storage-local.svg +11 -0
- package/src/assets/icons/storage-minio.svg +1 -0
- package/src/assets/icons/storage-onedrive-china.svg +18 -0
- package/src/assets/icons/storage-onedrive.svg +4 -0
- package/src/assets/icons/storage-open115.svg +23 -0
- package/src/assets/icons/storage-qiniu.svg +1 -0
- package/src/assets/icons/storage-s3.svg +5 -0
- package/src/assets/icons/storage-sftp.svg +13 -0
- package/src/assets/icons/storage-sharepoint-china.svg +23 -0
- package/src/assets/icons/storage-sharepoint.svg +1 -0
- package/src/assets/icons/storage-tencent.svg +9 -0
- package/src/assets/icons/storage-ufile.svg +14 -0
- package/src/assets/icons/storage-upyun.svg +1 -0
- package/src/assets/icons/storage-webdav.svg +1 -0
- package/src/assets/icons/upload.svg +50 -0
- package/src/assets/icons/zfile-basic.svg +17 -0
- package/src/assets/icons/zfile-horizontal.svg +16 -0
- package/src/assets/icons/zfile.svg +1 -0
- package/src/assets/vite.svg +1 -0
- package/src/assets/vue.svg +1 -0
- package/src/components/HelloWorld.vue +319 -0
- package/src/components/common/QrCodePreview.vue +118 -0
- package/src/components/common/dialog/ZDialog.vue +171 -0
- package/src/components/common/dialog/types.ts +19 -0
- package/src/components/common/dialog/useDialog.ts +18 -0
- package/src/components/common/dialog/useDialogWithForm.ts +21 -0
- package/src/components/copy.vue +133 -0
- package/src/components/file/preview/AudioPlayer.vue +333 -0
- package/src/components/file/preview/CopyCode.vue +47 -0
- package/src/components/file/preview/FileGallery.vue +199 -0
- package/src/components/file/preview/ImageViewer.vue +432 -0
- package/src/components/file/preview/KkFileViewer.vue +86 -0
- package/src/components/file/preview/KkFileViewerDialog.vue +42 -0
- package/src/components/file/preview/MarkdownViewer.vue +102 -0
- package/src/components/file/preview/MarkdownViewerAsyncLoading.vue +17 -0
- package/src/components/file/preview/MarkdownViewerDialogAsyncLoading.vue +12 -0
- package/src/components/file/preview/OfficeViewer.vue +76 -0
- package/src/components/file/preview/OfficeViewerDialog.vue +55 -0
- package/src/components/file/preview/PdfViewer.vue +157 -0
- package/src/components/file/preview/PdfViewerDialog.vue +41 -0
- package/src/components/file/preview/TextViewer.vue +232 -0
- package/src/components/file/preview/TextViewerAsyncLoading.vue +22 -0
- package/src/components/file/preview/TextViewerDialog.vue +53 -0
- package/src/components/file/preview/Three3dPreview.vue +114 -0
- package/src/components/file/preview/Three3dPreviewDialog.vue +50 -0
- package/src/components/file/preview/VideoPlayer.vue +341 -0
- package/src/components/file/preview/VideoPlayerAsyncLoading.vue +45 -0
- package/src/components/file/preview/VideoPlayerDialog.vue +51 -0
- package/src/components/file/selectFolder/SelectFolder.vue +208 -0
- package/src/components/file/selectFolder/index.ts +50 -0
- package/src/components/file/selectFolder/types.ts +5 -0
- package/src/components/fileReview/AudioPlayer-copy.vue +333 -0
- package/src/components/fileReview/PdfViewer-copy.vue +157 -0
- package/src/components/fileReview/TextViewer-copy.vue +44 -0
- package/src/components/fileReview/VideoPlayer-copy.vue +341 -0
- package/src/components/messageBox/confirm/confirm.vue +137 -0
- package/src/components/messageBox/confirm/index.ts +27 -0
- package/src/components/messageBox/confirm/types.ts +15 -0
- package/src/components/messageBox/messageBox.ts +9 -0
- package/src/components/messageBox/prompt/index.ts +27 -0
- package/src/components/messageBox/prompt/prompt.vue +178 -0
- package/src/components/messageBox/prompt/types.ts +24 -0
- package/src/components/vue-codemirror/editor.vue +212 -0
- package/src/components/vue-codemirror/encodings.ts +27 -0
- package/src/components/vue-codemirror/index.vue +380 -0
- package/src/components/vue-codemirror/lang-code/cpp/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/css/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/dockerfile/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/erlang/index.ts +6 -0
- package/src/components/vue-codemirror/lang-code/go/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/html/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/java/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/javascript/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/json/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/jsx/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/lua/index.ts +6 -0
- package/src/components/vue-codemirror/lang-code/markdown/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/mysql/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/nginx/index.ts +6 -0
- package/src/components/vue-codemirror/lang-code/perl/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/pgsql/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/php/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/powershell/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/python/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/r/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/ruby/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/rust/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/shell/index.ts +5 -0
- package/src/components/vue-codemirror/lang-code/sql/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/stylus/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/swift/index.ts +4 -0
- package/src/components/vue-codemirror/lang-code/toml/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/tsx/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/typescript/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/vb/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/vbscript/index.ts +3 -0
- package/src/components/vue-codemirror/lang-code/xml/index.ts +2 -0
- package/src/components/vue-codemirror/lang-code/yaml/index.ts +3 -0
- package/src/components/vue-codemirror/languages.ts +8 -0
- package/src/components/vue-codemirror/themes.ts +5 -0
- package/src/components/vue-codemirror/toolbar.vue +183 -0
- package/src/components/vue-codemirror/types.ts +12 -0
- package/src/components.d.ts +49 -0
- package/src/composables/admin/layout/admin-layout.js +53 -0
- package/src/composables/admin/link/useLinkSetting.js +16 -0
- package/src/composables/admin/sso/baseSsoConfig.js +54 -0
- package/src/composables/admin/sso/useSsoConfig.js +176 -0
- package/src/composables/admin/storage/storage-copy.js +89 -0
- package/src/composables/admin/storage/storage-filter.js +64 -0
- package/src/composables/admin/storage/storage-list.js +202 -0
- package/src/composables/admin/storage/storage-password.js +101 -0
- package/src/composables/admin/storage/storage-readme.js +102 -0
- package/src/composables/admin/storage/utils/open115-util.js +61 -0
- package/src/composables/admin/useAdminSetting.js +60 -0
- package/src/composables/admin/useClientInfo.js +20 -0
- package/src/composables/admin/user/user-copy.js +79 -0
- package/src/composables/file/useBatchOperatorResult.js +19 -0
- package/src/composables/file/useFileContextMenu.js +74 -0
- package/src/composables/file/useFileData.js +243 -0
- package/src/composables/file/useFileLink.js +175 -0
- package/src/composables/file/useFileLoading.js +41 -0
- package/src/composables/file/useFileLongPressEvent.js +71 -0
- package/src/composables/file/useFileOperator.js +347 -0
- package/src/composables/file/useFilePreview.js +99 -0
- package/src/composables/file/useFilePwd.js +138 -0
- package/src/composables/file/useFileSelect.js +105 -0
- package/src/composables/file/useFileShare.js +39 -0
- package/src/composables/file/useFileUpload.js +1045 -0
- package/src/composables/file/useKkFileViewDialog.js +24 -0
- package/src/composables/file/useOfficeViewerDialog.js +20 -0
- package/src/composables/file/usePdfViewerDialog.js +22 -0
- package/src/composables/file/useShareActions.js +94 -0
- package/src/composables/file/useShareTableOperator.js +84 -0
- package/src/composables/file/useTableOperator.js +211 -0
- package/src/composables/file/useTextViewerDialog.js +22 -0
- package/src/composables/file/useThree3dPreviewDialog.js +23 -0
- package/src/composables/file/useVideoPlayerDialog.js +19 -0
- package/src/composables/header/useHeaderBreadcrumb.js +111 -0
- package/src/composables/header/useHeaderStorageList.js +150 -0
- package/src/composables/header/useSetting.js +58 -0
- package/src/composables/share/useShareData.js +178 -0
- package/src/composables/useDarks.ts +4 -0
- package/src/composables/useRouterData.js +41 -0
- package/src/constant/index.js +193 -0
- package/src/http/index.js +153 -0
- package/src/http/request.js +31 -0
- package/src/main.ts +23 -0
- package/src/stores/file-data.ts +108 -0
- package/src/stores/global-config.ts +115 -0
- package/src/stores/storage-config.ts +123 -0
- package/src/style.css +296 -0
- package/src/styles/admin.scss +91 -0
- package/src/styles/code-editor-variables.scss +52 -0
- package/src/styles/element-plus.scss +22 -0
- package/src/styles/error-page.css +26 -0
- package/src/styles/main.css +142 -0
- package/src/styles/tailwind/index.scss +33 -0
- package/src/utils/index.ts +7 -0
- package/src/utils/models/base.ts +34 -0
- package/src/utils/models/file.ts +95 -0
- package/src/utils/models/path.ts +117 -0
- package/src/utils/models/qrcode.ts +21 -0
- package/src/utils/models/time.ts +132 -0
- package/src/utils/models/util.ts +42 -0
- package/src/utils/models/window.ts +14 -0
- package/stats.html +4950 -0
- package/tsconfig.app.json +16 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +57 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { isEmpty } from "~/utils";
|
|
2
|
+
import {loadStorageFilterReq, saveStorageFilterReq} from "~/api/admin/admin-storage";
|
|
3
|
+
|
|
4
|
+
let list = ref([]);
|
|
5
|
+
let loading = ref(false);
|
|
6
|
+
|
|
7
|
+
export default function useStorageFilter(router, route) {
|
|
8
|
+
let currentStorageId = route.params.storageId;
|
|
9
|
+
|
|
10
|
+
const loadData = () => {
|
|
11
|
+
loadStorageFilterReq(currentStorageId).then((response) => {
|
|
12
|
+
list.value = response.data;
|
|
13
|
+
if (list.value.length === 0) {
|
|
14
|
+
addItem();
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const saveData = () => {
|
|
20
|
+
let notFill = list.value.find((value) => {
|
|
21
|
+
if (isEmpty(value.expression)) {
|
|
22
|
+
ElMessage.warning('请检查数据填写是否完整');
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
if (!notFill) {
|
|
28
|
+
loading.value = true;
|
|
29
|
+
saveStorageFilterReq(currentStorageId, list.value).then(() => {
|
|
30
|
+
ElMessageBox.confirm('保存成功, 是否返回存储源列表?', '提示', {
|
|
31
|
+
confirmButtonText: '确定',
|
|
32
|
+
cancelButtonText: '取消',
|
|
33
|
+
type: 'success',
|
|
34
|
+
callback: action => {
|
|
35
|
+
if (action === 'confirm') {
|
|
36
|
+
router.push('/admin/storage-list');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}).finally(() => {
|
|
41
|
+
loading.value = false;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const addItem = () => {
|
|
47
|
+
list.value.push({
|
|
48
|
+
mode: 'hidden',
|
|
49
|
+
expression: '',
|
|
50
|
+
storageId: currentStorageId,
|
|
51
|
+
description: '表达式 - ' + list.value.length
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const deleteItem = (index) => {
|
|
56
|
+
list.value.splice(index, 1);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
loading, loadData, list,
|
|
61
|
+
addItem, deleteItem,
|
|
62
|
+
saveData
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deleteStorageReq,
|
|
3
|
+
loadStorageListReq,
|
|
4
|
+
storageSortReq,
|
|
5
|
+
switchCacheAutoRefreshReq,
|
|
6
|
+
switchCacheEnableReq,
|
|
7
|
+
switchEnableReq
|
|
8
|
+
} from "~/api/admin/admin-storage";
|
|
9
|
+
import Sortable from "sortablejs";
|
|
10
|
+
import { isMobile } from "~/utils";
|
|
11
|
+
|
|
12
|
+
let cacheManageVisible = ref(false);
|
|
13
|
+
let currentCacheManageId = ref();
|
|
14
|
+
|
|
15
|
+
let loading = ref(false);
|
|
16
|
+
let storageList = ref([]);
|
|
17
|
+
let searchKey = ref('');
|
|
18
|
+
|
|
19
|
+
import useStorageCopy from '~/composables/admin/storage/storage-copy'
|
|
20
|
+
const { openDialog: openCopyStorageDialog } = useStorageCopy();
|
|
21
|
+
|
|
22
|
+
export default function useStorageList(router) {
|
|
23
|
+
|
|
24
|
+
// 添加存储源
|
|
25
|
+
const addStorage = () => {
|
|
26
|
+
router.push('/admin/storage-edit');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 编辑存储源
|
|
30
|
+
const editStorage = (row) => {
|
|
31
|
+
router.push('/admin/storage-edit/' + row.id);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 删除存储源
|
|
35
|
+
const deleteStorage = (row) => {
|
|
36
|
+
ElMessageBox.confirm('是否确认删除?', '提示', {
|
|
37
|
+
confirmButtonText: '确定',
|
|
38
|
+
cancelButtonText: '取消',
|
|
39
|
+
type: 'warning',
|
|
40
|
+
callback: action => {
|
|
41
|
+
if (action === 'confirm') {
|
|
42
|
+
deleteStorageReq(row.id).then((response) => {
|
|
43
|
+
ElMessage.success('删除成功');
|
|
44
|
+
init();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 响应关闭操作提示.
|
|
52
|
+
const handleClose = (done) => {
|
|
53
|
+
ElMessageBox.confirm('是否确认关闭?关闭后填写的数据不会保留。', {
|
|
54
|
+
type: 'warning',
|
|
55
|
+
}).then(_ => {
|
|
56
|
+
done();
|
|
57
|
+
}).catch(_ => {
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 跳转到文件夹过滤设置
|
|
62
|
+
const showFilterPage = (row) => {
|
|
63
|
+
router.push('/admin/storage-filter/' + row.id);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 跳转到文件夹文档设置
|
|
67
|
+
const showReadmePage = (row) => {
|
|
68
|
+
router.push('/admin/storage-readme/' + row.id);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 跳转到文件夹密码设置
|
|
72
|
+
const showPasswordPage = (row) => {
|
|
73
|
+
router.push('/admin/storage-password/' + row.id);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 切换存储源启用/关闭状态
|
|
77
|
+
const switchEnableStatus = (row) => {
|
|
78
|
+
ElMessageBox.confirm(`是否确认${row.enable ? '停用' : '启用'}存储源。`, '提示', {
|
|
79
|
+
confirmButtonText: '确定',
|
|
80
|
+
cancelButtonText: '取消',
|
|
81
|
+
type: 'warning',
|
|
82
|
+
callback: action => {
|
|
83
|
+
if (action === 'confirm') {
|
|
84
|
+
let enableStatus = row.enable ? 'disable' : 'enable';
|
|
85
|
+
switchEnableReq(row.id, enableStatus).then(() => {
|
|
86
|
+
ElMessage.success((row.enable ? '停用' : '启用') + '成功');
|
|
87
|
+
row.enable = !row.enable;
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 切换缓存启用/关闭状态
|
|
95
|
+
const switchCacheEnableStatus = (row) => {
|
|
96
|
+
let action = row.enableCache ? 'enable' : 'disable';
|
|
97
|
+
switchCacheEnableReq(row.id, action).then(() => {
|
|
98
|
+
ElMessage.success('修改成功');
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 切换缓存启用/关闭自动刷新状态
|
|
103
|
+
const switchCacheAutoRefreshStatus = (row) => {
|
|
104
|
+
let action = row.autoRefreshCache ? 'start' : 'stop';
|
|
105
|
+
switchCacheAutoRefreshReq(row.id, action).then(() => {
|
|
106
|
+
ElMessage.success('修改成功');
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 权限管理
|
|
111
|
+
const showPermissionPage = (row) => {
|
|
112
|
+
router.push('/admin/storage-premission/' + row.id);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 缓存管理
|
|
116
|
+
const cacheManage = (row) => {
|
|
117
|
+
currentCacheManageId.value = row.id;
|
|
118
|
+
cacheManageVisible.value = true;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// 响应操作指令
|
|
122
|
+
const handleOperator = (command) => {
|
|
123
|
+
switch (command.operator) {
|
|
124
|
+
case "edit": editStorage(command.storage); break;
|
|
125
|
+
case "enable": switchEnableStatus(command.storage); break;
|
|
126
|
+
case "readmeManager": showReadmePage(command.storage); break;
|
|
127
|
+
case "cacheManager": cacheManage(command.storage); break;
|
|
128
|
+
case "filterManager": showFilterPage(command.storage); break;
|
|
129
|
+
case "pwdManager": showPasswordPage(command.storage); break;
|
|
130
|
+
case "delete": deleteStorage(command.storage); break;
|
|
131
|
+
case "permissionManager": showPermissionPage(command.storage); break;
|
|
132
|
+
case "copy": openCopyStorageDialog(command.storage); break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// 设置可拖动排序
|
|
137
|
+
const setSort = () => {
|
|
138
|
+
const el = document.querySelector('.storage-container')
|
|
139
|
+
Sortable.create(el, {
|
|
140
|
+
draggable: '.storage-item',
|
|
141
|
+
filter: '.add-storage-btn',
|
|
142
|
+
delay: isMobile.value ? 300 : 0,
|
|
143
|
+
onEnd: e => {
|
|
144
|
+
if (e.oldIndex === e.newIndex) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const currRow = storageList.value.splice(e.oldIndex, 1)[0];
|
|
149
|
+
storageList.value.splice(e.newIndex, 0, currRow)
|
|
150
|
+
|
|
151
|
+
storageSortReq(storageList.value).then(() => {
|
|
152
|
+
ElMessage.success('调整排序成功');
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// 初始化
|
|
159
|
+
const init = () => {
|
|
160
|
+
loading.value = true;
|
|
161
|
+
loadStorageListReq().then((response) => {
|
|
162
|
+
storageList.value = response.data;
|
|
163
|
+
setSort();
|
|
164
|
+
loading.value = false;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// 存储源列表计算属性, 用于显示右上角搜索框对应的搜索结果.
|
|
169
|
+
const storageListSearchResult = computed(() => {
|
|
170
|
+
if (searchKey.value === '') {
|
|
171
|
+
return storageList.value;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// 如果名字或备注或存储源类型包含输入关键字,则作为检索结果.
|
|
175
|
+
return storageList.value.filter((item) => {
|
|
176
|
+
if (item.name && item.name.toLowerCase().indexOf(searchKey.value.toLowerCase()) !== -1) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
if (item.remark && item.remark.toLowerCase().indexOf(searchKey.value.toLowerCase()) !== -1) {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
if (item.type && item.type.description.toLowerCase().indexOf(searchKey.value.toLowerCase()) !== -1) {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
if (item.type && item.type.key.toLowerCase().indexOf(searchKey.value.toLowerCase()) !== -1) {
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
return false;
|
|
189
|
+
});
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
init, loading,
|
|
195
|
+
searchKey, storageListSearchResult,
|
|
196
|
+
handleOperator,
|
|
197
|
+
addStorage, editStorage, deleteStorage, handleClose,
|
|
198
|
+
showFilterPage, showReadmePage, showPasswordPage,
|
|
199
|
+
switchEnableStatus,
|
|
200
|
+
cacheManageVisible, currentCacheManageId, switchCacheEnableStatus, switchCacheAutoRefreshStatus, cacheManage,
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {loadStoragePasswordReq, saveStoragePasswordReq} from "~/api/admin/admin-storage";
|
|
2
|
+
|
|
3
|
+
let list = ref([]);
|
|
4
|
+
let loading = ref(false);
|
|
5
|
+
import Sortable from "sortablejs";
|
|
6
|
+
import { isEmpty } from "~/utils";
|
|
7
|
+
|
|
8
|
+
export default function useStoragePassword(router, route) {
|
|
9
|
+
let currentStorageId = route.params.storageId;
|
|
10
|
+
|
|
11
|
+
const loadData = () => {
|
|
12
|
+
loadStoragePasswordReq(currentStorageId).then((response) => {
|
|
13
|
+
list.value = response.data;
|
|
14
|
+
if (list.value.length === 0) {
|
|
15
|
+
addItem();
|
|
16
|
+
}
|
|
17
|
+
setSort();
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const setSort = () => {
|
|
22
|
+
const el = document.querySelectorAll('.el-table__body-wrapper table > tbody')[0]
|
|
23
|
+
if (el) {
|
|
24
|
+
Sortable.create(el, {
|
|
25
|
+
filter: ".el-button",
|
|
26
|
+
onEnd: e => {
|
|
27
|
+
if (e.oldIndex === e.newIndex) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const targetRow = list.value.splice(e.oldIndex, 1)[0];
|
|
31
|
+
list.value.splice(e.newIndex, 0, targetRow);
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const saveData = () => {
|
|
38
|
+
let notFill = list.value.find((value) => {
|
|
39
|
+
if (isEmpty(value.description) || isEmpty(value.expression) || isEmpty(value.password)) {
|
|
40
|
+
ElMessage.warning('请检查数据填写是否完整');
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if (!notFill) {
|
|
47
|
+
loading.value = true;
|
|
48
|
+
for (let i = 0; i < list.value.length; i++) {
|
|
49
|
+
let valueElement = list.value[i];
|
|
50
|
+
valueElement.id = (i + 1);
|
|
51
|
+
}
|
|
52
|
+
saveStoragePasswordReq(currentStorageId, list.value).then(() => {
|
|
53
|
+
ElMessageBox.confirm('保存成功, 是否返回存储源列表?', '提示', {
|
|
54
|
+
confirmButtonText: '确定',
|
|
55
|
+
cancelButtonText: '取消',
|
|
56
|
+
type: 'success',
|
|
57
|
+
callback: action => {
|
|
58
|
+
if (action === 'confirm') {
|
|
59
|
+
router.push('/admin/storage-list');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}).finally(() => {
|
|
64
|
+
loading.value = false;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const addItem = () => {
|
|
70
|
+
list.value.push({
|
|
71
|
+
description: '表达式 - ' + (list.value.length + 1),
|
|
72
|
+
expression: '',
|
|
73
|
+
password: '',
|
|
74
|
+
storageId: currentStorageId
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const deleteItem = (index) => {
|
|
79
|
+
list.value.splice(index, 1);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const moveUp = (index) => {
|
|
83
|
+
if (index === 0) return;
|
|
84
|
+
const item = list.value[index];
|
|
85
|
+
list.value.splice(index, 1);
|
|
86
|
+
list.value.splice(index - 1, 0, item);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const moveDown = (index) => {
|
|
90
|
+
if (index === list.value.length - 1) return;
|
|
91
|
+
const item = list.value[index];
|
|
92
|
+
list.value.splice(index, 1);
|
|
93
|
+
list.value.splice(index + 1, 0, item);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
loading, loadData, list,
|
|
98
|
+
addItem, deleteItem, moveUp, moveDown,
|
|
99
|
+
saveData
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { isEmpty } from "~/utils";
|
|
2
|
+
import {loadStorageReadmeReq, saveStorageReadmeReq} from "~/api/admin/admin-storage";
|
|
3
|
+
|
|
4
|
+
let list = ref([]);
|
|
5
|
+
let loading = ref(false);
|
|
6
|
+
import Sortable from "sortablejs";
|
|
7
|
+
|
|
8
|
+
export default function useStorageReadme(router, route) {
|
|
9
|
+
let currentStorageId = route.params.storageId;
|
|
10
|
+
|
|
11
|
+
const loadData = () => {
|
|
12
|
+
loadStorageReadmeReq(currentStorageId).then((response) => {
|
|
13
|
+
list.value = response.data;
|
|
14
|
+
if (list.value.length === 0) {
|
|
15
|
+
addItem();
|
|
16
|
+
}
|
|
17
|
+
setSort();
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const setSort = () => {
|
|
22
|
+
const el = document.querySelectorAll('.el-table__body-wrapper table > tbody')[0]
|
|
23
|
+
if (el) {
|
|
24
|
+
Sortable.create(el, {
|
|
25
|
+
filter: ".el-button",
|
|
26
|
+
onEnd: e => {
|
|
27
|
+
if (e.oldIndex === e.newIndex) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const targetRow = list.value.splice(e.oldIndex, 1)[0];
|
|
31
|
+
list.value.splice(e.newIndex, 0, targetRow);
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const saveData = () => {
|
|
38
|
+
let notFill = list.value.find((value) => {
|
|
39
|
+
if (isEmpty(value.description) || isEmpty(value.expression) || isEmpty(value.readmeText)) {
|
|
40
|
+
ElMessage.warning('请检查数据填写是否完整');
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if (!notFill) {
|
|
47
|
+
loading.value = true;
|
|
48
|
+
for (let i = 0; i < list.value.length; i++) {
|
|
49
|
+
let valueElement = list.value[i];
|
|
50
|
+
valueElement.id = (i + 1);
|
|
51
|
+
}
|
|
52
|
+
saveStorageReadmeReq(currentStorageId, list.value).then(() => {
|
|
53
|
+
ElMessageBox.confirm('保存成功, 是否返回存储源列表?', '提示', {
|
|
54
|
+
confirmButtonText: '确定',
|
|
55
|
+
cancelButtonText: '取消',
|
|
56
|
+
type: 'success',
|
|
57
|
+
callback: action => {
|
|
58
|
+
if (action === 'confirm') {
|
|
59
|
+
router.push('/admin/storage-list');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}).finally(() => {
|
|
64
|
+
loading.value = false;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const addItem = () => {
|
|
70
|
+
list.value.push({
|
|
71
|
+
description: '表达式 - ' + (list.value.length + 1),
|
|
72
|
+
expression: '',
|
|
73
|
+
readmeText: '',
|
|
74
|
+
displayMode: 'top',
|
|
75
|
+
storageId: currentStorageId
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const deleteItem = (index) => {
|
|
80
|
+
list.value.splice(index, 1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const moveUp = (index) => {
|
|
84
|
+
if (index === 0) return;
|
|
85
|
+
const item = list.value[index];
|
|
86
|
+
list.value.splice(index, 1);
|
|
87
|
+
list.value.splice(index - 1, 0, item);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const moveDown = (index) => {
|
|
91
|
+
if (index === list.value.length - 1) return;
|
|
92
|
+
const item = list.value[index];
|
|
93
|
+
list.value.splice(index, 1);
|
|
94
|
+
list.value.splice(index + 1, 0, item);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
loading, loadData, list,
|
|
99
|
+
addItem, deleteItem, moveUp, moveDown,
|
|
100
|
+
saveData
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { authDeviceCodeReq, getStatusReq } from "~/api/tools/tools-115";
|
|
2
|
+
import { encodeData, rendererRect } from 'beautify-qrcode';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* svg 转为 src data uri
|
|
6
|
+
* @param svgText svg 文本
|
|
7
|
+
* @returns {string} src data uri
|
|
8
|
+
*/
|
|
9
|
+
const svgToDataUri = (svgText) => {
|
|
10
|
+
let xmlElement = document.createElement("xml")
|
|
11
|
+
xmlElement.innerHTML = svgText;
|
|
12
|
+
|
|
13
|
+
// 增加 svg 底色, 防止复制后是透明.
|
|
14
|
+
let rectElement = document.createElement("rect")
|
|
15
|
+
rectElement.setAttribute('width', '100%');
|
|
16
|
+
rectElement.setAttribute('height', '100%');
|
|
17
|
+
rectElement.style.fill = '#ffffff';
|
|
18
|
+
|
|
19
|
+
xmlElement.children[0].prepend(rectElement);
|
|
20
|
+
|
|
21
|
+
return 'data:image/svg+xml;utf8,' + encodeURIComponent(xmlElement.innerHTML);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function useOpen115Util() {
|
|
25
|
+
|
|
26
|
+
const qrCode = ref("");
|
|
27
|
+
const qrCodeStatus = ref({
|
|
28
|
+
status: "",
|
|
29
|
+
errorMessage: "",
|
|
30
|
+
accessToken: "",
|
|
31
|
+
refreshToken: "",
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const generateQrCode = (appId) => {
|
|
35
|
+
authDeviceCodeReq({ appId: appId }).then(res => {
|
|
36
|
+
getQrCodeStatus(res.data);
|
|
37
|
+
|
|
38
|
+
qrCodeStatus.value.status = "waiting";
|
|
39
|
+
|
|
40
|
+
// 生成二维码
|
|
41
|
+
qrCode.value = svgToDataUri(rendererRect(encodeData({
|
|
42
|
+
text: res.data.qrcode,
|
|
43
|
+
correctLevel: 2,
|
|
44
|
+
isSpace: false
|
|
45
|
+
})))
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const getQrCodeStatus = (data) => {
|
|
50
|
+
getStatusReq(data).then(res => {
|
|
51
|
+
qrCodeStatus.value = res.data;
|
|
52
|
+
if (qrCodeStatus.value.status === "scanning" || qrCodeStatus.value.status === "waiting") {
|
|
53
|
+
getQrCodeStatus(data);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
generateQrCode, qrCode, qrCodeStatus
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { loadConfigReq } from "~/api/admin/admin-setting";
|
|
2
|
+
import { useRequest } from "vue-request";
|
|
3
|
+
|
|
4
|
+
export default function useAdminSetting(saveReq, formRef) {
|
|
5
|
+
|
|
6
|
+
const siteSetting = ref(null);
|
|
7
|
+
|
|
8
|
+
// 加载请求
|
|
9
|
+
const {
|
|
10
|
+
loading: siteSettingLoading,
|
|
11
|
+
refresh: siteSettingReload
|
|
12
|
+
} = useRequest(loadConfigReq, {
|
|
13
|
+
cacheKey: "siteSetting",
|
|
14
|
+
onSuccess(res) {
|
|
15
|
+
siteSetting.value = res.data;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// 保存请求
|
|
20
|
+
const {
|
|
21
|
+
loading: saveLoading,
|
|
22
|
+
run: saveSetting
|
|
23
|
+
} = useRequest(saveReq, {
|
|
24
|
+
manual: true,
|
|
25
|
+
onSuccess() {
|
|
26
|
+
ElMessage({
|
|
27
|
+
message: "保存成功",
|
|
28
|
+
type: "success"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const saveData = (alertMsg) => {
|
|
34
|
+
if (formRef && formRef.value) {
|
|
35
|
+
formRef.value.validate((errors, fields) => {
|
|
36
|
+
if (errors) {
|
|
37
|
+
saveSetting(siteSetting.value);
|
|
38
|
+
} else if (alertMsg === true) {
|
|
39
|
+
for (let key in fields) {
|
|
40
|
+
let msg = '';
|
|
41
|
+
for (let i = 0; i < fields[key].length; i++) {
|
|
42
|
+
msg += fields[key][i].message;
|
|
43
|
+
if (i < fields[key].length - 1) {
|
|
44
|
+
msg += ', ';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
ElMessage.warning(msg);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
} else {
|
|
52
|
+
saveSetting(siteSetting.value);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
siteSetting, siteSettingLoading, siteSettingReload,
|
|
58
|
+
saveData, saveLoading
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getClientIpReq } from "~/api/admin/admin-setting";
|
|
2
|
+
|
|
3
|
+
export default function useClientInfo() {
|
|
4
|
+
|
|
5
|
+
// 获取当前客户端 IP
|
|
6
|
+
const clientIp = ref('');
|
|
7
|
+
onBeforeMount(() => {
|
|
8
|
+
getClientIpReq().then(res => {
|
|
9
|
+
clientIp.value = res.data;
|
|
10
|
+
});
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
// 获取当前浏览器 UserAgent
|
|
14
|
+
const userAgent = ref(navigator.userAgent);
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
clientIp, userAgent
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { copyUserReq, checkUsernameDuplicateReq } from "~/api/admin/admin-user";
|
|
2
|
+
|
|
3
|
+
const formData = reactive({
|
|
4
|
+
toUsername: '',
|
|
5
|
+
toNickname: '',
|
|
6
|
+
toPassword: '',
|
|
7
|
+
fromId: null
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const rules = {
|
|
11
|
+
toUsername: [
|
|
12
|
+
{ required: true, message: '请输入新用户名' },
|
|
13
|
+
{ min: 1, max: 255, message: '长度应在 1 到 255 个字符', trigger: 'blur' },
|
|
14
|
+
{
|
|
15
|
+
validator: (rule, value, callback) => {
|
|
16
|
+
if (value === undefined || value === null || value === '') {
|
|
17
|
+
callback();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
checkUsernameDuplicateReq({ username: value }).then((res) => {
|
|
21
|
+
if (res.data) {
|
|
22
|
+
callback(new Error('该用户名已存在,请修改。'));
|
|
23
|
+
} else {
|
|
24
|
+
callback();
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
toNickname: [
|
|
31
|
+
{ required: true, message: '请输入新用户昵称', trigger: 'blur' },
|
|
32
|
+
],
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const dialogVisible = ref(false);
|
|
36
|
+
const saveLoading = ref(false);
|
|
37
|
+
export default function useUserCopy() {
|
|
38
|
+
|
|
39
|
+
const openDialog = (row) => {
|
|
40
|
+
dialogVisible.value = true;
|
|
41
|
+
formData.fromId = row.id;
|
|
42
|
+
formData.toUsername = row.username;
|
|
43
|
+
formData.toNickname = row.nickname;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const closeDialog = () => {
|
|
47
|
+
dialogVisible.value = false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const userCopyFormRef = ref(null);
|
|
51
|
+
|
|
52
|
+
const submitForm = (emit) => {
|
|
53
|
+
saveLoading.value = true;
|
|
54
|
+
userCopyFormRef.value.validate((valid) => {
|
|
55
|
+
if (valid) {
|
|
56
|
+
copyUserReq(formData).then((res) => {
|
|
57
|
+
ElMessage.success('复制成功');
|
|
58
|
+
dialogVisible.value = false;
|
|
59
|
+
emit('close');
|
|
60
|
+
}).finally(() => {
|
|
61
|
+
saveLoading.value = false;
|
|
62
|
+
})
|
|
63
|
+
} else {
|
|
64
|
+
saveLoading.value = false;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
dialogVisible,
|
|
71
|
+
openDialog,
|
|
72
|
+
closeDialog,
|
|
73
|
+
formData,
|
|
74
|
+
rules,
|
|
75
|
+
userCopyFormRef,
|
|
76
|
+
submitForm,
|
|
77
|
+
saveLoading
|
|
78
|
+
}
|
|
79
|
+
}
|