refactor: 调整 eslint.config.js,优化代码格式

This commit is contained in:
2024-10-28 21:20:08 +08:00
parent 0e8fe5ff1f
commit 9e5dff144b
176 changed files with 5956 additions and 5624 deletions

View File

@@ -16,10 +16,10 @@ export default function appInfo(): Plugin {
padding: 1,
margin: 1,
borderStyle: 'double',
textAlignment: 'center'
}
)
textAlignment: 'center',
},
),
)
}
},
}
}

View File

@@ -5,8 +5,8 @@ export default function createAutoImport() {
// 自动导入 vue 相关函数
imports: ['vue', 'vue-router', {
// vue 3.5.x
vue: ['useTemplateRef', 'onWatcherCleanup', 'useId']
vue: ['useTemplateRef', 'onWatcherCleanup', 'useId'],
}],
dts: './src/types/auto-imports.d.ts'
dts: './src/types/auto-imports.d.ts',
})
}

View File

@@ -6,6 +6,6 @@ export default function createComponents() {
dirs: ['src/components'],
extensions: ['vue', 'tsx'],
// 配置文件生成位置
dts: './src/types/components.d.ts'
dts: './src/types/components.d.ts',
})
}

View File

@@ -12,6 +12,6 @@ export default function createMock(env, isBuild) {
injectCode: `
import { setupProdMockServer } from '../src/mock/index';
setupProdMockServer();
`
`,
})
}

View File

@@ -8,6 +8,6 @@ export default function createSvgIcon(isBuild) {
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
// 指定 symbolId 格式
symbolId: 'icon-[dir]-[name]',
svgoOptions: isBuild
svgoOptions: isBuild,
})
}

View File

@@ -3,54 +3,42 @@ import antfu from '@antfu/eslint-config'
// https://github.com/antfu/eslint-config
export default antfu(
{
vue: true,
vue: {
overrides: {
'vue/block-order': ['error', {
order: [['script', 'template'], 'style'],
}], // 强制组件顶级元素的顺序
'vue/singleline-html-element-content-newline': 'off', // 要求在单行元素的内容前后换行
'vue/html-self-closing': ['off', {
html: {
void: 'never',
normal: 'always',
component: 'never',
},
}], // 强制自结束样式
'vue/custom-event-name-casing': ['error', 'kebab-case'], // 对自定义事件名称强制使用特定大小写
},
},
typescript: true,
ignores: [
'README.md',
'src/types/shims-vue.d.ts'
]
'**/*.md',
'.github',
'.image',
'src/types/shims-vue.d.ts',
],
},
{
// Remember to specify the file glob here, otherwise it might cause the vue plugin to handle non-vue files
files: ['**/*.vue'],
rules: {
'vue/block-order': [2, {
order: [['script', 'template'], 'style']
}], // 强制组件顶级元素的顺序
'vue/html-self-closing': [0, {
html: {
void: 'never',
normal: 'always',
component: 'never'
}
}], // 强制自结束样式
'vue/custom-event-name-casing': [2, 'kebab-case'], // 对自定义事件名称强制使用特定大小写
'vue/singleline-html-element-content-newline': 0, // 要求在单行元素的内容前后换行
'vue/first-attribute-linebreak': 0, // 强制第一个属性的位置
'vue/define-macros-order': [2, {
order: ['defineOptions', 'defineModel', 'defineProps', 'defineEmits', 'defineSlots'],
defineExposeLast: false
}], // 强制执行定义限制和定义弹出编译器宏的顺序
'vue/html-indent': 0, // 在《模板》中强制一致的缩进
'vue/html-closing-bracket-newline': 0 // 要求或不允许在标记的右括号前换行
}
'curly': ['off', 'all'], // 对所有控制语句强制使用一致的大括号样式
'no-new': 'off', // 不允许在赋值或比较之外使用 new 运算符
// 'no-console': 'error', // 禁止使用 console
'style/arrow-parens': ['error', 'always'], // 箭头函数参数需要括号
'style/brace-style': ['error', '1tbs', { allowSingleLine: true }], // 对块执行一致的大括号样式
'regexp/no-unused-capturing-group': 'off',
'regexp/no-super-linear-backtracking': 'off',
'node/prefer-global/process': 'off',
'antfu/top-level-function': 'off',
'antfu/if-newline': 'off',
},
},
{
// Without `files`, they are general rules for all files
rules: {
'curly': [0, 'all'], // 对所有控制语句强制使用一致的大括号样式
'dot-notation': 0, // 尽可能强制使用点表示法。 在 JavaScript 中,可以使用点表示法 (foo.bar) 或方括号表示法 (foo["bar"]) 访问属性
'no-new': 0, // 不允许在赋值或比较之外使用 new 运算符
// 'no-console': 2, // 禁止使用 console
'no-process-env': 0,
'style/arrow-parens': [2, 'always'], // 箭头函数参数需要括号
'style/brace-style': [2, '1tbs', { allowSingleLine: true }], // 对块执行一致的大括号样式
'style/comma-dangle': [2, 'never'], // 要求或不允许尾随逗号
'ts/consistent-type-definitions': 0,
'ts/no-unused-expressions': 0,
'node/prefer-global/process': 0,
'antfu/top-level-function': 0,
'antfu/if-newline': 0
}
}
)

View File

@@ -9,8 +9,8 @@
"build:test": "vue-tsc --noEmit && vite build --mode test",
"preview": "vite preview --port 5050",
"typecheck": "vue-tsc --noEmit",
"lint": "eslint src",
"lint:fix": "eslint src --fix"
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
@@ -20,6 +20,9 @@
"@codemirror/lang-vue": "^0.1.2",
"@codemirror/theme-one-dark": "^6.1.2",
"@ddietr/codemirror-themes": "^1.4.2",
"@vue-office/docx": "1.6.0",
"@vue-office/excel": "1.7.1",
"@vue-office/pdf": "1.6.4",
"@vueuse/components": "^10.5.0",
"@vueuse/core": "^10.5.0",
"aieditor": "^1.0.13",
@@ -31,6 +34,7 @@
"dayjs": "^1.11.4",
"echarts": "^5.4.2",
"jsencrypt": "^3.3.2",
"lint-staged": "^15.2.10",
"lodash-es": "^4.17.21",
"mitt": "^3.0.0",
"mockjs": "^1.1.0",
@@ -52,10 +56,7 @@
"vue-json-pretty": "^2.4.0",
"vue-router": "^4.3.3",
"xe-utils": "^3.5.7",
"xgplayer": "^2.31.6",
"@vue-office/docx": "1.6.0",
"@vue-office/excel": "1.7.1",
"@vue-office/pdf": "1.6.4"
"xgplayer": "^2.31.6"
},
"devDependencies": {
"@antfu/eslint-config": "^2.16.3",
@@ -81,5 +82,11 @@
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-svg-icons": "^2.0.1",
"vue-tsc": "2.0.19"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
}
}

238
pnpm-lock.yaml generated
View File

@@ -71,6 +71,9 @@ importers:
jsencrypt:
specifier: ^3.3.2
version: 3.3.2
lint-staged:
specifier: ^15.2.10
version: 15.2.10
lodash-es:
specifier: ^4.17.21
version: 4.17.21
@@ -1486,6 +1489,10 @@ packages:
ansi-align@3.0.1:
resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==}
ansi-escapes@7.0.0:
resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==}
engines: {node: '>=18'}
ansi-regex@2.1.1:
resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==}
engines: {node: '>=0.10.0'}
@@ -1616,6 +1623,10 @@ packages:
resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
engines: {node: '>=8'}
braces@3.0.3:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
browserslist@4.23.0:
resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
@@ -1716,6 +1727,14 @@ packages:
resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==}
engines: {node: '>=10'}
cli-cursor@5.0.0:
resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==}
engines: {node: '>=18'}
cli-truncate@4.0.0:
resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==}
engines: {node: '>=18'}
cliui@8.0.1:
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
engines: {node: '>=12'}
@@ -1750,6 +1769,9 @@ packages:
color@3.2.1:
resolution: {integrity: sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==}
colorette@2.0.20:
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
@@ -1901,6 +1923,15 @@ packages:
supports-color:
optional: true
debug@4.3.7:
resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
decode-uri-component@0.2.2:
resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==}
engines: {node: '>=0.10'}
@@ -2019,6 +2050,9 @@ packages:
electron-to-chromium@1.4.774:
resolution: {integrity: sha512-132O1XCd7zcTkzS3FgkAzKmnBuNJjK8WjcTtNuoylj7MYbqw5eXehjQ5OK91g0zm7OTKIPeaAG4CPoRfD9M1Mg==}
emoji-regex@10.4.0:
resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==}
emoji-regex@8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
@@ -2051,6 +2085,10 @@ packages:
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
engines: {node: '>=0.12'}
environment@1.1.0:
resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==}
engines: {node: '>=18'}
errno@0.1.8:
resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==}
hasBin: true
@@ -2489,6 +2527,9 @@ packages:
eventemitter3@4.0.7:
resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==}
eventemitter3@5.0.1:
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
events@3.3.0:
resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
engines: {node: '>=0.8.x'}
@@ -2544,6 +2585,10 @@ packages:
resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
engines: {node: '>=8'}
fill-range@7.1.1:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
filter-obj@5.1.0:
resolution: {integrity: sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==}
engines: {node: '>=14.16'}
@@ -2632,6 +2677,10 @@ packages:
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
engines: {node: 6.* || 8.* || >= 10.*}
get-east-asian-width@1.3.0:
resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==}
engines: {node: '>=18'}
get-intrinsic@1.2.4:
resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==}
engines: {node: '>= 0.4'}
@@ -2907,6 +2956,14 @@ packages:
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
engines: {node: '>=8'}
is-fullwidth-code-point@4.0.0:
resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==}
engines: {node: '>=12'}
is-fullwidth-code-point@5.0.0:
resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==}
engines: {node: '>=18'}
is-glob@4.0.3:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
@@ -3106,6 +3163,10 @@ packages:
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
engines: {node: '>= 0.8.0'}
lilconfig@3.1.2:
resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==}
engines: {node: '>=14'}
lines-and-columns@1.2.4:
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
@@ -3118,6 +3179,15 @@ packages:
linkifyjs@4.1.3:
resolution: {integrity: sha512-auMesunaJ8yfkHvK4gfg1K0SaKX/6Wn9g2Aac/NwX+l5VdmFZzo/hdPGxEOETj+ryRa4/fiOPjeeKURSAJx1sg==}
lint-staged@15.2.10:
resolution: {integrity: sha512-5dY5t743e1byO19P9I4b3x8HJwalIznL5E1FWYnU6OWw33KxNBSLAc6Cy7F2PsFEO8FKnLwjwm5hx7aMF0jzZg==}
engines: {node: '>=18.12.0'}
hasBin: true
listr2@8.2.5:
resolution: {integrity: sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==}
engines: {node: '>=18.0.0'}
loader-runner@4.3.0:
resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==}
engines: {node: '>=6.11.5'}
@@ -3155,6 +3225,10 @@ packages:
lodash@4.17.21:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
log-update@6.1.0:
resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==}
engines: {node: '>=18'}
lower-case@2.0.2:
resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==}
@@ -3240,6 +3314,10 @@ packages:
resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==}
engines: {node: '>=8.6'}
micromatch@4.0.8:
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
engines: {node: '>=8.6'}
mime-db@1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
@@ -3257,6 +3335,10 @@ packages:
resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==}
engines: {node: '>=12'}
mimic-function@5.0.1:
resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==}
engines: {node: '>=18'}
min-indent@1.0.1:
resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}
engines: {node: '>=4'}
@@ -3391,6 +3473,10 @@ packages:
resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==}
engines: {node: '>=12'}
onetime@7.0.0:
resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==}
engines: {node: '>=18'}
open@10.1.0:
resolution: {integrity: sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==}
engines: {node: '>=18'}
@@ -3518,6 +3604,11 @@ packages:
resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
engines: {node: '>=12'}
pidtree@0.6.0:
resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==}
engines: {node: '>=0.10'}
hasBin: true
pify@4.0.1:
resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==}
engines: {node: '>=6'}
@@ -3759,6 +3850,10 @@ packages:
resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==}
hasBin: true
restore-cursor@5.1.0:
resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==}
engines: {node: '>=18'}
ret@0.1.15:
resolution: {integrity: sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==}
engines: {node: '>=0.12'}
@@ -3770,6 +3865,9 @@ packages:
rfdc@1.3.1:
resolution: {integrity: sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==}
rfdc@1.4.1:
resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==}
rollup@4.17.2:
resolution: {integrity: sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
@@ -3904,6 +4002,14 @@ packages:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'}
slice-ansi@5.0.0:
resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==}
engines: {node: '>=12'}
slice-ansi@7.1.0:
resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==}
engines: {node: '>=18'}
snake-case@3.0.4:
resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==}
@@ -4009,6 +4115,10 @@ packages:
resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==}
engines: {node: '>=12'}
string-width@7.2.0:
resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==}
engines: {node: '>=18'}
string.prototype.trim@1.2.9:
resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==}
engines: {node: '>= 0.4'}
@@ -4565,6 +4675,10 @@ packages:
resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}
engines: {node: '>=12'}
wrap-ansi@9.0.0:
resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==}
engines: {node: '>=18'}
xe-utils@3.5.26:
resolution: {integrity: sha512-u9R7RqWDumamToEelrCv2nVA2PBJSPPUubvmiMcuHeFxwbYeBsouoi/opejmr7AdPlSj92FifF7IKFzFrczU7w==}
@@ -4595,6 +4709,11 @@ packages:
engines: {node: '>= 14'}
hasBin: true
yaml@2.5.1:
resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==}
engines: {node: '>= 14'}
hasBin: true
yargs-parser@21.1.1:
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
@@ -6075,6 +6194,10 @@ snapshots:
dependencies:
string-width: 4.2.3
ansi-escapes@7.0.0:
dependencies:
environment: 1.1.0
ansi-regex@2.1.1: {}
ansi-regex@5.0.1: {}
@@ -6208,6 +6331,10 @@ snapshots:
dependencies:
fill-range: 7.0.1
braces@3.0.3:
dependencies:
fill-range: 7.1.1
browserslist@4.23.0:
dependencies:
caniuse-lite: 1.0.30001620
@@ -6335,6 +6462,15 @@ snapshots:
cli-boxes@3.0.0: {}
cli-cursor@5.0.0:
dependencies:
restore-cursor: 5.1.0
cli-truncate@4.0.0:
dependencies:
slice-ansi: 5.0.0
string-width: 7.2.0
cliui@8.0.1:
dependencies:
string-width: 4.2.3
@@ -6382,6 +6518,8 @@ snapshots:
color-convert: 1.9.3
color-string: 1.9.1
colorette@2.0.20: {}
combined-stream@1.0.8:
dependencies:
delayed-stream: 1.0.0
@@ -6526,6 +6664,10 @@ snapshots:
dependencies:
ms: 2.1.2
debug@4.3.7:
dependencies:
ms: 2.1.3
decode-uri-component@0.2.2: {}
decode-uri-component@0.4.1: {}
@@ -6655,6 +6797,8 @@ snapshots:
electron-to-chromium@1.4.774: {}
emoji-regex@10.4.0: {}
emoji-regex@8.0.0: {}
emoji-regex@9.2.2: {}
@@ -6676,6 +6820,8 @@ snapshots:
entities@4.5.0: {}
environment@1.1.0: {}
errno@0.1.8:
dependencies:
prr: 1.0.1
@@ -7226,6 +7372,8 @@ snapshots:
eventemitter3@4.0.7: {}
eventemitter3@5.0.1: {}
events@3.3.0: {}
execa@8.0.1:
@@ -7311,6 +7459,10 @@ snapshots:
dependencies:
to-regex-range: 5.0.1
fill-range@7.1.1:
dependencies:
to-regex-range: 5.0.1
filter-obj@5.1.0: {}
finalhandler@1.1.2:
@@ -7407,6 +7559,8 @@ snapshots:
get-caller-file@2.0.5: {}
get-east-asian-width@1.3.0: {}
get-intrinsic@1.2.4:
dependencies:
es-errors: 1.3.0
@@ -7659,6 +7813,12 @@ snapshots:
is-fullwidth-code-point@3.0.0: {}
is-fullwidth-code-point@4.0.0: {}
is-fullwidth-code-point@5.0.0:
dependencies:
get-east-asian-width: 1.3.0
is-glob@4.0.3:
dependencies:
is-extglob: 2.1.1
@@ -7833,6 +7993,8 @@ snapshots:
prelude-ls: 1.2.1
type-check: 0.4.0
lilconfig@3.1.2: {}
lines-and-columns@1.2.4: {}
linkify-it@4.0.1:
@@ -7845,6 +8007,30 @@ snapshots:
linkifyjs@4.1.3: {}
lint-staged@15.2.10:
dependencies:
chalk: 5.3.0
commander: 12.1.0
debug: 4.3.7
execa: 8.0.1
lilconfig: 3.1.2
listr2: 8.2.5
micromatch: 4.0.8
pidtree: 0.6.0
string-argv: 0.3.2
yaml: 2.5.1
transitivePeerDependencies:
- supports-color
listr2@8.2.5:
dependencies:
cli-truncate: 4.0.0
colorette: 2.0.20
eventemitter3: 5.0.1
log-update: 6.1.0
rfdc: 1.4.1
wrap-ansi: 9.0.0
loader-runner@4.3.0: {}
loader-utils@1.4.2:
@@ -7878,6 +8064,14 @@ snapshots:
lodash@4.17.21: {}
log-update@6.1.0:
dependencies:
ansi-escapes: 7.0.0
cli-cursor: 5.0.0
slice-ansi: 7.1.0
strip-ansi: 7.1.0
wrap-ansi: 9.0.0
lower-case@2.0.2:
dependencies:
tslib: 2.6.2
@@ -7995,6 +8189,11 @@ snapshots:
braces: 3.0.2
picomatch: 2.3.1
micromatch@4.0.8:
dependencies:
braces: 3.0.3
picomatch: 2.3.1
mime-db@1.52.0: {}
mime-types@2.1.35:
@@ -8006,6 +8205,8 @@ snapshots:
mimic-fn@4.0.0: {}
mimic-function@5.0.1: {}
min-indent@1.0.1: {}
minimatch@3.1.2:
@@ -8146,6 +8347,10 @@ snapshots:
dependencies:
mimic-fn: 4.0.0
onetime@7.0.0:
dependencies:
mimic-function: 5.0.1
open@10.1.0:
dependencies:
default-browser: 5.2.1
@@ -8263,6 +8468,8 @@ snapshots:
picomatch@4.0.2: {}
pidtree@0.6.0: {}
pify@4.0.1:
optional: true
@@ -8547,12 +8754,19 @@ snapshots:
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
restore-cursor@5.1.0:
dependencies:
onetime: 7.0.0
signal-exit: 4.1.0
ret@0.1.15: {}
reusify@1.0.4: {}
rfdc@1.3.1: {}
rfdc@1.4.1: {}
rollup@4.17.2:
dependencies:
'@types/estree': 1.0.5
@@ -8707,6 +8921,16 @@ snapshots:
slash@3.0.0: {}
slice-ansi@5.0.0:
dependencies:
ansi-styles: 6.2.1
is-fullwidth-code-point: 4.0.0
slice-ansi@7.1.0:
dependencies:
ansi-styles: 6.2.1
is-fullwidth-code-point: 5.0.0
snake-case@3.0.4:
dependencies:
dot-case: 3.0.4
@@ -8816,6 +9040,12 @@ snapshots:
emoji-regex: 9.2.2
strip-ansi: 7.1.0
string-width@7.2.0:
dependencies:
emoji-regex: 10.4.0
get-east-asian-width: 1.3.0
strip-ansi: 7.1.0
string.prototype.trim@1.2.9:
dependencies:
call-bind: 1.0.7
@@ -9462,6 +9692,12 @@ snapshots:
string-width: 5.1.2
strip-ansi: 7.1.0
wrap-ansi@9.0.0:
dependencies:
ansi-styles: 6.2.1
string-width: 7.2.0
strip-ansi: 7.1.0
xe-utils@3.5.26: {}
xgplayer-subtitles@1.0.19:
@@ -9494,6 +9730,8 @@ snapshots:
yaml@2.4.2: {}
yaml@2.5.1: {}
yargs-parser@21.1.1: {}
yargs@17.7.2:

File diff suppressed because one or more lines are too long

View File

@@ -34,6 +34,6 @@ export function listRoleUsers(id: string) {
return http.get(`${BASE_URL}/listRoleUsers/${id}`)
}
export function bindUsers(id: string, userIds : Array<string>) {
return http.post(`${BASE_URL}/bindUsers/${id}`,userIds)
export function bindUsers(id: string, userIds: Array<string>) {
return http.post(`${BASE_URL}/bindUsers/${id}`, userIds)
}

View File

@@ -157,7 +157,7 @@ export interface DictQuery {
sort: Array<string>
}
export type DictItemResp = {
export interface DictItemResp {
id: string
label: string
value: string
@@ -209,7 +209,7 @@ export interface NoticePageQuery extends NoticeQuery, PageQuery {
}
/** 系统文件类型 */
export type FileItem = {
export interface FileItem {
id: string
name: string
size: number
@@ -245,7 +245,7 @@ export interface FilePageQuery extends FileQuery, PageQuery {
}
/** 系统存储类型 */
export type StorageResp = {
export interface StorageResp {
id: string
name: string
code: string

View File

@@ -36,7 +36,7 @@ export function generate(tableNames: Array<string>) {
return http.requestNative({
url: `${BASE_URL}/${tableNames}`,
method: 'post',
responseType: 'blob'
responseType: 'blob',
})
}

View File

@@ -30,7 +30,7 @@ const props = withDefaults(defineProps<Props>(), {
color: '#168CFF',
size: 20,
alt: 'avatar',
trigger: false
trigger: false,
})
interface Props {
@@ -65,7 +65,7 @@ const colors = [
'#7BC616',
'#14C9C9',
'#FF7D00',
'#FFC72E'
'#FFC72E',
]
const avatarColor = computed(() => {
const hash = (s) => {

View File

@@ -16,20 +16,20 @@ defineProps({
type: Object,
default() {
return {}
}
},
},
autoResize: {
type: Boolean,
default: true
default: true,
},
width: {
type: String,
default: '100%'
default: '100%',
},
height: {
type: String,
default: '100%'
}
default: '100%',
},
})
const renderChart = ref(false)
// wait container expand

View File

@@ -19,47 +19,47 @@ defineOptions({ name: 'DateRangePicker' })
defineProps({
format: {
type: String,
default: 'YYYY-MM-DD HH:mm:ss'
default: 'YYYY-MM-DD HH:mm:ss',
},
showTime: {
type: Boolean,
default: true
default: true,
},
placeholder: {
type: Array as PropType<string[]>,
default: (): string[] => ['开始时间', '结束时间']
default: (): string[] => ['开始时间', '结束时间'],
},
allowClear: {
type: Boolean,
default: true
}
default: true,
},
})
const shortcuts = computed<ShortcutType[]>(() => {
return [
{
label: '今天',
value: (): Date[] => [dayjs().startOf('day').toDate(), dayjs().toDate()]
value: (): Date[] => [dayjs().startOf('day').toDate(), dayjs().toDate()],
},
{
label: '昨天',
value: (): Date[] => [
dayjs().subtract(1, 'day').startOf('day').toDate(),
dayjs().subtract(1, 'day').endOf('day').toDate()
]
dayjs().subtract(1, 'day').endOf('day').toDate(),
],
},
{
label: '本周',
value: (): Date[] => [dayjs().startOf('week').add(1, 'day').toDate(), dayjs().toDate()]
value: (): Date[] => [dayjs().startOf('week').add(1, 'day').toDate(), dayjs().toDate()],
},
{
label: '本月',
value: (): Date[] => [dayjs().startOf('month').toDate(), dayjs().toDate()]
value: (): Date[] => [dayjs().startOf('month').toDate(), dayjs().toDate()],
},
{
label: '本年',
value: (): Date[] => [dayjs().startOf('year').toDate(), dayjs().toDate()]
}
value: (): Date[] => [dayjs().startOf('year').toDate(), dayjs().toDate()],
},
]
})
</script>

View File

@@ -1,11 +1,11 @@
<template>
<a-modal
v-model:visible="visible"
:width="width >= 1350 ? 1350 : '100%'"
:on-before-close="onClose"
:footer="false"
esc-to-close="esc-to-close"
@close="onClose"
v-model:visible="visible"
:width="width >= 1350 ? 1350 : '100%'"
:on-before-close="onClose"
:footer="false"
esc-to-close="esc-to-close"
@close="onClose"
>
<template #title>
{{ modalTitle }}
@@ -18,26 +18,26 @@
<a-spin :loading="loading" class="w-full mt--10">
<a-card class="preview-content">
<VueOfficePdf
v-if="filePreview.fileInfo?.fileType === 'pdf'"
:src="filePreview.fileInfo?.data"
class="h-full"
@rendered="renderedHandler"
@error="errorHandler"
v-if="filePreview.fileInfo?.fileType === 'pdf'"
:src="filePreview.fileInfo?.data"
class="h-full"
@rendered="renderedHandler"
@error="errorHandler"
/>
<VueOfficeDocx
v-else-if="WordTypes.includes(filePreview.fileInfo?.fileType || '')"
:src="filePreview.fileInfo?.data"
class="h-full"
@rendered="renderedHandler"
@error="errorHandler"
v-else-if="WordTypes.includes(filePreview.fileInfo?.fileType || '')"
:src="filePreview.fileInfo?.data"
class="h-full"
@rendered="renderedHandler"
@error="errorHandler"
/>
<VueOfficeExcel
v-else-if="ExcelTypes.includes(filePreview.fileInfo?.fileType || '')"
:src="filePreview.fileInfo?.data"
style="height: 80vh; width: 100%"
:options="filePreview.excelConfig"
@rendered="renderedHandler"
@error="errorHandler"
v-else-if="ExcelTypes.includes(filePreview.fileInfo?.fileType || '')"
:src="filePreview.fileInfo?.data"
style="height: 80vh; width: 100%"
:options="filePreview.excelConfig"
@rendered="renderedHandler"
@error="errorHandler"
/>
</a-card>
</a-spin>
@@ -65,7 +65,7 @@ const blobUrl = ref<string>('')
// 文件预览对象
const filePreview = reactive<FilePreview>({
fileInfo: {},
excelConfig: {}
excelConfig: {},
})
// 弹框标题
const modalTitle = computed(() => {
@@ -124,7 +124,7 @@ const onOpen = () => {
const onClose = () => {
Object.assign(filePreview, {
fileInfo: {},
excelConfig: {}
excelConfig: {},
})
loading.value = false
visible.value = false

View File

@@ -53,8 +53,8 @@ export default defineComponent({
props: useFormProps({
defaultValue: '*',
props: {
week: { type: String, default: '?' }
}
week: { type: String, default: '?' },
},
}),
emits: useFromEmits(),
setup(props, context) {
@@ -68,21 +68,21 @@ export default defineComponent({
maxValue: 31,
valueRange: { start: 1, end: 31 },
valueLoop: { start: 1, interval: 1 },
disabled: isDisabled
disabled: isDisabled,
})
const typeWorkAttrs = computed(() => ({
disabled: setup.type.value !== TypeEnum.work || props.disabled || isDisabled.value,
...setup.inputNumberAttrs.value
...setup.inputNumberAttrs.value,
}))
watch(
() => props.week,
() => {
setup.updateValue(isDisabled.value ? '?' : setup.computeValue.value)
}
},
)
return { ...setup, typeWorkAttrs }
}
},
})
</script>

View File

@@ -44,7 +44,7 @@ import { useFormProps, useFormSetup, useFromEmits } from './use-mixin'
export default defineComponent({
name: 'HourForm',
props: useFormProps({
defaultValue: '*'
defaultValue: '*',
}),
emits: useFromEmits(),
setup(props, context) {
@@ -53,8 +53,8 @@ export default defineComponent({
minValue: 0,
maxValue: 23,
valueRange: { start: 0, end: 23 },
valueLoop: { start: 0, interval: 1 }
valueLoop: { start: 0, interval: 1 },
})
}
},
})
</script>

View File

@@ -44,7 +44,7 @@ import { useFormProps, useFormSetup, useFromEmits } from './use-mixin'
export default defineComponent({
name: 'MinuteForm',
props: useFormProps({
defaultValue: '*'
defaultValue: '*',
}),
emits: useFromEmits(),
setup(props, context) {
@@ -53,8 +53,8 @@ export default defineComponent({
minValue: 0,
maxValue: 59,
valueRange: { start: 0, end: 59 },
valueLoop: { start: 0, interval: 1 }
valueLoop: { start: 0, interval: 1 },
})
}
},
})
</script>

View File

@@ -44,7 +44,7 @@ import { useFormProps, useFormSetup, useFromEmits } from './use-mixin'
export default defineComponent({
name: 'MonthForm',
props: useFormProps({
defaultValue: '*'
defaultValue: '*',
}),
emits: useFromEmits(),
setup(props, context) {
@@ -53,8 +53,8 @@ export default defineComponent({
minValue: 1,
maxValue: 12,
valueRange: { start: 1, end: 12 },
valueLoop: { start: 1, interval: 1 }
valueLoop: { start: 1, interval: 1 },
})
}
},
})
</script>

View File

@@ -44,7 +44,7 @@ import { useFormProps, useFormSetup, useFromEmits } from './use-mixin'
export default defineComponent({
name: 'SecondForm',
props: useFormProps({
defaultValue: '*'
defaultValue: '*',
}),
emits: useFromEmits(),
setup(props, context) {
@@ -53,8 +53,8 @@ export default defineComponent({
minValue: 0,
maxValue: 59,
valueRange: { start: 0, end: 59 },
valueLoop: { start: 0, interval: 1 }
valueLoop: { start: 0, interval: 1 },
})
}
},
})
</script>

View File

@@ -8,7 +8,7 @@ export enum TypeEnum {
loop = 'LOOP',
work = 'WORK',
last = 'LAST',
specify = 'SPECIFY'
specify = 'SPECIFY',
}
// 周定义
@@ -19,7 +19,7 @@ export const WEEK_MAP: any = {
4: '周三',
5: '周四',
6: '周五',
7: '周六'
7: '周六',
}
// use 公共 props
@@ -28,13 +28,13 @@ export function useFormProps(options: any) {
return {
modelValue: {
type: String,
default: defaultValue
default: defaultValue,
},
disabled: {
type: Boolean,
default: false
default: false,
},
...options?.props
...options?.props,
}
}
@@ -166,7 +166,7 @@ export function useFormSetup(props: any, context: any, options: any) {
const beforeRadioAttrs = computed(() => ({
class: ['choice'],
disabled: props.disabled || unref(options.disabled),
size: 'small'
size: 'small',
}))
// 输入框属性
@@ -176,26 +176,26 @@ export function useFormSetup(props: any, context: any, options: any) {
precision: 0,
size: 'small',
hideButton: true,
class: 'w60'
class: 'w60',
}))
// 区间属性
const typeRangeAttrs = computed(() => ({
disabled: type.value !== TypeEnum.range || props.disabled || unref(options.disabled),
...inputNumberAttrs.value
...inputNumberAttrs.value,
}))
// 间隔属性
const typeLoopAttrs = computed(() => ({
disabled: type.value !== TypeEnum.loop || props.disabled || unref(options.disabled),
...inputNumberAttrs.value
...inputNumberAttrs.value,
}))
// 指定属性
const typeSpecifyAttrs = computed(() => ({
disabled: type.value !== TypeEnum.specify || props.disabled || unref(options.disabled),
class: ['list-check-item'],
size: 'small'
size: 'small',
}))
return {
@@ -215,6 +215,6 @@ export function useFormSetup(props: any, context: any, options: any) {
inputNumberAttrs,
typeRangeAttrs,
typeLoopAttrs,
typeSpecifyAttrs
typeSpecifyAttrs,
}
}

View File

@@ -50,8 +50,8 @@ export default defineComponent({
props: useFormProps({
defaultValue: '?',
props: {
day: { type: String, default: '*' }
}
day: { type: String, default: '*' },
},
}),
emits: useFromEmits(),
setup(props, context) {
@@ -66,7 +66,7 @@ export default defineComponent({
// 0,7表示周日 1表示周一
valueRange: { start: 1, end: 7 },
valueLoop: { start: 2, interval: 1 },
disabled: disabledChoice
disabled: disabledChoice,
})
const weekOptions = computed(() => {
const options: { label: string, value: number }[] = []
@@ -74,7 +74,7 @@ export default defineComponent({
const weekName: string = WEEK_MAP[weekKey]
options.push({
value: Number.parseInt(weekKey),
label: weekName
label: weekName,
})
}
return options
@@ -83,13 +83,13 @@ export default defineComponent({
const typeRangeSelectAttrs = computed(() => ({
disabled: setup.typeRangeAttrs.value.disabled,
size: 'small',
class: ['w80']
class: ['w80'],
}))
const typeLoopSelectAttrs = computed(() => ({
disabled: setup.typeLoopAttrs.value.disabled,
size: 'small',
class: ['w80']
class: ['w80'],
}))
watch(() => props.day, () => {
@@ -101,8 +101,8 @@ export default defineComponent({
weekOptions,
typeLoopSelectAttrs,
typeRangeSelectAttrs,
WEEK_MAP
WEEK_MAP,
}
}
},
})
</script>

View File

@@ -30,7 +30,7 @@ import { useFormProps, useFormSetup, useFromEmits } from './use-mixin'
export default defineComponent({
name: 'YearForm',
props: useFormProps({
defaultValue: '*'
defaultValue: '*',
}),
emits: useFromEmits(),
setup(props, context) {
@@ -39,8 +39,8 @@ export default defineComponent({
defaultValue: '*',
minValue: 0,
valueRange: { start: nowYear, end: nowYear + 100 },
valueLoop: { start: nowYear, interval: 1 }
valueLoop: { start: nowYear, interval: 1 },
})
}
},
})
</script>

View File

@@ -95,9 +95,11 @@
</a-col>
<!-- 表达式 -->
<a-col :span="16">
<a-input v-model="cronInputs.cron"
:placeholder="placeholder"
@change="onInputCronChange">
<a-input
v-model="cronInputs.cron"
:placeholder="placeholder"
@change="onInputCronChange"
>
<template #prepend>
<span class="allow-click">表达式</span>
</template>
@@ -135,7 +137,7 @@ const props = withDefaults(defineProps<Partial<CronPropType>>(), {
disabled: false,
hideSecond: false,
hideYear: false,
placeholder: '请输入 Cron 表达式'
placeholder: '请输入 Cron 表达式',
})
const emit = defineEmits(['change', 'update:modelValue'])
const activeKey = ref(props.hideSecond ? 'minute' : 'second')
@@ -154,7 +156,7 @@ const cronInputs = reactive({
month: '',
week: '',
year: '',
cron: ''
cron: '',
})
const previewTimes = ref('执行预览')
@@ -190,7 +192,7 @@ const calculateNextExecutionTimes = (corn: string = cronExpression.value) => {
// 解析表达式
const date = dateFormat(new Date())
const iter = CronParser.parseExpression(parse, {
currentDate: date
currentDate: date,
})
const result: string[] = []
for (let i = 1; i <= 5; i++) {

View File

@@ -1,23 +1,27 @@
<template>
<a-modal v-model:visible="visible"
modal-class="modal-form-small"
title-align="start"
title="Cron表达式生成"
:top="32"
:width="780"
:align-center="false"
:draggable="true"
:mask-closable="false"
:unmount-on-close="true"
:body-style="{ padding: '4px 16px 8px 16px' }">
<a-modal
v-model:visible="visible"
modal-class="modal-form-small"
title-align="start"
title="Cron表达式生成"
:top="32"
:width="780"
:align-center="false"
:draggable="true"
:mask-closable="false"
:unmount-on-close="true"
:body-style="{ padding: '4px 16px 8px 16px' }"
>
<!-- cron 输入框 -->
<CronGeneratorInput ref="cronInputRef" v-model="cronExpression" />
<!-- 页脚 -->
<template #footer>
<a-button size="small" @click="handlerClose">关闭</a-button>
<a-button size="small"
type="primary"
@click="handlerOk">
<a-button
size="small"
type="primary"
@click="handlerOk"
>
确定
</a-button>
</template>

View File

@@ -33,7 +33,7 @@ defineOptions({ name: 'GiCellAvatar' })
const props = withDefaults(defineProps<Props>(), {
avatar: '',
name: '',
isLink: false // 是否可以点击
isLink: false, // 是否可以点击
})
const emit = defineEmits<{

View File

@@ -16,7 +16,7 @@
defineOptions({ name: 'GiCellGender' })
const props = withDefaults(defineProps<Props>(), {
gender: 1
gender: 1,
})
interface Props {

View File

@@ -13,7 +13,7 @@
defineOptions({ name: 'GiCellStatus' })
const props = withDefaults(defineProps<Props>(), {
status: 1
status: 1,
})
interface Props {

View File

@@ -17,15 +17,15 @@ defineOptions({ name: 'GiCellTag' })
const props = withDefaults(defineProps<Partial<GiCellTagType>>(), {
dict: [{
label: '',
value: ''
value: '',
}],
value: ''
value: '',
})
const dictItem = computed((): LabelValueState => {
try {
return props.dict.find(
(d) => d.value === String(props.value) || d.value === Number(props.value)
(d) => d.value === String(props.value) || d.value === Number(props.value),
) || { label: '', value: '' }
} catch (error) {
return { label: '', value: '' }

View File

@@ -22,7 +22,7 @@
defineOptions({ name: 'GiCellTags' })
withDefaults(defineProps<Props>(), {
data: () => []
data: () => [],
})
interface Props {

View File

@@ -19,7 +19,7 @@ import { useAppStore } from '@/stores'
const props = withDefaults(defineProps<Props>(), {
type: 'javascript',
codeJson: ''
codeJson: '',
})
const appStore = useAppStore()
const isDark = computed(() => appStore.theme === 'dark')
@@ -32,7 +32,7 @@ const defaultConfig = {
tabSize: 2,
basic: true,
dark: true,
readonly: true
readonly: true,
}
const config = defaultConfig

View File

@@ -7,14 +7,14 @@ export default defineComponent({
props: {
animation: {
type: Boolean,
default: true
default: true,
},
type: {
type: String as PropType<TPropsType>,
default: 'primary'
}
default: 'primary',
},
},
setup(props) {
return () => <span class={['gi-dot', { 'gi-dot-processing': props.animation }, `gi-dot-${props.type}`]}></span>
}
},
})

View File

@@ -3,17 +3,23 @@
<a-form ref="formRef" :model="form">
<a-table :data="form.tableData" :bordered="{ cell: true }" :pagination="false" v-bind="attrs">
<template #columns>
<a-table-column v-for="col in props.columns" :key="col.dataIndex" :title="col.title"
:data-index="col.dataIndex" :header-cell-class="headerCellClass(col)" v-bind="col.columnProps">
<a-table-column
v-for="col in props.columns" :key="col.dataIndex" :title="col.title"
:data-index="col.dataIndex" :header-cell-class="headerCellClass(col)" v-bind="col.columnProps"
>
<template #cell="{ record, rowIndex, column }">
<a-form-item :field="`tableData[${rowIndex}].${col.dataIndex}`" :label-col-style="{ display: 'none' }"
<a-form-item
:field="`tableData[${rowIndex}].${col.dataIndex}`" :label-col-style="{ display: 'none' }"
:wrapper-col-props="{ span: 24 }" v-bind="col.formItemProps"
:rules="[{ required: col.required || false, message: getRuleMessage(col) }, ...(col.rules || [])]">
:rules="[{ required: col.required || false, message: getRuleMessage(col) }, ...(col.rules || [])]"
>
<template v-if="col.slotName">
<slot :name="col.dataIndex" v-bind="{ record, rowIndex, column }"></slot>
</template>
<component :is="`a-${col.type}`" v-else v-bind="getComponentBindProps(col)"
v-model="record[col.dataIndex]" :disabled="isDisabled({ row: record, rowIndex, col })">
<component
:is="`a-${col.type}`" v-else v-bind="getComponentBindProps(col)"
v-model="record[col.dataIndex]" :disabled="isDisabled({ row: record, rowIndex, col })"
>
</component>
</a-form-item>
</template>
@@ -31,7 +37,7 @@ import type { ColumnItem, Disabled } from './type'
defineOptions({ name: 'GiEditTable', inheritAttrs: false })
const props = withDefaults(defineProps<Props>(), {
cellDisabled: false
cellDisabled: false,
})
defineSlots<{

View File

@@ -11,7 +11,7 @@ defineOptions({ name: 'GiFlexibleBox' })
const props = withDefaults(defineProps<Props>(), {
modelValue: false,
direction: 'right'
direction: 'right',
})
interface Props {

View File

@@ -2,20 +2,30 @@
<a-form ref="formRef" :auto-label-width="true" v-bind="options.form" :model="modelValue">
<a-grid class="w-full" :col-gap="8" v-bind="options.grid" :collapsed="collapsed">
<template v-for="(item, index) in columns" :key="item.field">
<a-grid-item v-if="!isHide(item.hide)" v-show="colVShow(index)" v-bind="item.gridItemProps || props.options.gridItem"
:span="item.span || options.gridItem?.span">
<a-form-item v-bind="item.formItemProps" :label="item.label" :field="item.field" :rules="item.rules"
:disabled="isDisabled(item.disabled)">
<slot v-if="!['group-title'].includes(item.type || '')" :name="item.field"
v-bind="{ disabled: isDisabled(item.disabled) }">
<a-grid-item
v-if="!isHide(item.hide)" v-show="colVShow(index)" v-bind="item.gridItemProps || props.options.gridItem"
:span="item.span || options.gridItem?.span"
>
<a-form-item
v-bind="item.formItemProps" :label="item.label" :field="item.field" :rules="item.rules"
:disabled="isDisabled(item.disabled)"
>
<slot
v-if="!['group-title'].includes(item.type || '')" :name="item.field"
v-bind="{ disabled: isDisabled(item.disabled) }"
>
<template v-if="item.type === 'range-picker'">
<DateRangePicker v-bind="(item.props as A.RangePickerInstance['$props'])"
:model-value="modelValue[item.field as keyof typeof modelValue]"
@update:model-value="valueChange($event, item.field)" />
<DateRangePicker
v-bind="(item.props as A.RangePickerInstance['$props'])"
:model-value="modelValue[item.field as keyof typeof modelValue]"
@update:model-value="valueChange($event, item.field)"
/>
</template>
<component :is="`a-${item.type}`" v-else v-bind="getComponentBindProps(item)"
:model-value="modelValue[item.field as keyof typeof modelValue]"
@update:model-value="valueChange($event, item.field)"></component>
<component
:is="`a-${item.type}`" v-else v-bind="getComponentBindProps(item)"
:model-value="modelValue[item.field as keyof typeof modelValue]"
@update:model-value="valueChange($event, item.field)"
></component>
</slot>
<slot v-else name="group-title">
<a-alert v-bind="item.props">{{ item.label }}</a-alert>
@@ -34,8 +44,10 @@
<template #icon><icon-refresh /></template>
<template #default>重置</template>
</a-button>
<a-button v-if="options.fold?.enable" class="gi-form__fold-btn" type="text" size="mini"
@click="collapsed = !collapsed">
<a-button
v-if="options.fold?.enable" class="gi-form__fold-btn" type="text" size="mini"
@click="collapsed = !collapsed"
>
<template #icon>
<icon-up v-if="!collapsed" />
<icon-down v-else />
@@ -60,7 +72,7 @@ interface Props {
}
const props = withDefaults(defineProps<Props>(), {
options: () => ({})
options: () => ({}),
})
const emit = defineEmits<{
@@ -72,7 +84,7 @@ const emit = defineEmits<{
const options = computed(() => ({
grid: { cols: 1 },
gridItem: { span: { xs: 2, sm: 1 } },
...props.options
...props.options,
}
))

View File

@@ -43,6 +43,6 @@ export function useGiForm(initValue: Columns) {
/** 设置 columns 某个对象属性的值 */
setValue,
/** 设置 columns.props 某个属性的值 */
setPropsValue
setPropsValue,
}
}

View File

@@ -74,7 +74,7 @@ defineOptions({ name: 'GiIconSelector' })
const props = withDefaults(defineProps<Props>(), {
modelValue: '',
enableCopy: false
enableCopy: false,
})
const emit = defineEmits(['select', 'update:modelValue'])

View File

@@ -25,7 +25,7 @@ const props = withDefaults(defineProps<Props>(), {
icon: '',
label: '',
more: false,
active: false
active: false,
})
const emit = defineEmits<{

View File

@@ -22,7 +22,7 @@
defineOptions({ name: 'GiOverFlowTags' })
withDefaults(defineProps<Props>(), {
data: () => []
data: () => [],
})
interface Props {
data: string[]

View File

@@ -15,7 +15,7 @@ defineOptions({ name: 'GiSvgIcon' })
const props = withDefaults(defineProps<Props>(), {
name: '',
color: '',
size: 20
size: 20,
})
interface Props {

View File

@@ -34,8 +34,10 @@
</a-doption>
</template>
</a-dropdown>
<a-popover v-if="showSettingColumnBtn" trigger="click" position="br"
:content-style="{ minWidth: '120px', padding: '6px 8px 10px' }">
<a-popover
v-if="showSettingColumnBtn" trigger="click" position="br"
:content-style="{ minWidth: '120px', padding: '6px 8px 10px' }"
>
<a-tooltip content="列设置">
<a-button>
<template #icon>
@@ -101,7 +103,7 @@ const props = withDefaults(defineProps<Props>(), {
title: '',
data: () => [],
disabledTools: () => [], // 禁止显示的工具
disabledColumnKeys: () => [] // 禁止控制显示隐藏的列
disabledColumnKeys: () => [], // 禁止控制显示隐藏的列
})
const emit = defineEmits<{
@@ -142,10 +144,10 @@ const size = ref<TableInstance['size']>('medium')
const isBordered = ref(false)
const isFullscreen = ref(false)
type SizeItem = { label: string, value: TableInstance['size'] }
interface SizeItem { label: string, value: TableInstance['size'] }
const sizeList: SizeItem[] = [
{ label: '紧凑', value: 'small' },
{ label: '默认', value: 'medium' }
{ label: '默认', value: 'medium' },
]
const handleSelect: DropdownInstance['onSelect'] = (value) => {
@@ -160,9 +162,9 @@ const showRefreshBtn = computed(() => !props.disabledTools.includes('refresh'))
const showSizeBtn = computed(() => !props.disabledTools.includes('size'))
const showFullscreenBtn = computed(() => !props.disabledTools.includes('fullscreen'))
const showSettingColumnBtn = computed(
() => !props.disabledTools.includes('setting') && attrs?.columns && (attrs?.columns as TableColumnData[])?.length
() => !props.disabledTools.includes('setting') && attrs?.columns && (attrs?.columns as TableColumnData[])?.length,
)
type SettingColumnItem = { title: string, key: string, show: boolean, disabled: boolean }
interface SettingColumnItem { title: string, key: string, show: boolean, disabled: boolean }
const settingColumnList = ref<SettingColumnItem[]>([])
// 重置配置列
@@ -176,8 +178,8 @@ const resetSettingColumns = () => {
title: typeof item.title === 'string' ? item.title : '',
show: item.show ?? true,
disabled: props.disabledColumnKeys.includes(
item.dataIndex || (typeof item.title === 'string' ? item.title : '')
)
item.dataIndex || (typeof item.title === 'string' ? item.title : ''),
),
})
})
}
@@ -188,7 +190,7 @@ watch(
() => {
resetSettingColumns()
},
{ immediate: true }
{ immediate: true },
)
// 排序和过滤可显示的列数据
@@ -201,7 +203,7 @@ const _columns = computed(() => {
.map((i) => i.key || (typeof i.title === 'string' ? i.title : ''))
// 显示的columns数据
const filterColumns = arr.filter((i) =>
showDataIndexs.includes(i.dataIndex || (typeof i.title === 'string' ? i.title : ''))
showDataIndexs.includes(i.dataIndex || (typeof i.title === 'string' ? i.title : '')),
)
const sortedColumns: TableColumnData[] = []
settingColumnList.value.forEach((i) => {

View File

@@ -16,7 +16,7 @@ const baseColorObj = {
blue: '#3491fa',
purple: '#722ed1',
pink: '#f5319d',
gray: '#86909c'
gray: '#86909c',
}
type BaseColor = keyof typeof baseColorObj
@@ -26,24 +26,24 @@ export default defineComponent({
props: {
type: {
type: String as PropType<PropsType>,
default: 'light'
default: 'light',
},
status: {
type: String as PropType<PropsStatus>,
default: 'primary'
default: 'primary',
},
color: {
type: String as PropType<BaseColor | string>,
default: ''
default: '',
},
size: {
type: String as PropType<PropsSize>,
default: 'small'
default: 'small',
},
closable: {
type: Boolean,
default: false
}
default: false,
},
},
emits: ['click', 'close'],
setup(props, { slots, emit }) {
@@ -125,5 +125,5 @@ export default defineComponent({
{props.closable && CloseIcon}
</span>
)
}
},
})

View File

@@ -22,7 +22,7 @@ const isDark = useDark({
storageKey: 'arco-theme',
onChanged(dark: boolean) {
appStore.toggleTheme(dark)
}
},
})
const toggleTheme = useToggle(isDark)

View File

@@ -8,28 +8,28 @@
</template>
</a-input>
<a-tree
ref="treeRef"
:data="treeData"
block-node
@select="handleDeptSelect"
ref="treeRef"
:data="treeData"
block-node
@select="handleDeptSelect"
/>
</a-col>
<a-col :span="24" :md="14" class="section">
<GiTable
v-model:selectedKeys="selectedKeys"
style="min-height: 600px;"
row-key="id"
:data="dataList"
:columns="tableColumns"
:loading="loading"
:scroll="{ x: '100%', y: '100%' }"
:pagination="pagination"
:disabled-tools="['size', 'fullscreen', 'setting', 'refresh']"
:row-selection="{ type: props.multiple ? 'checkbox' : 'radio', showCheckedAll: true }"
@select="onRowSelect"
@select-all="onTableSelectAll"
@refresh="search"
v-model:selectedKeys="selectedKeys"
style="min-height: 600px;"
row-key="id"
:data="dataList"
:columns="tableColumns"
:loading="loading"
:scroll="{ x: '100%', y: '100%' }"
:pagination="pagination"
:disabled-tools="['size', 'fullscreen', 'setting', 'refresh']"
:row-selection="{ type: props.multiple ? 'checkbox' : 'radio', showCheckedAll: true }"
@select="onRowSelect"
@select-all="onTableSelectAll"
@refresh="search"
>
<template #top>
<div>
@@ -90,7 +90,7 @@ import type { UserItem, UserSelectPropType } from '@/components/UserSelect/type'
const props = withDefaults(defineProps<UserSelectPropType & { selectedUsers: string | string[] }>(), {
multiple: false,
selectedUsers: () => []
selectedUsers: () => [],
})
const emit = defineEmits(['update:selectedUsers'])
@@ -106,7 +106,7 @@ const selectedData = ref<any[]>([])
const { tableData: dataList, loading, pagination, search } = useTable(
(page) => listUser({ ...queryForm.value, deptId: selectedDeptId.value, sort: [], ...page }),
{ immediate: false, formatResult: (data) => data.map((i) => ({ ...i, disabled: false })) }
{ immediate: false, formatResult: (data) => data.map((i) => ({ ...i, disabled: false })) },
)
// 刷新表单
@@ -119,7 +119,7 @@ const onRefresh = () => {
const { deptList, getDeptList } = useDept({
onSuccess: () => {
nextTick(() => treeRef.value?.expandAll(true))
}
},
})
// 部门树过滤函数
@@ -127,11 +127,11 @@ const deptTreeSearch = (keyword: string, data: TreeNodeData[]): TreeNodeData[] =
return data
.map((item) => ({
...item,
children: item.children ? deptTreeSearch(keyword, item.children) : []
children: item.children ? deptTreeSearch(keyword, item.children) : [],
}))
.filter(
(item) =>
item.title?.toLowerCase().includes(keyword.toLowerCase()) || item.children?.length
item.title?.toLowerCase().includes(keyword.toLowerCase()) || item.children?.length,
)
}
@@ -148,13 +148,13 @@ const tableColumns = [
{ title: '角色', dataIndex: 'roleNames' },
{ title: '手机号', dataIndex: 'phone' },
{ title: '邮箱', dataIndex: 'email' },
{ title: '状态', dataIndex: 'status', slotName: 'status' }
{ title: '状态', dataIndex: 'status', slotName: 'status' },
]
// 右侧已选用户列定义
const rightColumn = [
{ title: '昵称', dataIndex: 'nickname' },
{ title: '操作', dataIndex: 'action', slotName: 'action' }
{ title: '操作', dataIndex: 'action', slotName: 'action' },
]
// 处理部门选择

View File

@@ -2,13 +2,13 @@
<div>
<div style="display: flex;">
<a-select
v-model="selectedUsers"
:allow-clear="true"
:multiple="props.multiple"
:max-tag-count="4"
:field-names="{ value: 'id', label: 'nickname' }"
:options="options"
@change="handleSelectChange"
v-model="selectedUsers"
:allow-clear="true"
:multiple="props.multiple"
:max-tag-count="4"
:field-names="{ value: 'id', label: 'nickname' }"
:options="options"
@change="handleSelectChange"
/>
<a-tooltip content="选择用户">
<a-button @click="onOpen">
@@ -19,18 +19,18 @@
</a-tooltip>
</div>
<a-modal
v-model:visible="visible"
title="用户选择"
:width="width >= 1350 ? 1350 : '100%'"
:esc-to-close="true"
@ok="handleModalOk"
v-model:visible="visible"
title="用户选择"
:width="width >= 1350 ? 1350 : '100%'"
:esc-to-close="true"
@ok="handleModalOk"
>
<UserSelectContent
ref="userSelectContentRef"
:value="selectedUsers"
:multiple="props.multiple"
:selected-users="selectedUsers"
@update:selected-users="updateSelectedUsers"
ref="userSelectContentRef"
:value="selectedUsers"
:multiple="props.multiple"
:selected-users="selectedUsers"
@update:selected-users="updateSelectedUsers"
/>
</a-modal>
</div>
@@ -44,7 +44,7 @@ import type { UserSelectPropType } from '@/components/UserSelect/type'
const props = withDefaults(defineProps<UserSelectPropType>(), {
multiple: false, // 是否支持多选
value: ''
value: '',
})
const emit = defineEmits(['update:value'])

View File

@@ -2,8 +2,8 @@
<div style="position: relative">
<div class="verify-img-out">
<div
class="verify-img-panel"
:style="{
class="verify-img-panel"
:style="{
'width': setSize.imgWidth,
'height': setSize.imgHeight,
'background-size': `${setSize.imgWidth} ${setSize.imgHeight}`,
@@ -11,26 +11,26 @@
}"
>
<div
v-show="showRefresh"
class="verify-refresh"
style="z-index: 3"
@click="refresh"
v-show="showRefresh"
class="verify-refresh"
style="z-index: 3"
@click="refresh"
>
<i class="iconfont icon-refresh"></i>
</div>
<img
ref="canvas"
:src="`data:image/png;base64,${pointBackImgBase}`"
alt=""
style="width: 100%; height: 100%; display: block"
@click="bindingClick ? canvasClick($event) : undefined"
ref="canvas"
:src="`data:image/png;base64,${pointBackImgBase}`"
alt=""
style="width: 100%; height: 100%; display: block"
@click="bindingClick ? canvasClick($event) : undefined"
/>
<div
v-for="(tempPoint, index) in tempPoints"
:key="index"
class="point-area"
:style="{
v-for="(tempPoint, index) in tempPoints"
:key="index"
class="point-area"
:style="{
'background-color': '#1abd6c',
'color': '#fff',
'z-index': 9999,
@@ -50,8 +50,8 @@
</div>
<div
class="verify-bar-area"
:style="{
class="verify-bar-area"
:style="{
'width': setSize.imgWidth,
'color': barAreaColor,
'border-color': barAreaBorderColor,
@@ -70,11 +70,11 @@ import {
onMounted,
reactive,
ref,
toRefs
toRefs,
} from 'vue'
import {
checkBehaviorCaptcha,
getBehaviorCaptcha
getBehaviorCaptcha,
} from '@/apis/common/captcha'
import { resetSize } from '@/utils/verify'
import { encryptByAes } from '@/utils/encrypt'
@@ -85,34 +85,34 @@ export default {
// 弹出式pop固定fixed
mode: {
type: String,
default: ''
default: '',
},
captchaType: {
type: String
type: String,
},
// 间隔
vSpace: {
type: Number,
default: 5
default: 5,
},
imgSize: {
type: Object,
default() {
return {
width: '310px',
height: '155px'
height: '155px',
}
}
},
},
barSize: {
type: Object,
default() {
return {
width: '310px',
height: '40px'
height: '40px',
}
}
}
},
},
},
setup(props) {
const { mode, captchaType } = toRefs(props)
@@ -129,7 +129,7 @@ export default {
imgHeight: 0,
imgWidth: 0,
barHeight: 0,
barWidth: 0
barWidth: 0,
})
const tempPoints = reactive([])
const text = ref('')
@@ -141,7 +141,7 @@ export default {
// 请求背景图片和验证图片
function getPicture() {
const data = {
captchaType: captchaType.value
captchaType: captchaType.value,
}
getBehaviorCaptcha(data).then((res) => {
pointBackImgBase.value = res.data.originalImageBase64
@@ -226,7 +226,7 @@ export default {
const captchaVerification = secretKey.value
? encryptByAes(
`${backToken.value}---${JSON.stringify(checkPosArr)}`,
secretKey.value
secretKey.value,
)
: `${backToken.value}---${JSON.stringify(checkPosArr)}`
const data = {
@@ -234,7 +234,7 @@ export default {
pointJson: secretKey.value
? encryptByAes(JSON.stringify(checkPosArr), secretKey.value)
: JSON.stringify(checkPosArr),
token: backToken.value
token: backToken.value,
}
checkBehaviorCaptcha(data).then((res) => {
if (res.success && res.data.repCode === '0000') {
@@ -289,8 +289,8 @@ export default {
createPoint,
refresh,
getPicture,
pointTransform
pointTransform,
}
}
},
}
</script>

View File

@@ -1,38 +1,35 @@
<template>
<div style="position: relative">
<div
v-if="type === '2'"
class="verify-img-out"
:style="{ height: `${parseInt(setSize.imgHeight) + vSpace}px` }"
v-if="type === '2'"
class="verify-img-out"
:style="{ height: `${parseInt(setSize.imgHeight) + vSpace}px` }"
>
<div
class="verify-img-panel"
:style="{ width: setSize.imgWidth, height: setSize.imgHeight }"
class="verify-img-panel"
:style="{ width: setSize.imgWidth, height: setSize.imgHeight }"
>
<img
:src="`data:image/png;base64,${backImgBase}`"
alt=""
style="width: 100%; height: 100%; display: block"
:src="`data:image/png;base64,${backImgBase}`"
alt=""
style="width: 100%; height: 100%; display: block"
/>
<div v-show="showRefresh" class="verify-refresh" @click="refresh"
>
<i class="iconfont icon-refresh"></i
>
</div>
<div v-show="showRefresh" class="verify-refresh" @click="refresh">
<i class="iconfont icon-refresh"></i>
</div>
<transition name="tips">
<span
v-if="tipWords"
class="verify-tips"
:class="passFlag ? 'suc-bg' : 'err-bg'"
>{{ tipWords }}</span
>
v-if="tipWords"
class="verify-tips"
:class="passFlag ? 'suc-bg' : 'err-bg'"
>{{ tipWords }}</span>
</transition>
</div>
</div>
<!-- 公共部分 -->
<div
class="verify-bar-area"
:style="{
class="verify-bar-area"
:style="{
'width': setSize.imgWidth,
'height': barSize.height,
'line-height': barSize.height,
@@ -40,8 +37,8 @@
>
<span class="verify-msg" v-text="text"></span>
<div
class="verify-left-bar"
:style="{
class="verify-left-bar"
:style="{
'width': leftBarWidth !== undefined ? leftBarWidth : barSize.height,
'height': barSize.height,
'border-color': leftBarBorderColor,
@@ -50,25 +47,25 @@
>
<span class="verify-msg" v-text="finishText"></span>
<div
class="verify-move-block"
:style="{
class="verify-move-block"
:style="{
'width': barSize.height,
'height': barSize.height,
'background-color': moveBlockBackgroundColor,
'left': moveBlockLeft,
'transition': transitionLeft,
}"
@touchstart="start"
@mousedown="start"
@touchstart="start"
@mousedown="start"
>
<i
class="verify-icon iconfont" :class="[iconClass]"
:style="{ color: iconColor }"
class="verify-icon iconfont" :class="[iconClass]"
:style="{ color: iconColor }"
></i>
<div
v-if="type === '2'"
class="verify-sub-block"
:style="{
v-if="type === '2'"
class="verify-sub-block"
:style="{
'width':
`${Math.floor((parseInt(setSize.imgWidth) * 47) / 310)}px`,
'height': setSize.imgHeight,
@@ -77,9 +74,9 @@
}"
>
<img
:src="`data:image/png;base64,${blockBackImgBase}`"
alt=""
style="
:src="`data:image/png;base64,${blockBackImgBase}`"
alt=""
style="
width: 100%;
height: 100%;
display: block;
@@ -102,11 +99,11 @@ import {
reactive,
ref,
toRefs,
watch
watch,
} from 'vue'
import {
checkBehaviorCaptcha,
getBehaviorCaptcha
getBehaviorCaptcha,
} from '@/apis/common/captcha'
import { encryptByAes } from '@/utils/encrypt'
import { resetSize } from '@/utils/verify'
@@ -115,52 +112,52 @@ export default {
name: 'VerifySlide',
props: {
captchaType: {
type: String
type: String,
},
type: {
type: String,
default: '1'
default: '1',
},
// 弹出式pop固定fixed
mode: {
type: String,
default: 'fixed'
default: 'fixed',
},
vSpace: {
type: Number,
default: 5
default: 5,
},
explain: {
type: String,
default: '向右滑动完成验证'
default: '向右滑动完成验证',
},
imgSize: {
type: Object,
default() {
return {
width: '310px',
height: '155px'
height: '155px',
}
}
},
},
blockSize: {
type: Object,
default() {
return {
width: '50px',
height: '50px'
height: '50px',
}
}
},
},
barSize: {
type: Object,
default() {
return {
width: '310px',
height: '40px'
height: '40px',
}
}
}
},
},
},
setup(props) {
const { mode, captchaType, type, blockSize, explain } = toRefs(props)
@@ -180,7 +177,7 @@ export default {
imgHeight: 0,
imgWidth: 0,
barHeight: 0,
barWidth: 0
barWidth: 0,
})
const top = ref(0)
const left = ref(0)
@@ -201,7 +198,7 @@ export default {
// 请求背景图片和验证图片
function getPicture() {
const data = {
captchaType: captchaType.value
captchaType: captchaType.value,
}
getBehaviorCaptcha(data).then((res) => {
backImgBase.value = res.data.originalImageBase64
@@ -276,7 +273,7 @@ export default {
if (status.value && isEnd.value === false) {
let moveLeftDistance = Number.parseInt(
(moveBlockLeft.value || '').replace('px', ''),
10
10,
)
moveLeftDistance
= (moveLeftDistance * 310) / Number.parseInt(`${setSize.imgWidth}`, 10)
@@ -285,10 +282,10 @@ export default {
pointJson: secretKey.value
? encryptByAes(
JSON.stringify({ x: moveLeftDistance, y: 5.0 }),
secretKey.value
secretKey.value,
)
: JSON.stringify({ x: moveLeftDistance, y: 5.0 }),
token: backToken.value
token: backToken.value,
}
checkBehaviorCaptcha(data).then((res) => {
if (res.success && res.data.repCode === '0000') {
@@ -313,13 +310,13 @@ export default {
? encryptByAes(
`${backToken.value}---${JSON.stringify({
x: moveLeftDistance,
y: 5.0
y: 5.0,
})}`,
secretKey.value
secretKey.value,
)
: `${backToken.value}---${JSON.stringify({
x: moveLeftDistance,
y: 5.0
y: 5.0,
})}`
setTimeout(() => {
tipWords.value = ''
@@ -410,7 +407,7 @@ export default {
x = e.touches[0].pageX
}
startLeft.value = Math.floor(
x - barArea.value.getBoundingClientRect().left
x - barArea.value.getBoundingClientRect().left,
)
startMoveTime.value = +new Date() // 开始滑动的时间
if (isEnd.value === false) {
@@ -452,8 +449,8 @@ export default {
transitionWidth,
barArea,
refresh,
start
start,
}
}
},
}
</script>

View File

@@ -1,8 +1,8 @@
<template>
<div v-show="showBox" :class="mode === 'pop' ? 'mask' : ''">
<div
:class="mode === 'pop' ? 'verifybox' : ''"
:style="{ 'max-width': `${parseInt(imgSize.width) + 30}px` }"
:class="mode === 'pop' ? 'verifybox' : ''"
:style="{ 'max-width': `${parseInt(imgSize.width) + 30}px` }"
>
<div v-if="mode === 'pop'" class="verifybox-top">
请完成安全验证
@@ -11,24 +11,25 @@
</span>
</div>
<div
class="verifybox-bottom"
:style="{ padding: mode === 'pop' ? '15px' : '0' }"
class="verifybox-bottom"
:style="{ padding: mode === 'pop' ? '15px' : '0' }"
>
<!-- 验证码容器 -->
<!-- eslint-disable-next-line vue/no-restricted-v-bind -->
<component
:is="componentType"
v-if="componentType"
ref="instance"
:captcha-type="captchaType"
:type="verifyType"
:figure="figure"
:arith="arith"
:mode="mode"
:v-space="vSpace"
:explain="explain"
:img-size="imgSize"
:block-size="blockSize"
:bar-size="barSize"
:is="componentType"
v-if="componentType"
ref="instance"
:space="space"
:captcha-type="captchaType"
:type="verifyType"
:figure="figure"
:arith="arith"
:mode="mode"
:explain="explain"
:img-size="imgSize"
:block-size="blockSize"
:bar-size="barSize"
></component>
</div>
</div>
@@ -44,44 +45,44 @@ export default {
name: 'Vue2Verify',
components: {
VerifySlide,
VerifyPoints
VerifyPoints,
},
props: {
captchaType: {
type: String,
required: true
required: true,
},
figure: {
type: Number
type: Number,
},
arith: {
type: Number
type: Number,
},
mode: {
type: String,
default: 'pop'
default: 'pop',
},
vSpace: {
type: Number
space: {
type: Number,
},
explain: {
type: String
type: String,
},
imgSize: {
type: Object,
default() {
return {
width: '310px',
height: '155px'
height: '155px',
}
}
},
},
blockSize: {
type: Object
type: Object,
},
barSize: {
type: Object
}
type: Object,
},
},
setup(props) {
const { captchaType, mode } = toRefs(props)
@@ -135,9 +136,9 @@ export default {
instance,
showBox,
closeBox,
show
show,
}
}
},
}
</script>

View File

@@ -1,5 +1,5 @@
type LabelValueItem = { label: string, value: number, color: string }
interface LabelValueItem { label: string, value: number, color: string }
export const DisEnableStatusList: LabelValueItem[] = [
{ label: '启用', value: 1, color: 'green' },
{ label: '禁用', value: 2, color: 'red' }
{ label: '禁用', value: 2, color: 'red' },
]

View File

@@ -11,7 +11,7 @@ export const FileTypeList: FileTypeListItem[] = [
{ name: '文档', value: 3, icon: 'file-txt' },
{ name: '视频', value: 4, icon: 'file-video-color' },
{ name: '音频', value: 5, icon: 'file-music' },
{ name: '其他', value: 1, icon: 'file-other' }
{ name: '其他', value: 1, icon: 'file-other' },
]
export interface FileExtendNameIconMap {
@@ -34,7 +34,7 @@ export const FileIcon: FileExtendNameIconMap = {
html: 'file-html',
css: 'file-css',
js: 'file-js',
other: 'file-other' // 未知文件
other: 'file-other', // 未知文件
}
/** 图片类型 */

View File

@@ -6,5 +6,5 @@ export default {
install(Vue: App) {
Vue.directive('permission', hasPerm)
Vue.directive('role', hasRole)
}
},
}

View File

@@ -29,7 +29,7 @@ const directive: Directive = {
},
updated(el: HTMLElement, binding: DirectiveBinding) {
checkPermission(el, binding)
}
},
}
export default directive

View File

@@ -28,7 +28,7 @@ const directive: Directive = {
},
updated(el: HTMLElement, binding: DirectiveBinding) {
checkRole(el, binding)
}
},
}
export default directive

View File

@@ -3,7 +3,7 @@ import { useRoute, useRouter } from 'vue-router'
import { type FormInstance, Message, Modal } from '@arco-design/web-vue'
import { isEqual } from 'lodash-es'
type Option<T> = {
interface Option<T> {
key?: string
formRef?: Ref<FormInstance>
initApi: () => Promise<ApiRes<T>>
@@ -49,7 +49,7 @@ export function useFormCurd<T = any>(option: Option<T>) {
() => route.query,
() => {
initForm()
}
},
)
watch(
@@ -61,7 +61,7 @@ export function useFormCurd<T = any>(option: Option<T>) {
isChanged.value = true
}
},
{ immediate: true, deep: true }
{ immediate: true, deep: true },
)
const save = async () => {
@@ -92,7 +92,7 @@ export function useFormCurd<T = any>(option: Option<T>) {
hideCancel: false,
onOk: () => {
router.back()
}
},
})
} else {
router.back()

View File

@@ -12,7 +12,7 @@ export function useBreakpoint() {
md: 768, // >=768
lg: 992, // >=992
xl: 1200, // >=1200
xxl: 1600 // >=1600
xxl: 1600, // >=1600
})
const arr = breakpoints.current() as ComputedRef<Breakpoint[]>

View File

@@ -21,7 +21,7 @@ export const useDownload = async (api: () => Promise<any>, isNotify = true, temp
if (isNotify && !res?.code) {
Notification.warning({
title: '温馨提示',
content: '如果数据庞大会导致下载缓慢哦,请您耐心等待!'
content: '如果数据庞大会导致下载缓慢哦,请您耐心等待!',
})
}
if (res.status !== 200 || res.data == null || !(res.data instanceof Blob)) {

View File

@@ -14,6 +14,6 @@ export function useLoading(initValue = false) {
return {
loading,
setLoading,
toggle
toggle,
}
}

View File

@@ -3,7 +3,7 @@ import { useBreakpoint } from '@/hooks'
type Callback = () => void
export type Options = {
export interface Options {
defaultPageSize: number
defaultSizeOptions: number[]
}
@@ -27,7 +27,7 @@ export function usePagination(callback: Callback, options: Options = { defaultPa
pagination.current = 1
pagination.pageSize = size
callback && callback()
}
},
})
watch(
@@ -36,7 +36,7 @@ export function usePagination(callback: Callback, options: Options = { defaultPa
pagination.simple = ['xs'].includes(breakpoint.value)
pagination.showTotal = !['xs'].includes(breakpoint.value)
},
{ immediate: true }
{ immediate: true },
)
const changeCurrent = pagination.onChange
@@ -54,6 +54,6 @@ export function usePagination(callback: Callback, options: Options = { defaultPa
pagination,
changeCurrent,
changePageSize,
setTotal
setTotal,
}
}

View File

@@ -5,7 +5,7 @@ import { useLoading } from '@/hooks'
export function useRequest<T>(
api: () => Promise<AxiosResponse<ApiRes<T>>>,
defaultValue = [] as unknown as T,
isLoading = true
isLoading = true,
) {
const { loading, setLoading } = useLoading(isLoading)
const response = ref<T>(defaultValue)

View File

@@ -11,7 +11,7 @@ interface Options<T, U> {
paginationOption?: paginationOptions
}
type PaginationParams = { page: number, size: number }
interface PaginationParams { page: number, size: number }
type Api<T> = (params: PaginationParams) => Promise<ApiRes<PageRes<T[]>>> | Promise<ApiRes<T[]>>
export function useTable<T extends U, U = T>(api: Api<T>, options?: Options<T, U>) {
@@ -60,7 +60,7 @@ export function useTable<T extends U, U = T>(api: Api<T>, options?: Options<T, U
// 删除
const handleDelete = async <T>(
deleteApi: () => Promise<ApiRes<T>>,
options?: { title?: string, content?: string, successTip?: string, showModal?: boolean }
options?: { title?: string, content?: string, successTip?: string, showModal?: boolean },
): Promise<boolean | undefined> => {
const onDelete = async () => {
try {
@@ -85,7 +85,7 @@ export function useTable<T extends U, U = T>(api: Api<T>, options?: Options<T, U
okButtonProps: { status: 'danger' },
hideCancel: false,
maskClosable: false,
onBeforeOk: onDelete
onBeforeOk: onDelete,
})
}

View File

@@ -1,7 +1,9 @@
<template>
<div class="layout-mix">
<section v-if="isDesktop" class="layout-mix-left" :class="{ 'app-menu-dark': appStore.menuDark }"
:style="appStore.menuDark ? appStore.themeCSSVar : undefined">
<section
v-if="isDesktop" class="layout-mix-left" :class="{ 'app-menu-dark': appStore.menuDark }"
:style="appStore.menuDark ? appStore.themeCSSVar : undefined"
>
<Logo :collapsed="appStore.menuCollapse"></Logo>
<Menu :menus="leftMenus" :menu-style="{ width: '220px', flex: 1 }"></Menu>
</section>
@@ -9,8 +11,10 @@
<section class="layout-mix-right">
<header class="header">
<MenuFoldBtn></MenuFoldBtn>
<a-menu v-if="isDesktop" mode="horizontal" :selected-keys="activeMenu" :auto-open-selected="false"
:trigger-props="{ animationName: 'slide-dynamic-origin' }" @menu-item-click="onMenuItemClick">
<a-menu
v-if="isDesktop" mode="horizontal" :selected-keys="activeMenu" :auto-open-selected="false"
:trigger-props="{ animationName: 'slide-dynamic-origin' }" @menu-item-click="onMenuItemClick"
>
<a-menu-item v-for="item in topMenus" :key="item.path">
<template #icon>
<GiSvgIcon :name="getMenuIcon(item)" :size="24" />
@@ -94,7 +98,7 @@ watch(
getLeftMenus(newPath)
})
},
{ immediate: true }
{ immediate: true },
)
</script>

View File

@@ -1,8 +1,12 @@
<template>
<div v-if="isDesktop" class="asider" :class="{ 'app-menu-dark': appStore.menuDark }"
:style="appStore.menuDark ? appStore.themeCSSVar : undefined">
<a-layout-sider class="menu" collapsible breakpoint="xl" hide-trigger :width="230"
:collapsed="appStore.menuCollapse" @collapse="handleCollapse">
<div
v-if="isDesktop" class="asider" :class="{ 'app-menu-dark': appStore.menuDark }"
:style="appStore.menuDark ? appStore.themeCSSVar : undefined"
>
<a-layout-sider
class="menu" collapsible breakpoint="xl" hide-trigger :width="230"
:collapsed="appStore.menuCollapse" @collapse="handleCollapse"
>
<Logo :collapsed="appStore.menuCollapse"></Logo>
<a-scrollbar outer-class="menu-scroll-view" style="height: 100%; overflow: auto">
<Menu></Menu>

View File

@@ -30,7 +30,7 @@ const queryParam = reactive({
isRead: false,
sort: ['createTime,desc'],
page: 1,
size: 5
size: 5,
})
const messageList = ref<MessageResp[]>()

View File

@@ -6,16 +6,20 @@
<a-space>
<a-badge>
<template #content>
<icon-check-circle-fill v-if="appStore.layout === 'left'" style="color: rgb(var(--success-6))"
:size="16"></icon-check-circle-fill>
<icon-check-circle-fill
v-if="appStore.layout === 'left'" style="color: rgb(var(--success-6))"
:size="16"
></icon-check-circle-fill>
</template>
<LayoutItem mode="left" @click="appStore.layout = 'left'"></LayoutItem>
<p class="layout-text">默认布局</p>
</a-badge>
<a-badge>
<template #content>
<icon-check-circle-fill v-if="appStore.layout === 'mix'" :size="16"
style="color: rgb(var(--success-6))"></icon-check-circle-fill>
<icon-check-circle-fill
v-if="appStore.layout === 'mix'" :size="16"
style="color: rgb(var(--success-6))"
></icon-check-circle-fill>
</template>
<LayoutItem mode="mix" @click="appStore.layout = 'mix'"></LayoutItem>
<p class="layout-text">混合布局</p>
@@ -25,8 +29,10 @@
<a-divider orientation="center">系统主题</a-divider>
<a-row justify="center">
<ColorPicker theme="dark" :color="appStore.themeColor" :sucker-hide="true" :colors-default="defaultColorList"
@change-color="changeColor"></ColorPicker>
<ColorPicker
theme="dark" :color="appStore.themeColor" :sucker-hide="true" :colors-default="defaultColorList"
@change-color="changeColor"
></ColorPicker>
</a-row>
<a-divider orientation="center">界面显示</a-divider>
@@ -36,16 +42,20 @@
<a-switch v-model="appStore.tab" />
</a-descriptions-item>
<a-descriptions-item label="页签风格">
<a-select v-model="appStore.tabMode" placeholder="请选择" :options="tabModeList" :disabled="!appStore.tab"
:trigger-props="{ autoFitPopupMinWidth: true }" :style="{ width: '120px' }">
<a-select
v-model="appStore.tabMode" placeholder="请选择" :options="tabModeList" :disabled="!appStore.tab"
:trigger-props="{ autoFitPopupMinWidth: true }" :style="{ width: '120px' }"
>
</a-select>
</a-descriptions-item>
<a-descriptions-item label="动画显示">
<a-switch v-model="appStore.animate" />
</a-descriptions-item>
<a-descriptions-item label="动画显示">
<a-select v-model="appStore.animateMode" placeholder="请选择" :options="animateModeList"
:disabled="!appStore.animate" :style="{ width: '120px' }">
<a-select
v-model="appStore.animateMode" placeholder="请选择" :options="animateModeList"
:disabled="!appStore.animate" :style="{ width: '120px' }"
>
</a-select>
</a-descriptions-item>
<a-descriptions-item label="深色菜单">
@@ -72,17 +82,16 @@
import { ColorPicker } from 'vue-color-kit'
import 'vue-color-kit/dist/vue-color-kit.css'
import LayoutItem from './components/LayoutItem.vue'
import { useAppStore, useUserStore } from '@/stores'
import { useAppStore } from '@/stores'
defineOptions({ name: 'SettingDrawer' })
const appStore = useAppStore()
const userStore = useUserStore()
const visible = ref(false)
const tabModeList: App.TabItem[] = [
{ label: '卡片', value: 'card' },
{ label: '间隔卡片', value: 'card-gutter' },
{ label: '圆角', value: 'rounded' }
{ label: '圆角', value: 'rounded' },
]
const animateModeList: App.AnimateItem[] = [
@@ -90,14 +99,13 @@ const animateModeList: App.AnimateItem[] = [
{ label: '滑动', value: 'fade-slide' },
{ label: '渐变', value: 'fade' },
{ label: '底部滑出', value: 'fade-bottom' },
{ label: '缩放消退', value: 'fade-scale' }
{ label: '缩放消退', value: 'fade-scale' },
]
const open = () => {
visible.value = true
}
const waterMarkPlaceholder = ref<string>()
defineExpose({ open })
// 默认显示的主题色列表
@@ -117,10 +125,10 @@ const defaultColorList = [
'#43a047',
'#e53935',
'#f4511e',
'#6d4c41'
'#6d4c41',
]
type ColorObj = {
interface ColorObj {
hex: string
hsv: { h: number, s: number, v: number }
rgba: { r: number, g: number, b: number, a: number }

View File

@@ -140,7 +140,7 @@ const logout = () => {
} catch (error) {
return false
}
}
},
})
}

View File

@@ -10,7 +10,7 @@
import { useAppStore } from '@/stores'
const props = withDefaults(defineProps<Props>(), {
collapsed: false
collapsed: false,
})
const appStore = useAppStore()
const title = computed(() => appStore.getTitle())

View File

@@ -3,8 +3,8 @@
<a-menu-item
v-if="
isOneShowingChild
&& (!onlyOneChild?.children || onlyOneChild?.meta?.noShowingChildren)
&& !item?.meta?.alwaysShow
&& (!onlyOneChild?.children || onlyOneChild?.meta?.noShowingChildren)
&& !item?.meta?.alwaysShow
"
v-bind="attrs"
:key="onlyOneChild?.path"

View File

@@ -73,7 +73,7 @@ watch(
() => route.fullPath,
() => {
handleRouteChange()
}
},
)
// 点击页签

View File

@@ -1,2 +1,2 @@
/** 省市区数据类型 */
export type MockAreaItem = { label: string, code: string, children?: MockAreaItem[] }
export interface MockAreaItem { label: string, code: string, children?: MockAreaItem[] }

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@ export const resultSuccess = (data: unknown) => {
code: 200,
data,
msg: '请求成功',
success: true
success: true,
})
}
@@ -17,7 +17,7 @@ export const resultError = (data: unknown, msg: string, code = 500) => {
code,
data,
msg,
success: false
success: false,
})
}

View File

@@ -19,6 +19,6 @@ export default defineMock([
const data = parent?.item?.children?.map((i) => ({ label: i.label, code: i.code }))
return resultSuccess(data)
}
}
}
},
},
])

View File

@@ -13,25 +13,25 @@ export const constantRoutes: RouteRecordRaw[] = [
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/default/redirect/index.vue')
}
]
component: () => import('@/views/default/redirect/index.vue'),
},
],
},
{
path: '/login',
name: 'Login',
component: () => import('@/views/login/index.vue'),
meta: { hidden: true }
meta: { hidden: true },
},
{
path: '/:pathMatch(.*)*',
component: () => import('@/views/default/error/404.vue'),
meta: { hidden: true }
meta: { hidden: true },
},
{
path: '/403',
component: () => import('@/views/default/error/403.vue'),
meta: { hidden: true }
meta: { hidden: true },
},
{
path: '/',
@@ -44,25 +44,25 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/dashboard/workplace',
name: 'Workplace',
component: () => import('@/views/dashboard/workplace/index.vue'),
meta: { title: '工作台', icon: 'desktop', hidden: false, affix: true }
meta: { title: '工作台', icon: 'desktop', hidden: false, affix: true },
},
{
path: '/dashboard/analysis',
name: 'Analysis',
component: () => import('@/views/dashboard/analysis/index.vue'),
meta: { title: '分析页', icon: 'insert-chart', hidden: false }
}
]
meta: { title: '分析页', icon: 'insert-chart', hidden: false },
},
],
},
{
path: '/social/callback',
component: () => import('@/views/login/social/index.vue'),
meta: { hidden: true }
meta: { hidden: true },
},
{
path: '/pwdExpired',
component: () => import('@/views/login/pwdExpired/index.vue'),
meta: { hidden: true }
meta: { hidden: true },
},
{
path: '/setting',
@@ -74,22 +74,22 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/setting/profile',
name: 'SettingProfile',
component: () => import('@/views/setting/profile/index.vue'),
meta: { title: '个人中心', showInTabs: false }
meta: { title: '个人中心', showInTabs: false },
},
{
path: '/setting/message',
name: 'SettingMessage',
component: () => import('@/views/setting/message/index.vue'),
meta: { title: '消息中心', showInTabs: false }
}
]
}
meta: { title: '消息中心', showInTabs: false },
},
],
},
]
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: constantRoutes,
scrollBehavior: () => ({ left: 0, top: 0 })
scrollBehavior: () => ({ left: 0, top: 0 }),
})
/**

View File

@@ -27,7 +27,7 @@ const handleNotification = () => {
position: 'bottomRight',
footer: () => {
return h(Space, {}, () => [h(Button, { type: 'primary', onClick: () => onUpdateSystem(id) }, '更新'), h(Button, { type: 'secondary', onClick: () => onCloseUpdateSystem(id) }, '关闭')])
}
},
})
}
@@ -37,7 +37,7 @@ const handleNotification = () => {
*/
const getVersionTag = async () => {
const response = await fetch('/', {
cache: 'no-cache'
cache: 'no-cache',
})
return response.headers.get('etag') || response.headers.get('last-modified')
}

View File

@@ -59,7 +59,7 @@ const storeSetup = () => {
// 初始化系统配置
const initSiteConfig = () => {
listOptionDict({
category: 'SITE'
category: 'SITE',
}).then((res) => {
const resMap = new Map()
res.data.forEach((item) => {
@@ -118,7 +118,7 @@ const storeSetup = () => {
getLogo,
getTitle,
getCopyright,
getForRecord
getForRecord,
}
}

View File

@@ -9,7 +9,7 @@ const storeSetup = () => {
if (_code !== null && _code !== '') {
dictData.value.push({
code: _code,
items
items,
})
}
}
@@ -50,7 +50,7 @@ const storeSetup = () => {
setDict,
getDict,
deleteDict,
cleanDict
cleanDict,
}
}

View File

@@ -66,8 +66,8 @@ const formatAsyncRoutes = (menus: RouteItem[]) => {
keepAlive: item.isCache,
icon: item.icon,
showInTabs: item.showInTabs,
activeMenu: item.activeMenu
}
activeMenu: item.activeMenu,
},
}
})
return routes as RouteRecordRaw[]
@@ -124,7 +124,7 @@ const storeSetup = () => {
return {
routes,
asyncRoutes,
generateRoutes
generateRoutes,
}
}

View File

@@ -127,7 +127,7 @@ const storeSetup = () => {
closeRight,
closeAll,
reset,
init
init,
}
}

View File

@@ -11,7 +11,7 @@ import {
getUserInfo as getUserInfoApi,
logout as logoutApi,
phoneLogin as phoneLoginApi,
socialLogin as socialLoginApi
socialLogin as socialLoginApi,
} from '@/apis'
import { clearToken, getToken, setToken } from '@/utils/auth'
import { resetHasRouteFlag } from '@/router/permission'
@@ -30,7 +30,7 @@ const storeSetup = () => {
registrationDate: '',
deptName: '',
roles: [],
permissions: []
permissions: [],
})
const nickname = computed(() => userInfo.nickname)
const username = computed(() => userInfo.username)
@@ -123,10 +123,10 @@ const storeSetup = () => {
logout,
logoutCallBack,
getInfo,
resetToken
resetToken,
}
}
export const useUserStore = defineStore('user', storeSetup, {
persist: { paths: ['token', 'roles', 'permissions', 'pwdExpiredShow'], storage: localStorage }
persist: { paths: ['token', 'roles', 'permissions', 'pwdExpiredShow'], storage: localStorage },
})

View File

@@ -17,7 +17,7 @@ function getFileName(url: string) {
export function downloadByUrl({
url,
target = '_blank',
fileName
fileName,
}: {
url: string
target?: '_self' | '_blank'

View File

@@ -33,7 +33,7 @@ export function encryptByAes(word, keyWord = defaultKeyWork) {
const arcs = CryptoJS.enc.Utf8.parse(word)
const encrypted = CryptoJS.AES.encrypt(arcs, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
padding: CryptoJS.pad.Pkcs7,
})
return encrypted.toString()
}

View File

@@ -48,5 +48,5 @@ export default {
/** 验证用户是否含有指定角色,必须全部拥有 */
hasRoleAnd(roles: string[]) {
return roles.every((item) => authRole(item))
}
},
}

View File

@@ -30,12 +30,12 @@ const StatusCodeMessage: ICodeMessage = {
501: '服务未实现(501)',
502: '网络错误(502)',
503: '服务不可用(503)',
504: '网络超时(504)'
504: '网络超时(504)',
}
const http: AxiosInstance = axios.create({
baseURL: import.meta.env.VITE_API_PREFIX ?? import.meta.env.VITE_API_BASE_URL,
timeout: 30 * 1000
timeout: 30 * 1000,
})
// 请求拦截器
@@ -53,7 +53,7 @@ http.interceptors.request.use(
},
(error) => {
return Promise.reject(error)
}
},
)
// 响应拦截器
@@ -84,7 +84,7 @@ http.interceptors.response.use(
const userStore = useUserStore()
userStore.logoutCallBack()
router.replace('/login')
}
},
})
} else {
NProgress.done()
@@ -92,7 +92,7 @@ http.interceptors.response.use(
if (msg.length <= 15) {
messageErrorWrapper({
content: msg || '服务器端错误',
duration: 5 * 1000
duration: 5 * 1000,
})
} else {
notificationErrorWrapper(msg || '服务器端错误')
@@ -106,11 +106,10 @@ http.interceptors.response.use(
response
&& messageErrorWrapper({
content: StatusCodeMessage[response.status] || '服务器暂时未响应,请刷新页面并重试。若无法解决,请联系管理员',
duration: 5 * 1000
duration: 5 * 1000,
})
console.log(response.status)
return Promise.reject(error)
}
},
)
const request = <T = unknown>(config: AxiosRequestConfig): Promise<ApiRes<T>> => {
@@ -139,7 +138,7 @@ const get = <T = any>(url: string, params?: object, config?: AxiosRequestConfig)
paramsSerializer: (obj) => {
return qs.stringify(obj)
},
...config
...config,
})
}
@@ -148,7 +147,7 @@ const post = <T = any>(url: string, params?: object, config?: AxiosRequestConfig
method: 'post',
url,
data: params,
...config
...config,
})
}
@@ -157,7 +156,7 @@ const put = <T = any>(url: string, params?: object, config?: AxiosRequestConfig)
method: 'put',
url,
data: params,
...config
...config,
})
}
@@ -166,7 +165,7 @@ const patch = <T = any>(url: string, params?: object, config?: AxiosRequestConfi
method: 'patch',
url,
data: params,
...config
...config,
})
}
@@ -175,7 +174,7 @@ const del = <T = any>(url: string, params?: object, config?: AxiosRequestConfig)
method: 'delete',
url,
data: params,
...config
...config,
})
}
const download = (url: string, params?: object, config?: AxiosRequestConfig): Promise<AxiosResponse> => {
@@ -187,7 +186,7 @@ const download = (url: string, params?: object, config?: AxiosRequestConfig): Pr
paramsSerializer: (obj) => {
return qs.stringify(obj)
},
...config
...config,
})
}
export default { get, post, put, patch, del, request, requestNative, download }

View File

@@ -297,7 +297,7 @@ export function dateFormat(date = new Date(), pattern = YMD_HMS) {
'm+': date.getMinutes(),
's+': date.getSeconds(),
'q+': Math.floor((date.getMonth() + 3) / 3),
'S+': date.getMilliseconds()
'S+': date.getMilliseconds(),
}
let formattedDate = pattern // Start with the pattern
@@ -341,7 +341,7 @@ export function parseCron(cron: string) {
try {
const parse = expressionNoYear(cron)
const iter = CronParser.parseExpression(parse, {
currentDate: dateFormat(new Date())
currentDate: dateFormat(new Date()),
})
const result: string[] = []
for (let i = 1; i <= 5; i++) {

View File

@@ -1,6 +1,6 @@
import mitt from 'mitt'
type Events = {
interface Events {
// 自定义事件名称
event: void
// 任意传递的参数

View File

@@ -19,13 +19,14 @@ export const Code_4 = /^\d{4}$/
/** @desc 正则-url链接 */
export const Url
= /(((^https?:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)$/
// eslint-disable-next-line regexp/no-useless-quantifier
= /(((^https?:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-]*)?\??[-+=&;%@.\w]*#?\w*)?)$/
/** @desc 正则-16进颜色值 #333 #8c8c8c */
export const ColorRegex = /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
export const ColorRegex = /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
/** @desc 正则-只能是中文 */
export const OnlyCh = /^[\u4E00-\u9FA5]+$/gi
export const OnlyCh = /^[\u4E00-\u9FA5]+$/g
/** @desc 正则-只能是英文 */
export const OnlyEn = /^[a-zA-Z]*$/
export const OnlyEn = /^[a-z]*$/i

View File

@@ -34,6 +34,6 @@ export function resetSize(vm) {
imgWidth: img_width,
imgHeight: img_height,
barWidth: bar_width,
barHeight: bar_height
barHeight: bar_height,
}
}

View File

@@ -23,7 +23,7 @@ const tooltipItemsHtmlString = (items) => {
<span class="tooltip-value">
${el.value}
</span>
</div>`
</div>`,
)
.join('')
}
@@ -36,7 +36,7 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
left: '40',
right: 0,
top: '20',
bottom: '100'
bottom: '100',
},
xAxis: {
type: 'category',
@@ -49,24 +49,24 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
if (idx === 0) return ''
if (idx === xAxis.value.length - 1) return ''
return `${value}`
}
},
},
axisLine: {
lineStyle: {
color: isDark ? '#3f3f3f' : '#A9AEB8'
}
color: isDark ? '#3f3f3f' : '#A9AEB8',
},
},
axisTick: {
show: true,
alignWithLabel: true,
lineStyle: {
color: '#86909C'
color: '#86909C',
},
interval(idx: number) {
if (idx === 0) return false
if (idx === xAxis.value.length - 1) return false
return true
}
},
},
splitLine: {
show: true,
@@ -75,16 +75,16 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
return idx !== xAxis.value.length - 1
},
lineStyle: {
color: isDark ? '#3F3F3F' : '#E5E8EF'
}
color: isDark ? '#3F3F3F' : '#E5E8EF',
},
},
axisPointer: {
show: true,
lineStyle: {
color: '#23ADFF',
width: 2
}
}
width: 2,
},
},
},
yAxis: {
type: 'value',
@@ -95,17 +95,17 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
return `${value / 1000}k`
}
return `${value}`
}
},
},
axisLine: {
show: false
show: false,
},
splitLine: {
lineStyle: {
type: 'dashed',
color: isDark ? '#3F3F3F' : '#E5E8EF'
}
}
color: isDark ? '#3F3F3F' : '#E5E8EF',
},
},
},
tooltip: {
show: true,
@@ -117,7 +117,7 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
${tooltipItemsHtmlString(params)}
</div>`
},
className: 'echarts-tooltip-diy'
className: 'echarts-tooltip-diy',
},
series: [
{
@@ -133,23 +133,23 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
focus: 'series',
itemStyle: {
borderWidth: 2,
borderColor: '#E0E3FF'
}
borderColor: '#E0E3FF',
},
},
areaStyle: {
opacity: 0.8,
color: new graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(17, 126, 255, 0.16)'
color: 'rgba(17, 126, 255, 0.16)',
},
{
offset: 1,
color: 'rgba(17, 128, 255, 0)'
}
])
}
}
color: 'rgba(17, 128, 255, 0)',
},
]),
},
},
],
dataZoom: [
{
@@ -164,18 +164,18 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
handleSize: '20',
handleStyle: {
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowBlur: 4
shadowBlur: 4,
},
brushSelect: false,
backgroundColor: isDark ? '#313132' : '#F2F3F5'
backgroundColor: isDark ? '#313132' : '#F2F3F5',
},
{
type: 'inside',
start: 0,
end: 100,
zoomOnMouseWheel: false
}
]
zoomOnMouseWheel: false,
},
],
}
})

