fix: lint
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import type { MusicSong } from './types';
|
||||
|
||||
import { provide, ref } from 'vue';
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -239,7 +239,9 @@ const selectProcessListener = (listener: any) => {
|
||||
) ?? [];
|
||||
updateElementExtensions(
|
||||
bpmnElement,
|
||||
otherExtensionList.value?.concat(bpmnElementListeners.value),
|
||||
otherExtensionList.value
|
||||
? [...otherExtensionList.value, ...bpmnElementListeners.value]
|
||||
: undefined,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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', ['采购退货'])
|
||||
|
||||
@@ -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', ['销售出库'])
|
||||
|
||||
@@ -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 })),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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 })),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import type { MusicSong } from './types';
|
||||
|
||||
import { provide, ref } from 'vue';
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -231,7 +231,9 @@ const selectProcessListener = (listener: any) => {
|
||||
) ?? [];
|
||||
updateElementExtensions(
|
||||
bpmnElement,
|
||||
otherExtensionList.value?.concat(bpmnElementListeners.value),
|
||||
otherExtensionList.value
|
||||
? [...otherExtensionList.value, ...bpmnElementListeners.value]
|
||||
: undefined,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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', ['采购退货'])
|
||||
|
||||
@@ -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', ['销售出库'])
|
||||
|
||||
@@ -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 })),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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 })),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import type { MusicSong } from './types';
|
||||
|
||||
import { provide, ref } from 'vue';
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -239,7 +239,9 @@ const selectProcessListener = (listener: any) => {
|
||||
) ?? [];
|
||||
updateElementExtensions(
|
||||
bpmnElement,
|
||||
otherExtensionList.value?.concat(bpmnElementListeners.value),
|
||||
otherExtensionList.value
|
||||
? [...otherExtensionList.value, ...bpmnElementListeners.value]
|
||||
: undefined,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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', ['采购退货'])
|
||||
|
||||
@@ -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', ['销售出库'])
|
||||
|
||||
@@ -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 })),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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 })),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 })),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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 })),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user