diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index 34241ee28..b7c665490 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -20,7 +20,7 @@ "build:analyze": "pnpm vite build --mode analyze", "dev": "pnpm vite --mode development", "preview": "vite preview", - "typecheck": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vue-tsc --noEmit --skipLibCheck --incremental --tsBuildInfoFile node_modules/.cache/vue-tsc/tsconfig.tsbuildinfo" + "typecheck": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vue-tsc --noEmit --skipLibCheck" }, "imports": { "#/*": "./src/*" diff --git a/apps/web-antd/src/api/im/friend/request/index.ts b/apps/web-antd/src/api/im/friend/request/index.ts index e57e4a5f2..726f09e88 100644 --- a/apps/web-antd/src/api/im/friend/request/index.ts +++ b/apps/web-antd/src/api/im/friend/request/index.ts @@ -55,7 +55,7 @@ export function refuseFriendRequest( /** 查询「我相关」的好友申请列表(游标分页:传 maxId 加载更多) */ export function getMyFriendRequestList(limit: number, maxId?: number) { const params: Record = { limit }; - if (maxId != null) { + if (maxId) { params.maxId = maxId; } return requestClient.get( diff --git a/apps/web-antd/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js b/apps/web-antd/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js index b8f1dfef7..fcc698646 100644 --- a/apps/web-antd/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js +++ b/apps/web-antd/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js @@ -77,7 +77,7 @@ ContextPadProvider.$inject = [ ContextPadProvider.prototype.getContextPadEntries = function (element) { const autoPlace = this._autoPlace; - const canvas = this._canvas; + // const canvas = this._canvas; const connect = this._connect; const contextPad = this._contextPad; const create = this._create; @@ -103,25 +103,25 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) { modeling.removeElements([element]); } - function getReplaceMenuPosition(element) { - const Y_OFFSET = 5; + // function getReplaceMenuPosition(element) { + // const Y_OFFSET = 5; - const diagramContainer = canvas.getContainer(); - const pad = contextPad.getPad(element).html; + // const diagramContainer = canvas.getContainer(); + // const pad = contextPad.getPad(element).html; - const diagramRect = diagramContainer.getBoundingClientRect(); - const padRect = pad.getBoundingClientRect(); + // const diagramRect = diagramContainer.getBoundingClientRect(); + // const padRect = pad.getBoundingClientRect(); - const top = padRect.top - diagramRect.top; - const left = padRect.left - diagramRect.left; + // const top = padRect.top - diagramRect.top; + // const left = padRect.left - diagramRect.left; - const pos = { - x: left, - y: top + padRect.height + Y_OFFSET, - }; + // const pos = { + // x: left, + // y: top + padRect.height + Y_OFFSET, + // }; - return pos; - } + // return pos; + // } /** * Create an append action @@ -335,11 +335,7 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) { title: '修改类型', action: { click(event, element) { - const position = Object.assign(getReplaceMenuPosition(element), { - cursor: { x: event.x, y: event.y }, - }); - - popupMenu.open(element, 'bpmn-replace', position); + popupMenu.open(element, 'bpmn-replace', { x: event.x, y: event.y }); }, }, }, diff --git a/apps/web-antd/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue b/apps/web-antd/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue index 3ee29c1a2..2f1ab36d4 100644 --- a/apps/web-antd/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue +++ b/apps/web-antd/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue @@ -237,10 +237,10 @@ const selectProcessListener = (listener: any) => { bpmnElement.businessObject?.extensionElements?.values?.filter( (ex: any) => ex.$type !== `${prefix}:TaskListener`, ) ?? []; - updateElementExtensions( - bpmnElement, - [...otherExtensionList.value, ...bpmnElementListeners.value], - ); + updateElementExtensions(bpmnElement, [ + ...otherExtensionList.value, + ...bpmnElementListeners.value, + ]); }; const [ListenerDrawer, listenerDrawerApi] = useVbenDrawer({ diff --git a/apps/web-antd/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue b/apps/web-antd/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue index 403a7932c..f5fee1128 100644 --- a/apps/web-antd/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue +++ b/apps/web-antd/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue @@ -259,14 +259,14 @@ function updateFormFieldKey( ) { if (!formSetting?.updateFormFields || !newKey) return; const value = formSetting.updateFormFields[oldKey]; - delete formSetting.updateFormFields[oldKey]; + Reflect.deleteProperty(formSetting.updateFormFields, oldKey); formSetting.updateFormFields[String(newKey)] = value; } /** 删除修改字段设置项 */ function deleteFormFieldSetting(formSetting: FormTriggerSetting, key: string) { if (!formSetting?.updateFormFields) return; - delete formSetting.updateFormFields[key]; + Reflect.deleteProperty(formSetting.updateFormFields, key); } /** 保存配置 */ diff --git a/apps/web-antd/src/views/bpm/processInstance/detail/modules/time-line.vue b/apps/web-antd/src/views/bpm/processInstance/detail/modules/time-line.vue index 58c9e3acc..2ad3faeb8 100644 --- a/apps/web-antd/src/views/bpm/processInstance/detail/modules/time-line.vue +++ b/apps/web-antd/src/views/bpm/processInstance/detail/modules/time-line.vue @@ -430,7 +430,9 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
审批意见:{{ task.reason }}
diff --git a/apps/web-antd/src/views/im/home/components/picker/conversation-picker-panel.vue b/apps/web-antd/src/views/im/home/components/picker/conversation-picker-panel.vue index 767128b01..085b0a2e7 100644 --- a/apps/web-antd/src/views/im/home/components/picker/conversation-picker-panel.vue +++ b/apps/web-antd/src/views/im/home/components/picker/conversation-picker-panel.vue @@ -4,6 +4,7 @@ import type { Conversation } from '../../types'; import { computed, ref } from 'vue'; import { IconifyIcon as Icon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Input, message } from 'ant-design-vue'; @@ -81,7 +82,7 @@ const recentForwardConversations = computed(() => .map((key) => byKey.value.get(key)) .filter( (c): c is Conversation => - c != null && !hideSet.value.has(getConversationKey(c)), + !isUndefined(c) && !hideSet.value.has(getConversationKey(c)), ), ); @@ -96,7 +97,7 @@ const selectedConversations = computed(() => .map((key) => byKey.value.get(key)) .filter( (conversation): conversation is Conversation => - conversation != null && + !isUndefined(conversation) && !hideSet.value.has(getConversationKey(conversation)), ), ); diff --git a/apps/web-antd/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue b/apps/web-antd/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue index 6ceef33e7..cafb6cad4 100644 --- a/apps/web-antd/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue +++ b/apps/web-antd/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue @@ -7,6 +7,7 @@ import { computed, ref, watch } from 'vue'; import { confirm } from '@vben/common-ui'; import { CommonStatusEnum } from '@vben/constants'; import { IconifyIcon as Icon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Button, @@ -95,13 +96,10 @@ const myId = computed(() => getCurrentUserId()); /** 历史退群群:禁所有群操作入口(邀请 / 移出 / 改资料 / 禁言 / 审批 / 退出等),只保留展示;props.group 是 GroupLite 无 joinStatus,回 store 取全量 */ const isQuitGroup = computed(() => { const id = props.group?.id; - return id != null && isGroupQuit(groupStore.getGroup(id)); + return !isUndefined(id) && isGroupQuit(groupStore.getGroup(id)); }); const isOwner = computed( - () => - !isQuitGroup.value && - props.group != null && - props.group.ownerId === myId.value, + () => !isQuitGroup.value && props.group?.ownerId === myId.value, ); /** 当前用户在群里的角色(来自 props.members 的 me 行);用于判定是否可移出他人 */ const myRole = computed( diff --git a/apps/web-antd/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue b/apps/web-antd/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue index 6c38ee84c..8193fd428 100644 --- a/apps/web-antd/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue +++ b/apps/web-antd/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue @@ -5,6 +5,7 @@ import { computed } from 'vue'; import { confirm } from '@vben/common-ui'; import { IconifyIcon as Icon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Tag } from 'ant-design-vue'; @@ -86,7 +87,7 @@ const showSendName = computed(() => { return false; } const lastType = props.conversation.lastMessageType; - return lastType != null && isNormalMessage(lastType); + return !isUndefined(lastType) && isNormalMessage(lastType); }); /** 列表展示文案:草稿优先(对齐微信 PC:有草稿时盖掉最后一条预览)→ 撤回实时算 → lastContent 兜底 */ @@ -96,7 +97,7 @@ const lastContentDisplay = computed(() => { } if ( props.conversation.lastMessageType === ImContentType.RECALL && - props.conversation.lastSenderId != null + !isUndefined(props.conversation.lastSenderId) ) { return buildRecallTip( props.conversation.lastSenderId, diff --git a/apps/web-antd/src/views/im/home/pages/conversation/components/message/message-item.vue b/apps/web-antd/src/views/im/home/pages/conversation/components/message/message-item.vue index e58691790..2ab61b5ad 100644 --- a/apps/web-antd/src/views/im/home/pages/conversation/components/message/message-item.vue +++ b/apps/web-antd/src/views/im/home/pages/conversation/components/message/message-item.vue @@ -13,6 +13,7 @@ import { computed, inject } from 'vue'; import { confirm } from '@vben/common-ui'; import { IconifyIcon as Icon } from '@vben/icons'; import { useUserStore } from '@vben/stores'; +import { isUndefined } from '@vben/utils'; import { useClipboard } from '@vueuse/core'; import { message as antdMessage, Tag } from 'ant-design-vue'; @@ -251,7 +252,7 @@ const redialRtcCall = inject(IM_RTC_REDIAL_KEY); /** 私聊 RTC_CALL_END 气泡点击:用同款 mediaType 重拨 */ function handleRtcCallBubbleClick() { const mediaType = rtcCallEndPrivatePayload.value?.mediaType; - if (mediaType == null) { + if (isUndefined(mediaType)) { return; } redialRtcCall?.(mediaType); diff --git a/apps/web-antd/src/views/im/manager/group/components/select.vue b/apps/web-antd/src/views/im/manager/group/components/select.vue index 6903c2bdc..d29643912 100644 --- a/apps/web-antd/src/views/im/manager/group/components/select.vue +++ b/apps/web-antd/src/views/im/manager/group/components/select.vue @@ -4,6 +4,7 @@ import type { ImManagerGroupApi } from '#/api/im/manager/group'; import { computed, ref, useAttrs, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Input, Tooltip } from 'ant-design-vue'; @@ -47,13 +48,13 @@ const showClear = computed(() => { props.allowClear && !props.disabled && hovering.value && - props.modelValue != null + props.modelValue !== null ); }); /** 根据编号查询群信息(用于编辑回显) */ async function resolveItemById(id: number | undefined) { - if (id == null) { + if (isUndefined(id)) { selectedItem.value = undefined; return; } @@ -83,7 +84,9 @@ function handleClick(event: MouseEvent) { clearSelected(); return; } - dialogRef.value?.open(props.modelValue == null ? [] : [props.modelValue]); + dialogRef.value?.open( + isUndefined(props.modelValue) ? [] : [props.modelValue], + ); } /** 弹窗选中回调 */ diff --git a/apps/web-antd/src/views/im/utils/pull.ts b/apps/web-antd/src/views/im/utils/pull.ts index 76c9af1ec..6524af26b 100644 --- a/apps/web-antd/src/views/im/utils/pull.ts +++ b/apps/web-antd/src/views/im/utils/pull.ts @@ -1,3 +1,5 @@ +import { isUndefined } from '@vben/utils'; + import { getDb } from './db'; /** @@ -54,16 +56,15 @@ export async function runIncrementalPull( ): Promise { const storedCursor = await getPullCursor(cursorKey); const highWater = { ...storedCursor }; - let cursor = - storedCursor.lastUpdateTime == null - ? {} - : { - lastUpdateTime: Math.max( - 0, - storedCursor.lastUpdateTime - PULL_OVERLAP_MS, - ), - lastId: 0, - }; + let cursor = isUndefined(storedCursor.lastUpdateTime) + ? {} + : { + lastUpdateTime: Math.max( + 0, + storedCursor.lastUpdateTime - PULL_OVERLAP_MS, + ), + lastId: 0, + }; for (let page = 0; page < PULL_MAX_PAGES; page++) { if (isActive && !isActive()) { return; @@ -89,12 +90,12 @@ export async function runIncrementalPull( if (!last) { return; } - if (last.updateTime == null) { + if (isUndefined(last.updateTime)) { return; } cursor = { lastUpdateTime: last.updateTime, lastId: last.id }; if ( - highWater.lastUpdateTime == null || + isUndefined(highWater.lastUpdateTime) || cursor.lastUpdateTime > highWater.lastUpdateTime || (cursor.lastUpdateTime === highWater.lastUpdateTime && cursor.lastId > (highWater.lastId ?? 0)) @@ -154,14 +155,14 @@ export async function runMinIdPull(options: { // 本批最大消息 id 作为下次游标;无有效 id 则本批 apply 后停(无法继续翻页) const validIds = list .map((record) => record.id) - .filter((id): id is number => id != null); + .filter((id): id is number => id !== null); const nextMinId = validIds.length > 0 ? Math.max(...validIds) : undefined; // applyPage 返回 false:本页未落地(如入库失败),不推进游标并终止,避免漏消息 if ((await applyPage(list, nextMinId)) === false) { return; } // 无有效 id,或游标没前进(后端契约是 id > minId,理论不会出现):停,防御死翻 - if (nextMinId == null || nextMinId <= minId) { + if (isUndefined(nextMinId) || nextMinId <= minId) { return; } minId = nextMinId; diff --git a/apps/web-antd/src/views/mall/product/spu/components/spu-showcase.vue b/apps/web-antd/src/views/mall/product/spu/components/spu-showcase.vue index f9a08cef6..f2c21fb9c 100644 --- a/apps/web-antd/src/views/mall/product/spu/components/spu-showcase.vue +++ b/apps/web-antd/src/views/mall/product/spu/components/spu-showcase.vue @@ -5,6 +5,7 @@ import type { MallSpuApi } from '#/api/mall/product/spu'; import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Image, Tooltip } from 'ant-design-vue'; @@ -58,7 +59,9 @@ watch( // 只有商品发生变化时才重新查询 if ( productSpus.value.length === 0 || - productSpus.value.some((spu) => spu.id == null || !ids.includes(spu.id)) + productSpus.value.some( + (spu) => isUndefined(spu.id) || !ids.includes(spu.id), + ) ) { productSpus.value = await getSpuDetailList(ids); } diff --git a/apps/web-antd/src/views/mall/promotion/combination/components/showcase.vue b/apps/web-antd/src/views/mall/promotion/combination/components/showcase.vue index 41834033b..45d4e795e 100644 --- a/apps/web-antd/src/views/mall/promotion/combination/components/showcase.vue +++ b/apps/web-antd/src/views/mall/promotion/combination/components/showcase.vue @@ -5,6 +5,7 @@ import type { MallCombinationActivityApi } from '#/api/mall/promotion/combinatio import { computed, ref, watch } from 'vue'; import { CloseCircleFilled, PlusOutlined } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Image, Tooltip } from 'ant-design-vue'; @@ -60,7 +61,7 @@ watch( if ( activityList.value.length === 0 || activityList.value.some( - (activity) => activity.id == null || !ids.includes(activity.id), + (activity) => isUndefined(activity.id) || !ids.includes(activity.id), ) ) { activityList.value = await getCombinationActivityListByIds(ids); diff --git a/apps/web-antd/src/views/mall/promotion/point/components/showcase.vue b/apps/web-antd/src/views/mall/promotion/point/components/showcase.vue index 9cb2d74a1..6a0b83b4c 100644 --- a/apps/web-antd/src/views/mall/promotion/point/components/showcase.vue +++ b/apps/web-antd/src/views/mall/promotion/point/components/showcase.vue @@ -5,6 +5,7 @@ import type { MallPointActivityApi } from '#/api/mall/promotion/point'; import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Image, Tooltip } from 'ant-design-vue'; @@ -54,7 +55,9 @@ watch( // 只有活动发生变化时才重新查询 if ( pointActivityList.value.length === 0 || - pointActivityList.value.some((activity) => !ids.includes(activity.id)) + pointActivityList.value.some( + (activity) => isUndefined(activity.id) || !ids.includes(activity.id), + ) ) { pointActivityList.value = await getPointActivityListByIds(ids); } diff --git a/apps/web-antd/src/views/mall/promotion/seckill/components/showcase.vue b/apps/web-antd/src/views/mall/promotion/seckill/components/showcase.vue index c0fcbf126..1424d9f8d 100644 --- a/apps/web-antd/src/views/mall/promotion/seckill/components/showcase.vue +++ b/apps/web-antd/src/views/mall/promotion/seckill/components/showcase.vue @@ -5,6 +5,7 @@ import type { MallSeckillActivityApi } from '#/api/mall/promotion/seckill/seckil import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Image, Tooltip } from 'ant-design-vue'; @@ -59,7 +60,7 @@ watch( if ( activityList.value.length === 0 || activityList.value.some( - (activity) => activity.id == null || !ids.includes(activity.id), + (activity) => isUndefined(activity.id) || !ids.includes(activity.id), ) ) { activityList.value = await getSeckillActivityListByIds(ids as number[]); diff --git a/apps/web-antd/src/views/mall/statistics/product/modules/rank-card.vue b/apps/web-antd/src/views/mall/statistics/product/modules/rank-card.vue index ea58c3986..e90d201dd 100644 --- a/apps/web-antd/src/views/mall/statistics/product/modules/rank-card.vue +++ b/apps/web-antd/src/views/mall/statistics/product/modules/rank-card.vue @@ -28,7 +28,10 @@ const handleDateRangeChange = (times?: [Dayjs, Dayjs]) => { formatDateTime(times[0]) as string, formatDateTime(times[1]) as string, ]; - gridApi.query(); + // ShortcutDateRangePicker 初始化会先触发 change,此时 Grid 可能还没 mount:https://gitee.com/yudaocode/yudao-ui-admin-vben/issues/IJXOKO + if (typeof gridApi.grid?.commitProxy === 'function') { + gridApi.query(); + } }; const columns: VxeTableGridOptions['columns'] = [ diff --git a/apps/web-antd/src/views/mes/wm/itemreceipt/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/itemreceipt/modules/line-list.vue index 4a7335bbd..b602b2e2c 100644 --- a/apps/web-antd/src/views/mes/wm/itemreceipt/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/itemreceipt/modules/line-list.vue @@ -54,7 +54,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/mes/wm/outsourceissue/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/outsourceissue/modules/line-list.vue index bac3f088d..8099f6bd9 100644 --- a/apps/web-antd/src/views/mes/wm/outsourceissue/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/outsourceissue/modules/line-list.vue @@ -52,7 +52,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/mes/wm/outsourcereceipt/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/outsourcereceipt/modules/line-list.vue index 43e0371a0..9d5657791 100644 --- a/apps/web-antd/src/views/mes/wm/outsourcereceipt/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/outsourcereceipt/modules/line-list.vue @@ -53,7 +53,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/mes/wm/productissue/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/productissue/modules/line-list.vue index 8ca8a2424..8a530127e 100644 --- a/apps/web-antd/src/views/mes/wm/productissue/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/productissue/modules/line-list.vue @@ -52,7 +52,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/mes/wm/productreceipt/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/productreceipt/modules/line-list.vue index 2c923cf4f..bb2a2f0ee 100644 --- a/apps/web-antd/src/views/mes/wm/productreceipt/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/productreceipt/modules/line-list.vue @@ -55,7 +55,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/mes/wm/productsales/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/productsales/modules/line-list.vue index fc4a42b69..0c2744a1d 100644 --- a/apps/web-antd/src/views/mes/wm/productsales/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/productsales/modules/line-list.vue @@ -53,7 +53,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/mes/wm/returnissue/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/returnissue/modules/line-list.vue index b17b61334..a0a4fd6c7 100644 --- a/apps/web-antd/src/views/mes/wm/returnissue/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/returnissue/modules/line-list.vue @@ -55,7 +55,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/mes/wm/returnsales/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/returnsales/modules/line-list.vue index 229b85852..e1026d1cd 100644 --- a/apps/web-antd/src/views/mes/wm/returnsales/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/returnsales/modules/line-list.vue @@ -55,7 +55,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/mes/wm/returnvendor/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/returnvendor/modules/line-list.vue index 6ea7c1035..25133b41c 100644 --- a/apps/web-antd/src/views/mes/wm/returnvendor/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/returnvendor/modules/line-list.vue @@ -54,7 +54,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/mes/wm/transfer/modules/line-list.vue b/apps/web-antd/src/views/mes/wm/transfer/modules/line-list.vue index fb0c75e09..12b849a07 100644 --- a/apps/web-antd/src/views/mes/wm/transfer/modules/line-list.vue +++ b/apps/web-antd/src/views/mes/wm/transfer/modules/line-list.vue @@ -52,7 +52,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antd/src/views/wms/order/check/index.vue b/apps/web-antd/src/views/wms/order/check/index.vue index b9321d7ec..40c6c6a89 100644 --- a/apps/web-antd/src/views/wms/order/check/index.vue +++ b/apps/web-antd/src/views/wms/order/check/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { message } from 'ant-design-vue'; @@ -68,7 +72,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getCheckOrderDetailListByOrderId(key); } diff --git a/apps/web-antd/src/views/wms/order/movement/index.vue b/apps/web-antd/src/views/wms/order/movement/index.vue index 958342f06..a178f3f1b 100644 --- a/apps/web-antd/src/views/wms/order/movement/index.vue +++ b/apps/web-antd/src/views/wms/order/movement/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { message } from 'ant-design-vue'; @@ -61,7 +65,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getMovementOrderDetailListByOrderId(key); } diff --git a/apps/web-antd/src/views/wms/order/receipt/index.vue b/apps/web-antd/src/views/wms/order/receipt/index.vue index 3c49b376e..7e783aed9 100644 --- a/apps/web-antd/src/views/wms/order/receipt/index.vue +++ b/apps/web-antd/src/views/wms/order/receipt/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { message } from 'ant-design-vue'; @@ -61,7 +65,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getReceiptOrderDetailListByOrderId(key); } diff --git a/apps/web-antd/src/views/wms/order/shipment/index.vue b/apps/web-antd/src/views/wms/order/shipment/index.vue index 0e9e41be1..6e3a6bfbb 100644 --- a/apps/web-antd/src/views/wms/order/shipment/index.vue +++ b/apps/web-antd/src/views/wms/order/shipment/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { message } from 'ant-design-vue'; @@ -61,7 +65,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getShipmentOrderDetailListByOrderId(key); } diff --git a/apps/web-antdv-next/package.json b/apps/web-antdv-next/package.json index 257e584dc..a6624a156 100644 --- a/apps/web-antdv-next/package.json +++ b/apps/web-antdv-next/package.json @@ -20,7 +20,7 @@ "build:analyze": "pnpm vite build --mode analyze", "dev": "pnpm vite --mode development", "preview": "vite preview", - "typecheck": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vue-tsc --noEmit --skipLibCheck --incremental --tsBuildInfoFile node_modules/.cache/vue-tsc/tsconfig.tsbuildinfo" + "typecheck": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vue-tsc --noEmit --skipLibCheck" }, "imports": { "#/*": "./src/*" diff --git a/apps/web-antdv-next/src/api/im/friend/request/index.ts b/apps/web-antdv-next/src/api/im/friend/request/index.ts index e57e4a5f2..7b72fb358 100644 --- a/apps/web-antdv-next/src/api/im/friend/request/index.ts +++ b/apps/web-antdv-next/src/api/im/friend/request/index.ts @@ -1,3 +1,5 @@ +import { isUndefined } from '@vben/utils'; + import { requestClient } from '#/api/request'; export namespace ImFriendRequestApi { @@ -55,7 +57,7 @@ export function refuseFriendRequest( /** 查询「我相关」的好友申请列表(游标分页:传 maxId 加载更多) */ export function getMyFriendRequestList(limit: number, maxId?: number) { const params: Record = { limit }; - if (maxId != null) { + if (!isUndefined(maxId)) { params.maxId = maxId; } return requestClient.get( diff --git a/apps/web-antdv-next/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js b/apps/web-antdv-next/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js index b8f1dfef7..fcc698646 100644 --- a/apps/web-antdv-next/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js +++ b/apps/web-antdv-next/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js @@ -77,7 +77,7 @@ ContextPadProvider.$inject = [ ContextPadProvider.prototype.getContextPadEntries = function (element) { const autoPlace = this._autoPlace; - const canvas = this._canvas; + // const canvas = this._canvas; const connect = this._connect; const contextPad = this._contextPad; const create = this._create; @@ -103,25 +103,25 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) { modeling.removeElements([element]); } - function getReplaceMenuPosition(element) { - const Y_OFFSET = 5; + // function getReplaceMenuPosition(element) { + // const Y_OFFSET = 5; - const diagramContainer = canvas.getContainer(); - const pad = contextPad.getPad(element).html; + // const diagramContainer = canvas.getContainer(); + // const pad = contextPad.getPad(element).html; - const diagramRect = diagramContainer.getBoundingClientRect(); - const padRect = pad.getBoundingClientRect(); + // const diagramRect = diagramContainer.getBoundingClientRect(); + // const padRect = pad.getBoundingClientRect(); - const top = padRect.top - diagramRect.top; - const left = padRect.left - diagramRect.left; + // const top = padRect.top - diagramRect.top; + // const left = padRect.left - diagramRect.left; - const pos = { - x: left, - y: top + padRect.height + Y_OFFSET, - }; + // const pos = { + // x: left, + // y: top + padRect.height + Y_OFFSET, + // }; - return pos; - } + // return pos; + // } /** * Create an append action @@ -335,11 +335,7 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) { title: '修改类型', action: { click(event, element) { - const position = Object.assign(getReplaceMenuPosition(element), { - cursor: { x: event.x, y: event.y }, - }); - - popupMenu.open(element, 'bpmn-replace', position); + popupMenu.open(element, 'bpmn-replace', { x: event.x, y: event.y }); }, }, }, diff --git a/apps/web-antdv-next/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue b/apps/web-antdv-next/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue index 4ea0011b4..b2f048fdc 100644 --- a/apps/web-antdv-next/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue +++ b/apps/web-antdv-next/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue @@ -229,10 +229,10 @@ const selectProcessListener = (listener: any) => { bpmnElement.businessObject?.extensionElements?.values?.filter( (ex: any) => ex.$type !== `${prefix}:TaskListener`, ) ?? []; - updateElementExtensions( - bpmnElement, - [...otherExtensionList.value, ...bpmnElementListeners.value], - ); + updateElementExtensions(bpmnElement, [ + ...otherExtensionList.value, + ...bpmnElementListeners.value, + ]); }; const [ListenerDrawer, listenerDrawerApi] = useVbenDrawer({ diff --git a/apps/web-antdv-next/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue b/apps/web-antdv-next/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue index 84f9e0d23..d486d769f 100644 --- a/apps/web-antdv-next/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue +++ b/apps/web-antdv-next/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue @@ -258,14 +258,14 @@ function updateFormFieldKey( ) { if (!formSetting?.updateFormFields || !newKey) return; const value = formSetting.updateFormFields[oldKey]; - delete formSetting.updateFormFields[oldKey]; + Reflect.deleteProperty(formSetting.updateFormFields, oldKey); formSetting.updateFormFields[String(newKey)] = value; } /** 删除修改字段设置项 */ function deleteFormFieldSetting(formSetting: FormTriggerSetting, key: string) { if (!formSetting?.updateFormFields) return; - delete formSetting.updateFormFields[key]; + Reflect.deleteProperty(formSetting.updateFormFields, key); } /** 保存配置 */ diff --git a/apps/web-antdv-next/src/views/bpm/processInstance/detail/modules/time-line.vue b/apps/web-antdv-next/src/views/bpm/processInstance/detail/modules/time-line.vue index eeb1d2e31..df3bedf13 100644 --- a/apps/web-antdv-next/src/views/bpm/processInstance/detail/modules/time-line.vue +++ b/apps/web-antdv-next/src/views/bpm/processInstance/detail/modules/time-line.vue @@ -437,7 +437,9 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
审批意见:{{ task.reason }}
diff --git a/apps/web-antdv-next/src/views/im/home/components/picker/conversation-picker-panel.vue b/apps/web-antdv-next/src/views/im/home/components/picker/conversation-picker-panel.vue index 24d8b62ac..d6a37ac4b 100644 --- a/apps/web-antdv-next/src/views/im/home/components/picker/conversation-picker-panel.vue +++ b/apps/web-antdv-next/src/views/im/home/components/picker/conversation-picker-panel.vue @@ -4,6 +4,7 @@ import type { Conversation } from '../../types'; import { computed, ref } from 'vue'; import { IconifyIcon as Icon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Input, message } from 'antdv-next'; @@ -81,7 +82,7 @@ const recentForwardConversations = computed(() => .map((key) => byKey.value.get(key)) .filter( (c): c is Conversation => - c != null && !hideSet.value.has(getConversationKey(c)), + !isUndefined(c) && !hideSet.value.has(getConversationKey(c)), ), ); @@ -96,7 +97,7 @@ const selectedConversations = computed(() => .map((key) => byKey.value.get(key)) .filter( (conversation): conversation is Conversation => - conversation != null && + !isUndefined(conversation) && !hideSet.value.has(getConversationKey(conversation)), ), ); diff --git a/apps/web-antdv-next/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue b/apps/web-antdv-next/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue index b91e92113..2877fc218 100644 --- a/apps/web-antdv-next/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue +++ b/apps/web-antdv-next/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue @@ -7,6 +7,7 @@ import { computed, ref, watch } from 'vue'; import { confirm } from '@vben/common-ui'; import { CommonStatusEnum } from '@vben/constants'; import { IconifyIcon as Icon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Button, Drawer, Input, message, Popover, Switch } from 'antdv-next'; @@ -88,13 +89,10 @@ const myId = computed(() => getCurrentUserId()); /** 历史退群群:禁所有群操作入口(邀请 / 移出 / 改资料 / 禁言 / 审批 / 退出等),只保留展示;props.group 是 GroupLite 无 joinStatus,回 store 取全量 */ const isQuitGroup = computed(() => { const id = props.group?.id; - return id != null && isGroupQuit(groupStore.getGroup(id)); + return !isUndefined(id) && isGroupQuit(groupStore.getGroup(id)); }); const isOwner = computed( - () => - !isQuitGroup.value && - props.group != null && - props.group.ownerId === myId.value, + () => !isQuitGroup.value && props.group?.ownerId === myId.value, ); /** 当前用户在群里的角色(来自 props.members 的 me 行);用于判定是否可移出他人 */ const myRole = computed( diff --git a/apps/web-antdv-next/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue b/apps/web-antdv-next/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue index 101e0c688..637902207 100644 --- a/apps/web-antdv-next/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue +++ b/apps/web-antdv-next/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue @@ -5,6 +5,7 @@ import { computed } from 'vue'; import { confirm } from '@vben/common-ui'; import { IconifyIcon as Icon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Tag } from 'antdv-next'; @@ -86,7 +87,7 @@ const showSendName = computed(() => { return false; } const lastType = props.conversation.lastMessageType; - return lastType != null && isNormalMessage(lastType); + return !isUndefined(lastType) && isNormalMessage(lastType); }); /** 列表展示文案:草稿优先(对齐微信 PC:有草稿时盖掉最后一条预览)→ 撤回实时算 → lastContent 兜底 */ @@ -96,7 +97,7 @@ const lastContentDisplay = computed(() => { } if ( props.conversation.lastMessageType === ImContentType.RECALL && - props.conversation.lastSenderId != null + !isUndefined(props.conversation.lastSenderId) ) { return buildRecallTip( props.conversation.lastSenderId, diff --git a/apps/web-antdv-next/src/views/im/home/pages/conversation/components/message/message-item.vue b/apps/web-antdv-next/src/views/im/home/pages/conversation/components/message/message-item.vue index 4e8dae66d..eb2d068b2 100644 --- a/apps/web-antdv-next/src/views/im/home/pages/conversation/components/message/message-item.vue +++ b/apps/web-antdv-next/src/views/im/home/pages/conversation/components/message/message-item.vue @@ -13,6 +13,7 @@ import { computed, inject } from 'vue'; import { confirm } from '@vben/common-ui'; import { IconifyIcon as Icon } from '@vben/icons'; import { useUserStore } from '@vben/stores'; +import { isUndefined } from '@vben/utils'; import { useClipboard } from '@vueuse/core'; import { message as antdMessage, Tag } from 'antdv-next'; @@ -251,7 +252,7 @@ const redialRtcCall = inject(IM_RTC_REDIAL_KEY); /** 私聊 RTC_CALL_END 气泡点击:用同款 mediaType 重拨 */ function handleRtcCallBubbleClick() { const mediaType = rtcCallEndPrivatePayload.value?.mediaType; - if (mediaType == null) { + if (isUndefined(mediaType)) { return; } redialRtcCall?.(mediaType); diff --git a/apps/web-antdv-next/src/views/im/manager/group/components/select.vue b/apps/web-antdv-next/src/views/im/manager/group/components/select.vue index 4fe3bd2ac..1df7ff83b 100644 --- a/apps/web-antdv-next/src/views/im/manager/group/components/select.vue +++ b/apps/web-antdv-next/src/views/im/manager/group/components/select.vue @@ -4,6 +4,7 @@ import type { ImManagerGroupApi } from '#/api/im/manager/group'; import { computed, ref, useAttrs, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Input, Tooltip } from 'antdv-next'; @@ -47,13 +48,13 @@ const showClear = computed(() => { props.allowClear && !props.disabled && hovering.value && - props.modelValue != null + props.modelValue !== null ); }); /** 根据编号查询群信息(用于编辑回显) */ async function resolveItemById(id: number | undefined) { - if (id == null) { + if (isUndefined(id)) { selectedItem.value = undefined; return; } @@ -83,7 +84,9 @@ function handleClick(event: MouseEvent) { clearSelected(); return; } - dialogRef.value?.open(props.modelValue == null ? [] : [props.modelValue]); + dialogRef.value?.open( + isUndefined(props.modelValue) ? [] : [props.modelValue], + ); } /** 弹窗选中回调 */ diff --git a/apps/web-antdv-next/src/views/im/utils/pull.ts b/apps/web-antdv-next/src/views/im/utils/pull.ts index 76c9af1ec..6524af26b 100644 --- a/apps/web-antdv-next/src/views/im/utils/pull.ts +++ b/apps/web-antdv-next/src/views/im/utils/pull.ts @@ -1,3 +1,5 @@ +import { isUndefined } from '@vben/utils'; + import { getDb } from './db'; /** @@ -54,16 +56,15 @@ export async function runIncrementalPull( ): Promise { const storedCursor = await getPullCursor(cursorKey); const highWater = { ...storedCursor }; - let cursor = - storedCursor.lastUpdateTime == null - ? {} - : { - lastUpdateTime: Math.max( - 0, - storedCursor.lastUpdateTime - PULL_OVERLAP_MS, - ), - lastId: 0, - }; + let cursor = isUndefined(storedCursor.lastUpdateTime) + ? {} + : { + lastUpdateTime: Math.max( + 0, + storedCursor.lastUpdateTime - PULL_OVERLAP_MS, + ), + lastId: 0, + }; for (let page = 0; page < PULL_MAX_PAGES; page++) { if (isActive && !isActive()) { return; @@ -89,12 +90,12 @@ export async function runIncrementalPull( if (!last) { return; } - if (last.updateTime == null) { + if (isUndefined(last.updateTime)) { return; } cursor = { lastUpdateTime: last.updateTime, lastId: last.id }; if ( - highWater.lastUpdateTime == null || + isUndefined(highWater.lastUpdateTime) || cursor.lastUpdateTime > highWater.lastUpdateTime || (cursor.lastUpdateTime === highWater.lastUpdateTime && cursor.lastId > (highWater.lastId ?? 0)) @@ -154,14 +155,14 @@ export async function runMinIdPull(options: { // 本批最大消息 id 作为下次游标;无有效 id 则本批 apply 后停(无法继续翻页) const validIds = list .map((record) => record.id) - .filter((id): id is number => id != null); + .filter((id): id is number => id !== null); const nextMinId = validIds.length > 0 ? Math.max(...validIds) : undefined; // applyPage 返回 false:本页未落地(如入库失败),不推进游标并终止,避免漏消息 if ((await applyPage(list, nextMinId)) === false) { return; } // 无有效 id,或游标没前进(后端契约是 id > minId,理论不会出现):停,防御死翻 - if (nextMinId == null || nextMinId <= minId) { + if (isUndefined(nextMinId) || nextMinId <= minId) { return; } minId = nextMinId; diff --git a/apps/web-antdv-next/src/views/mall/product/spu/components/spu-showcase.vue b/apps/web-antdv-next/src/views/mall/product/spu/components/spu-showcase.vue index c124c613b..a25f90223 100644 --- a/apps/web-antdv-next/src/views/mall/product/spu/components/spu-showcase.vue +++ b/apps/web-antdv-next/src/views/mall/product/spu/components/spu-showcase.vue @@ -5,6 +5,7 @@ import type { MallSpuApi } from '#/api/mall/product/spu'; import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Image, Tooltip } from 'antdv-next'; @@ -58,7 +59,9 @@ watch( // 只有商品发生变化时才重新查询 if ( productSpus.value.length === 0 || - productSpus.value.some((spu) => spu.id == null || !ids.includes(spu.id)) + productSpus.value.some( + (spu) => isUndefined(spu.id) || !ids.includes(spu.id), + ) ) { productSpus.value = await getSpuDetailList(ids); } diff --git a/apps/web-antdv-next/src/views/mall/promotion/combination/components/showcase.vue b/apps/web-antdv-next/src/views/mall/promotion/combination/components/showcase.vue index 908133c07..eae9ce366 100644 --- a/apps/web-antdv-next/src/views/mall/promotion/combination/components/showcase.vue +++ b/apps/web-antdv-next/src/views/mall/promotion/combination/components/showcase.vue @@ -5,6 +5,7 @@ import type { MallCombinationActivityApi } from '#/api/mall/promotion/combinatio import { computed, ref, watch } from 'vue'; import { CloseCircleFilled, PlusOutlined } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Image, Tooltip } from 'antdv-next'; @@ -60,7 +61,7 @@ watch( if ( activityList.value.length === 0 || activityList.value.some( - (activity) => activity.id == null || !ids.includes(activity.id), + (activity) => isUndefined(activity.id) || !ids.includes(activity.id), ) ) { activityList.value = await getCombinationActivityListByIds(ids); diff --git a/apps/web-antdv-next/src/views/mall/promotion/point/components/showcase.vue b/apps/web-antdv-next/src/views/mall/promotion/point/components/showcase.vue index 1b34d7289..d8b53998a 100644 --- a/apps/web-antdv-next/src/views/mall/promotion/point/components/showcase.vue +++ b/apps/web-antdv-next/src/views/mall/promotion/point/components/showcase.vue @@ -5,6 +5,7 @@ import type { MallPointActivityApi } from '#/api/mall/promotion/point'; import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Image, Tooltip } from 'antdv-next'; @@ -54,7 +55,9 @@ watch( // 只有活动发生变化时才重新查询 if ( pointActivityList.value.length === 0 || - pointActivityList.value.some((activity) => !ids.includes(activity.id!)) + pointActivityList.value.some( + (activity) => isUndefined(activity.id) || !ids.includes(activity.id), + ) ) { pointActivityList.value = await getPointActivityListByIds(ids); } diff --git a/apps/web-antdv-next/src/views/mall/promotion/seckill/components/showcase.vue b/apps/web-antdv-next/src/views/mall/promotion/seckill/components/showcase.vue index 147245344..83f704cf5 100644 --- a/apps/web-antdv-next/src/views/mall/promotion/seckill/components/showcase.vue +++ b/apps/web-antdv-next/src/views/mall/promotion/seckill/components/showcase.vue @@ -5,6 +5,7 @@ import type { MallSeckillActivityApi } from '#/api/mall/promotion/seckill/seckil import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { Image, Tooltip } from 'antdv-next'; @@ -54,7 +55,9 @@ watch( // 只有活动发生变化时才重新查询 if ( activityList.value.length === 0 || - activityList.value.some((activity) => !ids.includes(activity.id!)) + activityList.value.some( + (activity) => isUndefined(activity.id) || !ids.includes(activity.id), + ) ) { activityList.value = await getSeckillActivityListByIds(ids as number[]); } diff --git a/apps/web-antdv-next/src/views/mall/statistics/product/modules/rank-card.vue b/apps/web-antdv-next/src/views/mall/statistics/product/modules/rank-card.vue index 321ec5b2e..990b01376 100644 --- a/apps/web-antdv-next/src/views/mall/statistics/product/modules/rank-card.vue +++ b/apps/web-antdv-next/src/views/mall/statistics/product/modules/rank-card.vue @@ -28,7 +28,10 @@ const handleDateRangeChange = (times?: [Dayjs, Dayjs]) => { formatDateTime(times[0]) as string, formatDateTime(times[1]) as string, ]; - gridApi.query(); + // ShortcutDateRangePicker 初始化会先触发 change,此时 Grid 可能还没 mount:https://gitee.com/yudaocode/yudao-ui-admin-vben/issues/IJXOKO + if (typeof gridApi.grid?.commitProxy === 'function') { + gridApi.query(); + } }; const columns: VxeTableGridOptions['columns'] = [ diff --git a/apps/web-antdv-next/src/views/mes/wm/itemreceipt/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/itemreceipt/modules/line-list.vue index ead0e0c90..7ccd5cc4a 100644 --- a/apps/web-antdv-next/src/views/mes/wm/itemreceipt/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/itemreceipt/modules/line-list.vue @@ -54,7 +54,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/mes/wm/outsourceissue/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/outsourceissue/modules/line-list.vue index 5efa9bf1b..82f151f3d 100644 --- a/apps/web-antdv-next/src/views/mes/wm/outsourceissue/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/outsourceissue/modules/line-list.vue @@ -52,7 +52,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/mes/wm/outsourcereceipt/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/outsourcereceipt/modules/line-list.vue index 2bafc308c..071e455dc 100644 --- a/apps/web-antdv-next/src/views/mes/wm/outsourcereceipt/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/outsourcereceipt/modules/line-list.vue @@ -53,7 +53,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/mes/wm/productissue/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/productissue/modules/line-list.vue index da694bc72..106afa7ee 100644 --- a/apps/web-antdv-next/src/views/mes/wm/productissue/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/productissue/modules/line-list.vue @@ -52,7 +52,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/mes/wm/productreceipt/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/productreceipt/modules/line-list.vue index 6e32e9004..07f213b7b 100644 --- a/apps/web-antdv-next/src/views/mes/wm/productreceipt/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/productreceipt/modules/line-list.vue @@ -55,7 +55,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/mes/wm/productsales/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/productsales/modules/line-list.vue index 2fff30329..47db8bf5e 100644 --- a/apps/web-antdv-next/src/views/mes/wm/productsales/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/productsales/modules/line-list.vue @@ -53,7 +53,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/mes/wm/returnissue/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/returnissue/modules/line-list.vue index a57767181..ef00f61c4 100644 --- a/apps/web-antdv-next/src/views/mes/wm/returnissue/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/returnissue/modules/line-list.vue @@ -55,7 +55,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/mes/wm/returnsales/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/returnsales/modules/line-list.vue index 4a3c93a7f..fac622c14 100644 --- a/apps/web-antdv-next/src/views/mes/wm/returnsales/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/returnsales/modules/line-list.vue @@ -55,7 +55,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/mes/wm/returnvendor/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/returnvendor/modules/line-list.vue index 177afa6bc..c500b15d5 100644 --- a/apps/web-antdv-next/src/views/mes/wm/returnvendor/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/returnvendor/modules/line-list.vue @@ -54,7 +54,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/mes/wm/transfer/modules/line-list.vue b/apps/web-antdv-next/src/views/mes/wm/transfer/modules/line-list.vue index 107947da5..14da9469a 100644 --- a/apps/web-antdv-next/src/views/mes/wm/transfer/modules/line-list.vue +++ b/apps/web-antdv-next/src/views/mes/wm/transfer/modules/line-list.vue @@ -52,7 +52,7 @@ const [DetailFormModal, detailFormModalApi] = useVbenModal({ function handleRefresh() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } gridApi.query(); } diff --git a/apps/web-antdv-next/src/views/wms/order/check/index.vue b/apps/web-antdv-next/src/views/wms/order/check/index.vue index ed0e7f645..4c01d1c62 100644 --- a/apps/web-antdv-next/src/views/wms/order/check/index.vue +++ b/apps/web-antdv-next/src/views/wms/order/check/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { message } from 'antdv-next'; @@ -68,7 +72,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getCheckOrderDetailListByOrderId(key); } diff --git a/apps/web-antdv-next/src/views/wms/order/movement/index.vue b/apps/web-antdv-next/src/views/wms/order/movement/index.vue index 2c82ca18d..a2a30c49e 100644 --- a/apps/web-antdv-next/src/views/wms/order/movement/index.vue +++ b/apps/web-antdv-next/src/views/wms/order/movement/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { message } from 'antdv-next'; @@ -61,7 +65,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getMovementOrderDetailListByOrderId(key); } diff --git a/apps/web-antdv-next/src/views/wms/order/receipt/index.vue b/apps/web-antdv-next/src/views/wms/order/receipt/index.vue index 89f5121ec..ca402b521 100644 --- a/apps/web-antdv-next/src/views/wms/order/receipt/index.vue +++ b/apps/web-antdv-next/src/views/wms/order/receipt/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { message } from 'antdv-next'; @@ -61,7 +65,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getReceiptOrderDetailListByOrderId(key); } diff --git a/apps/web-antdv-next/src/views/wms/order/shipment/index.vue b/apps/web-antdv-next/src/views/wms/order/shipment/index.vue index 40155e3bc..3e94eb983 100644 --- a/apps/web-antdv-next/src/views/wms/order/shipment/index.vue +++ b/apps/web-antdv-next/src/views/wms/order/shipment/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { message } from 'antdv-next'; @@ -61,7 +65,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getShipmentOrderDetailListByOrderId(key); } diff --git a/apps/web-ele/package.json b/apps/web-ele/package.json index 1e8a051df..854f1da53 100644 --- a/apps/web-ele/package.json +++ b/apps/web-ele/package.json @@ -20,7 +20,7 @@ "build:analyze": "pnpm vite build --mode analyze", "dev": "pnpm vite --mode development", "preview": "vite preview", - "typecheck": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vue-tsc --noEmit --skipLibCheck --incremental --tsBuildInfoFile node_modules/.cache/vue-tsc/tsconfig.tsbuildinfo" + "typecheck": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vue-tsc --noEmit --skipLibCheck" }, "imports": { "#/*": "./src/*" diff --git a/apps/web-ele/src/api/im/friend/request/index.ts b/apps/web-ele/src/api/im/friend/request/index.ts index e57e4a5f2..7b72fb358 100644 --- a/apps/web-ele/src/api/im/friend/request/index.ts +++ b/apps/web-ele/src/api/im/friend/request/index.ts @@ -1,3 +1,5 @@ +import { isUndefined } from '@vben/utils'; + import { requestClient } from '#/api/request'; export namespace ImFriendRequestApi { @@ -55,7 +57,7 @@ export function refuseFriendRequest( /** 查询「我相关」的好友申请列表(游标分页:传 maxId 加载更多) */ export function getMyFriendRequestList(limit: number, maxId?: number) { const params: Record = { limit }; - if (maxId != null) { + if (!isUndefined(maxId)) { params.maxId = maxId; } return requestClient.get( diff --git a/apps/web-ele/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js b/apps/web-ele/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js index b8f1dfef7..fcc698646 100644 --- a/apps/web-ele/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js +++ b/apps/web-ele/src/views/bpm/components/bpmn-process-designer/package/designer/plugins/content-pad/contentPadProvider.js @@ -77,7 +77,7 @@ ContextPadProvider.$inject = [ ContextPadProvider.prototype.getContextPadEntries = function (element) { const autoPlace = this._autoPlace; - const canvas = this._canvas; + // const canvas = this._canvas; const connect = this._connect; const contextPad = this._contextPad; const create = this._create; @@ -103,25 +103,25 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) { modeling.removeElements([element]); } - function getReplaceMenuPosition(element) { - const Y_OFFSET = 5; + // function getReplaceMenuPosition(element) { + // const Y_OFFSET = 5; - const diagramContainer = canvas.getContainer(); - const pad = contextPad.getPad(element).html; + // const diagramContainer = canvas.getContainer(); + // const pad = contextPad.getPad(element).html; - const diagramRect = diagramContainer.getBoundingClientRect(); - const padRect = pad.getBoundingClientRect(); + // const diagramRect = diagramContainer.getBoundingClientRect(); + // const padRect = pad.getBoundingClientRect(); - const top = padRect.top - diagramRect.top; - const left = padRect.left - diagramRect.left; + // const top = padRect.top - diagramRect.top; + // const left = padRect.left - diagramRect.left; - const pos = { - x: left, - y: top + padRect.height + Y_OFFSET, - }; + // const pos = { + // x: left, + // y: top + padRect.height + Y_OFFSET, + // }; - return pos; - } + // return pos; + // } /** * Create an append action @@ -335,11 +335,7 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) { title: '修改类型', action: { click(event, element) { - const position = Object.assign(getReplaceMenuPosition(element), { - cursor: { x: event.x, y: event.y }, - }); - - popupMenu.open(element, 'bpmn-replace', position); + popupMenu.open(element, 'bpmn-replace', { x: event.x, y: event.y }); }, }, }, diff --git a/apps/web-ele/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue b/apps/web-ele/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue index a38cde32f..594b7ae39 100644 --- a/apps/web-ele/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue +++ b/apps/web-ele/src/views/bpm/components/bpmn-process-designer/package/penal/listeners/UserTaskListeners.vue @@ -237,10 +237,10 @@ const selectProcessListener = (listener: any) => { bpmnElement.businessObject?.extensionElements?.values?.filter( (ex: any) => ex.$type !== `${prefix}:TaskListener`, ) ?? []; - updateElementExtensions( - bpmnElement, - [...otherExtensionList.value, ...bpmnElementListeners.value], - ); + updateElementExtensions(bpmnElement, [ + ...otherExtensionList.value, + ...bpmnElementListeners.value, + ]); }; const [ListenerDrawer, listenerDrawerApi] = useVbenDrawer({ diff --git a/apps/web-ele/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue b/apps/web-ele/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue index ff1e53fbf..045aa3279 100644 --- a/apps/web-ele/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue +++ b/apps/web-ele/src/views/bpm/components/simple-process-design/components/nodes-config/trigger-node-config.vue @@ -258,14 +258,14 @@ function updateFormFieldKey( ) { if (!formSetting?.updateFormFields || !newKey) return; const value = formSetting.updateFormFields[oldKey]; - delete formSetting.updateFormFields[oldKey]; + Reflect.deleteProperty(formSetting.updateFormFields, oldKey); formSetting.updateFormFields[String(newKey)] = value; } /** 删除修改字段设置项 */ function deleteFormFieldSetting(formSetting: FormTriggerSetting, key: string) { if (!formSetting?.updateFormFields) return; - delete formSetting.updateFormFields[key]; + Reflect.deleteProperty(formSetting.updateFormFields, key); } /** 保存配置 */ diff --git a/apps/web-ele/src/views/bpm/processInstance/detail/modules/time-line.vue b/apps/web-ele/src/views/bpm/processInstance/detail/modules/time-line.vue index c4bc05e2e..86512f654 100644 --- a/apps/web-ele/src/views/bpm/processInstance/detail/modules/time-line.vue +++ b/apps/web-ele/src/views/bpm/processInstance/detail/modules/time-line.vue @@ -435,7 +435,9 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
审批意见:{{ task.reason }}
diff --git a/apps/web-ele/src/views/im/home/components/picker/conversation-picker-panel.vue b/apps/web-ele/src/views/im/home/components/picker/conversation-picker-panel.vue index 70b33d0a6..cf09b6998 100644 --- a/apps/web-ele/src/views/im/home/components/picker/conversation-picker-panel.vue +++ b/apps/web-ele/src/views/im/home/components/picker/conversation-picker-panel.vue @@ -4,6 +4,7 @@ import type { Conversation } from '../../types'; import { computed, ref } from 'vue'; import { IconifyIcon as Icon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { ElInput, ElMessage } from 'element-plus'; @@ -81,7 +82,7 @@ const recentForwardConversations = computed(() => .map((key) => byKey.value.get(key)) .filter( (c): c is Conversation => - c != null && !hideSet.value.has(getConversationKey(c)), + !isUndefined(c) && !hideSet.value.has(getConversationKey(c)), ), ); @@ -96,7 +97,7 @@ const selectedConversations = computed(() => .map((key) => byKey.value.get(key)) .filter( (conversation): conversation is Conversation => - conversation != null && + !isUndefined(conversation) && !hideSet.value.has(getConversationKey(conversation)), ), ); diff --git a/apps/web-ele/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue b/apps/web-ele/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue index 5277c6356..a634b3e28 100644 --- a/apps/web-ele/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue +++ b/apps/web-ele/src/views/im/home/pages/conversation/components/conversation/conversation-group-side.vue @@ -7,6 +7,7 @@ import { computed, ref, watch } from 'vue'; import { confirm } from '@vben/common-ui'; import { CommonStatusEnum } from '@vben/constants'; import { IconifyIcon as Icon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { ElButton, @@ -95,13 +96,10 @@ const myId = computed(() => getCurrentUserId()); /** 历史退群群:禁所有群操作入口(邀请 / 移出 / 改资料 / 禁言 / 审批 / 退出等),只保留展示;props.group 是 GroupLite 无 joinStatus,回 store 取全量 */ const isQuitGroup = computed(() => { const id = props.group?.id; - return id != null && isGroupQuit(groupStore.getGroup(id)); + return !isUndefined(id) && isGroupQuit(groupStore.getGroup(id)); }); const isOwner = computed( - () => - !isQuitGroup.value && - props.group != null && - props.group.ownerId === myId.value, + () => !isQuitGroup.value && props.group?.ownerId === myId.value, ); /** 当前用户在群里的角色(来自 props.members 的 me 行);用于判定是否可移出他人 */ const myRole = computed( diff --git a/apps/web-ele/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue b/apps/web-ele/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue index a0ddaf790..73be144cd 100644 --- a/apps/web-ele/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue +++ b/apps/web-ele/src/views/im/home/pages/conversation/components/conversation/conversation-item.vue @@ -5,6 +5,7 @@ import { computed } from 'vue'; import { confirm } from '@vben/common-ui'; import { IconifyIcon as Icon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { ElTag } from 'element-plus'; @@ -86,7 +87,7 @@ const showSendName = computed(() => { return false; } const lastType = props.conversation.lastMessageType; - return lastType != null && isNormalMessage(lastType); + return !isUndefined(lastType) && isNormalMessage(lastType); }); /** 列表展示文案:草稿优先(对齐微信 PC:有草稿时盖掉最后一条预览)→ 撤回实时算 → lastContent 兜底 */ @@ -96,7 +97,7 @@ const lastContentDisplay = computed(() => { } if ( props.conversation.lastMessageType === ImContentType.RECALL && - props.conversation.lastSenderId != null + !isUndefined(props.conversation.lastSenderId) ) { return buildRecallTip( props.conversation.lastSenderId, diff --git a/apps/web-ele/src/views/im/home/pages/conversation/components/message/message-item.vue b/apps/web-ele/src/views/im/home/pages/conversation/components/message/message-item.vue index 22d1a7c2b..3dcaec490 100644 --- a/apps/web-ele/src/views/im/home/pages/conversation/components/message/message-item.vue +++ b/apps/web-ele/src/views/im/home/pages/conversation/components/message/message-item.vue @@ -13,6 +13,7 @@ import { computed, inject } from 'vue'; import { confirm } from '@vben/common-ui'; import { IconifyIcon as Icon } from '@vben/icons'; import { useUserStore } from '@vben/stores'; +import { isUndefined } from '@vben/utils'; import { useClipboard } from '@vueuse/core'; import { ElMessage, ElTag } from 'element-plus'; @@ -251,7 +252,7 @@ const redialRtcCall = inject(IM_RTC_REDIAL_KEY); /** 私聊 RTC_CALL_END 气泡点击:用同款 mediaType 重拨 */ function handleRtcCallBubbleClick() { const mediaType = rtcCallEndPrivatePayload.value?.mediaType; - if (mediaType == null) { + if (isUndefined(mediaType)) { return; } redialRtcCall?.(mediaType); diff --git a/apps/web-ele/src/views/im/manager/group/components/select.vue b/apps/web-ele/src/views/im/manager/group/components/select.vue index a43baf2f9..df53910fd 100644 --- a/apps/web-ele/src/views/im/manager/group/components/select.vue +++ b/apps/web-ele/src/views/im/manager/group/components/select.vue @@ -4,6 +4,7 @@ import type { ImManagerGroupApi } from '#/api/im/manager/group'; import { computed, ref, useAttrs, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { ElInput, ElTooltip } from 'element-plus'; @@ -47,13 +48,13 @@ const showClear = computed(() => { props.clearable && !props.disabled && hovering.value && - props.modelValue != null + props.modelValue !== null ); }); /** 根据编号查询群信息(用于编辑回显) */ async function resolveItemById(id: number | undefined) { - if (id == null) { + if (isUndefined(id)) { selectedItem.value = undefined; return; } @@ -83,7 +84,9 @@ function handleClick(event: MouseEvent) { clearSelected(); return; } - dialogRef.value?.open(props.modelValue == null ? [] : [props.modelValue]); + dialogRef.value?.open( + isUndefined(props.modelValue) ? [] : [props.modelValue], + ); } /** 弹窗选中回调 */ diff --git a/apps/web-ele/src/views/im/utils/pull.ts b/apps/web-ele/src/views/im/utils/pull.ts index 76c9af1ec..6524af26b 100644 --- a/apps/web-ele/src/views/im/utils/pull.ts +++ b/apps/web-ele/src/views/im/utils/pull.ts @@ -1,3 +1,5 @@ +import { isUndefined } from '@vben/utils'; + import { getDb } from './db'; /** @@ -54,16 +56,15 @@ export async function runIncrementalPull( ): Promise { const storedCursor = await getPullCursor(cursorKey); const highWater = { ...storedCursor }; - let cursor = - storedCursor.lastUpdateTime == null - ? {} - : { - lastUpdateTime: Math.max( - 0, - storedCursor.lastUpdateTime - PULL_OVERLAP_MS, - ), - lastId: 0, - }; + let cursor = isUndefined(storedCursor.lastUpdateTime) + ? {} + : { + lastUpdateTime: Math.max( + 0, + storedCursor.lastUpdateTime - PULL_OVERLAP_MS, + ), + lastId: 0, + }; for (let page = 0; page < PULL_MAX_PAGES; page++) { if (isActive && !isActive()) { return; @@ -89,12 +90,12 @@ export async function runIncrementalPull( if (!last) { return; } - if (last.updateTime == null) { + if (isUndefined(last.updateTime)) { return; } cursor = { lastUpdateTime: last.updateTime, lastId: last.id }; if ( - highWater.lastUpdateTime == null || + isUndefined(highWater.lastUpdateTime) || cursor.lastUpdateTime > highWater.lastUpdateTime || (cursor.lastUpdateTime === highWater.lastUpdateTime && cursor.lastId > (highWater.lastId ?? 0)) @@ -154,14 +155,14 @@ export async function runMinIdPull(options: { // 本批最大消息 id 作为下次游标;无有效 id 则本批 apply 后停(无法继续翻页) const validIds = list .map((record) => record.id) - .filter((id): id is number => id != null); + .filter((id): id is number => id !== null); const nextMinId = validIds.length > 0 ? Math.max(...validIds) : undefined; // applyPage 返回 false:本页未落地(如入库失败),不推进游标并终止,避免漏消息 if ((await applyPage(list, nextMinId)) === false) { return; } // 无有效 id,或游标没前进(后端契约是 id > minId,理论不会出现):停,防御死翻 - if (nextMinId == null || nextMinId <= minId) { + if (isUndefined(nextMinId) || nextMinId <= minId) { return; } minId = nextMinId; diff --git a/apps/web-ele/src/views/mall/product/spu/components/spu-showcase.vue b/apps/web-ele/src/views/mall/product/spu/components/spu-showcase.vue index c794c145c..fcd956756 100644 --- a/apps/web-ele/src/views/mall/product/spu/components/spu-showcase.vue +++ b/apps/web-ele/src/views/mall/product/spu/components/spu-showcase.vue @@ -5,6 +5,7 @@ import type { MallSpuApi } from '#/api/mall/product/spu'; import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { ElImage, ElTooltip } from 'element-plus'; @@ -54,7 +55,9 @@ watch( // 只有商品发生变化时才重新查询 if ( productSpus.value.length === 0 || - productSpus.value.some((spu) => !ids.includes(spu.id!)) + productSpus.value.some( + (spu) => isUndefined(spu.id) || !ids.includes(spu.id), + ) ) { productSpus.value = await getSpuDetailList(ids); } diff --git a/apps/web-ele/src/views/mall/promotion/combination/components/showcase.vue b/apps/web-ele/src/views/mall/promotion/combination/components/showcase.vue index 1b51c4ba8..98a148fb6 100644 --- a/apps/web-ele/src/views/mall/promotion/combination/components/showcase.vue +++ b/apps/web-ele/src/views/mall/promotion/combination/components/showcase.vue @@ -5,6 +5,7 @@ import type { MallCombinationActivityApi } from '#/api/mall/promotion/combinatio import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { ElImage, ElTooltip } from 'element-plus'; @@ -55,7 +56,9 @@ watch( // 只有活动发生变化时才重新查询 if ( activityList.value.length === 0 || - activityList.value.some((activity) => !ids.includes(activity.id!)) + activityList.value.some( + (activity) => isUndefined(activity.id) || !ids.includes(activity.id), + ) ) { activityList.value = await getCombinationActivityListByIds(ids); } diff --git a/apps/web-ele/src/views/mall/promotion/point/components/showcase.vue b/apps/web-ele/src/views/mall/promotion/point/components/showcase.vue index 0af0b51c2..0f2e87279 100644 --- a/apps/web-ele/src/views/mall/promotion/point/components/showcase.vue +++ b/apps/web-ele/src/views/mall/promotion/point/components/showcase.vue @@ -5,6 +5,7 @@ import type { MallPointActivityApi } from '#/api/mall/promotion/point'; import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { ElImage, ElTooltip } from 'element-plus'; @@ -54,7 +55,9 @@ watch( // 只有活动发生变化时才重新查询 if ( pointActivityList.value.length === 0 || - pointActivityList.value.some((activity) => !ids.includes(activity.id!)) + pointActivityList.value.some( + (activity) => isUndefined(activity.id) || !ids.includes(activity.id), + ) ) { pointActivityList.value = await getPointActivityListByIds(ids); } diff --git a/apps/web-ele/src/views/mall/promotion/seckill/components/showcase.vue b/apps/web-ele/src/views/mall/promotion/seckill/components/showcase.vue index 4eecdc671..789cdebd9 100644 --- a/apps/web-ele/src/views/mall/promotion/seckill/components/showcase.vue +++ b/apps/web-ele/src/views/mall/promotion/seckill/components/showcase.vue @@ -5,6 +5,7 @@ import type { MallSeckillActivityApi } from '#/api/mall/promotion/seckill/seckil import { computed, ref, watch } from 'vue'; import { IconifyIcon } from '@vben/icons'; +import { isUndefined } from '@vben/utils'; import { ElImage, ElTooltip } from 'element-plus'; @@ -54,7 +55,9 @@ watch( // 只有活动发生变化时才重新查询 if ( activityList.value.length === 0 || - activityList.value.some((activity) => !ids.includes(activity.id!)) + activityList.value.some( + (activity) => isUndefined(activity.id) || !ids.includes(activity.id), + ) ) { activityList.value = await getSeckillActivityListByIds(ids as number[]); } diff --git a/apps/web-ele/src/views/mall/statistics/product/modules/rank-card.vue b/apps/web-ele/src/views/mall/statistics/product/modules/rank-card.vue index 0a7e34e74..127dc7173 100644 --- a/apps/web-ele/src/views/mall/statistics/product/modules/rank-card.vue +++ b/apps/web-ele/src/views/mall/statistics/product/modules/rank-card.vue @@ -28,7 +28,10 @@ const handleDateRangeChange = (times?: [Dayjs, Dayjs]) => { formatDateTime(times[0]) as string, formatDateTime(times[1]) as string, ]; - gridApi.query(); + // ShortcutDateRangePicker 初始化会先触发 change,此时 Grid 可能还没 mount:https://gitee.com/yudaocode/yudao-ui-admin-vben/issues/IJXOKO + if (typeof gridApi.grid?.commitProxy === 'function') { + gridApi.query(); + } }; const columns: VxeTableGridOptions['columns'] = [ diff --git a/apps/web-ele/src/views/mes/cal/holiday/index.vue b/apps/web-ele/src/views/mes/cal/holiday/index.vue index 6659507af..01d5efe63 100644 --- a/apps/web-ele/src/views/mes/cal/holiday/index.vue +++ b/apps/web-ele/src/views/mes/cal/holiday/index.vue @@ -158,9 +158,7 @@ onMounted(getList); {{ data.day.split('-')[2] }} filter(option)) : options; cb(results); }, diff --git a/apps/web-ele/src/views/wms/order/check/index.vue b/apps/web-ele/src/views/wms/order/check/index.vue index b3d950dd6..efa2f3f8d 100644 --- a/apps/web-ele/src/views/wms/order/check/index.vue +++ b/apps/web-ele/src/views/wms/order/check/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { ElLoading, ElMessage } from 'element-plus'; @@ -68,7 +72,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getCheckOrderDetailListByOrderId(key); } diff --git a/apps/web-ele/src/views/wms/order/movement/index.vue b/apps/web-ele/src/views/wms/order/movement/index.vue index 75211d5ea..ca8170718 100644 --- a/apps/web-ele/src/views/wms/order/movement/index.vue +++ b/apps/web-ele/src/views/wms/order/movement/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { ElLoading, ElMessage } from 'element-plus'; @@ -61,7 +65,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getMovementOrderDetailListByOrderId(key); } diff --git a/apps/web-ele/src/views/wms/order/receipt/index.vue b/apps/web-ele/src/views/wms/order/receipt/index.vue index 6045de050..ed49bb015 100644 --- a/apps/web-ele/src/views/wms/order/receipt/index.vue +++ b/apps/web-ele/src/views/wms/order/receipt/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { ElLoading, ElMessage } from 'element-plus'; @@ -61,7 +65,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getReceiptOrderDetailListByOrderId(key); } diff --git a/apps/web-ele/src/views/wms/order/shipment/index.vue b/apps/web-ele/src/views/wms/order/shipment/index.vue index fd9e63ab3..12418cf4b 100644 --- a/apps/web-ele/src/views/wms/order/shipment/index.vue +++ b/apps/web-ele/src/views/wms/order/shipment/index.vue @@ -11,7 +11,11 @@ import { OrderStatusEnum, OrderUpdateStatusList, } from '@vben/constants'; -import { downloadFileFromBlobPart, formatDateTime } from '@vben/utils'; +import { + downloadFileFromBlobPart, + formatDateTime, + isUndefined, +} from '@vben/utils'; import { ElLoading, ElMessage } from 'element-plus'; @@ -61,7 +65,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ function clearDetailMap() { for (const id of Object.keys(detailMap)) { const key = Number(id); - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); } } @@ -107,10 +111,10 @@ async function handleExpandChange( return; } const key = row.id; - if (key == null) { + if (isUndefined(key)) { return; } - delete detailMap[key]; + Reflect.deleteProperty(detailMap, key); detailMap[key] = await getShipmentOrderDetailListByOrderId(key); } diff --git a/packages/@core/ui-kit/form-ui/src/components/form-actions.vue b/packages/@core/ui-kit/form-ui/src/components/form-actions.vue index d09e1a606..95057672b 100644 --- a/packages/@core/ui-kit/form-ui/src/components/form-actions.vue +++ b/packages/@core/ui-kit/form-ui/src/components/form-actions.vue @@ -12,7 +12,7 @@ const { $t } = useSimpleLocale(); const [rootProps, form] = injectFormProps(); -const collapsed = defineModel({ default: false }); +const collapsed = defineModel({ default: false }); const resetButtonOptions = computed(() => { return { diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params.vue b/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params.vue index dd1cce797..a9341c1dd 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params.vue @@ -31,8 +31,10 @@ const props = withDefaults(defineProps(), { const emits = defineEmits<{ 'update:value': [any, string] }>(); -const modelValue = defineModel('value', { - default: {} as Recordable, +const modelValue = defineModel< + Recordable +>('value', { + default: () => ({}), }); const visibleRefs = useTemplateRef('visibleRefs'); diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible.vue b/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible.vue index d6e4e2ccc..d17d6ba7d 100755 --- a/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible.vue @@ -30,7 +30,7 @@ const delegatedProps = computed(() => { const forwarded = useForwardPropsEmits(delegatedProps, emits); -const open = defineModel('open', { default: true }); +const open = defineModel('open', { default: true }); function toggle() { open.value = !open.value; diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/expandable-arrow/expandable-arrow.vue b/packages/@core/ui-kit/shadcn-ui/src/components/expandable-arrow/expandable-arrow.vue index 5cdf619a1..cabfa4af3 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/components/expandable-arrow/expandable-arrow.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/expandable-arrow/expandable-arrow.vue @@ -7,7 +7,7 @@ const props = defineProps<{ }>(); // 控制箭头展开/收起状态 -const collapsed = defineModel({ default: false }); +const collapsed = defineModel({ default: false });