View File

@@ -29,7 +29,7 @@ const tooltipItemsHtmlString = (items) => {
<span class="tooltip-value">
${el.value}
</span>
</div>`
</div>`,
)
.join('')
}
@@ -43,14 +43,14 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
left: '38',
right: '5',
top: '10',
bottom: '50'
bottom: '50',
},
legend: {
bottom: -3,
icon: 'circle',
textStyle: {
color: '#4E5969'
}
color: '#4E5969',
},
},
xAxis: {
type: 'category',
@@ -63,13 +63,13 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
if (idx === 0) return ''
if (idx === xAxis.value.length - 1) return ''
return `${value}`
}
},
},
axisLine: {
show: false
show: false,
},
axisTick: {
show: false
show: false,
},
splitLine: {
show: true,
@@ -78,16 +78,16 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
return idx !== xAxis.value.length - 1
},
lineStyle: {
color: isDark ? '#3F3F3F' : '#E5E8EF'
}
color: isDark ? '#3F3F3F' : '#E5E8EF',
},
},
axisPointer: {
show: true,
lineStyle: {
color: '#23ADFF',
width: 2
}
}
width: 2,
},
},
},
yAxis: {
type: 'value',
@@ -98,17 +98,17 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
return `${value / 1000}k`
}
return `${value}`
}
},
},
axisLine: {
show: false
show: false,
},
splitLine: {
lineStyle: {
type: 'dashed',
color: isDark ? '#3F3F3F' : '#E5E8EF'
}
}
color: isDark ? '#3F3F3F' : '#E5E8EF',
},
},
},
tooltip: {
show: true,
@@ -120,7 +120,7 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
${tooltipItemsHtmlString(params)}
</div>`
},
className: 'echarts-tooltip-diy'
className: 'echarts-tooltip-diy',
},
series: [
{
@@ -136,22 +136,22 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
focus: 'series',
itemStyle: {
borderWidth: 2,
borderColor: '#E0E3FF'
}
borderColor: '#E0E3FF',
},
},
areaStyle: {
opacity: 0.8,
color: new graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(17, 126, 255, 0.16)'
color: 'rgba(17, 126, 255, 0.16)',
},
{
offset: 1,
color: 'rgba(17, 128, 255, 0)'
}
])
}
color: 'rgba(17, 128, 255, 0)',
},
]),
},
},
{
name: '独立IP',
@@ -166,24 +166,24 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
focus: 'series',
itemStyle: {
borderWidth: 2,
borderColor: '#E2F2FF'
}
borderColor: '#E2F2FF',
},
},
areaStyle: {
opacity: 0.8,
color: new graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(17, 126, 255, 0.16)'
color: 'rgba(17, 126, 255, 0.16)',
},
{
offset: 1,
color: 'rgba(17, 128, 255, 0)'
}
])
}
}
]
color: 'rgba(17, 128, 255, 0)',
},
]),
},
},
],
}
})

View File

@@ -23,15 +23,15 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
icon: 'circle',
itemWidth: 8,
textStyle: {
color: isDark ? 'rgba(255,255,255,0.7)' : '#4E5969'
color: isDark ? 'rgba(255,255,255,0.7)' : '#4E5969',
},
itemStyle: {
borderWidth: 0
}
borderWidth: 0,
},
},
tooltip: {
show: true,
trigger: 'item'
trigger: 'item',
},
series: [
{
@@ -40,15 +40,15 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
center: ['50%', '42%'],
label: {
formatter: '{d}% ',
color: isDark ? 'rgba(255, 255, 255, 0.7)' : '#4E5969'
color: isDark ? 'rgba(255, 255, 255, 0.7)' : '#4E5969',
},
itemStyle: {
borderColor: isDark ? '#000' : '#fff',
borderWidth: 1
borderWidth: 1,
},
data: chartData.value
}
]
data: chartData.value,
},
],
}
})
@@ -64,8 +64,8 @@ const getChartData = async () => {
chartData.value.push({
...item,
itemStyle: {
color: data.length > 1 && index === data.length - 1 ? colors[colors.length - 1] : colors[index]
}
color: data.length > 1 && index === data.length - 1 ? colors[colors.length - 1] : colors[index],
},
})
})
} finally {

View File

@@ -39,7 +39,6 @@
<script lang="ts" setup>
import { computed } from 'vue'
import type { EChartsOption } from 'echarts'
import { useChart } from '@/hooks'
import { useAppStore } from '@/stores'
@@ -50,24 +49,24 @@ const count = ref(0)
const growth = ref(0)
const xAxis = ref<string[]>([])
const chartData = ref<number[]>([])
const { chartOption } = useChart((isDark: EChartsOption) => {
const { chartOption } = useChart(() => {
return {
grid: {
left: 0,
right: 30,
top: 10,
bottom: 0
bottom: 0,
},
xAxis: {
type: 'category',
data: xAxis.value
data: xAxis.value,
},
yAxis: {
show: false
show: false,
},
tooltip: {
show: true,
trigger: 'axis'
trigger: 'axis',
},
series: [
{
@@ -79,10 +78,10 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
lineStyle: {
color: '#246EFF',
width: 2,
type: 'dashed'
}
}
]
type: 'dashed',
},
},
],
}
})

View File

@@ -39,7 +39,6 @@
<script lang="ts" setup>
import { computed } from 'vue'
import type { EChartsOption } from 'echarts'
import { useChart } from '@/hooks'
import { useAppStore } from '@/stores'
@@ -49,13 +48,13 @@ const isDark = computed(() => appStore.theme === 'dark')
const count = ref(0)
const growth = ref(0)
const chartData = ref<number[]>([])
const { chartOption } = useChart((isDark: EChartsOption) => {
const { chartOption } = useChart(() => {
return {
grid: {
left: 0,
right: 0,
top: 0,
bottom: 0
bottom: 0,
},
legend: {
show: true,
@@ -66,11 +65,11 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
itemWidth: 6,
itemHeight: 6,
textStyle: {
color: '#4E5969'
}
color: '#4E5969',
},
},
tooltip: {
show: true
show: true,
},
series: [
{
@@ -79,11 +78,11 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
radius: ['50%', '70%'],
center: ['30%', '50%'],
label: {
show: false
show: false,
},
data: chartData.value
}
]
data: chartData.value,
},
],
}
})
@@ -101,8 +100,8 @@ const getChartData = async () => {
name: `示例${index + 1}`,
value: item,
itemStyle: {
color: data.length > 1 && index === data.length - 1 ? colors[colors.length - 1] : colors[index]
}
color: data.length > 1 && index === data.length - 1 ? colors[colors.length - 1] : colors[index],
},
})
})
} finally {

View File

@@ -39,7 +39,6 @@
<script lang="ts" setup>
import { computed } from 'vue'
import type { EChartsOption } from 'echarts'
import { useChart } from '@/hooks'
import { useAppStore } from '@/stores'
import { type DashboardChartCommonResp, getDashboardOverviewIp as getData } from '@/apis'
@@ -52,24 +51,24 @@ const today = ref(0)
const growth = ref(0)
const xAxis = ref<string[]>([])
const chartData = ref<number[]>([])
const { chartOption } = useChart((isDark: EChartsOption) => {
const { chartOption } = useChart(() => {
return {
grid: {
left: 0,
right: 30,
top: 10,
bottom: 0
bottom: 0,
},
xAxis: {
type: 'category',
data: xAxis.value
data: xAxis.value,
},
yAxis: {
show: false
show: false,
},
tooltip: {
show: true,
trigger: 'axis'
trigger: 'axis',
},
series: [
{
@@ -79,10 +78,10 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
showSymbol: false,
lineStyle: {
color: '#2CAB40',
width: 2
}
}
]
width: 2,
},
},
],
}
})

View File

@@ -39,7 +39,6 @@
<script lang="ts" setup>
import { computed } from 'vue'
import type { EChartsOption } from 'echarts'
import { useChart } from '@/hooks'
import { useAppStore } from '@/stores'
import { type DashboardChartCommonResp, getDashboardOverviewPv as getData } from '@/apis'
@@ -52,24 +51,24 @@ const today = ref(0)
const growth = ref(0)
const xAxis = ref<string[]>([])
const chartData = ref<number[]>([])
const { chartOption } = useChart((isDark: EChartsOption) => {
const { chartOption } = useChart(() => {
return {
grid: {
left: 0,
right: 30,
top: 10,
bottom: 0
bottom: 0,
},
xAxis: {
type: 'category',
data: xAxis.value
data: xAxis.value,
},
yAxis: {
show: false
show: false,
},
tooltip: {
show: true,
trigger: 'axis'
trigger: 'axis',
},
series: [
{
@@ -79,10 +78,10 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
showSymbol: false,
lineStyle: {
color: '#246EFF',
width: 2
}
}
]
width: 2,
},
},
],
}
})

View File

@@ -21,7 +21,7 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
left: 55,
right: 20,
top: 0,
bottom: 20
bottom: 20,
},
xAxis: {
type: 'value',
@@ -30,38 +30,38 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
formatter(value: number, idx: number) {
if (idx === 0) return String(value)
return `${Number(value) / 1000}k`
}
},
},
splitLine: {
lineStyle: {
color: isDark ? '#484849' : '#E5E8EF'
}
}
color: isDark ? '#484849' : '#E5E8EF',
},
},
},
yAxis: {
type: 'category',
data: yAxis.value,
axisLabel: {
show: true,
color: '#4E5969'
color: '#4E5969',
},
axisTick: {
show: true,
length: 2,
lineStyle: {
color: '#A9AEB8'
color: '#A9AEB8',
},
alignWithLabel: true
alignWithLabel: true,
},
axisLine: {
lineStyle: {
color: isDark ? '#484849' : '#A9AEB8'
}
}
color: isDark ? '#484849' : '#A9AEB8',
},
},
},
tooltip: {
show: true,
trigger: 'axis'
trigger: 'axis',
},
series: [
{
@@ -70,10 +70,10 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
barWidth: 7,
itemStyle: {
color: '#4086FF',
borderRadius: 4
}
}
]
borderRadius: 4,
},
},
],
}
})

View File

@@ -23,15 +23,15 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
icon: 'circle',
itemWidth: 8,
textStyle: {
color: isDark ? 'rgba(255,255,255,0.7)' : '#4E5969'
color: isDark ? 'rgba(255,255,255,0.7)' : '#4E5969',
},
itemStyle: {
borderWidth: 0
}
borderWidth: 0,
},
},
tooltip: {
show: true,
trigger: 'item'
trigger: 'item',
},
series: [
{
@@ -40,15 +40,15 @@ const { chartOption } = useChart((isDark: EChartsOption) => {
center: ['50%', '42%'],
label: {
formatter: '{d}% ',
color: isDark ? 'rgba(255, 255, 255, 0.7)' : '#4E5969'
color: isDark ? 'rgba(255, 255, 255, 0.7)' : '#4E5969',
},
itemStyle: {
borderColor: isDark ? '#000' : '#fff',
borderWidth: 1
borderWidth: 1,
},
data: chartData.value
}
]
data: chartData.value,
},
],
}
})
@@ -64,8 +64,8 @@ const getChartData = async () => {
chartData.value.push({
...item,
itemStyle: {
color: data.length > 1 && index === data.length - 1 ? colors[colors.length - 1] : colors[index]
}
color: data.length > 1 && index === data.length - 1 ? colors[colors.length - 1] : colors[index],
},
})
})
} finally {

View File

@@ -23,11 +23,11 @@
const images = [
{
src: `https://continew.top/qrcode-text.png?${new Date().getTime()}`,
url: 'https://continew.top/about/intro.html'
url: 'https://continew.top/about/intro.html',
},
{
src: `https://continew.top/sponsor.png?${new Date().getTime()}`,
url: 'https://continew.top/sponsor.html'
}
url: 'https://continew.top/sponsor.html',
},
]
</script>

View File

@@ -30,7 +30,7 @@ const links = [
{ text: '常见问题', url: 'https://continew.top/faq.html' },
{ text: '更新日志', url: 'https://continew.top/admin/other/changelog.html' },
{ text: '贡献指南', url: 'https://continew.top/admin/other/contributing.html' },
{ text: '赞助支持 💖', url: 'https://continew.top/sponsor.html' }
{ text: '赞助支持 💖', url: 'https://continew.top/sponsor.html' },
]
</script>

View File

@@ -139,7 +139,7 @@ const get = <T = unknown>(url: string, params?: object, config?: AxiosRequestCon
paramsSerializer: (obj) => {
return qs.stringify(obj)
},
...config
...config,
})
.then((res: AxiosResponse) => resolve(res.data))
.catch((err: { msg: string }) => reject(err))
@@ -156,7 +156,7 @@ const getDataList = async () => {
data.forEach((item) => {
dataList.value.push({
...item,
createTimeString: dayjs(new Date(item.createTime)).fromNow()
createTimeString: dayjs(new Date(item.createTime)).fromNow(),
})
})
} catch (err) {

Some files were not shown because too many files have changed in this diff Show More