fix(ts): 修复 delete/联合类型/ECharts 等低风险类型错误
- delete 操作符改为解构 rest(afterSale/UserAftersale/OrderUpdatePrice 提交参数) - v-for 索引、createTime 等联合类型用 Number() 收敛 - ECharts axisLabel.textStyle → axisLabel.color(顺带让标签颜色真正生效) - AlipayChannelForm 证书上传抽取 readCertFile 并补 UploadRequestHandler 类型 - ExpressForm reset 对齐 DeliveryExpressVO(移除 picUrl、补 code/logo/sort) ts:check 795 → 768,无新增类型错误pull/885/MERGE
parent
0970806dca
commit
e58fe91a29
|
|
@ -1,6 +1,7 @@
|
|||
<script lang="tsx">
|
||||
import { PropType, nextTick, onBeforeUnmount, onMounted } from 'vue'
|
||||
import { ElMenu, ElScrollbar } from 'element-plus'
|
||||
import type { MenuInstance } from 'element-plus'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { usePermissionStore } from '@/store/modules/permission'
|
||||
import { useRenderMenuItem } from './components/useRenderMenuItem'
|
||||
|
|
@ -63,7 +64,7 @@ export default defineComponent({
|
|||
|
||||
const menuWrapRef = ref<HTMLElement>()
|
||||
|
||||
const menuRef = ref<InstanceType<typeof ElMenu>>()
|
||||
const menuRef = ref<MenuInstance>()
|
||||
|
||||
const menuMode = computed(
|
||||
(): 'vertical' | 'horizontal' =>
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ const getChatConversationList = async () => {
|
|||
conversationList.value = await ChatConversationApi.getChatConversationMyList()
|
||||
// 1.2 排序
|
||||
conversationList.value.sort((a, b) => {
|
||||
return b.createTime - a.createTime
|
||||
return Number(b.createTime || 0) - Number(a.createTime || 0)
|
||||
})
|
||||
// 1.3 没有任何对话情况
|
||||
if (conversationList.value.length === 0) {
|
||||
|
|
@ -254,7 +254,7 @@ const getConversationGroupByCreateTime = async (list: ChatConversationVO[]) => {
|
|||
continue
|
||||
}
|
||||
// 计算时间差(单位:毫秒)
|
||||
const diff = now - conversation.createTime
|
||||
const diff = now - Number(conversation.createTime || 0)
|
||||
// 根据时间间隔判断
|
||||
if (diff < oneDay) {
|
||||
groupMap['今天'].push(conversation)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
>
|
||||
<div v-for="(segment, index) in currentFile.segments" :key="index" class="mb-10px">
|
||||
<div class="text-gray-500 text-12px mb-5px">
|
||||
分片-{{ index + 1 }} · {{ segment.contentLength || 0 }} 字符数 ·
|
||||
分片-{{ Number(index) + 1 }} · {{ segment.contentLength || 0 }} 字符数 ·
|
||||
{{ segment.tokens || 0 }} Token
|
||||
</div>
|
||||
<div class="bg-white p-10px rounded-md">{{ segment.content }}</div>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
</el-descriptions>
|
||||
</ContentWrap>
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ProductForm ref="formRef" @success="emit('refresh')" />
|
||||
<ProductForm ref="formRef" @success="$emit('refresh')" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import ProductForm from '@/views/crm/product/ProductForm.vue'
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
<template #default="{ row }">
|
||||
<template v-if="row.atUserIds?.length">
|
||||
<span v-for="(userId, idx) in row.atUserIds" :key="userId">
|
||||
<span v-if="idx > 0">、</span>
|
||||
<span v-if="Number(idx) > 0">、</span>
|
||||
<template v-if="userId === IM_AT_ALL_USER_ID">@{{ IM_AT_ALL_NICKNAME }}</template>
|
||||
<template v-else>
|
||||
@{{ row.atUserNicknames?.[idx] || userId }}
|
||||
|
|
|
|||
|
|
@ -214,9 +214,7 @@ const lineChartOptions = reactive<EChartsOption>({
|
|||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#7F8B9C'
|
||||
}
|
||||
color: '#7F8B9C'
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
|
|
@ -235,9 +233,7 @@ const lineChartOptions = reactive<EChartsOption>({
|
|||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#7F8B9C'
|
||||
}
|
||||
color: '#7F8B9C'
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
|
|
|
|||
|
|
@ -213,11 +213,9 @@ const getList = async () => {
|
|||
try {
|
||||
const data = cloneDeep(queryParams)
|
||||
// 处理掉全部的状态,不传就是全部
|
||||
if (data.status === '0') {
|
||||
delete data.status
|
||||
}
|
||||
const queryData = data.status === '0' ? (({ status: _status, ...rest }) => rest)(data) : data
|
||||
// 执行查询
|
||||
const res = await AfterSaleApi.getAfterSalePage(data)
|
||||
const res = await AfterSaleApi.getAfterSalePage(queryData)
|
||||
list.value = res.list as AfterSaleApi.TradeAfterSaleVO[]
|
||||
total.value = res.total
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -117,8 +117,10 @@ const submitForm = async () => {
|
|||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
code: '',
|
||||
name: '',
|
||||
picUrl: '',
|
||||
logo: '',
|
||||
sort: 0,
|
||||
status: CommonStatusEnum.ENABLE
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
|
|
|||
|
|
@ -68,10 +68,8 @@ const submitForm = async () => {
|
|||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = cloneDeep(unref(formData))
|
||||
const { payPrice: _payPrice, newPayPrice: _newPayPrice, ...data } = cloneDeep(unref(formData))
|
||||
data.adjustPrice = convertToInteger(data.adjustPrice)
|
||||
delete data.payPrice
|
||||
delete data.newPayPrice
|
||||
await TradeOrderApi.updateOrderPrice(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
dialogVisible.value = false
|
||||
|
|
|
|||
|
|
@ -213,14 +213,12 @@ const getList = async () => {
|
|||
try {
|
||||
const data = cloneDeep(queryParams.value)
|
||||
// 处理掉全部的状态,不传就是全部
|
||||
if (data.status === '0') {
|
||||
delete data.status
|
||||
}
|
||||
const queryData = data.status === '0' ? (({ status: _status, ...rest }) => rest)(data) : data
|
||||
// 执行查询
|
||||
if (props.userId) {
|
||||
data.userId = props.userId as any
|
||||
queryData.userId = props.userId as any
|
||||
}
|
||||
const res = await AfterSaleApi.getAfterSalePage(data)
|
||||
const res = await AfterSaleApi.getAfterSalePage(queryData)
|
||||
list.value = res.list as AfterSaleApi.TradeAfterSaleVO[]
|
||||
total.value = res.total
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@
|
|||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||
import * as ChannelApi from '@/api/pay/channel'
|
||||
import type { UploadRequestHandler, UploadRequestOptions } from 'element-plus'
|
||||
|
||||
defineOptions({ name: 'AlipayChannelForm' })
|
||||
|
||||
|
|
@ -312,7 +313,7 @@ const resetForm = (appId, code) => {
|
|||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
const fileBeforeUpload = (file) => {
|
||||
const fileBeforeUpload = (file: File) => {
|
||||
let format = '.' + file.name.split('.')[1]
|
||||
if (format !== fileAccept) {
|
||||
message.error(`请上传指定格式"${fileAccept}"文件`)
|
||||
|
|
@ -325,27 +326,36 @@ const fileBeforeUpload = (file) => {
|
|||
return isRightSize
|
||||
}
|
||||
|
||||
const appCertUpload = (event) => {
|
||||
const readFile = new FileReader()
|
||||
readFile.onload = (e: any) => {
|
||||
formData.value.config.appCertContent = e.target.result
|
||||
}
|
||||
readFile.readAsText(event.file)
|
||||
const readCertFile = (
|
||||
event: UploadRequestOptions,
|
||||
setContent: (content: string) => void
|
||||
): Promise<void> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const readFile = new FileReader()
|
||||
readFile.onload = (e) => {
|
||||
setContent(String(e.target?.result || ''))
|
||||
resolve()
|
||||
}
|
||||
readFile.onerror = () => reject(readFile.error)
|
||||
readFile.readAsText(event.file)
|
||||
})
|
||||
}
|
||||
|
||||
const alipayPublicCertUpload = (event) => {
|
||||
const readFile = new FileReader()
|
||||
readFile.onload = (e: any) => {
|
||||
formData.value.config.alipayPublicCertContent = e.target.result
|
||||
}
|
||||
readFile.readAsText(event.file)
|
||||
const appCertUpload: UploadRequestHandler = (event) => {
|
||||
return readCertFile(event, (content) => {
|
||||
formData.value.config.appCertContent = content
|
||||
})
|
||||
}
|
||||
|
||||
const rootCertUpload = (event) => {
|
||||
const readFile = new FileReader()
|
||||
readFile.onload = (e: any) => {
|
||||
formData.value.config.rootCertContent = e.target.result
|
||||
}
|
||||
readFile.readAsText(event.file)
|
||||
const alipayPublicCertUpload: UploadRequestHandler = (event) => {
|
||||
return readCertFile(event, (content) => {
|
||||
formData.value.config.alipayPublicCertContent = content
|
||||
})
|
||||
}
|
||||
|
||||
const rootCertUpload: UploadRequestHandler = (event) => {
|
||||
return readCertFile(event, (content) => {
|
||||
formData.value.config.rootCertContent = content
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -25,19 +25,19 @@
|
|||
<div v-if="detailData.toMails && detailData.toMails.length > 0">
|
||||
收件:
|
||||
<span v-for="(mail, index) in detailData.toMails" :key="mail">
|
||||
{{ mail }}<span v-if="index < detailData.toMails.length - 1">、</span>
|
||||
{{ mail }}<span v-if="Number(index) < detailData.toMails.length - 1">、</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="detailData.ccMails && detailData.ccMails.length > 0">
|
||||
抄送:
|
||||
<span v-for="(mail, index) in detailData.ccMails" :key="mail">
|
||||
{{ mail }}<span v-if="index < detailData.ccMails.length - 1">、</span>
|
||||
{{ mail }}<span v-if="Number(index) < detailData.ccMails.length - 1">、</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="detailData.bccMails && detailData.bccMails.length > 0">
|
||||
密送:
|
||||
<span v-for="(mail, index) in detailData.bccMails" :key="mail">
|
||||
{{ mail }}<span v-if="index < detailData.bccMails.length - 1">、</span>
|
||||
{{ mail }}<span v-if="Number(index) < detailData.bccMails.length - 1">、</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -134,19 +134,19 @@
|
|||
<div v-if="scope.row.toMails && scope.row.toMails.length > 0">
|
||||
收件:
|
||||
<span v-for="(mail, index) in scope.row.toMails" :key="mail">
|
||||
{{ mail }}<span v-if="index < scope.row.toMails.length - 1">、</span>
|
||||
{{ mail }}<span v-if="Number(index) < scope.row.toMails.length - 1">、</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="scope.row.ccMails && scope.row.ccMails.length > 0">
|
||||
抄送:
|
||||
<span v-for="(mail, index) in scope.row.ccMails" :key="mail">
|
||||
{{ mail }}<span v-if="index < scope.row.ccMails.length - 1">、</span>
|
||||
{{ mail }}<span v-if="Number(index) < scope.row.ccMails.length - 1">、</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="scope.row.bccMails && scope.row.bccMails.length > 0">
|
||||
密送:
|
||||
<span v-for="(mail, index) in scope.row.bccMails" :key="mail">
|
||||
{{ mail }}<span v-if="index < scope.row.bccMails.length - 1">、</span>
|
||||
{{ mail }}<span v-if="Number(index) < scope.row.bccMails.length - 1">、</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue