更新小计
This commit is contained in:
parent
2348fd316a
commit
5be26b6120
|
@ -1,4 +1,4 @@
|
|||
NODE_ENV = 'development'
|
||||
|
||||
# Base API
|
||||
NODE_ENV = 'development'
|
||||
|
||||
# Base API
|
||||
VITE_APP_BASE_URL=''
|
|
@ -0,0 +1,3 @@
|
|||
NODE_ENV = 'production'
|
||||
# Base API
|
||||
VITE_APP_BASE_URL=''
|
|
@ -1,42 +1,42 @@
|
|||
/* eslint-env node */
|
||||
require('@rushstack/eslint-patch/modern-module-resolution')
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
ignorePatterns: ['/auto-imports.d.ts', '/components.d.ts'],
|
||||
extends: [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/eslint-config-typescript/recommended',
|
||||
'@vue/eslint-config-prettier',
|
||||
'./.eslintrc-auto-import.json'
|
||||
],
|
||||
rules: {
|
||||
'prettier/prettier': [
|
||||
'warn',
|
||||
{
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
printWidth: 100,
|
||||
proseWrap: 'preserve',
|
||||
bracketSameLine: false,
|
||||
endOfLine: 'lf',
|
||||
tabWidth: 4,
|
||||
useTabs: false,
|
||||
trailingComma: 'none'
|
||||
}
|
||||
],
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'no-undef': 'off',
|
||||
'vue/prefer-import-from-vue': 'off',
|
||||
'no-prototype-builtins': 'off',
|
||||
'prefer-spread': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off'
|
||||
},
|
||||
globals: {
|
||||
module: 'readonly'
|
||||
}
|
||||
}
|
||||
/* eslint-env node */
|
||||
require('@rushstack/eslint-patch/modern-module-resolution')
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
ignorePatterns: ['/auto-imports.d.ts', '/components.d.ts'],
|
||||
extends: [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/eslint-config-typescript/recommended',
|
||||
'@vue/eslint-config-prettier',
|
||||
'./.eslintrc-auto-import.json'
|
||||
],
|
||||
rules: {
|
||||
'prettier/prettier': [
|
||||
'warn',
|
||||
{
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
printWidth: 100,
|
||||
proseWrap: 'preserve',
|
||||
bracketSameLine: false,
|
||||
endOfLine: 'lf',
|
||||
tabWidth: 4,
|
||||
useTabs: false,
|
||||
trailingComma: 'none'
|
||||
}
|
||||
],
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'no-undef': 'off',
|
||||
'vue/prefer-import-from-vue': 'off',
|
||||
'no-prototype-builtins': 'off',
|
||||
'prefer-spread': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off'
|
||||
},
|
||||
globals: {
|
||||
module: 'readonly'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# unplugin-auto-import
|
||||
auto-imports.d.ts
|
||||
components.d.ts
|
||||
.eslintrc-auto-import.json
|
||||
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# .env
|
||||
.env.development
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# unplugin-auto-import
|
||||
auto-imports.d.ts
|
||||
components.d.ts
|
||||
.eslintrc-auto-import.json
|
||||
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# .env
|
||||
.env.development
|
||||
.env.production
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
|
||||
}
|
||||
{
|
||||
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"editor.detectIndentation": false,
|
||||
"editor.tabSize": 4,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
},
|
||||
"css.validate": false,
|
||||
"less.validate": false,
|
||||
"scss.validate": false
|
||||
}
|
||||
{
|
||||
"editor.detectIndentation": false,
|
||||
"editor.tabSize": 4,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
},
|
||||
"css.validate": false,
|
||||
"less.validate": false,
|
||||
"scss.validate": false
|
||||
}
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
# vue-project
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
||||
|
||||
## Type Support for `.vue` Imports in TS
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
||||
|
||||
1. Disable the built-in TypeScript Extension
|
||||
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
||||
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
||||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
npm run lint
|
||||
```
|
||||
# vue-project
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
||||
|
||||
## Type Support for `.vue` Imports in TS
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
||||
|
||||
1. Disable the built-in TypeScript Extension
|
||||
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
||||
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
||||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
npm run lint
|
||||
```
|
||||
|
|
|
@ -1 +1 @@
|
|||
/// <reference types="vite/client" />
|
||||
/// <reference types="vite/client" />
|
||||
|
|
132
admin/index.html
132
admin/index.html
|
@ -1,66 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>后台管理系统</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.preload {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.circular {
|
||||
height: 42px;
|
||||
width: 42px;
|
||||
animation: loading-rotate 2s linear infinite;
|
||||
}
|
||||
|
||||
.circular .path {
|
||||
animation: loading-dash 1.5s ease-in-out infinite;
|
||||
stroke-dasharray: 90, 150;
|
||||
stroke-dashoffset: 0;
|
||||
stroke-width: 2;
|
||||
stroke: #4073fa;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
|
||||
@keyframes loading-rotate {
|
||||
100% {
|
||||
transform: rotate(1turn);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loading-dash {
|
||||
|
||||
0% {
|
||||
stroke-dasharray: 90, 150;
|
||||
stroke-dashoffset: -40px;
|
||||
}
|
||||
|
||||
100% {
|
||||
stroke-dasharray: 90, 150;
|
||||
stroke-dashoffset: -120px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="preload">
|
||||
<svg viewBox="25 25 50 50" class="circular">
|
||||
<circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>后台管理系统</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.preload {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.circular {
|
||||
height: 42px;
|
||||
width: 42px;
|
||||
animation: loading-rotate 2s linear infinite;
|
||||
}
|
||||
|
||||
.circular .path {
|
||||
animation: loading-dash 1.5s ease-in-out infinite;
|
||||
stroke-dasharray: 90, 150;
|
||||
stroke-dashoffset: 0;
|
||||
stroke-width: 2;
|
||||
stroke: #4073fa;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
|
||||
@keyframes loading-rotate {
|
||||
100% {
|
||||
transform: rotate(1turn);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loading-dash {
|
||||
|
||||
0% {
|
||||
stroke-dasharray: 90, 150;
|
||||
stroke-dashoffset: -40px;
|
||||
}
|
||||
|
||||
100% {
|
||||
stroke-dasharray: 90, 150;
|
||||
stroke-dashoffset: -120px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="preload">
|
||||
<svg viewBox="25 25 50 50" class="circular">
|
||||
<circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,63 +1,65 @@
|
|||
{
|
||||
"name": "vue-project",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"preview": "vite preview --port 4173",
|
||||
"build": "vite build && node scripts/release.mjs",
|
||||
"type-check": "vue-tsc --noEmit",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.0.6",
|
||||
"@highlightjs/vue-plugin": "^2.1.0",
|
||||
"@wangeditor/editor": "^5.1.12",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"axios": "^0.27.2",
|
||||
"css-color-function": "^1.3.3",
|
||||
"echarts": "^5.3.3",
|
||||
"element-plus": "^2.2.9",
|
||||
"highlight.js": "^11.6.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^2.0.14",
|
||||
"vue": "^3.2.37",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-echarts": "^6.2.3",
|
||||
"vue-router": "^4.0.16",
|
||||
"vue3-video-play": "^1.3.1-beta.6",
|
||||
"vuedraggable": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.1.0",
|
||||
"@tailwindcss/line-clamp": "^0.4.2",
|
||||
"@types/lodash-es": "^4.17.6",
|
||||
"@types/node": "^16.11.41",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@vitejs/plugin-legacy": "^2.3.1",
|
||||
"@vitejs/plugin-vue": "^3.0.0",
|
||||
"@vitejs/plugin-vue-jsx": "^2.0.0",
|
||||
"@vue/eslint-config-prettier": "^7.0.0",
|
||||
"@vue/eslint-config-typescript": "^11.0.0",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"autoprefixer": "^10.4.7",
|
||||
"consola": "^2.15.3",
|
||||
"eslint": "^8.5.0",
|
||||
"eslint-plugin-vue": "^9.0.0",
|
||||
"execa": "^6.1.0",
|
||||
"fs-extra": "^10.1.0",
|
||||
"postcss": "^8.4.14",
|
||||
"prettier": "^2.5.1",
|
||||
"sass": "^1.53.0",
|
||||
"tailwindcss": "^3.0.24",
|
||||
"terser": "^5.15.1",
|
||||
"typescript": "~4.7.4",
|
||||
"unplugin-auto-import": "^0.9.2",
|
||||
"unplugin-vue-components": "^0.19.9",
|
||||
"vite": "^3.0.0",
|
||||
"vite-plugin-style-import": "^2.0.0",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||
"vue-tsc": "^0.38.1"
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "vue-project",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"preview": "vite preview --port 4173",
|
||||
"build": "vite build && node scripts/release.mjs",
|
||||
"type-check": "vue-tsc --noEmit",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
||||
},
|
||||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||
"@element-plus/icons-vue": "^2.0.6",
|
||||
"@highlightjs/vue-plugin": "^2.1.0",
|
||||
"@wangeditor/editor": "^5.1.12",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"axios": "^0.27.2",
|
||||
"css-color-function": "^1.3.3",
|
||||
"echarts": "^5.3.3",
|
||||
"element-plus": "^2.2.9",
|
||||
"highlight.js": "^11.6.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^2.0.14",
|
||||
"vue": "^3.2.37",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-echarts": "^6.2.3",
|
||||
"vue-router": "^4.0.16",
|
||||
"vue-simple-calendar": "^6.3.1",
|
||||
"vue3-video-play": "^1.3.1-beta.6",
|
||||
"vuedraggable": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.1.0",
|
||||
"@tailwindcss/line-clamp": "^0.4.2",
|
||||
"@types/lodash-es": "^4.17.6",
|
||||
"@types/node": "^16.11.41",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@vitejs/plugin-legacy": "^2.3.1",
|
||||
"@vitejs/plugin-vue": "^3.0.0",
|
||||
"@vitejs/plugin-vue-jsx": "^2.0.0",
|
||||
"@vue/eslint-config-prettier": "^7.0.0",
|
||||
"@vue/eslint-config-typescript": "^11.0.0",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"autoprefixer": "^10.4.7",
|
||||
"consola": "^2.15.3",
|
||||
"eslint": "^8.5.0",
|
||||
"eslint-plugin-vue": "^9.0.0",
|
||||
"execa": "^6.1.0",
|
||||
"fs-extra": "^10.1.0",
|
||||
"postcss": "^8.4.14",
|
||||
"prettier": "^2.5.1",
|
||||
"sass": "^1.53.0",
|
||||
"tailwindcss": "^3.0.24",
|
||||
"terser": "^5.15.1",
|
||||
"typescript": "~4.7.4",
|
||||
"unplugin-auto-import": "^0.9.2",
|
||||
"unplugin-vue-components": "^0.19.9",
|
||||
"vite": "^3.0.0",
|
||||
"vite-plugin-style-import": "^2.0.0",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||
"vue-tsc": "^0.38.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {}
|
||||
}
|
||||
}
|
||||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
import path from 'path'
|
||||
import fsExtra from 'fs-extra'
|
||||
const { existsSync, remove, copy } = fsExtra
|
||||
const cwd = process.cwd()
|
||||
//打包发布路径,谨慎改动
|
||||
const releaseRelativePath = '../public/admin'
|
||||
const distPath = path.resolve(cwd, 'dist')
|
||||
const releasePath = path.resolve(cwd, releaseRelativePath)
|
||||
|
||||
async function build() {
|
||||
if (existsSync(releasePath)) {
|
||||
await remove(releasePath)
|
||||
}
|
||||
console.log(`文件正在复制 ==> ${releaseRelativePath}`)
|
||||
try {
|
||||
await copyFile(distPath, releasePath)
|
||||
} catch (error) {
|
||||
console.log(`\n ${error}`)
|
||||
}
|
||||
console.log(`文件已复制 ==> ${releaseRelativePath}`)
|
||||
}
|
||||
|
||||
function copyFile(sourceDir, targetDir) {
|
||||
return new Promise((resolve, reject) => {
|
||||
copy(sourceDir, targetDir, (err) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
build()
|
||||
import path from 'path'
|
||||
import fsExtra from 'fs-extra'
|
||||
const { existsSync, remove, copy } = fsExtra
|
||||
const cwd = process.cwd()
|
||||
//打包发布路径,谨慎改动
|
||||
const releaseRelativePath = '../public/admin'
|
||||
const distPath = path.resolve(cwd, 'dist')
|
||||
const releasePath = path.resolve(cwd, releaseRelativePath)
|
||||
|
||||
async function build() {
|
||||
if (existsSync(releasePath)) {
|
||||
await remove(releasePath)
|
||||
}
|
||||
console.log(`文件正在复制 ==> ${releaseRelativePath}`)
|
||||
try {
|
||||
await copyFile(distPath, releasePath)
|
||||
} catch (error) {
|
||||
console.log(`\n ${error}`)
|
||||
}
|
||||
console.log(`文件已复制 ==> ${releaseRelativePath}`)
|
||||
}
|
||||
|
||||
function copyFile(sourceDir, targetDir) {
|
||||
return new Promise((resolve, reject) => {
|
||||
copy(sourceDir, targetDir, (err) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
build()
|
||||
|
|
|
@ -1,58 +1,58 @@
|
|||
<script setup lang="ts">
|
||||
import { useDark, useWindowSize, useThrottleFn } from '@vueuse/core'
|
||||
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
||||
import useAppStore from './stores/modules/app'
|
||||
import useSettingStore from './stores/modules/setting'
|
||||
import { ScreenEnum } from './enums/appEnums'
|
||||
const appStore = useAppStore()
|
||||
const settingStore = useSettingStore()
|
||||
const elConfig = {
|
||||
zIndex: 3000,
|
||||
locale: zhCn
|
||||
}
|
||||
const isDark = useDark()
|
||||
onMounted(async () => {
|
||||
//设置主题
|
||||
settingStore.setTheme(isDark.value)
|
||||
// 获取配置
|
||||
const data: any = await appStore.getConfig()
|
||||
// 设置网站logo
|
||||
let favicon: HTMLLinkElement = document.querySelector('link[rel="icon"]')!
|
||||
if (favicon) {
|
||||
favicon.href = data.web_favicon
|
||||
return
|
||||
}
|
||||
favicon = document.createElement('link')
|
||||
favicon.rel = 'icon'
|
||||
favicon.href = data.web_favicon
|
||||
document.head.appendChild(favicon)
|
||||
})
|
||||
|
||||
const { width } = useWindowSize()
|
||||
watch(
|
||||
width,
|
||||
useThrottleFn((value) => {
|
||||
if (value > ScreenEnum.SM) {
|
||||
appStore.setMobile(false)
|
||||
appStore.toggleCollapsed(false)
|
||||
} else {
|
||||
appStore.setMobile(true)
|
||||
appStore.toggleCollapsed(true)
|
||||
}
|
||||
if (value < ScreenEnum.MD) {
|
||||
appStore.toggleCollapsed(true)
|
||||
}
|
||||
}),
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-config-provider :locale="elConfig.locale" :z-index="elConfig.zIndex">
|
||||
<router-view />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<style></style>
|
||||
<script setup lang="ts">
|
||||
import { useDark, useWindowSize, useThrottleFn } from '@vueuse/core'
|
||||
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
||||
import useAppStore from './stores/modules/app'
|
||||
import useSettingStore from './stores/modules/setting'
|
||||
import { ScreenEnum } from './enums/appEnums'
|
||||
const appStore = useAppStore()
|
||||
const settingStore = useSettingStore()
|
||||
const elConfig = {
|
||||
zIndex: 3000,
|
||||
locale: zhCn
|
||||
}
|
||||
const isDark = useDark()
|
||||
onMounted(async () => {
|
||||
//设置主题
|
||||
settingStore.setTheme(isDark.value)
|
||||
// 获取配置
|
||||
const data: any = await appStore.getConfig()
|
||||
// 设置网站logo
|
||||
let favicon: HTMLLinkElement = document.querySelector('link[rel="icon"]')!
|
||||
if (favicon) {
|
||||
favicon.href = data.web_favicon
|
||||
return
|
||||
}
|
||||
favicon = document.createElement('link')
|
||||
favicon.rel = 'icon'
|
||||
favicon.href = data.web_favicon
|
||||
document.head.appendChild(favicon)
|
||||
})
|
||||
|
||||
const { width } = useWindowSize()
|
||||
watch(
|
||||
width,
|
||||
useThrottleFn((value) => {
|
||||
if (value > ScreenEnum.SM) {
|
||||
appStore.setMobile(false)
|
||||
appStore.toggleCollapsed(false)
|
||||
} else {
|
||||
appStore.setMobile(true)
|
||||
appStore.toggleCollapsed(true)
|
||||
}
|
||||
if (value < ScreenEnum.MD) {
|
||||
appStore.toggleCollapsed(true)
|
||||
}
|
||||
}),
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-config-provider :locale="elConfig.locale" :z-index="elConfig.zIndex">
|
||||
<router-view />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<style></style>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 配置
|
||||
export function getConfig() {
|
||||
return request.get({ url: '/config/getConfig' })
|
||||
}
|
||||
|
||||
// 工作台主页
|
||||
export function getWorkbench() {
|
||||
return request.get({ url: '/workbench/index' })
|
||||
}
|
||||
|
||||
//字典数据
|
||||
export function getDictData(params: any) {
|
||||
return request.get({ url: '/config/dict', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 配置
|
||||
export function getConfig() {
|
||||
return request.get({ url: '/config/getConfig' })
|
||||
}
|
||||
|
||||
// 工作台主页
|
||||
export function getWorkbench() {
|
||||
return request.get({ url: '/workbench/index' })
|
||||
}
|
||||
|
||||
//字典数据
|
||||
export function getDictData(params: any) {
|
||||
return request.get({ url: '/config/dict', params })
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function getRechargeConfig() {
|
||||
return request.get({ url: '/recharge.recharge/getConfig' })
|
||||
}
|
||||
|
||||
// 设置
|
||||
export function setRechargeConfig(params: any) {
|
||||
return request.post({ url: '/recharge.recharge/setConfig', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getRechargeConfig() {
|
||||
return request.get({ url: '/recharge.recharge/getConfig' })
|
||||
}
|
||||
|
||||
// 设置
|
||||
export function setRechargeConfig(params: any) {
|
||||
return request.post({ url: '/recharge.recharge/setConfig', params })
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// app更新列表
|
||||
export function apiAppUpdateLists(params: any) {
|
||||
return request.get({ url: '/app_update/lists', params })
|
||||
}
|
||||
|
||||
// 添加app更新
|
||||
export function apiAppUpdateAdd(params: any) {
|
||||
return request.post({ url: '/app_update/add', params })
|
||||
}
|
||||
|
||||
// 编辑app更新
|
||||
export function apiAppUpdateEdit(params: any) {
|
||||
return request.post({ url: '/app_update/edit', params })
|
||||
}
|
||||
|
||||
// 删除app更新
|
||||
export function apiAppUpdateDelete(params: any) {
|
||||
return request.post({ url: '/app_update/delete', params })
|
||||
}
|
||||
|
||||
// app更新详情
|
||||
export function apiAppUpdateDetail(params: any) {
|
||||
return request.get({ url: '/app_update/detail', params })
|
||||
}
|
|
@ -1,69 +1,69 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 文章分类列表
|
||||
export function articleCateLists(params?: any) {
|
||||
return request.get({ url: '/article.articleCate/lists', params })
|
||||
}
|
||||
// 文章分类列表
|
||||
export function articleCateAll(params?: any) {
|
||||
return request.get({ url: '/article.articleCate/all', params })
|
||||
}
|
||||
|
||||
// 添加文章分类
|
||||
export function articleCateAdd(params: any) {
|
||||
return request.post({ url: '/article.articleCate/add', params })
|
||||
}
|
||||
|
||||
// 编辑文章分类
|
||||
export function articleCateEdit(params: any) {
|
||||
return request.post({ url: '/article.articleCate/edit', params })
|
||||
}
|
||||
|
||||
// 删除文章分类
|
||||
export function articleCateDelete(params: any) {
|
||||
return request.post({ url: '/article.articleCate/delete', params })
|
||||
}
|
||||
|
||||
// 文章分类详情
|
||||
export function articleCateDetail(params: any) {
|
||||
return request.get({ url: '/article.articleCate/detail', params })
|
||||
}
|
||||
|
||||
// 文章分类状态
|
||||
export function articleCateStatus(params: any) {
|
||||
return request.post({ url: '/article.articleCate/updateStatus', params })
|
||||
}
|
||||
|
||||
// 文章列表
|
||||
export function articleLists(params?: any) {
|
||||
return request.get({ url: '/article.article/lists', params })
|
||||
}
|
||||
// 文章列表
|
||||
export function articleAll(params?: any) {
|
||||
return request.get({ url: '/article/all', params })
|
||||
}
|
||||
|
||||
// 添加文章
|
||||
export function articleAdd(params: any) {
|
||||
return request.post({ url: '/article.article/add', params })
|
||||
}
|
||||
|
||||
// 编辑文章
|
||||
export function articleEdit(params: any) {
|
||||
return request.post({ url: '/article.article/edit', params })
|
||||
}
|
||||
|
||||
// 删除文章
|
||||
export function articleDelete(params: any) {
|
||||
return request.post({ url: '/article.article/delete', params })
|
||||
}
|
||||
|
||||
// 文章详情
|
||||
export function articleDetail(params: any) {
|
||||
return request.get({ url: '/article.article/detail', params })
|
||||
}
|
||||
|
||||
// 文章分类状态
|
||||
export function articleStatus(params: any) {
|
||||
return request.post({ url: '/article.article/updateStatus', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 文章分类列表
|
||||
export function articleCateLists(params?: any) {
|
||||
return request.get({ url: '/article.articleCate/lists', params })
|
||||
}
|
||||
// 文章分类列表
|
||||
export function articleCateAll(params?: any) {
|
||||
return request.get({ url: '/article.articleCate/all', params })
|
||||
}
|
||||
|
||||
// 添加文章分类
|
||||
export function articleCateAdd(params: any) {
|
||||
return request.post({ url: '/article.articleCate/add', params })
|
||||
}
|
||||
|
||||
// 编辑文章分类
|
||||
export function articleCateEdit(params: any) {
|
||||
return request.post({ url: '/article.articleCate/edit', params })
|
||||
}
|
||||
|
||||
// 删除文章分类
|
||||
export function articleCateDelete(params: any) {
|
||||
return request.post({ url: '/article.articleCate/delete', params })
|
||||
}
|
||||
|
||||
// 文章分类详情
|
||||
export function articleCateDetail(params: any) {
|
||||
return request.get({ url: '/article.articleCate/detail', params })
|
||||
}
|
||||
|
||||
// 文章分类状态
|
||||
export function articleCateStatus(params: any) {
|
||||
return request.post({ url: '/article.articleCate/updateStatus', params })
|
||||
}
|
||||
|
||||
// 文章列表
|
||||
export function articleLists(params?: any) {
|
||||
return request.get({ url: '/article.article/lists', params })
|
||||
}
|
||||
// 文章列表
|
||||
export function articleAll(params?: any) {
|
||||
return request.get({ url: '/article/all', params })
|
||||
}
|
||||
|
||||
// 添加文章
|
||||
export function articleAdd(params: any) {
|
||||
return request.post({ url: '/article.article/add', params })
|
||||
}
|
||||
|
||||
// 编辑文章
|
||||
export function articleEdit(params: any) {
|
||||
return request.post({ url: '/article.article/edit', params })
|
||||
}
|
||||
|
||||
// 删除文章
|
||||
export function articleDelete(params: any) {
|
||||
return request.post({ url: '/article.article/delete', params })
|
||||
}
|
||||
|
||||
// 文章详情
|
||||
export function articleDetail(params: any) {
|
||||
return request.get({ url: '/article.article/detail', params })
|
||||
}
|
||||
|
||||
// 文章分类状态
|
||||
export function articleStatus(params: any) {
|
||||
return request.post({ url: '/article.article/updateStatus', params })
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
// 合同列表
|
||||
export function apiContractLists(params: any) {
|
||||
return request.get({ url: "/contract.VehicleContract/townRentList", params });
|
||||
}
|
||||
// 发送合同
|
||||
// /adminapi/accnortt.VehicleContract / initiatingRentCarContract;
|
||||
export function sendContract(params: any) {
|
||||
return request.post({
|
||||
url: "/contract.VehicleContract/initiatingRentCarContract",
|
||||
params,
|
||||
});
|
||||
}
|
||||
// 重新短信
|
||||
export function sendMsg(params: any) {
|
||||
return request.post({ url: "/contract.contract/sendSmsAgain", params });
|
||||
}
|
||||
// /adminapi//adminapi/contract.VehicleContract/initiatingRentCarContract
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 商机分类表列表
|
||||
export function apiCategoryBusinessLists(params: any) {
|
||||
return request.get({ url: '/archives.Business/lists', params })
|
||||
}
|
||||
|
||||
// 添加商机分类表
|
||||
export function apiCategoryBusinessAdd(params: any) {
|
||||
return request.post({ url: '/archives.Business/create', params })
|
||||
}
|
||||
|
||||
// 编辑商机分类表
|
||||
export function apiCategoryBusinessEdit(params: any) {
|
||||
return request.post({ url: '/archives.Business/edit', params })
|
||||
}
|
||||
|
||||
// 删除商机分类表
|
||||
export function apiCategoryBusinessDelete(params: any) {
|
||||
return request.post({ url: '/archives.Business/delete', params })
|
||||
}
|
||||
|
||||
// 商机分类表详情
|
||||
export function apiCategoryBusinessDetail(params: any) {
|
||||
return request.get({ url: '/archives.Business/detail', params })
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// H5渠道配置保存
|
||||
export function setH5Config(params: any) {
|
||||
return request.post({ url: '/channel.web_page_setting/setConfig', params })
|
||||
}
|
||||
|
||||
// H5渠道配置详情
|
||||
export function getH5Config() {
|
||||
return request.get({ url: '/channel.web_page_setting/getConfig' })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// H5渠道配置保存
|
||||
export function setH5Config(params: any) {
|
||||
return request.post({ url: '/channel.web_page_setting/setConfig', params })
|
||||
}
|
||||
|
||||
// H5渠道配置详情
|
||||
export function getH5Config() {
|
||||
return request.get({ url: '/channel.web_page_setting/getConfig' })
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 微信开发平台配置保存
|
||||
export function setOpenSettingConfig(params: any) {
|
||||
return request.post({ url: '/channel.open_setting/setConfig', params })
|
||||
}
|
||||
|
||||
// 微信开发平台配置详情
|
||||
export function getOpenSettingConfig() {
|
||||
return request.get({ url: '/channel.open_setting/getConfig' })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 微信开发平台配置保存
|
||||
export function setOpenSettingConfig(params: any) {
|
||||
return request.post({ url: '/channel.open_setting/setConfig', params })
|
||||
}
|
||||
|
||||
// 微信开发平台配置详情
|
||||
export function getOpenSettingConfig() {
|
||||
return request.get({ url: '/channel.open_setting/getConfig' })
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 微信小程序配置保存
|
||||
export function setWeappConfig(params: any) {
|
||||
return request.post({ url: '/channel.mnp_settings/setConfig', params })
|
||||
}
|
||||
|
||||
// 微信小程序配置详情
|
||||
export function getWeappConfig() {
|
||||
return request.get({ url: '/channel.mnp_settings/getConfig' })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 微信小程序配置保存
|
||||
export function setWeappConfig(params: any) {
|
||||
return request.post({ url: '/channel.mnp_settings/setConfig', params })
|
||||
}
|
||||
|
||||
// 微信小程序配置详情
|
||||
export function getWeappConfig() {
|
||||
return request.get({ url: '/channel.mnp_settings/getConfig' })
|
||||
}
|
||||
|
|
|
@ -1,110 +1,110 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 微信公众号配置保存
|
||||
export function setOaConfig(params: any) {
|
||||
return request.post({ url: '/channel.official_account_setting/setConfig', params })
|
||||
}
|
||||
|
||||
// 微信公众号配置详情
|
||||
export function getOaConfig() {
|
||||
return request.get({ url: '/channel.official_account_setting/getConfig' })
|
||||
}
|
||||
|
||||
export interface Menu {
|
||||
name: string
|
||||
has_menu?: boolean
|
||||
type?: string
|
||||
url?: string
|
||||
appid?: string
|
||||
pagepath?: string
|
||||
sub_button: Menu[] | any
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 获取菜单
|
||||
*/
|
||||
export function getOaMenu() {
|
||||
return request.get({ url: '/channel.official_account_menu/detail' })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { Menu } Menu
|
||||
* @description 菜单保存
|
||||
*/
|
||||
export function setOaMenuSave(params: Menu | any) {
|
||||
return request.post({ url: '/channel.official_account_menu/save', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { Menu } Menu
|
||||
* @description 菜单发布
|
||||
*/
|
||||
export function setOaMenuPublish(params: Menu | any) {
|
||||
return request.post({ url: '/channel.official_account_menu/saveAndPublish', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { string } reply_type
|
||||
* @description 获取回复列表
|
||||
*/
|
||||
export function getOaReplyList(params: { reply_type: string }) {
|
||||
return request.get({ url: '/channel.official_account_reply/lists', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { number } id
|
||||
* @description 回复列表删除
|
||||
*/
|
||||
export function oaReplyDel(params: { id: number }) {
|
||||
return request.post({ url: '/channel.official_account_reply/delete', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { number } id
|
||||
* @description 回复状态修改
|
||||
*/
|
||||
export function changeOaReplyStatus(params: { id: number }) {
|
||||
return request.post({ url: '/channel.official_account_reply/status', params })
|
||||
}
|
||||
|
||||
export interface Reply {
|
||||
content: string // 内容
|
||||
content_type: number // 内容类型: 1=文本
|
||||
keyword?: string // 关键词
|
||||
matching_type?: number // 匹配方式: [1=全匹配, 2=模糊匹配]
|
||||
name: string // 规则名称
|
||||
status: number // 状态: 1=开启, 0=关闭
|
||||
reply_type: number // 类型: 回复类型 1-关注回复 2-关键词回复 3-默认回复
|
||||
reply_num: number // 回复数量`
|
||||
sort: number // 排序
|
||||
}
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 回复添加
|
||||
*/
|
||||
export function oaReplyAdd(params: Reply) {
|
||||
return request.post({ url: '/channel.official_account_reply/add', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 回复编辑
|
||||
*/
|
||||
export function oaReplyEdit(params: Reply) {
|
||||
return request.post({ url: '/channel.official_account_reply/edit', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { string } type
|
||||
* @description 获取回复详情
|
||||
*/
|
||||
export function getOaReplyDetail(params: { id: number }) {
|
||||
return request.get({ url: '/channel.official_account_reply/detail', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 微信公众号配置保存
|
||||
export function setOaConfig(params: any) {
|
||||
return request.post({ url: '/channel.official_account_setting/setConfig', params })
|
||||
}
|
||||
|
||||
// 微信公众号配置详情
|
||||
export function getOaConfig() {
|
||||
return request.get({ url: '/channel.official_account_setting/getConfig' })
|
||||
}
|
||||
|
||||
export interface Menu {
|
||||
name: string
|
||||
has_menu?: boolean
|
||||
type?: string
|
||||
url?: string
|
||||
appid?: string
|
||||
pagepath?: string
|
||||
sub_button: Menu[] | any
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 获取菜单
|
||||
*/
|
||||
export function getOaMenu() {
|
||||
return request.get({ url: '/channel.official_account_menu/detail' })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { Menu } Menu
|
||||
* @description 菜单保存
|
||||
*/
|
||||
export function setOaMenuSave(params: Menu | any) {
|
||||
return request.post({ url: '/channel.official_account_menu/save', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { Menu } Menu
|
||||
* @description 菜单发布
|
||||
*/
|
||||
export function setOaMenuPublish(params: Menu | any) {
|
||||
return request.post({ url: '/channel.official_account_menu/saveAndPublish', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { string } reply_type
|
||||
* @description 获取回复列表
|
||||
*/
|
||||
export function getOaReplyList(params: { reply_type: string }) {
|
||||
return request.get({ url: '/channel.official_account_reply/lists', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { number } id
|
||||
* @description 回复列表删除
|
||||
*/
|
||||
export function oaReplyDel(params: { id: number }) {
|
||||
return request.post({ url: '/channel.official_account_reply/delete', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { number } id
|
||||
* @description 回复状态修改
|
||||
*/
|
||||
export function changeOaReplyStatus(params: { id: number }) {
|
||||
return request.post({ url: '/channel.official_account_reply/status', params })
|
||||
}
|
||||
|
||||
export interface Reply {
|
||||
content: string // 内容
|
||||
content_type: number // 内容类型: 1=文本
|
||||
keyword?: string // 关键词
|
||||
matching_type?: number // 匹配方式: [1=全匹配, 2=模糊匹配]
|
||||
name: string // 规则名称
|
||||
status: number // 状态: 1=开启, 0=关闭
|
||||
reply_type: number // 类型: 回复类型 1-关注回复 2-关键词回复 3-默认回复
|
||||
reply_num: number // 回复数量`
|
||||
sort: number // 排序
|
||||
}
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 回复添加
|
||||
*/
|
||||
export function oaReplyAdd(params: Reply) {
|
||||
return request.post({ url: '/channel.official_account_reply/add', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 回复编辑
|
||||
*/
|
||||
export function oaReplyEdit(params: Reply) {
|
||||
return request.post({ url: '/channel.official_account_reply/edit', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { string } type
|
||||
* @description 获取回复详情
|
||||
*/
|
||||
export function getOaReplyDetail(params: { id: number }) {
|
||||
return request.get({ url: '/channel.official_account_reply/detail', params })
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
import request from '@/utils/request'
|
||||
// 省列表
|
||||
export function apiProvinceList(params: any) {
|
||||
return request.get({ url: '/geo/provinces', params })
|
||||
}
|
||||
// 市列表
|
||||
export function apiCityList(params: any) {
|
||||
return request.get({ url: '/geo/cities', params })
|
||||
}
|
||||
// 区列表
|
||||
export function apiAreaList(params: any) {
|
||||
return request.get({ url: '/geo/areas', params })
|
||||
}
|
||||
// 镇列表
|
||||
export function apiStreetList(params: any) {
|
||||
return request.get({ url: '/geo/streets', params })
|
||||
}
|
||||
// 村列表
|
||||
export function apiVillageList(params: any) {
|
||||
return request.get({ url: '/geo/villages', params })
|
||||
}
|
||||
|
||||
// 队列表
|
||||
export function apiBrigadeList() {
|
||||
return request.get({ url: '/geo/brigades' })
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 公司列表
|
||||
export function apiCompanyLists(params: any) {
|
||||
return request.get({ url: '/company.Company/lists', params })
|
||||
}
|
||||
//获取公司余额明细、押金充值
|
||||
export function apiCompanyLists1(params: any) {
|
||||
return request.get({ url: '/company.company/lists', params })
|
||||
}
|
||||
|
||||
// 添加公司
|
||||
export function apiCompanyAdd(params: any) {
|
||||
return request.post({ url: '/company.Company/create', params })
|
||||
}
|
||||
|
||||
// 编辑公司
|
||||
export function apiCompanyEdit(params: any) {
|
||||
return request.post({ url: '/company.Company/edit', params })
|
||||
}
|
||||
|
||||
// 删除公司
|
||||
export function apiCompanyDelete(params: any) {
|
||||
return request.post({ url: '/company.Company/delete', params })
|
||||
}
|
||||
|
||||
// 公司详情
|
||||
export function apiCompanyDetail(params: any) {
|
||||
return request.get({ url: '/company.Company/detail', params })
|
||||
}
|
||||
|
||||
//公司成员
|
||||
export function companyUserLists(params: any) {
|
||||
return request.get({ url: '/company.Company/companyUserLists', params })
|
||||
}
|
||||
//成员详情
|
||||
export function companyUserDetail(params: any) {
|
||||
return request.get({ url: '/company.Company/companyUserDetail', params })
|
||||
}
|
||||
|
||||
|
||||
// 下属公司详情
|
||||
export function apiSubordinateList(params: any) {
|
||||
return request.get({ url: '/company.Company/subsidiaryCompany', params })
|
||||
}
|
||||
|
||||
// 获取公司类型
|
||||
export function companyType(params: any) {
|
||||
return request.get({ url: '/company.Company/companyType', params })
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 重新发送短信
|
||||
export function sendMsgApi(params: any) {
|
||||
return request.post({ url: '/contract.CompanyContract/sendSms', params })
|
||||
}
|
||||
// 生成合同
|
||||
export function initiate_contract(params: any) {
|
||||
return request.post({ url: '/company.Company/generateContract', params })
|
||||
}
|
||||
// 发送合同
|
||||
export function generateGontract(params: any) {
|
||||
return request.post({ url: '/contract.CompanyContract/DraftingContract', params })
|
||||
}
|
||||
// 发送个人合同
|
||||
export function userGontract(params: any) {
|
||||
return request.get({ url: '/user.user/Draftingcontracts', params })
|
||||
}
|
||||
// 企业认证
|
||||
export function authentication(params: any) {
|
||||
return request.post({ url: '/company.Company/enterpriseCertification', params })
|
||||
}
|
||||
|
||||
|
||||
// 平台公司
|
||||
export function companyListTwo(params: any) {
|
||||
return request.get({ url: '/company.Company/lists', params })
|
||||
}
|
||||
|
||||
// 获取管辖区域
|
||||
export function companyResponsibleArea(params: any) {
|
||||
return request.get({ url: '/company.company/responsibleArea', params })
|
||||
}
|
||||
|
||||
|
||||
// 人脸采集
|
||||
export function organizationFaceCreate(params: any) {
|
||||
return request.get({ url: '/company/organizationFaceCreate', params })
|
||||
}
|
||||
|
||||
// 押金线下对公账号转账凭证录入接口
|
||||
export function depositRechargeTransferVoucher(params: any) {
|
||||
return request.post({ url: '/company.company/depositRechargeTransferVoucher', params })
|
||||
}
|
||||
|
||||
// 获取押金凭证录入列表
|
||||
export function getDepositRechargeTransferVoucherList(params: any) {
|
||||
return request.get({ url: '/company.company/getDepositRechargeTransferVoucherList', params })
|
||||
}
|
||||
|
||||
// 根据公司id获取甲方公司信息
|
||||
export function getPartyAbyCompanyId(params: any) {
|
||||
return request.get({ url: '/company.company/getPartyA', params })
|
||||
}
|
||||
|
||||
//合同类型
|
||||
export function contractType(params: any) {
|
||||
return request.get({ url: '/company.Company/contractType', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 投诉反馈列表
|
||||
export function apiCompanyComplaintFeedbackLists(params: any) {
|
||||
return request.get({ url: '/company_complaint_feedback/lists', params })
|
||||
}
|
||||
|
||||
// 添加投诉反馈
|
||||
export function apiCompanyComplaintFeedbackAdd(params: any) {
|
||||
return request.post({ url: '/company_complaint_feedback/add', params })
|
||||
}
|
||||
|
||||
// 编辑投诉反馈
|
||||
export function apiCompanyComplaintFeedbackEdit(params: any) {
|
||||
return request.post({ url: '/company_complaint_feedback/edit', params })
|
||||
}
|
||||
|
||||
// 删除投诉反馈
|
||||
export function apiCompanyComplaintFeedbackDelete(params: any) {
|
||||
return request.post({ url: '/company_complaint_feedback/delete', params })
|
||||
}
|
||||
|
||||
// 投诉反馈详情
|
||||
export function apiCompanyComplaintFeedbackDetail(params: any) {
|
||||
return request.get({ url: '/company_complaint_feedback/detail', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 公司认证表格列表
|
||||
export function apiCompanyFormLists(params: any) {
|
||||
return request.get({ url: '/company.Merchant/merchantAuthLists', params })
|
||||
}
|
||||
|
||||
// 添加公司认证表格
|
||||
export function apiCompanyFormAdd(params: any) {
|
||||
return request.post({ url: '/company_form/add', params })
|
||||
}
|
||||
|
||||
// 编辑公司认证表格
|
||||
export function apiCompanyFormEdit(params: any) {
|
||||
return request.post({ url: '/company_form/edit', params })
|
||||
}
|
||||
|
||||
// 删除公司认证表格
|
||||
export function apiCompanyFormDelete(params: any) {
|
||||
return request.post({ url: '/company_form/delete', params })
|
||||
}
|
||||
|
||||
// 公司认证表格详情
|
||||
export function apiCompanyFormDetail(params: any) {
|
||||
return request.get({ url: '/company_form/detail', params })
|
||||
}
|
|
@ -1,21 +1,56 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 用户列表
|
||||
export function getUserList(params: any) {
|
||||
return request.get({ url: '/user.user/lists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 用户详情
|
||||
export function getUserDetail(params: any) {
|
||||
return request.get({ url: '/user.user/detail', params })
|
||||
}
|
||||
|
||||
// 用户编辑
|
||||
export function userEdit(params: any) {
|
||||
return request.post({ url: '/user.user/edit', params })
|
||||
}
|
||||
|
||||
// 用户编辑
|
||||
export function adjustMoney(params: any) {
|
||||
return request.post({ url: '/user.user/adjustMoney', params })
|
||||
}
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 用户列表
|
||||
export function getUserList(params: any) {
|
||||
return request.get(
|
||||
{ url: "/user.user/lists", params },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
|
||||
// 用户详情
|
||||
export function getUserDetail(params: any) {
|
||||
return request.get({ url: "/user.user/detail", params });
|
||||
}
|
||||
|
||||
// 用户编辑
|
||||
export function userEdit(params: any) {
|
||||
return request.post({ url: "/user.user/edit", params });
|
||||
}
|
||||
|
||||
// 用户编辑
|
||||
export function adjustMoney(params: any) {
|
||||
return request.post({ url: "/user.user/adjustMoney", params });
|
||||
}
|
||||
// 发起合同
|
||||
export function initiateContact(params: any) {
|
||||
return request.post({ url: "/user.user/initiate_contract", params });
|
||||
}
|
||||
// 上传合同
|
||||
export function upContact(params: any) {
|
||||
return request.post({ url: "/contract.CompanyContract/uploadContract", params });
|
||||
}
|
||||
|
||||
//生产个人合同
|
||||
export function creatContact(params: any) {
|
||||
return request.post({ url: "/user.user/Draftingcontracts", params });
|
||||
}
|
||||
//发送短息
|
||||
export function sendMsgApi(params: any) {
|
||||
return request.get({ url: "/contract.contract/postsms", params });
|
||||
}
|
||||
|
||||
//公司下拉列表
|
||||
export function getCompanyList(params: any) {
|
||||
return request.get({ url: "/user.user/getCompanyList", params });
|
||||
}
|
||||
|
||||
//角色下拉列表
|
||||
export function getRolelist(params: any) {
|
||||
return request.get({ url: "/user.userRole/getlist", params });
|
||||
}
|
||||
|
||||
//创建用户
|
||||
export function userAdd(params: any) {
|
||||
return request.post({ url: "/user.user/add", params });
|
||||
}
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 合同列表
|
||||
export function apiContractLists(params: any) {
|
||||
return request.get({ url: '/contract.CompanyContract/lists', params })
|
||||
}
|
||||
|
||||
// 添加合同
|
||||
export function apiContractAdd(params: any) {
|
||||
return request.post({ url: '/contract.contract/add', params })
|
||||
}
|
||||
|
||||
// 编辑合同
|
||||
export function apiContractEdit(params: any) {
|
||||
return request.post({ url: '/contract.contract/edit', params })
|
||||
}
|
||||
|
||||
// 删除合同
|
||||
export function apiContractDelete(params: any) {
|
||||
return request.post({ url: '/contract.contract/delete', params })
|
||||
}
|
||||
|
||||
// 合同详情
|
||||
export function apiContractDetail(params: any) {
|
||||
return request.get({ url: '/contract.CompanyContract/detail', params })
|
||||
}
|
||||
|
||||
// 三轮车合同列表
|
||||
export function leaseContractList(params: any) {
|
||||
return request.get({ url: "/contract.VehicleContract/lists", params });
|
||||
}
|
||||
|
||||
//租赁详情
|
||||
export function leaseContractDetail(params: any) {
|
||||
return request.get({ url: "/contract.VehicleContract/detail", params });
|
||||
}
|
||||
|
||||
//上传合同
|
||||
export function leaseUpContract(params: any) {
|
||||
return request.post({
|
||||
url: "/contract.VehicleContract/uploadContract",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
//请求证据包下载地址
|
||||
export function contractEvidence(params: any) {
|
||||
return request.get({ url: "/contract.CompanyContract/evidence", params });
|
||||
}
|
|
@ -1,26 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 页面装修详情
|
||||
export function getDecoratePages(params: any) {
|
||||
return request.get({ url: '/decorate.page/detail', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 页面装修保存
|
||||
export function setDecoratePages(params: any) {
|
||||
return request.post({ url: '/decorate.page/save', params })
|
||||
}
|
||||
|
||||
// 获取首页文章数据
|
||||
export function getDecorateArticle(params?: any) {
|
||||
return request.get({ url: '/decorate.data/article', params })
|
||||
}
|
||||
|
||||
// 底部导航详情
|
||||
export function getDecorateTabbar(params?: any) {
|
||||
return request.get({ url: '/decorate.tabbar/detail', params })
|
||||
}
|
||||
|
||||
// 底部导航保存
|
||||
export function setDecorateTabbar(params: any) {
|
||||
return request.post({ url: '/decorate.tabbar/save', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 页面装修详情
|
||||
export function getDecoratePages(params: any) {
|
||||
return request.get({ url: '/decorate.page/detail', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 页面装修保存
|
||||
export function setDecoratePages(params: any) {
|
||||
return request.post({ url: '/decorate.page/save', params })
|
||||
}
|
||||
|
||||
// 获取首页文章数据
|
||||
export function getDecorateArticle(params?: any) {
|
||||
return request.get({ url: '/decorate.data/article', params })
|
||||
}
|
||||
|
||||
// 底部导航详情
|
||||
export function getDecorateTabbar(params?: any) {
|
||||
return request.get({ url: '/decorate.tabbar/detail', params })
|
||||
}
|
||||
|
||||
// 底部导航保存
|
||||
export function setDecorateTabbar(params: any) {
|
||||
return request.post({ url: '/decorate.tabbar/save', params })
|
||||
}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
import request from '@/utils/request'
|
||||
//审批类型列表
|
||||
export function apiCateLists(params: any) {
|
||||
return request.get({ url: '/dict.dict/lists', params })
|
||||
}
|
||||
//审批流程列表
|
||||
export function apiFlowLists(params: any) {
|
||||
return request.get({ url: '/task.scheduling/approve', params })
|
||||
}
|
||||
|
||||
//创建审批类型
|
||||
export function apiCateCreat(params: any) {
|
||||
return request.post({ url: '/cate/create', params })
|
||||
}
|
||||
// 创建流程
|
||||
export function apiFlowCreat(params: any) {
|
||||
return request.post({ url: '/flow/create', params })
|
||||
}
|
||||
|
||||
// 启用审批类型
|
||||
export function apiCateStatus(params: any) {
|
||||
return request.get({ url: '/cate/status', params })
|
||||
}
|
||||
// 启用审批流程
|
||||
export function apiFlowStatus(params: any) {
|
||||
return request.get({ url: '/flow/status', params })
|
||||
}
|
||||
// 审批流程详情
|
||||
export function apiFlowDetil(params: any) {
|
||||
return request.get({ url: '/flow/view', params })
|
||||
}
|
||||
|
||||
// 任务
|
||||
|
||||
// 任务审批列表(待审批列表)
|
||||
export function apiApproveList(params: any) {
|
||||
return request.get({ url: '/task.scheduling/approve', params })
|
||||
}
|
||||
|
||||
// 任务审批(待审批列表)
|
||||
export function apiApproveAudit(params: any) {
|
||||
return request.post({ url: '/approve.approve/audit', params })
|
||||
}
|
||||
|
||||
// 商户入驻,开通交易审批列表
|
||||
export function apiApproveList2(params: any) {
|
||||
return request.get({ url: '/company.Merchant/merchantApplyLists', params })
|
||||
}
|
|
@ -1,39 +1,39 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function fileCateAdd(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/addCate', params })
|
||||
}
|
||||
|
||||
export function fileCateEdit(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/editCate', params })
|
||||
}
|
||||
|
||||
// 文件分类删除
|
||||
export function fileCateDelete(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/delCate', params })
|
||||
}
|
||||
|
||||
// 文件分类列表
|
||||
export function fileCateLists(params: Record<string, any>) {
|
||||
return request.get({ url: '/file/listCate', params })
|
||||
}
|
||||
|
||||
// 文件列表
|
||||
export function fileList(params: Record<string, any>) {
|
||||
return request.get({ url: '/file/lists', params })
|
||||
}
|
||||
|
||||
// 文件删除
|
||||
export function fileDelete(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/delete', params })
|
||||
}
|
||||
|
||||
// 文件移动
|
||||
export function fileMove(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/move', params })
|
||||
}
|
||||
|
||||
// 文件重命名
|
||||
export function fileRename(params: { id: number; name: string }) {
|
||||
return request.post({ url: '/file/rename', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function fileCateAdd(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/addCate', params })
|
||||
}
|
||||
|
||||
export function fileCateEdit(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/editCate', params })
|
||||
}
|
||||
|
||||
// 文件分类删除
|
||||
export function fileCateDelete(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/delCate', params })
|
||||
}
|
||||
|
||||
// 文件分类列表
|
||||
export function fileCateLists(params: Record<string, any>) {
|
||||
return request.get({ url: '/file/listCate', params })
|
||||
}
|
||||
|
||||
// 文件列表
|
||||
export function fileList(params: Record<string, any>) {
|
||||
return request.get({ url: '/file/lists', params })
|
||||
}
|
||||
|
||||
// 文件删除
|
||||
export function fileDelete(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/delete', params })
|
||||
}
|
||||
|
||||
// 文件移动
|
||||
export function fileMove(params: Record<string, any>) {
|
||||
return request.post({ url: '/file/move', params })
|
||||
}
|
||||
|
||||
// 文件重命名
|
||||
export function fileRename(params: { id: number; name: string }) {
|
||||
return request.post({ url: '/file/rename', params })
|
||||
}
|
||||
|
|
|
@ -1,41 +1,47 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 余额明细
|
||||
export function accountLog(params?: any) {
|
||||
return request.get({ url: '/finance.account_log/lists', params })
|
||||
}
|
||||
|
||||
// 充值记录
|
||||
export function rechargeLists(params?: any) {
|
||||
return request.get({ url: '/recharge.recharge/lists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 余额变动类型
|
||||
export function getUmChangeType(params?: any) {
|
||||
return request.get({ url: '/finance.account_log/getUmChangeType', params })
|
||||
}
|
||||
|
||||
//退款
|
||||
export function refund(params?: any) {
|
||||
return request.post({ url: '/recharge.recharge/refund', params })
|
||||
}
|
||||
|
||||
//重新退款
|
||||
export function refundAgain(params?: any) {
|
||||
return request.post({ url: '/recharge.recharge/refundAgain', params })
|
||||
}
|
||||
|
||||
//退款记录
|
||||
export function refundRecord(params?: any) {
|
||||
return request.get({ url: '/finance.refund/record', params })
|
||||
}
|
||||
|
||||
//退款日志
|
||||
export function refundLog(params?: any) {
|
||||
return request.get({ url: '/finance.refund/log', params })
|
||||
}
|
||||
|
||||
//退款统计
|
||||
export function refundStat(params?: any) {
|
||||
return request.get({ url: '/finance.refund/stat', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 余额明细
|
||||
export function accountLog(params?: any) {
|
||||
return request.get({ url: '/finance.account_log/taskLists', params })
|
||||
}
|
||||
|
||||
// 成员信息
|
||||
export function getCompanyUserList(params?: any) {
|
||||
return request.get({ url: '/finance.account_log/getTaskCompanyUserList', params })
|
||||
}
|
||||
|
||||
// 充值记录
|
||||
export function rechargeLists(params?: any) {
|
||||
return request.get({ url: '/recharge.recharge/taskLists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 余额变动类型
|
||||
export function getUmChangeType(params?: any) {
|
||||
return request.get({ url: '/finance.account_log/getTaskUmChangeType', params })
|
||||
}
|
||||
|
||||
//退款
|
||||
export function refund(params?: any) {
|
||||
return request.post({ url: '/recharge.recharge/taskRefund', params })
|
||||
}
|
||||
|
||||
//重新退款
|
||||
export function refundAgain(params?: any) {
|
||||
return request.post({ url: '/recharge.recharge/refundAgain', params })
|
||||
}
|
||||
|
||||
//退款记录
|
||||
export function refundRecord(params?: any) {
|
||||
return request.get({ url: '/finance.refund/taskRecord', params })
|
||||
}
|
||||
|
||||
//退款日志
|
||||
export function refundLog(params?: any) {
|
||||
return request.get({ url: '/finance.refund/taskLog', params })
|
||||
}
|
||||
|
||||
//退款统计
|
||||
export function refundStat(params?: any) {
|
||||
return request.get({ url: '/finance.refund/taskStat', params })
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
// 档案列表
|
||||
|
||||
export function fileManagelist(params: any) {
|
||||
return request.get({ url: "/archives.Archives/lists", params });
|
||||
}
|
||||
|
||||
// 档案详情
|
||||
export function fileManageDetil(params: any) {
|
||||
return request.get({ url: "/archives.Archives/detail", params });
|
||||
}
|
|
@ -1,31 +1,31 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 通知设置列表
|
||||
export function noticeLists(params: any) {
|
||||
return request.get({ url: '/notice.notice/settingLists', params })
|
||||
}
|
||||
|
||||
// 通知设置详情
|
||||
export function noticeDetail(params: any) {
|
||||
return request.get({ url: '/notice.notice/detail', params })
|
||||
}
|
||||
|
||||
// 通知设置保存
|
||||
export function setNoticeConfig(params: any) {
|
||||
return request.post({ url: '/notice.notice/set', params })
|
||||
}
|
||||
|
||||
// 短信设置列表
|
||||
export function smsLists() {
|
||||
return request.get({ url: '/notice.sms_config/getConfig' })
|
||||
}
|
||||
|
||||
// 短信设置详情
|
||||
export function smsDetail(params: any) {
|
||||
return request.get({ url: '/notice.sms_config/detail', params })
|
||||
}
|
||||
|
||||
// 短信设置保存
|
||||
export function setSmsConfig(params: any) {
|
||||
return request.post({ url: '/notice.sms_config/setConfig', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 通知设置列表
|
||||
export function noticeLists(params: any) {
|
||||
return request.get({ url: '/notice.notice/settingLists', params })
|
||||
}
|
||||
|
||||
// 通知设置详情
|
||||
export function noticeDetail(params: any) {
|
||||
return request.get({ url: '/notice.notice/detail', params })
|
||||
}
|
||||
|
||||
// 通知设置保存
|
||||
export function setNoticeConfig(params: any) {
|
||||
return request.post({ url: '/notice.notice/set', params })
|
||||
}
|
||||
|
||||
// 短信设置列表
|
||||
export function smsLists() {
|
||||
return request.get({ url: '/notice.sms_config/getConfig' })
|
||||
}
|
||||
|
||||
// 短信设置详情
|
||||
export function smsDetail(params: any) {
|
||||
return request.get({ url: '/notice.sms_config/detail', params })
|
||||
}
|
||||
|
||||
// 短信设置保存
|
||||
export function setSmsConfig(params: any) {
|
||||
return request.post({ url: '/notice.sms_config/setConfig', params })
|
||||
}
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 部门列表
|
||||
export function deptLists(params?: any) {
|
||||
return request.get({ url: '/dept.dept/lists', params })
|
||||
}
|
||||
|
||||
// 添加部门
|
||||
export function deptAdd(params: any) {
|
||||
return request.post({ url: '/dept.dept/add', params })
|
||||
}
|
||||
|
||||
// 编辑部门
|
||||
export function deptEdit(params: any) {
|
||||
return request.post({ url: '/dept.dept/edit', params })
|
||||
}
|
||||
|
||||
// 删除部门
|
||||
export function deptDelete(params: any) {
|
||||
return request.post({ url: '/dept.dept/delete', params })
|
||||
}
|
||||
|
||||
// 部门详情
|
||||
export function deptDetail(params: any) {
|
||||
return request.get({ url: '/dept.dept/detail', params })
|
||||
}
|
||||
|
||||
// 部门列表全部
|
||||
export function deptAll() {
|
||||
return request.get({ url: '/dept.dept/all' })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 部门列表
|
||||
export function deptLists(params?: any) {
|
||||
return request.get({ url: '/dept.dept/lists', params })
|
||||
}
|
||||
|
||||
// 添加部门
|
||||
export function deptAdd(params: any) {
|
||||
return request.post({ url: '/dept.dept/add', params })
|
||||
}
|
||||
|
||||
// 编辑部门
|
||||
export function deptEdit(params: any) {
|
||||
return request.post({ url: '/dept.dept/edit', params })
|
||||
}
|
||||
|
||||
// 删除部门
|
||||
export function deptDelete(params: any) {
|
||||
return request.post({ url: '/dept.dept/delete', params })
|
||||
}
|
||||
|
||||
// 部门详情
|
||||
export function deptDetail(params: any) {
|
||||
return request.get({ url: '/dept.dept/detail', params })
|
||||
}
|
||||
|
||||
// 部门列表全部
|
||||
export function deptAll() {
|
||||
return request.get({ url: '/dept.dept/all' })
|
||||
}
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 岗位列表
|
||||
export function jobsLists(params: any) {
|
||||
return request.get({ url: '/dept.jobs/lists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 岗位列表全部
|
||||
export function jobsAll(params: any) {
|
||||
return request.get({ url: '/dept.jobs/all', params })
|
||||
}
|
||||
|
||||
// 添加岗位
|
||||
export function jobsAdd(params: any) {
|
||||
return request.post({ url: '/dept.jobs/add', params })
|
||||
}
|
||||
|
||||
// 编辑岗位
|
||||
export function jobsEdit(params: any) {
|
||||
return request.post({ url: '/dept.jobs/edit', params })
|
||||
}
|
||||
|
||||
// 删除岗位
|
||||
export function jobsDelete(params: any) {
|
||||
return request.post({ url: '/dept.jobs/delete', params })
|
||||
}
|
||||
|
||||
// 岗位详情
|
||||
export function jobsDetail(params: any) {
|
||||
return request.get({ url: '/dept.jobs/detail', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 岗位列表
|
||||
export function jobsLists(params: any) {
|
||||
return request.get({ url: '/dept.jobs/lists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 岗位列表全部
|
||||
export function jobsAll(params: any) {
|
||||
return request.get({ url: '/dept.jobs/all', params })
|
||||
}
|
||||
|
||||
// 添加岗位
|
||||
export function jobsAdd(params: any) {
|
||||
return request.post({ url: '/dept.jobs/add', params })
|
||||
}
|
||||
|
||||
// 编辑岗位
|
||||
export function jobsEdit(params: any) {
|
||||
return request.post({ url: '/dept.jobs/edit', params })
|
||||
}
|
||||
|
||||
// 删除岗位
|
||||
export function jobsDelete(params: any) {
|
||||
return request.post({ url: '/dept.jobs/delete', params })
|
||||
}
|
||||
|
||||
// 岗位详情
|
||||
export function jobsDetail(params: any) {
|
||||
return request.get({ url: '/dept.jobs/detail', params })
|
||||
}
|
||||
|
|
|
@ -1,29 +1,41 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 管理员列表
|
||||
export function adminLists(params: any) {
|
||||
return request.get({ url: '/auth.admin/lists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
// 管理员列表全部
|
||||
export function adminAll(params: any) {
|
||||
return request.get({ url: '/auth.admin/all', params })
|
||||
}
|
||||
// 管理员添加
|
||||
export function adminAdd(params: any) {
|
||||
return request.post({ url: '/auth.admin/add', params })
|
||||
}
|
||||
|
||||
// 管理员编辑
|
||||
export function adminEdit(params: any) {
|
||||
return request.post({ url: '/auth.admin/edit', params })
|
||||
}
|
||||
|
||||
// 管理员删除
|
||||
export function adminDelete(params: any) {
|
||||
return request.post({ url: '/auth.admin/delete', params })
|
||||
}
|
||||
|
||||
// 管理员详情
|
||||
export function adminDetail(params: any) {
|
||||
return request.get({ url: '/auth.admin/detail', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 管理员列表
|
||||
export function adminLists(params: any) {
|
||||
return request.get({ url: '/auth.admin/lists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
// 管理员列表全部
|
||||
export function adminAll(params: any) {
|
||||
return request.get({ url: '/auth.admin/all', params })
|
||||
}
|
||||
// 管理员添加
|
||||
export function adminAdd(params: any) {
|
||||
return request.post({ url: '/auth.admin/add', params })
|
||||
}
|
||||
|
||||
// 管理员编辑
|
||||
export function adminEdit(params: any) {
|
||||
return request.post({ url: '/auth.admin/edit', params })
|
||||
}
|
||||
|
||||
// 管理员删除
|
||||
export function adminDelete(params: any) {
|
||||
return request.post({ url: '/auth.admin/delete', params })
|
||||
}
|
||||
|
||||
// 管理员详情
|
||||
export function adminDetail(params: any) {
|
||||
return request.get({ url: '/auth.admin/detail', params })
|
||||
}
|
||||
// 生成合同
|
||||
export function generateGontract(params: any) {
|
||||
return request.get({ url: '/auth.admin/Draftingcontracts', params })
|
||||
}
|
||||
// 发送短信
|
||||
export function sendMsgApi(params: any) {
|
||||
return request.get({ url: '/auth.admin/postsms', params })
|
||||
}
|
||||
// 废除合同
|
||||
export function abolition(params: any) {
|
||||
return request.get({ url: '/auth.admin/abolition', params })
|
||||
}
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 菜单列表
|
||||
export function menuLists(params: Record<string, any>) {
|
||||
return request.get({ url: '/auth.menu/lists', params })
|
||||
}
|
||||
// 菜单全部
|
||||
export function menuAll(params?: Record<string, any>) {
|
||||
return request.get({ url: '/auth.menu/all', params })
|
||||
}
|
||||
|
||||
// 添加菜单
|
||||
export function menuAdd(params: Record<string, any>) {
|
||||
return request.post({ url: '/auth.menu/add', params })
|
||||
}
|
||||
|
||||
// 编辑菜单
|
||||
export function menuEdit(params: Record<string, any>) {
|
||||
return request.post({ url: '/auth.menu/edit', params })
|
||||
}
|
||||
|
||||
// 菜单删除
|
||||
export function menuDelete(params: Record<string, any>) {
|
||||
return request.post({ url: '/auth.menu/delete', params })
|
||||
}
|
||||
|
||||
// 菜单详情
|
||||
export function menuDetail(params: Record<string, any>) {
|
||||
return request.get({ url: '/auth.menu/detail', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 菜单列表
|
||||
export function menuLists(params: Record<string, any>) {
|
||||
return request.get({ url: '/auth.menu/lists', params })
|
||||
}
|
||||
// 菜单全部
|
||||
export function menuAll(params?: Record<string, any>) {
|
||||
return request.get({ url: '/auth.menu/all', params })
|
||||
}
|
||||
|
||||
// 添加菜单
|
||||
export function menuAdd(params: Record<string, any>) {
|
||||
return request.post({ url: '/auth.menu/add', params })
|
||||
}
|
||||
|
||||
// 编辑菜单
|
||||
export function menuEdit(params: Record<string, any>) {
|
||||
return request.post({ url: '/auth.menu/edit', params })
|
||||
}
|
||||
|
||||
// 菜单删除
|
||||
export function menuDelete(params: Record<string, any>) {
|
||||
return request.post({ url: '/auth.menu/delete', params })
|
||||
}
|
||||
|
||||
// 菜单详情
|
||||
export function menuDetail(params: Record<string, any>) {
|
||||
return request.get({ url: '/auth.menu/detail', params })
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 角色列表
|
||||
export function roleLists(params: any) {
|
||||
return request.get({ url: '/auth.role/lists', params })
|
||||
}
|
||||
// 角色列表全部
|
||||
export function roleAll(params: any) {
|
||||
return request.get({ url: '/auth.role/all', params })
|
||||
}
|
||||
// 添加角色
|
||||
export function roleAdd(params: any) {
|
||||
return request.post({ url: '/auth.role/add', params })
|
||||
}
|
||||
// 编辑角色
|
||||
export function roleEdit(params: any) {
|
||||
return request.post({ url: '/auth.role/edit', params })
|
||||
}
|
||||
// 删除角色
|
||||
export function roleDelete(params: any) {
|
||||
return request.post({ url: '/auth.role/delete', params })
|
||||
}
|
||||
|
||||
// 角色详情
|
||||
export function roleDetail(params: any) {
|
||||
return request.get({ url: '/auth.role/detail', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 角色列表
|
||||
export function roleLists(params: any) {
|
||||
return request.get({ url: '/auth.role/lists', params })
|
||||
}
|
||||
// 角色列表全部
|
||||
export function roleAll(params: any) {
|
||||
return request.get({ url: '/auth.role/all', params })
|
||||
}
|
||||
// 添加角色
|
||||
export function roleAdd(params: any) {
|
||||
return request.post({ url: '/auth.role/add', params })
|
||||
}
|
||||
// 编辑角色
|
||||
export function roleEdit(params: any) {
|
||||
return request.post({ url: '/auth.role/edit', params })
|
||||
}
|
||||
// 删除角色
|
||||
export function roleDelete(params: any) {
|
||||
return request.post({ url: '/auth.role/delete', params })
|
||||
}
|
||||
|
||||
// 角色详情
|
||||
export function roleDetail(params: any) {
|
||||
return request.get({ url: '/auth.role/detail', params })
|
||||
}
|
||||
|
|
|
@ -1,61 +1,66 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 字典类型列表
|
||||
export function dictTypeLists(params: any) {
|
||||
return request.get({ url: '/setting.dict.dict_type/lists', params })
|
||||
}
|
||||
|
||||
// 字典类型列表全部
|
||||
export function dictTypeAll(params: any) {
|
||||
return request.get({ url: '/setting.dict.dict_type/all', params })
|
||||
}
|
||||
|
||||
// 添加字典类型
|
||||
export function dictTypeAdd(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_type/add', params })
|
||||
}
|
||||
|
||||
// 编辑字典类型
|
||||
export function dictTypeEdit(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_type/edit', params })
|
||||
}
|
||||
|
||||
// 删除字典类型
|
||||
export function dictTypeDelete(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_type/delete', params })
|
||||
}
|
||||
|
||||
// 字典类型详情
|
||||
export function dictTypeDetail(params: any) {
|
||||
return request.get({ url: '/setting.dict.dict_type/detail', params })
|
||||
}
|
||||
|
||||
// 字典数据列表
|
||||
export function dictDataLists(params: any) {
|
||||
return request.get(
|
||||
{ url: '/setting.dict.dict_data/lists', params },
|
||||
{
|
||||
ignoreCancelToken: true
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 添加字典数据
|
||||
export function dictDataAdd(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_data/add', params })
|
||||
}
|
||||
|
||||
// 编辑字典数据
|
||||
export function dictDataEdit(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_data/edit', params })
|
||||
}
|
||||
|
||||
// 删除字典数据
|
||||
export function dictDataDelete(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_data/delete', params })
|
||||
}
|
||||
|
||||
// 字典数据详情
|
||||
export function dictDataDetail(params: any) {
|
||||
return request.get({ url: '/setting.dict.dict_data/detail', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 字典类型列表
|
||||
export function dictTypeLists(params: any) {
|
||||
return request.get({ url: '/setting.dict.dict_type/lists', params })
|
||||
}
|
||||
|
||||
// 字典类型列表全部
|
||||
export function dictTypeAll(params: any) {
|
||||
return request.get({ url: '/setting.dict.dict_type/all', params })
|
||||
}
|
||||
|
||||
// 添加字典类型
|
||||
export function dictTypeAdd(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_type/add', params })
|
||||
}
|
||||
|
||||
// 编辑字典类型
|
||||
export function dictTypeEdit(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_type/edit', params })
|
||||
}
|
||||
|
||||
// 删除字典类型
|
||||
export function dictTypeDelete(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_type/delete', params })
|
||||
}
|
||||
|
||||
// 字典类型详情
|
||||
export function dictTypeDetail(params: any) {
|
||||
return request.get({ url: '/setting.dict.dict_type/detail', params })
|
||||
}
|
||||
|
||||
// 字典数据列表
|
||||
export function dictDataLists(params: any) {
|
||||
return request.get(
|
||||
{ url: '/setting.dict.dict_data/lists', params },
|
||||
{
|
||||
ignoreCancelToken: true
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 添加字典数据
|
||||
export function dictDataAdd(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_data/add', params })
|
||||
}
|
||||
|
||||
// 编辑字典数据
|
||||
export function dictDataEdit(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_data/edit', params })
|
||||
}
|
||||
|
||||
// 删除字典数据
|
||||
export function dictDataDelete(params: any) {
|
||||
return request.post({ url: '/setting.dict.dict_data/delete', params })
|
||||
}
|
||||
|
||||
// 字典数据详情
|
||||
export function dictDataDetail(params: any) {
|
||||
return request.get({ url: '/setting.dict.dict_data/detail', params })
|
||||
}
|
||||
|
||||
// 审批任务类型
|
||||
export function getTaskApproveTypeList(params: any|undefined) {
|
||||
return request.get({ url: '/dict.dict/getTaskApproveTypeList', params })
|
||||
}
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取支付方式
|
||||
export function getPayWay() {
|
||||
return request.get({ url: '/setting.pay.pay_way/getPayWay' })
|
||||
}
|
||||
|
||||
// 设置支付方式
|
||||
export function setPayWay(params: any) {
|
||||
return request.post({ url: '/setting.pay.pay_way/setPayWay', params })
|
||||
}
|
||||
|
||||
// 获取支付方式
|
||||
export function getPayConfigLists() {
|
||||
return request.get({ url: '/setting.pay.pay_config/lists' })
|
||||
}
|
||||
|
||||
// 设置支付方式
|
||||
export function setPayConfig(params: any) {
|
||||
return request.post({ url: '/setting.pay.pay_config/setConfig', params })
|
||||
}
|
||||
|
||||
// 设置支付方式
|
||||
export function getPayConfig(params: any) {
|
||||
return request.get({ url: '/setting.pay.pay_config/getConfig', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取支付方式
|
||||
export function getPayWay() {
|
||||
return request.get({ url: '/setting.pay.pay_way/getPayWay' })
|
||||
}
|
||||
|
||||
// 设置支付方式
|
||||
export function setPayWay(params: any) {
|
||||
return request.post({ url: '/setting.pay.pay_way/setPayWay', params })
|
||||
}
|
||||
|
||||
// 获取支付方式
|
||||
export function getPayConfigLists() {
|
||||
return request.get({ url: '/setting.pay.pay_config/lists' })
|
||||
}
|
||||
|
||||
// 设置支付方式
|
||||
export function setPayConfig(params: any) {
|
||||
return request.post({ url: '/setting.pay.pay_config/setConfig', params })
|
||||
}
|
||||
|
||||
// 设置支付方式
|
||||
export function getPayConfig(params: any) {
|
||||
return request.get({ url: '/setting.pay.pay_config/getConfig', params })
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 获取热门搜索数据
|
||||
*/
|
||||
export function getSearch() {
|
||||
return request.get({ url: '/setting.hot_search/getConfig' })
|
||||
}
|
||||
|
||||
export interface List {
|
||||
name: string // 搜索关键字
|
||||
sort: number // 热门搜索排序
|
||||
}
|
||||
|
||||
export interface Search {
|
||||
status: number // 是否开启搜索0/1
|
||||
data: List[]
|
||||
}
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { Search } Search
|
||||
* @description 设置热门搜索
|
||||
*/
|
||||
export function setSearch(params: Search) {
|
||||
return request.post({ url: '/setting.hot_search/setConfig', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 获取热门搜索数据
|
||||
*/
|
||||
export function getSearch() {
|
||||
return request.get({ url: '/setting.hot_search/getConfig' })
|
||||
}
|
||||
|
||||
export interface List {
|
||||
name: string // 搜索关键字
|
||||
sort: number // 热门搜索排序
|
||||
}
|
||||
|
||||
export interface Search {
|
||||
status: number // 是否开启搜索0/1
|
||||
data: List[]
|
||||
}
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { Search } Search
|
||||
* @description 设置热门搜索
|
||||
*/
|
||||
export function setSearch(params: Search) {
|
||||
return request.post({ url: '/setting.hot_search/setConfig', params })
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取存储引擎列表
|
||||
export function storageLists() {
|
||||
return request.get({ url: '/setting.storage/lists' })
|
||||
}
|
||||
|
||||
// 设置存储引擎信息
|
||||
export function storageChange(params: any) {
|
||||
return request.post({ url: '/setting.storage/change', params })
|
||||
}
|
||||
|
||||
// 设置存储引擎信息
|
||||
export function storageSetup(params: any) {
|
||||
return request.post({ url: '/setting.storage/setup', params })
|
||||
}
|
||||
|
||||
// 获取存储配置信息
|
||||
export function storageDetail(params: any) {
|
||||
return request.get({ url: '/setting.storage/detail', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取存储引擎列表
|
||||
export function storageLists() {
|
||||
return request.get({ url: '/setting.storage/lists' })
|
||||
}
|
||||
|
||||
// 设置存储引擎信息
|
||||
export function storageChange(params: any) {
|
||||
return request.post({ url: '/setting.storage/change', params })
|
||||
}
|
||||
|
||||
// 设置存储引擎信息
|
||||
export function storageSetup(params: any) {
|
||||
return request.post({ url: '/setting.storage/setup', params })
|
||||
}
|
||||
|
||||
// 获取存储配置信息
|
||||
export function storageDetail(params: any) {
|
||||
return request.get({ url: '/setting.storage/detail', params })
|
||||
}
|
||||
|
|
|
@ -1,51 +1,51 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取系统环境
|
||||
export function systemInfo() {
|
||||
return request.get({ url: '/setting.system.system/info' })
|
||||
}
|
||||
|
||||
// 获取系统日志列表
|
||||
export function systemLogLists(params: any) {
|
||||
return request.get({ url: '/setting.system.log/lists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 清除系统缓存
|
||||
export function systemCacheClear() {
|
||||
return request.post({ url: '/setting.system.cache/clear' })
|
||||
}
|
||||
|
||||
// 定时任务列表
|
||||
export function crontabLists(params: any) {
|
||||
return request.get({ url: '/crontab.crontab/lists', params })
|
||||
}
|
||||
|
||||
// 添加定时任务
|
||||
export function crontabAdd(params: any) {
|
||||
return request.post({ url: '/crontab.crontab/add', params })
|
||||
}
|
||||
|
||||
// 定时任务详情
|
||||
export function crontabDetail(params: any) {
|
||||
return request.get({ url: '/crontab.crontab/detail', params })
|
||||
}
|
||||
|
||||
// 编辑定时任务
|
||||
export function crontabEdit(params: any) {
|
||||
return request.post({ url: '/crontab.crontab/edit', params })
|
||||
}
|
||||
|
||||
// 删除定时任务
|
||||
export function crontabDel(params: any) {
|
||||
return request.post({ url: '/crontab.crontab/delete', params })
|
||||
}
|
||||
|
||||
// 获取规则执行时间
|
||||
export function crontabExpression(params: any) {
|
||||
return request.get({ url: '/crontab.crontab/expression', params })
|
||||
}
|
||||
|
||||
// 操作定时任务
|
||||
export function srontabOperate(params: any) {
|
||||
return request.post({ url: '/crontab.crontab/operate', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取系统环境
|
||||
export function systemInfo() {
|
||||
return request.get({ url: '/setting.system.system/info' })
|
||||
}
|
||||
|
||||
// 获取系统日志列表
|
||||
export function systemLogLists(params: any) {
|
||||
return request.get({ url: '/setting.system.log/lists', params }, { ignoreCancelToken: true })
|
||||
}
|
||||
|
||||
// 清除系统缓存
|
||||
export function systemCacheClear() {
|
||||
return request.post({ url: '/setting.system.cache/clear' })
|
||||
}
|
||||
|
||||
// 定时任务列表
|
||||
export function crontabLists(params: any) {
|
||||
return request.get({ url: '/crontab.crontab/lists', params })
|
||||
}
|
||||
|
||||
// 添加定时任务
|
||||
export function crontabAdd(params: any) {
|
||||
return request.post({ url: '/crontab.crontab/add', params })
|
||||
}
|
||||
|
||||
// 定时任务详情
|
||||
export function crontabDetail(params: any) {
|
||||
return request.get({ url: '/crontab.crontab/detail', params })
|
||||
}
|
||||
|
||||
// 编辑定时任务
|
||||
export function crontabEdit(params: any) {
|
||||
return request.post({ url: '/crontab.crontab/edit', params })
|
||||
}
|
||||
|
||||
// 删除定时任务
|
||||
export function crontabDel(params: any) {
|
||||
return request.post({ url: '/crontab.crontab/delete', params })
|
||||
}
|
||||
|
||||
// 获取规则执行时间
|
||||
export function crontabExpression(params: any) {
|
||||
return request.get({ url: '/crontab.crontab/expression', params })
|
||||
}
|
||||
|
||||
// 操作定时任务
|
||||
export function srontabOperate(params: any) {
|
||||
return request.post({ url: '/crontab.crontab/operate', params })
|
||||
}
|
||||
|
|
|
@ -1,43 +1,43 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 获取用户设置
|
||||
*/
|
||||
export function getUserSetup() {
|
||||
return request.get({ url: '/setting.user.user/getConfig' })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { string } default_avatar 默认用户头像
|
||||
* @description 设置用户设置
|
||||
*/
|
||||
export function setUserSetup(params: { default_avatar: string }) {
|
||||
return request.post({ url: '/setting.user.user/setConfig', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 设置登录注册规则
|
||||
*/
|
||||
export function getLogin() {
|
||||
return request.get({ url: '/setting.user.user/getRegisterConfig' })
|
||||
}
|
||||
|
||||
export interface LoginSetup {
|
||||
login_way: number[] | any // 登录方式, 逗号隔开
|
||||
coerce_mobile: number // 强制绑定手机 0/1
|
||||
login_agreement: number // 是否开启协议 0/1
|
||||
third_auth: number // 第三方登录 0/1
|
||||
wechat_auth: number // 微信授权登录 0-关闭 1-开启
|
||||
qq_auth: number // qq授权登录 0-关闭 1-开启
|
||||
}
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { LoginSetup } LoginSetup
|
||||
* @description 设置登录注册规则
|
||||
*/
|
||||
export function setLogin(params: LoginSetup) {
|
||||
return request.post({ url: '/setting.user.user/setRegisterConfig', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 获取用户设置
|
||||
*/
|
||||
export function getUserSetup() {
|
||||
return request.get({ url: '/setting.user.user/getConfig' })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { string } default_avatar 默认用户头像
|
||||
* @description 设置用户设置
|
||||
*/
|
||||
export function setUserSetup(params: { default_avatar: string }) {
|
||||
return request.post({ url: '/setting.user.user/setConfig', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @description 设置登录注册规则
|
||||
*/
|
||||
export function getLogin() {
|
||||
return request.get({ url: '/setting.user.user/getRegisterConfig' })
|
||||
}
|
||||
|
||||
export interface LoginSetup {
|
||||
login_way: number[] | any // 登录方式, 逗号隔开
|
||||
coerce_mobile: number // 强制绑定手机 0/1
|
||||
login_agreement: number // 是否开启协议 0/1
|
||||
third_auth: number // 第三方登录 0/1
|
||||
wechat_auth: number // 微信授权登录 0-关闭 1-开启
|
||||
qq_auth: number // qq授权登录 0-关闭 1-开启
|
||||
}
|
||||
/**
|
||||
* @return { Promise }
|
||||
* @param { LoginSetup } LoginSetup
|
||||
* @description 设置登录注册规则
|
||||
*/
|
||||
export function setLogin(params: LoginSetup) {
|
||||
return request.post({ url: '/setting.user.user/setRegisterConfig', params })
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取备案信息
|
||||
export function getCopyright() {
|
||||
return request.get({ url: '/setting.web.web_setting/getCopyright' })
|
||||
}
|
||||
// 设置备案信息
|
||||
export function setCopyright(params: any) {
|
||||
return request.post({ url: '/setting.web.web_setting/setCopyright', params })
|
||||
}
|
||||
// 获取网站信息
|
||||
export function getWebsite() {
|
||||
return request.get({ url: '/setting.web.web_setting/getWebsite' })
|
||||
}
|
||||
// 设置网站信息
|
||||
export function setWebsite(params: any) {
|
||||
return request.post({ url: '/setting.web.web_setting/setWebsite', params })
|
||||
}
|
||||
|
||||
// 获取政策协议
|
||||
export function getProtocol() {
|
||||
return request.get({ url: '/setting.web.web_setting/getAgreement' })
|
||||
}
|
||||
// 设置政策协议
|
||||
export function setProtocol(params: any) {
|
||||
return request.post({ url: '/setting.web.web_setting/setAgreement', params })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取备案信息
|
||||
export function getCopyright() {
|
||||
return request.get({ url: '/setting.web.web_setting/getCopyright' })
|
||||
}
|
||||
// 设置备案信息
|
||||
export function setCopyright(params: any) {
|
||||
return request.post({ url: '/setting.web.web_setting/setCopyright', params })
|
||||
}
|
||||
// 获取网站信息
|
||||
export function getWebsite() {
|
||||
return request.get({ url: '/setting.web.web_setting/getWebsite' })
|
||||
}
|
||||
// 设置网站信息
|
||||
export function setWebsite(params: any) {
|
||||
return request.post({ url: '/setting.web.web_setting/setWebsite', params })
|
||||
}
|
||||
|
||||
// 获取政策协议
|
||||
export function getProtocol() {
|
||||
return request.get({ url: '/setting.web.web_setting/getAgreement' })
|
||||
}
|
||||
// 设置政策协议
|
||||
export function setProtocol(params: any) {
|
||||
return request.post({ url: '/setting.web.web_setting/setAgreement', params })
|
||||
}
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 商户合同列表
|
||||
export function apiShopContractLists(params: any) {
|
||||
return request.get({ url: '/contract.ShopContract/lists', params })
|
||||
}
|
||||
|
||||
// 添加商户合同
|
||||
export function apiShopContractAdd(params: any) {
|
||||
return request.post({ url: '/shop_contract/add', params })
|
||||
}
|
||||
|
||||
// 编辑商户合同
|
||||
export function apiShopContractEdit(params: any) {
|
||||
return request.post({ url: '/shop_contract/edit', params })
|
||||
}
|
||||
|
||||
// 删除商户合同
|
||||
export function apiShopContractDelete(params: any) {
|
||||
return request.post({ url: '/shop_contract/delete', params })
|
||||
}
|
||||
|
||||
// 商户合同详情
|
||||
export function apiShopContractDetail(params: any) {
|
||||
return request.get({ url: '/contract.ShopContract/detail', params })
|
||||
}
|
||||
|
||||
// 合同上传
|
||||
export function apiShopWindControl(params: any) {
|
||||
return request.post({ url: '/contract.CompanyContract/uploadContract', params })
|
||||
}
|
||||
|
||||
// 发送合同
|
||||
export function apiShopDraftingcontracts(params: any) {
|
||||
return request.post({ url: '/contract.CompanyContract/DraftingContract', params })
|
||||
}
|
||||
|
||||
// 重新发送短信
|
||||
export function apiShopSendMsgApi(params: any) {
|
||||
return request.get({ url: '/contract.ShopContract/sendSms', params })
|
||||
}
|
||||
|
||||
//请求证据包下载地址
|
||||
export function contractEvidence(params: any) {
|
||||
return request.get({ url: "/contract.ShopContract/evidence", params });
|
||||
}
|
||||
|
||||
// 设置备注
|
||||
export function apiShopContractAddNotes(params: any) {
|
||||
return request.post({ url: '/shop_contract/addNote', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 商城商户列表
|
||||
export function apiShopMerchantLists(params: any) {
|
||||
return request.get({ url: '/company.Merchant/merchantRecordLists', params })
|
||||
}
|
||||
|
||||
// 添加商城商户
|
||||
export function apiShopMerchantAdd(params: any) {
|
||||
return request.post({ url: '/shop_merchant/add', params })
|
||||
}
|
||||
|
||||
// 编辑商城商户
|
||||
export function apiShopMerchantEdit(params: any) {
|
||||
return request.post({ url: '/shop_merchant/edit', params })
|
||||
}
|
||||
|
||||
// 删除商城商户
|
||||
export function apiShopMerchantDelete(params: any) {
|
||||
return request.post({ url: '/shop_merchant/delete', params })
|
||||
}
|
||||
|
||||
// 商城商户详情
|
||||
export function apiShopMerchantDetail(params: any) {
|
||||
return request.get({ url: '/shop_merchant/detail', params })
|
||||
}
|
|
@ -1,25 +1,25 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
// 系统列表
|
||||
export function systemListApi(params?: any) {
|
||||
return request.get({ url: "/systems.system/lists", params });
|
||||
}
|
||||
|
||||
// 系统详情
|
||||
export function systemDetailApi(params?: any) {
|
||||
return request.get({ url: "/systems.system/detail", params });
|
||||
}
|
||||
// 添加系统
|
||||
export function systemAddApi(params?: any) {
|
||||
return request.post({ url: "/systems.system/add", params });
|
||||
}
|
||||
|
||||
// 编辑系统
|
||||
export function systemEditApi(params?: any) {
|
||||
return request.post({ url: "/systems.system/edit", params });
|
||||
}
|
||||
// 删除系统
|
||||
|
||||
export function systemDeleteApi(params?: any) {
|
||||
return request.post({ url: "/systems.system/delete", params });
|
||||
}
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 系统列表
|
||||
export function systemListApi(params?: any) {
|
||||
return request.get({ url: "/systems.system/lists", params });
|
||||
}
|
||||
|
||||
// 系统详情
|
||||
export function systemDetailApi(params?: any) {
|
||||
return request.get({ url: "/systems.system/detail", params });
|
||||
}
|
||||
// 添加系统
|
||||
export function systemAddApi(params?: any) {
|
||||
return request.post({ url: "/systems.system/add", params });
|
||||
}
|
||||
|
||||
// 编辑系统
|
||||
export function systemEditApi(params?: any) {
|
||||
return request.post({ url: "/systems.system/edit", params });
|
||||
}
|
||||
// 删除系统
|
||||
|
||||
export function systemDeleteApi(params?: any) {
|
||||
return request.post({ url: "/systems.system/delete", params });
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
import request from "@/utils/request/indexs";
|
||||
|
||||
/**
|
||||
* 绑定scoket
|
||||
*/
|
||||
export const bindScoket = (data: any) =>
|
||||
request.post({ url: "/common/im/doBindUid", data });
|
||||
// 发送消息
|
||||
export const sendMsgApi = (data: any) =>
|
||||
request.post({ url: "/common/im/sendTextMsg", data });
|
||||
// 发送文件
|
||||
export const sendFileApi = (data: any) =>
|
||||
request.post({ url: "/common/im/sendFileMsg", data });
|
||||
// 消息列表
|
||||
export const getMsgListApi = (data: any) =>
|
||||
request.post({ url: "/common/im/msgList", data });
|
||||
// 片区经理id
|
||||
export const getAreaManagerApi = (data: any) =>
|
||||
request.post({ url: "/common/im/getAreaManager", data });
|
||||
// 联系人列表
|
||||
export const getContactListApi = (data: any) =>
|
||||
request.post({ url: "/common/im/contactList", data });
|
|
@ -0,0 +1,27 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//添加任务
|
||||
export function apiTaskAdd(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/add', params })
|
||||
}
|
||||
|
||||
//修改任务
|
||||
export function apiTaskEdit(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/edit', params })
|
||||
}
|
||||
|
||||
//删除任务
|
||||
export function apiTaskDelete(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/delete', params })
|
||||
}
|
||||
|
||||
|
||||
//任务日程-列表
|
||||
export function apiTaskList(params: any) {
|
||||
return request.get({ url: '/task.scheduling/plan', params })
|
||||
}
|
||||
|
||||
//任务日程-详情
|
||||
export function apiTaskDetails(params: any) {
|
||||
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/detail', params })
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 任务公司排期列表
|
||||
export function apiTaskSchedulingLists(params: any) {
|
||||
return request.get({ url: '/task.scheduling/lists', params })
|
||||
}
|
||||
|
||||
// 添加任务公司排期
|
||||
export function apiTaskSchedulingAdd(params: any) {
|
||||
return request.post({ url: '/task.scheduling/addTemplate', params })
|
||||
}
|
||||
|
||||
// 编辑任务公司排期
|
||||
export function apiTaskSchedulingEdit(params: any) {
|
||||
return request.post({ url: '/task.scheduling/edit', params })
|
||||
}
|
||||
|
||||
// 删除任务公司排期
|
||||
export function apiTaskSchedulingDelete(params: any) {
|
||||
return request.post({ url: '/task.scheduling/deleteTemplate', params })
|
||||
}
|
||||
|
||||
// 任务公司排期详情
|
||||
export function apiTaskSchedulingDetail(params: any) {
|
||||
return request.get({ url: '/task.scheduling/detail', params })
|
||||
}
|
||||
|
||||
// 任务公司排期详情
|
||||
export function apiTaskSchedulingEditMoney(params: any) {
|
||||
return request.post({ url: '/task.scheduling/editMoney', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 任务日历列表
|
||||
export function apiTaskSchedulingPlanLists(params: any) {
|
||||
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/lists', params })
|
||||
}
|
||||
|
||||
// 添加任务日历
|
||||
export function apiTaskSchedulingPlanAdd(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/add', params })
|
||||
}
|
||||
|
||||
// 编辑任务日历
|
||||
export function apiTaskSchedulingPlanEdit(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/edit', params })
|
||||
}
|
||||
|
||||
// 删除任务日历
|
||||
export function apiTaskSchedulingPlanDelete(params: any) {
|
||||
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/delete', params })
|
||||
}
|
||||
|
||||
// 任务日历详情
|
||||
export function apiTaskSchedulingPlanDetail(params: any) {
|
||||
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/detail', params })
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 任务安排列表
|
||||
export function apiTaskTemplateLists(params: any) {
|
||||
return request.get({ url: '/task.scheduling/template', params })
|
||||
}
|
||||
|
||||
// 添加任务安排
|
||||
export function apiTaskTemplateAdd(params: any) {
|
||||
return request.post({ url: '/task.scheduling/addTemplate', params })
|
||||
}
|
||||
|
||||
// 编辑任务安排
|
||||
export function apiTaskTemplateEdit(params: any) {
|
||||
return request.post({ url: '/task.scheduling/editTemplate', params })
|
||||
}
|
||||
|
||||
// 删除任务安排
|
||||
export function apiTaskTemplateDelete(params: any) {
|
||||
return request.post({ url: '/task.scheduling/deleteTemplate', params })
|
||||
}
|
||||
|
||||
// 任务安排详情
|
||||
export function apiTaskTemplateDetail(params: any) {
|
||||
return request.get({ url: '/task.scheduling/deleteTemplate', params })
|
||||
}
|
||||
|
||||
// 任务类型
|
||||
export function apiTaskTypeList(params: any) {
|
||||
return request.get({ url: '/dict.dict/lists', params })
|
||||
}
|
||||
|
||||
// 指定商品
|
||||
export function apiGetProductList(params: any) {
|
||||
return request.get({ url: '/task_template.task_template/getProductList', params })
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
import request from "@/utils/request/indexs";
|
||||
|
||||
// 系统列表
|
||||
export function editssAPI(params?: any) {
|
||||
return request.post({ url: "/SuYuan/addMonitor", params });
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import request from "@/utils/request/indexs";
|
||||
|
||||
// 系统列表
|
||||
export function editssAPI(params?: any) {
|
||||
return request.post({ url: "/SuYuan/addMonitor", params });
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,51 +1,51 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 代码生成已选数据表列表接口
|
||||
export function generateTable(params: any) {
|
||||
return request.get({ url: '/tools.generator/generateTable', params })
|
||||
}
|
||||
|
||||
// 数据表列表接口
|
||||
export function dataTable(params: any) {
|
||||
return request.get({ url: '/tools.generator/dataTable', params })
|
||||
}
|
||||
|
||||
//选择要生成代码的数据表
|
||||
export function selectTable(params: any) {
|
||||
return request.post({ url: '/tools.generator/selectTable', params })
|
||||
}
|
||||
|
||||
// 已选择的数据表详情
|
||||
export function tableDetail(params: any) {
|
||||
return request.get({ url: '/tools.generator/detail', params })
|
||||
}
|
||||
|
||||
//同步字段
|
||||
export function syncColumn(params: any) {
|
||||
return request.post({ url: '/tools.generator/syncColumn', params })
|
||||
}
|
||||
|
||||
//删除已选择的数据表
|
||||
export function generateDelete(params: any) {
|
||||
return request.post({ url: '/tools.generator/delete', params })
|
||||
}
|
||||
|
||||
//编辑已选表字段
|
||||
export function generateEdit(params: any) {
|
||||
return request.post({ url: '/tools.generator/edit', params })
|
||||
}
|
||||
|
||||
//预览代码
|
||||
export function generatePreview(params: any) {
|
||||
return request.post({ url: '/tools.generator/preview', params })
|
||||
}
|
||||
|
||||
//生成代码
|
||||
export function generateCode(params: any) {
|
||||
return request.post({ url: '/tools.generator/generate', params })
|
||||
}
|
||||
|
||||
//获取模型
|
||||
export function getModels() {
|
||||
return request.get({ url: '/tools.generator/getModels' })
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 代码生成已选数据表列表接口
|
||||
export function generateTable(params: any) {
|
||||
return request.get({ url: '/tools.generator/generateTable', params })
|
||||
}
|
||||
|
||||
// 数据表列表接口
|
||||
export function dataTable(params: any) {
|
||||
return request.get({ url: '/tools.generator/dataTable', params })
|
||||
}
|
||||
|
||||
//选择要生成代码的数据表
|
||||
export function selectTable(params: any) {
|
||||
return request.post({ url: '/tools.generator/selectTable', params })
|
||||
}
|
||||
|
||||
// 已选择的数据表详情
|
||||
export function tableDetail(params: any) {
|
||||
return request.get({ url: '/tools.generator/detail', params })
|
||||
}
|
||||
|
||||
//同步字段
|
||||
export function syncColumn(params: any) {
|
||||
return request.post({ url: '/tools.generator/syncColumn', params })
|
||||
}
|
||||
|
||||
//删除已选择的数据表
|
||||
export function generateDelete(params: any) {
|
||||
return request.post({ url: '/tools.generator/delete', params })
|
||||
}
|
||||
|
||||
//编辑已选表字段
|
||||
export function generateEdit(params: any) {
|
||||
return request.post({ url: '/tools.generator/edit', params })
|
||||
}
|
||||
|
||||
//预览代码
|
||||
export function generatePreview(params: any) {
|
||||
return request.post({ url: '/tools.generator/preview', params })
|
||||
}
|
||||
|
||||
//生成代码
|
||||
export function generateCode(params: any) {
|
||||
return request.post({ url: '/tools.generator/generate', params })
|
||||
}
|
||||
|
||||
//获取模型
|
||||
export function getModels() {
|
||||
return request.get({ url: '/tools.generator/getModels' })
|
||||
}
|
||||
|
|
|
@ -1,22 +1,27 @@
|
|||
import config from '@/config'
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 登录
|
||||
export function login(params: Record<string, any>) {
|
||||
return request.post({ url: '/login/account', params: { ...params, terminal: config.terminal } })
|
||||
}
|
||||
|
||||
// 退出登录
|
||||
export function logout() {
|
||||
return request.post({ url: '/login/logout' })
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export function getUserInfo() {
|
||||
return request.get({ url: '/auth.admin/mySelf' })
|
||||
}
|
||||
|
||||
// 编辑管理员信息
|
||||
export function setUserInfo(params: any) {
|
||||
return request.post({ url: '/auth.admin/editSelf', params })
|
||||
}
|
||||
import config from '@/config'
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 登录
|
||||
export function login(params: Record<string, any>) {
|
||||
return request.post({ url: '/login/account', params: { ...params, terminal: config.terminal } })
|
||||
}
|
||||
|
||||
// 退出登录
|
||||
export function logout() {
|
||||
return request.post({ url: '/login/logout' })
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export function getUserInfo() {
|
||||
return request.get({ url: '/auth.admin/mySelf' })
|
||||
}
|
||||
|
||||
// 编辑管理员信息
|
||||
export function setUserInfo(params: any) {
|
||||
return request.post({ url: '/auth.admin/editSelf', params })
|
||||
}
|
||||
|
||||
// 编辑管理员信息
|
||||
export function getUserList(params: any) {
|
||||
return request.get({ url: '/user.user/lists', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 系统菜单表列表
|
||||
export function apiUserMenuLists(params: any) {
|
||||
return request.get({ url: '/user.user_menu/lists', params })
|
||||
}
|
||||
|
||||
// 添加系统菜单表
|
||||
export function apiUserMenuAdd(params: any) {
|
||||
return request.post({ url: '/user.user_menu/add', params })
|
||||
}
|
||||
|
||||
// 编辑系统菜单表
|
||||
export function apiUserMenuEdit(params: any) {
|
||||
return request.post({ url: '/user.user_menu/edit', params })
|
||||
}
|
||||
|
||||
// 删除系统菜单表
|
||||
export function apiUserMenuDelete(params: any) {
|
||||
return request.post({ url: '/user.user_menu/delete', params })
|
||||
}
|
||||
|
||||
// 系统菜单表详情
|
||||
export function apiUserMenuDetail(params: any) {
|
||||
return request.get({ url: '/user.user_menu/detail', params })
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 角色表列表
|
||||
export function apiUserRoleLists(params: any) {
|
||||
return request.get({ url: '/user.user_role/lists', params })
|
||||
}
|
||||
|
||||
// 添加角色表
|
||||
export function apiUserRoleAdd(params: any) {
|
||||
return request.post({ url: '/user.user_role/add', params })
|
||||
}
|
||||
|
||||
// 编辑角色表
|
||||
export function apiUserRoleEdit(params: any) {
|
||||
return request.post({ url: '/user.user_role/edit', params })
|
||||
}
|
||||
|
||||
// 删除角色表
|
||||
export function apiUserRoleDelete(params: any) {
|
||||
return request.post({ url: '/user.user_role/delete', params })
|
||||
}
|
||||
|
||||
// 角色表详情
|
||||
export function apiUserRoleDetail(params: any) {
|
||||
return request.get({ url: '/user.user_role/detail', params })
|
||||
}
|
|
@ -1,52 +1,52 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
// 用户列表
|
||||
export function usersListApi(params?: any) {
|
||||
return request.get({ url: "/user.user/lists", params });
|
||||
}
|
||||
|
||||
// 用户列表
|
||||
export function usersDetailApi(params?: any) {
|
||||
return request.get({ url: "/user.user/detail", params });
|
||||
}
|
||||
// 余额列表
|
||||
export function usersbalanceListApi(params?: any) {
|
||||
return request.get({ url: "/user.user/balance", params });
|
||||
}
|
||||
|
||||
// 积分列表
|
||||
export function usersintegralListApi(params?: any) {
|
||||
return request.get({ url: "/user.user/integral", params });
|
||||
}
|
||||
|
||||
export function accountLog(params?: any) {
|
||||
return request.get({ url: "/user.user/lists", params });
|
||||
}
|
||||
// 省
|
||||
export function proApi(params?: any) {
|
||||
return request.get({ url: "/geo/provinces", params });
|
||||
}
|
||||
// 市
|
||||
export function cityApi(params?: any) {
|
||||
return request.get({ url: "/geo/cities", params });
|
||||
}
|
||||
// 区
|
||||
export function areaApi(params?: any) {
|
||||
return request.get({ url: "/geo/areas", params });
|
||||
}
|
||||
// 镇
|
||||
export function townApi(params?: any) {
|
||||
return request.get({ url: "/geo/streets", params });
|
||||
}
|
||||
// 村
|
||||
export function coutnyApi(params?: any) {
|
||||
return request.get({ url: "/geo/villages", params });
|
||||
}
|
||||
// 组
|
||||
export function groupApi(params?: any) {
|
||||
return request.get({ url: "/geo/brigades", params });
|
||||
}
|
||||
// apps
|
||||
export function appListApi(params?: any) {
|
||||
return request.get({ url: "/user.user/apps", params });
|
||||
}
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 用户列表
|
||||
export function usersListApi(params?: any) {
|
||||
return request.get({ url: "/user.user/lists", params });
|
||||
}
|
||||
|
||||
// 用户列表
|
||||
export function usersDetailApi(params?: any) {
|
||||
return request.get({ url: "/user.user/detail", params });
|
||||
}
|
||||
// 余额列表
|
||||
export function usersbalanceListApi(params?: any) {
|
||||
return request.get({ url: "/user.user/balance", params });
|
||||
}
|
||||
|
||||
// 积分列表
|
||||
export function usersintegralListApi(params?: any) {
|
||||
return request.get({ url: "/user.user/integral", params });
|
||||
}
|
||||
|
||||
export function accountLog(params?: any) {
|
||||
return request.get({ url: "/user.user/lists", params });
|
||||
}
|
||||
// 省
|
||||
export function proApi(params?: any) {
|
||||
return request.get({ url: "/geo/provinces", params });
|
||||
}
|
||||
// 市
|
||||
export function cityApi(params?: any) {
|
||||
return request.get({ url: "/geo/cities", params });
|
||||
}
|
||||
// 区
|
||||
export function areaApi(params?: any) {
|
||||
return request.get({ url: "/geo/areas", params });
|
||||
}
|
||||
// 镇
|
||||
export function townApi(params?: any) {
|
||||
return request.get({ url: "/geo/streets", params });
|
||||
}
|
||||
// 村
|
||||
export function coutnyApi(params?: any) {
|
||||
return request.get({ url: "/geo/villages", params });
|
||||
}
|
||||
// 组
|
||||
export function groupApi(params?: any) {
|
||||
return request.get({ url: "/geo/brigades", params });
|
||||
}
|
||||
// apps
|
||||
export function appListApi(params?: any) {
|
||||
return request.get({ url: "/user.user/apps", params });
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 提现申请列表
|
||||
export function apiWithdrawLists(params: any) {
|
||||
return request.get({ url: '/finance.withdraw/index', params })
|
||||
}
|
||||
|
||||
// 添加提现申请
|
||||
export function apiWithdrawAdd(params: any) {
|
||||
return request.post({ url: '/finance.withdraw/add', params })
|
||||
}
|
||||
|
||||
// 编辑提现申请
|
||||
export function apiWithdrawEdit(params: any) {
|
||||
return request.post({ url: '/finance.withdraw/edit', params })
|
||||
}
|
||||
|
||||
// 删除提现申请
|
||||
export function apiWithdrawDelete(params: any) {
|
||||
return request.post({ url: '/finance.withdraw/delete', params })
|
||||
}
|
||||
|
||||
// 提现申请详情
|
||||
export function apiWithdrawDetail(params: any) {
|
||||
return request.get({ url: '/finance.withdraw/detail', params })
|
||||
}
|
||||
|
||||
//提现审核
|
||||
export function withdrawAudit(params?: any) {
|
||||
return request.post({ url: '/finance.withdraw/audit', params })
|
||||
}
|
|
@ -1,38 +1,38 @@
|
|||
<template>
|
||||
<component :is="type" v-bind="linkProps">
|
||||
<slot />
|
||||
</component>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
/**
|
||||
* @description 兼容第三方页面的跳转
|
||||
*/
|
||||
import { isExternal } from '@/utils/validate'
|
||||
interface Props {
|
||||
to: string | Record<string, string>
|
||||
replace?: boolean
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const isExternalLink = computed(() => {
|
||||
return typeof props.to !== 'object' && isExternal(props.to)
|
||||
})
|
||||
|
||||
const type = computed(() => {
|
||||
if (isExternalLink.value) {
|
||||
return 'a'
|
||||
}
|
||||
return 'router-link'
|
||||
})
|
||||
|
||||
const linkProps = computed(() => {
|
||||
if (isExternalLink.value) {
|
||||
return {
|
||||
href: props.to,
|
||||
target: '_blank'
|
||||
}
|
||||
}
|
||||
return props
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<component :is="type" v-bind="linkProps">
|
||||
<slot />
|
||||
</component>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
/**
|
||||
* @description 兼容第三方页面的跳转
|
||||
*/
|
||||
import { isExternal } from '@/utils/validate'
|
||||
interface Props {
|
||||
to: string | Record<string, string>
|
||||
replace?: boolean
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const isExternalLink = computed(() => {
|
||||
return typeof props.to !== 'object' && isExternal(props.to)
|
||||
})
|
||||
|
||||
const type = computed(() => {
|
||||
if (isExternalLink.value) {
|
||||
return 'a'
|
||||
}
|
||||
return 'router-link'
|
||||
})
|
||||
|
||||
const linkProps = computed(() => {
|
||||
if (isExternalLink.value) {
|
||||
return {
|
||||
href: props.to,
|
||||
target: '_blank'
|
||||
}
|
||||
}
|
||||
return props
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
<template>
|
||||
<div class="color-picker flex flex-1">
|
||||
<el-color-picker v-model="color" :predefine="predefineColors" />
|
||||
<el-input v-model="color" class="mx-[10px] flex-1" type="text" readonly />
|
||||
<el-button type="text" @click="reset">重置</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: String
|
||||
},
|
||||
defaultColor: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: any): void
|
||||
}>()
|
||||
|
||||
const color = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
set(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
const predefineColors = ['#409EFF', '#28C76F', '#EA5455', '#FF9F43', '#01CFE8', '#4A5DFF']
|
||||
const reset = () => {
|
||||
color.value = props.defaultColor
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="color-picker flex flex-1">
|
||||
<el-color-picker v-model="color" :predefine="predefineColors" />
|
||||
<el-input v-model="color" class="mx-[10px] flex-1" type="text" readonly />
|
||||
<el-button type="text" @click="reset">重置</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: String
|
||||
},
|
||||
defaultColor: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: any): void
|
||||
}>()
|
||||
|
||||
const color = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
set(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
const predefineColors = ['#409EFF', '#28C76F', '#EA5455', '#FF9F43', '#01CFE8', '#4A5DFF']
|
||||
const reset = () => {
|
||||
color.value = props.defaultColor
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,43 +1,43 @@
|
|||
<template>
|
||||
<el-date-picker
|
||||
v-model="content"
|
||||
type="datetimerange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
clearable
|
||||
></el-date-picker>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { withDefaults, computed } from 'vue'
|
||||
|
||||
/* Props S */
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
startTime?: string
|
||||
endTime?: string
|
||||
}>(),
|
||||
{
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
}
|
||||
)
|
||||
const emit = defineEmits(['update:startTime', 'update:endTime'])
|
||||
|
||||
const content = computed<any>({
|
||||
get: () => {
|
||||
return [props.startTime, props.endTime]
|
||||
},
|
||||
set: (value: Event | any) => {
|
||||
if (value === null) {
|
||||
emit('update:startTime', '')
|
||||
emit('update:endTime', '')
|
||||
} else {
|
||||
emit('update:startTime', value[0])
|
||||
emit('update:endTime', value[1])
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<el-date-picker
|
||||
v-model="content"
|
||||
type="datetimerange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
clearable
|
||||
></el-date-picker>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { withDefaults, computed } from 'vue'
|
||||
|
||||
/* Props S */
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
startTime?: string
|
||||
endTime?: string
|
||||
}>(),
|
||||
{
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
}
|
||||
)
|
||||
const emit = defineEmits(['update:startTime', 'update:endTime'])
|
||||
|
||||
const content = computed<any>({
|
||||
get: () => {
|
||||
return [props.startTime, props.endTime]
|
||||
},
|
||||
set: (value: Event | any) => {
|
||||
if (value === null) {
|
||||
emit('update:startTime', '')
|
||||
emit('update:endTime', '')
|
||||
} else {
|
||||
emit('update:startTime', value[0])
|
||||
emit('update:endTime', value[1])
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -1,51 +1,51 @@
|
|||
<template>
|
||||
<div class="del-wrap">
|
||||
<slot></slot>
|
||||
<div v-if="showClose" class="icon-close" @click.stop="handleClose">
|
||||
<icon :size="12" name="el-icon-CloseBold" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default defineComponent({
|
||||
props: {
|
||||
showClose: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
emits: ['close'],
|
||||
setup(props, { emit }) {
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
return {
|
||||
handleClose
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.del-wrap {
|
||||
position: relative;
|
||||
&:hover > .icon-close {
|
||||
display: flex;
|
||||
}
|
||||
.icon-close {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -8px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="del-wrap">
|
||||
<slot></slot>
|
||||
<div v-if="showClose" class="icon-close" @click.stop="handleClose">
|
||||
<icon :size="12" name="el-icon-CloseBold" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default defineComponent({
|
||||
props: {
|
||||
showClose: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
emits: ['close'],
|
||||
setup(props, { emit }) {
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
return {
|
||||
handleClose
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.del-wrap {
|
||||
position: relative;
|
||||
&:hover > .icon-close {
|
||||
display: flex;
|
||||
}
|
||||
.icon-close {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -8px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="公司名称" prop="company_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_name"
|
||||
clearable
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.company_type"
|
||||
clearable
|
||||
placeholder="请输入公司类型"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="签约公司" property="company_name" />
|
||||
<el-table-column label="公司类型" property="company_type" />
|
||||
<el-table-column label="区县" property="area" />
|
||||
<el-table-column label="乡镇" property="street" />
|
||||
<el-table-column label="主联系人" property="master_name" />
|
||||
<el-table-column label="联系方式" property="master_phone" />
|
||||
<el-table-column label="片区经理" property="area_manager" />
|
||||
<el-table-column label="是否签约" property="is_contract" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiCompanyLists, apiCompanyDelete } from '@/api/company'
|
||||
import { defineEmits } from 'vue'
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
level_two: '',
|
||||
level_one: '',
|
||||
company_name: '',
|
||||
organization_code: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
company_type: '',
|
||||
master_name: '',
|
||||
master_position: '',
|
||||
master_phone: '',
|
||||
master_email: '',
|
||||
other_contacts: '',
|
||||
area_manager: '',
|
||||
is_contract: '',
|
||||
account: '',
|
||||
password: '',
|
||||
deposit: '',
|
||||
deposit_time: '',
|
||||
qualification: '',
|
||||
status: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(['customEvent'])
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits('customEvent', value)
|
||||
}
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
getLists()
|
||||
</script>
|
|
@ -1,35 +1,35 @@
|
|||
<template>
|
||||
<div>
|
||||
<template v-for="(item, index) in getOptions" :key="index">
|
||||
<span>{{ index != 0 ? '、' : '' }}{{ item[config.label] }}</span>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
options: any[]
|
||||
value: any
|
||||
config: Record<string, string>
|
||||
}>(),
|
||||
{
|
||||
options: () => [],
|
||||
config: () => ({
|
||||
label: 'name',
|
||||
value: 'value'
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
const values = computed(() => {
|
||||
if (props.value !== null && typeof props.value !== 'undefined') {
|
||||
return Array.isArray(props.value) ? props.value : String(props.value).split(',')
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
})
|
||||
|
||||
const getOptions = computed(() => {
|
||||
return props.options.filter((item) => values.value.includes(item[props.config.value]))
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<template v-for="(item, index) in getOptions" :key="index">
|
||||
<span>{{ index != 0 ? '、' : '' }}{{ item[config.label] }}</span>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
options: any[]
|
||||
value: any
|
||||
config: Record<string, string>
|
||||
}>(),
|
||||
{
|
||||
options: () => [],
|
||||
config: () => ({
|
||||
label: 'name',
|
||||
value: 'value'
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
const values = computed(() => {
|
||||
if (props.value !== null && typeof props.value !== 'undefined') {
|
||||
return Array.isArray(props.value) ? props.value : String(props.value).split(',')
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
})
|
||||
|
||||
const getOptions = computed(() => {
|
||||
return props.options.filter((item) => values.value.includes(item[props.config.value]))
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -1,143 +1,143 @@
|
|||
<template>
|
||||
<div class="border border-br flex flex-col" :style="styles">
|
||||
<toolbar
|
||||
class="border-b border-br"
|
||||
:editor="editorRef"
|
||||
:defaultConfig="toolbarConfig"
|
||||
:mode="mode"
|
||||
/>
|
||||
<w-editor
|
||||
class="overflow-y-auto flex-1"
|
||||
v-model="valueHtml"
|
||||
:defaultConfig="editorConfig"
|
||||
:mode="mode"
|
||||
@onCreated="handleCreated"
|
||||
/>
|
||||
<material-picker
|
||||
ref="materialPickerRef"
|
||||
:type="fileType"
|
||||
:limit="-1"
|
||||
hidden-upload
|
||||
@change="selectChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import '@wangeditor/editor/dist/css/style.css' // 引入 css
|
||||
import { Editor as WEditor, Toolbar } from '@wangeditor/editor-for-vue'
|
||||
import type { IEditorConfig, IToolbarConfig } from '@wangeditor/editor'
|
||||
import MaterialPicker from '@/components/material/picker.vue'
|
||||
import { addUnit } from '@/utils/util'
|
||||
import type { CSSProperties } from 'vue'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
modelValue?: string
|
||||
mode?: 'default' | 'simple'
|
||||
height?: string | number
|
||||
width?: string | number
|
||||
toolbarConfig?: Partial<IToolbarConfig>
|
||||
}>(),
|
||||
{
|
||||
modelValue: '',
|
||||
mode: 'default',
|
||||
height: '100%',
|
||||
width: 'auto',
|
||||
toolbarConfig: () => ({})
|
||||
}
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: string): void
|
||||
}>()
|
||||
|
||||
// 编辑器实例,必须用 shallowRef
|
||||
const editorRef = shallowRef()
|
||||
const materialPickerRef = shallowRef<InstanceType<typeof MaterialPicker>>()
|
||||
const fileType = ref('')
|
||||
|
||||
let insertFn: any
|
||||
|
||||
const editorConfig: Partial<IEditorConfig> = {
|
||||
MENU_CONF: {
|
||||
uploadImage: {
|
||||
customBrowseAndUpload(insert: any) {
|
||||
fileType.value = 'image'
|
||||
materialPickerRef.value?.showPopup(-1)
|
||||
insertFn = insert
|
||||
}
|
||||
},
|
||||
uploadVideo: {
|
||||
customBrowseAndUpload(insert: any) {
|
||||
fileType.value = 'video'
|
||||
materialPickerRef.value?.showPopup(-1)
|
||||
insertFn = insert
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const styles = computed<CSSProperties>(() => ({
|
||||
height: addUnit(props.height),
|
||||
width: addUnit(props.width)
|
||||
}))
|
||||
const valueHtml = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
set(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
|
||||
const selectChange = (fileUrl: string[]) => {
|
||||
fileUrl.forEach((url) => {
|
||||
insertFn(url)
|
||||
})
|
||||
}
|
||||
|
||||
// 组件销毁时,也及时销毁编辑器
|
||||
onBeforeUnmount(() => {
|
||||
const editor = editorRef.value
|
||||
if (editor == null) return
|
||||
editor.destroy()
|
||||
})
|
||||
|
||||
const handleCreated = (editor: any) => {
|
||||
editorRef.value = editor // 记录 editor 实例,重要!
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.w-e-full-screen-container {
|
||||
z-index: 999;
|
||||
}
|
||||
.w-e-text-container [data-slate-editor] ul {
|
||||
list-style: disc;
|
||||
}
|
||||
.w-e-text-container [data-slate-editor] ol {
|
||||
list-style: decimal;
|
||||
}
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.17em;
|
||||
}
|
||||
h4 {
|
||||
font-size: 1em;
|
||||
}
|
||||
h5 {
|
||||
font-size: 0.83em;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5 {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="border border-br flex flex-col" :style="styles">
|
||||
<toolbar
|
||||
class="border-b border-br"
|
||||
:editor="editorRef"
|
||||
:defaultConfig="toolbarConfig"
|
||||
:mode="mode"
|
||||
/>
|
||||
<w-editor
|
||||
class="overflow-y-auto flex-1"
|
||||
v-model="valueHtml"
|
||||
:defaultConfig="editorConfig"
|
||||
:mode="mode"
|
||||
@onCreated="handleCreated"
|
||||
/>
|
||||
<material-picker
|
||||
ref="materialPickerRef"
|
||||
:type="fileType"
|
||||
:limit="-1"
|
||||
hidden-upload
|
||||
@change="selectChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import '@wangeditor/editor/dist/css/style.css' // 引入 css
|
||||
import { Editor as WEditor, Toolbar } from '@wangeditor/editor-for-vue'
|
||||
import type { IEditorConfig, IToolbarConfig } from '@wangeditor/editor'
|
||||
import MaterialPicker from '@/components/material/picker.vue'
|
||||
import { addUnit } from '@/utils/util'
|
||||
import type { CSSProperties } from 'vue'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
modelValue?: string
|
||||
mode?: 'default' | 'simple'
|
||||
height?: string | number
|
||||
width?: string | number
|
||||
toolbarConfig?: Partial<IToolbarConfig>
|
||||
}>(),
|
||||
{
|
||||
modelValue: '',
|
||||
mode: 'default',
|
||||
height: '100%',
|
||||
width: 'auto',
|
||||
toolbarConfig: () => ({})
|
||||
}
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: string): void
|
||||
}>()
|
||||
|
||||
// 编辑器实例,必须用 shallowRef
|
||||
const editorRef = shallowRef()
|
||||
const materialPickerRef = shallowRef<InstanceType<typeof MaterialPicker>>()
|
||||
const fileType = ref('')
|
||||
|
||||
let insertFn: any
|
||||
|
||||
const editorConfig: Partial<IEditorConfig> = {
|
||||
MENU_CONF: {
|
||||
uploadImage: {
|
||||
customBrowseAndUpload(insert: any) {
|
||||
fileType.value = 'image'
|
||||
materialPickerRef.value?.showPopup(-1)
|
||||
insertFn = insert
|
||||
}
|
||||
},
|
||||
uploadVideo: {
|
||||
customBrowseAndUpload(insert: any) {
|
||||
fileType.value = 'video'
|
||||
materialPickerRef.value?.showPopup(-1)
|
||||
insertFn = insert
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const styles = computed<CSSProperties>(() => ({
|
||||
height: addUnit(props.height),
|
||||
width: addUnit(props.width)
|
||||
}))
|
||||
const valueHtml = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
set(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
|
||||
const selectChange = (fileUrl: string[]) => {
|
||||
fileUrl.forEach((url) => {
|
||||
insertFn(url)
|
||||
})
|
||||
}
|
||||
|
||||
// 组件销毁时,也及时销毁编辑器
|
||||
onBeforeUnmount(() => {
|
||||
const editor = editorRef.value
|
||||
if (editor == null) return
|
||||
editor.destroy()
|
||||
})
|
||||
|
||||
const handleCreated = (editor: any) => {
|
||||
editorRef.value = editor // 记录 editor 实例,重要!
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.w-e-full-screen-container {
|
||||
z-index: 999;
|
||||
}
|
||||
.w-e-text-container [data-slate-editor] ul {
|
||||
list-style: disc;
|
||||
}
|
||||
.w-e-text-container [data-slate-editor] ol {
|
||||
list-style: decimal;
|
||||
}
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.17em;
|
||||
}
|
||||
h4 {
|
||||
font-size: 1em;
|
||||
}
|
||||
h5 {
|
||||
font-size: 0.83em;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5 {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,149 +1,149 @@
|
|||
<template>
|
||||
<div class="export-data">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
title="导出设置"
|
||||
width="500px"
|
||||
confirm-button-text="确认导出"
|
||||
@confirm="handleConfirm"
|
||||
:async="true"
|
||||
@open="getData"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button>导出</el-button>
|
||||
</template>
|
||||
<div>
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
|
||||
<el-form-item label="数据量:">
|
||||
预计导出{{ exportData.count }}条数据, 共{{ exportData.sum_page }}页,每页{{
|
||||
exportData.page_size
|
||||
}}条数据
|
||||
</el-form-item>
|
||||
<el-form-item label="导出限制:">
|
||||
每次导出最大允许{{ exportData.max_page }}页,共{{
|
||||
exportData.all_max_size
|
||||
}}条数据
|
||||
</el-form-item>
|
||||
<el-form-item prop="page_type" label="导出范围:" required>
|
||||
<el-radio-group v-model="formData.page_type">
|
||||
<el-radio :label="0">全部导出</el-radio>
|
||||
<el-radio :label="1">分页导出</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="分页范围:" v-if="formData.page_type == 1">
|
||||
<div class="flex">
|
||||
<el-form-item prop="page_start">
|
||||
<el-input
|
||||
style="width: 140px"
|
||||
v-model.number="formData.page_start"
|
||||
placeholder=""
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<span class="flex-none ml-2 mr-2">页,至</span>
|
||||
<el-form-item prop="page_end">
|
||||
<el-input
|
||||
style="width: 140px"
|
||||
v-model.number="formData.page_end"
|
||||
placeholder=""
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="导出文件名称:" prop="file_name">
|
||||
<el-input
|
||||
v-model="formData.file_name"
|
||||
placeholder="请输入导出文件名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import feedback from '@/utils/feedback'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const props = defineProps({
|
||||
params: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
pageSize: {
|
||||
type: Number,
|
||||
default: 25
|
||||
},
|
||||
fetchFun: {
|
||||
type: Function,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const formData = reactive({
|
||||
page_type: 0,
|
||||
page_start: 1,
|
||||
page_end: 200,
|
||||
file_name: ''
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
page_start: [
|
||||
{ required: true, message: '请输入起始页码' },
|
||||
{ type: 'number', message: '页码必须是整数' },
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value <= 0) return callback(new Error('页码必须大于0'))
|
||||
callback()
|
||||
}
|
||||
}
|
||||
],
|
||||
page_end: [
|
||||
{ required: true, message: '请输入结束页码' },
|
||||
{ type: 'number', message: '页码必须是整数' },
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value <= 0) return callback(new Error('页码必须大于0'))
|
||||
callback()
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const exportData = reactive({
|
||||
count: 0,
|
||||
sum_page: 0,
|
||||
page_size: 0,
|
||||
max_page: 0,
|
||||
all_max_size: 0
|
||||
})
|
||||
|
||||
const getData = async () => {
|
||||
const res = await props.fetchFun({
|
||||
...props.params,
|
||||
page_size: props.pageSize,
|
||||
export: 1
|
||||
})
|
||||
Object.assign(exportData, res)
|
||||
formData.file_name = res.file_name
|
||||
formData.page_end = res.page_end
|
||||
formData.page_start = res.page_start
|
||||
}
|
||||
const handleConfirm = async () => {
|
||||
await formRef.value?.validate()
|
||||
feedback.loading('正在导出中...')
|
||||
try {
|
||||
await props.fetchFun({
|
||||
...props.params,
|
||||
...formData,
|
||||
page_size: props.pageSize,
|
||||
export: 2
|
||||
})
|
||||
popupRef.value?.close()
|
||||
feedback.closeLoading()
|
||||
} catch (error) {
|
||||
feedback.closeLoading()
|
||||
}
|
||||
}
|
||||
getData()
|
||||
</script>
|
||||
<template>
|
||||
<div class="export-data">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
title="导出设置"
|
||||
width="500px"
|
||||
confirm-button-text="确认导出"
|
||||
@confirm="handleConfirm"
|
||||
:async="true"
|
||||
@open="getData"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button>导出</el-button>
|
||||
</template>
|
||||
<div>
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
|
||||
<el-form-item label="数据量:">
|
||||
预计导出{{ exportData.count }}条数据, 共{{ exportData.sum_page }}页,每页{{
|
||||
exportData.page_size
|
||||
}}条数据
|
||||
</el-form-item>
|
||||
<el-form-item label="导出限制:">
|
||||
每次导出最大允许{{ exportData.max_page }}页,共{{
|
||||
exportData.all_max_size
|
||||
}}条数据
|
||||
</el-form-item>
|
||||
<el-form-item prop="page_type" label="导出范围:" required>
|
||||
<el-radio-group v-model="formData.page_type">
|
||||
<el-radio :label="0">全部导出</el-radio>
|
||||
<el-radio :label="1">分页导出</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="分页范围:" v-if="formData.page_type == 1">
|
||||
<div class="flex">
|
||||
<el-form-item prop="page_start">
|
||||
<el-input
|
||||
style="width: 140px"
|
||||
v-model.number="formData.page_start"
|
||||
placeholder=""
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<span class="flex-none ml-2 mr-2">页,至</span>
|
||||
<el-form-item prop="page_end">
|
||||
<el-input
|
||||
style="width: 140px"
|
||||
v-model.number="formData.page_end"
|
||||
placeholder=""
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="导出文件名称:" prop="file_name">
|
||||
<el-input
|
||||
v-model="formData.file_name"
|
||||
placeholder="请输入导出文件名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import feedback from '@/utils/feedback'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const props = defineProps({
|
||||
params: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
pageSize: {
|
||||
type: Number,
|
||||
default: 25
|
||||
},
|
||||
fetchFun: {
|
||||
type: Function,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const formData = reactive({
|
||||
page_type: 0,
|
||||
page_start: 1,
|
||||
page_end: 200,
|
||||
file_name: ''
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
page_start: [
|
||||
{ required: true, message: '请输入起始页码' },
|
||||
{ type: 'number', message: '页码必须是整数' },
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value <= 0) return callback(new Error('页码必须大于0'))
|
||||
callback()
|
||||
}
|
||||
}
|
||||
],
|
||||
page_end: [
|
||||
{ required: true, message: '请输入结束页码' },
|
||||
{ type: 'number', message: '页码必须是整数' },
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value <= 0) return callback(new Error('页码必须大于0'))
|
||||
callback()
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const exportData = reactive({
|
||||
count: 0,
|
||||
sum_page: 0,
|
||||
page_size: 0,
|
||||
max_page: 0,
|
||||
all_max_size: 0
|
||||
})
|
||||
|
||||
const getData = async () => {
|
||||
const res = await props.fetchFun({
|
||||
...props.params,
|
||||
page_size: props.pageSize,
|
||||
export: 1
|
||||
})
|
||||
Object.assign(exportData, res)
|
||||
formData.file_name = res.file_name
|
||||
formData.page_end = res.page_end
|
||||
formData.page_start = res.page_start
|
||||
}
|
||||
const handleConfirm = async () => {
|
||||
await formRef.value?.validate()
|
||||
feedback.loading('正在导出中...')
|
||||
try {
|
||||
await props.fetchFun({
|
||||
...props.params,
|
||||
...formData,
|
||||
page_size: props.pageSize,
|
||||
export: 2
|
||||
})
|
||||
popupRef.value?.close()
|
||||
feedback.closeLoading()
|
||||
} catch (error) {
|
||||
feedback.closeLoading()
|
||||
}
|
||||
}
|
||||
getData()
|
||||
</script>
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
<template>
|
||||
<div class="footer-btns">
|
||||
<div class="footer-btns__content" :style="fixed ? 'position: fixed' : ''">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
defineProps({
|
||||
fixed: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.footer-btns {
|
||||
height: 60px;
|
||||
&__content {
|
||||
bottom: 0;
|
||||
height: 60px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 99;
|
||||
@apply flex justify-center items-center shadow bg-body;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="footer-btns">
|
||||
<div class="footer-btns__content" :style="fixed ? 'position: fixed' : ''">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
defineProps({
|
||||
fixed: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.footer-btns {
|
||||
height: 60px;
|
||||
&__content {
|
||||
bottom: 0;
|
||||
height: 60px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 99;
|
||||
@apply flex justify-center items-center shadow bg-body;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
import * as ElementPlusIcons from '@element-plus/icons-vue'
|
||||
//@ts-ignore
|
||||
import localIconsName from 'virtual:svg-icons-names'
|
||||
|
||||
export const LOCAL_ICON_PREFIX = 'local-icon-'
|
||||
export const EL_ICON_PREFIX = 'el-icon-'
|
||||
|
||||
const elIconsName: string[] = []
|
||||
|
||||
for (const [, component] of Object.entries(ElementPlusIcons)) {
|
||||
elIconsName.push(`${EL_ICON_PREFIX}${component.name}`)
|
||||
}
|
||||
|
||||
export function getElementPlusIconNames() {
|
||||
return elIconsName
|
||||
}
|
||||
export function getLocalIconNames() {
|
||||
return localIconsName
|
||||
}
|
||||
import * as ElementPlusIcons from '@element-plus/icons-vue'
|
||||
//@ts-ignore
|
||||
import localIconsName from 'virtual:svg-icons-names'
|
||||
|
||||
export const LOCAL_ICON_PREFIX = 'local-icon-'
|
||||
export const EL_ICON_PREFIX = 'el-icon-'
|
||||
|
||||
const elIconsName: string[] = []
|
||||
|
||||
for (const [, component] of Object.entries(ElementPlusIcons)) {
|
||||
elIconsName.push(`${EL_ICON_PREFIX}${component.name}`)
|
||||
}
|
||||
|
||||
export function getElementPlusIconNames() {
|
||||
return elIconsName
|
||||
}
|
||||
export function getLocalIconNames() {
|
||||
return localIconsName
|
||||
}
|
||||
|
|
|
@ -1,48 +1,48 @@
|
|||
<script lang="ts">
|
||||
import { createVNode } from 'vue'
|
||||
import { ElIcon } from 'element-plus'
|
||||
import { EL_ICON_PREFIX, LOCAL_ICON_PREFIX } from './index'
|
||||
import svgIcon from './svg-icon.vue'
|
||||
export default defineComponent({
|
||||
name: 'Icon',
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
size: {
|
||||
type: [String, Number],
|
||||
default: '14px'
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: 'inherit'
|
||||
}
|
||||
},
|
||||
setup(props) {
|
||||
if (props.name.indexOf(EL_ICON_PREFIX) === 0) {
|
||||
// el-icon
|
||||
return () =>
|
||||
createVNode(
|
||||
ElIcon,
|
||||
{
|
||||
size: props.size,
|
||||
color: props.color
|
||||
},
|
||||
() => [createVNode(resolveComponent(props.name.replace(EL_ICON_PREFIX, '')))]
|
||||
)
|
||||
}
|
||||
if (props.name.indexOf(LOCAL_ICON_PREFIX) === 0) {
|
||||
// 本地icon
|
||||
return () =>
|
||||
h(
|
||||
'i',
|
||||
{
|
||||
class: ['local-icon']
|
||||
},
|
||||
createVNode(svgIcon, { ...props })
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<script lang="ts">
|
||||
import { createVNode } from 'vue'
|
||||
import { ElIcon } from 'element-plus'
|
||||
import { EL_ICON_PREFIX, LOCAL_ICON_PREFIX } from './index'
|
||||
import svgIcon from './svg-icon.vue'
|
||||
export default defineComponent({
|
||||
name: 'Icon',
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
size: {
|
||||
type: [String, Number],
|
||||
default: '14px'
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: 'inherit'
|
||||
}
|
||||
},
|
||||
setup(props) {
|
||||
if (props.name.indexOf(EL_ICON_PREFIX) === 0) {
|
||||
// el-icon
|
||||
return () =>
|
||||
createVNode(
|
||||
ElIcon,
|
||||
{
|
||||
size: props.size,
|
||||
color: props.color
|
||||
},
|
||||
() => [createVNode(resolveComponent(props.name.replace(EL_ICON_PREFIX, '')))]
|
||||
)
|
||||
}
|
||||
if (props.name.indexOf(LOCAL_ICON_PREFIX) === 0) {
|
||||
// 本地icon
|
||||
return () =>
|
||||
h(
|
||||
'i',
|
||||
{
|
||||
class: ['local-icon']
|
||||
},
|
||||
createVNode(svgIcon, { ...props })
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -1,185 +1,185 @@
|
|||
<template>
|
||||
<div class="icon-select">
|
||||
<el-popover
|
||||
trigger="contextmenu"
|
||||
v-model:visible="state.popoverVisible"
|
||||
:width="state.popoverWidth"
|
||||
>
|
||||
<div
|
||||
@mouseover.stop="state.mouseoverSelect = true"
|
||||
@mouseout.stop="state.mouseoverSelect = false"
|
||||
>
|
||||
<div>
|
||||
<div class="flex justify-between">
|
||||
<div class="mb-3">请选择图标</div>
|
||||
<div>
|
||||
<span
|
||||
v-for="(item, index) in iconTabsMap"
|
||||
:key="index"
|
||||
class="cursor-pointer text-sm ml-2"
|
||||
:class="{
|
||||
'text-primary': index == tabIndex
|
||||
}"
|
||||
@click="tabIndex = index"
|
||||
>
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="h-[280px]">
|
||||
<el-scrollbar>
|
||||
<div class="flex flex-wrap">
|
||||
<div v-for="item in iconNamesFliter" :key="item" class="m-1">
|
||||
<el-button @click="handleSelect(item)">
|
||||
<icon :name="item" :size="18" />
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #reference>
|
||||
<el-input
|
||||
ref="inputRef"
|
||||
v-model.trim="state.inputValue"
|
||||
placeholder="搜索图标"
|
||||
:autofocus="false"
|
||||
:disabled="disabled"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
clearable
|
||||
>
|
||||
<template #prepend>
|
||||
<div class="flex items-center" v-if="modelValue">
|
||||
<el-tooltip class="flex-1 w-20" :content="modelValue" placement="top">
|
||||
<icon
|
||||
class="mr-1"
|
||||
:key="modelValue"
|
||||
:name="modelValue"
|
||||
:size="16"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<template v-else>无</template>
|
||||
</template>
|
||||
<template #append>
|
||||
<el-button>
|
||||
<icon name="el-icon-Close" :size="18" @click="handleClear" />
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-popover>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, nextTick, onMounted, reactive, shallowRef, watch } from 'vue'
|
||||
import { useEventListener } from '@vueuse/core'
|
||||
import { ElInput } from 'element-plus'
|
||||
import { getElementPlusIconNames, getLocalIconNames } from './index'
|
||||
interface Props {
|
||||
modelValue: string
|
||||
disabled?: boolean
|
||||
}
|
||||
withDefaults(defineProps<Props>(), {
|
||||
modelValue: '',
|
||||
disabled: false
|
||||
})
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'update:modelValue', value: string): void
|
||||
(e: 'change', value: string): void
|
||||
}>()
|
||||
|
||||
const tabIndex = ref(0)
|
||||
const iconTabsMap = [
|
||||
{
|
||||
name: 'element图标',
|
||||
icons: getElementPlusIconNames()
|
||||
},
|
||||
{
|
||||
name: '本地图标',
|
||||
icons: getLocalIconNames()
|
||||
}
|
||||
]
|
||||
|
||||
const inputRef = shallowRef<InstanceType<typeof ElInput>>()
|
||||
|
||||
const state = reactive({
|
||||
inputValue: '',
|
||||
popoverVisible: false,
|
||||
popoverWidth: 0,
|
||||
mouseoverSelect: false,
|
||||
inputFocus: false
|
||||
})
|
||||
|
||||
// input 框聚焦
|
||||
const handleFocus = () => {
|
||||
state.inputFocus = state.popoverVisible = true
|
||||
}
|
||||
|
||||
// input 框失去焦点
|
||||
const handleBlur = () => {
|
||||
state.inputFocus = false
|
||||
state.popoverVisible = state.mouseoverSelect
|
||||
}
|
||||
|
||||
// 选中图标
|
||||
const handleSelect = (icon: string) => {
|
||||
state.mouseoverSelect = state.popoverVisible = false
|
||||
emits('update:modelValue', icon)
|
||||
emits('change', icon)
|
||||
}
|
||||
//取消选中
|
||||
const handleClear = () => {
|
||||
emits('update:modelValue', '')
|
||||
emits('change', '')
|
||||
}
|
||||
|
||||
//根据输入框内容塞选
|
||||
const iconNamesFliter = computed(() => {
|
||||
const iconNames = iconTabsMap[tabIndex.value]?.icons ?? []
|
||||
if (!state.inputValue) {
|
||||
return iconNames
|
||||
}
|
||||
const inputValue = state.inputValue.toLowerCase()
|
||||
return iconNames.filter((icon: string) => {
|
||||
if (icon.toLowerCase().indexOf(inputValue) !== -1) {
|
||||
return icon
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 获取 input 的宽度
|
||||
const getInputWidth = () => {
|
||||
nextTick(() => {
|
||||
const inputWidth = inputRef.value?.$el.offsetWidth
|
||||
state.popoverWidth = inputWidth < 300 ? 300 : inputWidth
|
||||
})
|
||||
}
|
||||
|
||||
//监听body点击事件
|
||||
useEventListener(document.body, 'click', () => {
|
||||
state.popoverVisible = state.inputFocus || state.mouseoverSelect ? true : false
|
||||
})
|
||||
|
||||
watch(
|
||||
() => state.popoverVisible,
|
||||
async (value) => {
|
||||
await nextTick()
|
||||
if (value) {
|
||||
inputRef.value?.focus()
|
||||
} else {
|
||||
inputRef.value?.blur()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
getInputWidth()
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div class="icon-select">
|
||||
<el-popover
|
||||
trigger="contextmenu"
|
||||
v-model:visible="state.popoverVisible"
|
||||
:width="state.popoverWidth"
|
||||
>
|
||||
<div
|
||||
@mouseover.stop="state.mouseoverSelect = true"
|
||||
@mouseout.stop="state.mouseoverSelect = false"
|
||||
>
|
||||
<div>
|
||||
<div class="flex justify-between">
|
||||
<div class="mb-3">请选择图标</div>
|
||||
<div>
|
||||
<span
|
||||
v-for="(item, index) in iconTabsMap"
|
||||
:key="index"
|
||||
class="cursor-pointer text-sm ml-2"
|
||||
:class="{
|
||||
'text-primary': index == tabIndex
|
||||
}"
|
||||
@click="tabIndex = index"
|
||||
>
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="h-[280px]">
|
||||
<el-scrollbar>
|
||||
<div class="flex flex-wrap">
|
||||
<div v-for="item in iconNamesFliter" :key="item" class="m-1">
|
||||
<el-button @click="handleSelect(item)">
|
||||
<icon :name="item" :size="18" />
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #reference>
|
||||
<el-input
|
||||
ref="inputRef"
|
||||
v-model.trim="state.inputValue"
|
||||
placeholder="搜索图标"
|
||||
:autofocus="false"
|
||||
:disabled="disabled"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
clearable
|
||||
>
|
||||
<template #prepend>
|
||||
<div class="flex items-center" v-if="modelValue">
|
||||
<el-tooltip class="flex-1 w-20" :content="modelValue" placement="top">
|
||||
<icon
|
||||
class="mr-1"
|
||||
:key="modelValue"
|
||||
:name="modelValue"
|
||||
:size="16"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<template v-else>无</template>
|
||||
</template>
|
||||
<template #append>
|
||||
<el-button>
|
||||
<icon name="el-icon-Close" :size="18" @click="handleClear" />
|
||||
</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-popover>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, nextTick, onMounted, reactive, shallowRef, watch } from 'vue'
|
||||
import { useEventListener } from '@vueuse/core'
|
||||
import { ElInput } from 'element-plus'
|
||||
import { getElementPlusIconNames, getLocalIconNames } from './index'
|
||||
interface Props {
|
||||
modelValue: string
|
||||
disabled?: boolean
|
||||
}
|
||||
withDefaults(defineProps<Props>(), {
|
||||
modelValue: '',
|
||||
disabled: false
|
||||
})
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'update:modelValue', value: string): void
|
||||
(e: 'change', value: string): void
|
||||
}>()
|
||||
|
||||
const tabIndex = ref(0)
|
||||
const iconTabsMap = [
|
||||
{
|
||||
name: 'element图标',
|
||||
icons: getElementPlusIconNames()
|
||||
},
|
||||
{
|
||||
name: '本地图标',
|
||||
icons: getLocalIconNames()
|
||||
}
|
||||
]
|
||||
|
||||
const inputRef = shallowRef<InstanceType<typeof ElInput>>()
|
||||
|
||||
const state = reactive({
|
||||
inputValue: '',
|
||||
popoverVisible: false,
|
||||
popoverWidth: 0,
|
||||
mouseoverSelect: false,
|
||||
inputFocus: false
|
||||
})
|
||||
|
||||
// input 框聚焦
|
||||
const handleFocus = () => {
|
||||
state.inputFocus = state.popoverVisible = true
|
||||
}
|
||||
|
||||
// input 框失去焦点
|
||||
const handleBlur = () => {
|
||||
state.inputFocus = false
|
||||
state.popoverVisible = state.mouseoverSelect
|
||||
}
|
||||
|
||||
// 选中图标
|
||||
const handleSelect = (icon: string) => {
|
||||
state.mouseoverSelect = state.popoverVisible = false
|
||||
emits('update:modelValue', icon)
|
||||
emits('change', icon)
|
||||
}
|
||||
//取消选中
|
||||
const handleClear = () => {
|
||||
emits('update:modelValue', '')
|
||||
emits('change', '')
|
||||
}
|
||||
|
||||
//根据输入框内容塞选
|
||||
const iconNamesFliter = computed(() => {
|
||||
const iconNames = iconTabsMap[tabIndex.value]?.icons ?? []
|
||||
if (!state.inputValue) {
|
||||
return iconNames
|
||||
}
|
||||
const inputValue = state.inputValue.toLowerCase()
|
||||
return iconNames.filter((icon: string) => {
|
||||
if (icon.toLowerCase().indexOf(inputValue) !== -1) {
|
||||
return icon
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 获取 input 的宽度
|
||||
const getInputWidth = () => {
|
||||
nextTick(() => {
|
||||
const inputWidth = inputRef.value?.$el.offsetWidth
|
||||
state.popoverWidth = inputWidth < 300 ? 300 : inputWidth
|
||||
})
|
||||
}
|
||||
|
||||
//监听body点击事件
|
||||
useEventListener(document.body, 'click', () => {
|
||||
state.popoverVisible = state.inputFocus || state.mouseoverSelect ? true : false
|
||||
})
|
||||
|
||||
watch(
|
||||
() => state.popoverVisible,
|
||||
async (value) => {
|
||||
await nextTick()
|
||||
if (value) {
|
||||
inputRef.value?.focus()
|
||||
} else {
|
||||
inputRef.value?.blur()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
getInputWidth()
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
<template>
|
||||
<svg aria-hidden="true" :style="styles">
|
||||
<use :xlink:href="symbolId" fill="currentColor" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { addUnit } from '@/utils/util'
|
||||
import type { CSSProperties } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
size: {
|
||||
type: [Number, String],
|
||||
default: 16
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: 'inherit'
|
||||
}
|
||||
},
|
||||
setup(props) {
|
||||
const symbolId = computed(() => `#${props.name}`)
|
||||
const styles = computed<CSSProperties>(() => {
|
||||
return {
|
||||
width: addUnit(props.size),
|
||||
height: addUnit(props.size),
|
||||
color: props.color
|
||||
}
|
||||
})
|
||||
return { symbolId, styles }
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<svg aria-hidden="true" :style="styles">
|
||||
<use :xlink:href="symbolId" fill="currentColor" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { addUnit } from '@/utils/util'
|
||||
import type { CSSProperties } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
size: {
|
||||
type: [Number, String],
|
||||
default: 16
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: 'inherit'
|
||||
}
|
||||
},
|
||||
setup(props) {
|
||||
const symbolId = computed(() => `#${props.name}`)
|
||||
const styles = computed<CSSProperties>(() => {
|
||||
return {
|
||||
width: addUnit(props.size),
|
||||
height: addUnit(props.size),
|
||||
color: props.color
|
||||
}
|
||||
})
|
||||
return { symbolId, styles }
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
<template>
|
||||
<el-image :style="styles" v-bind="props"> </el-image>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
import type { CSSProperties } from 'vue'
|
||||
import { addUnit } from '@/utils/util'
|
||||
import { imageProps } from 'element-plus'
|
||||
const props = defineProps({
|
||||
width: {
|
||||
type: [String, Number],
|
||||
default: 'auto'
|
||||
},
|
||||
height: {
|
||||
type: [String, Number],
|
||||
default: 'auto'
|
||||
},
|
||||
radius: {
|
||||
type: [String, Number],
|
||||
default: 0
|
||||
},
|
||||
...imageProps
|
||||
})
|
||||
|
||||
const styles = computed<CSSProperties>(() => {
|
||||
return {
|
||||
width: addUnit(props.width),
|
||||
height: addUnit(props.height),
|
||||
borderRadius: addUnit(props.radius)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-image {
|
||||
display: block;
|
||||
.el-image__error {
|
||||
@apply text-xs;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<el-image :style="styles" v-bind="props"> </el-image>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
import type { CSSProperties } from 'vue'
|
||||
import { addUnit } from '@/utils/util'
|
||||
import { imageProps } from 'element-plus'
|
||||
const props = defineProps({
|
||||
width: {
|
||||
type: [String, Number],
|
||||
default: 'auto'
|
||||
},
|
||||
height: {
|
||||
type: [String, Number],
|
||||
default: 'auto'
|
||||
},
|
||||
radius: {
|
||||
type: [String, Number],
|
||||
default: 0
|
||||
},
|
||||
...imageProps
|
||||
})
|
||||
|
||||
const styles = computed<CSSProperties>(() => {
|
||||
return {
|
||||
width: addUnit(props.width),
|
||||
height: addUnit(props.height),
|
||||
borderRadius: addUnit(props.radius)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-image {
|
||||
display: block;
|
||||
.el-image__error {
|
||||
@apply text-xs;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
<template>
|
||||
<div class="custom-link mt-[30px]">
|
||||
<div class="flex flex-wrap items-center">
|
||||
自定义链接
|
||||
<div class="ml-4 flex-1 min-w-[100px]">
|
||||
<el-input
|
||||
:model-value="modelValue.query?.url"
|
||||
placeholder="请输入链接地址"
|
||||
@input="handleInput"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-tips">
|
||||
请填写完整的带有“https://”或“http://”的链接地址,链接的域名必须在微信公众平台设置业务域名
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from 'vue'
|
||||
import { LinkTypeEnum, type Link } from '.'
|
||||
|
||||
defineProps({
|
||||
modelValue: {
|
||||
type: Object as PropType<Link>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: Link): void
|
||||
}>()
|
||||
|
||||
const handleInput = (value: string) => {
|
||||
emit('update:modelValue', {
|
||||
path: '/pages/webview/webview',
|
||||
query: {
|
||||
url: value
|
||||
},
|
||||
type: LinkTypeEnum.CUSTOM_LINK
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="custom-link mt-[30px]">
|
||||
<div class="flex flex-wrap items-center">
|
||||
自定义链接
|
||||
<div class="ml-4 flex-1 min-w-[100px]">
|
||||
<el-input
|
||||
:model-value="modelValue.query?.url"
|
||||
placeholder="请输入链接地址"
|
||||
@input="handleInput"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-tips">
|
||||
请填写完整的带有“https://”或“http://”的链接地址,链接的域名必须在微信公众平台设置业务域名
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from 'vue'
|
||||
import { LinkTypeEnum, type Link } from '.'
|
||||
|
||||
defineProps({
|
||||
modelValue: {
|
||||
type: Object as PropType<Link>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: Link): void
|
||||
}>()
|
||||
|
||||
const handleInput = (value: string) => {
|
||||
emit('update:modelValue', {
|
||||
path: '/pages/webview/webview',
|
||||
query: {
|
||||
url: value
|
||||
},
|
||||
type: LinkTypeEnum.CUSTOM_LINK
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
export enum LinkTypeEnum {
|
||||
'SHOP_PAGES' = 'shop',
|
||||
'CUSTOM_LINK' = 'custom'
|
||||
}
|
||||
|
||||
export interface Link {
|
||||
path: string
|
||||
name?: string
|
||||
type: string
|
||||
query?: Record<string, any>
|
||||
}
|
||||
export enum LinkTypeEnum {
|
||||
'SHOP_PAGES' = 'shop',
|
||||
'CUSTOM_LINK' = 'custom'
|
||||
}
|
||||
|
||||
export interface Link {
|
||||
path: string
|
||||
name?: string
|
||||
type: string
|
||||
query?: Record<string, any>
|
||||
}
|
||||
|
|
|
@ -1,96 +1,96 @@
|
|||
<template>
|
||||
<div class="link flex">
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
class="w-[160px] min-h-[350px] link-menu"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<el-menu-item v-for="(item, index) in menus" :index="item.type" :key="index">
|
||||
<span>{{ item.name }}</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
<div class="flex-1 pl-4">
|
||||
<shop-pages v-model="activeLink" v-if="LinkTypeEnum.SHOP_PAGES == activeMenu" />
|
||||
<custom-link v-model="activeLink" v-if="LinkTypeEnum.CUSTOM_LINK == activeMenu" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from 'vue'
|
||||
import { LinkTypeEnum, type Link } from '.'
|
||||
import ShopPages from './shop-pages.vue'
|
||||
import CustomLink from './custom-link.vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Object as PropType<Link>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: any): void
|
||||
}>()
|
||||
|
||||
const menus = ref([
|
||||
{
|
||||
name: '商城页面',
|
||||
type: LinkTypeEnum.SHOP_PAGES,
|
||||
link: {}
|
||||
},
|
||||
{
|
||||
name: '自定义链接',
|
||||
type: LinkTypeEnum.CUSTOM_LINK,
|
||||
link: {}
|
||||
}
|
||||
])
|
||||
|
||||
const activeLink = computed({
|
||||
get() {
|
||||
return menus.value.find((item) => item.type == activeMenu.value)?.link as Link
|
||||
},
|
||||
set(value) {
|
||||
menus.value.forEach((item) => {
|
||||
if (item.type == activeMenu.value) {
|
||||
item.link = value
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const activeMenu = ref<string>(LinkTypeEnum.SHOP_PAGES)
|
||||
|
||||
const handleSelect = (index: string) => {
|
||||
activeMenu.value = index
|
||||
}
|
||||
|
||||
watch(activeLink, (value) => {
|
||||
if (!value.type) return
|
||||
emit('update:modelValue', value)
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(value) => {
|
||||
activeMenu.value = value.type
|
||||
activeLink.value = value
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.link-menu {
|
||||
--el-menu-item-height: 40px;
|
||||
:deep(.el-menu-item) {
|
||||
border-color: transparent;
|
||||
&.is-active {
|
||||
border-right-width: 2px;
|
||||
border-color: var(--el-color-primary);
|
||||
background-color: var(--el-color-primary-light-9);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="link flex">
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
class="w-[160px] min-h-[350px] link-menu"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<el-menu-item v-for="(item, index) in menus" :index="item.type" :key="index">
|
||||
<span>{{ item.name }}</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
<div class="flex-1 pl-4">
|
||||
<shop-pages v-model="activeLink" v-if="LinkTypeEnum.SHOP_PAGES == activeMenu" />
|
||||
<custom-link v-model="activeLink" v-if="LinkTypeEnum.CUSTOM_LINK == activeMenu" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from 'vue'
|
||||
import { LinkTypeEnum, type Link } from '.'
|
||||
import ShopPages from './shop-pages.vue'
|
||||
import CustomLink from './custom-link.vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Object as PropType<Link>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: any): void
|
||||
}>()
|
||||
|
||||
const menus = ref([
|
||||
{
|
||||
name: '商城页面',
|
||||
type: LinkTypeEnum.SHOP_PAGES,
|
||||
link: {}
|
||||
},
|
||||
{
|
||||
name: '自定义链接',
|
||||
type: LinkTypeEnum.CUSTOM_LINK,
|
||||
link: {}
|
||||
}
|
||||
])
|
||||
|
||||
const activeLink = computed({
|
||||
get() {
|
||||
return menus.value.find((item) => item.type == activeMenu.value)?.link as Link
|
||||
},
|
||||
set(value) {
|
||||
menus.value.forEach((item) => {
|
||||
if (item.type == activeMenu.value) {
|
||||
item.link = value
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const activeMenu = ref<string>(LinkTypeEnum.SHOP_PAGES)
|
||||
|
||||
const handleSelect = (index: string) => {
|
||||
activeMenu.value = index
|
||||
}
|
||||
|
||||
watch(activeLink, (value) => {
|
||||
if (!value.type) return
|
||||
emit('update:modelValue', value)
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(value) => {
|
||||
activeMenu.value = value.type
|
||||
activeLink.value = value
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.link-menu {
|
||||
--el-menu-item-height: 40px;
|
||||
:deep(.el-menu-item) {
|
||||
border-color: transparent;
|
||||
&.is-active {
|
||||
border-right-width: 2px;
|
||||
border-color: var(--el-color-primary);
|
||||
background-color: var(--el-color-primary-light-9);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,84 +1,84 @@
|
|||
<template>
|
||||
<div class="link-picker flex-1" @click="!disabled && popupRef?.open()">
|
||||
<el-input :model-value="getLink" placeholder="请选择链接" readonly :disabled="disabled">
|
||||
<template #suffix>
|
||||
<icon v-if="!modelValue?.path" name="el-icon-ArrowRight" />
|
||||
<icon
|
||||
v-else
|
||||
name="el-icon-Close"
|
||||
@click.stop="!disabled && emit('update:modelValue', {})"
|
||||
/>
|
||||
</template>
|
||||
</el-input>
|
||||
<popup ref="popupRef" width="700px" title="链接选择" @confirm="handleConfirm">
|
||||
<link-content v-model="activeLink" />
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { LinkTypeEnum, type Link } from '.'
|
||||
import LinkContent from './index.vue'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Object
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: any): void
|
||||
}>()
|
||||
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const activeLink = ref<Link>({ path: '', type: LinkTypeEnum.SHOP_PAGES })
|
||||
const handleConfirm = () => {
|
||||
emit('update:modelValue', activeLink.value)
|
||||
}
|
||||
|
||||
const getLink = computed(() => {
|
||||
switch (props.modelValue?.type) {
|
||||
case LinkTypeEnum.SHOP_PAGES:
|
||||
return props.modelValue.name
|
||||
case LinkTypeEnum.CUSTOM_LINK:
|
||||
return props.modelValue.query?.url
|
||||
default:
|
||||
return props.modelValue?.name
|
||||
}
|
||||
})
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(value) => {
|
||||
if (value?.type) {
|
||||
activeLink.value = value as Link
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.link-picker {
|
||||
:deep(.el-input) {
|
||||
&.is-disabled {
|
||||
.el-input__inner {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.el-input__suffix {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
.el-input__inner {
|
||||
cursor: pointer;
|
||||
}
|
||||
.el-input__suffix {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="link-picker flex-1" @click="!disabled && popupRef?.open()">
|
||||
<el-input :model-value="getLink" placeholder="请选择链接" readonly :disabled="disabled">
|
||||
<template #suffix>
|
||||
<icon v-if="!modelValue?.path" name="el-icon-ArrowRight" />
|
||||
<icon
|
||||
v-else
|
||||
name="el-icon-Close"
|
||||
@click.stop="!disabled && emit('update:modelValue', {})"
|
||||
/>
|
||||
</template>
|
||||
</el-input>
|
||||
<popup ref="popupRef" width="700px" title="链接选择" @confirm="handleConfirm">
|
||||
<link-content v-model="activeLink" />
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { LinkTypeEnum, type Link } from '.'
|
||||
import LinkContent from './index.vue'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Object
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: any): void
|
||||
}>()
|
||||
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const activeLink = ref<Link>({ path: '', type: LinkTypeEnum.SHOP_PAGES })
|
||||
const handleConfirm = () => {
|
||||
emit('update:modelValue', activeLink.value)
|
||||
}
|
||||
|
||||
const getLink = computed(() => {
|
||||
switch (props.modelValue?.type) {
|
||||
case LinkTypeEnum.SHOP_PAGES:
|
||||
return props.modelValue.name
|
||||
case LinkTypeEnum.CUSTOM_LINK:
|
||||
return props.modelValue.query?.url
|
||||
default:
|
||||
return props.modelValue?.name
|
||||
}
|
||||
})
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(value) => {
|
||||
if (value?.type) {
|
||||
activeLink.value = value as Link
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.link-picker {
|
||||
:deep(.el-input) {
|
||||
&.is-disabled {
|
||||
.el-input__inner {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.el-input__suffix {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
.el-input__inner {
|
||||
cursor: pointer;
|
||||
}
|
||||
.el-input__suffix {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,106 +1,106 @@
|
|||
<template>
|
||||
<div class="shop-pages">
|
||||
<div class="link-list flex flex-wrap">
|
||||
<div
|
||||
class="link-item border border-br px-5 py-[5px] rounded-[3px] cursor-pointer mr-[10px] mb-[10px]"
|
||||
v-for="(item, index) in linkList"
|
||||
:class="{
|
||||
'border-primary text-primary':
|
||||
modelValue.path == item.path && modelValue.name == item.name
|
||||
}"
|
||||
:key="index"
|
||||
@click="handleSelect(item)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from 'vue'
|
||||
import { LinkTypeEnum, type Link } from '.'
|
||||
|
||||
defineProps({
|
||||
modelValue: {
|
||||
type: Object as PropType<Link>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: Link): void
|
||||
}>()
|
||||
|
||||
const linkList = ref([
|
||||
{
|
||||
path: '/pages/index/index',
|
||||
name: '商城首页',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/news/news',
|
||||
name: '文章资讯',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/user/user',
|
||||
name: '个人中心',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/collection/collection',
|
||||
name: '我的收藏',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/customer_service/customer_service',
|
||||
name: '联系客服',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/user_set/user_set',
|
||||
name: '个人设置',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/as_us/as_us',
|
||||
name: '关于我们',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/user_data/user_data',
|
||||
name: '个人资料',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/agreement/agreement',
|
||||
name: '隐私政策',
|
||||
query: {
|
||||
type: 'privacy'
|
||||
},
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/agreement/agreement',
|
||||
name: '服务协议',
|
||||
query: {
|
||||
type: 'service'
|
||||
},
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/search/search',
|
||||
name: '搜索',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/packages/pages/user_wallet/user_wallet',
|
||||
name: '我的钱包',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
}
|
||||
])
|
||||
|
||||
const handleSelect = (value: Link) => {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="shop-pages">
|
||||
<div class="link-list flex flex-wrap">
|
||||
<div
|
||||
class="link-item border border-br px-5 py-[5px] rounded-[3px] cursor-pointer mr-[10px] mb-[10px]"
|
||||
v-for="(item, index) in linkList"
|
||||
:class="{
|
||||
'border-primary text-primary':
|
||||
modelValue.path == item.path && modelValue.name == item.name
|
||||
}"
|
||||
:key="index"
|
||||
@click="handleSelect(item)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from 'vue'
|
||||
import { LinkTypeEnum, type Link } from '.'
|
||||
|
||||
defineProps({
|
||||
modelValue: {
|
||||
type: Object as PropType<Link>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: Link): void
|
||||
}>()
|
||||
|
||||
const linkList = ref([
|
||||
{
|
||||
path: '/pages/index/index',
|
||||
name: '商城首页',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/news/news',
|
||||
name: '文章资讯',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/user/user',
|
||||
name: '个人中心',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/collection/collection',
|
||||
name: '我的收藏',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/customer_service/customer_service',
|
||||
name: '联系客服',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/user_set/user_set',
|
||||
name: '个人设置',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/as_us/as_us',
|
||||
name: '关于我们',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/user_data/user_data',
|
||||
name: '个人资料',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/agreement/agreement',
|
||||
name: '隐私政策',
|
||||
query: {
|
||||
type: 'privacy'
|
||||
},
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/agreement/agreement',
|
||||
name: '服务协议',
|
||||
query: {
|
||||
type: 'service'
|
||||
},
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/pages/search/search',
|
||||
name: '搜索',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
},
|
||||
{
|
||||
path: '/packages/pages/user_wallet/user_wallet',
|
||||
name: '我的钱包',
|
||||
type: LinkTypeEnum.SHOP_PAGES
|
||||
}
|
||||
])
|
||||
|
||||
const handleSelect = (value: Link) => {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,159 @@
|
|||
<template>
|
||||
<div id="container" ref="map"></div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="mapContainer">
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import { shallowRef } from "@vue/reactivity";
|
||||
|
||||
const map = shallowRef(null);
|
||||
let AMap: any = null;
|
||||
let markerList: Array<any> = [];
|
||||
let m_index: Number = 0;
|
||||
let geocoder: any = null;
|
||||
let marker: any = null;
|
||||
|
||||
const emits = defineEmits(["changeMaps"]);
|
||||
|
||||
const resetMap = () => {
|
||||
try {
|
||||
markerList = [];
|
||||
map.value?.clearMap();
|
||||
m_index = 0;
|
||||
emits("changeMaps", markerList);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
const initMap = async () => {
|
||||
const loader = AMapLoader.load({
|
||||
key: "4f8f55618010007147aab96fc72bb408",
|
||||
version: "2.0",
|
||||
});
|
||||
|
||||
AMap = await loader;
|
||||
|
||||
map.value = new AMap.Map("container", {
|
||||
zoom: 13,
|
||||
viewMode: "2D",
|
||||
center: [105.4423, 28.8717],
|
||||
});
|
||||
|
||||
AMap.plugin("AMap.Geocoder", function () {
|
||||
geocoder = new AMap.Geocoder({
|
||||
radius: 10, // 逆地理编码范围,默认值:1000,单位:米
|
||||
extensions: "all", // 返回地址描述结果时是否包含引擎内置的POI,默认值:base,可选值:base、all
|
||||
}); // 经纬度数组
|
||||
});
|
||||
|
||||
AMap.plugin("AMap.Geolocation", function () {
|
||||
let geolocation = new AMap.Geolocation({
|
||||
enableHighAccuracy: true, // 是否使用高精度定位,默认:true
|
||||
timeout: 10000, // 超过1秒后停止定位,默认:无穷大
|
||||
buttonPosition: "RB", // 定位按钮的停靠位置
|
||||
zoomToAccuracy: true, // 定位成功后是否自动调整地图视野到定位点
|
||||
});
|
||||
|
||||
map.value.addControl(geolocation);
|
||||
|
||||
// geolocation.getCurrentPosition(function (status, result) {
|
||||
// console.log(status, result);
|
||||
// });
|
||||
});
|
||||
|
||||
map.value.setFitView();
|
||||
|
||||
map.value.on("click", (e: any) => {
|
||||
// if (m_index >= 1) return;
|
||||
if (m_index >= 1) {
|
||||
map.value?.remove(marker);
|
||||
m_index = 0;
|
||||
}
|
||||
// 调用函数并传入经纬度
|
||||
getDistrictName(e.lnglat.lng, e.lnglat.lat, e);
|
||||
|
||||
// 创建标记并添加到地图
|
||||
marker = new AMap.Marker({
|
||||
position: e.lnglat,
|
||||
offset: new AMap.Pixel(0, 0),
|
||||
title: "位置",
|
||||
});
|
||||
map.value.add(marker);
|
||||
m_index++;
|
||||
|
||||
// 添加标记点击事件监听器
|
||||
marker.on("click", (event: any) => {
|
||||
// markerList = markerList.filter((item: any) => {
|
||||
// item[0] == marker._position.pos[0] &&
|
||||
// item[0] == marker._position.pos[0];
|
||||
// });
|
||||
markerList = [];
|
||||
emits("changeMaps", markerList);
|
||||
map.value.remove(marker);
|
||||
m_index--;
|
||||
marker = null;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const searchMap = (address: any) => {
|
||||
// ElMessage.error("搜索功能开发中");
|
||||
AMap.plugin("AMap.PlaceSearch", async function () {
|
||||
try {
|
||||
const placeSearch = new AMap.PlaceSearch({
|
||||
pageSize: 5, // 单页显示结果条数
|
||||
pageIndex: 1, // 页码
|
||||
city: "510500", // 兴趣点城市
|
||||
citylimit: true, //是否强制限制在设置的城市内搜索
|
||||
map: map.value, // 展现结果的地图实例
|
||||
panel: false, // 结果列表将在此容器中进行展示。
|
||||
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
|
||||
});
|
||||
AMap.Event.addListener(placeSearch, "markerClick", (e: any) => {
|
||||
marker ? map.value?.remove(marker) : null;
|
||||
getDistrictName(e.event.lnglat.lng, e.event.lnglat.lat, e.event);
|
||||
});
|
||||
placeSearch.search(address);
|
||||
} catch (error) {
|
||||
ElMessage.error("没找到");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 获取地区名称
|
||||
const getDistrictName = (lng: any, lat: any, e: any) => {
|
||||
geocoder.getAddress([lng, lat], function (status: any, result: any) {
|
||||
if (status === "complete" && result.info === "OK") {
|
||||
markerList = [];
|
||||
markerList.push({
|
||||
lnglat: e.lnglat,
|
||||
address: result.regeocode.formattedAddress,
|
||||
});
|
||||
emits("changeMaps", markerList);
|
||||
} else {
|
||||
// 解析失败
|
||||
ElMessage.error("逆地理编码失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
resetMap,
|
||||
searchMap,
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
initMap();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
#container {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
|
@ -1,55 +1,55 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="file-item relative" :style="{ height: fileSize, width: fileSize }">
|
||||
<el-image class="image" v-if="type == 'image'" fit="contain" :src="uri"></el-image>
|
||||
<video class="video" v-else-if="type == 'video'" :src="uri"></video>
|
||||
<div
|
||||
v-if="type == 'video'"
|
||||
class="absolute left-1/2 top-1/2 translate-x-[-50%] translate-y-[-50%] rounded-full w-5 h-5 flex justify-center items-center bg-[rgba(0,0,0,0.3)]"
|
||||
>
|
||||
<icon name="el-icon-CaretRight" :size="18" color="#fff" />
|
||||
</div>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
export default defineComponent({
|
||||
props: {
|
||||
// 图片地址
|
||||
uri: {
|
||||
type: String
|
||||
},
|
||||
// 图片尺寸
|
||||
fileSize: {
|
||||
type: String,
|
||||
default: '100px'
|
||||
},
|
||||
// 文件类型
|
||||
type: {
|
||||
type: String,
|
||||
default: 'image'
|
||||
}
|
||||
},
|
||||
emits: ['close']
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.file-item {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
@apply bg-br-extra-light border border-br-extra-light;
|
||||
.image,
|
||||
.video {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div>
|
||||
<div class="file-item relative" :style="{ height: fileSize, width: fileSize }">
|
||||
<el-image class="image" v-if="type == 'image'" fit="contain" :src="uri"></el-image>
|
||||
<video class="video" v-else-if="type == 'video'" :src="uri"></video>
|
||||
<div
|
||||
v-if="type == 'video'"
|
||||
class="absolute left-1/2 top-1/2 translate-x-[-50%] translate-y-[-50%] rounded-full w-5 h-5 flex justify-center items-center bg-[rgba(0,0,0,0.3)]"
|
||||
>
|
||||
<icon name="el-icon-CaretRight" :size="18" color="#fff" />
|
||||
</div>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
export default defineComponent({
|
||||
props: {
|
||||
// 图片地址
|
||||
uri: {
|
||||
type: String
|
||||
},
|
||||
// 图片尺寸
|
||||
fileSize: {
|
||||
type: String,
|
||||
default: '100px'
|
||||
},
|
||||
// 文件类型
|
||||
type: {
|
||||
type: String,
|
||||
default: 'image'
|
||||
}
|
||||
},
|
||||
emits: ['close']
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.file-item {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
@apply bg-br-extra-light border border-br-extra-light;
|
||||
.image,
|
||||
.video {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,209 +1,209 @@
|
|||
import {
|
||||
fileCateAdd,
|
||||
fileCateDelete,
|
||||
fileCateEdit,
|
||||
fileCateLists,
|
||||
fileDelete,
|
||||
fileList,
|
||||
fileMove,
|
||||
fileRename
|
||||
} from '@/api/file'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import feedback from '@/utils/feedback'
|
||||
import { ElMessage, ElTree, type CheckboxValueType } from 'element-plus'
|
||||
import { shallowRef, type Ref } from 'vue'
|
||||
|
||||
// 左侧分组的钩子函数
|
||||
export function useCate(type: number) {
|
||||
const treeRef = shallowRef<InstanceType<typeof ElTree>>()
|
||||
// 分组列表
|
||||
const cateLists = ref<any[]>([])
|
||||
|
||||
// 选中的分组id
|
||||
const cateId = ref<number | string>('')
|
||||
|
||||
// 获取分组列表
|
||||
const getCateLists = async () => {
|
||||
const data = await fileCateLists({
|
||||
page_type: 0,
|
||||
type
|
||||
})
|
||||
const item: any[] = [
|
||||
{
|
||||
name: '全部',
|
||||
id: ''
|
||||
},
|
||||
{
|
||||
name: '未分组',
|
||||
id: 0
|
||||
}
|
||||
]
|
||||
cateLists.value = data.lists
|
||||
cateLists.value.unshift(...item)
|
||||
setTimeout(() => {
|
||||
treeRef.value?.setCurrentKey(cateId.value)
|
||||
}, 0)
|
||||
}
|
||||
|
||||
// 添加分组
|
||||
const handleAddCate = async (value: string) => {
|
||||
await fileCateAdd({
|
||||
type,
|
||||
name: value,
|
||||
pid: 0
|
||||
})
|
||||
getCateLists()
|
||||
}
|
||||
|
||||
// 编辑分组
|
||||
const handleEditCate = async (value: string, id: number) => {
|
||||
await fileCateEdit({
|
||||
id,
|
||||
name: value
|
||||
})
|
||||
getCateLists()
|
||||
}
|
||||
|
||||
// 删除分组
|
||||
const handleDeleteCate = async (id: number) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await fileCateDelete({ id })
|
||||
cateId.value = ''
|
||||
getCateLists()
|
||||
}
|
||||
|
||||
//选中分类
|
||||
const handleCatSelect = (item: any) => {
|
||||
cateId.value = item.id
|
||||
}
|
||||
|
||||
return {
|
||||
treeRef,
|
||||
cateId,
|
||||
cateLists,
|
||||
handleAddCate,
|
||||
handleEditCate,
|
||||
handleDeleteCate,
|
||||
getCateLists,
|
||||
handleCatSelect
|
||||
}
|
||||
}
|
||||
|
||||
// 处理文件的钩子函数
|
||||
export function useFile(
|
||||
cateId: Ref<string | number>,
|
||||
type: Ref<number>,
|
||||
limit: Ref<number>,
|
||||
size: number
|
||||
) {
|
||||
const tableRef = shallowRef()
|
||||
const listShowType = ref('normal')
|
||||
const moveId = ref(0)
|
||||
const select = ref<any[]>([])
|
||||
const isCheckAll = ref(false)
|
||||
const isIndeterminate = ref(false)
|
||||
const fileParams = reactive({
|
||||
name: '',
|
||||
type: type,
|
||||
cid: cateId
|
||||
})
|
||||
const { pager, getLists, resetPage } = usePaging({
|
||||
fetchFun: fileList,
|
||||
params: fileParams,
|
||||
firstLoading: true,
|
||||
size
|
||||
})
|
||||
|
||||
const getFileList = () => {
|
||||
getLists()
|
||||
}
|
||||
const refresh = () => {
|
||||
resetPage()
|
||||
}
|
||||
|
||||
const isSelect = (id: number) => {
|
||||
return !!select.value.find((item: any) => item.id == id)
|
||||
}
|
||||
|
||||
const batchFileDelete = async (id?: number[]) => {
|
||||
await feedback.confirm(
|
||||
'确认删除后,本地或云存储文件也将同步删除,如文件已被使用,请谨慎操作!'
|
||||
)
|
||||
const ids = id ? id : select.value.map((item: any) => item.id)
|
||||
await fileDelete({ ids })
|
||||
getFileList()
|
||||
clearSelect()
|
||||
}
|
||||
|
||||
const batchFileMove = async () => {
|
||||
const ids = select.value.map((item: any) => item.id)
|
||||
await fileMove({ ids, cid: moveId.value })
|
||||
moveId.value = 0
|
||||
getFileList()
|
||||
clearSelect()
|
||||
}
|
||||
|
||||
const selectFile = (item: any) => {
|
||||
const index = select.value.findIndex((items: any) => items.id == item.id)
|
||||
if (index != -1) {
|
||||
select.value.splice(index, 1)
|
||||
return
|
||||
}
|
||||
if (select.value.length == limit.value) {
|
||||
if (limit.value == 1) {
|
||||
select.value = []
|
||||
select.value.push(item)
|
||||
return
|
||||
}
|
||||
ElMessage.warning('已达到选择上限')
|
||||
return
|
||||
}
|
||||
select.value.push(item)
|
||||
}
|
||||
|
||||
const clearSelect = () => {
|
||||
select.value = []
|
||||
}
|
||||
|
||||
const cancelSelete = (id: number) => {
|
||||
select.value = select.value.filter((item: any) => item.id != id)
|
||||
}
|
||||
|
||||
const selectAll = (value: CheckboxValueType) => {
|
||||
isIndeterminate.value = false
|
||||
tableRef.value?.toggleAllSelection()
|
||||
if (value) {
|
||||
select.value = [...pager.lists]
|
||||
return
|
||||
}
|
||||
clearSelect()
|
||||
}
|
||||
|
||||
const handleFileRename = async (name: string, id: number) => {
|
||||
await fileRename({
|
||||
id,
|
||||
name
|
||||
})
|
||||
getFileList()
|
||||
}
|
||||
return {
|
||||
listShowType,
|
||||
tableRef,
|
||||
moveId,
|
||||
pager,
|
||||
fileParams,
|
||||
select,
|
||||
isCheckAll,
|
||||
isIndeterminate,
|
||||
getFileList,
|
||||
refresh,
|
||||
batchFileDelete,
|
||||
batchFileMove,
|
||||
selectFile,
|
||||
isSelect,
|
||||
clearSelect,
|
||||
cancelSelete,
|
||||
selectAll,
|
||||
handleFileRename
|
||||
}
|
||||
}
|
||||
import {
|
||||
fileCateAdd,
|
||||
fileCateDelete,
|
||||
fileCateEdit,
|
||||
fileCateLists,
|
||||
fileDelete,
|
||||
fileList,
|
||||
fileMove,
|
||||
fileRename
|
||||
} from '@/api/file'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import feedback from '@/utils/feedback'
|
||||
import { ElMessage, ElTree, type CheckboxValueType } from 'element-plus'
|
||||
import { shallowRef, type Ref } from 'vue'
|
||||
|
||||
// 左侧分组的钩子函数
|
||||
export function useCate(type: number) {
|
||||
const treeRef = shallowRef<InstanceType<typeof ElTree>>()
|
||||
// 分组列表
|
||||
const cateLists = ref<any[]>([])
|
||||
|
||||
// 选中的分组id
|
||||
const cateId = ref<number | string>('')
|
||||
|
||||
// 获取分组列表
|
||||
const getCateLists = async () => {
|
||||
const data = await fileCateLists({
|
||||
page_type: 0,
|
||||
type
|
||||
})
|
||||
const item: any[] = [
|
||||
{
|
||||
name: '全部',
|
||||
id: ''
|
||||
},
|
||||
{
|
||||
name: '未分组',
|
||||
id: 0
|
||||
}
|
||||
]
|
||||
cateLists.value = data.lists
|
||||
cateLists.value.unshift(...item)
|
||||
setTimeout(() => {
|
||||
treeRef.value?.setCurrentKey(cateId.value)
|
||||
}, 0)
|
||||
}
|
||||
|
||||
// 添加分组
|
||||
const handleAddCate = async (value: string) => {
|
||||
await fileCateAdd({
|
||||
type,
|
||||
name: value,
|
||||
pid: 0
|
||||
})
|
||||
getCateLists()
|
||||
}
|
||||
|
||||
// 编辑分组
|
||||
const handleEditCate = async (value: string, id: number) => {
|
||||
await fileCateEdit({
|
||||
id,
|
||||
name: value
|
||||
})
|
||||
getCateLists()
|
||||
}
|
||||
|
||||
// 删除分组
|
||||
const handleDeleteCate = async (id: number) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await fileCateDelete({ id })
|
||||
cateId.value = ''
|
||||
getCateLists()
|
||||
}
|
||||
|
||||
//选中分类
|
||||
const handleCatSelect = (item: any) => {
|
||||
cateId.value = item.id
|
||||
}
|
||||
|
||||
return {
|
||||
treeRef,
|
||||
cateId,
|
||||
cateLists,
|
||||
handleAddCate,
|
||||
handleEditCate,
|
||||
handleDeleteCate,
|
||||
getCateLists,
|
||||
handleCatSelect
|
||||
}
|
||||
}
|
||||
|
||||
// 处理文件的钩子函数
|
||||
export function useFile(
|
||||
cateId: Ref<string | number>,
|
||||
type: Ref<number>,
|
||||
limit: Ref<number>,
|
||||
size: number
|
||||
) {
|
||||
const tableRef = shallowRef()
|
||||
const listShowType = ref('normal')
|
||||
const moveId = ref(0)
|
||||
const select = ref<any[]>([])
|
||||
const isCheckAll = ref(false)
|
||||
const isIndeterminate = ref(false)
|
||||
const fileParams = reactive({
|
||||
name: '',
|
||||
type: type,
|
||||
cid: cateId
|
||||
})
|
||||
const { pager, getLists, resetPage } = usePaging({
|
||||
fetchFun: fileList,
|
||||
params: fileParams,
|
||||
firstLoading: true,
|
||||
size
|
||||
})
|
||||
|
||||
const getFileList = () => {
|
||||
getLists()
|
||||
}
|
||||
const refresh = () => {
|
||||
resetPage()
|
||||
}
|
||||
|
||||
const isSelect = (id: number) => {
|
||||
return !!select.value.find((item: any) => item.id == id)
|
||||
}
|
||||
|
||||
const batchFileDelete = async (id?: number[]) => {
|
||||
await feedback.confirm(
|
||||
'确认删除后,本地或云存储文件也将同步删除,如文件已被使用,请谨慎操作!'
|
||||
)
|
||||
const ids = id ? id : select.value.map((item: any) => item.id)
|
||||
await fileDelete({ ids })
|
||||
getFileList()
|
||||
clearSelect()
|
||||
}
|
||||
|
||||
const batchFileMove = async () => {
|
||||
const ids = select.value.map((item: any) => item.id)
|
||||
await fileMove({ ids, cid: moveId.value })
|
||||
moveId.value = 0
|
||||
getFileList()
|
||||
clearSelect()
|
||||
}
|
||||
|
||||
const selectFile = (item: any) => {
|
||||
const index = select.value.findIndex((items: any) => items.id == item.id)
|
||||
if (index != -1) {
|
||||
select.value.splice(index, 1)
|
||||
return
|
||||
}
|
||||
if (select.value.length == limit.value) {
|
||||
if (limit.value == 1) {
|
||||
select.value = []
|
||||
select.value.push(item)
|
||||
return
|
||||
}
|
||||
ElMessage.warning('已达到选择上限')
|
||||
return
|
||||
}
|
||||
select.value.push(item)
|
||||
}
|
||||
|
||||
const clearSelect = () => {
|
||||
select.value = []
|
||||
}
|
||||
|
||||
const cancelSelete = (id: number) => {
|
||||
select.value = select.value.filter((item: any) => item.id != id)
|
||||
}
|
||||
|
||||
const selectAll = (value: CheckboxValueType) => {
|
||||
isIndeterminate.value = false
|
||||
tableRef.value?.toggleAllSelection()
|
||||
if (value) {
|
||||
select.value = [...pager.lists]
|
||||
return
|
||||
}
|
||||
clearSelect()
|
||||
}
|
||||
|
||||
const handleFileRename = async (name: string, id: number) => {
|
||||
await fileRename({
|
||||
id,
|
||||
name
|
||||
})
|
||||
getFileList()
|
||||
}
|
||||
return {
|
||||
listShowType,
|
||||
tableRef,
|
||||
moveId,
|
||||
pager,
|
||||
fileParams,
|
||||
select,
|
||||
isCheckAll,
|
||||
isIndeterminate,
|
||||
getFileList,
|
||||
refresh,
|
||||
batchFileDelete,
|
||||
batchFileMove,
|
||||
selectFile,
|
||||
isSelect,
|
||||
clearSelect,
|
||||
cancelSelete,
|
||||
selectAll,
|
||||
handleFileRename
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,303 +1,303 @@
|
|||
<template>
|
||||
<div class="material-select">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
width="830px"
|
||||
custom-class="body-padding"
|
||||
:title="`选择${tipsText}`"
|
||||
@confirm="handleConfirm"
|
||||
@close="handleClose"
|
||||
>
|
||||
<template v-if="!hiddenUpload" #trigger>
|
||||
<div class="material-select__trigger clearfix" @click.stop>
|
||||
<draggable class="draggable" v-model="fileList" animation="300" item-key="id">
|
||||
<template v-slot:item="{ element, index }">
|
||||
<div
|
||||
class="material-preview"
|
||||
:class="{
|
||||
'is-disabled': disabled,
|
||||
'is-one': limit == 1
|
||||
}"
|
||||
@click="showPopup(index)"
|
||||
>
|
||||
<del-wrap @close="deleteImg(index)">
|
||||
<file-item
|
||||
:uri="excludeDomain ? getImageUrl(element) : element"
|
||||
:file-size="size"
|
||||
:type="type"
|
||||
></file-item>
|
||||
</del-wrap>
|
||||
<div class="operation-btns text-xs text-center">
|
||||
<span>修改</span>
|
||||
|
|
||||
<span @click.stop="handlePreview(element)">查看</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
<div
|
||||
class="material-upload"
|
||||
@click="showPopup(-1)"
|
||||
v-show="showUpload"
|
||||
:class="{
|
||||
'is-disabled': disabled,
|
||||
'is-one': limit == 1,
|
||||
[uploadClass]: true
|
||||
}"
|
||||
>
|
||||
<slot name="upload">
|
||||
<div
|
||||
class="upload-btn"
|
||||
:style="{
|
||||
width: size,
|
||||
height: size
|
||||
}"
|
||||
>
|
||||
<icon :size="25" name="el-icon-Plus" />
|
||||
<span>添加</span>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-scrollbar>
|
||||
<div class="material-wrap">
|
||||
<material
|
||||
ref="materialRef"
|
||||
:type="type"
|
||||
:file-size="fileSize"
|
||||
:limit="meterialLimit"
|
||||
@change="selectChange"
|
||||
/>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</popup>
|
||||
<preview v-model="showPreview" :url="previewUrl" :type="type" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Draggable from 'vuedraggable'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import FileItem from './file.vue'
|
||||
import Material from './index.vue'
|
||||
import Preview from './preview.vue'
|
||||
import useAppStore from '@/stores/modules/app'
|
||||
import { useThrottleFn } from '@vueuse/core'
|
||||
export default defineComponent({
|
||||
components: {
|
||||
Popup,
|
||||
Draggable,
|
||||
FileItem,
|
||||
Material,
|
||||
Preview
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: [String, Array],
|
||||
default: () => []
|
||||
},
|
||||
// 文件类型
|
||||
type: {
|
||||
type: String,
|
||||
default: 'image'
|
||||
},
|
||||
// 选择器尺寸
|
||||
size: {
|
||||
type: String,
|
||||
default: '100px'
|
||||
},
|
||||
// 文件尺寸
|
||||
fileSize: {
|
||||
type: String,
|
||||
default: '100px'
|
||||
},
|
||||
// 选择数量限制
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
// 禁用选择
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 隐藏上传框*(目前在富文本中使用到)
|
||||
hiddenUpload: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
uploadClass: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//选择的url排出域名
|
||||
excludeDomain: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
emits: ['change', 'update:modelValue'],
|
||||
setup(props, { emit }) {
|
||||
const popupRef = ref<InstanceType<typeof Popup>>()
|
||||
const materialRef = ref<InstanceType<typeof Material>>()
|
||||
const previewUrl = ref('')
|
||||
const showPreview = ref(false)
|
||||
const fileList = ref<any[]>([])
|
||||
const select = ref<any[]>([])
|
||||
const isAdd = ref(true)
|
||||
const currentIndex = ref(-1)
|
||||
const { disabled, limit, modelValue } = toRefs(props)
|
||||
const { getImageUrl } = useAppStore()
|
||||
const tipsText = computed(() => {
|
||||
switch (props.type) {
|
||||
case 'image':
|
||||
return '图片'
|
||||
case 'video':
|
||||
return '视频'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
})
|
||||
|
||||
const showUpload = computed(() => {
|
||||
return props.limit - fileList.value.length > 0
|
||||
})
|
||||
const meterialLimit: any = computed(() => {
|
||||
if (!isAdd.value) {
|
||||
return 1
|
||||
}
|
||||
if (limit.value == -1) return null
|
||||
return limit.value - fileList.value.length
|
||||
})
|
||||
const handleConfirm = useThrottleFn(
|
||||
() => {
|
||||
const selectUri = select.value.map((item) =>
|
||||
props.excludeDomain ? item.url : item.uri
|
||||
)
|
||||
if (!isAdd.value) {
|
||||
fileList.value.splice(currentIndex.value, 1, selectUri.shift())
|
||||
} else {
|
||||
fileList.value = [...fileList.value, ...selectUri]
|
||||
}
|
||||
handleChange()
|
||||
},
|
||||
1000,
|
||||
false
|
||||
)
|
||||
const showPopup = (index: number) => {
|
||||
if (disabled.value) return
|
||||
if (index >= 0) {
|
||||
isAdd.value = false
|
||||
currentIndex.value = index
|
||||
} else {
|
||||
isAdd.value = true
|
||||
}
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const selectChange = (val: any[]) => {
|
||||
select.value = val
|
||||
}
|
||||
const handleChange = () => {
|
||||
const valueImg = limit.value != 1 ? fileList.value : fileList.value[0] || ''
|
||||
emit('update:modelValue', valueImg)
|
||||
emit('change', valueImg)
|
||||
handleClose()
|
||||
}
|
||||
|
||||
const deleteImg = (index: number) => {
|
||||
fileList.value.splice(index, 1)
|
||||
handleChange()
|
||||
}
|
||||
|
||||
const handlePreview = (url: string) => {
|
||||
previewUrl.value = url
|
||||
showPreview.value = true
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
nextTick(() => {
|
||||
if (props.hiddenUpload) fileList.value = []
|
||||
materialRef.value?.clearSelect()
|
||||
})
|
||||
}
|
||||
|
||||
watch(
|
||||
modelValue,
|
||||
(val: any[] | string) => {
|
||||
fileList.value = Array.isArray(val) ? val : val == '' ? [] : [val]
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
provide('limit', props.limit)
|
||||
provide('hiddenUpload', props.hiddenUpload)
|
||||
return {
|
||||
popupRef,
|
||||
materialRef,
|
||||
fileList,
|
||||
tipsText,
|
||||
handleConfirm,
|
||||
meterialLimit,
|
||||
showUpload,
|
||||
showPopup,
|
||||
selectChange,
|
||||
deleteImg,
|
||||
previewUrl,
|
||||
showPreview,
|
||||
handlePreview,
|
||||
handleClose,
|
||||
getImageUrl
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.material-select {
|
||||
.material-upload,
|
||||
.material-preview {
|
||||
position: relative;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
margin-right: 8px;
|
||||
margin-bottom: 8px;
|
||||
box-sizing: border-box;
|
||||
float: left;
|
||||
&.is-disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
&.is-one {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
&:hover {
|
||||
.operation-btns {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.operation-btns {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
border-radius: 4px;
|
||||
width: 100%;
|
||||
line-height: 2;
|
||||
color: #fff;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
}
|
||||
.material-upload {
|
||||
:deep(.upload-btn) {
|
||||
@apply text-tx-secondary box-border rounded border-br border-dashed border flex flex-col justify-center items-center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.material-wrap {
|
||||
min-width: 720px;
|
||||
height: 430px;
|
||||
@apply border-t border-b border-br;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="material-select">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
width="830px"
|
||||
custom-class="body-padding"
|
||||
:title="`选择${tipsText}`"
|
||||
@confirm="handleConfirm"
|
||||
@close="handleClose"
|
||||
>
|
||||
<template v-if="!hiddenUpload" #trigger>
|
||||
<div class="material-select__trigger clearfix" @click.stop>
|
||||
<draggable class="draggable" v-model="fileList" animation="300" item-key="id">
|
||||
<template v-slot:item="{ element, index }">
|
||||
<div
|
||||
class="material-preview"
|
||||
:class="{
|
||||
'is-disabled': disabled,
|
||||
'is-one': limit == 1
|
||||
}"
|
||||
@click="showPopup(index)"
|
||||
>
|
||||
<del-wrap @close="deleteImg(index)">
|
||||
<file-item
|
||||
:uri="excludeDomain ? getImageUrl(element) : element"
|
||||
:file-size="size"
|
||||
:type="type"
|
||||
></file-item>
|
||||
</del-wrap>
|
||||
<div class="operation-btns text-xs text-center">
|
||||
<span>修改</span>
|
||||
|
|
||||
<span @click.stop="handlePreview(element)">查看</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
<div
|
||||
class="material-upload"
|
||||
@click="showPopup(-1)"
|
||||
v-show="showUpload"
|
||||
:class="{
|
||||
'is-disabled': disabled,
|
||||
'is-one': limit == 1,
|
||||
[uploadClass]: true
|
||||
}"
|
||||
>
|
||||
<slot name="upload">
|
||||
<div
|
||||
class="upload-btn"
|
||||
:style="{
|
||||
width: size,
|
||||
height: size
|
||||
}"
|
||||
>
|
||||
<icon :size="25" name="el-icon-Plus" />
|
||||
<span>添加</span>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-scrollbar>
|
||||
<div class="material-wrap">
|
||||
<material
|
||||
ref="materialRef"
|
||||
:type="type"
|
||||
:file-size="fileSize"
|
||||
:limit="meterialLimit"
|
||||
@change="selectChange"
|
||||
/>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</popup>
|
||||
<preview v-model="showPreview" :url="previewUrl" :type="type" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Draggable from 'vuedraggable'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import FileItem from './file.vue'
|
||||
import Material from './index.vue'
|
||||
import Preview from './preview.vue'
|
||||
import useAppStore from '@/stores/modules/app'
|
||||
import { useThrottleFn } from '@vueuse/core'
|
||||
export default defineComponent({
|
||||
components: {
|
||||
Popup,
|
||||
Draggable,
|
||||
FileItem,
|
||||
Material,
|
||||
Preview
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: [String, Array],
|
||||
default: () => []
|
||||
},
|
||||
// 文件类型
|
||||
type: {
|
||||
type: String,
|
||||
default: 'image'
|
||||
},
|
||||
// 选择器尺寸
|
||||
size: {
|
||||
type: String,
|
||||
default: '100px'
|
||||
},
|
||||
// 文件尺寸
|
||||
fileSize: {
|
||||
type: String,
|
||||
default: '100px'
|
||||
},
|
||||
// 选择数量限制
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
// 禁用选择
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 隐藏上传框*(目前在富文本中使用到)
|
||||
hiddenUpload: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
uploadClass: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//选择的url排出域名
|
||||
excludeDomain: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
emits: ['change', 'update:modelValue'],
|
||||
setup(props, { emit }) {
|
||||
const popupRef = ref<InstanceType<typeof Popup>>()
|
||||
const materialRef = ref<InstanceType<typeof Material>>()
|
||||
const previewUrl = ref('')
|
||||
const showPreview = ref(false)
|
||||
const fileList = ref<any[]>([])
|
||||
const select = ref<any[]>([])
|
||||
const isAdd = ref(true)
|
||||
const currentIndex = ref(-1)
|
||||
const { disabled, limit, modelValue } = toRefs(props)
|
||||
const { getImageUrl } = useAppStore()
|
||||
const tipsText = computed(() => {
|
||||
switch (props.type) {
|
||||
case 'image':
|
||||
return '图片'
|
||||
case 'video':
|
||||
return '视频'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
})
|
||||
|
||||
const showUpload = computed(() => {
|
||||
return props.limit - fileList.value.length > 0
|
||||
})
|
||||
const meterialLimit: any = computed(() => {
|
||||
if (!isAdd.value) {
|
||||
return 1
|
||||
}
|
||||
if (limit.value == -1) return null
|
||||
return limit.value - fileList.value.length
|
||||
})
|
||||
const handleConfirm = useThrottleFn(
|
||||
() => {
|
||||
const selectUri = select.value.map((item) =>
|
||||
props.excludeDomain ? item.url : item.uri
|
||||
)
|
||||
if (!isAdd.value) {
|
||||
fileList.value.splice(currentIndex.value, 1, selectUri.shift())
|
||||
} else {
|
||||
fileList.value = [...fileList.value, ...selectUri]
|
||||
}
|
||||
handleChange()
|
||||
},
|
||||
1000,
|
||||
false
|
||||
)
|
||||
const showPopup = (index: number) => {
|
||||
if (disabled.value) return
|
||||
if (index >= 0) {
|
||||
isAdd.value = false
|
||||
currentIndex.value = index
|
||||
} else {
|
||||
isAdd.value = true
|
||||
}
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const selectChange = (val: any[]) => {
|
||||
select.value = val
|
||||
}
|
||||
const handleChange = () => {
|
||||
const valueImg = limit.value != 1 ? fileList.value : fileList.value[0] || ''
|
||||
emit('update:modelValue', valueImg)
|
||||
emit('change', valueImg)
|
||||
handleClose()
|
||||
}
|
||||
|
||||
const deleteImg = (index: number) => {
|
||||
fileList.value.splice(index, 1)
|
||||
handleChange()
|
||||
}
|
||||
|
||||
const handlePreview = (url: string) => {
|
||||
previewUrl.value = url
|
||||
showPreview.value = true
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
nextTick(() => {
|
||||
if (props.hiddenUpload) fileList.value = []
|
||||
materialRef.value?.clearSelect()
|
||||
})
|
||||
}
|
||||
|
||||
watch(
|
||||
modelValue,
|
||||
(val: any[] | string) => {
|
||||
fileList.value = Array.isArray(val) ? val : val == '' ? [] : [val]
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
provide('limit', props.limit)
|
||||
provide('hiddenUpload', props.hiddenUpload)
|
||||
return {
|
||||
popupRef,
|
||||
materialRef,
|
||||
fileList,
|
||||
tipsText,
|
||||
handleConfirm,
|
||||
meterialLimit,
|
||||
showUpload,
|
||||
showPopup,
|
||||
selectChange,
|
||||
deleteImg,
|
||||
previewUrl,
|
||||
showPreview,
|
||||
handlePreview,
|
||||
handleClose,
|
||||
getImageUrl
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.material-select {
|
||||
.material-upload,
|
||||
.material-preview {
|
||||
position: relative;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
margin-right: 8px;
|
||||
margin-bottom: 8px;
|
||||
box-sizing: border-box;
|
||||
float: left;
|
||||
&.is-disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
&.is-one {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
&:hover {
|
||||
.operation-btns {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.operation-btns {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
border-radius: 4px;
|
||||
width: 100%;
|
||||
line-height: 2;
|
||||
color: #fff;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
}
|
||||
.material-upload {
|
||||
:deep(.upload-btn) {
|
||||
@apply text-tx-secondary box-border rounded border-br border-dashed border flex flex-col justify-center items-center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.material-wrap {
|
||||
min-width: 720px;
|
||||
height: 430px;
|
||||
@apply border-t border-b border-br;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,72 +1,72 @@
|
|||
<template>
|
||||
<div v-show="modelValue">
|
||||
<div v-if="type == 'image'">
|
||||
<el-image-viewer
|
||||
v-if="previewLists.length"
|
||||
:url-list="previewLists"
|
||||
hide-on-click-modal
|
||||
@close="handleClose"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="type == 'video'">
|
||||
<el-dialog v-model="visible" width="740px" title="视频预览" :before-close="handleClose">
|
||||
<video-player ref="playerRef" :src="url" width="100%" height="450px" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'image'
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: boolean): void
|
||||
}>()
|
||||
|
||||
const playerRef = shallowRef()
|
||||
|
||||
const visible = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
|
||||
set(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
|
||||
const handleClose = () => {
|
||||
emit('update:modelValue', false)
|
||||
}
|
||||
|
||||
const previewLists = ref<any[]>([])
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(value) => {
|
||||
if (value) {
|
||||
nextTick(() => {
|
||||
previewLists.value = [props.url]
|
||||
playerRef.value?.play()
|
||||
})
|
||||
} else {
|
||||
nextTick(() => {
|
||||
previewLists.value = []
|
||||
playerRef.value?.pause()
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
<template>
|
||||
<div v-show="modelValue">
|
||||
<div v-if="type == 'image'">
|
||||
<el-image-viewer
|
||||
v-if="previewLists.length"
|
||||
:url-list="previewLists"
|
||||
hide-on-click-modal
|
||||
@close="handleClose"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="type == 'video'">
|
||||
<el-dialog v-model="visible" width="740px" title="视频预览" :before-close="handleClose">
|
||||
<video-player ref="playerRef" :src="url" width="100%" height="450px" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'image'
|
||||
}
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: boolean): void
|
||||
}>()
|
||||
|
||||
const playerRef = shallowRef()
|
||||
|
||||
const visible = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
|
||||
set(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
|
||||
const handleClose = () => {
|
||||
emit('update:modelValue', false)
|
||||
}
|
||||
|
||||
const previewLists = ref<any[]>([])
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(value) => {
|
||||
if (value) {
|
||||
nextTick(() => {
|
||||
previewLists.value = [props.url]
|
||||
playerRef.value?.play()
|
||||
})
|
||||
} else {
|
||||
nextTick(() => {
|
||||
previewLists.value = []
|
||||
playerRef.value?.pause()
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-tooltip v-bind="props" :disabled="disabled">
|
||||
<div
|
||||
ref="textRef"
|
||||
class="overflow-text truncate"
|
||||
:style="{ textOverflow: overfloType }"
|
||||
>
|
||||
{{ content }}
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useEventListener } from '@vueuse/core'
|
||||
import { useTooltipContentProps, type Placement } from 'element-plus'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
...useTooltipContentProps,
|
||||
teleported: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
placement: {
|
||||
type: String as PropType<Placement>,
|
||||
default: 'top'
|
||||
},
|
||||
overfloType: {
|
||||
type: String as PropType<'ellipsis' | 'unset' | 'clip'>,
|
||||
default: 'ellipsis'
|
||||
}
|
||||
})
|
||||
const textRef = shallowRef<HTMLElement>()
|
||||
const disabled = ref(false)
|
||||
|
||||
useEventListener(textRef, 'mouseenter', () => {
|
||||
if (textRef.value?.scrollWidth! > textRef.value?.offsetWidth!) {
|
||||
disabled.value = false
|
||||
} else {
|
||||
disabled.value = true
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
<template>
|
||||
<div>
|
||||
<el-tooltip v-bind="props" :disabled="disabled">
|
||||
<div
|
||||
ref="textRef"
|
||||
class="overflow-text truncate"
|
||||
:style="{ textOverflow: overfloType }"
|
||||
>
|
||||
{{ content }}
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useEventListener } from '@vueuse/core'
|
||||
import { useTooltipContentProps, type Placement } from 'element-plus'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
...useTooltipContentProps,
|
||||
teleported: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
placement: {
|
||||
type: String as PropType<Placement>,
|
||||
default: 'top'
|
||||
},
|
||||
overfloType: {
|
||||
type: String as PropType<'ellipsis' | 'unset' | 'clip'>,
|
||||
default: 'ellipsis'
|
||||
}
|
||||
})
|
||||
const textRef = shallowRef<HTMLElement>()
|
||||
const disabled = ref(false)
|
||||
|
||||
useEventListener(textRef, 'mouseenter', () => {
|
||||
if (textRef.value?.scrollWidth! > textRef.value?.offsetWidth!) {
|
||||
disabled.value = false
|
||||
} else {
|
||||
disabled.value = true
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
|
|
@ -1,50 +1,50 @@
|
|||
<template>
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
v-bind="props"
|
||||
:pager-count="5"
|
||||
v-model:currentPage="pager.page"
|
||||
v-model:pageSize="pager.size"
|
||||
:page-sizes="pageSizes"
|
||||
:layout="layout"
|
||||
:total="pager.count"
|
||||
:hide-on-single-page="false"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
interface Props {
|
||||
modelValue?: Record<string, any>
|
||||
pageSizes?: number[]
|
||||
layout?: string
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: () => ({}),
|
||||
pageSizes: () => [15, 20, 30, 40],
|
||||
layout: 'total, sizes, prev, pager, next, jumper'
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: 'change'): void
|
||||
(event: 'update:modelValue', value: any): void
|
||||
}>()
|
||||
|
||||
const pager = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
set(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
const sizeChange = () => {
|
||||
pager.value.page = 1
|
||||
emit('change')
|
||||
}
|
||||
const pageChange = () => {
|
||||
emit('change')
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
v-bind="props"
|
||||
:pager-count="5"
|
||||
v-model:currentPage="pager.page"
|
||||
v-model:pageSize="pager.size"
|
||||
:page-sizes="pageSizes"
|
||||
:layout="layout"
|
||||
:total="pager.count"
|
||||
:hide-on-single-page="false"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
interface Props {
|
||||
modelValue?: Record<string, any>
|
||||
pageSizes?: number[]
|
||||
layout?: string
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: () => ({}),
|
||||
pageSizes: () => [15, 20, 30, 40],
|
||||
layout: 'total, sizes, prev, pager, next, jumper'
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: 'change'): void
|
||||
(event: 'update:modelValue', value: any): void
|
||||
}>()
|
||||
|
||||
const pager = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
set(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
const sizeChange = () => {
|
||||
pager.value.page = 1
|
||||
emit('change')
|
||||
}
|
||||
const pageChange = () => {
|
||||
emit('change')
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,130 +1,130 @@
|
|||
<template>
|
||||
<div @mouseenter="inPopover = true" @mouseleave="inPopover = false">
|
||||
<el-popover
|
||||
placement="top"
|
||||
v-model:visible="visible"
|
||||
:width="width"
|
||||
trigger="contextmenu"
|
||||
class="popover-input"
|
||||
:teleported="teleported"
|
||||
:persistent="false"
|
||||
popper-class="!p-0"
|
||||
>
|
||||
<div class="flex p-3" @click.stop="">
|
||||
<div class="popover-input__input mr-[10px] flex-1">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
:size="size"
|
||||
v-if="type == 'select'"
|
||||
v-model="inputValue"
|
||||
:teleported="teleported"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-else
|
||||
v-model.trim="inputValue"
|
||||
:maxlength="limit"
|
||||
:show-word-limit="showLimit"
|
||||
:type="type"
|
||||
:size="size"
|
||||
clearable
|
||||
:placeholder="placeholder"
|
||||
/>
|
||||
</div>
|
||||
<div class="popover-input__btns flex-none">
|
||||
<el-button link @click="close">取消</el-button>
|
||||
<el-button type="primary" :size="size" @click="handleConfirm">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<template #reference>
|
||||
<div class="inline" @click.stop="handleOpen">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
</el-popover>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useEventListener } from '@vueuse/core'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: String
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'text'
|
||||
},
|
||||
width: {
|
||||
type: [Number, String],
|
||||
default: '300px'
|
||||
},
|
||||
placeholder: String,
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
options: {
|
||||
type: Array as PropType<any[]>,
|
||||
default: () => []
|
||||
},
|
||||
size: {
|
||||
type: String as PropType<'default' | 'small' | 'large'>,
|
||||
default: 'default'
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
showLimit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
teleported: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['confirm'])
|
||||
const visible = ref(false)
|
||||
const inPopover = ref(false)
|
||||
const inputValue = ref()
|
||||
const handleConfirm = () => {
|
||||
close()
|
||||
emit('confirm', inputValue.value)
|
||||
}
|
||||
const handleOpen = () => {
|
||||
if (props.disabled) {
|
||||
return
|
||||
}
|
||||
visible.value = true
|
||||
}
|
||||
const close = () => {
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(value) => {
|
||||
inputValue.value = value
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
|
||||
useEventListener(document.documentElement, 'click', () => {
|
||||
if (inPopover.value) return
|
||||
close()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
<template>
|
||||
<div @mouseenter="inPopover = true" @mouseleave="inPopover = false">
|
||||
<el-popover
|
||||
placement="top"
|
||||
v-model:visible="visible"
|
||||
:width="width"
|
||||
trigger="contextmenu"
|
||||
class="popover-input"
|
||||
:teleported="teleported"
|
||||
:persistent="false"
|
||||
popper-class="!p-0"
|
||||
>
|
||||
<div class="flex p-3" @click.stop="">
|
||||
<div class="popover-input__input mr-[10px] flex-1">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
:size="size"
|
||||
v-if="type == 'select'"
|
||||
v-model="inputValue"
|
||||
:teleported="teleported"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-else
|
||||
v-model.trim="inputValue"
|
||||
:maxlength="limit"
|
||||
:show-word-limit="showLimit"
|
||||
:type="type"
|
||||
:size="size"
|
||||
clearable
|
||||
:placeholder="placeholder"
|
||||
/>
|
||||
</div>
|
||||
<div class="popover-input__btns flex-none">
|
||||
<el-button link @click="close">取消</el-button>
|
||||
<el-button type="primary" :size="size" @click="handleConfirm">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<template #reference>
|
||||
<div class="inline" @click.stop="handleOpen">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
</el-popover>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useEventListener } from '@vueuse/core'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: String
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'text'
|
||||
},
|
||||
width: {
|
||||
type: [Number, String],
|
||||
default: '300px'
|
||||
},
|
||||
placeholder: String,
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
options: {
|
||||
type: Array as PropType<any[]>,
|
||||
default: () => []
|
||||
},
|
||||
size: {
|
||||
type: String as PropType<'default' | 'small' | 'large'>,
|
||||
default: 'default'
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
showLimit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
teleported: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['confirm'])
|
||||
const visible = ref(false)
|
||||
const inPopover = ref(false)
|
||||
const inputValue = ref()
|
||||
const handleConfirm = () => {
|
||||
close()
|
||||
emit('confirm', inputValue.value)
|
||||
}
|
||||
const handleOpen = () => {
|
||||
if (props.disabled) {
|
||||
return
|
||||
}
|
||||
visible.value = true
|
||||
}
|
||||
const close = () => {
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(value) => {
|
||||
inputValue.value = value
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
|
||||
useEventListener(document.documentElement, 'click', () => {
|
||||
if (inPopover.value) return
|
||||
close()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
@ -1,132 +1,125 @@
|
|||
<template>
|
||||
<div class="dialog">
|
||||
<div class="dialog__trigger" @click="open">
|
||||
<!-- 触发弹窗 -->
|
||||
<slot name="trigger"></slot>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:custom-class="customClass"
|
||||
:center="center"
|
||||
:append-to-body="true"
|
||||
:width="width"
|
||||
:close-on-click-modal="clickModalClose"
|
||||
@closed="close"
|
||||
>
|
||||
<!-- 弹窗内容 -->
|
||||
<template v-if="title" #header>{{ title }}</template>
|
||||
|
||||
<!-- 自定义内容 -->
|
||||
<slot>{{ content }}</slot>
|
||||
<!-- 底部弹窗页脚 -->
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button v-if="cancelButtonText" @click="handleEvent('cancel')">
|
||||
{{ cancelButtonText }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="confirmButtonText"
|
||||
type="primary"
|
||||
@click="handleEvent('confirm')"
|
||||
>
|
||||
{{ confirmButtonText }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default defineComponent({
|
||||
props: {
|
||||
title: {
|
||||
// 弹窗标题
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
content: {
|
||||
// 弹窗内容
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
confirmButtonText: {
|
||||
// 确认按钮内容
|
||||
type: [String, Boolean],
|
||||
default: '确定'
|
||||
},
|
||||
cancelButtonText: {
|
||||
// 取消按钮内容
|
||||
type: [String, Boolean],
|
||||
default: '取消'
|
||||
},
|
||||
width: {
|
||||
// 弹窗的宽度
|
||||
type: String,
|
||||
default: '400px'
|
||||
},
|
||||
disabled: {
|
||||
// 是否禁用
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
async: {
|
||||
// 是否开启异步关闭
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
clickModalClose: {
|
||||
// 点击遮罩层关闭对话窗口
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
center: {
|
||||
// 是否居中布局
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
customClass: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
emits: ['confirm', 'cancel', 'close', 'open'],
|
||||
setup(props, { emit }) {
|
||||
const visible = ref(false)
|
||||
|
||||
const handleEvent = (type: 'confirm' | 'cancel') => {
|
||||
emit(type)
|
||||
if (!props.async || type === 'cancel') {
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
visible.value = false
|
||||
nextTick(() => {
|
||||
emit('close')
|
||||
})
|
||||
}
|
||||
const open = () => {
|
||||
if (props.disabled) {
|
||||
return
|
||||
}
|
||||
emit('open')
|
||||
visible.value = true
|
||||
}
|
||||
provide('visible', visible)
|
||||
return {
|
||||
visible,
|
||||
handleEvent,
|
||||
close,
|
||||
open
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog-body {
|
||||
white-space: pre-line;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="dialog">
|
||||
<div class="dialog__trigger" @click="open">
|
||||
<!-- 触发弹窗 -->
|
||||
<slot name="trigger"></slot>
|
||||
</div>
|
||||
<el-dialog v-model="visible" :custom-class="customClass" :center="center" :append-to-body="true" :width="width" :close-on-click-modal="clickModalClose" @closed="close">
|
||||
<!-- 弹窗内容 -->
|
||||
<template v-if="title" #header>{{ title }}</template>
|
||||
|
||||
<!-- 自定义内容 -->
|
||||
<slot>{{ content }}</slot>
|
||||
<!-- 底部弹窗页脚 -->
|
||||
<template v-if="button" #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button v-if="cancelButtonText" @click="handleEvent('cancel')">
|
||||
{{ cancelButtonText }}
|
||||
</el-button>
|
||||
<el-button v-if="confirmButtonText" type="primary" @click="handleEvent('confirm')">
|
||||
{{ confirmButtonText }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default defineComponent({
|
||||
props: {
|
||||
title: {
|
||||
// 弹窗标题
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
button: {
|
||||
// 是否显示按钮
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
content: {
|
||||
// 弹窗内容
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
confirmButtonText: {
|
||||
// 确认按钮内容
|
||||
type: [String, Boolean],
|
||||
default: "确定",
|
||||
},
|
||||
cancelButtonText: {
|
||||
// 取消按钮内容
|
||||
type: [String, Boolean],
|
||||
default: "取消",
|
||||
},
|
||||
width: {
|
||||
// 弹窗的宽度
|
||||
type: String,
|
||||
default: "400px",
|
||||
},
|
||||
disabled: {
|
||||
// 是否禁用
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
async: {
|
||||
// 是否开启异步关闭
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
clickModalClose: {
|
||||
// 点击遮罩层关闭对话窗口
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
center: {
|
||||
// 是否居中布局
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
customClass: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
emits: ["confirm", "cancel", "close", "open"],
|
||||
setup(props, { emit }) {
|
||||
const visible = ref(false);
|
||||
|
||||
const handleEvent = (type: "confirm" | "cancel") => {
|
||||
emit(type);
|
||||
if (!props.async || type === "cancel") {
|
||||
close();
|
||||
}
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
visible.value = false;
|
||||
nextTick(() => {
|
||||
emit("close");
|
||||
});
|
||||
};
|
||||
const open = () => {
|
||||
if (props.disabled) {
|
||||
return;
|
||||
}
|
||||
emit("open");
|
||||
visible.value = true;
|
||||
};
|
||||
provide("visible", visible);
|
||||
return {
|
||||
visible,
|
||||
handleEvent,
|
||||
close,
|
||||
open,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog-body {
|
||||
white-space: pre-line;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,151 +1,151 @@
|
|||
<template>
|
||||
<div class="upload">
|
||||
<el-upload
|
||||
ref="uploadRefs"
|
||||
:action="action"
|
||||
:multiple="multiple"
|
||||
:limit="limit"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
:data="data"
|
||||
:on-progress="handleProgress"
|
||||
:on-success="handleSuccess"
|
||||
:on-exceed="handleExceed"
|
||||
:on-error="handleError"
|
||||
:accept="getAccept"
|
||||
>
|
||||
<slot></slot>
|
||||
</el-upload>
|
||||
<el-dialog
|
||||
v-if="showProgress && fileList.length"
|
||||
v-model="visible"
|
||||
title="上传进度"
|
||||
:close-on-click-modal="false"
|
||||
width="500px"
|
||||
:modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<div class="file-list p-4">
|
||||
<template v-for="(item, index) in fileList" :key="index">
|
||||
<div class="mb-5">
|
||||
<div>{{ item.name }}</div>
|
||||
<div class="flex-1">
|
||||
<el-progress :percentage="parseInt(item.percentage)"></el-progress>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, ref, shallowRef } from 'vue'
|
||||
import useUserStore from '@/stores/modules/user'
|
||||
import config from '@/config'
|
||||
import feedback from '@/utils/feedback'
|
||||
import type { ElUpload } from 'element-plus'
|
||||
import { RequestCodeEnum } from '@/enums/requestEnums'
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
props: {
|
||||
// 上传文件类型
|
||||
type: {
|
||||
type: String,
|
||||
default: 'image'
|
||||
},
|
||||
// 是否支持多选
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 多选时最多选择几条
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 10
|
||||
},
|
||||
// 上传时的额外参数
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
// 是否显示上传进度
|
||||
showProgress: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['change', 'error', 'success'],
|
||||
setup(props, { emit }) {
|
||||
const userStore = useUserStore()
|
||||
const uploadRefs = shallowRef<InstanceType<typeof ElUpload>>()
|
||||
const action = ref(`${config.baseUrl}${config.urlPrefix}/upload/${props.type}`)
|
||||
const headers = computed(() => ({
|
||||
token: userStore.token,
|
||||
version: config.version
|
||||
}))
|
||||
const visible = ref(false)
|
||||
const fileList = ref<any[]>([])
|
||||
|
||||
const handleProgress = (event: any, file: any, fileLists: any[]) => {
|
||||
visible.value = true
|
||||
fileList.value = toRaw(fileLists)
|
||||
}
|
||||
|
||||
const handleSuccess = (response: any, file: any, fileLists: any[]) => {
|
||||
const allSuccess = fileLists.every((item) => item.status == 'success')
|
||||
if (allSuccess) {
|
||||
uploadRefs.value?.clearFiles()
|
||||
visible.value = false
|
||||
}
|
||||
emit('change', file)
|
||||
if (response.code == RequestCodeEnum.SUCCESS) {
|
||||
emit('success', response)
|
||||
}
|
||||
if (response.code == RequestCodeEnum.FAIL && response.msg) {
|
||||
feedback.msgError(response.msg)
|
||||
}
|
||||
}
|
||||
const handleError = (event: any, file: any) => {
|
||||
feedback.msgError(`${file.name}文件上传失败`)
|
||||
uploadRefs.value?.abort(file)
|
||||
visible.value = false
|
||||
emit('change', file)
|
||||
emit('error', file)
|
||||
}
|
||||
const handleExceed = () => {
|
||||
feedback.msgError(`超出上传上限${props.limit},请重新上传`)
|
||||
}
|
||||
const handleClose = () => {
|
||||
uploadRefs.value?.clearFiles()
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
const getAccept = computed(() => {
|
||||
switch (props.type) {
|
||||
case 'image':
|
||||
return '.jpg,.png,.gif,.jpeg'
|
||||
case 'video':
|
||||
return '.wmv,.avi,.mpg,.mpeg,.3gp,.mov,.mp4,.flv,.rmvb,.mkv'
|
||||
default:
|
||||
return '*'
|
||||
}
|
||||
})
|
||||
return {
|
||||
uploadRefs,
|
||||
action,
|
||||
headers,
|
||||
visible,
|
||||
fileList,
|
||||
getAccept,
|
||||
handleProgress,
|
||||
handleSuccess,
|
||||
handleError,
|
||||
handleExceed,
|
||||
handleClose
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
<template>
|
||||
<div class="upload">
|
||||
<el-upload
|
||||
ref="uploadRefs"
|
||||
:action="action"
|
||||
:multiple="multiple"
|
||||
:limit="limit"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
:data="data"
|
||||
:on-progress="handleProgress"
|
||||
:on-success="handleSuccess"
|
||||
:on-exceed="handleExceed"
|
||||
:on-error="handleError"
|
||||
:accept="getAccept"
|
||||
>
|
||||
<slot></slot>
|
||||
</el-upload>
|
||||
<el-dialog
|
||||
v-if="showProgress && fileList.length"
|
||||
v-model="visible"
|
||||
title="上传进度"
|
||||
:close-on-click-modal="false"
|
||||
width="500px"
|
||||
:modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<div class="file-list p-4">
|
||||
<template v-for="(item, index) in fileList" :key="index">
|
||||
<div class="mb-5">
|
||||
<div>{{ item.name }}</div>
|
||||
<div class="flex-1">
|
||||
<el-progress :percentage="parseInt(item.percentage)"></el-progress>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, ref, shallowRef } from 'vue'
|
||||
import useUserStore from '@/stores/modules/user'
|
||||
import config from '@/config'
|
||||
import feedback from '@/utils/feedback'
|
||||
import type { ElUpload } from 'element-plus'
|
||||
import { RequestCodeEnum } from '@/enums/requestEnums'
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
props: {
|
||||
// 上传文件类型
|
||||
type: {
|
||||
type: String,
|
||||
default: 'image'
|
||||
},
|
||||
// 是否支持多选
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 多选时最多选择几条
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 10
|
||||
},
|
||||
// 上传时的额外参数
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
// 是否显示上传进度
|
||||
showProgress: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['change', 'error', 'success'],
|
||||
setup(props, { emit }) {
|
||||
const userStore = useUserStore()
|
||||
const uploadRefs = shallowRef<InstanceType<typeof ElUpload>>()
|
||||
const action = ref(`${config.baseUrl}${config.urlPrefix}/upload/${props.type}`)
|
||||
const headers = computed(() => ({
|
||||
token: userStore.token,
|
||||
version: config.version
|
||||
}))
|
||||
const visible = ref(false)
|
||||
const fileList = ref<any[]>([])
|
||||
|
||||
const handleProgress = (event: any, file: any, fileLists: any[]) => {
|
||||
visible.value = true
|
||||
fileList.value = toRaw(fileLists)
|
||||
}
|
||||
|
||||
const handleSuccess = (response: any, file: any, fileLists: any[]) => {
|
||||
const allSuccess = fileLists.every((item) => item.status == 'success')
|
||||
if (allSuccess) {
|
||||
uploadRefs.value?.clearFiles()
|
||||
visible.value = false
|
||||
}
|
||||
emit('change', file)
|
||||
if (response.code == RequestCodeEnum.SUCCESS) {
|
||||
emit('success', response)
|
||||
}
|
||||
if (response.code == RequestCodeEnum.FAIL && response.msg) {
|
||||
feedback.msgError(response.msg)
|
||||
}
|
||||
}
|
||||
const handleError = (event: any, file: any) => {
|
||||
feedback.msgError(`${file.name}文件上传失败`)
|
||||
uploadRefs.value?.abort(file)
|
||||
visible.value = false
|
||||
emit('change', file)
|
||||
emit('error', file)
|
||||
}
|
||||
const handleExceed = () => {
|
||||
feedback.msgError(`超出上传上限${props.limit},请重新上传`)
|
||||
}
|
||||
const handleClose = () => {
|
||||
uploadRefs.value?.clearFiles()
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
const getAccept = computed(() => {
|
||||
switch (props.type) {
|
||||
case 'image':
|
||||
return '.jpg,.png,.gif,.jpeg'
|
||||
case 'video':
|
||||
return '.wmv,.avi,.mpg,.mpeg,.3gp,.mov,.mp4,.flv,.rmvb,.mkv'
|
||||
default:
|
||||
return '*'
|
||||
}
|
||||
})
|
||||
return {
|
||||
uploadRefs,
|
||||
action,
|
||||
headers,
|
||||
visible,
|
||||
fileList,
|
||||
getAccept,
|
||||
handleProgress,
|
||||
handleSuccess,
|
||||
handleError,
|
||||
handleExceed,
|
||||
handleClose
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
|
|
|
@ -1,72 +1,72 @@
|
|||
<template>
|
||||
<div>
|
||||
<video-play
|
||||
ref="playerRef"
|
||||
v-bind="options"
|
||||
:src="src"
|
||||
@play="onPlay"
|
||||
@pause="onPause"
|
||||
@timeupdate="onTimeupdate"
|
||||
@canplay="onCanplay"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, shallowRef } from 'vue'
|
||||
import 'vue3-video-play/dist/style.css'
|
||||
import VideoPlay from 'vue3-video-play'
|
||||
const props = defineProps({
|
||||
src: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
width: String,
|
||||
height: String,
|
||||
poster: String
|
||||
})
|
||||
|
||||
const playerRef = shallowRef()
|
||||
const options = reactive({
|
||||
color: 'var(--el-color-primary)', //主题色
|
||||
muted: false, //静音
|
||||
webFullScreen: false,
|
||||
speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], //播放倍速
|
||||
autoPlay: true, //自动播放
|
||||
loop: false, //循环播放
|
||||
mirror: false, //镜像画面
|
||||
ligthOff: false, //关灯模式
|
||||
volume: 0.3, //默认音量大小
|
||||
control: true, //是否显示控制器
|
||||
title: '', //视频名称
|
||||
poster: '', //封面
|
||||
...props
|
||||
})
|
||||
|
||||
const play = () => {
|
||||
playerRef.value.play()
|
||||
}
|
||||
|
||||
const pause = () => {
|
||||
playerRef.value.pause()
|
||||
}
|
||||
|
||||
const onPlay = (event: any) => {
|
||||
console.log(event, '播放')
|
||||
}
|
||||
const onPause = (event: any) => {
|
||||
console.log(event, '暂停')
|
||||
}
|
||||
|
||||
const onTimeupdate = (event: any) => {
|
||||
console.log(event, '时间更新')
|
||||
}
|
||||
const onCanplay = (event: any) => {
|
||||
console.log(event, '可以播放')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
play,
|
||||
pause
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<video-play
|
||||
ref="playerRef"
|
||||
v-bind="options"
|
||||
:src="src"
|
||||
@play="onPlay"
|
||||
@pause="onPause"
|
||||
@timeupdate="onTimeupdate"
|
||||
@canplay="onCanplay"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, shallowRef } from 'vue'
|
||||
import 'vue3-video-play/dist/style.css'
|
||||
import VideoPlay from 'vue3-video-play'
|
||||
const props = defineProps({
|
||||
src: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
width: String,
|
||||
height: String,
|
||||
poster: String
|
||||
})
|
||||
|
||||
const playerRef = shallowRef()
|
||||
const options = reactive({
|
||||
color: 'var(--el-color-primary)', //主题色
|
||||
muted: false, //静音
|
||||
webFullScreen: false,
|
||||
speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], //播放倍速
|
||||
autoPlay: true, //自动播放
|
||||
loop: false, //循环播放
|
||||
mirror: false, //镜像画面
|
||||
ligthOff: false, //关灯模式
|
||||
volume: 0.3, //默认音量大小
|
||||
control: true, //是否显示控制器
|
||||
title: '', //视频名称
|
||||
poster: '', //封面
|
||||
...props
|
||||
})
|
||||
|
||||
const play = () => {
|
||||
playerRef.value.play()
|
||||
}
|
||||
|
||||
const pause = () => {
|
||||
playerRef.value.pause()
|
||||
}
|
||||
|
||||
const onPlay = (event: any) => {
|
||||
console.log(event, '播放')
|
||||
}
|
||||
const onPause = (event: any) => {
|
||||
console.log(event, '暂停')
|
||||
}
|
||||
|
||||
const onTimeupdate = (event: any) => {
|
||||
console.log(event, '时间更新')
|
||||
}
|
||||
const onCanplay = (event: any) => {
|
||||
console.log(event, '可以播放')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
play,
|
||||
pause
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
const config = {
|
||||
terminal: 1, //终端
|
||||
title: "后台管理系统", //网站默认标题
|
||||
version: "1.6.0", //版本号
|
||||
baseUrl: `${
|
||||
import.meta.env.VITE_APP_BASE_URL || ""
|
||||
}/`, //请求接口域名
|
||||
urlPrefix: "adminapi", //请求默认前缀
|
||||
timeout: 10 * 1000, //请求超时时长
|
||||
};
|
||||
|
||||
export default config;
|
||||
// const config = {
|
||||
// terminal: 1, //终端
|
||||
// title: "后台管理系统", //网站默认标题
|
||||
// version: "1.6.0", //版本号
|
||||
// baseUrl: " ", //请求接口域名
|
||||
// urlPrefix: "adminapi", //请求默认前缀
|
||||
// timeout: 10 * 1000, //请求超时时长
|
||||
// };
|
||||
|
||||
// export default config;
|
||||
const config = {
|
||||
terminal: 1, //终端
|
||||
title: "后台管理系统", //网站默认标题
|
||||
version: "1.6.0", //版本号
|
||||
baseUrl: `${
|
||||
import.meta.env.VITE_APP_BASE_URL || "https://ceshi-middle.lihaink.cn"
|
||||
}/`, //请求接口域名
|
||||
urlPrefix: "adminapi", //请求默认前缀
|
||||
timeout: 10 * 1000, //请求超时时长
|
||||
}
|
||||
|
||||
|
||||
export default config;
|
||||
// const config = {
|
||||
// terminal: 1, //终端
|
||||
// title: "后台管理系统", //网站默认标题
|
||||
// version: "1.6.0", //版本号
|
||||
// baseUrl: " ", //请求接口域名
|
||||
// urlPrefix: "adminapi", //请求默认前缀
|
||||
// timeout: 10 * 1000, //请求超时时长
|
||||
// };
|
||||
|
||||
// export default config;
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
const defaultSetting = {
|
||||
showCrumb: true, // 是否显示面包屑
|
||||
showLogo: true, // 是否显示logo
|
||||
isUniqueOpened: false, //只展开一个一级菜单
|
||||
sideWidth: 200, //侧边栏宽度
|
||||
sideTheme: 'light', //侧边栏主题
|
||||
sideDarkColor: '#1d2124', //侧边栏深色主题颜色
|
||||
openMultipleTabs: true, // 是否开启多标签tab栏
|
||||
theme: '#4A5DFF', //主题色
|
||||
successTheme: '#67c23a', //成功主题色
|
||||
warningTheme: '#e6a23c', //警告主题色
|
||||
dangerTheme: '#f56c6c', //危险主题色
|
||||
errorTheme: '#f56c6c', //错误主题色
|
||||
infoTheme: '#909399' //信息主题色
|
||||
}
|
||||
export default defaultSetting
|
||||
const defaultSetting = {
|
||||
showCrumb: true, // 是否显示面包屑
|
||||
showLogo: true, // 是否显示logo
|
||||
isUniqueOpened: false, //只展开一个一级菜单
|
||||
sideWidth: 200, //侧边栏宽度
|
||||
sideTheme: 'light', //侧边栏主题
|
||||
sideDarkColor: '#1d2124', //侧边栏深色主题颜色
|
||||
openMultipleTabs: true, // 是否开启多标签tab栏
|
||||
theme: '#4A5DFF', //主题色
|
||||
successTheme: '#67c23a', //成功主题色
|
||||
warningTheme: '#e6a23c', //警告主题色
|
||||
dangerTheme: '#f56c6c', //危险主题色
|
||||
errorTheme: '#f56c6c', //错误主题色
|
||||
infoTheme: '#909399' //信息主题色
|
||||
}
|
||||
export default defaultSetting
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
//菜单主题类型
|
||||
export enum ThemeEnum {
|
||||
LIGHT = 'light',
|
||||
DARK = 'dark'
|
||||
}
|
||||
|
||||
// 菜单类型
|
||||
export enum MenuEnum {
|
||||
CATALOGUE = 'M',
|
||||
MENU = 'C',
|
||||
BUTTON = 'A'
|
||||
}
|
||||
|
||||
// 屏幕
|
||||
export enum ScreenEnum {
|
||||
SM = 640,
|
||||
MD = 768,
|
||||
LG = 1024,
|
||||
XL = 1280,
|
||||
'2XL' = 1536
|
||||
}
|
||||
|
||||
// 客户端类型
|
||||
export enum ClientEnum {
|
||||
MP_WEIXIN = 1, // 微信-小程序
|
||||
OA_WEIXIN = 2, // 微信-公众号
|
||||
H5 = 3, // H5
|
||||
PC = 4, // PC
|
||||
IOS = 5, //苹果
|
||||
ANDROID = 6 //安卓
|
||||
}
|
||||
|
||||
export const ClientMap = {
|
||||
[ClientEnum.MP_WEIXIN]: '微信小程序',
|
||||
[ClientEnum.OA_WEIXIN]: '微信公众号',
|
||||
[ClientEnum.H5]: '手机H5',
|
||||
[ClientEnum.PC]: '电脑PC',
|
||||
[ClientEnum.IOS]: '苹果APP',
|
||||
[ClientEnum.ANDROID]: '安卓APP'
|
||||
}
|
||||
//菜单主题类型
|
||||
export enum ThemeEnum {
|
||||
LIGHT = 'light',
|
||||
DARK = 'dark'
|
||||
}
|
||||
|
||||
// 菜单类型
|
||||
export enum MenuEnum {
|
||||
CATALOGUE = 'M',
|
||||
MENU = 'C',
|
||||
BUTTON = 'A'
|
||||
}
|
||||
|
||||
// 屏幕
|
||||
export enum ScreenEnum {
|
||||
SM = 640,
|
||||
MD = 768,
|
||||
LG = 1024,
|
||||
XL = 1280,
|
||||
'2XL' = 1536
|
||||
}
|
||||
|
||||
// 客户端类型
|
||||
export enum ClientEnum {
|
||||
MP_WEIXIN = 1, // 微信-小程序
|
||||
OA_WEIXIN = 2, // 微信-公众号
|
||||
H5 = 3, // H5
|
||||
PC = 4, // PC
|
||||
IOS = 5, //苹果
|
||||
ANDROID = 6 //安卓
|
||||
}
|
||||
|
||||
export const ClientMap = {
|
||||
[ClientEnum.MP_WEIXIN]: '微信小程序',
|
||||
[ClientEnum.OA_WEIXIN]: '微信公众号',
|
||||
[ClientEnum.H5]: '手机H5',
|
||||
[ClientEnum.PC]: '电脑PC',
|
||||
[ClientEnum.IOS]: '苹果APP',
|
||||
[ClientEnum.ANDROID]: '安卓APP'
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// 本地缓冲key
|
||||
|
||||
//token
|
||||
export const TOKEN_KEY = 'token'
|
||||
//账号
|
||||
export const ACCOUNT_KEY = 'account'
|
||||
//设置
|
||||
export const SETTING_KEY = 'setting'
|
||||
// 本地缓冲key
|
||||
|
||||
//token
|
||||
export const TOKEN_KEY = 'token'
|
||||
//账号
|
||||
export const ACCOUNT_KEY = 'account'
|
||||
//设置
|
||||
export const SETTING_KEY = 'setting'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export enum PageEnum {
|
||||
//登录页面
|
||||
LOGIN = '/login',
|
||||
//无权限页面
|
||||
ERROR_403 = '/403',
|
||||
INDEX = '/'
|
||||
}
|
||||
export enum PageEnum {
|
||||
//登录页面
|
||||
LOGIN = '/login',
|
||||
//无权限页面
|
||||
ERROR_403 = '/403',
|
||||
INDEX = '/'
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
export enum ContentTypeEnum {
|
||||
// json
|
||||
JSON = 'application/json;charset=UTF-8',
|
||||
// form-data 上传资源(图片,视频)
|
||||
FORM_DATA = 'multipart/form-data;charset=UTF-8'
|
||||
}
|
||||
|
||||
export enum RequestMethodsEnum {
|
||||
GET = 'GET',
|
||||
POST = 'POST'
|
||||
}
|
||||
|
||||
export enum RequestCodeEnum {
|
||||
SUCCESS = 1,
|
||||
FAIL = 0,
|
||||
LOGIN_FAILURE = -1,
|
||||
OPEN_NEW_PAGE = 2
|
||||
}
|
||||
export enum ContentTypeEnum {
|
||||
// json
|
||||
JSON = 'application/json;charset=UTF-8',
|
||||
// form-data 上传资源(图片,视频)
|
||||
FORM_DATA = 'multipart/form-data;charset=UTF-8'
|
||||
}
|
||||
|
||||
export enum RequestMethodsEnum {
|
||||
GET = 'GET',
|
||||
POST = 'POST'
|
||||
}
|
||||
|
||||
export enum RequestCodeEnum {
|
||||
SUCCESS = 1,
|
||||
FAIL = 0,
|
||||
LOGIN_FAILURE = -1,
|
||||
OPEN_NEW_PAGE = 2
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue