Compare commits
52 Commits
qhw-dev-0927
...
master
Author | SHA1 | Date |
---|---|---|
ccongli | 48f9bdca7c | 1 year ago |
ccongli | e08e65995f | 1 year ago |
ccongli | 76d9a8bf86 | 1 year ago |
ccongli | 29d30c5581 | 1 year ago |
ccongli | 45a8e573e0 | 1 year ago |
杨世强 | 42020ecc7b | 1 year ago |
杨世强 | 599015f6c1 | 1 year ago |
qiuhongwu | e320886ff7 | 1 year ago |
qiuhongwu | e955c98eab | 1 year ago |
ccongli | a5a703479a | 1 year ago |
杨世强 | 39135c13a8 | 1 year ago |
杨世强 | cbafb07278 | 1 year ago |
ccongli | c79db68acb | 1 year ago |
17602169347 | 615a86d50a | 1 year ago |
17602169347 | 2c16788d8f | 1 year ago |
ccongli | 39ad4dfb72 | 1 year ago |
杨世强 | f19083e8a7 | 1 year ago |
杨世强 | 0350cdae6b | 1 year ago |
qiuhongwu | ba7c34ac0e | 1 year ago |
杨世强 | d1ce48e28b | 1 year ago |
杨世强 | f95b8abb5d | 1 year ago |
qiuhongwu | 98a0015579 | 1 year ago |
qiuhongwu | e566c2bac7 | 1 year ago |
mhsnet | add9532e04 | 1 year ago |
杨世强 | ccc73b1696 | 1 year ago |
ccongli | 19a3825c62 | 1 year ago |
杨世强 | d19160843e | 1 year ago |
LI-CCONG\李聪聪 | 6d37489385 | 1 year ago |
huchuanhu | 68f2af1d49 | 1 year ago |
tengxi | 7fa223db42 | 1 year ago |
mhsnet | dbc20379eb | 1 year ago |
杨世强 | 78f052b3ac | 1 year ago |
杨世强 | c31ed02f9b | 1 year ago |
17602169347 | c1f4520e85 | 1 year ago |
mhsnet | a871d77903 | 1 year ago |
qiuhongwu | 52df6c6b76 | 1 year ago |
17602169347 | 716df92a68 | 1 year ago |
qiuhongwu | 1e104717cb | 1 year ago |
qiuhongwu | 43ea91d5f1 | 1 year ago |
qiuhongwu | 1ada243d7f | 1 year ago |
tengxi | 5bb22e3c7a | 1 year ago |
tengxi | 984d9b94a5 | 1 year ago |
杨世强 | 7a83d4e067 | 1 year ago |
杨世强 | b517aec7d7 | 1 year ago |
qiuhongwu | fa8365f84e | 1 year ago |
tengxi | 30e63f041f | 1 year ago |
tengxi | 4ae74fe524 | 1 year ago |
LI-CCONG\李聪聪 | 9d8fa16a10 | 1 year ago |
杨世强 | 0edbecba34 | 1 year ago |
tengxi | 82a0445962 | 1 year ago |
tengxi | 54b7c20332 | 1 year ago |
LI-CCONG\李聪聪 | b358c9989f | 1 year ago |
@ -1,17 +0,0 @@
|
||||
# 端口号
|
||||
VITE_PORT = 80
|
||||
|
||||
# 网站标题
|
||||
VITE_GLOB_APP_TITLE = 芋道管理系统
|
||||
|
||||
# 简称,用于配置文件名字 不要出现空格、数字开头等特殊字符
|
||||
VITE_GLOB_APP_SHORT_NAME = Yudao_Admin
|
||||
|
||||
# 租户开关
|
||||
VITE_GLOB_APP_TENANT_ENABLE = true
|
||||
|
||||
# 验证码的开关
|
||||
VITE_GLOB_APP_CAPTCHA_ENABLE = true
|
||||
|
||||
# 百度统计
|
||||
VITE_APP_BAIDU_CODE = eb21166668bf766b9d059a6fd1c10777
|
@ -1,33 +0,0 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
.npmrc
|
||||
.cache
|
||||
|
||||
tests/server/static
|
||||
tests/server/static/upload
|
||||
|
||||
*.local
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
.eslintcache
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
# .vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
package-lock.json
|
||||
|
||||
.history
|
@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# shellcheck source=./_/husky.sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
PATH="/usr/local/bin:$PATH"
|
||||
|
||||
npx --no-install commitlint --edit "$1"
|
@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
command_exists () {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Workaround for Windows 10, Git Bash and Yarn
|
||||
if command_exists winpty && test -t 1; then
|
||||
exec < /dev/tty
|
||||
fi
|
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
. "$(dirname "$0")/common.sh"
|
||||
|
||||
[ -n "$CI" ] && exit 0
|
||||
|
||||
PATH="/usr/local/bin:$PATH"
|
||||
|
||||
# Format and submit code according to lintstagedrc.js configuration
|
||||
npm run lint:lint-staged
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"christian-kohler.path-intellisense",
|
||||
"vscode-icons-team.vscode-icons",
|
||||
"davidanson.vscode-markdownlint",
|
||||
"stylelint.vscode-stylelint",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"usernamehw.errorlens",
|
||||
"mrmlnc.vscode-less",
|
||||
"lokalise.i18n-ally",
|
||||
"redhat.vscode-yaml",
|
||||
"csstools.postcss",
|
||||
"mikestead.dotenv",
|
||||
"eamodio.gitlens",
|
||||
"antfu.iconify",
|
||||
"antfu.unocss",
|
||||
"Vue.volar"
|
||||
]
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch Chrome",
|
||||
"url": "http://localhost:80",
|
||||
"webRoot": "${workspaceFolder}/src",
|
||||
"sourceMaps": true
|
||||
}
|
||||
]
|
||||
}
|
@ -1,181 +0,0 @@
|
||||
{
|
||||
"typescript.tsdk": "./node_modules/typescript/lib",
|
||||
"npm.packageManager": "pnpm",
|
||||
"editor.tabSize": 2,
|
||||
"prettier.printWidth": 140, // 超过最大值换行
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"files.eol": "\n",
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/*.log": true,
|
||||
"**/*.log*": true,
|
||||
"**/bower_components": true,
|
||||
"**/dist": true,
|
||||
"**/elehukouben": true,
|
||||
"**/.git": true,
|
||||
"**/.gitignore": true,
|
||||
"**/.svn": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/.idea": true,
|
||||
"**/.vscode": false,
|
||||
"**/yarn.lock": true,
|
||||
"pnpm-lock.yaml": true,
|
||||
"**/tmp": true,
|
||||
"out": true,
|
||||
"dist": true,
|
||||
"public": true,
|
||||
"node_modules": true,
|
||||
"CHANGELOG.md": true,
|
||||
"examples": true,
|
||||
"res": true,
|
||||
"screenshots": true,
|
||||
"yarn-error.log": true,
|
||||
"**/.yarn": true
|
||||
},
|
||||
"files.exclude": {
|
||||
"**/.cache": true,
|
||||
"**/.editorconfig": true,
|
||||
"**/.eslintcache": true,
|
||||
"**/bower_components": true,
|
||||
"**/.idea": true,
|
||||
"**/tmp": true,
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true
|
||||
},
|
||||
"files.watcherExclude": {
|
||||
"**/.git/objects/**": true,
|
||||
"**/.git/subtree-cache/**": true,
|
||||
"**/.vscode/**": true,
|
||||
"**/node_modules/**": true,
|
||||
"**/tmp/**": true,
|
||||
"**/bower_components/**": true,
|
||||
"**/dist/**": true,
|
||||
"**/yarn.lock": true
|
||||
},
|
||||
"stylelint.enable": true,
|
||||
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
|
||||
"path-intellisense.mappings": {
|
||||
"@/": "${workspaceRoot}/src"
|
||||
},
|
||||
"prettier.enable": false,
|
||||
"editor.formatOnSave": false,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true,
|
||||
"source.organizeImports": false
|
||||
},
|
||||
"eslint.rules.customizations": [
|
||||
{
|
||||
"rule": "@stylistic/*",
|
||||
"severity": "off"
|
||||
}
|
||||
],
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"html",
|
||||
"markdown",
|
||||
"json",
|
||||
"jsonc",
|
||||
"yaml"
|
||||
],
|
||||
"[javascriptreact]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
|
||||
},
|
||||
"[typescriptreact]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[html]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[css]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[less]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[scss]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[markdown]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[vue]": {
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true,
|
||||
"source.organizeImports": false,
|
||||
"source.fixAll.stylelint": true
|
||||
}
|
||||
},
|
||||
"i18n-ally.localesPaths": ["src/locales/lang"],
|
||||
"i18n-ally.keystyle": "nested",
|
||||
"i18n-ally.sortKeys": true,
|
||||
"i18n-ally.namespace": true,
|
||||
"i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}",
|
||||
"i18n-ally.enabledParsers": ["ts"],
|
||||
"i18n-ally.sourceLanguage": "en",
|
||||
"i18n-ally.displayLanguage": "zh-CN",
|
||||
"i18n-ally.enabledFrameworks": ["vue", "react"],
|
||||
"cSpell.words": [
|
||||
"antd",
|
||||
"antdv",
|
||||
"antfu",
|
||||
"antv",
|
||||
"brotli",
|
||||
"browserslist",
|
||||
"Cascader",
|
||||
"codemirror",
|
||||
"commitlint",
|
||||
"cropperjs",
|
||||
"echarts",
|
||||
"esnext",
|
||||
"esno",
|
||||
"iconify",
|
||||
"INTLIFY",
|
||||
"lintstagedrc",
|
||||
"logicflow",
|
||||
"nprogress",
|
||||
"pinia",
|
||||
"pnpm",
|
||||
"qrcode",
|
||||
"sider",
|
||||
"sortablejs",
|
||||
"stylelint",
|
||||
"tailwind",
|
||||
"tailwindcss",
|
||||
"tinymce",
|
||||
"unocss",
|
||||
"unref",
|
||||
"vben",
|
||||
"vditor",
|
||||
"videojs",
|
||||
"vitejs",
|
||||
"vuedraggable",
|
||||
"vueuse",
|
||||
"xingyuv",
|
||||
"yudao",
|
||||
"zxcvbn"
|
||||
],
|
||||
// 控制相关文件嵌套展示
|
||||
"explorer.fileNesting.enabled": true,
|
||||
"explorer.fileNesting.expand": false,
|
||||
"explorer.fileNesting.patterns": {
|
||||
"*.ts": "$(capture).test.ts, $(capture).test.tsx",
|
||||
"*.tsx": "$(capture).test.ts, $(capture).test.tsx",
|
||||
"*.env": "$(capture).env.*",
|
||||
"package.json": ".hintrc,pnpm-lock.yaml,yarn.lock,LICENSE,README*,CHANGELOG*,CNAME,.gitattributes,.gitignore,prettier.config.js,stylelint.config.js,commitlint.config.js,.stylelintignore,.prettierignore,.gitpod.yml,.eslintrc.js,.eslintignore"
|
||||
},
|
||||
"eslint.codeAction.showDocumentation": {
|
||||
"enable": true
|
||||
},
|
||||
"terminal.integrated.scrollback": 10000,
|
||||
"nuxt.isNuxtApp": false
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
import { generate } from '@ant-design/colors'
|
||||
|
||||
export const primaryColor = '#0960bd'
|
||||
|
||||
export const darkMode = 'light'
|
||||
|
||||
type Fn = (...arg: any) => any
|
||||
|
||||
type GenerateTheme = 'default' | 'dark'
|
||||
|
||||
export interface GenerateColorsParams {
|
||||
mixLighten: Fn
|
||||
mixDarken: Fn
|
||||
tinycolor: any
|
||||
color?: string
|
||||
}
|
||||
|
||||
export function generateAntColors(color: string, theme: GenerateTheme = 'default') {
|
||||
return generate(color, {
|
||||
theme,
|
||||
})
|
||||
}
|
||||
|
||||
export function getThemeColors(color?: string) {
|
||||
const tc = color || primaryColor
|
||||
const lightColors = generateAntColors(tc)
|
||||
const primary = lightColors[5]
|
||||
const modeColors = generateAntColors(primary, 'dark')
|
||||
|
||||
return [...lightColors, ...modeColors]
|
||||
}
|
||||
|
||||
export function generateColors({ color = primaryColor, mixLighten, mixDarken, tinycolor }: GenerateColorsParams) {
|
||||
const arr = Array.from({ length: 19 }).fill(0)
|
||||
const lightens = arr.map((_t, i) => {
|
||||
return mixLighten(color, i / 5)
|
||||
})
|
||||
|
||||
const darkens = arr.map((_t, i) => {
|
||||
return mixDarken(color, i / 5)
|
||||
})
|
||||
|
||||
const alphaColors = arr.map((_t, i) => {
|
||||
return tinycolor(color)
|
||||
.setAlpha(i / 20)
|
||||
.toRgbString()
|
||||
})
|
||||
|
||||
const shortAlphaColors = alphaColors.map(item => item.replace(/\s/g, '').replace(/0\./g, '.'))
|
||||
|
||||
const tinycolorLightens = arr
|
||||
.map((_t, i) => {
|
||||
return tinycolor(color)
|
||||
.lighten(i * 5)
|
||||
.toHexString()
|
||||
})
|
||||
.filter(item => item !== '#ffffff')
|
||||
|
||||
const tinycolorDarkens = arr
|
||||
.map((_t, i) => {
|
||||
return tinycolor(color)
|
||||
.darken(i * 5)
|
||||
.toHexString()
|
||||
})
|
||||
.filter(item => item !== '#000000')
|
||||
return [...lightens, ...darkens, ...alphaColors, ...shortAlphaColors, ...tinycolorDarkens, ...tinycolorLightens].filter(
|
||||
item => !item.includes('-'),
|
||||
)
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
/**
|
||||
* The name of the configuration file entered in the production environment
|
||||
*/
|
||||
export const GLOB_CONFIG_FILE_NAME = '_app.config.js'
|
||||
|
||||
export const OUTPUT_DIR = 'dist'
|
@ -1,18 +0,0 @@
|
||||
import { resolve } from 'node:path'
|
||||
import { generateAntColors, primaryColor } from '../config/themeConfig'
|
||||
|
||||
/**
|
||||
* less global variable
|
||||
*/
|
||||
export function generateModifyVars() {
|
||||
const palettes = generateAntColors(primaryColor)
|
||||
|
||||
const primaryColorObj: Record<string, string> = {}
|
||||
|
||||
for (let index = 0; index < 10; index++)
|
||||
primaryColorObj[`primary-${index + 1}`] = palettes[index]
|
||||
|
||||
return {
|
||||
hack: `true; @import (reference) "${resolve('src/design/config.less')}";`,
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
import path from 'node:path'
|
||||
import fs from 'fs-extra'
|
||||
import inquirer from 'inquirer'
|
||||
import colors from 'picocolors'
|
||||
import pkg from '../../../package.json'
|
||||
|
||||
async function generateIcon() {
|
||||
const dir = path.resolve(process.cwd(), 'node_modules/@iconify/json')
|
||||
|
||||
const raw = await fs.readJSON(path.join(dir, 'collections.json'))
|
||||
|
||||
const collections = Object.entries(raw).map(([id, v]) => ({
|
||||
...(v as any),
|
||||
id,
|
||||
}))
|
||||
|
||||
const choices = collections.map(item => ({ key: item.id, value: item.id, name: item.name }))
|
||||
|
||||
inquirer
|
||||
.prompt([
|
||||
{
|
||||
type: 'list',
|
||||
name: 'useType',
|
||||
choices: [
|
||||
{ key: 'local', value: 'local', name: 'Local' },
|
||||
{ key: 'onLine', value: 'onLine', name: 'OnLine' },
|
||||
],
|
||||
message: 'How to use icons?',
|
||||
},
|
||||
{
|
||||
type: 'list',
|
||||
name: 'iconSet',
|
||||
choices,
|
||||
message: 'Select the icon set that needs to be generated?',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
name: 'output',
|
||||
message: 'Select the icon set that needs to be generated?',
|
||||
default: 'src/components/Icon/data',
|
||||
},
|
||||
])
|
||||
.then(async (answers) => {
|
||||
const { iconSet, output, useType } = answers
|
||||
const outputDir = path.resolve(process.cwd(), output)
|
||||
await fs.ensureDir(outputDir)
|
||||
const genCollections = collections.filter(item => [iconSet].includes(item.id))
|
||||
const prefixSet: string[] = []
|
||||
for (const info of genCollections) {
|
||||
const data = await fs.readJSON(path.join(dir, 'json', `${info.id}.json`))
|
||||
if (data) {
|
||||
const { prefix } = data
|
||||
const isLocal = useType === 'local'
|
||||
const icons = Object.keys(data.icons).map(item => `${isLocal ? `${prefix}:` : ''}${item}`)
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(output, 'icons.data.ts'),
|
||||
`export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}`,
|
||||
)
|
||||
prefixSet.push(prefix)
|
||||
}
|
||||
}
|
||||
await fs.emptyDir(path.join(process.cwd(), 'node_modules/.vite'))
|
||||
console.log(`✨ ${colors.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`)
|
||||
})
|
||||
}
|
||||
|
||||
generateIcon()
|
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Get the configuration file variable name
|
||||
* @param env
|
||||
*/
|
||||
export function getConfigFileName(env: Record<string, any>) {
|
||||
return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '')
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
/**
|
||||
* 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 fs, { writeFileSync } from 'fs-extra'
|
||||
import colors from 'picocolors'
|
||||
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant'
|
||||
|
||||
import { getEnvConfig, getRootPath } from '../utils'
|
||||
import { getConfigFileName } from '../getConfigFileName'
|
||||
|
||||
import pkg from '../../package.json'
|
||||
|
||||
interface CreateConfigParams {
|
||||
configName: string
|
||||
config: any
|
||||
configFileName?: string
|
||||
}
|
||||
|
||||
function createConfig(params: CreateConfigParams) {
|
||||
const { configName, config, configFileName } = params
|
||||
try {
|
||||
const windowConf = `window.${configName}`
|
||||
// Ensure that the variable will not be modified
|
||||
let configStr = `${windowConf}=${JSON.stringify(config)};`
|
||||
configStr += `
|
||||
Object.freeze(${windowConf});
|
||||
Object.defineProperty(window, "${configName}", {
|
||||
configurable: false,
|
||||
writable: false,
|
||||
});
|
||||
`.replace(/\s/g, '')
|
||||
|
||||
fs.mkdirp(getRootPath(OUTPUT_DIR))
|
||||
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr)
|
||||
|
||||
console.log(`${colors.cyan(`✨ [${pkg.name}]`)} - configuration file is build successfully:`)
|
||||
console.log(`${colors.gray(`${OUTPUT_DIR}/${colors.green(configFileName)}`)}\n`)
|
||||
}
|
||||
catch (error: any) {
|
||||
console.log(colors.red(`configuration file configuration file failed to package:\n${error}`))
|
||||
}
|
||||
}
|
||||
|
||||
export function runBuildConfig() {
|
||||
const config = getEnvConfig()
|
||||
const configFileName = getConfigFileName(config)
|
||||
createConfig({ config, configName: configFileName, configFileName: GLOB_CONFIG_FILE_NAME })
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
// #!/usr/bin/env node
|
||||
|
||||
import colors from 'picocolors'
|
||||
|
||||
import pkg from '../../package.json'
|
||||
import { runBuildConfig } from './buildConf'
|
||||
|
||||
export function runBuild() {
|
||||
try {
|
||||
const argvList = process.argv.splice(2)
|
||||
|
||||
// Generate configuration file
|
||||
if (!argvList.includes('disabled-config'))
|
||||
runBuildConfig()
|
||||
|
||||
console.log(`✨ ${colors.cyan(`[${pkg.name}]`)}` + ' - build successfully!')
|
||||
}
|
||||
catch (error: any) {
|
||||
console.log(colors.red(`vite build error:\n${error}`))
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
runBuild()
|
@ -1,93 +0,0 @@
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import dotenv from 'dotenv'
|
||||
|
||||
export function isDevFn(mode: string): boolean {
|
||||
return mode === 'development'
|
||||
}
|
||||
|
||||
export function isProdFn(mode: string): boolean {
|
||||
return mode === 'production'
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to generate package preview
|
||||
*/
|
||||
export function isReportMode(): boolean {
|
||||
return process.env.REPORT === 'true'
|
||||
}
|
||||
|
||||
// Read all environment variable configuration files to process.env
|
||||
export function wrapperEnv(envConf: Recordable): ViteEnv {
|
||||
const ret: any = {}
|
||||
|
||||
for (const envName of Object.keys(envConf)) {
|
||||
let realName = envConf[envName].replace(/\\n/g, '\n')
|
||||
realName = realName === 'true' ? true : realName === 'false' ? false : realName
|
||||
|
||||
if (envName === 'VITE_PORT')
|
||||
realName = Number(realName)
|
||||
|
||||
if (envName === 'VITE_PROXY' && realName) {
|
||||
try {
|
||||
realName = JSON.parse(realName.replace(/'/g, '"'))
|
||||
}
|
||||
catch (error) {
|
||||
realName = ''
|
||||
}
|
||||
}
|
||||
ret[envName] = realName
|
||||
// if (typeof realName === 'string') {
|
||||
// process.env[envName] = realName;
|
||||
// } else if (typeof realName === 'object') {
|
||||
// process.env[envName] = JSON.stringify(realName);
|
||||
// }
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前环境下生效的配置文件名
|
||||
*/
|
||||
function getConfFiles() {
|
||||
const script = process.env.npm_lifecycle_script
|
||||
const reg = /--mode ([a-z_\d]+)/
|
||||
const result = reg.exec(script as string) as any
|
||||
if (result) {
|
||||
const mode = result[1] as string
|
||||
return ['.env', `.env.${mode}`]
|
||||
}
|
||||
return ['.env', '.env.production']
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the environment variables starting with the specified prefix
|
||||
* @param match prefix
|
||||
* @param confFiles ext
|
||||
*/
|
||||
export function getEnvConfig(match = 'VITE_GLOB_', confFiles = getConfFiles()) {
|
||||
let envConfig = {}
|
||||
confFiles.forEach((item) => {
|
||||
try {
|
||||
const env = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), item)))
|
||||
envConfig = { ...envConfig, ...env }
|
||||
}
|
||||
catch (e) {
|
||||
console.error(`Error in parsing ${item}`, e)
|
||||
}
|
||||
})
|
||||
const reg = new RegExp(`^(${match})`)
|
||||
Object.keys(envConfig).forEach((key) => {
|
||||
if (!reg.test(key))
|
||||
Reflect.deleteProperty(envConfig, key)
|
||||
})
|
||||
return envConfig
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user root directory
|
||||
* @param dir file path
|
||||
*/
|
||||
export function getRootPath(...dir: string[]) {
|
||||
return path.resolve(process.cwd(), ...dir)
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
const include = [
|
||||
'qs',
|
||||
'vue',
|
||||
'less',
|
||||
'axios',
|
||||
'pinia',
|
||||
'dayjs',
|
||||
'echarts',
|
||||
'cropperjs',
|
||||
'crypto-js',
|
||||
'lodash-es',
|
||||
'nprogress',
|
||||
'vue-i18n',
|
||||
'vue-types',
|
||||
'vue-router',
|
||||
'codemirror',
|
||||
'sortablejs',
|
||||
'vuedraggable',
|
||||
'echarts/core',
|
||||
'echarts/charts',
|
||||
'echarts/components',
|
||||
'echarts/renderers',
|
||||
'@vueuse/core',
|
||||
'@zxcvbn-ts/core',
|
||||
'@iconify/iconify',
|
||||
'vue-json-pretty',
|
||||
'ant-design-vue',
|
||||
'ant-design-vue/es/style',
|
||||
'ant-design-vue/es/locale/zh_CN',
|
||||
'ant-design-vue/es/locale/en_US',
|
||||
]
|
||||
|
||||
const exclude = ['@iconify/json']
|
||||
|
||||
export { include, exclude }
|
@ -1,35 +0,0 @@
|
||||
/**
|
||||
* Used to package and output gzip. Note that this does not work properly in Vite, the specific reason is still being investigated
|
||||
* https://github.com/anncwb/vite-plugin-compression
|
||||
*/
|
||||
import type { PluginOption } from 'vite'
|
||||
import compressPlugin from 'vite-plugin-compression'
|
||||
|
||||
export function configCompressPlugin(
|
||||
compress: 'gzip' | 'brotli' | 'none' = 'none',
|
||||
deleteOriginFile = false,
|
||||
): PluginOption | PluginOption[] {
|
||||
const compressList = compress.split(',')
|
||||
|
||||
const plugins: PluginOption[] = []
|
||||
|
||||
if (compressList.includes('gzip')) {
|
||||
plugins.push(
|
||||
compressPlugin({
|
||||
ext: '.gz',
|
||||
deleteOriginFile,
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
if (compressList.includes('brotli')) {
|
||||
plugins.push(
|
||||
compressPlugin({
|
||||
ext: '.br',
|
||||
algorithm: 'brotliCompress',
|
||||
deleteOriginFile,
|
||||
}),
|
||||
)
|
||||
}
|
||||
return plugins
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Plugin to minimize and use ejs template syntax in index.html.
|
||||
* https://github.com/xingyuv/vite-vue-plugin-html
|
||||
*/
|
||||
import type { PluginOption } from 'vite'
|
||||
import { createHtmlPlugin } from 'vite-vue-plugin-html'
|
||||
import pkg from '../../../package.json'
|
||||
import { GLOB_CONFIG_FILE_NAME } from '../../constant'
|
||||
|
||||
export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
|
||||
const { VITE_GLOB_APP_TITLE, VITE_PUBLIC_PATH } = env
|
||||
|
||||
const path = VITE_PUBLIC_PATH.endsWith('/') ? VITE_PUBLIC_PATH : `${VITE_PUBLIC_PATH}/`
|
||||
|
||||
const getAppConfigSrc = () => {
|
||||
return `${path || '/'}${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`
|
||||
}
|
||||
|
||||
const htmlPlugin: PluginOption[] = createHtmlPlugin({
|
||||
minify: isBuild,
|
||||
inject: {
|
||||
// Inject data into ejs template
|
||||
data: {
|
||||
title: VITE_GLOB_APP_TITLE,
|
||||
},
|
||||
// Embed the generated app.config.js file
|
||||
tags: isBuild
|
||||
? [
|
||||
{
|
||||
tag: 'script',
|
||||
attrs: {
|
||||
src: getAppConfigSrc(),
|
||||
},
|
||||
},
|
||||
]
|
||||
: [],
|
||||
},
|
||||
})
|
||||
return htmlPlugin
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
import type { PluginOption } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
import progress from 'vite-plugin-progress'
|
||||
import purgeIcons from 'vite-plugin-purge-icons'
|
||||
import VitePluginCertificate from 'vite-plugin-mkcert'
|
||||
import UnoCSS from 'unocss/vite'
|
||||
import { configPwaConfig } from './pwa'
|
||||
import { configHtmlPlugin } from './html'
|
||||
import { configCompressPlugin } from './compress'
|
||||
import { configVisualizerConfig } from './visualizer'
|
||||
import { configSvgIconsPlugin } from './svgSprite'
|
||||
|
||||
export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
|
||||
const { VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE } = viteEnv
|
||||
|
||||
const vitePlugins: PluginOption[] = [
|
||||
// have to
|
||||
vue(),
|
||||
// have to
|
||||
vueJsx(),
|
||||
// UnoCSS
|
||||
UnoCSS(),
|
||||
// 打包进度条
|
||||
progress(),
|
||||
VitePluginCertificate({
|
||||
source: 'coding',
|
||||
}),
|
||||
]
|
||||
|
||||
// vite-vue-plugin-html
|
||||
vitePlugins.push(configHtmlPlugin(viteEnv, isBuild))
|
||||
|
||||
// vite-plugin-svg-icons
|
||||
vitePlugins.push(configSvgIconsPlugin(isBuild))
|
||||
|
||||
// vite-plugin-purge-icons
|
||||
vitePlugins.push(purgeIcons())
|
||||
|
||||
// rollup-plugin-visualizer
|
||||
vitePlugins.push(configVisualizerConfig())
|
||||
|
||||
// The following plugins only work in the production environment
|
||||
if (isBuild) {
|
||||
// rollup-plugin-gzip
|
||||
vitePlugins.push(configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE))
|
||||
|
||||
// vite-plugin-pwa
|
||||
vitePlugins.push(configPwaConfig(viteEnv))
|
||||
}
|
||||
|
||||
return vitePlugins
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
/**
|
||||
* Zero-config PWA for Vite
|
||||
* https://github.com/antfu/vite-plugin-pwa
|
||||
*/
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
|
||||
export function configPwaConfig(env: ViteEnv) {
|
||||
const { VITE_USE_PWA, VITE_GLOB_APP_TITLE, VITE_GLOB_APP_SHORT_NAME } = env
|
||||
|
||||
if (VITE_USE_PWA) {
|
||||
// vite-plugin-pwa
|
||||
const pwaPlugin = VitePWA({
|
||||
manifest: {
|
||||
name: VITE_GLOB_APP_TITLE,
|
||||
short_name: VITE_GLOB_APP_SHORT_NAME,
|
||||
icons: [
|
||||
{
|
||||
src: './resource/img/pwa-192x192.png',
|
||||
sizes: '192x192',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
src: './resource/img/pwa-512x512.png',
|
||||
sizes: '512x512',
|
||||
type: 'image/png',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
return pwaPlugin
|
||||
}
|
||||
return []
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Vite Plugin for fast creating SVG sprites.
|
||||
* https://github.com/anncwb/vite-plugin-svg-icons
|
||||
*/
|
||||
|
||||
import path from 'node:path'
|
||||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||||
import type { PluginOption } from 'vite'
|
||||
|
||||
export function configSvgIconsPlugin(isBuild: boolean) {
|
||||
const svgIconsPlugin = createSvgIconsPlugin({
|
||||
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
|
||||
svgoOptions: isBuild,
|
||||
// default
|
||||
symbolId: 'icon-[dir]-[name]',
|
||||
})
|
||||
return svgIconsPlugin as PluginOption
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Package file volume analysis
|
||||
*/
|
||||
import visualizer from 'rollup-plugin-visualizer'
|
||||
import type { PluginOption } from 'vite'
|
||||
import { isReportMode } from '../../utils'
|
||||
|
||||
export function configVisualizerConfig() {
|
||||
if (isReportMode()) {
|
||||
return visualizer({
|
||||
filename: './node_modules/.cache/visualizer/stats.html',
|
||||
open: true,
|
||||
gzipSize: true,
|
||||
brotliSize: true,
|
||||
}) as PluginOption
|
||||
}
|
||||
return []
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/**
|
||||
* Used to parse the .env.development proxy configuration
|
||||
*/
|
||||
import type { ProxyOptions } from 'vite'
|
||||
|
||||
type ProxyItem = [string, string]
|
||||
|
||||
type ProxyList = ProxyItem[]
|
||||
|
||||
type ProxyTargetList = Record<string, ProxyOptions>
|
||||
|
||||
const httpsRE = /^https:\/\//
|
||||
|
||||
/**
|
||||
* Generate proxy
|
||||
* @param list
|
||||
*/
|
||||
export function createProxy(list: ProxyList = []) {
|
||||
const ret: ProxyTargetList = {}
|
||||
for (const [prefix, target] of list) {
|
||||
const isHttps = httpsRE.test(target)
|
||||
|
||||
// https://github.com/http-party/node-http-proxy#options
|
||||
ret[prefix] = {
|
||||
target,
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewrite: path => path.replace(new RegExp(`^${prefix}`), ''),
|
||||
// https is require secure=false
|
||||
...(isHttps ? { secure: false } : {}),
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
import type { TentantNameVO } from './model/loginModel'
|
||||
import { defHttp } from '@/utils/http/axios'
|
||||
import { getRefreshToken } from '@/utils/auth'
|
||||
|
||||
enum Api {
|
||||
Login = '/system/auth/login',
|
||||
RefreshToken = '/system/auth/refresh-token?refreshToken=',
|
||||
GetTenantIdByName = '/system/tenant/get-id-by-name?name=',
|
||||
LoginOut = '/system/auth/logout',
|
||||
GetUserInfo = '/system/auth/get-permission-info',
|
||||
GetCaptcha = '/system/captcha/get',
|
||||
CheckCaptcha = '/system/captcha/check',
|
||||
}
|
||||
|
||||
// 刷新访问令牌
|
||||
export function refreshToken() {
|
||||
const refreshToken: string = getRefreshToken()
|
||||
return defHttp.post({ url: Api.RefreshToken + refreshToken })
|
||||
}
|
||||
|
||||
// 使用租户名,获得租户编号
|
||||
export function getTenantIdByName(name: string) {
|
||||
return defHttp.get<TentantNameVO>({ url: Api.GetTenantIdByName + name })
|
||||
}
|
||||
|
||||
// 登出
|
||||
export function loginOut() {
|
||||
return defHttp.delete({ url: Api.LoginOut })
|
||||
}
|
||||
|
||||
// 获取用户权限信息
|
||||
export function getUserInfo() {
|
||||
return defHttp.get({ url: Api.GetUserInfo })
|
||||
}
|
||||
|
||||
// 获取登录验证码
|
||||
export function sendSmsCode(mobile, scene) {
|
||||
return defHttp.post({
|
||||
url: '/system/auth/send-sms-code',
|
||||
data: {
|
||||
mobile,
|
||||
scene,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证图片 以及token
|
||||
export function getCaptcha(data) {
|
||||
return defHttp.post({ url: Api.GetCaptcha, data }, { isReturnNativeResponse: true })
|
||||
}
|
||||
|
||||
// 滑动或者点选验证
|
||||
export function checkCaptcha(data) {
|
||||
return defHttp.post({ url: Api.CheckCaptcha, data }, { isReturnNativeResponse: true })
|
||||
}
|
||||
|
||||
// ========== OAUTH 2.0 相关 ==========
|
||||
|
||||
export function getAuthorize(clientId) {
|
||||
return defHttp.get({ url: `/system/oauth2/authorize?clientId=${clientId}` })
|
||||
}
|
||||
|
||||
export function authorize(responseType, clientId, redirectUri, state, autoApprove, checkedScopes, uncheckedScopes) {
|
||||
// 构建 scopes
|
||||
const scopes = {}
|
||||
for (const scope of checkedScopes)
|
||||
scopes[scope] = true
|
||||
|
||||
for (const scope of uncheckedScopes)
|
||||
scopes[scope] = false
|
||||
|
||||
// 发起请求
|
||||
return defHttp.post({
|
||||
url: '/system/oauth2/authorize',
|
||||
headers: {
|
||||
'Content-type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
params: {
|
||||
response_type: responseType,
|
||||
client_id: clientId,
|
||||
redirect_uri: redirectUri,
|
||||
state,
|
||||
auto_approve: autoApprove,
|
||||
scope: JSON.stringify(scopes),
|
||||
},
|
||||
})
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
import { defHttp } from '@/utils/http/axios'
|
||||
|
||||
// 查询业务线/仓库列表
|
||||
export function getBusinessWarehousePage(params) {
|
||||
return defHttp.get({ url: '/system/business-warehouse/page', params })
|
||||
}
|
||||
|
||||
// 查询业务线/仓库详情
|
||||
export function getBusinessWarehouse(id: number) {
|
||||
return defHttp.get({ url: '/system/business-warehouse/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增业务线/仓库
|
||||
export function createBusinessWarehouse(data) {
|
||||
return defHttp.post({ url: '/system/business-warehouse/create', data })
|
||||
}
|
||||
|
||||
// 修改业务线/仓库
|
||||
export function updateBusinessWarehouse(data) {
|
||||
return defHttp.put({ url: '/system/business-warehouse/update', data })
|
||||
}
|
||||
|
||||
// 删除业务线/仓库
|
||||
export function deleteBusinessWarehouse(id: number) {
|
||||
return defHttp.delete({ url: '/system/business-warehouse/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出业务线/仓库 Excel
|
||||
export function exportBusinessWarehouse(params) {
|
||||
return defHttp.download({ url: '/xxjj/business-warehouse/export-excel', params }, '业务线/仓库.xls')
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
import { defHttp } from '@/utils/http/axios'
|
||||
|
||||
// 查询企业信息列表
|
||||
export function getEnterprisePage(params) {
|
||||
return defHttp.get({ url: '/xxjj/enterprise/page', params })
|
||||
}
|
||||
|
||||
// 查询企业信息详情
|
||||
export function getEnterprise(id: number) {
|
||||
return defHttp.get({ url: '/xxjj/enterprise/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增企业信息
|
||||
export function createEnterprise(data) {
|
||||
return defHttp.post({ url: '/xxjj/enterprise/create', data })
|
||||
}
|
||||
|
||||
// 修改企业信息
|
||||
export function updateEnterprise(data) {
|
||||
return defHttp.put({ url: '/xxjj/enterprise/update', data })
|
||||
}
|
||||
|
||||
// 删除企业信息
|
||||
export function deleteEnterprise(id: number) {
|
||||
return defHttp.delete({ url: '/xxjj/enterprise/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出企业信息 Excel
|
||||
export function exportEnterprise(params) {
|
||||
return defHttp.download({ url: '/xxjj/enterprise/export-excel', params }, '企业信息.xls')
|
||||
}
|
@ -1,215 +0,0 @@
|
||||
import { h } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import type { RouteRecordRaw } from 'vue-router'
|
||||
import type { ErrorMessageMode } from '@/types/axios'
|
||||
|
||||
import { store } from '@/store'
|
||||
import { router } from '@/router'
|
||||
import type { RoleEnum } from '@/enums/roleEnum'
|
||||
import { PageEnum } from '@/enums/pageEnum'
|
||||
import { ACCESS_TOKEN_KEY, REFRESH_TOKEN_KEY, ROLES_KEY, USER_INFO_KEY } from '@/enums/cacheEnum'
|
||||
import { PAGE_NOT_FOUND_ROUTE } from '@/router/routes/basic'
|
||||
import { usePermissionStore } from '@/store/modules/permission'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useMessage } from '@/hooks/web/useMessage'
|
||||
import { getAuthCache, setAuthCache } from '@/utils/auth'
|
||||
import { doLogout, getUserInfo, loginApi, smsLogin } from '@/api/base/user'
|
||||
import type { GetUserInfoModel, LoginParams, SmsLoginParams } from '@/api/base/model/userModel'
|
||||
|
||||
import { isArray } from '@/utils/is'
|
||||
|
||||
interface UserState {
|
||||
userInfo: Nullable<GetUserInfoModel>
|
||||
accessToken?: string
|
||||
refreshToken?: string
|
||||
roleList: RoleEnum[]
|
||||
sessionTimeout?: boolean
|
||||
lastUpdateTime: number
|
||||
}
|
||||
|
||||
export const useUserStore = defineStore('app-user', {
|
||||
state: (): UserState => ({
|
||||
// user info
|
||||
userInfo: null,
|
||||
// token
|
||||
accessToken: undefined,
|
||||
refreshToken: undefined,
|
||||
// roleList
|
||||
roleList: [],
|
||||
// Whether the login expired
|
||||
sessionTimeout: false,
|
||||
// Last fetch time
|
||||
lastUpdateTime: 0,
|
||||
}),
|
||||
getters: {
|
||||
getUserInfo(state): GetUserInfoModel {
|
||||
return state.userInfo || getAuthCache<GetUserInfoModel>(USER_INFO_KEY) || {}
|
||||
},
|
||||
getAccessToken(state): string {
|
||||
return state.accessToken || getAuthCache<string>(ACCESS_TOKEN_KEY)
|
||||
},
|
||||
getRefreshToken(state): string {
|
||||
return state.refreshToken || getAuthCache<string>(REFRESH_TOKEN_KEY)
|
||||
},
|
||||
getRoleList(state): RoleEnum[] {
|
||||
return state.roleList.length > 0 ? state.roleList : getAuthCache<RoleEnum[]>(ROLES_KEY)
|
||||
},
|
||||
getSessionTimeout(state): boolean {
|
||||
return !!state.sessionTimeout
|
||||
},
|
||||
getLastUpdateTime(state): number {
|
||||
return state.lastUpdateTime
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setAccessToken(info: string | undefined) {
|
||||
this.accessToken = info || '' // for null or undefined value
|
||||
setAuthCache(ACCESS_TOKEN_KEY, info)
|
||||
},
|
||||
setRefreshToken(info: string | undefined) {
|
||||
this.refreshToken = info || '' // for null or undefined value
|
||||
setAuthCache(REFRESH_TOKEN_KEY, info)
|
||||
},
|
||||
setRoleList(roleList: RoleEnum[]) {
|
||||
this.roleList = roleList
|
||||
setAuthCache(ROLES_KEY, roleList)
|
||||
},
|
||||
setUserInfo(info: GetUserInfoModel | null) {
|
||||
this.userInfo = info
|
||||
this.lastUpdateTime = new Date().getTime()
|
||||
setAuthCache(USER_INFO_KEY, info)
|
||||
},
|
||||
setSessionTimeout(flag: boolean) {
|
||||
this.sessionTimeout = flag
|
||||
},
|
||||
resetState() {
|
||||
this.userInfo = null
|
||||
this.accessToken = ''
|
||||
this.roleList = []
|
||||
this.sessionTimeout = false
|
||||
},
|
||||
/**
|
||||
* @description: login
|
||||
*/
|
||||
async login(
|
||||
params: LoginParams & {
|
||||
goHome?: boolean
|
||||
mode?: ErrorMessageMode
|
||||
},
|
||||
): Promise<GetUserInfoModel | null> {
|
||||
try {
|
||||
const { goHome = true, mode, ...loginParams } = params
|
||||
const data = await loginApi(loginParams, mode)
|
||||
const { accessToken, refreshToken } = data
|
||||
|
||||
// save token
|
||||
this.setAccessToken(accessToken)
|
||||
this.setRefreshToken(refreshToken)
|
||||
return this.afterLoginAction(goHome)
|
||||
}
|
||||
catch (error) {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
},
|
||||
async smsLogin(
|
||||
params: SmsLoginParams & {
|
||||
goHome?: boolean
|
||||
mode?: ErrorMessageMode
|
||||
},
|
||||
): Promise<GetUserInfoModel | null> {
|
||||
try {
|
||||
const { goHome = true, mode, ...smsLoginParams } = params
|
||||
const data = await smsLogin(smsLoginParams, mode)
|
||||
const { accessToken, refreshToken } = data
|
||||
// save token
|
||||
this.setAccessToken(accessToken)
|
||||
this.setRefreshToken(refreshToken)
|
||||
return this.afterLoginAction(goHome)
|
||||
}
|
||||
catch (error) {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
},
|
||||
async afterLoginAction(goHome?: boolean): Promise<GetUserInfoModel | null> {
|
||||
if (!this.getAccessToken)
|
||||
return null
|
||||
// get user info
|
||||
const userInfo = await this.getUserInfoAction()
|
||||
|
||||
const sessionTimeout = this.sessionTimeout
|
||||
if (sessionTimeout) {
|
||||
this.setSessionTimeout(false)
|
||||
}
|
||||
else {
|
||||
const permissionStore = usePermissionStore()
|
||||
if (!permissionStore.isDynamicAddedRoute) {
|
||||
const routes = await permissionStore.buildRoutesAction()
|
||||
routes.forEach((route) => {
|
||||
try {
|
||||
router.addRoute(route as unknown as RouteRecordRaw)
|
||||
}
|
||||
catch (e) {}
|
||||
})
|
||||
router.addRoute(PAGE_NOT_FOUND_ROUTE as unknown as RouteRecordRaw)
|
||||
permissionStore.setDynamicAddedRoute(true)
|
||||
}
|
||||
goHome && (await router.replace(PageEnum.BASE_HOME))
|
||||
}
|
||||
return userInfo
|
||||
},
|
||||
async getUserInfoAction(): Promise<GetUserInfoModel | null> {
|
||||
if (!this.getAccessToken)
|
||||
return null
|
||||
const userInfo = await getUserInfo()
|
||||
const { roles = [] } = userInfo
|
||||
if (isArray(roles)) {
|
||||
const roleList = roles.map(item => item) as RoleEnum[]
|
||||
this.setRoleList(roleList)
|
||||
}
|
||||
else {
|
||||
userInfo.roles = []
|
||||
this.setRoleList([])
|
||||
}
|
||||
this.setUserInfo(userInfo)
|
||||
return userInfo
|
||||
},
|
||||
/**
|
||||
* @description: logout
|
||||
*/
|
||||
async logout(goLogin = false) {
|
||||
if (this.getAccessToken) {
|
||||
try {
|
||||
await doLogout()
|
||||
}
|
||||
catch {
|
||||
console.log('注销Token失败')
|
||||
}
|
||||
}
|
||||
this.setAccessToken(undefined)
|
||||
this.setSessionTimeout(false)
|
||||
this.setUserInfo(null)
|
||||
goLogin && router.push(PageEnum.BASE_LOGIN)
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: Confirm before logging out
|
||||
*/
|
||||
confirmLoginOut() {
|
||||
const { createConfirm } = useMessage()
|
||||
const { t } = useI18n()
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: () => h('span', t('sys.app.logoutTip')),
|
||||
content: () => h('span', t('sys.app.logoutMessage')),
|
||||
onOk: async () => {
|
||||
await this.logout(true)
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// Need to be used outside the setup
|
||||
export function useUserStoreWithOut() {
|
||||
return useUserStore(store)
|
||||
}
|
@ -1,164 +0,0 @@
|
||||
/**
|
||||
* 数据字典工具类
|
||||
*/
|
||||
import { useDictStoreWithOut } from '@/store/modules/dict'
|
||||
|
||||
const dictStore = useDictStoreWithOut()
|
||||
|
||||
/**
|
||||
* 获取 dictType 对应的数据字典数组
|
||||
*
|
||||
* @param dictType 数据类型
|
||||
* @returns {*|Array} 数据字典数组
|
||||
*/
|
||||
export interface DictDataType {
|
||||
dictType: string
|
||||
label: string
|
||||
value: string | number | boolean
|
||||
key?: any
|
||||
colorType: string
|
||||
cssClass: string
|
||||
}
|
||||
|
||||
export function getDictDatas(dictType: string) {
|
||||
return dictStore.getDictMap[dictType] || []
|
||||
}
|
||||
|
||||
export function getDictOpts(dictType: string) {
|
||||
/**
|
||||
* 这里原来是转换类型 转换类型后反而显示不出来正确的Tag
|
||||
* 实际类型转换交给下面的getDictOptions来处理
|
||||
*
|
||||
* bugfix:
|
||||
* dictOption.push({
|
||||
...dict,
|
||||
value: parseInt(dict.value + '')
|
||||
})
|
||||
原来的这种写法是造成页面卡死的原因
|
||||
*/
|
||||
return getDictDatas(dictType)
|
||||
}
|
||||
|
||||
export function getDictOptions(dictType: string, valueType?: 'string' | 'number' | 'boolean') {
|
||||
const dictOption: DictDataType[] = []
|
||||
const dictOptions: DictDataType[] = getDictDatas(dictType)
|
||||
if (dictOptions && dictOptions.length > 0) {
|
||||
dictOptions.forEach((dict: DictDataType) => {
|
||||
dictOption.push({
|
||||
...dict,
|
||||
key: dict.value,
|
||||
value:
|
||||
valueType === 'string'
|
||||
? `${dict.value}`
|
||||
: valueType === 'boolean'
|
||||
? `${dict.value}` === 'true'
|
||||
: Number.parseInt(`${dict.value}`),
|
||||
})
|
||||
})
|
||||
}
|
||||
return dictOption
|
||||
}
|
||||
|
||||
export function getDictObj(dictType: string, value: any) {
|
||||
const dictOptions: DictDataType[] = getDictDatas(dictType)
|
||||
if (dictOptions) {
|
||||
dictOptions.forEach((dict: DictDataType) => {
|
||||
if (dict.value === value.toString())
|
||||
return dict
|
||||
})
|
||||
}
|
||||
else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export enum DICT_TYPE {
|
||||
USER_TYPE = 'user_type',
|
||||
COMMON_STATUS = 'common_status',
|
||||
SYSTEM_TENANT_PACKAGE_ID = 'system_tenant_package_id',
|
||||
|
||||
// ========== SYSTEM 模块 ==========
|
||||
SYSTEM_USER_SEX = 'system_user_sex',
|
||||
SYSTEM_MENU_TYPE = 'system_menu_type',
|
||||
SYSTEM_ROLE_TYPE = 'system_role_type',
|
||||
SYSTEM_DATA_SCOPE = 'system_data_scope',
|
||||
SYSTEM_NOTICE_TYPE = 'system_notice_type',
|
||||
SYSTEM_OPERATE_TYPE = 'system_operate_type',
|
||||
SYSTEM_LOGIN_TYPE = 'system_login_type',
|
||||
SYSTEM_LOGIN_RESULT = 'system_login_result',
|
||||
SYSTEM_SMS_CHANNEL_CODE = 'system_sms_channel_code',
|
||||
SYSTEM_SMS_TEMPLATE_TYPE = 'system_sms_template_type',
|
||||
SYSTEM_SMS_SEND_STATUS = 'system_sms_send_status',
|
||||
SYSTEM_SMS_RECEIVE_STATUS = 'system_sms_receive_status',
|
||||
SYSTEM_ERROR_CODE_TYPE = 'system_error_code_type',
|
||||
SYSTEM_OAUTH2_GRANT_TYPE = 'system_oauth2_grant_type',
|
||||
SYSTEM_MAIL_SEND_STATUS = 'system_mail_send_status',
|
||||
SYSTEM_NOTIFY_TEMPLATE_TYPE = 'system_notify_template_type',
|
||||
|
||||
// ========== INFRA 模块 ==========
|
||||
INFRA_BOOLEAN_STRING = 'infra_boolean_string',
|
||||
INFRA_REDIS_TIMEOUT_TYPE = 'infra_redis_timeout_type',
|
||||
INFRA_JOB_STATUS = 'infra_job_status',
|
||||
INFRA_JOB_LOG_STATUS = 'infra_job_log_status',
|
||||
INFRA_API_ERROR_LOG_PROCESS_STATUS = 'infra_api_error_log_process_status',
|
||||
INFRA_CONFIG_TYPE = 'infra_config_type',
|
||||
INFRA_CODEGEN_TEMPLATE_TYPE = 'infra_codegen_template_type',
|
||||
INFRA_CODEGEN_FRONT_TYPE = 'infra_codegen_front_type',
|
||||
INFRA_CODEGEN_SCENE = 'infra_codegen_scene',
|
||||
INFRA_FILE_STORAGE = 'infra_file_storage',
|
||||
|
||||
// ========== BPM 模块 ==========
|
||||
BPM_MODEL_CATEGORY = 'bpm_model_category',
|
||||
BPM_MODEL_FORM_TYPE = 'bpm_model_form_type',
|
||||
BPM_TASK_ASSIGN_RULE_TYPE = 'bpm_task_assign_rule_type',
|
||||
BPM_PROCESS_INSTANCE_STATUS = 'bpm_process_instance_status',
|
||||
BPM_PROCESS_INSTANCE_RESULT = 'bpm_process_instance_result',
|
||||
BPM_TASK_ASSIGN_SCRIPT = 'bpm_task_assign_script',
|
||||
BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type',
|
||||
|
||||
// ========== PAY 模块 ==========
|
||||
PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型
|
||||
PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态
|
||||
PAY_REFUND_STATUS = 'pay_refund_status', // 退款订单状态
|
||||
PAY_NOTIFY_STATUS = 'pay_notify_status', // 商户支付回调状态
|
||||
PAY_NOTIFY_TYPE = 'pay_notify_type', // 商户支付回调状态
|
||||
|
||||
// ========== MP 模块 ==========
|
||||
MP_AUTO_REPLY_REQUEST_MATCH = 'mp_auto_reply_request_match', // 自动回复请求匹配类型
|
||||
MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型
|
||||
|
||||
// ========== MALL - 会员模块 ==========
|
||||
MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', // 积分的业务类型
|
||||
|
||||
// ========== MALL - 商品模块 ==========
|
||||
PRODUCT_UNIT = 'product_unit', // 商品单位
|
||||
PRODUCT_SPU_STATUS = 'product_spu_status', // 商品状态
|
||||
|
||||
// ========== MALL - 交易模块 ==========
|
||||
EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode', // 快递的计费方式
|
||||
TRADE_AFTER_SALE_STATUS = 'trade_after_sale_status', // 售后 - 状态
|
||||
TRADE_AFTER_SALE_WAY = 'trade_after_sale_way', // 售后 - 方式
|
||||
TRADE_AFTER_SALE_TYPE = 'trade_after_sale_type', // 售后 - 类型
|
||||
TRADE_ORDER_TYPE = 'trade_order_type', // 订单 - 类型
|
||||
TRADE_ORDER_STATUS = 'trade_order_status', // 订单 - 状态
|
||||
TRADE_ORDER_ITEM_AFTER_SALE_STATUS = 'trade_order_item_after_sale_status', // 订单项 - 售后状态
|
||||
TERMINAL = 'terminal', // 终端
|
||||
|
||||
// ========== MALL - 营销模块 ==========
|
||||
PROMOTION_DISCOUNT_TYPE = 'promotion_discount_type', // 优惠类型
|
||||
PROMOTION_PRODUCT_SCOPE = 'promotion_product_scope', // 营销的商品范围
|
||||
PROMOTION_COUPON_TEMPLATE_VALIDITY_TYPE = 'promotion_coupon_template_validity_type', // 优惠劵模板的有限期类型
|
||||
PROMOTION_COUPON_STATUS = 'promotion_coupon_status', // 优惠劵的状态
|
||||
PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式
|
||||
PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态
|
||||
PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举
|
||||
|
||||
// ============= BUSINESSLINE 模块=================
|
||||
BUSINESS_TYPE = 'business_type', //业务线类型
|
||||
DIFF_FLAG = 'diff_flag',
|
||||
|
||||
// ============= ENTERPRISEBRANCHING 模块=================
|
||||
ENTERPRISE_TYPE = 'enterprise_type', //业务线类型
|
||||
CLASS_STATUS = 'class_status',
|
||||
|
||||
}
|
@ -1,125 +0,0 @@
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, ref } from 'vue'
|
||||
import DeptModal from './DeptModal.vue'
|
||||
import { columns, searchFormSchema } from './dept.data'
|
||||
import { handleTree } from '@/utils/tree'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useMessage } from '@/hooks/web/useMessage'
|
||||
import { useModal } from '@/components/Modal'
|
||||
import { IconEnum } from '@/enums/appEnum'
|
||||
import { BasicTable, TableAction, useTable } from '@/components/Table'
|
||||
import { getListSimpleUsers } from '@/api/system/user'
|
||||
import { deleteDept, getDeptPage } from '@/api/system/dept'
|
||||
|
||||
defineOptions({ name: 'SystemDept' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const { createMessage } = useMessage()
|
||||
const [registerModal, { openModal }] = useModal()
|
||||
|
||||
const [register, { expandAll, collapseAll, getForm, reload }] = useTable({
|
||||
title: '部门列表',
|
||||
api: getList,
|
||||
columns,
|
||||
rowKey: 'id',
|
||||
formConfig: { labelWidth: 120, schemas: searchFormSchema },
|
||||
isTreeTable: true,
|
||||
pagination: false,
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
showIndexColumn: false,
|
||||
actionColumn: {
|
||||
width: 140,
|
||||
title: t('common.action'),
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
},
|
||||
})
|
||||
|
||||
async function getList() {
|
||||
const res = await getDeptPage(getForm().getFieldsValue() as any)
|
||||
return handleTree(res, 'id')
|
||||
}
|
||||
|
||||
const users = ref<any[]>([])
|
||||
|
||||
async function getUserList() {
|
||||
const res = await getListSimpleUsers()
|
||||
users.value = res
|
||||
}
|
||||
|
||||
function handleCreate() {
|
||||
openModal(true, { isUpdate: false })
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true })
|
||||
}
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
await deleteDept(record.id)
|
||||
createMessage.success(t('common.delSuccessText'))
|
||||
reload()
|
||||
}
|
||||
|
||||
function onFetchSuccess() {
|
||||
nextTick(expandAll)
|
||||
}
|
||||
|
||||
function userNicknameFormat(row) {
|
||||
if (!row.leaderUserId)
|
||||
return '未设置'
|
||||
|
||||
for (const user of users.value) {
|
||||
if (row.leaderUserId === user.id)
|
||||
return user.nickname
|
||||
}
|
||||
return `未知【${row.leaderUserId}】`
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getUserList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="register" @fetch-success="onFetchSuccess">
|
||||
<template #toolbar>
|
||||
<a-button v-auth="['system:dept:create']" type="primary" :pre-icon="IconEnum.ADD" @click="handleCreate">
|
||||
{{ t('action.create') }}
|
||||
</a-button>
|
||||
<a-button type="info" @click="expandAll">
|
||||
{{ t('component.tree.expandAll') }}
|
||||
</a-button>
|
||||
<a-button type="info" @click="collapseAll">
|
||||
{{ t('component.tree.unExpandAll') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #leader="{ text }">
|
||||
<span> {{ userNicknameFormat(text) }} </span>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'system:dept:update', onClick: handleEdit.bind(null, record) },
|
||||
{
|
||||
icon: IconEnum.DELETE,
|
||||
danger: true,
|
||||
label: t('action.delete'),
|
||||
auth: 'system:dept:delete',
|
||||
popConfirm: {
|
||||
title: t('common.delMessage'),
|
||||
placement: 'left',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<DeptModal @register="registerModal" @success="reload()" />
|
||||
</div>
|
||||
</template>
|
@ -1,142 +0,0 @@
|
||||
<script lang="ts" setup>
|
||||
import { reactive } from 'vue'
|
||||
import UserModal from './UserModal.vue'
|
||||
import UserRoleModal from './UserRoleModal.vue'
|
||||
import ResetPwdModal from './ResetPwdModal.vue'
|
||||
import DeptTree from './DeptTree.vue'
|
||||
import { columns, searchFormSchema } from './user.data'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useMessage } from '@/hooks/web/useMessage'
|
||||
import { useModal } from '@/components/Modal'
|
||||
import { IconEnum } from '@/enums/appEnum'
|
||||
import { BasicTable, TableAction, useTable } from '@/components/Table'
|
||||
import type { UserExportReqVO } from '@/api/system/user'
|
||||
import { deleteUser, exportUser, getUserPage } from '@/api/system/user'
|
||||
|
||||
defineOptions({ name: 'SystemUser' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const { createConfirm, createMessage } = useMessage()
|
||||
const [registerModal, { openModal }] = useModal()
|
||||
const [registerRoleModal, { openModal: openRoleModal }] = useModal()
|
||||
const [registerPwdModal, { openModal: openPwdModal }] = useModal()
|
||||
const searchInfo = reactive<Recordable>({})
|
||||
|
||||
const [registerTable, { getForm, reload }] = useTable({
|
||||
title: '账号列表',
|
||||
api: getUserPage,
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
showIndexColumn: false,
|
||||
actionColumn: {
|
||||
width: 140,
|
||||
title: t('common.action'),
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
},
|
||||
})
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleCreate() {
|
||||
openModal(true, { isUpdate: false })
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
async function handleExport() {
|
||||
createConfirm({
|
||||
title: t('common.exportTitle'),
|
||||
iconType: 'warning',
|
||||
content: t('common.exportMessage'),
|
||||
async onOk() {
|
||||
await exportUser(getForm().getFieldsValue() as UserExportReqVO)
|
||||
createMessage.success(t('common.exportSuccessText'))
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true })
|
||||
}
|
||||
|
||||
/** 分配用户角色操作 */
|
||||
function handleRole(record: Recordable) {
|
||||
openRoleModal(true, { record })
|
||||
}
|
||||
|
||||
/** 重置密码按钮操作 */
|
||||
function handleResetPwd(record: Recordable) {
|
||||
openPwdModal(true, { record })
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
async function handleDelete(record: Recordable) {
|
||||
await deleteUser(record.id)
|
||||
createMessage.success(t('common.delSuccessText'))
|
||||
reload()
|
||||
}
|
||||
/** 点击部门操作 */
|
||||
function handleSelect(deptId = '') {
|
||||
searchInfo.deptId = deptId
|
||||
reload()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex">
|
||||
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
|
||||
<BasicTable class="w-3/4 xl:w-4/5" :search-info="searchInfo" @register="registerTable">
|
||||
<template #toolbar>
|
||||
<a-button v-auth="['system:user:create']" type="primary" :pre-icon="IconEnum.ADD" @click="handleCreate">
|
||||
{{ t('action.create') }}
|
||||
</a-button>
|
||||
<a-button v-auth="['system:user:export']" :pre-icon="IconEnum.EXPORT" @click="handleExport">
|
||||
{{ t('action.export') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'system:user:update', onClick: handleEdit.bind(null, record) },
|
||||
]"
|
||||
:drop-down-actions="[
|
||||
{
|
||||
icon: IconEnum.EDIT,
|
||||
label: '分配角色',
|
||||
auth: 'system:permission:assign-user-role',
|
||||
onClick: handleRole.bind(null, record),
|
||||
},
|
||||
{
|
||||
icon: IconEnum.EDIT,
|
||||
label: '重置密码',
|
||||
auth: 'system:user:update-password',
|
||||
onClick: handleResetPwd.bind(null, record),
|
||||
},
|
||||
{
|
||||
icon: IconEnum.DELETE,
|
||||
danger: true,
|
||||
label: t('action.delete'),
|
||||
auth: 'system:user:delete',
|
||||
popConfirm: {
|
||||
title: t('common.delMessage'),
|
||||
placement: 'left',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<UserModal @register="registerModal" @success="reload()" />
|
||||
<UserRoleModal @register="registerRoleModal" @success="reload()" />
|
||||
<ResetPwdModal @register="registerPwdModal" @success="reload()" />
|
||||
</div>
|
||||
</template>
|
@ -1,284 +0,0 @@
|
||||
import { h } from 'vue'
|
||||
import { Switch } from 'ant-design-vue'
|
||||
import { useMessage } from '@/hooks/web/useMessage'
|
||||
import { listSimpleDept } from '@/api/system/dept'
|
||||
import { listSimplePosts } from '@/api/system/post'
|
||||
import type { BasicColumn, FormSchema } from '@/components/Table'
|
||||
import { useRender } from '@/components/Table'
|
||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||
import { updateUserStatus } from '@/api/system/user'
|
||||
import { listSimpleRoles } from '@/api/system/role'
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '用户编号',
|
||||
dataIndex: 'id',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '用户名称',
|
||||
dataIndex: 'username',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '用户昵称',
|
||||
dataIndex: 'nickname',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
dataIndex: 'deptId',
|
||||
width: 120,
|
||||
customRender: ({ record }) => {
|
||||
return useRender.renderTag(record.dept && record.dept.name)
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
dataIndex: 'mobile',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
width: 180,
|
||||
// customRender: ({ text }) => {
|
||||
// return useRender.renderDict(text, DICT_TYPE.COMMON_STATUS)
|
||||
// }
|
||||
customRender: ({ record }) => {
|
||||
if (!Reflect.has(record, 'pendingStatus'))
|
||||
record.pendingStatus = false
|
||||
|
||||
return h(Switch, {
|
||||
checked: record.status === 0,
|
||||
checkedChildren: '已启用',
|
||||
unCheckedChildren: '已禁用',
|
||||
loading: record.pendingStatus,
|
||||
onChange(checked: boolean) {
|
||||
record.pendingStatus = true
|
||||
const newStatus = checked ? 0 : 1
|
||||
const { createMessage } = useMessage()
|
||||
updateUserStatus(record.id, newStatus)
|
||||
.then(() => {
|
||||
record.status = newStatus
|
||||
createMessage.success('已成功修改用户状态')
|
||||
})
|
||||
.catch(() => {
|
||||
createMessage.error('修改用户状态失败')
|
||||
})
|
||||
.finally(() => {
|
||||
record.pendingStatus = false
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
width: 180,
|
||||
customRender: ({ text }) => {
|
||||
return useRender.renderDate(text)
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '用户名称',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
label: '手机号码',
|
||||
field: 'mobile',
|
||||
component: 'Input',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
field: 'createTime',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
]
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '编号',
|
||||
field: 'id',
|
||||
show: false,
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '用户昵称',
|
||||
field: 'nickname',
|
||||
required: true,
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '用户头像',
|
||||
field: 'avatar',
|
||||
component: 'FileUpload',
|
||||
componentProps: {
|
||||
maxCount: 1,
|
||||
fileType: 'image',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '归属部门',
|
||||
field: 'deptId',
|
||||
required: true,
|
||||
component: 'ApiTreeSelect',
|
||||
componentProps: {
|
||||
api: () => listSimpleDept(),
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
key: 'id',
|
||||
value: 'id',
|
||||
},
|
||||
handleTree: 'id',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '手机号码',
|
||||
field: 'mobile',
|
||||
required: true,
|
||||
defaultValue: 0,
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
field: 'email',
|
||||
required: true,
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '用户名称',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
dynamicDisabled: ({ values }) => !!values.id,
|
||||
},
|
||||
{
|
||||
label: '用户密码',
|
||||
field: 'password',
|
||||
component: 'InputPassword',
|
||||
ifShow: ({ values }) => !values.id,
|
||||
},
|
||||
{
|
||||
label: '用户性别',
|
||||
field: 'sex',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '岗位',
|
||||
field: 'postIds',
|
||||
component: 'ApiSelect',
|
||||
defaultValue: [],
|
||||
componentProps: {
|
||||
api: () => listSimplePosts(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
mode: 'tags',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
field: 'status',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
field: 'remark',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
]
|
||||
|
||||
export const userRoleFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '编号',
|
||||
field: 'id',
|
||||
show: false,
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '用户名称',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
dynamicDisabled: () => true,
|
||||
},
|
||||
{
|
||||
label: '用户昵称',
|
||||
field: 'nickname',
|
||||
component: 'Input',
|
||||
dynamicDisabled: () => true,
|
||||
},
|
||||
{
|
||||
label: '角色',
|
||||
field: 'roleIds',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: () => listSimpleRoles(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
mode: 'tags',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export const userPwdFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'newPassword',
|
||||
label: '新密码',
|
||||
component: 'StrengthMeter',
|
||||
componentProps: {
|
||||
placeholder: '新密码',
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入新密码',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
field: 'confirmPassword',
|
||||
label: '确认密码',
|
||||
component: 'InputPassword',
|
||||
dynamicRules: ({ values }) => {
|
||||
return [
|
||||
{
|
||||
required: true,
|
||||
validator: (_, value) => {
|
||||
if (!value)
|
||||
return Promise.reject('密码不能为空')
|
||||
|
||||
if (value !== values.newPassword)
|
||||
return Promise.reject('两次输入的密码不一致!')
|
||||
|
||||
return Promise.resolve()
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
},
|
||||
]
|
Binary file not shown.
@ -1,57 +0,0 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="isUpdate ? t('action.edit') : t('action.create')" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, unref } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useMessage } from '@/hooks/web/useMessage'
|
||||
import { BasicForm, useForm } from '@/components/Form'
|
||||
import { BasicModal, useModalInner } from '@/components/Modal'
|
||||
import { createFormSchema, updateFormSchema } from './businessWarehouse.data'
|
||||
import { createBusinessWarehouse, getBusinessWarehouse, updateBusinessWarehouse } from '@/api/xxjj/businessWarehouse'
|
||||
|
||||
defineOptions({ name: 'BusinessWarehouseModal' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const { createMessage } = useMessage()
|
||||
const emit = defineEmits(['success', 'register'])
|
||||
const isUpdate = ref(true)
|
||||
|
||||
const [registerForm, { setFieldsValue, resetFields, resetSchema, validate }] = useForm({
|
||||
labelWidth: 120,
|
||||
baseColProps: { span: 24 },
|
||||
schemas: createFormSchema,
|
||||
showActionButtonGroup: false,
|
||||
actionColOptions: { span: 23 }
|
||||
})
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
resetFields()
|
||||
setModalProps({ confirmLoading: false })
|
||||
isUpdate.value = !!data?.isUpdate
|
||||
if (unref(isUpdate)) {
|
||||
resetSchema(updateFormSchema)
|
||||
const res = await getBusinessWarehouse(data.record.id)
|
||||
setFieldsValue({ ...res })
|
||||
}
|
||||
})
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate()
|
||||
setModalProps({ confirmLoading: true })
|
||||
if (unref(isUpdate)) {
|
||||
await updateBusinessWarehouse(values)
|
||||
} else {
|
||||
await createBusinessWarehouse(values)
|
||||
}
|
||||
closeModal()
|
||||
emit('success')
|
||||
createMessage.success(t('common.saveSuccessText'))
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false })
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,92 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #toolbar>
|
||||
<a-button type="primary" v-auth="['xxjj:business-warehouse:create']" :preIcon="IconEnum.ADD" @click="handleCreate">
|
||||
{{ t('action.create') }}
|
||||
</a-button>
|
||||
<a-button type="warning" v-auth="['xxjj:business-warehouse:export']" :preIcon="IconEnum.EXPORT" @click="handleExport">
|
||||
{{ t('action.export') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'xxjj:business-warehouse:update', onClick: handleEdit.bind(null, record) },
|
||||
{
|
||||
icon: IconEnum.DELETE,
|
||||
color: 'error',
|
||||
label: t('action.delete'),
|
||||
auth: 'xxjj:business-warehouse:delete',
|
||||
popConfirm: {
|
||||
title: t('common.delMessage'),
|
||||
placement: 'left',
|
||||
confirm: handleDelete.bind(null, record)
|
||||
}
|
||||
}
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<BusinessWarehouseModal @register="registerModal" @success="reload()" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useMessage } from '@/hooks/web/useMessage'
|
||||
import { useModal } from '@/components/Modal'
|
||||
import BusinessWarehouseModal from './BusinessWarehouseModal.vue'
|
||||
import { IconEnum } from '@/enums/appEnum'
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table'
|
||||
import { deleteBusinessWarehouse, exportBusinessWarehouse, getBusinessWarehousePage } from '@/api/xxjj/businessWarehouse'
|
||||
import { columns, searchFormSchema } from './businessWarehouse.data'
|
||||
|
||||
defineOptions({ name: 'BusinessWarehouse' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const { createConfirm, createMessage } = useMessage()
|
||||
const [registerModal, { openModal }] = useModal()
|
||||
|
||||
const [registerTable, { getForm, reload }] = useTable({
|
||||
title: '业务线/仓库列表',
|
||||
api: getBusinessWarehousePage,
|
||||
columns,
|
||||
formConfig: { labelWidth: 120, schemas: searchFormSchema },
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
actionColumn: {
|
||||
width: 140,
|
||||
title: t('common.action'),
|
||||
dataIndex: 'action',
|
||||
fixed: 'right'
|
||||
}
|
||||
})
|
||||
|
||||
function handleCreate() {
|
||||
openModal(true, { isUpdate: false })
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true })
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
createConfirm({
|
||||
title: t('common.exportTitle'),
|
||||
iconType: 'warning',
|
||||
content: t('common.exportMessage'),
|
||||
async onOk() {
|
||||
await exportBusinessWarehouse(getForm().getFieldsValue())
|
||||
createMessage.success(t('common.exportSuccessText'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
await deleteBusinessWarehouse(record.id)
|
||||
createMessage.success(t('common.delSuccessText'))
|
||||
reload()
|
||||
}
|
||||
</script>
|
@ -1,57 +0,0 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="isUpdate ? t('action.edit') : t('action.create')" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, unref } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useMessage } from '@/hooks/web/useMessage'
|
||||
import { BasicForm, useForm } from '@/components/Form'
|
||||
import { BasicModal, useModalInner } from '@/components/Modal'
|
||||
import { createFormSchema, updateFormSchema } from './enterprise.data'
|
||||
import { createEnterprise, getEnterprise, updateEnterprise } from '@/api/system/enterprise'
|
||||
|
||||
defineOptions({ name: 'EnterpriseModal' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const { createMessage } = useMessage()
|
||||
const emit = defineEmits(['success', 'register'])
|
||||
const isUpdate = ref(true)
|
||||
|
||||
const [registerForm, { setFieldsValue, resetFields, resetSchema, validate }] = useForm({
|
||||
labelWidth: 120,
|
||||
baseColProps: { span: 24 },
|
||||
schemas: createFormSchema,
|
||||
showActionButtonGroup: false,
|
||||
actionColOptions: { span: 23 }
|
||||
})
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
resetFields()
|
||||
setModalProps({ confirmLoading: false })
|
||||
isUpdate.value = !!data?.isUpdate
|
||||
if (unref(isUpdate)) {
|
||||
resetSchema(updateFormSchema)
|
||||
const res = await getEnterprise(data.record.id)
|
||||
setFieldsValue({ ...res })
|
||||
}
|
||||
})
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate()
|
||||
setModalProps({ confirmLoading: true })
|
||||
if (unref(isUpdate)) {
|
||||
await updateEnterprise(values)
|
||||
} else {
|
||||
await createEnterprise(values)
|
||||
}
|
||||
closeModal()
|
||||
emit('success')
|
||||
createMessage.success(t('common.saveSuccessText'))
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false })
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,92 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #toolbar>
|
||||
<a-button type="primary" v-auth="['system:enterprise:create']" :preIcon="IconEnum.ADD" @click="handleCreate">
|
||||
{{ t('action.create') }}
|
||||
</a-button>
|
||||
<a-button type="warning" v-auth="['system:enterprise:export']" :preIcon="IconEnum.EXPORT" @click="handleExport">
|
||||
{{ t('action.export') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'system:enterprise:update', onClick: handleEdit.bind(null, record) },
|
||||
{
|
||||
icon: IconEnum.DELETE,
|
||||
color: 'error',
|
||||
label: t('action.delete'),
|
||||
auth: 'system:enterprise:delete',
|
||||
popConfirm: {
|
||||
title: t('common.delMessage'),
|
||||
placement: 'left',
|
||||
confirm: handleDelete.bind(null, record)
|
||||
}
|
||||
}
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<EnterpriseModal @register="registerModal" @success="reload()" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useMessage } from '@/hooks/web/useMessage'
|
||||
import { useModal } from '@/components/Modal'
|
||||
import EnterpriseModal from './EnterpriseModal.vue'
|
||||
import { IconEnum } from '@/enums/appEnum'
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table'
|
||||
import { deleteEnterprise, exportEnterprise, getEnterprisePage } from '@/api/system/enterprise'
|
||||
import { columns, searchFormSchema } from './enterprise.data'
|
||||
|
||||
defineOptions({ name: 'Enterprise' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const { createConfirm, createMessage } = useMessage()
|
||||
const [registerModal, { openModal }] = useModal()
|
||||
|
||||
const [registerTable, { getForm, reload }] = useTable({
|
||||
title: '分支机构',
|
||||
api: getEnterprisePage,
|
||||
columns,
|
||||
formConfig: { labelWidth: 120, schemas: searchFormSchema },
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
actionColumn: {
|
||||
width: 140,
|
||||
title: t('common.action'),
|
||||
dataIndex: 'action',
|
||||
fixed: 'right'
|
||||
}
|
||||
})
|
||||
|
||||
function handleCreate() {
|
||||
openModal(true, { isUpdate: false })
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, { record, isUpdate: true })
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
createConfirm({
|
||||
title: t('common.exportTitle'),
|
||||
iconType: 'warning',
|
||||
content: t('common.exportMessage'),
|
||||
async onOk() {
|
||||
await exportEnterprise(getForm().getFieldsValue())
|
||||
createMessage.success(t('common.exportSuccessText'))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
await deleteEnterprise(record.id)
|
||||
createMessage.success(t('common.delSuccessText'))
|
||||
reload()
|
||||
}
|
||||
</script>
|
@ -0,0 +1,18 @@
|
||||
package com.yunxi.scm.module.system.enums.business;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BusinessEnum {
|
||||
|
||||
ENABLE("0"), // 启用
|
||||
|
||||
DISABLE("1"); // 禁用
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final String status;
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessenterpriserelational;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
import com.yunxi.scm.framework.common.pojo.CommonResult;
|
||||
import static com.yunxi.scm.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yunxi.scm.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yunxi.scm.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.yunxi.scm.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yunxi.scm.module.system.controller.admin.businessenterpriserelational.vo.*;
|
||||
import com.yunxi.scm.module.system.dal.dataobject.businessenterpriserelational.BusinessEnterpriseRelationalDO;
|
||||
import com.yunxi.scm.module.system.convert.businessenterpriserelational.BusinessEnterpriseRelationalConvert;
|
||||
import com.yunxi.scm.module.system.service.businessenterpriserelational.BusinessEnterpriseRelationalService;
|
||||
|
||||
@Tag(name = "管理后台 - 业务线和机构关联")
|
||||
@RestController
|
||||
@RequestMapping("/system/business-enterprise-relational")
|
||||
@Validated
|
||||
public class BusinessEnterpriseRelationalController {
|
||||
|
||||
@Resource
|
||||
private BusinessEnterpriseRelationalService businessEnterpriseRelationalService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建业务线和机构关联")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-enterprise-relational:create')")
|
||||
public CommonResult<Long> createBusinessEnterpriseRelational(@Valid @RequestBody BusinessEnterpriseRelationalCreateReqVO createReqVO) {
|
||||
return success(businessEnterpriseRelationalService.createBusinessEnterpriseRelational(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新业务线和机构关联")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-enterprise-relational:update')")
|
||||
public CommonResult<Boolean> updateBusinessEnterpriseRelational(@Valid @RequestBody BusinessEnterpriseRelationalUpdateReqVO updateReqVO) {
|
||||
businessEnterpriseRelationalService.updateBusinessEnterpriseRelational(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除业务线和机构关联")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:business-enterprise-relational:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessEnterpriseRelational(@RequestParam("id") Long id) {
|
||||
businessEnterpriseRelationalService.deleteBusinessEnterpriseRelational(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得业务线和机构关联")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-enterprise-relational:query')")
|
||||
public CommonResult<BusinessEnterpriseRelationalRespVO> getBusinessEnterpriseRelational(@RequestParam("id") Long id) {
|
||||
BusinessEnterpriseRelationalDO businessEnterpriseRelational = businessEnterpriseRelationalService.getBusinessEnterpriseRelational(id);
|
||||
return success(BusinessEnterpriseRelationalConvert.INSTANCE.convert(businessEnterpriseRelational));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得业务线和机构关联列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-enterprise-relational:query')")
|
||||
public CommonResult<List<BusinessEnterpriseRelationalRespVO>> getBusinessEnterpriseRelationalList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<BusinessEnterpriseRelationalDO> list = businessEnterpriseRelationalService.getBusinessEnterpriseRelationalList(ids);
|
||||
return success(BusinessEnterpriseRelationalConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得业务线和机构关联分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-enterprise-relational:query')")
|
||||
public CommonResult<PageResult<BusinessEnterpriseRelationalRespVO>> getBusinessEnterpriseRelationalPage(@Valid BusinessEnterpriseRelationalPageReqVO pageVO) {
|
||||
PageResult<BusinessEnterpriseRelationalDO> pageResult = businessEnterpriseRelationalService.getBusinessEnterpriseRelationalPage(pageVO);
|
||||
return success(BusinessEnterpriseRelationalConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出业务线和机构关联 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-enterprise-relational:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportBusinessEnterpriseRelationalExcel(@Valid BusinessEnterpriseRelationalExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<BusinessEnterpriseRelationalDO> list = businessEnterpriseRelationalService.getBusinessEnterpriseRelationalList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<BusinessEnterpriseRelationalExcelVO> datas = BusinessEnterpriseRelationalConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "业务线和机构关联.xls", "数据", BusinessEnterpriseRelationalExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessenterpriserelational.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线和机构关联创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BusinessEnterpriseRelationalCreateReqVO extends BusinessEnterpriseRelationalBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessenterpriserelational.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 业务线和机构关联 Excel VO
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Data
|
||||
public class BusinessEnterpriseRelationalExcelVO {
|
||||
|
||||
@ExcelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("业务线id")
|
||||
private Long businessId;
|
||||
|
||||
@ExcelProperty("企业id")
|
||||
private Long enterpriseId;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessenterpriserelational.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yunxi.scm.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线和机构关联分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BusinessEnterpriseRelationalPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "业务线id", example = "3256")
|
||||
private Long businessId;
|
||||
|
||||
@Schema(description = "企业id", example = "15640")
|
||||
private Long enterpriseId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessenterpriserelational.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线和机构关联 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BusinessEnterpriseRelationalRespVO extends BusinessEnterpriseRelationalBaseVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21519")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessenterpriserelational.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线和机构关联更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BusinessEnterpriseRelationalUpdateReqVO extends BusinessEnterpriseRelationalBaseVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21519")
|
||||
@NotNull(message = "主键id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessuserrelational;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
import com.yunxi.scm.framework.common.pojo.CommonResult;
|
||||
import static com.yunxi.scm.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.yunxi.scm.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.yunxi.scm.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.yunxi.scm.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.yunxi.scm.module.system.controller.admin.businessuserrelational.vo.*;
|
||||
import com.yunxi.scm.module.system.dal.dataobject.businessuserrelational.BusinessUserRelationalDO;
|
||||
import com.yunxi.scm.module.system.convert.businessuserrelational.BusinessUserRelationalConvert;
|
||||
import com.yunxi.scm.module.system.service.businessuserrelational.BusinessUserRelationalService;
|
||||
|
||||
@Tag(name = "管理后台 - 业务线和用户关联")
|
||||
@RestController
|
||||
@RequestMapping("/system/business-user-relational")
|
||||
@Validated
|
||||
public class BusinessUserRelationalController {
|
||||
|
||||
@Resource
|
||||
private BusinessUserRelationalService businessUserRelationalService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建业务线和用户关联")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-user-relational:create')")
|
||||
public CommonResult<Long> createBusinessUserRelational(@Valid @RequestBody BusinessUserRelationalCreateReqVO createReqVO) {
|
||||
return success(businessUserRelationalService.createBusinessUserRelational(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新业务线和用户关联")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-user-relational:update')")
|
||||
public CommonResult<Boolean> updateBusinessUserRelational(@Valid @RequestBody BusinessUserRelationalUpdateReqVO updateReqVO) {
|
||||
businessUserRelationalService.updateBusinessUserRelational(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除业务线和用户关联")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:business-user-relational:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessUserRelational(@RequestParam("id") Long id) {
|
||||
businessUserRelationalService.deleteBusinessUserRelational(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得业务线和用户关联")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-user-relational:query')")
|
||||
public CommonResult<BusinessUserRelationalRespVO> getBusinessUserRelational(@RequestParam("id") Long id) {
|
||||
BusinessUserRelationalDO businessUserRelational = businessUserRelationalService.getBusinessUserRelational(id);
|
||||
return success(BusinessUserRelationalConvert.INSTANCE.convert(businessUserRelational));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得业务线和用户关联列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-user-relational:query')")
|
||||
public CommonResult<List<BusinessUserRelationalRespVO>> getBusinessUserRelationalList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<BusinessUserRelationalDO> list = businessUserRelationalService.getBusinessUserRelationalList(ids);
|
||||
return success(BusinessUserRelationalConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得业务线和用户关联分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-user-relational:query')")
|
||||
public CommonResult<PageResult<BusinessUserRelationalRespVO>> getBusinessUserRelationalPage(@Valid BusinessUserRelationalPageReqVO pageVO) {
|
||||
PageResult<BusinessUserRelationalDO> pageResult = businessUserRelationalService.getBusinessUserRelationalPage(pageVO);
|
||||
return success(BusinessUserRelationalConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出业务线和用户关联 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:business-user-relational:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportBusinessUserRelationalExcel(@Valid BusinessUserRelationalExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<BusinessUserRelationalDO> list = businessUserRelationalService.getBusinessUserRelationalList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<BusinessUserRelationalExcelVO> datas = BusinessUserRelationalConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "业务线和用户关联.xls", "数据", BusinessUserRelationalExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessuserrelational.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线和用户关联创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BusinessUserRelationalCreateReqVO extends BusinessUserRelationalBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessuserrelational.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 业务线和用户关联 Excel VO
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Data
|
||||
public class BusinessUserRelationalExcelVO {
|
||||
|
||||
@ExcelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("业务线/仓库id")
|
||||
private Long businessId;
|
||||
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessuserrelational.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.yunxi.scm.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线和用户关联分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BusinessUserRelationalPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "业务线/仓库id", example = "29863")
|
||||
private Long businessId;
|
||||
|
||||
@Schema(description = "用户id", example = "2593")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessuserrelational.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线和用户关联 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BusinessUserRelationalRespVO extends BusinessUserRelationalBaseVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17732")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businessuserrelational.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线和用户关联更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BusinessUserRelationalUpdateReqVO extends BusinessUserRelationalBaseVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17732")
|
||||
@NotNull(message = "主键id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businesswarehouse.vo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线表精简信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BusinessSimpleRespVo {
|
||||
|
||||
@Schema(description = "业务线编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "业务线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "父部门 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long parentId;
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.businesswarehouse.vo;
|
||||
|
||||
|
||||
import com.yunxi.scm.framework.common.pojo.PageParam;
|
||||
import com.yunxi.scm.module.system.dal.dataobject.businesswarehouse.BusinessWarehouseDO;
|
||||
import com.yunxi.scm.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 业务线员工信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BusinessUserVO extends AdminUserDO {
|
||||
|
||||
|
||||
@Schema(description = "帐号状态")
|
||||
private Integer accountStatus;
|
||||
@Schema(description = "业务编号")
|
||||
private Integer businessId;
|
||||
@Schema(description = "业务名称")
|
||||
private String businessName;
|
||||
@Schema(description = "员工编号")
|
||||
private Integer userId;
|
||||
@Schema(description = "分页")
|
||||
private Integer pageNo;
|
||||
@Schema(description = "分页")
|
||||
private Integer pageSize;
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
@Schema(description = "职务名称")
|
||||
private String postName;
|
||||
@Schema(description = "创建时间", example = "[2022-07-01 00:00:00, 2022-07-01 23:59:59]")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] loginTime;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.yunxi.scm.module.system.convert.businessenterpriserelational;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import com.yunxi.scm.module.system.controller.admin.businessenterpriserelational.vo.*;
|
||||
import com.yunxi.scm.module.system.dal.dataobject.businessenterpriserelational.BusinessEnterpriseRelationalDO;
|
||||
|
||||
/**
|
||||
* 业务线和机构关联 Convert
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Mapper
|
||||
public interface BusinessEnterpriseRelationalConvert {
|
||||
|
||||
BusinessEnterpriseRelationalConvert INSTANCE = Mappers.getMapper(BusinessEnterpriseRelationalConvert.class);
|
||||
|
||||
BusinessEnterpriseRelationalDO convert(BusinessEnterpriseRelationalCreateReqVO bean);
|
||||
|
||||
BusinessEnterpriseRelationalDO convert(BusinessEnterpriseRelationalUpdateReqVO bean);
|
||||
|
||||
BusinessEnterpriseRelationalRespVO convert(BusinessEnterpriseRelationalDO bean);
|
||||
|
||||
List<BusinessEnterpriseRelationalRespVO> convertList(List<BusinessEnterpriseRelationalDO> list);
|
||||
|
||||
PageResult<BusinessEnterpriseRelationalRespVO> convertPage(PageResult<BusinessEnterpriseRelationalDO> page);
|
||||
|
||||
List<BusinessEnterpriseRelationalExcelVO> convertList02(List<BusinessEnterpriseRelationalDO> list);
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.yunxi.scm.module.system.convert.businessuserrelational;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import com.yunxi.scm.module.system.controller.admin.businessuserrelational.vo.*;
|
||||
import com.yunxi.scm.module.system.dal.dataobject.businessuserrelational.BusinessUserRelationalDO;
|
||||
|
||||
/**
|
||||
* 业务线和用户关联 Convert
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Mapper
|
||||
public interface BusinessUserRelationalConvert {
|
||||
|
||||
BusinessUserRelationalConvert INSTANCE = Mappers.getMapper(BusinessUserRelationalConvert.class);
|
||||
|
||||
BusinessUserRelationalDO convert(BusinessUserRelationalCreateReqVO bean);
|
||||
|
||||
BusinessUserRelationalDO convert(BusinessUserRelationalUpdateReqVO bean);
|
||||
|
||||
BusinessUserRelationalRespVO convert(BusinessUserRelationalDO bean);
|
||||
|
||||
List<BusinessUserRelationalRespVO> convertList(List<BusinessUserRelationalDO> list);
|
||||
|
||||
PageResult<BusinessUserRelationalRespVO> convertPage(PageResult<BusinessUserRelationalDO> page);
|
||||
|
||||
List<BusinessUserRelationalExcelVO> convertList02(List<BusinessUserRelationalDO> list);
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue