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