Commit 0c6ff6c8 by 前端

Merge branch 'SAAS+V5.7.1' into 'master'

上线合并

See merge request !2
2 parents 93877bd2 5e7dab3e
...@@ -24,5 +24,5 @@ ...@@ -24,5 +24,5 @@
<% } %> <% } %>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
</html> </html>
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
</div> </div>
</template> </template>
<script> <script>
import { wxConfig } from '@/api'
export default { export default {
name: 'App', name: 'App',
data () { data () {
...@@ -34,7 +35,12 @@ export default { ...@@ -34,7 +35,12 @@ export default {
return this.$store.state.app.showWindow return this.$store.state.app.showWindow
} }
}, },
mounted () { }, mounted () {
wxConfig.init(['hideOptionMenu']).then(res => {
wx.hideOptionMenu()
})
},
methods: {} methods: {}
} }
......
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
*/ */
import ssoApi from './ssoApi' import ssoApi from './ssoApi'
import reportApi from './reportApi' import reportApi from './reportApi'
import wxConfig from './wxConfig'
export { export {
ssoApi, ssoApi,
reportApi, reportApi,
wxConfig,
} }
\ No newline at end of file \ No newline at end of file
...@@ -45,12 +45,12 @@ fetchConfig(!isMock).then(res => { ...@@ -45,12 +45,12 @@ fetchConfig(!isMock).then(res => {
// 设置 js中可以访问 $cdn // 设置 js中可以访问 $cdn
Vue.use(cfg) Vue.use(cfg)
window.$fetchConfig = res window.$fetchConfig = res
// if (res.vconsole) new VConsole() if (res.vconsole) new VConsole()
/**登录过期 重新登录 */ /**登录过期 重新登录 */
window.reLogin = () => { window.reLogin = () => {
util.removeLocalStorage('ww_userInfo') util.removeLocalStorage('ww_userInfo')
util.clearSessionId() util.clearSessionId()
store.dispatch('navigation') store.dispatch('navigation', true)
} }
window.vm = new Vue({ window.vm = new Vue({
el: '#app', el: '#app',
......
...@@ -114,8 +114,9 @@ export default { ...@@ -114,8 +114,9 @@ export default {
}) })
}, },
shareReport () { shareReport () {
const { reportStartDate, reportEndDate, reportType, corpId } = this.query const { reportStartDate, reportEndDate, reportType, corpId } = this.query,
utils.setClipboardData(`${window.location.origin}/#/mobile/report?reportStartDate=${reportStartDate}&reportEndDate=${reportEndDate}&reportType=${reportType}&corpId=${corpId}`, '链接复制成功,快去粘贴吧~') url = window.$fetchConfig.shareReportUrl
utils.setClipboardData(`${url}?reportStartDate=${reportStartDate}&reportEndDate=${reportEndDate}&reportType=${reportType}&corpId=${corpId}`, '链接复制成功,快去粘贴吧~',true)
window.parent.postMessage( window.parent.postMessage(
{ type: 'COPY_SUCCESS' }, { type: 'COPY_SUCCESS' },
'*' '*'
......
export const mobilePages = { export const mobilePages = {
mobile: [ mobile: [
{ {
name: 'settings' name: 'settings',
}, },
{ {
name: 'report', name: 'report',
...@@ -23,6 +23,12 @@ export const mobilePages = { ...@@ -23,6 +23,12 @@ export const mobilePages = {
meta: { meta: {
noAuth: true noAuth: true
} }
},
{
name:'aiWebView',
meta: {
noAuth: true
}
} }
] ]
} }
...@@ -34,6 +34,7 @@ function createRouter () { ...@@ -34,6 +34,7 @@ function createRouter () {
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
const isWxWork = ua.includes('wxwork') const isWxWork = ua.includes('wxwork')
const { devOff } = window.$fetchConfig
store.commit('SET_LAST_PATH', to.name) store.commit('SET_LAST_PATH', to.name)
/* 路由发生变化修改页面title */ /* 路由发生变化修改页面title */
store.dispatch('setPageMeta', to.meta) store.dispatch('setPageMeta', to.meta)
...@@ -45,8 +46,8 @@ router.beforeEach((to, from, next) => { ...@@ -45,8 +46,8 @@ router.beforeEach((to, from, next) => {
store.state.app.showWindow = true store.state.app.showWindow = true
store.dispatch('registerHttp') store.dispatch('registerHttp')
} else { } else {
if (!isWxWork && to.name !== 'notWxWork') return next('/mobile/notWxWork') //上线打开 if (!isWxWork && to.name !== 'notWxWork' && !devOff) return next('/mobile/notWxWork')
store.dispatch('navigation', to) store.dispatch('navigation')
} }
next() next()
}) })
......
...@@ -74,7 +74,8 @@ const actions = { ...@@ -74,7 +74,8 @@ const actions = {
}) })
if (corpInfo) { if (corpInfo) {
const { agentId } = corpInfo const { agentId } = corpInfo
window.location.href = `${loginUrl}?redirect_uri=${encodeURIComponent(window.location.href)}&corpId=${corpId}&agentId=${agentId}&backLoginCode=BACKCODE` // window.location.href = `${loginUrl}?redirect_uri=${encodeURIComponent(window.location.href)}&corpId=${corpId}&agentId=${agentId}&backLoginCode=BACKCODE`
window.location.replace(`${loginUrl}?redirect_uri=${encodeURIComponent(window.location.href)}&corpId=${corpId}&agentId=${agentId}&backLoginCode=BACKCODE`)
} else throw '获取企业信息失败' } else throw '获取企业信息失败'
console.log(corpInfo) console.log(corpInfo)
} }
...@@ -83,7 +84,7 @@ const actions = { ...@@ -83,7 +84,7 @@ const actions = {
if (error) Notify(typeof error === 'string' ? error : error.toString()) if (error) Notify(typeof error === 'string' ? error : error.toString())
} }
}, },
navigation ({ dispatch }, to) { navigation ({ dispatch }, isReLogin) {
let { corpId, sessionId } = getParams(), let { corpId, sessionId } = getParams(),
userInfo = util.getLocalStorage('ww_userInfo') userInfo = util.getLocalStorage('ww_userInfo')
dispatch('registerHttp', sessionId || '') dispatch('registerHttp', sessionId || '')
...@@ -92,10 +93,13 @@ const actions = { ...@@ -92,10 +93,13 @@ const actions = {
ww_storage_info.corpId = corpId ww_storage_info.corpId = corpId
util.setLocalStorage('ww_storage_info', ww_storage_info) util.setLocalStorage('ww_storage_info', ww_storage_info)
} }
if (userInfo) { if (isReLogin) {
dispatch('login')
return
}
if (userInfo || sessionId) {
state.showWindow = true state.showWindow = true
} else { } else {
util.showLoading()
dispatch('login') dispatch('login')
} }
} }
......
...@@ -120,7 +120,7 @@ const jumpChildrenPage = (to, params) => { ...@@ -120,7 +120,7 @@ const jumpChildrenPage = (to, params) => {
} }
/**拷贝 */ /**拷贝 */
const setClipboardData = (data, tips) => { const setClipboardData = (data, tips, hideToast) => {
let transfer = document.createElement('input') let transfer = document.createElement('input')
document.body.appendChild(transfer) document.body.appendChild(transfer)
transfer.value = data transfer.value = data
...@@ -128,7 +128,7 @@ const setClipboardData = (data, tips) => { ...@@ -128,7 +128,7 @@ const setClipboardData = (data, tips) => {
transfer.select() transfer.select()
if (document.execCommand('copy')) document.execCommand('copy') if (document.execCommand('copy')) document.execCommand('copy')
transfer.blur() transfer.blur()
Toast(tips || '内容已复制') if (!hideToast) Toast(tips || '内容已复制')
document.body.removeChild(transfer) document.body.removeChild(transfer)
} }
......
<template>
<iframe
:src="src"
frameborder="0"
width="100%"
height="100%"
></iframe>
</template>
<script type='text/ecmascript-6'>
import { util } from 'utils'
export default {
name: '',
data () {
return {
src: ''
}
},
mounted () {
document.title = 'AI智能问数'
let baseUrl = window.$fetchConfig.aiDataLink;
let { phone, staffUuid, role_type, sessionId, corpId } = util.getQuery()
this.src = `${baseUrl}?platformType=1&domain=https://aiassistant.glsx.com.cn&phone=${phone}&staffUuid=${staffUuid}&role_type=${role_type}&sessionId=${sessionId}&corpId=${corpId}`
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="report-component " :class="{ 'is-card': isCard }"> <div
class="report-component "
:class="{ 'is-card': isCard }"
>
<template v-if="reportIndex == 1"> <template v-if="reportIndex == 1">
<div class="date">统计周期:{{dayjs(reportItem.reportStartDate).format('YYYY年M月')}} ({{ reportItem.reportStartDate }}至{{ reportItem.reportEndDate }})</div> <div class="date">统计周期:{{dayjs(reportItem.reportStartDate).format('YYYY年M月')}} ({{ reportItem.reportStartDate }}至{{ reportItem.reportEndDate }})</div>
</template> </template>
...@@ -32,10 +35,12 @@ ...@@ -32,10 +35,12 @@
<!-- 1.2 业务数据汇总 --> <!-- 1.2 业务数据汇总 -->
<div class="sub-title">{{ reportIndex }}.2 业务数据汇总</div> <div class="sub-title">{{ reportIndex }}.2 业务数据汇总</div>
<template v-for="(b,bindex) in reportItem.brandList"> <template v-for="(b,bindex) in reportItem.brandList">
<div <div
:key="'b'+ bindex" :key="'b'+ bindex"
class="business-data" class="business-data"
> >
<div class="brand-title">🚗 {{ b.brandName }}</div>
<div class="data-table"> <div class="data-table">
<table> <table>
<thead> <thead>
...@@ -83,8 +88,10 @@ ...@@ -83,8 +88,10 @@
<span class="dot">●</span> <span class="dot">●</span>
整体结论 整体结论
</div> </div>
<div class="content-text"> <div
{{ b.overallConclusion || '暂无整体结论' }} class="content-text"
v-html="formatText(b.overallConclusion)"
>
</div> </div>
<!-- 行动建议 --> <!-- 行动建议 -->
...@@ -92,8 +99,10 @@ ...@@ -92,8 +99,10 @@
<span class="dot">●</span> <span class="dot">●</span>
行动建议 行动建议
</div> </div>
<div class="content-text"> <div
{{ b.actionSuggestion || '暂无行动建议' }} class="content-text"
v-html="formatText(b.actionSuggestion)"
>
</div> </div>
</div> </div>
</template> </template>
...@@ -143,6 +152,12 @@ export default { ...@@ -143,6 +152,12 @@ export default {
} }
}, },
methods: { methods: {
// 格式化文本,将 \n 转换为 <br>
formatText (text) {
if (!text) return '暂无内容'
// 将换行符转换为 <br> 标签
return text.replace(/\n/g, '<br>')
},
// 格式化变化值 // 格式化变化值
formatChange (value) { formatChange (value) {
if (value === null || value === undefined) return '-' if (value === null || value === undefined) return '-'
...@@ -182,7 +197,13 @@ export default { ...@@ -182,7 +197,13 @@ export default {
font-size: 14px; font-size: 14px;
margin-bottom: 8px; margin-bottom: 8px;
} }
.brand-title{
height: 20px;
color: #133368;
font-size: 14px;
font-weight: 500;
margin-bottom: 12px;
}
// 门店数据汇总 // 门店数据汇总
.merchant-list { .merchant-list {
display: flex; display: flex;
...@@ -230,7 +251,7 @@ export default { ...@@ -230,7 +251,7 @@ export default {
margin-bottom: 16px; margin-bottom: 16px;
border-radius: 8px; border-radius: 8px;
overflow: auto; overflow: auto;
border: 1px solid #D8E6F0; border: 1px solid #d8e6f0;
table { table {
width: 100%; width: 100%;
...@@ -246,7 +267,7 @@ export default { ...@@ -246,7 +267,7 @@ export default {
text-align: left; text-align: left;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
border: 1px solid #D8E6F0; border: 1px solid #d8e6f0;
border-top: none; border-top: none;
&:first-child { &:first-child {
...@@ -263,7 +284,7 @@ export default { ...@@ -263,7 +284,7 @@ export default {
tbody { tbody {
tr { tr {
background: #fff; background: #fff;
td{ td {
border-left: none !important; border-left: none !important;
&:last-child { &:last-child {
border-right: none !important; border-right: none !important;
...@@ -281,9 +302,7 @@ export default { ...@@ -281,9 +302,7 @@ export default {
td { td {
padding: 6px 8px; padding: 6px 8px;
text-align: left; text-align: left;
border: 1px solid #D8E6F0; border: 1px solid #d8e6f0;
&.change-up { &.change-up {
color: #ff2d55; color: #ff2d55;
...@@ -326,10 +345,30 @@ export default { ...@@ -326,10 +345,30 @@ export default {
} }
} }
.is-card{ .is-card {
.date {
.content-text,.section-title{ font-size: 14.31px !important;
font-size: 15.31px; }
.content-text,
.section-title,
.business-title,
.sub-title {
font-size: 15.31px !important;
}
.merchant-list .merchant-item {
.value{
font-size: 19.68px !important;
}
.label,
.unit {
font-size: 15.31px !important;
}
}
.data-table table{
font-size: 14.31px !important;
}
.brand-title{
font-size: 15.31px !important;
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -54,7 +54,8 @@ export default { ...@@ -54,7 +54,8 @@ export default {
let userInfo = util.getLocalStorage('ww_userInfo'); let userInfo = util.getLocalStorage('ww_userInfo');
let sessionId = util.getSessionId(); let sessionId = util.getSessionId();
let { phone, uuid, loginRole } = userInfo let { phone, uuid, loginRole } = userInfo
window.open(`${baseUrl}?phone=${phone}&uuid=${uuid}&loginRole=${loginRole}&sessionId=${sessionId}&corpId=${corpId}`) // window.open(`${baseUrl}?platformType=1&domain=https://aiassistant.glsx.com.cn&phone=${phone}&staffUuid=${uuid}&role_type=${loginRole}&sessionId=${sessionId}&corpId=${corpId}`)
window.location.href = `${baseUrl}?platformType=1&domain=https://aiassistant.glsx.com.cn&phone=${phone}&staffUuid=${uuid}&role_type=${loginRole}&sessionId=${sessionId}&corpId=${corpId}`
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} }
......
...@@ -50,11 +50,20 @@ export default { ...@@ -50,11 +50,20 @@ export default {
return 150 return 150
} }
// 存储 reportId
let currentReportId = ''
window.addEventListener('message', function (event) { window.addEventListener('message', function (event) {
if (event.data && event.data.type === 'GET_IFRAME_HEIGHT') { if (event.data && event.data.type === 'GET_IFRAME_HEIGHT') {
// 保存 reportId
currentReportId = event.data.reportId || ''
// 发送 report-card 的高度给父页面 // 发送 report-card 的高度给父页面
window.parent.postMessage( window.parent.postMessage(
{ type: 'RESIZE_IFRAME', height: getReportCardHeight() }, {
type: 'RESIZE_IFRAME',
height: getReportCardHeight(),
reportId: currentReportId
},
'*' '*'
) )
} }
...@@ -64,7 +73,11 @@ export default { ...@@ -64,7 +73,11 @@ export default {
window.addEventListener('load', function () { window.addEventListener('load', function () {
setTimeout(function () { setTimeout(function () {
window.parent.postMessage( window.parent.postMessage(
{ type: 'RESIZE_IFRAME', height: getReportCardHeight() }, {
type: 'RESIZE_IFRAME',
height: getReportCardHeight(),
reportId: currentReportId
},
'*' '*'
) )
}, 200) }, 200)
...@@ -73,7 +86,11 @@ export default { ...@@ -73,7 +86,11 @@ export default {
// 监听 DOM 变化,动态调整高度 // 监听 DOM 变化,动态调整高度
const observer = new MutationObserver(function () { const observer = new MutationObserver(function () {
window.parent.postMessage( window.parent.postMessage(
{ type: 'RESIZE_IFRAME', height: getReportCardHeight() }, {
type: 'RESIZE_IFRAME',
height: getReportCardHeight(),
reportId: currentReportId
},
'*' '*'
) )
}) })
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
active-color="#0088FF" active-color="#0088FF"
size="18" size="18"
@change="switchChange($event, '展业周报', 'updateWeeklySubscribeStatus')" @change="switchChange($event, '展业周报', 'updateWeeklySubscribeStatus')"
inactive-color="#E6E6E6"
/> />
</div> </div>
...@@ -26,6 +27,7 @@ ...@@ -26,6 +27,7 @@
active-color="#0088FF" active-color="#0088FF"
size="18" size="18"
@change="switchChange($event, '展业月报','updateMonthlySubscribeStatus')" @change="switchChange($event, '展业月报','updateMonthlySubscribeStatus')"
inactive-color="#E6E6E6"
/> />
</div> </div>
</div> </div>
......
...@@ -27,7 +27,7 @@ const spritesmithFunction = data => { ...@@ -27,7 +27,7 @@ const spritesmithFunction = data => {
module.exports = { module.exports = {
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-zhangls/', // 署应用包时的基本 URL。 vue-router hash 模式使用 // publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-zhangls/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用 publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开 // publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
outputDir: 'dist', // 生产环境构建文件的目录 outputDir: 'dist', // 生产环境构建文件的目录
assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录 assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
...@@ -35,7 +35,7 @@ module.exports = { ...@@ -35,7 +35,7 @@ module.exports = {
productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: { devServer: {
disableHostCheck: true, disableHostCheck: true,
port: 8081, // 端口 dj-scrm-wx-work-lwk port: 9527, // 端口 dj-scrm-wx-work-lwk
// port: 9528, // 端口 dj-scrm-wx-work-main-lwk // port: 9528, // 端口 dj-scrm-wx-work-main-lwk
open: false, // 启动后打开浏览器. open: false, // 启动后打开浏览器.
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!