提交 314af25a 作者: 方治民

feat: 接入 pont 接口生成工具、统一代码格式

上级 ebec3835
...@@ -14,6 +14,7 @@ VITE_DROP_CONSOLE = false ...@@ -14,6 +14,7 @@ VITE_DROP_CONSOLE = false
# Basic interface address SPA # Basic interface address SPA
VITE_GLOB_API_URL=/basic-api VITE_GLOB_API_URL=/basic-api
# VITE_GLOB_API_URL=http://localhost:8181/basic-api
# File upload address, optional # File upload address, optional
VITE_GLOB_UPLOAD_URL=/upload VITE_GLOB_UPLOAD_URL=/upload
......
...@@ -15,11 +15,7 @@ module.exports = { ...@@ -15,11 +15,7 @@ module.exports = {
jsx: true, jsx: true,
}, },
}, },
extends: [ extends: ['plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: { rules: {
'vue/script-setup-uses-vars': 'error', 'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off', '@typescript-eslint/ban-ts-ignore': 'off',
......
...@@ -27,3 +27,5 @@ pnpm-debug.log* ...@@ -27,3 +27,5 @@ pnpm-debug.log*
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
.mocks/
\ No newline at end of file
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
}, },
"files.exclude": { "files.exclude": {
"**/.cache": true, "**/.cache": true,
"**/.editorconfig": true,
"**/.eslintcache": true, "**/.eslintcache": true,
"**/bower_components": true, "**/bower_components": true,
"**/.idea": true, "**/.idea": true,
......
...@@ -9,12 +9,7 @@ export function resultSuccess<T = Recordable>(result: T, { message = 'ok' } = {} ...@@ -9,12 +9,7 @@ export function resultSuccess<T = Recordable>(result: T, { message = 'ok' } = {}
} }
} }
export function resultPageSuccess<T = any>( export function resultPageSuccess<T = any>(page: number, pageSize: number, list: T[], { message = 'ok' } = {}) {
page: number,
pageSize: number,
list: T[],
{ message = 'ok' } = {},
) {
const pageData = pagination(page, pageSize, list) const pageData = pagination(page, pageSize, list)
return { return {
......
...@@ -88,11 +88,9 @@ const menuList = (() => { ...@@ -88,11 +88,9 @@ const menuList = (() => {
menuName: ['菜单1', '菜单2', '菜单3', '菜单4'][j], menuName: ['菜单1', '菜单2', '菜单3', '菜单4'][j],
icon: 'ion:document', icon: 'ion:document',
permission: ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index], permission: ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index],
component: [ component: ['/dashboard/welcome/index', '/dashboard/workbench/index', '/dashboard/test/index'][
'/dashboard/welcome/index', j
'/dashboard/workbench/index', ],
'/dashboard/test/index',
][j],
orderNo: j + 1, orderNo: j + 1,
createTime: '@datetime', createTime: '@datetime',
'status|1': ['0', '1'], 'status|1': ['0', '1'],
...@@ -106,9 +104,7 @@ const menuList = (() => { ...@@ -106,9 +104,7 @@ const menuList = (() => {
menuName: '按钮' + (j + 1) + '-' + (k + 1), menuName: '按钮' + (j + 1) + '-' + (k + 1),
icon: '', icon: '',
permission: permission:
['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][ ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index] +
index
] +
':btn' + ':btn' +
(k + 1), (k + 1),
component: [ component: [
......
...@@ -241,13 +241,11 @@ export default [ ...@@ -241,13 +241,11 @@ export default [
let menu: Object[] let menu: Object[]
switch (id) { switch (id) {
case '1': case '1':
dashboardRoute.redirect = dashboardRoute.redirect = dashboardRoute.path + '/' + dashboardRoute.children[0].path
dashboardRoute.path + '/' + dashboardRoute.children[0].path
menu = [dashboardRoute, authRoute, levelRoute, sysRoute, linkRoute] menu = [dashboardRoute, authRoute, levelRoute, sysRoute, linkRoute]
break break
case '2': case '2':
dashboardRoute.redirect = dashboardRoute.redirect = dashboardRoute.path + '/' + dashboardRoute.children[1].path
dashboardRoute.path + '/' + dashboardRoute.children[1].path
menu = [dashboardRoute, authRoute, levelRoute, linkRoute] menu = [dashboardRoute, authRoute, levelRoute, linkRoute]
break break
default: default:
......
...@@ -132,6 +132,7 @@ ...@@ -132,6 +132,7 @@
"lint-staged": "12.3.7", "lint-staged": "12.3.7",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"pont-engine": "^1.2.0",
"postcss": "^8.4.12", "postcss": "^8.4.12",
"postcss-html": "^1.3.0", "postcss-html": "^1.3.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
......
...@@ -66,6 +66,7 @@ specifiers: ...@@ -66,6 +66,7 @@ specifiers:
path-to-regexp: ^6.2.0 path-to-regexp: ^6.2.0
picocolors: ^1.0.0 picocolors: ^1.0.0
pinia: 2.0.12 pinia: 2.0.12
pont-engine: ^1.2.0
postcss: ^8.4.12 postcss: ^8.4.12
postcss-html: ^1.3.0 postcss-html: ^1.3.0
postcss-less: ^6.0.0 postcss-less: ^6.0.0
...@@ -196,6 +197,7 @@ devDependencies: ...@@ -196,6 +197,7 @@ devDependencies:
lint-staged: 12.3.7 lint-staged: 12.3.7
npm-run-all: 4.1.5 npm-run-all: 4.1.5
picocolors: 1.0.0 picocolors: 1.0.0
pont-engine: registry.npmjs.org/pont-engine/1.2.0
postcss: 8.4.12 postcss: 8.4.12
postcss-html: 1.3.0 postcss-html: 1.3.0
postcss-less: 6.0.0_postcss@8.4.12 postcss-less: 6.0.0_postcss@8.4.12
...@@ -1870,7 +1872,7 @@ packages: ...@@ -1870,7 +1872,7 @@ packages:
'@octokit/request-error': 2.1.0 '@octokit/request-error': 2.1.0
'@octokit/types': 6.34.0 '@octokit/types': 6.34.0
is-plain-object: 5.0.0 is-plain-object: 5.0.0
node-fetch: 2.6.7 node-fetch: registry.npmjs.org/node-fetch/2.6.7
universal-user-agent: 6.0.0 universal-user-agent: 6.0.0
transitivePeerDependencies: transitivePeerDependencies:
- encoding - encoding
...@@ -3347,10 +3349,6 @@ packages: ...@@ -3347,10 +3349,6 @@ packages:
resolution: {integrity: sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==} resolution: {integrity: sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==}
dev: true dev: true
/commander/2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
dev: true
/commander/7.2.0: /commander/7.2.0:
resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
...@@ -7779,7 +7777,7 @@ packages: ...@@ -7779,7 +7777,7 @@ packages:
resolution: {integrity: sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==} resolution: {integrity: sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==}
hasBin: true hasBin: true
dependencies: dependencies:
commander: 2.20.3 commander: registry.npmjs.org/commander/2.20.3
dev: true dev: true
/semver/5.7.1: /semver/5.7.1:
...@@ -8529,7 +8527,7 @@ packages: ...@@ -8529,7 +8527,7 @@ packages:
hasBin: true hasBin: true
dependencies: dependencies:
acorn: 8.7.0 acorn: 8.7.0
commander: 2.20.3 commander: registry.npmjs.org/commander/2.20.3
source-map: registry.npmjs.org/source-map/0.7.3 source-map: registry.npmjs.org/source-map/0.7.3
source-map-support: 0.5.21 source-map-support: 0.5.21
dev: true dev: true
...@@ -8617,15 +8615,6 @@ packages: ...@@ -8617,15 +8615,6 @@ packages:
resolution: {integrity: sha1-zCAOqyYT9BZtJ/+a/HylbUnfbrQ=} resolution: {integrity: sha1-zCAOqyYT9BZtJ/+a/HylbUnfbrQ=}
dev: true dev: true
/tr46/0.0.3:
resolution: {integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=}
/tr46/1.0.1:
resolution: {integrity: sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=}
dependencies:
punycode: 2.1.1
dev: true
/traverse/0.6.6: /traverse/0.6.6:
resolution: {integrity: sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=} resolution: {integrity: sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=}
dev: true dev: true
...@@ -9333,25 +9322,18 @@ packages: ...@@ -9333,25 +9322,18 @@ packages:
defaults: 1.0.3 defaults: 1.0.3
dev: true dev: true
/webidl-conversions/3.0.1:
resolution: {integrity: sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=}
/webidl-conversions/4.0.2:
resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==}
dev: true
/whatwg-url/5.0.0: /whatwg-url/5.0.0:
resolution: {integrity: sha1-lmRU6HZUYuN2RNNib2dCzotwll0=} resolution: {integrity: sha1-lmRU6HZUYuN2RNNib2dCzotwll0=}
dependencies: dependencies:
tr46: 0.0.3 tr46: registry.npmjs.org/tr46/0.0.3
webidl-conversions: 3.0.1 webidl-conversions: registry.npmjs.org/webidl-conversions/3.0.1
/whatwg-url/7.1.0: /whatwg-url/7.1.0:
resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==}
dependencies: dependencies:
lodash.sortby: 4.7.0 lodash.sortby: 4.7.0
tr46: 1.0.1 tr46: registry.npmjs.org/tr46/1.0.1
webidl-conversions: 4.0.2 webidl-conversions: registry.npmjs.org/webidl-conversions/4.0.2
dev: true dev: true
/which-boxed-primitive/1.0.2: /which-boxed-primitive/1.0.2:
...@@ -9886,6 +9868,12 @@ packages: ...@@ -9886,6 +9868,12 @@ packages:
dev: true dev: true
optional: true optional: true
registry.npmjs.org/@types/blueimp-md5/2.18.0:
resolution: {integrity: sha512-f4A+++lGZGJvVSgeyMkqA7BEf2BVQli6F+qEykKb49c5ieWQBkfpn6CP5c1IZr2Yi2Ofl6Fj+v0e1fN18Z8Cnw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/blueimp-md5/-/blueimp-md5-2.18.0.tgz}
name: '@types/blueimp-md5'
version: 2.18.0
dev: true
registry.npmjs.org/@types/glob/7.2.0: registry.npmjs.org/@types/glob/7.2.0:
resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz} resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz}
name: '@types/glob' name: '@types/glob'
...@@ -9901,6 +9889,12 @@ packages: ...@@ -9901,6 +9889,12 @@ packages:
version: 3.0.5 version: 3.0.5
dev: true dev: true
registry.npmjs.org/@types/node/12.20.47:
resolution: {integrity: sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz}
name: '@types/node'
version: 12.20.47
dev: true
registry.npmjs.org/@types/node/17.0.21: registry.npmjs.org/@types/node/17.0.21:
resolution: {integrity: sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz} resolution: {integrity: sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz}
name: '@types/node' name: '@types/node'
...@@ -9958,6 +9952,15 @@ packages: ...@@ -9958,6 +9952,15 @@ packages:
engines: {node: '>=4'} engines: {node: '>=4'}
dev: true dev: true
registry.npmjs.org/ansi-escapes/4.3.2:
resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz}
name: ansi-escapes
version: 4.3.2
engines: {node: '>=8'}
dependencies:
type-fest: registry.npmjs.org/type-fest/0.21.3
dev: true
registry.npmjs.org/ansi-regex/2.1.1: registry.npmjs.org/ansi-regex/2.1.1:
resolution: {integrity: sha1-w7M6te42DYbg5ijwRorn7yfWVN8=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz} resolution: {integrity: sha1-w7M6te42DYbg5ijwRorn7yfWVN8=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz}
name: ansi-regex name: ansi-regex
...@@ -10118,6 +10121,12 @@ packages: ...@@ -10118,6 +10121,12 @@ packages:
safe-buffer: registry.npmjs.org/safe-buffer/5.2.1 safe-buffer: registry.npmjs.org/safe-buffer/5.2.1
dev: true dev: true
registry.npmjs.org/blueimp-md5/2.19.0:
resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz}
name: blueimp-md5
version: 2.19.0
dev: true
registry.npmjs.org/brace-expansion/1.1.11: registry.npmjs.org/brace-expansion/1.1.11:
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz} resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz}
name: brace-expansion name: brace-expansion
...@@ -10280,12 +10289,28 @@ packages: ...@@ -10280,12 +10289,28 @@ packages:
restore-cursor: registry.npmjs.org/restore-cursor/2.0.0 restore-cursor: registry.npmjs.org/restore-cursor/2.0.0
dev: true dev: true
registry.npmjs.org/cli-cursor/3.1.0:
resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz}
name: cli-cursor
version: 3.1.0
engines: {node: '>=8'}
dependencies:
restore-cursor: registry.npmjs.org/restore-cursor/3.1.0
dev: true
registry.npmjs.org/cli-width/2.2.1: registry.npmjs.org/cli-width/2.2.1:
resolution: {integrity: sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz} resolution: {integrity: sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz}
name: cli-width name: cli-width
version: 2.2.1 version: 2.2.1
dev: true dev: true
registry.npmjs.org/cli-width/3.0.0:
resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz}
name: cli-width
version: 3.0.0
engines: {node: '>= 10'}
dev: true
registry.npmjs.org/clone-response/1.0.2: registry.npmjs.org/clone-response/1.0.2:
resolution: {integrity: sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz} resolution: {integrity: sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz}
name: clone-response name: clone-response
...@@ -10671,6 +10696,11 @@ packages: ...@@ -10671,6 +10696,11 @@ packages:
version: 0.1.4 version: 0.1.4
dev: true dev: true
registry.npmjs.org/emoji-regex/8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz}
name: emoji-regex
version: 8.0.0
registry.npmjs.org/end-of-stream/1.4.4: registry.npmjs.org/end-of-stream/1.4.4:
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz} resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz}
name: end-of-stream name: end-of-stream
...@@ -11055,6 +11085,15 @@ packages: ...@@ -11055,6 +11085,15 @@ packages:
escape-string-regexp: registry.npmjs.org/escape-string-regexp/1.0.5 escape-string-regexp: registry.npmjs.org/escape-string-regexp/1.0.5
dev: true dev: true
registry.npmjs.org/figures/3.2.0:
resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/figures/-/figures-3.2.0.tgz}
name: figures
version: 3.2.0
engines: {node: '>=8'}
dependencies:
escape-string-regexp: registry.npmjs.org/escape-string-regexp/1.0.5
dev: true
registry.npmjs.org/file-type/3.9.0: registry.npmjs.org/file-type/3.9.0:
resolution: {integrity: sha1-JXoHg4TR24CHvESdEH1SpSZyuek=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz} resolution: {integrity: sha1-JXoHg4TR24CHvESdEH1SpSZyuek=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz}
name: file-type name: file-type
...@@ -11191,6 +11230,16 @@ packages: ...@@ -11191,6 +11230,16 @@ packages:
universalify: registry.npmjs.org/universalify/2.0.0 universalify: registry.npmjs.org/universalify/2.0.0
dev: true dev: true
registry.npmjs.org/fs-extra/5.0.0:
resolution: {integrity: sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz}
name: fs-extra
version: 5.0.0
dependencies:
graceful-fs: registry.npmjs.org/graceful-fs/4.2.9
jsonfile: registry.npmjs.org/jsonfile/4.0.0
universalify: registry.npmjs.org/universalify/0.1.2
dev: true
registry.npmjs.org/fs-extra/8.1.0: registry.npmjs.org/fs-extra/8.1.0:
resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz} resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz}
name: fs-extra name: fs-extra
...@@ -11545,6 +11594,27 @@ packages: ...@@ -11545,6 +11594,27 @@ packages:
through: registry.npmjs.org/through/2.3.8 through: registry.npmjs.org/through/2.3.8
dev: true dev: true
registry.npmjs.org/inquirer/7.3.3:
resolution: {integrity: sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz}
name: inquirer
version: 7.3.3
engines: {node: '>=8.0.0'}
dependencies:
ansi-escapes: registry.npmjs.org/ansi-escapes/4.3.2
chalk: registry.npmjs.org/chalk/4.1.2
cli-cursor: registry.npmjs.org/cli-cursor/3.1.0
cli-width: registry.npmjs.org/cli-width/3.0.0
external-editor: registry.npmjs.org/external-editor/3.1.0
figures: registry.npmjs.org/figures/3.2.0
lodash: registry.npmjs.org/lodash/4.17.21
mute-stream: registry.npmjs.org/mute-stream/0.0.8
run-async: registry.npmjs.org/run-async/2.4.1
rxjs: registry.npmjs.org/rxjs/6.6.7
string-width: registry.npmjs.org/string-width/4.2.3
strip-ansi: registry.npmjs.org/strip-ansi/6.0.1
through: registry.npmjs.org/through/2.3.8
dev: true
registry.npmjs.org/into-stream/3.1.0: registry.npmjs.org/into-stream/3.1.0:
resolution: {integrity: sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz} resolution: {integrity: sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz}
name: into-stream name: into-stream
...@@ -11865,6 +11935,13 @@ packages: ...@@ -11865,6 +11935,13 @@ packages:
engines: {node: '>=4'} engines: {node: '>=4'}
dev: true dev: true
registry.npmjs.org/mimic-fn/2.1.0:
resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz}
name: mimic-fn
version: 2.1.0
engines: {node: '>=6'}
dev: true
registry.npmjs.org/mimic-response/1.0.1: registry.npmjs.org/mimic-response/1.0.1:
resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz} resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz}
name: mimic-response name: mimic-response
...@@ -11911,6 +11988,12 @@ packages: ...@@ -11911,6 +11988,12 @@ packages:
version: 0.0.7 version: 0.0.7
dev: true dev: true
registry.npmjs.org/mute-stream/0.0.8:
resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz}
name: mute-stream
version: 0.0.8
dev: true
registry.npmjs.org/needle/2.9.1: registry.npmjs.org/needle/2.9.1:
resolution: {integrity: sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/needle/-/needle-2.9.1.tgz} resolution: {integrity: sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/needle/-/needle-2.9.1.tgz}
name: needle name: needle
...@@ -11931,6 +12014,20 @@ packages: ...@@ -11931,6 +12014,20 @@ packages:
version: 1.0.5 version: 1.0.5
dev: true dev: true
registry.npmjs.org/node-fetch/2.6.7:
resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz}
name: node-fetch
version: 2.6.7
engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
dependencies:
whatwg-url: registry.npmjs.org/whatwg-url/5.0.0
dev: true
registry.npmjs.org/normalize-url/2.0.1: registry.npmjs.org/normalize-url/2.0.1:
resolution: {integrity: sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz} resolution: {integrity: sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz}
name: normalize-url name: normalize-url
...@@ -11985,6 +12082,15 @@ packages: ...@@ -11985,6 +12082,15 @@ packages:
mimic-fn: registry.npmjs.org/mimic-fn/1.2.0 mimic-fn: registry.npmjs.org/mimic-fn/1.2.0
dev: true dev: true
registry.npmjs.org/onetime/5.1.2:
resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz}
name: onetime
version: 5.1.2
engines: {node: '>=6'}
dependencies:
mimic-fn: registry.npmjs.org/mimic-fn/2.1.0
dev: true
registry.npmjs.org/os-filter-obj/2.0.0: registry.npmjs.org/os-filter-obj/2.0.0:
resolution: {integrity: sha512-uksVLsqG3pVdzzPvmAHpBK0wKxYItuzZr7SziusRPoz67tGV8rL1szZ6IdeUrbqLjGDwApBtN29eEE3IqGHOjg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/os-filter-obj/-/os-filter-obj-2.0.0.tgz} resolution: {integrity: sha512-uksVLsqG3pVdzzPvmAHpBK0wKxYItuzZr7SziusRPoz67tGV8rL1szZ6IdeUrbqLjGDwApBtN29eEE3IqGHOjg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/os-filter-obj/-/os-filter-obj-2.0.0.tgz}
name: os-filter-obj name: os-filter-obj
...@@ -12161,6 +12267,25 @@ packages: ...@@ -12161,6 +12267,25 @@ packages:
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: true dev: true
registry.npmjs.org/pont-engine/1.2.0:
resolution: {integrity: sha512-QMtzdxhpoARbq/SpXmrUf5RMS6RLzdM8rLA7SGukAqBjrEhAMRNOdbOmNDVayM/RwPkK5FUDxIVBxh2pOLpQ3A==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/pont-engine/-/pont-engine-1.2.0.tgz}
name: pont-engine
version: 1.2.0
hasBin: true
dependencies:
chalk: registry.npmjs.org/chalk/2.4.2
commander: registry.npmjs.org/commander/2.20.3
fs-extra: registry.npmjs.org/fs-extra/5.0.0
inquirer: registry.npmjs.org/inquirer/7.3.3
lodash: registry.npmjs.org/lodash/4.17.21
node-fetch: registry.npmjs.org/node-fetch/2.6.7
prettier: registry.npmjs.org/prettier/2.6.0
translation.js: registry.npmjs.org/translation.js/0.7.15
typescript: registry.npmjs.org/typescript/3.9.10
transitivePeerDependencies:
- encoding
dev: true
registry.npmjs.org/prepend-http/2.0.0: registry.npmjs.org/prepend-http/2.0.0:
resolution: {integrity: sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz} resolution: {integrity: sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz}
name: prepend-http name: prepend-http
...@@ -12168,6 +12293,14 @@ packages: ...@@ -12168,6 +12293,14 @@ packages:
engines: {node: '>=4'} engines: {node: '>=4'}
dev: true dev: true
registry.npmjs.org/prettier/2.6.0:
resolution: {integrity: sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz}
name: prettier
version: 2.6.0
engines: {node: '>=10.13.0'}
hasBin: true
dev: true
registry.npmjs.org/process-nextick-args/2.0.1: registry.npmjs.org/process-nextick-args/2.0.1:
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz} resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz}
name: process-nextick-args name: process-nextick-args
...@@ -12288,6 +12421,16 @@ packages: ...@@ -12288,6 +12421,16 @@ packages:
signal-exit: registry.npmjs.org/signal-exit/3.0.7 signal-exit: registry.npmjs.org/signal-exit/3.0.7
dev: true dev: true
registry.npmjs.org/restore-cursor/3.1.0:
resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz}
name: restore-cursor
version: 3.1.0
engines: {node: '>=8'}
dependencies:
onetime: registry.npmjs.org/onetime/5.1.2
signal-exit: registry.npmjs.org/signal-exit/3.0.7
dev: true
registry.npmjs.org/reusify/1.0.4: registry.npmjs.org/reusify/1.0.4:
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz} resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz}
name: reusify name: reusify
...@@ -12488,7 +12631,7 @@ packages: ...@@ -12488,7 +12631,7 @@ packages:
version: 4.2.3 version: 4.2.3
engines: {node: '>=8'} engines: {node: '>=8'}
dependencies: dependencies:
emoji-regex: 8.0.0 emoji-regex: registry.npmjs.org/emoji-regex/8.0.0
is-fullwidth-code-point: registry.npmjs.org/is-fullwidth-code-point/3.0.0 is-fullwidth-code-point: registry.npmjs.org/is-fullwidth-code-point/3.0.0
strip-ansi: registry.npmjs.org/strip-ansi/6.0.1 strip-ansi: registry.npmjs.org/strip-ansi/6.0.1
...@@ -12685,6 +12828,30 @@ packages: ...@@ -12685,6 +12828,30 @@ packages:
is-number: registry.npmjs.org/is-number/7.0.0 is-number: registry.npmjs.org/is-number/7.0.0
dev: true dev: true
registry.npmjs.org/tr46/0.0.3:
resolution: {integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz}
name: tr46
version: 0.0.3
registry.npmjs.org/tr46/1.0.1:
resolution: {integrity: sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz}
name: tr46
version: 1.0.1
dependencies:
punycode: 2.1.1
dev: true
registry.npmjs.org/translation.js/0.7.15:
resolution: {integrity: sha512-TFgTbvbUY73JXIir3A/MUBDkdlstYOIF3PzpzsC8T5FZVCWrRHtdLeICN0G//GblX3vKCg3cSdCnTovq1/utxw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/translation.js/-/translation.js-0.7.15.tgz}
name: translation.js
version: 0.7.15
dependencies:
'@types/blueimp-md5': registry.npmjs.org/@types/blueimp-md5/2.18.0
'@types/node': registry.npmjs.org/@types/node/12.20.47
blueimp-md5: registry.npmjs.org/blueimp-md5/2.19.0
tslib: registry.npmjs.org/tslib/1.14.1
dev: true
registry.npmjs.org/trim-repeated/1.0.0: registry.npmjs.org/trim-repeated/1.0.0:
resolution: {integrity: sha1-42RqLqTokTEr9+rObPsFOAvAHCE=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz} resolution: {integrity: sha1-42RqLqTokTEr9+rObPsFOAvAHCE=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz}
name: trim-repeated name: trim-repeated
...@@ -12749,6 +12916,21 @@ packages: ...@@ -12749,6 +12916,21 @@ packages:
safe-buffer: registry.npmjs.org/safe-buffer/5.2.1 safe-buffer: registry.npmjs.org/safe-buffer/5.2.1
dev: true dev: true
registry.npmjs.org/type-fest/0.21.3:
resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz}
name: type-fest
version: 0.21.3
engines: {node: '>=10'}
dev: true
registry.npmjs.org/typescript/3.9.10:
resolution: {integrity: sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz}
name: typescript
version: 3.9.10
engines: {node: '>=4.2.0'}
hasBin: true
dev: true
registry.npmjs.org/typescript/4.6.2: registry.npmjs.org/typescript/4.6.2:
resolution: {integrity: sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz} resolution: {integrity: sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz}
name: typescript name: typescript
...@@ -12860,6 +13042,26 @@ packages: ...@@ -12860,6 +13042,26 @@ packages:
- supports-color - supports-color
dev: true dev: true
registry.npmjs.org/webidl-conversions/3.0.1:
resolution: {integrity: sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz}
name: webidl-conversions
version: 3.0.1
registry.npmjs.org/webidl-conversions/4.0.2:
resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz}
name: webidl-conversions
version: 4.0.2
dev: true
registry.npmjs.org/whatwg-url/5.0.0:
resolution: {integrity: sha1-lmRU6HZUYuN2RNNib2dCzotwll0=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz}
name: whatwg-url
version: 5.0.0
dependencies:
tr46: registry.npmjs.org/tr46/0.0.3
webidl-conversions: registry.npmjs.org/webidl-conversions/3.0.1
dev: true
registry.npmjs.org/which/1.3.1: registry.npmjs.org/which/1.3.1:
resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/which/-/which-1.3.1.tgz} resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/which/-/which-1.3.1.tgz}
name: which name: which
......
{
"originUrl": "http://localhost:8181/basic-api/v2/api-docs",
"templatePath": "./pont.template",
"outDir": "./src/api/services",
"surrounding": "typeScript",
"mocks": {
"enable": true,
"basePath": "",
"port": 3101,
"wrapper": "{\"status\": 200, \"body\": {response}, \"message\": \"OK\"}"
},
"templateType": "fetch",
"prettierConfig": {
"printWidth": 120,
"semi": false,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "all",
"proseWrap": "never",
"endOfLine": "lf"
}
}
import { Interface, BaseClass, Property, CodeGenerator } from 'pont-engine'
export default class MyGenerator extends CodeGenerator {
getParams(inter: Interface) {
const requestParams = inter.getRequestParams(this.surrounding)
return `${requestParams.replace(
'options?: any',
`config?: axios.RequestConfig<Params${requestParams.includes('form') ? ' | FormData' : ''}>`,
)}, options?: axios.RequestOptions`
}
getInterfaceContentInDeclaration(inter: Interface) {
const requestParams = this.getParams(inter)
const paramsCode = inter.getParamsCode('Params')
return `
export ${paramsCode}
export type Response = ${inter.responseType.replace(/defs.Result\<(.*)\>/, '$1')};
export const init: Response;
export function request(${requestParams}): Promise<Response>;
`
}
getBaseClassInDeclaration(base: BaseClass) {
const originProps = base.properties
base.properties = base.properties.map((prop) => {
return new Property({
...prop,
required: false,
})
})
const result = super.getBaseClassInDeclaration(base)
base.properties = originProps
return result
}
getInterfaceContent(inter: Interface) {
const method = inter.method.toUpperCase()
const requestParams = this.getParams(inter)
const paramsCode = inter.getParamsCode('Params', this.surrounding)
return `
/**
* @desc ${inter.description}
*/
import * as defs from '../../baseClass';
import { defHttp } from '/@/utils/http/axios'
export ${paramsCode}
export const init = ${inter.response.getInitialValue()};
export function request(${requestParams}) {
return defHttp.request({
url: "${inter.path}",
method: '${method}',
${
method === 'GET'
? 'params'
: `data: ${requestParams.includes('form') ? 'form || params' : 'params'}`
},
...config,
}, options);
}
`
}
}
module.exports = { module.exports = {
printWidth: 100, printWidth: 120,
semi: false, semi: false,
tabWidth: 4, tabWidth: 4,
vueIndentScriptAndStyle: true, vueIndentScriptAndStyle: true,
...@@ -7,5 +7,5 @@ module.exports = { ...@@ -7,5 +7,5 @@ module.exports = {
trailingComma: 'all', trailingComma: 'all',
proseWrap: 'never', proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict', htmlWhitespaceSensitivity: 'strict',
endOfLine: 'auto', endOfLine: 'lf',
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
type ObjectMap<Key extends string | number | symbol = any, Value = any> = {
[key in Key]: Value
}
declare namespace defs {
export class LoginVo {
/** token */
token?: string
}
export class PageVo<T0 = any> {
/** 数据 */
data?: Array<T0>
/** 数据最新时间 */
latest?: string
/** 数据总数 */
total?: number
}
export class PermissionVo {
/** 子权限 */
children?: Array<defs.PermissionVo>
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 主键 */
id?: number
/** 名称 */
name?: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 序号 */
serial?: number
/** 权限类型 */
type?: 'MENU' | 'BUTTON'
/** 标识 */
uid?: string
}
export class Result<T0 = any> {
/** 内容 */
body?: T0
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class RoleVo {
/** 主键 */
id?: number
/** 名称 */
name?: string
/** 权限 */
permissions?: Array<defs.PermissionVo>
/** 标识 */
uid?: string
}
export class UserInfo {
/** 头像 */
avatar?: string
/** 邮箱 */
email?: string
/** 主页地址 */
homePath?: string
/** 手机号 */
mobile?: string
/** 权限 */
permissions?: Array<defs.PermissionVo>
/** 真实姓名 */
realName?: string
/** 角色 */
roles?: Array<defs.RoleVo>
/** 职称 */
title?: string
/** 主键 */
userId?: number
/** 用户名 */
username?: string
}
export class UserVo {
/** 头像 */
avatar?: string
/** 最后登录时间 */
createTime?: string
/** 是否删除 */
deleted?: boolean
/** 邮箱 */
email?: string
/** 是否启用 */
enabled?: boolean
/** 主键 */
id?: number
/** 最后登录IP地址 */
lastLoginIp?: string
/** 最后登录时间 */
lastLoginTime?: string
/** 手机号 */
mobile?: string
/** 真实姓名 */
realName?: string
/** 职称 */
title?: string
/** 用户名 */
username?: string
}
}
declare namespace API {
/**
*
*/
export namespace auth {
/**
* 登录
* /basic-api/auth/login
*/
export namespace login {
export class Params {
/** 账号(支持用户名/手机号/邮箱) */
account: string
/** 密码 */
password: string
}
export type Response = defs.LoginVo
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 登出
* /basic-api/auth/logout
*/
export namespace logout {
export class Params {}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 注册
* /basic-api/auth/register
*/
export namespace register {
export class Params {
/** 头像 */
avatar?: string
/** 邮箱 */
email?: string
/** 是否启用 */
enable?: boolean
/** 手机号 */
mobile: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 职称 */
title?: string
/** 用户名 */
username: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace hello {
/**
* hello
* /basic-api/hello/
*/
export namespace hello {
export class Params {}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* fail
* /basic-api/hello/fail
*/
export namespace fail {
export class Params {}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* page
* /basic-api/hello/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<string>
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace minio {
/**
* 文件上传
* /basic-api/common/minio/upload
*/
export namespace upload {
export class Params {}
export type Response = string
export const init: Response
export function request(
params: Params,
form: FormData,
config?: axios.RequestConfig<Params | FormData>,
options?: axios.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace permission {
/**
* 新增
* /basic-api/manage/permission/add
*/
export namespace add {
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 序号 */
serial?: number
/** 权限类型 */
type: 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /basic-api/manage/permission/deleted
*/
export namespace deleted {
export class Params {
/** id */
id: number
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 查询
* /basic-api/manage/permission/find
*/
export namespace find {
export class Params {
/** id */
id: number
}
export type Response = defs.PermissionVo
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 修改
* /basic-api/manage/permission/modify
*/
export namespace modify {
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** id */
id: number
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 序号 */
serial?: number
/** 权限类型 */
type: 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 分页查询
* /basic-api/manage/permission/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<defs.PermissionVo>
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 树结构查询
* /basic-api/manage/permission/tree
*/
export namespace tree {
export class Params {
/** 父级 id */
pid?: number
}
export type Response = Array<defs.PermissionVo>
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace role {
/**
* 新增
* /basic-api/manage/role/add
*/
export namespace add {
export class Params {
/** 名称 */
name: string
/** 标识 */
uid: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 分配权限
* /basic-api/manage/role/assign
*/
export namespace assign {
export class Params {
/** id */
id: number
/** ids 多个以逗号分割 */
ids: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /basic-api/manage/role/deleted
*/
export namespace deleted {
export class Params {
/** id */
id: number
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 查询
* /basic-api/manage/role/find
*/
export namespace find {
export class Params {
/** id */
id: number
}
export type Response = defs.RoleVo
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 修改
* /basic-api/manage/role/modify
*/
export namespace modify {
export class Params {
/** id */
id: number
/** 名称 */
name: string
/** 标识 */
uid: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 分页查询
* /basic-api/manage/role/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<defs.RoleVo>
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 选项查询
* /basic-api/manage/role/selector
*/
export namespace selector {
export class Params {}
export type Response = Array<defs.RoleVo>
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace user {
/**
* 获取登录用户信息
* /basic-api/user/info
*/
export namespace info {
export class Params {}
export type Response = defs.UserInfo
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 分配角色
* /basic-api/user/manage/assign
*/
export namespace assign {
export class Params {
/** id */
id: number
/** ids 多个以逗号分割 */
ids: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
/**
* 分页查询
* /basic-api/user/manage/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<defs.UserVo>
export const init: Response
export function request(
params: Params,
config?: axios.RequestConfig<Params>,
options?: axios.RequestOptions,
): Promise<Response>
}
}
}
export class LoginVo {
/** token */
token = ''
}
export class PageVo {
/** 数据 */
data = []
/** 数据最新时间 */
latest = ''
/** 数据总数 */
total = undefined
}
export class PermissionVo {
/** 子权限 */
children = []
/** 组件 */
component = ''
/** 是否启用 */
enable = false
/** 是否隐藏 */
hidden = false
/** 图标 */
icon = ''
/** 主键 */
id = undefined
/** 名称 */
name = ''
/** 路径 */
path = ''
/** 父级ID */
pid = undefined
/** 序号 */
serial = undefined
/** 权限类型 */
type = 'MENU'
/** 标识 */
uid = ''
}
export class Result {
/** 内容 */
body = new LoginVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class RoleVo {
/** 主键 */
id = undefined
/** 名称 */
name = ''
/** 权限 */
permissions = []
/** 标识 */
uid = ''
}
export class UserInfo {
/** 头像 */
avatar = ''
/** 邮箱 */
email = ''
/** 主页地址 */
homePath = ''
/** 手机号 */
mobile = ''
/** 权限 */
permissions = []
/** 真实姓名 */
realName = ''
/** 角色 */
roles = []
/** 职称 */
title = ''
/** 主键 */
userId = undefined
/** 用户名 */
username = ''
}
export class UserVo {
/** 头像 */
avatar = ''
/** 最后登录时间 */
createTime = ''
/** 是否删除 */
deleted = false
/** 邮箱 */
email = ''
/** 是否启用 */
enabled = false
/** 主键 */
id = undefined
/** 最后登录IP地址 */
lastLoginIp = ''
/** 最后登录时间 */
lastLoginTime = ''
/** 手机号 */
mobile = ''
/** 真实姓名 */
realName = ''
/** 职称 */
title = ''
/** 用户名 */
username = ''
}
import * as defs from './baseClass'
import './mods/'
;(window as any).defs = defs
/**
* @description
*/
import * as login from './login'
import * as logout from './logout'
import * as register from './register'
export { login, logout, register }
/**
* @desc 登录
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 账号(支持用户名/手机号/邮箱) */
account: string
/** 密码 */
password: string
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/auth/login',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 登出
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/auth/logout',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 注册
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 头像 */
avatar?: string
/** 邮箱 */
email?: string
/** 是否启用 */
enable?: boolean
/** 手机号 */
mobile: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 职称 */
title?: string
/** 用户名 */
username: string
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/auth/register',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc fail
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/hello/fail',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc hello
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/hello/',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description
*/
import * as hello from './hello'
import * as fail from './fail'
import * as page from './page'
export { hello, fail, page }
/**
* @desc page
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/hello/page',
method: 'GET',
params,
...config,
},
options,
)
}
import * as auth from './auth'
import * as hello from './hello'
import * as minio from './minio'
import * as permission from './permission'
import * as role from './role'
import * as user from './user'
;(window as any).API = {
auth,
hello,
minio,
permission,
role,
user,
}
/**
* @description
*/
import * as upload from './upload'
export { upload }
/**
* @desc 文件上传
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(
params: Params,
form: FormData,
config?: axios.RequestConfig<Params | FormData>,
options?: axios.RequestOptions,
) {
return defHttp.request(
{
url: '/basic-api/common/minio/upload',
method: 'POST',
data: form || params,
...config,
},
options,
)
}
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 序号 */
serial?: number
/** 权限类型 */
type: 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/permission/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/permission/deleted',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/permission/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description
*/
import * as add from './add'
import * as deleted from './deleted'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as tree from './tree'
export { add, deleted, find, modify, page, tree }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** id */
id: number
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 序号 */
serial?: number
/** 权限类型 */
type: 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/permission/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/permission/page',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 树结构查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 父级 id */
pid?: number
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/permission/tree',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 名称 */
name: string
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/role/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分配权限
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/role/assign',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/role/deleted',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/role/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description
*/
import * as add from './add'
import * as assign from './assign'
import * as deleted from './deleted'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as selector from './selector'
export { add, assign, deleted, find, modify, page, selector }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
/** 名称 */
name: string
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/role/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/role/page',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 选项查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/manage/role/selector',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 分配角色
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/user/manage/assign',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @description
*/
import * as info from './info'
import * as assign from './assign'
import * as page from './page'
export { info, assign, page }
/**
* @desc 获取登录用户信息
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/user/info',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export const init = new defs.Result()
export function request(params: Params, config?: axios.RequestConfig<Params>, options?: axios.RequestOptions) {
return defHttp.request(
{
url: '/basic-api/user/manage/page',
method: 'GET',
params,
...config,
},
options,
)
}
...@@ -8,10 +8,7 @@ const { uploadUrl = '' } = useGlobSetting() ...@@ -8,10 +8,7 @@ const { uploadUrl = '' } = useGlobSetting()
/** /**
* @description: Upload interface * @description: Upload interface
*/ */
export function uploadApi( export function uploadApi(params: UploadFileParams, onUploadProgress: (progressEvent: ProgressEvent) => void) {
params: UploadFileParams,
onUploadProgress: (progressEvent: ProgressEvent) => void,
) {
return defHttp.uploadFile<UploadApiResult>( return defHttp.uploadFile<UploadApiResult>(
{ {
url: uploadUrl, url: uploadUrl,
......
...@@ -45,12 +45,7 @@ ...@@ -45,12 +45,7 @@
if (!unref(isSetState)) { if (!unref(isSetState)) {
isSetState.value = true isSetState.value = true
const { const {
menuSetting: { menuSetting: { type: menuType, mode: menuMode, collapsed: menuCollapsed, split: menuSplit },
type: menuType,
mode: menuMode,
collapsed: menuCollapsed,
split: menuSplit,
},
} = appStore.getProjectConfig } = appStore.getProjectConfig
appStore.setProjectConfig({ appStore.setProjectConfig({
menuSetting: { menuSetting: {
...@@ -64,8 +59,7 @@ ...@@ -64,8 +59,7 @@
} else { } else {
if (unref(isSetState)) { if (unref(isSetState)) {
isSetState.value = false isSetState.value = false
const { menuMode, menuCollapsed, menuType, menuSplit } = const { menuMode, menuCollapsed, menuType, menuSplit } = appStore.getBeforeMiniInfo
appStore.getBeforeMiniInfo
appStore.setProjectConfig({ appStore.setProjectConfig({
menuSetting: { menuSetting: {
type: menuType, type: menuType,
......
...@@ -24,10 +24,7 @@ ...@@ -24,10 +24,7 @@
default: () => <SearchOutlined />, default: () => <SearchOutlined />,
}} }}
</Tooltip> </Tooltip>
<AppSearchModal <AppSearchModal onClose={changeModal.bind(null, false)} visible={unref(showModal)} />
onClose={changeModal.bind(null, false)}
visible={unref(showModal)}
/>
</div> </div>
) )
} }
......
...@@ -41,8 +41,7 @@ ...@@ -41,8 +41,7 @@
margin-right: 0.4em; margin-right: 0.4em;
background-color: linear-gradient(-225deg, #d5dbe4, #f8f8f8); background-color: linear-gradient(-225deg, #d5dbe4, #f8f8f8);
border-radius: 2px; border-radius: 2px;
box-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff, box-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff, 0 1px 2px 1px rgb(30 35 90 / 40%);
0 1px 2px 1px rgb(30 35 90 / 40%);
align-items: center; align-items: center;
justify-content: center; justify-content: center;
......
...@@ -84,8 +84,11 @@ ...@@ -84,8 +84,11 @@
const [refs, setRefs] = useRefs() const [refs, setRefs] = useRefs()
const { getIsMobile } = useAppInject() const { getIsMobile } = useAppInject()
const { handleSearch, searchResult, keyword, activeIndex, handleEnter, handleMouseenter } = const { handleSearch, searchResult, keyword, activeIndex, handleEnter, handleMouseenter } = useMenuSearch(
useMenuSearch(refs, scrollWrap, emit) refs,
scrollWrap,
emit,
)
const getIsNotData = computed(() => !keyword || unref(searchResult).length === 0) const getIsNotData = computed(() => !keyword || unref(searchResult).length === 0)
......
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
* @default '' * @default ''
*/ */
value: { value: {
type: [Number, Array, String] as PropType< type: [Number, Array, String] as PropType<RoleEnum | RoleEnum[] | string | string[]>,
RoleEnum | RoleEnum[] | string | string[]
>,
default: '', default: '',
}, },
}, },
......
...@@ -46,9 +46,7 @@ ...@@ -46,9 +46,7 @@
setup(props, { slots }) { setup(props, { slots }) {
const { prefixCls } = useDesign('basic-help') const { prefixCls } = useDesign('basic-help')
const getTooltipStyle = computed( const getTooltipStyle = computed((): CSSProperties => ({ color: props.color, fontSize: props.fontSize }))
(): CSSProperties => ({ color: props.color, fontSize: props.fontSize }),
)
const getOverlayStyle = computed((): CSSProperties => ({ maxWidth: props.maxWidth })) const getOverlayStyle = computed((): CSSProperties => ({ maxWidth: props.maxWidth }))
......
...@@ -15,11 +15,7 @@ ...@@ -15,11 +15,7 @@
<Tooltip> <Tooltip>
<template #title> <template #title>
<div class="w-50">每行显示数量</div <div class="w-50">每行显示数量</div
><Slider ><Slider id="slider" v-bind="sliderProp" v-model:value="grid" @change="sliderChange"
id="slider"
v-bind="sliderProp"
v-model:value="grid"
@change="sliderChange"
/></template> /></template>
<Button><TableOutlined /></Button> <Button><TableOutlined /></Button>
</Tooltip> </Tooltip>
...@@ -61,10 +57,7 @@ ...@@ -61,10 +57,7 @@
<CardMeta> <CardMeta>
<template #title> <template #title>
<TypographyText <TypographyText :content="item.name" :ellipsis="{ tooltip: item.address }" />
:content="item.name"
:ellipsis="{ tooltip: item.address }"
/>
</template> </template>
<template #avatar> <template #avatar>
<Avatar :src="item.avatar" /> <Avatar :src="item.avatar" />
...@@ -80,12 +73,7 @@ ...@@ -80,12 +73,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onMounted, ref } from 'vue' import { computed, onMounted, ref } from 'vue'
import { import { EditOutlined, EllipsisOutlined, RedoOutlined, TableOutlined } from '@ant-design/icons-vue'
EditOutlined,
EllipsisOutlined,
RedoOutlined,
TableOutlined,
} from '@ant-design/icons-vue'
import { List, Card, Image, Typography, Tooltip, Slider, Avatar } from 'ant-design-vue' import { List, Card, Image, Typography, Tooltip, Slider, Avatar } from 'ant-design-vue'
import { Dropdown } from '/@/components/Dropdown' import { Dropdown } from '/@/components/Dropdown'
import { BasicForm, useForm } from '/@/components/Form' import { BasicForm, useForm } from '/@/components/Form'
......
<template> <template>
<div class="h-full"> <div class="h-full">
<CodeMirrorEditor <CodeMirrorEditor :value="getValue" @change="handleValueChange" :mode="mode" :readonly="readonly" />
:value="getValue"
@change="handleValueChange"
:mode="mode"
:readonly="readonly"
/>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
......
...@@ -66,10 +66,7 @@ ...@@ -66,10 +66,7 @@
) )
function setTheme() { function setTheme() {
unref(editor)?.setOption( unref(editor)?.setOption('theme', appStore.getDarkMode === 'light' ? 'idea' : 'material-palenight')
'theme',
appStore.getDarkMode === 'light' ? 'idea' : 'material-palenight',
)
} }
function refresh() { function refresh() {
......
<template> <template>
<transition-group <transition-group class="h-full w-full" v-bind="$attrs" ref="elRef" :name="transitionName" :tag="tag" mode="out-in">
class="h-full w-full"
v-bind="$attrs"
ref="elRef"
:name="transitionName"
:tag="tag"
mode="out-in"
>
<div key="component" v-if="isInit"> <div key="component" v-if="isInit">
<slot :loading="loading"></slot> <slot :loading="loading"></slot>
</div> </div>
...@@ -39,9 +32,7 @@ ...@@ -39,9 +32,7 @@
* If the component is scrolling in the page container, the viewport is the container * If the component is scrolling in the page container, the viewport is the container
*/ */
viewport: { viewport: {
type: (typeof window !== 'undefined' type: (typeof window !== 'undefined' ? window.HTMLElement : Object) as PropType<HTMLElement>,
? window.HTMLElement
: Object) as PropType<HTMLElement>,
default: () => null, default: () => null,
}, },
/** /**
...@@ -124,8 +115,7 @@ ...@@ -124,8 +115,7 @@
rootMargin, rootMargin,
target: toRef(elRef.value, '$el'), target: toRef(elRef.value, '$el'),
onIntersect: (entries: any[]) => { onIntersect: (entries: any[]) => {
const isIntersecting = const isIntersecting = entries[0].isIntersecting || entries[0].intersectionRatio
entries[0].isIntersecting || entries[0].intersectionRatio
if (isIntersecting) { if (isIntersecting) {
init() init()
if (observer) { if (observer) {
......
...@@ -31,11 +31,7 @@ ...@@ -31,11 +31,7 @@
const ItemContent: FunctionalComponent<ItemContentProps> = (props) => { const ItemContent: FunctionalComponent<ItemContentProps> = (props) => {
const { item } = props const { item } = props
return ( return (
<span <span style="display: inline-block; width: 100%; " class="px-4" onClick={props.handler.bind(null, item)}>
style="display: inline-block; width: 100%; "
class="px-4"
onClick={props.handler.bind(null, item)}
>
{props.showIcon && item.icon && <Icon class="mr-2" icon={item.icon} />} {props.showIcon && item.icon && <Icon class="mr-2" icon={item.icon} />}
<span>{item.label}</span> <span>{item.label}</span>
</span> </span>
...@@ -101,11 +97,7 @@ ...@@ -101,11 +97,7 @@
if (!children || children.length === 0) { if (!children || children.length === 0) {
return ( return (
<> <>
<Menu.Item <Menu.Item disabled={disabled} class={`${prefixCls}__item`} key={label}>
disabled={disabled}
class={`${prefixCls}__item`}
key={label}
>
<ItemContent {...contentProps} /> <ItemContent {...contentProps} />
</Menu.Item> </Menu.Item>
{divider ? <Divider key={`d-${label}`} /> : null} {divider ? <Divider key={`d-${label}`} /> : null}
...@@ -115,11 +107,7 @@ ...@@ -115,11 +107,7 @@
if (!unref(showRef)) return null if (!unref(showRef)) return null
return ( return (
<Menu.SubMenu <Menu.SubMenu key={label} disabled={disabled} popupClassName={`${prefixCls}__popup`}>
key={label}
disabled={disabled}
popupClassName={`${prefixCls}__popup`}
>
{{ {{
title: () => <ItemContent {...contentProps} />, title: () => <ItemContent {...contentProps} />,
default: () => renderMenuItem(children), default: () => renderMenuItem(children),
...@@ -135,12 +123,7 @@ ...@@ -135,12 +123,7 @@
const { items } = props const { items } = props
return ( return (
<div class={prefixCls}> <div class={prefixCls}>
<Menu <Menu inlineIndent={12} mode="vertical" ref={wrapRef} style={unref(getStyle)}>
inlineIndent={12}
mode="vertical"
ref={wrapRef}
style={unref(getStyle)}
>
{renderMenuItem(items)} {renderMenuItem(items)}
</Menu> </Menu>
</div> </div>
...@@ -191,8 +174,7 @@ ...@@ -191,8 +174,7 @@
background-color: @component-background; background-color: @component-background;
border: 1px solid rgb(0 0 0 / 8%); border: 1px solid rgb(0 0 0 / 8%);
border-radius: 0.25rem; border-radius: 0.25rem;
box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 10%), box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 10%), 0 1px 5px 0 rgb(0 0 0 / 6%);
0 1px 5px 0 rgb(0 0 0 / 6%);
background-clip: padding-box; background-clip: padding-box;
user-select: none; user-select: none;
......
<template> <template>
<a-input v-bind="$attrs" :class="prefixCls" :size="size" :value="state"> <a-input v-bind="$attrs" :class="prefixCls" :size="size" :value="state">
<template #addonAfter> <template #addonAfter>
<CountButton <CountButton :size="size" :count="count" :value="state" :beforeStartFunc="sendCodeApi" />
:size="size"
:count="count"
:value="state"
:beforeStartFunc="sendCodeApi"
/>
</template> </template>
<template <template #[item]="data" v-for="item in Object.keys($slots).filter((k) => k !== 'addonAfter')">
#[item]="data"
v-for="item in Object.keys($slots).filter((k) => k !== 'addonAfter')"
>
<slot :name="item" v-bind="data || {}"></slot> <slot :name="item" v-bind="data || {}"></slot>
</template> </template>
</a-input> </a-input>
......
...@@ -24,11 +24,7 @@ ...@@ -24,11 +24,7 @@
<div :class="`${prefixCls}-toolbar`"> <div :class="`${prefixCls}-toolbar`">
<Upload :fileList="[]" accept="image/*" :beforeUpload="handleBeforeUpload"> <Upload :fileList="[]" accept="image/*" :beforeUpload="handleBeforeUpload">
<Tooltip :title="t('component.cropper.selectImage')" placement="bottom"> <Tooltip :title="t('component.cropper.selectImage')" placement="bottom">
<a-button <a-button size="small" preIcon="ant-design:upload-outlined" type="primary" />
size="small"
preIcon="ant-design:upload-outlined"
type="primary"
/>
</Tooltip> </Tooltip>
</Upload> </Upload>
<Space> <Space>
...@@ -50,10 +46,7 @@ ...@@ -50,10 +46,7 @@
@click="handlerToolbar('rotate', -45)" @click="handlerToolbar('rotate', -45)"
/> />
</Tooltip> </Tooltip>
<Tooltip <Tooltip :title="t('component.cropper.btn_rotate_right')" placement="bottom">
:title="t('component.cropper.btn_rotate_right')"
placement="bottom"
>
<a-button <a-button
type="primary" type="primary"
preIcon="ant-design:rotate-right-outlined" preIcon="ant-design:rotate-right-outlined"
...@@ -103,11 +96,7 @@ ...@@ -103,11 +96,7 @@
</div> </div>
<div :class="`${prefixCls}-right`"> <div :class="`${prefixCls}-right`">
<div :class="`${prefixCls}-preview`"> <div :class="`${prefixCls}-preview`">
<img <img :src="previewSource" v-if="previewSource" :alt="t('component.cropper.preview')" />
:src="previewSource"
v-if="previewSource"
:alt="t('component.cropper.preview')"
/>
</div> </div>
<template v-if="previewSource"> <template v-if="previewSource">
<div :class="`${prefixCls}-group`"> <div :class="`${prefixCls}-group`">
...@@ -250,13 +239,7 @@ ...@@ -250,13 +239,7 @@
transparent 75%, transparent 75%,
rgb(0 0 0 / 25%) 0 rgb(0 0 0 / 25%) 0
), ),
linear-gradient( linear-gradient(45deg, rgb(0 0 0 / 25%) 25%, transparent 0, transparent 75%, rgb(0 0 0 / 25%) 0);
45deg,
rgb(0 0 0 / 25%) 25%,
transparent 0,
transparent 75%,
rgb(0 0 0 / 25%) 0
);
background-position: 0 0, 12px 12px; background-position: 0 0, 12px 12px;
background-size: 24px 24px; background-size: 24px 24px;
} }
......
<template> <template>
<div :class="getClass" :style="getWrapperStyle"> <div :class="getClass" :style="getWrapperStyle">
<img <img v-show="isReady" ref="imgElRef" :src="src" :alt="alt" :crossorigin="crossorigin" :style="getImageStyle" />
v-show="isReady"
ref="imgElRef"
:src="src"
:alt="alt"
:crossorigin="crossorigin"
:style="getImageStyle"
/>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -165,14 +158,7 @@ ...@@ -165,14 +158,7 @@
context.drawImage(sourceCanvas, 0, 0, width, height) context.drawImage(sourceCanvas, 0, 0, width, height)
context.globalCompositeOperation = 'destination-in' context.globalCompositeOperation = 'destination-in'
context.beginPath() context.beginPath()
context.arc( context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true)
width / 2,
height / 2,
Math.min(width, height) / 2,
0,
2 * Math.PI,
true,
)
context.fill() context.fill()
return canvas return canvas
} }
......
...@@ -11,12 +11,7 @@ ...@@ -11,12 +11,7 @@
</div> </div>
<img :src="sourceValue" v-if="sourceValue" alt="avatar" /> <img :src="sourceValue" v-if="sourceValue" alt="avatar" />
</div> </div>
<a-button <a-button :class="`${prefixCls}-upload-btn`" @click="openModal" v-if="showBtn" v-bind="btnProps">
:class="`${prefixCls}-upload-btn`"
@click="openModal"
v-if="showBtn"
v-bind="btnProps"
>
{{ btnText ? btnText : t('component.cropper.selectImage') }} {{ btnText ? btnText : t('component.cropper.selectImage') }}
</a-button> </a-button>
...@@ -29,16 +24,7 @@ ...@@ -29,16 +24,7 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { import { defineComponent, computed, CSSProperties, unref, ref, watchEffect, watch, PropType } from 'vue'
defineComponent,
computed,
CSSProperties,
unref,
ref,
watchEffect,
watch,
PropType,
} from 'vue'
import CopperModal from './CopperModal.vue' import CopperModal from './CopperModal.vue'
import { useDesign } from '/@/hooks/web/useDesign' import { useDesign } from '/@/hooks/web/useDesign'
import { useModal } from '/@/components/Modal' import { useModal } from '/@/components/Modal'
...@@ -72,9 +58,7 @@ ...@@ -72,9 +58,7 @@
const getWidth = computed(() => `${props.width}`.replace(/px/, '') + 'px') const getWidth = computed(() => `${props.width}`.replace(/px/, '') + 'px')
const getIconWidth = computed( const getIconWidth = computed(() => parseInt(`${props.width}`.replace(/px/, '')) / 2 + 'px')
() => parseInt(`${props.width}`.replace(/px/, '')) / 2 + 'px',
)
const getStyle = computed((): CSSProperties => ({ width: unref(getWidth) })) const getStyle = computed((): CSSProperties => ({ width: unref(getWidth) }))
......
...@@ -12,10 +12,7 @@ export interface DescItem { ...@@ -12,10 +12,7 @@ export interface DescItem {
span?: number span?: number
show?: (...arg: any) => boolean show?: (...arg: any) => boolean
// render // render
render?: ( render?: (val: any, data: Recordable) => VNode | undefined | JSX.Element | Element | string | number
val: any,
data: Recordable,
) => VNode | undefined | JSX.Element | Element | string | number
} }
export interface DescriptionProps extends DescriptionsProps { export interface DescriptionProps extends DescriptionsProps {
......
...@@ -4,9 +4,7 @@ import { isProdMode } from '/@/utils/env' ...@@ -4,9 +4,7 @@ import { isProdMode } from '/@/utils/env'
export function useDescription(props?: Partial<DescriptionProps>): UseDescReturnType { export function useDescription(props?: Partial<DescriptionProps>): UseDescReturnType {
if (!getCurrentInstance()) { if (!getCurrentInstance()) {
throw new Error( throw new Error('useDescription() can only be used inside setup() or functional components!')
'useDescription() can only be used inside setup() or functional components!',
)
} }
const desc = ref<Nullable<DescInstance>>(null) const desc = ref<Nullable<DescInstance>>(null)
const loaded = ref(false) const loaded = ref(false)
......
...@@ -33,16 +33,7 @@ ...@@ -33,16 +33,7 @@
<script lang="ts"> <script lang="ts">
import type { DrawerInstance, DrawerProps } from './typing' import type { DrawerInstance, DrawerProps } from './typing'
import type { CSSProperties } from 'vue' import type { CSSProperties } from 'vue'
import { import { defineComponent, ref, computed, watch, unref, nextTick, toRaw, getCurrentInstance } from 'vue'
defineComponent,
ref,
computed,
watch,
unref,
nextTick,
toRaw,
getCurrentInstance,
} from 'vue'
import { Drawer } from 'ant-design-vue' import { Drawer } from 'ant-design-vue'
import { useI18n } from '/@/hooks/web/useI18n' import { useI18n } from '/@/hooks/web/useI18n'
import { isFunction, isNumber } from '/@/utils/is' import { isFunction, isNumber } from '/@/utils/is'
...@@ -115,9 +106,7 @@ ...@@ -115,9 +106,7 @@
const getFooterHeight = computed(() => { const getFooterHeight = computed(() => {
const { footerHeight, showFooter } = unref(getProps) const { footerHeight, showFooter } = unref(getProps)
if (showFooter && footerHeight) { if (showFooter && footerHeight) {
return isNumber(footerHeight) return isNumber(footerHeight) ? `${footerHeight}px` : `${footerHeight.replace('px', '')}px`
? `${footerHeight}px`
: `${footerHeight.replace('px', '')}px`
} }
return `0px` return `0px`
}) })
......
...@@ -2,12 +2,7 @@ ...@@ -2,12 +2,7 @@
<div :class="prefixCls" :style="getStyle" v-if="showFooter || $slots.footer"> <div :class="prefixCls" :style="getStyle" v-if="showFooter || $slots.footer">
<template v-if="!$slots.footer"> <template v-if="!$slots.footer">
<slot name="insertFooter"></slot> <slot name="insertFooter"></slot>
<a-button <a-button v-bind="cancelButtonProps" @click="handleClose" class="mr-2" v-if="showCancelBtn">
v-bind="cancelButtonProps"
@click="handleClose"
class="mr-2"
v-if="showCancelBtn"
>
{{ cancelText }} {{ cancelText }}
</a-button> </a-button>
<slot name="centerFooter"></slot> <slot name="centerFooter"></slot>
......
...@@ -5,16 +5,7 @@ import type { ...@@ -5,16 +5,7 @@ import type {
DrawerProps, DrawerProps,
UseDrawerInnerReturnType, UseDrawerInnerReturnType,
} from './typing' } from './typing'
import { import { ref, getCurrentInstance, unref, reactive, watchEffect, nextTick, toRaw, computed } from 'vue'
ref,
getCurrentInstance,
unref,
reactive,
watchEffect,
nextTick,
toRaw,
computed,
} from 'vue'
import { isProdMode } from '/@/utils/env' import { isProdMode } from '/@/utils/env'
import { isFunction } from '/@/utils/is' import { isFunction } from '/@/utils/is'
import { tryOnUnmounted } from '@vueuse/core' import { tryOnUnmounted } from '@vueuse/core'
...@@ -103,9 +94,7 @@ export const useDrawerInner = (callbackFn?: Fn): UseDrawerInnerReturnType => { ...@@ -103,9 +94,7 @@ export const useDrawerInner = (callbackFn?: Fn): UseDrawerInnerReturnType => {
const uidRef = ref<string>('') const uidRef = ref<string>('')
if (!getCurrentInstance()) { if (!getCurrentInstance()) {
throw new Error( throw new Error('useDrawerInner() can only be used inside setup() or functional components!')
'useDrawerInner() can only be used inside setup() or functional components!',
)
} }
const getInstance = () => { const getInstance = () => {
......
...@@ -6,15 +6,8 @@ ...@@ -6,15 +6,8 @@
<template #overlay> <template #overlay>
<a-menu :selectedKeys="selectedKeys"> <a-menu :selectedKeys="selectedKeys">
<template v-for="item in dropMenuList" :key="`${item.event}`"> <template v-for="item in dropMenuList" :key="`${item.event}`">
<a-menu-item <a-menu-item v-bind="getAttr(item.event)" @click="handleClickMenu(item)" :disabled="item.disabled">
v-bind="getAttr(item.event)" <a-popconfirm v-if="popconfirm && item.popConfirm" v-bind="getPopConfirmAttrs(item.popConfirm)">
@click="handleClickMenu(item)"
:disabled="item.disabled"
>
<a-popconfirm
v-if="popconfirm && item.popConfirm"
v-bind="getPopConfirmAttrs(item.popConfirm)"
>
<template #icon v-if="item.popConfirm.icon"> <template #icon v-if="item.popConfirm.icon">
<Icon :icon="item.popConfirm.icon" /> <Icon :icon="item.popConfirm.icon" />
</template> </template>
...@@ -84,10 +77,8 @@ ...@@ -84,10 +77,8 @@
const getPopConfirmAttrs = computed(() => { const getPopConfirmAttrs = computed(() => {
return (attrs) => { return (attrs) => {
const originAttrs = omit(attrs, ['confirm', 'cancel', 'icon']) const originAttrs = omit(attrs, ['confirm', 'cancel', 'icon'])
if (!attrs.onConfirm && attrs.confirm && isFunction(attrs.confirm)) if (!attrs.onConfirm && attrs.confirm && isFunction(attrs.confirm)) originAttrs['onConfirm'] = attrs.confirm
originAttrs['onConfirm'] = attrs.confirm if (!attrs.onCancel && attrs.cancel && isFunction(attrs.cancel)) originAttrs['onCancel'] = attrs.cancel
if (!attrs.onCancel && attrs.cancel && isFunction(attrs.cancel))
originAttrs['onCancel'] = attrs.cancel
return originAttrs return originAttrs
} }
}) })
......
<template> <template>
<BasicModal <BasicModal v-bind="$attrs" :title="t('component.excel.exportModalTitle')" @ok="handleOk" @register="registerModal">
v-bind="$attrs" <BasicForm :labelWidth="100" :schemas="schemas" :showActionButtonGroup="false" @register="registerForm" />
:title="t('component.excel.exportModalTitle')"
@ok="handleOk"
@register="registerModal"
>
<BasicForm
:labelWidth="100"
:schemas="schemas"
:showActionButtonGroup="false"
@register="registerForm"
/>
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts"> <script lang="ts">
......
<template> <template>
<div> <div>
<input <input ref="inputRef" type="file" v-show="false" accept=".xlsx, .xls" @change="handleInputClick" />
ref="inputRef"
type="file"
v-show="false"
accept=".xlsx, .xls"
@change="handleInputClick"
/>
<div @click="handleUpload"> <div @click="handleUpload">
<slot></slot> <slot></slot>
</div> </div>
......
...@@ -3,15 +3,8 @@ ...@@ -3,15 +3,8 @@
<template v-for="item in toolbarItemList" :key="item.type"> <template v-for="item in toolbarItemList" :key="item.type">
<Tooltip placement="bottom" v-bind="item.disabled ? { visible: false } : {}"> <Tooltip placement="bottom" v-bind="item.disabled ? { visible: false } : {}">
<template #title>{{ item.tooltip }}</template> <template #title>{{ item.tooltip }}</template>
<span <span :class="`${prefixCls}-toolbar__icon`" v-if="item.icon" @click="onControl(item)">
:class="`${prefixCls}-toolbar__icon`" <Icon :icon="item.icon" :class="item.disabled ? 'cursor-not-allowed disabeld' : 'cursor-pointer'" />
v-if="item.icon"
@click="onControl(item)"
>
<Icon
:icon="item.icon"
:class="item.disabled ? 'cursor-not-allowed disabeld' : 'cursor-pointer'"
/>
</span> </span>
</Tooltip> </Tooltip>
<Divider v-if="item.separate" type="vertical" /> <Divider v-if="item.separate" type="vertical" />
......
...@@ -41,16 +41,7 @@ ...@@ -41,16 +41,7 @@
import type { AdvanceState } from './types/hooks' import type { AdvanceState } from './types/hooks'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { import { defineComponent, reactive, ref, computed, unref, onMounted, watch, nextTick } from 'vue'
defineComponent,
reactive,
ref,
computed,
unref,
onMounted,
watch,
nextTick,
} from 'vue'
import { Form, Row } from 'ant-design-vue' import { Form, Row } from 'ant-design-vue'
import FormItem from './components/FormItem.vue' import FormItem from './components/FormItem.vue'
import FormAction from './components/FormAction.vue' import FormAction from './components/FormAction.vue'
...@@ -119,9 +110,7 @@ ...@@ -119,9 +110,7 @@
} }
}) })
const getBindValue = computed( const getBindValue = computed(() => ({ ...attrs, ...props, ...unref(getProps) } as Recordable))
() => ({ ...attrs, ...props, ...unref(getProps) } as Recordable),
)
const getSchema = computed((): FormSchema[] => { const getSchema = computed((): FormSchema[] => {
const schemas: FormSchema[] = unref(schemaRef) || (unref(getProps).schemas as any) const schemas: FormSchema[] = unref(schemaRef) || (unref(getProps).schemas as any)
...@@ -141,9 +130,7 @@ ...@@ -141,9 +130,7 @@
} }
} }
if (unref(getProps).showAdvancedButton) { if (unref(getProps).showAdvancedButton) {
return schemas.filter( return schemas.filter((schema) => schema.component !== 'Divider') as FormSchema[]
(schema) => schema.component !== 'Divider',
) as FormSchema[]
} else { } else {
return schemas as FormSchema[] return schemas as FormSchema[]
} }
...@@ -303,9 +290,7 @@ ...@@ -303,9 +290,7 @@
formActionType: formActionType as any, formActionType: formActionType as any,
setFormModel, setFormModel,
getFormClass, getFormClass,
getFormActionBindProps: computed( getFormActionBindProps: computed((): Recordable => ({ ...getProps.value, ...advanceState })),
(): Recordable => ({ ...getProps.value, ...advanceState }),
),
...formActionType, ...formActionType,
} }
}, },
......
...@@ -25,12 +25,7 @@ ...@@ -25,12 +25,7 @@
</Button> </Button>
<slot name="advanceBefore"></slot> <slot name="advanceBefore"></slot>
<Button <Button type="link" size="small" @click="toggleAdvanced" v-if="showAdvancedButton && !hideAdvanceBtn">
type="link"
size="small"
@click="toggleAdvanced"
v-if="showAdvancedButton && !hideAdvanceBtn"
>
{{ isAdvanced ? t('component.form.putAway') : t('component.form.unfold') }} {{ isAdvanced ? t('component.form.putAway') : t('component.form.unfold') }}
<BasicArrow class="ml-1" :expand="!isAdvanced" up /> <BasicArrow class="ml-1" :expand="!isAdvanced" up />
</Button> </Button>
...@@ -88,9 +83,7 @@ ...@@ -88,9 +83,7 @@
const actionColOpt = computed(() => { const actionColOpt = computed(() => {
const { showAdvancedButton, actionSpan: span, actionColOptions } = props const { showAdvancedButton, actionSpan: span, actionColOptions } = props
const actionSpan = 24 - span const actionSpan = 24 - span
const advancedSpanObj = showAdvancedButton const advancedSpanObj = showAdvancedButton ? { span: actionSpan < 6 ? 24 : actionSpan } : {}
? { span: actionSpan < 6 ? 24 : actionSpan }
: {}
const actionColOpt: Partial<ColEx> = { const actionColOpt: Partial<ColEx> = {
style: { textAlign: 'right' }, style: { textAlign: 'right' },
span: showAdvancedButton ? 6 : 4, span: showAdvancedButton ? 6 : 4,
......
...@@ -75,8 +75,7 @@ ...@@ -75,8 +75,7 @@
const { schema, tableAction, formModel, formActionType } = props const { schema, tableAction, formModel, formActionType } = props
let { componentProps = {} } = schema let { componentProps = {} } = schema
if (isFunction(componentProps)) { if (isFunction(componentProps)) {
componentProps = componentProps = componentProps({ schema, tableAction, formModel, formActionType }) ?? {}
componentProps({ schema, tableAction, formModel, formActionType }) ?? {}
} }
if (schema.component === 'Divider') { if (schema.component === 'Divider') {
componentProps = Object.assign({ type: 'horizontal' }, componentProps, { componentProps = Object.assign({ type: 'horizontal' }, componentProps, {
...@@ -219,13 +218,7 @@ ...@@ -219,13 +218,7 @@
} }
function renderComponent() { function renderComponent() {
const { const { renderComponentContent, component, field, changeEvent = 'change', valueField } = props.schema
renderComponentContent,
component,
field,
changeEvent = 'change',
valueField,
} = props.schema
const isCheck = component && ['Switch', 'Checkbox'].includes(component) const isCheck = component && ['Switch', 'Checkbox'].includes(component)
...@@ -257,8 +250,7 @@ ...@@ -257,8 +250,7 @@
// RangePicker place is an array // RangePicker place is an array
if (isCreatePlaceholder && component !== 'RangePicker' && component) { if (isCreatePlaceholder && component !== 'RangePicker' && component) {
propsData.placeholder = propsData.placeholder =
unref(getComponentsProps)?.placeholder || unref(getComponentsProps)?.placeholder || createPlaceholderMessage(component)
createPlaceholderMessage(component)
} }
propsData.codeField = field propsData.codeField = field
propsData.formValues = unref(getValues) propsData.formValues = unref(getValues)
...@@ -293,24 +285,14 @@ ...@@ -293,24 +285,14 @@
) : ( ) : (
label label
) )
const getHelpMessage = isFunction(helpMessage) const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage
? helpMessage(unref(getValues)) if (!getHelpMessage || (Array.isArray(getHelpMessage) && getHelpMessage.length === 0)) {
: helpMessage
if (
!getHelpMessage ||
(Array.isArray(getHelpMessage) && getHelpMessage.length === 0)
) {
return renderLabel return renderLabel
} }
return ( return (
<span> <span>
{renderLabel} {renderLabel}
<BasicHelp <BasicHelp placement="top" class="mx-1" text={getHelpMessage} {...helpComponentProps} />
placement="top"
class="mx-1"
text={getHelpMessage}
{...helpComponentProps}
/>
</span> </span>
) )
} }
...@@ -323,9 +305,7 @@ ...@@ -323,9 +305,7 @@
if (component === 'Divider') { if (component === 'Divider') {
return ( return (
<Col span={24}> <Col span={24}>
<Divider {...unref(getComponentsProps)}> <Divider {...unref(getComponentsProps)}>{renderLabelHelpMessage()}</Divider>
{renderLabelHelpMessage()}
</Divider>
</Col> </Col>
) )
} else { } else {
......
...@@ -35,11 +35,7 @@ function genType() { ...@@ -35,11 +35,7 @@ function genType() {
return [...DATE_TYPE, 'RangePicker'] return [...DATE_TYPE, 'RangePicker']
} }
export function setComponentRuleType( export function setComponentRuleType(rule: ValidationRule, component: ComponentType, valueFormat: string) {
rule: ValidationRule,
component: ComponentType,
valueFormat: string,
) {
if (['DatePicker', 'MonthPicker', 'WeekPicker', 'TimePicker'].includes(component)) { if (['DatePicker', 'MonthPicker', 'WeekPicker', 'TimePicker'].includes(component)) {
rule.type = valueFormat ? 'string' : 'object' rule.type = valueFormat ? 'string' : 'object'
} else if (['RangePicker', 'Upload', 'CheckboxGroup', 'TimePicker'].includes(component)) { } else if (['RangePicker', 'Upload', 'CheckboxGroup', 'TimePicker'].includes(component)) {
......
...@@ -18,14 +18,7 @@ interface UseAdvancedContext { ...@@ -18,14 +18,7 @@ interface UseAdvancedContext {
defaultValueRef: Ref<Recordable> defaultValueRef: Ref<Recordable>
} }
export default function ({ export default function ({ advanceState, emit, getProps, getSchema, formModel, defaultValueRef }: UseAdvancedContext) {
advanceState,
emit,
getProps,
getSchema,
formModel,
defaultValueRef,
}: UseAdvancedContext) {
const { realWidthRef, screenEnum, screenRef } = useBreakpoint() const { realWidthRef, screenEnum, screenRef } = useBreakpoint()
const getEmptySpan = computed((): number => { const getEmptySpan = computed((): number => {
...@@ -137,10 +130,7 @@ export default function ({ ...@@ -137,10 +130,7 @@ export default function ({
} }
if (isShow && (colProps || baseColProps)) { if (isShow && (colProps || baseColProps)) {
const { itemColSum: sum, isAdvanced } = getAdvanced( const { itemColSum: sum, isAdvanced } = getAdvanced({ ...baseColProps, ...colProps }, itemColSum)
{ ...baseColProps, ...colProps },
itemColSum,
)
itemColSum = sum || 0 itemColSum = sum || 0
if (isAdvanced) { if (isAdvanced) {
......
...@@ -9,12 +9,7 @@ interface UseAutoFocusContext { ...@@ -9,12 +9,7 @@ interface UseAutoFocusContext {
isInitedDefault: Ref<boolean> isInitedDefault: Ref<boolean>
formElRef: Ref<FormActionType> formElRef: Ref<FormActionType>
} }
export async function useAutoFocus({ export async function useAutoFocus({ getSchema, getProps, formElRef, isInitedDefault }: UseAutoFocusContext) {
getSchema,
getProps,
formElRef,
isInitedDefault,
}: UseAutoFocusContext) {
watchEffect(async () => { watchEffect(async () => {
if (unref(isInitedDefault) || !unref(getProps).autoFocusFirstItem) { if (unref(isInitedDefault) || !unref(getProps).autoFocusFirstItem) {
return return
......
...@@ -93,11 +93,7 @@ export function useForm(props?: Props): UseFormReturnType { ...@@ -93,11 +93,7 @@ export function useForm(props?: Props): UseFormReturnType {
form.setFieldsValue<T>(values) form.setFieldsValue<T>(values)
}, },
appendSchemaByField: async ( appendSchemaByField: async (schema: FormSchema, prefixField: string | undefined, first: boolean) => {
schema: FormSchema,
prefixField: string | undefined,
first: boolean,
) => {
const form = await getForm() const form = await getForm()
form.appendSchemaByField(schema, prefixField, first) form.appendSchemaByField(schema, prefixField, first)
}, },
......
...@@ -79,11 +79,7 @@ export function useFormEvents({ ...@@ -79,11 +79,7 @@ export function useFormEvents({
if (typeof componentProps === 'function') { if (typeof componentProps === 'function') {
_props = _props({ formModel }) _props = _props({ formModel })
} }
formModel[key] = value formModel[key] = value ? (_props?.valueFormat ? value : dateUtil(value)) : null
? _props?.valueFormat
? value
: dateUtil(value)
: null
} }
} else { } else {
formModel[key] = value formModel[key] = value
...@@ -161,9 +157,7 @@ export function useFormEvents({ ...@@ -161,9 +157,7 @@ export function useFormEvents({
) )
if (!hasField) { if (!hasField) {
error( error('All children of the form Schema array that need to be updated must contain the `field` field')
'All children of the form Schema array that need to be updated must contain the `field` field',
)
return return
} }
schemaRef.value = updateData as FormSchema[] schemaRef.value = updateData as FormSchema[]
...@@ -183,9 +177,7 @@ export function useFormEvents({ ...@@ -183,9 +177,7 @@ export function useFormEvents({
) )
if (!hasField) { if (!hasField) {
error( error('All children of the form Schema array that need to be updated must contain the `field` field')
'All children of the form Schema array that need to be updated must contain the `field` field',
)
return return
} }
const schema: FormSchema[] = [] const schema: FormSchema[] = []
......
...@@ -48,12 +48,7 @@ function tryDeconstructObject(key: string, value: any, target: Recordable) { ...@@ -48,12 +48,7 @@ function tryDeconstructObject(key: string, value: any, target: Recordable) {
} }
} }
export function useFormValues({ export function useFormValues({ defaultValueRef, getSchema, formModel, getProps }: UseFormValuesContext) {
defaultValueRef,
getSchema,
formModel,
getProps,
}: UseFormValuesContext) {
// Processing form values // Processing form values
function handleFormValues(values: Recordable) { function handleFormValues(values: Recordable) {
if (!isObject(values)) { if (!isObject(values)) {
......
...@@ -135,10 +135,7 @@ export interface FormSchema { ...@@ -135,10 +135,7 @@ export interface FormSchema {
// Auxiliary text // Auxiliary text
subLabel?: string subLabel?: string
// Help text on the right side of the text // Help text on the right side of the text
helpMessage?: helpMessage?: string | string[] | ((renderCallbackParams: RenderCallbackParams) => string | string[])
| string
| string[]
| ((renderCallbackParams: RenderCallbackParams) => string | string[])
// BaseHelp component props // BaseHelp component props
helpComponentProps?: Partial<HelpComponentProps> helpComponentProps?: Partial<HelpComponentProps>
// Label width, if it is passed, the labelCol and WrapperCol configured by itemProps will be invalid // Label width, if it is passed, the labelCol and WrapperCol configured by itemProps will be invalid
...@@ -189,11 +186,7 @@ export interface FormSchema { ...@@ -189,11 +186,7 @@ export interface FormSchema {
// Rendering col content requires outer wrapper form-item // Rendering col content requires outer wrapper form-item
renderColContent?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string renderColContent?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string
renderComponentContent?: renderComponentContent?: ((renderCallbackParams: RenderCallbackParams) => any) | VNode | VNode[] | string
| ((renderCallbackParams: RenderCallbackParams) => any)
| VNode
| VNode[]
| string
// Custom slot, in from-item // Custom slot, in from-item
slot?: string slot?: string
......
<template> <template>
<SvgIcon <SvgIcon :size="size" :name="getSvgIcon" v-if="isSvgIcon" :class="[$attrs.class, 'anticon']" :spin="spin" />
:size="size"
:name="getSvgIcon"
v-if="isSvgIcon"
:class="[$attrs.class, 'anticon']"
:spin="spin"
/>
<span <span
v-else v-else
ref="elRef" ref="elRef"
...@@ -15,16 +9,7 @@ ...@@ -15,16 +9,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import type { PropType } from 'vue' import type { PropType } from 'vue'
import { import { defineComponent, ref, watch, onMounted, nextTick, unref, computed, CSSProperties } from 'vue'
defineComponent,
ref,
watch,
onMounted,
nextTick,
unref,
computed,
CSSProperties,
} from 'vue'
import SvgIcon from './SvgIcon.vue' import SvgIcon from './SvgIcon.vue'
import Iconify from '@purge-icons/generated' import Iconify from '@purge-icons/generated'
import { isString } from '/@/utils/is' import { isString } from '/@/utils/is'
...@@ -52,9 +37,7 @@ ...@@ -52,9 +37,7 @@
const isSvgIcon = computed(() => props.icon?.endsWith(SVG_END_WITH_FLAG)) const isSvgIcon = computed(() => props.icon?.endsWith(SVG_END_WITH_FLAG))
const getSvgIcon = computed(() => props.icon.replace(SVG_END_WITH_FLAG, '')) const getSvgIcon = computed(() => props.icon.replace(SVG_END_WITH_FLAG, ''))
const getIconRef = computed( const getIconRef = computed(() => `${props.prefix ? props.prefix + ':' : ''}${props.icon}`)
() => `${props.prefix ? props.prefix + ':' : ''}${props.icon}`,
)
const update = async () => { const update = async () => {
if (unref(isSvgIcon)) return if (unref(isSvgIcon)) return
......
...@@ -41,10 +41,7 @@ ...@@ -41,10 +41,7 @@
</li> </li>
</ul> </ul>
</ScrollContainer> </ScrollContainer>
<div <div class="flex py-2 items-center justify-center" v-if="getTotal >= pageSize">
class="flex py-2 items-center justify-center"
v-if="getTotal >= pageSize"
>
<a-pagination <a-pagination
showLessItems showLessItems
size="small" size="small"
...@@ -59,17 +56,10 @@ ...@@ -59,17 +56,10 @@
</template> </template>
</template> </template>
<span <span class="cursor-pointer px-2 py-1 flex items-center" v-if="isSvgMode && currentSelect">
class="cursor-pointer px-2 py-1 flex items-center"
v-if="isSvgMode && currentSelect"
>
<SvgIcon :name="currentSelect" /> <SvgIcon :name="currentSelect" />
</span> </span>
<Icon <Icon :icon="currentSelect || 'ion:apps-outline'" class="cursor-pointer px-2 py-1" v-else />
:icon="currentSelect || 'ion:apps-outline'"
class="cursor-pointer px-2 py-1"
v-else
/>
</a-popover> </a-popover>
</template> </template>
</a-input> </a-input>
...@@ -137,10 +127,7 @@ ...@@ -137,10 +127,7 @@
const { clipboardRef, isSuccessRef } = useCopyToClipboard(props.value) const { clipboardRef, isSuccessRef } = useCopyToClipboard(props.value)
const { createMessage } = useMessage() const { createMessage } = useMessage()
const { getPaginationList, getTotal, setCurrentPage } = usePagination( const { getPaginationList, getTotal, setCurrentPage } = usePagination(currentList, props.pageSize)
currentList,
props.pageSize,
)
watchEffect(() => { watchEffect(() => {
currentSelect.value = props.value currentSelect.value = props.value
......
<template> <template>
<svg <svg :class="[prefixCls, $attrs.class, spin && 'svg-icon-spin']" :style="getStyle" aria-hidden="true">
:class="[prefixCls, $attrs.class, spin && 'svg-icon-spin']"
:style="getStyle"
aria-hidden="true"
>
<use :xlink:href="symbolId" /> <use :xlink:href="symbolId" />
</svg> </svg>
</template> </template>
......
...@@ -15,9 +15,7 @@ interface Fn { ...@@ -15,9 +15,7 @@ interface Fn {
export function useLoading(props: Partial<LoadingProps>): [Fn, Fn, (string) => void] export function useLoading(props: Partial<LoadingProps>): [Fn, Fn, (string) => void]
export function useLoading(opt: Partial<UseLoadingOptions>): [Fn, Fn, (string) => void] export function useLoading(opt: Partial<UseLoadingOptions>): [Fn, Fn, (string) => void]
export function useLoading( export function useLoading(opt: Partial<LoadingProps> | Partial<UseLoadingOptions>): [Fn, Fn, (string) => void] {
opt: Partial<LoadingProps> | Partial<UseLoadingOptions>,
): [Fn, Fn, (string) => void] {
let props: Partial<LoadingProps> let props: Partial<LoadingProps>
let target: HTMLElement | Ref<ElRef> = document.body let target: HTMLElement | Ref<ElRef> = document.body
......
...@@ -3,16 +3,7 @@ ...@@ -3,16 +3,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { import { defineComponent, ref, unref, nextTick, computed, watch, onBeforeUnmount, onDeactivated } from 'vue'
defineComponent,
ref,
unref,
nextTick,
computed,
watch,
onBeforeUnmount,
onDeactivated,
} from 'vue'
import Vditor from 'vditor' import Vditor from 'vditor'
import 'vditor/dist/index.css' import 'vditor/dist/index.css'
import { useLocale } from '/@/locales/useLocale' import { useLocale } from '/@/locales/useLocale'
......
...@@ -60,12 +60,7 @@ ...@@ -60,12 +60,7 @@
const { currentRoute } = useRouter() const { currentRoute } = useRouter()
const { handleOpenChange, setOpenKeys, getOpenKeys } = useOpenKeys( const { handleOpenChange, setOpenKeys, getOpenKeys } = useOpenKeys(menuState, items, mode as any, accordion)
menuState,
items,
mode as any,
accordion,
)
const getIsTopMenu = computed(() => { const getIsTopMenu = computed(() => {
const { type, mode } = props const { type, mode } = props
...@@ -77,8 +72,7 @@ ...@@ -77,8 +72,7 @@
}) })
const getMenuClass = computed(() => { const getMenuClass = computed(() => {
const align = const align = props.isHorizontal && unref(getSplit) ? 'start' : unref(getTopMenuAlign)
props.isHorizontal && unref(getSplit) ? 'start' : unref(getTopMenuAlign)
return [ return [
prefixCls, prefixCls,
`justify-${align}`, `justify-${align}`,
...@@ -94,9 +88,7 @@ ...@@ -94,9 +88,7 @@
const inlineCollapseOptions: { inlineCollapsed?: boolean } = {} const inlineCollapseOptions: { inlineCollapsed?: boolean } = {}
if (isInline) { if (isInline) {
inlineCollapseOptions.inlineCollapsed = props.mixSider inlineCollapseOptions.inlineCollapsed = props.mixSider ? false : unref(getCollapsed)
? false
: unref(getCollapsed)
} }
return inlineCollapseOptions return inlineCollapseOptions
}) })
...@@ -138,8 +130,7 @@ ...@@ -138,8 +130,7 @@
return return
} }
const path = const path =
(route || unref(currentRoute)).meta?.currentActiveMenu || (route || unref(currentRoute)).meta?.currentActiveMenu || (route || unref(currentRoute)).path
(route || unref(currentRoute)).path
setOpenKeys(path) setOpenKeys(path)
if (unref(currentActiveMenu)) return if (unref(currentActiveMenu)) return
if (props.isHorizontal && unref(getSplit)) { if (props.isHorizontal && unref(getSplit)) {
......
<template> <template>
<span :class="`${prefixCls}- flex items-center `"> <span :class="`${prefixCls}- flex items-center `">
<Icon <Icon v-if="getIcon" :icon="getIcon" :size="18" :class="`${prefixCls}-wrapper__icon mr-2`" />
v-if="getIcon"
:icon="getIcon"
:size="18"
:class="`${prefixCls}-wrapper__icon mr-2`"
/>
{{ getI18nName }} {{ getI18nName }}
</span> </span>
</template> </template>
......
...@@ -31,10 +31,7 @@ export function useOpenKeys( ...@@ -31,10 +31,7 @@ export function useOpenKeys(
return return
} }
if (!unref(accordion)) { if (!unref(accordion)) {
menuState.openKeys = uniq([ menuState.openKeys = uniq([...menuState.openKeys, ...getAllParentPath(menuList, path)])
...menuState.openKeys,
...getAllParentPath(menuList, path),
])
} else { } else {
menuState.openKeys = getAllParentPath(menuList, path) menuState.openKeys = getAllParentPath(menuList, path)
} }
...@@ -59,11 +56,7 @@ export function useOpenKeys( ...@@ -59,11 +56,7 @@ export function useOpenKeys(
} }
function handleOpenChange(openKeys: string[]) { function handleOpenChange(openKeys: string[]) {
if ( if (unref(mode) === MenuModeEnum.HORIZONTAL || !unref(accordion) || unref(getIsMixSidebar)) {
unref(mode) === MenuModeEnum.HORIZONTAL ||
!unref(accordion) ||
unref(getIsMixSidebar)
) {
menuState.openKeys = openKeys menuState.openKeys = openKeys
} else { } else {
// const menuList = toRaw(menus.value); // const menuList = toRaw(menus.value);
......
...@@ -51,17 +51,7 @@ ...@@ -51,17 +51,7 @@
<script lang="ts"> <script lang="ts">
import type { ModalProps, ModalMethods } from './typing' import type { ModalProps, ModalMethods } from './typing'
import { import { defineComponent, computed, ref, watch, unref, watchEffect, toRef, getCurrentInstance, nextTick } from 'vue'
defineComponent,
computed,
ref,
watch,
unref,
watchEffect,
toRef,
getCurrentInstance,
nextTick,
} from 'vue'
import Modal from './components/Modal' import Modal from './components/Modal'
import ModalWrapper from './components/ModalWrapper.vue' import ModalWrapper from './components/ModalWrapper.vue'
import ModalClose from './components/ModalClose.vue' import ModalClose from './components/ModalClose.vue'
...@@ -178,8 +168,7 @@ ...@@ -178,8 +168,7 @@
async function handleCancel(e: Event) { async function handleCancel(e: Event) {
e?.stopPropagation() e?.stopPropagation()
// 过滤自定义关闭按钮的空白区域 // 过滤自定义关闭按钮的空白区域
if ((e.target as HTMLElement)?.classList?.contains(prefixCls + '-close--custom')) if ((e.target as HTMLElement)?.classList?.contains(prefixCls + '-close--custom')) return
return
if (props.closeFunc && isFunction(props.closeFunc)) { if (props.closeFunc && isFunction(props.closeFunc)) {
const isClose: boolean = await props.closeFunc() const isClose: boolean = await props.closeFunc()
visibleRef.value = !isClose visibleRef.value = !isClose
......
...@@ -15,11 +15,7 @@ ...@@ -15,11 +15,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, computed } from 'vue' import { defineComponent, computed } from 'vue'
import { import { FullscreenExitOutlined, FullscreenOutlined, CloseOutlined } from '@ant-design/icons-vue'
FullscreenExitOutlined,
FullscreenOutlined,
CloseOutlined,
} from '@ant-design/icons-vue'
import { useDesign } from '/@/hooks/web/useDesign' import { useDesign } from '/@/hooks/web/useDesign'
import { Tooltip } from 'ant-design-vue' import { Tooltip } from 'ant-design-vue'
import { useI18n } from '/@/hooks/web/useI18n' import { useI18n } from '/@/hooks/web/useI18n'
......
...@@ -5,13 +5,7 @@ ...@@ -5,13 +5,7 @@
{{ cancelText }} {{ cancelText }}
</a-button> </a-button>
<slot name="centerFooter"></slot> <slot name="centerFooter"></slot>
<a-button <a-button :type="okType" @click="handleOk" :loading="confirmLoading" v-bind="okButtonProps" v-if="showOkBtn">
:type="okType"
@click="handleOk"
:loading="confirmLoading"
v-bind="okButtonProps"
v-if="showOkBtn"
>
{{ okText }} {{ okText }}
</a-button> </a-button>
<slot name="appendFooter"></slot> <slot name="appendFooter"></slot>
......
...@@ -7,17 +7,7 @@ ...@@ -7,17 +7,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import type { CSSProperties } from 'vue' import type { CSSProperties } from 'vue'
import { import { defineComponent, computed, ref, watchEffect, unref, watch, onMounted, nextTick, onUnmounted } from 'vue'
defineComponent,
computed,
ref,
watchEffect,
unref,
watch,
onMounted,
nextTick,
onUnmounted,
} from 'vue'
import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn' import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn'
import { ScrollContainer } from '/@/components/Container' import { ScrollContainer } from '/@/components/Container'
import { createModalContext } from '../hooks/useModalContext' import { createModalContext } from '../hooks/useModalContext'
...@@ -149,10 +139,7 @@ ...@@ -149,10 +139,7 @@
if (props.fullScreen) { if (props.fullScreen) {
realHeightRef.value = realHeightRef.value =
window.innerHeight - window.innerHeight - props.modalFooterHeight - props.modalHeaderHeight - 28
props.modalFooterHeight -
props.modalHeaderHeight -
28
} else { } else {
realHeightRef.value = props.height realHeightRef.value = props.height
? props.height ? props.height
......
import type { import type { UseModalReturnType, ModalMethods, ModalProps, ReturnMethods, UseModalInnerReturnType } from '../typing'
UseModalReturnType, import { ref, onUnmounted, unref, getCurrentInstance, reactive, watchEffect, nextTick, toRaw } from 'vue'
ModalMethods,
ModalProps,
ReturnMethods,
UseModalInnerReturnType,
} from '../typing'
import {
ref,
onUnmounted,
unref,
getCurrentInstance,
reactive,
watchEffect,
nextTick,
toRaw,
} from 'vue'
import { isProdMode } from '/@/utils/env' import { isProdMode } from '/@/utils/env'
import { isFunction } from '/@/utils/is' import { isFunction } from '/@/utils/is'
import { isEqual } from 'lodash-es' import { isEqual } from 'lodash-es'
......
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
line-height: 44px; line-height: 44px;
background-color: @component-background; background-color: @component-background;
border-top: 1px solid @border-color-base; border-top: 1px solid @border-color-base;
box-shadow: 0 -6px 16px -8px rgb(0 0 0 / 8%), 0 -9px 28px 0 rgb(0 0 0 / 5%), box-shadow: 0 -6px 16px -8px rgb(0 0 0 / 8%), 0 -9px 28px 0 rgb(0 0 0 / 5%), 0 -12px 48px 16px rgb(0 0 0 / 3%);
0 -12px 48px 16px rgb(0 0 0 / 3%);
transition: width 0.2s; transition: width 0.2s;
&__left { &__left {
......
<template> <template>
<div :class="getClass" ref="wrapperRef"> <div :class="getClass" ref="wrapperRef">
<PageHeader <PageHeader :ghost="ghost" :title="title" v-bind="omit($attrs, 'class')" ref="headerRef" v-if="getShowHeader">
:ghost="ghost"
:title="title"
v-bind="omit($attrs, 'class')"
ref="headerRef"
v-if="getShowHeader"
>
<template #default> <template #default>
<template v-if="content"> <template v-if="content">
{{ content }} {{ content }}
...@@ -18,12 +12,7 @@ ...@@ -18,12 +12,7 @@
</template> </template>
</PageHeader> </PageHeader>
<div <div class="overflow-hidden" :class="getContentClass" :style="getContentStyle" ref="contentRef">
class="overflow-hidden"
:class="getContentClass"
:style="getContentStyle"
ref="contentRef"
>
<slot></slot> <slot></slot>
</div> </div>
...@@ -105,19 +94,13 @@ ...@@ -105,19 +94,13 @@
}) })
const getShowHeader = computed( const getShowHeader = computed(
() => () => props.content || slots?.headerContent || props.title || getHeaderSlots.value.length,
props.content ||
slots?.headerContent ||
props.title ||
getHeaderSlots.value.length,
) )
const getShowFooter = computed(() => slots?.leftFooter || slots?.rightFooter) const getShowFooter = computed(() => slots?.leftFooter || slots?.rightFooter)
const getHeaderSlots = computed(() => { const getHeaderSlots = computed(() => {
return Object.keys( return Object.keys(omit(slots, 'default', 'leftFooter', 'rightFooter', 'headerContent'))
omit(slots, 'default', 'leftFooter', 'rightFooter', 'headerContent'),
)
}) })
const getContentStyle = computed((): CSSProperties => { const getContentStyle = computed((): CSSProperties => {
......
...@@ -345,25 +345,16 @@ ...@@ -345,25 +345,16 @@
const renderController = () => { const renderController = () => {
return ( return (
<div class={`${prefixCls}__controller`}> <div class={`${prefixCls}__controller`}>
<div <div class={`${prefixCls}__controller-item`} onClick={() => scaleFunc(-getScaleStep.value)}>
class={`${prefixCls}__controller-item`}
onClick={() => scaleFunc(-getScaleStep.value)}
>
<img src={unScaleSvg} /> <img src={unScaleSvg} />
</div> </div>
<div <div class={`${prefixCls}__controller-item`} onClick={() => scaleFunc(getScaleStep.value)}>
class={`${prefixCls}__controller-item`}
onClick={() => scaleFunc(getScaleStep.value)}
>
<img src={scaleSvg} /> <img src={scaleSvg} />
</div> </div>
<div class={`${prefixCls}__controller-item`} onClick={resume}> <div class={`${prefixCls}__controller-item`} onClick={resume}>
<img src={resumeSvg} /> <img src={resumeSvg} />
</div> </div>
<div <div class={`${prefixCls}__controller-item`} onClick={() => rotateFunc(-90)}>
class={`${prefixCls}__controller-item`}
onClick={() => rotateFunc(-90)}
>
<img src={unRotateSvg} /> <img src={unRotateSvg} />
</div> </div>
<div class={`${prefixCls}__controller-item`} onClick={() => rotateFunc(90)}> <div class={`${prefixCls}__controller-item`} onClick={() => rotateFunc(90)}>
...@@ -378,10 +369,7 @@ ...@@ -378,10 +369,7 @@
return null return null
} }
return ( return (
<div <div class={[`${prefixCls}__arrow`, direction]} onClick={() => handleChange(direction)}>
class={[`${prefixCls}__arrow`, direction]}
onClick={() => handleChange(direction)}
>
{direction === 'left' ? <LeftOutlined /> : <RightOutlined />} {direction === 'left' ? <LeftOutlined /> : <RightOutlined />}
</div> </div>
) )
...@@ -390,12 +378,7 @@ ...@@ -390,12 +378,7 @@
return () => { return () => {
return ( return (
imgState.show && ( imgState.show && (
<div <div class={prefixCls} ref={wrapElRef} onMouseup={handleMouseUp} onClick={handleMaskClick}>
class={prefixCls}
ref={wrapElRef}
onMouseup={handleMouseUp}
onClick={handleMaskClick}
>
<div class={`${prefixCls}-content`}> <div class={`${prefixCls}-content`}>
{/*<Spin*/} {/*<Spin*/}
{/* indicator={<LoadingOutlined style="font-size: 24px" spin />}*/} {/* indicator={<LoadingOutlined style="font-size: 24px" spin />}*/}
...@@ -409,10 +392,7 @@ ...@@ -409,10 +392,7 @@
{/*/>*/} {/*/>*/}
<img <img
style={unref(getImageStyle)} style={unref(getImageStyle)}
class={[ class={[`${prefixCls}-image`, imgState.status === StatueEnum.DONE ? '' : 'hidden']}
`${prefixCls}-image`,
imgState.status === StatueEnum.DONE ? '' : 'hidden',
]}
ref={imgElRef} ref={imgElRef}
src={imgState.currentUrl} src={imgState.currentUrl}
onMousedown={handleAddMoveListener} onMousedown={handleAddMoveListener}
......
...@@ -3,12 +3,7 @@ import type { QRCodeRenderersOptions } from 'qrcode' ...@@ -3,12 +3,7 @@ import type { QRCodeRenderersOptions } from 'qrcode'
import { RenderQrCodeParams, ContentType } from './typing' import { RenderQrCodeParams, ContentType } from './typing'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
export const renderQrCode = ({ export const renderQrCode = ({ canvas, content, width = 0, options: params = {} }: RenderQrCodeParams) => {
canvas,
content,
width = 0,
options: params = {},
}: RenderQrCodeParams) => {
const options = cloneDeep(params) const options = cloneDeep(params)
// 容错率,默认对内容少的二维码采用高容错率,内容多的二维码采用低容错率 // 容错率,默认对内容少的二维码采用高容错率,内容多的二维码采用低容错率
options.errorCorrectionLevel = options.errorCorrectionLevel || getErrorCorrectionLevel(content) options.errorCorrectionLevel = options.errorCorrectionLevel || getErrorCorrectionLevel(content)
......
...@@ -6,12 +6,7 @@ ...@@ -6,12 +6,7 @@
:style="style" :style="style"
@scroll="handleScroll" @scroll="handleScroll"
> >
<component <component :is="tag" ref="resize" :class="['scrollbar__view', viewClass]" :style="viewStyle">
:is="tag"
ref="resize"
:class="['scrollbar__view', viewClass]"
:style="viewStyle"
>
<slot></slot> <slot></slot>
</component> </component>
</div> </div>
...@@ -26,16 +21,7 @@ ...@@ -26,16 +21,7 @@
import componentSetting from '/@/settings/componentSetting' import componentSetting from '/@/settings/componentSetting'
const { scrollbar } = componentSetting const { scrollbar } = componentSetting
import { toObject } from './util' import { toObject } from './util'
import { import { defineComponent, ref, onMounted, onBeforeUnmount, nextTick, provide, computed, unref } from 'vue'
defineComponent,
ref,
onMounted,
onBeforeUnmount,
nextTick,
provide,
computed,
unref,
} from 'vue'
import Bar from './bar' import Bar from './bar'
export default defineComponent({ export default defineComponent({
......
import { import { defineComponent, h, computed, ref, getCurrentInstance, onUnmounted, inject, Ref } from 'vue'
defineComponent,
h,
computed,
ref,
getCurrentInstance,
onUnmounted,
inject,
Ref,
} from 'vue'
import { on, off } from '/@/utils/domUtils' import { on, off } from '/@/utils/domUtils'
import { renderThumbStyle, BAR_MAP } from './util' import { renderThumbStyle, BAR_MAP } from './util'
...@@ -43,15 +34,11 @@ export default defineComponent({ ...@@ -43,15 +34,11 @@ export default defineComponent({
} }
const clickTrackHandler = (e: any) => { const clickTrackHandler = (e: any) => {
const offset = Math.abs( const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client])
e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client],
)
const thumbHalf = thumb.value[bar.value.offset] / 2 const thumbHalf = thumb.value[bar.value.offset] / 2
const thumbPositionPercentage = const thumbPositionPercentage = ((offset - thumbHalf) * 100) / instance?.vnode.el?.[bar.value.offset]
((offset - thumbHalf) * 100) / instance?.vnode.el?.[bar.value.offset]
wrap.value[bar.value.scroll] = wrap.value[bar.value.scroll] = (thumbPositionPercentage * wrap.value[bar.value.scrollSize]) / 100
(thumbPositionPercentage * wrap.value[bar.value.scrollSize]) / 100
} }
const startDrag = (e: any) => { const startDrag = (e: any) => {
e.stopImmediatePropagation() e.stopImmediatePropagation()
...@@ -67,15 +54,11 @@ export default defineComponent({ ...@@ -67,15 +54,11 @@ export default defineComponent({
if (!prevPage) return if (!prevPage) return
const offset = const offset = (instance?.vnode.el?.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1
(instance?.vnode.el?.getBoundingClientRect()[bar.value.direction] -
e[bar.value.client]) *
-1
const thumbClickPosition = thumb.value[bar.value.offset] - prevPage const thumbClickPosition = thumb.value[bar.value.offset] - prevPage
const thumbPositionPercentage = const thumbPositionPercentage =
((offset - thumbClickPosition) * 100) / instance?.vnode.el?.[bar.value.offset] ((offset - thumbClickPosition) * 100) / instance?.vnode.el?.[bar.value.offset]
wrap.value[bar.value.scroll] = wrap.value[bar.value.scroll] = (thumbPositionPercentage * wrap.value[bar.value.scrollSize]) / 100
(thumbPositionPercentage * wrap.value[bar.value.scrollSize]) / 100
} }
function mouseUpDocumentHandler() { function mouseUpDocumentHandler() {
......
...@@ -8,12 +8,7 @@ ...@@ -8,12 +8,7 @@
@select="handleSelect" @select="handleSelect"
> >
<template v-for="item in items" :key="item.path"> <template v-for="item in items" :key="item.path">
<SimpleSubMenu <SimpleSubMenu :item="item" :parent="true" :collapsedShowTitle="collapsedShowTitle" :collapse="collapse" />
:item="item"
:parent="true"
:collapsedShowTitle="collapsedShowTitle"
:collapse="collapse"
/>
</template> </template>
</Menu> </Menu>
</template> </template>
...@@ -70,13 +65,7 @@ ...@@ -70,13 +65,7 @@
const { prefixCls } = useDesign('simple-menu') const { prefixCls } = useDesign('simple-menu')
const { items, accordion, mixSider, collapse } = toRefs(props) const { items, accordion, mixSider, collapse } = toRefs(props)
const { setOpenKeys, getOpenKeys } = useOpenKeys( const { setOpenKeys, getOpenKeys } = useOpenKeys(menuState, items, accordion, mixSider, collapse)
menuState,
items,
accordion,
mixSider,
collapse,
)
const getBindValues = computed(() => ({ ...attrs, ...props })) const getBindValues = computed(() => ({ ...attrs, ...props }))
......
<template> <template>
<MenuItem <MenuItem :name="item.path" v-if="!menuHasChildren(item) && getShowMenu" v-bind="$props" :class="getLevelClass">
:name="item.path"
v-if="!menuHasChildren(item) && getShowMenu"
v-bind="$props"
:class="getLevelClass"
>
<Icon v-if="getIcon" :icon="getIcon" :size="16" /> <Icon v-if="getIcon" :icon="getIcon" :size="16" />
<div v-if="collapsedShowTitle && getIsCollapseParent" class="mt-1 collapse-title"> <div v-if="collapsedShowTitle && getIsCollapseParent" class="mt-1 collapse-title">
{{ getI18nName }} {{ getI18nName }}
......
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
const active = ref(false) const active = ref(false)
const { getItemStyle, getParentList, getParentMenu, getParentRootMenu } = const { getItemStyle, getParentList, getParentMenu, getParentRootMenu } = useMenuItem(instance)
useMenuItem(instance)
const { prefixCls } = useDesign('menu') const { prefixCls } = useDesign('menu')
...@@ -60,9 +59,7 @@ ...@@ -60,9 +59,7 @@
const getCollapse = computed(() => unref(getParentRootMenu)?.props.collapse) const getCollapse = computed(() => unref(getParentRootMenu)?.props.collapse)
const showTooptip = computed(() => { const showTooptip = computed(() => {
return ( return unref(getParentMenu)?.type.name === 'Menu' && unref(getCollapse) && slots.title
unref(getParentMenu)?.type.name === 'Menu' && unref(getCollapse) && slots.title
)
}) })
function handleClickItem() { function handleClickItem() {
......
<template> <template>
<li :class="getClass"> <li :class="getClass">
<template v-if="!getCollapse"> <template v-if="!getCollapse">
<div <div :class="`${prefixCls}-submenu-title`" @click.stop="handleClick" :style="getItemStyle">
:class="`${prefixCls}-submenu-title`"
@click.stop="handleClick"
:style="getItemStyle"
>
<slot name="title"></slot> <slot name="title"></slot>
<Icon <Icon icon="eva:arrow-ios-downward-outline" :size="14" :class="`${prefixCls}-submenu-title-icon`" />
icon="eva:arrow-ios-downward-outline"
:size="14"
:class="`${prefixCls}-submenu-title-icon`"
/>
</div> </div>
<CollapseTransition> <CollapseTransition>
<ul :class="prefixCls" v-show="opened"> <ul :class="prefixCls" v-show="opened">
...@@ -113,8 +105,7 @@ ...@@ -113,8 +105,7 @@
isChild: false, isChild: false,
}) })
const { getParentSubMenu, getItemStyle, getParentMenu, getParentList } = const { getParentSubMenu, getItemStyle, getParentMenu, getParentList } = useMenuItem(instance)
useMenuItem(instance)
const { prefixCls } = useDesign('menu') const { prefixCls } = useDesign('menu')
...@@ -269,9 +260,7 @@ ...@@ -269,9 +260,7 @@
clearTimeout(data.timeout!) clearTimeout(data.timeout!)
}) })
rootMenuEmitter.on( rootMenuEmitter.on('on-update-opened', (data: boolean | (string | number)[] | Recordable) => {
'on-update-opened',
(data: boolean | (string | number)[] | Recordable) => {
if (unref(getCollapse)) return if (unref(getCollapse)) return
if (isBoolean(data)) { if (isBoolean(data)) {
state.opened = data state.opened = data
...@@ -290,8 +279,7 @@ ...@@ -290,8 +279,7 @@
if (props.name && Array.isArray(data)) { if (props.name && Array.isArray(data)) {
state.opened = (data as (string | number)[]).includes(props.name) state.opened = (data as (string | number)[]).includes(props.name)
} }
}, })
)
rootMenuEmitter.on('on-update-active-name:submenu', (data: number[]) => { rootMenuEmitter.on('on-update-active-name:submenu', (data: number[]) => {
if (instance?.uid) { if (instance?.uid) {
......
...@@ -35,12 +35,7 @@ ...@@ -35,12 +35,7 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import type { import type { BasicTableProps, TableActionType, SizeType, ColumnChangeParam } from './types/table'
BasicTableProps,
TableActionType,
SizeType,
ColumnChangeParam,
} from './types/table'
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect } from 'vue' import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect } from 'vue'
import { Table } from 'ant-design-vue' import { Table } from 'ant-design-vue'
...@@ -120,13 +115,8 @@ ...@@ -120,13 +115,8 @@
}) })
const { getLoading, setLoading } = useLoading(getProps) const { getLoading, setLoading } = useLoading(getProps)
const { const { getPaginationInfo, getPagination, setPagination, setShowPagination, getShowPagination } =
getPaginationInfo, usePagination(getProps)
getPagination,
setPagination,
setShowPagination,
getShowPagination,
} = usePagination(getProps)
const { const {
getRowSelection, getRowSelection,
...@@ -174,14 +164,8 @@ ...@@ -174,14 +164,8 @@
onChange && isFunction(onChange) && onChange.call(undefined, ...args) onChange && isFunction(onChange) && onChange.call(undefined, ...args)
} }
const { const { getViewColumns, getColumns, setCacheColumnsByField, setColumns, getColumnsRef, getCacheColumns } =
getViewColumns, useColumns(getProps, getPaginationInfo)
getColumns,
setCacheColumnsByField,
setColumns,
getColumnsRef,
getCacheColumns,
} = useColumns(getProps, getPaginationInfo)
const { getScrollRef, redoHeight } = useTableScroll( const { getScrollRef, redoHeight } = useTableScroll(
getProps, getProps,
...@@ -205,11 +189,7 @@ ...@@ -205,11 +189,7 @@
const { getRowClassName } = useTableStyle(getProps, prefixCls) const { getRowClassName } = useTableStyle(getProps, prefixCls)
const { getExpandOption, expandAll, expandRows, collapseAll } = useTableExpand( const { getExpandOption, expandAll, expandRows, collapseAll } = useTableExpand(getProps, tableData, emit)
getProps,
tableData,
emit,
)
const handlers: InnerHandlers = { const handlers: InnerHandlers = {
onColumnsChange: (data: ColumnChangeParam[]) => { onColumnsChange: (data: ColumnChangeParam[]) => {
...@@ -221,16 +201,15 @@ ...@@ -221,16 +201,15 @@
const { getHeaderProps } = useTableHeader(getProps, slots, handlers) const { getHeaderProps } = useTableHeader(getProps, slots, handlers)
const { getFooterProps } = useTableFooter( const { getFooterProps } = useTableFooter(getProps, getScrollRef, tableElRef, getDataSourceRef)
const { getFormProps, replaceFormSlotKey, getFormSlotKeys, handleSearchInfoChange } = useTableForm(
getProps, getProps,
getScrollRef, slots,
tableElRef, fetch,
getDataSourceRef, getLoading,
) )
const { getFormProps, replaceFormSlotKey, getFormSlotKeys, handleSearchInfoChange } =
useTableForm(getProps, slots, fetch, getLoading)
const getBindValues = computed(() => { const getBindValues = computed(() => {
const dataSource = unref(getDataSourceRef) const dataSource = unref(getDataSourceRef)
let propsData: Recordable = { let propsData: Recordable = {
......
import type { Component } from 'vue' import type { Component } from 'vue'
import { import { Input, Select, Checkbox, InputNumber, Switch, DatePicker, TimePicker } from 'ant-design-vue'
Input,
Select,
Checkbox,
InputNumber,
Switch,
DatePicker,
TimePicker,
} from 'ant-design-vue'
import type { ComponentType } from './types/componentType' import type { ComponentType } from './types/componentType'
import { ApiSelect, ApiTreeSelect } from '/@/components/Form' import { ApiSelect, ApiTreeSelect } from '/@/components/Form'
......
...@@ -3,11 +3,7 @@ ...@@ -3,11 +3,7 @@
<template v-for="(action, index) in getActions" :key="`${index}-${action.label}`"> <template v-for="(action, index) in getActions" :key="`${index}-${action.label}`">
<Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)"> <Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)">
<PopConfirmButton v-bind="action"> <PopConfirmButton v-bind="action">
<Icon <Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
:icon="action.icon"
:class="{ 'mr-1': !!action.label }"
v-if="action.icon"
/>
<template v-if="action.label">{{ action.label }}</template> <template v-if="action.label">{{ action.label }}</template>
</PopConfirmButton> </PopConfirmButton>
</Tooltip> </Tooltip>
...@@ -15,11 +11,7 @@ ...@@ -15,11 +11,7 @@
<Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" /> <Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
<template v-if="action.label">{{ action.label }}</template> <template v-if="action.label">{{ action.label }}</template>
</PopConfirmButton> </PopConfirmButton>
<Divider <Divider type="vertical" class="action-divider" v-if="divider && index < getActions.length - 1" />
type="vertical"
class="action-divider"
v-if="divider && index < getActions.length - 1"
/>
</template> </template>
<Dropdown <Dropdown
:trigger="['hover']" :trigger="['hover']"
...@@ -95,8 +87,7 @@ ...@@ -95,8 +87,7 @@
.map((action) => { .map((action) => {
const { popConfirm } = action const { popConfirm } = action
return { return {
getPopupContainer: () => getPopupContainer: () => unref((table as any)?.wrapRef.value) ?? document.body,
unref((table as any)?.wrapRef.value) ?? document.body,
type: 'link', type: 'link',
size: 'small', size: 'small',
...action, ...action,
......
...@@ -64,9 +64,7 @@ ...@@ -64,9 +64,7 @@
const columns: BasicColumn[] = cloneDeep(table.getColumns()) const columns: BasicColumn[] = cloneDeep(table.getColumns())
const index = columns.findIndex((item) => item.flag === INDEX_COLUMN_FLAG) const index = columns.findIndex((item) => item.flag === INDEX_COLUMN_FLAG)
const hasRowSummary = dataSource.some((item) => Reflect.has(item, SUMMARY_ROW_KEY)) const hasRowSummary = dataSource.some((item) => Reflect.has(item, SUMMARY_ROW_KEY))
const hasIndexSummary = dataSource.some((item) => const hasIndexSummary = dataSource.some((item) => Reflect.has(item, SUMMARY_INDEX_KEY))
Reflect.has(item, SUMMARY_INDEX_KEY),
)
if (index !== -1) { if (index !== -1) {
if (hasIndexSummary) { if (hasIndexSummary) {
......
...@@ -5,19 +5,11 @@ ...@@ -5,19 +5,11 @@
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<slot name="tableTitle" v-if="$slots.tableTitle"></slot> <slot name="tableTitle" v-if="$slots.tableTitle"></slot>
<TableTitle <TableTitle :helpMessage="titleHelpMessage" :title="title" v-if="!$slots.tableTitle && title" />
:helpMessage="titleHelpMessage"
:title="title"
v-if="!$slots.tableTitle && title"
/>
<div :class="`${prefixCls}__toolbar`"> <div :class="`${prefixCls}__toolbar`">
<slot name="toolbar"></slot> <slot name="toolbar"></slot>
<Divider type="vertical" v-if="$slots.toolbar && showTableSetting" /> <Divider type="vertical" v-if="$slots.toolbar && showTableSetting" />
<TableSetting <TableSetting :setting="tableSetting" v-if="showTableSetting" @columns-change="handleColumnChange" />
:setting="tableSetting"
v-if="showTableSetting"
@columns-change="handleColumnChange"
/>
</div> </div>
</div> </div>
</div> </div>
......
<template> <template>
<div <div :class="prefixCls" class="flex items-center mx-auto" v-if="imgList && imgList.length" :style="getWrapStyle">
:class="prefixCls"
class="flex items-center mx-auto"
v-if="imgList && imgList.length"
:style="getWrapStyle"
>
<Badge :count="!showBadge || imgList.length == 1 ? 0 : imgList.length" v-if="simpleShow"> <Badge :count="!showBadge || imgList.length == 1 ? 0 : imgList.length" v-if="simpleShow">
<div class="img-div"> <div class="img-div">
<PreviewGroup> <PreviewGroup>
...@@ -22,11 +17,7 @@ ...@@ -22,11 +17,7 @@
</Badge> </Badge>
<PreviewGroup v-else> <PreviewGroup v-else>
<template v-for="(img, index) in imgList" :key="img"> <template v-for="(img, index) in imgList" :key="img">
<Image <Image :width="size" :style="{ marginLeft: index === 0 ? 0 : margin }" :src="srcPrefix + img" />
:width="size"
:style="{ marginLeft: index === 0 ? 0 : margin }"
:src="srcPrefix + img"
/>
</template> </template>
</PreviewGroup> </PreviewGroup>
</div> </div>
......
...@@ -14,13 +14,7 @@ export interface ComponentProps { ...@@ -14,13 +14,7 @@ export interface ComponentProps {
} }
export const CellComponent: FunctionalComponent = ( export const CellComponent: FunctionalComponent = (
{ { component = 'Input', rule = true, ruleMessage, popoverVisible, getPopupContainer }: ComponentProps,
component = 'Input',
rule = true,
ruleMessage,
popoverVisible,
getPopupContainer,
}: ComponentProps,
{ attrs }, { attrs },
) => { ) => {
const Comp = componentMap.get(component) as typeof defineComponent const Comp = componentMap.get(component) as typeof defineComponent
......
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
}, },
props: { props: {
value: { value: {
type: [String, Number, Boolean, Object] as PropType< type: [String, Number, Boolean, Object] as PropType<string | number | boolean | Recordable>,
string | number | boolean | Recordable
>,
default: '', default: '',
}, },
record: { record: {
...@@ -109,8 +107,7 @@ ...@@ -109,8 +107,7 @@
return value return value
} }
const options: LabelValueOptions = const options: LabelValueOptions = unref(getComponentProps)?.options ?? (unref(optionsRef) || [])
unref(getComponentProps)?.options ?? (unref(optionsRef) || [])
const option = options.find((item) => `${item.value}` === `${value}`) const option = options.find((item) => `${item.value}` === `${value}`)
return option?.label ?? value return option?.label ?? value
...@@ -296,11 +293,7 @@ ...@@ -296,11 +293,7 @@
const { replaceFields } = unref(getComponentProps) const { replaceFields } = unref(getComponentProps)
const component = unref(getComponent) const component = unref(getComponent)
if (component === 'ApiTreeSelect') { if (component === 'ApiTreeSelect') {
const { const { title = 'title', value = 'value', children = 'children' } = replaceFields || {}
title = 'title',
value = 'value',
children = 'children',
} = replaceFields || {}
let listOptions: Recordable[] = treeToList(options, { children }) let listOptions: Recordable[] = treeToList(options, { children })
listOptions = listOptions.map((item) => { listOptions = listOptions.map((item) => {
return { return {
...@@ -317,9 +310,7 @@ ...@@ -317,9 +310,7 @@
function initCbs(cbs: 'submitCbs' | 'validCbs' | 'cancelCbs', handle: Fn) { function initCbs(cbs: 'submitCbs' | 'validCbs' | 'cancelCbs', handle: Fn) {
if (props.record) { if (props.record) {
/* eslint-disable */ /* eslint-disable */
isArray(props.record[cbs]) isArray(props.record[cbs]) ? props.record[cbs]?.push(handle) : (props.record[cbs] = [handle])
? props.record[cbs]?.push(handle)
: (props.record[cbs] = [handle])
} }
} }
...@@ -334,8 +325,7 @@ ...@@ -334,8 +325,7 @@
} }
/* eslint-disable */ /* eslint-disable */
props.record.onCancelEdit = () => { props.record.onCancelEdit = () => {
isArray(props.record?.cancelCbs) && isArray(props.record?.cancelCbs) && props.record?.cancelCbs.forEach((fn) => fn())
props.record?.cancelCbs.forEach((fn) => fn())
} }
/* eslint-disable */ /* eslint-disable */
props.record.onSubmitEdit = async () => { props.record.onSubmitEdit = async () => {
...@@ -385,10 +375,7 @@ ...@@ -385,10 +375,7 @@
}} }}
onClick={this.handleEdit} onClick={this.handleEdit}
> >
<div <div class="cell-content" title={this.column.ellipsis ? this.getValues ?? '' : ''}>
class="cell-content"
title={this.column.ellipsis ? this.getValues ?? '' : ''}
>
{this.column.editRender {this.column.editRender
? this.column.editRender({ ? this.column.editRender({
text: this.value, text: this.value,
...@@ -400,16 +387,11 @@ ...@@ -400,16 +387,11 @@
? this.getValues ? this.getValues
: '\u00A0'} : '\u00A0'}
</div> </div>
{!this.column.editRow && ( {!this.column.editRow && <FormOutlined class={`${this.prefixCls}__normal-icon`} />}
<FormOutlined class={`${this.prefixCls}__normal-icon`} />
)}
</div> </div>
{this.isEdit && ( {this.isEdit && (
<Spin spinning={this.spinning}> <Spin spinning={this.spinning}>
<div <div class={`${this.prefixCls}__wrapper`} v-click-outside={this.onClickOutside}>
class={`${this.prefixCls}__wrapper`}
v-click-outside={this.onClickOutside}
>
<CellComponent <CellComponent
{...this.getComponentProps} {...this.getComponentProps}
component={this.getComponent} component={this.getComponent}
...@@ -429,10 +411,7 @@ ...@@ -429,10 +411,7 @@
class={[`${this.prefixCls}__icon`, 'mx-2']} class={[`${this.prefixCls}__icon`, 'mx-2']}
onClick={this.handleSubmitClick} onClick={this.handleSubmitClick}
/> />
<CloseOutlined <CloseOutlined class={`${this.prefixCls}__icon `} onClick={this.handleCancel} />
class={`${this.prefixCls}__icon `}
onClick={this.handleCancel}
/>
</div> </div>
)} )}
</div> </div>
......
...@@ -12,11 +12,7 @@ ...@@ -12,11 +12,7 @@
> >
<template #title> <template #title>
<div :class="`${prefixCls}__popover-title`"> <div :class="`${prefixCls}__popover-title`">
<Checkbox <Checkbox :indeterminate="indeterminate" v-model:checked="checkAll" @change="onCheckAllChange">
:indeterminate="indeterminate"
v-model:checked="checkAll"
@change="onCheckAllChange"
>
{{ t('component.table.settingColumnShow') }} {{ t('component.table.settingColumnShow') }}
</Checkbox> </Checkbox>
...@@ -40,16 +36,9 @@ ...@@ -40,16 +36,9 @@
<template #content> <template #content>
<ScrollContainer> <ScrollContainer>
<CheckboxGroup <CheckboxGroup v-model:value="checkedList" @change="onChange" ref="columnListRef">
v-model:value="checkedList"
@change="onChange"
ref="columnListRef"
>
<template v-for="item in plainOptions" :key="item.value"> <template v-for="item in plainOptions" :key="item.value">
<div <div :class="`${prefixCls}__check-item`" v-if="!('ifShow' in item && !item.ifShow)">
:class="`${prefixCls}__check-item`"
v-if="!('ifShow' in item && !item.ifShow)"
>
<DragOutlined class="table-column-drag-icon" /> <DragOutlined class="table-column-drag-icon" />
<Checkbox :value="item.value"> <Checkbox :value="item.value">
{{ item.label }} {{ item.label }}
...@@ -107,16 +96,7 @@ ...@@ -107,16 +96,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import type { BasicColumn, ColumnChangeParam } from '../../types/table' import type { BasicColumn, ColumnChangeParam } from '../../types/table'
import { import { defineComponent, ref, reactive, toRefs, watchEffect, nextTick, unref, computed } from 'vue'
defineComponent,
ref,
reactive,
toRefs,
watchEffect,
nextTick,
unref,
computed,
} from 'vue'
import { Tooltip, Popover, Checkbox, Divider } from 'ant-design-vue' import { Tooltip, Popover, Checkbox, Divider } from 'ant-design-vue'
import { SettingOutlined, DragOutlined } from '@ant-design/icons-vue' import { SettingOutlined, DragOutlined } from '@ant-design/icons-vue'
import { Icon } from '/@/components/Icon' import { Icon } from '/@/components/Icon'
...@@ -237,9 +217,7 @@ ...@@ -237,9 +217,7 @@
// ) as BasicColumn[]; // ) as BasicColumn[];
unref(plainOptions).forEach((item: BasicColumn) => { unref(plainOptions).forEach((item: BasicColumn) => {
const findItem = columns.find( const findItem = columns.find((col: BasicColumn) => col.dataIndex === item.dataIndex)
(col: BasicColumn) => col.dataIndex === item.dataIndex,
)
if (findItem) { if (findItem) {
item.fixed = findItem.fixed item.fixed = findItem.fixed
} }
...@@ -307,11 +285,7 @@ ...@@ -307,11 +285,7 @@
handle: '.table-column-drag-icon ', handle: '.table-column-drag-icon ',
onEnd: (evt) => { onEnd: (evt) => {
const { oldIndex, newIndex } = evt const { oldIndex, newIndex } = evt
if ( if (isNullAndUnDef(oldIndex) || isNullAndUnDef(newIndex) || oldIndex === newIndex) {
isNullAndUnDef(oldIndex) ||
isNullAndUnDef(newIndex) ||
oldIndex === newIndex
) {
return return
} }
// Sort column // Sort column
...@@ -373,8 +347,7 @@ ...@@ -373,8 +347,7 @@
const visible = const visible =
columns.findIndex( columns.findIndex(
(c: BasicColumn | string) => (c: BasicColumn | string) =>
c === col.value || c === col.value || (typeof c !== 'string' && c.dataIndex === col.value),
(typeof c !== 'string' && c.dataIndex === col.value),
) !== -1 ) !== -1
return { dataIndex: col.value, fixed: col.fixed, visible } return { dataIndex: col.value, fixed: col.fixed, visible }
}) })
...@@ -383,9 +356,7 @@ ...@@ -383,9 +356,7 @@
} }
function getPopupContainer() { function getPopupContainer() {
return isFunction(attrs.getPopupContainer) return isFunction(attrs.getPopupContainer) ? attrs.getPopupContainer() : getParentContainer()
? attrs.getPopupContainer()
: getParentContainer()
} }
return { return {
......
...@@ -2,14 +2,7 @@ import componentSetting from '/@/settings/componentSetting' ...@@ -2,14 +2,7 @@ import componentSetting from '/@/settings/componentSetting'
const { table } = componentSetting const { table } = componentSetting
const { const { pageSizeOptions, defaultPageSize, fetchSetting, defaultSize, defaultSortFn, defaultFilterFn } = table
pageSizeOptions,
defaultPageSize,
fetchSetting,
defaultSize,
defaultSortFn,
defaultFilterFn,
} = table
export const ROW_KEY = 'key' export const ROW_KEY = 'key'
......
...@@ -120,12 +120,7 @@ export function useColumns( ...@@ -120,12 +120,7 @@ export function useColumns(
columns.forEach((item) => { columns.forEach((item) => {
const { customRender, slots } = item const { customRender, slots } = item
handleItem( handleItem(item, Reflect.has(item, 'ellipsis') ? !!item.ellipsis : !!ellipsis && !customRender && !slots)
item,
Reflect.has(item, 'ellipsis')
? !!item.ellipsis
: !!ellipsis && !customRender && !slots,
)
}) })
return columns return columns
}) })
...@@ -220,9 +215,7 @@ export function useColumns( ...@@ -220,9 +215,7 @@ export function useColumns(
cacheColumns.forEach((item) => { cacheColumns.forEach((item) => {
newColumns.push({ newColumns.push({
...item, ...item,
defaultHidden: !columnKeys.includes( defaultHidden: !columnKeys.includes(item.dataIndex?.toString() || (item.key as string)),
item.dataIndex?.toString() || (item.key as string),
),
}) })
}) })
// Sort according to another array // Sort according to another array
...@@ -283,9 +276,7 @@ function sortFixedColumn(columns: BasicColumn[]) { ...@@ -283,9 +276,7 @@ function sortFixedColumn(columns: BasicColumn[]) {
} }
defColumns.push(column) defColumns.push(column)
} }
return [...fixedLeftColumns, ...defColumns, ...fixedRightColumns].filter( return [...fixedLeftColumns, ...defColumns, ...fixedRightColumns].filter((item) => !item.defaultHidden)
(item) => !item.defaultHidden,
)
} }
// format cell // format cell
......
import type { BasicTableProps, FetchParams, SorterResult } from '../types/table' import type { BasicTableProps, FetchParams, SorterResult } from '../types/table'
import type { PaginationProps } from '../types/pagination' import type { PaginationProps } from '../types/pagination'
import { import { ref, unref, ComputedRef, computed, onMounted, watch, reactive, Ref, watchEffect } from 'vue'
ref,
unref,
ComputedRef,
computed,
onMounted,
watch,
reactive,
Ref,
watchEffect,
} from 'vue'
import { useTimeoutFn } from '/@/hooks/core/useTimeout' import { useTimeoutFn } from '/@/hooks/core/useTimeout'
import { buildUUID } from '/@/utils/uuid' import { buildUUID } from '/@/utils/uuid'
import { isFunction, isBoolean } from '/@/utils/is' import { isFunction, isBoolean } from '/@/utils/is'
...@@ -32,14 +22,7 @@ interface SearchState { ...@@ -32,14 +22,7 @@ interface SearchState {
} }
export function useDataSource( export function useDataSource(
propsRef: ComputedRef<BasicTableProps>, propsRef: ComputedRef<BasicTableProps>,
{ { getPaginationInfo, setPagination, setLoading, getFieldsValue, clearSelectedRowKeys, tableData }: ActionType,
getPaginationInfo,
setPagination,
setLoading,
getFieldsValue,
clearSelectedRowKeys,
tableData,
}: ActionType,
emit: EmitType, emit: EmitType,
) { ) {
const searchState = reactive<SearchState>({ const searchState = reactive<SearchState>({
...@@ -146,10 +129,7 @@ export function useDataSource( ...@@ -146,10 +129,7 @@ export function useDataSource(
return dataSourceRef.value[index] return dataSourceRef.value[index]
} }
function updateTableDataRecord( function updateTableDataRecord(rowKey: string | number, record: Recordable): Recordable | undefined {
rowKey: string | number,
record: Recordable,
): Recordable | undefined {
const row = findTableDataRecord(rowKey) const row = findTableDataRecord(rowKey)
if (row) { if (row) {
...@@ -187,8 +167,7 @@ export function useDataSource( ...@@ -187,8 +167,7 @@ export function useDataSource(
} }
return row[targetKeyName] === key return row[targetKeyName] === key
}) })
if (typeof index !== 'undefined' && index !== -1) if (typeof index !== 'undefined' && index !== -1) unref(propsRef).dataSource?.splice(index, 1)
unref(propsRef).dataSource?.splice(index, 1)
} }
setPagination({ setPagination({
total: unref(propsRef).dataSource?.length, total: unref(propsRef).dataSource?.length,
...@@ -240,29 +219,15 @@ export function useDataSource( ...@@ -240,29 +219,15 @@ export function useDataSource(
} }
async function fetch(opt?: FetchParams) { async function fetch(opt?: FetchParams) {
const { const { api, searchInfo, defSort, fetchSetting, beforeFetch, afterFetch, useSearchForm, pagination } =
api, unref(propsRef)
searchInfo,
defSort,
fetchSetting,
beforeFetch,
afterFetch,
useSearchForm,
pagination,
} = unref(propsRef)
if (!api || !isFunction(api)) return if (!api || !isFunction(api)) return
try { try {
setLoading(true) setLoading(true)
const { pageField, sizeField, listField, totalField } = Object.assign( const { pageField, sizeField, listField, totalField } = Object.assign({}, FETCH_SETTING, fetchSetting)
{},
FETCH_SETTING,
fetchSetting,
)
let pageParams: Recordable = {} let pageParams: Recordable = {}
const { current = 1, pageSize = PAGE_SIZE } = unref( const { current = 1, pageSize = PAGE_SIZE } = unref(getPaginationInfo) as PaginationProps
getPaginationInfo,
) as PaginationProps
if ((isBoolean(pagination) && !pagination) || isBoolean(getPaginationInfo)) { if ((isBoolean(pagination) && !pagination) || isBoolean(getPaginationInfo)) {
pageParams = {} pageParams = {}
......
...@@ -5,11 +5,7 @@ import { ROW_KEY } from '../const' ...@@ -5,11 +5,7 @@ import { ROW_KEY } from '../const'
import { omit } from 'lodash-es' import { omit } from 'lodash-es'
import { findNodeAll } from '/@/utils/helper/treeHelper' import { findNodeAll } from '/@/utils/helper/treeHelper'
export function useRowSelection( export function useRowSelection(propsRef: ComputedRef<BasicTableProps>, tableData: Ref<Recordable[]>, emit: EmitType) {
propsRef: ComputedRef<BasicTableProps>,
tableData: Ref<Recordable[]>,
emit: EmitType,
) {
const selectedRowKeysRef = ref<string[]>([]) const selectedRowKeysRef = ref<string[]>([])
const selectedRowRef = ref<Recordable[]>([]) const selectedRowRef = ref<Recordable[]>([])
...@@ -42,8 +38,7 @@ export function useRowSelection( ...@@ -42,8 +38,7 @@ export function useRowSelection(
const { rowSelection } = unref(propsRef) const { rowSelection } = unref(propsRef)
if (rowSelection) { if (rowSelection) {
const { onChange } = rowSelection const { onChange } = rowSelection
if (onChange && isFunction(onChange)) if (onChange && isFunction(onChange)) onChange(getSelectRowKeys(), getSelectRows())
onChange(getSelectRowKeys(), getSelectRows())
} }
emit('selection-change', { emit('selection-change', {
keys: getSelectRowKeys(), keys: getSelectRowKeys(),
......
...@@ -2,17 +2,12 @@ import type { ComputedRef, Ref } from 'vue' ...@@ -2,17 +2,12 @@ import type { ComputedRef, Ref } from 'vue'
import { nextTick, unref } from 'vue' import { nextTick, unref } from 'vue'
import { warn } from '/@/utils/log' import { warn } from '/@/utils/log'
export function useTableScrollTo( export function useTableScrollTo(tableElRef: Ref<ComponentRef>, getDataSourceRef: ComputedRef<Recordable[]>) {
tableElRef: Ref<ComponentRef>,
getDataSourceRef: ComputedRef<Recordable[]>,
) {
let bodyEl: HTMLElement | null let bodyEl: HTMLElement | null
async function findTargetRowToScroll(targetRowData: Recordable) { async function findTargetRowToScroll(targetRowData: Recordable) {
const { id } = targetRowData const { id } = targetRowData
const targetRowEl: HTMLElement | null | undefined = bodyEl?.querySelector( const targetRowEl: HTMLElement | null | undefined = bodyEl?.querySelector(`[data-row-key="${id}"]`)
`[data-row-key="${id}"]`,
)
//Add a delay to get new dataSource //Add a delay to get new dataSource
await nextTick() await nextTick()
bodyEl?.scrollTo({ bodyEl?.scrollTo({
......
...@@ -3,11 +3,7 @@ import type { BasicTableProps } from '../types/table' ...@@ -3,11 +3,7 @@ import type { BasicTableProps } from '../types/table'
import { computed, unref, ref, toRaw } from 'vue' import { computed, unref, ref, toRaw } from 'vue'
import { ROW_KEY } from '../const' import { ROW_KEY } from '../const'
export function useTableExpand( export function useTableExpand(propsRef: ComputedRef<BasicTableProps>, tableData: Ref<Recordable[]>, emit: EmitType) {
propsRef: ComputedRef<BasicTableProps>,
tableData: Ref<Recordable[]>,
emit: EmitType,
) {
const expandedRowKeys = ref<string[]>([]) const expandedRowKeys = ref<string[]>([])
const getAutoCreateKey = computed(() => { const getAutoCreateKey = computed(() => {
......
...@@ -23,9 +23,7 @@ export function useTableForm( ...@@ -23,9 +23,7 @@ export function useTableForm(
const getFormSlotKeys: ComputedRef<string[]> = computed(() => { const getFormSlotKeys: ComputedRef<string[]> = computed(() => {
const keys = Object.keys(slots) const keys = Object.keys(slots)
return keys return keys.map((item) => (item.startsWith('form-') ? item : null)).filter((item) => !!item) as string[]
.map((item) => (item.startsWith('form-') ? item : null))
.filter((item) => !!item) as string[]
}) })
function replaceFormSlotKey(key: string) { function replaceFormSlotKey(key: string) {
......
...@@ -5,11 +5,7 @@ import TableHeader from '../components/TableHeader.vue' ...@@ -5,11 +5,7 @@ import TableHeader from '../components/TableHeader.vue'
import { isString } from '/@/utils/is' import { isString } from '/@/utils/is'
import { getSlot } from '/@/utils/helper/tsxHelper' import { getSlot } from '/@/utils/helper/tsxHelper'
export function useTableHeader( export function useTableHeader(propsRef: ComputedRef<BasicTableProps>, slots: Slots, handlers: InnerHandlers) {
propsRef: ComputedRef<BasicTableProps>,
slots: Slots,
handlers: InnerHandlers,
) {
const getHeaderProps = computed((): Recordable => { const getHeaderProps = computed((): Recordable => {
const { title, showTableSetting, titleHelpMessage, tableSetting } = unref(propsRef) const { title, showTableSetting, titleHelpMessage, tableSetting } = unref(propsRef)
const hideTitle = !slots.tableTitle && !title && !slots.toolbar && !showTableSetting const hideTitle = !slots.tableTitle && !title && !slots.toolbar && !showTableSetting
......
...@@ -56,8 +56,7 @@ export function useTableScroll( ...@@ -56,8 +56,7 @@ export function useTableScroll(
let bodyEl: HTMLElement | null let bodyEl: HTMLElement | null
async function calcTableHeight() { async function calcTableHeight() {
const { resizeHeightOffset, pagination, maxHeight, isCanResizeParent, useSearchForm } = const { resizeHeightOffset, pagination, maxHeight, isCanResizeParent, useSearchForm } = unref(propsRef)
unref(propsRef)
const tableData = unref(getDataSourceRef) const tableData = unref(getDataSourceRef)
const table = unref(tableElRef) const table = unref(tableElRef)
...@@ -75,19 +74,15 @@ export function useTableScroll( ...@@ -75,19 +74,15 @@ export function useTableScroll(
const hasScrollBarX = bodyEl.scrollWidth > bodyEl.clientWidth const hasScrollBarX = bodyEl.scrollWidth > bodyEl.clientWidth
if (hasScrollBarY) { if (hasScrollBarY) {
tableEl.classList.contains('hide-scrollbar-y') && tableEl.classList.contains('hide-scrollbar-y') && tableEl.classList.remove('hide-scrollbar-y')
tableEl.classList.remove('hide-scrollbar-y')
} else { } else {
!tableEl.classList.contains('hide-scrollbar-y') && !tableEl.classList.contains('hide-scrollbar-y') && tableEl.classList.add('hide-scrollbar-y')
tableEl.classList.add('hide-scrollbar-y')
} }
if (hasScrollBarX) { if (hasScrollBarX) {
tableEl.classList.contains('hide-scrollbar-x') && tableEl.classList.contains('hide-scrollbar-x') && tableEl.classList.remove('hide-scrollbar-x')
tableEl.classList.remove('hide-scrollbar-x')
} else { } else {
!tableEl.classList.contains('hide-scrollbar-x') && !tableEl.classList.contains('hide-scrollbar-x') && tableEl.classList.add('hide-scrollbar-x')
tableEl.classList.add('hide-scrollbar-x')
} }
bodyEl!.style.height = 'unset' bodyEl!.style.height = 'unset'
...@@ -151,14 +146,10 @@ export function useTableScroll( ...@@ -151,14 +146,10 @@ export function useTableScroll(
paddingHeight = 0 paddingHeight = 0
} }
const headerCellHeight = const headerCellHeight = (tableEl.querySelector('.ant-table-title') as HTMLElement)?.offsetHeight ?? 0
(tableEl.querySelector('.ant-table-title') as HTMLElement)?.offsetHeight ?? 0
console.log( console.log(wrapHeight - formHeight - headerCellHeight - tablePadding - paginationMargin)
wrapHeight - formHeight - headerCellHeight - tablePadding - paginationMargin, bottomIncludeBody = wrapHeight - formHeight - headerCellHeight - tablePadding - paginationMargin
)
bottomIncludeBody =
wrapHeight - formHeight - headerCellHeight - tablePadding - paginationMargin
} else { } else {
// Table height from bottom // Table height from bottom
bottomIncludeBody = getViewportOffset(headEl).bottomIncludeBody bottomIncludeBody = getViewportOffset(headEl).bottomIncludeBody
......
...@@ -136,12 +136,7 @@ export const basicProps = { ...@@ -136,12 +136,7 @@ export const basicProps = {
}, },
beforeEditSubmit: { beforeEditSubmit: {
type: Function as PropType< type: Function as PropType<
(data: { (data: { record: Recordable; index: number; key: string | number; value: any }) => Promise<any>
record: Recordable
index: number
key: string | number
value: any
}) => Promise<any>
>, >,
}, },
size: { size: {
......
...@@ -71,10 +71,7 @@ export interface ColumnProps<T> { ...@@ -71,10 +71,7 @@ export interface ColumnProps<T> {
* Customized filter overlay * Customized filter overlay
* @type any (slot) * @type any (slot)
*/ */
filterDropdown?: filterDropdown?: VNodeChild | JSX.Element | ((props: FilterDropdownProps) => VNodeChild | JSX.Element)
| VNodeChild
| JSX.Element
| ((props: FilterDropdownProps) => VNodeChild | JSX.Element)
/** /**
* Whether filterDropdown is visible * Whether filterDropdown is visible
......
...@@ -373,12 +373,7 @@ export interface BasicTableProps<T = any> { ...@@ -373,12 +373,7 @@ export interface BasicTableProps<T = any> {
* *
* The cell will not submit data while callback return false * The cell will not submit data while callback return false
*/ */
beforeEditSubmit?: (data: { beforeEditSubmit?: (data: { record: Recordable; index: number; key: string | number; value: any }) => Promise<any>
record: Recordable
index: number
key: string | number
value: any
}) => Promise<any>
/** /**
* Callback executed when pagination, filters or sorter is changed * Callback executed when pagination, filters or sorter is changed
...@@ -417,11 +412,7 @@ export interface BasicColumn extends ColumnProps<Recordable> { ...@@ -417,11 +412,7 @@ export interface BasicColumn extends ColumnProps<Recordable> {
filters?: { filters?: {
text: string text: string
value: string value: string
children?: children?: unknown[] | (((props: Record<string, unknown>) => unknown[]) & (() => unknown[]) & (() => unknown[]))
| unknown[]
| (((props: Record<string, unknown>) => unknown[]) &
(() => unknown[]) &
(() => unknown[]))
}[] }[]
// //
......
...@@ -17,11 +17,7 @@ ...@@ -17,11 +17,7 @@
export default defineComponent({ export default defineComponent({
name: 'Time', name: 'Time',
props: { props: {
value: propTypes.oneOfType([ value: propTypes.oneOfType([propTypes.number, propTypes.instanceOf(Date), propTypes.string]).isRequired,
propTypes.number,
propTypes.instanceOf(Date),
propTypes.string,
]).isRequired,
step: propTypes.number.def(60), step: propTypes.number.def(60),
mode: propTypes.oneOf(['date', 'datetime', 'relative']).def('relative'), mode: propTypes.oneOf(['date', 'datetime', 'relative']).def('relative'),
}, },
......
...@@ -8,12 +8,7 @@ ...@@ -8,12 +8,7 @@
v-show="editorRef" v-show="editorRef"
:disabled="disabled" :disabled="disabled"
/> />
<textarea <textarea :id="tinymceId" ref="elRef" :style="{ visibility: 'hidden' }" v-if="!initOptions.inline"></textarea>
:id="tinymceId"
ref="elRef"
:style="{ visibility: 'hidden' }"
v-if="!initOptions.inline"
></textarea>
<slot v-else></slot> <slot v-else></slot>
</div> </div>
</template> </template>
...@@ -53,16 +48,7 @@ ...@@ -53,16 +48,7 @@
import 'tinymce/plugins/visualchars' import 'tinymce/plugins/visualchars'
import 'tinymce/plugins/wordcount' import 'tinymce/plugins/wordcount'
import { import { defineComponent, computed, nextTick, ref, unref, watch, onDeactivated, onBeforeUnmount } from 'vue'
defineComponent,
computed,
nextTick,
ref,
unref,
watch,
onDeactivated,
onBeforeUnmount,
} from 'vue'
import ImgUpload from './ImgUpload.vue' import ImgUpload from './ImgUpload.vue'
import { toolbar, plugins } from './tinymce' import { toolbar, plugins } from './tinymce'
import { buildShortUUID } from '/@/utils/uuid' import { buildShortUUID } from '/@/utils/uuid'
...@@ -162,11 +148,7 @@ ...@@ -162,11 +148,7 @@
auto_focus: true, auto_focus: true,
skin: skinName.value, skin: skinName.value,
skin_url: publicPath + 'resource/tinymce/skins/ui/' + skinName.value, skin_url: publicPath + 'resource/tinymce/skins/ui/' + skinName.value,
content_css: content_css: publicPath + 'resource/tinymce/skins/ui/' + skinName.value + '/content.min.css',
publicPath +
'resource/tinymce/skins/ui/' +
skinName.value +
'/content.min.css',
...options, ...options,
setup: (editor: Editor) => { setup: (editor: Editor) => {
editorRef.value = editor editorRef.value = editor
...@@ -261,9 +243,7 @@ ...@@ -261,9 +243,7 @@
function bindModelHandlers(editor: any) { function bindModelHandlers(editor: any) {
const modelEvents = attrs.modelEvents ? attrs.modelEvents : null const modelEvents = attrs.modelEvents ? attrs.modelEvents : null
const normalizedEvents = Array.isArray(modelEvents) const normalizedEvents = Array.isArray(modelEvents) ? modelEvents.join(' ') : modelEvents
? modelEvents.join(' ')
: modelEvents
watch( watch(
() => props.modelValue, () => props.modelValue,
......
...@@ -16,12 +16,6 @@ export const SlideXReverseTransition = createSimpleTransition('slide-x-reverse-t ...@@ -16,12 +16,6 @@ export const SlideXReverseTransition = createSimpleTransition('slide-x-reverse-t
export const ScrollXReverseTransition = createSimpleTransition('scroll-x-reverse-transition') export const ScrollXReverseTransition = createSimpleTransition('scroll-x-reverse-transition')
export const ScaleRotateTransition = createSimpleTransition('scale-rotate-transition') export const ScaleRotateTransition = createSimpleTransition('scale-rotate-transition')
export const ExpandXTransition = createJavascriptTransition( export const ExpandXTransition = createJavascriptTransition('expand-x-transition', ExpandTransitionGenerator('', true))
'expand-x-transition',
ExpandTransitionGenerator('', true),
)
export const ExpandTransition = createJavascriptTransition( export const ExpandTransition = createJavascriptTransition('expand-transition', ExpandTransitionGenerator(''))
'expand-transition',
ExpandTransitionGenerator(''),
)
...@@ -38,11 +38,7 @@ export function createSimpleTransition(name: string, origin = 'top center 0', mo ...@@ -38,11 +38,7 @@ export function createSimpleTransition(name: string, origin = 'top center 0', mo
}, },
}) })
} }
export function createJavascriptTransition( export function createJavascriptTransition(name: string, functions: Recordable, mode: Mode = 'in-out') {
name: string,
functions: Recordable,
mode: Mode = 'in-out',
) {
return defineComponent({ return defineComponent({
name, name,
props: { props: {
......
<script lang="tsx"> <script lang="tsx">
import type { CSSProperties } from 'vue' import type { CSSProperties } from 'vue'
import type { import type { FieldNames, TreeState, TreeItem, KeyType, CheckKeys, TreeActionType } from './tree'
FieldNames,
TreeState, import { defineComponent, reactive, computed, unref, ref, watchEffect, toRaw, watch, onMounted } from 'vue'
TreeItem,
KeyType,
CheckKeys,
TreeActionType,
} from './tree'
import {
defineComponent,
reactive,
computed,
unref,
ref,
watchEffect,
toRaw,
watch,
onMounted,
} from 'vue'
import TreeHeader from './TreeHeader.vue' import TreeHeader from './TreeHeader.vue'
import { Tree, Empty } from 'ant-design-vue' import { Tree, Empty } from 'ant-design-vue'
import { TreeIcon } from './TreeIcon' import { TreeIcon } from './TreeIcon'
...@@ -91,10 +74,7 @@ ...@@ -91,10 +74,7 @@
let currentValue = toRaw(state.checkedKeys) as KeyType[] let currentValue = toRaw(state.checkedKeys) as KeyType[]
if (isArray(currentValue) && searchState.startSearch) { if (isArray(currentValue) && searchState.startSearch) {
const { key } = unref(getFieldNames) const { key } = unref(getFieldNames)
currentValue = difference( currentValue = difference(currentValue, getChildrenKeys(e.node.$attrs.node[key]))
currentValue,
getChildrenKeys(e.node.$attrs.node[key]),
)
if (e.checked) { if (e.checked) {
currentValue.push(e.node.$attrs.node[key]) currentValue.push(e.node.$attrs.node[key])
} }
...@@ -221,8 +201,7 @@ ...@@ -221,8 +201,7 @@
searchState.startSearch = false searchState.startSearch = false
return return
} }
const { filterFn, checkable, expandOnSearch, checkOnSearch, selectedOnSearch } = const { filterFn, checkable, expandOnSearch, checkOnSearch, selectedOnSearch } = unref(props)
unref(props)
searchState.startSearch = true searchState.startSearch = true
const { title: titleField, key: keyField } = unref(getFieldNames) const { title: titleField, key: keyField } = unref(getFieldNames)
...@@ -368,21 +347,13 @@ ...@@ -368,21 +347,13 @@
eachTree(data, (item, _parent) => { eachTree(data, (item, _parent) => {
const searchText = searchState.searchText const searchText = searchState.searchText
const { highlight } = unref(props) const { highlight } = unref(props)
const { const { title: titleField, key: keyField, children: childrenField } = unref(getFieldNames)
title: titleField,
key: keyField,
children: childrenField,
} = unref(getFieldNames)
const icon = getIcon(item, item.icon) const icon = getIcon(item, item.icon)
const title = get(item, titleField) const title = get(item, titleField)
const searchIdx = searchText ? title.indexOf(searchText) : -1 const searchIdx = searchText ? title.indexOf(searchText) : -1
const isHighlight = const isHighlight = searchState.startSearch && !isEmpty(searchText) && highlight && searchIdx !== -1
searchState.startSearch &&
!isEmpty(searchText) &&
highlight &&
searchIdx !== -1
const highlightStyle = `color: ${isBoolean(highlight) ? '#f50' : highlight}` const highlightStyle = `color: ${isBoolean(highlight) ? '#f50' : highlight}`
const titleDom = isHighlight ? ( const titleDom = isHighlight ? (
...@@ -397,11 +368,7 @@ ...@@ -397,11 +368,7 @@
item.title = ( item.title = (
<span <span
class={`${bem('title')} pl-2`} class={`${bem('title')} pl-2`}
onClick={handleClickNode.bind( onClick={handleClickNode.bind(null, item[keyField], item[childrenField])}
null,
item[keyField],
item[childrenField],
)}
> >
{slots?.title ? ( {slots?.title ? (
getSlot(slots, 'title', item) getSlot(slots, 'title', item)
...@@ -444,17 +411,9 @@ ...@@ -444,17 +411,9 @@
</TreeHeader> </TreeHeader>
)} )}
<ScrollContainer style={scrollStyle} v-show={!unref(getNotFound)}> <ScrollContainer style={scrollStyle} v-show={!unref(getNotFound)}>
<Tree <Tree {...unref(getBindValues)} showIcon={false} treeData={treeData.value} />
{...unref(getBindValues)}
showIcon={false}
treeData={treeData.value}
/>
</ScrollContainer> </ScrollContainer>
<Empty <Empty v-show={unref(getNotFound)} image={Empty.PRESENTED_IMAGE_SIMPLE} class="!mt-4" />
v-show={unref(getNotFound)}
image={Empty.PRESENTED_IMAGE_SIMPLE}
class="!mt-4"
/>
</div> </div>
) )
} }
......
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
<BasicTitle :helpMessage="helpMessage" v-if="!slots.headerTitle && title"> <BasicTitle :helpMessage="helpMessage" v-if="!slots.headerTitle && title">
{{ title }} {{ title }}
</BasicTitle> </BasicTitle>
<div <div class="flex items-center flex-1 cursor-pointer justify-self-stretch" v-if="search || toolbar">
class="flex items-center flex-1 cursor-pointer justify-self-stretch"
v-if="search || toolbar"
>
<div :class="getInputSearchCls" v-if="search"> <div :class="getInputSearchCls" v-if="search">
<InputSearch <InputSearch
:placeholder="t('common.searchText')" :placeholder="t('common.searchText')"
......
...@@ -36,9 +36,7 @@ export interface FieldNames { ...@@ -36,9 +36,7 @@ export interface FieldNames {
export type KeyType = string | number export type KeyType = string | number
export type CheckKeys = export type CheckKeys = KeyType[] | { checked: string[] | number[]; halfChecked: string[] | number[] }
| KeyType[]
| { checked: string[] | number[]; halfChecked: string[] | number[] }
export const treeProps = buildProps({ export const treeProps = buildProps({
value: { value: {
...@@ -114,9 +112,7 @@ export const treeProps = buildProps({ ...@@ -114,9 +112,7 @@ export const treeProps = buildProps({
}, },
// 自定义数据过滤判断方法(注: 不是整个过滤方法,而是内置过滤的判断方法,用于增强原本仅能通过title进行过滤的方式) // 自定义数据过滤判断方法(注: 不是整个过滤方法,而是内置过滤的判断方法,用于增强原本仅能通过title进行过滤的方式)
filterFn: { filterFn: {
type: Function as PropType< type: Function as PropType<(searchValue: any, node: TreeItem, fieldNames: FieldNames) => boolean>,
(searchValue: any, node: TreeItem, fieldNames: FieldNames) => boolean
>,
default: undefined, default: undefined,
}, },
// 高亮搜索值,仅高亮具体匹配值(通过title)值为true时使用默认色值,值为#xxx时使用此值替代且高亮开启 // 高亮搜索值,仅高亮具体匹配值(通过title)值为true时使用默认色值,值为#xxx时使用此值替代且高亮开启
......
...@@ -49,17 +49,10 @@ ...@@ -49,17 +49,10 @@
return ( return (
<tr class="file-table-tr" key={`${index + record.name || ''}`}> <tr class="file-table-tr" key={`${index + record.name || ''}`}>
{columnList.map((item) => { {columnList.map((item) => {
const { const { dataIndex = '', customRender, align = 'center' } = item
dataIndex = '',
customRender,
align = 'center',
} = item
const render = customRender && isFunction(customRender) const render = customRender && isFunction(customRender)
return ( return (
<td <td class={['file-table-td', align]} key={dataIndex}>
class={['file-table-td', align]}
key={dataIndex}
>
{render {render
? customRender?.({ ? customRender?.({
text: record[dataIndex], text: record[dataIndex],
......
...@@ -14,12 +14,7 @@ ...@@ -14,12 +14,7 @@
:cancelButtonProps="{ disabled: isUploadingRef }" :cancelButtonProps="{ disabled: isUploadingRef }"
> >
<template #centerFooter> <template #centerFooter>
<a-button <a-button @click="handleStartUpload" color="success" :disabled="!getIsSelectFile" :loading="isUploadingRef">
@click="handleStartUpload"
color="success"
:disabled="!getIsSelectFile"
:loading="isUploadingRef"
>
{{ getUploadBtnText }} {{ getUploadBtnText }}
</a-button> </a-button>
</template> </template>
...@@ -102,19 +97,14 @@ ...@@ -102,19 +97,14 @@
}) })
const getOkButtonProps = computed(() => { const getOkButtonProps = computed(() => {
const someSuccess = fileListRef.value.some( const someSuccess = fileListRef.value.some((item) => item.status === UploadResultStatus.SUCCESS)
(item) => item.status === UploadResultStatus.SUCCESS,
)
return { return {
disabled: disabled: isUploadingRef.value || fileListRef.value.length === 0 || !someSuccess,
isUploadingRef.value || fileListRef.value.length === 0 || !someSuccess,
} }
}) })
const getUploadBtnText = computed(() => { const getUploadBtnText = computed(() => {
const someError = fileListRef.value.some( const someError = fileListRef.value.some((item) => item.status === UploadResultStatus.ERROR)
(item) => item.status === UploadResultStatus.ERROR,
)
return isUploadingRef.value return isUploadingRef.value
? t('component.upload.uploading') ? t('component.upload.uploading')
: someError : someError
...@@ -191,8 +181,7 @@ ...@@ -191,8 +181,7 @@
filename: props.filename, filename: props.filename,
}, },
function onUploadProgress(progressEvent: ProgressEvent) { function onUploadProgress(progressEvent: ProgressEvent) {
const complete = const complete = ((progressEvent.loaded / progressEvent.total) * 100) | 0
((progressEvent.loaded / progressEvent.total) * 100) | 0
item.percent = complete item.percent = complete
}, },
) )
...@@ -222,9 +211,7 @@ ...@@ -222,9 +211,7 @@
isUploadingRef.value = true isUploadingRef.value = true
// 只上传不是成功状态的 // 只上传不是成功状态的
const uploadFileList = const uploadFileList =
fileListRef.value.filter( fileListRef.value.filter((item) => item.status !== UploadResultStatus.SUCCESS) || []
(item) => item.status !== UploadResultStatus.SUCCESS,
) || []
const data = await Promise.all( const data = await Promise.all(
uploadFileList.map((item) => { uploadFileList.map((item) => {
return uploadApiByItem(item) return uploadApiByItem(item)
......
...@@ -110,8 +110,7 @@ ...@@ -110,8 +110,7 @@
const actionEl = unref(actionElRef) const actionEl = unref(actionElRef)
if (!actionEl) return if (!actionEl) return
emit('start', e) emit('start', e)
state.moveDistance = state.moveDistance = getEventPageX(e) - parseInt(actionEl.style.left.replace('px', ''), 10)
getEventPageX(e) - parseInt(actionEl.style.left.replace('px', ''), 10)
state.startTime = new Date().getTime() state.startTime = new Date().getTime()
state.isMoving = true state.isMoving = true
} }
......
...@@ -65,15 +65,10 @@ ...@@ -65,15 +65,10 @@
const { imgWidth, height, maxDegree } = props const { imgWidth, height, maxDegree } = props
const { moveX } = data const { moveX } = data
const currentRotate = Math.ceil( const currentRotate = Math.ceil(
(moveX / (imgWidth! - parseInt(height as string))) * (moveX / (imgWidth! - parseInt(height as string))) * maxDegree! * unref(getFactorRef),
maxDegree! *
unref(getFactorRef),
) )
state.currentRotate = currentRotate state.currentRotate = currentRotate
state.imgStyle = hackCss( state.imgStyle = hackCss('transform', `rotateZ(${state.randomRotate - currentRotate}deg)`)
'transform',
`rotateZ(${state.randomRotate - currentRotate}deg)`,
)
} }
function handleImgOnLoad() { function handleImgOnLoad() {
...@@ -144,21 +139,14 @@ ...@@ -144,21 +139,14 @@
alt="verify" alt="verify"
/> />
{state.showTip && ( {state.showTip && (
<span <span class={[`ir-dv-img__tip`, state.isPassing ? 'success' : 'error']}>
class={[
`ir-dv-img__tip`,
state.isPassing ? 'success' : 'error',
]}
>
{state.isPassing {state.isPassing
? t('component.verify.time', { time: time.toFixed(1) }) ? t('component.verify.time', { time: time.toFixed(1) })
: t('component.verify.error')} : t('component.verify.error')}
</span> </span>
)} )}
{!state.showTip && !state.draged && ( {!state.showTip && !state.draged && (
<span class={[`ir-dv-img__tip`, 'normal']}> <span class={[`ir-dv-img__tip`, 'normal']}>{t('component.verify.redoTip')}</span>
{t('component.verify.redoTip')}
</span>
)} )}
</div> </div>
<BasicDragVerify <BasicDragVerify
......
<script lang="tsx"> <script lang="tsx">
import { import { defineComponent, computed, ref, unref, reactive, onMounted, watch, nextTick, CSSProperties } from 'vue'
defineComponent,
computed,
ref,
unref,
reactive,
onMounted,
watch,
nextTick,
CSSProperties,
} from 'vue'
import { useEventListener } from '/@/hooks/event/useEventListener' import { useEventListener } from '/@/hooks/event/useEventListener'
import { getSlot } from '/@/utils/helper/tsxHelper' import { getSlot } from '/@/utils/helper/tsxHelper'
...@@ -38,10 +28,7 @@ ...@@ -38,10 +28,7 @@
const prefixCls = 'virtual-scroll' const prefixCls = 'virtual-scroll'
function convertToUnit( function convertToUnit(str: string | number | null | undefined, unit = 'px'): string | undefined {
str: string | number | null | undefined,
unit = 'px',
): string | undefined {
if (str == null || str === '') { if (str == null || str === '') {
return undefined return undefined
} else if (isNaN(+str!)) { } else if (isNaN(+str!)) {
...@@ -132,9 +119,7 @@ ...@@ -132,9 +119,7 @@
function renderChildren() { function renderChildren() {
const { items = [] } = props const { items = [] } = props
return items return items.slice(unref(getFirstToRenderRef), unref(getLastToRenderRef)).map(genChild)
.slice(unref(getFirstToRenderRef), unref(getLastToRenderRef))
.map(genChild)
} }
function genChild(item: any, index: number) { function genChild(item: any, index: number) {
......
...@@ -33,13 +33,12 @@ html[data-theme='light'] { ...@@ -33,13 +33,12 @@ html[data-theme='light'] {
} }
.ant-card-grid-hoverable:hover { .ant-card-grid-hoverable:hover {
box-shadow: 0 3px 6px -4px rgb(0 0 0 / 48%), 0 6px 16px 0 rgb(0 0 0 / 32%), box-shadow: 0 3px 6px -4px rgb(0 0 0 / 48%), 0 6px 16px 0 rgb(0 0 0 / 32%), 0 9px 28px 8px rgb(0 0 0 / 20%);
0 9px 28px 8px rgb(0 0 0 / 20%);
} }
.ant-card-grid { .ant-card-grid {
box-shadow: 1px 0 0 0 #434343, 0 1px 0 0 #434343, 1px 1px 0 0 #434343, box-shadow: 1px 0 0 0 #434343, 0 1px 0 0 #434343, 1px 1px 0 0 #434343, 1px 0 0 0 #434343 inset,
1px 0 0 0 #434343 inset, 0 1px 0 0 #434343 inset; 0 1px 0 0 #434343 inset;
} }
.ant-calendar-selected-day .ant-calendar-date { .ant-calendar-selected-day .ant-calendar-date {
......
...@@ -6,6 +6,5 @@ ...@@ -6,6 +6,5 @@
@import './zoom.less'; @import './zoom.less';
.collapse-transition { .collapse-transition {
transition: 0.2s height ease-in-out, 0.2s padding-top ease-in-out, transition: 0.2s height ease-in-out, 0.2s padding-top ease-in-out, 0.2s padding-bottom ease-in-out;
0.2s padding-bottom ease-in-out;
} }
...@@ -51,14 +51,7 @@ function createDocumentHandler(el: HTMLElement, binding: DirectiveBinding): Docu ...@@ -51,14 +51,7 @@ function createDocumentHandler(el: HTMLElement, binding: DirectiveBinding): Docu
(excludes.length && excludes.includes(mouseDownTarget as HTMLElement)) (excludes.length && excludes.includes(mouseDownTarget as HTMLElement))
const isContainedByPopper = const isContainedByPopper =
popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget)) popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget))
if ( if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
isBound ||
isTargetExists ||
isContainedByEl ||
isSelf ||
isTargetExcluded ||
isContainedByPopper
) {
return return
} }
binding.value() binding.value()
......
...@@ -46,12 +46,7 @@ const RippleDirective: Directive & RippleProto = { ...@@ -46,12 +46,7 @@ const RippleDirective: Directive & RippleProto = {
}, },
} }
function rippler({ function rippler({ event, el, zIndex, background }: { event: EventType; el: HTMLElement } & RippleProto) {
event,
el,
zIndex,
background,
}: { event: EventType; el: HTMLElement } & RippleProto) {
const targetBorder = parseInt(getComputedStyle(el).borderWidth.replace('px', '')) const targetBorder = parseInt(getComputedStyle(el).borderWidth.replace('px', ''))
const clientX = event.clientX || event.touches[0].clientX const clientX = event.clientX || event.touches[0].clientX
const clientY = event.clientY || event.touches[0].clientY const clientY = event.clientY || event.touches[0].clientY
...@@ -99,8 +94,7 @@ function rippler({ ...@@ -99,8 +94,7 @@ function rippler({
overflow: 'hidden', overflow: 'hidden',
}) })
const storedTargetPosition = const storedTargetPosition = el.style.position.length > 0 ? el.style.position : getComputedStyle(el).position
el.style.position.length > 0 ? el.style.position : getComputedStyle(el).position
if (storedTargetPosition !== 'relative') { if (storedTargetPosition !== 'relative') {
el.style.position = 'relative' el.style.position = 'relative'
...@@ -114,12 +108,7 @@ function rippler({ ...@@ -114,12 +108,7 @@ function rippler({
marginLeft: `${dx}px`, marginLeft: `${dx}px`,
}) })
const { const { borderTopLeftRadius, borderTopRightRadius, borderBottomLeftRadius, borderBottomRightRadius } = style
borderTopLeftRadius,
borderTopRightRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
} = style
Object.assign(rippleContainer.style, { Object.assign(rippleContainer.style, {
width: `${width}px`, width: `${width}px`,
height: `${height}px`, height: `${height}px`,
......
import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue' import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue'
import { import { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, nextTick, toRaw } from 'vue'
reactive,
readonly,
computed,
getCurrentInstance,
watchEffect,
unref,
nextTick,
toRaw,
} from 'vue'
import { isEqual } from 'lodash-es' import { isEqual } from 'lodash-es'
......
...@@ -18,11 +18,7 @@ type ShallowUnwrap<T> = { ...@@ -18,11 +18,7 @@ type ShallowUnwrap<T> = {
[P in keyof T]: UnwrapRef<T[P]> [P in keyof T]: UnwrapRef<T[P]>
} }
export function createContext<T>( export function createContext<T>(context: any, key: InjectionKey<T> = Symbol(), options: CreateContextOptions = {}) {
context: any,
key: InjectionKey<T> = Symbol(),
options: CreateContextOptions = {},
) {
const { readonly = true, createProvider = false, native = false } = options const { readonly = true, createProvider = false, native = false } = options
const state = reactive(context) const state = reactive(context)
...@@ -37,9 +33,6 @@ export function createContext<T>( ...@@ -37,9 +33,6 @@ export function createContext<T>(
export function useContext<T>(key: InjectionKey<T>, native?: boolean): T export function useContext<T>(key: InjectionKey<T>, native?: boolean): T
export function useContext<T>(key: InjectionKey<T>, defaultValue?: any, native?: boolean): T export function useContext<T>(key: InjectionKey<T>, defaultValue?: any, native?: boolean): T
export function useContext<T>( export function useContext<T>(key: InjectionKey<T> = Symbol(), defaultValue?: any): ShallowUnwrap<T> {
key: InjectionKey<T> = Symbol(),
defaultValue?: any,
): ShallowUnwrap<T> {
return inject(key, defaultValue || {}) return inject(key, defaultValue || {})
} }
...@@ -28,20 +28,12 @@ export function useHeaderSetting() { ...@@ -28,20 +28,12 @@ export function useHeaderSetting() {
const getShowInsetHeaderRef = computed(() => { const getShowInsetHeaderRef = computed(() => {
const need = !unref(getFullContent) && unref(getShowHeader) const need = !unref(getFullContent) && unref(getShowHeader)
return ( return (
(need && !unref(getShowMixHeaderRef)) || (need && !unref(getShowMixHeaderRef)) || (need && unref(getIsTopMenu)) || (need && unref(getIsMixSidebar))
(need && unref(getIsTopMenu)) ||
(need && unref(getIsMixSidebar))
) )
}) })
const { const { getMenuMode, getSplit, getShowHeaderTrigger, getIsSidebarType, getIsMixSidebar, getIsTopMenu } =
getMenuMode, useMenuSetting()
getSplit,
getShowHeaderTrigger,
getIsSidebarType,
getIsMixSidebar,
getIsTopMenu,
} = useMenuSetting()
const { getShowBreadCrumb, getShowLogo } = useRootSetting() const { getShowBreadCrumb, getShowLogo } = useRootSetting()
const getShowMixHeaderRef = computed(() => !unref(getIsSidebarType) && unref(getShowHeader)) const getShowMixHeaderRef = computed(() => !unref(getIsSidebarType) && unref(getShowHeader))
...@@ -65,11 +57,7 @@ export function useHeaderSetting() { ...@@ -65,11 +57,7 @@ export function useHeaderSetting() {
const getShowNotice = computed(() => appStore.getHeaderSetting.showNotice) const getShowNotice = computed(() => appStore.getHeaderSetting.showNotice)
const getShowBread = computed(() => { const getShowBread = computed(() => {
return ( return unref(getMenuMode) !== MenuModeEnum.HORIZONTAL && unref(getShowBreadCrumb) && !unref(getSplit)
unref(getMenuMode) !== MenuModeEnum.HORIZONTAL &&
unref(getShowBreadCrumb) &&
!unref(getSplit)
)
}) })
const getShowHeaderLogo = computed(() => { const getShowHeaderLogo = computed(() => {
......
...@@ -17,9 +17,7 @@ export function useMenuSetting() { ...@@ -17,9 +17,7 @@ export function useMenuSetting() {
const getShowSidebar = computed(() => { const getShowSidebar = computed(() => {
return ( return (
unref(getSplit) || unref(getSplit) ||
(unref(getShowMenu) && (unref(getShowMenu) && unref(getMenuMode) !== MenuModeEnum.HORIZONTAL && !unref(fullContent))
unref(getMenuMode) !== MenuModeEnum.HORIZONTAL &&
!unref(fullContent))
) )
}) })
...@@ -55,9 +53,7 @@ export function useMenuSetting() { ...@@ -55,9 +53,7 @@ export function useMenuSetting() {
const getTopMenuAlign = computed(() => appStore.getMenuSetting.topMenuAlign) const getTopMenuAlign = computed(() => appStore.getMenuSetting.topMenuAlign)
const getCloseMixSidebarOnChange = computed( const getCloseMixSidebarOnChange = computed(() => appStore.getMenuSetting.closeMixSidebarOnChange)
() => appStore.getMenuSetting.closeMixSidebarOnChange,
)
const getIsSidebarType = computed(() => unref(getMenuType) === MenuTypeEnum.SIDEBAR) const getIsSidebarType = computed(() => unref(getMenuType) === MenuTypeEnum.SIDEBAR)
...@@ -70,11 +66,7 @@ export function useMenuSetting() { ...@@ -70,11 +66,7 @@ export function useMenuSetting() {
}) })
const getShowHeaderTrigger = computed(() => { const getShowHeaderTrigger = computed(() => {
if ( if (unref(getMenuType) === MenuTypeEnum.TOP_MENU || !unref(getShowMenu) || unref(getMenuHidden)) {
unref(getMenuType) === MenuTypeEnum.TOP_MENU ||
!unref(getShowMenu) ||
unref(getMenuHidden)
) {
return false return false
} }
...@@ -95,9 +87,7 @@ export function useMenuSetting() { ...@@ -95,9 +87,7 @@ export function useMenuSetting() {
const getRealWidth = computed(() => { const getRealWidth = computed(() => {
if (unref(getIsMixSidebar)) { if (unref(getIsMixSidebar)) {
return unref(getCollapsed) && !unref(getMixSideFixed) return unref(getCollapsed) && !unref(getMixSideFixed) ? unref(getMiniWidthNumber) : unref(getMenuWidth)
? unref(getMiniWidthNumber)
: unref(getMenuWidth)
} }
return unref(getCollapsed) ? unref(getMiniWidthNumber) : unref(getMenuWidth) return unref(getCollapsed) ? unref(getMiniWidthNumber) : unref(getMenuWidth)
}) })
......
...@@ -5,10 +5,7 @@ import { computed } from 'vue' ...@@ -5,10 +5,7 @@ import { computed } from 'vue'
import { useAppStore } from '/@/store/modules/app' import { useAppStore } from '/@/store/modules/app'
import { ContentEnum, ThemeEnum } from '/@/enums/appEnum' import { ContentEnum, ThemeEnum } from '/@/enums/appEnum'
type RootSetting = Omit< type RootSetting = Omit<ProjectConfig, 'locale' | 'headerSetting' | 'menuSetting' | 'multiTabsSetting'>
ProjectConfig,
'locale' | 'headerSetting' | 'menuSetting' | 'multiTabsSetting'
>
export function useRootSetting() { export function useRootSetting() {
const appStore = useAppStore() const appStore = useAppStore()
...@@ -54,9 +51,7 @@ export function useRootSetting() { ...@@ -54,9 +51,7 @@ export function useRootSetting() {
const getDarkMode = computed(() => appStore.getDarkMode) const getDarkMode = computed(() => appStore.getDarkMode)
const getLayoutContentMode = computed(() => const getLayoutContentMode = computed(() =>
appStore.getProjectConfig.contentMode === ContentEnum.FULL appStore.getProjectConfig.contentMode === ContentEnum.FULL ? ContentEnum.FULL : ContentEnum.FIXED,
? ContentEnum.FULL
: ContentEnum.FIXED,
) )
function setRootSetting(setting: Partial<RootSetting>) { function setRootSetting(setting: Partial<RootSetting>) {
......
...@@ -115,10 +115,7 @@ export function useContentHeight( ...@@ -115,10 +115,7 @@ export function useContentHeight(
// upwardSpace // upwardSpace
let upwardSpaceHeight = 0 let upwardSpaceHeight = 0
function upward( function upward(element: Element | null, upwardLvlOrClass: number | string | null | undefined) {
element: Element | null,
upwardLvlOrClass: number | string | null | undefined,
) {
if (element && upwardLvlOrClass) { if (element && upwardLvlOrClass) {
const parent = element.parentElement const parent = element.parentElement
if (parent) { if (parent) {
......
...@@ -9,10 +9,7 @@ import { useBreakpoint } from '/@/hooks/event/useBreakpoint' ...@@ -9,10 +9,7 @@ import { useBreakpoint } from '/@/hooks/event/useBreakpoint'
import echarts from '/@/utils/lib/echarts' import echarts from '/@/utils/lib/echarts'
import { useRootSetting } from '/@/hooks/setting/useRootSetting' import { useRootSetting } from '/@/hooks/setting/useRootSetting'
export function useECharts( export function useECharts(elRef: Ref<HTMLDivElement>, theme: 'light' | 'dark' | 'default' = 'default') {
elRef: Ref<HTMLDivElement>,
theme: 'light' | 'dark' | 'default' = 'default',
) {
const { getDarkMode: getSysDarkMode } = useRootSetting() const { getDarkMode: getSysDarkMode } = useRootSetting()
const getDarkMode = computed(() => { const getDarkMode = computed(() => {
......
...@@ -20,10 +20,7 @@ export function useGo(_router?: Router) { ...@@ -20,10 +20,7 @@ export function useGo(_router?: Router) {
router = useRouter() router = useRouter()
} }
const { push, replace } = _router || router const { push, replace } = _router || router
function go( function go(opt: PageEnum | RouteLocationRawEx | string = PageEnum.BASE_HOME, isReplace = false) {
opt: PageEnum | RouteLocationRawEx | string = PageEnum.BASE_HOME,
isReplace = false,
) {
if (!opt) { if (!opt) {
return return
} }
......
...@@ -87,9 +87,7 @@ export function usePermission() { ...@@ -87,9 +87,7 @@ export function usePermission() {
*/ */
async function changeRole(roles: RoleEnum | RoleEnum[]): Promise<void> { async function changeRole(roles: RoleEnum | RoleEnum[]): Promise<void> {
if (projectSetting.permissionMode !== PermissionModeEnum.ROUTE_MAPPING) { if (projectSetting.permissionMode !== PermissionModeEnum.ROUTE_MAPPING) {
throw new Error( throw new Error('Please switch PermissionModeEnum to ROUTE_MAPPING mode in the configuration to operate!')
'Please switch PermissionModeEnum to ROUTE_MAPPING mode in the configuration to operate!',
)
} }
if (!isArray(roles)) { if (!isArray(roles)) {
......
...@@ -22,9 +22,7 @@ export function useTabs(_router?: Router) { ...@@ -22,9 +22,7 @@ export function useTabs(_router?: Router) {
function canIUseTabs(): boolean { function canIUseTabs(): boolean {
const { show } = appStore.getMultiTabsSetting const { show } = appStore.getMultiTabsSetting
if (!show) { if (!show) {
throw new Error( throw new Error('The multi-tab page is currently not open, please open it in the settings!')
'The multi-tab page is currently not open, please open it in the settings!',
)
} }
return !!show return !!show
} }
...@@ -100,7 +98,6 @@ export function useTabs(_router?: Router) { ...@@ -100,7 +98,6 @@ export function useTabs(_router?: Router) {
closeCurrent: () => handleTabAction(TableActionEnum.CLOSE_CURRENT), closeCurrent: () => handleTabAction(TableActionEnum.CLOSE_CURRENT),
close: (tab?: RouteLocationNormalized) => handleTabAction(TableActionEnum.CLOSE, tab), close: (tab?: RouteLocationNormalized) => handleTabAction(TableActionEnum.CLOSE, tab),
setTitle: (title: string, tab?: RouteLocationNormalized) => updateTabTitle(title, tab), setTitle: (title: string, tab?: RouteLocationNormalized) => updateTabTitle(title, tab),
updatePath: (fullPath: string, tab?: RouteLocationNormalized) => updatePath: (fullPath: string, tab?: RouteLocationNormalized) => updateTabPath(fullPath, tab),
updateTabPath(fullPath, tab),
} }
} }
...@@ -5,9 +5,7 @@ import { isDef } from '/@/utils/is' ...@@ -5,9 +5,7 @@ import { isDef } from '/@/utils/is'
const domSymbol = Symbol('watermark-dom') const domSymbol = Symbol('watermark-dom')
export function useWatermark( export function useWatermark(appendEl: Ref<HTMLElement | null> = ref(document.body) as Ref<HTMLElement>) {
appendEl: Ref<HTMLElement | null> = ref(document.body) as Ref<HTMLElement>,
) {
const func = useRafThrottle(function () { const func = useRafThrottle(function () {
const el = unref(appendEl) const el = unref(appendEl)
if (!el) return if (!el) return
......
<template> <template>
<div <div :class="[prefixCls, getLayoutContentMode]" v-loading="getOpenPageLoading && getPageLoading">
:class="[prefixCls, getLayoutContentMode]"
v-loading="getOpenPageLoading && getPageLoading"
>
<PageLayout /> <PageLayout />
</div> </div>
</template> </template>
......
...@@ -16,18 +16,12 @@ ...@@ -16,18 +16,12 @@
components: { components: {
BackTop, BackTop,
LayoutLockPage: createAsyncComponent(() => import('/@/views/sys/lock/index.vue')), LayoutLockPage: createAsyncComponent(() => import('/@/views/sys/lock/index.vue')),
SettingDrawer: createAsyncComponent( SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue')),
() => import('/@/layouts/default/setting/index.vue'),
),
SessionTimeoutLogin, SessionTimeoutLogin,
}, },
setup() { setup() {
const { const { getUseOpenBackTop, getShowSettingButton, getSettingButtonPosition, getFullContent } =
getUseOpenBackTop, useRootSetting()
getShowSettingButton,
getSettingButtonPosition,
getFullContent,
} = useRootSetting()
const userStore = useUserStoreWithOut() const userStore = useUserStoreWithOut()
const { prefixCls } = useDesign('setting-drawer-feature') const { prefixCls } = useDesign('setting-drawer-feature')
const { getShowHeader } = useHeaderSetting() const { getShowHeader } = useHeaderSetting()
......
...@@ -31,13 +31,8 @@ ...@@ -31,13 +31,8 @@
const { getCalcContentWidth, getSplit } = useMenuSetting() const { getCalcContentWidth, getSplit } = useMenuSetting()
const { getIsMobile } = useAppInject() const { getIsMobile } = useAppInject()
const { const { getFixed, getShowInsetHeaderRef, getShowFullHeaderRef, getHeaderTheme, getShowHeader } =
getFixed, useHeaderSetting()
getShowInsetHeaderRef,
getShowFullHeaderRef,
getHeaderTheme,
getShowHeader,
} = useHeaderSetting()
const { getFullContent } = useFullContent() const { getFullContent } = useFullContent()
......
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
const { toggle, isFullscreen } = useFullscreen() const { toggle, isFullscreen } = useFullscreen()
const getTitle = computed(() => { const getTitle = computed(() => {
return unref(isFullscreen) return unref(isFullscreen) ? t('layout.header.tooltipExitFull') : t('layout.header.tooltipEntryFull')
? t('layout.header.tooltipExitFull')
: t('layout.header.tooltipEntryFull')
}) })
return { return {
......
...@@ -13,11 +13,7 @@ ...@@ -13,11 +13,7 @@
<span v-if="item.list.length !== 0">({{ item.list.length }})</span> <span v-if="item.list.length !== 0">({{ item.list.length }})</span>
</template> </template>
<!-- 绑定title-click事件的通知列表中标题是“可点击”的--> <!-- 绑定title-click事件的通知列表中标题是“可点击”的-->
<NoticeList <NoticeList :list="item.list" v-if="item.key === '1'" @title-click="onNoticeClick" />
:list="item.list"
v-if="item.key === '1'"
@title-click="onNoticeClick"
/>
<NoticeList :list="item.list" v-else /> <NoticeList :list="item.list" v-else />
</TabPane> </TabPane>
</template> </template>
......
...@@ -24,11 +24,7 @@ ...@@ -24,11 +24,7 @@
:text="t('layout.header.tooltipLock')" :text="t('layout.header.tooltipLock')"
icon="ion:lock-closed-outline" icon="ion:lock-closed-outline"
/> />
<MenuItem <MenuItem key="logout" :text="t('layout.header.dropdownItemLoginOut')" icon="ion:power-outline" />
key="logout"
:text="t('layout.header.dropdownItemLoginOut')"
icon="ion:power-outline"
/>
</Menu> </Menu>
</template> </template>
</Dropdown> </Dropdown>
......
...@@ -10,10 +10,7 @@ ...@@ -10,10 +10,7 @@
:style="getLogoWidth" :style="getLogoWidth"
/> />
<LayoutTrigger <LayoutTrigger
v-if=" v-if="(getShowContent && getShowHeaderTrigger && !getSplit && !getIsMixSidebar) || getIsMobile"
(getShowContent && getShowHeaderTrigger && !getSplit && !getIsMixSidebar) ||
getIsMobile
"
:theme="getHeaderTheme" :theme="getHeaderTheme"
:sider="false" :sider="false"
/> />
...@@ -36,17 +33,11 @@ ...@@ -36,17 +33,11 @@
<div :class="`${prefixCls}-action`"> <div :class="`${prefixCls}-action`">
<AppSearch :class="`${prefixCls}-action__item `" v-if="getShowSearch" /> <AppSearch :class="`${prefixCls}-action__item `" v-if="getShowSearch" />
<ErrorAction <ErrorAction v-if="getUseErrorHandle" :class="`${prefixCls}-action__item error-action`" />
v-if="getUseErrorHandle"
:class="`${prefixCls}-action__item error-action`"
/>
<Notify v-if="getShowNotice" :class="`${prefixCls}-action__item notify-item`" /> <Notify v-if="getShowNotice" :class="`${prefixCls}-action__item notify-item`" />
<FullScreen <FullScreen v-if="getShowFullScreen" :class="`${prefixCls}-action__item fullscreen-item`" />
v-if="getShowFullScreen"
:class="`${prefixCls}-action__item fullscreen-item`"
/>
<AppLocalePicker <AppLocalePicker
v-if="getShowLocalePicker" v-if="getShowLocalePicker"
...@@ -102,28 +93,18 @@ ...@@ -102,28 +93,18 @@
Notify, Notify,
AppSearch, AppSearch,
ErrorAction, ErrorAction,
SettingDrawer: createAsyncComponent( SettingDrawer: createAsyncComponent(() => import('/@/layouts/default/setting/index.vue'), {
() => import('/@/layouts/default/setting/index.vue'),
{
loading: true, loading: true,
}, }),
),
}, },
props: { props: {
fixed: propTypes.bool, fixed: propTypes.bool,
}, },
setup(props) { setup(props) {
const { prefixCls } = useDesign('layout-header') const { prefixCls } = useDesign('layout-header')
const { const { getShowTopMenu, getShowHeaderTrigger, getSplit, getIsMixMode, getMenuWidth, getIsMixSidebar } =
getShowTopMenu, useMenuSetting()
getShowHeaderTrigger, const { getUseErrorHandle, getShowSettingButton, getSettingButtonPosition } = useRootSetting()
getSplit,
getIsMixMode,
getMenuWidth,
getIsMixSidebar,
} = useMenuSetting()
const { getUseErrorHandle, getShowSettingButton, getSettingButtonPosition } =
useRootSetting()
const { const {
getHeaderTheme, getHeaderTheme,
......
...@@ -33,9 +33,7 @@ ...@@ -33,9 +33,7 @@
export default defineComponent({ export default defineComponent({
name: 'DefaultLayout', name: 'DefaultLayout',
components: { components: {
LayoutFeatures: createAsyncComponent( LayoutFeatures: createAsyncComponent(() => import('/@/layouts/default/feature/index.vue')),
() => import('/@/layouts/default/feature/index.vue'),
),
LayoutFooter: createAsyncComponent(() => import('/@/layouts/default/footer/index.vue')), LayoutFooter: createAsyncComponent(() => import('/@/layouts/default/footer/index.vue')),
LayoutHeader, LayoutHeader,
LayoutContent, LayoutContent,
......
...@@ -161,9 +161,7 @@ ...@@ -161,9 +161,7 @@
<> <>
{renderHeader()} {renderHeader()}
{unref(getUseScroll) ? ( {unref(getUseScroll) ? (
<ScrollContainer style={unref(getWrapperStyle)}> <ScrollContainer style={unref(getWrapperStyle)}>{() => renderMenu()}</ScrollContainer>
{() => renderMenu()}
</ScrollContainer>
) : ( ) : (
renderMenu() renderMenu()
)} )}
......
...@@ -19,13 +19,9 @@ export function useSplitMenu(splitType: Ref<MenuSplitTyeEnum>) { ...@@ -19,13 +19,9 @@ export function useSplitMenu(splitType: Ref<MenuSplitTyeEnum>) {
const throttleHandleSplitLeftMenu = useThrottleFn(handleSplitLeftMenu, 50) const throttleHandleSplitLeftMenu = useThrottleFn(handleSplitLeftMenu, 50)
const splitNotLeft = computed( const splitNotLeft = computed(() => unref(splitType) !== MenuSplitTyeEnum.LEFT && !unref(getIsHorizontal))
() => unref(splitType) !== MenuSplitTyeEnum.LEFT && !unref(getIsHorizontal),
)
const getSplitLeft = computed( const getSplitLeft = computed(() => !unref(getSplit) || unref(splitType) !== MenuSplitTyeEnum.LEFT)
() => !unref(getSplit) || unref(splitType) !== MenuSplitTyeEnum.LEFT,
)
const getSpiltTop = computed(() => unref(splitType) === MenuSplitTyeEnum.TOP) const getSpiltTop = computed(() => unref(splitType) === MenuSplitTyeEnum.TOP)
......
import { defineComponent, computed, unref } from 'vue' import { defineComponent, computed, unref } from 'vue'
import { BasicDrawer } from '/@/components/Drawer/index' import { BasicDrawer } from '/@/components/Drawer/index'
import { Divider } from 'ant-design-vue' import { Divider } from 'ant-design-vue'
import { import { TypePicker, ThemeColorPicker, SettingFooter, SwitchItem, SelectItem, InputNumberItem } from './components'
TypePicker,
ThemeColorPicker,
SettingFooter,
SwitchItem,
SelectItem,
InputNumberItem,
} from './components'
import { AppDarkModeToggle } from '/@/components/Application' import { AppDarkModeToggle } from '/@/components/Application'
...@@ -33,11 +26,7 @@ import { ...@@ -33,11 +26,7 @@ import {
mixSidebarTriggerOptions, mixSidebarTriggerOptions,
} from './enum' } from './enum'
import { import { HEADER_PRESET_BG_COLOR_LIST, SIDE_BAR_BG_COLOR_LIST, APP_PRESET_COLOR_LIST } from '/@/settings/designSetting'
HEADER_PRESET_BG_COLOR_LIST,
SIDE_BAR_BG_COLOR_LIST,
APP_PRESET_COLOR_LIST,
} from '/@/settings/designSetting'
const { t } = useI18n() const { t } = useI18n()
...@@ -58,8 +47,7 @@ export default defineComponent({ ...@@ -58,8 +47,7 @@ export default defineComponent({
getThemeColor, getThemeColor,
} = useRootSetting() } = useRootSetting()
const { getOpenPageLoading, getBasicTransition, getEnableTransition, getOpenNProgress } = const { getOpenPageLoading, getBasicTransition, getEnableTransition, getOpenNProgress } = useTransitionSetting()
useTransitionSetting()
const { const {
getIsHorizontal, getIsHorizontal,
...@@ -82,15 +70,9 @@ export default defineComponent({ ...@@ -82,15 +70,9 @@ export default defineComponent({
getMixSideFixed, getMixSideFixed,
} = useMenuSetting() } = useMenuSetting()
const { const { getShowHeader, getFixed: getHeaderFixed, getHeaderBgColor, getShowSearch } = useHeaderSetting()
getShowHeader,
getFixed: getHeaderFixed,
getHeaderBgColor,
getShowSearch,
} = useHeaderSetting()
const { getShowMultipleTab, getShowQuick, getShowRedo, getShowFold } = const { getShowMultipleTab, getShowQuick, getShowRedo, getShowFold } = useMultipleTabSetting()
useMultipleTabSetting()
const getShowMenuRef = computed(() => { const getShowMenuRef = computed(() => {
return unref(getShowMenu) && !unref(getIsHorizontal) return unref(getShowMenu) && !unref(getIsHorizontal)
...@@ -207,9 +189,7 @@ export default defineComponent({ ...@@ -207,9 +189,7 @@ export default defineComponent({
title={t('layout.setting.collapseMenuDisplayName')} title={t('layout.setting.collapseMenuDisplayName')}
event={HandlerEnum.MENU_COLLAPSED_SHOW_TITLE} event={HandlerEnum.MENU_COLLAPSED_SHOW_TITLE}
def={unref(getCollapsedShowTitle)} def={unref(getCollapsedShowTitle)}
disabled={ disabled={!unref(getShowMenuRef) || !unref(getCollapsed) || unref(getIsMixSidebar)}
!unref(getShowMenuRef) || !unref(getCollapsed) || unref(getIsMixSidebar)
}
/> />
<SwitchItem <SwitchItem
...@@ -400,15 +380,8 @@ export default defineComponent({ ...@@ -400,15 +380,8 @@ export default defineComponent({
} }
return () => ( return () => (
<BasicDrawer <BasicDrawer {...attrs} title={t('layout.setting.drawerTitle')} width={330} class="setting-drawer">
{...attrs} {unref(getShowDarkModeToggle) && <Divider>{() => t('layout.setting.darkMode')}</Divider>}
title={t('layout.setting.drawerTitle')}
width={330}
class="setting-drawer"
>
{unref(getShowDarkModeToggle) && (
<Divider>{() => t('layout.setting.darkMode')}</Divider>
)}
{unref(getShowDarkModeToggle) && <AppDarkModeToggle class="mx-auto" />} {unref(getShowDarkModeToggle) && <AppDarkModeToggle class="mx-auto" />}
<Divider>{() => t('layout.setting.navMode')}</Divider> <Divider>{() => t('layout.setting.navMode')}</Divider>
{renderSidebar()} {renderSidebar()}
......
<template> <template>
<div :class="prefixCls"> <div :class="prefixCls">
<span> {{ title }}</span> <span> {{ title }}</span>
<InputNumber <InputNumber v-bind="$attrs" size="small" :class="`${prefixCls}-input-number`" @change="handleChange" />
v-bind="$attrs"
size="small"
:class="`${prefixCls}-input-number`"
@change="handleChange"
/>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
......
...@@ -46,9 +46,7 @@ ...@@ -46,9 +46,7 @@
setup(props) { setup(props) {
const { prefixCls } = useDesign('setting-select-item') const { prefixCls } = useDesign('setting-select-item')
const getBindValue = computed(() => { const getBindValue = computed(() => {
return props.def return props.def ? { value: props.def, defaultValue: props.initValue || props.def } : {}
? { value: props.def, defaultValue: props.initValue || props.def }
: {}
}) })
function handleChange(e: ChangeEvent) { function handleChange(e: ChangeEvent) {
......
...@@ -48,9 +48,7 @@ ...@@ -48,9 +48,7 @@
const appStore = useAppStore() const appStore = useAppStore()
function handleCopy() { function handleCopy() {
const { isSuccessRef } = useCopyToClipboard( const { isSuccessRef } = useCopyToClipboard(JSON.stringify(unref(appStore.getProjectConfig), null, 2))
JSON.stringify(unref(appStore.getProjectConfig), null, 2),
)
unref(isSuccessRef) && unref(isSuccessRef) &&
createSuccessModal({ createSuccessModal({
title: t('layout.setting.operatingTitle'), title: t('layout.setting.operatingTitle'),
......
import { ContentEnum, RouterTransitionEnum } from '/@/enums/appEnum' import { ContentEnum, RouterTransitionEnum } from '/@/enums/appEnum'
import { import { MenuModeEnum, MenuTypeEnum, TopMenuAlignEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum'
MenuModeEnum,
MenuTypeEnum,
TopMenuAlignEnum,
TriggerEnum,
MixSidebarTriggerEnum,
} from '/@/enums/menuEnum'
import { useI18n } from '/@/hooks/web/useI18n' import { useI18n } from '/@/hooks/web/useI18n'
......
<template> <template>
<div <div v-if="getMenuFixed && !getIsMobile" :style="getHiddenDomStyle" v-show="showClassSideBarRef"></div>
v-if="getMenuFixed && !getIsMobile"
:style="getHiddenDomStyle"
v-show="showClassSideBarRef"
></div>
<Sider <Sider
v-show="showClassSideBarRef" v-show="showClassSideBarRef"
ref="sideRef" ref="sideRef"
......
...@@ -62,18 +62,9 @@ ...@@ -62,18 +62,9 @@
/> />
</div> </div>
<ScrollContainer :class="`${prefixCls}-menu-list__content`"> <ScrollContainer :class="`${prefixCls}-menu-list__content`">
<SimpleMenu <SimpleMenu :items="childrenMenus" :theme="getMenuTheme" mixSider @menu-click="handleMenuClick" />
:items="childrenMenus"
:theme="getMenuTheme"
mixSider
@menu-click="handleMenuClick"
/>
</ScrollContainer> </ScrollContainer>
<div <div v-show="getShowDragBar && openMenu" :class="`${prefixCls}-drag-bar`" ref="dragBarRef"></div>
v-show="getShowDragBar && openMenu"
:class="`${prefixCls}-drag-bar`"
ref="dragBarRef"
></div>
</div> </div>
</div> </div>
</template> </template>
...@@ -260,9 +251,7 @@ ...@@ -260,9 +251,7 @@
activePath.value = await getCurrentParentPath(path) activePath.value = await getCurrentParentPath(path)
// hanldeModuleClick(parentPath); // hanldeModuleClick(parentPath);
if (unref(getIsMixSidebar)) { if (unref(getIsMixSidebar)) {
const activeMenu = unref(menuModules).find( const activeMenu = unref(menuModules).find((item) => item.path === unref(activePath))
(item) => item.path === unref(activePath),
)
const p = activeMenu?.path const p = activeMenu?.path
if (p) { if (p) {
const children = await getChildrenMenus(p) const children = await getChildrenMenus(p)
......
...@@ -36,9 +36,7 @@ export function useTrigger(getIsMobile: Ref<boolean>) { ...@@ -36,9 +36,7 @@ export function useTrigger(getIsMobile: Ref<boolean>) {
const trigger = unref(getTrigger) const trigger = unref(getTrigger)
return ( return (
trigger !== TriggerEnum.NONE && trigger !== TriggerEnum.NONE && !unref(getIsMobile) && (trigger === TriggerEnum.FOOTER || unref(getSplit))
!unref(getIsMobile) &&
(trigger === TriggerEnum.FOOTER || unref(getSplit))
) )
}) })
...@@ -104,9 +102,7 @@ export function useDragLine(siderRef: Ref<any>, dragBarRef: Ref<any>, mix = fals ...@@ -104,9 +102,7 @@ export function useDragLine(siderRef: Ref<any>, dragBarRef: Ref<any>, mix = fals
if (!mix) { if (!mix) {
const miniWidth = unref(getMiniWidthNumber) const miniWidth = unref(getMiniWidthNumber)
if (!unref(getCollapsed)) { if (!unref(getCollapsed)) {
width > miniWidth + 20 width > miniWidth + 20 ? setMenuSetting({ menuWidth: width }) : setMenuSetting({ collapsed: true })
? setMenuSetting({ menuWidth: width })
: setMenuSetting({ collapsed: true })
} else { } else {
width > miniWidth && setMenuSetting({ collapsed: false, menuWidth: width }) width > miniWidth && setMenuSetting({ collapsed: false, menuWidth: width })
} }
......
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
const getIsUnFold = computed(() => !unref(getShowMenu) && !unref(getShowHeader)) const getIsUnFold = computed(() => !unref(getShowMenu) && !unref(getShowHeader))
const getIcon = computed(() => const getIcon = computed(() => (unref(getIsUnFold) ? 'codicon:screen-normal' : 'codicon:screen-full'))
unref(getIsUnFold) ? 'codicon:screen-normal' : 'codicon:screen-full',
)
function handleFold() { function handleFold() {
const isUnFold = unref(getIsUnFold) const isUnFold = unref(getIsUnFold)
......
...@@ -102,12 +102,9 @@ ...@@ -102,12 +102,9 @@
} }
if (isHide) { if (isHide) {
const findParentRoute = router const findParentRoute = router.getRoutes().find((item) => item.path === currentActiveMenu)
.getRoutes()
.find((item) => item.path === currentActiveMenu)
findParentRoute && findParentRoute && tabStore.addTab(findParentRoute as unknown as RouteLocationNormalized)
tabStore.addTab(findParentRoute as unknown as RouteLocationNormalized)
} else { } else {
tabStore.addTab(unref(route)) tabStore.addTab(unref(route))
} }
......
...@@ -30,9 +30,7 @@ export function initAffixTabs(): string[] { ...@@ -30,9 +30,7 @@ export function initAffixTabs(): string[] {
* @description: Set fixed tabs * @description: Set fixed tabs
*/ */
function addAffixTabs(): void { function addAffixTabs(): void {
const affixTabs = filterAffixTabs( const affixTabs = filterAffixTabs(router.getRoutes() as unknown as RouteLocationNormalized[])
router.getRoutes() as unknown as RouteLocationNormalized[],
)
affixList.value = affixTabs affixList.value = affixTabs
for (const tab of affixTabs) { for (const tab of affixTabs) {
tabStore.addTab({ tabStore.addTab({
...@@ -58,9 +56,7 @@ export function useTabsDrag(affixTextList: string[]) { ...@@ -58,9 +56,7 @@ export function useTabsDrag(affixTextList: string[]) {
const { prefixCls } = useDesign('multiple-tabs') const { prefixCls } = useDesign('multiple-tabs')
nextTick(() => { nextTick(() => {
if (!multiTabsSetting.canDrag) return if (!multiTabsSetting.canDrag) return
const el = document.querySelectorAll( const el = document.querySelectorAll(`.${prefixCls} .ant-tabs-nav-wrap > div`)?.[0] as HTMLElement
`.${prefixCls} .ant-tabs-nav-wrap > div`,
)?.[0] as HTMLElement
const { initSortable } = useSortable(el, { const { initSortable } = useSortable(el, {
filter: (e: ChangeEvent) => { filter: (e: ChangeEvent) => {
const text = e?.target?.innerText const text = e?.target?.innerText
......
...@@ -48,8 +48,7 @@ export function useTabDropdown(tabContentProps: TabContentProps, getIsTabs: Comp ...@@ -48,8 +48,7 @@ export function useTabDropdown(tabContentProps: TabContentProps, getIsTabs: Comp
// Close right // Close right
const closeRightDisabled = const closeRightDisabled =
!isCurItem || !isCurItem || (index === tabStore.getTabList.length - 1 && tabStore.getLastDragEndIndex >= 0)
(index === tabStore.getTabList.length - 1 && tabStore.getLastDragEndIndex >= 0)
const dropMenuList: DropMenu[] = [ const dropMenuList: DropMenu[] = [
{ {
icon: 'ion:reload-sharp', icon: 'ion:reload-sharp',
......
...@@ -16,8 +16,7 @@ export function useFrameKeepAlive() { ...@@ -16,8 +16,7 @@ export function useFrameKeepAlive() {
const { getShowMultipleTab } = useMultipleTabSetting() const { getShowMultipleTab } = useMultipleTabSetting()
const tabStore = useMultipleTabStore() const tabStore = useMultipleTabStore()
const getFramePages = computed(() => { const getFramePages = computed(() => {
const ret = const ret = getAllFramePages(toRaw(router.getRoutes()) as unknown as AppRouteRecordRaw[]) || []
getAllFramePages(toRaw(router.getRoutes()) as unknown as AppRouteRecordRaw[]) || []
return ret return ret
}) })
......
...@@ -4,12 +4,10 @@ export default { ...@@ -4,12 +4,10 @@ export default {
errorTip: 'Error Tip', errorTip: 'Error Tip',
errorMessage: 'The operation failed, the system is abnormal!', errorMessage: 'The operation failed, the system is abnormal!',
timeoutMessage: 'Login timed out, please log in again!', timeoutMessage: 'Login timed out, please log in again!',
apiTimeoutMessage: apiTimeoutMessage: 'The interface request timed out, please refresh the page and try again!',
'The interface request timed out, please refresh the page and try again!',
apiRequestFailed: 'The interface request failed, please try again later!', apiRequestFailed: 'The interface request failed, please try again later!',
networkException: 'network anomaly', networkException: 'network anomaly',
networkExceptionMsg: networkExceptionMsg: 'Please check if your network connection is normal! The network is abnormal',
'Please check if your network connection is normal! The network is abnormal',
errMsg401: 'The user does not have permission (token, user name, password error)!', errMsg401: 'The user does not have permission (token, user name, password error)!',
errMsg403: 'The user is authorized, but access is forbidden!', errMsg403: 'The user is authorized, but access is forbidden!',
...@@ -19,8 +17,7 @@ export default { ...@@ -19,8 +17,7 @@ export default {
errMsg500: 'Server error, please contact the administrator!', errMsg500: 'Server error, please contact the administrator!',
errMsg501: 'The network is not implemented!', errMsg501: 'The network is not implemented!',
errMsg502: 'Network Error!', errMsg502: 'Network Error!',
errMsg503: errMsg503: 'The service is unavailable, the server is temporarily overloaded or maintained!',
'The service is unavailable, the server is temporarily overloaded or maintained!',
errMsg504: 'Network timeout!', errMsg504: 'Network timeout!',
errMsg505: 'The http version does not support the request!', errMsg505: 'The http version does not support the request!',
}, },
...@@ -45,8 +42,7 @@ export default { ...@@ -45,8 +42,7 @@ export default {
fireResourceError: 'Fire resource error', fireResourceError: 'Fire resource error',
fireAjaxError: 'Fire ajax error', fireAjaxError: 'Fire ajax error',
enableMessage: enableMessage: 'Only effective when useErrorHandle=true in `/src/settings/projectSetting.ts`.',
'Only effective when useErrorHandle=true in `/src/settings/projectSetting.ts`.',
}, },
exception: { exception: {
backLogin: 'Back Login', backLogin: 'Back Login',
...@@ -56,8 +52,7 @@ export default { ...@@ -56,8 +52,7 @@ export default {
subTitle500: 'Sorry, the server is reporting an error.', subTitle500: 'Sorry, the server is reporting an error.',
noDataTitle: 'No data on the current page.', noDataTitle: 'No data on the current page.',
networkErrorTitle: 'Network Error', networkErrorTitle: 'Network Error',
networkErrorSubTitle: networkErrorSubTitle: 'Sorry,Your network connection has been disconnected, please check your network!',
'Sorry,Your network connection has been disconnected, please check your network!',
}, },
lock: { lock: {
unlock: 'Click to unlock', unlock: 'Click to unlock',
......
...@@ -18,10 +18,7 @@ export function setRouteChange(lastChangeRoute: RouteLocationNormalized) { ...@@ -18,10 +18,7 @@ export function setRouteChange(lastChangeRoute: RouteLocationNormalized) {
lastChangeTab = r lastChangeTab = r
} }
export function listenerRouteChange( export function listenerRouteChange(callback: (route: RouteLocationNormalized) => void, immediate = true) {
callback: (route: RouteLocationNormalized) => void,
immediate = true,
) {
emitter.on(key, callback) emitter.on(key, callback)
immediate && lastChangeTab && callback(lastChangeTab) immediate && lastChangeTab && callback(lastChangeTab)
} }
......
...@@ -15,6 +15,9 @@ import { setupGlobDirectives } from '/@/directives' ...@@ -15,6 +15,9 @@ import { setupGlobDirectives } from '/@/directives'
import { setupI18n } from '/@/locales/setupI18n' import { setupI18n } from '/@/locales/setupI18n'
import { registerGlobComp } from '/@/components/registerGlobComp' import { registerGlobComp } from '/@/components/registerGlobComp'
// 全局注入 API
import '/@/api/services/mods'
async function bootstrap() { async function bootstrap() {
const app = createApp(App) const app = createApp(App)
......
...@@ -40,10 +40,7 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) { ...@@ -40,10 +40,7 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
}) })
} }
function dynamicImport( function dynamicImport(dynamicViewsModules: Record<string, () => Promise<Recordable>>, component: string) {
dynamicViewsModules: Record<string, () => Promise<Recordable>>,
component: string,
) {
const keys = Object.keys(dynamicViewsModules) const keys = Object.keys(dynamicViewsModules)
const matchKeys = keys.filter((key) => { const matchKeys = keys.filter((key) => {
const k = key.replace('../../views', '') const k = key.replace('../../views', '')
...@@ -123,11 +120,7 @@ function promoteRouteLevel(routeModule: AppRouteModule) { ...@@ -123,11 +120,7 @@ function promoteRouteLevel(routeModule: AppRouteModule) {
} }
// Add all sub-routes to the secondary route // Add all sub-routes to the secondary route
function addToChildren( function addToChildren(routes: RouteRecordNormalized[], children: AppRouteRecordRaw[], routeModule: AppRouteModule) {
routes: RouteRecordNormalized[],
children: AppRouteRecordRaw[],
routeModule: AppRouteModule,
) {
for (let index = 0; index < children.length; index++) { for (let index = 0; index < children.length; index++) {
const child = children[index] const child = children[index]
const route = routes.find((item) => item.name === child.name) const route = routes.find((item) => item.name === child.name)
......
...@@ -54,9 +54,7 @@ const staticMenus: Menu[] = [] ...@@ -54,9 +54,7 @@ const staticMenus: Menu[] = []
async function getAsyncMenus() { async function getAsyncMenus() {
const permissionStore = usePermissionStore() const permissionStore = usePermissionStore()
if (isBackMode()) { if (isBackMode()) {
return permissionStore.getBackMenuList.filter( return permissionStore.getBackMenuList.filter((item) => !item.meta?.hideMenu && !item.hideMenu)
(item) => !item.meta?.hideMenu && !item.hideMenu,
)
} }
if (isRouteMappingMode()) { if (isRouteMappingMode()) {
return permissionStore.getFrontMenuList.filter((item) => !item.hideMenu) return permissionStore.getFrontMenuList.filter((item) => !item.hideMenu)
......
import type { import type { ProjectConfig, HeaderSetting, MenuSetting, TransitionSetting, MultiTabsSetting } from '/#/config'
ProjectConfig,
HeaderSetting,
MenuSetting,
TransitionSetting,
MultiTabsSetting,
} from '/#/config'
import type { BeforeMiniState } from '/#/store' import type { BeforeMiniState } from '/#/store'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
......
...@@ -56,10 +56,8 @@ export const useErrorLogStore = defineStore({ ...@@ -56,10 +56,8 @@ export const useErrorLogStore = defineStore({
type: ErrorTypeEnum.AJAX, type: ErrorTypeEnum.AJAX,
} }
if (error.response) { if (error.response) {
const { const { config: { url = '', data: params = '', method = 'get', headers = {} } = {}, data = {} } =
config: { url = '', data: params = '', method = 'get', headers = {} } = {}, error.response
data = {},
} = error.response
errInfo.url = url errInfo.url = url
errInfo.name = 'Ajax Error!' errInfo.name = 'Ajax Error!'
errInfo.file = '-' errInfo.file = '-'
......
...@@ -157,14 +157,9 @@ export const useMultipleTabStore = defineStore({ ...@@ -157,14 +157,9 @@ export const useMultipleTabStore = defineStore({
// const realName: string = path.match(/(\S*)\//)![1]; // const realName: string = path.match(/(\S*)\//)![1];
const realPath = meta?.realPath ?? '' const realPath = meta?.realPath ?? ''
// 获取到已经打开的动态路由数, 判断是否大于某一个值 // 获取到已经打开的动态路由数, 判断是否大于某一个值
if ( if (this.tabList.filter((e) => e.meta?.realPath ?? '' === realPath).length >= dynamicLevel) {
this.tabList.filter((e) => e.meta?.realPath ?? '' === realPath).length >=
dynamicLevel
) {
// 关闭第一个 // 关闭第一个
const index = this.tabList.findIndex( const index = this.tabList.findIndex((item) => item.meta.realPath === realPath)
(item) => item.meta.realPath === realPath,
)
index !== -1 && this.tabList.splice(index, 1) index !== -1 && this.tabList.splice(index, 1)
} }
} }
......
...@@ -62,9 +62,7 @@ export const createStorage = ({ ...@@ -62,9 +62,7 @@ export const createStorage = ({
time: Date.now(), time: Date.now(),
expire: !isNullOrUnDef(expire) ? new Date().getTime() + expire * 1000 : null, expire: !isNullOrUnDef(expire) ? new Date().getTime() + expire * 1000 : null,
}) })
const stringifyValue = this.hasEncrypt const stringifyValue = this.hasEncrypt ? this.encryption.encryptByAES(stringData) : stringData
? this.encryption.encryptByAES(stringData)
: stringData
this.storage.setItem(this.getKey(key), stringifyValue) this.storage.setItem(this.getKey(key), stringifyValue)
} }
......
...@@ -82,10 +82,10 @@ export function darken(color: string, amount: number) { ...@@ -82,10 +82,10 @@ export function darken(color: string, amount: number) {
export function lighten(color: string, amount: number) { export function lighten(color: string, amount: number) {
color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color color = color.indexOf('#') >= 0 ? color.substring(1, color.length) : color
amount = Math.trunc((255 * amount) / 100) amount = Math.trunc((255 * amount) / 100)
return `#${addLight(color.substring(0, 2), amount)}${addLight( return `#${addLight(color.substring(0, 2), amount)}${addLight(color.substring(2, 4), amount)}${addLight(
color.substring(2, 4), color.substring(4, 6),
amount, amount,
)}${addLight(color.substring(4, 6), amount)}` )}`
} }
/* Suma el porcentaje indicado a un color (RR, GG o BB) hexadecimal para aclararlo */ /* Suma el porcentaje indicado a un color (RR, GG o BB) hexadecimal para aclararlo */
...@@ -121,10 +121,7 @@ function luminanace(r: number, g: number, b: number) { ...@@ -121,10 +121,7 @@ function luminanace(r: number, g: number, b: number) {
* @param {string} rgb2 rgb color 2 * @param {string} rgb2 rgb color 2
*/ */
function contrast(rgb1: string[], rgb2: number[]) { function contrast(rgb1: string[], rgb2: number[]) {
return ( return (luminanace(~~rgb1[0], ~~rgb1[1], ~~rgb1[2]) + 0.05) / (luminanace(rgb2[0], rgb2[1], rgb2[2]) + 0.05)
(luminanace(~~rgb1[0], ~~rgb1[1], ~~rgb1[2]) + 0.05) /
(luminanace(rgb2[0], rgb2[1], rgb2[2]) + 0.05)
)
} }
/** /**
......
...@@ -6,17 +6,11 @@ import dayjs from 'dayjs' ...@@ -6,17 +6,11 @@ import dayjs from 'dayjs'
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss' const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
const DATE_FORMAT = 'YYYY-MM-DD' const DATE_FORMAT = 'YYYY-MM-DD'
export function formatToDateTime( export function formatToDateTime(date: dayjs.Dayjs | undefined = undefined, format = DATE_TIME_FORMAT): string {
date: dayjs.Dayjs | undefined = undefined,
format = DATE_TIME_FORMAT,
): string {
return dayjs(date).format(format) return dayjs(date).format(format)
} }
export function formatToDate( export function formatToDate(date: dayjs.Dayjs | undefined = undefined, format = DATE_FORMAT): string {
date: dayjs.Dayjs | undefined = undefined,
format = DATE_FORMAT,
): string {
return dayjs(date).format(format) return dayjs(date).format(format)
} }
......
...@@ -144,11 +144,7 @@ export function on( ...@@ -144,11 +144,7 @@ export function on(
} }
/* istanbul ignore next */ /* istanbul ignore next */
export function off( export function off(element: Element | HTMLElement | Document | Window, event: string, handler: Fn): void {
element: Element | HTMLElement | Document | Window,
event: string,
handler: Fn,
): void {
if (element && event && handler) { if (element && event && handler) {
element.removeEventListener(event, handler, false) element.removeEventListener(event, handler, false)
} }
......
...@@ -40,11 +40,7 @@ export function treeToList<T = any>(tree: any, config: Partial<TreeHelperConfig> ...@@ -40,11 +40,7 @@ export function treeToList<T = any>(tree: any, config: Partial<TreeHelperConfig>
return result return result
} }
export function findNode<T = any>( export function findNode<T = any>(tree: any, func: Fn, config: Partial<TreeHelperConfig> = {}): T | null {
tree: any,
func: Fn,
config: Partial<TreeHelperConfig> = {},
): T | null {
config = getConfig(config) config = getConfig(config)
const { children } = config const { children } = config
const list = [...tree] const list = [...tree]
...@@ -55,11 +51,7 @@ export function findNode<T = any>( ...@@ -55,11 +51,7 @@ export function findNode<T = any>(
return null return null
} }
export function findNodeAll<T = any>( export function findNodeAll<T = any>(tree: any, func: Fn, config: Partial<TreeHelperConfig> = {}): T[] {
tree: any,
func: Fn,
config: Partial<TreeHelperConfig> = {},
): T[] {
config = getConfig(config) config = getConfig(config)
const { children } = config const { children } = config
const list = [...tree] const list = [...tree]
...@@ -71,11 +63,7 @@ export function findNodeAll<T = any>( ...@@ -71,11 +63,7 @@ export function findNodeAll<T = any>(
return result return result
} }
export function findPath<T = any>( export function findPath<T = any>(tree: any, func: Fn, config: Partial<TreeHelperConfig> = {}): T | T[] | null {
tree: any,
func: Fn,
config: Partial<TreeHelperConfig> = {},
): T | T[] | null {
config = getConfig(config) config = getConfig(config)
const path: T[] = [] const path: T[] = []
const list = [...tree] const list = [...tree]
...@@ -120,11 +108,7 @@ export function findPathAll(tree: any, func: Fn, config: Partial<TreeHelperConfi ...@@ -120,11 +108,7 @@ export function findPathAll(tree: any, func: Fn, config: Partial<TreeHelperConfi
return result return result
} }
export function filter<T = any>( export function filter<T = any>(tree: T[], func: (n: T) => boolean, config: Partial<TreeHelperConfig> = {}): T[] {
tree: T[],
func: (n: T) => boolean,
config: Partial<TreeHelperConfig> = {},
): T[] {
config = getConfig(config) config = getConfig(config)
const children = config.children as string const children = config.children as string
function listFilter(list: T[]) { function listFilter(list: T[]) {
...@@ -138,11 +122,7 @@ export function filter<T = any>( ...@@ -138,11 +122,7 @@ export function filter<T = any>(
return listFilter(tree) return listFilter(tree)
} }
export function forEach<T = any>( export function forEach<T = any>(tree: T[], func: (n: T) => any, config: Partial<TreeHelperConfig> = {}): void {
tree: T[],
func: (n: T) => any,
config: Partial<TreeHelperConfig> = {},
): void {
config = getConfig(config) config = getConfig(config)
const list: any[] = [...tree] const list: any[] = [...tree]
const { children } = config const { children } = config
...@@ -165,10 +145,7 @@ export function treeMap<T = any>(treeData: T[], opt: { children?: string; conver ...@@ -165,10 +145,7 @@ export function treeMap<T = any>(treeData: T[], opt: { children?: string; conver
/** /**
* @description: Extract tree specified structure * @description: Extract tree specified structure
*/ */
export function treeMapEach( export function treeMapEach(data: any, { children = 'children', conversion }: { children?: string; conversion: Fn }) {
data: any,
{ children = 'children', conversion }: { children?: string; conversion: Fn },
) {
const haveChildren = Array.isArray(data[children]) && data[children].length > 0 const haveChildren = Array.isArray(data[children]) && data[children].length > 0
const conversionData = conversion(data) || {} const conversionData = conversion(data) || {}
if (haveChildren) { if (haveChildren) {
......
...@@ -68,12 +68,8 @@ export class VAxios { ...@@ -68,12 +68,8 @@ export class VAxios {
if (!transform) { if (!transform) {
return return
} }
const { const { requestInterceptors, requestInterceptorsCatch, responseInterceptors, responseInterceptorsCatch } =
requestInterceptors, transform
requestInterceptorsCatch,
responseInterceptors,
responseInterceptorsCatch,
} = transform
const axiosCanceler = new AxiosCanceler() const axiosCanceler = new AxiosCanceler()
...@@ -83,9 +79,7 @@ export class VAxios { ...@@ -83,9 +79,7 @@ export class VAxios {
// @ts-ignore // @ts-ignore
const { ignoreCancelToken } = config.requestOptions const { ignoreCancelToken } = config.requestOptions
const ignoreCancel = const ignoreCancel =
ignoreCancelToken !== undefined ignoreCancelToken !== undefined ? ignoreCancelToken : this.options.requestOptions?.ignoreCancelToken
? ignoreCancelToken
: this.options.requestOptions?.ignoreCancelToken
!ignoreCancel && axiosCanceler.addPending(config) !ignoreCancel && axiosCanceler.addPending(config)
if (requestInterceptors && isFunction(requestInterceptors)) { if (requestInterceptors && isFunction(requestInterceptors)) {
......
...@@ -30,10 +30,7 @@ export abstract class AxiosTransform { ...@@ -30,10 +30,7 @@ export abstract class AxiosTransform {
/** /**
* @description: 请求之前的拦截器 * @description: 请求之前的拦截器
*/ */
requestInterceptors?: ( requestInterceptors?: (config: AxiosRequestConfig, options: CreateAxiosOptions) => AxiosRequestConfig
config: AxiosRequestConfig,
options: CreateAxiosOptions,
) => AxiosRequestConfig
/** /**
* @description: 请求之后的拦截器 * @description: 请求之后的拦截器
......
...@@ -11,11 +11,7 @@ const { createMessage, createErrorModal } = useMessage() ...@@ -11,11 +11,7 @@ const { createMessage, createErrorModal } = useMessage()
const error = createMessage.error! const error = createMessage.error!
const stp = projectSetting.sessionTimeoutProcessing const stp = projectSetting.sessionTimeoutProcessing
export function checkStatus( export function checkStatus(status: number, msg: string, errorMessageMode: ErrorMessageMode = 'message'): void {
status: number,
msg: string,
errorMessageMode: ErrorMessageMode = 'message',
): void {
const { t } = useI18n() const { t } = useI18n()
const userStore = useUserStoreWithOut() const userStore = useUserStoreWithOut()
let errMessage = '' let errMessage = ''
......
...@@ -2,10 +2,7 @@ import { isObject, isString } from '/@/utils/is' ...@@ -2,10 +2,7 @@ import { isObject, isString } from '/@/utils/is'
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss' const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
export function joinTimestamp<T extends boolean>( export function joinTimestamp<T extends boolean>(join: boolean, restful: T): T extends true ? string : object
join: boolean,
restful: T,
): T extends true ? string : object
export function joinTimestamp(join: boolean, restful = false): string | object { export function joinTimestamp(join: boolean, restful = false): string | object {
if (!join) { if (!join) {
......
...@@ -87,14 +87,7 @@ const transform: AxiosTransform = { ...@@ -87,14 +87,7 @@ const transform: AxiosTransform = {
// 请求之前处理config // 请求之前处理config
beforeRequestHook: (config, options) => { beforeRequestHook: (config, options) => {
const { const { apiUrl, joinPrefix, joinParamsToUrl, formatDate, joinTime = true, urlPrefix } = options
apiUrl,
joinPrefix,
joinParamsToUrl,
formatDate,
joinTime = true,
urlPrefix,
} = options
if (joinPrefix) { if (joinPrefix) {
config.url = `${urlPrefix}${config.url}` config.url = `${urlPrefix}${config.url}`
...@@ -118,11 +111,7 @@ const transform: AxiosTransform = { ...@@ -118,11 +111,7 @@ const transform: AxiosTransform = {
} else { } else {
if (!isString(params)) { if (!isString(params)) {
formatDate && formatRequestDate(params) formatDate && formatRequestDate(params)
if ( if (Reflect.has(config, 'data') && config.data && Object.keys(config.data).length > 0) {
Reflect.has(config, 'data') &&
config.data &&
Object.keys(config.data).length > 0
) {
config.data = data config.data = data
config.params = params config.params = params
} else { } else {
...@@ -131,10 +120,7 @@ const transform: AxiosTransform = { ...@@ -131,10 +120,7 @@ const transform: AxiosTransform = {
config.params = undefined config.params = undefined
} }
if (joinParamsToUrl) { if (joinParamsToUrl) {
config.url = setObjToUrlParams( config.url = setObjToUrlParams(config.url as string, Object.assign({}, config.params, config.data))
config.url as string,
Object.assign({}, config.params, config.data),
)
} }
} else { } else {
// 兼容restful风格 // 兼容restful风格
......
import * as echarts from 'echarts/core' import * as echarts from 'echarts/core'
import { import { BarChart, LineChart, PieChart, MapChart, PictorialBarChart, RadarChart } from 'echarts/charts'
BarChart,
LineChart,
PieChart,
MapChart,
PictorialBarChart,
RadarChart,
} from 'echarts/charts'
import { import {
TitleComponent, TitleComponent,
......
...@@ -25,11 +25,7 @@ export type BuildPropOption<T, D extends BuildPropType<T, V, C>, R, V, C> = { ...@@ -25,11 +25,7 @@ export type BuildPropOption<T, D extends BuildPropType<T, V, C>, R, V, C> = {
type?: T type?: T
values?: readonly V[] values?: readonly V[]
required?: R required?: R
default?: R extends true default?: R extends true ? never : D extends Record<string, unknown> | Array<any> ? () => D : (() => D) | D
? never
: D extends Record<string, unknown> | Array<any>
? () => D
: (() => D) | D
validator?: ((val: any) => val is C) | ((val: any) => boolean) validator?: ((val: any) => val is C) | ((val: any) => boolean)
} }
...@@ -41,11 +37,7 @@ type _BuildPropType<T, V, C> = ...@@ -41,11 +37,7 @@ type _BuildPropType<T, V, C> =
: never) : never)
| V | V
| C | C
export type BuildPropType<T, V, C> = _BuildPropType< export type BuildPropType<T, V, C> = _BuildPropType<IfUnknown<T, never>, IfUnknown<V, never>, IfUnknown<C, never>>
IfUnknown<T, never>,
IfUnknown<V, never>,
IfUnknown<C, never>
>
type _BuildPropDefault<T, D> = [T] extends [ type _BuildPropDefault<T, D> = [T] extends [
// eslint-disable-next-line @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/ban-types
...@@ -121,9 +113,7 @@ export function buildProp< ...@@ -121,9 +113,7 @@ export function buildProp<
warn( warn(
`Invalid prop: validation failed${ `Invalid prop: validation failed${
key ? ` for prop "${key}"` : '' key ? ` for prop "${key}"` : ''
}. Expected one of [${allowValuesText}], got value ${JSON.stringify( }. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`,
val,
)}.`,
) )
} }
return valid return valid
...@@ -159,9 +149,7 @@ export const buildProps = < ...@@ -159,9 +149,7 @@ export const buildProps = <
>( >(
props: O, props: O,
) => ) =>
fromPairs( fromPairs(Object.entries(props).map(([key, option]) => [key, buildProp(option as any, key)])) as unknown as {
Object.entries(props).map(([key, option]) => [key, buildProp(option as any, key)]),
) as unknown as {
[K in keyof O]: O[K] extends { [propKey]: boolean } [K in keyof O]: O[K] extends { [propKey]: boolean }
? O[K] ? O[K]
: [O[K]] extends NativePropType : [O[K]] extends NativePropType
...@@ -181,7 +169,6 @@ export const buildProps = < ...@@ -181,7 +169,6 @@ export const buildProps = <
export const definePropType = <T>(val: any) => ({ [wrapperKey]: val } as PropWrapper<T>) export const definePropType = <T>(val: any) => ({ [wrapperKey]: val } as PropWrapper<T>)
export const keyOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T> export const keyOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T>
export const mutable = <T extends readonly any[] | Record<string, unknown>>(val: T) => export const mutable = <T extends readonly any[] | Record<string, unknown>>(val: T) => val as Mutable<typeof val>
val as Mutable<typeof val>
export const componentSize = ['large', 'medium', 'small', 'mini'] as const export const componentSize = ['large', 'medium', 'small', 'mini'] as const
...@@ -11,9 +11,7 @@ ...@@ -11,9 +11,7 @@
{{ item.date }} {{ item.date }}
</template> </template>
<!-- eslint-disable-next-line --> <!-- eslint-disable-next-line -->
<template #title> <template #title> {{ item.name }} <span v-html="item.desc"> </span> </template>
{{ item.name }} <span v-html="item.desc"> </span>
</template>
<template #avatar> <template #avatar>
<Icon :icon="item.avatar" :size="30" /> <Icon :icon="item.avatar" :size="30" />
</template> </template>
......
...@@ -25,16 +25,12 @@ ...@@ -25,16 +25,12 @@
}, },
{ {
title: 'Collapse Button', title: 'Collapse Button',
element: document.querySelector( element: document.querySelector(`.${prefixVar}-layout-header-trigger`)!,
`.${prefixVar}-layout-header-trigger`,
)!,
intro: 'This is the menu collapse button.', intro: 'This is the menu collapse button.',
}, },
{ {
title: 'User Action', title: 'User Action',
element: document.querySelector( element: document.querySelector(`.${prefixVar}-layout-header-action`)!,
`.${prefixVar}-layout-header-action`,
)!,
intro: 'This is the user function area.', intro: 'This is the user function area.',
}, },
], ],
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<span class="flex-1"> <span class="flex-1">
<a :href="GITLAB_URL" target="_blank">{{ name }}</a> <a :href="GITLAB_URL" target="_blank">{{ name }}</a>
是一个基于Vue3.0、Vite、 Ant-Design-Vue 、TypeScript 的后台解决方案, 是一个基于Vue3.0、Vite、 Ant-Design-Vue 、TypeScript 的后台解决方案, 目标是为项目开发,
目标是为项目开发, 提供现成的开箱解决方案。 提供现成的开箱解决方案。
</span> </span>
</div> </div>
</template> </template>
......
<template> <template>
<div :class="prefixCls" :style="getWrapStyle"> <div :class="prefixCls" :style="getWrapStyle">
<Spin :spinning="loading" size="large" :style="getWrapStyle"> <Spin :spinning="loading" size="large" :style="getWrapStyle">
<iframe <iframe :src="frameSrc" :class="`${prefixCls}__main`" ref="frameRef" @load="hideLoading"></iframe>
:src="frameSrc"
:class="`${prefixCls}__main`"
ref="frameRef"
@load="hideLoading"
></iframe>
</Spin> </Spin>
</div> </div>
</template> </template>
......
<template> <template>
<div <div :class="prefixCls" class="fixed inset-0 flex h-screen w-screen bg-black items-center justify-center">
:class="prefixCls"
class="fixed inset-0 flex h-screen w-screen bg-black items-center justify-center"
>
<div <div
:class="`${prefixCls}__unlock`" :class="`${prefixCls}__unlock`"
class="absolute top-0 left-1/2 flex pt-5 h-16 items-center justify-center sm:text-md xl:text-xl text-white flex-col cursor-pointer transform translate-x-1/2" class="absolute top-0 left-1/2 flex pt-5 h-16 items-center justify-center sm:text-md xl:text-xl text-white flex-col cursor-pointer transform translate-x-1/2"
...@@ -28,19 +25,12 @@ ...@@ -28,19 +25,12 @@
<div :class="`${prefixCls}-entry`" v-show="!showDate"> <div :class="`${prefixCls}-entry`" v-show="!showDate">
<div :class="`${prefixCls}-entry-content`"> <div :class="`${prefixCls}-entry-content`">
<div :class="`${prefixCls}-entry__header enter-x`"> <div :class="`${prefixCls}-entry__header enter-x`">
<img <img :src="userinfo.avatar || headerImg" :class="`${prefixCls}-entry__header-img`" />
:src="userinfo.avatar || headerImg"
:class="`${prefixCls}-entry__header-img`"
/>
<p :class="`${prefixCls}-entry__header-name`"> <p :class="`${prefixCls}-entry__header-name`">
{{ userinfo.realName }} {{ userinfo.realName }}
</p> </p>
</div> </div>
<InputPassword <InputPassword :placeholder="t('sys.lock.placeholder')" class="enter-x" v-model:value="password" />
:placeholder="t('sys.lock.placeholder')"
class="enter-x"
v-model:value="password"
/>
<span :class="`${prefixCls}-entry__err-msg enter-x`" v-if="errMsg"> <span :class="`${prefixCls}-entry__err-msg enter-x`" v-if="errMsg">
{{ t('sys.lock.alert') }} {{ t('sys.lock.alert') }}
</span> </span>
...@@ -63,13 +53,7 @@ ...@@ -63,13 +53,7 @@
> >
{{ t('sys.lock.backToLogin') }} {{ t('sys.lock.backToLogin') }}
</a-button> </a-button>
<a-button <a-button class="mt-2" type="link" size="small" @click="unLock()" :loading="loading">
class="mt-2"
type="link"
size="small"
@click="unLock()"
:loading="loading"
>
{{ t('sys.lock.entry') }} {{ t('sys.lock.entry') }}
</a-button> </a-button>
</div> </div>
...@@ -77,9 +61,7 @@ ...@@ -77,9 +61,7 @@
</div> </div>
</transition> </transition>
<div <div class="absolute bottom-5 w-full text-gray-300 xl:text-xl 2xl:text-3xl text-center enter-y">
class="absolute bottom-5 w-full text-gray-300 xl:text-xl 2xl:text-3xl text-center enter-y"
>
<div class="text-5xl mb-4 enter-x" v-show="!showDate"> <div class="text-5xl mb-4 enter-x" v-show="!showDate">
{{ hour }}:{{ minute }} <span class="text-3xl">{{ meridiem }}</span> {{ hour }}:{{ minute }} <span class="text-3xl">{{ meridiem }}</span>
</div> </div>
......
...@@ -3,26 +3,14 @@ ...@@ -3,26 +3,14 @@
<LoginFormTitle class="enter-x" /> <LoginFormTitle class="enter-x" />
<Form class="p-4 enter-x" :model="formData" :rules="getFormRules" ref="formRef"> <Form class="p-4 enter-x" :model="formData" :rules="getFormRules" ref="formRef">
<FormItem name="account" class="enter-x"> <FormItem name="account" class="enter-x">
<Input <Input size="large" v-model:value="formData.account" :placeholder="t('sys.login.userName')" />
size="large"
v-model:value="formData.account"
:placeholder="t('sys.login.userName')"
/>
</FormItem> </FormItem>
<FormItem name="mobile" class="enter-x"> <FormItem name="mobile" class="enter-x">
<Input <Input size="large" v-model:value="formData.mobile" :placeholder="t('sys.login.mobile')" />
size="large"
v-model:value="formData.mobile"
:placeholder="t('sys.login.mobile')"
/>
</FormItem> </FormItem>
<FormItem name="sms" class="enter-x"> <FormItem name="sms" class="enter-x">
<CountdownInput <CountdownInput size="large" v-model:value="formData.sms" :placeholder="t('sys.login.smsCode')" />
size="large"
v-model:value="formData.sms"
:placeholder="t('sys.login.smsCode')"
/>
</FormItem> </FormItem>
<FormItem class="enter-x"> <FormItem class="enter-x">
......
...@@ -16,19 +16,11 @@ ...@@ -16,19 +16,11 @@
<div class="hidden min-h-full pl-4 mr-4 xl:flex xl:flex-col xl:w-6/12"> <div class="hidden min-h-full pl-4 mr-4 xl:flex xl:flex-col xl:w-6/12">
<AppLogo class="-enter-x" /> <AppLogo class="-enter-x" />
<div class="my-auto"> <div class="my-auto">
<img <img :alt="title" src="../../../assets/svg/login-box-bg.svg" class="w-1/2 -mt-16 -enter-x" />
:alt="title"
src="../../../assets/svg/login-box-bg.svg"
class="w-1/2 -mt-16 -enter-x"
/>
<div class="mt-10 font-medium text-white -enter-x"> <div class="mt-10 font-medium text-white -enter-x">
<span class="inline-block mt-4 text-3xl"> <span class="inline-block mt-4 text-3xl"> {{ t('sys.login.signInTitle') }}</span>
{{ t('sys.login.signInTitle') }}</span
>
</div> </div>
<div <div class="mt-5 font-normal text-white text-md dark:text-gray-500 -enter-x">
class="mt-5 font-normal text-white text-md dark:text-gray-500 -enter-x"
>
{{ t('sys.login.signInDesc') }} {{ t('sys.login.signInDesc') }}
</div> </div>
</div> </div>
......
...@@ -37,11 +37,7 @@ ...@@ -37,11 +37,7 @@
<ACol :span="12"> <ACol :span="12">
<FormItem :style="{ 'text-align': 'right' }"> <FormItem :style="{ 'text-align': 'right' }">
<!-- No logic, you need to deal with it yourself --> <!-- No logic, you need to deal with it yourself -->
<Button <Button type="link" size="small" @click="setLoginState(LoginStateEnum.RESET_PASSWORD)">
type="link"
size="small"
@click="setLoginState(LoginStateEnum.RESET_PASSWORD)"
>
{{ t('sys.login.forgetPassword') }} {{ t('sys.login.forgetPassword') }}
</Button> </Button>
</FormItem> </FormItem>
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
<template v-if="getShow"> <template v-if="getShow">
<LoginFormTitle class="enter-x" /> <LoginFormTitle class="enter-x" />
<div class="enter-x min-w-64 min-h-64"> <div class="enter-x min-w-64 min-h-64">
<QrCode <QrCode :value="qrCodeUrl" class="enter-x flex justify-center xl:justify-start" :width="280" />
:value="qrCodeUrl"
class="enter-x flex justify-center xl:justify-start"
:width="280"
/>
<Divider class="enter-x">{{ t('sys.login.scanSign') }}</Divider> <Divider class="enter-x">{{ t('sys.login.scanSign') }}</Divider>
<Button size="large" block class="mt-4 enter-x" @click="handleBackLogin"> <Button size="large" block class="mt-4 enter-x" @click="handleBackLogin">
{{ t('sys.login.backSignIn') }} {{ t('sys.login.backSignIn') }}
......
...@@ -27,11 +27,7 @@ ...@@ -27,11 +27,7 @@
/> />
</FormItem> </FormItem>
<FormItem name="password" class="enter-x"> <FormItem name="password" class="enter-x">
<StrengthMeter <StrengthMeter size="large" v-model:value="formData.password" :placeholder="t('sys.login.password')" />
size="large"
v-model:value="formData.password"
:placeholder="t('sys.login.password')"
/>
</FormItem> </FormItem>
<FormItem name="confirmPassword" class="enter-x"> <FormItem name="confirmPassword" class="enter-x">
<InputPassword <InputPassword
...@@ -49,14 +45,7 @@ ...@@ -49,14 +45,7 @@
</Checkbox> </Checkbox>
</FormItem> </FormItem>
<Button <Button type="primary" class="enter-x" size="large" block @click="handleRegister" :loading="loading">
type="primary"
class="enter-x"
size="large"
block
@click="handleRegister"
:loading="loading"
>
{{ t('sys.login.registerButton') }} {{ t('sys.login.registerButton') }}
</Button> </Button>
<Button size="large" block class="mt-4 enter-x" @click="handleBackLogin"> <Button size="large" block class="mt-4 enter-x" @click="handleBackLogin">
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
"lib": ["dom", "esnext"], "lib": ["dom", "esnext"],
"noImplicitAny": false, "noImplicitAny": false,
"skipLibCheck": true, "skipLibCheck": true,
"strictNullChecks": false,
"strictPropertyInitialization": false,
"types": ["vite/client"], "types": ["vite/client"],
"removeComments": true, "removeComments": true,
"paths": { "paths": {
......
...@@ -7,6 +7,8 @@ import type { ...@@ -7,6 +7,8 @@ import type {
PropType as VuePropType, PropType as VuePropType,
} from 'vue' } from 'vue'
import type { AxiosRequestConfig } from 'axios'
declare global { declare global {
const __APP_INFO__: { const __APP_INFO__: {
pkg: { pkg: {
...@@ -92,10 +94,40 @@ declare global { ...@@ -92,10 +94,40 @@ declare global {
[elem: string]: any [elem: string]: any
} }
} }
// 扩展类型,用于在 pont 生成的 api.d.ts 内部使用
namespace axios {
declare interface RequestOptions {
// Splicing request parameters to url
joinParamsToUrl?: boolean
// Format request parameter time
formatDate?: boolean
// Whether to process the request result
isTransformResponse?: boolean
// Whether to return native response headers
// For example: use this attribute when you need to get the response headers
isReturnNativeResponse?: boolean
// Whether to join url
joinPrefix?: boolean
// Interface address, use the default apiUrl if you leave it blank
apiUrl?: string
// 请求拼接路径
urlPrefix?: string
// Error message prompt type
errorMessageMode?: ErrorMessageMode
// Whether to add a timestamp
joinTime?: boolean
ignoreCancelToken?: boolean
// Whether to send token in header
withToken?: boolean
// 请求重试机制
retryRequest?: RetryRequest
}
type RequestConfig<T = any> = AxiosRequestConfig<T>
}
} }
declare module 'vue' { declare module 'vue' {
export type JSXComponent<Props = any> = export type JSXComponent<Props = any> = { new (): ComponentPublicInstance<Props> } | FunctionalComponent<Props>
| { new (): ComponentPublicInstance<Props> }
| FunctionalComponent<Props>
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论