Commit c4dab253 by 胡悦

Merge branch 'v1.1.0'

2 parents 25cff592 5acd95c0
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http_common } from '@/main'
const pictureUpload = params => {
params.method = "glsx.accounts.biz.common.pictureUpload"
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export default {
pictureUpload
}
\ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const URL = '/rop-scrm-entmicro/router'
const PATH = 'org.ore.api.one.template.'
const templateList = params => {
params.method = `${PATH}list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const insert = params => {
params.method = `${PATH}insert`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const update = params => {
params.method = `${PATH}update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const detail = params => {
params.method = `${PATH}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const status = params => {
params.method = `${PATH}status`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
export default {
templateList,
insert,
detail,
status,
update,
listDepartmentTree
}
......@@ -18,11 +18,12 @@ module.exports = {
code_message_map: {}
},
// 王小龙:http://192.168.2.98:8091/rop-scrm-datahub 冯支:http://192.168.3.191:8064/rop-scrm-entmicro/
/* 开发环境的域名:http://scrm.dev.glsx.com.cn/rop-scrm-datahub 测试:https://scrm.test.glsx.com.cn
http://scrm.dev.glsx.com.cn/rop-scrm-entmicro http://scrm.test.glsx.com.cn/
*/
request: {
baseURL: 'http://scrm.test.glsx.com.cn',
/* 开发环境的域名:http://scrm.dev.glsx.com.cn/rop-scrm-datahub 测试:https://scrm.test.glsx.com.cn
http://scrm.dev.glsx.com.cn/rop-scrm-entmicro http://scrm.test.glsx.com.cn/
*/
request: {
// baseURL: 'http://scrm.test.glsx.com.cn', // 测试
baseURL: 'http://192.168.2.42:8064',
// 设置超时时间
timeout: 180000,
// 携带凭证
......@@ -33,7 +34,7 @@ http://scrm.dev.glsx.com.cn/rop-scrm-entmicro http://scrm.test.glsx.com.cn/
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
format: 'json',
source: 'client-sub-custom'
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
......
......@@ -11,7 +11,7 @@
let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
export const fetchConfig = function (isEnv = true) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
......@@ -19,7 +19,7 @@ export const fetchConfig = function(isEnv = true) {
}
// https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base
// https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config
return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config')
}
export const config = {
install(vue, cfg) {
......
......@@ -33,8 +33,9 @@ Vue.prototype.$Commons = common
Vue.prototype.$echarts = echarts
//过滤器统一处理预加载
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
Vue.filter(key, filters[key])
})
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
......@@ -25,11 +25,11 @@ VueRouter.prototype.push = function push(location) {
// }
function getRoutes(routesData) {
return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.path + '.vue') })
return routes
routes.push({ ...route, component: () => import('@/views' + route.compath + '.vue') })
return routes
}, [])
}
export {
export {
VueRouter,
routes,
getRoutes
......
......@@ -37,53 +37,58 @@ const staticRoutes = Object.freeze([
// },
{
name: 'clientGroupManage',
path: "/clientGroupManage/index",
path: "/clientGroupManage/index",
component: resolve => require([`@/views/clientGroupManage/index.vue`], resolve),
meta: {}
},
{
name: 'clientGroupDetail',
path: "/clientGroupManage/clientGroupDetail",
path: "/clientGroupManage/clientGroupDetail",
component: resolve => require([`@/views/clientGroupManage/clientGroupDetail.vue`], resolve),
meta: {}
},
{
name: 'tagsManage',
path: "/tagsManage/index",
path: "/tagsManage/index",
component: resolve => require([`@/views/tagsManage/index.vue`], resolve),
meta: {}
},
{
name: 'expand',
path: "/expand/index",
path: "/expand/index",
component: resolve => require([`@/views/expand/index.vue`], resolve),
meta: {}
},
{
name: 'employee',
path: "/employee/index",
component: resolve => require([`@/views/employee/index.vue`], resolve),
meta: {
}
path: "/employee/index",
component: resolve => require([`@/views/employee/index.vue`], resolve),
meta: {}
},
{
name: 'employee',
path: "/employee/detail",
component: resolve => require([`@/views/employee/detail.vue`], resolve),
meta: {
}
path: "/employee/detail",
component: resolve => require([`@/views/employee/detail.vue`], resolve),
meta: {}
},
{
name: 'employee',
path: "/employee/add",
component: resolve => require([`@/views/employee/add.vue`], resolve),
meta: {
}
path: "/employee/add",
component: resolve => require([`@/views/employee/add.vue`], resolve),
meta: {}
},
{
name: 'guestGuest',
path: "/guestGroup/index",
component: resolve => require([`@/views/guestGroup/index.vue`], resolve),
meta: {}
},
{
name: 'guestAdd',
path: "/guestGroup/add/:id",
component: resolve => require([`@/views/guestGroup/add.vue`], resolve),
meta: {}
}
])
export default staticRoutes
// {
......@@ -110,7 +115,7 @@ export default staticRoutes
// keepAlive: false,
// component: () => import("../views/clientMassTexting/detailMassTexting.vue"),
// },
// {
// path: "/clientPartGroup",
// name: "clientPartGroup",
......
......@@ -2,10 +2,10 @@ import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import ElementUI from 'element-ui'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import render from './render'
Vue.use(ElementUI)
Vue.use(ElementUI)
Vue.use(GLTable)
import 'glsx-components/dist/glsx-components.css'
......@@ -13,12 +13,13 @@ let routes = []
let router = null
let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState }) {
const { response, request, sign, secret } = await fetchConfig(globalState.configSwitch)//globalState.configSwitch
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig(globalState.configSwitch)//globalState.configSwitch
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
//Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers)
......
......@@ -10,15 +10,16 @@
import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig(false)
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: 'mini-f27a0943-8fbf-4b21-a7a1-8e82a117ba39-rop' } })
Vue.use(GLButton,GLTable, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const { response, request, sign, secret } = await fetchConfig(true)
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: 'mini-3ab7a37c-3bfa-4a83-bbf8-9e59c6e10330-rop' } })
Vue.prototype.$http_common = new Http({ response, signWay: "md5", request: 'http://qcdidicb.glsx.net:7060', sign, secret, alert: message.error, headers: { token: 'mini-3ab7a37c-3bfa-4a83-bbf8-9e59c6e10330-rop' } })
Vue.use(GLButton, GLTable, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
<template>
<div class="img-bg">
<div class="preview-content">
<div class="preview-time">{{ currentTime }}</div>
<div class="preview-info" v-for="item in previewList" :key="item.id">
<img class="avatar" src="@/assets/logo.png" alt="" />
<template v-if="item.attType == 1">
<div class="preview-text text">{{ item.attContent }}</div>
</template>
<template v-else-if="item.attType == 4">
<div class="preview-text preview-link">
{{ item.attContent.url }}
<img src="@/assets/guestCustom/preview-link.png" alt="" />
</div>
</template>
<template v-else-if="item.attType == 2">
<el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
</template>
<template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<video style="width: 100px" :src="item.attContent"></video>
</template>
<template v-else-if="item.attType == 5">
<div class="preview-text text preview-applet">
<div class="preview-applet-title">
<img :src="item.attContent.picUrl" alt="" />
<span>{{ item.attContent.title }}</span>
</div>
{{ item.attContent.page }}
</div>
</template>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Preview',
props: { eventBus: Object },
data() {
return {
previewList: [],
currentTime: ''
}
},
created() {
this.eventBus.$on('update', val => {
console.log(val)
this.previewList = val
})
},
mounted() {
const date = new Date()
let hours = date.getHours()
hours = hours < 10 ? `0${hours}` : hours
let minutes = date.getMinutes()
minutes = minutes < 10 ? `0${minutes}` : minutes
this.currentTime = `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日 ${hours}:${minutes}`
}
}
</script>
<style lang="scss" scope>
.img-bg {
position: relative;
width: 290px;
height: 566px;
background-image: url(../../../assets/guestCustom/iphone-bg.png);
background-size: 100%;
.preview-content {
position: absolute;
width: 250px;
height: 350px;
overflow-y: auto;
top: 115px;
left: 20px;
// background-color: cornflowerblue;
.preview-time {
font-size: 10px;
color: #999;
text-align: center;
margin-bottom: 15px;
}
.preview-info {
display: flex;
padding: 0 44px 20px 9px;
.avatar {
width: 26px;
height: 26px;
margin-right: 8px;
}
.preview-text {
position: relative;
max-width: 169px;
color: #333;
background-color: #fff;
border-radius: 4px;
word-wrap: break-word;
}
.text {
font-size: 16px;
padding: 8px 11px;
}
.preview-link {
display: inline-flex;
word-break: break-all;
font-size: 14px;
padding: 8px 8px 8px 11px;
img {
width: 34px;
height: 34px;
margin-left: 10px;
}
}
.preview-text::before {
content: '';
position: absolute;
left: -10px;
top: 20%;
border-width: 5px;
border-style: dashed solid dashed dashed;
border-color: transparent #fff transparent transparent;
// background-color: cornflowerblue;
}
.preview-applet {
img {
width: 20px;
height: 20px;
margin-right: 4px;
}
&-title {
display: flex;
align-self: center;
color: #999;
margin-bottom: 5px;
}
}
}
}
}
</style>
<template>
<div class="select-emp-panel">
<div class="scrm-p10 emp-tree-panel">
<div class="popper-arrow"></div>
<div
class="emp-scroll-panel"
:style="{
height: treeHeight + 'px'
}"
>
<div class="tree-title">所在门店/部门</div>
<el-tree :data="listTree" :expand-on-click-node="false" highlight-current :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>
</div>
<el-col
class="scrm-p10 emp-table-panel"
:style="{
height: treeHeight + 20 + 'px'
}"
>
<GLTable ref="saleTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" @selectionTable="selectionTable">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" v-show="!group.staffName" @click="selectGroup(scope.scope)">设为群主</el-button>
<el-button type="text" v-show="group.staffName && scope.scope.staffName == group.staffName" @click="cancelGroup">取消群主</el-button>
</div>
</GLTable>
</el-col>
</div>
</template>
<script>
export default {
name: 'selectEmp',
props: ['selectData'],
data() {
return {
treeHeight: 0,
staffName: '',
listTree: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '职务',
prop: 'staffTitle'
},
{
label: '',
prop: 'optionBtns',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
tableEmpData: [],
group: {},
allGroup: [],
employeeList: []
}
},
methods: {
selectionTable(val) {
console.log(val)
this.$emit('selectTable', val)
this.allGroup = val
const hasGroup = val.find(item => item.id == this.group.id)
if (!hasGroup) {
this.cancelGroup()
}
},
listDepartmentTree() {
this.$apis.groupGuest.listDepartmentTree({ merchantId: 10001001, addChildrensFlag: true }).then(res => {
this.listTree = res
this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
console.log(this.listTree)
this.selectData.forEach(i => {
const row = this.getEmployee(this.listTree).find(j => j.id == i.staffId)
console.log(row)
this.clearSelect(row)
})
this.$nextTick(() => {
document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
document.getElementsByClassName('el-tree-node__content')[0].click()
})
})
},
clearSelect(row) {
console.log(row, '2222')
this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
clearSelection() {
console.log(2222)
this.$refs.saleTable.$refs.salelistMutiTable.clearSelection()
},
handleNodeClick(data) {
this.departmentId = data.id
this.tableEmpData = data.entmicroStaffResponses
// this.listEntmicroStaff()
},
selectGroup(data) {
console.log(data)
this.group = data
const obj = this.allGroup.find(item => item.id == data.id)
if (!obj) this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(data)
this.$emit('group', this.group)
},
cancelGroup() {
this.group = {}
this.$emit('group', this.group)
},
getEmployee(d, arr = []) {
d.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
arr.push(j)
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
}
// listEntmicroStaff(staffName) {
// let params = {
// departmentId: this.departmentId,
// staffName: staffName ? staffName : this.staffName,
// merchantid: this.$globalState.session.merchantId
// }
// this.$apis.emp.listEntmicroStaff(params).then(res => {
// this.tableEmpData = res
// })
// }
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.treeHeight = clientHeight - 450
this.listDepartmentTree()
console.log(this.selectData, '.....')
}
}
</script>
<style scoped lang="scss">
.select-emp-panel {
display: flex;
.emp-tree-panel {
margin-top: 10px;
width: 200px;
position: relative;
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
border: 1px solid #e4e7ed;
.emp-scroll-panel {
min-height: 200px;
overflow: auto;
box-sizing: border-box;
}
.popper-arrow {
border-top-width: 0;
border-width: 6px;
position: absolute;
top: -12px;
left: 30px;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-bottom-color: #e4e7ed;
&:after {
content: ' ';
border-width: 6px;
top: 1px;
margin-left: -6px;
border-top-width: 0;
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-bottom-color: #fff;
}
}
}
.emp-table-panel {
flex: 1;
min-height: 200px;
overflow: auto;
margin-top: 10px;
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
border: 1px solid #e4e7ed;
/deep/ .el-checkbox__input.is-disabled .el-checkbox__inner {
background-color: #999999;
}
}
.emp-tree-panel {
margin-right: 10px;
font-size: 15px;
/deep/ .el-tree-node:focus > .el-tree-node__content {
color: #5850ff;
background: #f2f5fa;
}
}
.tree-title {
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 14px;
padding: 10px;
}
}
</style>
<template>
<div class="drawer-sale-panel">
<el-form label-width="100px" :model="addForm">
<el-form-item label="请选择成员">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp :selectData="selectData" @group="handlGroup" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="群主">
<el-tag v-show="group.staffName" closable @close="cancelGroup">{{ group.staffName }}</el-tag>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp.vue'
export default {
name: 'SelectMembers',
props: ['selectData'],
components: {
selectEmp
},
data() {
return {
addForm: {},
typeIndex: 0,
empType: [],
// empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {},
group: {}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
console.log(val)
this.innerTags = val
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
console.log(row, '111')
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listDepartmentTree(this.newTag)
},
handlGroup(val) {
console.log(val)
this.group = val
},
cancelGroup() {
this.$refs.selectEmpTabel.cancelGroup()
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择成员',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
}
}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #606266;
display: inline-block;
outline: none;
padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
</style>
<template>
<div class="scrm-sub-client-container">
<div class="btn-header">
<button class="addBtn" @click="btnClick('create')">新建群组</button>
<span class="toptips">
<span>配置群聊不会自动拉群,邀请客户入群后群聊才会正式生效,一个客户默认拉一个群聊。</span>
</span>
</div>
<div class="container">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="searchFormData">
<span class="inline-b" slot="form-slot">
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<!-- 表格区域 开始 -->
<GLTable ref="gueastGroup" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.staffName }}({{ i.departmentName }});</span>
</div>
<span slot="status" slot-scope="scope">
<span class="statusText" :class="{ 'red-text': scope.scope.status === '2', 'green-text': scope.scope.status === '1' }">{{ scope.scope.status == '1' ? '启用' : '停用' }}</span>
</span>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="btnClick('edit', scope.scope)">修改</el-button>
<el-button type="text" @click="btnClick('status', scope.scope)">{{ scope.scope.status == 1 ? '停用' : '启用' }}</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
export default {
data() {
return {
searchForm: {},
searchFormData: [
{
type: 'input',
inputType: 'text',
prop: 'groupName',
label: '组名',
placeholder: '请输入组名搜索'
}
],
// 表格
getListApi: this.$apis.groupGuest.templateList,
tableParams: {
listName: '',
tableOption: false,
otherOptions: {
label: '启用开关'
},
tableColumns: [
{
label: '组名',
prop: 'orgName'
},
{
label: '默认成员',
prop: 'entmicroName',
line: 2,
minWidth: '100px',
addHtml: 'entmicro-name'
},
{
label: '创建时间',
prop: 'createdTime',
line: 2
},
{
label: '状态',
prop: 'status',
width: '80px',
addHtml: 'status'
},
{
label: '操作',
prop: 'optionBtns',
width: '140px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableData: [
{
id: 1,
orgName: '守候专用服务一组',
createdTime: '2021-11-05',
status: '1',
userList: [
{
id: 1,
name: '1号',
tips: '售前一组'
},
{
id: 2,
name: '2号',
tips: '售前一组'
},
{
id: 3,
name: '3号',
tips: '售前一组'
},
{
id: 4,
name: '4号',
tips: '售前一组'
},
{
id: 5,
name: '5号',
tips: '售前一组'
},
{
id: 6,
name: '6号',
tips: '售前一组'
},
{
id: 7,
name: '7号',
tips: '售前一组'
},
{
id: 8,
name: '8号',
tips: '售前一组'
},
{
id: 9,
name: '9号',
tips: '售前一组'
},
{
id: 10,
name: '10号',
tips: '售前一组'
}
]
},
{
id: 2,
orgName: '守候专用服务er组',
createdTime: '2021-11-05',
status: '2',
userList: [
{
id: 1,
name: '1号'
},
{
id: 2,
name: '2号'
},
{
id: 3,
name: '3号'
},
{
id: 4,
name: '4号'
},
{
id: 5,
name: '5号'
}
]
}
]
}
},
methods: {
//搜索表格
searchTable() {
console.log(this.searchForm)
this.$refs.gueastGroup.refreshTable()
},
btnClick(name, rowData) {
console.log(name)
switch (name) {
case 'create':
this.$router.push('/guestGroup/add/' + -1)
break
case 'edit':
this.$router.push('/guestGroup/add/' + rowData.id)
break
case 'status':
this.$confirm(`是否确认${rowData.status == 1 ? '启用' : '停用'}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const params = {
id: rowData.id,
status: rowData.status == 1 ? 2 : 1,
merchantId: 1
}
this.$apis.groupGuest
.status(params)
.then(res => {
console.log(res)
if (res) {
this.searchTable()
this.$message({
type: 'success',
message: '操作成功!'
})
}
})
.catch(err => {
this.$message({
type: 'error',
message: err.message
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
break
default:
console.log('gaocuole')
}
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.btn-header {
margin-bottom: 20px;
}
.container {
margin-bottom: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.addBtn {
height: 32px;
background: $btnBlue;
border-radius: 4px;
padding: 0 20px;
color: #fff;
font-size: 14px;
&:hover {
background-color: $lightBtnBlue;
}
}
.toptips {
display: inline-block;
position: relative;
margin-left: 10px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
}
.entmicro {
text-align: left;
span {
line-height: 20px;
}
}
/deep/ {
.search-form {
padding-top: 0;
}
.search-form .itemWidth {
max-width: 100%;
}
.search-form .el-form-item:last-child {
float: right;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!