Commit 6fac30a4 by 前端

Merge branch 'SAAS+V5.6.1' into 'SAAS+V5.6.2'

上线合并

See merge request !564
2 parents ce3e7b06 d6135734
Showing 196 changed files with 3901 additions and 769 deletions
......@@ -2,8 +2,8 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
indent_style = tab
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
......@@ -9,3 +9,4 @@ coverage/
# 忽略文件
**/*-min.js
**/*.min.js
**/*.vue
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'@vue/prettier'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
module.exports = {
root: true,
parserOptions: {
// parser: '@babel/eslint-parser'
ecmaVersion: 2020
},
env: {
browser: true
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevent
// ion consider switching to `plugin:vue/strongly-recommended` or
// `plugin:vue/recommended` for stricter rules.
"plugin:vue/essential",
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
"standard",
"plugin:vue/strongly-recommended",
"@vue/standard"
// '@vue/typescript/recommended'
],
// required to lint *.vue files
plugins: ["vue"],
globals: {
NODE_ENV: false,
_: false,
echarts: false
},
rules: {
"vue/max-attributes-per-line": [
0,
{
singleline: 10,
multiline: {
max: 2,
allowFirstLine: false
}
}
],
"vue/html-closing-bracket-newline": [
"error",
{
singleline: "never",
multiline: "never"
}
],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline": "off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
"arrow-spacing": [
2,
{
before: true,
after: true
}
],
"no-var": "off",
eqeqeq: "off",
// 'no-eval': ['error', { allowIndirect: false }], // default is false
"no-eval": "off", // default is false
// allow async-await
"generator-star-spacing": "off",
// 'block-spacing': [2, 'always'],
"brace-style": [
2,
"1tbs",
{
allowSingleLine: true
}
],
"comma-dangle": [2, "never"],
"comma-spacing": [
2,
{
before: false,
after: true
}
],
"comma-style": [2, "last"],
curly: [2, "multi-line"],
"dot-location": [2, "property"],
indent: [
2,
2,
{
SwitchCase: 1
}
],
"key-spacing": [
2,
{
beforeColon: false,
afterColon: true
}
],
"keyword-spacing": [
2,
{
before: true,
after: true
}
],
"new-cap": [
2,
{
newIsCap: true,
capIsNew: false
}
],
"no-extra-parens": [2, "functions"],
"no-floating-decimal": 2,
"no-multi-spaces": 2,
"no-multiple-empty-lines": [
2,
{
max: 1
}
],
"no-trailing-spaces": 2,
quotes: [
0,
"single",
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
semi: [2, "never"],
"space-before-blocks": [2, "always"],
// 'space-before-function-paren': [2, 'never'],
"space-before-function-paren": 0,
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [
2,
{
words: true,
nonwords: false
}
],
"spaced-comment": [2, "always"],
"prefer-const": 2,
"node/no-callback-literal": 'off',
"no-unused-expressions": "off",
camelcase: 'off',
"no-undef": 'off',
"vue/html-self-closing": 'off',
"array-callback-return": 'off'
}
}
.DS_Store
node_modules
/dist
/.history
/cache
/copyDirTarget
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
\ No newline at end of file
.DS_Store
node_modules
/dist
/.history
/cache
/copyDirTarget
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
{
"singleQuote": false,
"semi": false,
"trailingComma": "none"
}
{
"recommendations": [
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"esbenp.prettier-vscode"
]
}
\ No newline at end of file
{
"i18n-ally.localesPaths": [
"src/locales"
],
"cSpell.words": [
"vuex",
"Cascader"
],
"workbench.tree.indent": 24,
"eslint.enable": true,
"explorer.compactFolders": false,
"scm.compactFolders": false,
"problems.decorations.enabled": false,
"eslint.format.enable": true,
"vetur.validation.template": false,
"vetur.validation.script": false,
"vetur.validation.style": true,
"vetur.ignoreProjectWarning": false,
"vetur.experimental.templateInterpolationService": false,
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"editor.autoIndent": "full",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"i18n-ally.sourceLanguage": "zh-chs"
}
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"problemMatcher": [],
"label": "npm: dev",
"detail": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve"
}
]
}
\ No newline at end of file
{
"Vue 2 Component": {
"prefix": "vue2",
"body": [
"<template>",
" <div class=\"$1\">",
" $0",
" </div>",
"</template>",
"",
"<script>",
"export default {",
" name: '$2',",
" data() {",
" return {",
" $3",
" };",
" },",
" props: {",
" $4",
" },",
" computed: {",
" $5",
" },",
" methods: {",
" $6",
" },",
" mounted() {",
" $7",
" }",
"};",
"</script>",
"",
"<style scoped lang=\"scss\">",
"$8",
"</style>"
],
"description": "Vue 2 单文件组件模板"
},
"Vuex Store Template (Vue2)": {
"prefix": "vuexstore2",
"body": [
"export default {",
" state: {",
" ${1:count}: ${2:0},",
" },",
" getters: {",
" ${3:get${1/(.*)/${1:/capitalize}/}}: state => state.${1},",
" },",
" mutations: {",
" set${1/(.*)/${1:/capitalize}/}(state, payload) {",
" state.${1} = payload;",
" },",
" increment${1/(.*)/${1:/capitalize}/}(state, payload = 1) {",
" state.${1} += payload;",
" }",
" },",
" actions: {",
" ${4:increment${1/(.*)/${1:/capitalize}/}Async}({ commit }, payload) {",
" setTimeout(() => {",
" commit('increment${1/(.*)/${1:/capitalize}/}', payload);",
" }, 1000);",
" }",
" },",
"};"
],
"description": "Vue 2 + Vuex 3 的 store 模板"
}
}
import antfu from "@antfu/eslint-config";
export default antfu({
markdown: true,
vue: true,
css: true,
jsonc: true,
json: true,
ignores: [
// 忽略uni_modules目录
"**/uni_modules/",
"dist",
// unplugin-auto-import 生成的类型文件,每次提交都改变,所以加入这里吧,与 .gitignore 配合使用
"auto-import.d.ts",
],
stylistic: {
"indent": "tab", // 4个空格
"quotes": "double", // or 'double'
"semi": true,
"array-bracket-spacing": ["error", "always"],
},
rules: {
"prefer-template": "off",
"no-useless-return": "off",
"vue/no-deprecated-delete-set": "off",
"vue/no-deprecated-dollar-listeners-api": "off",
"vue/require-explicit-emits": "off",
"eqeqeq": "warn",
"vue/v-on-event-hyphenation": "off",
"style/no-tabs": "off",
"vue/no-deprecated-v-bind-sync": "off",
"vue/no-lone-template": "off",
"vue/no-mutating-props": "off",
// 强制:Vue 多行 HTML 元素的内容前后必须换行
"vue/multiline-html-element-content-newline": [
"error",
{
ignoreWhenEmpty: false, // 即使元素内容为空,也要求换行(如 <div>\n</div>)
ignores: [], // 无忽略的元素(所有多行元素都生效)
allowEmptyLines: true, // 允许内容前后存在空白行
},
],
// 强制:Vue HTML 标签闭合括号不换行
"vue/html-closing-bracket-newline": [
"error",
{
singleline: "never", // 单行标签:闭合括号不换行(如 <image src="xxx" />)
multiline: "never", // 多行标签:闭合括号不换行(如 <image\n src="xxx"\n/>)
},
],
// 强制:Vue HTML 元素自闭合格式(如 <image /> 而非 <image></image>)
"vue/html-self-closing": [
"error",
{
html: {
void: "any", // 原生空标签(如 <img>)允许任意自闭合格式
normal: "any", // 原生普通标签(如 <div>)允许任意自闭合格式
component: "any", // 自定义组件(如 <MyComponent>)允许任意自闭合格式
},
svg: "any", // SVG 标签允许任意自闭合格式
math: "any", // MathML 标签允许任意自闭合格式
},
],
// 强制:Vue HTML 模板中标签缩进 4 个空格
"vue/html-indent": [
"error",
4,
{
attribute: 1, // 属性相对于标签缩进 1 级(4 个空格)
baseIndent: 1, // 基础缩进 1 级(适配组件嵌套场景)
closeBracket: 0, // 闭合标签与属性对齐(不额外缩进)
alignAttributesVertically: true, // 多行属性时垂直对齐(如所有属性左侧对齐)
ignores: [], // 无忽略的标签
},
],
"vue/attributes-order": ["error", {
order: [
"DEFINITION", // is
"LIST_RENDERING", // v-for
"CONDITIONALS", // v-if v-else-if v-else v-show v-cloak
"RENDER_MODIFIERS", // v-once v-pre
"GLOBAL", // id
"UNIQUE", // ref key
"SLOT", // v-slot slot
"TWO_WAY_BINDING", // v-model
"OTHER_DIRECTIVES", // v-custom-directive
"OTHER_ATTR", // 自定义属性和其他
"EVENTS", // @click @focus
"CONTENT", // v-text v-html
],
alphabetical: true, // 是否在同组内再按字母排序(建议 false,官方默认顺序更好)
}],
// 强制:Vue SFC 中块的顺序(template -> script -> style)
"vue/block-order": [
"error",
{
order: ["template", "script", "style"], // 固定三个核心块的顺序
},
],
// 强制:Vue 元素首属性的换行格式
"vue/first-attribute-linebreak": [
"error",
{
singleline: "beside", // 单行属性:首属性紧跟标签名(不换行)
multiline: "beside", // 多行属性:首属性也紧跟标签名(注:原注释描述与配置冲突,按配置「不换行」,如需换行可改为 "below")
},
],
// 强制:Vue 元素属性每行最多数量限制
"vue/max-attributes-per-line": [
"error",
{
singleline: 2, // 单行元素最多允许 2 个属性(如 <image src="xxx" alt="xxx">)
multiline: 1, // 多行元素每行最多 1 个属性(每个属性单独一行)
},
],
// 关闭:unused-imports 插件的「禁止未使用变量」检测(与 no-unused-vars 功能重叠,同步关闭)
"unused-imports/no-unused-vars": "off",
// 关闭:禁止无限制使用 eslint-disable 注释(允许临时禁用多个规则,按需关闭)
"eslint-comments/no-unlimited-disable": "off",
// 关闭:检查 JSDoc 注释中参数名与实际参数是否一致(无需强制 JSDoc 规范时关闭)
"jsdoc/check-param-names": "off",
// 强制:代码块前必须加空格(如 function fn() { 前加空格,报错级别 error)
"space-before-blocks": "error",
// 关闭:禁止使用 console(开发环境保留 console.log 便于调试,按需关闭)
"no-console": "off",
"style/brace-style": ["error", "1tbs"],
},
formatters: {
/**
* Format CSS, LESS, SCSS files, also the `<style>` blocks in Vue
* By default uses Prettier
*/
css: true,
scss: true,
less: true,
/**
* Format HTML files
* By default uses Prettier
*/
html: true,
},
});
{
"compilerOptions": {
"target": "ES2020",
// "jsx": "react-jsx",
// "lib": ["ES2020", "DOM", "DOM.Iterable"],
"lib": [
"ES2020"
],
"useDefineForClassFields": true,
/* Paths */
"baseUrl": ".",
"module": "ESNext",
/* Bundler mode */
"moduleResolution": "bundler",
"paths": {
"@/*": [
"src/*"
],
"@api/*": [
"src/api/*"
]
},
"resolveJsonModule": true,
"allowImportingTsExtensions": false,
"allowJs": true,
"checkJs": false,
"noEmit": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"skipLibCheck": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"dist",
".git"
]
}
\ No newline at end of file
This diff could not be displayed because it is too large.
{
"name": "dj-car-life-system",
"version": "0.1.0",
"private": true,
"scripts": {
"备注": "去掉nomock配置命令",
"serve": "vue-cli-service serve",
"start": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve",
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve",
"build": "vue-cli-service build --no-module",
"build:nomock": "vue-cli-service build --mode nomock",
"lint": "vue-cli-service lint --fix",
"test:unit": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service test:unit",
"report": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --report"
},
"dependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.17.12",
"@babel/plugin-proposal-optional-chaining": "7.13.12",
"@sentry/browser": "^7.12.1",
"@sentry/integrations": "^7.12.1",
"@sentry/tracing": "^7.3.0",
"@sentry/vue": "^7.3.0",
"@sentry/webpack-plugin": "^1.18.9",
"ali-oss": "^6.22.0",
"axios": "^0.18.0",
"better-scroll": "^1.15.2",
"bignumber.js": "^9.1.1",
"core-js": "^3.8.3",
"dayjs": "^1.8.12",
"default-passive-events": "^2.0.0",
"echarts": "^5.3.2",
"element-ui": "2.13.2",
"eslint-plugin-standard": "^5.0.0",
"file-saver": "^2.0.5",
"flex.css": "^1.1.7",
"fuse.js": "^3.4.4",
"glsk-oss-jssdk": "^1.0.6",
"glsk-toolkit": "^1.0.5",
"glsx-common-sdk": "^0.3.0",
"hash.js": "^1.0.0",
"hotkeys-js": "^3.6.2",
"html2canvas": "^1.4.1",
"js-cookie": "^2.2.0",
"js-md5": "^0.7.3",
"jspdf": "^2.5.1",
"lowdb": "^1.0.0",
"nprogress": "^0.2.0",
"number-precision": "^1.6.0",
"print-js": "^1.6.0",
"qrcodejs2": "^0.0.2",
"qs": "^6.8.0",
"rfdc": "^1.3.0",
"screenfull": "^4.2.0",
"sha1": "^1.1.1",
"sortablejs": "^1.15.6",
"speed-measure-webpack-plugin": "^1.5.0",
"svg-sprite-loader": "^6.0.11",
"ua-parser-js": "^0.7.19",
"vue": "^2.6.10",
"vue-lazyload": "^1.2.3",
"vue-router": "3.0.5",
"vuedraggable": "^2.24.3",
"vuex": "^3.0.1",
"wangeditor": "4.7.15",
"webpack-theme-color-replacer": "^1.4.2",
"webpack5-svg-sprite-loader": "^5.1.1",
"xlsx": "^0.16.9",
"yarn": "^1.22.19"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@kazupon/vue-i18n-loader": "^0.4.1",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-unit-jest": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/eslint-config-standard": "^6.1.0",
"@vue/test-utils": "1.0.0-beta.29",
"@vue/vue2-jest": "^27.0.0-alpha.3",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.0.0",
"jest": "^27.1.0",
"md5": "^2.3.0",
"postcss-preset-env": "^7.7.2",
"postcss-px-to-viewport": "^1.1.1",
"sass": "~1.62.0",
"sass-loader": "^7.3.1",
"script-loader": "^0.7.2",
"vue-template-compiler": "^2.5.21",
"webpack": "^5.74.0"
}
"name": "dj-car-life-system",
"version": "0.1.0",
"private": true,
"scripts": {
"备注": "去掉nomock配置命令",
"serve": "vue-cli-service serve",
"start": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve",
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve",
"build": "vue-cli-service build --no-module",
"build:nomock": "vue-cli-service build --mode nomock",
"lint": "vue-cli-service lint --fix",
"test:unit": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service test:unit",
"report": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --report"
},
"dependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.17.12",
"@babel/plugin-proposal-optional-chaining": "7.13.12",
"@sentry/browser": "^7.12.1",
"@sentry/integrations": "^7.12.1",
"@sentry/tracing": "^7.3.0",
"@sentry/vue": "^7.3.0",
"@sentry/webpack-plugin": "^1.18.9",
"ali-oss": "^6.22.0",
"axios": "^0.18.0",
"baseline-browser-mapping": "^2.9.13",
"better-scroll": "^1.15.2",
"bignumber.js": "^9.1.1",
"caniuse-lite": "^1.0.30001763",
"core-js": "^3.8.3",
"dayjs": "^1.8.12",
"default-passive-events": "^2.0.0",
"echarts": "^5.3.2",
"element-ui": "2.13.2",
"file-saver": "^2.0.5",
"flex.css": "^1.1.7",
"fuse.js": "^3.4.4",
"glsk-oss-jssdk": "^1.0.6",
"glsk-toolkit": "^1.0.5",
"glsx-common-sdk": "^0.3.0",
"hash.js": "^1.0.0",
"hotkeys-js": "^3.6.2",
"html2canvas": "^1.4.1",
"js-cookie": "^2.2.0",
"js-md5": "^0.7.3",
"jspdf": "^2.5.1",
"lodash-es": "^4.17.22",
"lowdb": "^1.0.0",
"nprogress": "^0.2.0",
"number-precision": "^1.6.0",
"print-js": "^1.6.0",
"qrcodejs2": "^0.0.2",
"qs": "^6.8.0",
"rfdc": "^1.3.0",
"screenfull": "^4.2.0",
"sha1": "^1.1.1",
"sortablejs": "^1.15.6",
"speed-measure-webpack-plugin": "^1.5.0",
"svg-sprite-loader": "^6.0.11",
"ua-parser-js": "^0.7.19",
"vue": "^2.6.10",
"vue-lazyload": "^1.2.3",
"vue-router": "3.0.5",
"vuedraggable": "^2.24.3",
"vuex": "^3.0.1",
"wangeditor": "4.7.15",
"webpack-theme-color-replacer": "^1.4.2",
"webpack5-svg-sprite-loader": "^5.1.1",
"xlsx": "^0.16.9",
"yarn": "^1.22.19"
},
"devDependencies": {
"@antfu/eslint-config": "^6.7.3",
"@babel/core": "^7.12.16",
"@kazupon/vue-i18n-loader": "^0.4.1",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-unit-jest": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/compiler-sfc": "^3.5.26",
"@vue/test-utils": "1.0.0-beta.29",
"@vue/vue2-jest": "^27.0.0-alpha.3",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"eslint": "^9.39.2",
"eslint-plugin-format": "^1.2.0",
"jest": "^27.1.0",
"md5": "^2.3.0",
"postcss-preset-env": "^7.7.2",
"postcss-px-to-viewport": "^1.1.1",
"sass": "~1.62.0",
"sass-loader": "^7.3.1",
"script-loader": "^0.7.2",
"vue-template-compiler": "^2.5.21",
"webpack": "^5.74.0"
},
"volta": {
"node": "14.21.3"
}
}
This diff could not be displayed because it is too large.
import request from "./request"
// const path = 'dj.api.'
......@@ -72,8 +71,63 @@ export function queryServiceRefByShop() {
return request(data, "post")
}
//文件上传
// 文件上传
export function uploadFile(data) {
data.method = `dj.api.smartcarlife.orderReconciliationRecord.import`
return request(data, "post",["file"])
}
\ No newline at end of file
return request(data, "post", ["file"])
}
// 异常订单列表
export function getAbnormalOrderPage(data) {
data.method = "dj.api.smartcarlife.abnormal.order.page"
return request(data)
}
// 对公流水导入
// dj.api.smartcarlife.pending.corporate.order.import/1.0.0
export function importPendingCorporateOrder(data) {
data.method = "dj.api.smartcarlife.pending.corporate.order.import"
return request(data, "post", ["file"])
}
// 异常订单统计
// dj.api.smartcarlife.abnormal.order.stat/1.0.0
export function getAbnormalOrderStat(data) {
data.method = "dj.api.smartcarlife.abnormal.order.stat"
return request(data)
}
// dj.api.smartcarlife.abnormal.payment.detail.page/1.0.0
// 异常流水明细列表
export function getAbnormalPaymentDetailPage(data) {
data.method = "dj.api.smartcarlife.abnormal.payment.detail.page"
return request(data)
}
// dj.api.smartcarlife.pending.corporate.order.detail.page/1.0.0
// 待确认对公订单明细列表
export function getPendingCorporateOrderDetailPage(data) {
data.method = "dj.api.smartcarlife.pending.corporate.order.detail.page"
return request(data)
}
// dj.api.smartcarlife.abnormal.detail.stat/1.0.0
// 异常明细统计
export function getAbnormalDetailStat(data) {
data.method = "dj.api.smartcarlife.abnormal.detail.stat"
return request(data)
}
// dj.api.smartcarlife.abnormal.order.detail.page/1.0.0
// 异常订单明细列表
export function getAbnormalOrderDetailPage(data) {
data.method = "dj.api.smartcarlife.abnormal.order.detail.page"
return request(data)
}
// dj.api.smartcarlife.abnormal.corporate.order.confirm/1.0.0
// 对公打款确认
export function confirmPendingCorporateOrder(data) {
data.method = "dj.api.smartcarlife.abnormal.corporate.order.confirm"
return request(data, "post")
}
// dj.api.smartcarlife.pending.corporate.order.detail/1.0.0
// 查询待确认对公订单明细
export function getPendingCorporateOrderDetail(data) {
data.method = "dj.api.smartcarlife.pending.corporate.order.detail"
return request(data)
}
module.exports = {
gscPost: (url, data, _config = {}) => {
return window.$gscApi.post(url, data, _config)
}
}
gscPost: (url, data, _config = {}) => {
return window.$gscApi.post(url, data, _config);
},
};
import { mockRequest } from "./request.mock";
const path = "dj.staff.api.service.merchant.";
// 分页查询费用类目
export function getStoreWithBrandList(data) {
// data.method = `${path}selectFeeCategoryList`
data.method = `${path}page.with.brand`;
return mockRequest(data);
}
/**
* Mock Service using Axios
* Mock Server Address: http://127.0.0.1:4523/m1/7746299-7491170-default/
*
* 单入口架构,通过不同的服务路径(dj.staff.api.service.merchant.page.with.brand)来决定调用后端哪个服务
*/
import axios from "axios";
// Mock 基础配置
const MOCK_BASE_URL = "http://127.0.0.1:4523/m1/7746299-7491170-default";
/**
* 创建 Mock Axios 实例
*/
const mockAxios = axios.create({
baseURL: MOCK_BASE_URL,
timeout: 10000,
headers: {
"Content-Type": "application/json",
},
});
/**
* Mock 服务包装器
*
* @param {object} params - 请求参数对象
* @param {string} params.method - 服务方法名称,如 'dj.staff.api.service.merchant.page.with.brand'
* @param {string} params.version - API版本,默认 '1.0.0'
* @param {object} params.data - 请求数据
* @param {string} method - HTTP方法,默认 'get'
* @returns {Promise} axios请求Promise
*
* @example
* mockRequest({
* method: 'dj.staff.api.service.merchant.page.with.brand',
* version: '1.0.0',
* data: {
* currentPage: 11,
* pageSize: 11,
* name: 'sss'
* }
* }, 'get')
*/
function mockRequest(params = {}, httpMethod = "post") {
const {
method = "",
data = {},
version = "1.0.0",
} = params;
if (!method) {
throw new Error("method is required in params");
}
// 构建请求URL
// 格式: /dj.staff.api.service.merchant.page.with.brand/1.0.0
const url = `/${method}/${version}`;
// 准备请求配置
const config = {
method: httpMethod.toLowerCase(),
url,
};
// 根据HTTP方法处理参数
if (httpMethod.toLowerCase() === "post" || httpMethod.toLowerCase() === "put") {
config.data = data;
} else {
// GET请求,将参数作为query string
config.params = {
"ropRequestContext.key": data["ropRequestContext.key"] || "",
...data,
};
}
return mockAxios(config);
}
/**
* 便捷方法 - GET 请求
* @param {object} params - 请求参数
* @returns {Promise}
*/
function mockGet(params = {}) {
return mockRequest(params, "get");
}
/**
* 便捷方法 - POST 请求
* @param {object} params - 请求参数
* @returns {Promise}
*/
function mockPost(params = {}) {
return mockRequest(params, "post");
}
/**
* 便捷方法 - PUT 请求
* @param {object} params - 请求参数
* @returns {Promise}
*/
function mockPut(params = {}) {
return mockRequest(params, "put");
}
/**
* 便捷方法 - DELETE 请求
* @param {object} params - 请求参数
* @returns {Promise}
*/
function mockDelete(params = {}) {
return mockRequest(params, "delete");
}
/**
* 请求拦截器
*/
mockAxios.interceptors.request.use(
(config) => {
return config;
},
(error) => {
return Promise.reject(error);
},
);
/**
* 响应拦截器
*/
mockAxios.interceptors.response.use(
(response) => {
console.log("Mock Response:", response.data);
return response.data;
},
(error) => {
console.error("Mock Error:", error);
return Promise.reject(error);
},
);
export default mockAxios;
export {
mockDelete,
mockGet,
mockPost,
mockPut,
mockRequest,
};
......@@ -202,3 +202,30 @@ export function getSellerListApi(data) {
data.method = `${path2}staff.page.info`
return request(data, "post")
}
//订单管理-有效引荐数复核列表
export function getEffectiveReferralStoreList(data) {
data.method = "dj.staff.api.effective.referral.audit.page"
return request(data)
}
// 订单管理 - 有效引荐数 - 复核
export function effectiveReferralStoreAudit(data) {
data.method = "dj.staff.api.effective.referral.audit"
return request(data)
}
//订单管理-有效引荐数-详情
export function getEffectiveReferralStoreDetail(data) {
data.method = "dj.staff.api.effective.referral.detail"
return request(data)
}
/** 审核异常订单 */
export function auditGoodsOrderApplyRecord(data) {
data.method = `${path2}goodsOrderApplyRecord.audit.update`
return request(data, "post")
}
/** 获取审核订单详情数据 */
export function getAuditOrderDetail(data) {
data.method = `${path2}goodsOrderApplyRecord.detail.select`
return request(data, "post")
}
......@@ -30,7 +30,9 @@ const request = (
apiName = "dj.smartcarlife"
} else if (params.method.includes("risk.manage.api")) {
apiName = "riskmanage"
}else {
} else if (params.method.includes("dj.api.strategy")) {
apiName = "strategy"
} else {
// console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0]
}
......@@ -52,7 +54,8 @@ const request = (
"dj.businessSchool": "axios6",
script: "axios7",
staff: "axios9",
riskmanage:"axios10",
riskmanage: "axios10",
strategy: 'axios_strategy'
}
const baseApiName = mappingName[apiName]
// console.log(baseApiName, "baseApiName")
......@@ -88,7 +91,7 @@ const request = (
clue: "sha1",
script: "sha1",
staff: "sha1",
riskmanage:'sha1'
riskmanage: 'sha1'
}
// console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret
......
// 工资绩效
import request from "./request"
// 提成方案审批列表
export function getConfigApprovetList(data) {
data.method = `dj.staff.api.performance.config.approve.page`
return request(data)
}
// 门店提成方案列表(以门店为维度)
export function getStoreConfigList(data) {
data.method = `dj.staff.api.performance.store.config.page`
return request(data)
}
// 提成方案列表(以方案为维度)
export function getConfigList(data) {
data.method = `dj.staff.api.performance.config.page`
return request(data)
}
// 提成方案审批详情
export function getConfigApprovetDetail(data) {
data.method = `dj.staff.api.performance.config.approve.detail`
return request(data)
}
// 查询系统审批人查询人列表
export function getApproveConfig(data = {}) {
data.method = `dj.staff.api.performance.approve.config.get`
return request(data)
}
//考勤/工资申诉分页查询
export function getSalaryAppealList(data) {
data.method = `dj.staff.api.salaryappeal.page`
return request(data)
}
//查询申诉详情
export function getSalaryAppealDetail(data) {
data.method = `dj.staff.api.salaryappeal.detail`
return request(data)
}
//工资申诉去答复
export function replySalaryAppeal(data) {
data.method = `dj.staff.api.salaryappeal.reply`
return request(data)
}
//绩效规则配置详情
export function getPerfRuleConfigDetail(data = {}) {
data.method = `dj.staff.api.perf.rule.config.detail`
return request(data)
}
// 绩效规则配置编辑
export function updatePerfRuleConfig(data) {
data.method = `dj.staff.api.perf.rule.config.update`
return request(data)
}
// 绩效统计导出
export function exportPerfRule(data) {
data.method = `dj.staff.api.perf.rule.export`
return request(data)
}
//提成方案提交审批
export function submitConfigApprove(data) {
data.method = `dj.staff.api.performance.config.approve.submit`
return request(data)
}
......@@ -364,4 +364,15 @@ export function exportProfit(data) {
export function importProfit(data) {
data.method = `dj.api.script.merchant.profit.record.async.import`
return request(data, "post", ["file"])
}
\ No newline at end of file
}
//店铺设置-有效引荐列表
export function getEffectiveReferralList(data) {
data.method = "dj.staff.api.effective.referral.page"
return request(data)
}
//店铺设置-有效引荐列表导出
export function exportEffectiveReferralList(data) {
data.method = "dj.staff.api.effective.referral.export.async"
return request(data)
}
No preview for this file type
......@@ -329,17 +329,20 @@ $prefix: d2;
height: 200px !important;
overflow-y: scroll;
}
.tools-gltip {
.el-tooltip__popper.tools-gltip {
width: 238px !important;
height: auto !important;
background: #fff;
height: 95px !important;
}
.el-tooltip__popper.is-light {
width: 177px;
max-width: 400px;
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08) !important;
border: 1px solid #e4e7ed !important;
color: #666;
width: fit-content;
.tooltip-content-max{
max-height: 50vh;
overflow-y: auto;
}
}
.el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow {
......@@ -347,9 +350,14 @@ $prefix: d2;
}
.el-tooltip__popper.is-dark {
white-space: wrap;
width: 400px;
max-width: 400px;
height: auto;
padding: 8px 10px;
width: fit-content;
.tooltip-content-max{
max-height: 50vh;
overflow-y: auto;
}
}
.el-textarea {
.el-input__count {
......
......@@ -367,6 +367,19 @@ export const rangePickerOptions_outputValue = {
}
/**
* 时间控件-限制只能选当前年份的上一年1月1日至今
*/
export const rangePickerOptions_lastOneYear = {
disabledDate(date) {
const now = new Date()
const lastYearStart = new Date(now.getFullYear() - 1, 0, 1)
lastYearStart.setHours(0, 0, 0, 0)
// 禁用:大于今天 OR 小于去年1月1日
return date > now || date < lastYearStart
}
}
/**
* 店面配置-门店主机厂交付数/个人交付成交率
* 限制:当前日期>10号‌:仅允许选择当前月份;当前日期≤10号‌:允许选择当前月份和上个月;其他情况‌:禁用所有其他月份‌
*/
......
/**
* 规范化树形数据为统一结构 {label, value, children}。
*
* - 从 labelKeys/valueKeys 中按顺序取第一个存在的字段作为 label/value。
* - 从 childrenKeys 中按顺序取第一个为数组的字段作为 children,并递归处理。
* - 当某字段不存在时,label/value 会回退为空字符串,children 回退为空数组。
*
* @typedef {object} NormalizedNode
* @property {string} label 标签文本
* @property {any} value 节点值(可能为字符串、数字等)
* @property {NormalizedNode[]} children 子节点列表
* @property {boolean} [leaf] 当原始项无子节点字段时为 false
*
* @param {Array<Record<string, any>>} data 输入的树形数据数组
* @param {object} [options] 可选配置
* @param {string[]} [options.labelKeys] 候选标签字段顺序
* @param {string[]} [options.valueKeys] 候选值字段顺序
* @param {string[]} [options.childrenKeys] 候选子节点字段顺序
* @returns {NormalizedNode[]} 规范化后的树数据
*/
export function normalizeTree(
data,
{
labelKeys,
valueKeys,
childrenKeys,
outputKeys,
} = {
labelKeys: ["label", "name", "title", "defineName", "itemName"],
valueKeys: ["value", "id", "deptId", "itemId"],
childrenKeys: ["children", "nodes", "childrenList", "itemList"],
outputKeys: {
label: "label",
value: "value",
children: "children",
},
},
) {
if (!Array.isArray(data))
return [];
return data.map((item) => {
const label = labelKeys.find(k => item[k] != null);
const value = valueKeys.find(k => item[k] != null);
const childrenKey = childrenKeys.find(k => Array.isArray(item[k]));
const next = { ...item };
if (!(outputKeys.label in next))
next[outputKeys.label] = label ? item[label] : "";
if (!(outputKeys.value in next))
next[outputKeys.value] = value ? item[value] : "";
if (childrenKey) {
next[outputKeys.children] = normalizeTree(item[childrenKey], {
labelKeys,
valueKeys,
childrenKeys,
outputKeys,
});
} else if (!("leaf" in next)) {
next.leaf = false;
}
return next;
});
}
......@@ -395,6 +395,63 @@ export const Util = {
// 检查小数点后的长度是否不超过2
return decimalPart.length <= 2
},
getStatusItem(baseData, optKey, row, rowKey) {
if (!baseData || !baseData[optKey] || (!row && row !== 0)) return null
let value = rowKey ? row[rowKey] : row
let item = baseData[optKey].find((item) => item.confId == value)
return (item && item.confValue) || "-"
},
getStatusColor(status, optKey) {
if (status === null || status === undefined) return "#C0C4CC"
const map = (this.baseData && this.baseData[optKey]) || {}
return map[status] || "#C0C4CC"
},
getOptionsList(that, formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = that[formName].find((k) => k.name == refreshSigle)
var index = that[formName].findIndex((k) => k.name == refreshSigle)
that.$set(
that[formName][index],
"optionList",
deepClone(that.baseData[item.optionsName])
)
if (
hasAll &&
that.baseData[item.optionsName].length &&
that.baseData[item.optionsName][0][
that[formName][index].optionLabel
] !== "全部"
) {
const temp = {}
temp[that[formName][index].optionId] = ""
temp[that[formName][index].optionLabel] = "全部"
that[formName][index].optionList.unshift(temp)
}
} else {
that[formName].forEach((item, index) => {
if (item.type === "select" && that.baseData[item.optionsName]?.length) {
that.$set(
that[formName][index],
"optionList",
deepClone(that.baseData[item.optionsName])
)
if (
hasAll &&
that.baseData[item.optionsName].length &&
that.baseData[item.optionsName][0][
that[formName][index].optionLabel
] !== "全部"
) {
const temp = {}
temp[that[formName][index].optionId] = ""
temp[that[formName][index].optionLabel] = "全部"
that[formName][index].optionList.unshift(temp)
}
}
})
}
}
}
......@@ -406,3 +463,6 @@ export const deepClone = Util.deepClone
export const downLoadFile = Util.downLoadFile
export const returnFloat = Util.returnFloat
export const getExplorer = Util.getExplorer
export const getStatusItem = Util.getStatusItem
export const getStatusColor = Util.getStatusColor
export const getOptionsList = Util.getOptionsList
// 组件
import d2ContainerFull from "./components/d2-container-full.vue"
import d2ContainerFullBs from "./components/d2-container-full-bs.vue"
import d2ContainerGhost from "./components/d2-container-ghost.vue"
import d2ContainerGhostBs from "./components/d2-container-ghost-bs.vue"
import d2ContainerCard from "./components/d2-container-card.vue"
import d2ContainerCardBs from "./components/d2-container-card-bs.vue"
// import d2Source from './components/d2-source.vue'
export default {
name: "d2-container",
props: {
// 容器样式
type: {
type: String,
required: false,
default: "full"
},
// 滚动优化
betterScroll: {
type: Boolean,
required: false,
default: false
}
},
computed: {
// 始终返回渲染组件
component() {
if (this.type === "card" && !this.betterScroll) return d2ContainerCard
if (this.type === "card" && this.betterScroll) return d2ContainerCardBs
if (this.type === "ghost" && !this.betterScroll) return d2ContainerGhost
if (this.type === "ghost" && this.betterScroll) return d2ContainerGhostBs
if (this.type === "full" && !this.betterScroll) return d2ContainerFull
if (this.type === "full" && this.betterScroll) return d2ContainerFullBs
else {
return "div"
}
}
},
render(h) {
const slots = [this.$slots.default]
if (this.$slots.header) { slots.push(h("template", { slot: "header" }, [this.$slots.header])) }
if (this.$slots.footer) { slots.push(h("template", { slot: "footer" }, [this.$slots.footer])) }
return h(
"div",
{
ref: "container",
class: "container-component"
},
[
h(
this.component,
{
ref: "component",
props: this.$attrs,
on: {
scroll: (e) => this.$emit("scroll", e)
}
},
slots
)
// h(d2Source)
]
)
},
methods: {
// 返回顶部
scrollToTop() {
this.$refs.component.scrollToTop()
// 如果开启了 better scroll 还需要手动触发一遍 scroll 事件
const bs = this.$refs.component.BS
if (bs) this.$refs.component.scroll()
},
// 用法同原生方法 scrollBy
scrollBy(x = 0, y = 0, time = 300) {
if (this.betterScroll) {
const bs = this.$refs.component.BS
if (bs) {
bs.scrollBy(-x, -y, time)
// 手动触发一遍 scroll 事件
this.$refs.component.scroll()
}
} else {
this.$refs.component.$refs.body.scrollBy(x, y)
}
},
// 用法同原生方法 scrollTo
scrollTo(x = 0, y = 0, time = 300) {
if (this.betterScroll) {
const bs = this.$refs.component.BS
if (bs) {
bs.scrollTo(-x, -y, time)
// 手动触发一遍 scroll 事件
this.$refs.component.scroll()
}
} else {
this.$refs.component.$refs.body.scrollTo(x, y)
}
},
// 用法同原生方法 scrollTop
scrollTop(top = 0, time = 300) {
if (this.betterScroll) {
const bs = this.$refs.component.BS
if (bs) {
bs.scrollTo(bs.x, -top, time)
// 手动触发一遍 scroll 事件
this.$refs.component.scroll()
}
} else {
this.$refs.component.$refs.body.scrollTop = top
}
}
}
}
// 组件
import d2ContainerFull from "./components/d2-container-full.vue"
import d2ContainerFullBs from "./components/d2-container-full-bs.vue"
import d2ContainerGhost from "./components/d2-container-ghost.vue"
import d2ContainerGhostBs from "./components/d2-container-ghost-bs.vue"
import d2ContainerCard from "./components/d2-container-card.vue"
import d2ContainerCardBs from "./components/d2-container-card-bs.vue"
// import d2Source from './components/d2-source.vue'
export default {
name: "d2-container",
props: {
// 容器样式
type: {
type: String,
required: false,
default: "full"
},
// 滚动优化
betterScroll: {
type: Boolean,
required: false,
default: false
}
},
computed: {
// 始终返回渲染组件
component() {
if (this.type === "card" && !this.betterScroll) return d2ContainerCard
if (this.type === "card" && this.betterScroll) return d2ContainerCardBs
if (this.type === "ghost" && !this.betterScroll) return d2ContainerGhost
if (this.type === "ghost" && this.betterScroll) return d2ContainerGhostBs
if (this.type === "full" && !this.betterScroll) return d2ContainerFull
if (this.type === "full" && this.betterScroll) return d2ContainerFullBs
else {
return "div"
}
}
},
render(h) {
const slots = [this.$slots.default]
if (this.$slots.header) { slots.push(h("template", { slot: "header" }, [this.$slots.header])) }
if (this.$slots.footer) { slots.push(h("template", { slot: "footer" }, [this.$slots.footer])) }
return h(
"div",
{
ref: "container",
class: "container-component"
},
[
h(
this.component,
{
ref: "component",
props: this.$attrs,
on: {
scroll: (e) => this.$emit("scroll", e)
}
},
slots
)
// h(d2Source)
]
)
},
methods: {
// 返回顶部
scrollToTop() {
this.$refs.component.scrollToTop()
// 如果开启了 better scroll 还需要手动触发一遍 scroll 事件
const bs = this.$refs.component.BS
if (bs) this.$refs.component.scroll()
},
// 用法同原生方法 scrollBy
scrollBy(x = 0, y = 0, time = 300) {
if (this.betterScroll) {
const bs = this.$refs.component.BS
if (bs) {
bs.scrollBy(-x, -y, time)
// 手动触发一遍 scroll 事件
this.$refs.component.scroll()
}
} else {
this.$refs.component.$refs.body.scrollBy(x, y)
}
},
// 用法同原生方法 scrollTo
scrollTo(x = 0, y = 0, time = 300) {
if (this.betterScroll) {
const bs = this.$refs.component.BS
if (bs) {
bs.scrollTo(-x, -y, time)
// 手动触发一遍 scroll 事件
this.$refs.component.scroll()
}
} else {
this.$refs.component.$refs.body.scrollTo(x, y)
}
},
// 用法同原生方法 scrollTop
scrollTop(top = 0, time = 300) {
if (this.betterScroll) {
const bs = this.$refs.component.BS
if (bs) {
bs.scrollTo(bs.x, -top, time)
// 手动触发一遍 scroll 事件
this.$refs.component.scroll()
}
} else {
this.$refs.component.$refs.body.scrollTop = top
}
}
}
}
......@@ -15,6 +15,8 @@
:span-method="arraySpanMethod"
v-bind="$attrs"
v-scroll="scroll"
@select="handleSelectRow"
@select-all="handleSelectAll"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
......@@ -362,6 +364,7 @@
:page-size="page.pageSize"
:total="getListApi ? total : tableTotal"
:layout="layout"
:pager-count="pagerCount"
/>
</div>
</template>
......@@ -561,6 +564,15 @@ export default {
noDataText: {
type: String,
default: "暂无数据"
},
pagerCount: {
type: Number,
default: 7
}
},
computed:{
tableRef(){
return this.$refs[this.tableParams.mutiSelectName + 'MutiTable' || 'mutiTable']
}
},
......@@ -594,9 +606,8 @@ export default {
handleSelect(val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val
// 多选
this.$emit("selectionTable", val)
this.$emit("selectionTable", val, this.page.currentPage)
},
// 清空多选
clearMutiSelect() {
this.mutiSelectArr[this.tableParams.mutiSelectName] = []
......@@ -742,7 +753,7 @@ export default {
}
this.total = res.total
this.loading = false
this.$emit("setTableFinishFun", this.data)
this.$emit("setTableFinishFun", this.data , this.page.currentPage)
})
.catch(() => {
this.loading = false
......@@ -788,7 +799,15 @@ export default {
},
scroll(e) {
this.$emit("scroll", e)
}
},
//当用户手动勾选数据行的 Checkbox 时触发的事件 selection, row
handleSelectRow(selection, row){
this.$emit("selectRow", selection, row)
},
// 当用户手动勾选数据行的 Checkbox 时触发的事件 selection
handleSelectAll(selection){
this.$emit("selectAll", selection)
},
}
}
</script>
......
<script>
export default {
name: "EditableText",
inheritAttrs: false,
props: {
value: {
type: [String, Number],
default: undefined,
},
type: {
type: String,
default: "text", // text | number
},
precision: {
type: Number,
default: 2,
},
placeholder: {
type: String,
default: "请输入",
},
debug: {
type: Boolean,
default: false,
},
},
data() {
return {
editing: false,
innerValue: null,
};
},
computed: {
// 缓存判空结果
isEmpty() {
return this.value === "" || this.value === null || this.value === undefined;
},
// 缓存格式化后的数值
formattedValue() {
if (this.type !== "number" || this.isEmpty) {
return this.value;
}
const num = Number(this.value);
return Number.isNaN(num) ? this.value : num.toFixed(this.precision);
},
// 缓存显示值
displayValue() {
return this.isEmpty ? this.placeholder : (this.type === "number" ? this.formattedValue : this.value);
},
// 缓存 class 名称
showingClass() {
const classes = ["el-input_showing"];
if (this.$attrs.disabled)
classes.push("is-disabled");
if (this.isEmpty)
classes.push("has-placeholder");
return classes.join(" ");
},
// 当前编辑的值(编辑时使用 innerValue,否则使用 value)
currentValue() {
return this.editing ? this.innerValue : this.value;
},
},
methods: {
startEdit() {
if (this.$attrs.disabled)
return;
this.editing = true;
this.innerValue = this.value;
this.$nextTick(() => {
this.$refs.input?.focus();
});
},
confirm() {
this.editing = false;
// 只在值真正改变时才触发事件
if (this.innerValue !== this.value) {
this.$emit("input", this.innerValue);
this.$emit("change", this.innerValue);
}
},
cancel() {
this.editing = false;
this.innerValue = this.value;
},
handleInput(val) {
this.innerValue = val;
this.$emit("input", val);
},
handleBlur(e) {
this.confirm();
this.$listeners.blur?.(e);
},
handleKeydown(e) {
if (e.key === "Enter") {
this.confirm();
} else if (e.key === "Escape") {
this.cancel();
}
},
renderInput(h) {
const commonOn = {
...this.$listeners,
input: this.handleInput,
blur: this.handleBlur,
keydown: this.handleKeydown,
};
// number 类型
if (this.type === "number") {
return h("el-input-number", {
ref: "input",
props: {
...this.$attrs,
value: this.currentValue,
precision: this.precision,
},
on: commonOn,
});
}
// text 类型
return h("el-input", {
ref: "input",
props: {
...this.$attrs,
value: this.currentValue,
placeholder: this.placeholder,
},
on: commonOn,
});
},
},
render(h) {
if (this.debug || this.editing) {
return this.renderInput(h);
}
return h(
"div",
{
class: this.showingClass,
on: {
click: this.startEdit,
},
},
this.displayValue,
);
},
};
</script>
<style lang="scss">
.el-input_showing {
background-color: #fff;
border-radius: 4px;
height: 36px;
line-height: 36px;
border: 1px solid #dcdfe6;
font-size: 14px;
display: inline-block;
padding: 0 15px;
color: #606266;
cursor: "text";
vertical-align: middle;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
&.is-disabled {
background-color: #f5f7fa;
color: #c0c4cc;
cursor: not-allowed;
}
&.has-placeholder {
color: #c0c4cc;
}
}
.el-form-item.is-error {
.el-input_showing {
border-color: #f56c6c;
}
}
</style>
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import { uploadImg, syncUploadVideo, uploadVideo } from "@/api/sys.base"
import E from "wangeditor"
export default {
name: "TextBox",
data() {
return {
editor: "",
content: "",
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ["code"]
},
boxHeight: {
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
const _this = this
this.editor = new E("#div-demo")
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = "down"
this.editor.config.height = this.boxHeight
this.editor.config.width = "500px"
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = (html) => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit("change", this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit("focus")
}
// 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传图片大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const imgFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
imgFile.split(",")[1]
// _this.$apis.common.pictureUpload({ file: base64 }).then(res => {
uploadImg({ file: base64, compress: 0 }).then((res) => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function (
resultFiles,
insertVideoFn
) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传视频大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const videoFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
videoFile.split(",")[1]
_this.$apis.common.pictureUpload({ file: base64 }).then((res) => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
width: 575px;
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import { uploadImg, syncUploadVideo, uploadVideo } from "@/api/sys.base"
import { set } from "nprogress";
import E from "wangeditor"
export default {
name: "TextBox",
data () {
return {
editor: "",
content: "",
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ["code"]
},
boxHeight: {
type: Number,
default: 240
}
},
mounted () {
this.getEdit()
},
methods: {
getEdit () {
const _this = this
this.editor = new E("#div-demo")
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = "down"
this.editor.config.height = this.boxHeight
this.editor.config.width = "500px"
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = (html) => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit("change", this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit("focus")
}
// 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传图片大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const imgFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
imgFile.split(",")[1]
// _this.$apis.common.pictureUpload({ file: base64 }).then(res => {
uploadImg({ file: base64, compress: 0 }).then((res) => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function (
resultFiles,
insertVideoFn
) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传视频大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const videoFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
videoFile.split(",")[1]
_this.$apis.common.pictureUpload({ file: base64 }).then((res) => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.config.focus = false // 解决编辑器内输入框获取焦点
this.editor.create()
},
setEdit (html) {
if (html) this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit () {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
width: 575px;
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-09-01 15:41:23
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-01-19 18:15:28
* @FilePath: \dj-car-life-system\src\components\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import Vue from "vue"
import d2Container from "./d2-container"
......@@ -20,5 +28,6 @@ Vue.component("BaseDialog", () => import("./baseDialog/index.vue"))
Vue.component("GlsxCombiForm", () => import("./glsx-combi-form/index.vue"))
Vue.component("GLDialog", () => import("./GLDialog/index.vue"))
Vue.component("GlskFormDialog", () => import("./glsk-form-dialog/index.vue"))
Vue.component("glsxPreview", () => import("./preview/index.vue"))
// Vue.component([authButton.name], authButton)
Vue.component(authButton.name, authButton)
<template>
<transition name="viewer-fade">
<div
tabindex="-1"
ref="el-image-viewer__wrapper"
class="el-image-viewer__wrapper"
:style="{ 'z-index': zIndex }"
>
<div class="el-image-viewer__mask" @click="hide"></div>
<!-- CLOSE -->
<span class="el-image-viewer__btn el-image-viewer__close" @click="hide">
<i class="el-icon-circle-close"></i>
</span>
<!-- ARROW -->
<template v-if="!isSingle">
<span
class="el-image-viewer__btn el-image-viewer__prev"
:class="{ 'is-disabled': !infinite && isFirst }"
@click="prev"
>
<i class="el-icon-arrow-left" />
</span>
<span
class="el-image-viewer__btn el-image-viewer__next"
:class="{ 'is-disabled': !infinite && isLast }"
@click="next"
>
<i class="el-icon-arrow-right" />
</span>
</template>
<!-- ACTIONS -->
<div class="el-image-viewer__btn el-image-viewer__actions">
<div class="el-image-viewer__actions__inner">
<i class="el-icon-zoom-out" @click="handleActions('zoomOut')"></i>
<i class="el-icon-zoom-in" @click="handleActions('zoomIn')"></i>
<i class="el-image-viewer__actions__divider"></i>
<i :class="mode.icon" @click="toggleMode"></i>
<i class="el-image-viewer__actions__divider"></i>
<i
class="el-icon-refresh-left"
@click="handleActions('anticlocelise')"
></i>
<i
class="el-icon-refresh-right"
@click="handleActions('clocelise')"
></i>
</div>
</div>
<!-- CANVAS -->
<div class="el-image-viewer__canvas">
<img
v-for="(url, i) in urlList"
v-if="i === index"
ref="img"
class="el-image-viewer__img"
:key="url"
:src="currentImg"
:style="imgStyle"
@load="handleImgLoad"
@error="handleImgError"
@mousedown="handleMouseDown"
/>
</div>
</div>
</transition>
</template>
<script>
function rafThrottle(fn) {
let locked = false
return function (...args) {
if (locked) return
locked = true
window.requestAnimationFrame((_) => {
fn.apply(this, args)
locked = false
})
}
}
const on = (function () {
return function (element, event, handler) {
if (element && event && handler) {
element.addEventListener(event, handler, false)
}
}
})()
const off = (function () {
return function (element, event, handler) {
if (element && event) {
element.removeEventListener(event, handler, false)
}
}
})()
const isFirefox = function () {
return !!window.navigator.userAgent.match(/firefox/i)
}
const Mode = {
CONTAIN: {
name: "contain",
icon: "el-icon-full-screen"
},
ORIGINAL: {
name: "original",
icon: "el-icon-c-scale-to-original"
}
}
const mousewheelEventName = isFirefox() ? "DOMMouseScroll" : "mousewheel"
export default {
name: "elImageViewer",
props: {
urlList: {
type: Array,
default: () => []
},
zIndex: {
type: Number,
default: 2000
},
onSwitch: {
type: Function,
default: () => {}
},
onClose: {
type: Function,
default: () => {}
},
initialIndex: {
type: Number,
default: 0
}
},
data() {
return {
index: this.initialIndex,
isShow: false,
infinite: true,
loading: false,
mode: Mode.CONTAIN,
transform: {
scale: 1,
deg: 0,
offsetX: 0,
offsetY: 0,
enableTransition: false
}
}
},
computed: {
isSingle() {
return this.urlList.length <= 1
},
isFirst() {
return this.index === 0
},
isLast() {
return this.index === this.urlList.length - 1
},
currentImg() {
return this.urlList[this.index]
},
imgStyle() {
const { scale, deg, offsetX, offsetY, enableTransition } = this.transform
const style = {
transform: `scale(${scale}) rotate(${deg}deg)`,
transition: enableTransition ? "transform .3s" : "",
"margin-left": `${offsetX}px`,
"margin-top": `${offsetY}px`
}
if (this.mode === Mode.CONTAIN) {
style.maxWidth = style.maxHeight = "100%"
}
return style
}
},
watch: {
index: {
handler: function (val) {
this.reset()
this.onSwitch(val)
}
},
currentImg(val) {
this.$nextTick((_) => {
const $img = this.$refs.img[0]
if (!$img.complete) {
this.loading = true
}
})
}
},
methods: {
hide() {
console.log(888)
this.deviceSupportUninstall()
this.onClose()
},
deviceSupportInstall() {
this._keyDownHandler = rafThrottle((e) => {
const keyCode = e.keyCode
switch (keyCode) {
// ESC
case 27:
this.hide()
break
// SPACE
case 32:
this.toggleMode()
break
// LEFT_ARROW
case 37:
this.prev()
break
// UP_ARROW
case 38:
this.handleActions("zoomIn")
break
// RIGHT_ARROW
case 39:
this.next()
break
// DOWN_ARROW
case 40:
this.handleActions("zoomOut")
break
}
})
this._mouseWheelHandler = rafThrottle((e) => {
const delta = e.wheelDelta ? e.wheelDelta : -e.detail
if (delta > 0) {
this.handleActions("zoomIn", {
zoomRate: 0.015,
enableTransition: false
})
} else {
this.handleActions("zoomOut", {
zoomRate: 0.015,
enableTransition: false
})
}
})
on(document, "keydown", this._keyDownHandler)
on(document, mousewheelEventName, this._mouseWheelHandler)
},
deviceSupportUninstall() {
off(document, "keydown", this._keyDownHandler)
off(document, mousewheelEventName, this._mouseWheelHandler)
this._keyDownHandler = null
this._mouseWheelHandler = null
},
handleImgLoad(e) {
this.loading = false
},
handleImgError(e) {
this.loading = false
e.target.alt = "加载失败"
},
handleMouseDown(e) {
if (this.loading || e.button !== 0) return
const { offsetX, offsetY } = this.transform
const startX = e.pageX
const startY = e.pageY
this._dragHandler = rafThrottle((ev) => {
this.transform.offsetX = offsetX + ev.pageX - startX
this.transform.offsetY = offsetY + ev.pageY - startY
})
on(document, "mousemove", this._dragHandler)
on(document, "mouseup", (ev) => {
off(document, "mousemove", this._dragHandler)
})
e.preventDefault()
},
reset() {
this.transform = {
scale: 1,
deg: 0,
offsetX: 0,
offsetY: 0,
enableTransition: false
}
},
toggleMode() {
if (this.loading) return
const modeNames = Object.keys(Mode)
const modeValues = Object.values(Mode)
const index = modeValues.indexOf(this.mode)
const nextIndex = (index + 1) % modeNames.length
this.mode = Mode[modeNames[nextIndex]]
this.reset()
},
prev() {
if (this.isFirst && !this.infinite) return
const len = this.urlList.length
this.index = (this.index - 1 + len) % len
},
next() {
if (this.isLast && !this.infinite) return
const len = this.urlList.length
this.index = (this.index + 1) % len
},
handleActions(action, options = {}) {
if (this.loading) return
const { zoomRate, rotateDeg, enableTransition } = {
zoomRate: 0.2,
rotateDeg: 90,
enableTransition: true,
...options
}
const { transform } = this
switch (action) {
case "zoomOut":
if (transform.scale > 0.2) {
transform.scale = parseFloat(
(transform.scale - zoomRate).toFixed(3)
)
}
break
case "zoomIn":
transform.scale = parseFloat((transform.scale + zoomRate).toFixed(3))
break
case "clocelise":
transform.deg += rotateDeg
break
case "anticlocelise":
transform.deg -= rotateDeg
break
}
transform.enableTransition = enableTransition
}
},
mounted() {
this.deviceSupportInstall()
// add tabindex then wrapper can be focusable via Javascript
// focus wrapper so arrow key can't cause inner scroll behavior underneath
this.$refs["el-image-viewer__wrapper"].focus()
}
}
</script>
......@@ -182,5 +182,53 @@ util.formatTime = function (time) {
}
}
/**
* 防抖函数
*/
util.debounce = function (func, wait = 300, immediate = false) {
let timeout = null
let result
const debounced = function (...args) {
const context = this
// 清除之前的定时器
if (timeout) {
clearTimeout(timeout)
}
// 如果设置了立即执行
if (immediate) {
// 如果还没有执行过,立即执行
const callNow = !timeout
timeout = setTimeout(() => {
timeout = null
}, wait)
if (callNow) {
result = func.apply(context, args)
}
} else {
// 延迟执行
timeout = setTimeout(() => {
func.apply(context, args)
timeout = null
}, wait)
}
return result
}
// 添加取消方法
debounced.cancel = function () {
if (timeout) {
clearTimeout(timeout)
timeout = null
}
}
return debounced
}
export default util
export const deepClone = util.deepClone
export const debounce = util.debounce
import { BrowserTracing } from "@sentry/tracing";
// 接入sentry
import * as Sentry from "@sentry/vue";
import { Request } from "glsk-toolkit";
// Vue
import Vue from "vue"
// import axios from 'axios'
// import i18n from './i18n'
import App from "./App"
import Vue from "vue";
// import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
import VueLazyload from "vue-lazyload";
import { config } from "@/common/baseConfig";
import GLMapSdk from "@/common/glsk-mapapi-sdk";
import notice from "@/common/notice";
import util from "@/libs/util.js";
// 针对template模板中使用可选链操作符
import chaining from "@/plugin/chaining";
// 核心插件
import d2Admin from "@/plugin/d2admin"
import d2Admin from "@/plugin/d2admin";
// store
import store from "@/store/index"
// 针对template模板中使用可选链操作符
import chaining from "@/plugin/chaining"
// 接入sentry
import * as Sentry from "@sentry/vue"
import { BrowserTracing } from "@sentry/tracing"
import store from "@/store/index";
// import axios from 'axios'
// import i18n from './i18n'
import App from "./App";
// import D2Crud from '@d2-projects/d2-crud'
// 菜单和路由设置
import router from "./router"
import "default-passive-events"
import notice from "@/common/notice"
import "element-ui/lib/theme-chalk/index.css"
import { config } from "@/common/baseConfig"
import GLMapSdk from "@/common/glsk-mapapi-sdk"
// import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
import VueLazyload from "vue-lazyload"
import { Request } from "glsk-toolkit"
import util from "@/libs/util.js"
import router from "./router";
import "default-passive-events";
import "element-ui/lib/theme-chalk/index.css";
Vue.prototype.$mapapi = new GLMapSdk()
Vue.prototype.$mapapi = new GLMapSdk();
Vue.use(VueLazyload, {
// 懒加载默认加载图片
loading:
// 懒加载默认加载图片
loading:
"https://img02.glsx.com.cn/weapp/resource/saas/dj/images/img_loading.png",
attempt: 3 // 尝试加载次数
})
attempt: 3, // 尝试加载次数
});
// 实例化
process.env.NODE_ENV === "production" &&
Sentry.init({
Vue,
dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24",
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost", "my-site-url.com", /^\//]
})
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
logErrors: true,
// 解决火狐浏览器 无法捕获错误的问题
beforeSend(event, hint) {
const isNonErrorException =
event.exception.values[0].value.startsWith(
"Non-Error exception captured"
) ||
hint.originalException.message.startsWith(
"Non-Error exception captured"
)
if (isNonErrorException) {
// We want to ignore those kind of errors
return null
}
return event
}
// "send-default-pii": true
})
process.env.NODE_ENV === "production"
&& Sentry.init({
Vue,
dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24",
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost", "my-site-url.com", /^\//],
}),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
logErrors: true,
// 解决火狐浏览器 无法捕获错误的问题
beforeSend(event, hint) {
const isNonErrorException
= event.exception.values[0].value.startsWith(
"Non-Error exception captured",
)
|| hint.originalException.message.startsWith(
"Non-Error exception captured",
);
if (isNonErrorException) {
// We want to ignore those kind of errors
return null;
}
return event;
},
// "send-default-pii": true
});
// d2Admin 已导入
// import ElementUI from 'element-ui'
// Vue.use(ElementUI)
// 核心插件
Vue.use(d2Admin)
Vue.use(chaining)
Vue.use(d2Admin);
Vue.use(chaining);
// Vue.use(GLCombiForm)
Vue.prototype.notice = notice
Vue.prototype.notice = notice;
const isProd = process.env.NODE_ENV === "production"
const isProd = process.env.NODE_ENV === "production";
// console.log(isProd)
if (!isProd) {
Vue.config.devtools = true
Vue.config.devtools = true;
}
Vue.prototype.$EventBus = new Vue()
Vue.prototype.$EventBus = new Vue();
Vue.directive("preventReClick", {
bind: (el, binding) => {
let time = binding.value // 防抖时间
if (!time) {
// 用户若不设置防抖时间,则默认1s
time = 1000
}
let fun
el.addEventListener(
"click",
(event) => {
if (!fun) {
// 第一次执行
fun = setTimeout(() => {
fun = null
}, time)
} else {
// 直接取消当前事件
event && event.stopImmediatePropagation()
}
},
true
)
}
})
let baseConfig = config
bind: (el, binding) => {
let time = binding.value; // 防抖时间
if (!time) {
// 用户若不设置防抖时间,则默认1s
time = 1000;
}
let fun;
el.addEventListener(
"click",
(event) => {
if (!fun) {
// 第一次执行
fun = setTimeout(() => {
fun = null;
}, time);
} else {
// 直接取消当前事件
event && event.stopImmediatePropagation();
}
},
true,
);
},
});
let baseConfig = config;
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
fetch(
"https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config"
"https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config",
)
.then(
(response) => {
// 处理http响应
return response.json()
},
(error) => {
// 处理错误
console.log(error)
}
)
.then((response) => {
const { code, data } = response
console.log("response", code, response)
if (code == "200") {
console.log(data)
baseConfig = data
// console.log("baseConfig", baseConfig)
// window.$fetchConfig = data
} else {
baseConfig = response
window.$fetchConfig = response
console.log(response)
window.$gscApi = new Request({
...response.gsc,
// baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade',
// baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade',
session: {
requiresSession: true,
sessionId: (_) => util.cookies.get("token")
},
events: {
error: (error, config) => {
Vue.prototype.$message.error(error.msg)
},
logout: (response, config) => {
store.dispatch("d2admin/user/clear")
util.cookies.remove("token")
router.replace("/login")
Vue.prototype.$message.error("登录超时,请重新登录")
}
}
})
console.log(window.$gscApi, "========")
}
})
.finally(() => {
init()
})
.then(
(response) => {
// 处理http响应
return response.json();
},
(error) => {
// 处理错误
console.log(error);
},
)
.then((response) => {
const { code, data } = response;
console.log("response", code, response);
if (code == "200") {
console.log(data);
baseConfig = data;
// console.log("baseConfig", baseConfig)
// window.$fetchConfig = data
} else {
baseConfig = response;
window.$fetchConfig = response;
console.log(response);
window.$gscApi = new Request({
...response.gsc,
// baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade',
// baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade',
session: {
requiresSession: true,
sessionId: _ => util.cookies.get("token"),
},
events: {
error: (error, config) => {
Vue.prototype.$message.error(error.msg);
},
logout: (response, config) => {
store.dispatch("d2admin/user/clear");
util.cookies.remove("token");
router.replace("/login");
Vue.prototype.$message.error("登录超时,请重新登录");
},
},
});
console.log(window.$gscApi, "========");
}
})
.finally(() => {
init();
});
function init() {
new Vue({
router,
store,
// i18n,
render: (h) => {
// baseConfig.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// data
// console.log(data)
Vue.prototype.baseConfig = baseConfig
return h(App)
},
created() {
// 系统配置
Vue.config.devtools = true
// 展示系统信息
this.$store.commit("d2admin/releases/versionShow")
// 用户登录后从数据库加载一系列的设置
this.$store.dispatch("d2admin/account/load")
// 获取并记录用户 UA
this.$store.commit("d2admin/ua/get")
// 初始化全屏监听
this.$store.dispatch("d2admin/fullscreen/listen")
},
mounted() {}
}).$mount("#app")
new Vue({
router,
store,
// i18n,
render: (h) => {
// baseConfig.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// data
// console.log(data)
Vue.prototype.baseConfig = baseConfig;
return h(App);
},
created() {
// 系统配置
Vue.config.devtools = true;
// 展示系统信息
this.$store.commit("d2admin/releases/versionShow");
// 用户登录后从数据库加载一系列的设置
this.$store.dispatch("d2admin/account/load");
// 获取并记录用户 UA
this.$store.commit("d2admin/ua/get");
// 初始化全屏监听
this.$store.dispatch("d2admin/fullscreen/listen");
},
mounted() {},
}).$mount("#app");
}
export { baseConfig }
export { baseConfig };
......@@ -368,7 +368,19 @@ export const routerName = {
parentId: "90401"
}
]
}
},
{
authId: "9040147",
parentId: "90401",
label: "通过",
handle: "handleApproved"
},
{
authId: "9040148",
parentId: "90401",
label: "驳回",
handle: "handleRejected"
},
],
component: _import("orderManage/orderList")
},
......@@ -722,5 +734,38 @@ export const routerName = {
}
],
component: _import("orderManage/refundExamine")
},
90409: {
path: "/referralAudit",
name: "referralAudit",
meta: {
title: "引荐数审核",
authId: "90409",
parentId: "904",
cache: false
},
auth: [
{
authId: "9040903",
parentId: "90409",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9040901",
parentId: "90409",
label: "查看",
handle: "handleExamine"
},
{
authId: "9040902",
parentId: "90409",
label: "复核",
handle: "handleExamine"
}
],
component: _import("orderManage/referralAudit")
}
}
......@@ -847,5 +847,66 @@ export const routerName = {
}
],
component: _import("financeManage/ysprepaymentManage/index")
},
90518: {
path: "/exceptionOrderManage",
name: "exceptionOrderManage",
meta: {
title: "异常订单管理",
authId: "90518",
parentId: "905",
cache: false
},
auth: [
{
authId: "9051801",
parentId: "90518",
label: "对公打款确认",
category: "Button",
type: "primary",
handle: "handleImport"
},
{
authId: "9051802",
parentId: "90518",
label: "导出汇总表",
category: "Button",
type: "primary",
handle: "handleExportSummary"
},
{
authId: "9051803",
parentId: "90518",
label: "导出明细表",
category: "Button",
type: "primary",
handle: "handleExportDetail"
},
{
authId: "9051804",
parentId: "90518",
label: "明细",
handle: "handleDetail",
addRoutePath: [
{
authId: "905180401",
name: "详情",
parentId: "90518"
}
]
}
],
component: _import("financeManage/exceptionOrderManage/index")
},
905180401: {
path: "/exceptionOrderDetail",
name: "exceptionOrderDetail",
meta: {
title: "异常订单详情",
authId: "905180401",
parentId: "90518",
cache: false
},
component: _import("financeManage/exceptionOrderManage/detail")
}
}
......@@ -141,5 +141,54 @@ export const routerName = {
}
],
component: _import("earlyWarningManager/biEventManager/index")
}
},
91506: {
path: "/strategyCentre",
name: "strategyCentre",
meta: {
title: "策略中心",
authId: "91506",
parentId: "915",
cache: false
},
auth: [
{
authId: "9150601",
parentId: "91506",
label: "查看详情",
handle: "handleDetail",
addRoutePath: [
{
authId: "9150602",
name: "门店看板",
parentId: "91506"
}
]
}
],
component: _import("earlyWarningManager/strategyCentre/index")
},
91507: {
path: "/strategyAnalysis",
name: "strategyAnalysis",
meta: {
title: "策略分析",
authId: "91507",
parentId: "915",
cache: false
},
component: _import("earlyWarningManager/strategyAnalysis/index")
},
9150602: {
path: "/storeSignboard",
name: "storeSignboard",
meta: {
title: "门店看板",
authId: "9150601",
parentId: "91506",
activePath: "/storeSignboard",
cache: false
},
component: _import("earlyWarningManager/strategyCentre/storeSignboard/index")
},
}
import Vue from "vue"
import Vuex from "vuex"
import d2admin, { storeResets } from "./modules/d2admin"
import goodsInfoData from "./modules/goodsInfoData"
import FinancialRules from "./modules/FinancialRules"
Vue.prototype.$StoreReset = function () {
return new Promise((resolve) => {
storeResets.forEach((reset) => this.dispatch(reset))
resolve()
})
}
Vue.use(Vuex)
const isProd = process.env.NODE_ENV === "production"
// console.log(isProd)
if (!isProd) {
Vue.config.devtools = true
}
export default new Vuex.Store({
modules: {
d2admin,
goodsInfoData,
FinancialRules
}
})
import Vue from "vue";
import Vuex from "vuex";
import performanceFormStore from "@/views/residentManage/salaryPerformance/performanceScheme/store/performanceFormStore.js";
import d2admin, { storeResets } from "./modules/d2admin";
import FinancialRules from "./modules/FinancialRules";
import goodsInfoData from "./modules/goodsInfoData";
Vue.prototype.$StoreReset = function () {
return new Promise((resolve) => {
storeResets.forEach(reset => this.dispatch(reset));
resolve();
});
};
Vue.use(Vuex);
const isProd = process.env.NODE_ENV === "production";
// console.log(isProd)
if (!isProd) {
Vue.config.devtools = true;
}
export default new Vuex.Store({
modules: {
d2admin,
goodsInfoData,
FinancialRules,
PerformanceFormStore: performanceFormStore,
},
});
......@@ -375,6 +375,7 @@ export default {
}
} else {
this.notice.errorTips('上传文件不可超过9M')
document.getElementById('fileUpload').value = ''
}
},
handleImport() {
......
<template>
<div class="dashboard-card rank-card">
<div class="card-header">
<span class="card-title">线上运营分布</span>
</div>
<div class="rank-list">
<!-- 表头 -->
<div class="rank-header">
<span class="rank-header-col" style="flex: 1;">排名</span>
<span class="rank-header-col" style="flex: 1;">姓名</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">策略总数</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">占比</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">门店总数</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">占比</span>
</div>
<!-- 列表内容 -->
<block v-if="rankData.length > 0">
<div
class="rank-item"
v-for="(item, index) in rankData"
:key="index"
>
<!-- 排名 Icon 处理 -->
<div
class="rank-index"
:class="'rank-' + (index + 1)"
>
<img
v-if="index < 3"
:src="require(`@/assets/strategy/icon-strategy-rank0${index + 1}.png`)"
style="width: 24px; height: 24px;"
/>
<span
v-else
style="width: 20px; height: 20px; border-radius: 50%; opacity: 1; background: #2a58ad1a; display: inline-block; text-align: center; line-height: 20px;"
>{{ index + 1 }}</span>
</div>
<div class="rank-name" :title="item.staffName">{{ item.staffName }}</div>
<div class="rank-col">{{ item.strategyCount }}</div>
<div class="rank-col">{{ item.strategyCountPercent }}%</div>
<div class="rank-col">{{ item.storeCount }}</div>
<div class="rank-col">{{ item.storeCountPercent }}%</div>
</div>
</block>
<block v-else>
<!-- 空数据占位,实际显示在 .dashboard-card 层级 -->
</block>
</div>
<div v-if="rankData.length === 0" class="empty-box">
<img :src="noDataImg" alt="暂无数据">
<div class="empty-text">暂无数据</div>
</div>
<div class="bottom-cover"></div>
</div>
</template>
<script>
import noDataImg from "@/assets/strategy/emepty-strategy.png"
export default {
name: 'OnlineOperatorRanking',
props: {
// 排行榜数据(由父组件传递)
rankData: {
type: Array,
default: () => []
}
},
data() {
return {
noDataImg
};
}
};
</script>
<style lang="scss" scoped>
$bg-white: #fff;
.dashboard-card {
background: $bg-white;
border-radius: 4px;
padding: 20px;
padding-right: 28px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
position: relative;
&.rank-card {
height: 332px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.card-title {
font-size: 16px;
font-weight: 500;
color: #303133;
}
}
.bottom-cover {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 72px;
border-radius: 10px;
background: linear-gradient(0deg, #ffffff 0%, #ffffff00 100%);
}
}
/* 排行榜样式 */
.rank-list {
font-size: 13px;
.rank-header {
display: flex;
color: #909399;
.rank-header-col {
display: inline-block;
}
}
.rank-item {
display: flex;
align-items: center;
box-sizing: border-box;
margin-top: 16px;
&:last-child {
border-bottom: none;
}
.rank-index {
flex: 1;
}
.rank-name {
flex: 1;
color: #303133;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.rank-col {
flex: 1;
text-align: center;
color: #606266;
}
}
}
.empty-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 12px;
color: #909399;
text-align: center;
width: calc(100% - 48px); // 减去左右 padding (20px + 28px)
box-sizing: border-box;
img {
width: 86px;
height: 86px;
}
.empty-text {
margin-top: 0;
}
}
</style>
<template>
<div class="dashboard-card chart-card">
<div class="card-header">
<span class="card-title">策略类型分布</span>
<div class="operator-filter">
线上运营人员:
<el-select
:value="operatorFilter"
size="mini"
style="width: 120px;"
@change="handleOperatorChange"
>
<el-option
v-for="operator in operatorList"
:key="operator.value"
:label="operator.label"
:value="operator.value"
></el-option>
</el-select>
</div>
</div>
<div class="chart-container" v-show="hasChartData">
<!-- ECharts 容器 -->
<div ref="pieChart" class="echart-box"></div>
<!-- 自定义图例 -->
<div class="custom-legend">
<div
class="legend-item"
v-for="(item, index) in processedPieData"
:key="index"
>
<div
class="legend-dot"
:style="{ background: item.color }"
></div>
<div class="legend-name">{{ item.name }}</div>
<div class="legend-right">
<div class="legend-percent">{{ item.percent }}%</div>
<span class="legend-sep">|</span>
<div class="legend-value">{{ item.value }}</div>
</div>
</div>
</div>
</div>
<div v-show="!hasChartData" class="empty-box">
<img :src="noDataImg" alt="暂无数据">
<div class="empty-text">暂无数据</div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import { merchantStaffByRoleList } from '@api/index';
import noDataImg from "@/assets/strategy/emepty-strategy.png";
/**
* 策略类型配置(统一管理名称和颜色)
* @type {Object<number, {name: string, color: string}>}
*/
const STRATEGY_TYPE_CONFIG = {
0: { name: '学习', color: '#409EFF' },
1: { name: '优秀案例分享', color: '#36CBCB' },
2: { name: '带教', color: '#67C23A' },
3: { name: '任务下发', color: '#FFD666' },
4: { name: '销售精英到店提拉', color: '#B3E19D' },
5: { name: '强力促销', color: '#E6A23C' },
6: { name: '最终盘点与低客单产品购入', color: '#9254DE' }
};
/**
* 获取策略类型配置
* @param {number} strategyType - 策略类型编号
* @returns {{name: string, color: string}}
*/
const getStrategyTypeConfig = (strategyType) => {
return STRATEGY_TYPE_CONFIG[strategyType];
};
/**
* 转换策略类型分布数据为图表数据格式
* @param {Array} apiData - API 返回的原始数据
* @returns {Array} 图表数据
*/
const transformStrategyData = (apiData) => {
if (!Array.isArray(apiData) || apiData.length === 0) {
return [];
}
// 过滤有效数据并计算总数
const validData = apiData.filter(item => (item.strategyCount || 0) > 0);
const total = validData.reduce((sum, item) => sum + (item.strategyCount || 0), 0);
// 转换数据格式
return validData
.map(item => {
const { strategyType, strategyCount = 0, percent } = item;
const config = getStrategyTypeConfig(strategyType);
const calculatedPercent = percent ?? (total > 0 ? Math.round((strategyCount / total) * 100) : 0);
return {
name: config.name,
value: strategyCount,
percent: calculatedPercent,
color: config.color,
strategyType // 保留原始类型用于调试
};
})
.sort((a, b) => b.value - a.value); // 按数量降序排序
};
export default {
name: 'StrategyTypeDistribution',
props: {
// 策略类型分布原始数据(由父组件传递)
pieData: {
type: Array,
default: () => []
},
// 运营人员筛选值(双向绑定)
operatorFilter: {
type: [String, Number],
default: null
}
},
data() {
return {
noDataImg,
myChart: null,
// 运营人员列表
operatorList: [
{ label: '全部', value: null },
],
// 处理后的图表数据
processedPieData: []
};
},
computed: {
/**
* 图表数据总数
*/
chartTotal() {
return this.processedPieData.reduce((sum, item) => sum + (item.value || 0), 0);
},
/**
* 图表是否有数据
*/
hasChartData() {
return this.processedPieData.length > 0 && this.chartTotal > 0;
},
/**
* ECharts 配置项
*/
chartOption() {
return this.getChartOption();
}
},
watch: {
// 监听原始数据变化,处理数据并更新图表
pieData: {
handler(newData) {
this.processedPieData = transformStrategyData(newData);
this.$nextTick(() => {
this.updateChart();
});
},
immediate: true,
deep: true
}
},
mounted() {
this.initChart();
window.addEventListener('resize', this.resizeChart);
// 获取线上运营列表
this.getOnlineOpsList();
// 数据加载由 watch 统一管理,无需在此处调用
},
beforeDestroy() {
// 清理图表实例
if (this.myChart) {
this.myChart.dispose();
this.myChart = null;
}
// 清理事件监听器
window.removeEventListener('resize', this.resizeChart);
},
methods: {
/**
* 获取线上运营列表
*/
getOnlineOpsList() {
merchantStaffByRoleList({ roleName: '线上运营' }).then((res) => {
if (res) {
// 将返回的数据转换为选择器需要的格式
this.operatorList = res.map(item => ({
value: item.uuid,
label: item.staffName
}));
// 在列表前面添加"全部"选项
if (this.operatorList.length && this.operatorList[0].label !== '全部') {
this.operatorList.unshift({
value: null,
label: '全部'
});
}
}
});
},
/**
* 处理运营人员选择变化
*/
handleOperatorChange(value) {
// 通过 .sync 修饰符自动更新父组件的值
this.$emit('update:operatorFilter', value);
},
/**
* 生成 ECharts 配置项
* @returns {Object} ECharts 配置对象
*/
getChartOption() {
return {
series: [
{
name: '策略总数',
type: 'pie',
radius: ['55%', '75%'],
center: ['50%', '50%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 0,
borderColor: '#fff',
borderWidth: 2,
},
label: {
show: true,
position: 'center',
formatter: this.hasChartData ? `策略总数` : '暂无数据',
fontSize: 18,
color: '#666666',
lineHeight: 20
},
emphasis: {
},
labelLine: {
show: false
},
data: this.processedPieData.map(item => ({
value: item.value,
name: item.name,
itemStyle: { color: item.color }
}))
}
]
};
},
/**
* 更新图表(使用 computed 配置)
*/
updateChart() {
if (!this.myChart) {
console.warn('图表实例未初始化');
return;
}
try {
this.myChart.setOption(this.chartOption, true); // true 表示不合并,使用新配置
} catch (error) {
console.error('图表更新失败:', error);
}
},
/**
* 初始化图表
*/
initChart() {
const chartDom = this.$refs.pieChart;
if (!chartDom) return;
this.myChart = echarts.init(chartDom);
// 初始时使用空数据,等待API数据加载后再更新
this.updateChart();
},
/**
* 图表窗口大小调整
*/
resizeChart() {
if (this.myChart) {
this.myChart.resize();
}
},
}
};
</script>
<style lang="scss" scoped>
$bg-white: #fff;
.dashboard-card {
background: $bg-white;
border-radius: 4px;
padding: 20px;
padding-right: 28px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
position: relative;
&.chart-card {
height: 332px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.card-title {
font-size: 16px;
font-weight: 500;
color: #303133;
}
.operator-filter {
font-size: 13px;
color: #909399;
}
}
}
/* 图表容器样式 */
.chart-container {
display: flex;
align-items: center;
justify-content: flex-end;
}
.echart-box {
width: 200px;
height: 200px;
flex-shrink: 0;
}
.custom-legend {
font-size: 13px;
margin-left: 20%;
.legend-item {
display: flex;
align-items: center;
margin-bottom: 12px;
color: #606266;
width: 306px;
.legend-dot {
width: 8px;
height: 8px;
border-radius: 2px;
margin-right: 8px;
}
.legend-name {
flex: 1;
}
.legend-right {
display: flex;
align-items: center;
justify-content: flex-end;
}
.legend-percent {
text-align: right;
color: #909399;
}
.legend-value {
text-align: right;
color: #303133;
font-weight: 500;
}
.legend-sep {
color: #E4E7ED;
margin: 0 8px;
}
}
}
.empty-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 12px;
color: #909399;
text-align: center;
width: calc(100% - 48px); // 减去左右 padding (20px + 28px)
box-sizing: border-box;
img {
width: 86px;
height: 86px;
}
.empty-text {
margin-top: 0;
}
}
</style>
<template>
<div class="top-header">
<!-- 左侧 Tabs -->
<div class="tabs-nav" ref="tabsNav">
<div
v-for="(tab, index) in tabs"
:key="getTabKey(tab, index)"
:ref="`tabItem${index}`"
:class="['tab-item', { active: isTabActive(tab) }]"
@click="switchTab(tab)"
>
{{ getTabLabel(tab) }}
</div>
<!-- 选中指示条 - 独立元素,通过动态计算位置实现滑动效果 -->
<div
class="active-line"
:style="activeLineStyle"
></div>
</div>
<!-- 右侧 筛选区 + 按钮 -->
<div class="filter-area" v-if="showRightArea">
<div class="filter-group">
<span class="label">区域:</span>
<el-select
v-model="localFilters.provinceId"
size="small"
placeholder="全部"
class="filter-select"
filterable
clearable
>
<el-option
v-for="item in provinceOptions"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</div>
<div class="filter-group">
<span class="label">品牌:</span>
<el-cascader
v-model="localFilters.brand"
:options="brandOptions"
:props="cascaderProps"
collapse-tags
size="small"
filterable
class="filter-select-brand"
placeholder="全部"
:show-all-levels="false"
clearable></el-cascader>
</div>
<div class="filter-group">
<span class="label">区域运营:</span>
<el-select v-model="localFilters.regionOps" size="small" placeholder="全部" class="filter-select" filterable clearable>
<el-option
v-for="item in regionOpsOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</div>
<div class="filter-group">
<span class="label">线上运营:</span>
<el-select v-model="localFilters.onlineOps" size="small" placeholder="全部" class="filter-select" filterable clearable>
<el-option
v-for="item in onlineOpsOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</div>
<!-- 按钮组 -->
<div class="btn-group">
<el-button type="primary" size="small" class="btn-search" @click="handleSearch">查询</el-button>
<el-button size="small" class="btn-reset" @click="handleReset">重置</el-button>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'HeaderCustom',
props: {
// Tabs 配置
tabs: {
type: Array,
default: () => ['延保', '权益', '轻改']
},
// 当前选中的 Tab
value: {
type: [String, Object],
default: () => ({label:'延保',value:0})
},
// 筛选条件
filters: {
type: Object,
default: () => ({
region: '',
provinceId: '',
brand: [],
regionOps: '',
onlineOps: ''
})
},
// 品牌级联选择器数据
brandOptions: {
type: Array,
default: () => []
},
// 省份选项数据
provinceOptions: {
type: Array,
default: () => []
},
// 城市选项数据
cityOptions: {
type: Array,
default: () => []
},
// 区域运营选项数据
regionOpsOptions: {
type: Array,
default: () => []
},
// 线上运营选项数据
onlineOpsOptions: {
type: Array,
default: () => []
},
// 控制筛选区域是否展示
showRightArea: {
type: Boolean,
default: false
}
},
data() {
return {
currentTab: this.value,
activeLineStyle: { transform: 'translateX(0px)', width: '52px' },
localFilters: {
...this.filters,
provinceId: this.filters.provinceId || ''
},
// 级联选择器配置
cascaderProps: {
value: 'id',
label: 'label',
children: 'children',
expandTrigger: 'hover',
emitPath: true,
checkStrictly: true, // 允许选择任意一级
multiple: true // 启用多选功能(Element UI 2.x 需要在 props 中配置)
}
};
},
watch: {
// 监听外部传入的 value 变化
value(newVal) {
this.currentTab = newVal;
this.$nextTick(this.updateActiveLinePosition);
},
// 监听外部传入的 filters 变化
filters: {
handler(newVal) {
this.localFilters = {
...newVal,
provinceId: newVal.provinceId || ''
};
},
deep: true
}
},
mounted() {
this.$nextTick(this.updateActiveLinePosition);
},
methods: {
switchTab(tab) {
this.currentTab = tab;
this.$emit('input', tab);
this.$emit('tab-change', tab);
this.$nextTick(this.updateActiveLinePosition);
},
updateActiveLinePosition() {
const currentIndex = this.getCurrentTabIndex();
const tabItemRef = this.$refs[`tabItem${currentIndex}`];
if (!tabItemRef?.[0]) return;
const { offsetLeft, offsetWidth } = tabItemRef[0];
this.activeLineStyle = {
transform: `translateX(${offsetLeft}px)`,
width: `${offsetWidth}px`
};
},
// 获取 tab 的 key(用于 v-for)
getTabKey(tab, index) {
if (typeof tab === 'string') {
return tab;
}
return tab.value !== undefined ? tab.value : index;
},
// 获取 tab 的 label(用于显示)
getTabLabel(tab) {
if (typeof tab === 'string') {
return tab;
}
return tab.label || tab;
},
// 判断 tab 是否激活
isTabActive(tab) {
if (typeof this.currentTab === 'string' && typeof tab === 'string') {
return this.currentTab === tab;
}
if (typeof tab === 'object' && typeof this.currentTab === 'object') {
// 比较 value 或整个对象
if (tab.value !== undefined && this.currentTab.value !== undefined) {
return tab.value === this.currentTab.value;
}
// 如果没有 value,比较 label
if (tab.label !== undefined && this.currentTab.label !== undefined) {
return tab.label === this.currentTab.label;
}
// 最后比较整个对象
return JSON.stringify(tab) === JSON.stringify(this.currentTab);
}
// 混合类型比较:字符串和对象
if (typeof tab === 'object' && typeof this.currentTab === 'string') {
return tab.label === this.currentTab;
}
if (typeof tab === 'string' && typeof this.currentTab === 'object') {
return tab === this.currentTab.label;
}
return false;
},
// 获取当前 tab 的索引
getCurrentTabIndex() {
return this.tabs.findIndex(tab => this.isTabActive(tab));
},
handleSearch() {
this.$emit('search', { ...this.localFilters });
},
handleReset() {
const resetFilters = {
region: '',
provinceId: '',
brand: [],
regionOps: '',
onlineOps: ''
};
this.localFilters = { ...resetFilters };
this.$emit('reset', resetFilters);
this.$emit('search', resetFilters);
}
}
};
</script>
<style lang="scss" scoped>
// 颜色变量
$primary: #2A58AD;
$text-main: #1D2129;
$text-sub: #333333;
$text-sub-2: #666666;
$border: #E5E6EB;
$bg-red: #FEF0F0;
$text-red: #F53F3F;
$bg-orange: #FDF6EC;
$text-orange: #FF7D00;
// ================= Top Header =================
.top-header {
background: #fff;
height: 54px;
display: flex;
align-items: center;
padding: 0 24px;
border-radius: 4px;
margin-bottom: 1px;
position: sticky;
top: 0;
z-index: 100;
// 确保 sticky 定位正常工作
flex-shrink: 0;
}
.tabs-nav {
position: relative;
display: flex;
height: 100%;
.tab-item {
height: 100%;
width: 54px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 32px;
font-size: 16px;
color: $text-sub;
cursor: pointer;
transition: all 0.2s;
&:hover { color: $primary; }
&.active { color: $primary; font-weight: 500; font-size: 16px;}
}
}
.active-line {
position: absolute;
bottom: 0;
left: 0;
height: 3px;
background: $primary;
border-radius: 2px 2px 0 0;
transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.filter-area {
display: flex;
align-items: center;
justify-content: flex-end;
margin-left: auto;
.filter-group {
display: flex;
align-items: center;
margin-right: 24px;
.label { font-size: 14px; color: $text-sub; margin-right: 8px; white-space: nowrap; }
.filter-select { width: 123px; }
.filter-select-brand {
min-width: 120px;
width: auto;
}
}
.btn-group { display: flex; gap: 12px; }
.btn-search { background: $primary; border-color: $primary; border-radius: 4px;&:hover { opacity: 0.9; }}
.btn-reset { background: #F2F3F5; border-color: #F2F3F5; color: $text-sub; &:hover { background: #e5e6eb; } border-radius: 4px;}
}
// 覆盖 Element UI 样式
::v-deep {
.el-input__inner {
border-radius: 2px;
border-color: $border;
color: $text-main;
&:hover { border-color: #C9CDD4; }
&:focus { border-color: $primary; }
}
.el-button--small { border-radius: 2px; }
// 确保级联选择器的 input 宽度自适应
.filter-select-brand {
.el-input {
width: 100%;
}
.el-input__inner {
width: 100%;
min-width: 120px;
}
.el-cascader__tags {
flex-wrap: nowrap;
}
}
}
</style>
<template>
<div class="monitor-card" :class="{ 'is-checked': cardData.checked }">
<div class="card-head">
<el-tooltip effect="dark" placement="bottom" popper-class="dark-tooltip" :disabled="!cardData.storeName">
<div slot="content" style="width:236px;line-height:1.6;word-break:break-all;">{{ cardData.storeName }}</div>
<div class="company-name">{{ cardData.storeName }}</div>
</el-tooltip>
<el-checkbox @change="handleCheckboxChange" v-model="cardData.checked" class="card-checkbox"></el-checkbox>
</div>
<div class="card-body" @click="handleViewDetail">
<div class="row-item">
<span class="label">主营品牌:</span>
<el-tooltip effect="dark" placement="top" popper-class="dark-tooltip" :disabled="!cardData.mainBrands">
<div slot="content" style="max-width:236px;line-height:1.6;word-break:break-all;">{{ cardData.mainBrands }}</div>
<span class="val">{{ cardData.mainBrands || '-' }}</span>
</el-tooltip>
</div>
<div class="row-item">
<span class="label">线上运营:</span>
<el-tooltip :disabled="!cardData.onlineOperators" effect="dark" placement="top" popper-class="dark-tooltip">
<div slot="content" style="max-width:236px;line-height:1.6;">{{ cardData.onlineOperators }}</div>
<span class="val">{{ cardData.onlineOperators || '-' }}</span>
</el-tooltip>
</div>
<div class="row-item">
<span class="label">区域运营:</span>
<el-tooltip :disabled="!cardData.regionalOperators" effect="dark" placement="top" popper-class="dark-tooltip">
<div slot="content" style="max-width:236px;line-height:1.6;">{{ cardData.regionalOperators }}</div>
<span class="val">{{ cardData.regionalOperators || '-' }}</span>
</el-tooltip>
</div>
<!-- 预警标签组 -->
<div v-if="cardData.warningSummary && cardData.warningSummary.length > 0" class="alert-group">
<div v-for="(item, index) in cardData.warningSummary" :key="index" :class="['alert-tag', item.includes('兜底预警') ? 'red' : 'orange']">
<img :src="getAlertIcon(item)" alt="" class="icon-img">
<span style=" font-size: 13px;">{{ item }}</span>
</div>
</div>
</div>
<div class="card-foot" @click="handleViewDetail">
<span class="info">共{{ cardData.warningTotalCount }}项预警</span>
<span class="link">查看详情 <img src="@/assets/strategy/icon-strategy-arrow-r.png" alt="" srcset="" class="icon-arrow"></span>
</div>
</div>
</template>
<script>
export default {
name: 'MonitorCard',
props: {
// 卡片数据
cardData: {
type: Object,
required: true,
default: () => ({})
},
// 卡片索引
index: {
type: Number,
default: 0
},
// 时间范围类型
timeRangeType: {
type: Object,
default: () => ({ label: '周', value: 1 })
},
// 日期范围
dateRange: {
type: Object,
default: () => ({ startDate: null, endDate: null })
}
},
methods: {
handleCheckboxChange() {
// 触发复选框变化事件,传递卡片数据和索引
this.$emit('checkbox-change', this.cardData, this.index);
},
handleViewDetail() {
// 获取 merchantNo 并跳转到门店看板页面
if (this.cardData.merchantNo) {
// 构建查询参数
const query = {
merchantNo: this.cardData.merchantNo,
storeName: this.cardData.storeName
};
// 添加时间范围类型
if (this.timeRangeType && this.timeRangeType.value !== undefined) {
query.timeRangeType = this.timeRangeType.value;
}
// 添加日期范围
if (this.dateRange) {
if (this.dateRange.startDate) {
query.startDate = this.dateRange.startDate;
}
if (this.dateRange.endDate) {
query.endDate = this.dateRange.endDate;
}
}
this.$router.push({
path: '/storeSignboard',
query
});
}
},
// 获取预警图标
getAlertIcon(item) {
// Tode: 数据未返回具体字段类型,因此经沟通智能暂时先通过字符串截取判断
return item.includes('兜底预警')
? require('@/assets/strategy/icon-strategy-type01.png')
: require('@/assets/strategy/icon-strategy-type02.png');
},
// 获取预警标签文本
getAlertLabel(index) {
return index === 0 ? '兜底指标:' : '生态预警:';
}
}
};
</script>
<style lang="scss" scoped>
// 颜色变量
$primary: #2A58AD;
$text-main: #1D2129;
$text-sub: #333333;
$bg-red: #FEF0F0;
$text-red: #F53F3F;
$bg-orange: #FDF6EC;
$text-orange: #FF7D00;
.monitor-card {
background: #fff;
border-radius: 8px;
border: 1px solid #0000001a;
box-shadow: 0 0 8px 0 #0000000d;
min-height: 266px;
transition: all 0.3s;
display: flex;
flex-direction: column;
&:hover {
border: 1px solid #0000001a;
background: #f9f9f9;
box-shadow: 0 0 8px 0 #0000000d;
}
.card-head {
padding: 16px 20px 0;
display: flex;
justify-content: space-between;
align-items: flex-start;
.company-name {
flex: 1;
padding-right: 10px;
font-size: 16px;
font-weight: 500;
color: $text-main;
line-height: 1.4;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-checkbox { transform: scale(1.1); margin-top: 2px; }
}
.card-body {
padding: 12px 20px 16px;
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
padding-bottom: 0px;
cursor: pointer;
.row-item {
display: flex;
margin-bottom: 8px;
font-size: 14px;
line-height: 1.5;
.label { color: #666666; white-space: nowrap; }
.val { color: $text-main; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.alert-group { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.alert-tag {
padding: 7px 10px;
border-radius: 4px;
font-size: 12px;
display: flex;
align-items: center;
color: #606266;
i { margin-right: 6px; font-size: 14px; }
.icon-img {
width: 18px;
height: 18px;
border-radius: 3px;
margin-right: 6px;
object-fit: contain;
}
&.red { background: $bg-red; i { color: $text-red; } }
&.orange { background: $bg-orange; i { color: $text-orange; } }
}
}
.card-foot {
padding: 0 20px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 13px;
height: 42px;
.info { color: #86909C; }
.link {
color: $primary;
cursor: pointer;
display: flex;
align-items: center;
i { font-size: 12px; margin-left: 4px; }
.icon-arrow {
width: 16px;
height: 16px;
margin-left: 6px;
padding-top: 2px;
}
&:hover { opacity: 0.8; }
}
}
}
</style>
<style>
/* 全局样式 - tooltip 样式 */
.dark-tooltip { background: #000000 !important; }
</style>
<template>
<el-popover
placement="bottom-start"
:width="popoverWidth"
trigger="click"
popper-class="pure-popover"
v-model="popoverVisible"
>
<ul class="popover-list">
<li
v-for="(item, index) in options"
:key="index"
:class="{ 'is-selected': isSelected(item) }"
@click="handleSelect(item)"
style="font-size: 14px;"
>
<!-- 支持图片图标 -->
<img
v-if="item.iconUrl"
:src="item.iconUrl"
alt=""
class="icon-img"
>
<!-- 支持字体图标 -->
<i
v-else-if="item.icon"
:class="item.icon"
></i>
{{ item.label }}
</li>
</ul>
<div
slot="reference"
class="icon-text-btn"
:class="{ 'has-selected': value && value.label && value.label !== defaultText }"
>
<!-- 触发按钮图标:支持图片和字体图标 -->
<img
v-if="triggerIconType === 'image'"
:src="triggerIcon"
alt=""
class="icon-img"
>
<i
v-else-if="triggerIconType === 'icon'"
:class="triggerIcon"
></i>
<span>{{ label }}:{{ currentValue }}</span>
</div>
</el-popover>
</template>
<script>
export default {
name: 'SelectCustom',
props: {
// 选项列表
options: {
type: Array,
required: true,
default: () => []
},
// 当前选中的值
value: {
type: Object,
default: () => ({ label: '盯防类型', value: '' })
},
// 标签文本(如"盯防类型"、"指标类型")
label: {
type: String,
required: true
},
// 触发按钮的图标(可以是图片路径或图标类名)
triggerIcon: {
type: String,
required: true
},
// 触发按钮图标类型:'image' | 'icon'
triggerIconType: {
type: String,
default: 'icon',
validator: (value) => ['image', 'icon'].includes(value)
},
// 默认文本(用于判断是否选中状态)
defaultText: {
type: String,
default: '全部'
},
// popover宽度
popoverWidth: {
type: Number,
default: 120
}
},
data() {
return {
popoverVisible: false
};
},
computed: {
// 当前显示的值
currentValue() {
if (this.value && typeof this.value === 'object' && this.value.label) {
return this.value.label;
}
return this.defaultText;
}
},
methods: {
// 处理选择
handleSelect(item) {
this.popoverVisible = false;
// 触发change事件,传递选中的项
this.$emit('change', item);
// 同时触发input事件,支持v-model,传递包含label和value的对象
const selectedValue = {
label: item.label,
value: item.value !== undefined ? item.value : item.label
};
this.$emit('input', selectedValue);
},
// 判断选项是否被选中
isSelected(item) {
if (!this.value) return false;
// 优先比较value属性,如果没有value则比较label
const itemValue = item.value !== undefined ? item.value : item.label;
const currentValue = this.value.value !== undefined ? this.value.value : this.value.label;
return itemValue === currentValue;
}
}
};
</script>
<style lang="scss" scoped>
.icon-text-btn {
cursor: pointer;
display: flex;
align-items: center;
padding: 4px 8px;
border-radius: 4px;
transition: all 0.3s;
font-size: 14px;
color: #333333;
&:hover {
color: #2A58AD;
}
i {
margin-right: 6px;
font-size: 16px;
}
.icon-img {
width: 16px;
height: 16px;
margin-right: 6px;
object-fit: contain;
vertical-align: middle;
}
&.has-selected {
background-color: #EFF3F6;
}
}
</style>
<style>
/* 全局样式,与父组件保持一致 */
.pure-popover {
padding: 4px 0 !important;
border-color: #E5E6EB !important;
box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}
.popover-list {
list-style: none;
margin: 0;
padding: 0;
li {
padding: 9px 16px;
cursor: pointer;
color: #333333;
font-size: 12px;
display: flex;
align-items: center;
&.is-selected {
background-color: #f7f7f7;
}
&:hover {
background-color: #F2F3F5;
}
i {
margin-right: 8px;
font-size: 14px;
}
.icon-img {
width: 18px;
height: 18px;
border-radius: 3px;
margin-right: 8px;
}
}
}
</style>
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content"
@handleClick="submit"
:config="config"
>
<div
class="content"
:key="viewKey"
>
<div class="left">
<div class="title flex">录音列表</div>
<div class="left-content">
<div class="search-box flex">
<el-input
placeholder="搜索员工名称"
size="small"
class="search-input"
clearable
v-model="searchForm.staffName"
></el-input>
<el-date-picker
v-model="searchForm.receptionDate"
size="small"
type="date"
class="search-input"
placeholder="搜索接待日期"
>
</el-date-picker>
<el-button
type="primary"
size="small"
@click="handleSearch"
>查询</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
</div>
<div class="table">
<d2-table
ref="multipleTable"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:has-num="false"
:layout="'total, prev, pager, next'"
:pagerCount="5"
@setTableFinishFun="setTableFinishFun"
@selectionTable="selectionTable"
@selectRow="selectRow"
@selectAll="selectAll"
:before-search-fn="beforeSearchFn"
>
</d2-table>
</div>
</div>
</div>
<div class="right">
<div class="title flex">
已选录音<div class="num">{{ count }}</div>条
<el-button
class="clear"
type="text"
@click="clearChooseList"
>清空</el-button>
</div>
<div class="right-content">
<el-scrollbar class="multiple-tag-box">
<div class="multiple-tags">
<template v-for="(i,ind) in chooseList">
<el-tag
closable
:key="ind"
@close="remove(i,ind)"
disable-transitions
>{{ i.chooseContent }}</el-tag>
</template>
</div>
</el-scrollbar>
</div>
</div>
</div>
</basedialog>
</template>
<script>
import {
getRecordAllPageListByCondition,
} from '@/api/earlyWarningManager'
import multipleMixin from "./multipleMixin";
import dayjs from 'dayjs';
export default {
name: "MultipleRecording",
mixins: [multipleMixin],
mounted () {
},
data () {
return {
dialogConfig: {
config: {
title: "选择录音",
width: "1092px"
}
},
targetId: 'id',
formatTag: (e) => {
return {
...e,
chooseContent: `${e.employeeName} ${e.startTime}`
}
},
getListApi: getRecordAllPageListByCondition,
searchForm: {
staffName: '',
receptionDate: '',
businessType: 1
},
searchFormSearch: {},
tableParams: {
listName: "list",
mutiSelectUniqueKey: "id",
mutiSelectName: "contentIndex",
tableColumns: [
{
label: "员工姓名",
prop: "employeeName",
minWidth: 90
},
{
label: "接待时间",
prop: "startTime",
minWidth: 90
},
{
label: "客户姓名",
prop: "customerName",
minWidth: 90
},
{
label: "车型",
prop: "carModel",
minWidth: 90
},
{
label: "接待时长",
prop: "duration",
minWidth: 90
},
{
label: "质检评分/分",
prop: "score",
minWidth: 90
},
{
label: "攻防得分/分",
prop: "defencePoint",
minWidth: 90
},
]
},
}
},
methods: {
getParams () {
let params = this.deepClone(this.searchForm)
if (params.receptionDate) {
params.receptionDate = dayjs(params.receptionDate).format("YYYY-MM-DD")
}
return params
},
}
}
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
}
::v-deep.el-dialog__wrapper {
overflow: hidden !important;
.el-dialog {
margin: 50vh auto 0 !important;
transform: translateY(-50%);
.el-dialog__body {
padding: 0;
// padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
}
.detail-content {
.content {
display: flex;
height: 588px;
box-sizing: border-box;
padding: 20px;
gap: 24px;
.left,
.right {
flex-shrink: 0;
height: 100%;
border: 1px solid #e5e5e5;
box-sizing: border-box;
border-radius: 2px;
overflow: hidden;
.title {
font-weight: 700;
color: #333333;
font-size: 16px;
height: 48px;
border-bottom: 1px solid #e5e5e5;
background: #f5f5f5;
padding: 0 16px;
.num {
margin-left: 4px;
}
.clear {
margin-left: auto;
}
}
}
.left {
width: calc(100% - 304px);
&-content {
padding: 16px;
height: calc(100% - 49px);
box-sizing: border-box;
.search-box {
margin-bottom: 20px;
.search-input {
width: 200px;
margin-right: 12px;
}
}
.table {
height: calc(100% - 52px);
::v-deep .d2-table {
height: 100%;
display: flex;
flex-direction: column;
.el-pagination {
margin-top: auto;
}
.el-table {
margin: 0 !important;
border-left: none;
overflow-y: auto;
&::before,
&::after {
display: none;
}
.el-table__header-wrapper,
.el-table__body-wrapper {
position: relative;
border-left: 1px solid #ebeef5;
&::after {
content: "";
position: absolute;
top: 0;
right: 1px;
width: 1px;
height: 100%;
background: #ebeef5;
}
}
.el-table__header-wrapper {
.cell {
padding: 0 5px;
}
}
}
.el-table-column--selection {
.cell {
padding: 0;
}
}
}
}
}
}
.right {
width: 284px;
.multiple-tag-box {
width: 100%;
height: 499px;
box-sizing: border-box;
.multiple-tags {
padding: 16px;
display: flex;
flex-wrap: wrap;
gap: 16px;
}
}
}
}
}
</style>
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!