Commit 51ac79b7 by 李伟康

feat(daily): 添加日报模板功能并调整环境配置

- 修改 env.js 中的环境索引值从 3 调整为 2
- 在 pages.json 中新增日报页面路由配置
- 创建新的 dailyTemplateApi 模块用于获取日报模板数据
- 在 API 模块索引中注册 dailyTemplateApi
- 更新 sprite.scss 中的图标样式和定位信息
- 添加日报相关的图标资源和样式定义
1 parent 17974848
import http from '../request/http'
import { env } from '../../env'
const ENV = env == 'ip' ? 'develop' : env,
configUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?env=${ENV}`
/**
*
* @param {*} templateType 1: 驻店 2:门店 3:洽谈
*
* @returns
*/
const getDailyTemplate = async (templateType) => {
try {
const configModule = {
1:'staff-daily-template',
2:'store-daily-template',
3:'negotiation-details-template',
}[templateType]
const data = await http.uni_request({ url: `${configUrl}&moduleUrl=${configModule}` })
return Promise.resolve(data)
} catch (error) {
return Promise.reject(error)
}
}
module.exports = { getDailyTemplate }
...@@ -12,6 +12,7 @@ import interceptionApi from './interceptionApi' ...@@ -12,6 +12,7 @@ import interceptionApi from './interceptionApi'
import popupApi from './popupApi' import popupApi from './popupApi'
import usedCarApi from './usedCar' import usedCarApi from './usedCar'
import equityApi from './equity' import equityApi from './equity'
import dailyTemplateApi from './dailyTemplateApi'
module.exports = { module.exports = {
commonApi, commonApi,
...@@ -27,5 +28,6 @@ module.exports = { ...@@ -27,5 +28,6 @@ module.exports = {
evaluationApi, evaluationApi,
usedCarApi, usedCarApi,
activityApi, activityApi,
equityApi equityApi,
dailyTemplateApi
} }

3.17 MB | W: | H:

3.21 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
<template v-if="entranceList.length"> <template v-if="entranceList.length">
<view class="entrance-container"> <view class="entrance-container">
<view :class="['entrance-list', `entrance-list-${type}`]"> <view :class="['entrance-list', `entrance-list-${type}`]">
<view class="entrance-item" v-for="(item, index) in entranceList" :key="index" @click="handleClick(item)"> <view
class="entrance-item"
v-for="(item, index) in entranceList"
:key="index"
@click="handleClick(item)"
>
<view :class="['sprite-icon', `icon-${item.icon}`]"></view> <view :class="['sprite-icon', `icon-${item.icon}`]"></view>
<view class="entrance-name">{{ item.label }}</view> <view class="entrance-name">{{ item.label }}</view>
</view> </view>
...@@ -12,7 +17,10 @@ ...@@ -12,7 +17,10 @@
</template> </template>
<template v-else> <template v-else>
<view class="developing flex"> <view class="developing flex">
<image class="developing-icon" src="../assets/images/common/developing.webp" /> <image
class="developing-icon"
src="../assets/images/common/developing.webp"
/>
功能开发中 功能开发中
</view> </view>
</template> </template>
...@@ -29,7 +37,7 @@ export default { ...@@ -29,7 +37,7 @@ export default {
default: 0 default: 0
} }
}, },
data() { data () {
return { return {
// 工资申诉入口是否允许显示 // 工资申诉入口是否允许显示
wageAppealAllowed: false, wageAppealAllowed: false,
...@@ -37,19 +45,20 @@ export default { ...@@ -37,19 +45,20 @@ export default {
loadingEntrance: true loadingEntrance: true
} }
}, },
created() { created () {
// 组件创建时请求工资申诉入口权限 // 组件创建时请求工资申诉入口权限
this.fetchWageAppealEntrance() this.fetchWageAppealEntrance()
}, },
computed: { computed: {
entranceList() { entranceList () {
let { sceneType } = uni.$storage.get('userInfo') || {}, let { sceneType } = uni.$storage.get('userInfo') || {},
entranceList = [ entranceList = [
{ {
icon: 'daily-report', icon: 'daily-report',
label: '驻店日报', label: '驻店日报',
name: 'DailyReport', name: 'DailyReport',
sceneType: [0, 1, 7] sceneType: [0, 1, 7],
noInterception:true
}, },
{ {
icon: 'create-order', icon: 'create-order',
...@@ -79,7 +88,8 @@ export default { ...@@ -79,7 +88,8 @@ export default {
icon: 'wage-appeal', icon: 'wage-appeal',
label: '工资申诉', label: '工资申诉',
name: 'WageAppeal', name: 'WageAppeal',
sceneType: [0, 1] sceneType: [0, 1],
noInterception:true
}, },
{ {
icon: 'evaluation-management', icon: 'evaluation-management',
...@@ -99,22 +109,49 @@ export default { ...@@ -99,22 +109,49 @@ export default {
label: '交付管理', label: '交付管理',
name: 'DeliveryManagement', name: 'DeliveryManagement',
page: '/pages/usedCar/deliveryManagement/index', page: '/pages/usedCar/deliveryManagement/index',
sceneType: [7] sceneType: [7],
checkDailyReport:false
}, },
{ {
icon: 'report-management', icon: 'report-management',
label: '报告管理', label: '报告管理',
name: 'ReportManagement', name: 'ReportManagement',
page: '/pages/usedCar/reportManagement/index', page: '/pages/usedCar/reportManagement/index',
sceneType: [7] sceneType: [7],
checkDailyReport:false
}, },
{ {
icon: 'report', icon: 'report',
label: '检测管理', label: '检测管理',
name: 'InspectionReport', name: 'InspectionReport',
page: '/pages/usedCar/inspectionReport/index', page: '/pages/usedCar/inspectionReport/index',
sceneType: [7] sceneType: [7],
} noInterception:true
},
{
icon: 'daily-report',
label: '驻店日报 (新)',
page: '/pages/common/dailyNewspaper/index',
name: 'staffDailyReport',
sceneType: [0, 1],
noInterception:true
},
{
icon: 'store-daily-report',
label: '门店日报',
name: 'storeDailyReport',
page: '/pages/common/dailyNewspaper/index',
sceneType: [0, 1],
noInterception:true
},
{
icon: 'negotiation-detail',
name: 'NegotiationDetailList',
label: '洽谈明细',
page: '/pages/common/dailyNewspaper/index',
sceneType: [0, 1],
noInterception:true
},
] ]
// 先根据场景过滤 // 先根据场景过滤
let list = entranceList.filter(e => e.sceneType.includes(sceneType)) let list = entranceList.filter(e => e.sceneType.includes(sceneType))
...@@ -127,7 +164,7 @@ export default { ...@@ -127,7 +164,7 @@ export default {
}, },
methods: { methods: {
// 请求工资申诉入口权限,并设置显示开关 // 请求工资申诉入口权限,并设置显示开关
async fetchWageAppealEntrance() { async fetchWageAppealEntrance () {
try { try {
this.loadingEntrance = true this.loadingEntrance = true
const userInfo = uni.$storage.get('userInfo') || {} const userInfo = uni.$storage.get('userInfo') || {}
...@@ -155,7 +192,7 @@ export default { ...@@ -155,7 +192,7 @@ export default {
this.loadingEntrance = false this.loadingEntrance = false
} }
}, },
handleClick(item) { handleClick (item) {
// 这里可以根据实际需求进行跳转或功能处理 // 这里可以根据实际需求进行跳转或功能处理
this.$emit('entranceClick', item) this.$emit('entranceClick', item)
} }
......
...@@ -120,7 +120,6 @@ export default { ...@@ -120,7 +120,6 @@ export default {
}, },
watch: { watch: {
userInfo (n) { userInfo (n) {
console.log('userInfo', n)
if (n.shopMerchantId) this.haveCustomerAccess(n) if (n.shopMerchantId) this.haveCustomerAccess(n)
}, },
activityWindowPopStatus:{ activityWindowPopStatus:{
...@@ -214,7 +213,6 @@ export default { ...@@ -214,7 +213,6 @@ export default {
] ]
let { sceneType } = uni.$storage.get("userInfo") let { sceneType } = uni.$storage.get("userInfo")
if (sceneType == 7) tabs[1].hidden = true if (sceneType == 7) tabs[1].hidden = true
console.log('tabs', tabs)
return tabs return tabs
}, },
activityWindowPopStatus () { activityWindowPopStatus () {
...@@ -225,7 +223,6 @@ export default { ...@@ -225,7 +223,6 @@ export default {
uni.$on('ActivityCenter', this.handleActivityCenter); uni.$on('ActivityCenter', this.handleActivityCenter);
// uni.$on('ActivityCenter', () => { // uni.$on('ActivityCenter', () => {
// console.log('ActivityCenter')
// let { tabs } = this, // let { tabs } = this,
// index = tabs.findIndex(e => e.name == 'ActivityCenter') // index = tabs.findIndex(e => e.name == 'ActivityCenter')
// this.changeIndex(index, this.tabs[index]) // this.changeIndex(index, this.tabs[index])
...@@ -236,7 +233,6 @@ export default { ...@@ -236,7 +233,6 @@ export default {
index = tabs.findIndex(e => e.name == 'StudyCenter') index = tabs.findIndex(e => e.name == 'StudyCenter')
this.changeIndex(index, this.tabs[index]) this.changeIndex(index, this.tabs[index])
}); });
console.log('this.tabIndex', this.tabIndex)
//获取北森代办数量 //获取北森代办数量
this.getUnreadCount() this.getUnreadCount()
// 学习中心权限获取,场景集市权限 // 学习中心权限获取,场景集市权限
...@@ -303,7 +299,6 @@ export default { ...@@ -303,7 +299,6 @@ export default {
}) })
}, },
handleActivityCenter () { handleActivityCenter () {
console.log('ActivityCenter triggered'); // 添加日志查看触发次数
let { tabs } = this; let { tabs } = this;
let index = tabs.findIndex(e => e.name == 'ActivityCenter'); let index = tabs.findIndex(e => e.name == 'ActivityCenter');
if (index !== -1) { if (index !== -1) {
...@@ -337,7 +332,6 @@ export default { ...@@ -337,7 +332,6 @@ export default {
merchantId: shopMerchantId, merchantId: shopMerchantId,
scene scene
}).then(result => { }).then(result => {
console.log('有客户权限', result)
if (result) { if (result) {
this.hasPerson = true this.hasPerson = true
// this.activityTabVisible = scene !== 7 // this.activityTabVisible = scene !== 7
...@@ -407,7 +401,6 @@ export default { ...@@ -407,7 +401,6 @@ export default {
// 1. 学习策略弹窗 // 1. 学习策略弹窗
caseParams.moduleType = 6 caseParams.moduleType = 6
const studyCaseRes = await uni.$api.commonApi.getBoxPage(caseParams) const studyCaseRes = await uni.$api.commonApi.getBoxPage(caseParams)
console.log(studyCaseRes, 'studyCaseRes')
if(studyCaseRes.list.length) { if(studyCaseRes.list.length) {
this.messageType = 'caseStudy' this.messageType = 'caseStudy'
this.messageData = studyCaseRes.list[0] this.messageData = studyCaseRes.list[0]
...@@ -416,7 +409,6 @@ export default { ...@@ -416,7 +409,6 @@ export default {
} }
// 2. 长课程推送 // 2. 长课程推送
const longCourseRes = await uni.$api.commonApi.getLongCourseNotify() const longCourseRes = await uni.$api.commonApi.getLongCourseNotify()
console.log(longCourseRes, 'longCourseRes')
if(longCourseRes.count > 0) { if(longCourseRes.count > 0) {
this.messageType = 'study' this.messageType = 'study'
this.messageData = longCourseRes this.messageData = longCourseRes
...@@ -432,7 +424,6 @@ export default { ...@@ -432,7 +424,6 @@ export default {
// 3. 优秀案例分享 // 3. 优秀案例分享
caseParams.moduleType = 7 caseParams.moduleType = 7
const caseRes = await uni.$api.commonApi.getBoxPage(caseParams) const caseRes = await uni.$api.commonApi.getBoxPage(caseParams)
console.log(caseRes, 'caseRes')
if(caseRes.list.length) { if(caseRes.list.length) {
this.messageType = 'caseShare' this.messageType = 'caseShare'
this.messageData = caseRes.list[0] this.messageData = caseRes.list[0]
...@@ -445,7 +436,6 @@ export default { ...@@ -445,7 +436,6 @@ export default {
// 5. 企业通知推送 // 5. 企业通知推送
const enterpriseRes = await uni.$api.commonApi.getEnterpriseNotify() const enterpriseRes = await uni.$api.commonApi.getEnterpriseNotify()
console.log(enterpriseRes, 'enterpriseRes')
if(enterpriseRes.ids || enterpriseRes.businessIds) { if(enterpriseRes.ids || enterpriseRes.businessIds) {
this.messageType = 'system' this.messageType = 'system'
this.messageData = enterpriseRes this.messageData = enterpriseRes
...@@ -510,7 +500,6 @@ export default { ...@@ -510,7 +500,6 @@ export default {
if (!res) { if (!res) {
uni.$api.commonApi.getStudyCenterPermission({}).then(res => { uni.$api.commonApi.getStudyCenterPermission({}).then(res => {
uni.$storage.set('studyCenterPermission', res) uni.$storage.set('studyCenterPermission', res)
console.log(res, 'res')
}) })
} }
if (userInfo.sceneType == 7) { if (userInfo.sceneType == 7) {
......
...@@ -655,9 +655,8 @@ export default { ...@@ -655,9 +655,8 @@ export default {
async entranceClick(item) { async entranceClick(item) {
console.log(item, 'item') console.log(item, 'item')
// 清除评估单的图片视频资源缓存 // 清除评估单的图片视频资源缓存
const noInterceptPage = ['DailyReport', 'DeliveryManagement', 'ReportManagement', 'WageAppeal', 'InspectionReport'], const { sceneType } = this
{ sceneType } = this if (!item.noInterception) {
if (!noInterceptPage.includes(item.name)) {
if (sceneType != 7) { if (sceneType != 7) {
// if (await this.inspectionOfProhibitionBill()) return // if (await this.inspectionOfProhibitionBill()) return
// 检查是否限制录单 // 检查是否限制录单
...@@ -697,7 +696,7 @@ export default { ...@@ -697,7 +696,7 @@ export default {
} }
if (item.page) if (item.page)
return uni.navigateTo({ return uni.navigateTo({
url: item.page url: `${item.page}?componentName=${item.name}`
}) })
let pageName = { let pageName = {
0: 'equity', 0: 'equity',
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 3 const index = 2
/** /**
* *
0本地 0本地
......
...@@ -347,6 +347,12 @@ ...@@ -347,6 +347,12 @@
} }
} }
} }
},
{
"path": "pages/common/dailyNewspaper/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
...@@ -137,7 +137,7 @@ const defaultConfig = [ ...@@ -137,7 +137,7 @@ const defaultConfig = [
} }
] ]
export default { export default {
components: { HomeFrame, detail, CenterPopup, PackageDetailPopup , SwiperComponent }, components: { HomeFrame, detail, CenterPopup, PackageDetailPopup, SwiperComponent },
name: 'boutique', name: 'boutique',
data () { data () {
return { return {
...@@ -193,6 +193,7 @@ export default { ...@@ -193,6 +193,7 @@ export default {
this.init(); this.init();
this.requested = true this.requested = true
this.$refs.home.updateApp(true) this.$refs.home.updateApp(true)
this.getMerchantCarBrand()
}, },
async onShow () { async onShow () {
const userInfo = uni.$storage.get("userInfo") const userInfo = uni.$storage.get("userInfo")
...@@ -210,6 +211,28 @@ export default { ...@@ -210,6 +211,28 @@ export default {
computed: { computed: {
}, },
methods: { methods: {
getMerchantCarBrand () {
const userInfo = uni.$storage.get('userInfo'),
{ shopMerchantId } = userInfo
/**获取门店主营品牌车型 */
uni.$api.commonApi.getMerchantCarBrandList([shopMerchantId]).then(({ data }) => {
let list = data[0].carBrandList,
carBrandList = [],
brandIdList = [],
subBrandIdList = []
list?.map(e => {
e.childs.map(i => {
i.brandName = e.name
i.brandId = e.id
carBrandList.push(i)
subBrandIdList.push(i.id)
})
brandIdList.push(e.id)
})
this.$store.dispatch('setCarBrandsList', carBrandList)
uni.$storage.set('carBrandList', carBrandList)
})
},
...mapMutations("audio", ["setReceptionStatus"]), ...mapMutations("audio", ["setReceptionStatus"]),
init () { init () {
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
...@@ -548,7 +571,6 @@ export default { ...@@ -548,7 +571,6 @@ export default {
font-size: toRpx(36); font-size: toRpx(36);
font-weight: 700; font-weight: 700;
justify-content: center; justify-content: center;
} }
.price-3 { .price-3 {
top: toRpx(54); top: toRpx(54);
......
<template>
<view class="daily-report">
<view class="common-title">
</view>
<template v-if="loadComplete">
<template v-if="list.length">
<view class="daily-report-container">
<template v-for="(i,index) in list">
<view
class="list-box"
:key="index"
>
<view class="list-title">{{ i.label }}</view>
<Table
:columns="i.children[index]"
:data="i.children"
titleKey="label"
tableStyle="padding-right:32rpx"
customTable
cornerText="序号"
LeftWidth="104rpx"
@rowClick="handleRowClick"
:index="index"
hasFooter
@clickAdd="addItem(index)"
>
<template v-slot:customCell="{col }">
{{ col.value || '-' }}
</template>
</Table>
</view>
</template>
</view>
<view class="footer">
<Footer>
<view class="btn">保存</view>
</Footer>
</view>
</template>
<nothing v-else />
</template>
<EditForm ref="editForm" @onDel="delItem" />
</view>
</template>
<script type='text/ecmascript-6'>
import Table from '../components/Table'
import Nothing from '../components/Nothing'
import Footer from '../components/Footer'
import utils from '@/utils/utils'
import EditForm from '../components/EditForm'
export default {
components: { Table, Nothing, Footer, EditForm },
name: 'NegotiationDetailList',
inject: ['sceneType'],
props: {
templateData: {
type: Array,
default: () => []
}
},
data () {
return {
loadComplete: false,
list: []
}
},
watch: {
templateData: {
handler (val) {
if (!this.list.length) this.list = utils.deepClone(val)
},
immediate: true,
deep: true
}
},
computed: {
title () {
let sceneName = {
0: '延保/权益',
1: '轻改'
}[this.sceneType]
return `洽谈明细 (${sceneName})`
}
},
mounted () {
this.loadComplete = true
},
methods: {
handleRowClick (row, rowIndex, index) {
this.$refs.editForm.open(row, rowIndex, index)
},
delItem (c_index, index) {
this.list[index].children.splice(c_index, 1)
// this.list.splice(index, 1)
},
addItem (index) {
let { templateData } = this
this.list[index].children.push(templateData[index].children[0])
let data = this.list[index].children[this.list[index].children.length - 1],
c_index = this.list[index].children.length - 1
this.$refs.editForm.open(data, c_index, index)
}
}
}
</script>
<style scoped lang='scss'>
.daily-report {
height: 100%;
position: relative;
&-container {
height: calc(100% - #{toRpx(184)});
padding: 0 48rpx;
box-sizing: border-box;
overflow-y: auto;
transform: translateY(48rpx);
}
.common-title {
position: absolute;
top: 0;
left: 0;
}
.list-box {
width: 100%;
border-radius: 32rpx;
background: #fff;
padding: 0 0 32rpx 32rpx;
margin-bottom: 32rpx;
.list-title {
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
padding: 32rpx 0 24rpx;
}
}
.footer {
transform: translateY(48rpx);
height: 136rpx;
.btn {
margin: 0 168rpx;
width: 100%;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 80rpx;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: 28rpx;
font-weight: 500;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="daily-report">
<view class="common-title">
</view>
<template v-if="loadComplete">
<template v-if="list.length">
<view class="list-box">
<view class="list-title">{{ title }}</view>
<view :class="[checkTable(list)]">
<Table
:columns="columns"
:data="list"
tableStyle="padding-right:32rpx"
close
/>
</view>
<view class="list-title">{{ title }}</view>
<view :class="[checkTable(list)]">
<Table
:columns="columns"
:data="list"
tableStyle="padding-right:32rpx"
/>
</view>
</view>
</template>
<nothing v-else />
</template>
</view>
</template>
<script type='text/ecmascript-6'>
import Table from '../components/Table'
import Nothing from '../components/Nothing'
export default {
components: { Table, Nothing },
name: 'NegotiationDetailList',
inject: ['sceneType'],
data () {
return {
columns: [
{ title: '数据1' },
{ title: '数据2' },
{ title: '数据3' },
{ title: '数据4' },
{ title: '数据5' },
{ title: '数据6' },
{ title: '数据7' },
{ title: '数据8' },
{ title: '数据9' },
{ title: '数据10' },
{ title: '数据11' },
{ title: '数据12' },
{ title: '数据13' },
{ title: '数据14' },
{ title: '数据15' },
{ title: '数据16' },
{ title: '数据17' },
{ title: '数据18' },
{ title: '数据19' },
{ title: '数据20' },
],
loadComplete: false,
list: [
{
rowHeader: '交车日期',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '部门',
data: ['3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3']
},
{
rowHeader: '推荐人',
data: ['5', '5', '5', '1', '5', '5', '4', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5']
},
{
rowHeader: '客户名称',
data: ['张三', '张三', '张三23423423234SCSDSDsdsd多少点', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三']
},
{
rowHeader: '客户电话',
data: ['12345678901', 'ddd', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', 123]
},
{
rowHeader: '客户地址',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '客户来源',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '客户备注',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '客户备注',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '客户备注',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '客户备注',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '客户备注',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '客户备注',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '客户备注',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '客户备注',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
]
}
},
computed: {
title () {
let sceneName = {
0: '延保/权益',
1: '轻改'
}[this.sceneType]
return `洽谈明细 (${sceneName})`
}
},
mounted () {
this.loadComplete = true
},
methods: {
checkTable (list) {
return list.length >= 12 ? 'table-box' : ''
}
}
}
</script>
<style scoped lang='scss'>
.daily-report {
height: 100%;
position: relative;
.common-title {
position: absolute;
top: 0;
left: 0;
}
.list-box {
position: absolute;
width: calc(100% - #{toRpx(96)});
height: calc(100% - #{toRpx(80)});
border-radius: 32rpx;
background: #fff;
top: 48rpx;
left: 50%;
transform: translateX(-50%);
padding: 0 0 32rpx 32rpx;
overflow-x: auto;
.list-title {
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
padding: 32rpx 0 24rpx;
position: sticky;
top: 0;
z-index: 50;
background: #fff;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
驻店日报
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
门店日报
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="form-popup">
<uni-popup
ref="popup"
type="right"
:is-mask-click="false"
animation
>
<view class="box">
<view class="popup-title flex">
第{{ c_index + 1 }}行
<view
class="popup-close flex"
@click="close"
>
<uni-icons
type="closeempty"
size="16"
></uni-icons>
</view>
</view>
<view class="popup-content">
</view>
<view class="popup-footer flex">
<view
class="del flex"
@click="del"
>
<view class="sprite-icon icon-blue-delete"></view>
</view>
<view
class="popup-btn popup-cancel"
@click="cancel"
>{{ cancelText }}</view>
<view
class="popup-btn popup-confirm"
@click="confirm"
>{{ confirmText }}</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script type='text/ecmascript-6'>
import Popup from '@/components/Popup.vue'
export default {
components: { Popup },
name: 'EditForm',
props: {
cancelText: {
type: String,
default: '取消'
},
confirmText: {
type: String,
default: '确定'
}
},
data () {
return {
data: {},
c_index: 0,
index: 0
}
},
mounted () {
},
methods: {
open (data, c_index, index) {
this.data = data || {}
this.c_index = c_index || 0
this.index = index || 0
this.$refs.popup.open()
},
del () {
this.$refs.popup.close()
this.$emit('onDel', this.c_index, this.index)
},
cancel () {
this.$emit('onCancel')
},
close () {
this.$refs.popup.close()
this.$emit('close')
},
confirm () {
this.$emit('onConfirm', this.data, this.c_index, this.index)
},
}
}
</script>
<style scoped lang='scss'>
.box {
width: 46vw;
height: 100vh;
border-radius: 32rpx 0 0 32rpx;
background-color: #fff;
.popup-title {
height: 112rpx;
position: relative;
justify-content: center;
color: #333333;
font-size: 36rpx;
font-weight: 500;
line-height: 48rpx;
.popup-close {
position: absolute;
height: 100%;
top: 0;
right: 0;
padding: 0 toRpx(48);
font-weight: 400;
color: #1a1a1a;
}
}
.popup-content {
height: calc(100vh - 320rpx);
overflow-y: auto;
}
.popup-footer {
padding: 64rpx 0;
justify-content: center;
gap: 0 32rpx;
margin: 0 48rpx;
.del {
border-radius: 64rpx;
background: #2c66f71a;
padding: 20rpx 32rpx;
}
.popup-btn {
display: flex;
align-items: center;
justify-content: center;
width: 412rpx;
height: 80rpx;
border-radius: 64rpx;
background: #f0f1f5;
color: #333333;
font-size: 32rpx;
font-weight: 500;
}
.popup-confirm {
color: #fff;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="footer-container">
<slot></slot>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.footer-container{
display: flex;
align-items: center;
justify-content: center;
height: 100%;
padding: 28rpx 32rpx;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="nothing-box">
<image
class="icon"
:src="require('@//assets/images/common/noData.png')"
/>
<text class="text">{{ text }}</text>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Nothing',
props: {
text: {
type: String,
default: '暂无数据'
}
},
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.nothing-box {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.icon {
width: 300rpx;
height: 236rpx;
margin-bottom: 8rpx;
}
.text {
font-size: 24rpx;
line-height: 28rpx;
color: #999;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="table-container">
<view class="table-scroll">
<view
class="table-wrapper"
:style="tableStyle"
>
<!-- 表格 -->
<view class="table">
<!-- 第一行:表头 -->
<view class="table-row header-row">
<!-- 左上角固定单元格 -->
<view
class="table-cell corner-cell fixed-corner"
:style="{width:LeftWidth, minWidth:LeftWidth}"
>
<text class="cell-text">{{ cornerText }}</text>
</view>
<!-- 顶部表头 -->
<view
v-for="(col, colIndex) in columns"
:key="'header-' + colIndex"
class="table-cell header-cell fixed-header"
:style="{ width: col.width + 'rpx', minWidth: col.width + 'rpx' }"
>
<text class="cell-text">
{{ col[titleKey] }}
<template v-if="col.required">
<text class="required-text">*</text>
</template>
</text>
</view>
</view>
<!-- 数据行 -->
<view
v-for="(row, rowIndex) in tableData"
:key="'row-' + rowIndex"
class="table-row"
@click="handleRowClick(row, rowIndex)"
>
<!-- 左侧行表头 -->
<view
class="table-cell row-header-cell fixed-left"
:style="{width:LeftWidth, minWidth:LeftWidth}"
>
<text class="cell-text">{{ row.rowHeader || rowIndex + 1 }}</text>
</view>
<!-- 数据单元格 -->
<view
v-for="(col, colIndex) in columns"
:key="'cell-' + rowIndex + '-' + colIndex"
class="table-cell data-cell"
:style="{ width: col.width + 'rpx', minWidth: col.width + 'rpx' }"
>
<template v-if="customTable">
<slot
name="customCell"
:row="row"
:col="col"
:colIndex="colIndex"
:rowIndex="rowIndex"
></slot>
</template>
<template v-else><text class="cell-text">{{ row.data[colIndex] }}</text></template>
</view>
</view>
</view>
<view class="footer-row">
<view
class="add"
@click="$emit('clickAdd')"
></view>
</view>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'DailyNewspaperTable',
props: {
// 左上角文字
cornerText: {
type: String,
default: ''
},
// 列配置(顶部表头)
columns: {
type: Array,
default: () => []
},
// 行数据(包含左侧行表头)
data: {
type: Array,
default: () => []
},
LeftWidth: {
type: String,
default: '400rpx'
},
tableStyle: {
type: String,
default: ''
},
customTable: {
type: Boolean,
default: false
},
scrollY: {
type: Boolean,
default: false
},
hasFooter: {
type: Boolean,
default: false
},
titleKey: {
type: String,
default: 'title'
},
tableIndex: {
type: Number,
default: 0
},
},
data () {
return {
tableData: []
}
},
watch: {
data: {
handler (val) {
this.tableData = val || []
},
immediate: true
}
},
mounted () {
},
methods: {
handleScroll (e) {
// 滚动事件处理
},
handleRowClick (row, rowIndex) {
this.$emit('rowClick', row, rowIndex, this.tableIndex)
},
}
}
</script>
<style scoped lang='scss'>
.table-container {
width: 100%;
height: 100%;
}
.table-scroll {
width: 100%;
height: 100%;
overflow-x: auto;
}
.table-wrapper {
display: inline-block;
min-width: 100%;
}
.table {
display: table;
border-collapse: separate;
border-spacing: 0;
width: max-content;
}
.table-row {
display: table-row;
}
.table-cell {
display: table-cell;
padding: 24rpx;
text-align: center;
vertical-align: middle;
font-size: 26rpx;
color: #333;
box-sizing: border-box;
border-right: 1rpx solid #fff;
max-width: 800rpx;
min-width: 200rpx;
}
.table-cell:last-child {
border-right: none;
}
// 左上角固定单元格
.corner-cell {
position: sticky;
top: 0;
left: 0;
z-index: 30;
background-color: #f0f4ff;
border-bottom: 2rpx solid #fff;
border-right: 1rpx solid #fff;
}
.required-text {
color: #f24724;
}
// 顶部表头
.header-row {
position: sticky;
top: 0;
z-index: 20;
}
.header-cell {
background-color: #f0f4ff;
color: #000;
font-size: 28rpx;
font-weight: 500;
border-bottom: 2rpx solid #fff;
}
.fixed-header {
position: sticky;
top: 0;
z-index: 20;
}
// 左侧行表头
.row-header-cell {
position: sticky;
left: 0;
z-index: 10;
background-color: #f9fafc;
color: #303133;
text-align: left;
padding-left: 20rpx;
padding-right: 32rpx;
border-bottom: 1rpx solid #fff;
border-right: 1rpx solid #fff;
}
.fixed-left {
position: sticky;
left: 0;
z-index: 10;
}
// 数据单元格
.data-cell {
background-color: #f9fafc;
border-bottom: 1rpx solid #fff;
}
// 最后一行去掉底部边框
.table-row:last-child .data-cell,
.table-row:last-child .row-header-cell {
border-bottom: none;
}
.cell-text {
display: inline-block;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.footer-row {
width: 100%;
height: 88rpx;
padding: 16rpx 24rpx;
border-top: 2rpx solid #fff;
background: #f9fafc;
.add {
width: 56rpx;
height: 56rpx;
border-radius: 16rpx;
border: 1.6rpx solid #4673ff33;
background: #4673ff14;
display: flex;
align-items: center;
justify-content: center;
position: sticky;
left: 24rpx;
&::before,
&::after {
position: absolute;
content: '';
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #4673ff;
border-radius: 4rpx;
}
&::before {
width: 4rpx;
height: 28rpx;
}
&::after {
width: 28rpx;
height: 4rpx;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="detail-box">
<view class="nav-bar">
<view
class="back"
@click="backPage"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
<view class="title">展业工具</view>
</view>
<view class="detail-content">
<view class="detail-left">
<view class="common-title">
<div :class="['sprite-icon',`icon-${titleIcon}-mini`]"></div>
{{ title }}
</view>
<view class="content">
<image
class="banner"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/common/daily-banner.webp"
mode="scaleToFill"
/>
<view class="calendar">
<uni-calendar
ref="calendar"
:clearDate="false"
:endDate="endDate"
:showMonth="false"
@monthSwitch="currentMonth = `${$event.year}-${$event.month}`"
@change="currentDate = $event.fulldate"
backgroundColor="transparent"
:selected="selectedDays"
:date="currentDate"
:calendarItemStyle="{width:'84rpx',height:'84rpx'}"
/>
</view>
</view>
</view>
<view class="detail-right">
<component
:is="componentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
:lastMonth="lastMonth"
@setCalendarSelected="selectedDays = $event"
:enterType="enterType"
:templateData="templateData"
/>
</view>
</view>
<NoticePopup
ref="notice"
title="重要提示"
text="当前页面暂未保存,是否确认退出"
type="warning"
></NoticePopup>
</view>
</template>
<script>
import dayjs from 'dayjs'
import NoticePopup from '@/components/NoticePopup.vue'
import StaffDailyReport from './StaffDailyReport/index.vue'
import StoreDailyReport from './StoreDailyReport/index.vue'
import NegotiationDetailList from './NegotiationDetail/index.vue'
import EditNegotiationDetail from './NegotiationDetail/edit.vue'
export default {
components: {
NoticePopup,
StaffDailyReport,
StoreDailyReport,
NegotiationDetailList,
EditNegotiationDetail
},
provide () {
return {
sceneType: this.SCENE_TYPE
}
},
data () {
return {
options: {},
transmissionOfData: null,
endDate: dayjs().format('YYYY-MM-DD'),
currentDate: dayjs().format('YYYY-MM-DD'),
currentMonth: dayjs().format('YYYY-MM'),
selectedDays: [],
lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'),
enterType: '',
templateData:[]
}
},
computed: {
SCENE_TYPE () {
const { sceneType } = uni.$storage.get('userInfo')
return Number(sceneType)
},
CAR_BRAND_ID () {
const carBrandList = uni.$storage.get('carBrandList'),
carBrandId = carBrandList.map(item => item.id)
return carBrandId
},
/**
* '1.1': 100101, //精品升级
// '1.2': 100102, //次新车升配
// '1.3': 100103, //售后众筹
// '2.1.1': 110101, //售前会员权益升级
// '2.1.2': 110102, //售后会员权益升级
// '2.3.1': 110201, //售前延保
// '2.3.2': 110202, //售后延保
*/
BASE_SCENE_CODE () {
return [100101, 100102, 100103, 110101, 110102, 110201, 110202]
},
title () {
return {
staffdailyreport: '驻店日报',
storedailyreport: '门店日报',
negotiationdetaillist: '洽谈明细',
editnegotiationdetail: '洽谈明细'
}[this.componentName.toLowerCase()]
},
titleIcon () {
return {
staffdailyreport: 'daily-report',
storedailyreport: 'store-daily-report',
negotiationdetaillist: 'negotiation-detail',
editnegotiationdetail: 'negotiation-detail'
}[this.componentName.toLowerCase()]
},
componentName () {
let { currentDate, options } = this,
componentName = options.componentName || ''
if (componentName && componentName.toLowerCase() == 'negotiationdetaillist' && currentDate == dayjs().format('YYYY-MM-DD')) {
componentName = 'EditNegotiationDetail'
}
return componentName
}
},
onLoad (options) {
this.options = options
this.getDailyTemplate(options.componentName)
if (options.currentDate) this.setCurrentDate(options.currentDate)
},
onUnload () {
},
methods: {
async getDailyTemplate (componentName) {
const hasCommonElement = (arrA, arrB) => {
return arrA.some(item => arrB.includes(item))
}
const isSubset = (arrA, arrB) => {
// 检查arrB的每个元素是否都在arrA中
const setA = new Set(arrA);
return arrB.every(item => setA.has(item));
}
const type = {
staffdailyreport: 1,
storedailyreport: 2,
negotiationdetaillist: 3,
editnegotiationdetail: 3
}[componentName.toLowerCase()],
{ SCENE_TYPE, CAR_BRAND_ID, BASE_SCENE_CODE } = this,
data = await uni.$api.dailyTemplateApi.getDailyTemplate(type)
let templateData = Object.values(data)
.filter(item => {
// 场景类型过滤
return item.sceneType.length ? item.sceneType.includes(SCENE_TYPE) : true
})
.filter(item => {
// 品牌过滤
if (item.filterBrandId && item.filterBrandId.length) {
return !isSubset(item.filterBrandId, CAR_BRAND_ID)
} else {
return item.brandId.length ? hasCommonElement(item.brandId, CAR_BRAND_ID) : true
}
})
.filter(item => {
// 基础场景代码过滤
return item.baseSceneCode.length ? hasCommonElement(item.baseSceneCode, BASE_SCENE_CODE) : true
})
this.templateData = templateData
console.log(templateData)
},
setCurrentDate (currentDate) {
this.currentDate = currentDate
this.currentMonth = dayjs(currentDate).format('YYYY-MM')
},
backPage () {
uni.navigateBack()
},
// name:跳转组件名,val:跳转参数
jump (name, val) {
this.componentName = name
if (val) {
this.transmissionOfData = val
}
},
}
}
</script>
<style scoped lang="scss">
.nav-bar {
z-index: 1;
}
.detail-content {
display: flex;
height: calc(100vh - #{toRpx(212)});
.detail-left {
width: toRpx(656);
height: 100%;
border-radius: toRpx(48);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
margin-right: toRpx(32);
z-index: 1;
overflow: hidden;
.content {
padding: 0 toRpx(32);
height: calc(100% - #{toRpx(144)});
.banner {
width: 100%;
height: toRpx(256);
}
.calendar {
height: calc(100% - #{toRpx(304)});
background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.5) 100%);
margin-top: toRpx(48);
width: calc(100% + #{toRpx(64)});
margin-left: toMinusRpx(32);
padding: toRpx(72) toRpx(32) 0;
border-radius: toRpx(32) toRpx(32) 0 0;
}
}
}
.detail-right {
width: calc(100% - #{toRpx(684)});
height: 100%;
border-radius: toRpx(48);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
z-index: 1;
overflow: hidden;
}
.common-title {
display: flex;
align-items: center;
justify-content: space-between;
font-size: toRpx(32);
height: toRpx(144);
justify-content: start;
padding-left: toRpx(32);
.sprite-icon {
margin-right: toRpx(24);
}
&::before,
&::after {
display: none;
}
}
}
.error-order-title {
text-align: center;
color: #333333;
font-size: toRpx(40);
font-weight: 500;
}
.error-order-content {
text-align: center;
color: #666666;
font-size: toRpx(32);
font-weight: 400;
margin-top: toRpx(16);
}
.error-order-footer {
margin-top: toRpx(64);
margin-bottom: toRpx(48);
width: 100%;
.cancel {
height: toRpx(88);
border-radius: toRpx(64);
opacity: 1;
line-height: toRpx(88);
background: #f0f1f5;
width: toRpx(344);
text-align: center;
color: #1a1a1a;
font-size: toRpx(32);
font-weight: 400;
}
.sure {
height: toRpx(88);
border-radius: toRpx(64);
opacity: 1;
line-height: toRpx(88);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #fff;
font-size: toRpx(32);
font-weight: 500;
width: 100%;
text-align: center;
margin-left: toRpx(32);
margin-right: toRpx(32);
}
}
</style>
...@@ -11,7 +11,10 @@ ...@@ -11,7 +11,10 @@
}" }"
@click="choiceDate(weeks)" @click="choiceDate(weeks)"
> >
<view class="uni-calendar-item__weeks-box-item"> <view
class="uni-calendar-item__weeks-box-item"
:style="calendarItemStyle"
>
<text <text
v-if="selected&&weeks.extraInfo" v-if="selected&&weeks.extraInfo"
class="uni-calendar-item__weeks-box-circle" class="uni-calendar-item__weeks-box-circle"
...@@ -100,8 +103,14 @@ export default { ...@@ -100,8 +103,14 @@ export default {
lunar: { lunar: {
type: Boolean, type: Boolean,
default: false default: false
},
calendarItemStyle: {
type: Object,
default () {
return {}
} }
}, },
},
computed: { computed: {
todayText () { todayText () {
return t("uni-calender.today") return t("uni-calender.today")
...@@ -117,7 +126,7 @@ export default { ...@@ -117,7 +126,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
$uni-font-size-base: 14px; $uni-font-size-base: 14px;
$uni-text-color: #37393D; $uni-text-color: #37393d;
$uni-font-size-sm: 12px; $uni-font-size-sm: 12px;
$uni-color-error: #e43d33; $uni-color-error: #e43d33;
$uni-opacity-disabled: 0.3; $uni-opacity-disabled: 0.3;
...@@ -198,19 +207,19 @@ $uni-primary: #4673ff !default; ...@@ -198,19 +207,19 @@ $uni-primary: #4673ff !default;
// background-color: rgba($color: $uni-primary, $alpha: 0.8); // background-color: rgba($color: $uni-primary, $alpha: 0.8);
background-color: #ecf1ff; background-color: #ecf1ff;
// color: #37393D; // color: #37393D;
color: #4673FF; color: #4673ff;
.uni-calendar-item--multiple{ .uni-calendar-item--multiple {
background: none; background: none;
} }
// opacity: 0.8; // opacity: 0.8;
} }
.uni-calendar-item--before-checked { .uni-calendar-item--before-checked {
background-color: #4673FF; background-color: #4673ff;
color: #fff; color: #fff;
border-radius: toRpx(16); border-radius: toRpx(16);
} }
.uni-calendar-item--after-checked { .uni-calendar-item--after-checked {
background-color: #4673FF; background-color: #4673ff;
color: #fff; color: #fff;
border-radius: inherit; border-radius: inherit;
border-radius: toRpx(16); border-radius: toRpx(16);
......
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
:selected="selected" :selected="selected"
:lunar="lunar" :lunar="lunar"
@change="choiceDate" @change="choiceDate"
:calendarItemStyle="calendarItemStyle"
></calendar-item> ></calendar-item>
</view> </view>
</view> </view>
...@@ -242,8 +243,14 @@ export default { ...@@ -242,8 +243,14 @@ export default {
hideMask: { hideMask: {
type: Boolean, type: Boolean,
default: false default: false
},
calendarItemStyle: {
type: Object,
default () {
return {}
} }
}, },
},
data () { data () {
return { return {
show: false, show: false,
......
...@@ -14,13 +14,16 @@ class LocalLog { ...@@ -14,13 +14,16 @@ class LocalLog {
logger = null logger = null
logListener = null logListener = null
constructor() { constructor() {
// #ifdef APP-PLUS
this.logger = new LogCat() this.logger = new LogCat()
this.removeOverDays(90) this.removeOverDays(90)
// #endif
} }
setLogListener(listener) { setLogListener (listener) {
this.logListener = listener this.logListener = listener
} }
_write(level, msg) { _write (level, msg) {
// #ifdef APP-PLUS
this.logger.writeLog(level, msg) this.logger.writeLog(level, msg)
if (this.logListener) { if (this.logListener) {
try { try {
...@@ -29,37 +32,38 @@ class LocalLog { ...@@ -29,37 +32,38 @@ class LocalLog {
console.error('LocalLog listener error', e) console.error('LocalLog listener error', e)
} }
} }
// #endif
} }
debug(msg) { debug (msg) {
this._write(LogLevel.DEBUG, msg) this._write(LogLevel.DEBUG, msg)
} }
info(msg) { info (msg) {
this._write(LogLevel.INFO, msg) this._write(LogLevel.INFO, msg)
} }
warn(msg) { warn (msg) {
this._write(LogLevel.WARN, msg) this._write(LogLevel.WARN, msg)
} }
error(msg) { error (msg) {
this._write(LogLevel.ERROR, msg) this._write(LogLevel.ERROR, msg)
} }
getFiles(beginDate, endDate) { getFiles (beginDate, endDate) {
const logFiles = this.logger.getLogFileList() const logFiles = this.logger.getLogFileList()
if ((!beginDate && !endDate) || !logFiles.length) return logFiles if ((!beginDate && !endDate) || !logFiles.length) return logFiles
beginDate = +withinSpliter(beginDate) beginDate = +withinSpliter(beginDate)
endDate = +withinSpliter(endDate) endDate = +withinSpliter(endDate)
// prettier-ignore // prettier-ignore
const fileList = logFiles.reduce((list,{name,path}) => { const fileList = logFiles.reduce((list, { name, path }) => {
const fileDate= +withinSpliter(name.split('.').shift()) const fileDate = +withinSpliter(name.split('.').shift())
if(fileDate>=beginDate && fileDate<=endDate){ if (fileDate >= beginDate && fileDate <= endDate) {
list.push(path) list.push(path)
} }
return list return list
},[]); }, []);
// console.log('fileList', fileList) // console.log('fileList', fileList)
// this.logger.zip(fileList) // this.logger.zip(fileList)
return fileList return fileList
} }
removeOverDays(day = 7) { removeOverDays (day = 7) {
this.logger._cleanOldLogs(day) this.logger._cleanOldLogs(day)
// const logFiles = this.logger.getLogFileList() // const logFiles = this.logger.getLogFileList()
// if (!logFiles.length) return // if (!logFiles.length) return
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!