Commit e467ff3e by xuyl

Merge branch 'v2.1.0' of http://192.168.3.233:8090/saas/scrm-micro-custom into xuyl_dev_2.1.0

2 parents 6a2c8b3a 265230d0
...@@ -57,5 +57,16 @@ export default { ...@@ -57,5 +57,16 @@ export default {
padding: 20px 0; padding: 20px 0;
line-height: 36px; line-height: 36px;
} }
#app {
background: #f4f5fa;
padding: 0px 20px 20px 20px;
position: absolute;
box-sizing: border-box;
width: 100%;
top: 0px;
left: 0px;
overflow-y: auto;
height: 100%;
}
</style> </style>
> >
...@@ -121,3 +121,14 @@ export function clientManageExportApi(params) { ...@@ -121,3 +121,14 @@ export function clientManageExportApi(params) {
sign: true sign: true
}) })
} }
//根据userId完善客户手机号
export function perfectCustomerPhone(params) {
params.method = `entmicro.api.customer.perfectCustomerPhone`
return http3({
url: 'http://192.168.3.193:8395/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
...@@ -18,7 +18,7 @@ export const fetchConfig = function(isEnv = true) { ...@@ -18,7 +18,7 @@ export const fetchConfig = function(isEnv = true) {
return Promise.resolve(cfg) return Promise.resolve(cfg)
} }
return new Http({ request: { timeout: 3000 } }).get('https://oss-config.test.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config2') return new Http({ request: { timeout: 3000 } }).get('https://oss-config.dev.glsx.com.cn/mock/616d3b131072f92988f05a01/custom/config2')
//开发环境mock //开发环境mock
// return new Http({ request: { timeout: 3000 } }).get('http://192.168.3.171:7300/mock/616d3b131072f92988f05a01/custom/config2') // return new Http({ request: { timeout: 3000 } }).get('http://192.168.3.171:7300/mock/616d3b131072f92988f05a01/custom/config2')
} }
......
...@@ -15,7 +15,7 @@ import '@/assets/css/public.scss' ...@@ -15,7 +15,7 @@ import '@/assets/css/public.scss'
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import './styles/index.scss' import './styles/index.scss'
import { start } from '@/setup' import { start } from '@/setup'
import glsxTable from 'glsx-table'; import glsxTable from 'glsx-table'
import { message } from './plugins/element.js' import { message } from './plugins/element.js'
import filters from '@/utils/filters' import filters from '@/utils/filters'
import * as echarts from 'echarts' import * as echarts from 'echarts'
...@@ -27,7 +27,7 @@ Vue.use(VueAnimateNumber) ...@@ -27,7 +27,7 @@ Vue.use(VueAnimateNumber)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
Vue.use(glsxTable); Vue.use(glsxTable)
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
// Vue.prototype.btn_size = 'mini' // Vue.prototype.btn_size = 'mini'
...@@ -39,7 +39,6 @@ Vue.prototype.$echarts = echarts ...@@ -39,7 +39,6 @@ Vue.prototype.$echarts = echarts
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]) Vue.filter(key, filters[key])
}) })
start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http2 = params => Vue.prototype.$http2(params) export const http2 = params => Vue.prototype.$http2(params)
......
import { getCustomersList, exportLabelList } from '@/api/modules/tagsManage'
import { getStaffList } from '@/api/modules/clientManage'
export default {
data() {
return {
tagHeight: 0,
tagHeightStatus: false,
tagCheckItem: [],
allListParams: [],
crowdForm: {
crowdName: '',
crowdDesc: ''
}
}
},
mounted() {
this.getStaffList()
this.getCustomersListData()
},
watch: {
tagCheckItem: {
handler() {
if (this.tagCheckItem.length == 0) {
this.tagHeight = 0
}
this.allListParams = []
const tagNode = this.$common.utils.deepClone(this.tagCheckItem)
tagNode.forEach(group_item => {
group_item.children.forEach(label_item => {
if (label_item) {
this.allListParams.push({
groupId: group_item.id,
groupName: group_item.name,
groupType: group_item.labelType,
labelId: label_item.id,
labelName: label_item.name
})
}
})
})
this.getCustomersListData()
},
deep: true
},
tagHeight: {
handler(val) {
if (val == 0) {
setTimeout(() => {
this.tagHeightStatus = false
}, 300)
} else {
this.tagHeightStatus = true
}
},
deep: true
}
},
methods: {
//获取跟进员工
getStaffList() {
getStaffList({}).then(res => {
if (res.length == 0) {
return ''
}
const id = this.tagsPartFormList.findIndex(item => {
return item.name == 'followStaff'
})
const staff = res.map(item => {
return {
label: item.staffName,
value: item.staffName
}
})
staff.unshift({ label: '全部', value: '' })
this.$nextTick(() => {
this.tagsPartFormList[id].optionList = staff
})
console.log(this.tagsPartFormList[id])
})
},
goDetail(scope) {
this.$router.push('/clientManage/clientDetail?id=' + scope.oneId)
},
//删除标签组
removeItem(index) {
this.tagCheckItem.splice(index, 1)
this.$refs.tagTree.getTreeNode(this.tagCheckItem)
},
treeScroll(id) {
const h = document.querySelector('.node_' + id).offsetTop
this.$refs.tagTree.handleScroll(h)
},
//获取选中的标签并排序
getCheckItem(item) {
const tree_id = []
const labelTree = this.$refs.tagTree.labelTree
labelTree.forEach(tree_node => {
tree_node.children.forEach(t_node => {
tree_id.push(t_node.id)
})
})
this.tagCheckItem = []
let group_all = item.getCheckedNodes().filter(item => item.labelType)
let group_Label = item.getCheckedNodes().filter(item => !item.children)
let label_id = []
group_Label.forEach(item => {
label_id.push(item.id)
})
let group_half = item.getHalfCheckedNodes().filter(item => item.labelType)
let group = [...group_half, ...group_all].sort((a, b) => {
return tree_id.indexOf(a.id) - tree_id.indexOf(b.id)
})
this.tagCheckItem = this.$common.utils.deepClone(group)
group.forEach((tag, idx) => {
tag.children.forEach((item, index) => {
if (!label_id.includes(item.id)) {
this.tagCheckItem[idx].children[index] = null
}
})
})
},
//导出
handleExport() {
const params = {
...JSON.parse(JSON.stringify({ tagLists: this.allListParams }))
}
exportLabelList(params).then(res => {
this.$Utils.exportFn(res)
})
},
//客户列表
getCustomersListData() {
if (this.searchForm.createTime) {
this.searchForm.beginTime = new Date(this.searchForm.createTime[0]).toLocaleDateString().replace(/-/g, '/')
this.searchForm.endTime = new Date(this.searchForm.createTime[1]).toLocaleDateString().replace(/-/g, '/')
}
delete this.searchForm.createTime
const tagLists = this.$common.utils.deepClone(this.allListParams)
this.userLoading = true
const params = {
...JSON.parse(JSON.stringify({ tagLists })),
...JSON.parse(JSON.stringify(this.searchForm)),
pageSize: this.$refs.viewCustomers.page.pageSize,
pageNum: this.$refs.viewCustomers.page.pageNum
}
getCustomersList(params)
.then(res => {
this.userLoading = false
this.tableData = res.data
this.tableTotal = res.count
if (this.tableTotal == 0) {
this.$refs.viewCustomers.setTableHeightFun()
}
})
.catch(err => {
this.userLoading = false
})
},
//创建人群
groupConfirmDialog() {
console.log(this.allListParams)
if (this.tagCheckItem.length == 0) {
this.$message.error('必须选择一个标签')
return
}
if (!this.crowdForm.crowdName) {
this.$message.error('请输入人群名称')
return
}
const tagCombine = this.allListParams.reduce((prev, cur) => {
const index = prev.findIndex(group => cur.groupId == group.groupId)
if (index == -1) {
return prev.concat({ groupId: cur.groupId, labelIdList: [cur.labelId] })
} else {
prev[index].labelIdList.push(cur.labelId)
return prev
}
}, [])
const params = {
'req.merchantId': this.merchantId,
'req.crowdType': 2, //类型 1-推荐 2-自定义
'req.crowdName': this.crowdForm.crowdName,
'req.crowdDesc': this.crowdForm.crowdDesc,
'req.tagCombine': JSON.stringify(tagCombine)
}
this.$apis.crowdManage
.addCrowd(params)
.then(res => {
if (res) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.groupVisible = false
} else {
this.$message({
type: 'error',
message: '操作失败'
})
}
})
.catch(err => {
this.$message({
type: 'error',
message: err.message
})
})
}
}
}
...@@ -2,59 +2,51 @@ import Vue from 'vue' ...@@ -2,59 +2,51 @@ import Vue from 'vue'
import { message } from '@/plugins/element.js' import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import { GLButton, GLTable, GLFooter } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import render from './render' import render from './render'
import GLCombiForm from '@/components/GlCombiForm'
import GlSearch from '@/components/GlSearch'
import GlSearchItem from '@/components/GlSearchItem'
Vue.use(GlSearch)
Vue.use(GlSearchItem)
Vue.use(GLCombiForm)
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
Vue.use(GLFooter) import GLCombiForm from '@/components/GlCombiForm'
Vue.use(GLCombiForm)
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
let routes = [] let routes = []
let router = null let router = null
let instance = null let instance = null
// http:调的是新版标签的接口,http2:调的是客户相关接口;http3:企微授权那边的接口 目前导出接口都测试的:http3 // http:调的是新版标签的接口,http2:调的是客户相关接口;http3:企微授权那边的接口 目前导出接口都测试的:http3
export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) { export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) {
const { response, request, request2, request3, request4, sign, secret, sign_common, request_common } = await fetchConfig(globalState.configSwitch) //globalState.configSwitch const { response, request, request2, request3, request4, sign, secret, sign_common, request_common } = await fetchConfig(globalState.configSwitch) //globalState.configSwitch
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
Vue.prototype.$common = common 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 = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http3 = new common.Http({ response, request: request3, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http3 = new common.Http({ response, request: request3, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$http4 = new common.Http({ response, request: request4, sign, secret, alert: message.error, headers: { token: 'scrm-base-e2d4f962-4ca3-4044-83e7-01ba314d8e3d-rop' } }) // Vue.prototype.$http4 = new common.Http({ response, request: request4, sign, secret, alert: message.error, headers: { token: 'scrm-base-e2d4f962-4ca3-4044-83e7-01ba314d8e3d-rop' } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: "mini-14eda653-4284-4165-bb85-325bb82a516d-rop" } }) // Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: "mini-14eda653-4284-4165-bb85-325bb82a516d-rop" } })
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.$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.prototype.$setGlobalState = globalState.actions.setGlobalState
//Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) //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) const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData) routes = getRoutes(routesData)
// { name, id, } // { name, id, }
subscribe({ messenger }) subscribe({ messenger })
Vue.use(GLButton, { routes, routerBase }) Vue.use(GLButton, { routes, routerBase })
} }
export async function mount(props) { export async function mount(props) {
const insts = render(props.routerBase, routes) const insts = render(props.routerBase, routes)
router = insts.router router = insts.router
instance = insts.vm instance = insts.vm
} }
export async function unmount() { export async function unmount() {
instance.$destroy() instance.$destroy()
instance.$el.innerHTML = '' instance.$el.innerHTML = ''
instance = null instance = null
router = null router = null
} }
function subscribe({ messenger }) { function subscribe({ messenger }) {
messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
\ No newline at end of file \ No newline at end of file
messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
@import './variables.scss'; @import "./variables.scss";
@import './common.scss'; @import "./common.scss";
@import './resetelement.scss'; @import "./resetelement.scss";
body, body,
html { html {
width: 100%; width: 100%;
...@@ -34,10 +34,10 @@ button { ...@@ -34,10 +34,10 @@ button {
// 子系统不设外边距 // 子系统不设外边距
.scrm-sub-client-container { .scrm-sub-client-container {
padding: 0 20px 20px 40px; // padding: 0 20px 20px 40px;
box-sizing: border-box; box-sizing: border-box;
} }
.el-table .cell { .el-table .cell {
// line-height: 20px!important; // line-height: 20px!important;
}
\ No newline at end of file \ No newline at end of file
}
//过滤器 //过滤器
/* eslint-disable */ /* eslint-disable */
const overThousandFilter = (val) => { import Vue from 'vue'
if(typeof(val)!='number'){ const overThousandFilter = val => {
return false; if (typeof val != 'number') {
} return false
if (val < 1000) return val; }
let a = val + ""; if (val < 1000) return val
let b = a.split(""); let a = val + ''
b.splice(-3, 0, ","); let b = a.split('')
return b.join(""); b.splice(-3, 0, ',')
}; return b.join('')
//来源 value值转为对应label(来源) }
const toLabel=(value)=> { //来源 value值转为对应label(来源)
if (value!==0 && !value) { const toLabel = value => {
return if (value !== 0 && !value) {
} return
let sourceList=JSON.parse(window.localStorage.getItem('sourceList')); }
let curElement =sourceList.find(item => { let sourceList = JSON.parse(window.localStorage.getItem('sourceList'))
return item.value === value let curElement = sourceList.find(item => {
}) return item.value === value
})
return curElement.label
} return curElement.label
}
const tagType = value => {
let type = ''
if (JSON.parse(sessionStorage.getItem('SCRM_BASE_SESSION')).merchantModel == 1) {
type = '集团'
} else {
type = '企业'
}
return type
}
export default { export default {
overThousandFilter, overThousandFilter,
toLabel toLabel,
}; tagType
}
export function debounce(fn, delay, triggerNow) { export function debounce(fn, delay, triggerNow) {
var t = null; var t = null
console.log('ceshi') console.log('ceshi')
var debounced = function(){ var debounced = function() {
var _self = this, var _self = this,
args = arguments; args = arguments
if(t){ if (t) {
clearTimeout(t); clearTimeout(t)
} }
if(triggerNow){ if (triggerNow) {
var exec = !t; var exec = !t
t = setTimeout(function(){
t = null;
}, delay);
if(exec){ t = setTimeout(function() {
// 初次进来 t = null
fn.apply(_self, args); }, delay)
}
}else{ if (exec) {
t = setTimeout(function(){ // 初次进来
fn.apply(_self, args); fn.apply(_self, args)
}, delay);
} }
} else {
t = setTimeout(function() {
fn.apply(_self, args)
}, delay)
}
} }
debounced.remove = function(){ debounced.remove = function() {
clearTimeout(t); clearTimeout(t)
t = null; t = null
} }
return debounced; return debounced
} }
//格式化日期 //格式化日期
export const formatDate = (date, fmt) => { export const formatDate = (date, fmt) => {
  if (!date) { if (!date) {
    date = new Date(); date = new Date()
  } }
  let o = {
    "M+": date.getMonth() + 1, //月份
    "d+": date.getDate(), //日
    "h+": date.getHours(), //小时
    "m+": date.getMinutes(), //分
    "s+": date.getSeconds(), //秒
    "q+": Math.floor((date.getMonth() + 3) / 3), //季度
    S: date.getMilliseconds(), //毫秒  1-3 位  只能一位占位符
    "U+": date.getMilliseconds() //毫秒   可以1-3位占位符
  };
  fmt = fmt || "yyyy-MM-dd hh:mm";
  if (/(y+)/.test(fmt))
    fmt = fmt.replace(
      RegExp.$1,
      (date.getFullYear() + "").substr(4 - RegExp.$1.length)
    );
  for (let k in o)
    if (new RegExp("(" + k + ")").test(fmt))
      fmt = fmt.replace(
        RegExp.$1,
        RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
      );
  return fmt;
};
let o = {
'M+': date.getMonth() + 1, //月份
'd+': date.getDate(), //日
'h+': date.getHours(), //小时
'm+': date.getMinutes(), //分
's+': date.getSeconds(), //秒
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
S: date.getMilliseconds(), //毫秒  1-3 位  只能一位占位符
'U+': date.getMilliseconds() //毫秒   可以1-3位占位符
}
fmt = fmt || 'yyyy-MM-dd hh:mm'
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
for (let k in o) if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
return fmt
}
//正则表示式是干什么的? 字符串匹配利器(难,规则多) //正则表示式是干什么的? 字符串匹配利器(难,规则多)
export function formatDate2(date, fmt) { export function formatDate2(date, fmt) {
//1.获取年份 //1.获取年份
if (/(y+)/.test(fmt)) { if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
} }
//2.获取 //2.获取
//M+ ->正则表达式一个规则 //M+ ->正则表达式一个规则
...@@ -79,16 +69,16 @@ export function formatDate2(date, fmt) { ...@@ -79,16 +69,16 @@ export function formatDate2(date, fmt) {
'h+': date.getHours(), 'h+': date.getHours(),
'm+': date.getMinutes(), 'm+': date.getMinutes(),
's+': date.getSeconds() 's+': date.getSeconds()
}; }
for (let k in o) { for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) { if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + ''; let str = o[k] + ''
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str)); fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : padLeftZero(str))
} }
} }
return fmt; return fmt
}; }
//填补左边的零(一般返回字符串最后两位) //填补左边的零(一般返回字符串最后两位)
function padLeftZero (str) { function padLeftZero(str) {
return ('00' + str).substr(str.length); return ('00' + str).substr(str.length)
}; }
import { Message } from 'element-ui' import { Message } from 'element-ui'
let util = {} let util = {}
util.cloneText = function (message) { util.cloneText = function(message) {
let input = document.createElement('input') let input = document.createElement('input')
input.value = message input.value = message
document.body.appendChild(input) document.body.appendChild(input)
input.select() input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy') input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input) document.body.removeChild(input)
Message.success('复制成功') Message.success('复制成功')
} }
util.getBeforeDate = function (sign = '-') { util.getBeforeDate = function(sign = '-') {
let day = new Date(); let day = new Date()
let month = day.getMonth() + 1; let month = day.getMonth() + 1
let date = day.getDate(); let date = day.getDate()
if (month < 10) month = '0' + month; if (month < 10) month = '0' + month
if (date < 10) date = '0' + date; if (date < 10) date = '0' + date
var s = day.getFullYear() + sign + month + sign + date; var s = day.getFullYear() + sign + month + sign + date
return s; return s
} }
util.getBeforeMonth = function (days) { util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1; let month = new Date().getMonth() + 1
let year = new Date().getFullYear(); let year = new Date().getFullYear()
let arr = new Array(); let arr = new Array()
for (let i = 0; i < days; i++) { for (let i = 0; i < days; i++) {
if (month <= 0) { if (month <= 0) {
year = year - 1; year = year - 1
month = month + 12; month = month + 12
}
if (month < 10) month = '0' + month;
arr[i] = year + '年' + month + '月'
month--
} }
return arr; if (month < 10) month = '0' + month
arr[i] = year + '年' + month + '月'
month--
}
return arr
} }
/** /**
* 格式化时间 * 格式化时间
* @param {Array} time * @param {Array} time
*/ */
util.formatTime = function (time) { util.formatTime = function(time) {
return { return {
startTime: time ? time[0] + ' ' + '00:00:00' : '', startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : '' endTime: time ? time[1] + ' ' + '23:59:59' : ''
} }
} }
util.tringToDate = function (dateStr, separator) { util.tringToDate = function(dateStr, separator) {
if (!separator) { if (!separator) {
separator = "-"; separator = '-'
} }
var dateArr = dateStr.split(separator); var dateArr = dateStr.split(separator)
var year = parseInt(dateArr[0]); var year = parseInt(dateArr[0])
var month; var month
//处理月份为04这样的情况 //处理月份为04这样的情况
if (dateArr[1].indexOf("0") == 0) { if (dateArr[1].indexOf('0') == 0) {
month = parseInt(dateArr[1].substring(1)); month = parseInt(dateArr[1].substring(1))
} else { } else {
month = parseInt(dateArr[1]); month = parseInt(dateArr[1])
} }
var day = parseInt(dateArr[2]); var day = parseInt(dateArr[2])
var date = new Date(year, month - 1, day); var date = new Date(year, month - 1, day)
return date; return date
} }
util.getDay = function (num, str = '-') { util.getDay = function(num, str = '-') {
var today = new Date(); var today = new Date()
var nowTime = today.getTime(); var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * num; var ms = 24 * 3600 * 1000 * num
today.setTime(parseInt(nowTime + ms)); today.setTime(parseInt(nowTime + ms))
var oYear = today.getFullYear(); var oYear = today.getFullYear()
var oMoth = (today.getMonth() + 1).toString(); var oMoth = (today.getMonth() + 1).toString()
if (oMoth.length <= 1) oMoth = '0' + oMoth; if (oMoth.length <= 1) oMoth = '0' + oMoth
var oDay = today.getDate().toString(); var oDay = today.getDate().toString()
if (oDay.length <= 1) oDay = '0' + oDay; if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay; return oYear + str + oMoth + str + oDay
} }
util.openUrl = function (url) { util.openUrl = function(url) {
const link = document.createElement('a') const link = document.createElement('a')
link.href = url link.href = url
link.target = '_blank' link.target = '_blank'
link.rel = 'opener' link.rel = 'opener'
link.click() link.click()
}
util.debounce = function(fn, timer) {
var t = null
return function() {
if (t) {
clearTimeout(t)
}
t = setTimeout(() => {
fn.apply(this, arguments)
}, timer)
}
} }
util.downloadIamge = function (imgsrc, name = new Date().getTime()) { util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名 //下载图片地址和图片名
var image = new Image(); var image = new Image()
// 解决跨域 Canvas 污染问题 // 解决跨域 Canvas 污染问题
image.setAttribute("crossOrigin", "anonymous"); image.setAttribute('crossOrigin', 'anonymous')
image.onload = function () { image.onload = function() {
var canvas = document.createElement("canvas"); var canvas = document.createElement('canvas')
canvas.width = image.width; canvas.width = image.width
canvas.height = image.height; canvas.height = image.height
var context = canvas.getContext("2d"); var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height); context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据 var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement("a"); // 生成一个a元素 var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent("click"); // 创建一个单击事件 var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || "photo"; // 设置图片名称 a.download = name || 'photo' // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性 a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件 a.dispatchEvent(event) // 触发a的单击事件
}; }
image.src = imgsrc; image.src = imgsrc
} }
export default util
\ No newline at end of file \ No newline at end of file
export default util
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<div class="back color-58 font-14" @click="goBack">返回人群管理</div> <div class="back color-58 font-14" @click="goBack">返回人群管理</div>
</div> </div>
<div class="main-container"> <div class="main-container">
<GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="tagsPartFormList" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="main-container-head flex-between"> <div class="main-container-head flex-between">
<div class="main-container-head-title color-3 font-20"> <div class="main-container-head-title color-3 font-20">
全部客户 全部客户
...@@ -56,6 +57,9 @@ ...@@ -56,6 +57,9 @@
</span> </span>
</div> </div>
</div> </div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="goDetail(scope.scope)" class="blue-text">详情</el-button>
</div>
</GLTable> </GLTable>
</div> </div>
</div> </div>
...@@ -63,6 +67,7 @@ ...@@ -63,6 +67,7 @@
<script> <script>
import { getCustomerList, getcrowdManageList, customerClusterListExport } from '@/api/modules/clientDataOverview' import { getCustomerList, getcrowdManageList, customerClusterListExport } from '@/api/modules/clientDataOverview'
import { getStaffList } from '@/api/modules/clientManage'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
export default { export default {
name: 'group', name: 'group',
...@@ -70,7 +75,58 @@ export default { ...@@ -70,7 +75,58 @@ export default {
return { return {
getListApi: this.$route.params.crowdType ? getcrowdManageList : getCustomerList, getListApi: this.$route.params.crowdType ? getcrowdManageList : getCustomerList,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableSearchForm: {}, tableSearchForm: {
customerPhone: '',
nickName: '',
customerName: '',
followStaff: '',
audi: '',
carNumber: '',
isJoin: ''
},
tagsPartFormList: [
{
type: 'select',
name: 'followStaff',
optionId: 'value',
optionLabel: 'label',
optionList: [],
label: '跟进员工'
},
{
type: 'input',
name: 'customerPhone',
label: '联系电话'
},
{
type: 'input',
name: 'nickName',
label: '企微名称'
},
{
type: 'input',
name: 'customerName',
label: '客户名称'
},
{
type: 'select',
name: 'isJoin',
label: '是否加企微',
optionId: 'value',
optionLabel: 'label',
placeholder: '请选择',
optionList: [
{
value: '1',
label: '是'
},
{
value: '0',
label: '否'
}
]
}
],
crowdForm: {}, crowdForm: {},
id: this.$route.params.id ? this.$route.params.id : '', id: this.$route.params.id ? this.$route.params.id : '',
crowdType: this.$route.params.crowdType ? this.$route.params.crowdType : '', crowdType: this.$route.params.crowdType ? this.$route.params.crowdType : '',
...@@ -102,7 +158,7 @@ export default { ...@@ -102,7 +158,7 @@ export default {
minWidth: 120 minWidth: 120
}, },
{ {
label: '车架号(后6位)', label: '车架号',
prop: 'carVin', prop: 'carVin',
minWidth: 140 minWidth: 140
}, },
...@@ -123,9 +179,21 @@ export default { ...@@ -123,9 +179,21 @@ export default {
width: 130 width: 130
}, },
{ {
label: '购车时间',
prop: 'addTime',
width: 110
},
{
label: '添加时间', label: '添加时间',
prop: 'addTime', prop: 'addTime',
width: 150 width: 110
},
{
label: '操作',
prop: 'optionBtns',
width: '100px',
addHtml: 'optionBtns',
fixed: 'right'
} }
] ]
}, },
...@@ -137,7 +205,42 @@ export default { ...@@ -137,7 +205,42 @@ export default {
let { id } = this let { id } = this
this.init(id) this.init(id)
}, },
mounted() {
this.getStaffList()
},
methods: { methods: {
//获取跟进员工
getStaffList() {
getStaffList({}).then(res => {
if (res.length == 0) {
return ''
}
const id = this.tagsPartFormList.findIndex(item => {
return item.name == 'followStaff'
})
const staff = res.map(item => {
return {
label: item.staffName,
value: item.staffName
}
})
staff.unshift({ label: '全部', value: '' })
this.$nextTick(() => {
this.tagsPartFormList[id].optionList = staff
})
console.log(this.tagsPartFormList[id])
})
},
handleSearch() {
this.$refs.groupRef.refreshTable()
},
handleReset() {
this.tableSearchForm = {
crowdId: this.id
}
this.$refs.groupRef.refreshTable()
},
init(id) { init(id) {
this.tableSearchForm = { this.tableSearchForm = {
crowdId: id crowdId: id
...@@ -148,6 +251,9 @@ export default { ...@@ -148,6 +251,9 @@ export default {
} }
// this.getTotalCount() // this.getTotalCount()
}, },
goDetail(scope) {
this.$router.push('/clientManage/clientDetail?id=' + scope.oneId)
},
getCrowdDetails() { getCrowdDetails() {
let params = { let params = {
'req.crowdId': this.id 'req.crowdId': this.id
......
...@@ -52,10 +52,10 @@ ...@@ -52,10 +52,10 @@
</div> </div>
</div> </div>
<template v-if="currentIndex == 0"> <template v-if="currentIndex == 0">
<client ref="childComp" :url="url" @goDetail="goDetail" ></client> <client ref="childComp" :url="url" @goDetail="goDetail"></client>
</template> </template>
<template v-if="currentIndex == 1"> <template v-if="currentIndex == 1">
<follow-employee ref="childComp" :url="url" ></follow-employee> <follow-employee ref="childComp" :url="url"></follow-employee>
</template> </template>
<template v-if="currentIndex == 2"> <template v-if="currentIndex == 2">
<leave-group-client ref="childComp" :url="url" @goDetail="goDetail"></leave-group-client> <leave-group-client ref="childComp" :url="url" @goDetail="goDetail"></leave-group-client>
...@@ -147,16 +147,16 @@ export default { ...@@ -147,16 +147,16 @@ export default {
this.currentIndex = index this.currentIndex = index
}, },
async getTableDetail(id = this.$route.query.id) { async getTableDetail(id = this.$route.query.id) {
const res = await getTableDetail({ id: id,pageNum:1,pageSize:10 }) const res = await getTableDetail({ id: id, pageNum: 1, pageSize: 10 })
console.log('获取客户群数据', res) console.log('获取客户群数据', res)
if (!res) { if (!res) {
return false return false
} }
this.leftPanelList = res this.leftPanelList = res
this.$set(this.titles[0], 'personNum', res.allCount) this.$set(this.titles[0], 'personNum', res.allCount)
this.$set(this.titles[1], 'personNum', res.staffCount) this.$set(this.titles[1], 'personNum', res.staffCount)
this.$set(this.titles[2], 'personNum', res.quitCount) this.$set(this.titles[2], 'personNum', res.quitCount)
this.$set(this.titles[3], 'personNum', res.potentialCount) this.$set(this.titles[3], 'personNum', res.potentialCount)
}, },
goBack() { goBack() {
...@@ -235,7 +235,7 @@ export default { ...@@ -235,7 +235,7 @@ export default {
.leftWrap { .leftWrap {
width: 240px; width: 240px;
// height: 877px; // height: 877px;
min-height: 270px; //calc(100vh - 92px); min-height: 370px; //calc(100vh - 92px);
background-color: #fff; background-color: #fff;
box-sizing: border-box; box-sizing: border-box;
.avator { .avator {
...@@ -344,7 +344,7 @@ export default { ...@@ -344,7 +344,7 @@ export default {
} }
} }
} }
/deep/ .el-dialog__header { /deep/ .el-dialog__header {
border: 0; border: 0;
} }
/deep/ .el-dialog__body { /deep/ .el-dialog__body {
......
...@@ -376,7 +376,6 @@ export default { ...@@ -376,7 +376,6 @@ export default {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
} }
} }
/deep/ .el-button { /deep/ .el-button {
color: #5850ff; color: #5850ff;
......
<template> <template>
<div class="scrm-sub-client-container"> <div class="scrm-sub-client-container">
<div class="container"> <div class="container" v-loading="loading">
<div class="leftWrap"> <div class="leftWrap">
<div class="avatorStyle"> <div class="avatorStyle">
<div class="avator"> <div class="avator">
...@@ -46,7 +46,17 @@ ...@@ -46,7 +46,17 @@
</div> </div>
<p> <p>
<span>联系电话:</span> <span>联系电话:</span>
<span class="ellipsis-1">{{ leftPanelInfo.customerPhone }}</span> <span class="ellipsis-1" v-if="leftPanelInfo.customerPhone">{{ leftPanelInfo.customerPhone }}</span>
<span
class="phone-fill"
v-else
@click="
phoneVisible = true
contactPhone = ''
"
>
待完善
</span>
</p> </p>
<p> <p>
<span>证件号码:</span> <span>证件号码:</span>
...@@ -225,11 +235,17 @@ ...@@ -225,11 +235,17 @@
<el-button type="primary" @click="goBack">返回</el-button> <el-button type="primary" @click="goBack">返回</el-button>
</div> </div>
</div> </div>
<basic-dialog class="phone-fill-box" title="添加联系电话" :isVisible="phoneVisible" @confirmDialog="phoneConfirmDialog" @closeDialog="phoneVisible = false">
<div class="dialog-form">
<label>联系电话:</label>
<el-input v-model.trim="contactPhone" size="small" placeholder="请输入11位的手机号" maxlength="11"></el-input>
</div>
</basic-dialog>
<basic-dialog class="tags" :title="tagsDialogTitle" :width="'712px'" :isDestroyClose="true" :btnLoading="sloading" :isShowThirdBtn="true" :isShowCloseBtn="true" @btnEvent="goNewTag" :isVisible="tagsVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose"> <basic-dialog class="tags" :title="tagsDialogTitle" :width="'712px'" :isDestroyClose="true" :btnLoading="sloading" :isShowThirdBtn="true" :isShowCloseBtn="true" @btnEvent="goNewTag" :isVisible="tagsVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<slot> <slot>
<p class="hint-text color-6"> <p class="hint-text color-6">
<span class="color-3">说明:</span> <span class="color-3">说明:</span>
仅支持企业标签 仅支持{{ '企业' | tagType }}标签
<span v-if="merchantModel == 1">和自店标签</span> <span v-if="merchantModel == 1">和自店标签</span>
进行人工维护和设置 进行人工维护和设置
</p> </p>
...@@ -263,7 +279,7 @@ ...@@ -263,7 +279,7 @@
</template> </template>
<script> <script>
import { getAllTagTree, getSingleClientTag, addSingleClientTag, getTableDetail } from '@/api/modules/clientManage' import { getAllTagTree, getSingleClientTag, addSingleClientTag, getTableDetail, perfectCustomerPhone } from '@/api/modules/clientManage'
import tipPanel from '@/components/tipPanel/index.vue' import tipPanel from '@/components/tipPanel/index.vue'
import url from '@/assets/clientDetail/noDataBox.png' import url from '@/assets/clientDetail/noDataBox.png'
export default { export default {
...@@ -273,10 +289,12 @@ export default { ...@@ -273,10 +289,12 @@ export default {
}, },
data() { data() {
return { return {
contactPhone: '',
isShowBaseInfo: true, isShowBaseInfo: true,
isShowTooltip: false, isShowTooltip: false,
remark: '', remark: '',
sloading: false, sloading: false,
loading: false,
expande: false, //车辆 expande: false, //车辆
deviceExpande: false, //设备 deviceExpande: false, //设备
guaranteeExpande: false, //保单 guaranteeExpande: false, //保单
...@@ -536,7 +554,7 @@ export default { ...@@ -536,7 +554,7 @@ export default {
label: '标签组类型', label: '标签组类型',
prop: 'labelGroupInfo', prop: 'labelGroupInfo',
formatter: cellValue => { formatter: cellValue => {
return cellValue.labelGroupInfo.labelGroupType return cellValue.labelGroupInfo.labelGroupType == '企业标签' && this.$globalState.session.merchantModel == 1 ? '集团标签' : cellValue.labelGroupInfo.labelGroupType
}, },
width: '160' width: '160'
}, },
...@@ -551,7 +569,7 @@ export default { ...@@ -551,7 +569,7 @@ export default {
//弹窗数据 //弹窗数据
tagsDialogTitle: '设置标签', tagsDialogTitle: '设置标签',
tagsVisible: false, tagsVisible: false,
phoneVisible: false,
companyTagsList: [], companyTagsList: [],
ownShopTagsList: [], ownShopTagsList: [],
...@@ -682,8 +700,9 @@ export default { ...@@ -682,8 +700,9 @@ export default {
}) })
}, },
async getPageDetail(id = this.$route.query.id) { async getPageDetail(id = this.$route.query.id) {
this.loading = true
const res = await getTableDetail({ oneId: id }) const res = await getTableDetail({ oneId: id })
this.loading = false
if (!res) { if (!res) {
return false return false
} }
...@@ -714,7 +733,7 @@ export default { ...@@ -714,7 +733,7 @@ export default {
this.$router.push({ path: '/tagsManage/index' }) this.$router.push({ path: '/tagsManage/index' })
}, },
goBack() { goBack() {
this.$router.push({ path: '/clientManage/index' }) this.$router.go(-1)
}, },
//点击添加按钮 //点击添加按钮
...@@ -757,7 +776,7 @@ export default { ...@@ -757,7 +776,7 @@ export default {
}) })
}) })
if (labels.labelType == '企业标签') { if (labels.labelType == '企业标签') {
allTagsList[0].labelType = '企业标签' allTagsList[0].labelType = this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签'
allTagsList[0].children.push(labels) allTagsList[0].children.push(labels)
} else if (labels.labelType == '自店标签') { } else if (labels.labelType == '自店标签') {
allTagsList[1].labelType = '自店标签' allTagsList[1].labelType = '自店标签'
...@@ -776,6 +795,29 @@ export default { ...@@ -776,6 +795,29 @@ export default {
}) })
this.handleClose() this.handleClose()
}, },
phoneConfirmDialog() {
if (!this.contactPhone) {
this.$message.error('请输入联系号码')
return
}
if (!/^1[3456789]\d{9}$/.test(this.contactPhone)) {
this.$message.error('联系电话不符合要求')
return
}
let param = {
pageSize: 1,
pageNum: 1,
customerPhone: this.contactPhone,
userId: this.nickNameList[0].userId
}
perfectCustomerPhone(param).then(res => {
if (res) {
this.getPageDetail()
this.$message.success('设置成功')
}
})
this.phoneVisible = false
},
handleConfirm() { handleConfirm() {
this.sloading = true this.sloading = true
let labelIdAddList = [] // 新增的标签 let labelIdAddList = [] // 新增的标签
...@@ -877,6 +919,22 @@ export default { ...@@ -877,6 +919,22 @@ export default {
.pure-yello-text { .pure-yello-text {
color: #fb8f28; color: #fb8f28;
} }
.phone-fill {
font-size: 14px;
font-weight: 400;
color: #5850ff !important;
line-height: 20px;
text-decoration: underline;
cursor: pointer;
}
.dialog-form {
display: flex;
align-items: center;
padding: 30px;
label {
width: 100px;
}
}
.newStyle { .newStyle {
display: flex; display: flex;
font-size: 14px; font-size: 14px;
......
...@@ -656,7 +656,7 @@ export default { ...@@ -656,7 +656,7 @@ export default {
} }
}, },
destroyed() { destroyed() {
window.removeEventListener('scroll', this.initHeight) window.removeEventListener('scroll', this.initHeight, true)
} }
} }
</script> </script>
...@@ -895,7 +895,7 @@ export default { ...@@ -895,7 +895,7 @@ export default {
width: 100%; width: 100%;
background: #ffffff; background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
z-index:999; z-index: 999;
.el-button:nth-child(2) { .el-button:nth-child(2) {
margin-left: 20px; margin-left: 20px;
} }
......
...@@ -127,6 +127,9 @@ export default { ...@@ -127,6 +127,9 @@ export default {
label: '标签组类型', label: '标签组类型',
prop: 'groupType', prop: 'groupType',
width: 180, width: 180,
formatter: cellValue => {
return cellValue.groupType == '企业标签' && this.$globalState.session.merchantModel == 1 ? '集团标签' : cellValue.groupType
},
align: 'left' align: 'left'
}, },
{ {
......
<template>
<div class="content-wrap" v-loading="loading">
<div class="tree-input">
<el-input placeholder="请输入标签组或标签关键字" v-model="filterText" size="small"><i slot="suffix" class="el-input__icon el-icon-search"></i></el-input>
<span @click="resetTree">重置</span>
</div>
<el-tree @check="checkChange" class="tag-tree" ref="tagTree" :data="labelTree" :props="defaultProps" @node-click="nodeClick" show-checkbox node-key="id" default-expand-all :expand-on-click-node="false" :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }">
<span :class="['tree-node', `node_${data.id}`]">{{ node.label }}</span>
<span v-if="data.labelType && data.labelType != '系统标签' && isShowEditBtn(data.labelDTO)" @click.stop="editTree(data)">
<i class="el-icon-edit-outline"></i>
</span>
</div>
</el-tree>
</div>
</template>
<script>
import { getTableList } from '@/api/modules/tagsManage'
export default {
name: 'tagGroup',
data() {
return {
loading: false,
heightBox: 200,
dialogVisible: false,
filterText: '',
selectNum: 0,
searchStatus: false,
labelTree: [],
defaultProps: {
children: 'children',
label: 'name'
}
}
},
watch: {
filterText(val) {
this.$refs.tagTree.filter(val)
}
},
methods: {
isShowEditBtn(row) {
const { userType, accountLevel, merchantModel } = this.$globalState.session
//集团模式下,只有集团能可以编辑企业,自店,其他只能编辑自店
//单店模式下,仅门店和员工可以编辑
if (row.labelType == '自店标签' && !(merchantModel == 1 && (accountLevel == 2 || accountLevel == 3 || accountLevel == 4))) {
return false
}
if (merchantModel == 1) {
if (accountLevel == 1 && userType == 1) {
return true
}
if (accountLevel !== 1) {
//如果是企业标签不显示
if (row.labelType == '企业标签' || row.labelType == '集团标签') {
return false
}
return true
}
}
return true //门店版都显示编辑按钮
},
nodeClick(data) {
!data.sort && document.querySelector(`.node_${data.id}`).parentElement.previousElementSibling.click()
},
handleScroll(height) {
document.querySelector('.tag-tree').scrollTop = height
},
resetTree() {
this.$refs.tagTree.setCheckedKeys([])
this.$nextTick(() => {
this.$emit('getCheckItem', this.$refs.tagTree)
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
//勾选
checkChange() {
this.$emit('getCheckItem', this.$refs.tagTree)
},
getTreeNode(item) {
let tree_id = []
item.forEach(group_item => {
group_item.children.forEach(label_item => {
label_item && tree_id.push(label_item.id)
})
})
this.$refs.tagTree.setCheckedKeys(tree_id)
},
editTree(data) {
this.$emit('editTag', 'edit', data.labelDTO)
},
updateTreeNode() {
this.getTreeNode(this.$parent.tagCheckItem)
this.$emit('getCheckItem', this.$refs.tagTree)
},
// 获取标签树
getTableList(status) {
this.labelTree = []
let params = {
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.filterText,
edition: this.$globalState.session.merchantModel
}
}
this.loading = true
getTableList(params).then(res => {
const labelTreeRets = res.labelTreeRets.map(item => {
return {
id: item.labelGroup.id,
name: item.labelGroup.name,
children: item.labelList,
labelType: item.labelType == '企业标签' && this.$globalState.session.merchantModel == 1 ? '集团标签' : item.labelType,
labelDTO: item
}
})
const labelType = this.$globalState.session.merchantModel == 1 ? '集团标签' : '企业标签'
labelTreeRets.forEach(item => {
const index = this.labelTree.findIndex(ret => ret.name == item.labelType)
if (index == -1) {
this.labelTree.push({
id: item.labelType == '系统标签' ? 1 : item.labelType == labelType ? 2 : 3,
name: item.labelType,
children: [item],
sort: item.labelType == '系统标签' ? 1 : item.labelType == labelType ? 2 : 3
})
} else {
this.labelTree[index].children.push(item)
}
})
this.labelTree = this.labelTree.sort((a, b) => a.sort - b.sort)
this.$nextTick(() => {
status && this.updateTreeNode()
})
this.loading = false
})
}
},
mounted() {
this.getTableList()
}
}
</script>
<style lang="scss" scoped>
.content-wrap {
padding: 16px 10px 16px 16px;
box-sizing: border-box;
height: 100%;
.tree-input {
display: flex;
align-items: center;
span {
display: inline-block;
color: #5850ff;
font-size: 14px;
width: 40px;
margin-left: 6px;
cursor: pointer;
}
}
.tag-tree {
margin-top: 20px;
height: calc(100% - 80px);
overflow-y: auto;
/deep/ {
.el-tree-node {
.el-tree-node__content {
height: 30px;
> .el-checkbox {
display: none;
}
}
}
.el-tree-node__children {
.el-tree-node__content {
.el-checkbox {
display: block;
}
}
}
.custom-tree-node {
font-size: 14px;
color: #333;
}
.tree-node {
width: 140px;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.el-tree-node__expand-icon {
font-size: 15px;
margin-top: -2px;
color: #000000;
}
.el-tree-node__expand-icon.is-leaf {
color: transparent;
}
.el-checkbox__inner {
margin-right: 10px;
}
.el-icon-edit-outline {
color: #5850ff;
font-size: 15px;
cursor: pointer;
}
}
}
}
</style>
...@@ -8,99 +8,92 @@ const baseUrl = '/' ...@@ -8,99 +8,92 @@ const baseUrl = '/'
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/' const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = { const cdn = {
css: [ css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css` js: [
], `${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`,
js: [ `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`,
`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`,
`${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`,
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, // `${CDN_DOMAIN}ajax/libs/axios/0.21.0/axios.min.js`,
`${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`
// `${CDN_DOMAIN}ajax/libs/axios/0.21.0/axios.min.js`, ]
`${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`
]
} }
module.exports = { module.exports = {
outputDir: `../dist/${packageName}`, outputDir: `../dist/${packageName}`,
publicPath,//node_env ? baseUrl : '/' publicPath, //node_env ? baseUrl : '/'
assetsDir: 'static', assetsDir: 'static',
configureWebpack: { configureWebpack: {
resolve: { resolve: {
alias: { alias: {
'@': resolve('src'), '@': resolve('src'),
assets: resolve('src/assets'), assets: resolve('src/assets'),
views: resolve('src/views'), views: resolve('src/views'),
components: resolve('src/components'), components: resolve('src/components')
// 'jquery': 'jquery' // 'jquery': 'jquery'
} }
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery', // 创建 '$'、'jQuery'、'window.jQuery' 三个变量指向依赖jquery
jQuery: 'jquery',
'window.jQuery': 'jquery'
})
],
output: {
library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}`
},
externals: {
'vue': 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios',
'echarts': 'echarts'
}
}, },
plugins: [
new webpack.ProvidePlugin({
devServer: { $: 'jquery', // 创建 '$'、'jQuery'、'window.jQuery' 三个变量指向依赖jquery
hot: true, jQuery: 'jquery',
disableHostCheck: true, 'window.jQuery': 'jquery'
host: process.env.VUE_APP_HOST, })
port: process.env.VUE_APP_PORT, ],
headers: { output: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头 library: `${packageName}-[name]`,
}, libraryTarget: 'umd', // 把微应用打包成 umd 库格式
// proxy: {     jsonpFunction: `webpackJsonp_${packageName}`
// '/api': {        
// target: 'http://rop-merchant.test.glsx.com.cn',
//         
// changeOrigin: true,
//         
// pathRewrite: {            
// '^/api': '/'        
// }    
// },
// },
}, },
chainWebpack: config => { externals: {
config.plugin('html') vue: 'Vue',
.tap(args => { 'element-ui': 'ELEMENT',
// args[0].minify.removeComments = false; 'vue-router': 'VueRouter',
args[0].cdn = cdn vuex: 'Vuex',
return args axios: 'axios',
}) echarts: 'echarts'
config.plugins.delete('preload') // TODO: need test }
config.plugins.delete('prefetch') // TODO: need test },
config.module
.rule('fonts') devServer: {
.test(/.(ttf|otf|eot|woff|woff2)$/) hot: true,
.use('url-loader') disableHostCheck: true,
.loader('url-loader') host: process.env.VUE_APP_HOST,
.tap(options => { port: process.env.VUE_APP_PORT,
options = { headers: {
// limit: 10000, 'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
} }
}
\ No newline at end of file \ No newline at end of file
// proxy: {
// '/api': {
// target: 'http://rop-merchant.test.glsx.com.cn',
//
// changeOrigin: true,
//
// pathRewrite: {
// '^/api': '/'
// }
// },
// },
},
chainWebpack: config => {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.module
.rule('fonts')
.test(/.(ttf|otf|eot|woff|woff2)$/)
.use('url-loader')
.loader('url-loader')
.tap(options => {
options = {
// limit: 10000,
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!