Merge remote-tracking branch 'yudao/master'
This commit is contained in:
@@ -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/*"
|
||||
|
||||
@@ -55,7 +55,7 @@ export function refuseFriendRequest(
|
||||
/** 查询「我相关」的好友申请列表(游标分页:传 maxId 加载更多) */
|
||||
export function getMyFriendRequestList(limit: number, maxId?: number) {
|
||||
const params: Record<string, number> = { limit };
|
||||
if (maxId != null) {
|
||||
if (maxId) {
|
||||
params.maxId = maxId;
|
||||
}
|
||||
return requestClient.get<ImFriendRequestApi.FriendRequestRespVO[]>(
|
||||
|
||||
@@ -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 });
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/** 保存配置 */
|
||||
|
||||
@@ -430,7 +430,9 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
|
||||
|
||||
<!-- 审批意见,附件和签名 -->
|
||||
<div
|
||||
v-if="shouldShowReasonAndAttachment(task, activity.nodeType, index)"
|
||||
v-if="
|
||||
shouldShowReasonAndAttachment(task, activity.nodeType, index)
|
||||
"
|
||||
class="mt-1 w-full rounded-md bg-gray-100 p-2 text-sm text-gray-500"
|
||||
>
|
||||
<div v-if="task.reason">审批意见:{{ task.reason }}</div>
|
||||
|
||||
@@ -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)),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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],
|
||||
);
|
||||
}
|
||||
|
||||
/** 弹窗选中回调 */
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { isUndefined } from '@vben/utils';
|
||||
|
||||
import { getDb } from './db';
|
||||
|
||||
/**
|
||||
@@ -54,16 +56,15 @@ export async function runIncrementalPull<T extends PullRecord>(
|
||||
): Promise<void> {
|
||||
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<T extends PullRecord>(
|
||||
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<T extends { id?: number }>(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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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[]);
|
||||
|
||||
@@ -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'] = [
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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/*"
|
||||
|
||||
@@ -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<string, number> = { limit };
|
||||
if (maxId != null) {
|
||||
if (!isUndefined(maxId)) {
|
||||
params.maxId = maxId;
|
||||
}
|
||||
return requestClient.get<ImFriendRequestApi.FriendRequestRespVO[]>(
|
||||
|
||||
@@ -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 });
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/** 保存配置 */
|
||||
|
||||
@@ -437,7 +437,9 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
|
||||
|
||||
<!-- 审批意见、附件和签名 -->
|
||||
<div
|
||||
v-if="shouldShowReasonAndAttachment(task, activity.nodeType, index)"
|
||||
v-if="
|
||||
shouldShowReasonAndAttachment(task, activity.nodeType, index)
|
||||
"
|
||||
class="mt-1 w-full rounded-md bg-gray-100 p-2 text-sm text-gray-500"
|
||||
>
|
||||
<div v-if="task.reason">审批意见:{{ task.reason }}</div>
|
||||
|
||||
@@ -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)),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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],
|
||||
);
|
||||
}
|
||||
|
||||
/** 弹窗选中回调 */
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { isUndefined } from '@vben/utils';
|
||||
|
||||
import { getDb } from './db';
|
||||
|
||||
/**
|
||||
@@ -54,16 +56,15 @@ export async function runIncrementalPull<T extends PullRecord>(
|
||||
): Promise<void> {
|
||||
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<T extends PullRecord>(
|
||||
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<T extends { id?: number }>(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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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[]);
|
||||
}
|
||||
|
||||
@@ -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'] = [
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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/*"
|
||||
|
||||
@@ -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<string, number> = { limit };
|
||||
if (maxId != null) {
|
||||
if (!isUndefined(maxId)) {
|
||||
params.maxId = maxId;
|
||||
}
|
||||
return requestClient.get<ImFriendRequestApi.FriendRequestRespVO[]>(
|
||||
|
||||
@@ -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 });
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/** 保存配置 */
|
||||
|
||||
@@ -435,7 +435,9 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
|
||||
|
||||
<!-- 审批意见,附件和签名 -->
|
||||
<div
|
||||
v-if="shouldShowReasonAndAttachment(task, activity.nodeType, index)"
|
||||
v-if="
|
||||
shouldShowReasonAndAttachment(task, activity.nodeType, index)
|
||||
"
|
||||
class="mt-1 w-full rounded-md bg-gray-100 p-2 text-sm text-gray-500"
|
||||
>
|
||||
<div v-if="task.reason">审批意见:{{ task.reason }}</div>
|
||||
|
||||
@@ -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)),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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],
|
||||
);
|
||||
}
|
||||
|
||||
/** 弹窗选中回调 */
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { isUndefined } from '@vben/utils';
|
||||
|
||||
import { getDb } from './db';
|
||||
|
||||
/**
|
||||
@@ -54,16 +56,15 @@ export async function runIncrementalPull<T extends PullRecord>(
|
||||
): Promise<void> {
|
||||
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<T extends PullRecord>(
|
||||
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<T extends { id?: number }>(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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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[]);
|
||||
}
|
||||
|
||||
@@ -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'] = [
|
||||
|
||||
@@ -158,9 +158,7 @@ onMounted(getList);
|
||||
{{ data.day.split('-')[2] }}
|
||||
</span>
|
||||
<ElTag
|
||||
v-if="
|
||||
data.type === 'current-month' && holidaySet.has(data.day)
|
||||
"
|
||||
v-if="data.type === 'current-month' && holidaySet.has(data.day)"
|
||||
effect="dark"
|
||||
size="small"
|
||||
type="success"
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -173,8 +173,9 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
return restaurant.value.toLowerCase().includes(qs.toLowerCase());
|
||||
};
|
||||
};
|
||||
const filter = createFilter(queryString);
|
||||
const results = queryString
|
||||
? options.filter(createFilter(queryString))
|
||||
? options.filter((option) => filter(option))
|
||||
: options;
|
||||
cb(results);
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ const { $t } = useSimpleLocale();
|
||||
|
||||
const [rootProps, form] = injectFormProps();
|
||||
|
||||
const collapsed = defineModel({ default: false });
|
||||
const collapsed = defineModel<boolean>({ default: false });
|
||||
|
||||
const resetButtonOptions = computed(() => {
|
||||
return {
|
||||
|
||||
@@ -31,8 +31,10 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
|
||||
const emits = defineEmits<{ 'update:value': [any, string] }>();
|
||||
|
||||
const modelValue = defineModel('value', {
|
||||
default: {} as Recordable<CollapsibleParamSchema['defaultValue']>,
|
||||
const modelValue = defineModel<
|
||||
Recordable<CollapsibleParamSchema['defaultValue']>
|
||||
>('value', {
|
||||
default: () => ({}),
|
||||
});
|
||||
|
||||
const visibleRefs = useTemplateRef('visibleRefs');
|
||||
|
||||
@@ -30,7 +30,7 @@ const delegatedProps = computed(() => {
|
||||
|
||||
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
||||
|
||||
const open = defineModel('open', { default: true });
|
||||
const open = defineModel<boolean>('open', { default: true });
|
||||
|
||||
function toggle() {
|
||||
open.value = !open.value;
|
||||
|
||||
@@ -7,7 +7,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
// 控制箭头展开/收起状态
|
||||
const collapsed = defineModel({ default: false });
|
||||
const collapsed = defineModel<boolean>({ default: false });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -23,7 +23,9 @@ const sidebarDraggable = defineModel<boolean>('sidebarDraggable');
|
||||
const sidebarCollapsed = defineModel<boolean>('sidebarCollapsed');
|
||||
const sidebarExpandOnHover = defineModel<boolean>('sidebarExpandOnHover');
|
||||
|
||||
const sidebarButtons = defineModel<string[]>('sidebarButtons', { default: [] });
|
||||
const sidebarButtons = defineModel<string[]>('sidebarButtons', {
|
||||
default: () => [],
|
||||
});
|
||||
const sidebarCollapsedButton = defineModel<boolean>('sidebarCollapsedButton');
|
||||
const sidebarFixedButton = defineModel<boolean>('sidebarFixedButton');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user