diff --git a/src/pages/statistic/bill/creditInstallmentAnalysis/index.vue b/src/pages/statistic/bill/creditInstallmentAnalysis/index.vue index a305ecc..183706d 100644 --- a/src/pages/statistic/bill/creditInstallmentAnalysis/index.vue +++ b/src/pages/statistic/bill/creditInstallmentAnalysis/index.vue @@ -22,6 +22,12 @@ > 本月 + + 下月 + 近6月 - - 近1年 - @@ -561,6 +561,13 @@ function searchSubmit() { const firstDay = new Date(today.getFullYear(), today.getMonth(), 1) const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0) + startTime = dayjs(firstDay).format(formatValue) + endTime = dayjs(lastDay).format(formatValue) + } else if (type === 'nextMonth') { + // 下月:下月1号到下月月底 + const firstDay = new Date(today.getFullYear(), today.getMonth() + 1, 1) + const lastDay = new Date(today.getFullYear(), today.getMonth() + 2, 0) + startTime = dayjs(firstDay).format(formatValue) endTime = dayjs(lastDay).format(formatValue) } else if (type === 'threeMonth') { @@ -575,13 +582,6 @@ function searchSubmit() { const firstDay = new Date(today.getFullYear(), today.getMonth(), 1) const lastDay = new Date(today.getFullYear(), today.getMonth() + 6, 0) - startTime = dayjs(firstDay).format(formatValue) - endTime = dayjs(lastDay).format(formatValue) - } else if (type === 'oneYear') { - // 近1年:本月1号到11个月后的月底 - const firstDay = new Date(today.getFullYear(), today.getMonth(), 1) - const lastDay = new Date(today.getFullYear(), today.getMonth() + 12, 0) - startTime = dayjs(firstDay).format(formatValue) endTime = dayjs(lastDay).format(formatValue) } @@ -613,7 +613,9 @@ const end = new Date(today.getFullYear(), today.getMonth() + 1, 0) function getList() { getInstallmentHistoryAnalysis({...queryParams.value }).then(res => { historyObj.value = { ...res.data } - listData.value = listData.value.concat(res.data.tableHistoryDetailList) + // 将获取的数据倒序排列后再添加到列表 + const reversedData = res.data.tableHistoryDetailList ? [...res.data.tableHistoryDetailList].reverse() : [] + listData.value = listData.value.concat(reversedData) }).catch(() => { }) } diff --git a/src/pages/statistic/bill/onlineLendAnalysis/index.vue b/src/pages/statistic/bill/onlineLendAnalysis/index.vue index 8896aef..cf580cf 100644 --- a/src/pages/statistic/bill/onlineLendAnalysis/index.vue +++ b/src/pages/statistic/bill/onlineLendAnalysis/index.vue @@ -23,6 +23,12 @@ > 本月 + + 下月 + 近6月 - - 近1年 - @@ -563,6 +563,13 @@ function searchSubmit() { const firstDay = new Date(today.getFullYear(), today.getMonth(), 1) const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0) + startTime = dayjs(firstDay).format(formatValue) + endTime = dayjs(lastDay).format(formatValue) + } else if (type === 'nextMonth') { + // 下月:下月1号到下月月底 + const firstDay = new Date(today.getFullYear(), today.getMonth() + 1, 1) + const lastDay = new Date(today.getFullYear(), today.getMonth() + 2, 0) + startTime = dayjs(firstDay).format(formatValue) endTime = dayjs(lastDay).format(formatValue) } else if (type === 'threeMonth') { @@ -577,13 +584,6 @@ function searchSubmit() { const firstDay = new Date(today.getFullYear(), today.getMonth(), 1) const lastDay = new Date(today.getFullYear(), today.getMonth() + 6, 0) - startTime = dayjs(firstDay).format(formatValue) - endTime = dayjs(lastDay).format(formatValue) - } else if (type === 'oneYear') { - // 近1年:本月1号到11个月后的月底 - const firstDay = new Date(today.getFullYear(), today.getMonth(), 1) - const lastDay = new Date(today.getFullYear(), today.getMonth() + 12, 0) - startTime = dayjs(firstDay).format(formatValue) endTime = dayjs(lastDay).format(formatValue) } @@ -616,7 +616,9 @@ function searchSubmit() { function getList() { getInstallmentHistoryAnalysis({...queryParams.value }).then(res => { historyObj.value = { ...res.data } - listData.value = listData.value.concat(res.data.tableHistoryDetailList) + // 将获取的数据倒序排列后再添加到列表 + const reversedData = res.data.tableHistoryDetailList ? [...res.data.tableHistoryDetailList].reverse() : [] + listData.value = listData.value.concat(reversedData) }).catch(() => { }) } diff --git a/src/pages/work/heartJourney/addEdit.vue b/src/pages/work/heartJourney/addEdit.vue index be5cdc3..870ecc1 100644 --- a/src/pages/work/heartJourney/addEdit.vue +++ b/src/pages/work/heartJourney/addEdit.vue @@ -25,8 +25,55 @@ - + + + + B + + + I + + + U + + + + H1 + + + H2 + + + + 1. + + + + + + + + + + + + + + + {{ contentLength }}/20000 + + @@ -60,6 +107,8 @@ const datePickShow = ref(false) const showTeam = ref(false) const title = ref("心路历程") const journeyTypeList = ref([]) +const editorCtx = ref(null) +const contentLength = ref(0) const data = reactive({ form: {}, rules: { @@ -83,6 +132,68 @@ onLoad((option) => { onReady(() => { form.value.createTime = dayjs(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss") }) + + // 编辑器初始化完成 + function onEditorReady() { + uni.createSelectorQuery().select('#editor').context((res) => { + editorCtx.value = res.context + // 如果是编辑模式,设置初始内容 + if (form.value.remark) { + editorCtx.value.setContents({ + html: form.value.remark + }) + } + }).exec() + } + + // 编辑器内容变化 + function onEditorInput(e) { + // 获取HTML内容 + editorCtx.value.getContents({ + success: (res) => { + form.value.remark = res.html + // 计算内容长度(去除HTML标签) + const text = res.text || '' + contentLength.value = text.length + } + }) + } + + // 编辑器获得焦点 + function editorFocus() { + // 可以添加焦点样式 + } + + // 编辑器失去焦点 + function editorBlur() { + // 保存内容 + if (editorCtx.value) { + editorCtx.value.getContents({ + success: (res) => { + form.value.remark = res.html + } + }) + } + } + + // 格式化文本 + function format(name, value) { + if (!editorCtx.value) return + + editorCtx.value.format(name, value) + } + + // 撤销 + function undo() { + if (!editorCtx.value) return + editorCtx.value.undo() + } + + // 重做 + function redo() { + if (!editorCtx.value) return + editorCtx.value.redo() + } function getDict() { // 类型 getDicts('journey_type').then(res => { @@ -95,7 +206,12 @@ onLoad((option) => { getDicts('journey_type').then(result => { form.value.typeName=dictStr(form.value.type, result.data) }) - + // 如果编辑器已经初始化,设置内容 + if (editorCtx.value && form.value.remark) { + editorCtx.value.setContents({ + html: form.value.remark + }) + } }) } } @@ -135,6 +251,21 @@ onLoad((option) => { datePickShow.value = false } function submit() { + // 提交前确保获取最新的编辑器内容 + if (editorCtx.value) { + editorCtx.value.getContents({ + success: (res) => { + form.value.remark = res.html + // 执行表单验证和提交 + doSubmit() + } + }) + } else { + doSubmit() + } + } + + function doSubmit() { proxy.$refs['uForm'].validate().then(() => { if (form.value.id != null) { updateHeartJourney(form.value).then(res => { @@ -194,6 +325,86 @@ onLoad((option) => { } } } + + .editor-container { + border: 2rpx solid #e8edf3; + border-radius: 12rpx; + overflow: hidden; + background: #ffffff; + + .editor-toolbar { + display: flex; + align-items: center; + padding: 12rpx; + background: #f8f9fa; + border-bottom: 2rpx solid #e8edf3; + flex-wrap: wrap; + gap: 8rpx; + + .toolbar-item { + display: flex; + align-items: center; + justify-content: center; + width: 56rpx; + height: 56rpx; + background: #ffffff; + border-radius: 8rpx; + border: 2rpx solid #e8edf3; + transition: all 0.3s ease; + + &:active { + transform: scale(0.95); + background: #667eea; + border-color: #667eea; + + .iconfont { + color: #ffffff; + } + } + + .iconfont { + font-size: 28rpx; + font-weight: 600; + color: #333333; + + &.italic { + font-style: italic; + } + + &.underline { + text-decoration: underline; + } + } + } + + .toolbar-divider { + width: 2rpx; + height: 40rpx; + background: #e8edf3; + margin: 0 4rpx; + } + } + + .editor-content { + min-height: 400rpx; + padding: 20rpx; + font-size: 28rpx; + line-height: 1.6; + background: #ffffff; + } + + .editor-counter { + padding: 12rpx 20rpx; + background: #f8f9fa; + border-top: 2rpx solid #e8edf3; + text-align: right; + + text { + font-size: 24rpx; + color: #999999; + } + } + }