From b64a0deae5b5d33f9e20671a68936b27f0b9b00b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 21 七月 2026 18:03:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_pro2.0' into dev_pro2.0

---
 src/views/mes/process-design/template/data.ts |  131 +++++++++++++++++++++++--------------------
 1 files changed, 71 insertions(+), 60 deletions(-)

diff --git a/src/views/mes/process-design/template/data.ts b/src/views/mes/process-design/template/data.ts
index 0e2f655..e5dabf1 100644
--- a/src/views/mes/process-design/template/data.ts
+++ b/src/views/mes/process-design/template/data.ts
@@ -1,64 +1,65 @@
-import type { VbenFormSchema } from '#/adapter/form';
-import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-import type { MesPdTemplateApi } from '#/api/mes/pro/processdesign/template';
+import type { VbenFormSchema } from "#/adapter/form";
+import type { VxeTableGridOptions } from "#/adapter/vxe-table";
+import type { MesPdTemplateApi } from "#/api/mes/pro/processdesign/template";
 
-import { DICT_TYPE } from '../../../../packages/constants/src';
-import { getDictOptions } from '../../../../packages/effects/hooks/src';
+import { DICT_TYPE } from "@vben/constants";
+import { getDictOptions } from "@vben/hooks";
 
-import { z } from '#/adapter/form';
+import { z } from "#/adapter/form";
 
 /** 琛ㄥ崟绫诲瀷 */
-export type FormType = 'create' | 'detail' | 'update';
+export type FormType = "create" | "detail" | "update";
 
 /** 鏂板/淇敼宸ヨ壓鍙傛暟妯℃澘鐨勮〃鍗� */
 export function useFormSchema(): VbenFormSchema[] {
   return [
     {
-      fieldName: 'id',
-      component: 'Input',
+      fieldName: "id",
+      component: "Input",
       dependencies: {
-        triggerFields: [''],
+        triggerFields: [""],
         show: () => false,
       },
     },
     {
-      fieldName: 'name',
-      label: '妯℃澘鍚嶇О',
-      component: 'Input',
+      fieldName: "templateCode",
+      label: "妯℃澘缂栫爜",
+      component: "Input",
+      componentProps: {
+        maxLength: 64,
+        placeholder: "妯℃澘缂栫爜鑷姩鐢熸垚",
+        disabled: true,
+      },
+    },
+    {
+      fieldName: "templateName",
+      label: "妯℃澘鍚嶇О",
+      component: "Input",
       componentProps: {
         maxLength: 100,
-        placeholder: '璇疯緭鍏ユā鏉垮悕绉�',
+        placeholder: "璇疯緭鍏ユā鏉垮悕绉�",
       },
-      rules: z.string().min(1, '妯℃澘鍚嶇О涓嶈兘涓虹┖').max(100),
+      rules: z.string().min(1, "妯℃澘鍚嶇О涓嶈兘涓虹┖").max(100),
     },
     {
-      fieldName: 'type',
-      label: '妯℃澘绫诲瀷',
-      component: 'Select',
+      fieldName: "templateType",
+      label: "妯℃澘绫诲瀷",
+      component: "Select",
       componentProps: {
         allowClear: true,
-        options: getDictOptions(DICT_TYPE.MES_PD_TEMPLATE_TYPE, 'number'),
-        placeholder: '璇烽�夋嫨妯℃澘绫诲瀷',
+        options: getDictOptions(DICT_TYPE.MES_PD_TEMPLATE_TYPE, "number"),
+        placeholder: "璇烽�夋嫨妯℃澘绫诲瀷",
       },
-      rules: 'selectRequired',
+      rules: "selectRequired",
     },
     {
-      fieldName: 'parameterIds',
-      label: '鍏宠仈鍙傛暟',
-      component: 'Input',
-      dependencies: {
-        triggerFields: [''],
-        show: () => false,
-      },
-    },
-    {
-      fieldName: 'remark',
-      label: '澶囨敞',
-      component: 'Textarea',
-      formItemClass: 'col-span-2',
+      fieldName: "remark",
+      label: "澶囨敞",
+      component: "Textarea",
+      formItemClass: "col-span-2",
       componentProps: {
         maxLength: 250,
-        placeholder: '璇疯緭鍏ュ娉�',
+        placeholder: "璇疯緭鍏ュ娉�",
         rows: 3,
       },
     },
@@ -69,59 +70,69 @@
 export function useGridFormSchema(): VbenFormSchema[] {
   return [
     {
-      fieldName: 'name',
-      label: '妯℃澘鍚嶇О',
-      component: 'Input',
+      fieldName: "templateCode",
+      label: "妯℃澘缂栫爜",
+      component: "Input",
       componentProps: {
         allowClear: true,
-        placeholder: '璇疯緭鍏ユā鏉垮悕绉�',
+        placeholder: "璇疯緭鍏ユā鏉跨紪鐮�",
       },
     },
     {
-      fieldName: 'type',
-      label: '妯℃澘绫诲瀷',
-      component: 'Select',
+      fieldName: "templateName",
+      label: "妯℃澘鍚嶇О",
+      component: "Input",
       componentProps: {
         allowClear: true,
-        options: getDictOptions(DICT_TYPE.MES_PD_TEMPLATE_TYPE, 'number'),
-        placeholder: '璇烽�夋嫨妯℃澘绫诲瀷',
+        placeholder: "璇疯緭鍏ユā鏉垮悕绉�",
+      },
+    },
+    {
+      fieldName: "templateType",
+      label: "妯℃澘绫诲瀷",
+      component: "Select",
+      componentProps: {
+        allowClear: true,
+        options: getDictOptions(DICT_TYPE.MES_PD_TEMPLATE_TYPE, "number"),
+        placeholder: "璇烽�夋嫨妯℃澘绫诲瀷",
       },
     },
   ];
 }
 
 /** 鍒楄〃鐨勫瓧娈� */
-export function useGridColumns(): VxeTableGridOptions<MesPdTemplateApi.Template>['columns'] {
+export function useGridColumns(): VxeTableGridOptions<MesPdTemplateApi.Template>["columns"] {
   return [
     {
-      type: 'seq',
-      title: '搴忓彿',
+      type: "seq",
+      title: "搴忓彿",
       width: 60,
-      align: 'center',
+      align: "center",
     },
-    { field: 'name', title: '妯℃澘鍚嶇О', minWidth: 180 },
+    { field: "templateCode", title: "妯℃澘缂栫爜", minWidth: 150 },
+    { field: "templateName", title: "妯℃澘鍚嶇О", minWidth: 180 },
     {
-      field: 'type',
-      title: '妯℃澘绫诲瀷',
+      field: "templateType",
+      title: "妯℃澘绫诲瀷",
       width: 120,
       cellRender: {
-        name: 'CellDict',
+        name: "CellDict",
         props: { type: DICT_TYPE.MES_PD_TEMPLATE_TYPE },
       },
     },
-    { field: 'createUser', title: '鍒涘缓浜�', width: 120 },
+    { field: "remark", title: "澶囨敞", minWidth: 180 },
     {
-      field: 'createTime',
-      title: '鍒涘缓鏃堕棿',
+      field: "createTime",
+      title: "鍒涘缓鏃堕棿",
       width: 180,
-      formatter: 'formatDateTime',
+      formatter: "formatDateTime",
     },
     {
-      title: '鎿嶄綔',
-      width: 150,
-      fixed: 'right',
+      title: "鎿嶄綔",
+      width: 240,
+      fixed: "right",
       slots: {
-        default: 'actions',
+        default: "actions",
       },
     },
   ];

--
Gitblit v1.9.3