Commit 2e4d9ffb by ext.wangyuman1

Merge branch 'vue3-master' of https://e.coding.net/linkwechat/linkwechat-front/l…

…inkwechat into bs-dev-wangyuman
2 parents 4a407af4 7c47ae09
Showing 76 changed files with 1871 additions and 1729 deletions
...@@ -359,14 +359,14 @@ li { ...@@ -359,14 +359,14 @@ li {
} }
/* 暗黑模式 Dark mode */ /* 暗黑模式 Dark mode */
@media (prefers-color-scheme: dark) { /* @media (prefers-color-scheme: dark) {
body, body,
img, img,
video { video {
filter: invert(1) brightness(1.5) hue-rotate(180deg); filter: invert(1) brightness(1.5) hue-rotate(180deg);
} }
/* 不使用暗黑模式 */ 不使用暗黑模式
.no-dark { .no-dark {
position: relative; position: relative;
} }
...@@ -378,4 +378,4 @@ li { ...@@ -378,4 +378,4 @@ li {
width: 100%; width: 100%;
backdrop-filter: invert(1) brightness(1.5) hue-rotate(180deg); backdrop-filter: invert(1) brightness(1.5) hue-rotate(180deg);
} }
} } */
html { :root {
--hsl: 149, 93%, 39%; /* 主题色hsl*/ --hsl: 149, 93%, 39%; /* 主题色hsl*/
--hsl-dark: 149, 93%, 34%; /* 深主题色hsl*/ --hsl-dark: 149, 93%, 34%; /* 深主题色hsl*/
...@@ -19,6 +19,15 @@ html { ...@@ -19,6 +19,15 @@ html {
--font-black: #1d2129; /* 通用字体黑色 */ --font-black: #1d2129; /* 通用字体黑色 */
--font-white: #fff; /* 通用字体白色 */ --font-white: #fff; /* 通用字体白色 */
/* 背景色,暗黑模式下为黑色 */
--bg-white: #fff;
}
/* 暗黑模式 */
.dark {
--font-black: var(--font-white);
--bg-white: #1d2129;
} }
/* 项目定制原子类 */ /* 项目定制原子类 */
......
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
flex: auto; flex: auto;
// min-width: 200px; // min-width: 200px;
max-width: 240px; max-width: 240px;
background: #fff; background: var(--bg-white);
border-radius: var(--border-radius-big); border-radius: var(--border-radius-big);
border: 1px solid #edf2f9; border: 1px solid #edf2f9;
line-height: 1; line-height: 1;
......
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
// top: 8px; // top: 8px;
// width: 8px; // width: 8px;
// height: 8px; // height: 8px;
// background: #fff; // background: var(--bg-white);
// transform: rotate(45deg); // transform: rotate(45deg);
// border: 1px solid #e1edfc; // border: 1px solid #e1edfc;
// z-index: 888; // z-index: 888;
...@@ -179,7 +179,7 @@ export default { ...@@ -179,7 +179,7 @@ export default {
@extend .mes; @extend .mes;
color: #333; color: #333;
margin-left: 10px; margin-left: 10px;
background-color: #fff; background: var(--bg-white);
border-top-left-radius: 0; border-top-left-radius: 0;
// &::before { // &::before {
// @extend .angle; // @extend .angle;
......
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
<div class="page"> <div class="page">
<div style="margin-top: 16px"> <div style="margin-top: 16px">
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<el-col :span="5" class="left pad20" style="border-radius: 4px; background: #fff"> <el-col :span="5" class="left pad20" style="border-radius: 4px; background: var(--bg-white)">
<div class="title"> <div class="title">
<div class="title-name">{{ typeTitle[type] }}分组</div> <div class="title-name">{{ typeTitle[type] }}分组</div>
</div> </div>
...@@ -197,8 +197,7 @@ export default { ...@@ -197,8 +197,7 @@ export default {
:class="{ active: groupIndex == key }" :class="{ active: groupIndex == key }"
v-for="(group, key) in groupList" v-for="(group, key) in groupList"
:key="group.id" :key="group.id"
@click="switchGroup(key, group)" @click="switchGroup(key, group)">
>
<div class="name">{{ group.name + ' (' + group.number + ')' }}</div> <div class="name">{{ group.name + ' (' + group.number + ')' }}</div>
</div> </div>
</div> </div>
...@@ -212,8 +211,7 @@ export default { ...@@ -212,8 +211,7 @@ export default {
clearable clearable
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
style="width: 300px" style="width: 300px"
@keyup.enter="search()" @keyup.enter="search()" />
/>
<el-button class="ml10" @click="getList(1)" type="primary">查询</el-button> <el-button class="ml10" @click="getList(1)" type="primary">查询</el-button>
<!-- v-hasPermi="['wecom:material:list']" --> <!-- v-hasPermi="['wecom:material:list']" -->
<el-button @click="resetQuery">重置</el-button> <el-button @click="resetQuery">重置</el-button>
...@@ -227,8 +225,7 @@ export default { ...@@ -227,8 +225,7 @@ export default {
:total="total" :total="total"
v-model:page="query.pageNum" v-model:page="query.pageNum"
v-model:limit="query.pageSize" v-model:limit="query.pageSize"
@pagination="getList()" @pagination="getList()" />
/>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
......
<template> <template>
<div class="left pad20" style="border-radius: 4px; background: #fff"> <div class="left pad20" style="border-radius: 4px; background: var(--bg-white)">
<!--模板库 --> <!--模板库 -->
<div> <div>
<!-- v-hasPermi="['wecom:tlp:add']" --> <!-- v-hasPermi="['wecom:tlp:add']" -->
......
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
bottom: 0; bottom: 0;
z-index: 9; z-index: 9;
text-align: right; text-align: right;
background: #fff; background: var(--bg-white);
padding: 15px 5px 20px; padding: 15px 5px 20px;
border-top: 1px solid #f8f8f8; border-top: 1px solid #f8f8f8;
} }
......
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
} }
.msg { .msg {
min-height: 28px; min-height: 28px;
background-color: #fff; background: var(--bg-white);
border: 1px solid #e4e6e9; border: 1px solid #e4e6e9;
display: inline-block; display: inline-block;
position: relative; position: relative;
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
} }
.avatar { .avatar {
border: 1px solid #fff; border: 1px solid #fff;
background: #fff; background: var(--bg-white);
border-radius: 6px; border-radius: 6px;
width: 28px; width: 28px;
height: 28px; height: 28px;
......
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
border-radius: 40px; border-radius: 40px;
box-sizing: content-box; box-sizing: content-box;
overflow: hidden; overflow: hidden;
background: #fff; background: var(--bg-white);
// .preview-status { // .preview-status {
// display: flex; // display: flex;
// justify-content: space-between; // justify-content: space-between;
......
...@@ -131,7 +131,7 @@ export default { ...@@ -131,7 +131,7 @@ export default {
<div> <div>
<el-dialog :title="title" v-model="Pvisible" width="900px" append-to-body :close-on-click-modal="false"> <el-dialog :title="title" v-model="Pvisible" width="900px" append-to-body :close-on-click-modal="false">
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<el-col :span="5" class="left pad20" style="border-radius: 4px; background: #fff"> <el-col :span="5" class="left pad20" style="border-radius: 4px; background: var(--bg-white)">
<div class="title"> <div class="title">
<div class="title-name">活码分组</div> <div class="title-name">活码分组</div>
</div> </div>
......
...@@ -20,7 +20,8 @@ const common = { ...@@ -20,7 +20,8 @@ const common = {
PRIVACY: env.BASE_URL + 'static/PRIVACY.pdf', // 隐私协议pdf PRIVACY: env.BASE_URL + 'static/PRIVACY.pdf', // 隐私协议pdf
IS_PUBLISH_DIALOG: false, // 是否显示发布弹窗 IS_PUBLISH_DIALOG: false, // 是否显示发布弹窗
COOKIEEXPIRES: 0.5, // token在Cookie中存储的天数,默认0.5天 COOKIEEXPIRES: 0.5, // token在Cookie中存储的天数,默认0.5天
WORKWEIXINPAGENAME: 'EnterpriseWechat', // 企业微信设置页面路由name WORK_WEIXIN_CONFIG_ROUTE_NAME: 'EnterpriseWechat', // 企业微信设置页面路由名称, 用于router 通过name判断与跳转,避免使用path不易于扩展
CUSTOMER_DETAIL_ROUTE_NAME: 'customerDetail', // 客户详情页面路由name,同上
DEFAULT_H5_PIC: env.DOMAIN + '/static/PIC.png', DEFAULT_H5_PIC: env.DOMAIN + '/static/PIC.png',
DEFAULT_H5_ART: env.DOMAIN + '/static/ARTICAL.png', // 文章默认封面 DEFAULT_H5_ART: env.DOMAIN + '/static/ARTICAL.png', // 文章默认封面
DEFAULT_H5_TP: env.DOMAIN + '/static/TEXT_PIC.png', // 图文默认封面 DEFAULT_H5_TP: env.DOMAIN + '/static/TEXT_PIC.png', // 图文默认封面
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<!-- </el-scrollbar> --> <!-- </el-scrollbar> -->
</template> </template>
<script> <script>
import { registerMicroApps, start } from 'qiankun' // import { registerMicroApps, start } from 'qiankun'
export default { export default {
name: 'AppMain', name: 'AppMain',
data() { data() {
...@@ -50,32 +50,32 @@ export default { ...@@ -50,32 +50,32 @@ export default {
// }, // },
}, },
mounted() { mounted() {
if (window.lwConfig.MICRO_APPS && window.lwConfig.MICRO_APPS.store) { // if (window.lwConfig.MICRO_APPS && window.lwConfig.MICRO_APPS.store) {
// window.Vue2 = window.Vue // // window.Vue2 = window.Vue
// delete window.Vue // // delete window.Vue
window.lwConfig.MICRO_APPS.store.loader = (loading) => (this.loading = loading) // window.lwConfig.MICRO_APPS.store.loader = (loading) => (this.loading = loading)
registerMicroApps([window.lwConfig.MICRO_APPS.store], { // registerMicroApps([window.lwConfig.MICRO_APPS.store], {
beforeLoad: () => (this.isActiveMicroApp = true), // beforeLoad: () => (this.isActiveMicroApp = true),
afterUnmount: () => (this.isActiveMicroApp = false), // afterUnmount: () => (this.isActiveMicroApp = false),
}) // })
start({ // start({
sandbox: { experimentalStyleIsolation: true }, // sandbox: { experimentalStyleIsolation: true },
}) // })
// 挂在window供下面微服务使用 // // 挂在window供下面微服务使用
window.lwConfig.$store = { // window.lwConfig.$store = {
dispatch: (_, s) => { // dispatch: (_, s) => {
this.$store.setBusininessDesc(s) // this.$store.setBusininessDesc(s)
}, // },
} // }
// 初始化 state // // 初始化 state
// const actions = initGlobalState({ token: getToken() }) // // const actions = initGlobalState({ token: getToken() })
// actions.onGlobalStateChange((state, prev) => { // // actions.onGlobalStateChange((state, prev) => {
// // state: 变更后的状态; prev 变更前的状态 // // // state: 变更后的状态; prev 变更前的状态
// }); // // });
// actions.setGlobalState(state) // // actions.setGlobalState(state)
} // }
// if (window.lwConfig.MICRO_APPS) { // if (window.lwConfig.MICRO_APPS) {
// import('qiankun').then(({ registerMicroApps, start }) => { // import('qiankun').then(({ registerMicroApps, start }) => {
// registerMicroApps(window.lwConfig.MICRO_APPS) // registerMicroApps(window.lwConfig.MICRO_APPS)
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
flex-direction: column; flex-direction: column;
transition: width 0.28s; transition: width 0.28s;
width: var(--side-bar-width) !important; width: var(--side-bar-width) !important;
background-color: #fff; background: var(--bg-white);
bottom: 0; bottom: 0;
z-index: 1001; z-index: 1001;
overflow: hidden; overflow: hidden;
...@@ -185,7 +185,7 @@ export default { ...@@ -185,7 +185,7 @@ export default {
// 当前激活菜单 // 当前激活菜单
.el-menu-item.is-active { .el-menu-item.is-active {
background: linear-gradient(to right, var(--color) 0%, var(--color-sub) 100%); background: linear-gradient(to right, var(--color) 0%, var(--color-sub) 100%);
box-shadow: 0px 13px 16px 0px rgba(7, 168, 85, 0.2); box-shadow: 0px 13px 16px 0px hsl(var(--hsl-dark), 0.2);
border-radius: 8px; border-radius: 8px;
color: var(--font-white, #fff) !important; color: var(--font-white, #fff) !important;
z-index: 1; z-index: 1;
......
...@@ -211,7 +211,7 @@ export default { ...@@ -211,7 +211,7 @@ export default {
.tags-view-container { .tags-view-container {
height: 34px; height: 34px;
width: 100%; width: 100%;
background: #fff; background: var(--bg-white);
border-bottom: 1px solid #d8dce5; border-bottom: 1px solid #d8dce5;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04); box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
.tags-view-wrapper { .tags-view-wrapper {
...@@ -223,7 +223,7 @@ export default { ...@@ -223,7 +223,7 @@ export default {
line-height: 26px; line-height: 26px;
border: 1px solid #d8dce5; border: 1px solid #d8dce5;
color: #495060; color: #495060;
background: #fff; background: var(--bg-white);
padding: 0 8px; padding: 0 8px;
font-size: 12px; font-size: 12px;
margin-left: 5px; margin-left: 5px;
...@@ -240,7 +240,7 @@ export default { ...@@ -240,7 +240,7 @@ export default {
border-color: #42b983; border-color: #42b983;
&::before { &::before {
content: ''; content: '';
background: #fff; background: var(--bg-white);
display: inline-block; display: inline-block;
width: 8px; width: 8px;
height: 8px; height: 8px;
...@@ -253,7 +253,7 @@ export default { ...@@ -253,7 +253,7 @@ export default {
} }
.contextmenu { .contextmenu {
margin: 0; margin: 0;
background: #fff; background: var(--bg-white);
z-index: 3000; z-index: 3000;
position: absolute; position: absolute;
list-style-type: none; list-style-type: none;
......
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.g-bg-lg { .g-bg-lg {
background: linear-gradient(to left, var(--color) 0%, var(--color-sub) 100%); background: linear-gradient(to left, var(--color) 0%, var(--color-sub) 100%);
box-shadow: 0px 13px 16px 0px rgba(7, 168, 85, 0.2); box-shadow: 0px 13px 16px 0px hsl(var(--hsl-dark), 0.2);
} }
// .nav-scrollbar { // .nav-scrollbar {
// width: calc(100% - 580px); // width: calc(100% - 580px);
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
& > .el-menu-item { & > .el-menu-item {
height: 38px !important; height: 38px !important;
line-height: 38px !important; line-height: 38px !important;
color: #1d2129; color: var(--font-black);
border-radius: 8px; border-radius: 8px;
font-weight: bold; font-weight: bold;
margin: 0 4px !important; margin: 0 4px !important;
......
...@@ -207,7 +207,7 @@ export default { ...@@ -207,7 +207,7 @@ export default {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
color: #1d2129; color: var(--font-black);
.errLog-container { .errLog-container {
display: inline-block; display: inline-block;
...@@ -218,7 +218,7 @@ export default { ...@@ -218,7 +218,7 @@ export default {
// position: absolute; // position: absolute;
// right: 0; // right: 0;
flex: none; flex: none;
background: #fff; background: var(--bg-white);
&:focus { &:focus {
outline: none; outline: none;
...@@ -296,7 +296,7 @@ export default { ...@@ -296,7 +296,7 @@ export default {
// left: 50%; // left: 50%;
// transform: translateX(-50%); // transform: translateX(-50%);
// border-radius: 6px; // border-radius: 6px;
// background: #fff; // background: var(--bg-white);
// } // }
// } // }
// } // }
...@@ -313,7 +313,7 @@ export default { ...@@ -313,7 +313,7 @@ export default {
background: linear-gradient(225deg, var(--color-sub) 0%, var(--color) 100%); background: linear-gradient(225deg, var(--color-sub) 0%, var(--color) 100%);
box-shadow: 0px 4px 20px 0px rgba(28, 49, 111, 0.1); box-shadow: 0px 4px 20px 0px rgba(28, 49, 111, 0.1);
border-radius: 50%; border-radius: 50%;
// background: #fff; // background: var(--bg-white);
// color: var(--color); // color: var(--color);
.contact-us-icon { .contact-us-icon {
color: var(--font-white, #fff); color: var(--font-white, #fff);
......
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
flex-direction: column; flex-direction: column;
} }
.breadcrumb-wrap { .breadcrumb-wrap {
background: #fff; background: var(--bg-white);
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
} }
.top-wrap { .top-wrap {
height: var(--top-nav-heght); height: var(--top-nav-heght);
background: #fff; background: var(--bg-white);
} }
.main-wrap { .main-wrap {
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
height: 100vh; height: 100vh;
background: #e3ebf6; background: #e3ebf6;
.login-top--wrap { .login-top--wrap {
background: #fff; background: var(--bg-white);
padding: 5px 20px; padding: 5px 20px;
box-shadow: 0px 5px 5px rgb(215 215 215 / 35%); box-shadow: 0px 5px 5px rgb(215 215 215 / 35%);
} }
......
...@@ -14,6 +14,10 @@ import ElementPlus, { ElNotification } from 'element-plus' ...@@ -14,6 +14,10 @@ import ElementPlus, { ElNotification } from 'element-plus'
import 'element-plus/dist/index.css' import 'element-plus/dist/index.css'
app.use(ElementPlus, {}) app.use(ElementPlus, {})
// import 'element-plus/theme-chalk/dark/css-vars.css'
// import { useDark, useToggle } from '@vueuse/core'
// useDark()
import '@/styles/index.scss' import '@/styles/index.scss'
// svg图标 // svg图标
......
...@@ -54,13 +54,13 @@ export default function permission(router) { ...@@ -54,13 +54,13 @@ export default function permission(router) {
} else { } else {
// 没有设置企业微信的 // 没有设置企业微信的
let isEnterpriseWechat = router.getRoutes().some((element) => { let isEnterpriseWechat = router.getRoutes().some((element) => {
return element.name === window.lwConfig.WORKWEIXINPAGENAME return element.name === window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME
}) })
// 若有设置企业微信的页面权限,默认跳转到设置企业微信页面 // 若有设置企业微信的页面权限,默认跳转到设置企业微信页面
if (isEnterpriseWechat) { if (isEnterpriseWechat) {
Message.warning('初次使用,请配置企业微信的id,以使用其他功能') Message.warning('初次使用,请配置企业微信的id,以使用其他功能')
next({ next({
name: window.lwConfig.WORKWEIXINPAGENAME, name: window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME,
replace: true, replace: true,
}) })
} else { } else {
......
...@@ -113,14 +113,15 @@ export const loadView = (route) => { ...@@ -113,14 +113,15 @@ export const loadView = (route) => {
res = modules[path] res = modules[path]
// 为需要单独使用的路由命名,避免使用绝对路径跳转 // 为需要单独使用的路由命名,避免使用绝对路径跳转
// 组件路径: route name
let routeNames = { let routeNames = {
'customerManage/customerDetail': 'customerDetail', // 客户详情 'customerManage/customerDetail': window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME, // 客户详情
'drainageCode/staff/list': 'staffCode', // 员工活码 'drainageCode/staff/list': 'staffCode', // 员工活码
'drainageCode/group/list': 'customerGroupCode', // 群活码 'drainageCode/group/list': 'customerGroupCode', // 群活码
'drainageCode/store/list': 'storeCode', //门店活码 'drainageCode/store/list': 'storeCode', //门店活码
'drainageCode/identity/list': 'identityCode', //识客码 'drainageCode/identity/list': 'identityCode', //识客码
'drainageCode/pullNews/list': 'pullNewsCode', //拉新活码 'drainageCode/pullNews/list': 'pullNewsCode', //拉新活码
'enterpriseWechat/list': window.lwConfig.WORKWEIXINPAGENAME, //企微配置 'enterpriseWechat/list': window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME, //企微配置
} }
routeNames[route.component] && (route.name = routeNames[route.component]) routeNames[route.component] && (route.name = routeNames[route.component])
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
.--card { .--card {
padding: 20px 20px; padding: 20px 20px;
border-radius: var(--border-radius-big); border-radius: var(--border-radius-big);
background: #fff; background: var(--bg-white);
} }
// 页面公用搜索 // 页面公用搜索
.top-search { .top-search {
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
} }
.el-radio__input.is-disabled { .el-radio__input.is-disabled {
.el-radio__inner { .el-radio__inner {
background-color: #fff; background: var(--bg-white);
border-color: #dcdfe6; border-color: #dcdfe6;
cursor: default; cursor: default;
} }
...@@ -358,7 +358,7 @@ ...@@ -358,7 +358,7 @@
cursor: default; cursor: default;
&::after { &::after {
background-color: #fff; background: var(--bg-white);
} }
} }
} }
...@@ -541,7 +541,7 @@ ...@@ -541,7 +541,7 @@
// .top-search + .el-table { // .top-search + .el-table {
// @extend .--card; // @extend .--card;
// box-sizing: content-box; // box-sizing: content-box;
// border: 20px solid #fff; border-radius: 20px; background: #fff // border: 20px solid #fff; border-radius: 20px; background: var(--bg-white)
// } // }
.el-table { .el-table {
--el-table-header-bg-color: #f5f7fa; --el-table-header-bg-color: #f5f7fa;
......
...@@ -98,7 +98,7 @@ div:focus { ...@@ -98,7 +98,7 @@ div:focus {
padding: 0 15px; padding: 0 15px;
overflow: hidden; overflow: hidden;
height: 32px; height: 32px;
background-color: #fff; background: var(--bg-white);
.tag-place { .tag-place {
color: #bbb; color: #bbb;
font-size: 14px; font-size: 14px;
...@@ -143,7 +143,7 @@ div:focus { ...@@ -143,7 +143,7 @@ div:focus {
font-weight: 500; font-weight: 500;
color: var(--font-black); color: var(--font-black);
padding: 0 20px; padding: 0 20px;
background: #fff; background: var(--bg-white);
border-radius: var(--border-radius-big) var(--border-radius-big) 0 0; border-radius: var(--border-radius-big) var(--border-radius-big) 0 0;
line-height: 1; line-height: 1;
.desc { .desc {
...@@ -174,7 +174,7 @@ div:focus { ...@@ -174,7 +174,7 @@ div:focus {
// 卡片样式 // 卡片样式
&card { &card {
border-radius: var(--border-radius-big); border-radius: var(--border-radius-big);
background: #fff; background: var(--bg-white);
overflow: auto; overflow: auto;
padding: 20px; padding: 20px;
scroll-behavior: smooth; scroll-behavior: smooth;
...@@ -229,7 +229,7 @@ div:focus { ...@@ -229,7 +229,7 @@ div:focus {
justify-content: center; justify-content: center;
height: 60px; height: 60px;
bottom: 0; bottom: 0;
background: #fff; background: var(--bg-white);
box-shadow: 0px -4px 20px 0px #edf2f9; box-shadow: 0px -4px 20px 0px #edf2f9;
border-radius: var(--border-radius-big); border-radius: var(--border-radius-big);
margin-top: var(--card-margin); margin-top: var(--card-margin);
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
/* 可以在此定义适用于自己团队的css 变量*/ /* 可以在此定义适用于自己团队的css 变量*/
/* element-plus var */ /* element-plus var */
:root { :root,
html.dark {
--el-color-primary: hsl(var(--hsl)); --el-color-primary: hsl(var(--hsl));
--el-color-primary-light-3: hsl(var(--hsl), 0.7); --el-color-primary-light-3: hsl(var(--hsl), 0.7);
--el-color-primary-light-5: hsl(var(--hsl), 0.5); --el-color-primary-light-5: hsl(var(--hsl), 0.5);
...@@ -12,21 +13,21 @@ ...@@ -12,21 +13,21 @@
--el-color-primary-dark-2: var(--color-dark); --el-color-primary-dark-2: var(--color-dark);
--el-color-success: hsl(var(--hsl)); --el-color-success: hsl(var(--hsl));
--el-color-warning: #faad14;
--el-color-danger: #eb5e12;
/* // --el-color-info: #fa7216; /* // --el-color-info: #fa7216;
// --el-color-info: #1E1E1E; */ // --el-color-info: #1E1E1E; */
--el-background-color-base: #e6f8ef;
--el-border-color-extra-light: #e6f8ef;
/* --el-datepicker-inrange-background-color: var(--border-color-extra-light); /* --el-datepicker-inrange-background-color: var(--border-color-extra-light);
--el-datepicker-inrange-hover-background-color: var(--border-color-extra-light); */ --el-datepicker-inrange-hover-background-color: var(--border-color-extra-light); */
--el-button-font-weight: 400; --el-button-font-weight: 400;
/* // --el-color-text-regular: #1f2d3d; */ /* // --el-color-text-regular: #1f2d3d; */
}
:root {
--el-color-warning: #faad14;
--el-color-danger: #eb5e12;
--el-border-color-extra-light: #e6f8ef;
--el-border-color-light: #dfe4ed; --el-border-color-light: #dfe4ed;
--el-border-color-lighter: #e6ebf5; --el-border-color-lighter: #e6ebf5;
......
// RSA加密 // RSA加密
import JSEncrypt from 'jsencrypt/bin/jsencrypt.js' // import JSEncrypt from 'jsencrypt/bin/jsencrypt.js'
import JSEncrypt from 'jsencrypt'
// 密钥对生成 http://web.chacuo.net/netrsakeypair // 密钥对生成 http://web.chacuo.net/netrsakeypair
......
...@@ -344,7 +344,7 @@ export default { ...@@ -344,7 +344,7 @@ export default {
.info_title { .info_title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #1d2129; color: var(--font-black);
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
.info_title { .info_title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #1d2129; color: var(--font-black);
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</el-steps> </el-steps>
</div> </div>
<template v-if="currentActive == 0"> <template v-if="currentActive == 0">
<el-row :gutter="20" type="flex" style="margin-top: 20px;"> <el-row :gutter="20" type="flex" style="margin-top: 20px">
<el-col> <el-col>
<div class="g-card"> <div class="g-card">
<el-form ref="baseForm" :rules="rules" :model="form" label-position="right" label-width="100px"> <el-form ref="baseForm" :rules="rules" :model="form" label-position="right" label-width="100px">
...@@ -18,8 +18,7 @@ ...@@ -18,8 +18,7 @@
placeholder="请输入名称" placeholder="请输入名称"
v-model="form.taskName" v-model="form.taskName"
show-word-limit show-word-limit
clearable clearable></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="推广短链:" prop="shortLinkId"> <el-form-item label="推广短链:" prop="shortLinkId">
<el-button type="primary" icon="el-icon-plus" @click="showShortLink = true"> <el-button type="primary" icon="el-icon-plus" @click="showShortLink = true">
...@@ -27,12 +26,11 @@ ...@@ -27,12 +26,11 @@
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"
@click="$router.push('/drainageCode/publicCustomer/IntelligentShortLink/index')" @click="$router.push('/drainageCode/publicCustomer/IntelligentShortLink/index')">
>
去新建 去新建
</el-button> </el-button>
<div style="margin-top: 10px;"> <div style="margin-top: 10px">
<ShowShortLinkVue :data="shortLinkObj"></ShowShortLinkVue> <ShowShortLinkVue :data="shortLinkObj"></ShowShortLinkVue>
</div> </div>
</el-form-item> </el-form-item>
...@@ -48,10 +46,10 @@ ...@@ -48,10 +46,10 @@
<el-button type="primary" icon="el-icon-plus" @click="choseDialog = true"> <el-button type="primary" icon="el-icon-plus" @click="choseDialog = true">
{{ form.materialId ? '编辑' : '选择' }}海报 {{ form.materialId ? '编辑' : '选择' }}海报
</el-button> </el-button>
<div style="margin-top: 10px;" v-if="posterUrl"> <div style="margin-top: 10px" v-if="posterUrl">
<ul class="el-upload-list el-upload-list--picture-card"> <ul class="el-upload-list el-upload-list--picture-card">
<li class="el-upload-list__item is-success"> <li class="el-upload-list__item is-success">
<img style="width: 100%; height: 100%;" :src="posterUrl" /> <img style="width: 100%; height: 100%" :src="posterUrl" />
<span class="el-upload-list__item-actions"> <span class="el-upload-list__item-actions">
<span class="el-upload-list__item-delete"> <span class="el-upload-list__item-delete">
<el-icon-delete class="el-icon-delete" @click="handleRemove"></el-icon-delete> <el-icon-delete class="el-icon-delete" @click="handleRemove"></el-icon-delete>
...@@ -63,13 +61,13 @@ ...@@ -63,13 +61,13 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="g-card" style="text-align: right;"> <div class="g-card" style="text-align: right">
<el-button plain @click="$router.go(-1)">取消</el-button> <el-button plain @click="$router.go(-1)">取消</el-button>
<el-button type="primary" @click="gotoNext">下一步</el-button> <el-button type="primary" @click="gotoNext">下一步</el-button>
</div> </div>
</el-col> </el-col>
<el-col style="flex-basis: 370px;"> <el-col style="flex-basis: 370px">
<div class="g-card" style="height: 100%;"> <div class="g-card" style="height: 100%">
<div class="info_title">消息预览</div> <div class="info_title">消息预览</div>
<Preview :value="posterUrl"></Preview> <Preview :value="posterUrl"></Preview>
</div> </div>
...@@ -135,7 +133,7 @@ ...@@ -135,7 +133,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="g-card" style="text-align: right;"> <div class="g-card" style="text-align: right">
<el-button plain @click="currentActive = 0">上一步</el-button> <el-button plain @click="currentActive = 0">上一步</el-button>
<el-button plain @click="saveFn" v-loading="loading">保存,暂不推广</el-button> <el-button plain @click="saveFn" v-loading="loading">保存,暂不推广</el-button>
<el-button type="primary" @click="currentActive = 2">下一步</el-button> <el-button type="primary" @click="currentActive = 2">下一步</el-button>
...@@ -153,227 +151,227 @@ ...@@ -153,227 +151,227 @@
</div> </div>
</template> </template>
<script> <script>
import SelectPosterSingle from './components/SelectPosterSingle.vue' import SelectPosterSingle from './components/SelectPosterSingle.vue'
import Preview from './components/PreviewInPhone.vue' import Preview from './components/PreviewInPhone.vue'
import SelectShortLink from '@/components/SelectShortLink' import SelectShortLink from '@/components/SelectShortLink'
import Step3 from './components/Step3.vue' import Step3 from './components/Step3.vue'
import ShowShortLinkVue from './components/ShowShortLink.vue' import ShowShortLinkVue from './components/ShowShortLink.vue'
import { getDetail, savePromotion } from './api' import { getDetail, savePromotion } from './api'
export default { export default {
name: 'short-link-popularize-add', name: 'short-link-popularize-add',
components: { components: {
Preview, Preview,
SelectPosterSingle, SelectPosterSingle,
SelectShortLink, SelectShortLink,
ShowShortLinkVue, ShowShortLinkVue,
Step3 Step3,
}, },
data() { data() {
return { return {
loading: false, loading: false,
form: { form: {
taskName: '', taskName: '',
shortLinkId: '', shortLinkId: '',
style: 0, style: 0,
materialId: '', materialId: '',
type: 0,
client: {
type: 0, type: 0,
client: { sex: null,
type: 0, trackState: null,
sex: null, addBeginTime: '',
trackState: null, addEndTime: '',
addBeginTime: '', labelIds: '',
addEndTime: '', userIds: '',
labelIds: '', sendType: 0,
userIds: '', taskSendTime: '',
sendType: 0, taskEndTime: '',
taskSendTime: '',
taskEndTime: ''
},
attachments: [],
senderList: []
}, },
currentActive: 0, attachments: [],
choseDialog: false, senderList: [],
showShortLink: false,
shortLinkObj: [],
posterUrl: '',
posterObj: {},
rules: {
taskName: [
{
required: true,
message: '请输入任务名称',
trigger: 'blur'
}
],
shortLinkId: [
{
required: true,
message: '请选择短链',
trigger: 'blur'
}
],
style: [
{
required: true,
message: '请选择推广样式',
trigger: 'blur'
}
],
materialId: [
{
required: true,
message: '请选择海报',
trigger: 'blur'
}
]
}
}
},
methods: {
setTypeFn(type) {
this.form.type = type
},
setChange(type) {
if (type == 0) {
this.posterUrl = ''
this.posterObj = {}
this.form.materialId = ''
}
},
saveFn() {
savePromotion(this.form)
.then((res) => {
if (res.code == 200) {
this.msgSuccess('操作成功!')
this.$router.back()
}
this.loading = false
})
.catch(() => {
this.loading = false
})
}, },
gotoNext() { currentActive: 0,
this.$refs.baseForm.validate((validate) => { choseDialog: false,
if (validate) { showShortLink: false,
this.currentActive = 1 shortLinkObj: [],
} posterUrl: '',
}) posterObj: {},
rules: {
taskName: [
{
required: true,
message: '请输入任务名称',
trigger: 'blur',
},
],
shortLinkId: [
{
required: true,
message: '请选择短链',
trigger: 'blur',
},
],
style: [
{
required: true,
message: '请选择推广样式',
trigger: 'blur',
},
],
materialId: [
{
required: true,
message: '请选择海报',
trigger: 'blur',
},
],
}, },
handleRemove() { }
},
methods: {
setTypeFn(type) {
this.form.type = type
},
setChange(type) {
if (type == 0) {
this.posterUrl = '' this.posterUrl = ''
this.posterObj = {} this.posterObj = {}
this.form.materialId = '' this.form.materialId = ''
}, }
getItemArry(data) { },
this.posterUrl = data.materialUrl saveFn() {
this.posterObj = data savePromotion(this.form)
this.form.materialId = data.id .then((res) => {
}, if (res.code == 200) {
getShortLink(data) { this.msgSuccess('操作成功!')
this.form.shortLinkId = data.id this.$router.back()
this.shortLinkObj = [data] }
}, this.loading = false
getUpdateData(data) {
this.form = data
},
updateSteps(step) {
this.currentActive = step
},
getDetailFn() {
getDetail(this.id).then((res) => {
this.form = res.data
this.setEdit()
}) })
}, .catch(() => {
setEdit() { this.loading = false
if (this.form.shortLinkId) { })
this.shortLinkObj = [this.form.shortLink] },
} gotoNext() {
if (this.form.style == 1) { this.$refs.baseForm.validate((validate) => {
this.posterObj = this.form.weMaterial if (validate) {
this.posterUrl = this.posterObj.materialUrl this.currentActive = 1
} }
} })
},
handleRemove() {
this.posterUrl = ''
this.posterObj = {}
this.form.materialId = ''
}, },
created() { getItemArry(data) {
this.id = this.$route.query.id this.posterUrl = data.materialUrl
if (this.$route.query.promotion) { this.posterObj = data
this.currentActive = 1 this.form.materialId = data.id
},
getShortLink(data) {
this.form.shortLinkId = data.id
this.shortLinkObj = [data]
},
getUpdateData(data) {
this.form = data
},
updateSteps(step) {
this.currentActive = step
},
getDetailFn() {
getDetail(this.id).then((res) => {
this.form = res.data
this.setEdit()
})
},
setEdit() {
if (this.form.shortLinkId) {
this.shortLinkObj = [this.form.shortLink]
} }
if (this.id) { if (this.form.style == 1) {
this.getDetailFn() this.posterObj = this.form.weMaterial
this.posterUrl = this.posterObj.materialUrl
} }
},
},
created() {
this.id = this.$route.query.id
if (this.$route.query.promotion) {
this.currentActive = 1
} }
} if (this.id) {
this.getDetailFn()
}
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.info_title { .info_title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #1d2129; color: var(--font-black);
margin-bottom: 10px; margin-bottom: 10px;
} }
.sub-des { .sub-des {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
} }
.title { .title {
font-size: 16px; font-size: 16px;
font-family: PingFang SC-Bold, PingFang SC; font-family: PingFang SC-Bold, PingFang SC;
font-weight: 600; font-weight: 600;
color: #1d2129; color: var(--font-black);
margin: 24px 0; margin: 24px 0;
} }
.unit { .unit {
margin: 0 auto; margin: 0 auto;
display: flex;
flex-wrap: wrap;
width: 580px;
justify-content: space-between;
.unit-item {
width: 280px;
height: 80px;
border-width: 1px;
border-style: solid;
border-color: rgba(242, 242, 242, 1);
border-radius: 5px;
display: flex; display: flex;
flex-wrap: wrap; padding: 17px;
width: 580px; margin-bottom: 20px;
justify-content: space-between; cursor: pointer;
.unit-item { .icon-style {
width: 280px; margin-right: 10px;
height: 80px; margin-top: 7px;
border-width: 1px; font-size: 22px;
border-style: solid; width: 24px;
border-color: rgba(242, 242, 242, 1); // height: 20px;
border-radius: 5px;
display: flex;
padding: 17px;
margin-bottom: 20px;
cursor: pointer;
.icon-style {
margin-right: 10px;
margin-top: 7px;
font-size: 22px;
width: 24px;
// height: 20px;
}
.item-title {
margin-top: 4px;
font-size: 16px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #1d2129;
}
.item-text {
margin-top: 6px;
font-size: 12px;
color: #aaaaaa;
line-height: 24px;
}
&:hover {
border: 1px solid rgba(7, 193, 96, 1);
background-color: rgba(7, 193, 96, 0.09019607843137255);
}
} }
.active_item { .item-title {
margin-top: 4px;
font-size: 16px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: var(--font-black);
}
.item-text {
margin-top: 6px;
font-size: 12px;
color: #aaaaaa;
line-height: 24px;
}
&:hover {
border: 1px solid rgba(7, 193, 96, 1); border: 1px solid rgba(7, 193, 96, 1);
background-color: rgba(7, 193, 96, 0.09019607843137255); background-color: rgba(7, 193, 96, 0.09019607843137255);
} }
} }
.active_item {
border: 1px solid rgba(7, 193, 96, 1);
background-color: rgba(7, 193, 96, 0.09019607843137255);
}
}
</style> </style>
...@@ -351,7 +351,7 @@ export default { ...@@ -351,7 +351,7 @@ export default {
.info_title { .info_title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #1d2129; color: var(--font-black);
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>
...@@ -2,16 +2,15 @@ ...@@ -2,16 +2,15 @@
<div> <div>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="任务信息" name="first"> <el-tab-pane label="任务信息" name="first">
<el-row :gutter="20" type="flex" style="margin-top: 20px;"> <el-row :gutter="20" type="flex" style="margin-top: 20px">
<el-col> <el-col>
<div class="g-card"> <div class="g-card">
<div style="display: flex; justify-content: space-between;"> <div style="display: flex; justify-content: space-between">
<div class="info_title">基本信息</div> <div class="info_title">基本信息</div>
<el-button <el-button
v-if="form.taskStatus == 0" v-if="form.taskStatus == 0"
type="primary" type="primary"
@click="$router.push({ path: './add', query: { id: id } })" @click="$router.push({ path: './add', query: { id: id } })">
>
编辑 编辑
</el-button> </el-button>
</div> </div>
...@@ -23,8 +22,7 @@ ...@@ -23,8 +22,7 @@
v-model="form.taskName" v-model="form.taskName"
show-word-limit show-word-limit
disabled disabled
clearable clearable></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="任务状态:"> <el-form-item label="任务状态:">
<el-tag :type="form.taskStatus == 0 ? 'info' : form.taskStatus == 2 ? 'danger' : ''"> <el-tag :type="form.taskStatus == 0 ? 'info' : form.taskStatus == 2 ? 'danger' : ''">
...@@ -32,7 +30,7 @@ ...@@ -32,7 +30,7 @@
</el-tag> </el-tag>
</el-form-item> </el-form-item>
<el-form-item label="推广短链:"> <el-form-item label="推广短链:">
<div style="margin-top: 10px;"> <div style="margin-top: 10px">
<ShowShortLinkVue :data="shortLinkObj"></ShowShortLinkVue> <ShowShortLinkVue :data="shortLinkObj"></ShowShortLinkVue>
</div> </div>
</el-form-item> </el-form-item>
...@@ -43,10 +41,10 @@ ...@@ -43,10 +41,10 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="form.style == 1" label="推广海报:" prop="materialId"> <el-form-item v-if="form.style == 1" label="推广海报:" prop="materialId">
<div style="margin-top: 10px;" v-if="posterUrl"> <div style="margin-top: 10px" v-if="posterUrl">
<ul class="el-upload-list el-upload-list--picture-card"> <ul class="el-upload-list el-upload-list--picture-card">
<li class="el-upload-list__item is-success"> <li class="el-upload-list__item is-success">
<img style="width: 100%; height: 100%;" :src="posterUrl" /> <img style="width: 100%; height: 100%" :src="posterUrl" />
</li> </li>
</ul> </ul>
</div> </div>
...@@ -54,8 +52,8 @@ ...@@ -54,8 +52,8 @@
</el-form> </el-form>
</div> </div>
</el-col> </el-col>
<el-col style="flex-basis: 370px;"> <el-col style="flex-basis: 370px">
<div class="g-card" style="height: 100%;"> <div class="g-card" style="height: 100%">
<div class="info_title">消息预览</div> <div class="info_title">消息预览</div>
<Preview :value="posterUrl"></Preview> <Preview :value="posterUrl"></Preview>
</div> </div>
...@@ -118,128 +116,128 @@ ...@@ -118,128 +116,128 @@
</template> </template>
<script> <script>
import Statistics from './statistics' import Statistics from './statistics'
import Preview from './components/PreviewInPhone.vue' import Preview from './components/PreviewInPhone.vue'
import ShowShortLinkVue from './components/ShowShortLink.vue' import ShowShortLinkVue from './components/ShowShortLink.vue'
import Step3 from './components/Step3.vue' import Step3 from './components/Step3.vue'
import { getDetail } from './api' import { getDetail } from './api'
export default { export default {
name: 'short-link-popularize-detail', name: 'short-link-popularize-detail',
components: { components: {
Statistics, Statistics,
ShowShortLinkVue, ShowShortLinkVue,
Preview, Preview,
Step3 Step3,
}, },
data() { data() {
return { return {
activeName: 'first', activeName: 'first',
form: { form: {
taskName: '', taskName: '',
shortLinkId: '', shortLinkId: '',
style: 0, style: 0,
materialId: '', materialId: '',
type: null, type: null,
attachments: [] attachments: [],
},
choseDialog: false,
showShortLink: false,
shortLinkObj: [],
posterUrl: '',
posterObj: {},
statusType: [
{ name: '待推广', key: 0 },
{ name: '推广中', key: 1 },
{ name: '已结束', key: 2 }
]
}
},
methods: {
setStatus(data) {
let str = ''
this.statusType.forEach((dd) => {
if (dd.key == data.taskStatus) {
str = dd.name
}
})
return str
}, },
getDetailFn() { choseDialog: false,
getDetail(this.id).then((res) => { showShortLink: false,
this.form = res.data shortLinkObj: [],
if (this.form.shortLinkId) { posterUrl: '',
this.shortLinkObj = [this.form.shortLink] posterObj: {},
} statusType: [
if (this.form.style == 1) { { name: '待推广', key: 0 },
this.posterObj = this.form.weMaterial { name: '推广中', key: 1 },
this.posterUrl = this.posterObj.materialUrl { name: '已结束', key: 2 },
} ],
}) }
} },
methods: {
setStatus(data) {
let str = ''
this.statusType.forEach((dd) => {
if (dd.key == data.taskStatus) {
str = dd.name
}
})
return str
},
getDetailFn() {
getDetail(this.id).then((res) => {
this.form = res.data
if (this.form.shortLinkId) {
this.shortLinkObj = [this.form.shortLink]
}
if (this.form.style == 1) {
this.posterObj = this.form.weMaterial
this.posterUrl = this.posterObj.materialUrl
}
})
}, },
created() { },
this.id = this.$route.query.id created() {
if (this.id) { this.id = this.$route.query.id
this.getDetailFn() if (this.id) {
} this.getDetailFn()
} }
} },
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.unit { .unit {
// margin: 0 auto; // margin: 0 auto;
display: flex;
flex-wrap: wrap;
// width: 580px;
justify-content: space-between;
.unit-item {
width: 280px;
// height: 80px;
border-width: 1px;
border-style: solid;
border-color: rgba(242, 242, 242, 1);
border-radius: 5px;
display: flex; display: flex;
flex-wrap: wrap; padding: 17px;
// width: 580px; margin-bottom: 20px;
justify-content: space-between; // cursor: pointer;
.unit-item { .icon-style {
width: 280px; margin-right: 10px;
// height: 80px; margin-top: 7px;
border-width: 1px; font-size: 22px;
border-style: solid; width: 24px;
border-color: rgba(242, 242, 242, 1); // height: 20px;
border-radius: 5px; }
display: flex; .item-title {
padding: 17px; margin-top: 4px;
margin-bottom: 20px; font-size: 16px;
// cursor: pointer; font-family: Source Han Sans CN-Regular, Source Han Sans CN;
.icon-style { font-weight: 400;
margin-right: 10px; color: var(--font-black);
margin-top: 7px; }
font-size: 22px; .item-text {
width: 24px; margin-top: 6px;
// height: 20px; font-size: 12px;
} color: #aaaaaa;
.item-title { line-height: 24px;
margin-top: 4px;
font-size: 16px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #1d2129;
}
.item-text {
margin-top: 6px;
font-size: 12px;
color: #aaaaaa;
line-height: 24px;
}
&:hover {
border: 1px solid rgba(7, 193, 96, 1);
background-color: rgba(7, 193, 96, 0.09019607843137255);
}
} }
.active_item { &:hover {
border: 1px solid rgba(7, 193, 96, 1); border: 1px solid rgba(7, 193, 96, 1);
background-color: rgba(7, 193, 96, 0.09019607843137255); background-color: rgba(7, 193, 96, 0.09019607843137255);
} }
} }
.info_title { .active_item {
font-size: 16px; border: 1px solid rgba(7, 193, 96, 1);
font-weight: 600; background-color: rgba(7, 193, 96, 0.09019607843137255);
color: #1d2129;
margin-bottom: 10px;
} }
}
.info_title {
font-size: 16px;
font-weight: 600;
color: var(--font-black);
margin-bottom: 10px;
}
</style> </style>
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
.info_title { .info_title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #1d2129; color: var(--font-black);
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>
...@@ -543,7 +543,7 @@ export default { ...@@ -543,7 +543,7 @@ export default {
.total-list { .total-list {
.item { .item {
padding: 10px; padding: 10px;
background-color: #fff; background: var(--bg-white);
} }
} }
.title { .title {
......
...@@ -194,7 +194,7 @@ export default { ...@@ -194,7 +194,7 @@ export default {
goDetail(row) { goDetail(row) {
let { externalUserid, firstUserId: userId } = row let { externalUserid, firstUserId: userId } = row
this.$router.push({ this.$router.push({
path: '/operateCenter/customerManage/customerDetail', name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid, userId }, query: { externalUserid, userId },
}) })
}, },
......
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
.total-list { .total-list {
.item { .item {
padding: 10px; padding: 10px;
background-color: #fff; background: var(--bg-white);
} }
} }
.title { .title {
......
...@@ -219,7 +219,7 @@ export default { ...@@ -219,7 +219,7 @@ export default {
.total-list { .total-list {
.item { .item {
padding: 10px; padding: 10px;
background-color: #fff; background: var(--bg-white);
} }
} }
</style> </style>
...@@ -182,7 +182,7 @@ export default { ...@@ -182,7 +182,7 @@ export default {
.total-list { .total-list {
.item { .item {
padding: 10px; padding: 10px;
background-color: #fff; background: var(--bg-white);
} }
} }
</style> </style>
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
.total-list { .total-list {
.item { .item {
padding: 10px; padding: 10px;
background-color: #fff; background: var(--bg-white);
} }
} }
......
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
show-overflow-tooltip /> show-overflow-tooltip />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button text @click="goDetail(scope.row.id)" v-if="scope.row.isCustomer">客户详情</el-button> <el-button text @click="goDetail(scope.row)" v-if="scope.row.isCustomer">客户详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -584,6 +584,13 @@ export default { ...@@ -584,6 +584,13 @@ export default {
this.loading = false this.loading = false
}) })
}, },
goDetail(row) {
let { externalUserid, firstUserId: userId } = row
this.$router.push({
name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid, userId },
})
},
}, },
mounted() { mounted() {
this.dealLength() this.dealLength()
......
...@@ -252,7 +252,7 @@ export default { ...@@ -252,7 +252,7 @@ export default {
font-size: 16px; font-size: 16px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN; font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #1d2129; color: var(--font-black);
} }
.item-text { .item-text {
margin-top: 6px; margin-top: 6px;
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
box-shadow: 0px 6px 8px 0px rgba(78, 89, 105, 0.3); box-shadow: 0px 6px 8px 0px rgba(78, 89, 105, 0.3);
border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px;
border: 1px solid #fff; border: 1px solid #fff;
background: #fff; background: var(--bg-white);
} }
.shabowbox { .shabowbox {
position: fixed; position: fixed;
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
top: 50%; top: 50%;
margin-top: -235px; margin-top: -235px;
z-index: 2001; z-index: 2001;
background: #fff; background: var(--bg-white);
} }
.shabowboxaudio { .shabowboxaudio {
......
...@@ -223,7 +223,7 @@ export default { ...@@ -223,7 +223,7 @@ export default {
} }
.chatListClassTab { .chatListClassTab {
padding: 10px 10px 0; padding: 10px 10px 0;
background: #fff; background: var(--bg-white);
text-align: left; text-align: left;
} }
</style> </style>
...@@ -221,7 +221,7 @@ export default { ...@@ -221,7 +221,7 @@ export default {
text-align: center; text-align: center;
.el-tabs { .el-tabs {
background: #fff; background: var(--bg-white);
} }
::v-deep .el-tabs__header { ::v-deep .el-tabs__header {
margin: 0; margin: 0;
......
...@@ -297,7 +297,7 @@ export default { ...@@ -297,7 +297,7 @@ export default {
} }
.employ { .employ {
.el-tabs { .el-tabs {
background: #fff; background: var(--bg-white);
} }
.name { .name {
font-size: 16px; font-size: 16px;
......
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
.line-height { .line-height {
padding: 5px; padding: 5px;
border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px;
background-color: #fff; background: var(--bg-white);
} }
.image { .image {
width: 40px; width: 40px;
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
box-shadow: 0px 6px 8px 0px rgba(78, 89, 105, 0.3); box-shadow: 0px 6px 8px 0px rgba(78, 89, 105, 0.3);
border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px;
border: 1px solid #fff; border: 1px solid #fff;
background: #fff; background: var(--bg-white);
} }
.shabowbox { .shabowbox {
position: fixed; position: fixed;
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
top: 50%; top: 50%;
margin-top: -235px; margin-top: -235px;
z-index: 2001; z-index: 2001;
background: #fff; background: var(--bg-white);
} }
.shabowboxaudio { .shabowboxaudio {
......
...@@ -219,7 +219,7 @@ export default { ...@@ -219,7 +219,7 @@ export default {
} }
.chatListClassTab { .chatListClassTab {
padding: 10px 10px 0; padding: 10px 10px 0;
background: #fff; background: var(--bg-white);
text-align: left; text-align: left;
} }
</style> </style>
...@@ -398,7 +398,7 @@ export default { ...@@ -398,7 +398,7 @@ export default {
goRoute(row) { goRoute(row) {
let { externalUserid, firstUserId: userId } = row let { externalUserid, firstUserId: userId } = row
this.$router.push({ this.$router.push({
path: 'customerDetail', name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid, userId }, query: { externalUserid, userId },
}) })
}, },
......
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
width: 50px; width: 50px;
height: 20px; height: 20px;
font-size: 12px; font-size: 12px;
background-color: #fff; background: var(--bg-white);
border: 1px solid #0079de; border: 1px solid #0079de;
border-radius: 10px; border-radius: 10px;
color: #0079de; color: #0079de;
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
v-hasPermi="['customerManage:dimission:edit']" v-hasPermi="['customerManage:dimission:edit']"
@click=" @click="
$router.push({ $router.push({
name: 'customerDetail', name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { externalUserid: row.externalUserid, userId: row.firstUserId, isDelete: true } query: { externalUserid: row.externalUserid, userId: row.firstUserId, isDelete: true }
}) })
" "
......
...@@ -276,7 +276,7 @@ export default { ...@@ -276,7 +276,7 @@ export default {
<el-button <el-button
@click=" @click="
$router.push({ $router.push({
path: '/customerManage/customerManage/customer/customerDetail', name: window.lwConfig.CUSTOMER_DETAIL_ROUTE_NAME,
query: { query: {
externalUserid: row.externalUserid, externalUserid: row.externalUserid,
userId: row.firstUserId, userId: row.firstUserId,
......
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
<div class="page"> <div class="page">
<div style="margin-top: 16px"> <div style="margin-top: 16px">
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<el-col :span="5" class="left pad20" style="border-radius: 4px; background: #fff"> <el-col :span="5" class="left pad20" style="border-radius: 4px; background: var(--bg-white)">
<div class="title"> <div class="title">
<div class="title-name">{{ typeTitle[type] }}分组</div> <div class="title-name">{{ typeTitle[type] }}分组</div>
</div> </div>
......
...@@ -242,6 +242,6 @@ export default { ...@@ -242,6 +242,6 @@ export default {
top: 0; top: 0;
left: 0; left: 0;
z-index: 10; z-index: 10;
background-color: #fff; background: var(--bg-white);
} }
</style> </style>
...@@ -1519,7 +1519,7 @@ export default { ...@@ -1519,7 +1519,7 @@ export default {
font-weight: 500; font-weight: 500;
color: #333; color: #333;
padding: 0 20px; padding: 0 20px;
background: #fff; background: var(--bg-white);
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }
...@@ -1590,7 +1590,7 @@ export default { ...@@ -1590,7 +1590,7 @@ export default {
img { img {
width: 132px; width: 132px;
height: 132px; height: 132px;
background-color: #fff; //设置白色背景色 background: var(--bg-white); //设置白色背景色
padding: 6px; // 利用padding的特性,挤出白边 padding: 6px; // 利用padding的特性,挤出白边
} }
} }
......
...@@ -228,7 +228,7 @@ $selectedColor: #f6f7ff; ...@@ -228,7 +228,7 @@ $selectedColor: #f6f7ff;
right: 56px; right: 56px;
border-color: var(--color); border-color: var(--color);
color: var(--color); color: var(--color);
background: #fff; background: var(--bg-white);
&:hover { &:hover {
background: var(--color); background: var(--color);
color: var(--font-white, #fff); color: var(--font-white, #fff);
...@@ -238,7 +238,7 @@ $selectedColor: #f6f7ff; ...@@ -238,7 +238,7 @@ $selectedColor: #f6f7ff;
right: 24px; right: 24px;
border-color: #f56c6c; border-color: #f56c6c;
color: #f56c6c; color: #f56c6c;
background: #fff; background: var(--bg-white);
&:hover { &:hover {
background: #f56c6c; background: #f56c6c;
color: var(--font-white, #fff); color: var(--font-white, #fff);
......
...@@ -925,7 +925,7 @@ export default { ...@@ -925,7 +925,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
// max-height: 100vh; // max-height: 100vh;
background: #fff; background: var(--bg-white);
} }
.containerPC { .containerPC {
max-width: 350px; max-width: 350px;
......
...@@ -783,7 +783,7 @@ $selectedColor: #f6f7ff; ...@@ -783,7 +783,7 @@ $selectedColor: #f6f7ff;
.logo-wrapper { .logo-wrapper {
position: relative; position: relative;
height: 42px; height: 42px;
background: #fff; background: var(--bg-white);
border-bottom: 1px solid #f1e8e8; border-bottom: 1px solid #f1e8e8;
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -934,7 +934,7 @@ $selectedColor: #f6f7ff; ...@@ -934,7 +934,7 @@ $selectedColor: #f6f7ff;
right: 56px; right: 56px;
border-color: var(--color); border-color: var(--color);
color: var(--color); color: var(--color);
background: #fff; background: var(--bg-white);
&:hover { &:hover {
background: var(--color); background: var(--color);
color: var(--font-white, #fff); color: var(--font-white, #fff);
...@@ -944,7 +944,7 @@ $selectedColor: #f6f7ff; ...@@ -944,7 +944,7 @@ $selectedColor: #f6f7ff;
right: 24px; right: 24px;
border-color: #f56c6c; border-color: #f56c6c;
color: #f56c6c; color: #f56c6c;
background: #fff; background: var(--bg-white);
&:hover { &:hover {
background: #f56c6c; background: #f56c6c;
color: var(--font-white, #fff); color: var(--font-white, #fff);
...@@ -1012,13 +1012,13 @@ $selectedColor: #f6f7ff; ...@@ -1012,13 +1012,13 @@ $selectedColor: #f6f7ff;
border-left: 1px solid #d7d7d7; border-left: 1px solid #d7d7d7;
} }
.smartForms_build_index_liBtn { .smartForms_build_index_liBtn {
background-color: #fff; background: var(--bg-white);
border-left: 0px solid #d7d7d7 !important; border-left: 0px solid #d7d7d7 !important;
border-bottom: none; border-bottom: none;
} }
} }
.drawing-item { .drawing-item {
background-color: #fff !important; background: var(--bg-white) !important;
overflow: inherit !important; overflow: inherit !important;
} }
.sortable-ghost .ssc { .sortable-ghost .ssc {
......
...@@ -317,7 +317,7 @@ export default { ...@@ -317,7 +317,7 @@ export default {
.dataStatistics_optionGraph_li { .dataStatistics_optionGraph_li {
margin-bottom: 10px; margin-bottom: 10px;
width: 49.6%; width: 49.6%;
background-color: #fff; background: var(--bg-white);
padding: 30px; padding: 30px;
} }
} }
......
...@@ -240,7 +240,7 @@ export default { ...@@ -240,7 +240,7 @@ export default {
.dataStatistics_optionGraph_li { .dataStatistics_optionGraph_li {
margin-bottom: 10px; margin-bottom: 10px;
width: 49.6%; width: 49.6%;
background-color: #fff; background: var(--bg-white);
padding: 30px; padding: 30px;
} }
} }
......
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
border-radius: 5px; border-radius: 5px;
background-color: #fff; background: var(--bg-white);
padding: 20px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
} }
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
v-for="item in codeCategoryList" v-for="item in codeCategoryList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"></el-option> :value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="自动通过好友"> <el-form-item label="自动通过好友">
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
</el-form-item> </el-form-item>
<el-form-item label="新客户标签"> <el-form-item label="新客户标签">
<template v-for="(item, index) in baseForm.weEmpleCodeTags"> <template v-for="(item, index) in baseForm.weEmpleCodeTags">
<el-tag v-if="item.tagName" :key="index">{{ item.tagName }}</el-tag> <el-tag v-if="item.tagName" :key="index">{{ item.tagName }}</el-tag>
</template> </template>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="selectedFn"> <el-button type="primary" icon="el-icon-plus" @click="selectedFn">
...@@ -106,7 +107,7 @@ ...@@ -106,7 +107,7 @@
</el-form-item> </el-form-item>
<el-form-item label="活码员工" prop="weEmpleCodeUseScops" v-if="codeForm.qrRuleType == 1"> <el-form-item label="活码员工" prop="weEmpleCodeUseScops" v-if="codeForm.qrRuleType == 1">
<div v-if="codeForm.weEmpleCodeUseScops.length > 0 && codeForm.qrType == 1"> <div v-if="codeForm.weEmpleCodeUseScops.length > 0 && codeForm.qrType == 1">
<el-tag v-for="(item, index) in codeForm.weEmpleCodeUseScops" :key="index"> <el-tag v-for="(item, index) in codeForm.weEmpleCodeUseScops" :key="index">
{{ item.businessName }} {{ item.businessName }}
</el-tag> </el-tag>
</div> </div>
...@@ -135,9 +136,10 @@ ...@@ -135,9 +136,10 @@
<el-form-item <el-form-item
label="备用员工" label="备用员工"
prop="weSpareUseScops" prop="weSpareUseScops"
v-if="codeForm.qrType == 2 && codeForm.qrRuleType == 1"> v-if="codeForm.qrType == 2 && codeForm.qrRuleType == 1"
>
<div v-if="codeForm.weSpareUseScops.length > 0"> <div v-if="codeForm.weSpareUseScops.length > 0">
<el-tag v-for="(item, index) in codeForm.weSpareUseScops" :key="index"> <el-tag v-for="(item, index) in codeForm.weSpareUseScops" :key="index">
{{ item.businessName }} {{ item.businessName }}
</el-tag> </el-tag>
</div> </div>
...@@ -148,30 +150,32 @@ ...@@ -148,30 +150,32 @@
<el-form-item <el-form-item
label="开启备用员工" label="开启备用员工"
prop="openSpareUser" prop="openSpareUser"
v-if="codeForm.qrType == 2 && codeForm.qrRuleType == 1"> v-if="codeForm.qrType == 2 && codeForm.qrRuleType == 1"
>
<el-switch v-model="codeForm.openSpareUser" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="codeForm.openSpareUser" :active-value="1" :inactive-value="0"></el-switch>
<div class="sub-des">员工当日添加用户数达每日上限后添加至备用员工。若如关闭,则自动循环下一个上限</div> <div class="sub-des">员工当日添加用户数达每日上限后添加至备用员工。若如关闭,则自动循环下一个上限</div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="添加同一员工" label="添加同一员工"
prop="openSpareUser" prop="openSpareUser"
v-if="codeForm.qrType == 2 && codeForm.qrRuleType == 1"> v-if="codeForm.qrType == 2 && codeForm.qrRuleType == 1"
>
<el-switch v-model="codeForm.isExclusive" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="codeForm.isExclusive" :active-value="1" :inactive-value="0"></el-switch>
<div class="sub-des">开启后,同一个企业的客户会优先添加到同一个员工。</div> <div class="sub-des">开启后,同一个企业的客户会优先添加到同一个员工。</div>
</el-form-item> </el-form-item>
<el-form-item v-if="codeForm.qrRuleType == 2" label="活码排班" prop="empleCodeRosterDto"> <el-form-item v-if="codeForm.qrRuleType == 2" label="活码排班" prop="empleCodeRosterDto">
<template v-for="(item, index) in codeForm.empleCodeRosterDto" :key="item.id"> <template v-for="(item, index) in codeForm.empleCodeRosterDto" :key="item.id">
<el-card class="box-card roster-card"> <el-card class="box-card roster-card">
<div style="display: flex; justify-content: flex-end"> <div style="display: flex; justify-content: flex-end;">
<el-button v-if="index !== 0" type="text" icon="el-icon-delete" @click="onRemoveRoster(index)"> <el-button v-if="index !== 0" type="text" icon="el-icon-delete" @click="onRemoveRoster(index)">
删除 删除
</el-button> </el-button>
</div> </div>
<el-form-item label="排班员工"> <el-form-item label="排班员工">
<el-tag v-for="(tag, key) in item.weEmpleCodeUseScops" :key="key"> <el-tag v-for="(tag, key) in item.weEmpleCodeUseScops" :key="key">
{{ tag.businessName }} {{ tag.businessName }}
</el-tag> </el-tag>
<el-button style="margin-left: 10px" type="primary" plain @click="onSelectUser(index)"> <el-button style="margin-left: 10px;" type="primary" plain @click="onSelectUser(index)">
{{ item.weEmpleCodeUseScops.length ? '修改' : '选择' }}员工 {{ item.weEmpleCodeUseScops.length ? '修改' : '选择' }}员工
</el-button> </el-button>
</el-form-item> </el-form-item>
...@@ -188,7 +192,7 @@ ...@@ -188,7 +192,7 @@
</el-form-item> </el-form-item>
<el-form-item label="在线时间"> <el-form-item label="在线时间">
<el-time-select <el-time-select
style="width: 40%" style="width: 40%;"
v-model="item.startDate" v-model="item.startDate"
:disabled="index === 0" :disabled="index === 0"
start="00:00" start="00:00"
...@@ -196,10 +200,11 @@ ...@@ -196,10 +200,11 @@
step="00:30" step="00:30"
:max-time="item.endDate" :max-time="item.endDate"
@change="checkStartEnd($event, index)" @change="checkStartEnd($event, index)"
placeholder="任意时间点"></el-time-select> placeholder="任意时间点"
></el-time-select>
- -
<el-time-select <el-time-select
style="width: 40%" style="width: 40%;"
start="00:00" start="00:00"
end="23:59" end="23:59"
step="00:30" step="00:30"
...@@ -207,7 +212,8 @@ ...@@ -207,7 +212,8 @@
@change="checkStartEnd($event, index)" @change="checkStartEnd($event, index)"
v-model="item.endDate" v-model="item.endDate"
:disabled="index === 0" :disabled="index === 0"
placeholder="任意时间点"></el-time-select> placeholder="任意时间点"
></el-time-select>
</el-form-item> </el-form-item>
</el-card> </el-card>
</template> </template>
...@@ -230,14 +236,16 @@ ...@@ -230,14 +236,16 @@
@update="currentActive = 2" @update="currentActive = 2"
@submit="getWelData" @submit="getWelData"
:baseData="materialData" :baseData="materialData"
:showModle="true"></AddMaterial> :showModle="true"
></AddMaterial>
</div> </div>
<!-- 选择标签弹窗 --> <!-- 选择标签弹窗 -->
<SelectTag <SelectTag
v-model:visible="dialogVisibleSelectTag" v-model:visible="dialogVisibleSelectTag"
:defaultValues="selectedTagList" :defaultValues="selectedTagList"
@success="submitSelectTag"></SelectTag> @success="submitSelectTag"
></SelectTag>
<!-- 选择使用员工弹窗 --> <!-- 选择使用员工弹窗 -->
<SelectUser <SelectUser
...@@ -247,7 +255,8 @@ ...@@ -247,7 +255,8 @@
title="选择使用员工" title="选择使用员工"
:isOnlyLeaf="true" :isOnlyLeaf="true"
:isSigleSelect="codeForm.qrType == 1" :isSigleSelect="codeForm.qrType == 1"
@success="selectedUser"></SelectUser> @success="selectedUser"
></SelectUser>
<!-- 选择使用备用员工弹窗 --> <!-- 选择使用备用员工弹窗 -->
<SelectUser <SelectUser
...@@ -257,879 +266,893 @@ ...@@ -257,879 +266,893 @@
title="选择使用备用员工" title="选择使用备用员工"
:isOnlyLeaf="true" :isOnlyLeaf="true"
:isSigleSelect="codeForm.qrType == 1" :isSigleSelect="codeForm.qrType == 1"
@success="selectedSpareUser"></SelectUser> @success="selectedSpareUser"
></SelectUser>
</div> </div>
</template> </template>
<script> <script>
import { getDetail, add, update, getCodeCategoryList } from '@/api/drainageCode/staff' import { getDetail, add, update, getCodeCategoryList } from '@/api/drainageCode/staff'
import SelectTag from '@/components/SelectTag' import SelectTag from '@/components/SelectTag'
import SelectMaterial from '@/components/SelectMaterial' import SelectMaterial from '@/components/SelectMaterial'
import WelcomeContent from '@/components/WelcomeContent.vue' import WelcomeContent from '@/components/WelcomeContent.vue'
import AddMaterial from '@/components/ContentCenter/AddMaterial' import AddMaterial from '@/components/ContentCenter/AddMaterial'
import MemeberList from './memberList.vue' import MemeberList from './memberList.vue'
export default { export default {
components: { components: {
SelectTag, SelectTag,
MemeberList, MemeberList,
SelectMaterial, SelectMaterial,
WelcomeContent, WelcomeContent,
AddMaterial, AddMaterial
}, },
data() { data() {
return { return {
operationIndex: null, operationIndex: null,
formTemp: {}, // 编辑基础数据 formTemp: {}, // 编辑基础数据
materialData: { materialData: {
templateInfo: '', templateInfo: '',
materialMsgList: [], materialMsgList: []
}, },
title: '新建', title: '新建',
currentActive: 1, currentActive: 1,
baseForm: { baseForm: {
qrName: '', qrName: '',
qrGroupId: '', qrGroupId: '',
qrAutoAdd: 1, // 自动通过 qrAutoAdd: 1, // 自动通过
weEmpleCodeTags: [], // 标签 weEmpleCodeTags: [] // 标签
}, },
baseRules: { baseRules: {
qrName: [ qrName: [
{ {
required: true, required: true,
message: '请输入活码名称', message: '请输入活码名称',
trigger: 'blur', trigger: 'blur'
}, }
], ],
qrGroupId: [ qrGroupId: [
{ {
required: true, required: true,
message: '请选择分组', message: '请选择分组',
trigger: 'blur', trigger: 'blur'
}, }
], ]
}, },
codeForm: { codeForm: {
qrType: 1, qrType: 1,
qrRuleType: 1, qrRuleType: 1,
qrRuleMode: 1, qrRuleMode: 1,
openSpareUser: 0, openSpareUser: 0,
isExclusive: 0, isExclusive: 0,
weEmpleCodeUseScops: [], weEmpleCodeUseScops: [],
weSpareUseScops: [], weSpareUseScops: [],
empleCodeRosterDto: [ empleCodeRosterDto: [
{ {
type: 0, type: 0,
weEmpleCodeUseScops: [], // 员工 weEmpleCodeUseScops: [], // 员工
weSpareUseScops: [], // 备用员工 weSpareUseScops: [], // 备用员工
weekday: [1, 2, 3, 4, 5, 6, 7], // 周期 weekday: [1, 2, 3, 4, 5, 6, 7], // 周期
qrRuleType: 2, qrRuleType: 2,
startDate: '00:00', // 开始时间 startDate: '00:00', // 开始时间
endDate: '23:59', // 结束时间 endDate: '23:59' // 结束时间
}, }
], ]
}, },
codeRules: { codeRules: {
qrType: [ qrType: [
{ {
required: true, required: true,
message: '请选择', message: '请选择',
trigger: 'blur', trigger: 'blur'
}, }
], ],
qrRuleType: [ qrRuleType: [
{ {
required: true, required: true,
message: '请选择', message: '请选择',
trigger: 'blur', trigger: 'blur'
}, }
], ],
qrRuleMode: [ qrRuleMode: [
{ {
required: true, required: true,
message: '请选择', message: '请选择',
trigger: 'blur', trigger: 'blur'
}, }
], ],
openSpareUser: [ openSpareUser: [
{ {
required: false, required: false,
message: '请选择', message: '请选择',
trigger: 'blur', trigger: 'blur'
}, }
], ],
weEmpleCodeUseScops: [ weEmpleCodeUseScops: [
{ {
required: true, required: true,
message: '请选择', message: '请选择',
trigger: 'blur', trigger: 'blur',
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (value.length == 0) { if (value.length == 0) {
callback(new Error('请选择')) callback(new Error('请选择'))
} else { } else {
callback() callback()
}
} }
}, }
}, ],
], weSpareUseScops: [
weSpareUseScops: [ {
{ required: false,
required: false, trigger: 'blur'
trigger: 'blur', }
}, ]
], },
}, isInsertClientName: true,
isInsertClientName: true, dialogVisibleSelectUser: false,
dialogVisibleSelectUser: false, dialogVisibleSelectSpareUser: false,
dialogVisibleSelectSpareUser: false, dialogVisibleSelectTag: false,
dialogVisibleSelectTag: false, dialogVisibleSelectMaterial: false,
dialogVisibleSelectMaterial: false, dialogVisibleSelectWel: false,
dialogVisibleSelectWel: false, loading: false,
loading: false, codeCategoryList: [], // 活码分组
codeCategoryList: [], // 活码分组 selectedUserList: [], // 需要回显的选中员工
selectedUserList: [], // 需要回显的选中员工 selectedSpareUserList: [], // 需要回显的选中备用员工
selectedSpareUserList: [], // 需要回显的选中备用员工 selectedTagList: [],
selectedTagList: [], timeConflict: false
timeConflict: false, }
}
},
created() {
let id = this.$route.query.id
let groupId = this.$route.query.groupId
if (groupId) {
this.baseForm.qrGroupId = groupId
}
this.getCodeCategoryList()
if (id) {
this.title = '编辑'
this.getDetailFn(id)
}
},
methods: {
getList(data) {
this.codeForm.weEmpleCodeUseScops = data
}, },
checkStartEnd(e, index) { created() {
this.timeConflict = false let id = this.$route.query.id
this.operationIndex = index let groupId = this.$route.query.groupId
let goto = this.allTimeConflict() // 默认全天员工冲突 if (groupId) {
// let timeGo = true // 非默认周期时间冲突 this.baseForm.qrGroupId = groupId
if (goto) { }
// if (this.operationIndex > 0) { this.getCodeCategoryList()
if ( if (id) {
this.codeForm.empleCodeRosterDto[this.operationIndex].weekday.length && this.title = '编辑'
(this.codeForm.empleCodeRosterDto[this.operationIndex].endDate || this.getDetailFn(id)
this.codeForm.empleCodeRosterDto[this.operationIndex].startDate)
) {
this.someTimeConflict()
}
// }
} }
}, },
someTimeConflict() { methods: {
let conflictUserItem = [] // 存在冲突的当前数据 getList(data) {
let userList = [] // 当前重复人员 this.codeForm.weEmpleCodeUseScops = data
let passList = [] // 当前之前的人员 不包含默认的第一条 },
checkStartEnd(e, index) {
let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map((i) => { this.timeConflict = false
return { userId: i.businessId, name: i.businessName } this.operationIndex = index
}) let goto = this.allTimeConflict() // 默认全天员工冲突
this.codeForm.empleCodeRosterDto.forEach((data, key) => { // let timeGo = true // 非默认周期时间冲突
data.weEmpleCodeUseScops.map((i, index) => { if (goto) {
if (key != this.operationIndex) { // if (this.operationIndex > 0) {
passList.push({ if (
userId: i.businessId, this.codeForm.empleCodeRosterDto[this.operationIndex].weekday.length &&
name: i.businessName, (this.codeForm.empleCodeRosterDto[this.operationIndex].endDate ||
index: key, this.codeForm.empleCodeRosterDto[this.operationIndex].startDate)
week: [], ) {
goto1: true, this.someTimeConflict()
goto2: true,
})
} }
// }
}
},
someTimeConflict() {
let conflictUserItem = [] // 存在冲突的当前数据
let userList = [] // 当前重复人员
let passList = [] // 当前之前的人员 不包含默认的第一条
let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map((i) => {
return { userId: i.businessId, name: i.businessName }
}) })
}) this.codeForm.empleCodeRosterDto.forEach((data, key) => {
current.map((dd) => { data.weEmpleCodeUseScops.map((i, index) => {
passList.map((ff) => { if (key != this.operationIndex) {
if (dd.userId === ff.userId) { passList.push({
userList.push(ff) userId: i.businessId,
} name: i.businessName,
index: key,
week: [],
goto1: true,
goto2: true
})
}
})
}) })
}) current.map((dd) => {
// 重复人员下的时间校验 passList.map((ff) => {
let repeatWeek = [] if (dd.userId === ff.userId) {
let currentWeekday = this.codeForm.empleCodeRosterDto[this.operationIndex].weekday userList.push(ff)
userList.forEach((user) => {
const arr = this.codeForm.empleCodeRosterDto[user.index].weekday
for (var i = 0; i < arr.length; i++) {
if (currentWeekday.indexOf(arr[i]) != -1) {
user.week.push(arr[i])
}
}
})
userList.forEach((ddd) => {
if (ddd.week.length) {
let start = this.codeForm.empleCodeRosterDto[ddd.index].startDate
let end = this.codeForm.empleCodeRosterDto[ddd.index].endDate
if (start && end) {
if (this.codeForm.empleCodeRosterDto[this.operationIndex].startDate) {
ddd.goto1 = this.checkAuditTime(
start,
end,
this.codeForm.empleCodeRosterDto[this.operationIndex].startDate,
)
} }
if (this.codeForm.empleCodeRosterDto[this.operationIndex].endDate) { })
ddd.goto2 = this.checkAuditTime(start, end, this.codeForm.empleCodeRosterDto[this.operationIndex].endDate) })
// 重复人员下的时间校验
let repeatWeek = []
let currentWeekday = this.codeForm.empleCodeRosterDto[this.operationIndex].weekday
userList.forEach((user) => {
const arr = this.codeForm.empleCodeRosterDto[user.index].weekday
for (var i = 0; i < arr.length; i++) {
if (currentWeekday.indexOf(arr[i]) != -1) {
user.week.push(arr[i])
} }
} }
})
userList.forEach((ddd) => {
if (ddd.week.length) {
let start = this.codeForm.empleCodeRosterDto[ddd.index].startDate
let end = this.codeForm.empleCodeRosterDto[ddd.index].endDate
if (start && end) {
if (this.codeForm.empleCodeRosterDto[this.operationIndex].startDate) {
ddd.goto1 = this.checkAuditTime(
start,
end,
this.codeForm.empleCodeRosterDto[this.operationIndex].startDate
)
}
if (this.codeForm.empleCodeRosterDto[this.operationIndex].endDate) {
ddd.goto2 = this.checkAuditTime(
start,
end,
this.codeForm.empleCodeRosterDto[this.operationIndex].endDate
)
}
}
}
})
let str = ''
userList.forEach((fdfd) => {
if (!fdfd.goto1 || !fdfd.goto2) {
let ss = fdfd.week.map((data) => {
return data === 7 ? '日' : data
})
str += '员工' + fdfd.name + '在周' + ss.join('、') + '时间存在冲突;'
}
})
if (str) {
this.timeConflict = true
this.msgError(str)
} else {
this.timeConflict = false
} }
}) },
let str = '' allTimeConflict() {
userList.forEach((fdfd) => { if (this.operationIndex === 0) {
if (!fdfd.goto1 || !fdfd.goto2) { return true
let ss = fdfd.week.map((data) => {
return data === 7 ? '日' : data
})
str += '员工' + fdfd.name + '在周' + ss.join('、') + '时间存在冲突;'
} }
}) let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map((i) => {
if (str) { return { userId: i.businessId, name: i.businessName }
this.timeConflict = true })
this.msgError(str) let first = this.codeForm.empleCodeRosterDto[0].weEmpleCodeUseScops.map((i) => {
} else { return { userId: i.businessId, name: i.businessName }
this.timeConflict = false
}
},
allTimeConflict() {
if (this.operationIndex === 0) {
return true
}
let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map((i) => {
return { userId: i.businessId, name: i.businessName }
})
let first = this.codeForm.empleCodeRosterDto[0].weEmpleCodeUseScops.map((i) => {
return { userId: i.businessId, name: i.businessName }
})
let result = []
current.map((dd) => {
first.map((ff) => {
if (dd.userId === ff.userId) {
result.push(dd)
}
}) })
}) let result = []
if (result.length) { current.map((dd) => {
let str = result first.map((ff) => {
.map((obj, index) => { if (dd.userId === ff.userId) {
return obj.name result.push(dd)
}
}) })
.join(',') })
this.msgError('员工 ' + str + ' 已是全天在线,时间存在冲突!') if (result.length) {
this.timeConflict = true let str = result
return false .map((obj, index) => {
} else { return obj.name
this.timeConflict = false })
return true .join(',')
} this.msgError('员工 ' + str + ' 已是全天在线,时间存在冲突!')
}, this.timeConflict = true
checkAuditTime(beginTime, endTime, current) { return false
let strb = beginTime.split(':') } else {
if (strb.length != 2) { this.timeConflict = false
return false return true
} }
let stre = endTime.split(':') },
if (stre.length != 2) { checkAuditTime(beginTime, endTime, current) {
return false let strb = beginTime.split(':')
} if (strb.length != 2) {
let cur = current.split(':') return false
if (cur.length != 2) { }
return false let stre = endTime.split(':')
} if (stre.length != 2) {
let b = new Date() return false
let e = new Date() }
let n = new Date() let cur = current.split(':')
b.setHours(strb[0]) if (cur.length != 2) {
b.setMinutes(strb[1]) return false
e.setHours(stre[0]) }
e.setMinutes(stre[1]) let b = new Date()
n.setHours(cur[0]) let e = new Date()
n.setMinutes(cur[1]) let n = new Date()
if (n.getTime() - b.getTime() >= 0 && n.getTime() - e.getTime() <= 0) { b.setHours(strb[0])
return false b.setMinutes(strb[1])
} else { e.setHours(stre[0])
return true e.setMinutes(stre[1])
} n.setHours(cur[0])
}, n.setMinutes(cur[1])
cancelFn() { if (n.getTime() - b.getTime() >= 0 && n.getTime() - e.getTime() <= 0) {
this.$router.back() return false
}, } else {
getWelData(data) { return true
this.submit(data) }
}, },
changeType(e) { cancelFn() {
if (e === 1) { this.$router.back()
this.codeForm.qrRuleType = 1 },
} getWelData(data) {
}, this.submit(data)
nextStep(nextStep) { },
let form = '' changeType(e) {
if (nextStep == 2) { if (e === 1) {
form = 'baseForm' this.codeForm.qrRuleType = 1
} else if (nextStep == 3) { }
form = 'codeForm' },
} nextStep(nextStep) {
this.$refs[form].validate((validate) => { let form = ''
if (validate) { if (nextStep == 2) {
if (nextStep === 3) { form = 'baseForm'
if (this.codeForm.qrRuleType === 2) { } else if (nextStep == 3) {
let go = true form = 'codeForm'
let week = true }
let time = true this.$refs[form].validate((validate) => {
this.codeForm.empleCodeRosterDto.forEach((ddd) => { if (validate) {
if (!ddd.weEmpleCodeUseScops.length) { if (nextStep === 3) {
go = false if (this.codeForm.qrRuleType === 2) {
} let go = true
if (!ddd.weekday.length) { let week = true
week = false let time = true
} this.codeForm.empleCodeRosterDto.forEach((ddd) => {
if (!ddd.startDate || !ddd.endDate) { if (!ddd.weEmpleCodeUseScops.length) {
time = false go = false
} }
}) if (!ddd.weekday.length) {
if (go) { week = false
if (week) { }
if (time) { if (!ddd.startDate || !ddd.endDate) {
if (this.timeConflict) { time = false
this.msgError('排班存在冲突!') }
})
if (go) {
if (week) {
if (time) {
if (this.timeConflict) {
this.msgError('排班存在冲突!')
} else {
this.currentActive = nextStep
}
} else { } else {
this.currentActive = nextStep this.msgError('请选择活码排班每项的在线时间!')
} }
} else { } else {
this.msgError('请选择活码排班每项的在线时间!') this.msgError('活码排班每项工作周期至少勾选一项!')
} }
} else { } else {
this.msgError('活码排班每项工作周期至少勾选一项!') this.msgError('活码排班每项至少选择一名员工!')
} }
} else { } else {
this.msgError('活码排班每项至少选择一名员工!') this.currentActive = nextStep
} }
} else { } else {
this.currentActive = nextStep this.currentActive = nextStep
} }
}
})
},
/** 获取详情 */
getDetailFn(id) {
getDetail(id).then((res) => {
this.formTemp = res.data
let base = JSON.parse(JSON.stringify(res.data))
this.baseForm = {
qrName: base.name,
qrGroupId: base.groupId,
qrAutoAdd: base.autoAdd, // 自动通过
weEmpleCodeTags: base.qrTags // 标签
}
this.codeForm.qrType = base.type
this.codeForm.qrRuleType = base.ruleType
this.codeForm.qrRuleMode = base.ruleMode
this.codeForm.openSpareUser = base.openSpareUser
this.codeForm.isExclusive = base.isExclusive
if (base.ruleType === 1) {
let arr = []
let spareArr = []
base.qrUserInfos[0].weQrUserList.forEach((dd) => {
if (dd.isSpareUser === 0) {
let obj = {
scopeId: base.qrUserInfos[0].scopeId,
businessId: dd.userId,
businessName: dd.userName,
businessNumber: dd.schedulingNum
}
arr.push(obj)
} else {
let obj = {
scopeId: base.qrUserInfos[0].scopeId,
businessId: dd.userId,
businessName: dd.userName
}
spareArr.push(obj)
}
})
this.codeForm.weEmpleCodeUseScops = arr
this.codeForm.weSpareUseScops = spareArr
} else { } else {
this.currentActive = nextStep let arr = []
base.qrUserInfos.forEach((dd) => {
let obj = {
type: dd.type,
startDate: dd.beginTime,
endDate: dd.endTime,
weekday: dd.workCycle ? dd.workCycle.split(',').map((i) => parseInt(i, 0)) : [],
scopeId: dd.scopeId,
weEmpleCodeUseScops: dd.weQrUserList.map((ff) => {
return { businessId: ff.userId, businessName: ff.userName }
})
}
arr.push(obj)
})
this.codeForm.empleCodeRosterDto = arr
} }
} this.materialData = {
}) templateInfo: base.qrAttachments ? base.qrAttachments[0].content : '',
}, attachments: base.qrAttachments ? this.setEditList(base.qrAttachments) : []
/** 获取详情 */ }
getDetailFn(id) { // this.materialData.materialMsgList.forEach(ddd => {
getDetail(id).then((res) => { // ddd.msgType = Number(ddd.msgType)
this.formTemp = res.data // })
let base = JSON.parse(JSON.stringify(res.data)) })
this.baseForm = { },
qrName: base.name, setEditList(list) {
qrGroupId: base.groupId, let arr = []
qrAutoAdd: base.autoAdd, // 自动通过 if (list && list.length) {
weEmpleCodeTags: base.qrTags, // 标签 list.forEach((dd) => {
} if (dd.realType === 0) {
this.codeForm.qrType = base.type
this.codeForm.qrRuleType = base.ruleType
this.codeForm.qrRuleMode = base.ruleMode
this.codeForm.openSpareUser = base.openSpareUser
this.codeForm.isExclusive = base.isExclusive
if (base.ruleType === 1) {
let arr = []
let spareArr = []
base.qrUserInfos[0].weQrUserList.forEach((dd) => {
if (dd.isSpareUser === 0) {
let obj = { let obj = {
scopeId: base.qrUserInfos[0].scopeId, id: dd.materialId,
businessId: dd.userId, mediaType: '0',
businessName: dd.userName, materialUrl: dd.picUrl
businessNumber: dd.schedulingNum,
} }
arr.push(obj) arr.push(obj)
} else { } else if (dd.realType === 2) {
let obj = { let obj = {
scopeId: base.qrUserInfos[0].scopeId, id: dd.materialId,
businessId: dd.userId, mediaType: '2',
businessName: dd.userName, materialUrl: dd.fileUrl,
coverUrl: dd.picUrl,
digest: dd.description,
materialName: dd.title
} }
spareArr.push(obj) arr.push(obj)
} } else if (dd.realType === 3) {
}) let obj = {
this.codeForm.weEmpleCodeUseScops = arr id: dd.materialId,
this.codeForm.weSpareUseScops = spareArr mediaType: '3',
} else { materialUrl: dd.fileUrl,
let arr = [] digest: dd.description,
base.qrUserInfos.forEach((dd) => { materialName: dd.title
let obj = { }
type: dd.type, arr.push(obj)
startDate: dd.beginTime, } else if (dd.realType === 4) {
endDate: dd.endTime, let obj = {
weekday: dd.workCycle ? dd.workCycle.split(',').map((i) => parseInt(i, 0)) : [], id: dd.materialId,
scopeId: dd.scopeId, mediaType: '4',
weEmpleCodeUseScops: dd.weQrUserList.map((ff) => { content: dd.content
return { businessId: ff.userId, businessName: ff.userName } }
}), arr.push(obj)
} else if (dd.realType === 9) {
let obj = {
id: dd.materialId,
mediaType: '9',
content: dd.content,
coverUrl: dd.picUrl,
materialUrl: dd.linkUrl,
materialName: dd.title
}
arr.push(obj)
} else if (dd.realType === 8) {
let ob = {
id: dd.materialId,
mediaType: '8',
materialName: dd.title,
materialUrl: dd.linkUrl,
materialName: dd.title
}
arr.push(ob)
} else if (dd.realType === 11) {
let ff = {
id: dd.materialId,
mediaType: '11',
digest: dd.appId,
materialName: dd.title,
coverUrl: dd.picUrl,
materialUrl: dd.fileUrl
}
arr.push(ff)
} else if (dd.realType === 12) {
let ff = {
id: dd.materialId,
mediaType: '12',
digest: dd.description,
materialUrl: dd.fileUrl,
coverUrl: dd.picUrl,
content: dd.content,
materialName: dd.title
}
arr.push(ff)
} else if (dd.realType === 5) {
let obj = {
id: dd.materialId,
mediaType: '5',
materialUrl: dd.fileUrl,
materialName: dd.title
}
arr.push(obj)
} }
arr.push(obj)
}) })
this.codeForm.empleCodeRosterDto = arr
}
this.materialData = {
templateInfo: base.qrAttachments ? base.qrAttachments[0].content : '',
attachments: base.qrAttachments ? this.setEditList(base.qrAttachments) : [],
} }
// this.materialData.materialMsgList.forEach(ddd => { return arr
// ddd.msgType = Number(ddd.msgType) },
// }) // 获取活码分组
}) getCodeCategoryList() {
}, getCodeCategoryList({ mediaType: 6 }).then((res) => {
setEditList(list) { this.codeCategoryList = res.data
let arr = []
if (list && list.length) {
list.forEach((dd) => {
if (dd.realType === 0) {
let obj = {
id: dd.materialId,
mediaType: '0',
materialUrl: dd.picUrl,
}
arr.push(obj)
} else if (dd.realType === 2) {
let obj = {
id: dd.materialId,
mediaType: '2',
materialUrl: dd.fileUrl,
coverUrl: dd.picUrl,
digest: dd.description,
materialName: dd.title,
}
arr.push(obj)
} else if (dd.realType === 3) {
let obj = {
id: dd.materialId,
mediaType: '3',
materialUrl: dd.fileUrl,
digest: dd.description,
materialName: dd.title,
}
arr.push(obj)
} else if (dd.realType === 4) {
let obj = {
id: dd.materialId,
mediaType: '4',
content: dd.content,
}
arr.push(obj)
} else if (dd.realType === 9) {
let obj = {
id: dd.materialId,
mediaType: '9',
content: dd.content,
coverUrl: dd.picUrl,
materialUrl: dd.linkUrl,
materialName: dd.title,
}
arr.push(obj)
} else if (dd.realType === 8) {
let ob = {
id: dd.materialId,
mediaType: '8',
materialName: dd.title,
materialUrl: dd.linkUrl,
materialName: dd.title,
}
arr.push(ob)
} else if (dd.realType === 11) {
let ff = {
id: dd.materialId,
mediaType: '11',
digest: dd.appId,
materialName: dd.title,
coverUrl: dd.picUrl,
materialUrl: dd.fileUrl,
}
arr.push(ff)
} else if (dd.realType === 12) {
let ff = {
id: dd.materialId,
mediaType: '12',
digest: dd.description,
materialUrl: dd.fileUrl,
coverUrl: dd.picUrl,
content: dd.content,
materialName: dd.title,
}
arr.push(ff)
} else if (dd.realType === 5) {
let obj = {
id: dd.materialId,
mediaType: '5',
materialUrl: dd.fileUrl,
materialName: dd.title,
}
arr.push(obj)
}
}) })
} },
return arr // 选择人员变化事件
}, selectedUser(users) {
// 获取活码分组 let params = {
getCodeCategoryList() { userIds: [],
getCodeCategoryList({ mediaType: 6 }).then((res) => { departmentIds: []
this.codeCategoryList = res.data
})
},
// 选择人员变化事件
selectedUser(users) {
let params = {
userIds: [],
departmentIds: [],
}
const selectedUserList = users.map((d) => {
d.userId && params.userIds.push(d.userId)
d.id && params.departmentIds.push(d.id)
return {
businessId: d.userId || d.id,
businessName: d.name,
businessIdType: d.userId ? 2 : 1,
businessNumber: 1,
}
})
params.userIds += ''
params.departmentIds += ''
// 全天排班
if (this.codeForm.qrRuleType == 1) {
this.codeForm.weEmpleCodeUseScops = selectedUserList
} else {
// 自动排班
this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weEmpleCodeUseScops = selectedUserList
this.checkStartEnd(null, this.selectedRosterIndex)
}
},
// 选择备用人员变化事件
selectedSpareUser(users) {
let params = {
spareUserIds: [],
departmentIds: [],
}
const selectedSpareUserList = users.map((d) => {
d.userId && params.spareUserIds.push(d.userId)
d.id && params.departmentIds.push(d.id)
return {
businessId: d.userId || d.id,
businessName: d.name,
businessIdType: d.userId ? 2 : 1,
} }
}) const selectedUserList = users.map((d) => {
params.spareUserIds += '' d.userId && params.userIds.push(d.userId)
params.departmentIds += '' d.id && params.departmentIds.push(d.id)
// 全天排班
if (this.codeForm.qrRuleType == 1) {
this.codeForm.weSpareUseScops = selectedSpareUserList
} else {
// 自动排班
this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weSpareUseScops = selectedSpareUserList
this.checkStartEnd(null, this.selectedRosterIndex)
}
},
// 自动排班-选择员工
onSelectUser(index) {
// 设置回显数据
this.selectedUserList = []
if (this.codeForm.qrRuleType == 2) {
this.selectedRosterIndex = index
let arr = []
arr = this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weEmpleCodeUseScops.map((dd) => {
return {
userId: dd.businessId,
// id: dd.businessIdType === 1 ? dd.businessId:'',
name: dd.businessName,
}
})
this.selectedUserList = arr
// this.selectedUserList = [...this.codeForm.weEmpleCodeUseScops[index]]
} else {
// this.selectedUserList = [...this.codeForm.weEmpleCodeUseScops]
let arr = []
arr = this.codeForm.weEmpleCodeUseScops.map((dd) => {
return {
userId: dd.businessId,
// id: dd.businessIdType === 1 ? dd.businessId:'',
name: dd.businessName,
}
})
this.selectedUserList = arr
}
this.dialogVisibleSelectUser = true
},
// 自动排班-选择备用员工
onSelectSpareUser(index) {
// 设置回显数据
this.selectedSpareUserList = []
if (this.codeForm.qrRuleType == 2) {
this.selectedRosterIndex = index
let arr = []
arr = this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weSpareUseScops.map((dd) => {
return { return {
userId: dd.businessId, businessId: d.userId || d.id,
// id: dd.businessIdType === 1 ? dd.businessId:'', businessName: d.name,
name: dd.businessName, businessIdType: d.userId ? 2 : 1,
businessNumber: 1
} }
}) })
this.selectedSpareUserList = arr params.userIds += ''
// this.selectedSpareUserList = [...this.codeForm.weSpareUseScops[index]] params.departmentIds += ''
} else { // 全天排班
// this.selectedSpareUserList = [...this.codeForm.weSpareUseScops] if (this.codeForm.qrRuleType == 1) {
let arr = [] this.codeForm.weEmpleCodeUseScops = selectedUserList
arr = this.codeForm.weSpareUseScops.map((dd) => { } else {
// 自动排班
this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weEmpleCodeUseScops = selectedUserList
this.checkStartEnd(null, this.selectedRosterIndex)
}
},
// 选择备用人员变化事件
selectedSpareUser(users) {
let params = {
spareUserIds: [],
departmentIds: []
}
const selectedSpareUserList = users.map((d) => {
d.userId && params.spareUserIds.push(d.userId)
d.id && params.departmentIds.push(d.id)
return { return {
userId: dd.businessId, businessId: d.userId || d.id,
// id: dd.businessIdType === 1 ? dd.businessId:'', businessName: d.name,
name: dd.businessName, businessIdType: d.userId ? 2 : 1
} }
}) })
this.selectedSpareUserList = arr params.spareUserIds += ''
} params.departmentIds += ''
this.dialogVisibleSelectSpareUser = true // 全天排班
}, if (this.codeForm.qrRuleType == 1) {
// 添加工作周期 this.codeForm.weSpareUseScops = selectedSpareUserList
onAddRoster() { } else {
this.codeForm.empleCodeRosterDto.push({ // 自动排班
weEmpleCodeUseScops: [], // 员工 this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weSpareUseScops = selectedSpareUserList
weekday: [], // 周期 this.checkStartEnd(null, this.selectedRosterIndex)
type: 1, }
startDate: '', // 开始时间 },
endDate: '', // 结束时间 // 自动排班-选择员工
}) onSelectUser(index) {
}, // 设置回显数据
// 删除工作周期 this.selectedUserList = []
onRemoveRoster(index) { if (this.codeForm.qrRuleType == 2) {
this.timeConflict = false this.selectedRosterIndex = index
this.codeForm.empleCodeRosterDto.splice(index, 1) let arr = []
}, arr = this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weEmpleCodeUseScops.map((dd) => {
// 工作周期时间变化 return {
onRosterTimeChange(e, index) { userId: dd.businessId,
const [startTime, endTime] = e // id: dd.businessIdType === 1 ? dd.businessId:'',
this.codeForm.empleCodeRosterDto[index].startDate = startTime name: dd.businessName
this.codeForm.empleCodeRosterDto[index].endDate = endTime }
this.codeForm.empleCodeRosterDto[index].time = e })
}, this.selectedUserList = arr
selectedFn() { // this.selectedUserList = [...this.codeForm.weEmpleCodeUseScops[index]]
if (this.baseForm.weEmpleCodeTags) { } else {
this.selectedTagList = this.baseForm.weEmpleCodeTags.map((dd) => ({ // this.selectedUserList = [...this.codeForm.weEmpleCodeUseScops]
tagId: dd.tagId, let arr = []
name: dd.tagName, arr = this.codeForm.weEmpleCodeUseScops.map((dd) => {
})) return {
} userId: dd.businessId,
this.dialogVisibleSelectTag = true // id: dd.businessIdType === 1 ? dd.businessId:'',
}, name: dd.businessName
submitSelectTag(data) {
this.baseForm.weEmpleCodeTags = data.map((d) => ({
tagId: d.tagId,
tagName: d.name,
}))
},
resetData(list) {
let arr = []
if (list && list.length) {
list.forEach((dd) => {
if (dd.msgType === '0') {
let obj = {
msgType: 'image',
picUrl: dd.materialUrl,
} }
arr.push(obj) })
} else if (dd.msgType === '8') { this.selectedUserList = arr
let ob = { }
msgType: 'link', this.dialogVisibleSelectUser = true
title: dd.materialName, },
linkUrl: dd.materialUrl, // 自动排班-选择备用员工
onSelectSpareUser(index) {
// 设置回显数据
this.selectedSpareUserList = []
if (this.codeForm.qrRuleType == 2) {
this.selectedRosterIndex = index
let arr = []
arr = this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weSpareUseScops.map((dd) => {
return {
userId: dd.businessId,
// id: dd.businessIdType === 1 ? dd.businessId:'',
name: dd.businessName
} }
arr.push(ob) })
} else if (dd.msgType === '9') { this.selectedSpareUserList = arr
let ff = { // this.selectedSpareUserList = [...this.codeForm.weSpareUseScops[index]]
msgType: 'miniprogram', } else {
appId: dd.digest, // this.selectedSpareUserList = [...this.codeForm.weSpareUseScops]
title: dd.materialName, let arr = []
picUrl: dd.coverUrl, arr = this.codeForm.weSpareUseScops.map((dd) => {
linkUrl: dd.materialUrl, return {
userId: dd.businessId,
// id: dd.businessIdType === 1 ? dd.businessId:'',
name: dd.businessName
} }
arr.push(ff) })
} this.selectedSpareUserList = arr
}) }
} this.dialogVisibleSelectSpareUser = true
return arr },
}, // 添加工作周期
submit(data) { onAddRoster() {
this.loading = true this.codeForm.empleCodeRosterDto.push({
let list = data.attachments weEmpleCodeUseScops: [], // 员工
let myObj = { weekday: [], // 周期
attachments: [ type: 1,
{ startDate: '', // 开始时间
content: data.templateInfo, endDate: '' // 结束时间
msgType: 'text',
},
],
}
myObj.attachments.push(...list)
if (this.codeForm.qrRuleType === 1) {
let qrUserInfosDetail = []
this.codeForm.weEmpleCodeUseScops.forEach((uu) => {
let objDetail = {
userId: uu.businessId,
schedulingNum: uu.businessNumber,
}
qrUserInfosDetail.push(objDetail)
}) })
let obj = { },
type: 0, // 删除工作周期
scopeId: this.codeForm.weEmpleCodeUseScops[0].scopeId ? this.codeForm.weEmpleCodeUseScops[0].scopeId : '', onRemoveRoster(index) {
userIds: this.codeForm.weEmpleCodeUseScops.map((dd) => dd.businessId), this.timeConflict = false
spareUserIds: this.codeForm.weSpareUseScops.map((ss) => ss.businessId), this.codeForm.empleCodeRosterDto.splice(index, 1)
qrUserInfosDetail: qrUserInfosDetail, },
// 工作周期时间变化
onRosterTimeChange(e, index) {
const [startTime, endTime] = e
this.codeForm.empleCodeRosterDto[index].startDate = startTime
this.codeForm.empleCodeRosterDto[index].endDate = endTime
this.codeForm.empleCodeRosterDto[index].time = e
},
selectedFn() {
if (this.baseForm.weEmpleCodeTags) {
this.selectedTagList = this.baseForm.weEmpleCodeTags.map((dd) => ({
tagId: dd.tagId,
name: dd.tagName
}))
} }
this.codeForm.qrUserInfos = [obj] this.dialogVisibleSelectTag = true
} else { },
this.codeForm.qrUserInfos = [] submitSelectTag(data) {
this.codeForm.empleCodeRosterDto.forEach((fff) => { this.baseForm.weEmpleCodeTags = data.map((d) => ({
tagId: d.tagId,
tagName: d.name
}))
},
resetData(list) {
let arr = []
if (list && list.length) {
list.forEach((dd) => {
if (dd.msgType === '0') {
let obj = {
msgType: 'image',
picUrl: dd.materialUrl
}
arr.push(obj)
} else if (dd.msgType === '8') {
let ob = {
msgType: 'link',
title: dd.materialName,
linkUrl: dd.materialUrl
}
arr.push(ob)
} else if (dd.msgType === '9') {
let ff = {
msgType: 'miniprogram',
appId: dd.digest,
title: dd.materialName,
picUrl: dd.coverUrl,
linkUrl: dd.materialUrl
}
arr.push(ff)
}
})
}
return arr
},
submit(data) {
this.loading = true
let list = data.attachments
let myObj = {
attachments: [
{
content: data.templateInfo,
msgType: 'text'
}
]
}
myObj.attachments.push(...list)
if (this.codeForm.qrRuleType === 1) {
let qrUserInfosDetail = []
this.codeForm.weEmpleCodeUseScops.forEach((uu) => {
let objDetail = {
userId: uu.businessId,
schedulingNum: uu.businessNumber
}
qrUserInfosDetail.push(objDetail)
})
let obj = { let obj = {
scopeId: fff.scopeId ? fff.scopeId : '', type: 0,
type: fff.type, scopeId: this.codeForm.weEmpleCodeUseScops[0].scopeId ? this.codeForm.weEmpleCodeUseScops[0].scopeId : '',
beginTime: fff.startDate, userIds: this.codeForm.weEmpleCodeUseScops.map((dd) => dd.businessId),
endTime: fff.endDate, spareUserIds: this.codeForm.weSpareUseScops.map((ss) => ss.businessId),
userIds: fff.weEmpleCodeUseScops.map((dd) => dd.businessId), qrUserInfosDetail: qrUserInfosDetail
workCycle: fff.weekday,
} }
this.codeForm.qrUserInfos.push(obj) this.codeForm.qrUserInfos = [obj]
}) } else {
} this.codeForm.qrUserInfos = []
this.baseForm.qrTags = this.baseForm.weEmpleCodeTags.map((ccc) => ccc.tagId) this.codeForm.empleCodeRosterDto.forEach((fff) => {
let obj = Object.assign({}, this.baseForm, this.codeForm, myObj) let qrUserInfosDetail = []
delete obj.weEmpleCodeTags fff.weEmpleCodeUseScops.forEach((uu) => {
delete obj.weEmpleCodeUseScops let objDetail = {
delete obj.empleCodeRosterDto userId: uu.businessId,
if (this.formTemp.id) { schedulingNum: 0
obj.qrId = this.formTemp.id }
obj.configId = this.formTemp.configId qrUserInfosDetail.push(objDetail)
})
let obj = {
scopeId: fff.scopeId ? fff.scopeId : '',
type: fff.type,
beginTime: fff.startDate,
endTime: fff.endDate,
userIds: fff.weEmpleCodeUseScops.map((dd) => dd.businessId),
workCycle: fff.weekday,
qrUserInfosDetail: qrUserInfosDetail
}
this.codeForm.qrUserInfos.push(obj)
})
}
this.baseForm.qrTags = this.baseForm.weEmpleCodeTags.map((ccc) => ccc.tagId)
let obj = Object.assign({}, this.baseForm, this.codeForm, myObj)
delete obj.weEmpleCodeTags
delete obj.weEmpleCodeUseScops
delete obj.empleCodeRosterDto
if (this.formTemp.id) {
obj.qrId = this.formTemp.id
obj.configId = this.formTemp.configId
}
;(this.formTemp.id ? update : add)(obj)
.then(({ data }) => {
this.msgSuccess('操作成功')
this.loading = false
this.$router.back()
})
.catch(() => {
this.loading = false
})
} }
;(this.formTemp.id ? update : add)(obj) }
.then(({ data }) => { }
this.msgSuccess('操作成功')
this.loading = false
this.$router.back()
})
.catch(() => {
this.loading = false
})
},
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sub-des { .sub-des {
font-size: 12px; font-size: 12px;
font-weight: 400;
color: #999999;
}
.add-continue {
cursor: pointer;
font-size: 14px;
font-weight: 400; font-weight: 400;
color: var(--color); color: #999999;
display: flex;
align-items: center;
justify-content: center;
&:hover {
opacity: 0.8;
} }
}
.crumb- { .add-continue {
// 一级 页面标题 cursor: pointer;
&title { font-size: 14px;
font-weight: 400;
color: var(--color);
display: flex; display: flex;
flex-direction: column; align-items: center;
justify-content: center; justify-content: center;
height: 90px; // line-height: 90px; &:hover {
font-size: 18px; opacity: 0.8;
font-weight: 500; }
color: #333;
padding: 0 20px;
background: #fff;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
} }
}
.crumb { .crumb- {
font-size: 12px; // 一级 页面标题
&title {
display: flex;
flex-direction: column;
justify-content: center;
height: 90px; // line-height: 90px;
font-size: 18px;
font-weight: 500;
color: #333;
padding: 0 20px;
background: var(--bg-white);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
}
font-weight: 400; .crumb {
color: #666666; font-size: 12px;
display: flex;
} font-weight: 400;
color: #666666;
display: flex;
}
.wrap { .wrap {
display: flex; display: flex;
margin-top: 24px; margin-top: 24px;
.el-form { .el-form {
margin-right: 10%; margin-right: 10%;
}
} }
}
.preview-wrap { .preview-wrap {
line-height: 26px; line-height: 26px;
} }
.tip { .tip {
color: #999; color: #999;
} }
.welcome-input { .welcome-input {
display: table; display: table;
width: 80%; width: 80%;
margin: 0 auto 20px; margin: 0 auto 20px;
} }
.el-icon-error { .el-icon-error {
} }
.my-cord { .my-cord {
position: relative; position: relative;
.operation { .operation {
z-index: 100; z-index: 100;
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #1785ff; color: #1785ff;
display: flex; display: flex;
align-items: center; align-items: center;
&:hover { &:hover {
opacity: 0.8; opacity: 0.8;
}
} }
} }
} .roster-btn-delete {
.roster-btn-delete { margin-top: -16%;
margin-top: -16%; margin-right: -8%;
margin-right: -8%; }
} .roster-card:not(:first-child) {
.roster-card:not(:first-child) { margin-top: 20px;
margin-top: 20px; }
} .user-el-tag {
.user-el-tag { margin-right: 50px;
margin-right: 50px; width: 160px;
width: 160px; margin-left: 0px;
margin-left: 0px; }
}
</style> </style>
<template> <template>
<div> <div>
<el-row style="margin-top: 10px" type="flex" :gutter="10"> <el-row style="margin-top: 10px;" type="flex" :gutter="10">
<el-col> <el-col>
<div class="g-card"> <div class="g-card">
<div class="g-card-title">基本信息</div> <div class="g-card-title">基本信息</div>
<div class="pad20"> <div class="pad20">
<el-form label-position="right" label-width="100px"> <el-form label-position="right" label-width="100px">
<el-form-item style="margin-bottom: 10px" label="活码名称">{{ form.name }}</el-form-item> <el-form-item style="margin-bottom: 10px;" label="活码名称">{{ form.name }}</el-form-item>
<el-form-item style="margin-bottom: 10px" label="活码分组">{{ form.qrGroupName }}</el-form-item> <el-form-item style="margin-bottom: 10px;" label="活码分组">{{ form.qrGroupName }}</el-form-item>
<el-form-item style="margin-bottom: 10px" label="自动通过好友"> <el-form-item style="margin-bottom: 10px;" label="自动通过好友">
<el-switch :value="form.autoAdd" :active-value="1" :inactive-value="0" disabled></el-switch> <el-switch :value="form.autoAdd" :active-value="1" :inactive-value="0" disabled></el-switch>
</el-form-item> </el-form-item>
<el-form-item style="margin-bottom: 10px" label="新客户标签"> <el-form-item style="margin-bottom: 10px;" label="新客户标签">
<el-tag v-for="(data, key) in form.qrTags" :key="key">{{ data.tagName }}</el-tag> <el-tag v-for="(data, key) in form.qrTags" :key="key">{{ data.tagName }}</el-tag>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -51,10 +51,10 @@ ...@@ -51,10 +51,10 @@
<div class="pad20" v-for="(unit, index) in form.qrUserInfos" :key="index"> <div class="pad20" v-for="(unit, index) in form.qrUserInfos" :key="index">
<div class="content pad20"> <div class="content pad20">
<el-form label-position="right" label-width="100px"> <el-form label-position="right" label-width="100px">
<el-form-item style="margin-bottom: 10px" label="排班员工"> <el-form-item style="margin-bottom: 10px;" label="排班员工">
<el-tag v-for="(data, key) in unit.weQrUserList" :key="key">{{ data.userName }}</el-tag> <el-tag v-for="(data, key) in unit.weQrUserList" :key="key">{{ data.userName }}</el-tag>
</el-form-item> </el-form-item>
<el-form-item style="margin-bottom: 10px" label="工作周期"> <el-form-item style="margin-bottom: 10px;" label="工作周期">
<el-checkbox-group v-if="unit.type === 0" v-model="checkList"> <el-checkbox-group v-if="unit.type === 0" v-model="checkList">
<el-checkbox label="周一" disabled></el-checkbox> <el-checkbox label="周一" disabled></el-checkbox>
<el-checkbox label="周二" disabled></el-checkbox> <el-checkbox label="周二" disabled></el-checkbox>
...@@ -74,13 +74,36 @@ ...@@ -74,13 +74,36 @@
<el-checkbox label="7" disabled>周日</el-checkbox> <el-checkbox label="7" disabled>周日</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item v-if="unit.type === 0" v-model="checkList" style="margin-bottom: 10px" label="在线时间"> <el-form-item v-if="unit.type === 0" v-model="checkList" style="margin-bottom: 10px;" label="在线时间">
<el-time-select disabled value="00:00" placeholder="任意时间点"></el-time-select> <el-time-select
<el-time-select disabled value="23:59" placeholder="任意时间点"></el-time-select> style="width: 40%;"
disabled
v-model="defaultStart"
placeholder="任意时间点"
></el-time-select>
-
<el-time-select
style="width: 40%;"
v-model="defaultEnd"
disabled
value="23:59"
placeholder="任意时间点"
></el-time-select>
</el-form-item> </el-form-item>
<el-form-item v-else style="margin-bottom: 10px" label="在线时间"> <el-form-item v-else style="margin-bottom: 10px;" label="在线时间">
<el-time-select disabled :value="unit.beginTime" placeholder="任意时间点"></el-time-select> <el-time-select
<el-time-select disabled :value="unit.endTime" placeholder="任意时间点"></el-time-select> style="width: 40%;"
disabled
v-model="unit.beginTime"
placeholder="任意时间点"
></el-time-select>
-
<el-time-select
style="width: 40%;"
disabled
v-model="unit.endTime"
placeholder="任意时间点"
></el-time-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -98,20 +121,21 @@ ...@@ -98,20 +121,21 @@
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
class="ml20" class="ml20"
style="width: 260px" style="width: 260px;"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
type="daterange" type="daterange"
:clearable="false" :clearable="false"
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
@change="getList"></el-date-picker> @change="getList"
></el-date-picker>
</div> </div>
<div ref="chart" id="mychart" style="width: 100%; height: 400px"></div> <div ref="chart" id="mychart" style="width: 100%; height: 400px;"></div>
</div> </div>
</el-col> </el-col>
<el-col style="flex-basis: auto"> <el-col style="flex-basis: auto;">
<div style="height: 100%; display: flex; flex-direction: column"> <div style="height: 100%; display: flex; flex-direction: column;">
<div class="g-card"> <div class="g-card">
<div class="right-title pad20"> <div class="right-title pad20">
<div class="right-title-name">员工活码</div> <div class="right-title-name">员工活码</div>
...@@ -126,15 +150,16 @@ ...@@ -126,15 +150,16 @@
:src="form.qrCode" :src="form.qrCode"
fit="fill" fit="fill"
:preview-src-list="[form.qrCode]" :preview-src-list="[form.qrCode]"
style="width: 124px; height: 124px"></el-image> style="width: 124px; height: 124px;"
></el-image>
<div> <div>
<el-button text @click="download()">下载二维码</el-button> <el-button text @click="download()">下载二维码</el-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="g-card" style="flex: 1"> <div class="g-card" style="flex: 1;">
<preview-client :list="form"></preview-client> <preview-client :list="form.materialMsgList" :templateInfo="form.welcomeMsg"></preview-client>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -143,277 +168,335 @@ ...@@ -143,277 +168,335 @@
</template> </template>
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import PreviewClient from '@/components/previewInMobileClient.vue' import PreviewClient from '@/components/ContentCenter/PreviewInPhone'
import { getDetail, getTotal, downloadBatch } from '@/api/drainageCode/staff' import { getDetail, getTotal, downloadBatch } from '@/api/drainageCode/staff'
export default {
// name: 'CodeDetail',
components: {
export default { PreviewClient
name: 'CodeDetail', },
components: { data() {
PreviewClient, return {
}, defaultStart: '00:00',
data() { defaultEnd: '23:59',
return { form: {},
form: {}, checkList: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
checkList: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], // 遮罩层
// 遮罩层 loading: false,
loading: false, // 选中数组
// 选中数组 ids: [],
ids: [], // 表格数据
// 表格数据 list: [],
list: [], // 日期范围
// 日期范围 dateRange: [],
dateRange: [], // 表单参数
// 表单参数 form: {},
form: {}, // 查询参数
// 查询参数
query: {
qrId: '',
beginTime: undefined,
endTime: undefined,
},
type: {
1: '单人',
2: '多人',
3: '批量单人',
},
timeRange: 7,
cardData: [],
}
},
created() {
let id = this.$route.query.id
this.query.qrId = id
id && this.getDetail(id)
// this.getList()
},
mounted() {
// var clipboard = new this.ClipboardJS('.copy-btn')
},
methods: {
editFn() {
this.$router.push({
path: '/drainageCode/qrCode/staff/' + 'staffAdd',
query: { query: {
id: this.form.id, qrId: '',
beginTime: undefined,
endTime: undefined
},
type: {
1: '单人',
2: '多人',
3: '批量单人'
}, },
}) timeRange: 7,
cardData: []
}
}, },
/** 获取详情 */ created() {
getDetail(id) { let id = this.$route.query.id
this.loading = true this.query.qrId = id
getDetail(id).then((res) => { id && this.getDetail(id)
this.form = res.data // this.getList()
if (this.form.qrAttachments && this.form.qrAttachments.length) { },
this.form.welcomeMsg = this.form.qrAttachments[0].content mounted() {
this.form.materialMsgList = this.setEditList(this.form.qrAttachments) // var clipboard = new this.ClipboardJS('.copy-btn')
} },
this.form.qrUserInfos.forEach((dd) => { methods: {
if (dd.workCycle) { editFn() {
dd.weekday = dd.workCycle.split(',') this.$router.push({
} else { path: '/drainageCode/qrCode/staff/' + 'staffAdd',
dd.weekday = [] query: {
id: this.form.id
} }
}) })
this.loading = false },
this.setTime(7) /** 获取详情 */
}) getDetail(id) {
}, this.loading = true
setEditList(list) { getDetail(id).then((res) => {
let arr = [] this.form = res.data
if (list && list.length) { if (this.form.qrAttachments && this.form.qrAttachments.length) {
list.forEach((dd) => { this.form.welcomeMsg = this.form.qrAttachments[0].content
if (dd.msgType === 'image') { this.form.materialMsgList = this.setEditList(this.form.qrAttachments)
let obj = { }
msgType: '0', this.form.qrUserInfos.forEach((dd) => {
materialUrl: dd.picUrl, if (dd.workCycle) {
dd.weekday = dd.workCycle.split(',')
} else {
dd.weekday = []
} }
arr.push(obj) })
} else if (dd.msgType === 'link') { this.loading = false
let ob = { this.setTime(7)
msgType: '8', })
materialName: dd.title, },
materialUrl: dd.linkUrl, setEditList(list) {
let arr = []
if (list && list.length) {
list.forEach((dd) => {
if (dd.realType === 0) {
let obj = {
id: dd.materialId,
mediaType: '0',
materialUrl: dd.picUrl
}
arr.push(obj)
} else if (dd.realType === 2) {
let obj = {
id: dd.materialId,
mediaType: '2',
materialUrl: dd.fileUrl,
coverUrl: dd.picUrl,
digest: dd.description,
materialName: dd.title
}
arr.push(obj)
} else if (dd.realType === 3) {
let obj = {
id: dd.materialId,
mediaType: '3',
materialUrl: dd.fileUrl,
digest: dd.description,
materialName: dd.title
}
arr.push(obj)
} else if (dd.realType === 4) {
let obj = {
id: dd.materialId,
mediaType: '4',
content: dd.content
}
arr.push(obj)
} else if (dd.realType === 9) {
let obj = {
id: dd.materialId,
mediaType: '9',
content: dd.content,
coverUrl: dd.picUrl,
materialUrl: dd.linkUrl,
materialName: dd.title
}
arr.push(obj)
} else if (dd.realType === 8) {
let ob = {
id: dd.materialId,
mediaType: '8',
materialName: dd.title,
materialUrl: dd.linkUrl,
materialName: dd.title
}
arr.push(ob)
} else if (dd.realType === 11) {
let ff = {
id: dd.materialId,
mediaType: '11',
digest: dd.appId,
materialName: dd.title,
coverUrl: dd.picUrl,
materialUrl: dd.fileUrl
}
arr.push(ff)
} else if (dd.realType === 12) {
let ff = {
id: dd.materialId,
mediaType: '12',
digest: dd.description,
materialUrl: dd.fileUrl,
coverUrl: dd.picUrl,
content: dd.content,
materialName: dd.title
}
arr.push(ff)
} else if (dd.realType === 5) {
let obj = {
id: dd.materialId,
mediaType: '5',
materialUrl: dd.fileUrl,
materialName: dd.title
}
arr.push(obj)
} }
arr.push(ob) })
} else if (dd.msgType === 'miniprogram') { }
let ff = { return arr
msgType: '9', },
digest: dd.appId, getList() {
materialName: dd.title, this.query.beginTime = this.dateRange[0]
coverUrl: dd.picUrl, this.query.endTime = this.dateRange[1]
materialUrl: dd.linkUrl, getTotal(this.query).then(({ data }) => {
this.cardData = [
{
title: '今日扫码次数',
value: data.total
},
{
title: '累计扫码次数',
value: data.today
} }
arr.push(ff) ]
let option = {
xAxis: {
type: 'category',
data: data.xaxis
},
yAxis: {
type: 'value'
},
series: [
{
data: data.yaxis,
type: 'line'
}
]
} }
var myChart = echarts.init(document.getElementById('mychart'))
myChart.setOption(option)
this.$nextTick(() => {
myChart.resize()
})
}) })
} },
return arr setTime(days) {
}, this.timeRange = days
getList() { let date = new Date()
this.query.beginTime = this.dateRange[0] date.setDate(date.getDate() - days)
this.query.endTime = this.dateRange[1] this.dateRange = [this.getTime(date), this.getTime()]
getTotal(this.query).then(({ data }) => { this.getList()
this.cardData = [ },
{ getHandledValue(num) {
title: '今日扫码次数', return num < 10 ? '0' + num : num
value: data.total, },
}, getTime(datePar) {
{ const d = datePar ? new Date(datePar) : new Date()
title: '累计扫码次数', const year = d.getFullYear()
value: data.today, const month = this.getHandledValue(d.getMonth() + 1)
}, const date = this.getHandledValue(d.getDate())
] return year + '-' + month + '-' + date
let option = { },
xAxis: { downloadByBlob(url, name) {
type: 'category', let image = new Image()
data: data.xaxis, image.setAttribute('crossOrigin', 'anonymous')
}, image.src = url
yAxis: { image.onload = () => {
type: 'value', let canvas = document.createElement('canvas')
}, canvas.width = image.width
series: [ canvas.height = image.height
{ let ctx = canvas.getContext('2d')
data: data.yaxis, ctx.drawImage(image, 0, 0, image.width, image.height)
type: 'line', canvas.toBlob((blob) => {
}, let url = URL.createObjectURL(blob)
], this.downloadFn(url, name)
// 用完释放URL对象
URL.revokeObjectURL(url)
})
} }
var myChart = echarts.init(document.getElementById('mychart')) },
myChart.setOption(option) downloadFn(href, name) {
this.$nextTick(() => { let eleLink = document.createElement('a')
myChart.resize() eleLink.download = name
}) eleLink.href = href
}) eleLink.click()
}, eleLink.remove()
setTime(days) { },
this.timeRange = days download() {
let date = new Date() let name = this.form.name + '.png'
date.setDate(date.getDate() - days) this.downloadByBlob(this.form.qrCode, name)
this.dateRange = [this.getTime(date), this.getTime()]
this.getList()
},
getHandledValue(num) {
return num < 10 ? '0' + num : num
},
getTime(datePar) {
const d = datePar ? new Date(datePar) : new Date()
const year = d.getFullYear()
const month = this.getHandledValue(d.getMonth() + 1)
const date = this.getHandledValue(d.getDate())
return year + '-' + month + '-' + date
},
downloadByBlob(url, name) {
let image = new Image()
image.setAttribute('crossOrigin', 'anonymous')
image.src = url
image.onload = () => {
let canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
let ctx = canvas.getContext('2d')
ctx.drawImage(image, 0, 0, image.width, image.height)
canvas.toBlob((blob) => {
let url = URL.createObjectURL(blob)
this.downloadFn(url, name)
// 用完释放URL对象
URL.revokeObjectURL(url)
})
} }
}, }
downloadFn(href, name) { }
let eleLink = document.createElement('a')
eleLink.download = name
eleLink.href = href
eleLink.click()
eleLink.remove()
},
download() {
let name = this.form.name + '.png'
this.downloadByBlob(this.form.qrCode, name)
},
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.top { .top {
align-items: flex-start; align-items: flex-start;
} }
.title {
font-size: 16px;
font-weight: 600;
margin: 0 0 20px;
}
.crumb { .title {
font-size: 12px; font-size: 16px;
font-weight: 600;
margin: 0 0 20px;
}
font-weight: 400; .crumb {
color: #666666; font-size: 12px;
display: flex;
}
.crumb- { font-weight: 400;
// 一级 页面标题 color: #666666;
&title {
display: flex; display: flex;
flex-direction: column;
justify-content: center;
height: 90px; // line-height: 90px;
font-size: 18px;
font-weight: 500;
color: #333;
padding: 0 20px;
background: #fff;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
} }
}
.content { .crumb- {
margin-top: 20px; // 一级 页面标题
border-radius: 4px; &title {
border: 1px solid #f1f1f1; display: flex;
&:first-child { flex-direction: column;
margin-top: 0; justify-content: center;
height: 90px; // line-height: 90px;
font-size: 18px;
font-weight: 500;
color: #333;
padding: 0 20px;
background: var(--bg-white);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
} }
}
.right-title {
display: flex;
justify-content: space-between;
align-items: center;
.right-title-name {
font-size: 16px;
font-weight: 500; .content {
color: #333333; margin-top: 20px;
border-radius: 4px;
border: 1px solid #f1f1f1;
&:first-child {
margin-top: 0;
}
} }
.right-title-edit {
font-size: 12px;
font-weight: 400; .right-title {
color: var(--color);
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
cursor: pointer; .right-title-name {
&:hover { font-size: 16px;
opacity: 0.8;
font-weight: 500;
color: #333333;
}
.right-title-edit {
font-size: 12px;
font-weight: 400;
color: var(--color);
display: flex;
align-items: center;
cursor: pointer;
&:hover {
opacity: 0.8;
}
} }
} }
}
.code-show { .code-show {
text-align: center; // .download-btn { text-align: center; // .download-btn {
// font-size: 12px; // font-size: 12px;
// //
// font-weight: 400; // font-weight: 400;
// color: var(--color); // color: var(--color);
// } // }
} }
</style> </style>
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
.active { .active {
font-weight: 600; font-weight: 600;
color: var(--color) !important; color: var(--color) !important;
background-color: #fff !important; background: var(--bg-white) !important;
box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05); box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05);
} }
.card-tab { .card-tab {
......
...@@ -236,7 +236,7 @@ export default { ...@@ -236,7 +236,7 @@ export default {
.total-list { .total-list {
.item { .item {
padding: 10px; padding: 10px;
background-color: #fff; background: var(--bg-white);
} }
} }
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
.active { .active {
font-weight: 600; font-weight: 600;
color: var(--color) !important; color: var(--color) !important;
background-color: #fff !important; background: var(--bg-white) !important;
box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05); box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05);
} }
.card-tab { .card-tab {
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
.active { .active {
font-weight: 600; font-weight: 600;
color: var(--color) !important; color: var(--color) !important;
background-color: #fff !important; background: var(--bg-white) !important;
box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05); box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05);
} }
.card-tab { .card-tab {
......
...@@ -209,7 +209,7 @@ export default { ...@@ -209,7 +209,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.page { .page {
padding: 30px; padding: 30px;
background-color: #fff; background: var(--bg-white);
border-radius: 8px; border-radius: 8px;
} }
...@@ -237,7 +237,7 @@ export default { ...@@ -237,7 +237,7 @@ export default {
font-weight: 500; font-weight: 500;
color: #333; color: #333;
padding: 0 20px; padding: 0 20px;
background: #fff; background: var(--bg-white);
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }
......
...@@ -636,7 +636,7 @@ export default { ...@@ -636,7 +636,7 @@ export default {
font-weight: 500; font-weight: 500;
color: #333; color: #333;
padding: 0 20px; padding: 0 20px;
background: #fff; background: var(--bg-white);
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }
......
...@@ -466,7 +466,7 @@ export default { ...@@ -466,7 +466,7 @@ export default {
font-weight: 500; font-weight: 500;
color: #333; color: #333;
padding: 0 20px; padding: 0 20px;
background: #fff; background: var(--bg-white);
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }
......
...@@ -70,15 +70,15 @@ export default { ...@@ -70,15 +70,15 @@ export default {
boxData: [ boxData: [
{ {
title: `管理员账号登录企业微信管理后台——进入【应用管理】——点击【${lwConfig.SYSTEM_NAME_MOBILE}】`, title: `管理员账号登录企业微信管理后台——进入【应用管理】——点击【${lwConfig.SYSTEM_NAME_MOBILE}】`,
url: ('@/assets/register/guid/customer-portrait-one.png'), url: '@/assets/register/guid/customer-portrait-one.png',
}, },
{ {
title: `在【${lwConfig.SYSTEM_NAME_MOBILE}】应用内找到“配置到聊天工具栏”功能中的“配置”按钮`, title: `在【${lwConfig.SYSTEM_NAME_MOBILE}】应用内找到“配置到聊天工具栏”功能中的“配置”按钮`,
url: ('@/assets/register/guid/customer-portrait-two.png'), url: '@/assets/register/guid/customer-portrait-two.png',
}, },
{ {
title: '进入“配置到聊天工具栏”功能页后点击“配置页面”按钮配置路径', title: '进入“配置到聊天工具栏”功能页后点击“配置页面”按钮配置路径',
url: ('@/assets/register/guid/customer-portrait-three.png'), url: '@/assets/register/guid/customer-portrait-three.png',
}, },
], ],
boxDataTwo: { boxDataTwo: {
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
title2: '客户画像', title2: '客户画像',
title3: '输入页面内容:选择“自定义”,内容链接为:', title3: '输入页面内容:选择“自定义”,内容链接为:',
title4: 'https://×××××××', title4: 'https://×××××××',
url: ('@/assets/register/guid/customer-portrait-four.png'), url: '@/assets/register/guid/customer-portrait-four.png',
}, },
buttonData: { buttonData: {
one: '返回上一步', one: '返回上一步',
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
boxData: [ boxData: [
{ {
title: '在当前页面内点击“继续配置”按钮', title: '在当前页面内点击“继续配置”按钮',
url: ('@/assets/register/guid/chat-material-five.png'), url: '@/assets/register/guid/chat-material-five.png',
}, },
], ],
boxDataTwo: { boxDataTwo: {
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
title2: '聊天素材', title2: '聊天素材',
title3: '输入页面内容:选择“自定义”,内容链接为:', title3: '输入页面内容:选择“自定义”,内容链接为:',
title4: 'https://×××××××', title4: 'https://×××××××',
url: ('@/assets/register/guid/chat-material-six.png'), url: '@/assets/register/guid/chat-material-six.png',
}, },
buttonData: { buttonData: {
one: '返回上一步', one: '返回上一步',
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
boxData: [ boxData: [
{ {
title: '在当前页面内点击“继续配置”按钮', title: '在当前页面内点击“继续配置”按钮',
url: ('@/assets/register/guid/keyword-group-seven.png'), url: '@/assets/register/guid/keyword-group-seven.png',
}, },
], ],
boxDataTwo: { boxDataTwo: {
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
title2: '关键词群', title2: '关键词群',
title3: '输入页面内容:选择“自定义”,内容链接为:', title3: '输入页面内容:选择“自定义”,内容链接为:',
title4: 'https://×××××××', title4: 'https://×××××××',
url: ('@/assets/register/guid/keyword-group-eight.png'), url: '@/assets/register/guid/keyword-group-eight.png',
}, },
buttonData: { buttonData: {
one: '返回上一步', one: '返回上一步',
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
boxData: [ boxData: [
{ {
title: '在当前页面内点击“继续配置”按钮', title: '在当前页面内点击“继续配置”按钮',
url: ('@/assets/register/guid/red-envelopes-nine.png'), url: '@/assets/register/guid/red-envelopes-nine.png',
}, },
], ],
boxDataTwo: { boxDataTwo: {
...@@ -147,7 +147,7 @@ export default { ...@@ -147,7 +147,7 @@ export default {
title2: '红包', title2: '红包',
title3: '输入页面内容:选择“自定义”,内容链接为:', title3: '输入页面内容:选择“自定义”,内容链接为:',
title4: 'https://×××××××', title4: 'https://×××××××',
url: ('@/assets/register/guid/red-envelopes-ten.png'), url: '@/assets/register/guid/red-envelopes-ten.png',
}, },
buttonData: { buttonData: {
one: '返回上一步', one: '返回上一步',
...@@ -216,7 +216,7 @@ svg.svg-icon { ...@@ -216,7 +216,7 @@ svg.svg-icon {
width: 80%; width: 80%;
height: 146px; height: 146px;
border-radius: 4px; border-radius: 4px;
background-color: #fff; background: var(--bg-white);
padding-top: 20px; padding-top: 20px;
margin-top: 20px; margin-top: 20px;
margin-bottom: 10px; margin-bottom: 10px;
...@@ -228,14 +228,14 @@ svg.svg-icon { ...@@ -228,14 +228,14 @@ svg.svg-icon {
.content-box { .content-box {
width: 80%; width: 80%;
padding: 20px; padding: 20px;
background: #fff; background: var(--bg-white);
padding-bottom: 60px; padding-bottom: 60px;
} }
.content { .content {
// width: 80%; // width: 80%;
} }
.tab { .tab {
background: #fff; background: var(--bg-white);
border-top: 1px solid #f1f1f1; border-top: 1px solid #f1f1f1;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
......
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
callback: (action) => { callback: (action) => {
sessionStorage.setItem('currentActive', '4') sessionStorage.setItem('currentActive', '4')
this.$router.push({ this.$router.push({
name: window.lwConfig.WORKWEIXINPAGENAME, name: window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME,
}) })
}, },
}, },
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
callback: (action) => { callback: (action) => {
sessionStorage.setItem('currentActive', '3') sessionStorage.setItem('currentActive', '3')
this.$router.push({ this.$router.push({
name: window.lwConfig.WORKWEIXINPAGENAME, name: window.lwConfig.WORK_WEIXIN_CONFIG_ROUTE_NAME,
}) })
}, },
}, },
......
...@@ -476,7 +476,7 @@ export default { ...@@ -476,7 +476,7 @@ export default {
.view-item-num { .view-item-num {
font-size: 24px; font-size: 24px;
font-weight: 500; font-weight: 500;
color: #1d2129; color: var(--font-black);
font-family: Bahnschrift-Regular, Bahnschrift; font-family: Bahnschrift-Regular, Bahnschrift;
} }
} }
......
...@@ -327,7 +327,7 @@ export default { ...@@ -327,7 +327,7 @@ export default {
margin: 0 20px 20px 0; margin: 0 20px 20px 0;
padding: 20px 20px 10px; padding: 20px 20px 10px;
border: 1px solid #eee; border: 1px solid #eee;
background: #fff; background: var(--bg-white);
border-radius: 6px; border-radius: 6px;
.el-image { .el-image {
margin-right: 10px; margin-right: 10px;
......
<script> <script>
var validateHttp = (rule, value, callback) => { var validateHttp = (rule, value, callback) => {
if (/^https?:\/\//gi.test(value)) { if (/^https?:\/\//gi.test(value)) {
callback() callback()
} else { } else {
callback(new Error('必须以 http://或 https://开头')) callback(new Error('必须以 http://或 https://开头'))
}
} }
export default { }
name: '', export default {
components: {}, name: '',
props: { components: {},
data: { props: {
type: Object, data: {
default: () => ({}) type: Object,
}, default: () => ({}),
disabled: {
type: Boolean
}
}, },
disabled: {
type: Boolean,
},
},
data() { data() {
return { return {
// 表单校验 // 表单校验
form: Object.assign({ scopeType: 1, sendType: 1, weMessageTemplate: { msgType: 'text' } }, this.data), form: Object.assign({ scopeType: 1, sendType: 1, weMessageTemplate: { msgType: 'text' } }, this.data),
rules: Object.freeze({ rules: Object.freeze({
content: [{ required: true, message: '不能为空', trigger: 'blur' }], content: [{ required: true, message: '不能为空', trigger: 'blur' }],
fileUrl: [{ required: true, message: '不能为空', trigger: 'change' }], fileUrl: [{ required: true, message: '不能为空', trigger: 'change' }],
title: [{ required: true, message: '不能为空', trigger: 'blur' }], title: [{ required: true, message: '不能为空', trigger: 'blur' }],
msgTitle: [{ required: true, message: '不能为空', trigger: 'blur' }], msgTitle: [{ required: true, message: '不能为空', trigger: 'blur' }],
description: [{ required: true, message: '不能为空', trigger: 'blur' }], description: [{ required: true, message: '不能为空', trigger: 'blur' }],
picUrl: [{ required: true, message: '不能为空', trigger: 'blur' }], picUrl: [{ required: true, message: '不能为空', trigger: 'blur' }],
sendTime: [{ required: true, message: '不能为空', trigger: 'blur' }], sendTime: [{ required: true, message: '不能为空', trigger: 'blur' }],
linkUrl: [ linkUrl: [
{ required: true, message: '不能为空', trigger: 'blur' }, { required: true, message: '不能为空', trigger: 'blur' },
{ validator: validateHttp, trigger: 'blur' } { validator: validateHttp, trigger: 'blur' },
] ],
}), }),
typeDict: { typeDict: {
text: '文本', text: '文本',
image: '图片', image: '图片',
news: '图文', news: '图文',
video: '视频', video: '视频',
file: '文件' file: '文件',
}, },
dialogVisible: false dialogVisible: false,
}
},
computed: {},
watch: {
'form.weMessageTemplate.msgType'(val, oldVal) {
if (!this.disabled) {
this.form.weMessageTemplate = { msgType: val }
if (this.$route.query.posterId && val == 'image') {
this.form.weMessageTemplate.picUrl = this.$route.query.posterId
}
} }
}, },
computed: {}, },
watch: { created() {
'form.weMessageTemplate.msgType'(val, oldVal) { if (!this.form.toParty) {
if (!this.disabled) { this.form.toParty = []
this.form.weMessageTemplate = { msgType: val } this.form.toPartyName = []
if (this.$route.query.posterId && val == 'image') { }
this.form.weMessageTemplate.picUrl = this.$route.query.posterId if (!this.form.toUser) {
this.form.toUser = []
this.form.toUserName = []
}
if (this.form.robotId) {
// 机器人消息没有视频类型
delete this.typeDict.video
}
if (this.$route.query.posterId) {
this.form.weMessageTemplate.msgType = 'image'
this.form.weMessageTemplate.picUrl = this.$route.query.posterId
}
},
mounted() {},
methods: {
selectedUser(value) {
this.form.toParty = []
this.form.toPartyName = []
this.form.toUser = []
this.form.toUserName = []
value.map((item) => {
if (item.isParty) {
// 部门
this.form.toParty.push(item.userId)
this.form.toPartyName.push(item.name)
} else {
let isInSelectDepart = item.userDepts.some((e) => value.some((e2) => e2.userId === e.deptId))
// 人员
if (!isInSelectDepart) {
this.form.toUser.push(item.userId)
this.form.toUserName.push(item.name)
} }
} }
} })
},
created() {
if (!this.form.toParty) {
this.form.toParty = []
this.form.toPartyName = []
}
if (!this.form.toUser) {
this.form.toUser = []
this.form.toUserName = []
}
if (this.form.robotId) {
// 机器人消息没有视频类型
delete this.typeDict.video
}
if (this.$route.query.posterId) {
this.form.weMessageTemplate.msgType = 'image'
this.form.weMessageTemplate.picUrl = this.$route.query.posterId
}
}, },
mounted() {}, async submit(status) {
methods: { let form = JSON.parse(JSON.stringify(this.form))
selectedUser(value) { let valid = await this.$refs['form'].validate()
this.form.toParty = [] valid = await this.$refs['formCon'].validate()
this.form.toPartyName = [] if (valid) {
this.form.toUser = [] if (form.scopeType == 2 && !form.toParty.concat(form.toUser).length) {
this.form.toUserName = [] this.msgError('发送范围不能为空')
value.map((item) => { } else if (form.sendType == 2 && new Date(form.sendTime).getTime() <= Date.now()) {
if (item.isParty) { this.msgError('定时发送时间不能小于当前时间')
// 部门 } else {
this.form.toParty.push(item.userId) form.status = status
this.form.toPartyName.push(item.name) this.$emit('submit', form)
} else {
let isInSelectDepart = item.userDepts.some((e) => value.some((e2) => e2.userId === e.deptId))
// 人员
if (!isInSelectDepart) {
this.form.toUser.push(item.userId)
this.form.toUserName.push(item.name)
}
}
})
},
async submit(status) {
let form = JSON.parse(JSON.stringify(this.form))
let valid = await this.$refs['form'].validate()
valid = await this.$refs['formCon'].validate()
if (valid) {
if (form.scopeType == 2 && !form.toParty.concat(form.toUser).length) {
this.msgError('发送范围不能为空')
} else if (form.sendType == 2 && new Date(form.sendTime).getTime() <= Date.now()) {
this.msgError('定时发送时间不能小于当前时间')
} else {
form.status = status
this.$emit('submit', form)
}
} }
} }
} },
} },
}
</script> </script>
<template> <template>
<div style="margin: 0 20px;" :class="disabled && 'detail-form'"> <div style="margin: 0 20px" :class="disabled && 'detail-form'">
<!-- 应用消息 --> <!-- 应用消息 -->
<el-form <el-form
class="mb20" class="mb20"
...@@ -127,12 +127,11 @@ ...@@ -127,12 +127,11 @@
:model="form" :model="form"
:rules="rules" :rules="rules"
:disabled="disabled" :disabled="disabled"
label-width="100px" label-width="100px">
>
<div class=""> <div class="">
<div class="title"> <div class="title">
<span>消息设置</span> <span>消息设置</span>
<span style="font-size: 12px; margin-left: 10px;"> <span style="font-size: 12px; margin-left: 10px">
将通过应用 将通过应用
<span class="theme">【{{ form.agentName }}】</span> <span class="theme">【{{ form.agentName }}】</span>
发送消息 发送消息
...@@ -151,8 +150,7 @@ ...@@ -151,8 +150,7 @@
<el-button v-if="!disabled" class="mr10" text @click="dialogVisible = true">选择范围</el-button> <el-button v-if="!disabled" class="mr10" text @click="dialogVisible = true">选择范围</el-button>
<TagEllipsis <TagEllipsis
v-if="form.toPartyName.concat(form.toUserName).length" v-if="form.toPartyName.concat(form.toUserName).length"
:list="form.toPartyName.concat(form.toUserName)" :list="form.toPartyName.concat(form.toUserName)" />
/>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="发送类型" prop="sendType"> <el-form-item label="发送类型" prop="sendType">
...@@ -171,9 +169,8 @@ ...@@ -171,9 +169,8 @@
disabledDate(time) { disabledDate(time) {
let date = new Date() let date = new Date()
return time.getTime() < date.setDate(date.getDate() - 1) return time.getTime() < date.setDate(date.getDate() - 1)
} },
}" }"></el-date-picker>
></el-date-picker>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -187,8 +184,7 @@ ...@@ -187,8 +184,7 @@
:model="form" :model="form"
:rules="rules" :rules="rules"
:disabled="disabled" :disabled="disabled"
label-width="100px" label-width="100px">
>
<el-form-item label="消息标题" prop="msgTitle"> <el-form-item label="消息标题" prop="msgTitle">
<el-input v-model="form.msgTitle" placeholder="请输入标题" maxlength="30" show-word-limit></el-input> <el-input v-model="form.msgTitle" placeholder="请输入标题" maxlength="30" show-word-limit></el-input>
</el-form-item> </el-form-item>
...@@ -210,8 +206,7 @@ ...@@ -210,8 +206,7 @@
:autosize="{ minRows: 2, maxRows: 50 }" :autosize="{ minRows: 2, maxRows: 50 }"
placeholder="请输入内容" placeholder="请输入内容"
maxlength="2000" maxlength="2000"
show-word-limit show-word-limit></el-input>
></el-input>
</el-form-item> </el-form-item>
<!-- 图片 --> <!-- 图片 -->
...@@ -227,8 +222,7 @@ ...@@ -227,8 +222,7 @@
<el-input <el-input
v-model="form.weMessageTemplate.linkUrl" v-model="form.weMessageTemplate.linkUrl"
type="text" type="text"
placeholder="请输入图文地址,以http://或https://开头" placeholder="请输入图文地址,以http://或https://开头"></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="图文标题" prop="title"> <el-form-item label="图文标题" prop="title">
<el-input <el-input
...@@ -236,8 +230,7 @@ ...@@ -236,8 +230,7 @@
type="text" type="text"
:maxlength="60" :maxlength="60"
show-word-limit show-word-limit
placeholder="请输入图文标题" placeholder="请输入图文标题"></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="图文描述" prop="description"> <el-form-item label="图文描述" prop="description">
<el-input <el-input
...@@ -246,8 +239,7 @@ ...@@ -246,8 +239,7 @@
:maxlength="100" :maxlength="100"
show-word-limit show-word-limit
:autosize="{ minRows: 2, maxRows: 50 }" :autosize="{ minRows: 2, maxRows: 50 }"
placeholder="请输入" placeholder="请输入"></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="图文封面"> <el-form-item label="图文封面">
<Upload v-model:fileUrl="form.weMessageTemplate.picUrl" type="0"> <Upload v-model:fileUrl="form.weMessageTemplate.picUrl" type="0">
...@@ -285,54 +277,53 @@ ...@@ -285,54 +277,53 @@
:isSigleSelect="false" :isSigleSelect="false"
:destroy-on-close="false" :destroy-on-close="false"
:defaultValues="form.toParty.concat(form.toUser)" :defaultValues="form.toParty.concat(form.toUser)"
@success="selectedUser" @success="selectedUser"></SelectUser>
></SelectUser>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.theme { .theme {
color: var(--color); color: var(--color);
}
::v-deep.detail-form {
.el-input.is-disabled .el-input__inner,
.el-textarea.is-disabled .el-textarea__inner {
background-color: transparent;
// border-color: transparent;
color: inherit;
cursor: default;
// &:hover {
// border-color: transparent;
// }
} }
::v-deep.detail-form { .el-radio__input.is-disabled {
.el-input.is-disabled .el-input__inner, .el-radio__inner {
.el-textarea.is-disabled .el-textarea__inner { background: var(--bg-white);
background-color: transparent; border-color: #dcdfe6;
// border-color: transparent; cursor: default;
}
+ span.el-radio__label {
color: inherit; color: inherit;
cursor: default; cursor: default;
// &:hover {
// border-color: transparent;
// }
} }
.el-radio__input.is-disabled { &.is-checked .el-radio__inner {
.el-radio__inner { background-color: var(--color);
background-color: #fff; border-color: var(--color);
border-color: #dcdfe6; cursor: default;
cursor: default;
}
+ span.el-radio__label {
color: inherit;
cursor: default;
}
&.is-checked .el-radio__inner {
background-color: var(--color);
border-color: var(--color);
cursor: default;
&::after { &::after {
background-color: #fff; background: var(--bg-white);
}
} }
} }
// .el-input-number__decrease,
// .el-input-number__increase,
// .el-input-group__prepend,
// .el-input-group__append,
// .el-icon-arrow-up,
// .el-input__prefix {
// display: none;
// }
} }
// .el-input-number__decrease,
// .el-input-number__increase,
// .el-input-group__prepend,
// .el-input-group__append,
// .el-icon-arrow-up,
// .el-input__prefix {
// display: none;
// }
}
</style> </style>
...@@ -207,7 +207,7 @@ export default { ...@@ -207,7 +207,7 @@ export default {
padding: 20px 20px 0; padding: 20px 20px 0;
border: 1px solid #eee; border: 1px solid #eee;
margin: 0 20px 20px 0; margin: 0 20px 20px 0;
background: #fff; background: var(--bg-white);
border-radius: 6px; border-radius: 6px;
.title { .title {
font-size: 16px; font-size: 16px;
......
...@@ -205,7 +205,7 @@ export default { ...@@ -205,7 +205,7 @@ export default {
.login-text { .login-text {
font-size: 32px; font-size: 32px;
font-weight: 700; font-weight: 700;
color: #1d2129; color: var(--font-black);
margin: 26px auto 50px auto; margin: 26px auto 50px auto;
} }
......
...@@ -487,7 +487,7 @@ export default { ...@@ -487,7 +487,7 @@ export default {
} }
.boxCard { .boxCard {
min-width: 300px; min-width: 300px;
background: #fff; background: var(--bg-white);
border-radius: 4px; border-radius: 4px;
margin: 0 10px 20px 0; margin: 0 10px 20px 0;
padding: 22px 20px; padding: 22px 20px;
......
...@@ -178,13 +178,41 @@ export default defineConfig(async ({ command, mode }) => { ...@@ -178,13 +178,41 @@ export default defineConfig(async ({ command, mode }) => {
env._ISCDN && env._ISCDN &&
vitePluginCdnImport({ vitePluginCdnImport({
// prodUrl: 'https://unpkg.com/{name}@{version}/{path}', // prodUrl: 'https://unpkg.com/{name}@{version}/{path}',
prodUrl: 'https://cdn.bootcdn.net/ajax/libs/{name}/{version}/{path}',
modules: [ modules: [
// autoComplete('vue'), // autoComplete('vue'),
// autoComplete('axios'), // autoComplete('axios'),
{ {
name: 'axios', // 包名 name: 'axios', // 包名
var: 'axios', // 对应cdn包导出的变量,如jQuery导出的是$ var: 'axios', // 对应cdn包导出的变量,如jQuery导出的是$
path: '//cdn.bootcdn.net/ajax/libs/axios/1.4.0/axios.min.js', version: '1.4.0',
path: 'axios.min.js',
},
{
name: 'clipboard',
var: 'ClipboardJS',
version: '2.0.11',
path: 'https://cdn.bootcdn.net/ajax/libs/clipboard.js/2.0.11/clipboard.min.js',
},
{
name: 'jsencrypt',
var: 'JSEncrypt',
version: '3.3.2',
path: 'jsencrypt.min.js',
},
{
name: 'crypto-js',
var: 'CryptoJS',
version: '4.1.1',
path: 'crypto-js.min.js',
},
{
name: 'nprogress',
var: 'NProgress',
version: '0.2.0',
path: 'nprogress.min.js',
css: 'nprogress.min.css',
}, },
// { // {
// name: 'element-plus', // name: 'element-plus',
...@@ -199,11 +227,11 @@ export default defineConfig(async ({ command, mode }) => { ...@@ -199,11 +227,11 @@ export default defineConfig(async ({ command, mode }) => {
// version: '2.1.0', // version: '2.1.0',
// path: 'dist/index.iife.min.js', // path: 'dist/index.iife.min.js',
// }, // },
// { {
// name: 'ali-oss', name: 'ali-oss',
// var: 'OSS', var: 'OSS',
// path: 'http://gosspublic.alicdn.com/aliyun-oss-sdk-6.17.1.min.js', path: 'https://gosspublic.alicdn.com/aliyun-oss-sdk-6.17.1.min.js',
// }, },
], ],
}), }),
rollupPluginVisualizer({ rollupPluginVisualizer({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!