Commit 6e2066a3 by xinla

合并release开源部分

1 parent 95abc7ae
// import { request } from '@/utils/request' // import { requestOpen } from '@/utils/request'
// const { get, post, put, del: _del } = request // const { get, post, put, del: _del } = requestOpen
// const serve = '/serve'
// /** // /**
// * 列表 // * 列表
// * @param {*} data // * @param {*} data
// */ // */
// export function getList(data) { // export function getList(data) {
// get(service + '/statistic', data) // return get(`${serve}/get/${id}`)
// } // }
// // 详情 // // 详情
...@@ -15,7 +17,7 @@ ...@@ -15,7 +17,7 @@
// // 删除 // // 删除
// export function del(id) { // export function del(id) {
// return _del(service + '/delete/' + id) // return _del(`${serve}/delete/${id}`)
// } // }
// /** // /**
...@@ -24,12 +26,12 @@ ...@@ -24,12 +26,12 @@
// * @returns // * @returns
// */ // */
// export function add(data) { // export function add(data) {
// return post(service + '/add', data) // return post(`${serve}/add`, data)
// } // }
// // 修改 // // 修改
// export function update(data) { // export function update(data) {
// return put(service + '/update/' + id, data) // return put(`${serve}/update`, data)
// } // }
import { decryptAES } from '@/utils/jsencrypt' import { decryptAES } from '@/utils/jsencrypt'
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
</keep-alive> </keep-alive>
</transition> </transition>
</router-view> </router-view>
<div v-loading="loading" class="micro-app-wrap height100" v-show="isActiveMicroApp"> <div v-loading="loading" class="micro-app-wrap h100" v-show="isActiveMicroApp">
<div id="micro-app" class="height100"></div> <div id="micro-app" class="h100"></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -61,14 +61,12 @@ export default { ...@@ -61,14 +61,12 @@ export default {
// start({ // start({
// sandbox: { experimentalStyleIsolation: true }, // sandbox: { experimentalStyleIsolation: true },
// }) // })
// // 挂在window供下面微服务使用 // // 挂在window供下面微服务使用
// window.lwConfig.$store = { // window.lwConfig.$store = {
// dispatch: (_, s) => { // dispatch: (_, s) => {
// this.$store.setBusininessDesc(s) // this.$store.setBusininessDesc(s)
// }, // },
// } // }
// // 初始化 state // // 初始化 state
// // const actions = initGlobalState({ token: getToken() }) // // const actions = initGlobalState({ token: getToken() })
// // actions.onGlobalStateChange((state, prev) => { // // actions.onGlobalStateChange((state, prev) => {
......
...@@ -13,19 +13,10 @@ ...@@ -13,19 +13,10 @@
:key="route.path + index" :key="route.path + index"
:item="route" :item="route"
level="1" level="1"
:base-path="route.path" /> :base-path="resolvePath(route.path)" />
</el-menu> </el-menu>
</el-scrollbar> </el-scrollbar>
<div class="serve-card" @click="$refs.serveDialog.$data.dialogVisible = true">
LinkWeChat
<br />
官方服务包
<br />
正式上线啦!
</div>
<ServeDialog ref="serveDialog" />
<div class="card"> <div class="card">
<el-tooltip content="文档手册" effect="dark" placement="top"> <el-tooltip content="文档手册" effect="dark" placement="top">
<div class="card-item"> <div class="card-item">
...@@ -79,14 +70,15 @@ ...@@ -79,14 +70,15 @@
</template> </template>
<script> <script>
import path from 'path-browserify'
import { mapState } from 'pinia' import { mapState } from 'pinia'
import stores from '@/stores' import stores from '@/stores'
import SidebarItem from './SidebarItem' import SidebarItem from './SidebarItem'
import ServeDialog from './ServeDialog' // import ServeDialog from './ServeDialog'
export default { export default {
components: { SidebarItem, ServeDialog }, components: { SidebarItem },
computed: { computed: {
// ...mapState(['settings']), // ...mapState(['settings']),
...mapState(stores, ['permission_routes', 'sidebarRouters', 'sidebar']), ...mapState(stores, ['permission_routes', 'sidebarRouters', 'sidebar']),
...@@ -115,6 +107,9 @@ export default { ...@@ -115,6 +107,9 @@ export default {
goto(url) { goto(url) {
window.open(url) window.open(url)
}, },
resolvePath(pathStr) {
return path.resolve(this.sidebarRouters.parentRoute.path, pathStr)
},
}, },
} }
</script> </script>
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
// 顶部显示菜单 // 顶部显示菜单
topMenus() { topMenus() {
let topMenus = [] let topMenus = []
this.routers.map((menu) => { this.topbarRouters.map((menu) => {
if (menu.hidden !== true) { if (menu.hidden !== true) {
// 兼容顶部栏一级菜单内部跳转 (you bug) // 兼容顶部栏一级菜单内部跳转 (you bug)
// if (menu.path === '/') { // if (menu.path === '/') {
...@@ -35,8 +35,8 @@ export default { ...@@ -35,8 +35,8 @@ export default {
}) })
return topMenus return topMenus
}, },
routers() { topbarRouters() {
console.log(this.$store.permission.topbarRouters) // console.log(this.$store.permission.topbarRouters)
return this.$store.permission.topbarRouters return this.$store.permission.topbarRouters
}, },
// 激活的/高亮的一级菜单路径 eg:/drainageCode // 激活的/高亮的一级菜单路径 eg:/drainageCode
...@@ -93,10 +93,11 @@ export default { ...@@ -93,10 +93,11 @@ export default {
}, },
// 当前激活的侧边栏菜单 // 当前激活的侧边栏菜单
activeRoutes(path) { activeRoutes(path) {
let activeRoute = this.routers.find((e) => e.path == path) let activeRoute = this.topbarRouters.find((e) => e.path == path)
let routes = (activeRoute && activeRoute.children) || [] let routes = (activeRoute && activeRoute.children) || []
if (routes.length > 0) { if (routes.length > 0) {
this.$store.permission.sidebarRouters = routes this.$store.permission.sidebarRouters = routes
this.$store.permission.sidebarRouters.parentRoute = activeRoute
} }
return routes return routes
}, },
......
/* Layout */ /* Layout */
import { RouterView } from 'vue-router'
import { h } from 'vue'
import Layout from '@/layout/index.vue' import Layout from '@/layout/index.vue'
import visitor from '@/layout/visitor.vue' import visitor from '@/layout/visitor.vue'
const routerView = {
render: () => h(RouterView),
}
/** /**
* Note: 路由配置项 * Note: 路由配置项
* *
...@@ -52,41 +56,98 @@ export let fixedRoutes = [ ...@@ -52,41 +56,98 @@ export let fixedRoutes = [
// }, // },
// ], // ],
// }, // },
]
// 开发环境路由,总后台配置完菜单务必删除或注释,只在开发环境生效
if (process.env.NODE_ENV === 'development' || process.env.VUE_APP_ENV === 'development') {
let devRoutes = [
{
path: '/dev',
component: Layout,
redirect: '/dev/saleInsight',
meta: {
title: '开发菜单',
},
children: [
// { // {
// path: '/drainageCode/customerService', // path: '/dev/saleInsight',
// component: Layout, // component: routerView,
// hidden: true, // redirect: '/dev/saleInsight/clueAnalysis',
// meta: { // meta: {
// title: '客服管理', // title: '销售洞察',
// }, // },
// children: [ // children: [
// { // {
// path: 'add', // path: 'clueAnalysis',
// name: 'service-add', // component: () => import('@/views/clue/clueAnalysis/index'),
// component: () => import('@/views/customerService/customerServiceManage/add'),
// meta: { // meta: {
// title: '新建客服', // title: '线索分析',
// activeMenu: '/drainageCode/customerService/index',
// breadcrumb: true,
// }, // },
// }, // },
// ],
// },
// {
// path: '/dev/privateIncubation',
// component: routerView,
// meta: {
// title: '私域孵化',
// },
// children: [
// {
// path: 'clueHighseas',
// component: routerView,
// redirect: '/dev/privateIncubation/clueHighseas/index',
// meta: {
// title: '线索公海',
// },
// children: [
// { // {
// path: 'detail', // path: 'index',
// name: 'service-add-detail', // hidden: true,
// component: () => import('@/views/customerService/customerServiceManage/detail'), // component: () => import('@/views/clue/clueHighseas/index'),
// meta: { // meta: {
// title: '客服详情', // title: '',
// activeMenu: '/drainageCode/customerService/index', // },
// breadcrumb: true, // },
// {
// path: 'addEdit',
// hidden: true,
// component: () => import('@/views/clue/clueHighseas/addEdit'),
// meta: {
// title: '新建公海',
// },
// },
// {
// path: 'highseasStatistics',
// hidden: true,
// component: () => import('@/views/clue/clueHighseas/highseasStatistics'),
// meta: {
// title: '公海统计',
// },
// },
// {
// path: 'clueDetail',
// hidden: true,
// component: () => import('@/views/clue/clueHighseas/clueDetail'),
// meta: {
// title: '客户详情',
// }, // },
// }, // },
// ], // ],
// }, // },
] // {
// path: 'clueTemplate',
// 开发环境路由,总后台配置完菜单务必删除或注释,只在开发环境生效 // component: () => import('@/views/clue/clueTemplate/index'),
if (process.env.VUE_APP_ENV === 'development') { // meta: {
fixedRoutes = fixedRoutes.concat() // title: '线索模板',
// },
// },
// ],
// },
],
},
]
fixedRoutes = fixedRoutes.concat(devRoutes)
} }
// 公共路由 // 公共路由
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
// color: var(--font-white, #fff); // color: var(--font-white, #fff);
// } // }
// } // }
.el-button { .el-button:not(.el-button--small, .el-button--large) {
padding: 9px 19px; padding: 9px 19px;
} }
.el-button:not(.is-text) { .el-button:not(.is-text) {
...@@ -292,6 +292,7 @@ ...@@ -292,6 +292,7 @@
.el-form-item .el-form-item { .el-form-item .el-form-item {
margin-bottom: 18px; margin-bottom: 18px;
} }
.el-form-item__content { .el-form-item__content {
display: block; display: block;
} }
...@@ -320,6 +321,11 @@ ...@@ -320,6 +321,11 @@
.el-input-number { .el-input-number {
width: 100%; width: 100%;
} }
// 会导致提示信息被滚动隐藏
// .el-form-item:last-child {
// margin-bottom: 0;
// }
} }
// 重置el-form-item hover样式 // 重置el-form-item hover样式
.no-hover-form .el-form-item { .no-hover-form .el-form-item {
......
...@@ -98,24 +98,26 @@ export function selectDictLabels(datas, value, separator) { ...@@ -98,24 +98,26 @@ export function selectDictLabels(datas, value, separator) {
/** /**
* 下载bolb文件 * 下载bolb文件
* @param {*} blob bolo源数据 * @param {*} blob bolo源数据 必需
* @param {*} type 文件类型 * @param {*} type 文件类型 必需
* @param {*} downloadName 下载文件名,需含文件后缀名 * @param {*} downloadName 下载文件名,需含文件后缀名 可选
*/ */
export function downloadBlob(blob, type, downloadName) { export function downloadBlob(blob, downloadName, type) {
if (blob && downloadName) {
const typeDict = { const typeDict = {
excel: 'application/vnd.ms-excel', excel: 'application/vnd.ms-excel',
zip: 'application/zip', zip: 'application/zip',
image: 'application/image', image: 'application/image',
} }
blob = new Blob([blob], { type: typeDict[type] || type }) type && (blob = new Blob([blob], { type: typeDict[type] || type }))
let url = window.URL.createObjectURL(blob) let url = window.URL.createObjectURL(blob)
const a = document.createElement('a') // 创建a标签 const a = document.createElement('a') // 创建a标签
a.href = url a.href = url
a.download = dateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss-') + downloadName // 下载文件名,不能包含英文 : 冒号 a.download = dateFormat(new Date(), 'YYYY-MM-DD HH-mm-ss-') + downloadName // 下载文件名,不能包含英文 : 冒号
a.click() a.click()
a.remove() a.remove()
URL.revokeObjectURL(url) // 释放内存 URL.revokeObjectURL(url) // 释放内存
}
} }
// 通用下载方法 系统内部 // 通用下载方法 系统内部
......
...@@ -8,10 +8,10 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' ...@@ -8,10 +8,10 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// setToken('eyJhbGciOiJIUzUxMiJ9.eyJ0ZW5hbnRfaWQiOjI2LCJ1c2VyX3R5cGUiOiI1IiwidXNlcl9pZCI6MjU5LCJ3ZUFwcFNlY3JldCI6IjY0YjRjNWRiMzg3MjA2Nzc2ZDRmYWJlMjEwNWMwNTc1IiwibG9naW5fdHlwZSI6IkxpbmtXZUNoYXRBUEkiLCJ1c2VyX25hbWUiOiLlp5zpuY_lh68iLCJ1c2VyX2tleSI6ImRmNTdmYzY4LWI2ZTYtNDVmNS04N2UzLWY4YzA5ZTZiNzFiOSIsIndlQXBwSWQiOiJ3eDg2M2MwMzFhNzRmNTg5YTAiLCJjb3JwX25hbWUiOiLku5_lvq7np5HmioAiLCJjb3JwX2lkIjoid3c2MjJmYzg1MmY3OWMzZjEzIn0.X5To1L7fJRBEIxmP6Dvp2XTpvWHwz8Ey6ODAeyk_owlFj_JywVjfpodDk0B7bGjRXE16nNpab0L9f3eF_-WGPQ') // setToken('eyJhbGciOiJIUzUxMiJ9.eyJ0ZW5hbnRfaWQiOjI2LCJ1c2VyX3R5cGUiOiI1IiwidXNlcl9pZCI6MjU5LCJ3ZUFwcFNlY3JldCI6IjY0YjRjNWRiMzg3MjA2Nzc2ZDRmYWJlMjEwNWMwNTc1IiwibG9naW5fdHlwZSI6IkxpbmtXZUNoYXRBUEkiLCJ1c2VyX25hbWUiOiLlp5zpuY_lh68iLCJ1c2VyX2tleSI6ImRmNTdmYzY4LWI2ZTYtNDVmNS04N2UzLWY4YzA5ZTZiNzFiOSIsIndlQXBwSWQiOiJ3eDg2M2MwMzFhNzRmNTg5YTAiLCJjb3JwX25hbWUiOiLku5_lvq7np5HmioAiLCJjb3JwX2lkIjoid3c2MjJmYzg1MmY3OWMzZjEzIn0.X5To1L7fJRBEIxmP6Dvp2XTpvWHwz8Ey6ODAeyk_owlFj_JywVjfpodDk0B7bGjRXE16nNpab0L9f3eF_-WGPQ')
// 创建axios实例 // 创建axios实例
function requestFactory(baseURL) { function requestFactory(getway = '') {
const service = axios.create({ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分 // axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: process.env.NODE_ENV === 'development' ? '/api' : baseURL, baseURL: (process.env.NODE_ENV === 'development' ? '/api' : window.lwConfig.BASE_API) + getway,
// 超时 // 超时
timeout: 100000, timeout: 100000,
}) })
...@@ -112,7 +112,7 @@ function requestFactory(baseURL) { ...@@ -112,7 +112,7 @@ function requestFactory(baseURL) {
return put(url, data, config) return put(url, data, config)
} }
let del = service.del let del = service.delete
service.del = (url, params, config = {}) => { service.del = (url, params, config = {}) => {
return del(url, { params, ...config }) return del(url, { params, ...config })
} }
...@@ -120,4 +120,7 @@ function requestFactory(baseURL) { ...@@ -120,4 +120,7 @@ function requestFactory(baseURL) {
return service return service
} }
export default requestFactory(window.lwConfig.BASE_API) // 创建常用网关接口请求
export const requestOpen = requestFactory(window.lwConfig.services.wecom)
export default requestFactory()
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!