fix: lint

This commit is contained in:
xingyu4j
2026-06-26 19:41:59 +08:00
parent 25be0950c7
commit 3d92c784c3
66 changed files with 147 additions and 129 deletions

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-dynamic-delete */
/**
* 百度地图 SDK 加载工具
*/
@@ -41,7 +40,7 @@ export const loadBaiduMapSdk = (timeout = 10_000): Promise<void> => {
// 全局回调
(window as any)[CALLBACK_NAME] = () => {
clearTimeout(timeoutId);
delete (window as any)[CALLBACK_NAME];
delete (window as any).CALLBACK_NAME;
resolve();
};
@@ -53,7 +52,7 @@ export const loadBaiduMapSdk = (timeout = 10_000): Promise<void> => {
script.addEventListener('onerror', () => {
clearTimeout(timeoutId);
loadPromise = null;
delete (window as any)[CALLBACK_NAME];
delete (window as any).CALLBACK_NAME;
reject(new Error('百度地图 SDK 加载失败'));
});
document.body.append(script);

View File

@@ -133,9 +133,8 @@ export const useAuthStore = defineStore('auth', () => {
async function fetchUserInfo() {
// 加载
// eslint-disable-next-line no-useless-assignment
let authPermissionInfo: AuthPermissionInfo | null = null;
authPermissionInfo = await getAuthPermissionInfoApi();
const authPermissionInfo: AuthPermissionInfo | null =
await getAuthPermissionInfoApi();
// userStore
userStore.setUserInfo(authPermissionInfo.user);
userStore.setUserRoles(authPermissionInfo.roles);

View File

@@ -100,8 +100,7 @@ function processContent(text: string) {
if (line.includes('```')) {
continue;
}
// eslint-disable-next-line unicorn/prefer-string-replace-all
line = line.replace(/([*_~`>])|(\d+\.)\s/g, '');
line = line.replaceAll(/([*_~`>])|(\d+\.)\s/g, '');
arr.push(line);
}
return arr.join('\n');
@@ -155,7 +154,6 @@ defineExpose({
class="flex flex-col items-center justify-center"
v-html="html"
></div>
<!-- eslint-enable vue/no-v-html -->
</div>
<div ref="mindMapRef" class="wh-full">
<svg

View File

@@ -65,7 +65,7 @@ function audioLoadedMetadata() {
audioProps.duration = formatAudioTime(audioRef.value.duration);
}
function handleProgressChange(value: number | [number, number]) {
function handleProgressChange(value: number | number[]) {
if (!audioRef.value || Array.isArray(value)) {
return;
}

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import type { MusicSong } from './types';
import { provide, ref } from 'vue';

View File

@@ -398,8 +398,7 @@ const setEncoded = (type: string, data: string) => {
const importLocalFile = () => {
const file = refFile.value.files[0];
const reader = new FileReader();
// eslint-disable-next-line unicorn/prefer-blob-reading-methods
reader.readAsText(file);
reader.text(file);
reader.addEventListener('load', function () {
const xmlStr = this.result;
createNewDiagram(xmlStr);

View File

@@ -239,7 +239,9 @@ const selectProcessListener = (listener: any) => {
) ?? [];
updateElementExtensions(
bpmnElement,
otherExtensionList.value?.concat(bpmnElementListeners.value),
otherExtensionList.value
? [...otherExtensionList.value, ...bpmnElementListeners.value]
: undefined,
);
};

View File

@@ -72,7 +72,6 @@ declare global {
const bpmnInstances = () => (window as any)?.bpmnInstances;
// @ts-expect-error: retained for legacy multi-instance mode compatibility
// eslint-disable-next-line unused-imports/no-unused-vars
const getElementLoop = (businessObject: any): void => {
if (!businessObject.loopCharacteristics) {
loopCharacteristics.value = 'Null';

View File

@@ -126,7 +126,6 @@ const resetTaskForm = () => {
(ex: any) => ex.$type === `${prefix}:CandidateParam`,
)?.value;
if (candidateParamStr && candidateParamStr.length > 0) {
// eslint-disable-next-line unicorn/prefer-switch
if (userTaskForm.value.candidateStrategy === CandidateStrategy.EXPRESSION) {
// 特殊:流程表达式,只有一个 input 输入框
// @ts-expect-error: expression strategy stores a scalar in an array-shaped field

View File

@@ -34,7 +34,6 @@ export default {
},
unbind(el) {
document.removeEventListener('touchstart', el[ctx].documentHandler); // 解绑
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete el[ctx];
delete el.ctx;
},
};

View File

@@ -1,6 +1,5 @@
function xmlStr2XmlObj(xmlStr) {
// eslint-disable-next-line no-useless-assignment
let xmlObj = {};
let xmlObj;
if (document.all) {
const xmlDom = new window.ActiveXObject('Microsoft.XMLDOM');
xmlDom.loadXML(xmlStr);

View File

@@ -413,9 +413,10 @@ export function useNodeForm(nodeType: BpmNodeTypeEnum) {
case CandidateStrategy.FORM_DEPT_LEADER: {
// 候选人参数格式: | 分隔 。左边为表单内部门字段。 右边为部门层级
const deptFieldOnForm = configForm.value.formDept;
candidateParam = deptFieldOnForm?.concat(
`|${configForm.value.deptLevel}`,
);
candidateParam =
deptFieldOnForm === undefined
? undefined
: `${deptFieldOnForm}|${configForm.value.deptLevel}`;
break;
}
case CandidateStrategy.FORM_USER: {
@@ -426,7 +427,10 @@ export function useNodeForm(nodeType: BpmNodeTypeEnum) {
case CandidateStrategy.MULTI_LEVEL_DEPT_LEADER: {
// 候选人参数格式: | 分隔 。左边为部门(多个部门用 , 分隔)。 右边为部门层级
const deptIds = configForm.value.deptIds?.join(',');
candidateParam = deptIds?.concat(`|${configForm.value.deptLevel}`);
candidateParam =
deptIds === undefined
? undefined
: `${deptIds}|${configForm.value.deptLevel}`;
break;
}
case CandidateStrategy.POST: {

View File

@@ -94,8 +94,10 @@ const [Modal, modalApi] = useVbenModal({
// 设置到 values
await formApi.setValues(formData.value as any);
await gridApi.grid.reloadData(
(formData.value!.statuses =
formData.value?.statuses?.concat(DEFAULT_STATUSES)) as any,
(formData.value!.statuses = [
...formData.value.statuses,
...DEFAULT_STATUSES,
]) as any,
);
} finally {
modalApi.unlock();
@@ -128,7 +130,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
mode: 'cell',
},
columns: useFormColumns(),
data: formData.value?.statuses?.concat(DEFAULT_STATUSES),
data: formData.value?.statuses
? [...formData.value.statuses, ...DEFAULT_STATUSES]
: undefined,
border: true,
showOverflow: true,
autoResize: true,

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
// oxlint-disable unicorn/no-nested-ternary
import type { FormType } from '../data';
import type { ErpPurchaseOrderApi } from '#/api/erp/purchase/order';
@@ -51,7 +52,6 @@ const formData = ref<
const formType = ref<FormType>('create'); // 表单类型:'create' | 'edit' | 'detail'
const itemFormRef = ref<InstanceType<typeof ItemForm>>();
/* eslint-disable unicorn/no-nested-ternary */
const getTitle = computed(() =>
formType.value === 'create'
? $t('ui.actionTitle.create', ['采购退货'])

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
// oxlint-disable unicorn/no-nested-ternary
import type { FormType } from '../data';
import type { ErpSaleOrderApi } from '#/api/erp/sale/order';
@@ -47,7 +48,6 @@ const formData = ref<
const formType = ref<FormType>('create'); // 表单类型:'create' | 'edit' | 'detail'
const itemFormRef = ref<InstanceType<typeof ItemForm>>();
/* eslint-disable unicorn/no-nested-ternary */
const getTitle = computed(() =>
formType.value === 'create'
? $t('ui.actionTitle.create', ['销售出库'])

View File

@@ -36,9 +36,12 @@ defineExpose({
tableRef.value?.getRemoveRecords() as Demo03StudentApi.Demo03Course[];
const insertRecords =
tableRef.value?.getInsertRecords() as Demo03StudentApi.Demo03Course[];
return data
.filter((row) => !removeRecords.some((removed) => removed.id === row.id))
?.concat(insertRecords.map((row: any) => ({ ...row, id: undefined })));
return [
...data.filter(
(row) => !removeRecords.some((removed) => removed.id === row.id),
),
...insertRecords.map((row: any) => ({ ...row, id: undefined })),
];
},
});

View File

@@ -36,9 +36,12 @@ defineExpose({
tableRef.value?.getRemoveRecords() as Demo03StudentApi.Demo03Course[];
const insertRecords =
tableRef.value?.getInsertRecords() as Demo03StudentApi.Demo03Course[];
return data
.filter((row) => !removeRecords.some((removed) => removed.id === row.id))
?.concat(insertRecords.map((row: any) => ({ ...row, id: undefined })));
return [
...data.filter(
(row) => !removeRecords.some((removed) => removed.id === row.id),
),
...insertRecords.map((row: any) => ({ ...row, id: undefined })),
];
},
});

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import type { MallSpuApi } from '#/api/mall/product/spu';
import type { PropertyAndValues } from '#/views/mall/product/spu/components/type';

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-dynamic-delete */
/**
* 百度地图 SDK 加载工具
*/
@@ -41,7 +40,7 @@ export const loadBaiduMapSdk = (timeout = 10_000): Promise<void> => {
// 全局回调
(window as any)[CALLBACK_NAME] = () => {
clearTimeout(timeoutId);
delete (window as any)[CALLBACK_NAME];
delete (window as any).CALLBACK_NAME;
resolve();
};
@@ -53,7 +52,7 @@ export const loadBaiduMapSdk = (timeout = 10_000): Promise<void> => {
script.addEventListener('onerror', () => {
clearTimeout(timeoutId);
loadPromise = null;
delete (window as any)[CALLBACK_NAME];
delete (window as any).CALLBACK_NAME;
reject(new Error('百度地图 SDK 加载失败'));
});
document.body.append(script);

View File

@@ -100,8 +100,7 @@ function processContent(text: string) {
if (line.includes('```')) {
continue;
}
// eslint-disable-next-line unicorn/prefer-string-replace-all
line = line.replace(/([*_~`>])|(\d+\.)\s/g, '');
line = line.replaceAll(/([*_~`>])|(\d+\.)\s/g, '');
arr.push(line);
}
return arr.join('\n');
@@ -155,7 +154,6 @@ defineExpose({
class="flex flex-col items-center justify-center"
v-html="html"
></div>
<!-- eslint-enable vue/no-v-html -->
</div>
<div ref="mindMapRef" class="wh-full">
<svg

View File

@@ -65,7 +65,7 @@ function audioLoadedMetadata() {
audioProps.duration = formatAudioTime(audioRef.value.duration);
}
function handleProgressChange(value: number | [number, number]) {
function handleProgressChange(value: number | number[]) {
if (!audioRef.value || Array.isArray(value)) {
return;
}

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import type { MusicSong } from './types';
import { provide, ref } from 'vue';

View File

@@ -398,8 +398,7 @@ const setEncoded = (type: string, data: string) => {
const importLocalFile = () => {
const file = refFile.value.files[0];
const reader = new FileReader();
// eslint-disable-next-line unicorn/prefer-blob-reading-methods
reader.readAsText(file);
reader.text(file);
reader.addEventListener('load', function () {
const xmlStr = this.result;
createNewDiagram(xmlStr);

View File

@@ -231,7 +231,9 @@ const selectProcessListener = (listener: any) => {
) ?? [];
updateElementExtensions(
bpmnElement,
otherExtensionList.value?.concat(bpmnElementListeners.value),
otherExtensionList.value
? [...otherExtensionList.value, ...bpmnElementListeners.value]
: undefined,
);
};

View File

@@ -72,7 +72,6 @@ declare global {
const bpmnInstances = () => (window as any)?.bpmnInstances;
// @ts-expect-error: retained for legacy multi-instance mode compatibility
// eslint-disable-next-line unused-imports/no-unused-vars
const getElementLoop = (businessObject: any): void => {
if (!businessObject.loopCharacteristics) {
loopCharacteristics.value = 'Null';

View File

@@ -125,7 +125,6 @@ const resetTaskForm = () => {
(ex: any) => ex.$type === `${prefix}:CandidateParam`,
)?.value;
if (candidateParamStr && candidateParamStr.length > 0) {
// eslint-disable-next-line unicorn/prefer-switch
if (userTaskForm.value.candidateStrategy === CandidateStrategy.EXPRESSION) {
// 特殊:流程表达式,只有一个 input 输入框
// @ts-expect-error: expression strategy stores a scalar in an array-shaped field

View File

@@ -34,7 +34,6 @@ export default {
},
unbind(el) {
document.removeEventListener('touchstart', el[ctx].documentHandler); // 解绑
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete el[ctx];
delete el.ctx;
},
};

View File

@@ -1,6 +1,5 @@
function xmlStr2XmlObj(xmlStr) {
// eslint-disable-next-line no-useless-assignment
let xmlObj = {};
let xmlObj;
if (document.all) {
const xmlDom = new window.ActiveXObject('Microsoft.XMLDOM');
xmlDom.loadXML(xmlStr);

View File

@@ -413,9 +413,10 @@ export function useNodeForm(nodeType: BpmNodeTypeEnum) {
case CandidateStrategy.FORM_DEPT_LEADER: {
// 候选人参数格式: | 分隔 。左边为表单内部门字段。 右边为部门层级
const deptFieldOnForm = configForm.value.formDept;
candidateParam = deptFieldOnForm?.concat(
`|${configForm.value.deptLevel}`,
);
candidateParam =
deptFieldOnForm === undefined
? undefined
: `${deptFieldOnForm}|${configForm.value.deptLevel}`;
break;
}
case CandidateStrategy.FORM_USER: {
@@ -426,7 +427,10 @@ export function useNodeForm(nodeType: BpmNodeTypeEnum) {
case CandidateStrategy.MULTI_LEVEL_DEPT_LEADER: {
// 候选人参数格式: | 分隔 。左边为部门(多个部门用 , 分隔)。 右边为部门层级
const deptIds = configForm.value.deptIds?.join(',');
candidateParam = deptIds?.concat(`|${configForm.value.deptLevel}`);
candidateParam =
deptIds === undefined
? undefined
: `${deptIds}|${configForm.value.deptLevel}`;
break;
}
case CandidateStrategy.POST: {

View File

@@ -94,8 +94,10 @@ const [Modal, modalApi] = useVbenModal({
// 设置到 values
await formApi.setValues(formData.value as any);
await gridApi.grid.reloadData(
(formData.value!.statuses =
formData.value?.statuses?.concat(DEFAULT_STATUSES)) as any,
(formData.value!.statuses = [
...formData.value.statuses,
...DEFAULT_STATUSES,
]) as any,
);
} finally {
modalApi.unlock();
@@ -128,7 +130,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
mode: 'cell',
},
columns: useFormColumns(),
data: formData.value?.statuses?.concat(DEFAULT_STATUSES),
data: formData.value?.statuses
? [...formData.value.statuses, ...DEFAULT_STATUSES]
: undefined,
border: true,
showOverflow: true,
autoResize: true,

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
// oxlint-disable unicorn/no-nested-ternary
import type { FormType } from '../data';
import type { ErpPurchaseOrderApi } from '#/api/erp/purchase/order';
@@ -51,7 +52,6 @@ const formData = ref<
const formType = ref<FormType>('create'); // 表单类型:'create' | 'edit' | 'detail'
const itemFormRef = ref<InstanceType<typeof ItemForm>>();
/* eslint-disable unicorn/no-nested-ternary */
const getTitle = computed(() =>
formType.value === 'create'
? $t('ui.actionTitle.create', ['采购退货'])

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
// oxlint-disable unicorn/no-nested-ternary
import type { FormType } from '../data';
import type { ErpSaleOrderApi } from '#/api/erp/sale/order';
@@ -47,7 +48,6 @@ const formData = ref<
const formType = ref<FormType>('create'); // 表单类型:'create' | 'edit' | 'detail'
const itemFormRef = ref<InstanceType<typeof ItemForm>>();
/* eslint-disable unicorn/no-nested-ternary */
const getTitle = computed(() =>
formType.value === 'create'
? $t('ui.actionTitle.create', ['销售出库'])

View File

@@ -36,9 +36,12 @@ defineExpose({
tableRef.value?.getRemoveRecords() as Demo03StudentApi.Demo03Course[];
const insertRecords =
tableRef.value?.getInsertRecords() as Demo03StudentApi.Demo03Course[];
return data
.filter((row) => !removeRecords.some((removed) => removed.id === row.id))
?.concat(insertRecords.map((row: any) => ({ ...row, id: undefined })));
return [
...data.filter(
(row) => !removeRecords.some((removed) => removed.id === row.id),
),
...insertRecords.map((row: any) => ({ ...row, id: undefined })),
];
},
});

View File

@@ -36,9 +36,12 @@ defineExpose({
tableRef.value?.getRemoveRecords() as Demo03StudentApi.Demo03Course[];
const insertRecords =
tableRef.value?.getInsertRecords() as Demo03StudentApi.Demo03Course[];
return data
.filter((row) => !removeRecords.some((removed) => removed.id === row.id))
?.concat(insertRecords.map((row: any) => ({ ...row, id: undefined })));
return [
...data.filter(
(row) => !removeRecords.some((removed) => removed.id === row.id),
),
...insertRecords.map((row: any) => ({ ...row, id: undefined })),
];
},
});

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import type { MallSpuApi } from '#/api/mall/product/spu';
import type { PropertyAndValues } from '#/views/mall/product/spu/components/type';

View File

@@ -45,7 +45,7 @@ const canAdd = computed(() => {
watch(
() => props.modelValue,
async (newValue) => {
// eslint-disable-next-line unicorn/no-nested-ternary
// oxlint-disable-next-line unicorn/no-nested-ternary
const ids = Array.isArray(newValue) ? newValue : newValue ? [newValue] : [];
if (ids.length === 0) {
pointActivityList.value = [];

View File

@@ -45,7 +45,7 @@ const canAdd = computed(() => {
watch(
() => props.modelValue,
async (newValue) => {
// eslint-disable-next-line unicorn/no-nested-ternary
// oxlint-disable-next-line unicorn/no-nested-ternary
const ids = Array.isArray(newValue) ? newValue : newValue ? [newValue] : [];
if (ids.length === 0) {
activityList.value = [];

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-dynamic-delete */
/**
* 百度地图 SDK 加载工具
*/
@@ -41,7 +40,7 @@ export const loadBaiduMapSdk = (timeout = 10_000): Promise<void> => {
// 全局回调
(window as any)[CALLBACK_NAME] = () => {
clearTimeout(timeoutId);
delete (window as any)[CALLBACK_NAME];
delete (window as any).CALLBACK_NAME;
resolve();
};
@@ -53,7 +52,7 @@ export const loadBaiduMapSdk = (timeout = 10_000): Promise<void> => {
script.addEventListener('onerror', () => {
clearTimeout(timeoutId);
loadPromise = null;
delete (window as any)[CALLBACK_NAME];
delete (window as any).CALLBACK_NAME;
reject(new Error('百度地图 SDK 加载失败'));
});
document.body.append(script);

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
// oxlint-disable unicorn/no-nested-ternary
import type {
UploadFile,
UploadProgressEvent,
@@ -159,7 +160,6 @@ function handleUploadError(error: any) {
* @param file 待上传的文件
* @returns 是否允许上传
*/
/* eslint-disable unicorn/no-nested-ternary */
async function beforeUpload(file: File) {
// 检查文件数量限制(使用 getValue 获取实际已上传的文件数量)
const currentFiles = getValue();

View File

@@ -100,8 +100,7 @@ function processContent(text: string) {
if (line.includes('```')) {
continue;
}
// eslint-disable-next-line unicorn/prefer-string-replace-all
line = line.replace(/([*_~`>])|(\d+\.)\s/g, '');
line = line.replaceAll(/([*_~`>])|(\d+\.)\s/g, '');
arr.push(line);
}
return arr.join('\n');
@@ -160,7 +159,6 @@ defineExpose({
class="flex flex-col items-center justify-center"
v-html="html"
></div>
<!-- eslint-enable vue/no-v-html -->
</div>
<div ref="mindMapRef" class="wh-full">
<svg

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import type { MusicSong } from './types';
import { provide, ref } from 'vue';

View File

@@ -405,8 +405,7 @@ const setEncoded = (type: string, data: string) => {
const importLocalFile = () => {
const file = refFile.value.files[0];
const reader = new FileReader();
// eslint-disable-next-line unicorn/prefer-blob-reading-methods
reader.readAsText(file);
reader.text(file);
reader.addEventListener('load', function () {
const xmlStr = this.result;
createNewDiagram(xmlStr);

View File

@@ -3,14 +3,11 @@ import { isFunction, isObject } from '@vben/utils';
const WILDCARD = '*';
function CamundaModdleExtension(eventBus) {
// eslint-disable-next-line unicorn/no-this-assignment, @typescript-eslint/no-this-alias
const self = this;
eventBus.on('moddleCopy.canCopyProperty', (context) => {
const parent = context.parent;
const property = context.property;
return self.canCopyProperty(property, parent);
return this.canCopyProperty(property, parent);
});
}

View File

@@ -239,7 +239,9 @@ const selectProcessListener = (listener: any) => {
) ?? [];
updateElementExtensions(
bpmnElement,
otherExtensionList.value?.concat(bpmnElementListeners.value),
otherExtensionList.value
? [...otherExtensionList.value, ...bpmnElementListeners.value]
: undefined,
);
};

View File

@@ -74,7 +74,6 @@ declare global {
const bpmnInstances = () => (window as any)?.bpmnInstances;
// @ts-expect-error: retained for legacy multi-instance mode compatibility
// eslint-disable-next-line unused-imports/no-unused-vars
const getElementLoop = (businessObject: any): void => {
if (!businessObject.loopCharacteristics) {
loopCharacteristics.value = 'Null';

View File

@@ -126,7 +126,6 @@ const resetTaskForm = () => {
(ex: any) => ex.$type === `${prefix}:CandidateParam`,
)?.value;
if (candidateParamStr && candidateParamStr.length > 0) {
// eslint-disable-next-line unicorn/prefer-switch
if (userTaskForm.value.candidateStrategy === CandidateStrategy.EXPRESSION) {
// 特殊:流程表达式,只有一个 input 输入框
// @ts-expect-error: expression strategy stores a scalar in an array-shaped field

View File

@@ -34,7 +34,6 @@ export default {
},
unbind(el) {
document.removeEventListener('touchstart', el[ctx].documentHandler); // 解绑
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete el[ctx];
delete el.ctx;
},
};

View File

@@ -1,6 +1,5 @@
function xmlStr2XmlObj(xmlStr) {
// eslint-disable-next-line no-useless-assignment
let xmlObj = {};
let xmlObj;
if (document.all) {
const xmlDom = new window.ActiveXObject('Microsoft.XMLDOM');
xmlDom.loadXML(xmlStr);

View File

@@ -455,9 +455,10 @@ export function useNodeForm(nodeType: BpmNodeTypeEnum) {
case CandidateStrategy.FORM_DEPT_LEADER: {
// 候选人参数格式: | 分隔 。左边为表单内部门字段。 右边为部门层级
const deptFieldOnForm = configForm.value.formDept;
candidateParam = deptFieldOnForm?.concat(
`|${configForm.value.deptLevel}`,
);
candidateParam =
deptFieldOnForm === undefined
? undefined
: `${deptFieldOnForm}|${configForm.value.deptLevel}`;
break;
}
case CandidateStrategy.FORM_USER: {
@@ -468,7 +469,10 @@ export function useNodeForm(nodeType: BpmNodeTypeEnum) {
case CandidateStrategy.MULTI_LEVEL_DEPT_LEADER: {
// 候选人参数格式: | 分隔 。左边为部门(多个部门用 , 分隔)。 右边为部门层级
const deptIds = configForm.value.deptIds?.join(',');
candidateParam = deptIds?.concat(`|${configForm.value.deptLevel}`);
candidateParam =
deptIds === undefined
? undefined
: `${deptIds}|${configForm.value.deptLevel}`;
break;
}
case CandidateStrategy.POST: {

View File

@@ -94,8 +94,10 @@ const [Modal, modalApi] = useVbenModal({
// 设置到 values
await formApi.setValues(formData.value as any);
await gridApi.grid.reloadData(
(formData.value!.statuses =
formData.value?.statuses?.concat(DEFAULT_STATUSES)) as any,
(formData.value!.statuses = [
...formData.value.statuses,
...DEFAULT_STATUSES,
]) as any,
);
} finally {
modalApi.unlock();
@@ -128,7 +130,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
mode: 'cell',
},
columns: useFormColumns(),
data: formData.value?.statuses?.concat(DEFAULT_STATUSES),
data: formData.value?.statuses
? [...formData.value.statuses, ...DEFAULT_STATUSES]
: undefined,
border: true,
showOverflow: true,
autoResize: true,

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
// oxlint-disable unicorn/no-nested-ternary
import type { FormType } from '../data';
import type { ErpPurchaseOrderApi } from '#/api/erp/purchase/order';
@@ -51,7 +52,6 @@ const formData = ref<
const formType = ref<FormType>('create'); // 表单类型:'create' | 'edit' | 'detail'
const itemFormRef = ref<InstanceType<typeof ItemForm>>();
/* eslint-disable unicorn/no-nested-ternary */
const getTitle = computed(() =>
formType.value === 'create'
? $t('ui.actionTitle.create', ['采购退货'])

View File

@@ -1,4 +1,5 @@
<script lang="ts" setup>
// oxlint-disable unicorn/no-nested-ternary
import type { FormType } from '../data';
import type { ErpSaleOrderApi } from '#/api/erp/sale/order';
@@ -47,7 +48,6 @@ const formData = ref<
const formType = ref<FormType>('create'); // 表单类型:'create' | 'edit' | 'detail'
const itemFormRef = ref<InstanceType<typeof ItemForm>>();
/* eslint-disable unicorn/no-nested-ternary */
const getTitle = computed(() =>
formType.value === 'create'
? $t('ui.actionTitle.create', ['销售出库'])

View File

@@ -36,9 +36,12 @@ defineExpose({
tableRef.value?.getRemoveRecords() as Demo03StudentApi.Demo03Course[];
const insertRecords =
tableRef.value?.getInsertRecords() as Demo03StudentApi.Demo03Course[];
return data
.filter((row) => !removeRecords.some((removed) => removed.id === row.id))
?.concat(insertRecords.map((row: any) => ({ ...row, id: undefined })));
return [
...data.filter(
(row) => !removeRecords.some((removed) => removed.id === row.id),
),
...insertRecords.map((row: any) => ({ ...row, id: undefined })),
];
},
});

View File

@@ -36,9 +36,12 @@ defineExpose({
tableRef.value?.getRemoveRecords() as Demo03StudentApi.Demo03Course[];
const insertRecords =
tableRef.value?.getInsertRecords() as Demo03StudentApi.Demo03Course[];
return data
.filter((row) => !removeRecords.some((removed) => removed.id === row.id))
?.concat(insertRecords.map((row: any) => ({ ...row, id: undefined })));
return [
...data.filter(
(row) => !removeRecords.some((removed) => removed.id === row.id),
),
...insertRecords.map((row: any) => ({ ...row, id: undefined })),
];
},
});

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import type { MallSpuApi } from '#/api/mall/product/spu';
import type { PropertyAndValues } from '#/views/mall/product/spu/components/type';

View File

@@ -45,7 +45,7 @@ const canAdd = computed(() => {
watch(
() => props.modelValue,
async (newValue) => {
// eslint-disable-next-line unicorn/no-nested-ternary
// oxlint-disable-next-line unicorn/no-nested-ternary
const ids = Array.isArray(newValue) ? newValue : newValue ? [newValue] : [];
if (ids.length === 0) {
productSpus.value = [];

View File

@@ -46,7 +46,7 @@ const canAdd = computed(() => {
watch(
() => props.modelValue,
async (newValue) => {
// eslint-disable-next-line unicorn/no-nested-ternary
// oxlint-disable-next-line unicorn/no-nested-ternary
const ids = Array.isArray(newValue) ? newValue : newValue ? [newValue] : [];
if (ids.length === 0) {
activityList.value = [];

View File

@@ -45,7 +45,7 @@ const canAdd = computed(() => {
watch(
() => props.modelValue,
async (newValue) => {
// eslint-disable-next-line unicorn/no-nested-ternary
// oxlint-disable-next-line unicorn/no-nested-ternary
const ids = Array.isArray(newValue) ? newValue : newValue ? [newValue] : [];
if (ids.length === 0) {
pointActivityList.value = [];

View File

@@ -45,7 +45,7 @@ const canAdd = computed(() => {
watch(
() => props.modelValue,
async (newValue) => {
// eslint-disable-next-line unicorn/no-nested-ternary
// oxlint-disable-next-line unicorn/no-nested-ternary
const ids = Array.isArray(newValue) ? newValue : newValue ? [newValue] : [];
if (ids.length === 0) {
activityList.value = [];

View File

@@ -133,9 +133,8 @@ export const useAuthStore = defineStore('auth', () => {
async function fetchUserInfo() {
// 加载
// eslint-disable-next-line no-useless-assignment
let authPermissionInfo: AuthPermissionInfo | null = null;
authPermissionInfo = await getAuthPermissionInfoApi();
const authPermissionInfo: AuthPermissionInfo | null =
await getAuthPermissionInfoApi();
// userStore
userStore.setUserInfo(authPermissionInfo.user);
userStore.setUserRoles(authPermissionInfo.roles);

View File

@@ -134,9 +134,8 @@ export const useAuthStore = defineStore('auth', () => {
async function fetchUserInfo() {
// 加载
// eslint-disable-next-line no-useless-assignment
let authPermissionInfo: AuthPermissionInfo | null = null;
authPermissionInfo = await getAuthPermissionInfoApi();
const authPermissionInfo: AuthPermissionInfo | null =
await getAuthPermissionInfoApi();
// userStore
userStore.setUserInfo(authPermissionInfo.user);
userStore.setUserRoles(authPermissionInfo.roles);

View File

@@ -36,9 +36,12 @@ defineExpose({
tableRef.value?.getRemoveRecords() as Demo03StudentApi.Demo03Course[];
const insertRecords =
tableRef.value?.getInsertRecords() as Demo03StudentApi.Demo03Course[];
return data
.filter((row) => !removeRecords.some((removed) => removed.id === row.id))
?.concat(insertRecords.map((row: any) => ({ ...row, id: undefined })));
return [
...data.filter(
(row) => !removeRecords.some((removed) => removed.id === row.id),
),
...insertRecords.map((row: any) => ({ ...row, id: undefined })),
];
},
});

View File

@@ -36,9 +36,12 @@ defineExpose({
tableRef.value?.getRemoveRecords() as Demo03StudentApi.Demo03Course[];
const insertRecords =
tableRef.value?.getInsertRecords() as Demo03StudentApi.Demo03Course[];
return data
.filter((row) => !removeRecords.some((removed) => removed.id === row.id))
?.concat(insertRecords.map((row: any) => ({ ...row, id: undefined })));
return [
...data.filter(
(row) => !removeRecords.some((removed) => removed.id === row.id),
),
...insertRecords.map((row: any) => ({ ...row, id: undefined })),
];
},
});

View File

@@ -142,15 +142,12 @@ export function dataURLtoBlob(base64Buf: string): Blob {
const arr = base64Buf.split(',');
const typeItem = arr[0];
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const mime = typeItem!.match(/:(.*?);/)![1];
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const bstr = window.atob(arr[1]!);
let n = bstr.length;
const u8arr = new Uint8Array(n);
while (n--) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
u8arr[n] = bstr.codePointAt(n)!;
}
return new Blob([u8arr], { type: mime });
@@ -225,8 +222,7 @@ export function base64ToFile(base64: string, fileName: string): File {
// 优化的 Uint8Array 填充逻辑
for (let i = 0; i < n; i++) {
// 使用 charCodeAt() 获取字符对应的字节值Base64 解码后的字符串是字节级别的)
// eslint-disable-next-line unicorn/prefer-code-point
u8arr[i] = bstr.charCodeAt(i);
u8arr[i] = bstr.codePointAt(i);
}
// 返回 File 文件对象

View File

@@ -82,8 +82,7 @@ export function copyValueToTarget(target: any, source: any) {
Object.keys(newObj).forEach((key) => {
// 如果不是target中的属性则删除
if (!Object.keys(target).includes(key)) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete newObj[key];
delete newObj.key;
}
});
// 更新目标对象值

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/**
* CRON 表达式工具类;提供 CRON 表达式的解析、格式化、验证等功能
*/