Commit 6e2066a3 by xinla

合并release开源部分

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