1 Commits
test ... main

Author SHA1 Message Date
88155a968b merge 2023-12-12 10:08:44 +08:00
29 changed files with 418 additions and 668 deletions

BIN
.DS_Store vendored

Binary file not shown.

3
.env
View File

@@ -1,7 +1,8 @@
NODE_ENV=production NODE_ENV=production
VUE_APP_PREVIEW=false VUE_APP_PREVIEW=false
# <!-- //水感应正式环境--> # <!-- //水感应正式环境-->
# VUE_APP_API_BASE_URL=https://api.shui.shuiganying.com/api # VUE_APP_API_BASE_URL=https://douhuo.douhuofalv.com/agent
# <!-- // 水感应测试--> # <!-- // 水感应测试-->
# VUE_APP_API_BASE_URL=https://api.douhuotest.douhuofalv.com/agent
VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api

View File

@@ -1,15 +1,16 @@
### ###
# @Author: Aimee~ # @Author: Aimee~
# @Date: 2023-05-11 11:17:32 # @Date: 2023-05-11 11:17:32
# @LastEditTime: 2023-12-12 15:52:34 # @LastEditTime: 2023-07-28 09:49:14
# @LastEditors: Aimee # @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
# @FilePath: /water_dealer-agent/.env.development # @FilePath: /douhuo-agent/.env.development
# @Description: 正式环境测试环境更改 # @Description: 正式环境测试环境更改
### ###
NODE_ENV=development NODE_ENV=development
VUE_APP_PREVIEW=true VUE_APP_PREVIEW=true
# <!-- //水感应正式环境--> # <!-- //水感应正式环境-->
# VUE_APP_API_BASE_URL=https://api.shui.shuiganying.com/api # VUE_APP_API_BASE_URL=https://douhuo.douhuofalv.com/agent
# <!-- // 水感应测试--> # <!-- //水感应测试-->
VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api # VUE_APP_API_BASE_URL=https://api.douhuotest.douhuofalv.com/agent
VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api

View File

@@ -1,15 +1,16 @@
### ###
# @Author: Aimee~ # @Author: Aimee~
# @Date: 2023-05-11 11:17:32 # @Date: 2023-05-11 11:17:32
# @LastEditTime: 2023-12-12 15:52:50 # @LastEditTime: 2023-07-28 10:09:13
# @LastEditors: Aimee # @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
# @FilePath: /water_dealer-agent/.env.preview # @FilePath: /douhuo-agent/.env.preview
# @Description: # @Description:
### ###
NODE_ENV=production NODE_ENV=production
VUE_APP_PREVIEW=true VUE_APP_PREVIEW=true
# <!-- //水感应正式环境--> # <!-- //水感应正式环境-->
# VUE_APP_API_BASE_URL=https://api.shui.shuiganying.com/api # VUE_APP_API_BASE_URL=https://douhuo.douhuofalv.com/agent
# <!-- // 水感应测试--> # <!-- //水感应测试-->
# VUE_APP_API_BASE_URL=https://api.douhuotest.douhuofalv.com/agent
VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api

View File

@@ -1,14 +1,12 @@
<!-- <!--
* @Author: Aimee~ * @Author: Aimee~
* @Date: 2023-05-11 12:02:45 * @Date: 2023-05-11 12:02:45
* @LastEditTime: 2023-12-12 16:31:35 * @LastEditTime: 2023-12-12 10:08:00
* @LastEditors: Aimee * @LastEditors: Aimee
* @FilePath: /water_dealer-agent/README.md * @FilePath: /water_dealer-agent/README.md
* @Description: 备注信息 * @Description: 备注信息
--> -->
# 组件 # 水感应 分公司 中台(数据展示及分公司数据) 线下
ant-design-vue
# 水感应 分公司 中台(数据展示及分公司数据) 水感应分公司管理 (线上)
打包后文件件需要有一个 static 文件存放 打包后文件件需要有一个 static 文件存放
'/static/vue.min.js' '/static/vue.min.js'
'/static/vue-router.min.js' '/static/vue-router.min.js'
@@ -19,12 +17,10 @@ ant-design-vue
# node 版本 node-v14.21.3 # node 版本 node-v14.21.3
# 水感应测试-存放路径 # 水感应测试-存放路径
/home/wwwroot/Development/Douhuo/agent
# 水感应正式-存放路径 # 水感应正式-存放路径
OSS_ACCESS_KEY=LTAI5tHYDoN6trRhsBmRvD7h oss://douhuo-agent/
OSS_SECRET_KEY=k3e6veUY45WM8QMMMyRKYr0KjiOXzC
oss://sgy-agent-web/
# 运行 yarn run dev # 运行 yarn run dev
# 打包 yarn build # 打包 yarn build

View File

@@ -26,17 +26,13 @@
"md5": "^2.3.0", "md5": "^2.3.0",
"moment": "^2.24.0", "moment": "^2.24.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"quill": "1.3.7",
"quill-image-drop-module": "1.0.3",
"quill-image-extend-module": "1.1.2",
"quill-image-resize-module": "3.0.0",
"store": "^2.0.12", "store": "^2.0.12",
"viser-vue": "^2.4.6", "viser-vue": "^2.4.6",
"vue": "^2.6.12", "vue": "^2.6.12",
"vue-clipboard2": "^0.2.1", "vue-clipboard2": "^0.2.1",
"vue-cropper": "0.4.9", "vue-cropper": "0.4.9",
"vue-i18n": "^8.22.3", "vue-i18n": "^8.22.3",
"vue-quill-editor": "3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^3.4.9", "vue-router": "^3.4.9",
"vue-sku-form": "^0.4.1", "vue-sku-form": "^0.4.1",
"vue-svg-component-runtime": "^1.0.1", "vue-svg-component-runtime": "^1.0.1",

12
public/index.html vendored
View File

@@ -1,11 +1,3 @@
<!--
* @Author: Aimee~
* @Date: 2023-08-03 17:36:19
* @LastEditTime: 2023-12-12 16:12:55
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/public/index.html
* @Description:
-->
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-cmn-Hans"> <html lang="zh-cmn-Hans">
@@ -14,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>logo.png"> <link rel="icon" href="<%= BASE_URL %>logo.png">
<title> 水感应分公司管理 WaterFeel.Vip</title> <title> 水感应经销商管理后台 WaterFeel.Vip</title>
<style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style> <style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>
<!-- require cdn assets css --> <!-- require cdn assets css -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
@@ -27,7 +19,7 @@
</noscript> </noscript>
<div id="app"> <div id="app">
<div class="first-loading-wrp"> <div class="first-loading-wrp">
<h1> 水感应分公司管理</h1> <h1> 水感应经销商管理后台</h1>
<div class="loading-wrp"> <div class="loading-wrp">
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span> <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div> </div>

View File

