提交 1ee567f2 作者: 方治民

Merge branch '3.x' of https://gitlab.yiring.com/basic/basic-vue-admin into electron

...@@ -6,7 +6,9 @@ import type { MockMethod } from 'vite-plugin-mock' ...@@ -6,7 +6,9 @@ import type { MockMethod } from 'vite-plugin-mock'
* @param path 请求地址 * @param path 请求地址
* @returns 拼接 BASE_URL 后的请求地址 * @returns 拼接 BASE_URL 后的请求地址
*/ */
export const URL = (path: string): string => `/basic-api${path}` export function URL(path: string): string {
return `/basic-api${path}`
}
/** /**
* 通用响应工具类 * 通用响应工具类
......
import type { MockMethod } from 'vite-plugin-mock' import type { MockMethod } from 'vite-plugin-mock'
import { Response } from '../_util' import { Response } from '../_util'
const demoList = (keyword, count = 20) => { function demoList(keyword, count = 20) {
const result = { const result = {
list: [] as any[], list: [] as any[],
} }
......
import type { MockMethod } from 'vite-plugin-mock' import type { MockMethod } from 'vite-plugin-mock'
import { Response } from '../_util' import { Response } from '../_util'
const demoTreeList = (keyword) => { function demoTreeList(keyword) {
const result = { const result = {
list: [] as Recordable[], list: [] as Recordable[],
} }
......
...@@ -4,7 +4,7 @@ import qs from 'qs' ...@@ -4,7 +4,7 @@ import qs from 'qs'
import type { MockMethod } from 'vite-plugin-mock' import type { MockMethod } from 'vite-plugin-mock'
import { Request, Response } from '../_util' import { Request, Response } from '../_util'
const parseFormParams = (req: IncomingMessage): Promise<Recordable> => { function parseFormParams(req: IncomingMessage): Promise<Recordable> {
return new Promise((resolve) => { return new Promise((resolve) => {
let body = '' let body = ''
req.on('data', function (chunk) { req.on('data', function (chunk) {
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
"@vueuse/core": "^9.13.0", "@vueuse/core": "^9.13.0",
"@vueuse/shared": "^9.13.0", "@vueuse/shared": "^9.13.0",
"@zxcvbn-ts/core": "^2.2.1", "@zxcvbn-ts/core": "^2.2.1",
"ant-design-vue": "^3.2.16", "ant-design-vue": "^3.2.19",
"axios": "^0.26.1", "axios": "^0.26.1",
"codemirror": "^6.0.1", "codemirror": "^6.0.1",
"cropperjs": "^1.5.13", "cropperjs": "^1.5.13",
...@@ -91,9 +91,9 @@ ...@@ -91,9 +91,9 @@
"nanoid": "^4.0.2", "nanoid": "^4.0.2",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"path-to-regexp": "^6.2.1", "path-to-regexp": "^6.2.1",
"pinia": "^2.0.33", "pinia": "^2.0.35",
"print-js": "^1.6.0", "print-js": "^1.6.0",
"qrcode": "^1.5.1", "qrcode": "^1.5.3",
"qs": "^6.11.1", "qs": "^6.11.1",
"resize-observer-polyfill": "^1.5.1", "resize-observer-polyfill": "^1.5.1",
"showdown": "^2.1.0", "showdown": "^2.1.0",
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
"sortablejs": "^1.15.0", "sortablejs": "^1.15.0",
"stompjs": "^2.3.3", "stompjs": "^2.3.3",
"tinymce": "^5.10.7", "tinymce": "^5.10.7",
"vditor": "^3.9.1", "vditor": "^3.9.2",
"vue": "^3.2.47", "vue": "^3.2.47",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-json-pretty": "^2.2.4", "vue-json-pretty": "^2.2.4",
...@@ -121,10 +121,10 @@ ...@@ -121,10 +121,10 @@
"@types/fs-extra": "^11.0.1", "@types/fs-extra": "^11.0.1",
"@types/inquirer": "^9.0.3", "@types/inquirer": "^9.0.3",
"@types/intro.js": "^5.1.1", "@types/intro.js": "^5.1.1",
"@types/lodash": "^4.14.192", "@types/lodash": "^4.14.194",
"@types/lodash-es": "^4.17.7", "@types/lodash-es": "^4.17.7",
"@types/mockjs": "^1.0.7", "@types/mockjs": "^1.0.7",
"@types/node": "^18.15.11", "@types/node": "^18.16.1",
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.5.0", "@types/qrcode": "^1.5.0",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
...@@ -132,10 +132,10 @@ ...@@ -132,10 +132,10 @@
"@types/sockjs-client": "^1.5.1", "@types/sockjs-client": "^1.5.1",
"@types/sortablejs": "^1.15.1", "@types/sortablejs": "^1.15.1",
"@types/stompjs": "^2.3.5", "@types/stompjs": "^2.3.5",
"@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.57.0", "@typescript-eslint/parser": "^5.59.1",
"@vitejs/plugin-legacy": "^4.0.2", "@vitejs/plugin-legacy": "^4.0.3",
"@vitejs/plugin-vue": "^4.1.0", "@vitejs/plugin-vue": "^4.2.1",
"@vitejs/plugin-vue-jsx": "^3.0.1", "@vitejs/plugin-vue-jsx": "^3.0.1",
"@vue/compiler-dom": "^3.2.47", "@vue/compiler-dom": "^3.2.47",
"@vue/compiler-sfc": "^3.2.47", "@vue/compiler-sfc": "^3.2.47",
...@@ -154,40 +154,39 @@ ...@@ -154,40 +154,39 @@
"eslint": "^8.37.0", "eslint": "^8.37.0",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.10.0", "eslint-plugin-vue": "^9.11.0",
"esno": "^0.16.3", "esno": "^0.16.3",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"husky": "^8.0.3", "husky": "^8.0.3",
"inquirer": "^9.1.5", "inquirer": "^9.2.0",
"less": "^4.1.3", "less": "^4.1.3",
"lint-staged": "^13.2.0", "lint-staged": "^13.2.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"pont-engine": "^1.5.7", "pont-engine": "^1.5.7",
"postcss": "^8.4.21", "postcss": "^8.4.23",
"postcss-html": "^1.5.0", "postcss-html": "^1.5.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
"prettier": "^2.8.7", "prettier": "^2.8.8",
"rimraf": "^4.4.1", "rimraf": "^4.4.1",
"rollup": "^2.79.1", "rollup": "^3.21.0",
"rollup-plugin-visualizer": "^5.9.0", "rollup-plugin-visualizer": "^5.9.0",
"sort-package-json": "^2.4.1", "sort-package-json": "^2.4.1",
"stylelint": "^14.16.1", "stylelint": "^15.6.0",
"stylelint-config-prettier": "^9.0.5", "stylelint-config-recommended": "^12.0.0",
"stylelint-config-recommended": "^9.0.0",
"stylelint-config-recommended-vue": "^1.4.0", "stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard": "^29.0.0", "stylelint-config-standard": "^33.0.0",
"stylelint-order": "^5.0.0", "stylelint-order": "^6.0.3",
"terser": "^5.16.8", "terser": "^5.17.1",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^5.0.3", "typescript": "^5.0.4",
"unplugin-auto-import": "^0.15.2", "unplugin-auto-import": "^0.15.3",
"vite": "^4.2.1", "vite": "^4.3.2",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-html": "^3.2.0", "vite-plugin-html": "^3.2.0",
"vite-plugin-mkcert": "^1.14.0", "vite-plugin-mkcert": "^1.14.0",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.8",
"vite-plugin-purge-icons": "^0.9.2", "vite-plugin-purge-icons": "^0.9.2",
"vite-plugin-pwa": "^0.14.7", "vite-plugin-pwa": "^0.14.7",
"vite-plugin-style-import": "^2.0.0", "vite-plugin-style-import": "^2.0.0",
...@@ -196,7 +195,7 @@ ...@@ -196,7 +195,7 @@
"vite-plugin-vue-setup-extend": "^0.4.0", "vite-plugin-vue-setup-extend": "^0.4.0",
"vite-plugin-windicss": "^1.8.10", "vite-plugin-windicss": "^1.8.10",
"vue-eslint-parser": "^9.1.1", "vue-eslint-parser": "^9.1.1",
"vue-tsc": "^1.2.0" "vue-tsc": "^1.4.4"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=14"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -9,4 +9,6 @@ enum Api { ...@@ -9,4 +9,6 @@ enum Api {
* @description: Trigger ajax error * @description: Trigger ajax error
*/ */
export const fireErrorApi = () => defHttp.get({ url: Api.Error }) export function fireErrorApi() {
return defHttp.get({ url: Api.Error })
}
...@@ -9,6 +9,6 @@ enum Api { ...@@ -9,6 +9,6 @@ enum Api {
* @description: Get user menu based on id * @description: Get user menu based on id
*/ */
export const getMenuList = () => { export function getMenuList() {
return defHttp.get<getMenuListResultModel>({ url: Api.GetMenuList }) return defHttp.get<getMenuListResultModel>({ url: Api.GetMenuList })
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import { SearchOutlined } from '@ant-design/icons-vue' import { SearchOutlined } from '@ant-design/icons-vue'
import AppSearchFooter from './AppSearchFooter.vue' import AppSearchFooter from './AppSearchFooter.vue'
import Icon from '/@/components/Icon' import Icon from '/@/components/Icon'
// @ts-expect-error // @ts-expect-error
import vClickOutside from '/@/directives/clickOutside' import vClickOutside from '/@/directives/clickOutside'
import { useDesign } from '/@/hooks/web/useDesign' import { useDesign } from '/@/hooks/web/useDesign'
...@@ -163,7 +164,7 @@ ...@@ -163,7 +164,7 @@
&__item { &__item {
&-enter { &-enter {
opacity: 0% !important; opacity: 0 !important;
} }
} }
} }
...@@ -249,7 +250,7 @@ ...@@ -249,7 +250,7 @@
background-color: @primary-color; background-color: @primary-color;
.@{prefix-cls}-list__item-enter { .@{prefix-cls}-list__item-enter {
opacity: 100%; opacity: 1;
} }
} }
...@@ -263,7 +264,7 @@ ...@@ -263,7 +264,7 @@
&-enter { &-enter {
width: 30px; width: 30px;
opacity: 0%; opacity: 0;
} }
} }
} }
......
import { ref } from 'vue' import { ref } from 'vue'
// 每行个数 // 每行个数
export const grid = ref(12) export const grid = ref(12)
// slider属性 // slider属性
export const useSlider = (min = 6, max = 12) => { export function useSlider(min = 6, max = 12) {
// 每行显示个数滑动条 // 每行显示个数滑动条
const getMarks = () => { const getMarks = () => {
const l = {} const l = {}
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import { useI18n } from '/@/hooks/web/useI18n' import { useI18n } from '/@/hooks/web/useI18n'
import type { ButtonProps } from '/@/components/Button' import type { ButtonProps } from '/@/components/Button'
import Icon from '/@/components/Icon' import Icon from '/@/components/Icon'
const props = { const props = {
width: { type: [String, Number], default: '200px' }, width: { type: [String, Number], default: '200px' },
value: { type: String }, value: { type: String },
...@@ -110,7 +111,7 @@ ...@@ -110,7 +111,7 @@
} }
&-image-mask { &-image-mask {
opacity: 0%; opacity: 0;
position: absolute; position: absolute;
width: inherit; width: inherit;
height: inherit; height: inherit;
...@@ -126,7 +127,7 @@ ...@@ -126,7 +127,7 @@
} }
&-image-mask:hover { &-image-mask:hover {
opacity: 4000%; opacity: 40;
} }
&-upload-btn { &-upload-btn {
......
...@@ -88,7 +88,7 @@ export function useDrawer(): UseDrawerReturnType { ...@@ -88,7 +88,7 @@ export function useDrawer(): UseDrawerReturnType {
return [register, methods] return [register, methods]
} }
export const useDrawerInner = (callbackFn?: Fn): UseDrawerInnerReturnType => { export function useDrawerInner(callbackFn?: Fn): UseDrawerInnerReturnType {
const drawerInstanceRef = ref<Nullable<DrawerInstance>>(null) const drawerInstanceRef = ref<Nullable<DrawerInstance>>(null)
const currentInstance = getCurrentInstance() const currentInstance = getCurrentInstance()
const uidRef = ref<string>('') const uidRef = ref<string>('')
......
...@@ -52,7 +52,9 @@ ...@@ -52,7 +52,9 @@
} }
}) })
const getAttr = (key: string | number) => ({ key }) function getAttr(key: string | number) {
return { key }
}
</script> </script>
<template> <template>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
display: inline-block; display: inline-block;
overflow: hidden; overflow: hidden;
vertical-align: -0.15em; vertical-align: -0.15em;
fill: currentColor; fill: currentcolor;
} }
.svg-icon-spin { .svg-icon-spin {
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
* @param darkModeVal 深色模式值 * @param darkModeVal 深色模式值
* @param themeMode 主题类型——外观(默认), 内容, 代码块 * @param themeMode 主题类型——外观(默认), 内容, 代码块
*/ */
export const getTheme = ( export function getTheme(
darkModeVal: 'light' | 'dark' | string, darkModeVal: 'light' | 'dark' | string,
themeMode: 'default' | 'content' | 'code' = 'default', themeMode: 'default' | 'content' | 'code' = 'default',
) => { ) {
const isDark = darkModeVal === 'dark' const isDark = darkModeVal === 'dark'
switch (themeMode) { switch (themeMode) {
case 'default': case 'default':
......
...@@ -84,7 +84,7 @@ export function useModal(): UseModalReturnType { ...@@ -84,7 +84,7 @@ export function useModal(): UseModalReturnType {
return [register, methods] return [register, methods]
} }
export const useModalInner = (callbackFn?: Fn): UseModalInnerReturnType => { export function useModalInner(callbackFn?: Fn): UseModalInnerReturnType {
const modalInstanceRef = ref<Nullable<ModalMethods>>(null) const modalInstanceRef = ref<Nullable<ModalMethods>>(null)
const currentInstance = getCurrentInstance() const currentInstance = getCurrentInstance()
const uidRef = ref<string>('') const uidRef = ref<string>('')
......
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
overflow: hidden; overflow: hidden;
.ant-modal { .ant-modal {
top: 0 !important; inset: 0 !important;
right: 0 !important;
bottom: 0 !important;
left: 0 !important;
width: 100% !important; width: 100% !important;
height: 100%; height: 100%;
...@@ -110,17 +107,20 @@ ...@@ -110,17 +107,20 @@
.ant-modal-confirm .ant-modal-body { .ant-modal-confirm .ant-modal-body {
padding: 24px !important; padding: 24px !important;
} }
@media screen and (max-height: 600px) {
@media screen and (min-height: 600px) {
.ant-modal { .ant-modal {
top: 60px; top: 60px;
} }
} }
@media screen and (max-height: 540px) {
@media screen and (min-height: 540px) {
.ant-modal { .ant-modal {
top: 30px; top: 30px;
} }
} }
@media screen and (max-height: 480px) {
@media screen and (min-height: 480px) {
.ant-modal { .ant-modal {
top: 10px; top: 10px;
} }
......
...@@ -414,10 +414,7 @@ ...@@ -414,10 +414,7 @@
<style lang="less"> <style lang="less">
.img-preview { .img-preview {
position: fixed; position: fixed;
top: 0; inset: 0;
right: 0;
bottom: 0;
left: 0;
z-index: @preview-comp-z-index; z-index: @preview-comp-z-index;
background: rgb(0 0 0 / 50%); background: rgb(0 0 0 / 50%);
user-select: none; user-select: none;
......
...@@ -3,7 +3,7 @@ import type { QRCodeRenderersOptions } from 'qrcode' ...@@ -3,7 +3,7 @@ import type { QRCodeRenderersOptions } from 'qrcode'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
import type { ContentType, RenderQrCodeParams } from './typing' import type { ContentType, RenderQrCodeParams } from './typing'
export const renderQrCode = ({ canvas, content, width = 0, options: params = {} }: RenderQrCodeParams) => { export function renderQrCode({ canvas, content, width = 0, options: params = {} }: RenderQrCodeParams) {
const options = cloneDeep(params) const options = cloneDeep(params)
// 容错率,默认对内容少的二维码采用高容错率,内容多的二维码采用低容错率 // 容错率,默认对内容少的二维码采用高容错率,内容多的二维码采用低容错率
options.errorCorrectionLevel = options.errorCorrectionLevel || getErrorCorrectionLevel(content) options.errorCorrectionLevel = options.errorCorrectionLevel || getErrorCorrectionLevel(content)
......
import { isString } from '/@/utils/is' import { isString } from '/@/utils/is'
import type { LogoType, RenderQrCodeParams } from './typing' import type { LogoType, RenderQrCodeParams } from './typing'
export const drawLogo = ({ canvas, logo }: RenderQrCodeParams) => {
export function drawLogo({ canvas, logo }: RenderQrCodeParams) {
if (!logo) { if (!logo) {
return new Promise((resolve) => { return new Promise((resolve) => {
resolve((canvas as HTMLCanvasElement).toDataURL()) resolve((canvas as HTMLCanvasElement).toDataURL())
......
import { renderQrCode } from './drawCanvas' import { renderQrCode } from './drawCanvas'
import { drawLogo } from './drawLogo' import { drawLogo } from './drawLogo'
import type { RenderQrCodeParams } from './typing' import type { RenderQrCodeParams } from './typing'
export const toCanvas = (options: RenderQrCodeParams) => {
export function toCanvas(options: RenderQrCodeParams) {
return renderQrCode(options) return renderQrCode(options)
.then(() => { .then(() => {
return options return options
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import { toObject } from './util' import { toObject } from './util'
import { computed, defineComponent, nextTick, onBeforeUnmount, onMounted, provide, ref, unref } from 'vue' import { computed, defineComponent, nextTick, onBeforeUnmount, onMounted, provide, ref, unref } from 'vue'
import Bar from './bar' import Bar from './bar'
const { scrollbar } = componentSetting const { scrollbar } = componentSetting
export default defineComponent({ export default defineComponent({
...@@ -142,7 +143,7 @@ ...@@ -142,7 +143,7 @@
display: none; display: none;
width: 0; width: 0;
height: 0; height: 0;
opacity: 0%; opacity: 0;
} }
} }
} }
...@@ -168,7 +169,7 @@ ...@@ -168,7 +169,7 @@
bottom: 2px; bottom: 2px;
z-index: 1; z-index: 1;
border-radius: 4px; border-radius: 4px;
opacity: 0%; opacity: 0;
transition: opacity 80ms ease; transition: opacity 80ms ease;
&.is-vertical { &.is-vertical {
...@@ -194,7 +195,7 @@ ...@@ -194,7 +195,7 @@
.scrollbar:active > .scrollbar__bar, .scrollbar:active > .scrollbar__bar,
.scrollbar:focus > .scrollbar__bar, .scrollbar:focus > .scrollbar__bar,
.scrollbar:hover > .scrollbar__bar { .scrollbar:hover > .scrollbar__bar {
opacity: 100%; opacity: 1;
transition: opacity 340ms ease-out; transition: opacity 340ms ease-out;
} }
</style> </style>
...@@ -63,9 +63,11 @@ const validEvents = [ ...@@ -63,9 +63,11 @@ const validEvents = [
'onVisualAid', 'onVisualAid',
] ]
const isValidKey = (key: string) => validEvents.includes(key) function isValidKey(key: string) {
return validEvents.includes(key)
}
export const bindHandlers = (initEvent: Event, listeners: any, editor: any): void => { export function bindHandlers(initEvent: Event, listeners: any, editor: any): void {
Object.keys(listeners) Object.keys(listeners)
.filter(isValidKey) .filter(isValidKey)
.forEach((key: string) => { .forEach((key: string) => {
......
...@@ -17,7 +17,7 @@ function isAuth(el: Element, binding: any) { ...@@ -17,7 +17,7 @@ function isAuth(el: Element, binding: any) {
} }
} }
const mounted = (el: Element, binding: DirectiveBinding<any>) => { function mounted(el: Element, binding: DirectiveBinding<any>) {
isAuth(el, binding) isAuth(el, binding)
} }
......
...@@ -8,7 +8,7 @@ export interface ScrollToParams { ...@@ -8,7 +8,7 @@ export interface ScrollToParams {
callback?: () => any callback?: () => any
} }
const easeInOutQuad = (t: number, b: number, c: number, d: number) => { function easeInOutQuad(t: number, b: number, c: number, d: number) {
t /= d / 2 t /= d / 2
if (t < 1) { if (t < 1) {
return (c / 2) * t * t + b return (c / 2) * t * t + b
...@@ -16,11 +16,11 @@ const easeInOutQuad = (t: number, b: number, c: number, d: number) => { ...@@ -16,11 +16,11 @@ const easeInOutQuad = (t: number, b: number, c: number, d: number) => {
t-- t--
return (-c / 2) * (t * (t - 2) - 1) + b return (-c / 2) * (t * (t - 2) - 1) + b
} }
const move = (el: HTMLElement, amount: number) => { function move(el: HTMLElement, amount: number) {
el.scrollTop = amount el.scrollTop = amount
} }
const position = (el: HTMLElement) => { function position(el: HTMLElement) {
return el.scrollTop return el.scrollTop
} }
export function useScrollTo({ el, to, duration = 500, callback }: ScrollToParams) { export function useScrollTo({ el, to, duration = 500, callback }: ScrollToParams) {
......
...@@ -3,7 +3,7 @@ import type { GlobConfig } from '/#/config' ...@@ -3,7 +3,7 @@ import type { GlobConfig } from '/#/config'
import { warn } from '/@/utils/log' import { warn } from '/@/utils/log'
import { getAppEnvConfig } from '/@/utils/env' import { getAppEnvConfig } from '/@/utils/env'
export const useGlobSetting = (): Readonly<GlobConfig> => { export function useGlobSetting(): Readonly<GlobConfig> {
const { const {
VITE_GLOB_APP_TITLE, VITE_GLOB_APP_TITLE,
VITE_GLOB_API_URL, VITE_GLOB_API_URL,
......
...@@ -7,7 +7,7 @@ import { useRouter } from 'vue-router' ...@@ -7,7 +7,7 @@ import { useRouter } from 'vue-router'
/** /**
* @description: Full screen display content * @description: Full screen display content
*/ */
export const useFullContent = () => { export function useFullContent() {
const appStore = useAppStore() const appStore = useAppStore()
const router = useRouter() const router = useRouter()
const { currentRoute } = router const { currentRoute } = router
......
...@@ -52,4 +52,6 @@ export function useI18n(namespace?: string): { ...@@ -52,4 +52,6 @@ export function useI18n(namespace?: string): {
// 为什么要编写此函数? // 为什么要编写此函数?
// 主要用于配合vscode i18nn ally插件。此功能仅用于路由和菜单。请在其他地方使用useI18n // 主要用于配合vscode i18nn ally插件。此功能仅用于路由和菜单。请在其他地方使用useI18n
export const t = (key: string) => key export function t(key: string) {
return key
}
...@@ -69,7 +69,7 @@ function createConfirm(options: ModalOptionsEx): ConfirmOptions { ...@@ -69,7 +69,7 @@ function createConfirm(options: ModalOptionsEx): ConfirmOptions {
return Modal.confirm(opt) as unknown as ConfirmOptions return Modal.confirm(opt) as unknown as ConfirmOptions
} }
const getBaseOptions = () => { function getBaseOptions() {
const { t } = useI18n() const { t } = useI18n()
return { return {
okText: t('common.okText'), okText: t('common.okText'),
......
...@@ -30,7 +30,7 @@ export function useGo(_router?: Router) { ...@@ -30,7 +30,7 @@ export function useGo(_router?: Router) {
/** /**
* @description: redo current page * @description: redo current page
*/ */
export const useRedo = (_router?: Router) => { export function useRedo(_router?: Router) {
const { replace, currentRoute } = _router || useRouter() const { replace, currentRoute } = _router || useRouter()
const { query, params = {}, name, fullPath } = unref(currentRoute.value) const { query, params = {}, name, fullPath } = unref(currentRoute.value)
function redo(): Promise<boolean> { function redo(): Promise<boolean> {
......
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
&--mobile { &--mobile {
.@{logo-prefix-cls} { .@{logo-prefix-cls} {
&__title { &__title {
opacity: 100%; opacity: 1;
} }
} }
} }
......
...@@ -79,7 +79,7 @@ export const topMenuAlignOptions = [ ...@@ -79,7 +79,7 @@ export const topMenuAlignOptions = [
}, },
] ]
export const getMenuTriggerOptions = (hideTop: boolean) => { export function getMenuTriggerOptions(hideTop: boolean) {
return [ return [
{ {
value: TriggerEnum.NONE, value: TriggerEnum.NONE,
......
...@@ -522,14 +522,14 @@ ...@@ -522,14 +522,14 @@
font-size: 18px; font-size: 18px;
color: @primary-color; color: @primary-color;
border-bottom: 1px solid rgb(238 238 238); border-bottom: 1px solid rgb(238 238 238);
opacity: 0%; opacity: 0;
transition: unset; transition: unset;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
&.show { &.show {
min-width: 130px; min-width: 130px;
opacity: 100%; opacity: 1;
transition: all 0.5s ease; transition: all 0.5s ease;
} }
......
...@@ -4,17 +4,21 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout' ...@@ -4,17 +4,21 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout'
export const PAGE_NOT_FOUND_NAME = 'PageNotFound' export const PAGE_NOT_FOUND_NAME = 'PageNotFound'
export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue') export function EXCEPTION_COMPONENT() {
return import('/@/views/sys/exception/Exception.vue')
}
/** /**
* @description: default layout * @description: default layout
*/ */
export const LAYOUT = () => import('/@/layouts/default/index.vue') export function LAYOUT() {
return import('/@/layouts/default/index.vue')
}
/** /**
* @description: parent-layout * @description: parent-layout
*/ */
export const getParentLayout = (_name?: string) => { export function getParentLayout(_name?: string) {
return () => return () =>
new Promise((resolve) => { new Promise((resolve) => {
resolve({ resolve({
......
...@@ -33,15 +33,15 @@ export function createParamMenuGuard(router: Router) { ...@@ -33,15 +33,15 @@ export function createParamMenuGuard(router: Router) {
}) })
} }
const getPermissionMode = () => { function getPermissionMode() {
const appStore = useAppStoreWithOut() const appStore = useAppStoreWithOut()
return appStore.getProjectConfig.permissionMode return appStore.getProjectConfig.permissionMode
} }
const isBackMode = () => { function isBackMode() {
return getPermissionMode() === PermissionModeEnum.BACK return getPermissionMode() === PermissionModeEnum.BACK
} }
const isRouteMappingMode = () => { function isRouteMappingMode() {
return getPermissionMode() === PermissionModeEnum.ROUTE_MAPPING return getPermissionMode() === PermissionModeEnum.ROUTE_MAPPING
} }
...@@ -7,7 +7,9 @@ import { warn } from '/@/utils/log' ...@@ -7,7 +7,9 @@ import { warn } from '/@/utils/log'
import { createRouter, createWebHashHistory } from 'vue-router' import { createRouter, createWebHashHistory } from 'vue-router'
export type LayoutMapKey = 'LAYOUT' export type LayoutMapKey = 'LAYOUT'
const IFRAME = () => import('/@/views/sys/iframe/FrameBlank.vue') function IFRAME() {
return import('/@/views/sys/iframe/FrameBlank.vue')
}
const LayoutMap = new Map<string, () => Promise<typeof import('*.vue')>>() const LayoutMap = new Map<string, () => Promise<typeof import('*.vue')>>()
......
...@@ -6,11 +6,12 @@ import { basicRoutes } from './routes' ...@@ -6,11 +6,12 @@ import { basicRoutes } from './routes'
// 白名单应该包含基本静态路由 // 白名单应该包含基本静态路由
const WHITE_NAME_LIST: string[] = [] const WHITE_NAME_LIST: string[] = []
const getRouteNames = (array: any[]) => function getRouteNames(array: any[]) {
array.forEach((item) => { return array.forEach((item) => {
WHITE_NAME_LIST.push(item.name) WHITE_NAME_LIST.push(item.name)
getRouteNames(item.children || []) getRouteNames(item.children || [])
}) })
}
getRouteNames(basicRoutes) getRouteNames(basicRoutes)
// app router // app router
......
...@@ -24,19 +24,19 @@ Object.keys(modules).forEach((key) => { ...@@ -24,19 +24,19 @@ Object.keys(modules).forEach((key) => {
// ==========Helper=========== // ==========Helper===========
// =========================== // ===========================
const getPermissionMode = () => { function getPermissionMode() {
const appStore = useAppStoreWithOut() const appStore = useAppStoreWithOut()
return appStore.getProjectConfig.permissionMode return appStore.getProjectConfig.permissionMode
} }
const isBackMode = () => { function isBackMode() {
return getPermissionMode() === PermissionModeEnum.BACK return getPermissionMode() === PermissionModeEnum.BACK
} }
const isRouteMappingMode = () => { function isRouteMappingMode() {
return getPermissionMode() === PermissionModeEnum.ROUTE_MAPPING return getPermissionMode() === PermissionModeEnum.ROUTE_MAPPING
} }
const isRoleMode = () => { function isRoleMode() {
return getPermissionMode() === PermissionModeEnum.ROLE return getPermissionMode() === PermissionModeEnum.ROLE
} }
...@@ -62,7 +62,7 @@ async function getAsyncMenus() { ...@@ -62,7 +62,7 @@ async function getAsyncMenus() {
return staticMenus return staticMenus
} }
export const getMenus = async (): Promise<Menu[]> => { export async function getMenus(): Promise<Menu[]> {
const menus = await getAsyncMenus() const menus = await getAsyncMenus()
if (isRoleMode()) { if (isRoleMode()) {
const routes = router.getRoutes() const routes = router.getRoutes()
......
...@@ -26,7 +26,7 @@ function handleGotoPage(router: Router) { ...@@ -26,7 +26,7 @@ function handleGotoPage(router: Router) {
go(unref(router.currentRoute).path, true) go(unref(router.currentRoute).path, true)
} }
const getToTarget = (tabItem: RouteLocationNormalized) => { function getToTarget(tabItem: RouteLocationNormalized) {
const { params, path, query } = tabItem const { params, path, query } = tabItem
return { return {
params: params || {}, params: params || {},
......
...@@ -5,7 +5,7 @@ import { DEFAULT_CACHE_TIME, enableStorageEncryption } from '/@/settings/encrypt ...@@ -5,7 +5,7 @@ import { DEFAULT_CACHE_TIME, enableStorageEncryption } from '/@/settings/encrypt
export type Options = Partial<CreateStorageParams> export type Options = Partial<CreateStorageParams>
const createOptions = (storage: Storage, options: Options = {}): Options => { function createOptions(storage: Storage, options: Options = {}): Options {
return { return {
// No encryption in debug mode // No encryption in debug mode
hasEncrypt: enableStorageEncryption, hasEncrypt: enableStorageEncryption,
...@@ -17,15 +17,15 @@ const createOptions = (storage: Storage, options: Options = {}): Options => { ...@@ -17,15 +17,15 @@ const createOptions = (storage: Storage, options: Options = {}): Options => {
export const WebStorage = create(createOptions(sessionStorage)) export const WebStorage = create(createOptions(sessionStorage))
export const createStorage = (storage: Storage = sessionStorage, options: Options = {}) => { export function createStorage(storage: Storage = sessionStorage, options: Options = {}) {
return create(createOptions(storage, options)) return create(createOptions(storage, options))
} }
export const createSessionStorage = (options: Options = {}) => { export function createSessionStorage(options: Options = {}) {
return createStorage(sessionStorage, { ...options, timeout: DEFAULT_CACHE_TIME }) return createStorage(sessionStorage, { ...options, timeout: DEFAULT_CACHE_TIME })
} }
export const createLocalStorage = (options: Options = {}) => { export function createLocalStorage(options: Options = {}) {
return createStorage(localStorage, { ...options, timeout: DEFAULT_CACHE_TIME }) return createStorage(localStorage, { ...options, timeout: DEFAULT_CACHE_TIME })
} }
......
...@@ -9,14 +9,14 @@ export interface CreateStorageParams extends EncryptionParams { ...@@ -9,14 +9,14 @@ export interface CreateStorageParams extends EncryptionParams {
hasEncrypt: boolean hasEncrypt: boolean
timeout?: Nullable<number> timeout?: Nullable<number>
} }
export const createStorage = ({ export function createStorage({
prefixKey = '', prefixKey = '',
storage = sessionStorage, storage = sessionStorage,
key = cacheCipher.key, key = cacheCipher.key,
iv = cacheCipher.iv, iv = cacheCipher.iv,
timeout = null, timeout = null,
hasEncrypt = true, hasEncrypt = true,
}: Partial<CreateStorageParams> = {}) => { }: Partial<CreateStorageParams> = {}) {
if (hasEncrypt && [key.length, iv.length].some((item) => item !== 16)) { if (hasEncrypt && [key.length, iv.length].some((item) => item !== 16)) {
throw new Error('When hasEncrypt is true, the key or iv must be 16 bits!') throw new Error('When hasEncrypt is true, the key or iv must be 16 bits!')
} }
......
...@@ -12,7 +12,9 @@ const DEFAULT_CONFIG: TreeHelperConfig = { ...@@ -12,7 +12,9 @@ const DEFAULT_CONFIG: TreeHelperConfig = {
} }
// 获取配置。 Object.assign 从一个或多个源对象复制到目标对象 // 获取配置。 Object.assign 从一个或多个源对象复制到目标对象
const getConfig = (config: Partial<TreeHelperConfig>) => Object.assign({}, DEFAULT_CONFIG, config) function getConfig(config: Partial<TreeHelperConfig>) {
return Object.assign({}, DEFAULT_CONFIG, config)
}
// tree from list // tree from list
// 列表中的树 // 列表中的树
......
...@@ -5,7 +5,9 @@ import { isFunction } from '/@/utils/is' ...@@ -5,7 +5,9 @@ import { isFunction } from '/@/utils/is'
// Used to store the identification and cancellation function of each request // Used to store the identification and cancellation function of each request
let pendingMap = new Map<string, Canceler>() let pendingMap = new Map<string, Canceler>()
export const getPendingUrl = (config: AxiosRequestConfig) => [config.method, config.url].join('&') export function getPendingUrl(config: AxiosRequestConfig) {
return [config.method, config.url].join('&')
}
export class AxiosCanceler { export class AxiosCanceler {
/** /**
......
...@@ -5,7 +5,7 @@ import { unref } from 'vue' ...@@ -5,7 +5,7 @@ import { unref } from 'vue'
import { isObject } from '/@/utils/is' import { isObject } from '/@/utils/is'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
export const noop = () => {} export function noop() {}
/** /**
* @description: Set ui mount node * @description: Set ui mount node
...@@ -82,7 +82,7 @@ export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormal ...@@ -82,7 +82,7 @@ export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormal
} }
} }
export const withInstall = <T>(component: T, alias?: string) => { export function withInstall<T>(component: T, alias?: string) {
const comp = component as any const comp = component as any
comp.install = (app: App) => { comp.install = (app: App) => {
app.component(comp.name || comp.displayName, component) app.component(comp.name || comp.displayName, component)
......
...@@ -133,7 +133,7 @@ export function buildProp< ...@@ -133,7 +133,7 @@ export function buildProp<
type NativePropType = [((...args: any) => any) | { new (...args: any): any } | undefined | null] type NativePropType = [((...args: any) => any) | { new (...args: any): any } | undefined | null]
export const buildProps = < export function buildProps<
O extends { O extends {
[K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any> [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any>
? O[K] ? O[K]
...@@ -145,10 +145,8 @@ export const buildProps = < ...@@ -145,10 +145,8 @@ export const buildProps = <
: never : never
: never : never
}, },
>( >(props: O) {
props: O, return fromPairs(Object.entries(props).map(([key, option]) => [key, buildProp(option as any, key)])) as unknown as {
) =>
fromPairs(Object.entries(props).map(([key, option]) => [key, buildProp(option as any, key)])) as unknown as {
[K in keyof O]: O[K] extends { [propKey]: boolean } [K in keyof O]: O[K] extends { [propKey]: boolean }
? O[K] ? O[K]
: [O[K]] extends NativePropType : [O[K]] extends NativePropType
...@@ -157,10 +155,17 @@ export const buildProps = < ...@@ -157,10 +155,17 @@ export const buildProps = <
? BuildPropReturn<T, O[K]['default'], R, V, C> ? BuildPropReturn<T, O[K]['default'], R, V, C>
: never : never
} }
}
export const definePropType = <T>(val: any) => ({ [wrapperKey]: val } as PropWrapper<T>) export function definePropType<T>(val: any) {
return { [wrapperKey]: val } as PropWrapper<T>
}
export const keyOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T> export function keyOf<T>(arr: T) {
export const mutable = <T extends readonly any[] | Record<string, unknown>>(val: T) => val as Mutable<typeof val> return Object.keys(arr) as Array<keyof T>
}
export function mutable<T extends readonly any[] | Record<string, unknown>>(val: T) {
return val as Mutable<typeof val>
}
export const componentSize = ['large', 'medium', 'small', 'mini'] as const export const componentSize = ['large', 'medium', 'small', 'mini'] as const
...@@ -15,7 +15,7 @@ const PROXY_LIST = [ ...@@ -15,7 +15,7 @@ const PROXY_LIST = [
* 将内部地址(内网)转换成代理/预览地址(公网) * 将内部地址(内网)转换成代理/预览地址(公网)
* @param url 内网地址 * @param url 内网地址
*/ */
export const getExtranetUrl = (url: string): string => { export function getExtranetUrl(url: string): string {
let uri = url let uri = url
PROXY_LIST.forEach((proxy) => { PROXY_LIST.forEach((proxy) => {
...@@ -30,7 +30,7 @@ export const getExtranetUrl = (url: string): string => { ...@@ -30,7 +30,7 @@ export const getExtranetUrl = (url: string): string => {
* eg: 主要用于解决内网文件上传后预览,但是实际上传存储时还是内网地址的问题 * eg: 主要用于解决内网文件上传后预览,但是实际上传存储时还是内网地址的问题
* @param url 代理/公网地址 * @param url 代理/公网地址
*/ */
export const getIntranetUrl = (url: string): string => { export function getIntranetUrl(url: string): string {
let uri = url let uri = url
PROXY_LIST.forEach((proxy) => { PROXY_LIST.forEach((proxy) => {
...@@ -45,7 +45,7 @@ export const getIntranetUrl = (url: string): string => { ...@@ -45,7 +45,7 @@ export const getIntranetUrl = (url: string): string => {
* @param body 接口返回的内容 * @param body 接口返回的内容
* @returns 替换本地链接后的数据结果 * @returns 替换本地链接后的数据结果
*/ */
export const handleResponseResource = <T>(body: T, options: Recordable) => { export function handleResponseResource<T>(body: T, options: Recordable) {
if (options.apiUrl.includes('proxy.yiring.com') && typeof body === 'object') { if (options.apiUrl.includes('proxy.yiring.com') && typeof body === 'object') {
let text = JSON.stringify(body) let text = JSON.stringify(body)
......
...@@ -13,8 +13,12 @@ ...@@ -13,8 +13,12 @@
const schema: DescItem[] = [] const schema: DescItem[] = []
const devSchema: DescItem[] = [] const devSchema: DescItem[] = []
const commonTagRender = (color: string) => (curVal) => h(Tag, { color }, () => curVal) function commonTagRender(color: string) {
const commonLinkRender = (text: string) => (href) => h('a', { href, target: '_blank' }, text) return (curVal) => h(Tag, { color }, () => curVal)
}
function commonLinkRender(text: string) {
return (href) => h('a', { href, target: '_blank' }, text)
}
const infoSchema: DescItem[] = [ const infoSchema: DescItem[] = [
{ {
......
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
font-size: 90px; font-size: 90px;
} }
} }
@media screen and (min-width: @screen-lg) { @media screen and (min-width: @screen-lg) {
span:not(.meridiem) { span:not(.meridiem) {
font-size: 220px; font-size: 220px;
...@@ -175,6 +176,7 @@ ...@@ -175,6 +176,7 @@
font-size: 260px; font-size: 260px;
} }
} }
@media screen and (min-width: @screen-2xl) { @media screen and (min-width: @screen-2xl) {
span:not(.meridiem) { span:not(.meridiem) {
font-size: 320px; font-size: 320px;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
import { useI18n } from '/@/hooks/web/useI18n' import { useI18n } from '/@/hooks/web/useI18n'
import { useDesign } from '/@/hooks/web/useDesign' import { useDesign } from '/@/hooks/web/useDesign'
import { useLocaleStore } from '/@/store/modules/locale' import { useLocaleStore } from '/@/store/modules/locale'
defineProps({ defineProps({
sessionTimeout: { sessionTimeout: {
type: Boolean, type: Boolean,
...@@ -80,7 +81,7 @@ ...@@ -80,7 +81,7 @@
background-color: @dark-bg; background-color: @dark-bg;
&::before { &::before {
background-image: url(/@/assets/svg/login-bg-dark.svg); background-image: url('/@/assets/svg/login-bg-dark.svg');
} }
.ant-input, .ant-input,
...@@ -110,6 +111,7 @@ ...@@ -110,6 +111,7 @@
.@{prefix-cls} { .@{prefix-cls} {
min-height: 100%; min-height: 100%;
overflow: hidden; overflow: hidden;
@media (max-width: @screen-xl) { @media (max-width: @screen-xl) {
background-color: #293146; background-color: #293146;
.@{prefix-cls}-form { .@{prefix-cls}-form {
...@@ -124,11 +126,12 @@ ...@@ -124,11 +126,12 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
margin-left: -48%; margin-left: -48%;
background-image: url(/@/assets/svg/login-bg.svg); background-image: url('/@/assets/svg/login-bg.svg');
background-position: 100%; background-position: 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: auto 100%; background-size: auto 100%;
content: ''; content: '';
@media (max-width: @screen-xl) { @media (max-width: @screen-xl) {
display: none; display: none;
} }
...@@ -179,15 +182,19 @@ ...@@ -179,15 +182,19 @@
input:not([type='checkbox']) { input:not([type='checkbox']) {
min-width: 360px; min-width: 360px;
@media (max-width: @screen-xl) { @media (max-width: @screen-xl) {
min-width: 320px; min-width: 320px;
} }
@media (max-width: @screen-lg) { @media (max-width: @screen-lg) {
min-width: 260px; min-width: 260px;
} }
@media (max-width: @screen-md) { @media (max-width: @screen-md) {
min-width: 240px; min-width: 240px;
} }
@media (max-width: @screen-sm) { @media (max-width: @screen-sm) {
min-width: 160px; min-width: 160px;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
const appStore = useAppStore() const appStore = useAppStore()
const userId = ref<Nullable<number | string>>(0) const userId = ref<Nullable<number | string>>(0)
const isBackMode = () => { function isBackMode() {
return appStore.getProjectConfig.permissionMode === PermissionModeEnum.BACK return appStore.getProjectConfig.permissionMode === PermissionModeEnum.BACK
} }
......
module.exports = { module.exports = {
root: true, root: true,
plugins: ['stylelint-order'], plugins: ['stylelint-order'],
extends: ['stylelint-config-standard', 'stylelint-config-prettier'], extends: ['stylelint-config-standard'],
customSyntax: 'postcss-html', customSyntax: 'postcss-html',
rules: { rules: {
'function-no-unknown': null, 'function-no-unknown': null,
...@@ -38,12 +38,9 @@ module.exports = { ...@@ -38,12 +38,9 @@ module.exports = {
'no-empty-source': null, 'no-empty-source': null,
'string-quotes': null, 'string-quotes': null,
'named-grid-areas-no-invalid': null, 'named-grid-areas-no-invalid': null,
'unicode-bom': 'never',
'no-descending-specificity': null, 'no-descending-specificity': null,
'media-feature-range-notation': null,
'font-family-no-missing-generic-family-keyword': null, 'font-family-no-missing-generic-family-keyword': null,
'declaration-colon-space-after': 'always-single-line',
'declaration-colon-space-before': 'never',
// 'declaration-block-trailing-semicolon': 'always',
'rule-empty-line-before': [ 'rule-empty-line-before': [
'always', 'always',
{ {
...@@ -76,7 +73,7 @@ module.exports = { ...@@ -76,7 +73,7 @@ module.exports = {
overrides: [ overrides: [
{ {
files: ['*.vue', '**/*.vue', '*.html', '**/*.html'], files: ['*.vue', '**/*.vue', '*.html', '**/*.html'],
extends: ['stylelint-config-recommended', 'stylelint-config-prettier', 'stylelint-config-recommended-vue'], extends: ['stylelint-config-recommended', 'stylelint-config-recommended-vue'],
rules: { rules: {
'keyframes-name-pattern': null, 'keyframes-name-pattern': null,
'selector-pseudo-class-no-unknown': [ 'selector-pseudo-class-no-unknown': [
...@@ -96,7 +93,7 @@ module.exports = { ...@@ -96,7 +93,7 @@ module.exports = {
{ {
files: ['*.less', '**/*.less'], files: ['*.less', '**/*.less'],
customSyntax: 'postcss-less', customSyntax: 'postcss-less',
extends: ['stylelint-config-standard', 'stylelint-config-prettier', 'stylelint-config-recommended-vue'], extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'],
}, },
], ],
} }
...@@ -25,7 +25,7 @@ declare global { ...@@ -25,7 +25,7 @@ declare global {
// } // }
// vue // vue
declare type PropType<T> = VuePropType<T> // declare type PropType<T> = VuePropType<T>
declare type VueNode = VNodeChild | JSX.Element declare type VueNode = VNodeChild | JSX.Element
export type Writable<T> = { export type Writable<T> = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论