feat: antdv4.0 init

pull/28/head
xingyu 2023-07-29 18:46:43 +08:00
parent 35f1298ee6
commit 4fb4cb9e82
819 changed files with 17792 additions and 16878 deletions

View File

@ -1,74 +1,15 @@
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', 'no-case-declarations': 'off',
'@typescript-eslint/no-explicit-any': 'off', 'no-console': 'off',
'@typescript-eslint/no-var-requires': 'off', 'n/prefer-global/process': 'off',
'@typescript-eslint/no-empty-function': 'off', },
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': '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'
}
} }

View File

@ -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'
}

64
.vscode/settings.json vendored
View File

@ -1,7 +1,5 @@
{ {
"typescript.tsdk": "./node_modules/typescript/lib", "typescript.tsdk": "./node_modules/typescript/lib",
"volar.tsPlugin": true,
"volar.tsPluginStatus": false,
"npm.packageManager": "pnpm", "npm.packageManager": "pnpm",
"editor.tabSize": 2, "editor.tabSize": 2,
"prettier.printWidth": 140, // "prettier.printWidth": 140, //
@ -60,33 +58,24 @@
"path-intellisense.mappings": { "path-intellisense.mappings": {
"@/": "${workspaceRoot}/src" "@/": "${workspaceRoot}/src"
}, },
"[javascriptreact]": { "prettier.enable": false,
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.formatOnSave": false,
},
"[typescript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true "source.fixAll.eslint": true,
"source.organizeImports": false
}, },
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
],
"[vue]": { "[vue]": {
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true, "source.fixAll.eslint": true,
@ -136,27 +125,6 @@
"pnpm", "pnpm",
"antd" "antd"
], ],
"vetur.format.scriptInitialIndent": true,
"vetur.format.styleInitialIndent": true,
"vetur.validation.script": false,
"MicroPython.executeButton": [
{
"text": "▶",
"tooltip": "运行",
"alignment": "left",
"command": "extension.executeFile",
"priority": 3.5
}
],
"MicroPython.syncButton": [
{
"text": "$(sync)",
"tooltip": "同步",
"alignment": "left",
"command": "extension.execute",
"priority": 4
}
],
// //
"explorer.fileNesting.enabled": true, "explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false, "explorer.fileNesting.expand": false,

View File

@ -17,7 +17,7 @@ export interface GenerateColorsParams {
export function generateAntColors(color: string, theme: GenerateTheme = 'default') { export function generateAntColors(color: string, theme: GenerateTheme = 'default') {
return generate(color, { return generate(color, {
theme theme,
}) })
} }
@ -31,7 +31,7 @@ export function getThemeColors(color?: string) {
} }
export function generateColors({ color = primaryColor, mixLighten, mixDarken, tinycolor }: GenerateColorsParams) { export function generateColors({ color = primaryColor, mixLighten, mixDarken, tinycolor }: GenerateColorsParams) {
const arr = new Array(19).fill(0) const arr = Array.from({ length: 19 }).fill(0)
const lightens = arr.map((_t, i) => { const lightens = arr.map((_t, i) => {
return mixLighten(color, i / 5) return mixLighten(color, i / 5)
}) })
@ -46,7 +46,7 @@ export function generateColors({ color = primaryColor, mixLighten, mixDarken, ti
.toRgbString() .toRgbString()
}) })
const shortAlphaColors = alphaColors.map((item) => item.replace(/\s/g, '').replace(/0\./g, '.')) const shortAlphaColors = alphaColors.map(item => item.replace(/\s/g, '').replace(/0\./g, '.'))
const tinycolorLightens = arr const tinycolorLightens = arr
.map((_t, i) => { .map((_t, i) => {
@ -54,7 +54,7 @@ export function generateColors({ color = primaryColor, mixLighten, mixDarken, ti
.lighten(i * 5) .lighten(i * 5)
.toHexString() .toHexString()
}) })
.filter((item) => item !== '#ffffff') .filter(item => item !== '#ffffff')
const tinycolorDarkens = arr const tinycolorDarkens = arr
.map((_t, i) => { .map((_t, i) => {
@ -62,8 +62,8 @@ export function generateColors({ color = primaryColor, mixLighten, mixDarken, ti
.darken(i * 5) .darken(i * 5)
.toHexString() .toHexString()
}) })
.filter((item) => item !== '#000000') .filter(item => item !== '#000000')
return [...lightens, ...darkens, ...alphaColors, ...shortAlphaColors, ...tinycolorDarkens, ...tinycolorLightens].filter( return [...lightens, ...darkens, ...alphaColors, ...shortAlphaColors, ...tinycolorDarkens, ...tinycolorLightens].filter(
(item) => !item.includes('-') item => !item.includes('-'),
) )
} }

View File

@ -1,6 +1,6 @@
import { generateAntColors, primaryColor } from '../config/themeConfig' import { resolve } from 'node:path'
import { getThemeVariables } from 'ant-design-vue/dist/theme' import { getThemeVariables } from 'ant-design-vue/dist/theme'
import { resolve } from 'path' import { generateAntColors, primaryColor } from '../config/themeConfig'
/** /**
* less global variable * less global variable
@ -11,16 +11,15 @@ export function generateModifyVars(dark = false) {
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 }) const modifyVars = getThemeVariables({ dark })
return { return {
...modifyVars, ...modifyVars,
// Used for global import to avoid the need to import each style file separately // Used for global import to avoid the need to import each style file separately
// reference: Avoid repeated references // reference: Avoid repeated references
hack: `${modifyVars.hack} @import (reference) "${resolve('src/design/config.less')}";`, 'hack': `${modifyVars.hack} @import (reference) "${resolve('src/design/config.less')}";`,
'primary-color': primary, 'primary-color': primary,
...primaryColorObj, ...primaryColorObj,
'info-color': primary, 'info-color': primary,
@ -28,10 +27,10 @@ export function generateModifyVars(dark = false) {
'success-color': '#55D187', // Success color 'success-color': '#55D187', // Success color
'error-color': '#ED6F6F', // False color 'error-color': '#ED6F6F', // False color
'warning-color': '#EFBD47', // Warning color 'warning-color': '#EFBD47', // Warning color
//'border-color-base': '#EEEEEE', // 'border-color-base': '#EEEEEE',
'font-size-base': '14px', // Main font size 'font-size-base': '14px', // Main font size
'border-radius-base': '2px', // Component/float fillet 'border-radius-base': '2px', // Component/float fillet
'link-color': primary, // Link color 'link-color': primary, // Link color
'app-content-background': '#fafafa' // Link color 'app-content-background': '#fafafa', // Link color
} }
} }

View File

@ -1,4 +1,4 @@
import path from 'path' import path from 'node:path'
import fs from 'fs-extra' import fs from 'fs-extra'
import inquirer from 'inquirer' import inquirer from 'inquirer'
import colors from 'picocolors' import colors from 'picocolors'
@ -11,10 +11,10 @@ async function generateIcon() {
const collections = Object.entries(raw).map(([id, v]) => ({ const collections = Object.entries(raw).map(([id, v]) => ({
...(v as any), ...(v as any),
id id,
})) }))
const choices = collections.map((item) => ({ key: item.id, value: item.id, name: item.name })) const choices = collections.map(item => ({ key: item.id, value: item.id, name: item.name }))
inquirer inquirer
.prompt([ .prompt([
@ -23,39 +23,39 @@ async function generateIcon() {
name: 'useType', name: 'useType',
choices: [ choices: [
{ key: 'local', value: 'local', name: 'Local' }, { key: 'local', value: 'local', name: 'Local' },
{ key: 'onLine', value: 'onLine', name: 'OnLine' } { key: 'onLine', value: 'onLine', name: 'OnLine' },
], ],
message: 'How to use icons?' message: 'How to use icons?',
}, },
{ {
type: 'list', type: 'list',
name: 'iconSet', name: 'iconSet',
choices: choices, choices,
message: 'Select the icon set that needs to be generated?' message: 'Select the icon set that needs to be generated?',
}, },
{ {
type: 'input', type: 'input',
name: 'output', name: 'output',
message: 'Select the icon set that needs to be generated?', message: 'Select the icon set that needs to be generated?',
default: 'src/components/Icon/data' default: 'src/components/Icon/data',
} },
]) ])
.then(async (answers) => { .then(async (answers) => {
const { iconSet, output, useType } = answers const { iconSet, output, useType } = answers
const outputDir = path.resolve(process.cwd(), output) const outputDir = path.resolve(process.cwd(), output)
await fs.ensureDir(outputDir) await fs.ensureDir(outputDir)
const genCollections = collections.filter((item) => [iconSet].includes(item.id)) const genCollections = collections.filter(item => [iconSet].includes(item.id))
const prefixSet: string[] = [] const prefixSet: string[] = []
for (const info of genCollections) { for (const info of genCollections) {
const data = await fs.readJSON(path.join(dir, 'json', `${info.id}.json`)) const data = await fs.readJSON(path.join(dir, 'json', `${info.id}.json`))
if (data) { if (data) {
const { prefix } = data const { prefix } = data
const isLocal = useType === 'local' const isLocal = useType === 'local'
const icons = Object.keys(data.icons).map((item) => `${isLocal ? prefix + ':' : ''}${item}`) const icons = Object.keys(data.icons).map(item => `${isLocal ? `${prefix}:` : ''}${item}`)
await fs.writeFileSync( await fs.writeFileSync(
path.join(output, `icons.data.ts`), path.join(output, 'icons.data.ts'),
`export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}` `export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}`,
) )
prefixSet.push(prefix) prefixSet.push(prefix)
} }

View File

@ -2,6 +2,6 @@
* Get the configuration file variable name * Get the configuration file variable name
* @param env * @param env
*/ */
export const getConfigFileName = (env: Record<string, any>) => { export function getConfigFileName(env: Record<string, any>) {
return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '') return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '')
} }

View File