@@ -1,8 +1,8 @@
/* /*
* @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
* @Date: 2023-07-07 14:02:05 * @Date: 2023-07-07 14:02:05
* @LastEditors: Aimee * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
* @LastEditTime: 2023-12-12 11:47:55 * @LastEditTime: 2023-07-31 13:58:48
* @FilePath: /water_dealer-agent/src/api/statistical.js * @FilePath: /water_dealer-agent/src/api/statistical.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@@ -10,18 +10,13 @@
import request from '@/utils/request' import request from '@/utils/request'
// 获取 首页数据看板数据 // 获取 首页数据看板数据
export function getMiddlesUserDatas (item, value) { export function getMiddlesUserDatas (item) {
const params = {
time_type: item
}
if (value !== null) {
params.start_at = value[0]
params.end_at = value[1]
}
return request({ return request({
url: '/middles/user/datas', url: '/middles/user/datas',
method: 'get', method: 'get',
params: params params: {
time_type: item
}
}) })
} }

View File

@@ -14,10 +14,10 @@
<a-icon type="lock" /> <a-icon type="lock" />
修改密码 修改密码
</a-menu-item> </a-menu-item>
<!-- <a-menu-item v-if="currentUser.isManage" key="changePermission" @click="goPermission"> <a-menu-item v-if="currentUser.isManage" key="changePermission" @click="goPermission">
<a-icon type="setting" /> <a-icon type="setting" />
管理员管理 管理员管理
</a-menu-item> --> </a-menu-item>
<a-menu-item key="logout" @click="handleLogout"> <a-menu-item key="logout" @click="handleLogout">
<a-icon type="logout" /> <a-icon type="logout" />
退出登录 退出登录

View File

@@ -1,9 +1,9 @@
/* /*
* @Author: Aimee~ * @Author: Aimee~
* @Date: 2022-06-12 15:05:53 * @Date: 2022-06-12 15:05:53
* @LastEditTime: 2023-12-12 16:13:22 * @LastEditTime: 2022-06-13 09:33:54
* @LastEditors: Aimee * @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/config/defaultSettings.js * @FilePath: /gl-agent/src/config/defaultSettings.js
* @Description: 修改默认配置 * @Description: 修改默认配置
*/ */
/** /**
@@ -31,7 +31,7 @@ var defaultValue = {
menu: { menu: {
locale: true locale: true
}, },
title: ' 水感应分公司管理', title: ' 水感应经销商管理后台',
pwa: false, pwa: false,
production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true' production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true'
} }

View File

@@ -1,9 +1,9 @@
/* /*
* @Author: Aimee~ * @Author: Aimee~
* @Date: 2023-05-11 12:02:45 * @Date: 2023-05-11 12:02:45
* @LastEditTime: 2023-12-13 13:11:46 * @LastEditTime: 2023-07-05 15:03:09
* @LastEditors: Aimee * @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/config/router.config.js * @FilePath: /douhuo-agent/src/config/router.config.js
* @Description: 路由 * @Description: 路由
*/ */
import { import {
@@ -13,10 +13,10 @@ import {
import detail from './routes/detail' import detail from './routes/detail'
import stock from './routes/stock' import stock from './routes/stock'
import user from './routes/user' import user from './routes/user'
// import coupon from './routes/coupon' import coupon from './routes/coupon'
import permission from './routes/permission' import permission from './routes/permission'
import sales from './routes/sales' import sales from './routes/sales'
// import cityExperienceOfficer from './routes/cityExperienceOfficer' import cityExperienceOfficer from './routes/cityExperienceOfficer'
export const asyncRouterMap = [{ export const asyncRouterMap = [{
path: '/', path: '/',
@@ -38,11 +38,11 @@ export const asyncRouterMap = [{
} }
}, },
...detail, ...detail,
// ...cityExperienceOfficer, ...cityExperienceOfficer,
...stock, ...stock,
...sales, ...sales,
...user, ...user,
// ...coupon, ...coupon,
...permission ...permission
] ]
}, },
@@ -67,7 +67,7 @@ export const constantRouterMap = [{
name: 'Login', name: 'Login',
component: () => import('@/views/auth/Login'), component: () => import('@/views/auth/Login'),
meta: { meta: {
title: '登陆水感应分公司管理' title: '登陆水感应经销商系统'
} }
}, },
{ {

View File

@@ -1,11 +1,3 @@
/*
* @Author: Aimee~
* @Date: 2023-10-30 15:25:23
* @LastEditTime: 2023-12-12 11:04:30
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/config/routes/sales.js
* @Description: 零售订单
*/
import { import {
RouteView RouteView
} from '@/layouts' } from '@/layouts'
@@ -14,7 +6,7 @@ export default [{
path: '/sales', path: '/sales',
name: 'StockIndex', name: 'StockIndex',
meta: { meta: {
title: '订单管理', title: '销售管理',
icon: 'bank' icon: 'bank'
}, },
component: RouteView, component: RouteView,
@@ -23,7 +15,7 @@ export default [{
path: '/sales/online', path: '/sales/online',
name: 'SalesOnline', name: 'SalesOnline',
meta: { meta: {
title: '零售订单', title: '线上零售订单',
icon: 'unordered-list' icon: 'unordered-list'
}, },
component: () => import('@/views/sales/Online') component: () => import('@/views/sales/Online')
@@ -32,7 +24,7 @@ export default [{
path: '/sales/stock', path: '/sales/stock',
name: 'SalesStock', name: 'SalesStock',
meta: { meta: {
title: '进货订单', title: '线上进货订单',
icon: 'unordered-list' icon: 'unordered-list'
}, },
component: () => import('@/views/sales/OnStock') component: () => import('@/views/sales/OnStock')

View File

@@ -1,11 +1,3 @@
/*
* @Author: Aimee~
* @Date: 2023-10-30 15:25:23
* @LastEditTime: 2023-12-12 11:02:36
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/config/routes/stock.js
* @Description: 库存管理
*/
import { import {
RouteView RouteView
} from '@/layouts' } from '@/layouts'
@@ -19,72 +11,74 @@ export default [{
}, },
component: RouteView, component: RouteView,
children: [ children: [
{ {
path: '/stock/dealer/in', path: '/stock/ins',
name: 'DealerIn', name: 'StockIns',
component: () => import('@/views/stock/DealerIn'),
meta: { meta: {
title: '经销商入库管理', title: '分公司库存管理',
icon: 'import' icon: 'control'
} },
}, component: RouteView,
{ redirect: '/stock/in',
path: '/stock/dealer/out', children: [
name: 'DealerOut', {
component: () => import('@/views/stock/DealerOut'), path: '/stock/in',
name: 'StockIn',
component: () => import('@/views/stock/In'),
meta: {
title: '入库管理',
icon: 'import'
}
},
{
path: '/sales/offline',
name: 'SalesOffline',
meta: {
title: '线下出货列表',
icon: 'unordered-list'
},
component: () => import('@/views/sales/Offline')
}
// {
// path: '/stock/out',
// name: 'StockOut',
// component: () => import('@/views/stock/Out'),
// meta: {
// title: '出库管理',
// icon: 'export'
// }
// }
]
},
{
path: '/stock/dealer',
name: 'StockDealer',
meta: { meta: {
title: '经销商库管理', title: '经销商库管理',
icon: 'export' icon: 'usergroup-add'
} },
} component: RouteView,
// { redirect: '/stock/dealer/in',
// path: '/stock/ins', children: [
// name: 'StockIns', {
// meta: { path: '/stock/dealer/in',
// title: '分公司库存管理', name: 'DealerIn',
// icon: 'control' component: () => import('@/views/stock/DealerIn'),
// }, meta: {
// component: RouteView, title: '入库管理',
// redirect: '/stock/in', icon: 'import'
// children: [ }
// { },
// path: '/stock/in', {
// name: 'StockIn', path: '/stock/dealer/out',
// component: () => import('@/views/stock/In'), name: 'DealerOut',
// meta: { component: () => import('@/views/stock/DealerOut'),
// title: '入库管理', meta: {
// icon: 'import' title: '出库管理',
// } icon: 'export'
// }, }
// { }
// path: '/sales/offline', ]
// name: 'SalesOffline', }
// meta: {
// title: '线下出货列表',
// icon: 'unordered-list'
// },
// component: () => import('@/views/sales/Offline')
// }
// // {
// // path: '/stock/out',
// // name: 'StockOut',
// // component: () => import('@/views/stock/Out'),
// // meta: {
// // title: '出库管理',
// // icon: 'export'
// // }
// // }
// ]
// },
// {
// path: '/stock/dealer',
// name: 'StockDealer',
// meta: {
// title: '经销商入库管理',
// icon: 'usergroup-add'
// },
// component: RouteView,
// redirect: '/stock/dealer/in'
// }
] ]
}] }]

View File

@@ -18,7 +18,7 @@
</template> </template>
<template v-slot:rightContentRender> <template v-slot:rightContentRender>
<span class="rightContentRenderTitle">欢迎使用水感应分公司管理</span> <span class="rightContentRenderTitle">欢迎使用水感应经销商端</span>
<right-content :is-mobile="isMobile" :theme="settings.theme" :top-menu="settings.layout === 'topmenu'" /> <right-content :is-mobile="isMobile" :theme="settings.theme" :top-menu="settings.layout === 'topmenu'" />
</template> </template>
@@ -61,7 +61,7 @@ export default {
menus: [], menus: [],
// 侧栏收起状态 // 侧栏收起状态
collapsed: false, collapsed: false,
title: ' 水感应分公司管理 ', title: ' 水感应代理商 ',
logo: '', logo: '',
settings: { settings: {
// 布局类型 // 布局类型

View File

@@ -6,7 +6,7 @@
<div class="header"> <div class="header">
<a href="/"> <a href="/">
<span class="title">欢迎登录</span> <span class="title">欢迎登录</span>
<span class="des">欢迎使用水感应分公司管理</span> <span class="des">欢迎使用水感应经销商端</span>
</a> </a>
</div> </div>
</div> </div>

View File

@@ -1,22 +1,14 @@
/*
* @Author: Aimee~
* @Date: 2023-08-03 17:36:19
* @LastEditTime: 2023-12-12 16:13:49
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/utils/screenLog.js
* @Description: 关键字
*/
/* eslint-disable */ /* eslint-disable */
export const printANSI = () => { export const printANSI = () => {
// console.clear() // console.clear()
// ASCII - ANSI Shadow // ASCII - ANSI Shadow
let text = `水感应分公司管理 let text = `水感应大数据综合管理后台
PUBLISHED: 1.0.0-10.0.0 PUBLISHED: 1.0.0-10.0.0
EMAIL: yuzhankeji@163.com EMAIL: yuzhankeji@163.com
CREATED_AT: ${BUILD_DATE}` CREATED_AT: ${BUILD_DATE}`
console.log(`%c${text}`, 'color: #fc4d50') console.log(`%c${text}`, 'color: #fc4d50')
console.log(`%c可以植入广告`, 'color: #fc4d50') console.log(`%c可以植入广告`, 'color: #fc4d50')
console.log('%c感谢使用 水感应分公司管理', 'color: #fc4d50; font-size: 14px; font-family: Hiragino Sans GB,Microsoft YaHei,\\\\5FAE\\8F6F\\96C5\\9ED1,Droid Sans Fallback,Source Sans,Wenquanyi Micro Hei,WenQuanYi Micro Hei Mono,WenQuanYi Zen Hei,Apple LiGothic Medium,SimHei,ST Heiti,WenQuanYi Zen Hei Sharp,sans-serif;') console.log('%c感谢使用 水感应大数据综合管理后台', 'color: #fc4d50; font-size: 14px; font-family: Hiragino Sans GB,Microsoft YaHei,\\\\5FAE\\8F6F\\96C5\\9ED1,Droid Sans Fallback,Source Sans,Wenquanyi Micro Hei,WenQuanYi Micro Hei Mono,WenQuanYi Zen Hei,Apple LiGothic Medium,SimHei,ST Heiti,WenQuanYi Zen Hei Sharp,sans-serif;')
console.log('%cThanks for ShuiGanYing - Vip!', 'color: #fc4d50; font-size: 14px; font-weight: 300; text-shadow:#000 1px 0 0,#000 0 1px 0,#000 -1px 0 0,#000 0 -1px 0;') console.log('%cThanks for DouHuo - Vip!', 'color: #fc4d50; font-size: 14px; font-weight: 300; text-shadow:#000 1px 0 0,#000 0 1px 0,#000 -1px 0 0,#000 0 -1px 0;')
} }

View File

@@ -1,18 +1,10 @@
<!--
* @Author: Aimee~
* @Date: 2023-08-03 17:36:19
* @LastEditTime: 2023-12-12 16:06:46
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/views/home/Index.vue
* @Description: index
-->
<template> <template>
<a-row :gutter="[24, 24]"> <a-row :gutter="[24, 24]">
<!-- <a-col :lg="10" :md="24" :sm="24" :xl="8" :xxl="7"> <!-- <a-col :lg="10" :md="24" :sm="24" :xl="8" :xxl="7">
<UserInfo /> <UserInfo />
</a-col> --> </a-col> -->
<a-col :lg="24" :md="24" :sm="24" :xl="24" :xxl="24"> <a-col :lg="24" :md="24" :sm="24" :xl="24" :xxl="24">
<Count v-if="info != {}" :info="info" /> <Count v-if="info!=={}" :info="info" />
</a-col> </a-col>
<!-- <!--
<a-col :lg="24" :md="24" :sm="24" :xl="24" :xxl="24"> <a-col :lg="24" :md="24" :sm="24" :xl="24" :xxl="24">
@@ -34,9 +26,8 @@ export default {
}, },
data () { data () {
return { return {
info: [], info: {},
serarchkey: 'year', serarchkey: 'today'
searchValue: null
} }
}, },
computed: { computed: {
@@ -52,17 +43,8 @@ export default {
created () { created () {
this.getInfo() this.getInfo()
// 监听是否切换了日,周,月,年 // 监听是否切换了日,周,月,年
this.eventBus.$on('updateHomeDataByType', (item) => { this.eventBus.$on('updateHomeDataByType', (type) => {
if (item.type === 'custom' && item.value == null) { this.serarchkey = type.type
return
} else if (item.type === 'custom' && item.value !== null) {
this.serarchkey = item.type
this.searchValue = item.value
this.getInfo()
return
}
this.serarchkey = item.type
this.searchValue = item.value
this.getInfo() this.getInfo()
}) })
}, },
@@ -71,7 +53,7 @@ export default {
}, },
methods: { methods: {
getInfo () { getInfo () {
getMiddlesUserDatas(this.serarchkey, this.searchValue).then(res => { getMiddlesUserDatas(this.serarchkey).then(res => {
this.info = res this.info = res
}).catch(err => { }).catch(err => {
this.$notification.error(err) this.$notification.error(err)

View File

@@ -2,7 +2,7 @@
<a-row> <a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<!-- 分公司库存 --> <!-- 分公司库存 -->
<!-- <a-col <a-col
v-if="info.middle" v-if="info.middle"
:sm="24" :sm="24"
:md="12" :md="12"
@@ -12,14 +12,15 @@
> >
<chart-card :loading="loading" title="分公司总库存(瓶)" :total="info.middle.total"> <chart-card :loading="loading" title="分公司总库存(瓶)" :total="info.middle.total">
<template slot="footer"> <template slot="footer">
<!-- <trend flag="up"> <span slot="term">{{ $t('线上库存') }}</span>{{ info.middle.online_stock }}</trend> -->
<trend flag="down"> <trend flag="down">
<span slot="term">{{ $t('线下库存') }}</span>{{ info.middle.offline_stock }} <span slot="term">{{ $t('线下库存') }}</span>{{ info.middle.offline_stock }}
</trend> </trend>
</template> </template>
</chart-card> </chart-card>
</a-col> --> </a-col>
<!-- 经销商总库存 --> <!-- 经销商总库存 -->
<!-- <a-col <a-col
:sm="24" :sm="24"
:md="12" :md="12"
:xl="12" :xl="12"
@@ -36,59 +37,53 @@
</div> </div>
<template slot="footer">{{ $t('经销商总数') }}<span style="margin-right:20px;"> {{ info.agent.users | NumberFormat }} </span></template> <template slot="footer">{{ $t('经销商总数') }}<span style="margin-right:20px;"> {{ info.agent.users | NumberFormat }} </span></template>
</chart-card> </chart-card>
</a-col> --> </a-col>
</a-row> </a-row>
<a-col
:span="24" <a-col :span="24" >
v-for="(item, index) in info" <a-card :bordered="false" title="用户数据">
:key="index"> <template #extra>
<a-card :bordered="false" :title="item.title">
<template v-if="index === 0" #extra>
<a-dropdown v-model="visible"> <a-dropdown v-model="visible">
<a class="ant-dropdown-link" @click="e => e.preventDefault()">{{ searchs[typeIndex].title }} <a-icon type="down" /></a> <a class="ant-dropdown-link" @click="e => e.preventDefault()">{{ searchs[typeIndex].title }} <a-icon type="down" /></a>
<a-menu slot="overlay" @click="handleMenuClick"> <a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item <a-menu-item
v-for="iit in searchs" v-for="item in searchs"
:key="iit.key"> :key="item.key">
<a href="javascript:;">{{ iit.title }}</a> <a href="javascript:;">{{ item.title }}</a>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
<a-range-picker
style="margin-left:40px;"
v-if="type == 'custom'"
:placeholder="['开始日期', '结束日期']"
:value="rang_at"
:ranges="{ Today: [moment(), moment()], 'This Month': [moment(), moment().endOf('month')] }"
@change="onCreateChange" />
</template> </template>
<a-row> <a-row v-if="info.users">
<a-col <a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
:sm="24" <info title="用户总数量(人)" :value="''+info.users.all" :bordered="true" />
:md="12" </a-col>
:xl="8" <a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
:xxl="8" <info title="新增代理数(人)" :value="''+info.users.new_agents" :bordered="true" />
v-for="(it, idx) in item.data" </a-col>
:key="idx" <a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
class="mt20"> <info title="新增创客数(人)" :value="''+info.users.new_makers" :bordered="true"/>
<info :title="it.title" :value="''+ it.number" :bordered="(idx + 1) === item.data.length ? false : true" /> </a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="新增VIP数(人)" :value="''+info.users.new_vips" :bordered="true"/>
</a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="新增游客数量(人)" :value="''+info.users.new_visitors"/>
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
</a-col> </a-col>
<a-col :span="24" v-if="info.sales_quantity">
<!-- <a-col :span="24" v-if="info.sales_quantity">
<a-card :bordered="false" title="累计销售数量"> <a-card :bordered="false" title="累计销售数量">
<a-row> <a-row>
<a-col <a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
:sm="24" <info title="累计销售数量(瓶)" :value="''+info.sales_quantity.online_all" :bordered="true" />
:md="12" </a-col>
:xl="8" <a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
:xxl="8" <info title="线上销售数量(瓶)" :value="''+info.sales_quantity.online_retail" :bordered="true"/>
class="mt20" </a-col>
v-for="(item, index) in info.sales_quantity" <a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
:key="index"> <info title="线下出货数量(瓶)" :value="''+info.sales_quantity.offline" />
<info :title="item.title" :value="'' + item.number" :bordered="true" />
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
@@ -96,19 +91,19 @@
<a-col :span="24" v-if="info.sales_amount"> <a-col :span="24" v-if="info.sales_amount">
<a-card :bordered="false" title="售卖数据管理"> <a-card :bordered="false" title="售卖数据管理">
<a-row> <a-row>
<a-col <a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
:sm="24" <info title="售卖数据管理总数(元)" :value="''+info.sales_amount.online_agent_all" :bordered="true"/>
:md="12" </a-col>
:xl="8" <a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
:xxl="8" <info title="线上销售金额(元)" :value="''+info.sales_amount.online_sell" :bordered="true"/>
class="mt20" </a-col>
v-for="(item, index) in info.sales_amount" <a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
:key="index"> <info title="线下出货金额总和(元)" :value="''+info.sales_amount.offline_sell" />
<info :title="item.title" :value="'' + item.number" :bordered="true" />
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
</a-col> --> </a-col>
<!-- <a-col :span="24" v-if="info.b_recheck"> <!-- <a-col :span="24" v-if="info.b_recheck">
<a-card :bordered="false" title="复审业务操作"> <a-card :bordered="false" title="复审业务操作">
<a-row> <a-row>
@@ -124,6 +119,7 @@
</a-row> </a-row>
</a-card> </a-card>
</a-col> --> </a-col> -->
</a-row> </a-row>
</template> </template>
@@ -140,7 +136,6 @@
NumberInfo, NumberInfo,
MiniSmoothArea MiniSmoothArea
} from '@/components' } from '@/components'
import moment from 'moment'
export default { export default {
components: { components: {
@@ -157,9 +152,9 @@ export default {
}, },
props: { props: {
info: { info: {
type: Array, type: Object,
default: () => { default: () => {
return [] return {}
} }
} }
}, },
@@ -167,35 +162,21 @@ export default {
data: () => ({ data: () => ({
visible: false, visible: false,
loading: false, loading: false,
type: 'year', type: 'today',
typeIndex: 0, typeIndex: 0,
searchs: [ searchs: [
{ key: 'year', title: '本年' },
{ key: 'month', title: '本月' },
{ key: 'week', title: '本周' },
{ key: 'today', title: '本日' }, { key: 'today', title: '本日' },
{ key: 'custom', title: '自定义时间' } { key: 'week', title: '本周' },
], { key: 'month', title: '本月' },
rang_at: null, // 开始时间 结束时间 { key: 'year', title: '本年' }
date2: null ]
}), }),
methods: { methods: {
moment,
handleMenuClick (e) { handleMenuClick (e) {
this.typeIndex = this.searchs.findIndex(item => item.key === e.key) this.typeIndex = this.searchs.findIndex(item => item.key === e.key)
this.visible = false this.visible = false
this.type = e.key this.type = e.key
if (this.type === 'custom') { this.eventBus.$emit('updateHomeDataByType', { type: e.key })
return
} else {
this.date2 = null
}
this.eventBus.$emit('updateHomeDataByType', { type: e.key, value: this.date2 })
},
onCreateChange (dates, dateStrings) {
this.rang_at = dates
this.date2 = dates.length === 2 ? dateStrings : null
this.eventBus.$emit('updateHomeDataByType', { type: this.type, value: this.date2 })
} }
} }
} }

View File

@@ -61,7 +61,7 @@
<div>{{ record.name }} {{ record.mobile?'('+record.mobile+')':'--' }}</div> <div>{{ record.name }} {{ record.mobile?'('+record.mobile+')':'--' }}</div>
<div>{{ record.address || '--' }}</div> <div>{{ record.address || '--' }}</div>
</div> </div>
<div slot="number" slot-scope="text, record">{{ record.number }}</div> <div slot="number" slot-scope="text, record">{{ record.number }}</div>
<a slot="total" slot-scope="text, record">{{ record.total || '0.00' }}</a> <a slot="total" slot-scope="text, record">{{ record.total || '0.00' }}</a>
<div slot="channel" slot-scope="text, record">{{ record.channel == 'express' ?'快递':'自提' }}</div> <div slot="channel" slot-scope="text, record">{{ record.channel == 'express' ?'快递':'自提' }}</div>
<div slot="express" slot-scope="text, record"> <div slot="express" slot-scope="text, record">

View File

@@ -60,7 +60,7 @@
<div>{{ record.express.full_address || '--' }}</div> <div>{{ record.express.full_address || '--' }}</div>
</div> </div>
<a slot="total" slot-scope="text, record">{{ record.total }}</a> <a slot="total" slot-scope="text, record">{{ record.total }}</a>
<a slot="items_qty" slot-scope="text, record">{{ record.items_qty }}</a> <a slot="items_qty" slot-scope="text, record">{{ record.items_qty }}</a>
<!-- 操作 --> <!-- 操作 -->
<div slot="actions" slot-scope="text, record"> <div slot="actions" slot-scope="text, record">
<a class="ant-dropdown-link" @click="onInfo(record.order_no)">查看详情</a> <a class="ant-dropdown-link" @click="onInfo(record.order_no)">查看详情</a>

View File

@@ -60,7 +60,7 @@
<div>{{ record.express.full_address || '--' }}</div> <div>{{ record.express.full_address || '--' }}</div>
</div> </div>
<a slot="total" slot-scope="text, record">{{ record.total }}</a> <a slot="total" slot-scope="text, record">{{ record.total }}</a>
<a slot="items_qty" slot-scope="text, record">{{ record.items_qty }}</a> <a slot="items_qty" slot-scope="text, record">{{ record.items_qty }}</a>
<!-- 操作 --> <!-- 操作 -->
<div slot="actions" slot-scope="text, record"> <div slot="actions" slot-scope="text, record">
<a class="ant-dropdown-link" @click="onInfo(record.order_no)">查看详情</a> <a class="ant-dropdown-link" @click="onInfo(record.order_no)">查看详情</a>

View File

@@ -1,11 +1,3 @@
<!--
* @Author: Aimee~
* @Date: 2023-08-03 17:36:19
* @LastEditTime: 2023-12-13 13:19:33
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/views/sales/widgets/StockInfo.vue
* @Description: stockinfo
-->
<!-- 驳回原因用户姓名输入 --> <!-- 驳回原因用户姓名输入 -->
<template> <template>
@@ -19,9 +11,9 @@
<br/><a-divider orientation="left">{{ info.channel.text + info.operation_type.text }}</a-divider> <br/><a-divider orientation="left">{{ info.channel.text + info.operation_type.text }}</a-divider>
<a-descriptions :column="4"> <a-descriptions :column="4">
<a-descriptions-item :label="info.channel.text + info.operation_type.text+ '方式'" span="2">{{ info.type.text }}</a-descriptions-item> <a-descriptions-item :label="info.channel.text + info.operation_type.text+ '方式'" span="2">{{ info.type.text }}</a-descriptions-item>
<a-descriptions-item :label="info.operation_type.text + '数量'" span="2">{{ info.items_count.qty_all }}</a-descriptions-item> <a-descriptions-item :label="info.operation_type.text + '数量'" span="2">{{ info.items_count.qty_all }}</a-descriptions-item>
<a-descriptions-item label="是否使用优惠券兑换" span="2">{{ info.items_count.coupon_all>0 ?'是':'否' }}</a-descriptions-item> <a-descriptions-item label="是否使用优惠券兑换" span="2">{{ info.items_count.coupon_all>0 ?'是':'否' }}</a-descriptions-item>
<a-descriptions-item label="使用优惠券兑换数量" span="2" v-if="info.items_count.coupon_all>0">{{ info.items_count.coupon_all + '' }}</a-descriptions-item> <a-descriptions-item label="使用优惠券兑换数量" span="2" v-if="info.items_count.coupon_all>0">{{ info.items_count.coupon_all + '' }}</a-descriptions-item>
<a-descriptions-item label="使用优惠券兑换抵扣金额" span="2" v-if="info.items_count.coupon_all>0">{{ info.coupon.price + '' }}</a-descriptions-item> <a-descriptions-item label="使用优惠券兑换抵扣金额" span="2" v-if="info.items_count.coupon_all>0">{{ info.coupon.price + '' }}</a-descriptions-item>
</a-descriptions> </a-descriptions>
<br/><a-divider orientation="left">购买商品</a-divider> <br/><a-divider orientation="left">购买商品</a-divider>

View File

@@ -64,8 +64,8 @@
size="default"> size="default">
<user-info slot="user" slot-scope="text, record" :info="{...record.in_user}" /> <user-info slot="user" slot-scope="text, record" :info="{...record.in_user}" />
<user-info slot="out_user" slot-scope="text, record" :info="{...record.out_user}" /> <user-info slot="out_user" slot-scope="text, record" :info="{...record.out_user}" />
<a slot="number" slot-scope="text, record" style="color: #1890ff">{{ record.number }}</a> <a slot="number" slot-scope="text, record" style="color: #1890ff">{{ record.number }}</a>
<a slot="stock" slot-scope="text, record" style="color: #1890ff">{{ record.stock }}</a> <a slot="stock" slot-scope="text, record" style="color: #1890ff">{{ record.stock }}</a>
<a slot="total" slot-scope="text, record" style="color: #1890ff">{{ record.total }}</a> <a slot="total" slot-scope="text, record" style="color: #1890ff">{{ record.total }}</a>
<div slot="stock_order" slot-scope="text, record" >{{ record.stock_order?record.stock_order.type:'--' }}</div> <div slot="stock_order" slot-scope="text, record" >{{ record.stock_order?record.stock_order.type:'--' }}</div>
</s-table> </s-table>

View File

@@ -81,8 +81,8 @@
size="default"> size="default">
<user-info slot="in_user" slot-scope="text, record" :info="{...record.in_user}" /> <user-info slot="in_user" slot-scope="text, record" :info="{...record.in_user}" />
<user-info slot="out_user" slot-scope="text, record" :info="{...record.out_user}" /> <user-info slot="out_user" slot-scope="text, record" :info="{...record.out_user}" />
<a slot="number" slot-scope="text, record" style="color: #1890ff">{{ record.number }}</a> <a slot="number" slot-scope="text, record" style="color: #1890ff">{{ record.number }}</a>
<a slot="stock" slot-scope="text, record" style="color: #1890ff">{{ record.stock }}</a> <a slot="stock" slot-scope="text, record" style="color: #1890ff">{{ record.stock }}</a>
<a slot="total" slot-scope="text, record" style="color: #1890ff">{{ record.total }}</a> <a slot="total" slot-scope="text, record" style="color: #1890ff">{{ record.total }}</a>
</s-table> </s-table>
</a-card> </a-card>

View File

@@ -44,7 +44,7 @@
showPagination="auto" showPagination="auto"
bordered bordered
size="default"> size="default">
<a slot="number" slot-scope="text, record" style="color: #1890ff">{{ record.number }}</a> <a slot="number" slot-scope="text, record" style="color: #1890ff">{{ record.number }}</a>
</s-table> </s-table>
</a-card> </a-card>
</page-header-wrapper> </page-header-wrapper>

View File

@@ -1,27 +1,248 @@
<template> <template>
<page-header-wrapper> <page-header-wrapper>
<template v-slot:content>
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="8" :sm="24">
<a-form-item label="用户昵称">
<a-input v-model="queryParam.nickname" placeholder="用户昵称" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="用户手机号">
<a-input v-model="queryParam.username" placeholder="用户手机号" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="身份筛选" has-feedback>
<a-select v-model="queryParam.identity_id" placeholder="身份筛选">
<a-select-option v-for="item in indentitys" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-button type="primary" @click="search"><a-icon type="search" />搜索</a-button>
<a-button class="ml8" type="primary" @click="onAddRole"><a-icon type="plus" />新增</a-button>
<a-button class="ml8" @click="resetSearch"><a-icon type="undo" />重置</a-button>
</a-col>
</a-row>
</a-form>
</div>
</template>
<!-- 列表 --> <!-- 列表 -->
<a-card :bordered="false"> <a-card :bordered="false">
<QuillEditor /> <s-table
ref="table"
:columns="columns"
:data="loadData"
:rowKey="(row) => row.user.user_id"
showPagination="auto"
bordered
size="default"
:scroll="{ x: 1200, y: 1000 }">
<div slot="user_id" slot-scope="text, record">{{ record.user.user_id }}</div>
<div slot="nickname" slot-scope="text, record" >{{ record.user.nickname || '-' }}</div>
<div slot="name" slot-scope="text, record">{{ record.user.name || '-' }}</div>
<div slot="username" slot-scope="text, record">{{ record.user.username || '-' }}</div>
<div slot="identity" slot-scope="text, record">
<img v-if="record.identity&& record.identity.cover" :src="record.identity.cover" alt="" style="width:60px">
<span v-else> {{ record.identity.name }}</span>
</div>
<div slot="invite" slot-scope="text, record" style="color: #1890ff">{{ record.user.invite || '-' }}</div>
<div slot="parent" slot-scope="text, record">{{ record.parent.nickname }}<div>{{ record.parent.username }}</div></div>
<span slot="created_at" slot-scope="text, record">{{ record.created_at }}</span>
<!-- 操作 -->
<div slot="actions" slot-scope="text, record">
<a class="ant-dropdown-link" @click="onEdit(record)">更改推荐人</a>
</div>
</s-table>
</a-card> </a-card>
</page-header-wrapper> </page-header-wrapper>
</template> </template>
<script> <script>
import QuillEditor from '@/components/Editor/QuillEditor.vue' import { STable, UserInfo } from '@/components'
import DeriveButton from '@/components/OrderDetailInfo/DeriveButton'
import moment from 'moment'
import { getMiddlesUser } from '@/api/user'
import EditInvite from './widgets/EditInvite.vue'
import AddUser from './widgets/AddUser.vue'
// 列表规格
const columns = [
{
title: '用户ID',
scopedSlots: { customRender: 'user_id' },
align: 'center',
width: 80
},
{
title: '当前用户信息',
children: [
{
title: '昵称',
scopedSlots: { customRender: 'nickname' },
align: 'center',
width: 200
},
{
title: '真实姓名',
scopedSlots: { customRender: 'name' },
align: 'center',
width: 140
},
{
title: '用户手机',
scopedSlots: { customRender: 'username' },
align: 'center',
width: 140
},
{
title: '身份',
scopedSlots: { customRender: 'identity' },
align: 'center',
width: 140
},
{
title: '邀请码',
scopedSlots: { customRender: 'invite' },
align: 'center',
width: 140
}
],
width: 300,
align: 'center'
},
{
title: '推荐人手机号',
scopedSlots: { customRender: 'parent' },
width: 140,
align: 'center'
},
{
title: '注册时间',
dataIndex: 'created_at',
width: 200,
align: 'center'
},
{
title: '操作',
dataIndex: 'status10',
scopedSlots: { customRender: 'actions' },
align: 'center',
width: 160,
fixed: 'right'
}
]
export default { export default {
name: 'UserIndex', name: 'UserIndex',
components: { components: {
QuillEditor STable,
UserInfo,
DeriveButton
}, },
data () { data () {
return { return {
columns,
indentitys: [
{ id: 1, name: '普通用户' },
{ id: 2, name: 'VIP' },
{ id: 4, name: '创客' },
{ id: 6, name: '代理商' }
], // 业务类型
queryParam: {
username: undefined,
nickname: undefined,
identity_id: undefined
},
listCount: 0,
loadData: (parameter) => {
const requestParameters = Object.assign({}, parameter, this.queryParam)
return getMiddlesUser(requestParameters)
}
}
},
watch: {
$route (to, from) {
if (to.name === 'UserIndex' && (
from.name === 'Home' ||
from.name === 'cityExperienceOfficer' ||
from.name === 'StockOut' ||
from.name === 'StockIn' ||
from.name === 'DealerIn' ||
from.name === 'DealerOut' ||
from.name === 'SalesOnline' ||
from.name === 'SalesStock')
) {
this.$refs.table.loadData()
}
} }
}, },
methods: { methods: {
moment,
// 搜索列表
search () {
this.$refs.table.refresh(true) // 重置接口且刷先到第一页
},
// 重置搜索列表
resetSearch () {
this.queryParam = {
username: undefined,
nickname: undefined,
identity_id: undefined
}
this.$refs.table.refresh(true) // 重置接口且刷先到第一页
},
// 新增用户
onAddRole () {
const success = {
title: '新增用户',
width: 600,
maskClosable: true,
closable: true,
okText: '确认新增',
cancelText: '取消'
}
this.$dialog(
AddUser,
{
on: {
ok: () => {
this.$refs.table.loadData()
}
}
},
success
)
},
// 更改推荐人
onEdit (item) {
const success = {
title: '更改推荐人',
width: 600,
maskClosable: true,
closable: true,
okText: '确认变更',
cancelText: '取消'
}
this.$dialog(
EditInvite,
{
item,
on: {
ok: () => {
this.$refs.table.loadData()
}
}
},
success
)
}
} }
} }
</script> </script>

View File

@@ -1,359 +0,0 @@
<!--
* @Author: Aimee~
* @Date: 2023-12-18 13:31:13
* @LastEditTime: 2023-12-19 16:30:51
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/views/user/widgets/QuillEditorVue.vue
* @Description: vueQuillEditor
-->
<template>
<div class="VueQuillEditor">
<!-- 上传 -->
<a-upload class="quill-upload" :action="actionUrl" @change="handleChange" :show-upload-list="false" ref="aUpload">
</a-upload>
<div class="myQuillTitle">{{ title }}</div>
<quill-editor
v-model="content"
ref="myQuillEditor"
:options="editorOption"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@change="onEditorChange($event)"
@ready="onEditorReady($event)">
</quill-editor>
</div>
</template>
<script>
import Quill from 'quill'
import { quillEditor } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import { ImageDrop } from 'quill-image-drop-module'
import ImageaResize from 'quill-image-resize-module'
import { ImageExtend } from 'quill-image-extend-module'
Quill.register('modules/imageResize', ImageaResize)
Quill.register('modules/imageExtend', ImageExtend)
Quill.register('modules/imageDrop', ImageDrop)
// 富文本顶部按钮
const toolbar = [
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
['blockquote', 'code-block'], // 引用 代码块
[{ header: 1 }, { header: 2 }], // 1、2 级标题
[{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
[{ script: 'sub' }, { script: 'super' }], // 上标/下标
[{ indent: '-1' }, { indent: '+1' }], // 缩进
[{ direction: 'rtl' }], // 文本方向
[{ 'size': ['12', '14', '16', '18', '20', '22', '24', '28', '32', '36'] }], // 字体大小
[{ header: [1, 2, 3, 4, 5, 6] }], // 标题
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
// [{ font: ['songti'] }], // 字体种类
[{ align: [] }], // 对齐方式
['clean'], // 清除文本格式
['link', 'video'], // 链接、图片、视频
['myUploadBtn'] // 自定义上传按钮
]
// toolbar标题
const titleConfig = [
{ Choice: '.ql-insertMetric', title: '跳转配置' },
{ Choice: '.ql-bold', title: '加粗' },
{ Choice: '.ql-italic', title: '斜体' },
{ Choice: '.ql-underline', title: '下划线' },
{ Choice: '.ql-header', title: '段落格式' },
{ Choice: '.ql-strike', title: '删除线' },
{ Choice: '.ql-blockquote', title: '块引用' },
{ Choice: '.ql-code', title: '插入代码' },
{ Choice: '.ql-code-block', title: '插入代码段' },
{ Choice: '.ql-font', title: '字体' },
{ Choice: '.ql-size', title: '字体大小' },
{ Choice: '.ql-list[value="ordered"]', title: '编号列表' },
{ Choice: '.ql-list[value="bullet"]', title: '项目列表' },
{ Choice: '.ql-direction', title: '文本方向' },
{ Choice: '.ql-header[value="1"]', title: 'h1' },
{ Choice: '.ql-header[value="2"]', title: 'h2' },
{ Choice: '.ql-align', title: '对齐方式' },
{ Choice: '.ql-color', title: '字体颜色' },
{ Choice: '.ql-background', title: '背景颜色' },
{ Choice: '.ql-image', title: '图像' },
{ Choice: '.ql-video', title: '视频' },
{ Choice: '.ql-link', title: '添加链接' },
{ Choice: '.ql-formula', title: '插入公式' },
{ Choice: '.ql-clean', title: '清除字体格式' },
{ Choice: '.ql-script[value="sub"]', title: '下标' },
{ Choice: '.ql-script[value="super"]', title: '上标' },
{ Choice: '.ql-indent[value="-1"]', title: '向左缩进' },
{ Choice: '.ql-indent[value="+1"]', title: '向右缩进' },
{ Choice: '.ql-header .ql-picker-label', title: '标题大小' },
{ Choice: '.ql-header .ql-picker-item[data-value="1"]', title: '标题一' },
{ Choice: '.ql-header .ql-picker-item[data-value="2"]', title: '标题二' },
{ Choice: '.ql-header .ql-picker-item[data-value="3"]', title: '标题三' },
{ Choice: '.ql-header .ql-picker-item[data-value="4"]', title: '标题四' },
{ Choice: '.ql-header .ql-picker-item[data-value="5"]', title: '标题五' },
{ Choice: '.ql-header .ql-picker-item[data-value="6"]', title: '标题六' },
{ Choice: '.ql-header .ql-picker-item:last-child', title: '标准' },
{ Choice: '.ql-size .ql-picker-item[data-value="small"]', title: '小号' },
{ Choice: '.ql-size .ql-picker-item[data-value="large"]', title: '大号' },
{ Choice: '.ql-size .ql-picker-item[data-value="huge"]', title: '超大号' },
{ Choice: '.ql-size .ql-picker-item:nth-child(2)', title: '标准' },
{ Choice: '.ql-align .ql-picker-item:first-child', title: '居左对齐' },
{ Choice: '.ql-align .ql-picker-item[data-value="center"]', title: '居中对齐' },
{ Choice: '.ql-align .ql-picker-item[data-value="right"]', title: '居右对齐' },
{ Choice: '.ql-align .ql-picker-item[data-value="justify"]', title: '两端对齐' }
]
// 遍历中文
for (const item of titleConfig) {
const tip = document.querySelector('.quill-editor ' + item.Choice)
if (!tip) continue
tip.setAttribute('title', item.title)
}
export default {
name: 'QuillEditor',
components: { quillEditor },
props: {
title: {
type: String,
default: () => {
return ''
}
},
content: {
type: String,
default: () => {
return ''
}
}
},
data () {
return {
// 富文本编辑器配置
editorOption: {
modules: {
history: { // 后退
delay: 1000,
maxStack: 50,
userOnly: false
},
imageDrop: true, // 可以拉图片
imageResize: {
displaySize: true // 修改图片大小
},
toolbar: {
container: toolbar,
handlers: {
myUploadBtn: this.myUploadBtnClick
}
}
},
placeholder: '请输入正文'
},
actionUrl: 'https://text.twmkeji.cn/api'
}
},
mounted () {
this.initButton()
},
methods: {
// 失去焦点事件
onEditorBlur (quill) {
console.log('editor blur!', quill)
},
// 获得焦点事件
onEditorFocus (quill) {
console.log('editor focus!', quill)
},
// 准备富文本编辑器
onEditorReady (quill) {
console.log('editor ready!', quill)
},
// 内容改变事件
onEditorChange ({ quill, html, text }) {
// console.log('editor change!', quill, html, text)
this.$emit('updateHtml', html)
},
// 自定义按钮内容初始化
initButton () {
const myUploadBtn = document.querySelector('.ql-myUploadBtn')
myUploadBtn.innerHTML = '<i class="el-icon-picture" style="font-size:18px;color:black;"></i>'
},
// 自定义按钮的点击事件
myUploadBtnClick (e) {
this.$refs.aUpload.$children[0].$refs.uploaderRef.onClick()
},
// 上传图片生成
handleChange (e) {
const { file } = e
if (file.status === 'done') {
console.log('done...')
const url = file.response.data.url[0]
console.log(file.response.data.url)
this.quillSuccess(url)
}
},
// 插入逛飙图片
quillSuccess (url) {
const quill = this.$refs.myQuillEditor.quill
// 获取光标所在位置
const length = quill.getSelection().index
// // 插入图片 res.url 为服务器返回的图片地址
quill.insertEmbed(length, 'image', url)
// // 调整光标到最后
quill.setSelection(length + 1)
}
}
}
</script>
<style>
.myQuillTitle {
color: #222;
padding-bottom: 10px;
}
/* // 这个是字号数字对应的显示的内容vertical-align根据个人需要加不加因为我页面那个字与其他对不齐 */
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="12"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12"]::before {
content: '12px';
vertical-align: top;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14"]::before {
content: '14px';
vertical-align: top;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="16"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16"]::before {
content: '16px';
vertical-align: top;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18"]::before {
content: '18px';
vertical-align: top;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="20"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20"]::before {
content: '20px';
vertical-align: top;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="22"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="22"]::before {
content: '22px';
vertical-align: top;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24"]::before {
content: '24px';
vertical-align: top;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="28"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="28"]::before {
content: '28px';
vertical-align: top;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="32"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32"]::before {
content: '32px';
vertical-align: top;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="36"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="36"]::before {
content: '36px';
vertical-align: top;
}
/* // 这个是字号数字对应的px值 */
.ql-editor .ql-size-12 {
font-size: 12px;
}
.ql-editor .ql-size-14 {
font-size: 14px;
}
.ql-editor .ql-size-16 {
font-size: 16px;
}
.ql-editor .ql-size-18 {
font-size: 18px;
}
.ql-editor .ql-size-20 {
font-size: 20px;
}
.ql-editor .ql-size-22 {
font-size: 22px;
}
.ql-editor .ql-size-24 {
font-size: 24px;
}
.ql-editor .ql-size-28 {
font-size: 28px;
}
.ql-editor .ql-size-32 {
font-size: 32px;
}
.ql-editor .ql-size-36 {
font-size: 36px;
}
/* // 选择字号富文本字的大小 */
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12"]::before {
font-size: 12px;
}
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14"]::before {
font-size: 14px;
}
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16"]::before {
font-size: 16px;
}
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18"]::before {
font-size: 18px;
}
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20"]::before {
font-size: 20px;
}
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="22"]::before {
font-size: 22px;
}
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24"]::before {
font-size: 24px;
}
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="28"]::before {
font-size: 28px;
}
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32"]::before {
font-size: 32px;
}
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="36"]::before {
font-size: 36px;
}
</style>

View File

@@ -36,20 +36,19 @@ const assetsCDN = {
] ]
} }
// vue.config.js
const vueConfig = { const vueConfig = {
configureWebpack: { configureWebpack: {
// webpack plugins
plugins: [ plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
APP_VERSION: `"${require('./package.json').version}"`, APP_VERSION: `"${require('./package.json').version}"`,
GIT_HASH: JSON.stringify(getGitHash()), GIT_HASH: JSON.stringify(getGitHash()),
BUILD_DATE: buildDate BUILD_DATE: buildDate
}),
new webpack.ProvidePlugin({
'window.Quill': 'quill/dist/quill.js',
'Quill': 'quill/dist/quill.js'
}) })
], ],
// if prod, add externals
externals: isProd ? assetsCDN.externals : {} externals: isProd ? assetsCDN.externals : {}
}, },

View File

@@ -10034,28 +10034,7 @@ quill-delta@^3.6.2:
extend "^3.0.2" extend "^3.0.2"
fast-diff "1.1.2" fast-diff "1.1.2"
quill-image-drop-module@1.0.3: quill@^1.3.4:
version "1.0.3"
resolved "https://registry.yarnpkg.com/quill-image-drop-module/-/quill-image-drop-module-1.0.3.tgz#0e5ec8329dd67a12126f166b191bf64d2057a7d3"
integrity sha512-HP0Y2kb3nQk1QbRKZzEe1j3mArRQerN5B/U/MlXrOnxmhy3m/xYmVv0YoE13vWnGnBOIcoXGJ/9fi7l6AwsP8Q==
dependencies:
quill "^1.2.2"
quill-image-extend-module@1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/quill-image-extend-module/-/quill-image-extend-module-1.1.2.tgz#b7c303c45282ae87133d643324d5ca39c6d52921"
integrity sha512-yHJWZWlTjNZzV34zuT4H55ttDwMxmVJ7JUgKnt/Wd3ejUNcaPOV57/sKG8VEMU5mL7bKZPIKmBdb3weM0M5UeA==
quill-image-resize-module@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/quill-image-resize-module/-/quill-image-resize-module-3.0.0.tgz#0fd93746a837336d95b2f536140416a623c71771"
integrity sha512-1TZBnUxU/WIx5dPyVjQ9yN7C6mLZSp04HyWBEMqT320DIq4MW4JgzlOPDZX5ZpBM3bU6sacU4kTLUc8VgYQZYw==
dependencies:
lodash "^4.17.4"
quill "^1.2.2"
raw-loader "^0.5.1"
quill@1.3.7, quill@^1.2.2, quill@^1.3.4:
version "1.3.7" version "1.3.7"
resolved "https://registry.yarnpkg.com/quill/-/quill-1.3.7.tgz#da5b2f3a2c470e932340cdbf3668c9f21f9286e8" resolved "https://registry.yarnpkg.com/quill/-/quill-1.3.7.tgz#da5b2f3a2c470e932340cdbf3668c9f21f9286e8"
integrity sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g== integrity sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==
@@ -10104,11 +10083,6 @@ raw-body@2.5.1:
iconv-lite "0.4.24" iconv-lite "0.4.24"
unpipe "1.0.0" unpipe "1.0.0"
raw-loader@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa"
integrity sha512-sf7oGoLuaYAScB4VGr0tzetsYlS8EJH6qnTCfQ/WVEa89hALQ4RQfCKt5xCyPQKPDUbVUAIP1QsxAwfAjlDp7Q==
react-is@^16.8.4: react-is@^16.8.4:
version "16.13.1" version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
@@ -12241,7 +12215,7 @@ vue-loader@^15.9.2:
vue-hot-reload-api "^2.3.0" vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0" vue-style-loader "^4.1.0"
vue-quill-editor@3.0.6: vue-quill-editor@^3.0.6:
version "3.0.6" version "3.0.6"
resolved "https://registry.yarnpkg.com/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz#1f85646211d68a31a80a72cb7f45bb2f119bc8fb" resolved "https://registry.yarnpkg.com/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz#1f85646211d68a31a80a72cb7f45bb2f119bc8fb"
integrity sha512-g20oSZNWg8Hbu41Kinjd55e235qVWPLfg4NvsLW6d+DhgBTFbEuMpcWlUdrD6qT3+Noim6DRu18VLM9lVShXOQ== integrity sha512-g20oSZNWg8Hbu41Kinjd55e235qVWPLfg4NvsLW6d+DhgBTFbEuMpcWlUdrD6qT3+Noim6DRu18VLM9lVShXOQ==