Commit 094b4d36 by 张恒

feat(jcsj): 工序管理页面添加左侧分类树和表单字段调整

- 添加左侧分类树组件,支持分类筛选功能
- 新增 defaultReporter 字段到表单参数
- 将 collectionItem 替换为 collectionSchemeId 字段
- 新增 ratedWorkingHours 字段
- 移除 processType 和 无工装生命周期相关字段
- 将作业指导字段类型改为上传组件
- 实现分类树的数据获取和图标渲染功能
- 添加页面初始化时的分类数据加载逻辑
parent 67efcb95
...@@ -6,11 +6,11 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; ...@@ -6,11 +6,11 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface RokeProcessPageParams extends BasicPageParams { export interface RokeProcessPageParams extends BasicPageParams {
name: string; name: string;
categoryId: string; defaultReporter: string;
processType: string; categoryId: string;
collectionItem: string; collectionSchemeId: string;
note: string; note: string;
} }
...@@ -25,10 +25,10 @@ export interface RokeProcessPageModel { ...@@ -25,10 +25,10 @@ export interface RokeProcessPageModel {
categoryId: string; categoryId: string;
processType: string;
collectionSchemeId: string; collectionSchemeId: string;
ratedWorkingHours: string;
note: string; note: string;
} }
......
...@@ -2,8 +2,29 @@ ...@@ -2,8 +2,29 @@
<template> <template>
<ResizePageWrapper :hasLeft="false"> <ResizePageWrapper :hasLeft="true" :formLeftWidth="300">
<template #resizeLeft>
<BasicTree
title=""
toolbar
search
switcher
:clickRowToExpand="true"
:treeData="treeData"
:fieldNames="{ key: 'value', title: 'name' }"
@select="handleSelect"
>
<template #title="item">
<template v-if="item.renderIcon === 'childIcon'">
<Icon icon="ant-design:branches-outlined" />
</template>
&nbsp;&nbsp;{{ item.name }}
</template>
</BasicTree>
</template>
<template #resizeRight> <template #resizeRight>
<BasicTable @register="registerTable" isMenuTable ref="tableRef" <BasicTable @register="registerTable" isMenuTable ref="tableRef"
...@@ -60,7 +81,7 @@ ...@@ -60,7 +81,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed,provide,Ref, createVNode, import { ref, computed,provide,Ref, onMounted,createVNode,
} from 'vue'; } from 'vue';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
...@@ -95,8 +116,8 @@ ...@@ -95,8 +116,8 @@
import Icon from '/@/components/Icon/index'; import Icon from '/@/components/Icon/index';
import { BasicTree, TreeItem } from '/@/components/Tree';
import { getDicDetailList } from '/@/api/system/dic';
...@@ -154,8 +175,8 @@ ...@@ -154,8 +175,8 @@
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string); const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef); provide<Ref<string>>('currentFormId', formIdComputedRef);
const selectId = ref('');
const treeData = ref<TreeItem[]>([]);
...@@ -214,6 +235,11 @@ ...@@ -214,6 +235,11 @@
onMounted(() => {
fetch();
});
function buttonClick(code) { function buttonClick(code) {
...@@ -326,6 +352,31 @@ ...@@ -326,6 +352,31 @@
function handleSelect(selectIds) {
selectId.value = selectIds[0];
reload({ searchInfo: { categoryId: selectIds[0] } });
}
async function fetch() {
treeData.value = (await getDicDetailList({
itemId: '2005547790246666242',
})) as unknown as TreeItem[];
addRenderIcon(treeData.value);
}
function addRenderIcon(data) {
data.map((item) => {
if (item.children?.length) addRenderIcon(item.children);
return (item.renderIcon = item.children?.length ? 'parentIcon' : 'childIcon');
});
}
function getLessActions(record: Recordable) { function getLessActions(record: Recordable) {
let list = getActions(record); let list = getActions(record);
return list.slice(0, listSpliceNum.value); return list.slice(0, listSpliceNum.value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment