fix(组件): 脑图&formTable 组件问题修复&lint
This commit is contained in:
parent
b7760714a0
commit
a78d3364c0
|
@ -23,9 +23,12 @@ import {
|
||||||
scheduleOrgCenterListUrl,
|
scheduleOrgCenterListUrl,
|
||||||
scheduleProCenterListUrl,
|
scheduleProCenterListUrl,
|
||||||
scheduleSysCenterListUrl,
|
scheduleSysCenterListUrl,
|
||||||
stopRealOrdApiUrl, stopRealOrgPlanUrl,
|
stopRealOrdApiUrl,
|
||||||
stopRealProjectApiUrl, stopRealProjectPlanUrl,
|
stopRealOrgPlanUrl,
|
||||||
stopRealSysApiUrl, stopRealSysPlanUrl,
|
stopRealProjectApiUrl,
|
||||||
|
stopRealProjectPlanUrl,
|
||||||
|
stopRealSysApiUrl,
|
||||||
|
stopRealSysPlanUrl,
|
||||||
systemRealTotal,
|
systemRealTotal,
|
||||||
systemScheduleTotal,
|
systemScheduleTotal,
|
||||||
taskOrgPlanRealCenterListUrl,
|
taskOrgPlanRealCenterListUrl,
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
import useMinderStore from '@/store/modules/components/minder-editor/index';
|
import useMinderStore from '@/store/modules/components/minder-editor/index';
|
||||||
import { MinderCustomEvent } from '@/store/modules/components/minder-editor/types';
|
import { MinderCustomEvent } from '@/store/modules/components/minder-editor/types';
|
||||||
import { filterTree, findNodeByKey, getGenerateId, mapTree, replaceNodeInTree } from '@/utils';
|
import { filterTree, findNodeByKey, getGenerateId, mapTree, replaceNodeInTree, traverseTree } from '@/utils';
|
||||||
import { hasAnyPermission } from '@/utils/permission';
|
import { hasAnyPermission } from '@/utils/permission';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -762,6 +762,21 @@
|
||||||
deleteResourceList: clearDeleteResource ? [] : tempMinderParams.value.deleteResourceList, // 请求错误的时候,删除的资源不清空,因为此时节点已经被脑图删除
|
deleteResourceList: clearDeleteResource ? [] : tempMinderParams.value.deleteResourceList, // 请求错误的时候,删除的资源不清空,因为此时节点已经被脑图删除
|
||||||
additionalNodeList: [],
|
additionalNodeList: [],
|
||||||
};
|
};
|
||||||
|
if (clearDeleteResource) {
|
||||||
|
traverseTree(importJson.value.root.children, (node) => {
|
||||||
|
const minderNode: MinderJsonNode = window.minder.getNodeById(node.data.id);
|
||||||
|
if (minderNode?.data) {
|
||||||
|
// 能找到对应的脑图节点,重置 isNew 和 changed 状态
|
||||||
|
minderNode.data.isNew = false;
|
||||||
|
minderNode.data.changed = false;
|
||||||
|
} else {
|
||||||
|
// 找不到对应的脑图节点,说明当前是进入了模块层级,之前更改的节点没有渲染,重置源数据 isNew 和 changed 状态
|
||||||
|
node.data.isNew = false;
|
||||||
|
node.data.changed = false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -810,16 +825,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const minderNode: MinderJsonNode = window.minder.getNodeById(node.data.id);
|
|
||||||
if (minderNode?.data) {
|
|
||||||
// 能找到对应的脑图节点,重置 isNew 和 changed 状态
|
|
||||||
minderNode.data.isNew = false;
|
|
||||||
minderNode.data.changed = false;
|
|
||||||
} else {
|
|
||||||
// 找不到对应的脑图节点,说明当前是进入了模块层级,之前更改的节点没有渲染,重置源数据 isNew 和 changed 状态
|
|
||||||
node.data.isNew = false;
|
|
||||||
node.data.changed = false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
return tempMinderParams.value;
|
return tempMinderParams.value;
|
||||||
|
@ -830,7 +835,7 @@
|
||||||
* @param fullJson 脑图导出的完整数据
|
* @param fullJson 脑图导出的完整数据
|
||||||
* @param callback 保存成功回调
|
* @param callback 保存成功回调
|
||||||
*/
|
*/
|
||||||
async function handleMinderSave(fullJson: MinderJson, callback: (refersh: boolean) => void) {
|
async function handleMinderSave(fullJson: MinderJson, callback: (refresh: boolean) => void) {
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await saveCaseMinder(makeMinderParams(fullJson));
|
await saveCaseMinder(makeMinderParams(fullJson));
|
||||||
|
|
|
@ -82,6 +82,7 @@
|
||||||
title: '',
|
title: '',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
|
maxLength: 1000,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<MsSelect
|
<MsSelect
|
||||||
v-model:model-value="currentValue"
|
v-model:model-value="innerValue"
|
||||||
mode="remote"
|
mode="remote"
|
||||||
:options="[]"
|
:options="[]"
|
||||||
:placeholder="props.placeholder || 'common.pleaseSelectMember'"
|
:placeholder="props.placeholder || 'common.pleaseSelectMember'"
|
||||||
|
@ -16,7 +16,13 @@
|
||||||
:remote-func="loadList"
|
:remote-func="loadList"
|
||||||
:remote-extra-params="{ ...props.loadOptionParams, type: props.type }"
|
:remote-extra-params="{ ...props.loadOptionParams, type: props.type }"
|
||||||
:option-label-render="optionLabelRender"
|
:option-label-render="optionLabelRender"
|
||||||
|
:fallback-option="(val) => ({
|
||||||
|
label: (val as Record<string, any>).name,
|
||||||
|
value: val,
|
||||||
|
})"
|
||||||
|
:object-value="true"
|
||||||
:should-calculate-max-tag="false"
|
:should-calculate-max-tag="false"
|
||||||
|
@remote-search="handleRemoteSearch"
|
||||||
>
|
>
|
||||||
</MsSelect>
|
</MsSelect>
|
||||||
</template>
|
</template>
|
||||||
|
@ -61,7 +67,8 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const currentValue = defineModel<(string | number)[] | string>({ default: [] });
|
const currentValue = defineModel<(string | number)[]>('modelValue', { default: [] });
|
||||||
|
const innerValue = ref<MsUserSelectorOption[]>([]);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
||||||
const loadList = async (params: Record<string, any>) => {
|
const loadList = async (params: Record<string, any>) => {
|
||||||
|
@ -99,4 +106,28 @@
|
||||||
}
|
}
|
||||||
return `<span class='text-[var(--color-text-1)]'>${option.name}</span>`;
|
return `<span class='text-[var(--color-text-1)]'>${option.name}</span>`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => innerValue.value,
|
||||||
|
(value) => {
|
||||||
|
const values: (string | number)[] = [];
|
||||||
|
value.forEach((item) => {
|
||||||
|
values.push(item.id);
|
||||||
|
});
|
||||||
|
currentValue.value = values;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
function handleRemoteSearch(options: MsUserSelectorOption[]) {
|
||||||
|
if (currentValue.value.length > 0 && innerValue.value.length === 0) {
|
||||||
|
const values: MsUserSelectorOption[] = [];
|
||||||
|
currentValue.value.forEach((item) => {
|
||||||
|
const option = options.find((o) => o.id === item);
|
||||||
|
if (option) {
|
||||||
|
values.push(option);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
innerValue.value = values;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -158,6 +158,7 @@
|
||||||
class="ms-form-table-input"
|
class="ms-form-table-input"
|
||||||
:auto-size="{ minRows: 1, maxRows: 1 }"
|
:auto-size="{ minRows: 1, maxRows: 1 }"
|
||||||
:size="item.size || 'medium'"
|
:size="item.size || 'medium'"
|
||||||
|
:max-length="item.maxLength"
|
||||||
@input="() => handleFormChange(record, rowIndex, item)"
|
@input="() => handleFormChange(record, rowIndex, item)"
|
||||||
></a-textarea>
|
></a-textarea>
|
||||||
<MsQuickInput
|
<MsQuickInput
|
||||||
|
@ -165,6 +166,7 @@
|
||||||
v-model:model-value="record[item.dataIndex as string]"
|
v-model:model-value="record[item.dataIndex as string]"
|
||||||
:title="item.title as string || ''"
|
:title="item.title as string || ''"
|
||||||
:disabled="props.disabled || item.disabled || record.disabled"
|
:disabled="props.disabled || item.disabled || record.disabled"
|
||||||
|
:max-length="item.maxLength"
|
||||||
class="ms-form-table-input"
|
class="ms-form-table-input"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@input="() => handleFormChange(record, rowIndex, item)"
|
@input="() => handleFormChange(record, rowIndex, item)"
|
||||||
|
|
|
@ -58,7 +58,7 @@ export interface SearchParams {
|
||||||
|
|
||||||
export interface AddProjectMember {
|
export interface AddProjectMember {
|
||||||
projectId?: string;
|
projectId?: string;
|
||||||
userIds: string[] | string;
|
userIds: string[];
|
||||||
roleIds: string[] | string;
|
roleIds: string[] | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,6 @@ export default {
|
||||||
'project.taskCenter.filterProPlaceholderText': '请选择所属项目',
|
'project.taskCenter.filterProPlaceholderText': '请选择所属项目',
|
||||||
'project.taskCenter.filterOrgPlaceholderText': '请选择所属组织',
|
'project.taskCenter.filterOrgPlaceholderText': '请选择所属组织',
|
||||||
'project.executionHistory.cleared': '执行结果被清理',
|
'project.executionHistory.cleared': '执行结果被清理',
|
||||||
'project.taskCenter.plan': '计划',
|
'project.taskCenter.plan': '计划',
|
||||||
'project.taskCenter.planGroup': '计划组',
|
'project.taskCenter.planGroup': '计划组',
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<!-- 编辑项目 -->
|
<!-- 编辑项目 -->
|
||||||
<a-form-item v-if="type === 'edit'" :label="t('organization.member.project')" asterisk-position="end">
|
<a-form-item v-if="type === 'edit'" :label="t('organization.member.project')" asterisk-position="end">
|
||||||
<MsUserSelector
|
<MsUserSelector
|
||||||
v-model="form.projectIds"
|
v-model:modelValue="form.projectIds"
|
||||||
:load-option-params="{ organizationId: lastOrganizationId }"
|
:load-option-params="{ organizationId: lastOrganizationId }"
|
||||||
:type="UserRequestTypeEnum.SYSTEM_ORGANIZATION_PROJECT"
|
:type="UserRequestTypeEnum.SYSTEM_ORGANIZATION_PROJECT"
|
||||||
placeholder="organization.member.selectProjectScope"
|
placeholder="organization.member.selectProjectScope"
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
:rules="[{ required: true, message: t('organization.member.selectMemberEmptyTip') }]"
|
:rules="[{ required: true, message: t('organization.member.selectMemberEmptyTip') }]"
|
||||||
>
|
>
|
||||||
<MsUserSelector
|
<MsUserSelector
|
||||||
v-model="form.memberIds"
|
v-model:modelValue="form.memberIds"
|
||||||
:load-option-params="{ organizationId: lastOrganizationId }"
|
:load-option-params="{ organizationId: lastOrganizationId }"
|
||||||
:type="UserRequestTypeEnum.SYSTEM_ORGANIZATION_MEMBER"
|
:type="UserRequestTypeEnum.SYSTEM_ORGANIZATION_MEMBER"
|
||||||
placeholder="organization.member.selectMemberScope"
|
placeholder="organization.member.selectMemberScope"
|
||||||
|
@ -100,8 +100,8 @@
|
||||||
export interface InitFromType {
|
export interface InitFromType {
|
||||||
organizationId?: string;
|
organizationId?: string;
|
||||||
userRoleIds: string[];
|
userRoleIds: string[];
|
||||||
memberIds: string[];
|
memberIds: (string | number)[];
|
||||||
projectIds: string[];
|
projectIds: (string | number)[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const initFormValue: InitFromType = {
|
const initFormValue: InitFromType = {
|
||||||
|
|
|
@ -35,5 +35,5 @@ export default {
|
||||||
'system.log.log': 'Operation log',
|
'system.log.log': 'Operation log',
|
||||||
'system.log.time': 'Operation time',
|
'system.log.time': 'Operation time',
|
||||||
'system.log.content': 'in {module} under {range}',
|
'system.log.content': 'in {module} under {range}',
|
||||||
'system.log.operateType.stop': 'Stop',
|
'system.log.operateType.stop': 'Stop',
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue