Commit 5a248ec9 by ext.wangyuman1

朋友圈模块

2 parents 1f110bd8 f5005800
Showing 75 changed files with 1868 additions and 1797 deletions
**本仓库为 LinkWeChat 的前端源码库,具体说明及后端库请移步至 [LinkWeChat](https://gitee.com/LinkWeChat/link-wechat) 查看。** **本仓库为 LinkWeChat 的前端源码库,具体项目说明及后端库请移步至 [LinkWeChat](https://gitee.com/LinkWeChat/link-wechat) 查看。**
## 更新日志
### v5.0.0
2023.06.16
1. pc 管理端由 vue cli + vue2 生态 升级为 vite+vue3 生态版本,同时 vue3-master 替换 master 成为默认分支
2. v4.8 是当前、同时也是最后一个 v4.x 的次级版本更新。 pc 管理端 vue2 版本由此 2023.06.16 日进入维护状态,并持续到 vue2 官方生命周期终止,即 2023 年 12 月 31 日。在此期间,将会提供必要的 bug 修复和安全修复,但不再提供新功能特性。在此之后,v4 在已有的分发渠道中仍然可用,但不再进行更新,包括对安全问题和浏览器兼容性问题的修复等。
3. 考虑移动端 vue3 生态的兼容性,小程序端和移动 web 端暂不升级 vue3,且暂无升级计划
4. 优化系统性能,部分 UI 和交互体验
...@@ -14,7 +14,7 @@ const envs = { ...@@ -14,7 +14,7 @@ const envs = {
}, },
test: { test: {
DOMAIN: 'https://demo.linkwechat.net', DOMAIN: 'https://demo.linkwechat.net',
BASE_URL: '/vue3/', // 路由基础路径 BASE_URL: '/', // 路由基础路径
BASE_API: 'https://demo.linkwechat.net/linkwechat-api', BASE_API: 'https://demo.linkwechat.net/linkwechat-api',
SYSTEM_API: '/linkwechat-api', SYSTEM_API: '/linkwechat-api',
VIEW_URL: 'https://saas.pardigital.cn/file-view/onlinePreview?url=', VIEW_URL: 'https://saas.pardigital.cn/file-view/onlinePreview?url=',
...@@ -23,7 +23,7 @@ const envs = { ...@@ -23,7 +23,7 @@ const envs = {
}, },
production: { production: {
DOMAIN: 'https://demo.linkwechat.net', DOMAIN: 'https://demo.linkwechat.net',
BASE_URL: '/vue3/', // 路由基础路径 BASE_URL: '/', // 路由基础路径
BASE_API: 'https://demo.linkwechat.net/linkwechat-api', BASE_API: 'https://demo.linkwechat.net/linkwechat-api',
VIEW_URL: 'https://saas.pardigital.cn/file-view/onlinePreview?url=', VIEW_URL: 'https://saas.pardigital.cn/file-view/onlinePreview?url=',
SYSTEM_API: '/linkwechat-api', SYSTEM_API: '/linkwechat-api',
......
...@@ -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) hue-rotate(180deg); filter: invert(1) brightness(1.5) hue-rotate(180deg);
} }
不使用暗黑模式 /* 不使用暗黑模式 */
.no-dark { .no-dark {
position: relative; position: relative;
} }
...@@ -376,6 +376,6 @@ li { ...@@ -376,6 +376,6 @@ li {
display: block; display: block;
height: 100%; height: 100%;
width: 100%; width: 100%;
backdrop-filter: invert(1) hue-rotate(180deg); backdrop-filter: invert(1) brightness(1.5) hue-rotate(180deg);
} }
} */ }
...@@ -10,12 +10,15 @@ html { ...@@ -10,12 +10,15 @@ html {
--color-success: #07c160; --color-success: #07c160;
--color-warning: #faad14; --color-warning: #faad14;
--color-danger: #eb5e12; --color-danger: #eb5e12;
--border-radius: 8px; /* 常规圆角 */ --border-radius: 8px; /* 常规圆角 */
--border-radius-small: 4px; /* 小圆角 */ --border-radius-small: 4px; /* 小圆角 */
--border-radius-big: 16px; /* 大圆角 */ --border-radius-big: 16px; /* 大圆角 */
--card-margin: 16px; /* 卡片间距 */ --card-margin: 16px; /* 卡片间距 */
--top-nav-heght: 64px; /* 顶部导航条高度 */ --top-nav-heght: 64px; /* 顶部导航条高度 */
--font-black: #1d2129; /* 通用字体黑色 */ --font-black: #1d2129; /* 通用字体黑色 */
--font-white: #fff; /* 通用字体白色 */
} }
/* 项目定制原子类 */ /* 项目定制原子类 */
......
import request from '@/utils/request' import request from '@/utils/request'
const service = window.lwConfig.services.system + window.lwConfig.services.wecom + '/strategic/journey' const service =
window.lwConfig.services.system + window.lwConfig.services.wecom + '/strategic/journey'
// import { get, post } from '@/plugins/axios' // import { get, post } from '@/plugins/axios'
...@@ -19,8 +20,8 @@ export function getCrowdPackDetail(id) { ...@@ -19,8 +20,8 @@ export function getCrowdPackDetail(id) {
// 计划列表查询接口 // 计划列表查询接口
// name 任务名称 String 支持模糊查询 // name 任务名称 String 支持模糊查询
// startDate 开始日期 String YYYY-MM-DD // startDate 开始日期 String yyyy-MM-dd
// endDate 结束日期 String YYYY-MM-DD // endDate 结束日期 String yyyy-MM-dd
// status 状态 number 0:待完善,1:未开始,2:待运行,3:运行中,4:已暂停,5:已停止,6:正常结束,7:异常结束 // status 状态 number 0:待完善,1:未开始,2:待运行,3:运行中,4:已暂停,5:已停止,6:正常结束,7:异常结束
// pageNum 页码 number // pageNum 页码 number
// pageSize 页大小 number // pageSize 页大小 number
......
...@@ -84,3 +84,10 @@ export function crowdAnalyse(data) { ...@@ -84,3 +84,10 @@ export function crowdAnalyse(data) {
params: data, params: data,
}) })
} }
export function deleteCategory(ids) {
return request({
url: base + '/strategic/crowd/categoryDel/' + ids,
method: 'delete',
})
}
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
default: () => ({}), default: () => ({}),
}, },
}, },
components: { Voice }, components: { Voice, BaiduMap: defineAsyncComponent(() => import('@/components/common/BaiduMap')) },
data() { data() {
return {} return {}
}, },
...@@ -108,17 +108,13 @@ export default { ...@@ -108,17 +108,13 @@ export default {
</video> </video>
</template> </template>
<div v-else-if="message.msgType === 'location'" class="msgtypecard"> <div v-else-if="message.msgType === 'location'" class="msgtypecard">
<div class="card-content" style="height: 100%; width: 100%"> <div class="card-content">
<el-amap <BaiduMap
ref="map" isDetail
vid="amapDemo" isOnlyShowMap
:center="[JSON.parse(message.contact).longitude, JSON.parse(message.contact).latitude]" mapWidth="300px"
:zoom="14" mapHeight="120px"
class="amap-demo" :initData="JSON.parse(message.contact)"></BaiduMap>
style="height: 120px; width: 250px; pointer-events: none">
<el-amap-marker
:position="[JSON.parse(message.contact).longitude, JSON.parse(message.contact).latitude]"></el-amap-marker>
</el-amap>
</div> </div>
<div class="card-foot">{{ content }}</div> <div class="card-foot">{{ content }}</div>
</div> </div>
...@@ -193,7 +189,7 @@ export default { ...@@ -193,7 +189,7 @@ export default {
} }
.message-right { .message-right {
@extend .mes; @extend .mes;
color: #fff; color: var(--font-white, #fff);
margin-right: 10px; margin-right: 10px;
background-color: var(--color); background-color: var(--color);
border-top-right-radius: 0; border-top-right-radius: 0;
...@@ -234,6 +230,7 @@ export default { ...@@ -234,6 +230,7 @@ export default {
line-height: 1.5; line-height: 1.5;
// text-indent: 10px; // text-indent: 10px;
color: #333; color: #333;
z-index: -1;
.card--link-title { .card--link-title {
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
<el-cascader <el-cascader
v-model="talkForm.categoryId" v-model="talkForm.categoryId"
:options="treeData[0].children" :options="treeData[0].children"
:props="groupProps" :props="groupProps"></el-cascader>
></el-cascader>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="话术标题" label="话术标题"
...@@ -112,8 +111,7 @@ ...@@ -112,8 +111,7 @@
'后重新尝试' '后重新尝试'
" "
placement="top-start" placement="top-start"
:disabled="talkList.length < maxlength" :disabled="talkList.length < maxlength">
>
<template #reference> <template #reference>
<el-dropdown <el-dropdown
@command="moveGroup" @command="moveGroup"
...@@ -168,14 +166,12 @@ ...@@ -168,14 +166,12 @@
'后重新尝试' '后重新尝试'
" "
placement="top-start" placement="top-start"
:disabled="talkList.length < maxlength" :disabled="talkList.length < maxlength">
>
<template #reference> <template #reference>
<div class="ml20"> <div class="ml20">
<el-button <el-button
@click="choseCenter" @click="choseCenter"
:disabled="talkList.length > maxlength || talkList.length === maxlength" :disabled="talkList.length > maxlength || talkList.length === maxlength">
>
从素材中心选择 从素材中心选择
</el-button> </el-button>
</div> </div>
...@@ -232,8 +228,7 @@ ...@@ -232,8 +228,7 @@
@dialogClose="dialogClose" @dialogClose="dialogClose"
:materialTalkList="talkList" :materialTalkList="talkList"
:moduleType="moduleType" :moduleType="moduleType"
:maxlength="maxlength" :maxlength="maxlength" />
/>
<!-- 模板库 --> <!-- 模板库 -->
<el-dialog <el-dialog
:title="otherType === 2 ? '选择群发模板' : '选择欢迎语模板'" :title="otherType === 2 ? '选择群发模板' : '选择欢迎语模板'"
...@@ -241,8 +236,7 @@ ...@@ -241,8 +236,7 @@
width="60%" width="60%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
v-if="welcomVisible" v-if="welcomVisible">
>
<TemplateLibrary @changeObj="changeObj" :isGroup="otherType === 2" /> <TemplateLibrary @changeObj="changeObj" :isGroup="otherType === 2" />
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
...@@ -267,8 +261,7 @@ ...@@ -267,8 +261,7 @@
:defaultValues="selectedUserList" :defaultValues="selectedUserList"
v-model:visible="dialogVisibleSelectUser" v-model:visible="dialogVisibleSelectUser"
title="选择使用员工" title="选择使用员工"
@success="selectedUser" @success="selectedUser"></SelectUser>
></SelectUser>
</div> </div>
</template> </template>
...@@ -915,12 +908,12 @@ export default { ...@@ -915,12 +908,12 @@ export default {
} }
} }
::v-deep .el-button.is-disabled { ::v-deep .el-button.is-disabled {
color: #fff; color: var(--font-white, #fff);
background-color: #cccccc; background-color: #cccccc;
border-color: #cccccc; border-color: #cccccc;
} }
::v-deep.el-dropdown [disabled] { ::v-deep.el-dropdown [disabled] {
color: #fff; color: var(--font-white, #fff);
background-color: #cccccc; background-color: #cccccc;
border-color: #cccccc; border-color: #cccccc;
} }
......
...@@ -242,7 +242,7 @@ export default { ...@@ -242,7 +242,7 @@ export default {
border-radius: 4px; border-radius: 4px;
.red-text { .red-text {
font-size: 14px; font-size: 14px;
color: #fff; color: var(--font-white, #fff);
margin-left: 56px; margin-left: 56px;
width: 98px; width: 98px;
white-space: nowrap; // 强制一行 white-space: nowrap; // 强制一行
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div <div
class="pagination-container" class="pagination-container"
ref="pagination" ref="pagination"
v-if="$attrs['hide-on-single-page'] === false || $attrs.total > limit"> v-if="['false', 'undefined'].includes($attrs['hide-on-single-page'] + '') || $attrs.total > limit">
<el-pagination <el-pagination
v-bind="$attrs" v-bind="$attrs"
:background="background" :background="background"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<script> <script>
export default { export default {
name: '', name: '',
inheritAttrs: false,
props: { props: {
modelValue: '', modelValue: '',
// ['emoji','insertCustomerNickName'] // ['emoji','insertCustomerNickName']
...@@ -42,18 +43,20 @@ export default { ...@@ -42,18 +43,20 @@ export default {
</script> </script>
<template> <template>
<el-input ref="textarea" v-model="proxyValue" type="textarea" v-bind="$attrs"></el-input> <div>
<div class="mt10"> <el-input ref="textarea" v-model="proxyValue" type="textarea" v-bind="$attrs"></el-input>
<SelectEmoji v-if="toolbar.includes('emoji')" @select="insertContent"> <div class="mt10">
<template v-slot:default="{ emojisArr }"> <SelectEmoji v-if="toolbar.includes('emoji')" @select="insertContent">
<el-button> <template v-slot:default="{ emojisArr }">
{{ emojisArr[0].emoji }} <el-button>
</el-button> {{ emojisArr[0].emoji }}
</template> </el-button>
</SelectEmoji> </template>
<el-button v-if="toolbar.includes('insertCustomerNickName')" @click="insertContent('#客户昵称#')" class="ml10"> </SelectEmoji>
插入客户昵称 <el-button v-if="toolbar.includes('insertCustomerNickName')" @click="insertContent('#客户昵称#')" class="ml10">
</el-button> 插入客户昵称
</el-button>
</div>
</div> </div>
</template> </template>
......
...@@ -716,7 +716,7 @@ export default { ...@@ -716,7 +716,7 @@ export default {
width: 300px; width: 300px;
height: 150px; height: 150px;
box-sizing: border-box; box-sizing: border-box;
color: #fff; color: var(--font-white, #fff);
background-color: #000; background-color: #000;
position: relative; position: relative;
padding: 0; padding: 0;
...@@ -750,7 +750,7 @@ export default { ...@@ -750,7 +750,7 @@ export default {
top: 0; top: 0;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
transition: opacity 0.3s; transition: opacity 0.3s;
......
<template> <template>
<div> <div>
<el-form-item label="详细地址" prop="address"> <el-form-item label="详细地址" prop="address" v-if="!isOnlyShowMap">
<el-autocomplete <el-autocomplete
:disabled="isDetail" :disabled="isDetail"
@change="setChange" @change="setChange"
v-model="form.address" v-model="form.address"
style="width: 500px" style="width: 500px;"
popper-class="autoAddressClass" popper-class="autoAddressClass"
:fetch-suggestions="querySearchAsync" :fetch-suggestions="querySearchAsync"
:trigger-on-focus="false" :trigger-on-focus="false"
placeholder="详细地址" placeholder="详细地址"
clearable clearable
@select="handleSelect"> @select="handleSelect"
>
<template #default="{ item }"> <template #default="{ item }">
<el-icon-search class="el-icon-search fl mgr10" /> <el-icon-search class="el-icon-search fl mgr10" />
<div style="overflow: hidden"> <div style="overflow: hidden;">
<div class="title">{{ item.title }}</div> <div class="title">{{ item.title }}</div>
<span class="address ellipsis">{{ item.address }}</span> <span class="address ellipsis">{{ item.address }}</span>
</div> </div>
</template> </template>
</el-autocomplete> </el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="" :label-width="isOnlyShowMap ? 0 : ''" :style="isOnlyShowMap && 'margin-bottom: 0'">
<div id="map-container" style="width: 500px; height: 300px" /> <div ref="bMap" :style="{ width: mapWidth, height: mapHeight }" />
</el-form-item> </el-form-item>
</div> </div>
</template> </template>
<script> <script>
/* eslint-disable */ /* eslint-disable */
import loadBMap from '@/utils/baiduMap.js' import loadBMap from '@/utils/baiduMap.js'
export default { export default {
data() { data() {
return { return {
form: { form: {
province: '', province: '',
city: '', city: '',
area: '', area: '',
address: '', // 详细地址 address: '', // 详细地址
addrPoint: { addrPoint: {
// 详细地址经纬度 // 详细地址经纬度
lng: 0, lng: 0,
lat: 0, lat: 0
}
}, },
}, map: '', // 地图实例
map: '', // 地图实例 mk: '', // Marker实例
mk: '', // Marker实例 locationPoint: null
locationPoint: null, }
}
},
props: {
initData: {
type: Object,
default: () => {},
},
isDetail: {
type: Boolean,
default: false,
}, },
}, props: {
watch: { initData: {
initData: { type: Object,
handler(value) { default: () => ({
if (this.initData.area && !this.initData.address) { // area: '', // 省市区
this.getPoint(this.initData.area) // address: '', // 详细地址
this.initMap() // longitude: '', // 经度
} // latitude: '', // 纬度
if (this.initData.address) { })
this.form.address = this.initData.address },
if (this.initData.longitude && this.initData.latitude) { mapWidth: {
this.form.addrPoint.lng = this.initData.longitude type: String,
this.form.addrPoint.lat = this.initData.latitude default: '500px'
} else { },
let detailAddress = this.initData.area + this.initData.address mapHeight: {
this.getPoint(detailAddress) type: String,
} default: '300px'
this.initMap()
}
}, },
deep: true, isDetail: {
type: Boolean,
default: false
},
// 是否只显示地图
isOnlyShowMap: {
type: Boolean,
default: false
},
watch: {
initData: {
handler(value) {
if (this.initData.area && !this.initData.address) {
this.form.address = ''
this.getPoint(this.initData.area)
this.initMap()
}
if (this.initData.address) {
this.form.address = this.initData.address
if (this.initData.longitude && this.initData.latitude) {
this.form.addrPoint.lng = this.initData.longitude
this.form.addrPoint.lat = this.initData.latitude
} else {
let detailAddress = this.initData.area + this.initData.address
this.getPoint(detailAddress)
}
this.initMap()
}
},
deep: true
}
}
}, },
}, async mounted() {
async mounted() { // 百度地图AK: GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P
// 百度地图AK: GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P await loadBMap() // 加载引入BMap
await loadBMap('GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P') // 加载引入BMap if (this.initData.address) {
if (this.initData.address) { this.form.address = this.initData.address
this.form.address = this.initData.address if (this.initData.longitude && this.initData.latitude) {
if (this.initData.longitude && this.initData.latitude) { this.form.addrPoint.lng = this.initData.longitude
this.form.addrPoint.lng = this.initData.longitude this.form.addrPoint.lat = this.initData.latitude
this.form.addrPoint.lat = this.initData.latitude } else {
} else { let detailAddress = this.initData.area + this.initData.address
let detailAddress = this.initData.area + this.initData.address this.getPoint(detailAddress)
this.getPoint(detailAddress) }
} }
} this.initMap()
this.initMap() },
}, methods: {
methods: { getCity(str) {
getCity(str) { if (str) {
if (str) { let area = {}
let area = {} let index11 = 0
let index11 = 0 let index1 = str.indexOf('省')
let index1 = str.indexOf('省') if (index1 == -1) {
if (index1 == -1) { index11 = str.indexOf('自治区')
index11 = str.indexOf('自治区') if (index11 != -1) {
if (index11 != -1) { area.Province = str.substring(0, index11 + 3)
area.Province = str.substring(0, index11 + 3) } else {
area.Province = str.substring(0, 0)
}
} else { } else {
area.Province = str.substring(0, 0) area.Province = str.substring(0, index1 + 1)
} }
} else {
area.Province = str.substring(0, index1 + 1)
}
let index2 = str.indexOf('市') let index2 = str.indexOf('市')
if (index11 == -1) { if (index11 == -1) {
area.City = str.substring(index11 + 1, index2 + 1) area.City = str.substring(index11 + 1, index2 + 1)
} else {
if (index11 == 0) {
area.City = str.substring(index1 + 1, index2 + 1)
} else { } else {
area.City = str.substring(index11 + 3, index2 + 1) if (index11 == 0) {
area.City = str.substring(index1 + 1, index2 + 1)
} else {
area.City = str.substring(index11 + 3, index2 + 1)
}
} }
}
let index3 = str.indexOf('区') let index3 = str.indexOf('区')
if (index3 == -1) {
index3 = str.indexOf('县')
if (index3 == -1) { if (index3 == -1) {
index3 = str.indexOf('旗') index3 = str.indexOf('县')
area.Country = str.substring(index2 + 1, index3 + 1) if (index3 == -1) {
index3 = str.indexOf('旗')
area.Country = str.substring(index2 + 1, index3 + 1)
} else {
area.Country = str.substring(index2 + 1, index3 + 1)
}
} else { } else {
area.Country = str.substring(index2 + 1, index3 + 1) area.Country = str.substring(index2 + 1, index3 + 1)
} }
return area.City
} else { } else {
area.Country = str.substring(index2 + 1, index3 + 1) return ''
} }
return area.City },
} else { getPoint(str) {
return ''
}
},
getPoint(str) {
var that = this
var myGeo = new BMap.Geocoder()
myGeo.getPoint(
str,
function (point) {
if (point) {
that.form.addrPoint = point
that.$emit('point', point)
} else {
// alert('您选择的地址没有解析到结果!')
}
},
that.getCity(str),
)
},
// 初始化地图
initMap() {
var that = this
// 1、挂载地图
this.map = new BMap.Map('map-container', { enableMapClick: false })
var point = new BMap.Point(
this.form.addrPoint.lng || 117.2334414073489,
this.form.addrPoint.lat || 31.826578293886,
)
this.map.centerAndZoom(point, 19)
// 3、设置图像标注并绑定拖拽标注结束后事件
this.mk = new BMap.Marker(point, { enableDragging: true })
this.map.addOverlay(this.mk)
this.mk.addEventListener('dragend', function (e) {
that.getAddrByPoint(e.point)
})
// 4、添加(右上角)平移缩放控件
this.map.addControl(
new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL }),
)
// 5、添加(左下角)定位控件
var geolocationControl = new BMap.GeolocationControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT })
geolocationControl.addEventListener('locationSuccess', function (e) {
that.getAddrByPoint(e.point)
})
geolocationControl.addEventListener('locationError', function (e) {
alert(e.message)
})
this.map.addControl(geolocationControl)
// 6、浏览器定位
// this.geolocation()
// 7、绑定点击地图任意点事件
this.map.addEventListener('click', function (e) {
that.getAddrByPoint(e.point)
})
},
// 获取两点间的距离
getDistancs(pointA, pointB) {
return this.map.getDistance(pointA, pointB).toFixed(2)
},
// 浏览器定位函数
geolocation() {
if (!this.isDetail) {
var that = this var that = this
var geolocation = new BMap.Geolocation() var myGeo = new BMap.Geocoder()
geolocation.getCurrentPosition( myGeo.getPoint(
function (res) { str,
if (this.getStatus() == BMAP_STATUS_SUCCESS) { function (point) {
that.getAddrByPoint(res.point) if (point) {
that.locationPoint = res.point that.form.addrPoint = point
that.$emit('point', point)
} else { } else {
alert('failed' + this.getStatus()) // alert('您选择的地址没有解析到结果!')
that.locationPoint = new BMap.Point(117.2334414073489, 31.826578293886)
} }
}, },
{ enableHighAccuracy: true }, that.getCity(str)
) )
} },
}, // 初始化地图
// 2、逆地址解析函数 initMap() {
getAddrByPoint(point) {
if (!this.isDetail) {
var that = this var that = this
var geco = new BMap.Geocoder() // 1、挂载地图
geco.getLocation(point, function (res) { this.map = new BMap.Map(this.$refs.bMap, { enableMapClick: false })
that.mk.setPosition(point) var point = new BMap.Point(
that.map.panTo(point) this.form.addrPoint.lng || 117.2334414073489,
that.form.address = that.splitName(res.address) this.form.addrPoint.lat || 31.826578293886
that.form.addrPoint = point )
that.onSubmit() this.map.centerAndZoom(point, 19)
// 3、设置图像标注并绑定拖拽标注结束后事件
this.mk = new BMap.Marker(point, { enableDragging: true })
this.map.addOverlay(this.mk)
this.mk.addEventListener('dragend', function (e) {
that.getAddrByPoint(e.point)
}) })
} // 4、添加(右上角)平移缩放控件
}, this.map.addControl(
// 8-1、地址搜索 new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL })
querySearchAsync(str, cb) { )
var options = { // 5、添加(左下角)定位控件
onSearchComplete: function (res) { var geolocationControl = new BMap.GeolocationControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT })
var s = [] geolocationControl.addEventListener('locationSuccess', function (e) {
if (local.getStatus() == BMAP_STATUS_SUCCESS) { that.getAddrByPoint(e.point)
for (var i = 0; i < res.getCurrentNumPois(); i++) { })
s.push(res.getPoi(i)) geolocationControl.addEventListener('locationError', function (e) {
alert(e.message)
})
this.map.addControl(geolocationControl)
// 6、浏览器定位
// this.geolocation()
// 7、绑定点击地图任意点事件
this.map.addEventListener('click', function (e) {
that.getAddrByPoint(e.point)
})
},
// 获取两点间的距离
getDistancs(pointA, pointB) {
return this.map.getDistance(pointA, pointB).toFixed(2)
},
// 浏览器定位函数
geolocation() {
if (!this.isDetail) {
var that = this
var geolocation = new BMap.Geolocation()
geolocation.getCurrentPosition(
function (res) {
if (this.getStatus() == BMAP_STATUS_SUCCESS) {
that.getAddrByPoint(res.point)
that.locationPoint = res.point
} else {
alert('failed' + this.getStatus())
that.locationPoint = new BMap.Point(117.2334414073489, 31.826578293886)
}
},
{ enableHighAccuracy: true }
)
}
},
// 2、逆地址解析函数
getAddrByPoint(point) {
if (!this.isDetail) {
var that = this
var geco = new BMap.Geocoder()
geco.getLocation(point, function (res) {
that.mk.setPosition(point)
that.map.panTo(point)
that.form.address = res.addressComponents.street + res.addressComponents.streetNumber
that.form.province = res.addressComponents.province
that.form.city = res.addressComponents.city
that.form.area = res.addressComponents.district
that.form.addrPoint = point
that.onSubmit()
})
}
},
// 8-1、地址搜索
querySearchAsync(str, cb) {
var options = {
onSearchComplete: function (res) {
var s = []
if (local.getStatus() == BMAP_STATUS_SUCCESS) {
for (var i = 0; i < res.getCurrentNumPois(); i++) {
s.push(res.getPoi(i))
}
cb(s)
} else {
cb(s)
} }
cb(s)
} else {
cb(s)
} }
}, }
} var local = new BMap.LocalSearch(this.map, options)
var local = new BMap.LocalSearch(this.map, options) local.search(str)
local.search(str) },
}, splitName(str) {
splitName(str) { if (str) {
if (str) { let area = {}
let area = {} let index11 = 0
let index11 = 0 let index1 = str.indexOf('省')
let index1 = str.indexOf('省') if (index1 == -1) {
if (index1 == -1) { index11 = str.indexOf('自治区')
index11 = str.indexOf('自治区') if (index11 != -1) {
if (index11 != -1) { area.Province = str.substring(0, index11 + 3)
area.Province = str.substring(0, index11 + 3) } else {
area.Province = str.substring(0, 0)
}
} else { } else {
area.Province = str.substring(0, 0) area.Province = str.substring(0, index1 + 1)
} }
} else {
area.Province = str.substring(0, index1 + 1)
}
let index2 = str.indexOf('市') let index2 = str.indexOf('市')
if (index11 == -1) { if (index11 == -1) {
area.City = str.substring(index11 + 1, index2 + 1) area.City = str.substring(index11 + 1, index2 + 1)
} else {
if (index11 == 0) {
area.City = str.substring(index1 + 1, index2 + 1)
} else { } else {
area.City = str.substring(index11 + 3, index2 + 1) if (index11 == 0) {
area.City = str.substring(index1 + 1, index2 + 1)
} else {
area.City = str.substring(index11 + 3, index2 + 1)
}
} }
}
let index3 = str.indexOf('区') let index3 = str.indexOf('区')
if (index3 == -1) {
index3 = str.indexOf('县')
if (index3 == -1) { if (index3 == -1) {
index3 = str.indexOf('旗') index3 = str.indexOf('县')
area.Country = str.substring(index2 + 1, index3 + 1) if (index3 == -1) {
index3 = str.indexOf('旗')
area.Country = str.substring(index2 + 1, index3 + 1)
} else {
area.Country = str.substring(index2 + 1, index3 + 1)
}
} else { } else {
area.Country = str.substring(index2 + 1, index3 + 1) area.Country = str.substring(index2 + 1, index3 + 1)
} }
let data = area.Province + area.City + area.Country
if (area.Province) {
this.form.province = area.Province
}
if (area.City) {
this.form.city = area.City
}
this.form.area = area.Country
return str.substring(data.length)
} else { } else {
area.Country = str.substring(index2 + 1, index3 + 1) return ''
}
let data = area.Province + area.City + area.Country
if (area.Province) {
this.form.province = area.Province
}
if (area.City) {
this.form.city = area.City
}
this.form.area = area.Country
return str.substring(data.length)
} else {
return ''
}
},
// 8-2、选择地址
handleSelect(item) {
this.form.province = item.province
this.form.city = item.city
this.form.address = this.splitName(item.address) + item.title
this.form.addrPoint = item.point
this.map.clearOverlays()
this.mk = new BMap.Marker(item.point)
this.map.addOverlay(this.mk)
this.map.panTo(item.point)
this.onSubmit()
},
setChange(data) {
if (!data) {
this.form = {
address: '',
addrPoint: {
lng: 0,
lat: 0,
},
} }
},
// 8-2、选择地址
handleSelect(item) {
this.form.province = item.province
this.form.city = item.city
this.form.address = this.splitName(item.address) + item.title
this.form.addrPoint = item.point
this.map.clearOverlays()
this.mk = new BMap.Marker(item.point)
this.map.addOverlay(this.mk)
this.map.panTo(item.point)
this.onSubmit() this.onSubmit()
},
setChange(data) {
if (!data) {
this.form = {
address: '',
addrPoint: {
lng: 0,
lat: 0
}
}
this.onSubmit()
}
},
onSubmit() {
this.$emit('update', this.form)
} }
}, }
onSubmit() { }
this.$emit('update', this.form)
},
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.autoAddressClass { .autoAddressClass {
li { li {
i.el-icon-search { i.el-icon-search {
margin-top: 11px; margin-top: 11px;
} }
.mgr10 { .mgr10 {
margin-right: 10px; margin-right: 10px;
} }
.title { .title {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.address { .address {
line-height: 1; line-height: 1;
font-size: 12px; font-size: 12px;
color: #b4b4b4; color: #b4b4b4;
margin-bottom: 5px; margin-bottom: 5px;
}
} }
} }
}
</style> </style>
...@@ -28,6 +28,7 @@ const common = { ...@@ -28,6 +28,7 @@ const common = {
DEFAULT_H5_WORDE: env.DOMAIN + '/static/WORD.png', DEFAULT_H5_WORDE: env.DOMAIN + '/static/WORD.png',
DEFAULT_H5_PPT: env.DOMAIN + '/static/PPT.png', DEFAULT_H5_PPT: env.DOMAIN + '/static/PPT.png',
PRIVIEW_URL: env.VIEW_URL, PRIVIEW_URL: env.VIEW_URL,
BAIDU_MAP_KEY: 'GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P', // 百度地图key
MICRO_APPS: { MICRO_APPS: {
store: { store: {
...@@ -42,7 +43,7 @@ const common = { ...@@ -42,7 +43,7 @@ const common = {
// 以下仅用于系统信息展示,不作为项目变量使用,请勿在代码中使用 // 以下仅用于系统信息展示,不作为项目变量使用,请勿在代码中使用
const project = { const project = {
_version: 'v5.0.0-rc.2', // 当前版本信息 // _version: 'v5.0.0', // 当前版本信息
_packDateTime: __PACK_DATETIME__, // 打包时间 _packDateTime: __PACK_DATETIME__, // 打包时间
_env: process.env.VUE_APP_ENV, // 前端系统环境模式 _env: process.env.VUE_APP_ENV, // 前端系统环境模式
} }
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* 操作权限处理 * 操作权限处理
*/ */
import store from '@/stores' import stores from '@/stores'
export default { export default {
inserted(el, binding, vnode) { mounted(el, binding, vnode) {
const { value } = binding const { value } = binding
const all_permission = '*:*:*' const all_permission = '*:*:*'
const permissions = store && store.permissions const permissions = stores() && stores().permissions
if (value && value instanceof Array && value.length > 0) { if (value && value instanceof Array && value.length > 0) {
const permissionFlag = value const permissionFlag = value
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* 角色权限处理 * 角色权限处理
*/ */
import store from '@/stores' import stores from '@/stores'
export default { export default {
inserted(el, binding, vnode) { mounted(el, binding, vnode) {
const { value } = binding const { value } = binding
const super_admin = 'admin' const super_admin = 'admin'
const roles = store && store.roles const roles = stores() && stores().roles
if (value && value instanceof Array && value.length > 0) { if (value && value instanceof Array && value.length > 0) {
const roleFlag = value const roleFlag = value
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* 使用 <div @click="search" v-preventReClick="1000">搜索</div> * 使用 <div @click="search" v-preventReClick="1000">搜索</div>
*/ */
export default { export default {
inserted(el, binding) { mounted(el, binding) {
el.addEventListener('click', () => { el.addEventListener('click', () => {
el.style.pointerEvents = 'none' el.style.pointerEvents = 'none'
setTimeout(() => { setTimeout(() => {
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<script> <script>
import { mapState } from 'pinia' import { mapState } from 'pinia'
import { appStore } from '@/stores' import stores from '@/stores'
import SidebarItem from './SidebarItem' import SidebarItem from './SidebarItem'
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
components: { SidebarItem }, components: { SidebarItem },
computed: { computed: {
// ...mapState(['settings']), // ...mapState(['settings']),
...mapState(appStore, ['permission_routes', 'sidebarRouters', 'sidebar']), ...mapState(stores, ['permission_routes', 'sidebarRouters', 'sidebar']),
activeMenu() { activeMenu() {
const route = this.$route const route = this.$route
const { meta, path } = route const { meta, path } = route
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
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 rgba(7, 168, 85, 0.2);
border-radius: 8px; border-radius: 8px;
color: #fff !important; color: var(--font-white, #fff) !important;
z-index: 1; z-index: 1;
} }
...@@ -251,7 +251,7 @@ export default { ...@@ -251,7 +251,7 @@ export default {
} }
.card { .card {
// color: #fff; // color: var(--font-white, #fff);
// padding: 20px; // padding: 20px;
// background: linear-gradient(315deg, #07c160 0%, #90de45 100%); // background: linear-gradient(315deg, #07c160 0%, #90de45 100%);
// box-shadow: 0px 15px 20px 0px rgba(64, 64, 64, 0.12); // box-shadow: 0px 15px 20px 0px rgba(64, 64, 64, 0.12);
......
...@@ -236,7 +236,7 @@ export default { ...@@ -236,7 +236,7 @@ export default {
} }
&.active { &.active {
background-color: #42b983; background-color: #42b983;
color: #fff; color: var(--font-white, #fff);
border-color: #42b983; border-color: #42b983;
&::before { &::before {
content: ''; content: '';
...@@ -294,7 +294,7 @@ export default { ...@@ -294,7 +294,7 @@ export default {
} }
&:hover { &:hover {
background-color: #b4bccc; background-color: #b4bccc;
color: #fff; color: var(--font-white, #fff);
} }
} }
} }
......
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
& .sidebar-title { & .sidebar-title {
display: inline-block; display: inline-block;
margin: 0; margin: 0;
color: #fff; color: var(--font-white, #fff);
font-weight: 600; font-weight: 600;
line-height: 50px; line-height: 50px;
font-size: 14px; font-size: 14px;
......
...@@ -116,10 +116,11 @@ export default { ...@@ -116,10 +116,11 @@ export default {
// } // }
// } // }
.el-menu--horizontal { .el-menu--horizontal {
background-color: transparent; background-color: initial;
border: none; border: none;
white-space: nowrap; white-space: nowrap;
flex: 1 1 1200px; flex: 1 1 1200px;
z-index: 0;
& > .el-menu-item { & > .el-menu-item {
height: 38px !important; height: 38px !important;
line-height: 38px !important; line-height: 38px !important;
...@@ -151,8 +152,8 @@ export default { ...@@ -151,8 +152,8 @@ export default {
&::after { &::after {
opacity: 1; opacity: 1;
} }
background-color: transparent; background-color: initial;
color: #fff; color: var(--font-white, #fff);
} }
} }
} }
...@@ -160,7 +161,7 @@ export default { ...@@ -160,7 +161,7 @@ export default {
& > .el-menu-item.is-active, & > .el-menu-item.is-active,
& > .el-submenu.is-active .el-submenu__title { & > .el-submenu.is-active .el-submenu__title {
@extend .g-bg-lg; @extend .g-bg-lg;
color: #fff !important; color: var(--font-white, #fff) !important;
border: 0; border: 0;
} }
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
import Settings from './Settings' import Settings from './Settings'
import { isExternal } from '@/utils/validate' import { isExternal } from '@/utils/validate'
import { mapState } from 'pinia' import { mapState } from 'pinia'
import { appStore } from '@/stores' import stores from '@/stores'
import Logo from './Logo' import Logo from './Logo'
// import { getCustomerServiceQrUrl } from "@/api/login"; // import { getCustomerServiceQrUrl } from "@/api/login";
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
Settings, Settings,
}, },
computed: { computed: {
...mapState(appStore, ['avatar', 'name', 'permission_routes']), ...mapState(stores, ['avatar', 'name', 'permission_routes']),
}, },
mounted() { mounted() {
// console.log(this.permission_routes) // console.log(this.permission_routes)
...@@ -316,12 +316,12 @@ export default { ...@@ -316,12 +316,12 @@ export default {
// background: #fff; // background: #fff;
// color: var(--color); // color: var(--color);
.contact-us-icon { .contact-us-icon {
color: #fff; color: var(--font-white, #fff);
// color: inherit; // color: inherit;
font-size: 30px; font-size: 30px;
} }
// &:hover { // &:hover {
// color: #fff; // color: var(--font-white, #fff);
// background: linear-gradient(225deg, var(--color-sub) 0%, var(--color) 100%); // background: linear-gradient(225deg, var(--color-sub) 0%, var(--color) 100%);
// transition: all 0.3s; // transition: all 0.3s;
// } // }
......
<template> <template>
<div :class="classObj" class="app-wrapper"> <div :class="classObj" class="app-wrapper">
<div class="top-wrap no-dark"> <div class="top-wrap">
<TopBar /> <TopBar />
</div> </div>
<div class="main-wrap"> <div class="main-wrap">
...@@ -28,7 +28,7 @@ import CustomerService from './components/CustomerService' ...@@ -28,7 +28,7 @@ import CustomerService from './components/CustomerService'
import ResizeMixin from './mixin/ResizeHandler' import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'pinia' import { mapState } from 'pinia'
import { appStore } from '@/stores' import stores from '@/stores'
export default { export default {
name: 'Layout', name: 'Layout',
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
mixins: [ResizeMixin], mixins: [ResizeMixin],
computed: { computed: {
// ...mapGetters(['sidebar', 'avatar', 'device']), // ...mapGetters(['sidebar', 'avatar', 'device']),
...mapState(appStore, { ...mapState(stores, {
sidebar: (state) => state.app.sidebar, sidebar: (state) => state.app.sidebar,
device: (state) => state.app.device, device: (state) => state.app.device,
showSettings: (state) => state.settings.showSettings, showSettings: (state) => state.settings.showSettings,
...@@ -100,6 +100,7 @@ export default { ...@@ -100,6 +100,7 @@ export default {
} }
.top-wrap { .top-wrap {
height: var(--top-nav-heght); height: var(--top-nav-heght);
background: #fff;
} }
.main-wrap { .main-wrap {
......
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
text-align: center; text-align: center;
// color: #fff; // color: var(--font-white, #fff);
font-family: Arial; font-family: Arial;
font-size: 12px; font-size: 12px;
letter-spacing: 1px; letter-spacing: 1px;
......
...@@ -99,45 +99,27 @@ Object.assign(app.config.globalProperties, methods, { ...@@ -99,45 +99,27 @@ Object.assign(app.config.globalProperties, methods, {
// app.use(AudioPlayer) // app.use(AudioPlayer)
import Driver from 'driver.js' // import Driver from 'driver.js'
import 'driver.js/dist/driver.min.css' // import 'driver.js/dist/driver.min.css'
app.config.globalProperties.$driver = new Driver({ // app.config.globalProperties.$driver = new Driver({
className: 'scoped-class', // className: 'scoped-class',
allowClose: false, //禁止点击外部关闭 // allowClose: false, //禁止点击外部关闭
doneBtnText: '完成', // 完成按钮标题 // doneBtnText: '完成', // 完成按钮标题
closeBtnText: '关闭', // 关闭按钮标题 // closeBtnText: '关闭', // 关闭按钮标题
stageBackground: '#fff', // 引导对话的背景色 // stageBackground: '#fff', // 引导对话的背景色
nextBtnText: '下一步', // 下一步按钮标题 // nextBtnText: '下一步', // 下一步按钮标题
prevBtnText: '上一步', // 上一步按钮标题 // prevBtnText: '上一步', // 上一步按钮标题
keyboardControl: false, // 禁止键盘控制 // keyboardControl: false, // 禁止键盘控制
// showButtons:false // // showButtons:false
}) // })
import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap'
import '@vuemap/vue-amap/dist/style.css'
app.use(VueAMap)
initAMapApiLoader({
key: '32396af00cd726deed804cf5b63ed2d8',
plugin: [
'AMap.Autocomplete',
'AMap.PlaceSearch',
'AMap.Scale',
'AMap.OverView',
'AMap.ToolBar',
'AMap.MapType',
'AMap.PolyEditor',
'AMap.CircleEditor',
],
})
import directive from './directive' import directive from './directive'
app.use(directive) app.use(directive)
// import { createPinia, defineStore } from 'pinia' import stores, { store } from '@/stores'
import store, { stores } from '@/stores'
app.use(stores) app.use(store)
app.use(router) app.use(router)
app.config.globalProperties.$store = store() app.config.globalProperties.$store = stores()
app.mount('#app') app.mount('#app')
...@@ -6,9 +6,9 @@ import permission from './modules/permission' ...@@ -6,9 +6,9 @@ import permission from './modules/permission'
import settings from './modules/settings' import settings from './modules/settings'
import getters from './getters' import getters from './getters'
export const stores = createPinia() export const store = createPinia()
export const appStore = defineStore('app', { export default defineStore('app', {
state: () => ({ state: () => ({
app: { ...app.state }, app: { ...app.state },
user: { ...user.state }, user: { ...user.state },
...@@ -25,5 +25,3 @@ export const appStore = defineStore('app', { ...@@ -25,5 +25,3 @@ export const appStore = defineStore('app', {
}, },
getters, getters,
}) })
export default appStore
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
} }
// .el-message-box__btns { // .el-message-box__btns {
// .el-button--default.el-button--primary { // .el-button--default.el-button--primary {
// color: #fff; // color: var(--font-white, #fff);
// } // }
// } // }
.el-button { .el-button {
...@@ -59,18 +59,18 @@ ...@@ -59,18 +59,18 @@
.el-button--cyan:active { .el-button--cyan:active {
background: #20b2aa; background: #20b2aa;
border-color: #20b2aa; border-color: #20b2aa;
color: #ffffff; color: var(--font-white, #fff);
} }
.el-button--cyan:focus, .el-button--cyan:focus,
.el-button--cyan:hover { .el-button--cyan:hover {
background: #48d1cc; background: #48d1cc;
border-color: #48d1cc; border-color: #48d1cc;
color: #ffffff; color: var(--font-white, #fff);
} }
.el-button--cyan { .el-button--cyan {
background-color: #20b2aa; background-color: #20b2aa;
border-color: #20b2aa; border-color: #20b2aa;
color: #ffffff; color: var(--font-white, #fff);
} }
// .el-input.el-input--small { // .el-input.el-input--small {
...@@ -496,7 +496,7 @@ ...@@ -496,7 +496,7 @@
color: #86909c; // 标题颜色 color: #86909c; // 标题颜色
} }
.el-step__head.is-process { .el-step__head.is-process {
color: #fff; // 数字颜色 color: var(--font-white, #fff); // 数字颜色
.el-step__icon.is-text { .el-step__icon.is-text {
background: var(--color); background: var(--color);
} }
......
...@@ -84,7 +84,7 @@ div:focus { ...@@ -84,7 +84,7 @@ div:focus {
/* 拖拽列样式 */ /* 拖拽列样式 */
.sortable-ghost { .sortable-ghost {
opacity: 0.8; opacity: 0.8;
color: #fff !important; color: var(--font-white, #fff) !important;
background: #42b983 !important; background: #42b983 !important;
} }
...@@ -203,7 +203,7 @@ div:focus { ...@@ -203,7 +203,7 @@ div:focus {
&card-blue-wrap { &card-blue-wrap {
display: flex; display: flex;
.card-blue { .card-blue {
color: #fff; color: var(--font-white, #fff);
width: 200px; width: 200px;
height: 90px; height: 90px;
background: linear-gradient(90deg, #3c89f0 0%, #1364f4 100%); background: linear-gradient(90deg, #3c89f0 0%, #1364f4 100%);
......
...@@ -2,20 +2,19 @@ ...@@ -2,20 +2,19 @@
* 动态加载百度地图api函数 * 动态加载百度地图api函数
* @param {String} ak 百度地图AK,必传 * @param {String} ak 百度地图AK,必传
*/ */
export default function loadBMap(ak) { export default function loadBMap() {
return new Promise(function(resolve, reject) { return new Promise(function (resolve, reject) {
if (typeof window.BMap !== 'undefined') { if (typeof window.BMap !== 'undefined') {
resolve(window.BMap) resolve(window.BMap)
return true return true
} }
window.onBMapCallback = function() { window.onBMapCallback = function () {
resolve(window.BMap) resolve(window.BMap)
} }
let script = document.createElement('script') let script = document.createElement('script')
script.type = 'text/javascript' script.type = 'text/javascript'
script.src = script.src = 'https://api.map.baidu.com/api?v=3.0&ak=' + window.lwConfig.BAIDU_MAP_KEY + '&callback=onBMapCallback'
'https://api.map.baidu.com/api?v=3.0&ak=' + ak + '&callback=onBMapCallback'
script.onerror = reject script.onerror = reject
document.head.appendChild(script) document.head.appendChild(script)
}) })
}
\ No newline at end of file \ No newline at end of file
}
import store from '@/stores' import stores from '@/stores'
/** /**
* 字符权限校验 * 字符权限校验
...@@ -7,7 +7,7 @@ import store from '@/stores' ...@@ -7,7 +7,7 @@ import store from '@/stores'
*/ */
export function checkPermi(value) { export function checkPermi(value) {
if (value && value instanceof Array && value.length > 0) { if (value && value instanceof Array && value.length > 0) {
const permissions = store && store.permissions const permissions = stores() && stores().permissions
const permissionDatas = value const permissionDatas = value
const hasPermission = permissions.some((permission) => { const hasPermission = permissions.some((permission) => {
......
import axios from 'axios' import axios from 'axios'
import { ElNotification as Notification, ElMessageBox as MessageBox, ElMessage as Message } from 'element-plus' import { ElNotification as Notification, ElMessageBox as MessageBox, ElMessage as Message } from 'element-plus'
import _store from '@/stores' import stores from '@/stores'
import { getToken, setToken } from '@/utils/auth' import { getToken, setToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode' import errorCode from '@/utils/errorCode'
...@@ -34,7 +34,7 @@ service.interceptors.request.use( ...@@ -34,7 +34,7 @@ service.interceptors.request.use(
// 响应拦截器 // 响应拦截器
service.interceptors.response.use( service.interceptors.response.use(
(res) => { (res) => {
let store = _store() let store = stores()
// 未设置状态码则默认成功状态 // 未设置状态码则默认成功状态
const code = res.data.code || 200 const code = res.data.code || 200
// 获取错误信息 // 获取错误信息
......
...@@ -806,12 +806,12 @@ export default { ...@@ -806,12 +806,12 @@ export default {
} }
} }
::v-deep .el-button.is-disabled { ::v-deep .el-button.is-disabled {
color: #fff; color: var(--font-white, #fff);
background-color: #cccccc; background-color: #cccccc;
border-color: #cccccc; border-color: #cccccc;
} }
::v-deep.el-dropdown [disabled] { ::v-deep.el-dropdown [disabled] {
color: #fff; color: var(--font-white, #fff);
background-color: #cccccc; background-color: #cccccc;
border-color: #cccccc; border-color: #cccccc;
} }
......
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
......
...@@ -530,7 +530,7 @@ export default { ...@@ -530,7 +530,7 @@ export default {
.group { .group {
font-size: 12px; font-size: 12px;
background: var(--color); background: var(--color);
color: #fff; color: var(--font-white, #fff);
display: block; display: block;
padding: 0 5px; padding: 0 5px;
height: 24px; height: 24px;
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
justify-content: space-between; justify-content: space-between;
.icon-action { .icon-action {
font-size: 14px; font-size: 14px;
color: #fff; color: var(--font-white, #fff);
} }
} }
} }
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
// left: 0; // left: 0;
// top: 0; // top: 0;
// text-align: center; // text-align: center;
// color: #fff; // color: var(--font-white, #fff);
// opacity: 0; // opacity: 0;
// font-size: 20px; // font-size: 20px;
// background-color: rgba(0, 0, 0, 0.5); // background-color: rgba(0, 0, 0, 0.5);
......
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
......
...@@ -1011,7 +1011,7 @@ export default { ...@@ -1011,7 +1011,7 @@ export default {
cursor: pointer; cursor: pointer;
z-index: 9; z-index: 9;
font-size: 24px; font-size: 24px;
color: #fff; color: var(--font-white, #fff);
display: none; display: none;
background: #0279de; background: #0279de;
width: 24px; width: 24px;
......
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
.group { .group {
font-size: 12px; font-size: 12px;
background: var(--color); background: var(--color);
color: #fff; color: var(--font-white, #fff);
display: block; display: block;
padding: 0 5px; padding: 0 5px;
height: 24px; height: 24px;
......
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
.group { .group {
font-size: 12px; font-size: 12px;
background: var(--color); background: var(--color);
color: #fff; color: var(--font-white, #fff);
display: block; display: block;
padding: 0 5px; padding: 0 5px;
height: 24px; height: 24px;
......
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
......
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
.group { .group {
font-size: 12px; font-size: 12px;
background: var(--color); background: var(--color);
color: #fff; color: var(--font-white, #fff);
display: block; display: block;
padding: 0 5px; padding: 0 5px;
height: 24px; height: 24px;
......
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
.group { .group {
font-size: 12px; font-size: 12px;
background: var(--color); background: var(--color);
color: #fff; color: var(--font-white, #fff);
display: block; display: block;
padding: 0 5px; padding: 0 5px;
height: 24px; height: 24px;
......
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
......
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
......
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
......
...@@ -617,7 +617,7 @@ export default { ...@@ -617,7 +617,7 @@ export default {
.group { .group {
font-size: 12px; font-size: 12px;
background: var(--color); background: var(--color);
color: #fff; color: var(--font-white, #fff);
display: block; display: block;
padding: 0 5px; padding: 0 5px;
height: 24px; height: 24px;
......
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
......
<script> <script>
import MaPage from '@/views/contentCenter/components/MaPage' import MaPage from '@/views/contentCenter/components/MaPage'
import PicTitContent from '@/views/contentCenter/components/PicTitContent' import PicTitContent from '@/views/contentCenter/components/PicTitContent'
import { tsThisType } from '@babel/types' import { tsThisType } from '@babel/types'
export default { export default {
name: 'MImageText', name: 'MImageText',
components: { MaPage, PicTitContent }, components: { MaPage, PicTitContent },
data() { data() {
return { return {
srcList: [], srcList: [],
ids: [], // 选中数组 ids: [], // 选中数组
dialogVisible: false, dialogVisible: false,
currentType: 0, currentType: 0,
poster: '' poster: '',
} }
},
watch: {},
created() {},
methods: {
listChange(data) {
this.srcList = data.map((item) => item.materialUrl)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id)
},
gotoSend(data) {
console.log(data)
this.dialogVisible = true
this.poster = data
},
setTypeFn(type) {
this.currentType = type
}, },
watch: {}, gotoRoute() {
created() {}, if (this.currentType == 0) {
methods: { this.$router.push({
listChange(data) { path: '/customerMaintain/groupMessage/record/add',
this.srcList = data.map((item) => item.materialUrl) query: {
}, posterId: this.poster.id,
// 多选框选中数据 chatType: 1,
handleSelectionChange(selection) { },
this.ids = selection.map((item) => item.id) })
}, } else if (this.currentType == 1) {
gotoSend(data) { this.$router.push({
console.log(data) path: '/customerMaintain/groupMessage/record/add',
this.dialogVisible = true query: {
this.poster = data posterId: this.poster.id,
}, chatType: 2,
setTypeFn(type) { },
this.currentType = type })
}, } else if (this.currentType == 2) {
gotoRoute() { this.$router.push({
if (this.currentType == 0) { path: '/customerMaintain/friendCircle/publish',
this.$router.push({ query: {
path: '/customerMaintain/groupMessage/record/add', posterId: this.poster.id,
query: { },
posterId: this.poster.id, })
chatType: 1 } else {
} this.$router.push({
}) path: '/enterpriseManage/internalCollaborate/appManage',
} else if (this.currentType == 1) { query: {
this.$router.push({ posterId: this.poster.materialUrl,
path: '/customerMaintain/groupMessage/record/add', },
query: { })
posterId: this.poster.id,
chatType: 2
}
})
} else if (this.currentType == 2) {
this.$router.push({
path: '/customerMaintain/friendCircle/publish',
query: {
posterId: this.poster.id
}
})
} else {
this.$router.push({
path: '/enterpriseManage/internalCollaborate/appManage',
query: {
posterId: this.poster.materialUrl
}
})
}
} }
} },
} },
}
</script> </script>
<template> <template>
...@@ -223,80 +223,80 @@ ...@@ -223,80 +223,80 @@
</template> </template>
<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: #1d2129;
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-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);
} }
} }
.img-wrap { .active_item {
position: relative; border: 1px solid rgba(7, 193, 96, 1);
height: 0; background-color: rgba(7, 193, 96, 0.09019607843137255);
padding: 70% 0 0 0;
border-bottom: 1px solid #e6ebf5;
&:hover .actions {
opacity: 1;
}
} }
.actions { }
position: absolute; .img-wrap {
width: 100%; position: relative;
height: 50px; height: 0;
left: 0; padding: 70% 0 0 0;
top: 0; border-bottom: 1px solid #e6ebf5;
text-align: center; &:hover .actions {
color: #fff; opacity: 1;
opacity: 0;
font-size: 20px;
background-color: rgba(0, 0, 0, 0.5);
transition: opacity 0.3s;
.el-icon-EditPen {
margin-right: 20px;
}
} }
.el-image { }
width: 80px; .actions {
height: 80px; position: absolute;
width: 100%;
height: 50px;
left: 0;
top: 0;
text-align: center;
color: var(--font-white, #fff);
opacity: 0;
font-size: 20px;
background-color: rgba(0, 0, 0, 0.5);
transition: opacity 0.3s;
.el-icon-EditPen {
margin-right: 20px;
} }
}
.el-image {
width: 80px;
height: 80px;
}
</style> </style>
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
left: 0; left: 0;
top: 0; top: 0;
text-align: center; text-align: center;
color: #fff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 20px; font-size: 20px;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
......
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
text-align: center; text-align: center;
line-height: 50px; line-height: 50px;
font-size: 20px; font-size: 20px;
color: #fff; color: var(--font-white, #fff);
cursor: pointer; cursor: pointer;
font-size: 43px; font-size: 43px;
} }
......
...@@ -209,7 +209,7 @@ export default { ...@@ -209,7 +209,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .list {
height: calc(100vh - 420px); height: calc(100vh - 370px);
margin-top: 10px; margin-top: 10px;
background: white; background: white;
overflow-y: scroll; overflow-y: scroll;
......
<template> <template>
<div class="content"> <div class="content" style="margin-top: -13px">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="员工检索" name="1"> <el-tab-pane label="员工检索" name="1">
<employee></employee> <employee></employee>
...@@ -14,21 +14,21 @@ ...@@ -14,21 +14,21 @@
</div> </div>
</template> </template>
<script> <script>
import employee from './employee.vue' import employee from './employee.vue'
import user from './customer.vue' import user from './customer.vue'
import global from './global.vue' import global from './global.vue'
export default { export default {
components: { employee, user, global }, components: { employee, user, global },
data() { data() {
return { return {
activeName: '1' activeName: '1',
} }
}, },
methods: {} methods: {},
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep.pd15 { ::v-deep.pd15 {
padding: 15px; padding: 15px;
} }
</style> </style>
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
text-align: center; text-align: center;
line-height: 50px; line-height: 50px;
font-size: 20px; font-size: 20px;
color: #fff; color: var(--font-white, #fff);
cursor: pointer; cursor: pointer;
font-size: 43px; font-size: 43px;
} }
......
...@@ -166,7 +166,7 @@ export default { ...@@ -166,7 +166,7 @@ export default {
}, },
// 根据生日计算年龄 // 根据生日计算年龄
jsGetAge(strBirthday) { jsGetAge(strBirthday) {
if (strBirthday === null) { if (!strBirthday) {
return '无' return '无'
} }
let returnAge let returnAge
...@@ -282,7 +282,7 @@ export default { ...@@ -282,7 +282,7 @@ export default {
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'age'"> <el-row class="baseinfo-row" v-else-if="item.labelVal == 'age'">
<!-- 年龄 --> <!-- 年龄 -->
<el-col :span="6">{{ item.labelName }}</el-col> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ jsGetAge(portrayalSum.bkirthday) }}</el-col> <el-col :span="18">{{ jsGetAge(portrayalSum.birthday) }}</el-col>
</el-row> </el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'birthday'"> <el-row class="baseinfo-row" v-else-if="item.labelVal == 'birthday'">
<!-- 生日 --> <!-- 生日 -->
...@@ -453,7 +453,7 @@ export default { ...@@ -453,7 +453,7 @@ export default {
line-height: 24px; line-height: 24px;
padding: 0 5px; padding: 0 5px;
margin-right: 10px; margin-right: 10px;
color: #fff; color: var(--font-white, #fff);
border-radius: var(--border-radius-small); border-radius: var(--border-radius-small);
} }
.el-card { .el-card {
...@@ -476,7 +476,7 @@ export default { ...@@ -476,7 +476,7 @@ export default {
} }
&.active { &.active {
background: var(--color); background: var(--color);
color: #fff; color: var(--font-white, #fff);
} }
} }
} }
......
...@@ -256,7 +256,11 @@ export default { ...@@ -256,7 +256,11 @@ export default {
</el-table-column> </el-table-column>
<el-table-column prop="address" label="标签" align="center"> <el-table-column prop="address" label="标签" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-tag type="info" v-for="(unit, unique) in row?.tagNames.split(',')" :key="unique">{{ unit }}</el-tag> <div v-if="row.tagNames">
<TagEllipsis :list="row.tagNames?.split(',')"></TagEllipsis>
</div>
<span v-else>无标签</span>
<!-- <el-tag type="info" v-for="(unit, unique) in row?.tagNames?.split(',')" :key="unique">{{ unit }}</el-tag> -->
<!-- <div v-for="(item, index) in row.weFlowerCustomerRels" :key="index"> <!-- <div v-for="(item, index) in row.weFlowerCustomerRels" :key="index">
<el-tag type="info" v-for="(unit, unique) in item.weFlowerCustomerTagRels" :key="unique">{{ <el-tag type="info" v-for="(unit, unique) in item.weFlowerCustomerTagRels" :key="unique">{{
......
...@@ -836,12 +836,12 @@ export default { ...@@ -836,12 +836,12 @@ export default {
} }
} }
::v-deep .el-button.is-disabled { ::v-deep .el-button.is-disabled {
color: #fff; color: var(--font-white, #fff);
background-color: #cccccc; background-color: #cccccc;
border-color: #cccccc; border-color: #cccccc;
} }
::v-deep.el-dropdown [disabled] { ::v-deep.el-dropdown [disabled] {
color: #fff; color: var(--font-white, #fff);
background-color: #cccccc; background-color: #cccccc;
border-color: #cccccc; border-color: #cccccc;
} }
......
...@@ -500,14 +500,14 @@ export default { ...@@ -500,14 +500,14 @@ export default {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #ffffff; color: var(--font-white, #fff);
} }
.value { .value {
margin-top: 5px; margin-top: 5px;
font-size: 18px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #ffffff; color: var(--font-white, #fff);
} }
} }
......
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #ffffff; color: var(--font-white, #fff);
} }
.value { .value {
...@@ -197,7 +197,7 @@ export default { ...@@ -197,7 +197,7 @@ export default {
font-size: 18px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #ffffff; color: var(--font-white, #fff);
} }
} }
</style> </style>
...@@ -270,7 +270,7 @@ export default { ...@@ -270,7 +270,7 @@ export default {
width: 175px; width: 175px;
height: 75px; height: 75px;
padding: 20px 10px 0 54px; padding: 20px 10px 0 54px;
color: #fff; color: var(--font-white, #fff);
line-height: 1.15; line-height: 1.15;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
......
...@@ -395,7 +395,7 @@ export default { ...@@ -395,7 +395,7 @@ export default {
width: 175px; width: 175px;
height: 75px; height: 75px;
padding: 20px 10px 0 54px; padding: 20px 10px 0 54px;
color: #fff; color: var(--font-white, #fff);
line-height: 1.15; line-height: 1.15;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
......
...@@ -445,7 +445,7 @@ export default { ...@@ -445,7 +445,7 @@ export default {
width: 175px; width: 175px;
height: 75px; height: 75px;
padding: 20px 10px 0 54px; padding: 20px 10px 0 54px;
color: #fff; color: var(--font-white, #fff);
line-height: 1.15; line-height: 1.15;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
......
...@@ -55,7 +55,7 @@ const layouts = { ...@@ -55,7 +55,7 @@ const layouts = {
<div>{element.url}</div> <div>{element.url}</div>
<div <div
// 无图片时,占位提示 // 无图片时,占位提示
domPropsInnerHTML={ innerHTML={
element.formCodeId == 1 && !element.src element.formCodeId == 1 && !element.src
? '<div class="no-image">请在右侧控件设置中添加需要展示的图片</div>' ? '<div class="no-image">请在右侧控件设置中添加需要展示的图片</div>'
: '' : ''
...@@ -231,7 +231,7 @@ $selectedColor: #f6f7ff; ...@@ -231,7 +231,7 @@ $selectedColor: #f6f7ff;
background: #fff; background: #fff;
&:hover { &:hover {
background: var(--color); background: var(--color);
color: #fff; color: var(--font-white, #fff);
} }
} }
& > .drawing-item-delete { & > .drawing-item-delete {
...@@ -241,7 +241,7 @@ $selectedColor: #f6f7ff; ...@@ -241,7 +241,7 @@ $selectedColor: #f6f7ff;
background: #fff; background: #fff;
&:hover { &:hover {
background: #f56c6c; background: #f56c6c;
color: #fff; color: var(--font-white, #fff);
} }
} }
} }
......
...@@ -950,7 +950,7 @@ export default { ...@@ -950,7 +950,7 @@ export default {
border-radius: 0 0 6px 0; border-radius: 0 0 6px 0;
text-align: center; text-align: center;
line-height: 26px; line-height: 26px;
color: #fff; color: var(--font-white, #fff);
font-size: 18px; font-size: 18px;
} }
.node-label { .node-label {
......
...@@ -936,7 +936,7 @@ export default { ...@@ -936,7 +936,7 @@ export default {
background-color: var(--color); background-color: var(--color);
text-align: center; text-align: center;
padding: 13px 30px; padding: 13px 30px;
color: #fff; color: var(--font-white, #fff);
} }
::v-deep .form3 .el-scrollbar__wrap { ::v-deep .form3 .el-scrollbar__wrap {
......
...@@ -578,7 +578,7 @@ export default { ...@@ -578,7 +578,7 @@ export default {
.el-tabs__item.is-active { .el-tabs__item.is-active {
background: #1e1e1e; background: #1e1e1e;
border-bottom-color: #1e1e1e !important; border-bottom-color: #1e1e1e !important;
color: #fff; color: var(--font-white, #fff);
} }
.el-icon-EditPen { .el-icon-EditPen {
color: #f1fa8c; color: #f1fa8c;
...@@ -626,7 +626,7 @@ export default { ...@@ -626,7 +626,7 @@ export default {
line-height: 16px; line-height: 16px;
background: rgba(0, 0, 0, 0.2); background: rgba(0, 0, 0, 0.2);
border-radius: 50%; border-radius: 50%;
color: #fff; color: var(--font-white, #fff);
text-align: center; text-align: center;
z-index: 1; z-index: 1;
cursor: pointer; cursor: pointer;
...@@ -937,7 +937,7 @@ $selectedColor: #f6f7ff; ...@@ -937,7 +937,7 @@ $selectedColor: #f6f7ff;
background: #fff; background: #fff;
&:hover { &:hover {
background: var(--color); background: var(--color);
color: #fff; color: var(--font-white, #fff);
} }
} }
& > .drawing-item-delete { & > .drawing-item-delete {
...@@ -947,7 +947,7 @@ $selectedColor: #f6f7ff; ...@@ -947,7 +947,7 @@ $selectedColor: #f6f7ff;
background: #fff; background: #fff;
&:hover { &:hover {
background: #f56c6c; background: #f56c6c;
color: #fff; color: var(--font-white, #fff);
} }
} }
} }
......
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
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" :value="item.id"></el-option>
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="自动通过好友"> <el-form-item label="自动通过好友">
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,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" size="medium" :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">
...@@ -107,7 +106,7 @@ ...@@ -107,7 +106,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 size="medium" 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>
...@@ -119,7 +118,7 @@ ...@@ -119,7 +118,7 @@
<MemeberList :list="codeForm.weEmpleCodeUseScops" @update="getList"></MemeberList> <MemeberList :list="codeForm.weEmpleCodeUseScops" @update="getList"></MemeberList>
<!-- <el-tag <!-- <el-tag
class="user-el-tag" class="user-el-tag"
size="medium"
v-for="(item, index) in codeForm.weEmpleCodeUseScops" v-for="(item, index) in codeForm.weEmpleCodeUseScops"
:key="index" :key="index"
> >
...@@ -136,10 +135,9 @@ ...@@ -136,10 +135,9 @@
<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 size="medium" 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>
...@@ -150,32 +148,30 @@ ...@@ -150,32 +148,30 @@
<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 size="medium" 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>
...@@ -192,7 +188,7 @@ ...@@ -192,7 +188,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"
...@@ -200,11 +196,10 @@ ...@@ -200,11 +196,10 @@
step="00:30" step="00:30"
:max-time="item.endDate" :max-time="item.endDate"
@change="checkStartEnd($event, index)" @change="checkStartEnd($event, index)"
placeholder="任意时间点" placeholder="任意时间点"></el-time-select>
></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"
...@@ -212,8 +207,7 @@ ...@@ -212,8 +207,7 @@
@change="checkStartEnd($event, index)" @change="checkStartEnd($event, index)"
v-model="item.endDate" v-model="item.endDate"
:disabled="index === 0" :disabled="index === 0"
placeholder="任意时间点" placeholder="任意时间点"></el-time-select>
></el-time-select>
</el-form-item> </el-form-item>
</el-card> </el-card>
</template> </template>
...@@ -236,16 +230,14 @@ ...@@ -236,16 +230,14 @@
@update="currentActive = 2" @update="currentActive = 2"
@submit="getWelData" @submit="getWelData"
:baseData="materialData" :baseData="materialData"
:showModle="true" :showModle="true"></AddMaterial>
></AddMaterial>
</div> </div>
<!-- 选择标签弹窗 --> <!-- 选择标签弹窗 -->
<SelectTag <SelectTag
:visible.sync="dialogVisibleSelectTag" v-model:visible="dialogVisibleSelectTag"
:defaultValues="selectedTagList" :defaultValues="selectedTagList"
@success="submitSelectTag" @success="submitSelectTag"></SelectTag>
></SelectTag>
<!-- 选择使用员工弹窗 --> <!-- 选择使用员工弹窗 -->
<SelectUser <SelectUser
...@@ -255,8 +247,7 @@ ...@@ -255,8 +247,7 @@
title="选择使用员工" title="选择使用员工"
:isOnlyLeaf="true" :isOnlyLeaf="true"
:isSigleSelect="codeForm.qrType == 1" :isSigleSelect="codeForm.qrType == 1"
@success="selectedUser" @success="selectedUser"></SelectUser>
></SelectUser>
<!-- 选择使用备用员工弹窗 --> <!-- 选择使用备用员工弹窗 -->
<SelectUser <SelectUser
...@@ -266,884 +257,879 @@ ...@@ -266,884 +257,879 @@
title="选择使用备用员工" title="选择使用备用员工"
:isOnlyLeaf="true" :isOnlyLeaf="true"
:isSigleSelect="codeForm.qrType == 1" :isSigleSelect="codeForm.qrType == 1"
@success="selectedSpareUser" @success="selectedSpareUser"></SelectUser>
></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, {
trigger: 'blur' required: false,
} trigger: 'blur',
] },
}, ],
isInsertClientName: true, },
dialogVisibleSelectUser: false, isInsertClientName: true,
dialogVisibleSelectSpareUser: false, dialogVisibleSelectUser: false,
dialogVisibleSelectTag: false, dialogVisibleSelectSpareUser: false,
dialogVisibleSelectMaterial: false, dialogVisibleSelectTag: false,
dialogVisibleSelectWel: false, dialogVisibleSelectMaterial: false,
loading: false, dialogVisibleSelectWel: false,
codeCategoryList: [], // 活码分组 loading: false,
selectedUserList: [], // 需要回显的选中员工 codeCategoryList: [], // 活码分组
selectedSpareUserList: [], // 需要回显的选中备用员工 selectedUserList: [], // 需要回显的选中员工
selectedTagList: [], selectedSpareUserList: [], // 需要回显的选中备用员工
timeConflict: false selectedTagList: [],
} 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
}, },
created() { checkStartEnd(e, index) {
let id = this.$route.query.id this.timeConflict = false
let groupId = this.$route.query.groupId this.operationIndex = index
if (groupId) { let goto = this.allTimeConflict() // 默认全天员工冲突
this.baseForm.qrGroupId = groupId // let timeGo = true // 非默认周期时间冲突
} if (goto) {
this.getCodeCategoryList() // if (this.operationIndex > 0) {
if (id) { if (
this.title = '编辑' this.codeForm.empleCodeRosterDto[this.operationIndex].weekday.length &&
this.getDetailFn(id) (this.codeForm.empleCodeRosterDto[this.operationIndex].endDate ||
this.codeForm.empleCodeRosterDto[this.operationIndex].startDate)
) {
this.someTimeConflict()
}
// }
} }
}, },
methods: { someTimeConflict() {
getList(data) { let conflictUserItem = [] // 存在冲突的当前数据
this.codeForm.weEmpleCodeUseScops = data let userList = [] // 当前重复人员
}, let passList = [] // 当前之前的人员 不包含默认的第一条
checkStartEnd(e, index) {
this.timeConflict = false
this.operationIndex = index
let goto = this.allTimeConflict() // 默认全天员工冲突
// let timeGo = true // 非默认周期时间冲突
if (goto) {
// if (this.operationIndex > 0) {
if (
this.codeForm.empleCodeRosterDto[this.operationIndex].weekday.length &&
(this.codeForm.empleCodeRosterDto[this.operationIndex].endDate ||
this.codeForm.empleCodeRosterDto[this.operationIndex].startDate)
) {
this.someTimeConflict()
}
// }
}
},
someTimeConflict() {
let conflictUserItem = [] // 存在冲突的当前数据
let userList = [] // 当前重复人员
let passList = [] // 当前之前的人员 不包含默认的第一条
let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map((i) => { let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map((i) => {
return { userId: i.businessId, name: i.businessName } return { userId: i.businessId, name: i.businessName }
}) })
this.codeForm.empleCodeRosterDto.forEach((data, key) => { this.codeForm.empleCodeRosterDto.forEach((data, key) => {
data.weEmpleCodeUseScops.map((i, index) => { data.weEmpleCodeUseScops.map((i, index) => {
if (key != this.operationIndex) { if (key != this.operationIndex) {
passList.push({ passList.push({
userId: i.businessId, userId: i.businessId,
name: i.businessName, name: i.businessName,
index: key, index: key,
week: [], week: [],
goto1: true, goto1: true,
goto2: true goto2: true,
}) })
}
})
})
current.map((dd) => {
passList.map((ff) => {
if (dd.userId === ff.userId) {
userList.push(ff)
}
})
})
// 重复人员下的时间校验
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) { current.map((dd) => {
let start = this.codeForm.empleCodeRosterDto[ddd.index].startDate passList.map((ff) => {
let end = this.codeForm.empleCodeRosterDto[ddd.index].endDate if (dd.userId === ff.userId) {
if (start && end) { userList.push(ff)
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 repeatWeek = []
let ss = fdfd.week.map((data) => { let currentWeekday = this.codeForm.empleCodeRosterDto[this.operationIndex].weekday
return data === 7 ? '日' : data userList.forEach((user) => {
}) const arr = this.codeForm.empleCodeRosterDto[user.index].weekday
str += '员工' + fdfd.name + '在周' + ss.join('、') + '时间存在冲突;' for (var i = 0; i < arr.length; i++) {
if (currentWeekday.indexOf(arr[i]) != -1) {
user.week.push(arr[i])
} }
})
if (str) {
this.timeConflict = true
this.msgError(str)
} else {
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 } userList.forEach((ddd) => {
}) if (ddd.week.length) {
let first = this.codeForm.empleCodeRosterDto[0].weEmpleCodeUseScops.map((i) => { let start = this.codeForm.empleCodeRosterDto[ddd.index].startDate
return { userId: i.businessId, name: i.businessName } let end = this.codeForm.empleCodeRosterDto[ddd.index].endDate
}) if (start && end) {
let result = [] if (this.codeForm.empleCodeRosterDto[this.operationIndex].startDate) {
current.map((dd) => { ddd.goto1 = this.checkAuditTime(
first.map((ff) => { start,
if (dd.userId === ff.userId) { end,
result.push(dd) 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)
if (result.length) { }
let str = result }
.map((obj, index) => {
return obj.name
})
.join(',')
this.msgError('员工 ' + str + ' 已是全天在线,时间存在冲突!')
this.timeConflict = true
return false
} else {
this.timeConflict = false
return true
}
},
checkAuditTime(beginTime, endTime, current) {
let strb = beginTime.split(':')
if (strb.length != 2) {
return false
}
let stre = endTime.split(':')
if (stre.length != 2) {
return false
}
let cur = current.split(':')
if (cur.length != 2) {
return false
}
let b = new Date()
let e = new Date()
let n = new Date()
b.setHours(strb[0])
b.setMinutes(strb[1])
e.setHours(stre[0])
e.setMinutes(stre[1])
n.setHours(cur[0])
n.setMinutes(cur[1])
if (n.getTime() - b.getTime() >= 0 && n.getTime() - e.getTime() <= 0) {
return false
} else {
return true
}
},
cancelFn() {
this.$router.back()
},
getWelData(data) {
this.submit(data)
},
changeType(e) {
if (e === 1) {
this.codeForm.qrRuleType = 1
} }
}, })
nextStep(nextStep) { let str = ''
let form = '' userList.forEach((fdfd) => {
if (nextStep == 2) { if (!fdfd.goto1 || !fdfd.goto2) {
form = 'baseForm' let ss = fdfd.week.map((data) => {
} else if (nextStep == 3) { return data === 7 ? '日' : data
form = 'codeForm' })
str += '员工' + fdfd.name + '在周' + ss.join('、') + '时间存在冲突;'
} }
this.$refs[form].validate((validate) => { })
if (validate) { if (str) {
if (nextStep === 3) { this.timeConflict = true
if (this.codeForm.qrRuleType === 2) { this.msgError(str)
let go = true } else {
let week = true this.timeConflict = false
let time = true }
this.codeForm.empleCodeRosterDto.forEach((ddd) => { },
if (!ddd.weEmpleCodeUseScops.length) { allTimeConflict() {
go = false if (this.operationIndex === 0) {
} return true
if (!ddd.weekday.length) { }
week = false let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map((i) => {
} return { userId: i.businessId, name: i.businessName }
if (!ddd.startDate || !ddd.endDate) { })
time = false let first = this.codeForm.empleCodeRosterDto[0].weEmpleCodeUseScops.map((i) => {
} return { userId: i.businessId, name: i.businessName }
}) })
if (go) { let result = []
if (week) { current.map((dd) => {
if (time) { first.map((ff) => {
if (this.timeConflict) { if (dd.userId === ff.userId) {
this.msgError('排班存在冲突!') result.push(dd)
} else { }
this.currentActive = nextStep })
} })
if (result.length) {
let str = result
.map((obj, index) => {
return obj.name
})
.join(',')
this.msgError('员工 ' + str + ' 已是全天在线,时间存在冲突!')
this.timeConflict = true
return false
} else {
this.timeConflict = false
return true
}
},
checkAuditTime(beginTime, endTime, current) {
let strb = beginTime.split(':')
if (strb.length != 2) {
return false
}
let stre = endTime.split(':')
if (stre.length != 2) {
return false
}
let cur = current.split(':')
if (cur.length != 2) {
return false
}
let b = new Date()
let e = new Date()
let n = new Date()
b.setHours(strb[0])
b.setMinutes(strb[1])
e.setHours(stre[0])
e.setMinutes(stre[1])
n.setHours(cur[0])
n.setMinutes(cur[1])
if (n.getTime() - b.getTime() >= 0 && n.getTime() - e.getTime() <= 0) {
return false
} else {
return true
}
},
cancelFn() {
this.$router.back()
},
getWelData(data) {
this.submit(data)
},
changeType(e) {
if (e === 1) {
this.codeForm.qrRuleType = 1
}
},
nextStep(nextStep) {
let form = ''
if (nextStep == 2) {
form = 'baseForm'
} else if (nextStep == 3) {
form = 'codeForm'
}
this.$refs[form].validate((validate) => {
if (validate) {
if (nextStep === 3) {
if (this.codeForm.qrRuleType === 2) {
let go = true
let week = true
let time = true
this.codeForm.empleCodeRosterDto.forEach((ddd) => {
if (!ddd.weEmpleCodeUseScops.length) {
go = false
}
if (!ddd.weekday.length) {
week = false
}
if (!ddd.startDate || !ddd.endDate) {
time = false
}
})
if (go) {
if (week) {
if (time) {
if (this.timeConflict) {
this.msgError('排班存在冲突!')
} else { } else {
this.msgError('请选择活码排班每项的在线时间!') this.currentActive = nextStep
} }
} else { } else {
this.msgError('活码排班每项工作周期至少勾选一项!') this.msgError('请选择活码排班每项的在线时间!')
} }
} else { } else {
this.msgError('活码排班每项至少选择一名员工!') this.msgError('活码排班每项工作周期至少勾选一项!')
} }
} else { } else {
this.currentActive = nextStep this.msgError('活码排班每项至少选择一名员工!')
} }
} 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 {
let arr = [] this.currentActive = nextStep
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) : []
} }
// this.materialData.materialMsgList.forEach(ddd => { }
// ddd.msgType = Number(ddd.msgType) })
// }) },
}) /** 获取详情 */
}, getDetailFn(id) {
setEditList(list) { getDetail(id).then((res) => {
let arr = [] this.formTemp = res.data
if (list && list.length) { let base = JSON.parse(JSON.stringify(res.data))
list.forEach((dd) => { this.baseForm = {
if (dd.realType === 0) { qrName: base.name,
let obj = { qrGroupId: base.groupId,
id: dd.materialId, qrAutoAdd: base.autoAdd, // 自动通过
mediaType: '0', weEmpleCodeTags: base.qrTags, // 标签
materialUrl: dd.picUrl }
} this.codeForm.qrType = base.type
arr.push(obj) this.codeForm.qrRuleType = base.ruleType
} else if (dd.realType === 2) { this.codeForm.qrRuleMode = base.ruleMode
let obj = { this.codeForm.openSpareUser = base.openSpareUser
id: dd.materialId, this.codeForm.isExclusive = base.isExclusive
mediaType: '2', if (base.ruleType === 1) {
materialUrl: dd.fileUrl, let arr = []
coverUrl: dd.picUrl, let spareArr = []
digest: dd.description, base.qrUserInfos[0].weQrUserList.forEach((dd) => {
materialName: dd.title if (dd.isSpareUser === 0) {
}
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 = { let obj = {
id: dd.materialId, scopeId: base.qrUserInfos[0].scopeId,
mediaType: '9', businessId: dd.userId,
content: dd.content, businessName: dd.userName,
coverUrl: dd.picUrl, businessNumber: dd.schedulingNum,
materialUrl: dd.linkUrl,
materialName: dd.title
} }
arr.push(obj) arr.push(obj)
} else if (dd.realType === 8) { } else {
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 = { let obj = {
id: dd.materialId, scopeId: base.qrUserInfos[0].scopeId,
mediaType: '5', businessId: dd.userId,
materialUrl: dd.fileUrl, businessName: dd.userName,
materialName: dd.title
} }
arr.push(obj) spareArr.push(obj)
}
})
this.codeForm.weEmpleCodeUseScops = arr
this.codeForm.weSpareUseScops = spareArr
} else {
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
} }
return arr this.materialData = {
}, templateInfo: base.qrAttachments ? base.qrAttachments[0].content : '',
// 获取活码分组 attachments: base.qrAttachments ? this.setEditList(base.qrAttachments) : [],
getCodeCategoryList() {
getCodeCategoryList({ mediaType: 6 }).then((res) => {
this.codeCategoryList = res.data
})
},
// 选择人员变化事件
selectedUser(users) {
let params = {
userIds: [],
departmentIds: []
} }
const selectedUserList = users.map((d) => { // this.materialData.materialMsgList.forEach(ddd => {
d.userId && params.userIds.push(d.userId) // ddd.msgType = Number(ddd.msgType)
d.id && params.departmentIds.push(d.id) // })
return { })
businessId: d.userId || d.id, },
businessName: d.name, setEditList(list) {
businessIdType: d.userId ? 2 : 1, let arr = []
businessNumber: 1 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)
} }
}) })
params.userIds += '' }
params.departmentIds += '' return arr
// 全天排班 },
if (this.codeForm.qrRuleType == 1) { // 获取活码分组
this.codeForm.weEmpleCodeUseScops = selectedUserList getCodeCategoryList() {
} else { getCodeCategoryList({ mediaType: 6 }).then((res) => {
// 自动排班 this.codeCategoryList = res.data
this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weEmpleCodeUseScops = selectedUserList })
this.checkStartEnd(null, this.selectedRosterIndex) },
// 选择人员变化事件
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 += ''
selectedSpareUser(users) { params.departmentIds += ''
let params = { // 全天排班
spareUserIds: [], if (this.codeForm.qrRuleType == 1) {
departmentIds: [] 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 selectedSpareUserList = users.map((d) => { })
d.userId && params.spareUserIds.push(d.userId) params.spareUserIds += ''
d.id && params.departmentIds.push(d.id) params.departmentIds += ''
// 全天排班
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 { return {
businessId: d.userId || d.id, userId: dd.businessId,
businessName: d.name, // id: dd.businessIdType === 1 ? dd.businessId:'',
businessIdType: d.userId ? 2 : 1 name: dd.businessName,
} }
}) })
params.spareUserIds += '' this.selectedUserList = arr
params.departmentIds += '' // this.selectedUserList = [...this.codeForm.weEmpleCodeUseScops[index]]
// 全天排班 } else {
if (this.codeForm.qrRuleType == 1) { // this.selectedUserList = [...this.codeForm.weEmpleCodeUseScops]
this.codeForm.weSpareUseScops = selectedSpareUserList let arr = []
} else { arr = this.codeForm.weEmpleCodeUseScops.map((dd) => {
// 自动排班 return {
this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weSpareUseScops = selectedSpareUserList userId: dd.businessId,
this.checkStartEnd(null, this.selectedRosterIndex) // id: dd.businessIdType === 1 ? dd.businessId:'',
} name: dd.businessName,
}, }
// 自动排班-选择员工
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 {
userId: dd.businessId,
// id: dd.businessIdType === 1 ? dd.businessId:'',
name: dd.businessName
}
})
this.selectedSpareUserList = arr
// this.selectedSpareUserList = [...this.codeForm.weSpareUseScops[index]]
} else {
// this.selectedSpareUserList = [...this.codeForm.weSpareUseScops]
let arr = []
arr = this.codeForm.weSpareUseScops.map((dd) => {
return {
userId: dd.businessId,
// id: dd.businessIdType === 1 ? dd.businessId:'',
name: dd.businessName
}
})
this.selectedSpareUserList = arr
}
this.dialogVisibleSelectSpareUser = true
},
// 添加工作周期
onAddRoster() {
this.codeForm.empleCodeRosterDto.push({
weEmpleCodeUseScops: [], // 员工
weekday: [], // 周期
type: 1,
startDate: '', // 开始时间
endDate: '' // 结束时间
}) })
}, this.selectedUserList = arr
// 删除工作周期 }
onRemoveRoster(index) { this.dialogVisibleSelectUser = true
this.timeConflict = false },
this.codeForm.empleCodeRosterDto.splice(index, 1) // 自动排班-选择备用员工
}, onSelectSpareUser(index) {
// 工作周期时间变化 // 设置回显数据
onRosterTimeChange(e, index) { this.selectedSpareUserList = []
const [startTime, endTime] = e if (this.codeForm.qrRuleType == 2) {
this.codeForm.empleCodeRosterDto[index].startDate = startTime this.selectedRosterIndex = index
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.dialogVisibleSelectTag = true
},
submitSelectTag(data) {
this.baseForm.weEmpleCodeTags = data.map((d) => ({
tagId: d.tagId,
tagName: d.name
}))
},
resetData(list) {
let arr = [] let arr = []
if (list && list.length) { arr = this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weSpareUseScops.map((dd) => {
list.forEach((dd) => { return {
if (dd.msgType === '0') { userId: dd.businessId,
let obj = { // id: dd.businessIdType === 1 ? dd.businessId:'',
msgType: 'image', name: dd.businessName,
picUrl: dd.materialUrl }
} })
arr.push(obj) this.selectedSpareUserList = arr
} else if (dd.msgType === '8') { // this.selectedSpareUserList = [...this.codeForm.weSpareUseScops[index]]
let ob = { } else {
msgType: 'link', // this.selectedSpareUserList = [...this.codeForm.weSpareUseScops]
title: dd.materialName, let arr = []
linkUrl: dd.materialUrl arr = this.codeForm.weSpareUseScops.map((dd) => {
} return {
arr.push(ob) userId: dd.businessId,
} else if (dd.msgType === '9') { // id: dd.businessIdType === 1 ? dd.businessId:'',
let ff = { name: dd.businessName,
msgType: 'miniprogram', }
appId: dd.digest, })
title: dd.materialName, this.selectedSpareUserList = arr
picUrl: dd.coverUrl, }
linkUrl: dd.materialUrl this.dialogVisibleSelectSpareUser = true
} },
arr.push(ff) // 添加工作周期
onAddRoster() {
this.codeForm.empleCodeRosterDto.push({
weEmpleCodeUseScops: [], // 员工
weekday: [], // 周期
type: 1,
startDate: '', // 开始时间
endDate: '', // 结束时间
})
},
// 删除工作周期
onRemoveRoster(index) {
this.timeConflict = false
this.codeForm.empleCodeRosterDto.splice(index, 1)
},
// 工作周期时间变化
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.dialogVisibleSelectTag = true
},
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') {
return arr let ob = {
}, msgType: 'link',
submit(data) { title: dd.materialName,
this.loading = true linkUrl: dd.materialUrl,
let list = data.attachments
let myObj = {
attachments: [
{
content: data.templateInfo,
msgType: 'text'
} }
] arr.push(ob)
} } else if (dd.msgType === '9') {
myObj.attachments.push(...list) let ff = {
if (this.codeForm.qrRuleType === 1) { msgType: 'miniprogram',
let qrUserInfosDetail = [] appId: dd.digest,
this.codeForm.weEmpleCodeUseScops.forEach((uu) => { title: dd.materialName,
let objDetail = { picUrl: dd.coverUrl,
userId: uu.businessId, linkUrl: dd.materialUrl,
schedulingNum: uu.businessNumber
} }
qrUserInfosDetail.push(objDetail) arr.push(ff)
})
let obj = {
type: 0,
scopeId: this.codeForm.weEmpleCodeUseScops[0].scopeId ? this.codeForm.weEmpleCodeUseScops[0].scopeId : '',
userIds: this.codeForm.weEmpleCodeUseScops.map((dd) => dd.businessId),
spareUserIds: this.codeForm.weSpareUseScops.map((ss) => ss.businessId),
qrUserInfosDetail: qrUserInfosDetail
} }
this.codeForm.qrUserInfos = [obj] })
} else { }
this.codeForm.qrUserInfos = [] return arr
this.codeForm.empleCodeRosterDto.forEach((fff) => { },
let obj = { submit(data) {
scopeId: fff.scopeId ? fff.scopeId : '', this.loading = true
type: fff.type, let list = data.attachments
beginTime: fff.startDate, let myObj = {
endTime: fff.endDate, attachments: [
userIds: fff.weEmpleCodeUseScops.map((dd) => dd.businessId), {
workCycle: fff.weekday content: data.templateInfo,
} msgType: 'text',
this.codeForm.qrUserInfos.push(obj) },
}) ],
} }
this.baseForm.qrTags = this.baseForm.weEmpleCodeTags.map((ccc) => ccc.tagId) myObj.attachments.push(...list)
let obj = Object.assign({}, this.baseForm, this.codeForm, myObj) if (this.codeForm.qrRuleType === 1) {
delete obj.weEmpleCodeTags let qrUserInfosDetail = []
delete obj.weEmpleCodeUseScops this.codeForm.weEmpleCodeUseScops.forEach((uu) => {
delete obj.empleCodeRosterDto let objDetail = {
if (this.formTemp.id) { userId: uu.businessId,
obj.qrId = this.formTemp.id schedulingNum: uu.businessNumber,
obj.configId = this.formTemp.configId }
qrUserInfosDetail.push(objDetail)
})
let obj = {
type: 0,
scopeId: this.codeForm.weEmpleCodeUseScops[0].scopeId ? this.codeForm.weEmpleCodeUseScops[0].scopeId : '',
userIds: this.codeForm.weEmpleCodeUseScops.map((dd) => dd.businessId),
spareUserIds: this.codeForm.weSpareUseScops.map((ss) => ss.businessId),
qrUserInfosDetail: qrUserInfosDetail,
} }
;(this.formTemp.id ? update : add)(obj) this.codeForm.qrUserInfos = [obj]
.then(({ data }) => { } else {
this.msgSuccess('操作成功') this.codeForm.qrUserInfos = []
this.loading = false this.codeForm.empleCodeRosterDto.forEach((fff) => {
this.$router.back() let obj = {
}) scopeId: fff.scopeId ? fff.scopeId : '',
.catch(() => { type: fff.type,
this.loading = false beginTime: fff.startDate,
}) endTime: fff.endDate,
userIds: fff.weEmpleCodeUseScops.map((dd) => dd.businessId),
workCycle: fff.weekday,
}
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
})
},
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sub-des { .sub-des {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
} }
.add-continue { .add-continue {
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: var(--color); color: var(--color);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
&:hover { &:hover {
opacity: 0.8; opacity: 0.8;
}
} }
}
.crumb- { .crumb- {
// 一级 页面标题 // 一级 页面标题
&title { &title {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
height: 90px; // line-height: 90px; height: 90px; // line-height: 90px;
font-size: 18px; font-size: 18px;
font-weight: 500; font-weight: 500;
color: #333; color: #333;
padding: 0 20px; padding: 0 20px;
background: #fff; background: #fff;
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
}
} }
}
.crumb { .crumb {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
display: flex; 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 { }
margin-top: -16%; .roster-btn-delete {
margin-right: -8%; margin-top: -16%;
} margin-right: -8%;
.roster-card:not(:first-child) { }
margin-top: 20px; .roster-card:not(:first-child) {
} margin-top: 20px;
.user-el-tag { }
margin-right: 50px; .user-el-tag {
width: 160px; margin-right: 50px;
margin-left: 0px; width: 160px;
} margin-left: 0px;
}
</style> </style>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<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="新客户标签">
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div> <div>
<el-form label-width="120px" label-position="right" ref="form" :rules="rule" :model="form"> <el-form label-width="120px" label-position="right" ref="form" :rules="rule" :model="form">
<div class="g-card"> <div class="g-card">
<div class="card-title" style="display: inline-block">基础信息</div> <div class="card-title" style="display: inline-block;">基础信息</div>
<div style="float: right" v-if="isDetail"> <div style="float: right;" v-if="isDetail">
<el-button <el-button
type="primary" type="primary"
@click=" @click="
...@@ -11,10 +11,11 @@ ...@@ -11,10 +11,11 @@
path: 'add', path: 'add',
query: { query: {
id: $route.query.id, id: $route.query.id,
obj: encodeURIComponent(JSON.stringify(form)), obj: encodeURIComponent(JSON.stringify(form))
}, }
}) })
"> "
>
编辑 编辑
</el-button> </el-button>
</div> </div>
...@@ -23,9 +24,10 @@ ...@@ -23,9 +24,10 @@
:disabled="isDetail" :disabled="isDetail"
v-model="form.storeName" v-model="form.storeName"
placeholder="请输入门店名称" placeholder="请输入门店名称"
style="width: 400px" style="width: 400px;"
show-word-limit show-word-limit
maxlength="30" /> maxlength="30"
/>
</el-form-item> </el-form-item>
<el-form-item label="所属地区" prop="area"> <el-form-item label="所属地区" prop="area">
<el-cascader <el-cascader
...@@ -34,7 +36,8 @@ ...@@ -34,7 +36,8 @@
:props="props" :props="props"
:options="cityTree" :options="cityTree"
ref="tree" ref="tree"
@change="handleTree"></el-cascader> @change="handleTree"
></el-cascader>
</el-form-item> </el-form-item>
<baidu-map @update="handleChange" @point="getPoint" :isDetail="isDetail" :initData="form"></baidu-map> <baidu-map @update="handleChange" @point="getPoint" :isDetail="isDetail" :initData="form"></baidu-map>
</div> </div>
...@@ -47,10 +50,10 @@ ...@@ -47,10 +50,10 @@
<el-button v-if="!isDetail" icon="el-icon-plus" type="primary" plain @click="dialogVisibleQr = true"> <el-button v-if="!isDetail" icon="el-icon-plus" type="primary" plain @click="dialogVisibleQr = true">
{{ form.shopGuideUrl ? '编辑' : '选择' }}员工活码 {{ form.shopGuideUrl ? '编辑' : '选择' }}员工活码
</el-button> </el-button>
<div style="margin-top: 10px" v-if="form.shopGuideUrl"> <div style="margin-top: 10px;" v-if="form.shopGuideUrl">
<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="form.shopGuideUrl" /> <img style="width: 100%; height: 100%;" :src="form.shopGuideUrl" />
<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,7 +66,7 @@ ...@@ -63,7 +66,7 @@
<el-form-item label="门店群活码"> <el-form-item label="门店群活码">
<div v-if="form.groupCodeUrl"> <div v-if="form.groupCodeUrl">
<div>{{ form.groupCodeName }}</div> <div>{{ form.groupCodeName }}</div>
<img style="height: 80px; width: 80px; margin-top: 5px" :src="form.groupCodeUrl" /> <img style="height: 80px; width: 80px; margin-top: 5px;" :src="form.groupCodeUrl" />
</div> </div>
<el-button <el-button
...@@ -71,7 +74,8 @@ ...@@ -71,7 +74,8 @@
icon="el-icon-plus" icon="el-icon-plus"
type="primary" type="primary"
plain plain
@click="dialogVisibleSelectQrCode = true"> @click="dialogVisibleSelectQrCode = true"
>
{{ form.groupCodeUrl ? '编辑' : '选择' }}群活码 {{ form.groupCodeUrl ? '编辑' : '选择' }}群活码
</el-button> </el-button>
</el-form-item> </el-form-item>
...@@ -83,7 +87,8 @@ ...@@ -83,7 +87,8 @@
active-text="启用" active-text="启用"
inactive-text="停用" inactive-text="停用"
:active-value="0" :active-value="0"
:inactive-value="1"></el-switch> :inactive-value="1"
></el-switch>
</template> </template>
<template v-else> <template v-else>
<el-switch <el-switch
...@@ -92,7 +97,8 @@ ...@@ -92,7 +97,8 @@
active-text="启用" active-text="启用"
inactive-text="停用" inactive-text="停用"
:active-value="0" :active-value="0"
:inactive-value="1"></el-switch> :inactive-value="1"
></el-switch>
</template> </template>
</el-form-item> </el-form-item>
</div> </div>
...@@ -112,214 +118,218 @@ ...@@ -112,214 +118,218 @@
<SelectQrCode <SelectQrCode
v-model:visible="dialogVisibleSelectQrCode" v-model:visible="dialogVisibleSelectQrCode"
@success="selectedQrCode" @success="selectedQrCode"
:selected="selectedCodeList"></SelectQrCode> :selected="selectedCodeList"
></SelectQrCode>
<SelectStaffQrCode v-model:visible="dialogVisibleQr" @success="selectedQr"></SelectStaffQrCode> <SelectStaffQrCode v-model:visible="dialogVisibleQr" @success="selectedQr"></SelectStaffQrCode>
</div> </div>
</template> </template>
<script> <script>
import BaiduMap from '@/components/common/BaiduMap' import BaiduMap from '@/components/common/BaiduMap'
import SelectQrCode from '@/components/SelectQrCode' import SelectQrCode from '@/components/SelectQrCode'
import SelectUser from '@/components/SelectUser' import SelectUser from '@/components/SelectUser'
import SelectStaffQrCode from '@/components/SelectStaffQrCode' import SelectStaffQrCode from '@/components/SelectStaffQrCode'
import { getProCityList } from '@/api/common' import { getProCityList } from '@/api/common'
import { addOrUpdateStore, storeDetail } from '@/api/drainageCode/store' import { addOrUpdateStore, storeDetail } from '@/api/drainageCode/store'
export default { export default {
name: 'store-add', name: 'store-add',
data() { data() {
return { return {
areaArray: [], areaArray: [],
current: { current: {
province: '', province: '',
city: '', city: '',
area: '', area: ''
}, },
form: { form: {
storeState: 1, storeState: 1,
storeName: '', storeName: '',
area: '', area: '',
provinceId: '', provinceId: '',
cityId: '', cityId: '',
areaId: '', areaId: '',
longitude: '', longitude: '',
latitude: '', latitude: '',
shopGuideId: '', shopGuideId: '',
shopGuideName: '', shopGuideName: '',
address: '', address: '',
groupCodeUrl: '', groupCodeUrl: '',
groupCodeName: '', groupCodeName: '',
groupCodeId: '', groupCodeId: '',
shopGuideUrl: '', shopGuideUrl: ''
}, },
selectedUserList: [], selectedUserList: [],
dialogVisibleSelectUser: false, dialogVisibleSelectUser: false,
dialogVisibleSelectQrCode: false, dialogVisibleSelectQrCode: false,
selectedCodeList: [], selectedCodeList: [],
submitLoading: false, submitLoading: false,
cityTree: [], cityTree: [],
props: { props: {
label: 'name', label: 'name',
value: 'name', value: 'name'
}, },
rule: { rule: {
storeName: [{ required: true, message: '请输入门店名称', trigger: 'blur' }], storeName: [{ required: true, message: '请输入门店名称', trigger: 'blur' }],
area: [{ required: true, message: '请选择所属地区', trigger: 'blur' }], area: [{ required: true, message: '请选择所属地区', trigger: 'blur' }],
address: [{ required: true, message: '请选择详细地址', trigger: 'blur' }], address: [{ required: true, message: '请选择详细地址', trigger: 'blur' }]
}, },
dialogVisibleQr: false, dialogVisibleQr: false
}
},
props: {
isDetail: {
type: Boolean,
default: false,
},
},
components: {
BaiduMap,
SelectQrCode,
SelectUser,
SelectStaffQrCode,
},
methods: {
handleRemove() {
this.form.shopGuideUrl = ''
this.form.shopGuideId = ''
this.form.shopGuideName = ''
},
selectedQr(data) {
let arr = []
if (data.qrUserInfos.length) {
data.qrUserInfos.forEach((dd) => {
arr = [...arr, ...dd.weQrUserList]
})
} }
let ids = []
let names = []
arr.forEach((dd) => {
ids.push(dd.userId)
names.push(dd.userName)
})
this.form.shopGuideId = ids.join(',')
this.form.shopGuideName = names.join(',')
this.form.shopGuideUrl = data.qrCode
this.dialogVisibleQr = false
},
getPoint(addrPoint) {
this.form.longitude = addrPoint.lng.toString()
this.form.latitude = addrPoint.lat.toString()
}, },
handleChange(data) { props: {
if (data.address) { isDetail: {
this.form.address = data.address type: Boolean,
this.form.area = data.province + data.city + data.area default: false
if (data.province) {
this.areaArray = [data.province, data.city, data.area]
}
this.form.longitude = data.addrPoint.lng.toString()
this.form.latitude = data.addrPoint.lat.toString()
} }
}, },
handleTree(data) { components: {
this.form.area = this.areaArray.join('') BaiduMap,
SelectQrCode,
SelectUser,
SelectStaffQrCode
}, },
selectedUser(data) { methods: {
this.selectedUserList = data handleRemove() {
let ids = [] this.form.shopGuideUrl = ''
let names = [] this.form.shopGuideId = ''
data.forEach((dd) => { this.form.shopGuideName = ''
ids.push(dd.userId) },
names.push(dd.name) selectedQr(data) {
}) let arr = []
this.form.shopGuideId = ids.join(',') if (data.qrUserInfos.length) {
this.form.shopGuideName = names.join(',') data.qrUserInfos.forEach((dd) => {
}, arr = [...arr, ...dd.weQrUserList]
onSelectUser() {
// this.dialogVisibleSelectUser = true
this.dialogVisibleQr = true
},
selectedQrCode(data) {
if (data) {
this.selectedCodeList[0] = data
this.form.groupCodeUrl = data.codeUrl
this.form.groupCodeName = data.activityName
this.form.groupCodeId = data.id
}
},
submitFn() {
this.$refs['form'].validate((valitate) => {
if (valitate) {
this.submitLoading = true
addOrUpdateStore(this.form).then((res) => {
if (res.code === 200) {
this.msgSuccess('操作成功')
this.$router.back()
this.submitLoading = false
} else {
this.submitLoading = false
this.msgInfo(res.msg)
}
}) })
} }
}) let ids = []
}, let names = []
cancelFn() { arr.forEach((dd) => {
this.$confirm(`是否确认取消${this.$route.query.id ? '编辑' : '新建'}?取消后不可恢复,请谨慎操作。`, '提示', { ids.push(dd.userId)
confirmButtonText: '确认', names.push(dd.userName)
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.$router.back()
}) })
.catch(function () {}) this.form.shopGuideId = ids.join(',')
}, this.form.shopGuideName = names.join(',')
setDetail() {
if (this.form.groupCodeId) { this.form.shopGuideUrl = data.qrCode
this.selectedCodeList[0] = { id: this.form.groupCodeId } this.dialogVisibleQr = false
} },
if (this.form.area) { getPoint(addrPoint) {
let reg = /.+?(省|市|自治区|自治州|县|区|旗)/g this.form.longitude = addrPoint.lng.toString()
let arr = this.form.area.match(reg) this.form.latitude = addrPoint.lat.toString()
this.areaArray = arr },
} handleChange(data) {
if (this.form.shopGuideId) { if (data.address) {
this.selectedUserList = [] this.form.address = data.address
let idList = this.form.shopGuideId.split(',') this.form.area = data.province + data.city + data.area
let nameList = this.form.shopGuideName.split(',') if (data.province) {
let arr = [] this.areaArray = [data.province, data.city, data.area]
idList.forEach((dd, index) => { }
arr.push({ name: nameList[index], userId: dd }) this.form.longitude = data.addrPoint.lng.toString()
this.form.latitude = data.addrPoint.lat.toString()
}
},
handleTree(data) {
this.form.area = this.areaArray.join('')
this.form.address = ''
this.form.longitude = ''
this.form.latitude = ''
},
selectedUser(data) {
this.selectedUserList = data
let ids = []
let names = []
data.forEach((dd) => {
ids.push(dd.userId)
names.push(dd.name)
})
this.form.shopGuideId = ids.join(',')
this.form.shopGuideName = names.join(',')
},
onSelectUser() {
// this.dialogVisibleSelectUser = true
this.dialogVisibleQr = true
},
selectedQrCode(data) {
if (data) {
this.selectedCodeList[0] = data
this.form.groupCodeUrl = data.codeUrl
this.form.groupCodeName = data.activityName
this.form.groupCodeId = data.id
}
},
submitFn() {
this.$refs['form'].validate((valitate) => {
if (valitate) {
this.submitLoading = true
addOrUpdateStore(this.form).then((res) => {
if (res.code === 200) {
this.msgSuccess('操作成功')
this.$router.back()
this.submitLoading = false
} else {
this.submitLoading = false
this.msgInfo(res.msg)
}
})
}
})
},
cancelFn() {
this.$confirm(`是否确认取消${this.$route.query.id ? '编辑' : '新建'}?取消后不可恢复,请谨慎操作。`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}) })
this.selectedUserList = [...arr] .then(() => {
// this.$forceUpdate() this.$router.back()
})
.catch(function () {})
},
setDetail() {
if (this.form.groupCodeId) {
this.selectedCodeList[0] = { id: this.form.groupCodeId }
}
if (this.form.area) {
let reg = /.+?(省|市|自治区|自治州|县|区|旗)/g
let arr = this.form.area.match(reg)
this.areaArray = arr
}
if (this.form.shopGuideId) {
this.selectedUserList = []
let idList = this.form.shopGuideId.split(',')
let nameList = this.form.shopGuideName.split(',')
let arr = []
idList.forEach((dd, index) => {
arr.push({ name: nameList[index], userId: dd })
})
this.selectedUserList = [...arr]
// this.$forceUpdate()
}
} }
}, },
}, created() {
created() { getProCityList({ isExtName: true }).then((res) => {
getProCityList({ isExtName: true }).then((res) => {
if (res.code === 200) {
this.cityTree = res.data
}
})
if (this.$route.query.id) {
storeDetail(this.$route.query.id).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.form = res.data this.cityTree = res.data
this.setDetail()
} }
}) })
if (this.$route.query.id) {
storeDetail(this.$route.query.id).then((res) => {
if (res.code === 200) {
this.form = res.data
this.setDetail()
}
})
}
} }
}, }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.card-title { .card-title {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
margin-bottom: 20px; margin-bottom: 20px;
} }
</style> </style>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</el-form> </el-form>
</div> </div>
<div class="g-footer-sticky bottom" v-if="roles[activeIndex]"> <div class="g-footer-sticky bottom" v-if="roles[activeIndex]">
<!-- <el-button plain type="danger">删除</el-button> --> <el-button plain type="danger" @click="deleteFn">删除</el-button>
<el-button type="primary" @click="edtiFn">编辑</el-button> <el-button type="primary" @click="edtiFn">编辑</el-button>
</div> </div>
</div> </div>
......
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
margin: 100px auto; margin: 100px auto;
.pan-back-btn { .pan-back-btn {
background: #008489; background: #008489;
color: #fff; color: var(--font-white, #fff);
border: none !important; border: none !important;
} }
.pan-gif { .pan-gif {
......
...@@ -2,44 +2,39 @@ ...@@ -2,44 +2,39 @@
<div class="wscn-http404-container"> <div class="wscn-http404-container">
<div class="wscn-http404"> <div class="wscn-http404">
<div class="pic-404"> <div class="pic-404">
<img class="pic-404__parent" src="@/assets/404_images/404.png" alt="404"> <img class="pic-404__parent" src="@/assets/404_images/404.png" alt="404" />
<img class="pic-404__child left" src="@/assets/404_images/404_cloud.png" alt="404"> <img class="pic-404__child left" src="@/assets/404_images/404_cloud.png" alt="404" />
<img class="pic-404__child mid" src="@/assets/404_images/404_cloud.png" alt="404"> <img class="pic-404__child mid" src="@/assets/404_images/404_cloud.png" alt="404" />
<img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404"> <img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404" />
</div> </div>
<div class="bullshit"> <div class="bullshit">
<div class="bullshit__oops"> <div class="bullshit__oops">404错误!</div>
404错误!
</div>
<div class="bullshit__headline"> <div class="bullshit__headline">
{{ message }} {{ message }}
</div> </div>
<div class="bullshit__info"> <div class="bullshit__info">
对不起,您正在寻找的页面不存在。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。 对不起,您正在寻找的页面不存在。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。
</div> </div>
<router-link to="/" class="bullshit__return-home"> <router-link to="/" class="bullshit__return-home">返回首页</router-link>
返回首页
</router-link>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'Page404', name: 'Page404',
computed: { computed: {
message() { message() {
return '找不到网页!' return '找不到网页!'
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.wscn-http404-container{ .wscn-http404-container {
transform: translate(-50%,-50%); transform: translate(-50%, -50%);
position: absolute; position: absolute;
top: 40%; top: 40%;
left: 50%; left: 50%;
...@@ -208,7 +203,7 @@ export default { ...@@ -208,7 +203,7 @@ export default {
background: #1482f0; background: #1482f0;
border-radius: 100px; border-radius: 100px;
text-align: center; text-align: center;
color: #ffffff; color: var(--font-white, #fff);
opacity: 0; opacity: 0;
font-size: 14px; font-size: 14px;
line-height: 36px; line-height: 36px;
......
<script> <script>
import { getList, getAnalysis, remove } from '@/api/intelligentShortLink' import { getList, getAnalysis, remove } from '@/api/intelligentShortLink'
import { touchTypeDict } from './components/mixin' import * as api from '@/api/enterpriseId'
export default { import { touchTypeDict } from './components/mixin'
name: '', export default {
components: {}, name: '',
data() { components: {},
return { data() {
loading: false, return {
cardData: [], loading: false,
total: 0, cardData: [],
query: { total: 0,
pageSize: 10, query: {
pageNum: 1, pageSize: 10,
}, pageNum: 1
touchTypeDict, },
// dictStatus: Object.freeze({ touchTypeDict,
// 1: '启用', // dictStatus: Object.freeze({
// 2: '关闭', // 1: '启用',
// }), // 2: '关闭',
// }),
list: [], list: [],
ids: [], ids: [],
} needMoreInfo: false,
}, dialogVisible: false
computed: {}, }
watch: {},
created() {
this.getList()
this.getAnalysis()
this.$store.setBusininessDesc(` <div>生成智能短链,一键跳转公众号、小程序、企业微信</div> `)
},
mounted() {
this.clipboard = new this.ClipboardJS('.copy-btn')
},
unmounted() {
this.clipboard.destroy()
},
methods: {
getAnalysis() {
this.loading = true
getAnalysis()
.then(({ data }) => {
this.cardData = [
{
title: '访问总数(pv)',
tips: '短链页面访问的总次数',
value: data.pvTotalCount,
},
{
title: '访问总人数(uv)',
tips: '短链页面访问的独立IP数',
value: data.uvTotalCount,
},
{
title: '小程序打开数',
tips: '小程序成功打开的总次数',
value: data.openTotalCount,
},
{
title: '今日访问总数(pv)',
tips: '今日短链页面访问的总次数',
value: data.pvTodayCount,
title1: '较昨日',
value1: data.pvDiff,
},
{
title: '今日访问总人数(uv)',
tips: '今日短链页面访问的独立IP数',
value: data.uvTodayCount,
title1: '较昨日',
value1: data.uvDiff,
},
{
title: '今日小程序打开数',
tips: '今日小程序成功打开的总次数',
value: data.openTodayCount,
title1: '较昨日',
value1: data.openDiff,
},
]
})
.catch((e) => {
console.log(e)
})
.finally(() => {
this.loading = false
})
}, },
getList(page) { computed: {},
page && (this.query.pageNum = page) watch: {},
this.loading = true created() {
getList(this.query) this.setState()
.then(({ rows, total }) => { this.getList()
this.list = rows this.getAnalysis()
this.total = +total this.$store.setBusininessDesc(` <div>生成智能短链,一键跳转公众号、小程序、企业微信</div> `)
})
.catch(() => {})
.finally(() => {
this.loading = false
})
}, },
resetForm() { mounted() {
this.$refs['queryForm'].resetFields() this.clipboard = new this.ClipboardJS('.copy-btn')
this.getList(1)
}, },
goRoute(row = {}, detail) { unmounted() {
let { id } = row this.clipboard.destroy()
this.$router.push({
path: './' + (detail || 'addEdit'),
query: { id },
})
}, },
remove(id) { methods: {
const ids = id || this.ids + '' cancelFn() {
this.$confirm('是否确认删除吗?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) this.needMoreInfo = false
.then(function () { this.dialogVisible = false
return remove(ids) this.goRoute()
},
gotoSetting() {
this.$router.push({
path: '/enterpriseManage/enterpriseWechat'
}) })
.then(() => { },
this.getList() setState() {
this.msgSuccess('删除成功') api.getDetail().then((res) => {
if (!res.data.wxAppletOriginalId || !res.data.miniAppId || !res.data.miniSecret) {
this.needMoreInfo = true
}
}) })
}, },
}, getAnalysis() {
} this.loading = true
getAnalysis()
.then(({ data }) => {
this.cardData = [
{
title: '访问总数(pv)',
tips: '短链页面访问的总次数',
value: data.pvTotalCount
},
{
title: '访问总人数(uv)',
tips: '短链页面访问的独立IP数',
value: data.uvTotalCount
},
{
title: '小程序打开数',
tips: '小程序成功打开的总次数',
value: data.openTotalCount
},
{
title: '今日访问总数(pv)',
tips: '今日短链页面访问的总次数',
value: data.pvTodayCount,
title1: '较昨日',
value1: data.pvDiff
},
{
title: '今日访问总人数(uv)',
tips: '今日短链页面访问的独立IP数',
value: data.uvTodayCount,
title1: '较昨日',
value1: data.uvDiff
},
{
title: '今日小程序打开数',
tips: '今日小程序成功打开的总次数',
value: data.openTodayCount,
title1: '较昨日',
value1: data.openDiff
}
]
})
.catch((e) => {
console.log(e)
})
.finally(() => {
this.loading = false
})
},
getList(page) {
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
})
.catch(() => {})
.finally(() => {
this.loading = false
})
},
resetForm() {
this.$refs['queryForm'].resetFields()
this.getList(1)
},
goRoute(row = {}, detail) {
if (this.needMoreInfo) {
this.dialogVisible = true
return
}
let { id } = row
this.$router.push({
path: './' + (detail || 'addEdit'),
query: { id }
})
},
remove(id) {
const ids = id || this.ids + ''
this.$confirm('是否确认删除吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(function () {
return remove(ids)
})
.then(() => {
this.getList()
this.msgSuccess('删除成功')
})
}
}
}
</script> </script>
<template> <template>
...@@ -140,7 +169,8 @@ export default { ...@@ -140,7 +169,8 @@ export default {
v-for="(item, index) in touchTypeDict" v-for="(item, index) in touchTypeDict"
:key="index" :key="index"
:label="item.allName" :label="item.allName"
:value="+index"></el-option> :value="+index"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="" prop="status"> <!-- <el-form-item label="" prop="status">
...@@ -172,7 +202,8 @@ export default { ...@@ -172,7 +202,8 @@ export default {
<el-icon-copy-document <el-icon-copy-document
class="el-icon-copy-document copy-btn cp ml20" class="el-icon-copy-document copy-btn cp ml20"
title="复制" title="复制"
:data-clipboard-text="row.shortLink"></el-icon-copy-document> :data-clipboard-text="row.shortLink"
></el-icon-copy-document>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="状态" align="center" prop="status"> <!-- <el-table-column label="状态" align="center" prop="status">
...@@ -188,14 +219,39 @@ export default { ...@@ -188,14 +219,39 @@ export default {
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination :total="total" v-model:page="query.pageNum" v-model:limit="query.pageSize" @pagination="getList()" /> <pagination :total="total" v-model:page="query.pageNum" v-model:limit="query.pageSize" @pagination="getList()" />
<template v-if="!list.length">
<div class="tips">
智能短链需要先配置短链小程序,否则无法正常使用,<a class="link" @click="gotoSetting">去配置</a>
</div>
</template>
</div> </div>
<el-dialog title="提示" :close-on-click-modal="false" :show-close="false" v-model="dialogVisible" width="auto">
<div style="text-align: center;">
智能短链需要先配置短链小程序,否则无法正常使用。
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancelFn">继续新建</el-button>
<el-button type="primary" @click="gotoSetting">去配置</el-button>
</span>
</template>
</el-dialog>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-icon-copy-document { .tips {
&:hover { margin-top: 30px;
text-align: center;
color: #999999;
}
.link {
color: var(--color); color: var(--color);
border-bottom: 1px solid var(--color);
}
.el-icon-copy-document {
&:hover {
color: var(--color);
}
} }
}
</style> </style>
...@@ -374,7 +374,7 @@ export default { ...@@ -374,7 +374,7 @@ export default {
width: 175px; width: 175px;
height: 75px; height: 75px;
padding: 20px 10px 0 54px; padding: 20px 10px 0 54px;
color: #fff; color: var(--font-white, #fff);
line-height: 1.15; line-height: 1.15;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</template> </template>
<script> <script>
import store from '@/stores' import stores from '@/stores'
import 'vue-cropper/dist/index.css' import 'vue-cropper/dist/index.css'
import { VueCropper } from 'vue-cropper' import { VueCropper } from 'vue-cropper'
import { uploadAvatar } from '@/api/system/user' import { uploadAvatar } from '@/api/system/user'
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
title: '修改头像', title: '修改头像',
options: { options: {
outputType: 'png', // 裁剪生成图片的格式 jpeg, png, webp outputType: 'png', // 裁剪生成图片的格式 jpeg, png, webp
img: store().avatar, //裁剪图片的地址 img: stores().avatar, //裁剪图片的地址
autoCrop: true, // 是否默认生成截图框 autoCrop: true, // 是否默认生成截图框
autoCropWidth: 200, // 默认生成截图框宽度 autoCropWidth: 200, // 默认生成截图框宽度
autoCropHeight: 200, // 默认生成截图框高度 autoCropHeight: 200, // 默认生成截图框高度
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
if (response.code === 200) { if (response.code === 200) {
this.open = false this.open = false
this.options.img = response.imgUrl this.options.img = response.imgUrl
store.avatar = this.options.img stores.avatar = this.options.img
this.msgSuccess('修改成功') this.msgSuccess('修改成功')
} }
this.visible = false this.visible = false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!