@skyfox2000/webui 0.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/.eslintrc.js +23 -0
- package/.prettierrc +11 -0
- package/.vscode/settings.json +25 -0
- package/README.md +104 -0
- package/env.d.ts +11 -0
- package/index.html +19 -0
- package/lib/AceEditor.d.ts +4 -0
- package/lib/BasicLayout.d.ts +4 -0
- package/lib/Error403.d.ts +4 -0
- package/lib/Error404.d.ts +4 -0
- package/lib/ExcelForm.d.ts +4 -0
- package/lib/UploadForm.d.ts +4 -0
- package/lib/assets/modules/basicLayout-YP_-EySb.js +726 -0
- package/lib/assets/modules/error403-Bi0E2twj.js +33 -0
- package/lib/assets/modules/error404-BF7vasR_.js +33 -0
- package/lib/assets/modules/excelForm-Dzndz-SG.js +109 -0
- package/lib/assets/modules/excelForm-WJVQmaDT.js +317 -0
- package/lib/assets/modules/index-FzWSvscZ.js +107 -0
- package/lib/assets/modules/index-ekkaExvB.js +49 -0
- package/lib/assets/modules/uploadForm-BahGnrAq.js +415 -0
- package/lib/assets/modules/uploadForm-DEnOjhwc.js +308 -0
- package/lib/components/common/button/index.vue.d.ts +42 -0
- package/lib/components/common/button/index.vue.d.ts.map +1 -0
- package/lib/components/common/icon/appicon.vue.d.ts +12 -0
- package/lib/components/common/icon/appicon.vue.d.ts.map +1 -0
- package/lib/components/common/icon/fullscreen.vue.d.ts +4 -0
- package/lib/components/common/icon/fullscreen.vue.d.ts.map +1 -0
- package/lib/components/common/icon/helper.vue.d.ts +23 -0
- package/lib/components/common/icon/helper.vue.d.ts.map +1 -0
- package/lib/components/common/icon/index.vue.d.ts +244 -0
- package/lib/components/common/icon/index.vue.d.ts.map +1 -0
- package/lib/components/common/icon/layoutIcon.vue.d.ts +44 -0
- package/lib/components/common/icon/layoutIcon.vue.d.ts.map +1 -0
- package/lib/components/common/icon/projectIcon.vue.d.ts +60 -0
- package/lib/components/common/icon/projectIcon.vue.d.ts.map +1 -0
- package/lib/components/common/icon/toolIcon.vue.d.ts +44 -0
- package/lib/components/common/icon/toolIcon.vue.d.ts.map +1 -0
- package/lib/components/common/index.d.ts +19 -0
- package/lib/components/common/index.d.ts.map +1 -0
- package/lib/components/common/tooltip/index.vue.d.ts +22 -0
- package/lib/components/common/tooltip/index.vue.d.ts.map +1 -0
- package/lib/components/content/dialog/excelForm.vue.d.ts +31 -0
- package/lib/components/content/dialog/excelForm.vue.d.ts.map +1 -0
- package/lib/components/content/dialog/index.vue.d.ts +35 -0
- package/lib/components/content/dialog/index.vue.d.ts.map +1 -0
- package/lib/components/content/dialog/uploadForm.vue.d.ts +25 -0
- package/lib/components/content/dialog/uploadForm.vue.d.ts.map +1 -0
- package/lib/components/content/drawer/index.vue.d.ts +27 -0
- package/lib/components/content/drawer/index.vue.d.ts.map +1 -0
- package/lib/components/content/form/formItem.vue.d.ts +26 -0
- package/lib/components/content/form/formItem.vue.d.ts.map +1 -0
- package/lib/components/content/form/index.vue.d.ts +26 -0
- package/lib/components/content/form/index.vue.d.ts.map +1 -0
- package/lib/components/content/index.d.ts +27 -0
- package/lib/components/content/index.d.ts.map +1 -0
- package/lib/components/content/search/index.vue.d.ts +30 -0
- package/lib/components/content/search/index.vue.d.ts.map +1 -0
- package/lib/components/content/search/searchItem.vue.d.ts +24 -0
- package/lib/components/content/search/searchItem.vue.d.ts.map +1 -0
- package/lib/components/content/table/index.vue.d.ts +37 -0
- package/lib/components/content/table/index.vue.d.ts.map +1 -0
- package/lib/components/content/table/tableOperate.vue.d.ts +19 -0
- package/lib/components/content/table/tableOperate.vue.d.ts.map +1 -0
- package/lib/components/content/toolbar/icontool.vue.d.ts +8 -0
- package/lib/components/content/toolbar/icontool.vue.d.ts.map +1 -0
- package/lib/components/content/toolbar/index.vue.d.ts +19 -0
- package/lib/components/content/toolbar/index.vue.d.ts.map +1 -0
- package/lib/components/content/tree/index.vue.d.ts +47 -0
- package/lib/components/content/tree/index.vue.d.ts.map +1 -0
- package/lib/components/error/error403.vue.d.ts +4 -0
- package/lib/components/error/error403.vue.d.ts.map +1 -0
- package/lib/components/error/error404.vue.d.ts +4 -0
- package/lib/components/error/error404.vue.d.ts.map +1 -0
- package/lib/components/form/aceEditor/aceConfig.d.ts +9 -0
- package/lib/components/form/aceEditor/aceConfig.d.ts.map +1 -0
- package/lib/components/form/aceEditor/index.vue.d.ts +13 -0
- package/lib/components/form/aceEditor/index.vue.d.ts.map +1 -0
- package/lib/components/form/autoComplete/index.vue.d.ts +140 -0
- package/lib/components/form/autoComplete/index.vue.d.ts.map +1 -0
- package/lib/components/form/cascader/index.vue.d.ts +110 -0
- package/lib/components/form/cascader/index.vue.d.ts.map +1 -0
- package/lib/components/form/checkbox/index.vue.d.ts +129 -0
- package/lib/components/form/checkbox/index.vue.d.ts.map +1 -0
- package/lib/components/form/datePicker/index.vue.d.ts +7 -0
- package/lib/components/form/datePicker/index.vue.d.ts.map +1 -0
- package/lib/components/form/index.d.ts +41 -0
- package/lib/components/form/index.d.ts.map +1 -0
- package/lib/components/form/input/index.vue.d.ts +27 -0
- package/lib/components/form/input/index.vue.d.ts.map +1 -0
- package/lib/components/form/input/inputIcon.vue.d.ts +11 -0
- package/lib/components/form/input/inputIcon.vue.d.ts.map +1 -0
- package/lib/components/form/input/inputNumber.vue.d.ts +4 -0
- package/lib/components/form/input/inputNumber.vue.d.ts.map +1 -0
- package/lib/components/form/input/inputPassword.vue.d.ts +4 -0
- package/lib/components/form/input/inputPassword.vue.d.ts.map +1 -0
- package/lib/components/form/propEditor/index.vue.d.ts +13 -0
- package/lib/components/form/propEditor/index.vue.d.ts.map +1 -0
- package/lib/components/form/radio/index.vue.d.ts +134 -0
- package/lib/components/form/radio/index.vue.d.ts.map +1 -0
- package/lib/components/form/radio/radioStatus.vue.d.ts +32 -0
- package/lib/components/form/radio/radioStatus.vue.d.ts.map +1 -0
- package/lib/components/form/rangePicker/index.vue.d.ts +17 -0
- package/lib/components/form/rangePicker/index.vue.d.ts.map +1 -0
- package/lib/components/form/select/index.vue.d.ts +143 -0
- package/lib/components/form/select/index.vue.d.ts.map +1 -0
- package/lib/components/form/switch/index.vue.d.ts +44 -0
- package/lib/components/form/switch/index.vue.d.ts.map +1 -0
- package/lib/components/form/textarea/index.vue.d.ts +4 -0
- package/lib/components/form/textarea/index.vue.d.ts.map +1 -0
- package/lib/components/form/transfer/index.vue.d.ts +39 -0
- package/lib/components/form/transfer/index.vue.d.ts.map +1 -0
- package/lib/components/form/transfer/transferTable.vue.d.ts +39 -0
- package/lib/components/form/transfer/transferTable.vue.d.ts.map +1 -0
- package/lib/components/form/treeSelect/index.vue.d.ts +39 -0
- package/lib/components/form/treeSelect/index.vue.d.ts.map +1 -0
- package/lib/components/form/upload/uploadList.vue.d.ts +477 -0
- package/lib/components/form/upload/uploadList.vue.d.ts.map +1 -0
- package/lib/components/index.d.ts +9 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/layout/breadcrumb/index.vue.d.ts +4 -0
- package/lib/components/layout/breadcrumb/index.vue.d.ts.map +1 -0
- package/lib/components/layout/content/index.vue.d.ts +23 -0
- package/lib/components/layout/content/index.vue.d.ts.map +1 -0
- package/lib/components/layout/datetime/index.vue.d.ts +4 -0
- package/lib/components/layout/datetime/index.vue.d.ts.map +1 -0
- package/lib/components/layout/header/headerExits.vue.d.ts +4 -0
- package/lib/components/layout/header/headerExits.vue.d.ts.map +1 -0
- package/lib/components/layout/header/index.vue.d.ts +4 -0
- package/lib/components/layout/header/index.vue.d.ts.map +1 -0
- package/lib/components/layout/index.d.ts +17 -0
- package/lib/components/layout/index.d.ts.map +1 -0
- package/lib/components/layout/menu/index.vue.d.ts +7 -0
- package/lib/components/layout/menu/index.vue.d.ts.map +1 -0
- package/lib/components/layout/menu/menuTabs.vue.d.ts +4 -0
- package/lib/components/layout/menu/menuTabs.vue.d.ts.map +1 -0
- package/lib/components/layout/page/basicLayout.vue.d.ts +7 -0
- package/lib/components/layout/page/basicLayout.vue.d.ts.map +1 -0
- package/lib/es/AceEditor/index.js +168 -0
- package/lib/es/BasicLayout/index.js +4 -0
- package/lib/es/Error403/index.js +4 -0
- package/lib/es/Error404/index.js +4 -0
- package/lib/es/ExcelForm/index.js +5 -0
- package/lib/es/UploadForm/index.js +5 -0
- package/lib/index.d.ts +2 -0
- package/lib/webui.css +1 -0
- package/lib/webui.es.js +3349 -0
- package/package.json +66 -0
- package/plugins/vite-plugin-auto-generate-vue.ts +105 -0
- package/postcss.config.ts +6 -0
- package/src/assets/global.css +9 -0
- package/src/components/common/button/index.vue +126 -0
- package/src/components/common/icon/appicon.vue +28 -0
- package/src/components/common/icon/fullscreen.vue +13 -0
- package/src/components/common/icon/helper.vue +30 -0
- package/src/components/common/icon/index.vue +426 -0
- package/src/components/common/icon/layoutIcon.vue +33 -0
- package/src/components/common/icon/projectIcon.vue +41 -0
- package/src/components/common/icon/toolIcon.vue +33 -0
- package/src/components/common/index.ts +19 -0
- package/src/components/common/tooltip/index.vue +25 -0
- package/src/components/content/dialog/excelForm.vue +479 -0
- package/src/components/content/dialog/index.vue +149 -0
- package/src/components/content/dialog/uploadForm.vue +228 -0
- package/src/components/content/drawer/index.vue +93 -0
- package/src/components/content/form/formItem.vue +76 -0
- package/src/components/content/form/index.vue +48 -0
- package/src/components/content/index.ts +32 -0
- package/src/components/content/search/index.vue +135 -0
- package/src/components/content/search/searchItem.vue +52 -0
- package/src/components/content/table/index.vue +215 -0
- package/src/components/content/table/tableOperate.vue +131 -0
- package/src/components/content/toolbar/icontool.vue +151 -0
- package/src/components/content/toolbar/index.vue +107 -0
- package/src/components/content/tree/index.vue +140 -0
- package/src/components/error/error403.vue +14 -0
- package/src/components/error/error404.vue +14 -0
- package/src/components/form/aceEditor/aceConfig.ts +90 -0
- package/src/components/form/aceEditor/index.vue +175 -0
- package/src/components/form/autoComplete/index.vue +171 -0
- package/src/components/form/cascader/index.vue +110 -0
- package/src/components/form/checkbox/index.vue +108 -0
- package/src/components/form/datePicker/index.vue +29 -0
- package/src/components/form/index.ts +54 -0
- package/src/components/form/input/index.vue +70 -0
- package/src/components/form/input/inputIcon.vue +39 -0
- package/src/components/form/input/inputNumber.vue +23 -0
- package/src/components/form/input/inputPassword.vue +22 -0
- package/src/components/form/propEditor/index.vue +81 -0
- package/src/components/form/radio/index.vue +132 -0
- package/src/components/form/radio/radioStatus.vue +42 -0
- package/src/components/form/rangePicker/index.vue +64 -0
- package/src/components/form/select/index.vue +186 -0
- package/src/components/form/switch/index.vue +58 -0
- package/src/components/form/textarea/index.vue +23 -0
- package/src/components/form/transfer/index.vue +95 -0
- package/src/components/form/transfer/transferTable.vue +124 -0
- package/src/components/form/treeSelect/index.vue +108 -0
- package/src/components/form/upload/uploadList.vue +235 -0
- package/src/components/index.ts +97 -0
- package/src/components/layout/breadcrumb/index.vue +38 -0
- package/src/components/layout/content/index.vue +28 -0
- package/src/components/layout/datetime/index.vue +16 -0
- package/src/components/layout/header/headerExits.vue +28 -0
- package/src/components/layout/header/index.vue +43 -0
- package/src/components/layout/index.ts +16 -0
- package/src/components/layout/menu/index.vue +64 -0
- package/src/components/layout/menu/menuTabs.vue +56 -0
- package/src/components/layout/page/basicLayout.vue +67 -0
- package/src/vite-env.d.ts +8 -0
- package/tailwind.config.ts +11 -0
- package/tsconfig.json +53 -0
- package/vite.config.ts +117 -0
- package//344/273/243/347/240/201/350/247/204/350/214/203/345/217/212/351/243/216/346/240/274/346/214/207/345/215/227.md +116 -0
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@skyfox2000/webui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "后台前端通用组件定义",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"keywords": [],
|
|
7
|
+
"author": "skyfox2000@github.com",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"module": "./lib/webui.es.js",
|
|
13
|
+
"types": "./lib/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./lib/index.d.ts",
|
|
17
|
+
"default": "./lib/webui.es.js"
|
|
18
|
+
},
|
|
19
|
+
"./webui.css": {
|
|
20
|
+
"default": "./lib/webui.css"
|
|
21
|
+
},
|
|
22
|
+
"./es/*": {
|
|
23
|
+
"import": "./lib/es/*/index.js",
|
|
24
|
+
"types": "./lib/*.d.ts"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "vue-tsc -b && vite build",
|
|
29
|
+
"build:dts": "vue-tsc -b && vite-dts-declaration",
|
|
30
|
+
"build:types": "vue-tsc --declaration --emitDeclarationOnly"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@skyfox2000/fapi": "^1.1.17",
|
|
34
|
+
"@skyfox2000/microbase": "^1.0.14",
|
|
35
|
+
"@skyfox2000/webbase": "^1.0.48",
|
|
36
|
+
"@vue-office/excel": "^1.7.14",
|
|
37
|
+
"ace-builds": "^1.42.0",
|
|
38
|
+
"ant-design-vue": "^4.2.6",
|
|
39
|
+
"dayjs": "^1.11.13",
|
|
40
|
+
"pinia": "^2.3.0",
|
|
41
|
+
"pinia-plugin-persistedstate": "^4.2.0",
|
|
42
|
+
"vue": "^3.5.16",
|
|
43
|
+
"vue-draggable-next": "^2.2.1",
|
|
44
|
+
"vue-m-message": "^4.0.2",
|
|
45
|
+
"vue-router": "^4.5.1",
|
|
46
|
+
"vue3-ace-editor": "^2.2.4"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^22.15.30",
|
|
50
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
51
|
+
"autoprefixer": "^10.4.21",
|
|
52
|
+
"esbuild": "^0.19.12",
|
|
53
|
+
"eslint": "^9.28.0",
|
|
54
|
+
"eslint-config-prettier": "^9.1.0",
|
|
55
|
+
"eslint-plugin-prettier": "^5.4.1",
|
|
56
|
+
"eslint-plugin-vue": "^9.33.0",
|
|
57
|
+
"postcss": "^8.5.4",
|
|
58
|
+
"prettier": "^3.5.3",
|
|
59
|
+
"rollup": "^4.42.0",
|
|
60
|
+
"tailwindcss": "^3.4.17",
|
|
61
|
+
"typescript": "^5.8.3",
|
|
62
|
+
"vite": "^6.3.5",
|
|
63
|
+
"vite-plugin-dts": "^4.5.4",
|
|
64
|
+
"vue-tsc": "^2.2.10"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 首字母大写的工具函数
|
|
7
|
+
*/
|
|
8
|
+
function capitalize(str: string): string {
|
|
9
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 规范化路径,确保使用正斜杠
|
|
14
|
+
*/
|
|
15
|
+
function normalizePath(filePath: string): string {
|
|
16
|
+
return filePath.split(path.sep).join('/');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 递归扫描目录中的 .vue 文件并生成导出语句
|
|
21
|
+
*/
|
|
22
|
+
function scanDir(dir: string, baseDir: string, skipDirFile: string[]): string[] {
|
|
23
|
+
const result: string[] = [];
|
|
24
|
+
const files = fs.readdirSync(dir);
|
|
25
|
+
files.forEach((file) => {
|
|
26
|
+
const filePath = path.join(dir, file);
|
|
27
|
+
if (skipDirFile.includes(filePath)) return;
|
|
28
|
+
|
|
29
|
+
const stat = fs.statSync(filePath);
|
|
30
|
+
|
|
31
|
+
if (stat.isDirectory()) {
|
|
32
|
+
// 递归扫描子目录
|
|
33
|
+
const subResult = scanDir(filePath, baseDir, skipDirFile);
|
|
34
|
+
result.push(...subResult);
|
|
35
|
+
} else if (file.endsWith('.vue')) {
|
|
36
|
+
// 获取相对路径并规范化
|
|
37
|
+
const relativePath = normalizePath(path.relative(baseDir, filePath));
|
|
38
|
+
const componentName = generateComponentName(filePath);
|
|
39
|
+
|
|
40
|
+
// 使用规范化的路径生成导入语句
|
|
41
|
+
result.push(`import ${componentName} from './${relativePath}';\nexport { ${componentName} };`);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 根据文件路径生成组件名
|
|
50
|
+
*/
|
|
51
|
+
function generateComponentName(filePath: string): string {
|
|
52
|
+
const dirName = path.basename(path.dirname(filePath));
|
|
53
|
+
const fileName = path.basename(filePath, '.vue');
|
|
54
|
+
|
|
55
|
+
if (fileName === 'index') {
|
|
56
|
+
return capitalize(dirName);
|
|
57
|
+
} else {
|
|
58
|
+
return capitalize(fileName);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 插件主逻辑
|
|
64
|
+
*/
|
|
65
|
+
export default function AutoGenerateVue(options: { dir: string; skip: string[]; output: string }): Plugin {
|
|
66
|
+
return {
|
|
67
|
+
name: 'vite-plugin-auto-generate-vue',
|
|
68
|
+
config() {
|
|
69
|
+
const { dir, skip, output } = options;
|
|
70
|
+
|
|
71
|
+
// 检查output是否文件结尾
|
|
72
|
+
const isFile = path.extname(output) !== '';
|
|
73
|
+
if (!isFile) {
|
|
74
|
+
throw new Error(`The specified output file "${output}" must be a file.`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// 规范化路径
|
|
78
|
+
const componentsDir = normalizePath(path.resolve(process.cwd(), dir));
|
|
79
|
+
const skipDirFile = skip.map((url) => {
|
|
80
|
+
return normalizePath(path.resolve(process.cwd(), url));
|
|
81
|
+
});
|
|
82
|
+
const outputFile = normalizePath(path.resolve(process.cwd(), output));
|
|
83
|
+
|
|
84
|
+
// 获取输出文件的目录路径
|
|
85
|
+
const baseDir = normalizePath(path.dirname(path.resolve(process.cwd(), output)));
|
|
86
|
+
|
|
87
|
+
if (!fs.existsSync(componentsDir)) {
|
|
88
|
+
throw new Error(`The specified directory "${componentsDir}" does not exist.`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const result = scanDir(componentsDir, baseDir, skipDirFile);
|
|
92
|
+
const exportStatements = result.join('\n');
|
|
93
|
+
|
|
94
|
+
// 确保输出目录存在
|
|
95
|
+
const outputDir = path.dirname(outputFile);
|
|
96
|
+
if (!fs.existsSync(outputDir)) {
|
|
97
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// 写入到目标文件
|
|
101
|
+
fs.writeFileSync(outputFile, exportStatements, 'utf-8');
|
|
102
|
+
console.log(`[autoGenerateVue] Global components written to ${output}`);
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* 按钮组件
|
|
4
|
+
* @component
|
|
5
|
+
* @name Button
|
|
6
|
+
* @summary 提供一个可点击的图标按钮,支持自动切换图标,发送点击事件等功能。
|
|
7
|
+
*/
|
|
8
|
+
import { Button } from 'ant-design-vue';
|
|
9
|
+
import Tooltip from '../tooltip/index.vue';
|
|
10
|
+
import ToolIcon from '../icon/toolIcon.vue';
|
|
11
|
+
import { useAttrs } from 'vue';
|
|
12
|
+
|
|
13
|
+
// 关闭自动继承属性到根元素
|
|
14
|
+
defineOptions({
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
});
|
|
17
|
+
const attrs = useAttrs(); // 手动获取 $attrs
|
|
18
|
+
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
/**
|
|
21
|
+
* 提示标题
|
|
22
|
+
* @props
|
|
23
|
+
* @name content
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
tiptext: String,
|
|
27
|
+
/**
|
|
28
|
+
* 提示显示位置
|
|
29
|
+
* @props
|
|
30
|
+
* @name placement
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @default 'top'
|
|
33
|
+
*/
|
|
34
|
+
placement: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'top',
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* 内置图标属性设置
|
|
40
|
+
* @props
|
|
41
|
+
* @name iconProps
|
|
42
|
+
* @type {object}
|
|
43
|
+
* @summary 内置图标复杂属性设置,仅支持前置图标
|
|
44
|
+
*/
|
|
45
|
+
iconProps: Object,
|
|
46
|
+
/**
|
|
47
|
+
* 默认使用框架图标
|
|
48
|
+
* 其它图标请自定义
|
|
49
|
+
* @props
|
|
50
|
+
* @name icon
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
53
|
+
icon: String,
|
|
54
|
+
// /**
|
|
55
|
+
// * 点击事件
|
|
56
|
+
// * @props
|
|
57
|
+
// * @name clickEvent
|
|
58
|
+
// * @summary 格式 "空间名#事件名",空间名和事件名用#分隔,事件名用.分隔
|
|
59
|
+
// * @type {string}
|
|
60
|
+
// */
|
|
61
|
+
// clickEvent: {
|
|
62
|
+
// type: String
|
|
63
|
+
// },
|
|
64
|
+
// /**
|
|
65
|
+
// * 点击传输数据
|
|
66
|
+
// * @props
|
|
67
|
+
// * @name data
|
|
68
|
+
// * @summary 点击事件传输的默认数据
|
|
69
|
+
// * @type {object|string}
|
|
70
|
+
// */
|
|
71
|
+
// data: {
|
|
72
|
+
// type: [Object, String]
|
|
73
|
+
// }
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// 定义组件发出的事件
|
|
77
|
+
const emits = defineEmits([
|
|
78
|
+
/**
|
|
79
|
+
* 点击事件
|
|
80
|
+
* @emits
|
|
81
|
+
* @name click
|
|
82
|
+
* @summary 图标按钮点击时触发的事件
|
|
83
|
+
*/
|
|
84
|
+
'click',
|
|
85
|
+
]);
|
|
86
|
+
|
|
87
|
+
const onClicked = () => {
|
|
88
|
+
// if (props.clickEvent) {
|
|
89
|
+
// const eventNames = props.clickEvent.split("#");
|
|
90
|
+
// if (eventNames.length === 2) {
|
|
91
|
+
// const $Bus = inject("$" + eventNames[0]) as any;
|
|
92
|
+
// $Bus.$emit(eventNames[1], props.data);
|
|
93
|
+
// }
|
|
94
|
+
// }
|
|
95
|
+
if (props.iconProps && props.iconProps.icons) {
|
|
96
|
+
props.iconProps.iconIndex = (props.iconProps.iconIndex + 1) % props.iconProps.icons.length;
|
|
97
|
+
}
|
|
98
|
+
emits('click');
|
|
99
|
+
};
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<div>
|
|
104
|
+
<!-- v-permit 必须放在实体元素上 -->
|
|
105
|
+
<Tooltip :title="props.tiptext" :disabled="props.tiptext ? undefined : 'disabled'" :placement="placement">
|
|
106
|
+
<Button class="px-[10px] py-[4px] flex items-center gap-1" v-bind="attrs" @click="onClicked">
|
|
107
|
+
<template #icon>
|
|
108
|
+
<slot name="icon">
|
|
109
|
+
<ToolIcon
|
|
110
|
+
:icon="props.icon"
|
|
111
|
+
:class="[
|
|
112
|
+
attrs.type === 'primary' ? 'ant-btn-primary' : '',
|
|
113
|
+
'cursor-pointer w-[17px] h-[17px] mx-auto',
|
|
114
|
+
]"
|
|
115
|
+
clickable
|
|
116
|
+
v-bind="props.iconProps"
|
|
117
|
+
/>
|
|
118
|
+
</slot>
|
|
119
|
+
</template>
|
|
120
|
+
<template #default>
|
|
121
|
+
<slot></slot>
|
|
122
|
+
</template>
|
|
123
|
+
</Button>
|
|
124
|
+
</Tooltip>
|
|
125
|
+
</div>
|
|
126
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { SERVER_HOST } from '@skyfox2000/fapi';
|
|
3
|
+
import { createFromIconfont } from '@skyfox2000/webbase';
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
icon: {
|
|
7
|
+
type: String,
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* 应用图标加载
|
|
12
|
+
* @returns 应用图标集
|
|
13
|
+
*/
|
|
14
|
+
const AppIcon = () => {
|
|
15
|
+
return createFromIconfont({
|
|
16
|
+
iconUrl: `${SERVER_HOST.APP_ICONS}`,
|
|
17
|
+
icon: props.icon,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 加载全部应用图标
|
|
23
|
+
*/
|
|
24
|
+
const AppIcons = AppIcon();
|
|
25
|
+
</script>
|
|
26
|
+
<template>
|
|
27
|
+
<AppIcons v-if="icon" :icon="icon" :class="['text-2xl', 'align-middle', 'w-6', 'h-6']" v-bind="$attrs" />
|
|
28
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onFullscreenClick, useSettingInfo } from '@skyfox2000/webbase';
|
|
3
|
+
import ToolIcon from './toolIcon.vue';
|
|
4
|
+
const settingStore = useSettingInfo();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<ToolIcon
|
|
9
|
+
@click.stop="onFullscreenClick"
|
|
10
|
+
:icon="settingStore.fullscreen ? 'icon-exitscreen' : 'icon-fullscreen'"
|
|
11
|
+
class="w-[17px] h-[17px]"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Popover } from 'ant-design-vue';
|
|
3
|
+
import ToolIcon from './toolIcon.vue';
|
|
4
|
+
import { useAttrs } from 'vue';
|
|
5
|
+
|
|
6
|
+
defineProps<{
|
|
7
|
+
text?: string;
|
|
8
|
+
maxWidth?: string;
|
|
9
|
+
}>();
|
|
10
|
+
// 关闭自动继承属性到根元素
|
|
11
|
+
defineOptions({
|
|
12
|
+
inheritAttrs: false,
|
|
13
|
+
});
|
|
14
|
+
const attrs = useAttrs(); // 手动获取 $attrs
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<Popover placement="topRight">
|
|
19
|
+
<template #content>
|
|
20
|
+
<slot>
|
|
21
|
+
<div class="text-[14px]" :style="{ maxWidth }">
|
|
22
|
+
{{ text }}
|
|
23
|
+
</div>
|
|
24
|
+
</slot>
|
|
25
|
+
</template>
|
|
26
|
+
<span class="ml-2">
|
|
27
|
+
<ToolIcon icon="icon-question-circle" class="text-[#888] w-4 h-4" v-bind="attrs" />
|
|
28
|
+
</span>
|
|
29
|
+
</Popover>
|
|
30
|
+
</template>
|