@ -1,9 +1,9 @@
/** /**
* Generate additional configuration files when used for packaging. The file can be configured with some global variables, so that it can be changed directly externally without repackaging * Generate additional configuration files when used for packaging. The file can be configured with some global variables, so that it can be changed directly externally without repackaging
*/ */
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant'
import fs, { writeFileSync } from 'fs-extra' import fs, { writeFileSync } from 'fs-extra'
import colors from 'picocolors' import colors from 'picocolors'
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant'
import { getEnvConfig, getRootPath } from '../utils' import { getEnvConfig, getRootPath } from '../utils'
import { getConfigFileName } from '../getConfigFileName' import { getConfigFileName } from '../getConfigFileName'
@ -33,10 +33,11 @@ function createConfig(params: CreateConfigParams) {
fs.mkdirp(getRootPath(OUTPUT_DIR)) fs.mkdirp(getRootPath(OUTPUT_DIR))
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr) writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr)
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`) console.log(`${colors.cyan(`✨ [${pkg.name}]`)} - configuration file is build successfully:`)
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n') console.log(`${colors.gray(`${OUTPUT_DIR}/${colors.green(configFileName)}`)}\n`)
} catch (error) { }
console.log(colors.red('configuration file configuration file failed to package:\n' + error)) catch (error) {
console.log(colors.red(`configuration file configuration file failed to package:\n${error}`))
} }
} }

View File

@ -1,22 +1,22 @@
// #!/usr/bin/env node // #!/usr/bin/env node
import { runBuildConfig } from './buildConf'
import colors from 'picocolors' import colors from 'picocolors'
import pkg from '../../package.json' import pkg from '../../package.json'
import { runBuildConfig } from './buildConf'
export const runBuild = async () => { export async function runBuild() {
try { try {
const argvList = process.argv.splice(2) const argvList = process.argv.splice(2)
// Generate configuration file // Generate configuration file
if (!argvList.includes('disabled-config')) { if (!argvList.includes('disabled-config'))
runBuildConfig() runBuildConfig()
}
console.log(`${colors.cyan(`[${pkg.name}]`)}` + ' - build successfully!') console.log(`${colors.cyan(`[${pkg.name}]`)}` + ' - build successfully!')
} catch (error) { }
console.log(colors.red('vite build error:\n' + error)) catch (error) {
console.log(colors.red(`vite build error:\n${error}`))
process.exit(1) process.exit(1)
} }
} }

View File

@ -1,5 +1,5 @@
import fs from 'fs' import fs from 'node:fs'
import path from 'path' import path from 'node:path'
import dotenv from 'dotenv' import dotenv from 'dotenv'
export function isDevFn(mode: string): boolean { export function isDevFn(mode: string): boolean {
@ -25,13 +25,14 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
let realName = envConf[envName].replace(/\\n/g, '\n') let realName = envConf[envName].replace(/\\n/g, '\n')
realName = realName === 'true' ? true : realName === 'false' ? false : realName realName = realName === 'true' ? true : realName === 'false' ? false : realName
if (envName === 'VITE_PORT') { if (envName === 'VITE_PORT')
realName = Number(realName) realName = Number(realName)
}
if (envName === 'VITE_PROXY' && realName) { if (envName === 'VITE_PROXY' && realName) {
try { try {
realName = JSON.parse(realName.replace(/'/g, '"')) realName = JSON.parse(realName.replace(/'/g, '"'))
} catch (error) { }
catch (error) {
realName = '' realName = ''
} }
} }
@ -70,15 +71,15 @@ export function getEnvConfig(match = 'VITE_GLOB_', confFiles = getConfFiles()) {
try { try {
const env = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), item))) const env = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), item)))
envConfig = { ...envConfig, ...env } envConfig = { ...envConfig, ...env }
} catch (e) { }
catch (e) {
console.error(`Error in parsing ${item}`, e) console.error(`Error in parsing ${item}`, e)
} }
}) })
const reg = new RegExp(`^(${match})`) const reg = new RegExp(`^(${match})`)
Object.keys(envConfig).forEach((key) => { Object.keys(envConfig).forEach((key) => {
if (!reg.test(key)) { if (!reg.test(key))
Reflect.deleteProperty(envConfig, key) Reflect.deleteProperty(envConfig, key)
}
}) })
return envConfig return envConfig
} }

View File

@ -28,7 +28,7 @@ const include = [
'ant-design-vue', 'ant-design-vue',
'ant-design-vue/es/style', 'ant-design-vue/es/style',
'ant-design-vue/es/locale/zh_CN', 'ant-design-vue/es/locale/zh_CN',
'ant-design-vue/es/locale/en_US' 'ant-design-vue/es/locale/en_US',
] ]
const exclude = ['@iconify/json'] const exclude = ['@iconify/json']

View File

@ -7,7 +7,7 @@ import compressPlugin from 'vite-plugin-compression'
export function configCompressPlugin( export function configCompressPlugin(
compress: 'gzip' | 'brotli' | 'none' = 'none', compress: 'gzip' | 'brotli' | 'none' = 'none',
deleteOriginFile = false deleteOriginFile = false,
): PluginOption | PluginOption[] { ): PluginOption | PluginOption[] {
const compressList = compress.split(',') const compressList = compress.split(',')
@ -17,8 +17,8 @@ export function configCompressPlugin(
plugins.push( plugins.push(
compressPlugin({ compressPlugin({
ext: '.gz', ext: '.gz',
deleteOriginFile deleteOriginFile,
}) }),
) )
} }
@ -27,8 +27,8 @@ export function configCompressPlugin(
compressPlugin({ compressPlugin({
ext: '.br', ext: '.br',
algorithm: 'brotliCompress', algorithm: 'brotliCompress',
deleteOriginFile deleteOriginFile,
}) }),
) )
} }
return plugins return plugins

View File

@ -21,7 +21,7 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
inject: { inject: {
// Inject data into ejs template // Inject data into ejs template
data: { data: {
title: VITE_GLOB_APP_TITLE title: VITE_GLOB_APP_TITLE,
}, },
// Embed the generated app.config.js file // Embed the generated app.config.js file
tags: isBuild tags: isBuild
@ -29,12 +29,12 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
{ {
tag: 'script', tag: 'script',
attrs: { attrs: {
src: getAppConfigSrc() src: getAppConfigSrc(),
} },
} },
] ]
: [] : [],
} },
}) })
return htmlPlugin return htmlPlugin
} }

View File

@ -1,9 +1,11 @@
import { PluginOption } from 'vite' import type { PluginOption } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx' import vueJsx from '@vitejs/plugin-vue-jsx'
import progress from 'vite-plugin-progress' import progress from 'vite-plugin-progress'
import purgeIcons from 'vite-plugin-purge-icons' import purgeIcons from 'vite-plugin-purge-icons'
import VitePluginCertificate from 'vite-plugin-mkcert' import VitePluginCertificate from 'vite-plugin-mkcert'
import UnoCSS from 'unocss/vite'
import { presetTypography, presetUno } from 'unocss'
import { configPwaConfig } from './pwa' import { configPwaConfig } from './pwa'
import { configHtmlPlugin } from './html' import { configHtmlPlugin } from './html'
import { configCompressPlugin } from './compress' import { configCompressPlugin } from './compress'
@ -11,8 +13,6 @@ import { configStyleImportPlugin } from './styleImport'
import { configVisualizerConfig } from './visualizer' import { configVisualizerConfig } from './visualizer'
import { configThemePlugin } from './theme' import { configThemePlugin } from './theme'
import { configSvgIconsPlugin } from './svgSprite' import { configSvgIconsPlugin } from './svgSprite'
import UnoCSS from 'unocss/vite'
import { presetTypography, presetUno } from 'unocss'
export async function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { export async function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
const { VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE } = viteEnv const { VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE } = viteEnv
@ -24,13 +24,13 @@ export async function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
vueJsx(), vueJsx(),
// UnoCSS // UnoCSS
UnoCSS({ UnoCSS({
presets: [presetUno(), presetTypography()] presets: [presetUno(), presetTypography()],
}), }),
// 打包进度条 // 打包进度条
progress(), progress(),
VitePluginCertificate({ VitePluginCertificate({
source: 'coding' source: 'coding',
}) }),
] ]
// vite-vue-plugin-html // vite-vue-plugin-html

View File

@ -17,15 +17,15 @@ export function configPwaConfig(env: ViteEnv) {
{ {
src: './resource/img/pwa-192x192.png', src: './resource/img/pwa-192x192.png',
sizes: '192x192', sizes: '192x192',
type: 'image/png' type: 'image/png',
}, },
{ {
src: './resource/img/pwa-512x512.png', src: './resource/img/pwa-512x512.png',
sizes: '512x512', sizes: '512x512',
type: 'image/png' type: 'image/png',
} },
] ],
} },
}) })
return pwaPlugin return pwaPlugin
} }

View File

@ -5,9 +5,9 @@
import { createStyleImportPlugin } from 'vite-plugin-style-import' import { createStyleImportPlugin } from 'vite-plugin-style-import'
export function configStyleImportPlugin(_isBuild: boolean) { export function configStyleImportPlugin(_isBuild: boolean) {
if (!_isBuild) { if (!_isBuild)
return [] return []
}
const styleImportPlugin = createStyleImportPlugin({ const styleImportPlugin = createStyleImportPlugin({
libs: [ libs: [
{ {
@ -44,12 +44,12 @@ export function configStyleImportPlugin(_isBuild: boolean) {
'skeleton-title', 'skeleton-title',
'skeleton-paragraph', 'skeleton-paragraph',
'skeleton-image', 'skeleton-image',
'skeleton-button' 'skeleton-button',
] ]
// 这里是需要额外引入样式的子组件列表 // 这里是需要额外引入样式的子组件列表
// 单独引入子组件时需引入组件样式,否则会在打包后导致子组件样式丢失 // 单独引入子组件时需引入组件样式,否则会在打包后导致子组件样式丢失
const replaceList = { const replaceList = {
textarea: 'input', 'textarea': 'input',
'typography-text': 'typography', 'typography-text': 'typography',
'typography-title': 'typography', 'typography-title': 'typography',
'typography-paragraph': 'typography', 'typography-paragraph': 'typography',
@ -66,17 +66,17 @@ export function configStyleImportPlugin(_isBuild: boolean) {
'layout-header': 'layout', 'layout-header': 'layout',
'month-picker': 'date-picker', 'month-picker': 'date-picker',
'range-picker': 'date-picker', 'range-picker': 'date-picker',
'image-preview-group': 'image' 'image-preview-group': 'image',
} }
return ignoreList.includes(name) return ignoreList.includes(name)
? '' ? ''
: replaceList.hasOwnProperty(name) : replaceList.hasOwnProperty(name)
? `ant-design-vue/es/${replaceList[name]}/style/index` ? `ant-design-vue/es/${replaceList[name]}/style/index`
: `ant-design-vue/es/${name}/style/index` : `ant-design-vue/es/${name}/style/index`
} },
} },
] ],
}) })
return styleImportPlugin return styleImportPlugin
} }

View File

@ -3,16 +3,16 @@
* https://github.com/anncwb/vite-plugin-svg-icons * https://github.com/anncwb/vite-plugin-svg-icons
*/ */
import path from 'node:path'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import path from 'path' import type { PluginOption } from 'vite'
import { PluginOption } from 'vite'
export function configSvgIconsPlugin(isBuild: boolean) { export function configSvgIconsPlugin(isBuild: boolean) {
const svgIconsPlugin = createSvgIconsPlugin({ const svgIconsPlugin = createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')], iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
svgoOptions: isBuild, svgoOptions: isBuild,
// default // default
symbolId: 'icon-[dir]-[name]' symbolId: 'icon-[dir]-[name]',
}) })
return svgIconsPlugin as PluginOption return svgIconsPlugin as PluginOption
} }

View File

@ -2,17 +2,17 @@
* Vite plugin for website theme color switching * Vite plugin for website theme color switching
* https://github.com/xingyuv/vite-vue-plugin-theme * https://github.com/xingyuv/vite-vue-plugin-theme
*/ */
import path from 'node:path'
import type { PluginOption } from 'vite' import type { PluginOption } from 'vite'
import path from 'path' import { antdDarkThemePlugin, mixDarken, mixLighten, tinycolor, viteThemePlugin } from 'vite-vue-plugin-theme'
import { viteThemePlugin, antdDarkThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-vue-plugin-theme' import { generateColors, getThemeColors } from '../../config/themeConfig'
import { getThemeColors, generateColors } from '../../config/themeConfig'
import { generateModifyVars } from '../../generate/generateModifyVars' import { generateModifyVars } from '../../generate/generateModifyVars'
export function configThemePlugin(isBuild: boolean): PluginOption[] { export function configThemePlugin(isBuild: boolean): PluginOption[] {
const colors = generateColors({ const colors = generateColors({
mixDarken, mixDarken,
mixLighten, mixLighten,
tinycolor tinycolor,
}) })
const plugin = [ const plugin = [
viteThemePlugin({ viteThemePlugin({
@ -37,15 +37,15 @@ export function configThemePlugin(isBuild: boolean): PluginOption[] {
} }
return s.startsWith('[data-theme') ? s : `[data-theme] ${s}` return s.startsWith('[data-theme') ? s : `[data-theme] ${s}`
}, },
colorVariables: [...getThemeColors(), ...colors] colorVariables: [...getThemeColors(), ...colors],
}), }),
antdDarkThemePlugin({ antdDarkThemePlugin({
preloadFiles: [ preloadFiles: [
path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'), 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(), 'node_modules/ant-design-vue/dist/antd.dark.less'),
path.resolve(process.cwd(), 'src/design/index.less') path.resolve(process.cwd(), 'src/design/index.less'),
], ],
filter: (id) => (isBuild ? !id.endsWith('antd.less') : true), filter: id => (isBuild ? !id.endsWith('antd.less') : true),
// extractCss: false, // extractCss: false,
darkModifyVars: { darkModifyVars: {
...generateModifyVars(true), ...generateModifyVars(true),
@ -74,9 +74,9 @@ export function configThemePlugin(isBuild: boolean): PluginOption[] {
'alert-warning-icon-color': '#d89614', 'alert-warning-icon-color': '#d89614',
'alert-error-border-color': '#58181c', 'alert-error-border-color': '#58181c',
'alert-error-bg-color': '#2a1215', 'alert-error-bg-color': '#2a1215',
'alert-error-icon-color': '#a61d24' 'alert-error-icon-color': '#a61d24',
} },
}) }),
] ]
return plugin as unknown as PluginOption[] return plugin as unknown as PluginOption[]

View File

@ -2,8 +2,8 @@
* Package file volume analysis * Package file volume analysis
*/ */
import visualizer from 'rollup-plugin-visualizer' import visualizer from 'rollup-plugin-visualizer'
import type { PluginOption } from 'vite'
import { isReportMode } from '../../utils' import { isReportMode } from '../../utils'
import { PluginOption } from 'vite'
export function configVisualizerConfig() { export function configVisualizerConfig() {
if (isReportMode()) { if (isReportMode()) {
@ -11,7 +11,7 @@ export function configVisualizerConfig() {
filename: './node_modules/.cache/visualizer/stats.html', filename: './node_modules/.cache/visualizer/stats.html',
open: true, open: true,
gzipSize: true, gzipSize: true,
brotliSize: true brotliSize: true,
}) as PluginOption }) as PluginOption
} }
return [] return []

View File

@ -22,12 +22,12 @@ export function createProxy(list: ProxyList = []) {
// https://github.com/http-party/node-http-proxy#options // https://github.com/http-party/node-http-proxy#options
ret[prefix] = { ret[prefix] = {
target: target, target,
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ''), rewrite: path => path.replace(new RegExp(`^${prefix}`), ''),
// https is require secure=false // https is require secure=false
...(isHttps ? { secure: false } : {}) ...(isHttps ? { secure: false } : {}),
} }
} }
return ret return ret

View File

@ -1,25 +1,25 @@
const fs = require('fs') const fs = require('node:fs')
const path = require('path') const path = require('node:path')
const { execSync } = require('child_process') const { execSync } = require('node:child_process')
const scopes = fs const scopes = fs
.readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true }) .readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
.filter((dirent) => dirent.isDirectory()) .filter(dirent => dirent.isDirectory())
.map((dirent) => dirent.name.replace(/s$/, '')) .map(dirent => dirent.name.replace(/s$/, ''))
// precomputed scope // precomputed scope
const scopeComplete = execSync('git status --porcelain || true') const scopeComplete = execSync('git status --porcelain || true')
.toString() .toString()
.trim() .trim()
.split('\n') .split('\n')
.find((r) => ~r.indexOf('M src')) .find(r => ~r.indexOf('M src'))
?.replace(/(\/)/g, '%%') ?.replace(/(\/)/g, '%%')
?.match(/src%%((\w|-)*)/)?.[1] ?.match(/src%%((\w|-)*)/)?.[1]
?.replace(/s$/, '') ?.replace(/s$/, '')
/** @type {import('cz-git').UserConfig} */ /** @type {import('cz-git').UserConfig} */
module.exports = { module.exports = {
ignores: [(commit) => commit.includes('init')], ignores: [commit => commit.includes('init')],
extends: ['@commitlint/config-conventional'], extends: ['@commitlint/config-conventional'],
rules: { rules: {
'body-leading-blank': [2, 'always'], 'body-leading-blank': [2, 'always'],
@ -31,8 +31,8 @@ module.exports = {
'type-enum': [ 'type-enum': [
2, 2,
'always', 'always',
['feat', 'fix', 'perf', 'style', 'docs', 'test', 'refactor', 'build', 'ci', 'chore', 'revert', 'wip', 'workflow', 'types', 'release'] ['feat', 'fix', 'perf', 'style', 'docs', 'test', 'refactor', 'build', 'ci', 'chore', 'revert', 'wip', 'workflow', 'types', 'release'],
] ],
}, },
prompt: { prompt: {
/** @use `yarn commit :f` */ /** @use `yarn commit :f` */
@ -41,7 +41,7 @@ module.exports = {
r: 'docs: update README', r: 'docs: update README',
s: 'style: update code format', s: 'style: update code format',
b: 'build: bump dependencies', b: 'build: bump dependencies',
c: 'chore: update config' c: 'chore: update config',
}, },
customScopesAlign: !scopeComplete ? 'top' : 'bottom', customScopesAlign: !scopeComplete ? 'top' : 'bottom',
defaultScope: scopeComplete, defaultScope: scopeComplete,
@ -53,7 +53,7 @@ module.exports = {
typesAppend: [ typesAppend: [
{ value: 'wip', name: 'wip: work in process' }, { value: 'wip', name: 'wip: work in process' },
{ value: 'workflow', name: 'workflow: workflow improvements' }, { value: 'workflow', name: 'workflow: workflow improvements' },
{ value: 'types', name: 'types: type definition file changes' } { value: 'types', name: 'types: type definition file changes' },
], ],
// 中英文对照版 // 中英文对照版
@ -67,7 +67,7 @@ module.exports = {
footerPrefixsSelect: '选择关联issue前缀 (可选):', footerPrefixsSelect: '选择关联issue前缀 (可选):',
customFooterPrefixs: '输入自定义issue前缀 :', customFooterPrefixs: '输入自定义issue前缀 :',
footer: '列举关联issue (可选) 例如: #31, #I3244 :\n', footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
confirmCommit: '是否提交或修改commit ?' confirmCommit: '是否提交或修改commit ?',
}, },
types: [ types: [
{ value: 'feat', name: 'feat: 新增功能' }, { value: 'feat', name: 'feat: 新增功能' },
@ -83,9 +83,9 @@ module.exports = {
{ value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改 (不影响源文件、测试用例)' }, { value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改 (不影响源文件、测试用例)' },
{ value: 'wip', name: 'wip: 正在开发中' }, { value: 'wip', name: 'wip: 正在开发中' },
{ value: 'workflow', name: 'workflow: 工作流程改进' }, { value: 'workflow', name: 'workflow: 工作流程改进' },
{ value: 'types', name: 'types: 类型定义文件修改' } { value: 'types', name: 'types: 类型定义文件修改' },
], ],
emptyScopesAlias: 'empty: 不填写', emptyScopesAlias: 'empty: 不填写',
customScopesAlias: 'custom: 自定义' customScopesAlias: 'custom: 自定义',
} },
} }

View File

@ -11,13 +11,13 @@
<body> <body>
<script> <script>
(() => { (() => {
var htmlRoot = document.getElementById('htmlRoot'); let htmlRoot = document.getElementById('htmlRoot')
var theme = window.localStorage.getItem('__APP__DARK__MODE__'); let theme = window.localStorage.getItem('__APP__DARK__MODE__')
if (htmlRoot && theme) { if (htmlRoot && theme) {
htmlRoot.setAttribute('data-theme', theme); htmlRoot.setAttribute('data-theme', theme)
theme = htmlRoot = null; theme = htmlRoot = null
} }
})(); })()
</script> </script>
<div id="app"> <div id="app">
<style> <style>

View File

@ -1,11 +1,25 @@
{ {
"name": "yudao-ui-admin-vben", "name": "yudao-ui-admin-vben",
"version": "1.8.0-snapshot", "version": "1.8.0-snapshot",
"packageManager": "pnpm@8.6.0",
"author": { "author": {
"name": "xingyuv", "name": "xingyuv",
"email": "xingyu4j@vip.qq.com", "email": "xingyu4j@vip.qq.com",
"url": "https://gitee.com/xingyuv" "url": "https://gitee.com/xingyuv"
}, },
"license": "MIT",
"homepage": "https://gitee.com/xingyuv",
"repository": {
"type": "git",
"url": "git+https://gitee.com/xingyuv/vue-vben-admin.git"
},
"bugs": {
"url": "https://gitee.com/xingyuv/issues"
},
"engines": {
"node": ">= 16.0.0",
"pnpm": ">=8.6.0"
},
"scripts": { "scripts": {
"commit": "czg", "commit": "czg",
"bootstrap": "pnpm install", "bootstrap": "pnpm install",
@ -20,12 +34,11 @@
"type:check": "vue-tsc --noEmit --skipLibCheck", "type:check": "vue-tsc --noEmit --skipLibCheck",
"preview": "pnpm build && vite preview", "preview": "pnpm build && vite preview",
"preview:dist": "vite preview", "preview:dist": "vite preview",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s",
"clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite", "clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
"clean:lib": "rimraf node_modules", "clean:lib": "rimraf node_modules",
"lint:eslint": "eslint --cache --max-warnings 0 \"src/**/*.{vue,ts,tsx}\" --fix", "lint": "eslint .",
"lint:prettier": "prettier --write \"src/**/*.{js,json,ts,tsx,css,less,scss,vue,html,md}\"", "lint:fix": "eslint . --fix",
"lint:style": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", "lint:stylelint": "stylelint \"**/*.{vue,css,less,scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged", "lint:lint-staged": "lint-staged",
"npm:check": "npx npm-check-updates", "npm:check": "npx npm-check-updates",
"reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && pnpm bootstrap", "reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && pnpm bootstrap",
@ -67,6 +80,7 @@
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^0.39.8",
"@commitlint/cli": "^17.6.7", "@commitlint/cli": "^17.6.7",
"@commitlint/config-conventional": "^17.6.7", "@commitlint/config-conventional": "^17.6.7",
"@iconify/json": "^2.2.95", "@iconify/json": "^2.2.95",
@ -86,16 +100,11 @@
"@vitejs/plugin-vue": "4.2.3", "@vitejs/plugin-vue": "4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1", "@vitejs/plugin-vue-jsx": "^3.0.1",
"@vue/compiler-sfc": "^3.3.4", "@vue/compiler-sfc": "^3.3.4",
"autoprefixer": "^10.4.14",
"conventional-changelog-cli": "^3.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"cz-git": "^1.7.0", "cz-git": "^1.7.0",
"czg": "^1.7.0", "czg": "^1.7.0",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"eslint": "^8.46.0", "eslint": "^8.46.0",
"eslint-config-prettier": "^8.9.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vue": "^9.15.1",
"esno": "^0.17.0", "esno": "^0.17.0",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"husky": "^8.0.3", "husky": "^8.0.3",
@ -110,14 +119,16 @@
"rimraf": "^5.0.1", "rimraf": "^5.0.1",
"rollup": "^3.27.0", "rollup": "^3.27.0",
"rollup-plugin-visualizer": "^5.9.2", "rollup-plugin-visualizer": "^5.9.2",
"unocss": "^0.54.0",
"stylelint": "^15.10.2", "stylelint": "^15.10.2",
"stylelint-config-recess-order": "^4.3.0",
"stylelint-config-recommended": "^13.0.0", "stylelint-config-recommended": "^13.0.0",
"stylelint-config-recommended-vue": "^1.5.0", "stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^34.0.0", "stylelint-config-standard": "^34.0.0",
"stylelint-order": "^6.0.3", "stylelint-order": "^6.0.3",
"stylelint-prettier": "^4.0.2",
"terser": "^5.19.2", "terser": "^5.19.2",
"typescript": "^5.1.6", "typescript": "^5.1.6",
"unocss": "^0.54.0",
"vite": "^4.4.7", "vite": "^4.4.7",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-mkcert": "^1.16.0", "vite-plugin-mkcert": "^1.16.0",
@ -131,43 +142,8 @@
"vue-eslint-parser": "^9.3.1", "vue-eslint-parser": "^9.3.1",
"vue-tsc": "^1.8.8" "vue-tsc": "^1.8.8"
}, },
"repository": {
"type": "git",
"url": "git+https://gitee.com/xingyuv/vue-vben-admin.git"
},
"license": "MIT",
"bugs": {
"url": "https://gitee.com/xingyuv/issues"
},
"homepage": "https://gitee.com/xingyuv",
"packageManager": "pnpm@8.6.0",
"engines": {
"node": ">= 16.0.0",
"pnpm": ">=8.6.0"
},
"lint-staged": { "lint-staged": {
"*.{js,jsx,ts,tsx}": [ "*": "eslint --fix"
"eslint --fix",
"prettier --write"
],
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
"prettier --write--parser json"
],
"package.json": [
"prettier --write"
],
"*.vue": [
"eslint --fix",
"prettier --write",
"stylelint --fix"
],
"*.{scss,less,styl,html}": [
"stylelint --fix",
"prettier --write"
],
"*.md": [
"prettier --write"
]
}, },
"config": { "config": {
"commitizen": { "commitizen": {

File diff suppressed because it is too large Load Diff

View File

@ -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
}

View File

@ -1,11 +1,3 @@
<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 { computed } from 'vue'
import { ConfigProvider } from 'ant-design-vue' import { ConfigProvider } from 'ant-design-vue'
@ -15,6 +7,7 @@ import { useLocale } from '@/locales/useLocale'
import { useAppStore } from '@/store/modules/app' import { useAppStore } from '@/store/modules/app'
import 'dayjs/locale/zh-cn' import 'dayjs/locale/zh-cn'
// support Multi-language // support Multi-language
const { getAntdLocale } = useLocale() const { getAntdLocale } = useLocale()
@ -25,3 +18,11 @@ 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" :component-size="componentSize">
<AppProvider>
<RouterView />
</AppProvider>
</ConfigProvider>
</template>

View File

@ -1,5 +1,5 @@
import type { TentantNameVO } from './model/loginModel'
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
import { TentantNameVO } from './model/loginModel'
import { getRefreshToken } from '@/utils/auth' import { getRefreshToken } from '@/utils/auth'
enum Api { enum Api {
@ -9,7 +9,7 @@ enum Api {
LoginOut = '/system/auth/logout', LoginOut = '/system/auth/logout',
GetUserInfo = '/system/auth/get-permission-info', GetUserInfo = '/system/auth/get-permission-info',
GetCaptcha = '/system/captcha/get', GetCaptcha = '/system/captcha/get',
CheckCaptcha = '/system/captcha/check' CheckCaptcha = '/system/captcha/check',
} }
// 刷新访问令牌 // 刷新访问令牌
@ -38,8 +38,8 @@ export function sendSmsCode(mobile, scene) {
url: '/system/auth/send-sms-code', url: '/system/auth/send-sms-code',
data: { data: {
mobile, mobile,
scene scene,
} },
}) })
} }
@ -56,31 +56,31 @@ export function checkCaptcha(data) {
// ========== OAUTH 2.0 相关 ========== // ========== OAUTH 2.0 相关 ==========
export function getAuthorize(clientId) { export function getAuthorize(clientId) {
return defHttp.get({ url: '/system/oauth2/authorize?clientId=' + clientId }) return defHttp.get({ url: `/system/oauth2/authorize?clientId=${clientId}` })
} }
export function authorize(responseType, clientId, redirectUri, state, autoApprove, checkedScopes, uncheckedScopes) { export function authorize(responseType, clientId, redirectUri, state, autoApprove, checkedScopes, uncheckedScopes) {
// 构建 scopes // 构建 scopes
const scopes = {} const scopes = {}
for (const scope of checkedScopes) { for (const scope of checkedScopes)
scopes[scope] = true scopes[scope] = true
}
for (const scope of uncheckedScopes) { for (const scope of uncheckedScopes)
scopes[scope] = false scopes[scope] = false
}
// 发起请求 // 发起请求
return defHttp.post({ return defHttp.post({
url: '/system/oauth2/authorize', url: '/system/oauth2/authorize',
headers: { headers: {
'Content-type': 'application/x-www-form-urlencoded' 'Content-type': 'application/x-www-form-urlencoded',
}, },
params: { params: {
response_type: responseType, response_type: responseType,
client_id: clientId, client_id: clientId,
redirect_uri: redirectUri, redirect_uri: redirectUri,
state: state, state,
auto_approve: autoApprove, auto_approve: autoApprove,
scope: JSON.stringify(scopes) scope: JSON.stringify(scopes),
} },
}) })
} }

View File

@ -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
} }

View File

@ -1,4 +1,5 @@
import type { RouteMeta } from 'vue-router' import type { RouteMeta } from 'vue-router'
export interface RouteItem { export interface RouteItem {
path: string path: string
component: any component: any

View File

@ -1,4 +1,4 @@
import { RouteItem } from './menuModel' import type { RouteItem } from './menuModel'
/** /**
* @description: Login interface parameters * @description: Login interface parameters

View File

@ -57,7 +57,7 @@ enum Api {
uploadAvatarApi = '/system/user/profile/update-avatar', uploadAvatarApi = '/system/user/profile/update-avatar',
updateUserPwdApi = '/system/user/profile/update-password', updateUserPwdApi = '/system/user/profile/update-password',
socialBindApi = '/system/social-user/bind', socialBindApi = '/system/social-user/bind',
socialUnbindApi = '/system/social-user/unbind' socialUnbindApi = '/system/social-user/unbind',
} }
/** /**
@ -79,9 +79,9 @@ export function updateUserPwdApi(oldPassword: string, newPassword: string) {
return defHttp.put({ return defHttp.put({
url: Api.updateUserPwdApi, url: Api.updateUserPwdApi,
data: { data: {
oldPassword: oldPassword, oldPassword,
newPassword: newPassword newPassword,
} },
}) })
} }
@ -91,10 +91,10 @@ export function uploadAvatarApi(data) {
url: Api.uploadAvatarApi, url: Api.uploadAvatarApi,
headers: { headers: {
'Content-type': ContentTypeEnum.FORM_DATA, 'Content-type': ContentTypeEnum.FORM_DATA,
// @ts-ignore // @ts-expect-error
ignoreCancelToken: true 'ignoreCancelToken': true,
}, },
data data,
}) })
} }
@ -105,8 +105,8 @@ export function socialBind(type, code, state) {
data: { data: {
type, type,
code, code,
state state,
} },
}) })
} }
@ -116,14 +116,14 @@ export function socialUnbind(type, openid) {
url: Api.socialUnbindApi, url: Api.socialUnbindApi,
data: { data: {
type, type,
openid openid,
} },
}) })
} }
// 社交授权的跳转 // 社交授权的跳转
export function socialAuthRedirect(type, redirectUri) { export function socialAuthRedirect(type, redirectUri) {
return defHttp.get({ return defHttp.get({
url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri url: `/system/auth/social-auth-redirect?type=${type}&redirectUri=${redirectUri}`,
}) })
} }

View File

@ -1,8 +1,8 @@
import { UploadApiResult } from './model/uploadModel' import type { AxiosProgressEvent } from 'axios'
import type { UploadApiResult } from './model/uploadModel'
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
import { UploadFileParams } from '@/types/axios' import type { UploadFileParams } from '@/types/axios'
import { useGlobSetting } from '@/hooks/setting' import { useGlobSetting } from '@/hooks/setting'
import { AxiosProgressEvent } from 'axios'
const { uploadUrl = '' } = useGlobSetting() const { uploadUrl = '' } = useGlobSetting()
@ -13,8 +13,8 @@ export function uploadApi(params: UploadFileParams, onUploadProgress: (progressE
return defHttp.uploadFile<UploadApiResult>( return defHttp.uploadFile<UploadApiResult>(
{ {
url: uploadUrl, url: uploadUrl,
onUploadProgress onUploadProgress,
}, },
params params,
) )
} }

View File

@ -1,13 +1,13 @@
import type { GetUserInfoModel, LoginParams, LoginResultModel, SmsLoginParams } from './model/userModel'
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
import { LoginParams, LoginResultModel, GetUserInfoModel, SmsLoginParams } from './model/userModel'
import { ErrorMessageMode } from '@/types/axios' import type { ErrorMessageMode } from '@/types/axios'
enum Api { enum Api {
Login = '/system/auth/login', Login = '/system/auth/login',
Logout = '/system/auth/logout', Logout = '/system/auth/logout',
SmsLogin = '/system/auth/sms-login', SmsLogin = '/system/auth/sms-login',
GetUserInfo = '/system/auth/get-permission-info' GetUserInfo = '/system/auth/get-permission-info',
} }
/** /**

View File

@ -9,5 +9,5 @@ export function getProcessDefinitionList(params) {
} }
export function getProcessDefinitionBpmnXML(id) { export function getProcessDefinitionBpmnXML(id) {
return defHttp.get({ url: '/bpm/process-definition/get-bpmn-xml?id=' + id }) return defHttp.get({ url: `/bpm/process-definition/get-bpmn-xml?id=${id}` })
} }

View File

@ -1,6 +1,6 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
export type FormVO = { export interface FormVO {
id: number id: number
name: string name: string
conf: string conf: string
@ -22,12 +22,12 @@ export function updateForm(data: FormVO) {
// 删除工作流的表单定义 // 删除工作流的表单定义
export function deleteForm(id: number) { export function deleteForm(id: number) {
return defHttp.delete({ url: '/bpm/form/delete?id=' + id }) return defHttp.delete({ url: `/bpm/form/delete?id=${id}` })
} }
// 获得工作流的表单定义 // 获得工作流的表单定义
export function getForm(id: number) { export function getForm(id: number) {
return defHttp.get({ url: '/bpm/form/get?id=' + id }) return defHttp.get({ url: `/bpm/form/get?id=${id}` })
} }
// 获得工作流的表单定义分页 // 获得工作流的表单定义分页

View File

@ -1,6 +1,6 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
export type LeaveVO = { export interface LeaveVO {
id: number id: number
result: number result: number
type: number type: number
@ -18,7 +18,7 @@ export function createLeave(data: LeaveVO) {
// 获得请假申请 // 获得请假申请
export function getLeave(id: number) { export function getLeave(id: number) {
return defHttp.get({ url: '/bpm/oa/leave/get?id=' + id }) return defHttp.get({ url: `/bpm/oa/leave/get?id=${id}` })
} }
// 获得请假申请分页 // 获得请假申请分页

View File

@ -1,19 +1,19 @@
import { UploadApiResult } from '@/api/base/model/uploadModel' import type { AxiosProgressEvent } from 'axios'
import type { UploadApiResult } from '@/api/base/model/uploadModel'
import { useGlobSetting } from '@/hooks/setting' import { useGlobSetting } from '@/hooks/setting'
import { UploadFileParams } from '@/types/axios' import type { UploadFileParams } from '@/types/axios'
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
import { AxiosProgressEvent } from 'axios'
const { apiUrl = '' } = useGlobSetting() const { apiUrl = '' } = useGlobSetting()
export type ProcessDefinitionVO = { export interface ProcessDefinitionVO {
id: string id: string
version: number version: number
deploymentTIme: string deploymentTIme: string
suspensionState: number suspensionState: number
} }
export type ModelVO = { export interface ModelVO {
id: number id: number
formName: string formName: string
key: string key: string
@ -35,7 +35,7 @@ export function getModelPage(params) {
} }
export function getModel(id: number) { export function getModel(id: number) {
return defHttp.get({ url: '/bpm/model/get?id=' + id }) return defHttp.get({ url: `/bpm/model/get?id=${id}` })
} }
export function updateModel(data: ModelVO) { export function updateModel(data: ModelVO) {
@ -52,19 +52,19 @@ export function createModel(data: ModelVO) {
} }
export function deleteModel(id: number) { export function deleteModel(id: number) {
return defHttp.delete({ url: '/bpm/model/delete?id=' + id }) return defHttp.delete({ url: `/bpm/model/delete?id=${id}` })
} }
export function deployModel(id: number) { export function deployModel(id: number) {
return defHttp.post({ url: '/bpm/model/deploy?id=' + id }) return defHttp.post({ url: `/bpm/model/deploy?id=${id}` })
} }
export function importModel(params: UploadFileParams, onUploadProgress: (progressEvent: AxiosProgressEvent) => void) { export function importModel(params: UploadFileParams, onUploadProgress: (progressEvent: AxiosProgressEvent) => void) {
return defHttp.uploadFile<UploadApiResult>( return defHttp.uploadFile<UploadApiResult>(
{ {
url: apiUrl + '/bpm/model/import', url: `${apiUrl}/bpm/model/import`,
onUploadProgress onUploadProgress,
}, },
params params,
) )
} }

View File

@ -1,10 +1,10 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
export type task = { export interface task {
id: string id: string
name: string name: string
} }
export type ProcessInstanceVO = { export interface ProcessInstanceVO {
id: number id: number
name: string name: string
processDefinitionId: string processDefinitionId: string
@ -29,12 +29,12 @@ export function createProcessInstance(data: ProcessInstanceVO) {
export function cancelProcessInstance(id: number, reason: string) { export function cancelProcessInstance(id: number, reason: string) {
const data = { const data = {
id: id, id,
reason: reason reason,
} }
return defHttp.delete({ url: '/bpm/process-instance/cancel', data }) return defHttp.delete({ url: '/bpm/process-instance/cancel', data })
} }
export function getProcessInstance(id: number) { export function getProcessInstance(id: number) {
return defHttp.get({ url: '/bpm/process-instance/get?id=' + id }) return defHttp.get({ url: `/bpm/process-instance/get?id=${id}` })
} }

View File

@ -29,6 +29,6 @@ export function updateTaskAssignee(data) {
export function getTaskListByProcessInstanceId(processInstanceId) { export function getTaskListByProcessInstanceId(processInstanceId) {
return defHttp.get({ return defHttp.get({
url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId url: `/bpm/task/list-by-process-instance-id?processInstanceId=${processInstanceId}`,
}) })
} }

View File

@ -1,4 +1,4 @@
export type FormVO = { export interface FormVO {
id: number id: number
name: string name: string
conf: string conf: string
@ -8,7 +8,7 @@ export type FormVO = {
createTime: string createTime: string
} }
export type TaskProcessVO = { export interface TaskProcessVO {
id: string id: string
name: string name: string
startUserId: number startUserId: number
@ -16,7 +16,7 @@ export type TaskProcessVO = {
processDefinitionId: string processDefinitionId: string
} }
export type TaskTodoVO = { export interface TaskTodoVO {
id: string id: string
name: string name: string
claimTime: string claimTime: string
@ -25,7 +25,7 @@ export type TaskTodoVO = {
processInstance: TaskProcessVO processInstance: TaskProcessVO
} }
export type TaskDoneVO = { export interface TaskDoneVO {
id: string id: string
name: string name: string
claimTime: string claimTime: string

View File

@ -1,6 +1,6 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
export type TaskAssignVO = { export interface TaskAssignVO {
id: number id: number
modelId: string modelId: string
processDefinitionId: string processDefinitionId: string

View File

@ -1,6 +1,6 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
export type UserGroupVO = { export interface UserGroupVO {
id: number id: number
name: string name: string
description: string description: string
@ -22,12 +22,12 @@ export function updateUserGroup(data: UserGroupVO) {
// 删除用户组 // 删除用户组
export function deleteUserGroup(id: number) { export function deleteUserGroup(id: number) {
return defHttp.delete({ url: '/bpm/user-group/delete?id=' + id }) return defHttp.delete({ url: `/bpm/user-group/delete?id=${id}` })
} }
// 获得用户组 // 获得用户组
export function getUserGroup(id: number) { export function getUserGroup(id: number) {
return defHttp.get({ url: '/bpm/user-group/get?id=' + id }) return defHttp.get({ url: `/bpm/user-group/get?id=${id}` })
} }
// 获得用户组分页 // 获得用户组分页

View File

@ -53,7 +53,7 @@ export function getApiErrorLogPage(params: ApiErrorLogPageReqVO) {
// 更新 API 错误日志的处理状态 // 更新 API 错误日志的处理状态
export function updateApiErrorLogProcess(id: number, processStatus: number) { export function updateApiErrorLogProcess(id: number, processStatus: number) {
return defHttp.put({ return defHttp.put({
url: '/infra/api-error-log/update-status?id=' + id + '&processStatus=' + processStatus url: `/infra/api-error-log/update-status?id=${id}&processStatus=${processStatus}`,
}) })
} }
@ -62,8 +62,8 @@ export function exportApiErrorLog(params: ApiErrorLogExportReqVO) {
return defHttp.download( return defHttp.download(
{ {
url: '/infra/api-error-log/export-excel', url: '/infra/api-error-log/export-excel',
params params,
}, },
'错误日志.xls' '错误日志.xls',
) )
} }

View File

@ -1,5 +1,5 @@
import type { CodegenCreateListReqVO, CodegenUpdateReqVO } from './types'
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types'
// 查询列表代码生成表定义 // 查询列表代码生成表定义
export function getCodegenTablePage(params) { export function getCodegenTablePage(params) {
@ -8,7 +8,7 @@ export function getCodegenTablePage(params) {
// 查询详情代码生成表定义 // 查询详情代码生成表定义
export function getCodegenTable(id: number) { export function getCodegenTable(id: number) {
return defHttp.get({ url: '/infra/codegen/detail?tableId=' + id }) return defHttp.get({ url: `/infra/codegen/detail?tableId=${id}` })
} }
// 新增代码生成表定义 // 新增代码生成表定义
@ -23,22 +23,22 @@ export function updateCodegenTable(data: CodegenUpdateReqVO) {
// 基于数据库的表结构,同步数据库的表和字段定义 // 基于数据库的表结构,同步数据库的表和字段定义
export function syncCodegenFromDB(id: number) { export function syncCodegenFromDB(id: number) {
return defHttp.put({ url: '/infra/codegen/sync-from-db?tableId=' + id }) return defHttp.put({ url: `/infra/codegen/sync-from-db?tableId=${id}` })
} }
// 基于 SQL 建表语句,同步数据库的表和字段定义 // 基于 SQL 建表语句,同步数据库的表和字段定义
export function syncCodegenFromSQL(id: number, sql: string) { export function syncCodegenFromSQL(id: number, sql: string) {
return defHttp.put({ url: '/infra/codegen/sync-from-sql?tableId=' + id + '&sql=' + sql }) return defHttp.put({ url: `/infra/codegen/sync-from-sql?tableId=${id}&sql=${sql}` })
} }
// 预览生成代码 // 预览生成代码
export function previewCodegen(id: number) { export function previewCodegen(id: number) {
return defHttp.get({ url: '/infra/codegen/preview?tableId=' + id }) return defHttp.get({ url: `/infra/codegen/preview?tableId=${id}` })
} }
// 下载生成代码 // 下载生成代码
export function downloadCodegen(data) { export function downloadCodegen(data) {
return defHttp.download({ url: '/infra/codegen/download?tableId=' + data.id }, data.tableName + '.zip') return defHttp.download({ url: `/infra/codegen/download?tableId=${data.id}` }, `${data.tableName}.zip`)
} }
// 获得表定义 // 获得表定义
@ -53,5 +53,5 @@ export function createCodegenList(data) {
// 删除代码生成表定义 // 删除代码生成表定义
export function deleteCodegenTable(id: number) { export function deleteCodegenTable(id: number) {
return defHttp.delete({ url: '/infra/codegen/delete?tableId=' + id }) return defHttp.delete({ url: `/infra/codegen/delete?tableId=${id}` })
} }

View File

@ -1,4 +1,4 @@
export type CodegenTableVO = { export interface CodegenTableVO {
id: number id: number
tableId: number tableId: number
isParentMenuIdValid: boolean isParentMenuIdValid: boolean
@ -18,7 +18,7 @@ export type CodegenTableVO = {
parentMenuId: number parentMenuId: number
} }
export type CodegenColumnVO = { export interface CodegenColumnVO {
id: number id: number
tableId: number tableId: number
columnName: string columnName: string
@ -39,23 +39,23 @@ export type CodegenColumnVO = {
listOperationResult: number listOperationResult: number
htmlType: string htmlType: string
} }
export type DatabaseTableVO = { export interface DatabaseTableVO {
name: string name: string
comment: string comment: string
} }
export type CodegenDetailVO = { export interface CodegenDetailVO {
table: CodegenTableVO table: CodegenTableVO
columns: CodegenColumnVO[] columns: CodegenColumnVO[]
} }
export type CodegenPreviewVO = { export interface CodegenPreviewVO {
filePath: string filePath: string
code: string code: string
} }
export type CodegenUpdateReqVO = { export interface CodegenUpdateReqVO {
table: CodegenTableVO table: CodegenTableVO
columns: CodegenColumnVO[] columns: CodegenColumnVO[]
} }
export type CodegenCreateListReqVO = { export interface CodegenCreateListReqVO {
dataSourceConfigId: number dataSourceConfigId: number
tableNames: string[] tableNames: string[]
} }

View File

@ -33,12 +33,12 @@ export function getConfigPage(params: ConfigPageReqVO) {
// 查询参数详情 // 查询参数详情
export function getConfig(id: number) { export function getConfig(id: number) {
return defHttp.get({ url: '/infra/config/get?id=' + id }) return defHttp.get({ url: `/infra/config/get?id=${id}` })
} }
// 根据参数键名查询参数值 // 根据参数键名查询参数值
export function getConfigKey(configKey: string) { export function getConfigKey(configKey: string) {
return defHttp.get({ url: '/infra/config/get-value-by-key?key=' + configKey }) return defHttp.get({ url: `/infra/config/get-value-by-key?key=${configKey}` })
} }
// 新增参数 // 新增参数
@ -53,7 +53,7 @@ export function updateConfig(data: ConfigVO) {
// 删除参数 // 删除参数
export function deleteConfig(id: number) { export function deleteConfig(id: number) {
return defHttp.delete({ url: '/infra/config/delete?id=' + id }) return defHttp.delete({ url: `/infra/config/delete?id=${id}` })
} }
// 导出参数 // 导出参数

View File

@ -16,7 +16,7 @@ export function getDataSourceConfigList() {
// 查询数据源配置详情 // 查询数据源配置详情
export function getDataSourceConfig(id: number) { export function getDataSourceConfig(id: number) {
return defHttp.get({ url: '/infra/data-source-config/get?id=' + id }) return defHttp.get({ url: `/infra/data-source-config/get?id=${id}` })
} }
// 新增数据源配置 // 新增数据源配置
@ -31,5 +31,5 @@ export function updateDataSourceConfig(data: DataSourceConfigVO) {
// 删除数据源配置 // 删除数据源配置
export function deleteDataSourceConfig(id: number) { export function deleteDataSourceConfig(id: number) {
return defHttp.delete({ url: '/infra/data-source-config/delete?id=' + id }) return defHttp.delete({ url: `/infra/data-source-config/delete?id=${id}` })
} }

View File

@ -24,5 +24,5 @@ export function getFilePage(params: FilePageReqVO) {
// 删除文件 // 删除文件
export function deleteFile(id: number) { export function deleteFile(id: number) {
return defHttp.delete({ url: '/infra/file/delete?id=' + id }) return defHttp.delete({ url: `/infra/file/delete?id=${id}` })
} }

View File

@ -37,12 +37,12 @@ export function getFileConfigPage(params: FileConfigPageReqVO) {
// 查询文件配置详情 // 查询文件配置详情
export function getFileConfig(id: number) { export function getFileConfig(id: number) {
return defHttp.get({ url: '/infra/file-config/get?id=' + id }) return defHttp.get({ url: `/infra/file-config/get?id=${id}` })
} }
// 更新文件配置为主配置 // 更新文件配置为主配置
export function updateFileConfigMaster(id: number) { export function updateFileConfigMaster(id: number) {
return defHttp.put({ url: '/infra/file-config/update-master?id=' + id }) return defHttp.put({ url: `/infra/file-config/update-master?id=${id}` })
} }
// 新增文件配置 // 新增文件配置
@ -57,10 +57,10 @@ export function updateFileConfig(data: FileConfigVO) {
// 删除文件配置 // 删除文件配置
export function deleteFileConfig(id: number) { export function deleteFileConfig(id: number) {
return defHttp.delete({ url: '/infra/file-config/delete?id=' + id }) return defHttp.delete({ url: `/infra/file-config/delete?id=${id}` })
} }
// 测试文件配置 // 测试文件配置
export function testFileConfig(id: number) { export function testFileConfig(id: number) {
return defHttp.get({ url: '/infra/file-config/test?id=' + id }) return defHttp.get({ url: `/infra/file-config/test?id=${id}` })
} }

View File

@ -32,7 +32,7 @@ export function getJobPage(params: JobPageReqVO) {
// 任务详情 // 任务详情
export function getJob(id: number) { export function getJob(id: number) {
return defHttp.get({ url: '/infra/job/get?id=' + id }) return defHttp.get({ url: `/infra/job/get?id=${id}` })
} }
// 新增任务 // 新增任务
@ -47,7 +47,7 @@ export function updateJob(data: JobVO) {
// 删除定时任务调度 // 删除定时任务调度
export function deleteJob(id: number) { export function deleteJob(id: number) {
return defHttp.delete({ url: '/infra/job/delete?id=' + id }) return defHttp.delete({ url: `/infra/job/delete?id=${id}` })
} }
// 导出定时任务调度 // 导出定时任务调度
@ -59,17 +59,17 @@ export function exportJob(params: JobExportReqVO) {
export function updateJobStatus(id: number, status: number) { export function updateJobStatus(id: number, status: number) {
const params = { const params = {
id, id,
status status,
} }
return defHttp.put({ url: '/infra/job/update-status', params }) return defHttp.put({ url: '/infra/job/update-status', params })
} }
// 定时任务立即执行一次 // 定时任务立即执行一次
export function runJob(id: number) { export function runJob(id: number) {
return defHttp.put({ url: '/infra/job/trigger?id=' + id }) return defHttp.put({ url: `/infra/job/trigger?id=${id}` })
} }
// 获得定时任务的下 n 次执行时间 // 获得定时任务的下 n 次执行时间
export function getJobNextTimes(id: number) { export function getJobNextTimes(id: number) {
return defHttp.get({ url: '/infra/job/get_next_times?id=' + id }) return defHttp.get({ url: `/infra/job/get_next_times?id=${id}` })
} }

View File

@ -37,7 +37,7 @@ export function getJobLogPage(params: JobLogPageReqVO) {
// 任务日志详情 // 任务日志详情
export function getJobLog(id: number) { export function getJobLog(id: number) {
return defHttp.get({ url: '/infra/job-log/get?id=' + id }) return defHttp.get({ url: `/infra/job-log/get?id=${id}` })
} }
// 导出定时任务日志 // 导出定时任务日志

View File

@ -17,25 +17,25 @@ export function getKeyList(keyTemplate: string) {
return defHttp.get({ return defHttp.get({
url: '/infra/redis/get-key-list', url: '/infra/redis/get-key-list',
params: { params: {
keyTemplate keyTemplate,
} },
}) })
} }
// 获取缓存内容 // 获取缓存内容
export function getKeyValue(key: string) { export function getKeyValue(key: string) {
return defHttp.get({ url: '/infra/redis/get-key-value?key=' + key }) return defHttp.get({ url: `/infra/redis/get-key-value?key=${key}` })
} }
// 根据键名删除缓存 // 根据键名删除缓存
export function deleteKey(key: string) { export function deleteKey(key: string) {
return defHttp.delete({ url: '/infra/redis/delete-key?key=' + key }) return defHttp.delete({ url: `/infra/redis/delete-key?key=${key}` })
} }
export function deleteKeys(keyTemplate: string) { export function deleteKeys(keyTemplate: string) {
return defHttp.delete({ return defHttp.delete({
url: '/infra/redis/delete-keys?', url: '/infra/redis/delete-keys?',
params: { params: {
keyTemplate keyTemplate,
} },
}) })
} }

View File

@ -17,12 +17,12 @@ export function updateAccount(data) {
// 删除公众号账号 // 删除公众号账号
export function deleteAccount(id) { export function deleteAccount(id) {
return defHttp.delete({ url: '/mp/account/delete?id=' + id, method: 'delete' }) return defHttp.delete({ url: `/mp/account/delete?id=${id}`, method: 'delete' })
} }
// 获得公众号账号 // 获得公众号账号
export function getAccount(id) { export function getAccount(id) {
return defHttp.get({ url: '/mp/account/get?id=' + id }) return defHttp.get({ url: `/mp/account/get?id=${id}` })
} }
// 获得公众号账号分页 // 获得公众号账号分页
@ -37,10 +37,10 @@ export function getSimpleAccounts() {
// 生成公众号二维码 // 生成公众号二维码
export function generateAccountQrCode(id) { export function generateAccountQrCode(id) {
return defHttp.put({ url: '/mp/account/generate-qr-code?id=' + id }) return defHttp.put({ url: `/mp/account/generate-qr-code?id=${id}` })
} }
// 清空公众号 API 配额 // 清空公众号 API 配额
export function clearAccountQuota(id) { export function clearAccountQuota(id) {
return defHttp.put({ url: '/mp/account/clear-quota?id=' + id }) return defHttp.put({ url: `/mp/account/clear-quota?id=${id}` })
} }

View File

@ -12,12 +12,12 @@ export function updateAutoReply(data) {
// 删除公众号的自动回复 // 删除公众号的自动回复
export function deleteAutoReply(id) { export function deleteAutoReply(id) {
return defHttp.delete({ url: '/mp/auto-reply/delete?id=' + id }) return defHttp.delete({ url: `/mp/auto-reply/delete?id=${id}` })
} }
// 获得公众号的自动回复 // 获得公众号的自动回复
export function getAutoReply(id) { export function getAutoReply(id) {
return defHttp.get({ url: '/mp/auto-reply/get?id=' + id }) return defHttp.get({ url: `/mp/auto-reply/get?id=${id}` })
} }
// 获得公众号的自动回复分页 // 获得公众号的自动回复分页

View File

@ -8,19 +8,19 @@ export function getDraftPage(params) {
// 创建公众号草稿 // 创建公众号草稿
export function createDraft(accountId, articles) { export function createDraft(accountId, articles) {
return defHttp.post({ return defHttp.post({
url: '/mp/draft/create?accountId=' + accountId, url: `/mp/draft/create?accountId=${accountId}`,
data: { data: {
articles articles,
} },
}) })
} }
// 更新公众号草稿 // 更新公众号草稿
export function updateDraft(accountId, mediaId, articles) { export function updateDraft(accountId, mediaId, articles) {
return defHttp.put({ url: '/mp/draft/update?accountId=' + accountId + '&mediaId=' + mediaId, data: articles }) return defHttp.put({ url: `/mp/draft/update?accountId=${accountId}&mediaId=${mediaId}`, data: articles })
} }
// 删除公众号草稿 // 删除公众号草稿
export function deleteDraft(accountId, mediaId) { export function deleteDraft(accountId, mediaId) {
return defHttp.delete({ url: '/mp/draft/delete?accountId=' + accountId + '&mediaId=' + mediaId }) return defHttp.delete({ url: `/mp/draft/delete?accountId=${accountId}&mediaId=${mediaId}` })
} }

View File

@ -7,10 +7,10 @@ export function getFreePublishPage(params) {
// 删除公众号素材 // 删除公众号素材
export function deleteFreePublish(accountId, articleId) { export function deleteFreePublish(accountId, articleId) {
return defHttp.delete({ url: '/mp/free-publish/delete?accountId=' + accountId + '&&articleId=' + articleId }) return defHttp.delete({ url: `/mp/free-publish/delete?accountId=${accountId}&&articleId=${articleId}` })
} }
// 发布公众号素材 // 发布公众号素材
export function submitFreePublish(accountId, mediaId) { export function submitFreePublish(accountId, mediaId) {
return defHttp.post({ url: '/mp/free-publish/submit?accountId=' + accountId + '&&mediaId=' + mediaId }) return defHttp.post({ url: `/mp/free-publish/submit?accountId=${accountId}&&mediaId=${mediaId}` })
} }

View File

@ -7,5 +7,5 @@ export function getMaterialPage(params) {
// 删除公众号永久素材 // 删除公众号永久素材
export function deletePermanentMaterial(id) { export function deletePermanentMaterial(id) {
return defHttp.delete({ url: '/mp/material/delete-permanent?id=' + id }) return defHttp.delete({ url: `/mp/material/delete-permanent?id=${id}` })
} }

View File

@ -2,7 +2,7 @@ import { defHttp } from '@/utils/http/axios'
// 获得公众号菜单列表 // 获得公众号菜单列表
export function getMenuList(accountId) { export function getMenuList(accountId) {
return defHttp.get({ url: '/mp/menu/list?accountId=' + accountId }) return defHttp.get({ url: `/mp/menu/list?accountId=${accountId}` })
} }
// 保存公众号菜单 // 保存公众号菜单
@ -11,12 +11,12 @@ export function saveMenu(accountId, menus) {
url: '/mp/menu/save', url: '/mp/menu/save',
data: { data: {
accountId, accountId,
menus menus,
} },
}) })
} }
// 删除公众号菜单 // 删除公众号菜单
export function deleteMenu(accountId) { export function deleteMenu(accountId) {
return defHttp.delete({ url: '/mp/menu/delete?accountId=' + accountId }) return defHttp.delete({ url: `/mp/menu/delete?accountId=${accountId}` })
} }

View File

@ -7,7 +7,7 @@ export function updateUser(data) {
// 获得公众号粉丝 // 获得公众号粉丝
export function getUser(id) { export function getUser(id) {
return defHttp.get({ url: '/mp/user/get?id=' + id }) return defHttp.get({ url: `/mp/user/get?id=${id}` })
} }
// 获得公众号粉丝分页 // 获得公众号粉丝分页
@ -17,5 +17,5 @@ export function getUserPage(params) {
// 同步公众号粉丝 // 同步公众号粉丝
export function syncUser(accountId) { export function syncUser(accountId) {
return defHttp.post({ url: '/mp/user/sync?accountId=' + accountId }) return defHttp.post({ url: `/mp/user/sync?accountId=${accountId}` })
} }

View File

@ -12,12 +12,12 @@ export function updateTag(data) {
// 删除公众号标签 // 删除公众号标签
export function deleteTag(id) { export function deleteTag(id) {
return defHttp.delete({ url: '/mp/tag/delete?id=' + id }) return defHttp.delete({ url: `/mp/tag/delete?id=${id}` })
} }
// 获得公众号标签 // 获得公众号标签
export function getTag(id) { export function getTag(id) {
return defHttp.get({ url: '/mp/tag/get?id=' + id }) return defHttp.get({ url: `/mp/tag/get?id=${id}` })
} }
// 获得公众号标签分页 // 获得公众号标签分页
@ -32,5 +32,5 @@ export function getSimpleTags() {
// 同步公众号标签 // 同步公众号标签
export function syncTag(accountId) { export function syncTag(accountId) {
return defHttp.post({ url: '/mp/tag/sync?accountId=' + accountId }) return defHttp.post({ url: `/mp/tag/sync?accountId=${accountId}` })
} }

View File

@ -44,7 +44,7 @@ export function getAppPage(params: AppPageReqVO) {
// 查询详情支付应用 // 查询详情支付应用
export function getApp(id: number) { export function getApp(id: number) {
return defHttp.get({ url: '/pay/app/get?id=' + id }) return defHttp.get({ url: `/pay/app/get?id=${id}` })
} }
// 新增支付应用 // 新增支付应用
@ -64,7 +64,7 @@ export function changeAppStatus(data: AppUpdateStatusReqVO) {
// 删除支付应用 // 删除支付应用
export function deleteApp(id: number) { export function deleteApp(id: number) {
return defHttp.delete({ url: '/pay/app/delete?id=' + id }) return defHttp.delete({ url: `/pay/app/delete?id=${id}` })
} }
// 导出支付应用 // 导出支付应用
@ -74,5 +74,5 @@ export function exportApp(params: AppExportReqVO) {
// 根据商ID称搜索应用列表 // 根据商ID称搜索应用列表
export function getAppListByMerchantId(merchantId: number) { export function getAppListByMerchantId(merchantId: number) {
return defHttp.get({ url: '/pay/app/list-merchant-id', params: { merchantId: merchantId } }) return defHttp.get({ url: '/pay/app/list-merchant-id', params: { merchantId } })
} }

View File

@ -42,11 +42,11 @@ export function getChannelPage(params: ChannelPageReqVO) {
// 查询详情支付渠道 // 查询详情支付渠道
export function getChannel(merchantId: number, appId: string, code: string) { export function getChannel(merchantId: number, appId: string, code: string) {
const params = { const params = {
merchantId: merchantId, merchantId,
appId: appId, appId,
code: code code,
} }
return defHttp.get({ url: '/pay/channel/get-channel', params: params }) return defHttp.get({ url: '/pay/channel/get-channel', params })
} }
// 新增支付渠道 // 新增支付渠道
@ -61,7 +61,7 @@ export function updateChannel(data: ChannelVO) {
// 删除支付渠道 // 删除支付渠道
export function deleteChannel(id: number) { export function deleteChannel(id: number) {
return defHttp.delete({ url: '/pay/channel/delete?id=' + id }) return defHttp.delete({ url: `/pay/channel/delete?id=${id}` })
} }
// 导出支付渠道 // 导出支付渠道

View File

@ -7,7 +7,7 @@ export function getDemoOrderPage(params) {
// 获得示例订单 // 获得示例订单
export function getDemoOrder(id: number) { export function getDemoOrder(id: number) {
return defHttp.get({ url: '/pay/demo-order/get?id=' + id }) return defHttp.get({ url: `/pay/demo-order/get?id=${id}` })
} }
// 创建示例订单 // 创建示例订单
@ -17,5 +17,5 @@ export function createDemoOrder(data) {
// 退款示例订单 // 退款示例订单
export function refundDemoOrder(id: number) { export function refundDemoOrder(id: number) {
return defHttp.put({ url: '/pay/demo-order/refund?id=' + id }) return defHttp.put({ url: `/pay/demo-order/refund?id=${id}` })
} }

View File

@ -35,7 +35,7 @@ export function getMerchantPage(params: MerchantPageReqVO) {
// 查询详情支付商户 // 查询详情支付商户
export function getMerchant(id: number) { export function getMerchant(id: number) {
return defHttp.get({ url: '/pay/merchant/get?id=' + id }) return defHttp.get({ url: `/pay/merchant/get?id=${id}` })
} }
// 根据商户名称搜索商户列表 // 根据商户名称搜索商户列表
@ -43,8 +43,8 @@ export function getMerchantListByName(name: string) {
return defHttp.get({ return defHttp.get({
url: '/pay/merchant/list-by-name?id=', url: '/pay/merchant/list-by-name?id=',
params: { params: {
name: name name,
} },
}) })
} }
@ -60,7 +60,7 @@ export function updateMerchant(data: MerchantVO) {
// 删除支付商户 // 删除支付商户
export function deleteMerchant(id: number) { export function deleteMerchant(id: number) {
return defHttp.delete({ url: '/pay/merchant/delete?id=' + id }) return defHttp.delete({ url: `/pay/merchant/delete?id=${id}` })
} }
// 导出支付商户 // 导出支付商户
@ -71,7 +71,7 @@ export function exportMerchant(params: MerchantExportReqVO) {
export function changeMerchantStatus(id: number, status: number) { export function changeMerchantStatus(id: number, status: number) {
const data = { const data = {
id, id,
status status,
} }
return defHttp.put({ url: '/pay/merchant/update-status', data }) return defHttp.put({ url: '/pay/merchant/update-status', data })
} }

View File

@ -85,12 +85,12 @@ export function getOrderPage(params: OrderPageReqVO) {
// 查询详情支付订单 // 查询详情支付订单
export function getOrder(id: number) { export function getOrder(id: number) {
return defHttp.get({ url: '/pay/order/get?id=' + id }) return defHttp.get({ url: `/pay/order/get?id=${id}` })
} }
// 查询详情支付订单 // 查询详情支付订单
export function getOrderDetail(id: number) { export function getOrderDetail(id: number) {
return defHttp.get({ url: '/pay/order/get-detail?id=' + id }) return defHttp.get({ url: `/pay/order/get-detail?id=${id}` })
} }
// 新增支付订单 // 新增支付订单
@ -105,7 +105,7 @@ export function updateOrder(data: OrderVO) {
// 删除支付订单 // 删除支付订单
export function deleteOrder(id: number) { export function deleteOrder(id: number) {
return defHttp.delete({ url: '/pay/order/delete?id=' + id }) return defHttp.delete({ url: `/pay/order/delete?id=${id}` })
} }
// 导出支付订单 // 导出支付订单

View File

@ -92,7 +92,7 @@ export function getRefundPage(params: RefundPageReqVO) {
// 查询详情退款订单 // 查询详情退款订单
export function getRefund(id: number) { export function getRefund(id: number) {
return defHttp.get({ url: '/pay/refund/get?id=' + id }) return defHttp.get({ url: `/pay/refund/get?id=${id}` })
} }
// 新增退款订单 // 新增退款订单
@ -107,7 +107,7 @@ export function updateRefund(data: RefundVO) {
// 删除退款订单 // 删除退款订单
export function deleteRefund(id: number) { export function deleteRefund(id: number) {
return defHttp.delete({ url: '/pay/refund/delete?id=' + id }) return defHttp.delete({ url: `/pay/refund/delete?id=${id}` })
} }
// 导出退款订单 // 导出退款订单

View File

@ -7,5 +7,5 @@ export function getAreaTree() {
// 获得 IP 对应的地区名 // 获得 IP 对应的地区名
export function getAreaByIp(ip: string) { export function getAreaByIp(ip: string) {
return defHttp.get({ url: '/system/area/get-by-ip?ip=' + ip }) return defHttp.get({ url: `/system/area/get-by-ip?ip=${ip}` })
} }

View File

@ -29,7 +29,7 @@ export function getDeptPage(params: DeptPageReqVO) {
// 查询部门详情 // 查询部门详情
export function getDept(id: number) { export function getDept(id: number) {
return defHttp.get({ url: '/system/dept/get?id=' + id }) return defHttp.get({ url: `/system/dept/get?id=${id}` })
} }
// 新增部门 // 新增部门
@ -44,5 +44,5 @@ export function updateDept(params: DeptVO) {
// 删除部门 // 删除部门
export function deleteDept(id: number) { export function deleteDept(id: number) {
return defHttp.delete({ url: '/system/dept/delete?id=' + id }) return defHttp.delete({ url: `/system/dept/delete?id=${id}` })
} }

View File

@ -1,5 +1,5 @@
import type { DictDataExportReqVO, DictDataPageReqVO, DictDataVO } from './types'
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
import type { DictDataVO, DictDataPageReqVO, DictDataExportReqVO } from './types'
// 查询字典数据(精简)列表 // 查询字典数据(精简)列表
export function listSimpleDictData() { export function listSimpleDictData() {
@ -13,7 +13,7 @@ export function getDictDataPage(params: DictDataPageReqVO) {
// 查询字典数据详情 // 查询字典数据详情
export function getDictData(id: number) { export function getDictData(id: number) {
return defHttp.get({ url: '/system/dict-data/get?id=' + id }) return defHttp.get({ url: `/system/dict-data/get?id=${id}` })
} }
// 新增字典数据 // 新增字典数据
@ -28,7 +28,7 @@ export function updateDictData(data: DictDataVO) {
// 删除字典数据 // 删除字典数据
export function deleteDictData(id: number) { export function deleteDictData(id: number) {
return defHttp.delete({ url: '/system/dict-data/delete?id=' + id }) return defHttp.delete({ url: `/system/dict-data/delete?id=${id}` })
} }
// 导出字典类型数据 // 导出字典类型数据
export function exportDictData(params: DictDataExportReqVO) { export function exportDictData(params: DictDataExportReqVO) {

View File

@ -1,5 +1,5 @@
import type { DictTypeExportReqVO, DictTypePageReqVO, DictTypeVO } from './types'
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
import type { DictTypeVO, DictTypePageReqVO, DictTypeExportReqVO } from './types'
// 查询字典(精简)列表 // 查询字典(精简)列表
export function listSimpleDictType() { export function listSimpleDictType() {
@ -13,7 +13,7 @@ export function getDictTypePage(params: DictTypePageReqVO) {
// 查询字典详情 // 查询字典详情
export function getDictType(id: number) { export function getDictType(id: number) {
return defHttp.get({ url: '/system/dict-type/get?id=' + id }) return defHttp.get({ url: `/system/dict-type/get?id=${id}` })
} }
// 新增字典 // 新增字典
@ -28,7 +28,7 @@ export function updateDictType(data: DictTypeVO) {
// 删除字典 // 删除字典
export function deleteDictType(id: number) { export function deleteDictType(id: number) {
return defHttp.delete({ url: '/system/dict-type/delete?id=' + id }) return defHttp.delete({ url: `/system/dict-type/delete?id=${id}` })
} }
// 导出字典类型 // 导出字典类型
export function exportDictType(params: DictTypeExportReqVO) { export function exportDictType(params: DictTypeExportReqVO) {

View File

@ -1,4 +1,4 @@
export type DictTypeVO = { export interface DictTypeVO {
id: number id: number
name: string name: string
type: string type: string
@ -7,21 +7,21 @@ export type DictTypeVO = {
createTime: Date createTime: Date
} }
export type DictTypePageReqVO = { export interface DictTypePageReqVO {
name: string name: string
type: string type: string
status: number status: number
createTime: Date[] createTime: Date[]
} }
export type DictTypeExportReqVO = { export interface DictTypeExportReqVO {
name: string name: string
type: string type: string
status: number status: number
createTime: Date[] createTime: Date[]
} }
export type DictDataVO = { export interface DictDataVO {
id: number id: number
sort: number sort: number
label: string label: string
@ -33,13 +33,13 @@ export type DictDataVO = {
remark: string remark: string
createTime: Date createTime: Date
} }
export type DictDataPageReqVO = { export interface DictDataPageReqVO {
label: string label: string
dictType: string dictType: string
status: number status: number
} }
export type DictDataExportReqVO = { export interface DictDataExportReqVO {
label: string label: string
dictType: string dictType: string
status: number status: number

View File

@ -25,7 +25,7 @@ export function getErrorCodePage(params: ErrorCodePageReqVO) {
// 查询错误码详情 // 查询错误码详情
export function getErrorCode(id: number) { export function getErrorCode(id: number) {
return defHttp.get({ url: '/system/error-code/get?id=' + id }) return defHttp.get({ url: `/system/error-code/get?id=${id}` })
} }
// 新增错误码 // 新增错误码
@ -40,7 +40,7 @@ export function updateErrorCode(data: ErrorCodeVO) {
// 删除错误码 // 删除错误码
export function deleteErrorCode(id: number) { export function deleteErrorCode(id: number) {
return defHttp.delete({ url: '/system/error-code/delete?id=' + id }) return defHttp.delete({ url: `/system/error-code/delete?id=${id}` })
} }
// 导出错误码 // 导出错误码

View File

@ -12,12 +12,12 @@ export function updateMailAccount(data) {
// 删除邮箱账号 // 删除邮箱账号
export function deleteMailAccount(id: number) { export function deleteMailAccount(id: number) {
return defHttp.delete({ url: '/system/mail-account/delete?id=' + id }) return defHttp.delete({ url: `/system/mail-account/delete?id=${id}` })
} }
// 获得邮箱账号 // 获得邮箱账号
export function getMailAccount(id: number) { export function getMailAccount(id: number) {
return defHttp.get({ url: '/system/mail-account/get?id=' + id }) return defHttp.get({ url: `/system/mail-account/get?id=${id}` })
} }
// 获得邮箱账号分页 // 获得邮箱账号分页

View File

@ -2,7 +2,7 @@ import { defHttp } from '@/utils/http/axios'
// 获得邮件日志 // 获得邮件日志
export function getMailLog(id: number) { export function getMailLog(id: number) {
return defHttp.get({ url: '/system/mail-log/get?id=' + id }) return defHttp.get({ url: `/system/mail-log/get?id=${id}` })
} }
// 获得邮件日志分页 // 获得邮件日志分页

View File

@ -12,12 +12,12 @@ export function updateMailTemplate(data) {
// 删除邮件模版 // 删除邮件模版
export function deleteMailTemplate(id: number) { export function deleteMailTemplate(id: number) {
return defHttp.delete({ url: '/system/mail-template/delete?id=' + id }) return defHttp.delete({ url: `/system/mail-template/delete?id=${id}` })
} }
// 获得邮件模版 // 获得邮件模版
export function getMailTemplate(id: number) { export function getMailTemplate(id: number) {
return defHttp.get({ url: '/system/mail-template/get?id=' + id }) return defHttp.get({ url: `/system/mail-template/get?id=${id}` })
} }
// 获得邮件模版分页 // 获得邮件模版分页
@ -26,7 +26,7 @@ export function getMailTemplatePage(params) {
} }
// 邮件模板 // 邮件模板
export type MailTemplate = { export interface MailTemplate {
name: string // 标题 name: string // 标题
code: string // 编码 code: string // 编码
accountId: number accountId: number
@ -40,7 +40,7 @@ export type MailTemplate = {
createTime: number createTime: number
} }
export type SendMailParams = { export interface SendMailParams {
mail: string mail: string
templateCode: string templateCode: string
templateParams: { templateParams: {

View File

@ -33,7 +33,7 @@ export function getMenuList(params: MenuPageReqVO) {
// 获取菜单详情 // 获取菜单详情
export function getMenu(id: number) { export function getMenu(id: number) {
return defHttp.get({ url: '/system/menu/get?id=' + id }) return defHttp.get({ url: `/system/menu/get?id=${id}` })
} }
// 新增菜单 // 新增菜单
@ -48,5 +48,5 @@ export function updateMenu(data: MenuVO) {
// 删除菜单 // 删除菜单
export function deleteMenu(id: number) { export function deleteMenu(id: number) {
return defHttp.delete({ url: '/system/menu/delete?id=' + id }) return defHttp.delete({ url: `/system/menu/delete?id=${id}` })
} }

View File

@ -23,7 +23,7 @@ export function getNoticePage(params: NoticePageReqVO) {
// 查询公告详情 // 查询公告详情
export function getNotice(id: number) { export function getNotice(id: number) {
return defHttp.get({ url: '/system/notice/get?id=' + id }) return defHttp.get({ url: `/system/notice/get?id=${id}` })
} }
// 新增公告 // 新增公告
@ -38,5 +38,5 @@ export function updateNotice(data: NoticeVO) {
// 删除公告 // 删除公告
export function deleteNotice(id: number) { export function deleteNotice(id: number) {
return defHttp.delete({ url: '/system/notice/delete?id=' + id }) return defHttp.delete({ url: `/system/notice/delete?id=${id}` })
} }

View File

@ -1,5 +1,5 @@
import { defHttp } from '@/utils/http/axios'
import qs from 'qs' import qs from 'qs'
import { defHttp } from '@/utils/http/axios'
// 获得站内信分页 // 获得站内信分页
export function getNotifyMessagePage(params) { export function getNotifyMessagePage(params) {
@ -13,7 +13,7 @@ export function getMyNotifyMessagePage(params) {
// 批量标记已读 // 批量标记已读
export function updateNotifyMessageRead(ids: number[]) { export function updateNotifyMessageRead(ids: number[]) {
return defHttp.put({ url: '/system/notify-message/update-read?' + qs.stringify({ ids: ids }, { indices: false }) }) return defHttp.put({ url: `/system/notify-message/update-read?${qs.stringify({ ids }, { indices: false })}` })
} }
// 标记所有站内信为已读 // 标记所有站内信为已读

View File

@ -12,12 +12,12 @@ export function updateNotifyTemplate(data) {
// 删除站内信模板 // 删除站内信模板
export function deleteNotifyTemplate(id: number) { export function deleteNotifyTemplate(id: number) {
return defHttp.delete({ url: '/system/notify-template/delete?id=' + id }) return defHttp.delete({ url: `/system/notify-template/delete?id=${id}` })
} }
// 获得站内信模板 // 获得站内信模板
export function getNotifyTemplate(id: number) { export function getNotifyTemplate(id: number) {
return defHttp.get({ url: '/system/notify-template/get?id=' + id }) return defHttp.get({ url: `/system/notify-template/get?id=${id}` })
} }
// 获得站内信模板分页 // 获得站内信模板分页
@ -35,7 +35,7 @@ export function exportNotifyTemplateExcel(params) {
return defHttp.download({ url: '/system/notify-template/export-excel', params }, '导出站内信模板.xls') return defHttp.download({ url: '/system/notify-template/export-excel', params }, '导出站内信模板.xls')
} }
export type SendNotifyParam = { export interface SendNotifyParam {
userId: number userId: number
templateCode: string templateCode: string
templateParams: { templateParams: {
@ -43,7 +43,7 @@ export type SendNotifyParam = {
} }
} }
export type NotifyTemplate = { export interface NotifyTemplate {
name: string name: string
code: string code: string
type: number type: number

View File

@ -32,7 +32,7 @@ export function getOAuth2ClientPage(params: OAuth2ClientPageReqVO) {
// 查询 OAuth2详情 // 查询 OAuth2详情
export function getOAuth2Client(id: number) { export function getOAuth2Client(id: number) {
return defHttp.get({ url: '/system/oauth2-client/get?id=' + id }) return defHttp.get({ url: `/system/oauth2-client/get?id=${id}` })
} }
// 新增 OAuth2 // 新增 OAuth2
@ -47,5 +47,5 @@ export function updateOAuth2Client(data: OAuth2ClientVO) {
// 删除 OAuth2 // 删除 OAuth2
export function deleteOAuth2Client(id: number) { export function deleteOAuth2Client(id: number) {
return defHttp.delete({ url: '/system/oauth2-client/delete?id=' + id }) return defHttp.delete({ url: `/system/oauth2-client/delete?id=${id}` })
} }

View File

@ -24,5 +24,5 @@ export function getAccessTokenPage(params: OAuth2TokenPageReqVO) {
// 删除 token // 删除 token
export function deleteAccessToken(accessToken: number) { export function deleteAccessToken(accessToken: number) {
return defHttp.delete({ url: '/system/oauth2-token/delete?accessToken=' + accessToken }) return defHttp.delete({ url: `/system/oauth2-token/delete?accessToken=${accessToken}` })
} }

View File

@ -9,7 +9,7 @@ export interface OperateLogVO {
name: string name: string
type: number type: number
content: string content: string
exts: Map<String, Object> exts: Map<string, Object>
defHttpMethod: string defHttpMethod: string
defHttpUrl: string defHttpUrl: string
userIp: string userIp: string

View File

@ -18,7 +18,7 @@ export interface PermissionAssignRoleDataScopeReqVO {
// 查询角色拥有的菜单权限 // 查询角色拥有的菜单权限
export function listRoleMenus(roleId: number) { export function listRoleMenus(roleId: number) {
return defHttp.get({ url: '/system/permission/list-role-resources?roleId=' + roleId }) return defHttp.get({ url: `/system/permission/list-role-resources?roleId=${roleId}` })
} }
// 赋予角色菜单权限 // 赋予角色菜单权限
@ -33,7 +33,7 @@ export function assignRoleDataScope(data: PermissionAssignRoleDataScopeReqVO) {
// 查询用户拥有的角色数组 // 查询用户拥有的角色数组
export function listUserRoles(userId: number) { export function listUserRoles(userId: number) {
return defHttp.get({ url: '/system/permission/list-user-roles?userId=' + userId }) return defHttp.get({ url: `/system/permission/list-user-roles?userId=${userId}` })
} }
// 赋予用户角色 // 赋予用户角色

View File

@ -34,7 +34,7 @@ export function listSimplePosts() {
// 查询岗位详情 // 查询岗位详情
export function getPost(id: number) { export function getPost(id: number) {
return defHttp.get({ url: '/system/post/get?id=' + id }) return defHttp.get({ url: `/system/post/get?id=${id}` })
} }
// 新增岗位 // 新增岗位
@ -49,7 +49,7 @@ export function updatePost(data: PostVO) {
// 删除岗位 // 删除岗位
export function deletePost(id: number) { export function deletePost(id: number) {
return defHttp.delete({ url: '/system/post/delete?id=' + id }) return defHttp.delete({ url: `/system/post/delete?id=${id}` })
} }
// 导出岗位 // 导出岗位

View File

@ -41,7 +41,7 @@ export function listSimpleRoles() {
// 查询角色详情 // 查询角色详情
export function getRole(id: number) { export function getRole(id: number) {
return defHttp.get({ url: '/system/role/get?id=' + id }) return defHttp.get({ url: `/system/role/get?id=${id}` })
} }
// 新增角色 // 新增角色
@ -61,7 +61,7 @@ export function updateRoleStatus(data: UpdateStatusReqVO) {
// 删除角色 // 删除角色
export function deleteRole(id: number) { export function deleteRole(id: number) {
return defHttp.delete({ url: '/system/role/delete?id=' + id }) return defHttp.delete({ url: `/system/role/delete?id=${id}` })
} }
// 导出角色 // 导出角色

View File

@ -30,7 +30,7 @@ export function getSensitiveWordPage(params: SensitiveWordPageReqVO) {
// 查询敏感词详情 // 查询敏感词详情
export function getSensitiveWord(id: number) { export function getSensitiveWord(id: number) {
return defHttp.get({ url: '/system/sensitive-word/get?id=' + id }) return defHttp.get({ url: `/system/sensitive-word/get?id=${id}` })
} }
// 新增敏感词 // 新增敏感词
@ -45,7 +45,7 @@ export function updateSensitiveWord(data: SensitiveWordVO) {
// 删除敏感词 // 删除敏感词
export function deleteSensitiveWord(id: number) { export function deleteSensitiveWord(id: number) {
return defHttp.delete({ url: '/system/sensitive-word/delete?id=' + id }) return defHttp.delete({ url: `/system/sensitive-word/delete?id=${id}` })
} }
// 导出敏感词 // 导出敏感词
@ -60,5 +60,5 @@ export function getSensitiveWordTags() {
// 获得文本所包含的不合法的敏感词数组 // 获得文本所包含的不合法的敏感词数组
export function validateText(id: number) { export function validateText(id: number) {
return defHttp.get({ url: '/system/sensitive-word/validate-text?' + id }) return defHttp.get({ url: `/system/sensitive-word/validate-text?${id}` })
} }

View File

@ -31,7 +31,7 @@ export function getSimpleSmsChannels() {
// 查询短信渠道详情 // 查询短信渠道详情
export function getSmsChannel(id: number) { export function getSmsChannel(id: number) {
return defHttp.get({ url: '/system/sms-channel/get?id=' + id }) return defHttp.get({ url: `/system/sms-channel/get?id=${id}` })
} }
// 新增短信渠道 // 新增短信渠道
@ -46,5 +46,5 @@ export function updateSmsChannel(data: SmsChannelVO) {
// 删除短信渠道 // 删除短信渠道
export function deleteSmsChannel(id: number) { export function deleteSmsChannel(id: number) {
return defHttp.delete({ url: '/system/sms-channel/delete?id=' + id }) return defHttp.delete({ url: `/system/sms-channel/delete?id=${id}` })
} }

View File

@ -50,7 +50,7 @@ export function getSmsTemplatePage(params: SmsTemplatePageReqVO) {
// 查询短信模板详情 // 查询短信模板详情
export function getSmsTemplate(id: number) { export function getSmsTemplate(id: number) {
return defHttp.get({ url: '/system/sms-template/get?id=' + id }) return defHttp.get({ url: `/system/sms-template/get?id=${id}` })
} }
// 新增短信模板 // 新增短信模板
@ -65,11 +65,11 @@ export function updateSmsTemplate(data: SmsTemplateVO) {
// 删除短信模板 // 删除短信模板
export function deleteSmsTemplate(id: number) { export function deleteSmsTemplate(id: number) {
return defHttp.delete({ url: '/system/sms-template/delete?id=' + id }) return defHttp.delete({ url: `/system/sms-template/delete?id=${id}` })
} }
// 邮件模板 // 邮件模板
export type SmsTemplate = { export interface SmsTemplate {
name: string // 标题 name: string // 标题
code: string // 编码 code: string // 编码
accountId: number accountId: number

View File

@ -38,7 +38,7 @@ export function getTenantPage(params: TenantPageReqVO) {
// 查询租户详情 // 查询租户详情
export function getTenant(id: number) { export function getTenant(id: number) {
return defHttp.get({ url: '/system/tenant/get?id=' + id }) return defHttp.get({ url: `/system/tenant/get?id=${id}` })
} }
// 新增租户 // 新增租户
@ -53,7 +53,7 @@ export function updateTenant(data: TenantVO) {
// 删除租户 // 删除租户
export function deleteTenant(id: number) { export function deleteTenant(id: number) {
return defHttp.delete({ url: '/system/tenant/delete?id=' + id }) return defHttp.delete({ url: `/system/tenant/delete?id=${id}` })
} }
// 导出租户 // 导出租户

View File

@ -26,7 +26,7 @@ export function getTenantPackagePage(params: TenantPackagePageReqVO) {
// 获得租户 // 获得租户
export function getTenantPackage(id: number) { export function getTenantPackage(id: number) {
return defHttp.get({ url: '/system/tenant-package/get?id=' + id }) return defHttp.get({ url: `/system/tenant-package/get?id=${id}` })
} }
// 新增租户套餐 // 新增租户套餐
@ -41,7 +41,7 @@ export function updateTenantPackage(data: TenantPackageVO) {
// 删除租户套餐 // 删除租户套餐
export function deleteTenantPackage(id: number) { export function deleteTenantPackage(id: number) {
return defHttp.delete({ url: '/system/tenant-package/delete?id=' + id }) return defHttp.delete({ url: `/system/tenant-package/delete?id=${id}` })
} }
// 获取租户套餐精简信息列表 // 获取租户套餐精简信息列表
export function getTenantPackageList() { export function getTenantPackageList() {

View File

@ -39,7 +39,7 @@ export function getUserPage(params: UserPageReqVO) {
// 查询用户详情 // 查询用户详情
export function getUser(id: number) { export function getUser(id: number) {
return defHttp.get({ url: '/system/user/get?id=' + id }) return defHttp.get({ url: `/system/user/get?id=${id}` })
} }
// 新增用户 // 新增用户
@ -54,7 +54,7 @@ export function updateUser(data: UserVO) {
// 删除用户 // 删除用户
export function deleteUser(id: number) { export function deleteUser(id: number) {
return defHttp.delete({ url: '/system/user/delete?id=' + id }) return defHttp.delete({ url: `/system/user/delete?id=${id}` })
} }
// 导出用户 // 导出用户
@ -71,7 +71,7 @@ export function importUserTemplate() {
export function resetUserPwd(id: number, password: string) { export function resetUserPwd(id: number, password: string) {
const data = { const data = {
id, id,
password password,
} }
return defHttp.put({ url: '/system/user/update-password', data }) return defHttp.put({ url: '/system/user/update-password', data })
} }
@ -80,7 +80,7 @@ export function resetUserPwd(id: number, password: string) {
export function updateUserStatus(id: number, status: number) { export function updateUserStatus(id: number, status: number) {
const data = { const data = {
id, id,
status status,
} }
return defHttp.put({ url: '/system/user/update-status', data }) return defHttp.put({ url: '/system/user/update-status', data })
} }

View File

@ -1,11 +1,10 @@
import { withInstall } from '@/utils'
import appLogo from './src/AppLogo.vue' import appLogo from './src/AppLogo.vue'
import appProvider from './src/AppProvider.vue' import appProvider from './src/AppProvider.vue'
import appSearch from './src/search/AppSearch.vue' import appSearch from './src/search/AppSearch.vue'
import appSizePicker from './src/AppSizePicker.vue' import appSizePicker from './src/AppSizePicker.vue'
import appLocalePicker from './src/AppLocalePicker.vue' import appLocalePicker from './src/AppLocalePicker.vue'
import appDarkModeToggle from './src/AppDarkModeToggle.vue' import appDarkModeToggle from './src/AppDarkModeToggle.vue'
import { withInstall } from '@/utils'
export { useAppProviderContext } from './src/useAppContext' export { useAppProviderContext } from './src/useAppContext'

View File

@ -1,10 +1,3 @@
<template>
<div v-if="getShowDarkModeToggle" :class="getClass" @click="toggleDarkMode">
<div :class="`${prefixCls}-inner`"></div>
<SvgIcon size="14" name="sun" />
<SvgIcon size="14" name="moon" />
</div>
</template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, unref } from 'vue' import { computed, unref } from 'vue'
import { SvgIcon } from '@/components/Icon' import { SvgIcon } from '@/components/Icon'
@ -22,8 +15,8 @@ const isDark = computed(() => getDarkMode.value === ThemeEnum.DARK)
const getClass = computed(() => [ const getClass = computed(() => [
prefixCls, prefixCls,
{ {
[`${prefixCls}--dark`]: unref(isDark) [`${prefixCls}--dark`]: unref(isDark),
} },
]) ])
function toggleDarkMode() { function toggleDarkMode() {
@ -34,6 +27,15 @@ function toggleDarkMode() {
updateSidebarBgColor() updateSidebarBgColor()
} }
</script> </script>
<template>
<div v-if="getShowDarkModeToggle" :class="getClass" @click="toggleDarkMode">
<div :class="`${prefixCls}-inner`" />
<SvgIcon size="14" name="sun" />
<SvgIcon size="14" name="moon" />
</div>
</template>
<style lang="less" scoped> <style lang="less" scoped>
@prefix-cls: ~'@{namespace}-dark-switch'; @prefix-cls: ~'@{namespace}-dark-switch';
@ -46,6 +48,8 @@ html[data-theme='dark'] {
.@{prefix-cls} { .@{prefix-cls} {
position: relative; position: relative;
display: flex; display: flex;
align-items: center;
justify-content: space-between;
width: 50px; width: 50px;
height: 26px; height: 26px;
padding: 0 6px; padding: 0 6px;
@ -53,8 +57,6 @@ html[data-theme='dark'] {
cursor: pointer; cursor: pointer;
background-color: #151515; background-color: #151515;
border-radius: 30px; border-radius: 30px;
justify-content: space-between;
align-items: center;
&-inner { &-inner {
position: absolute; position: absolute;

View File

@ -1,22 +1,7 @@
<template>
<Dropdown
placement="bottom"
:trigger="['click']"
:dropMenuList="localeList"
:selectedKeys="selectedKeys"
@menu-event="handleMenuEvent"
overlayClassName="app-locale-picker-overlay"
>
<span class="cursor-pointer flex items-center">
<Icon icon="ion:language" />
<span v-if="showText" class="ml-1">{{ getLocaleText }}</span>
</span>
</Dropdown>
</template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref, unref, watchEffect } from 'vue'
import type { LocaleType } from '@/types/config' import type { LocaleType } from '@/types/config'
import type { DropMenu } from '@/components/Dropdown' import type { DropMenu } from '@/components/Dropdown'
import { ref, watchEffect, unref, computed } from 'vue'
import { Dropdown } from '@/components/Dropdown' import { Dropdown } from '@/components/Dropdown'
import { Icon } from '@/components/Icon' import { Icon } from '@/components/Icon'
import { useLocale } from '@/locales/useLocale' import { useLocale } from '@/locales/useLocale'
@ -30,7 +15,7 @@ const props = defineProps({
/** /**
* Whether to refresh the interface when changing * Whether to refresh the interface when changing
*/ */
reload: { type: Boolean } reload: { type: Boolean },
}) })
const selectedKeys = ref<string[]>([]) const selectedKeys = ref<string[]>([])
@ -39,10 +24,10 @@ const { changeLocale, getLocale } = useLocale()
const getLocaleText = computed(() => { const getLocaleText = computed(() => {
const key = selectedKeys.value[0] const key = selectedKeys.value[0]
if (!key) { if (!key)
return '' return ''
}
return localeList.find((item) => item.event === key)?.text return localeList.find(item => item.event === key)?.text
}) })
watchEffect(() => { watchEffect(() => {
@ -56,13 +41,29 @@ async function toggleLocale(lang: LocaleType | string) {
} }
function handleMenuEvent(menu: DropMenu) { function handleMenuEvent(menu: DropMenu) {
if (unref(getLocale) === menu.event) { if (unref(getLocale) === menu.event)
return return
}
toggleLocale(menu.event as string) toggleLocale(menu.event as string)
} }
</script> </script>
<template>
<Dropdown
placement="bottom"
:trigger="['click']"
:drop-menu-list="localeList"
:selected-keys="selectedKeys"
overlay-class-name="app-locale-picker-overlay"
@menu-event="handleMenuEvent"
>
<span class="cursor-pointer flex items-center">
<Icon icon="ion:language" />
<span v-if="showText" class="ml-1">{{ getLocaleText }}</span>
</span>
</Dropdown>
</template>
<style lang="less"> <style lang="less">
.app-locale-picker-overlay { .app-locale-picker-overlay {
.ant-dropdown-menu-item { .ant-dropdown-menu-item {

View File

@ -1,11 +1,3 @@
<template>
<div class="anticon" :class="getAppLogoClass" @click="goHome">
<img src="@/assets/images/logo.png" />
<div class="ml-2 truncate md:opacity-100" :class="getTitleClass" v-show="showTitle">
{{ title }}
</div>
</div>
</template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, unref } from 'vue' import { computed, unref } from 'vue'
import { useGlobSetting } from '@/hooks/setting' import { useGlobSetting } from '@/hooks/setting'
@ -20,7 +12,7 @@ const props = defineProps({
// //
showTitle: { type: Boolean, default: true }, showTitle: { type: Boolean, default: true },
// //
alwaysShowTitle: { type: Boolean } alwaysShowTitle: { type: Boolean },
}) })
const { prefixCls } = useDesign('app-logo') const { prefixCls } = useDesign('app-logo')
@ -33,14 +25,24 @@ const getAppLogoClass = computed(() => [prefixCls, props.theme, { 'collapsed-sho
const getTitleClass = computed(() => [ const getTitleClass = computed(() => [
`${prefixCls}__title`, `${prefixCls}__title`,
{ {
'xs:opacity-0': !props.alwaysShowTitle 'xs:opacity-0': !props.alwaysShowTitle,
} },
]) ])
function goHome() { function goHome() {
go(PageEnum.BASE_HOME) go(PageEnum.BASE_HOME)
} }
</script> </script>
<template>
<div class="anticon" :class="getAppLogoClass" @click="goHome">
<img src="@/assets/images/logo.png">
<div v-show="showTitle" class="ml-2 truncate md:opacity-100" :class="getTitleClass">
{{ title }}
</div>
</div>
</template>
<style lang="less" scoped> <style lang="less" scoped>
@prefix-cls: ~'@{namespace}-app-logo'; @prefix-cls: ~'@{namespace}-app-logo';
@ -70,8 +72,8 @@ function goHome() {
&__title { &__title {
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
transition: all 0.5s;
line-height: normal; line-height: normal;
transition: all 0.5s;
} }
} }
</style> </style>

View File

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, toRefs, ref, unref } from 'vue' import { defineComponent, ref, toRefs, unref } from 'vue'
import { createAppProviderContext } from './useAppContext' import { createAppProviderContext } from './useAppContext'
import { createBreakpointListen } from '@/hooks/event/useBreakpoint' import { createBreakpointListen } from '@/hooks/event/useBreakpoint'
import { prefixCls } from '@/settings/designSetting' import { prefixCls } from '@/settings/designSetting'
@ -10,7 +10,7 @@ const props = {
/** /**
* class style prefix * class style prefix
*/ */
prefixCls: { type: String, default: prefixCls } prefixCls: { type: String, default: prefixCls },
} }
export default defineComponent({ export default defineComponent({
@ -26,9 +26,9 @@ export default defineComponent({
// Monitor screen breakpoint information changes // Monitor screen breakpoint information changes
createBreakpointListen(({ screenMap, sizeEnum, width }) => { createBreakpointListen(({ screenMap, sizeEnum, width }) => {
const lgWidth = screenMap.get(sizeEnum.LG) const lgWidth = screenMap.get(sizeEnum.LG)
if (lgWidth) { if (lgWidth)
isMobile.value = width.value - 1 < lgWidth isMobile.value = width.value - 1 < lgWidth
}
handleRestoreState() handleRestoreState()
}) })
@ -45,18 +45,19 @@ export default defineComponent({
if (!unref(isSetState)) { if (!unref(isSetState)) {
isSetState.value = true isSetState.value = true
const { const {
menuSetting: { type: menuType, mode: menuMode, collapsed: menuCollapsed, split: menuSplit } menuSetting: { type: menuType, mode: menuMode, collapsed: menuCollapsed, split: menuSplit },
} = appStore.getProjectConfig } = appStore.getProjectConfig
appStore.setProjectConfig({ appStore.setProjectConfig({
menuSetting: { menuSetting: {
type: MenuTypeEnum.SIDEBAR, type: MenuTypeEnum.SIDEBAR,
mode: MenuModeEnum.INLINE, mode: MenuModeEnum.INLINE,
split: false split: false,
} },
}) })
appStore.setBeforeMiniInfo({ menuMode, menuCollapsed, menuType, menuSplit }) appStore.setBeforeMiniInfo({ menuMode, menuCollapsed, menuType, menuSplit })
} }
} else { }
else {
if (unref(isSetState)) { if (unref(isSetState)) {
isSetState.value = false isSetState.value = false
const { menuMode, menuCollapsed, menuType, menuSplit } = appStore.getBeforeMiniInfo const { menuMode, menuCollapsed, menuType, menuSplit } = appStore.getBeforeMiniInfo
@ -65,13 +66,13 @@ export default defineComponent({
type: menuType, type: menuType,
mode: menuMode, mode: menuMode,
collapsed: menuCollapsed, collapsed: menuCollapsed,
split: menuSplit split: menuSplit,
} },
}) })
} }
} }
} }
return () => slots.default?.() return () => slots.default?.()
} },
}) })
</script> </script>

View File

@ -1,44 +1,29 @@
<template>
<Dropdown
placement="bottom"
:trigger="['click']"
:dropMenuList="sizeList"
:selectedKeys="selectedKeys"
@menu-event="handleMenuEvent"
overlayClassName="app-locale-picker-overlay"
>
<span class="cursor-pointer flex items-center">
<Icon icon="mdi:format-size" />
<span v-if="showText" class="ml-1">{{ getSizeText }}</span>
</span>
</Dropdown>
</template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref, unref, watchEffect } from 'vue'
import type { AppSizeType } from '@/types/config' import type { AppSizeType } from '@/types/config'
import type { DropMenu } from '@/components/Dropdown' import type { DropMenu } from '@/components/Dropdown'
import { ref, watchEffect, unref, computed } from 'vue'
import { Dropdown } from '@/components/Dropdown' import { Dropdown } from '@/components/Dropdown'
import { Icon } from '@/components/Icon' import { Icon } from '@/components/Icon'
import { sizeList } from '@/settings/sizeSetting' import { sizeList } from '@/settings/sizeSetting'
import { useAppStore } from '@/store/modules/app' import { useAppStore } from '@/store/modules/app'
const appStore = useAppStore()
const props = defineProps({ const props = defineProps({
// //
showText: { type: Boolean, default: true }, showText: { type: Boolean, default: true },
// //
reload: { type: Boolean } reload: { type: Boolean },
}) })
const appStore = useAppStore()
const selectedKeys = ref<string[]>([]) const selectedKeys = ref<string[]>([])
const getSizeText = computed(() => { const getSizeText = computed(() => {
const key = selectedKeys.value[0] const key = selectedKeys.value[0]
if (!key) { if (!key)
return '' return ''
}
return sizeList.find((item) => item.event === key)?.text return sizeList.find(item => item.event === key)?.text
}) })
watchEffect(() => { watchEffect(() => {
@ -52,13 +37,29 @@ async function toggleSize(size: AppSizeType) {
} }
function handleMenuEvent(menu: DropMenu) { function handleMenuEvent(menu: DropMenu) {
if (unref(appStore.getComponentSize) === menu.event) { if (unref(appStore.getComponentSize) === menu.event)
return return
}
toggleSize(menu.event as AppSizeType) toggleSize(menu.event as AppSizeType)
} }
</script> </script>
<template>
<Dropdown
placement="bottom"
:trigger="['click']"
:drop-menu-list="sizeList"
:selected-keys="selectedKeys"
overlay-class-name="app-locale-picker-overlay"
@menu-event="handleMenuEvent"
>
<span class="cursor-pointer flex items-center">
<Icon icon="mdi:format-size" />
<span v-if="showText" class="ml-1">{{ getSizeText }}</span>
</span>
</Dropdown>
</template>
<style lang="less"> <style lang="less">
.app-locale-picker-overlay { .app-locale-picker-overlay {
.ant-dropdown-menu-item { .ant-dropdown-menu-item {

View File

@ -21,13 +21,13 @@ export default defineComponent({
<Tooltip> <Tooltip>
{{ {{
title: () => t('common.searchText'), title: () => t('common.searchText'),
default: () => <SearchOutlined /> default: () => <SearchOutlined />,
}} }}
</Tooltip> </Tooltip>
<AppSearchModal onClose={changeModal.bind(null, false)} visible={unref(showModal)} /> <AppSearchModal onClose={changeModal.bind(null, false)} visible={unref(showModal)} />
</div> </div>
) )
} }
} },
}) })
</script> </script>

View File

@ -1,3 +1,12 @@
<script lang="ts" setup>
import AppSearchKeyItem from './AppSearchKeyItem.vue'
import { useDesign } from '@/hooks/web/useDesign'
import { useI18n } from '@/hooks/web/useI18n'
const { prefixCls } = useDesign('app-search-footer')
const { t } = useI18n()
</script>
<template> <template>
<div :class="`${prefixCls}`"> <div :class="`${prefixCls}`">
<AppSearchKeyItem :class="`${prefixCls}-item`" icon="ant-design:enter-outlined" /> <AppSearchKeyItem :class="`${prefixCls}-item`" icon="ant-design:enter-outlined" />
@ -10,19 +19,14 @@
</div> </div>
</template> </template>
<script lang="ts" setup>
import AppSearchKeyItem from './AppSearchKeyItem.vue'
import { useDesign } from '@/hooks/web/useDesign'
import { useI18n } from '@/hooks/web/useI18n'
const { prefixCls } = useDesign('app-search-footer')
const { t } = useI18n()
</script>
<style lang="less" scoped> <style lang="less" scoped>
@prefix-cls: ~'@{namespace}-app-search-footer'; @prefix-cls: ~'@{namespace}-app-search-footer';
.@{prefix-cls} { .@{prefix-cls} {
position: relative; position: relative;
display: flex; display: flex;
flex-shrink: 0;
align-items: center;
height: 44px; height: 44px;
padding: 0 16px; padding: 0 16px;
font-size: 12px; font-size: 12px;
@ -30,11 +34,11 @@ const { t } = useI18n()
background-color: @component-background; background-color: @component-background;
border-top: 1px solid @border-color-base; border-top: 1px solid @border-color-base;
border-radius: 0 0 16px 16px; border-radius: 0 0 16px 16px;
align-items: center;
flex-shrink: 0;
&-item { &-item {
display: flex; display: flex;
align-items: center;
justify-content: center;
width: 20px; width: 20px;
height: 18px; height: 18px;
padding-bottom: 2px; padding-bottom: 2px;
@ -45,8 +49,6 @@ const { t } = useI18n()
inset 0 -2px 0 0 #cdcde6, inset 0 -2px 0 0 #cdcde6,
inset 0 0 1px 1px #fff, inset 0 0 1px 1px #fff,
0 1px 2px 1px rgb(30 35 90 / 40%); 0 1px 2px 1px rgb(30 35 90 / 40%);
align-items: center;
justify-content: center;
&:nth-child(2), &:nth-child(2),
&:nth-child(3), &:nth-child(3),

View File

@ -1,11 +1,13 @@
<script lang="ts" setup>
import { Icon } from '@/components/Icon'
defineProps({
icon: String,
})
</script>
<template> <template>
<span :class="$attrs.class"> <span :class="$attrs.class">
<Icon :icon="icon" /> <Icon :icon="icon" />
</span> </span>
</template> </template>
<script lang="ts" setup>
import { Icon } from '@/components/Icon'
defineProps({
icon: String
})
</script>

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