827 changed files with 18180 additions and 18163 deletions
@ -1,74 +1,20 @@ |
|||||||
|
const process = require('node:process') |
||||||
|
|
||||||
|
process.env.ESLINT_TSCONFIG = 'tsconfig.json' |
||||||
|
|
||||||
module.exports = { |
module.exports = { |
||||||
root: true, |
extends: '@antfu', |
||||||
env: { |
|
||||||
browser: true, |
|
||||||
node: true, |
|
||||||
es6: true |
|
||||||
}, |
|
||||||
parser: 'vue-eslint-parser', |
|
||||||
plugins: ['vue'], |
|
||||||
parserOptions: { |
|
||||||
parser: '@typescript-eslint/parser', |
|
||||||
ecmaVersion: 2020, |
|
||||||
sourceType: 'module', |
|
||||||
jsxPragma: 'React', |
|
||||||
ecmaFeatures: { |
|
||||||
jsx: true |
|
||||||
} |
|
||||||
}, |
|
||||||
extends: ['plugin:vue/vue3-recommended', 'prettier', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], |
|
||||||
rules: { |
rules: { |
||||||
'max-len': ['error', { code: 140, tabWidth: 2, ignoreComments: true }], |
'max-len': ['error', { code: 140, tabWidth: 2, ignoreComments: true }], |
||||||
'vue/script-setup-uses-vars': 'error', |
'@typescript-eslint/no-floating-promises': 'off', |
||||||
'@typescript-eslint/ban-ts-ignore': 'off', |
'@typescript-eslint/no-unsafe-assignment': 'off', |
||||||
'@typescript-eslint/explicit-function-return-type': 'off', |
'@typescript-eslint/no-unsafe-argument': 'off', |
||||||
'@typescript-eslint/no-explicit-any': 'off', |
'@typescript-eslint/no-unsafe-member-access': 'off', |
||||||
'@typescript-eslint/no-var-requires': 'off', |
'@typescript-eslint/no-unsafe-return': 'off', |
||||||
'@typescript-eslint/no-empty-function': 'off', |
'@typescript-eslint/no-unsafe-call': 'off', |
||||||
'vue/custom-event-name-casing': 'off', |
'prefer-promise-reject-errors': 'off', |
||||||
'no-use-before-define': 'off', |
'no-case-declarations': 'off', |
||||||
'@typescript-eslint/no-use-before-define': 'off', |
'no-console': 'off', |
||||||
'@typescript-eslint/ban-ts-comment': 'off', |
'n/prefer-global/process': 'off', |
||||||
'@typescript-eslint/ban-types': 'off', |
}, |
||||||
'@typescript-eslint/no-non-null-assertion': 'off', |
|
||||||
'@typescript-eslint/explicit-module-boundary-types': 'off', |
|
||||||
'@typescript-eslint/no-unused-vars': [ |
|
||||||
'error', |
|
||||||
{ |
|
||||||
argsIgnorePattern: '^_', |
|
||||||
varsIgnorePattern: '^_' |
|
||||||
} |
|
||||||
], |
|
||||||
'no-unused-vars': [ |
|
||||||
'error', |
|
||||||
{ |
|
||||||
argsIgnorePattern: '^_', |
|
||||||
varsIgnorePattern: '^_' |
|
||||||
} |
|
||||||
], |
|
||||||
'space-before-function-paren': 'off', |
|
||||||
|
|
||||||
'vue/attributes-order': 'off', |
|
||||||
'vue/one-component-per-file': 'off', |
|
||||||
'vue/html-closing-bracket-newline': 'off', |
|
||||||
'vue/max-attributes-per-line': 'off', |
|
||||||
'vue/multiline-html-element-content-newline': 'off', |
|
||||||
'vue/singleline-html-element-content-newline': 'off', |
|
||||||
'vue/attribute-hyphenation': 'off', |
|
||||||
'vue/require-default-prop': 'off', |
|
||||||
'vue/require-explicit-emits': 'off', |
|
||||||
'vue/html-self-closing': [ |
|
||||||
'error', |
|
||||||
{ |
|
||||||
html: { |
|
||||||
void: 'always', |
|
||||||
normal: 'never', |
|
||||||
component: 'always' |
|
||||||
}, |
|
||||||
svg: 'always', |
|
||||||
math: 'always' |
|
||||||
} |
|
||||||
], |
|
||||||
'vue/multi-word-component-names': 'off' |
|
||||||
} |
|
||||||
} |
} |
||||||
|
@ -1,8 +0,0 @@ |
|||||||
// .lintstagedrc.js
|
|
||||||
module.exports = { |
|
||||||
'*.js': ['prettier --config prettier.config.js --write', 'eslint --fix --ext .js'], |
|
||||||
'*.ts': ['prettier --config prettier.config.js --write', 'eslint --fix --ext .ts'], |
|
||||||
'*.vue': ['prettier --config prettier.config.js --write', 'eslint --fix --ext .vue'], |
|
||||||
'*.tsx': ['prettier --config prettier.config.js --write', 'eslint --fix --ext .tsx'], |
|
||||||
'*.json': 'prettier --config prettier.config.js --write' |
|
||||||
} |
|
@ -1,37 +1,18 @@ |
|||||||
|
import { resolve } from 'node:path' |
||||||
import { generateAntColors, primaryColor } from '../config/themeConfig' |
import { generateAntColors, primaryColor } from '../config/themeConfig' |
||||||
import { getThemeVariables } from 'ant-design-vue/dist/theme' |
|
||||||
import { resolve } from 'path' |
|
||||||
|
|
||||||
/** |
/** |
||||||
* less global variable |
* less global variable |
||||||
*/ |
*/ |
||||||
export function generateModifyVars(dark = false) { |
export function generateModifyVars() { |
||||||
const palettes = generateAntColors(primaryColor) |
const palettes = generateAntColors(primaryColor) |
||||||
const primary = palettes[5] |
|
||||||
|
|
||||||
const primaryColorObj: Record<string, string> = {} |
const primaryColorObj: Record<string, string> = {} |
||||||
|
|
||||||
for (let index = 0; index < 10; index++) { |
for (let index = 0; index < 10; index++) |
||||||
primaryColorObj[`primary-${index + 1}`] = palettes[index] |
primaryColorObj[`primary-${index + 1}`] = palettes[index] |
||||||
} |
|
||||||
|
|
||||||
const modifyVars = getThemeVariables({ dark }) |
|
||||||
return { |
return { |
||||||
...modifyVars, |
hack: `true; @import (reference) "${resolve('src/design/config.less')}";`, |
||||||
// Used for global import to avoid the need to import each style file separately
|
|
||||||
// reference: Avoid repeated references
|
|
||||||
hack: `${modifyVars.hack} @import (reference) "${resolve('src/design/config.less')}";`, |
|
||||||
'primary-color': primary, |
|
||||||
...primaryColorObj, |
|
||||||
'info-color': primary, |
|
||||||
'processing-color': primary, |
|
||||||
'success-color': '#55D187', // Success color
|
|
||||||
'error-color': '#ED6F6F', // False color
|
|
||||||
'warning-color': '#EFBD47', // Warning color
|
|
||||||
//'border-color-base': '#EEEEEE',
|
|
||||||
'font-size-base': '14px', // Main font size
|
|
||||||
'border-radius-base': '2px', // Component/float fillet
|
|
||||||
'link-color': primary, // Link color
|
|
||||||
'app-content-background': '#fafafa' // Link color
|
|
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,82 +0,0 @@ |
|||||||
/** |
|
||||||
* Introduces component library styles on demand. |
|
||||||
* https://github.com/xingyuv/vite-plugin-style-import
|
|
||||||
*/ |
|
||||||
import { createStyleImportPlugin } from 'vite-plugin-style-import' |
|
||||||
|
|
||||||
export function configStyleImportPlugin(_isBuild: boolean) { |
|
||||||
if (!_isBuild) { |
|
||||||
return [] |
|
||||||
} |
|
||||||
const styleImportPlugin = createStyleImportPlugin({ |
|
||||||
libs: [ |
|
||||||
{ |
|
||||||
libraryName: 'ant-design-vue', |
|
||||||
esModule: true, |
|
||||||
resolveStyle: (name) => { |
|
||||||
// 这里是无需额外引入样式文件的“子组件”列表
|
|
||||||
const ignoreList = [ |
|
||||||
'anchor-link', |
|
||||||
'sub-menu', |
|
||||||
'menu-item', |
|
||||||
'menu-divider', |
|
||||||
'menu-item-group', |
|
||||||
'breadcrumb-item', |
|
||||||
'breadcrumb-separator', |
|
||||||
'form-item', |
|
||||||
'step', |
|
||||||
'select-option', |
|
||||||
'select-opt-group', |
|
||||||
'card-grid', |
|
||||||
'card-meta', |
|
||||||
'collapse-panel', |
|
||||||
'descriptions-item', |
|
||||||
'list-item', |
|
||||||
'list-item-meta', |
|
||||||
'table-column', |
|
||||||
'table-column-group', |
|
||||||
'tab-pane', |
|
||||||
'tab-content', |
|
||||||
'timeline-item', |
|
||||||
'tree-node', |
|
||||||
'skeleton-input', |
|
||||||
'skeleton-avatar', |
|
||||||
'skeleton-title', |
|
||||||
'skeleton-paragraph', |
|
||||||
'skeleton-image', |
|
||||||
'skeleton-button' |
|
||||||
] |
|
||||||
// 这里是需要额外引入样式的子组件列表
|
|
||||||
// 单独引入子组件时需引入组件样式,否则会在打包后导致子组件样式丢失
|
|
||||||
const replaceList = { |
|
||||||
textarea: 'input', |
|
||||||
'typography-text': 'typography', |
|
||||||
'typography-title': 'typography', |
|
||||||
'typography-paragraph': 'typography', |
|
||||||
'typography-link': 'typography', |
|
||||||
'dropdown-button': 'dropdown', |
|
||||||
'input-password': 'input', |
|
||||||
'input-search': 'input', |
|
||||||
'input-group': 'input', |
|
||||||
'radio-group': 'radio', |
|
||||||
'checkbox-group': 'checkbox', |
|
||||||
'layout-sider': 'layout', |
|
||||||
'layout-content': 'layout', |
|
||||||
'layout-footer': 'layout', |
|
||||||
'layout-header': 'layout', |
|
||||||
'month-picker': 'date-picker', |
|
||||||
'range-picker': 'date-picker', |
|
||||||
'image-preview-group': 'image' |
|
||||||
} |
|
||||||
|
|
||||||
return ignoreList.includes(name) |
|
||||||
? '' |
|
||||||
: replaceList.hasOwnProperty(name) |
|
||||||
? `ant-design-vue/es/${replaceList[name]}/style/index` |
|
||||||
: `ant-design-vue/es/${name}/style/index` |
|
||||||
} |
|
||||||
} |
|
||||||
] |
|
||||||
}) |
|
||||||
return styleImportPlugin |
|
||||||
} |
|
@ -1,83 +0,0 @@ |
|||||||
/** |
|
||||||
* Vite plugin for website theme color switching |
|
||||||
* https://github.com/xingyuv/vite-vue-plugin-theme
|
|
||||||
*/ |
|
||||||
import type { PluginOption } from 'vite' |
|
||||||
import path from 'path' |
|
||||||
import { viteThemePlugin, antdDarkThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-vue-plugin-theme' |
|
||||||
import { getThemeColors, generateColors } from '../../config/themeConfig' |
|
||||||
import { generateModifyVars } from '../../generate/generateModifyVars' |
|
||||||
|
|
||||||
export function configThemePlugin(isBuild: boolean): PluginOption[] { |
|
||||||
const colors = generateColors({ |
|
||||||
mixDarken, |
|
||||||
mixLighten, |
|
||||||
tinycolor |
|
||||||
}) |
|
||||||
const plugin = [ |
|
||||||
viteThemePlugin({ |
|
||||||
resolveSelector: (s) => { |
|
||||||
s = s.trim() |
|
||||||
switch (s) { |
|
||||||
case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon': |
|
||||||
return '.ant-steps-item-icon > .ant-steps-icon' |
|
||||||
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)': |
|
||||||
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover': |
|
||||||
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active': |
|
||||||
return s |
|
||||||
case '.ant-steps-item-icon > .ant-steps-icon': |
|
||||||
return s |
|
||||||
case '.ant-select-item-option-selected:not(.ant-select-item-option-disabled)': |
|
||||||
return s |
|
||||||
default: |
|
||||||
if (s.indexOf('.ant-btn') >= -1) { |
|
||||||
// 按钮被重新定制过,需要过滤掉class防止覆盖
|
|
||||||
return s |
|
||||||
} |
|
||||||
} |
|
||||||
return s.startsWith('[data-theme') ? s : `[data-theme] ${s}` |
|
||||||
}, |
|
||||||
colorVariables: [...getThemeColors(), ...colors] |
|
||||||
}), |
|
||||||
antdDarkThemePlugin({ |
|
||||||
preloadFiles: [ |
|
||||||
path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'), |
|
||||||
//path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.dark.less'),
|
|
||||||
path.resolve(process.cwd(), 'src/design/index.less') |
|
||||||
], |
|
||||||
filter: (id) => (isBuild ? !id.endsWith('antd.less') : true), |
|
||||||
// extractCss: false,
|
|
||||||
darkModifyVars: { |
|
||||||
...generateModifyVars(true), |
|
||||||
'text-color': '#c9d1d9', |
|
||||||
'primary-1': 'rgb(255 255 255 / 8%)', |
|
||||||
'text-color-base': '#c9d1d9', |
|
||||||
'component-background': '#151515', |
|
||||||
'heading-color': 'rgb(255 255 255 / 65%)', |
|
||||||
// black: '#0e1117',
|
|
||||||
// #8b949e
|
|
||||||
'text-color-secondary': '#8b949e', |
|
||||||
'border-color-base': '#303030', |
|
||||||
// 'border-color-split': '#30363d',
|
|
||||||
'item-active-bg': '#111b26', |
|
||||||
'app-content-background': '#1e1e1e', |
|
||||||
'tree-node-selected-bg': '#11263c', |
|
||||||
|
|
||||||
'alert-success-border-color': '#274916', |
|
||||||
'alert-success-bg-color': '#162312', |
|
||||||
'alert-success-icon-color': '#49aa19', |
|
||||||
'alert-info-border-color': '#153450', |
|
||||||
'alert-info-bg-color': '#111b26', |
|
||||||
'alert-info-icon-color': '#177ddc', |
|
||||||
'alert-warning-border-color': '#594214', |
|
||||||
'alert-warning-bg-color': '#2b2111', |
|
||||||
'alert-warning-icon-color': '#d89614', |
|
||||||
'alert-error-border-color': '#58181c', |
|
||||||
'alert-error-bg-color': '#2a1215', |
|
||||||
'alert-error-icon-color': '#a61d24' |
|
||||||
} |
|
||||||
}) |
|
||||||
] |
|
||||||
|
|
||||||
return plugin as unknown as PluginOption[] |
|
||||||
} |
|
@ -1,37 +0,0 @@ |
|||||||
module.exports = { |
|
||||||
// 一行代码的最大字符数,默认是80
|
|
||||||
printWidth: 140, |
|
||||||
// tab宽度为2空格
|
|
||||||
tabWidth: 2, |
|
||||||
// 使用tab缩进,默认false
|
|
||||||
useTabs: false, |
|
||||||
// 结尾是否添加分号, 默认true
|
|
||||||
semi: false, |
|
||||||
// vue script和style标签中是否缩进,开启可能会破坏编辑器的代码折叠
|
|
||||||
vueIndentScriptAndStyle: false, |
|
||||||
// 使用单引号, 默认false(在jsx中配置无效, 默认都是双引号)
|
|
||||||
singleQuote: true, |
|
||||||
// object对象中key值是否加引号 as-needed只有在需求要的情况下加引号,consistent是有一个需要引号就统一加,preserve是保留用户输入的引号
|
|
||||||
quoteProps: 'as-needed', |
|
||||||
// object对象里面的key和value值和括号间的空格
|
|
||||||
bracketSpacing: true, |
|
||||||
// 行尾逗号,默认none,可选 none|es5|all
|
|
||||||
// es5 包括es5中的数组、对象
|
|
||||||
// all 包括函数对象等所有可选
|
|
||||||
trailingComma: 'none', |
|
||||||
// 在jsx文件中的引号需要单独设置 默认false
|
|
||||||
jsxSingleQuote: false, |
|
||||||
// 箭头函数单个参数的情况是否省略括号,默认always是总是带括号
|
|
||||||
// avoid 能省略括号的时候就省略 例如x => x
|
|
||||||
// always 总是有括号
|
|
||||||
arrowParens: 'always', |
|
||||||
insertPragma: false, |
|
||||||
requirePragma: false, |
|
||||||
proseWrap: 'never', |
|
||||||
htmlWhitespaceSensitivity: 'strict', |
|
||||||
// endOfLine: "<lf|crlf|cr|auto>" 行尾换行符,默认是lf
|
|
||||||
endOfLine: 'auto', |
|
||||||
// range是format执行的范围,可以选执行一个文件的一部分,默认的设置是整个文件
|
|
||||||
rangeStart: 0, |
|
||||||
rangeEnd: Infinity |
|
||||||
} |
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 175 KiB |
After Width: | Height: | Size: 135 KiB |
@ -1,27 +1,26 @@ |
|||||||
<template> |
|
||||||
<ConfigProvider :locale="getAntdLocale" :component-size="componentSize"> |
|
||||||
<AppProvider> |
|
||||||
<RouterView /> |
|
||||||
</AppProvider> |
|
||||||
</ConfigProvider> |
|
||||||
</template> |
|
||||||
|
|
||||||
<script lang="ts" setup> |
<script lang="ts" setup> |
||||||
import { computed } from 'vue' |
import 'dayjs/locale/zh-cn' |
||||||
|
|
||||||
import { ConfigProvider } from 'ant-design-vue' |
import { ConfigProvider } from 'ant-design-vue' |
||||||
|
import { storeToRefs } from 'pinia' |
||||||
|
|
||||||
import { AppProvider } from '@/components/Application' |
import { AppProvider } from '@/components/Application' |
||||||
import { useTitle } from '@/hooks/web/useTitle' |
import { useTitle } from '@/hooks/web/useTitle' |
||||||
import { useLocale } from '@/locales/useLocale' |
import { useLocale } from '@/locales/useLocale' |
||||||
import { useAppStore } from '@/store/modules/app' |
import { useAppStore } from '@/store/modules/app' |
||||||
|
|
||||||
import 'dayjs/locale/zh-cn' |
|
||||||
// support Multi-language |
// support Multi-language |
||||||
const { getAntdLocale } = useLocale() |
const { getAntdLocale } = useLocale() |
||||||
|
|
||||||
const appStore = useAppStore() |
const appStore = useAppStore() |
||||||
|
const { themeConfig } = storeToRefs(appStore) |
||||||
const componentSize = computed(() => appStore.getComponentSize) |
|
||||||
|
|
||||||
// Listening to page changes and dynamically changing site titles |
// Listening to page changes and dynamically changing site titles |
||||||
useTitle() |
useTitle() |
||||||
</script> |
</script> |
||||||
|
|
||||||
|
<template> |
||||||
|
<ConfigProvider :locale="getAntdLocale" :theme="themeConfig"> |
||||||
|
<AppProvider> |
||||||
|
<RouterView /> |
||||||
|
</AppProvider> |
||||||
|
</ConfigProvider> |
||||||
|
</template> |
||||||
|
@ -1,9 +1,9 @@ |
|||||||
export type UserLoginVO = { |
export interface UserLoginVO { |
||||||
username: string |
username: string |
||||||
password: string |
password: string |
||||||
captchaVerification: string |
captchaVerification: string |
||||||
} |
} |
||||||
|
|
||||||
export type TentantNameVO = { |
export interface TentantNameVO { |
||||||
id: number |
id: number |
||||||
} |
} |
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in new issue