fix: 代码 review 修改
parent
6a029ad7a0
commit
9f7761f832
|
@ -1,7 +1,5 @@
|
||||||
import type { PageParam, PageResult } from '@vben/request';
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
import type { BpmModelApi } from '#/api/bpm/model';
|
|
||||||
|
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace BpmCategoryApi {
|
export namespace BpmCategoryApi {
|
||||||
|
@ -14,14 +12,6 @@ export namespace BpmCategoryApi {
|
||||||
description?: string;
|
description?: string;
|
||||||
sort: number; // 分类排序
|
sort: number; // 分类排序
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 模型分类信息 */
|
|
||||||
// TODO @jason:这个应该非 api 的,可以考虑抽到页面里哈。
|
|
||||||
export interface ModelCategoryInfo {
|
|
||||||
id: number;
|
|
||||||
name: string;
|
|
||||||
modelList: BpmModelApi.ModelVO[];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询流程分类分页 */
|
/** 查询流程分类分页 */
|
||||||
|
|
|
@ -40,13 +40,13 @@ export namespace BpmModelApi {
|
||||||
bpmnXml: string;
|
bpmnXml: string;
|
||||||
startUsers?: UserInfo[];
|
startUsers?: UserInfo[];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 模型分类信息 */
|
/** 模型分类信息 */
|
||||||
export interface ModelCategoryInfo {
|
export interface ModelCategoryInfo {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
modelList: ModelVO[];
|
modelList: BpmModelApi.ModelVO[];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取流程模型列表 */
|
/** 获取流程模型列表 */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { BpmModelApi } from '#/api/bpm/model';
|
import type { ModelCategoryInfo } from '#/api/bpm/model';
|
||||||
|
|
||||||
import { onActivated, reactive, ref, useTemplateRef, watch } from 'vue';
|
import { onActivated, reactive, ref, useTemplateRef, watch } from 'vue';
|
||||||
|
|
||||||
|
@ -41,9 +41,9 @@ const modelListSpinning = refAutoReset(false, 3000);
|
||||||
// 保存排序状态
|
// 保存排序状态
|
||||||
const saveSortLoading = ref(false);
|
const saveSortLoading = ref(false);
|
||||||
// 按照 category 分组的数据
|
// 按照 category 分组的数据
|
||||||
const categoryGroup = ref<BpmModelApi.ModelCategoryInfo[]>([]);
|
const categoryGroup = ref<ModelCategoryInfo[]>([]);
|
||||||
// 未排序前的原始数据
|
// 未排序前的原始数据
|
||||||
const originalData = ref<BpmModelApi.ModelCategoryInfo[]>([]);
|
const originalData = ref<ModelCategoryInfo[]>([]);
|
||||||
// 可以排序元素的容器
|
// 可以排序元素的容器
|
||||||
const sortable = useTemplateRef<HTMLElement>('categoryGroupRef');
|
const sortable = useTemplateRef<HTMLElement>('categoryGroupRef');
|
||||||
// 排序引用,以便后续启用或禁用排序
|
// 排序引用,以便后续启用或禁用排序
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { BpmCategoryApi } from '#/api/bpm/category';
|
import type { BpmModelApi, ModelCategoryInfo } from '#/api/bpm/model';
|
||||||
import type { BpmModelApi } from '#/api/bpm/model';
|
|
||||||
|
|
||||||
import { computed, ref, watchEffect } from 'vue';
|
import { computed, ref, watchEffect } from 'vue';
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ import { DICT_TYPE } from '#/utils';
|
||||||
import CategoryRenameForm from '../../category/modules/rename-form.vue';
|
import CategoryRenameForm from '../../category/modules/rename-form.vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
categoryInfo: BpmCategoryApi.ModelCategoryInfo;
|
categoryInfo: ModelCategoryInfo;
|
||||||
isCategorySorting: boolean;
|
isCategorySorting: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue