1
0

2 Komitmen cd1728b453 ... 94dd371f68

Pembuat SHA1 Pesan Tanggal
  DOVER-GLOBAL\10093976 94dd371f68 feat:测试自动生成弹窗 8 bulan lalu
  DOVER-GLOBAL\10093976 78ef686061 feat:最新一版 9 bulan lalu
31 mengubah file dengan 1492 tambahan dan 250 penghapusan
  1. 1 1
      admin.ui.plus-master/beiyong.vue
  2. 40 18
      admin.ui.plus-master/src/api/admin/AlarmService/alarmQueryApi.ts
  3. 38 21
      admin.ui.plus-master/src/api/admin/AlarmService/alarmQueryDto.ts
  4. 23 0
      admin.ui.plus-master/src/api/admin/AlarmService/testApi.ts
  5. 57 0
      admin.ui.plus-master/src/api/admin/AlarmService/testDto.ts
  6. 1 1
      admin.ui.plus-master/src/views/admin/PCBA/boardFunctionResult/index.vue
  7. 1 1
      admin.ui.plus-master/src/views/admin/PCBA/boardFunctionSummary/index.vue
  8. 1 1
      admin.ui.plus-master/src/views/admin/PCBA/boardList/index.vue
  9. 1 1
      admin.ui.plus-master/src/views/admin/PCBA/boardTestRecord/index.vue
  10. 2 2
      admin.ui.plus-master/src/views/admin/application/fuelingFTP/index.vue
  11. 11 4
      admin.ui.plus-master/src/views/admin/application/fuelingFTPofDate/index.vue
  12. 2 2
      admin.ui.plus-master/src/views/admin/authorize/dispenserAuthCode/index.vue
  13. 6 4
      admin.ui.plus-master/src/views/admin/authorize/fuelingFTP/index.vue
  14. 3 3
      admin.ui.plus-master/src/views/admin/authorize/fuelingFTPofDate/index.vue
  15. 3 3
      admin.ui.plus-master/src/views/admin/authorize/oilUp/index.vue
  16. 1 1
      admin.ui.plus-master/src/views/admin/product/groupLogo/index.vue
  17. 1 1
      admin.ui.plus-master/src/views/admin/product/slelist/index.vue
  18. 1 1
      admin.ui.plus-master/src/views/admin/product/type/index.vue
  19. 1 1
      admin.ui.plus-master/src/views/admin/statement/BlackBox/index.vue
  20. 163 149
      admin.ui.plus-master/src/views/admin/statement/alarmQuery/index.vue
  21. 1 1
      admin.ui.plus-master/src/views/admin/statement/displayControl/index.vue
  22. 2 2
      admin.ui.plus-master/src/views/admin/statement/encodercontrols/index.vue
  23. 2 2
      admin.ui.plus-master/src/views/admin/statement/jikongzhuban/index.vue
  24. 1 1
      admin.ui.plus-master/src/views/admin/statement/problemData/index.vue
  25. 1 1
      admin.ui.plus-master/src/views/admin/statement/repairList/index .vue
  26. 1 1
      admin.ui.plus-master/src/views/admin/statement/taxcontrol/index.vue
  27. 3 3
      admin.ui.plus-master/src/views/admin/yujing/alarmRules/Level.vue
  28. 389 0
      admin.ui.plus-master/src/views/admin/yujing/alarmRules/test.vue
  29. 1 1
      admin.ui.plus-master/src/views/example/application/equipment/index.vue
  30. 645 0
      admin.ui.plus-master/src/views/example/codeGeneration/dialog.vue
  31. 89 23
      admin.ui.plus-master/src/views/example/codeGeneration/index.vue

+ 1 - 1
admin.ui.plus-master/beiyong.vue

@@ -624,7 +624,7 @@ const pageState = useDynamicPageSize(10, 15);`
         const init = async () => {
           state.loading = true`
           if(state.isPage){
-            indexCode=indexCode+`\nconst res:any = await new Api().getList({...state.pageInput, Filter:state.filter})
+            indexCode=indexCode+`\nconst res:any = await new Api().getList({...pageState.pageInput, Filter:state.filter})
             state.total = res?.data?.total ?? 0`
           }else{
             indexCode=indexCode+`\nconst res:any = await new Api().getList({...state.filter})`

+ 40 - 18
admin.ui.plus-master/src/api/admin/AlarmService/alarmQueryApi.ts

@@ -1,23 +1,45 @@
 import { AxiosResponse } from 'axios'
-  import { ContentType, HttpClient, RequestParams } from '/@/api/admin/http-client'
-  export class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
-    /**
-   * No description
-   *
-   * @tags
+import { ContentType, HttpClient, RequestParams } from '/@/api/admin/http-client'
+import { ResultOutputBoolean } from '/@/api/admin/AlarmService/alarmQueryDto'
+
+export class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
+  /**
+   * 查询列表
+   * @tags 推送管理
    * @name GetList
-   * @summary 查询列表
+   * @summary 查询推送列表
    * @request POST:'/api/app/push/get-push-list'
    * @secure
    */
-getList = (data:any ,params: RequestParams = {}) : any  =>
-      this.request<AxiosResponse,any>({
-        path:'/api/app/push/get-push-list',
-        method: 'POST',
-        body:data,
-        type: ContentType.Json,
-        secure: true,
-        format: 'json',
-        ...params
-      })
-    }
+  getList = (data: any, params: RequestParams = {}): Promise<any> =>
+    this.request<AxiosResponse, any>({
+      path: '/api/app/push/get-push-list',
+      method: 'POST',
+      body: data,
+      type: ContentType.Json,
+      secure: true,
+      format: 'json',
+      ...params
+    })
+
+  /**
+   * 模板推送
+   * @tags 推送管理
+   * @name TemplateSend
+   * @summary 执行推送操作
+   * @request POST:'/api/app/push/template-send'
+   * @secure
+   */
+  templateSend = (data: {
+    filter: any,        // 筛选条件
+    selectedIds: any[]  // 选中的记录ID
+  }, params: RequestParams = {}): Promise<ResultOutputBoolean> =>
+    this.request<AxiosResponse, ResultOutputBoolean>({
+      path: '/api/app/push/template-send',
+      method: 'POST',
+      body: data,
+      type: ContentType.FormUrlEncoded, // 匹配接口要求的content-type
+      secure: true,
+      ...params
+    })
+}

+ 38 - 21
admin.ui.plus-master/src/api/admin/AlarmService/alarmQueryDto.ts

@@ -1,5 +1,5 @@
 /** 查询信息输出 */
-  export interface ResultOutputListPushDto{
+export interface ResultOutputListPushDto {
   /** 是否成功标记 */
   success?: boolean
   /** 编码 */
@@ -7,27 +7,44 @@
   /** 消息 */
   msg?: string | null
   /** 数据 */
- data?:PushDto[] | null
+  data?: {
+    list: PushDto[]
+    total: number
+  } | null
 }
-      export interface PushDto{
-   /** 规则id */
-        ruleId?: integer
-   /** 推送用户id */
-        pushUserid?: integer
-   /** 推送用户 */
-        pushUser?: string
-   /** 推送内容 */
-        content?: string
-   /** 是否推送 */
-        isPushed?: boolean | ""
-   /** 推送时间 */
-        pushTime?: string
-   /** 报警ID */
-        alarmhistoryID?: string
-   /** 优先级 */
-        taskPriority?: integer
 
-        sdate?:string
-        edate?:string
+/** 推送接口响应 */
+export interface ResultOutputBoolean {
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  /** 数据 */
+  data?: boolean | null
+}
+
+/** 推送数据模型 */
+export interface PushDto {
+  /** 规则id */
+  ruleId?: number
+  /** 推送用户id */
+  pushUserid?: number
+  /** 推送用户 */
+  pushUser?: string
+  /** 推送内容 */
+  content?: string
+  /** 是否推送 */
+  pushed?: string  // 与页面显示保持一致:"已推送"/"未推送"
+  /** 推送时间 */
+  pushTime?: string
+  /** 报警ID */
+  alarmhistoryID?: string
+  /** 优先级 */
+  taskPriority?: number
 
+  // 时间范围参数
+  sdate?: string
+  edate?: string
 }

+ 23 - 0
admin.ui.plus-master/src/api/admin/AlarmService/testApi.ts

@@ -0,0 +1,23 @@
+import { AxiosResponse } from 'axios'
+  import { ContentType, HttpClient, RequestParams } from '/@/api/admin/http-client'
+  export class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
+    /**
+   * No description
+   *
+   * @tags
+   * @name GetList
+   * @summary 查询列表
+   * @request POST:'/api/app/board-test-record/get-board-test-record-page'
+   * @secure
+   */
+getList = (data:any ,params: RequestParams = {}) : any  =>
+      this.request<AxiosResponse,any>({
+        path:'/api/app/board-test-record/get-board-test-record-page',
+        method: 'POST',
+        body:data,
+        type: ContentType.Json,
+        secure: true,
+        format: 'json',
+        ...params
+      })
+    }

+ 57 - 0
admin.ui.plus-master/src/api/admin/AlarmService/testDto.ts

@@ -0,0 +1,57 @@
+/** 查询信息输出 */
+  export interface ResultOutputPageOutputBoardTestRecordDto{
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  /** 数据 */
+ data?:PageOutputBoardTestRecordDto[] | null
+}
+    export interface PageOutputBoardTestRecordDto{
+      /**
+      * 数据总数
+      * @format int64
+      */
+      total?: number
+      /** 数据 */
+      list?: BoardTestRecordDto[] | null
+    }
+    export interface BoardTestRecordDto{
+   /** 序列号 */
+      serno?: string
+   /** 外部序列号 */
+      exserno?: string
+   /** 主板类型 */
+      boardType?: integer
+   /** 主板名称 */
+      boardName?: string
+   /** 功能码 */
+      functionCode?: integer
+   /** 功能名称 */
+      functionName?: string
+   /** 检测类型 */
+      testType?: integer
+   /** 检测时间 */
+      time?: string
+   /** 测试结果 */
+      result?: integer
+   /** 测试功能数 */
+      testNum?: integer
+   /** 测试成功功能数 */
+      testSuccessNum?: integer
+   /** 测试员 */
+      user?: string
+   /** 测试耗时 */
+      duration?: integer
+   /** 备注 */
+      info?: string
+
+}
+export interface pageInput {
+      /**当前页数 */
+      CurrentPage: number | any
+      /**展示页数 */
+      PageSize: number | any
+    }

+ 1 - 1
admin.ui.plus-master/src/views/admin/PCBA/boardFunctionResult/index.vue

@@ -274,7 +274,7 @@ const init = async () => {
   const beginCreateTime = createTimeRange.length > 0? createTimeRange[0] : "";
   const endCreateTime = createTimeRange.length > 1? createTimeRange[1] : "";
   const res: any = await new BoardFunctionResultApi().getList({
-    ...state.pageInput,
+    ...pageState.pageInput,
     Filter: {
       ...filterWithoutTimeRange,
       beginCreateTime,

+ 1 - 1
admin.ui.plus-master/src/views/admin/PCBA/boardFunctionSummary/index.vue

@@ -225,7 +225,7 @@ const init = async () => {
 
 
   const res: any = await new BoardFunctionSummaryApi().getList({
-   ...state.pageInput,
+   ...pageState.pageInput,
     Filter: {
      ...filterWithoutTimeRange,
       beginCreateTime,

+ 1 - 1
admin.ui.plus-master/src/views/admin/PCBA/boardList/index.vue

@@ -238,7 +238,7 @@ const init = async () => {
   const beginCreateTime = createTimeRange.length > 0? createTimeRange[0] : "";
   const endCreateTime = createTimeRange.length > 1? createTimeRange[1] : "";
   const res: any = await new BoardListApi().getList({
-   ...state.pageInput,
+   ...pageState.pageInput,
     Filter: {
      ...filterWithoutTimeRange,
       beginCreateTime,

+ 1 - 1
admin.ui.plus-master/src/views/admin/PCBA/boardTestRecord/index.vue

@@ -293,7 +293,7 @@ const init = async () => {
   const beginTime = testTimeRange.length > 0? testTimeRange[0] : "";
   const endTime = testTimeRange.length > 1? testTimeRange[1] : "";
   const res: any = await new BoardTestRecordApi().getList({
-   ...state.pageInput,
+   ...pageState.pageInput,
     Filter: {
      ...filterWithoutTimeRange,
       beginTime,

+ 2 - 2
admin.ui.plus-master/src/views/admin/application/fuelingFTP/index.vue

@@ -137,7 +137,7 @@ const init = async () => {
   state.msgDisplay=false
   state.pwdDisplay=false
   state.timeDisplay=false
-  const res:any = await new FuelingFtpAPI().getFtpDate({...state.pageInput, filter:state.filter}).catch(() => {
+  const res:any = await new FuelingFtpAPI().getFtpDate({...pageState.pageInput, filter:state.filter}).catch(() => {
     state.loading = false
   })
   //console.log(res.data.list)
@@ -202,7 +202,7 @@ const onQuery =async () => {
     const name:any=await new AuthApi().getUserProfile()
     state.filter.name=name.data.name
     await new FuelingFtpAPI().insertFtpDate(state.filter)
-    const data:any = await new FuelingFtpAPI().getFtpDate({...state.pageInput, filter:state.filter}).catch(() => {
+    const data:any = await new FuelingFtpAPI().getFtpDate({...pageState.pageInput, filter:state.filter}).catch(() => {
       state.loading = false
     })
     state.total=data.data.total

+ 11 - 4
admin.ui.plus-master/src/views/admin/application/fuelingFTPofDate/index.vue

@@ -59,8 +59,8 @@
             </el-table>
             <div class="my-flex my-flex-end" style="margin-top: 20px">
               <el-pagination
-                v-model:currentPage="state.pageInput.CurrentPage"
-                v-model:page-size="state.pageInput.PageSize"
+                v-model:currentPage="pageState.pageInput.currentPage"
+                v-model:page-size="pageState.pageInput.pageSize"
                 :total="state.total"
                 :page-sizes="[10, 15, 20, 50, 100]"
                 small
@@ -87,6 +87,11 @@
   import type {pageInput} from "/@/api/admin/shareDto/shareDto";
   import { AuthApi } from '/@/api/admin/Auth'
   
+import { useDynamicPageSize } from "/@/composables/useDynamicPageSize";
+
+// 使用组合式函数获取分页状态
+const pageState = useDynamicPageSize(10, 15);
+
   const multipleTableRef=ref<InstanceType<typeof ElTable>>()
   /**FTP申请页面对象 */
   const state = reactive({
@@ -143,7 +148,7 @@
     state.msgDisplay=false
     state.pwdDisplay=false
     state.timeDisplay=false
-    const res:any = await new FuelingFtpAPI().getFtpDate({...state.pageInput, filter:state.filter}).catch(() => {
+    const res:any = await new FuelingFtpAPI().getFtpDate({...pageState.pageInput, filter:state.filter}).catch(() => {
       state.loading = false
     })
     //console.log(res.data.list)
@@ -152,6 +157,8 @@
   }
   
   onMounted(() => {
+   // 初始化分页大小
+   state.pageInput.PageSize = pageState.pageInput.pageSize;
     init()
     eventBus.off('refreshView')
     eventBus.on('refreshView', async () => {
@@ -212,7 +219,7 @@
       const name:any=await new AuthApi().getUserProfile()
       state.filter.name=name.data.name
       await new FuelingFtpAPI().insertFtpDate(state.filter)
-      const data:any = await new FuelingFtpAPI().getFtpDate({...state.pageInput, filter:state.filter}).catch(() => {
+      const data:any = await new FuelingFtpAPI().getFtpDate({...pageState.pageInput, filter:state.filter}).catch(() => {
         state.loading = false
       })
       state.total=data.data.total

+ 2 - 2
admin.ui.plus-master/src/views/admin/authorize/dispenserAuthCode/index.vue

@@ -144,7 +144,7 @@ const init = async () => {
   state.btnDisplay = true
   state.msgDisplay = false
   state.pwdDisplay = false
-  const res: any = await new DispenserAuthCodeApi().getDispenserAuthCodeRecord({ ...state.pageInput, filter: state.filter }).catch(() => {
+  const res: any = await new DispenserAuthCodeApi().getDispenserAuthCodeRecord({ ...pageState.pageInput, filter: state.filter }).catch(() => {
     state.loading = false
 
 
@@ -250,7 +250,7 @@ const onQuery = async () => {
       state.filter.type = funcode.toString();
 
       await new DispenserAuthCodeApi().InsertDispenserAuthCode(state.filter)
-      const data: any = await new DispenserAuthCodeApi().getDispenserAuthCodeRecord({ ...state.pageInput, filter: state.filter }).catch(() => {
+      const data: any = await new DispenserAuthCodeApi().getDispenserAuthCodeRecord({ ...pageState.pageInput, filter: state.filter }).catch(() => {
         state.loading = false
       })
       state.total = data.data.total

+ 6 - 4
admin.ui.plus-master/src/views/admin/authorize/fuelingFTP/index.vue

@@ -64,8 +64,8 @@
               :label="column.label" />
           </el-table>
           <div class="my-flex my-flex-end" style="margin-top: 20px">
-            <el-pagination v-model:currentPage="state.pageInput.CurrentPage"
-              v-model:page-size="state.pageInput.PageSize" :total="state.total" :page-sizes="[10, 15, 20, 50, 100]" small
+            <el-pagination v-model:currentPage="pageState.pageInput.currentPage"
+              v-model:page-size="pageState.pageInput.pageSize" :total="state.total" :page-sizes="[10, 15, 20, 50, 100]" small
               background @size-change="onSizeChange" @current-change="onCurrentChange"
               layout="total, sizes, prev, pager, next, jumper" />
           </div>
@@ -149,7 +149,7 @@ const init = async (showLoading: boolean = true) => {
 
   try {
     const res: any = await new FuelingFtpAPI().getFtpDate({
-      ...state.pageInput,
+      ...pageState.pageInput,
       filter: state.filter
     });
 
@@ -165,6 +165,8 @@ const init = async (showLoading: boolean = true) => {
 
 onMounted(() => {
   // 初始化分页大小
+state.pageInput.PageSize = pageState.pageInput.pageSize;
+  // 初始化分页大小
   init()
   eventBus.off('refreshView')
   eventBus.on('refreshView', async () => {
@@ -219,7 +221,7 @@ const onQuery = async () => {
     const name: any = await new AuthApi().getUserProfile()
     state.filter.name = name.data.name
     await new FuelingFtpAPI().insertFtpDate(state.filter)
-    const data: any = await new FuelingFtpAPI().getFtpDate({ ...state.pageInput, filter: state.filter }).catch(() => {
+    const data: any = await new FuelingFtpAPI().getFtpDate({ ...pageState.pageInput, filter: state.filter }).catch(() => {
       state.loading = false
     })
     state.total = data.data.total

+ 3 - 3
admin.ui.plus-master/src/views/admin/authorize/fuelingFTPofDate/index.vue

@@ -161,7 +161,7 @@ const init = async (showLoading: boolean = true) => {
 
   try {
     const res: any = await new FuelingFtpAPI().getFtpDate({
-      ...state.pageInput,
+      ...pageState.pageInput,
       filter: state.filter
     });
 
@@ -177,7 +177,7 @@ const init = async (showLoading: boolean = true) => {
 
 onMounted(() => {
   // 初始化分页大小
-// state.pageInput.PageSize = pageState.pageInput.pageSize;
+state.pageInput.PageSize = pageState.pageInput.pageSize;
   init()
   eventBus.off('refreshView')
   eventBus.on('refreshView', async () => {
@@ -236,7 +236,7 @@ const onQuery = async () => {
     const name: any = await new AuthApi().getUserProfile()
     state.filter.name = name.data.name
     await new FuelingFtpAPI().insertFtpDate(state.filter)
-    const data: any = await new FuelingFtpAPI().getFtpDate({ ...state.pageInput, filter: state.filter }).catch(() => {
+    const data: any = await new FuelingFtpAPI().getFtpDate({ ...pageState.pageInput, filter: state.filter }).catch(() => {
       state.loading = false
     })
     state.total = data.data.total

+ 3 - 3
admin.ui.plus-master/src/views/admin/authorize/oilUp/index.vue

@@ -104,8 +104,8 @@
 </el-table>
 <div class="my-flex my-flex-end" style="margin-top: 20px">
             <el-pagination
-              v-model:currentPage="state.pageInput.CurrentPage"
-              v-model:page-size="state.pageInput.PageSize"
+              v-model:currentPage="pageState.pageInput.currentPage"
+              v-model:page-size="pageState.pageInput.pageSize"
               :total="state.total"
               :page-sizes="[10, 15, 20, 50, 100]"
               small
@@ -217,7 +217,7 @@ const onCurrentChange = (val: number) => {
         /**初始化 */
         const init = async () => {
           state.loading = true
-const res:any = await new Api().getList({...state.pageInput, Filter:state.filter})
+const res:any = await new Api().getList({...pageState.pageInput, Filter:state.filter})
             state.total = res?.data?.total ?? 0
 state.tableModel = res?.data?.list ?? []
           state.loading = false

+ 1 - 1
admin.ui.plus-master/src/views/admin/product/groupLogo/index.vue

@@ -180,7 +180,7 @@ const onQuery = async () => {
   if (filterCopy.state === '' || filterCopy.state === null) {
     delete filterCopy.state;
   }
-  const { data } = await new GroupLogoKeyApi().getPage({ ...state.pageInput, filter: filterCopy } as groupLogoKeyRequestBody).catch(() => state.loading = false)
+  const { data } = await new GroupLogoKeyApi().getPage({ ...pageState.pageInput, filter: filterCopy } as groupLogoKeyRequestBody).catch(() => state.loading = false)
   state.list = data?.list ?? []
   state.total = data?.total ?? 0
   state.loading = false

+ 1 - 1
admin.ui.plus-master/src/views/admin/product/slelist/index.vue

@@ -198,7 +198,7 @@ const rules = reactive({
         /**初始化 */
         const init = async () => {
           state.loading = true
-          const res: any = await new Api().getList({ ...state.pageInput, Filter: state.filter })
+          const res: any = await new Api().getList({ ...pageState.pageInput, Filter: state.filter })
   state.tableModel = res?.data?.list ?? []
   state.total = res?.data?.total ?? 0
   state.loading = false

+ 1 - 1
admin.ui.plus-master/src/views/admin/product/type/index.vue

@@ -246,7 +246,7 @@ const getImg = (url) => {
 const onQuery = async () => {
   state.loading = true
   const { data } = await new ComponentTypeApi().getPage({
-     ...state.pageInput, filter: state.filterModel }).catch(() => {
+     ...pageState.pageInput, filter: state.filterModel }).catch(() => {
     state.loading = false
   })
   state.bomListData = data?.list ?? []

+ 1 - 1
admin.ui.plus-master/src/views/admin/statement/BlackBox/index.vue

@@ -201,7 +201,7 @@ tableModel: [] as BlackBoxDto,
 
   try {
     const res: any = await new Api().getList({
-      ...state.pageInput, // 使用 state.pageInput 中的分页参数
+      ...pageState.pageInput, // 使用 state.pageInput 中的分页参数
       Filter: state.filter,
     });
     state.total = res?.data?.total ?? 0;

+ 163 - 149
admin.ui.plus-master/src/views/admin/statement/alarmQuery/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="layout-pd">
     <el-row>
-<!--操作-->
-      <el-col :xs="24" >
-        <el-card class="mt8"  shadow="hover" >
-<el-form :model="state.filter" :inline="true" @submit.stop.prevent style="margin-bottom:-20px;">
+      <!-- 操作区域 -->
+      <el-col :xs="24">
+        <el-card class="mt8" shadow="hover">
+          <el-form :model="state.filter" :inline="true" @submit.stop.prevent style="margin-bottom:-20px;">
             <el-form-item prop="name" style="width: 100%">
               <el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
                 <el-form-item label="推送用户">
@@ -17,7 +17,6 @@
                     <el-option label="所有" :value="undefined"></el-option>
                     <el-option v-for="(value, key) in FuelDispenserEnum" :key="key" :label="value" :value="key" />
                   </el-select>
-                  <!-- <el-input v-model="state.filter.isPushed" placeholder="单行输入" clearable></el-input> -->
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
@@ -32,171 +31,155 @@
                   />
                 </el-form-item>
               </el-col>
-</el-form-item>
+            </el-form-item>
           </el-form>
 
           <hr>
 
           <el-row justify="space-between" class="submit-button" style="margin-bottom:-6px;">
             <el-row>
-<el-button  type="primary" icon="ele-Search" @click="onQuery"> 查询 </el-button>
-<el-button  type="primary" icon="ele-RefreshRight" @click="onReset"> 重置 </el-button>
-<el-button v-auth="'api:admin:file:upload-file'" type="primary" icon="ele-Upload"> 立即推送
-</el-button>
+              <el-button type="primary" icon="ele-Search" @click="onQuery"> 查询 </el-button>
+              <el-button type="primary" icon="ele-RefreshRight" @click="onReset"> 重置 </el-button>
+              <el-button 
+                v-auth="'api:admin:file:upload-file'" 
+                type="primary" 
+                icon="ele-Upload"
+                @click="handlePush"
+              > 
+                立即推送
+              </el-button>
+            </el-row>
           </el-row>
-        </el-row>
-</el-card>
+        </el-card>
       </el-col>
-<!--表格-->
-      <el-col  :xs="24" >
+
+      <!-- 表格区域 -->
+      <el-col :xs="24">
         <el-card style="height: 70vh" class="my-fill mt8" shadow="hover">
-<el-table v-loading="state.loading" stripe :data="state.tableModel" row-key="id" style="width: 100%">
-  <el-table-column type="selection" width="55" fixed="left"></el-table-column>
-        <el-table-column v-for="column in state.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label"  >
-        </el-table-column> 
-<!-- <el-table-column label="操作"  fixed="right" header-align="center" align="center" class="right-operation" width="140">
-        <template #default="{ row }" >
-<el-link          v-if="row.isPushed === '未推送'"
-                  class="my-el-link mr12 ml12"
-                  type="primary"
-                  icon="ele-Upload"
-                  @click="onDateUpdate(row)"
-                  :underline="false"
-                  target="_blank"
-                >立即推送</el-link>
-</template>
-            </el-table-column> -->
-</el-table>
-<div class="my-flex my-flex-end" style="margin-top: 20px">
-            <el-pagination v-model:currentPage="state.pageInput.currentPage"
-              v-model:page-size="state.pageInput.pageSize" :total="state.total" :page-sizes="[10, 15, 20, 50, 100]"
-              small background @size-change="onSizeChange" @current-change="onCurrentChange"
-              layout="total, sizes, prev, pager, next, jumper" />
+          <el-table 
+            v-loading="state.loading" 
+            stripe 
+            :data="state.tableModel" 
+            row-key="id" 
+            style="width: 100%"
+            ref="tableRef"
+          >
+            <el-table-column type="selection" width="55" fixed="left"></el-table-column>
+            <el-table-column 
+              v-for="column in state.dynamicColumns" 
+              :key="column.prop" 
+              :prop="column.prop" 
+              :label="column.label"  
+            >
+            </el-table-column> 
+          </el-table>
+          <div class="my-flex my-flex-end" style="margin-top: 20px">
+            <el-pagination 
+              v-model:currentPage="state.pageInput.currentPage"
+              v-model:page-size="state.pageInput.pageSize" 
+              :total="state.total" 
+              :page-sizes="[10, 15, 20, 50, 100]"
+              small 
+              background 
+              @size-change="onSizeChange" 
+              @current-change="onCurrentChange"
+              layout="total, sizes, prev, pager, next, jumper" 
+            />
           </div>
-</el-card>
+        </el-card>
       </el-col>
-</el-row>
-    </div>
-  </template>
-  <script setup lang="ts">
-  import {onBeforeMount, onMounted, reactive, ref, watch} from "vue";
-  import eventBus from "/@/utils/mitt";
-  import {Api} from "/@/api/admin/AlarmService/alarmQueryApi";
+    </el-row>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { onBeforeMount, onMounted, reactive, ref, watch } from "vue";
+import eventBus from "/@/utils/mitt";
+import { Api } from "/@/api/admin/AlarmService/alarmQueryApi";
 import { PushDto } from "/@/api/admin/AlarmService/alarmQueryDto";
 import { PageInputAlarmFilterModel } from "/@/api/admin/reportManagement/alarm/alarmDto";
-import { useDynamicPageSize } from "/@/composables/useDynamicPageSize";
-import { ElMessage } from "element-plus";
-import { all } from "axios";
+import { ElMessage, ElTable } from "element-plus";
 import { useRoute } from 'vue-router';
 
 const route = useRoute();
 const alarmHistoryID = ref<string | undefined>(route.query.alarmHistoryID as string);
+const tableRef = ref<InstanceType<typeof ElTable>>();
 
-
-// 使用组合式函数获取分页状态
-// const pageState = useDynamicPageSize(10, 15);
-
-
-/**数据对象*/
-  const state = reactive({
-    /**加载显示 */
-    loading: false,
-    /**条件查询模块 */
-      filter: {
-/**推送用户 */
-        pushUser: "",
-/**是否推送 */
-        pushed: "",
-/**推送时间 */
-        pushTime: "",
-        ispushed:undefined,
-         alarmHistoryID: ""
-      },
-  /**表格信息 */
-tableModel: [] as PushDto[],
-    /**动态表头 */
-    dynamicColumns: [
-{ prop: 'ruleName', label: '规则名称' },
-// { prop: 'pushUserid', label: '推送用户id' },
-{ prop: 'pushUser', label: '推送用户' },
-{ prop: 'content', label: '推送内容' },
-{ prop: 'pushed', label: '是否推送' },
-{ prop: 'pushTime', label: '推送时间' },
-// { prop: 'alarmhistoryID', label: '报警ID' },
-// { prop: 'taskPriority', label: '优先级' },
-],
-  /**分页标识 */
+/** 数据对象 */
+const state = reactive({
+  loading: false,
+  filter: {
+    pushUser: "",
+    pushed: "",
+    pushTime: "",
+    ispushed: undefined,
+    alarmHistoryID: ""
+  },
+  tableModel: [] as PushDto[],
+  dynamicColumns: [
+    { prop: 'ruleName', label: '规则名称' },
+    { prop: 'pushUser', label: '推送用户' },
+    { prop: 'content', label: '推送内容' },
+    { prop: 'pushed', label: '是否推送' },
+    { prop: 'pushTime', label: '推送时间' },
+  ],
   pageInput: {
     currentPage: 1,
     pageSize: 15,
   } as PageInputAlarmFilterModel,
-  /**分页总数 */
   total: 0,
-})
+});
 
-/**设备状态*/
+/** 设备状态枚举 */
 enum FuelDispenserEnum {
   true = "已推送",
   false = "未推送",
 }
 
-  onMounted(async () => {
-      if (alarmHistoryID.value) {
-    state.filter.alarmHistoryID = alarmHistoryID.value; // 将参数赋值给筛选条件
-      }
-  await onQuery()
-    init()
-    eventBus.off('refreshView')
-    eventBus.on('refreshView', async () => {
-      await init()
-    })
-    console.log()
-  })
-  onBeforeMount(() => {
-    eventBus.off('refreshView')
-  })
+/** API实例 */
+const api = new Api();
 
-/**
-* 页条变化
-* @param val
-*/
-const onSizeChange = (val: number) => {
-  state.pageInput.pageSize = val
-  init()
-}
-
-/**
- * 页数 变化
- * @param val
- */
-const onCurrentChange = (val: number) => {
-  state.pageInput.currentPage = val
-  init()
-}
+onMounted(async () => {
+  if (alarmHistoryID.value) {
+    state.filter.alarmHistoryID = alarmHistoryID.value;
+  }
+  await onQuery();
+  init();
+  eventBus.off('refreshView');
+  eventBus.on('refreshView', async () => {
+    await init();
+  });
+});
 
+onBeforeMount(() => {
+  eventBus.off('refreshView');
+});
 
-  /**
-  * 监听变换
-  */
-  watch(() => {})
+/** 分页相关方法 */
+const onSizeChange = (val: number) => {
+  state.pageInput.pageSize = val;
+  init();
+};
 
-/**条件查询 */
-          const onQuery = () => {
-          init()
-        }
+const onCurrentChange = (val: number) => {
+  state.pageInput.currentPage = val;
+  init();
+};
 
+/** 查询方法 */
+const onQuery = () => {
+  init();
+};
 
-/**初始化 */
+/** 初始化数据 */
 const init = async () => {
   state.loading = true;
-
   try {
-    // 处理时间范围
     let sdate = '';
     let edate = '';
     if (state.filter.pushTime && Array.isArray(state.filter.pushTime) && state.filter.pushTime.length === 2) {
-      sdate = state.filter.pushTime[0]; // 开始时间
-      edate = state.filter.pushTime[1]; // 结束时间
+      sdate = state.filter.pushTime[0];
+      edate = state.filter.pushTime[1];
     }
 
     const params = {
@@ -205,11 +188,11 @@ const init = async () => {
         ...state.filter,
         sdate,
         edate,
-        pushTime: undefined, // 避免传到后端去
+        pushTime: undefined,
       },
     };
 
-    const res = await new Api().getList(params);
+    const res = await api.getList(params);
     state.tableModel = res?.data?.list ?? [];
     state.total = res?.data?.total ?? 0;
   } catch (error) {
@@ -220,42 +203,73 @@ const init = async () => {
   }
 };
 
-
-
-/**重置 */
-        const onReset=()=>{
-  // 重置查询条件
+/** 重置方法 */
+const onReset = () => {
   state.filter = {
     pushUser: "",
     pushed: "",
     pushTime: "",
-    ispushed:undefined,
-    alarmHistoryID:""
+    ispushed: undefined,
+    alarmHistoryID: ""
   };
-
-  // 重新加载数据
+  state.pageInput.currentPage = 1;
   init();
-        }
-/**编辑 */
-      const onDateUpdate=(row: any)=>{
-        console.log("编辑行数据:", row);
-      }
+};
+
+/** 处理推送逻辑 */
+const handlePush = async () => {
+  // 获取选中的行
+  const selectedRows = tableRef.value?.getSelectionRows() as PushDto[];
+  if (!selectedRows || selectedRows.length === 0) {
+    ElMessage.warning('请先选择需要推送的记录');
+    return;
+  }
+
+  // 验证是否已推送
+  const alreadyPushed = selectedRows.some(row => row.pushed === '已推送');
+  if (alreadyPushed) {
+    ElMessage.warning('选中的记录中包含已推送项,请重新选择');
+    return;
+  }
+
+  try {
+    state.loading = true;
+    // 调用推送接口,传递筛选条件和选中的ID
+    const response = await api.templateSend({
+      filter: state.filter,
+      selectedIds: selectedRows.map(row => row.ruleId) // 假设用ruleId作为标识
+    });
+
+    if (response.success) {
+      ElMessage.success('推送成功');
+      // 刷新列表
+      await init();
+      // 取消选中状态
+      tableRef.value?.clearSelection();
+    } else {
+      ElMessage.error(`推送失败: ${response.msg || '未知错误'}`);
+    }
+  } catch (error) {
+    console.error('推送接口调用失败:', error);
+    ElMessage.error('推送失败,请重试');
+  } finally {
+    state.loading = false;
+  }
+};
 </script>
+
 <style scoped lang="scss">
 .el-input,
 .el-select {
   width: 240px;
 }
 
-/* 输入框标签固定四个字符宽度 */
 ::v-deep .el-form-item__label {
-  // 字体大小14,4个字符,12px右间距
   width: 14*4px+12px;
   justify-content: start;
 }
 
-/* 数据表头 设置灰色样式 */
 ::v-deep .el-table th.el-table__cell {
   background-color: #F6F6F6;
 }
-  </style>
+</style>

+ 1 - 1
admin.ui.plus-master/src/views/admin/statement/displayControl/index.vue

@@ -237,7 +237,7 @@ const onCurrentChange = () =>{
         /**初始化 */
         const init = async () => {
           state.loading = true
-const res:any = await new Api().getList({...state.pageInput, Filter:state.filter})
+const res:any = await new Api().getList({...pageState.pageInput, Filter:state.filter})
             state.total = res?.data?.total ?? 0
 state.tableModel = res?.data?.list ?? []
           state.loading = false

+ 2 - 2
admin.ui.plus-master/src/views/admin/statement/encodercontrols/index.vue

@@ -223,8 +223,8 @@ const onCurrentChange = () =>{
         /**初始化 */
         const init = async () => {
   state.loading = true;
-  console.log("Request Payload:", { ...state.pageInput, Filter: state.filter });
-  const res: any = await new Api().getList({ ...state.pageInput, Filter: state.filter });
+  console.log("Request Payload:", { ...pageState.pageInput, Filter: state.filter });
+  const res: any = await new Api().getList({ ...pageState.pageInput, Filter: state.filter });
   state.total = res?.data?.total ?? 0;
   state.tableModel = res?.data?.list ?? [];
   state.loading = false;

+ 2 - 2
admin.ui.plus-master/src/views/admin/statement/jikongzhuban/index.vue

@@ -211,7 +211,7 @@ watch(() => state.time, (newVal) => {
 const init = async () => {
   state.loading = true;
   console.log('发送的过滤条件:', {
-    ...state.pageInput,
+    ...pageState.pageInput,
     Filter: {
       ...state.filter,
 
@@ -219,7 +219,7 @@ const init = async () => {
   });
   
   const res = await new Api().getList({
-    ...state.pageInput,
+    ...pageState.pageInput,
     Filter: state.filter
   });
   

+ 1 - 1
admin.ui.plus-master/src/views/admin/statement/problemData/index.vue

@@ -223,7 +223,7 @@ const onQuery = () => {
   const init = async () => {
   state.loading = true
   const params = {
-    ...state.pageInput,
+    ...pageState.pageInput,
     Filter: state.filter,
     _t: Date.now() // 防止缓存
   }

+ 1 - 1
admin.ui.plus-master/src/views/admin/statement/repairList/index .vue

@@ -179,7 +179,7 @@ const onCurrentChange = (val: number) => {
         /**初始化 */
         const init = async () => {
           state.loading = true
-const res:any = await new Api().getList({...state.pageInput, Filter:state.filter})
+const res:any = await new Api().getList({...pageState.pageInput, Filter:state.filter})
             state.total = res?.data?.total ?? 0
 state.tableModel = res?.data?.list ?? []
           state.loading = false

+ 1 - 1
admin.ui.plus-master/src/views/admin/statement/taxcontrol/index.vue

@@ -233,7 +233,7 @@ const onCurrentChange = () =>{
         /**初始化 */
         const init = async () => {
           state.loading = true
-const res:any = await new Api().getList({...state.pageInput, Filter:state.filter})
+const res:any = await new Api().getList({...pageState.pageInput, Filter:state.filter})
             state.total = res?.data?.total ?? 0
 state.tableModel = res?.data?.list ?? []
           state.loading = false

+ 3 - 3
admin.ui.plus-master/src/views/admin/yujing/alarmRules/Level.vue

@@ -83,8 +83,8 @@
 </el-table>
 <div class="my-flex my-flex-end" style="margin-top: 20px">
             <el-pagination
-              v-model:currentPage="state.pageInput.CurrentPage"
-              v-model:page-size="state.pageInput.PageSize"
+              v-model:currentPage="pageState.pageInput.currentPage"
+              v-model:page-size="pageState.pageInput.pageSize"
               :total="state.total"
               :page-sizes="[10, 15, 20, 50, 100]"
               small
@@ -310,7 +310,7 @@ const fetchAlarmLevelDict = async () => {
         /**初始化 */
         const init = async () => {
           state.loading = true
-          const res: any = await new Api().getList({ ...state.pageInput, Filter: state.filter })
+          const res: any = await new Api().getList({ ...pageState.pageInput, Filter: state.filter })
           state.tableModel = res?.data?.list ?? []
           state.total = res?.data?.total ?? 0
           state.loading = false

+ 389 - 0
admin.ui.plus-master/src/views/admin/yujing/alarmRules/test.vue

@@ -0,0 +1,389 @@
+
+<template>
+  <div class="layout-pd">
+    <el-row>
+<!--操作-->
+      <el-col :xs="24" >
+        <el-card class="mt8"  shadow="hover" >
+<el-form :model="state.filter" :inline="true" @submit.stop.prevent>
+            <el-form-item prop="name" style="width: 100%">
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+                <el-form-item label="serno">
+                  <el-input v-model="state.filter.serno" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+                <el-form-item label="外部序列号">
+                  <el-input v-model="state.filter.exserno" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+                <el-form-item label="boardType">
+                  <el-input v-model="state.filter.boardType" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+                <el-form-item label="functionCode">
+                  <el-input v-model="state.filter.functionCode" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+                <el-form-item label="功能名称">
+                  <el-input v-model="state.filter.functionName" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+                <el-form-item label="检测类型">
+                  <el-input v-model="state.filter.testType" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+            <el-form-item label="选择时间">
+                  <el-date-picker
+                    v-model="state.filter.beginTime"
+                    type="datetimerange"
+                    value-format="YYYY-MM-DD HH:mm:ss"
+                    range-separator="To"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                  />
+                </el-form-item>
+              </el-col>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+            <el-form-item label="选择时间">
+                  <el-date-picker
+                    v-model="state.filter.endTime"
+                    type="datetimerange"
+                    value-format="YYYY-MM-DD HH:mm:ss"
+                    range-separator="To"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                  />
+                </el-form-item>
+              </el-col>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+                <el-form-item label="测试结果">
+                  <el-input v-model="state.filter.result" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+                <el-form-item label="测试员">
+                  <el-input v-model="state.filter.user" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+</el-form-item>
+          </el-form>
+          
+          <hr>
+
+          
+<el-row justify="space-between" class="submit-button" style="margin-bottom: -9px;">
+<el-button type="primary" icon="ele-Search" @click="onQuery"> 查询 </el-button>
+<el-button type="primary" icon="ele-Plus" @click="onAdd"> 添加 </el-button>
+<el-button type="primary" icon="ele-Delete" @click="ondelete"> 批量删除 </el-button>
+<el-button type="primary" icon="ele-RefreshRight" @click="onReset"> 重置 </el-button>
+<el-button type="primary" icon="ele-Upload" @click="onUpload"> 上传 </el-button>
+<el-button type="primary" icon="ele-Document" @click="onExport"> 导出 </el-button>
+<el-button type="primary" icon="ele-UploadFilled" @click="onBatImport"> 批量导入 </el-button>
+<el-button type="primary" icon="ele-Document" @click="onBatExport"> 批量导出 </el-button>
+<el-button type="primary" icon="ele-Tickets" @click="onBatReview"> 批量审核 </el-button>
+</el-row>
+</el-card>
+      </el-col>
+<!--表格-->
+      <el-col  :xs="24" >
+        <el-card style="height: 70vh" class="my-fill mt8" shadow="hover">
+        <el-table v-loading="state.loading" stripe :data="state.tableModel" row-key="id" style="width: 100%">
+<el-table-column type="selection" width="50"></el-table-column>
+
+        <el-table-column v-for="column in state.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label"  >
+        </el-table-column> 
+<el-table-column label="操作"  fixed="right" header-align="center" align="center" class="right-operation" width="140">
+        <template #default="{ row }" >
+<el-link
+                  class="my-el-link mr12 ml12"
+                  type="primary"
+                  icon="ele-Upload"
+                  @click="onDateUpdate(row)"
+                  :underline="false"
+                  target="_blank"
+                >编辑</el-link>
+<el-link
+                  class="my-el-link mr12 ml12"
+                  type="primary"
+                  icon="ele-Upload"
+                  @click="onDataDetail(row)"
+                  :underline="false"
+                  target="_blank"
+                >详情</el-link>
+<el-link
+                  class="my-el-link mr12 ml12"
+                  type="primary"
+                  icon="ele-Upload"
+                  @click="onDataDelete(row)"
+                  :underline="false"
+                  target="_blank"
+                >删除</el-link>
+</template>
+            </el-table-column>
+</el-table>
+<div class="my-flex my-flex-end" style="margin-top: 20px">
+            <el-pagination
+              v-model:currentPage="pageState.pageInput.CurrentPage"
+              v-model:page-size="pageState.pageInput.PageSize"
+              :total="state.total"
+              :page-sizes="[10, 15, 20, 50, 100]"
+              small
+              background
+              @size-change="onSizeChange"
+              @current-change="onCurrentChange"
+              layout="total, sizes, prev, pager, next, jumper"
+            />
+          </div>
+</el-card>
+      </el-col>
+<!-- 弹窗 -->
+    <el-dialog
+      v-model="state.dialogVisible"
+      :title="state.isEdit ? '修改BoardTestRecordDto' : '添加BoardTestRecordDto'"
+      width="500px"
+      :before-close="handleDialogClose"
+    >
+      <el-form
+        ref="formRef"
+        :model="state.formData"
+        :rules="state.rules"
+        label-width="100px"
+      >
+<el-form-item label="序列号" prop="serno">
+          <el-input v-model="state.formData.serno" placeholder="请输入序列号"></el-input>
+        </el-form-item>
+<el-form-item label="外部序列号" prop="exserno">
+          <el-input v-model="state.formData.exserno" placeholder="请输入外部序列号"></el-input>
+        </el-form-item>
+<el-form-item label="主板类型" prop="boardType">
+          <el-input v-model="state.formData.boardType" placeholder="请输入主板类型"></el-input>
+        </el-form-item>
+<el-form-item label="主板名称" prop="boardName">
+          <el-input v-model="state.formData.boardName" placeholder="请输入主板名称"></el-input>
+        </el-form-item>
+<el-form-item label="功能码" prop="functionCode">
+          <el-input v-model="state.formData.functionCode" placeholder="请输入功能码"></el-input>
+        </el-form-item>
+<el-form-item label="功能名称" prop="functionName">
+          <el-input v-model="state.formData.functionName" placeholder="请输入功能名称"></el-input>
+        </el-form-item>
+<el-form-item label="检测类型" prop="testType">
+          <el-input v-model="state.formData.testType" placeholder="请输入检测类型"></el-input>
+        </el-form-item>
+<el-form-item label="检测时间" prop="time">
+          <el-input v-model="state.formData.time" placeholder="请输入检测时间"></el-input>
+        </el-form-item>
+<el-form-item label="测试结果" prop="result">
+          <el-input v-model="state.formData.result" placeholder="请输入测试结果"></el-input>
+        </el-form-item>
+<el-form-item label="测试功能数" prop="testNum">
+          <el-input v-model="state.formData.testNum" placeholder="请输入测试功能数"></el-input>
+        </el-form-item>
+<el-form-item label="测试成功功能数" prop="testSuccessNum">
+          <el-input v-model="state.formData.testSuccessNum" placeholder="请输入测试成功功能数"></el-input>
+        </el-form-item>
+<el-form-item label="测试员" prop="user">
+          <el-input v-model="state.formData.user" placeholder="请输入测试员"></el-input>
+        </el-form-item>
+<el-form-item label="测试耗时" prop="duration">
+          <el-input v-model="state.formData.duration" placeholder="请输入测试耗时"></el-input>
+        </el-form-item>
+<el-form-item label="备注" prop="info">
+          <el-input v-model="state.formData.info" placeholder="请输入备注"></el-input>
+        </el-form-item>
+</el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="handleDialogClose">取消</el-button>
+          <el-button type="primary" @click="handleSubmit">确定</el-button>
+        </span>
+      </template>
+    </el-dialog>
+</el-row>
+    </div>
+  </template>
+  <script setup lang="ts">
+  import {onBeforeMount, onMounted, reactive, ref, watch} from "vue";
+  import eventBus from "/@/utils/mitt";
+  import {Api} from "/@/api/code/api";
+  import { useDynamicPageSize } from "/@/composables/useDynamicPageSize";
+
+  // 使用组合式函数获取分页状态
+const pageState = useDynamicPageSize(10, 15);
+import { BoardTestRecordDto } from "/@/api/code/dto";
+    import type { pageInput } from "/@/api/code/dto"
+    
+/**数据对象*/
+  const state = reactive({
+    /**加载显示 */
+    loading: false,
+/** 弹窗显示状态 */
+    dialogVisible: false,
+    /** 是否是编辑状态 */
+    isEdit: false,
+    /** 表单数据 */
+    formData: {} as BoardTestRecordDto,
+    /** 表单验证规则 */
+    rules: {},
+/**条件查询模块 */
+      filter: {
+/**serno */
+        serno: "",
+/**外部序列号 */
+        exserno: "",
+/**boardType */
+        boardType: "",
+/**functionCode */
+        functionCode: "",
+/**功能名称 */
+        functionName: "",
+/**检测类型 */
+        testType: "",
+/**起始检测时间 */
+        beginTime: "",
+/**结束检测时间 */
+        endTime: "",
+/**测试结果 */
+        result: "",
+/**测试员 */
+        user: "",},
+  /**表格信息 */
+tableModel: [] as BoardTestRecordDto,
+    /**动态表头 */
+    dynamicColumns: [
+{ prop: 'serno', label: '序列号' },
+{ prop: 'exserno', label: '外部序列号' },
+{ prop: 'boardType', label: '主板类型' },
+{ prop: 'boardName', label: '主板名称' },
+{ prop: 'functionCode', label: '功能码' },
+{ prop: 'functionName', label: '功能名称' },
+{ prop: 'testType', label: '检测类型' },
+{ prop: 'time', label: '检测时间' },
+{ prop: 'result', label: '测试结果' },
+{ prop: 'testNum', label: '测试功能数' },
+{ prop: 'testSuccessNum', label: '测试成功功能数' },
+{ prop: 'user', label: '测试员' },
+{ prop: 'duration', label: '测试耗时' },
+{ prop: 'info', label: '备注' },],
+/**分页标识 */
+    pageInput:{
+      CurrentPage: 1,
+      PageSize: 10,
+    } as pageInput,
+    /**分页总数 */
+    total: 0,
+})
+  onMounted(() => {
+    // 初始化分页大小
+    Data.pageInput.pageSize = pageState.pageInput.pageSize; 
+    init()
+    eventBus.off('refreshView')
+    eventBus.on('refreshView', async () => {
+      await init()
+    })
+    console.log()
+  })
+  onBeforeMount(() => {
+    eventBus.off('refreshView')
+  })
+  /**
+  * 监听变换
+  */
+  watch(() => {})
+/**条件查询 */
+          const onQuery = () => {
+          init()
+        }
+        /**初始化 */
+        const init = async () => {
+          state.loading = true
+const res:any = await new Api().getList({...pageState.pageInput, Filter:state.filter})
+            state.total = res?.data?.total ?? 0
+state.tableModel = res?.data?.list ?? []
+          state.loading = false
+        }
+/**添加 */
+                const onAdd = () => {
+          state.isEdit = false;
+          state.formData = {} as BoardTestRecordDto;
+          state.dialogVisible = true;
+        };
+        /**批量删除 */
+        const ondelete=()=>{}
+/**重置 */
+        const onReset=()=>{}
+/**上传 */
+        const onUpload=()=>{}
+/**导出 */
+        const onExport=()=>{}
+/**批量导入 */
+        const onBatImport=()=>{}
+/**批量导出 */
+        const onBatExport=()=>{}
+/**批量审核 */
+        const onBatReview=()=>{}
+/**编辑 */
+        const onDateUpdate = (row: BoardTestRecordDto) => {
+          state.isEdit = true;
+          state.formData = { ...row };
+          state.dialogVisible = true;
+        }
+/**详情 */
+        const onDataDetail=(row)=>{}
+/**删除 */
+        const onDataDelete=(row)=>{}
+/** 关闭弹窗 */
+    const handleDialogClose = () => {
+      state.dialogVisible = false;
+    };
+    
+    /** 提交表单 */
+    const handleSubmit = () => {
+      // Add your submit logic here
+      state.dialogVisible = false;
+    };
+
+  /**
+* 页条变化
+* @param val
+*/
+const onSizeChange = (val: number) => {
+  Data.pageInput.pageSize = val
+  //需按照页面对象修改Data
+  init()
+}
+
+/**
+ * 页数 变化
+ * @param val
+ */
+const onCurrentChange = (val: number) => {
+  Data.pageInput.currentPage = val
+  //需按照页面对象修改Data
+  init()
+}
+  </script>
+<style scoped lang="scss">
+  .el-input,
+.el-select {
+  width: 240px;
+}
+
+/* 输入框标签固定四个字符宽度 */
+::v-deep .el-form-item__label {
+  // 字体大小14,5个字符,12px右间距
+  width: 14*5px+12px;
+  justify-content: start;
+}
+
+/* 数据表头 设置灰色样式 */
+::v-deep .el-table th.el-table__cell {
+  background-color: #F6F6F6;
+}
+  </style>

+ 1 - 1
admin.ui.plus-master/src/views/example/application/equipment/index.vue

@@ -173,7 +173,7 @@ const onQuery = async () => {
   state.loading = true;
   try {
     const res: any = await new PermissionApi().getEquipmentList({
-      ...state.pageInput,
+      ...pageState.pageInput,
       "Filter.Appid": state.filter.Appid,
       "Filter.SN": state.filter.SN,
       "Filter.Account": state.filter.Account,

+ 645 - 0
admin.ui.plus-master/src/views/example/codeGeneration/dialog.vue

@@ -0,0 +1,645 @@
+<template>
+  <div class="layout">
+    <h1 style="margin-top: 10px;margin-bottom: 10px;">弹窗配置</h1>
+    <div style="color: #505050;margin-bottom: 20px;">配置弹窗的表单项和功能</div>
+    
+    <!-- 接口选择部分 -->
+    <el-card class="mt8" shadow="never" :body-style="{ paddingBottom: '0' }">
+      <div>
+        <el-form :inline="true" @submit.stop.prevent>
+          <el-form-item label="接口地址" style="width: 60%;">
+            <el-input v-model="state.filter.name" placeholder="请输入接口地址" @keyup.enter="onQuery" />
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" icon="ele-Search" @click="onQuery"> 查询 </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div>
+        <el-form :inline="true" @submit.stop.prevent>
+          <el-form-item label="弹窗接口来源" style="width: 70%;">
+            <el-select v-model="state.filter.api" placeholder="请选择弹窗接口来源" @change="onChange(state.filter.api)">
+              <el-option v-for="(value, key) in state.api" :key="key" :label="value.api+' '+value.summary" :value="value.api" />
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </div>
+    </el-card>
+    
+    <!-- 弹窗功能配置 -->
+    <el-card class="mt8" shadow="never" :body-style="{ paddingBottom: '0' }">
+      <div>
+        <el-form :inline="true" @submit.stop.prevent>
+          <el-form-item label="弹窗功能配置" style="width: 100%;"></el-form-item>
+          <el-form-item>
+            <el-checkbox v-model="state.dialogConfig.hasTitle">显示标题</el-checkbox>
+            <el-checkbox v-model="state.dialogConfig.hasFooter">显示底部按钮</el-checkbox>
+            <el-checkbox v-model="state.dialogConfig.hasCancelBtn">显示取消按钮</el-checkbox>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div>
+        <el-form :inline="true" @submit.stop.prevent>
+          <el-form-item label="弹窗宽度" style="width: 30%;">
+            <el-input v-model="state.dialogConfig.width" placeholder="例如: 500px"></el-input>
+          </el-form-item>
+          <el-form-item label="标题变量名" style="width: 30%;">
+            <el-input v-model="state.dialogConfig.titleVar" placeholder="例如: dialogTitle"></el-input>
+          </el-form-item>
+          <el-form-item label="显示变量名" style="width: 30%;">
+            <el-input v-model="state.dialogConfig.visibleVar" placeholder="例如: dialogVisible"></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+    </el-card>
+    
+    <!-- 表单项配置 -->
+    <el-card class="mt8" shadow="never" :body-style="{ paddingBottom: '0' }">
+      <div>
+        <el-form :inline="true" @submit.stop.prevent>
+          <el-form-item label="表单项配置" style="width: 100%;"></el-form-item>
+          <el-form-item>
+            <el-table :data="state.formItems" style="width: 100%">
+              <el-table-column prop="name" label="字段名" width="120"></el-table-column>
+              <el-table-column prop="description" label="描述" width="180"></el-table-column>
+              <el-table-column label="是否包含" width="100">
+                <template #default="{ row }">
+                  <el-switch v-model="row.include" @change="changeItem(row)"></el-switch>
+                </template>
+              </el-table-column>
+              <el-table-column label="表单类型" width="150">
+                <template #default="{ row }">
+                  <el-select v-model="row.type" placeholder="选择类型" @change="changeItemType(row)">
+                    <el-option label="输入框" value="input"></el-option>
+                    <el-option label="数字输入框" value="number"></el-option>
+                    <el-option label="下拉框" value="select"></el-option>
+                    <el-option label="日期选择器" value="date"></el-option>
+                    <el-option label="日期时间选择器" value="datetime"></el-option>
+                    <el-option label="日期范围" value="daterange"></el-option>
+                    <el-option label="开关" value="switch"></el-option>
+                    <el-option label="多选框" value="checkbox"></el-option>
+                    <el-option label="单选框" value="radio"></el-option>
+                    <el-option label="文本域" value="textarea"></el-option>
+                  </el-select>
+                </template>
+              </el-table-column>
+              <el-table-column label="是否必填" width="100">
+                <template #default="{ row }">
+                  <el-switch v-model="row.required" @change="changeItem(row)"></el-switch>
+                </template>
+              </el-table-column>
+              <el-table-column label="验证规则" width="150">
+                <template #default="{ row }">
+                  <el-select v-model="row.rule" placeholder="选择规则" @change="changeItemRule(row)">
+                    <el-option label="无" value=""></el-option>
+                    <el-option label="必填" value="required"></el-option>
+                    <el-option label="邮箱" value="email"></el-option>
+                    <el-option label="手机号" value="phone"></el-option>
+                    <el-option label="数字" value="number"></el-option>
+                    <el-option label="自定义" value="custom"></el-option>
+                  </el-select>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" width="120">
+                <template #default="{ row }">
+                  <el-button size="small" @click="editItemOptions(row)">选项配置</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form-item>
+        </el-form>
+      </div>
+    </el-card>
+    
+    <!-- 生成按钮 -->
+    <div style="display: flex;justify-content: center;align-items: center;">
+      <el-button style="margin-top: 20px;width: 264px;height: 42px;" type="primary" @click="generateDialogCode">生成弹窗代码</el-button>
+    </div>
+    
+    <!-- 代码预览弹窗 -->
+    <el-dialog v-model="state.codePreviewVisible" title="弹窗代码预览" width="70%" top="5vh">
+      <el-tabs type="border-card">
+        <el-tab-pane label="弹窗模板">
+          <pre>{{ state.generatedCode.template }}</pre>
+        </el-tab-pane>
+        <el-tab-pane label="脚本部分">
+          <pre>{{ state.generatedCode.script }}</pre>
+        </el-tab-pane>
+        <el-tab-pane label="样式部分">
+          <pre>{{ state.generatedCode.style }}</pre>
+        </el-tab-pane>
+      </el-tabs>
+      <template #footer>
+        <el-button @click="state.codePreviewVisible = false">关闭</el-button>
+        <el-button type="primary" @click="downloadCode">下载代码</el-button>
+      </template>
+    </el-dialog>
+
+    <!-- 选项配置弹窗 -->
+    <el-dialog v-model="state.optionsDialogVisible" title="选项配置">
+      <el-form>
+        <el-form-item label="字段名">
+          <el-input v-model="state.currentItem.name" disabled></el-input>
+        </el-form-item>
+        <el-form-item label="选项列表">
+          <el-button type="primary" @click="addOption">添加选项</el-button>
+          <div v-for="(option, index) in state.currentItem.options" :key="index" style="margin-top: 10px;">
+            <el-input v-model="option.label" placeholder="选项标签" style="width: 200px; margin-right: 10px;"></el-input>
+            <el-input v-model="option.value" placeholder="选项值" style="width: 200px; margin-right: 10px;"></el-input>
+            <el-button type="danger" @click="removeOption(index)">删除</el-button>
+          </div>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="state.optionsDialogVisible = false">取消</el-button>
+        <el-button type="primary" @click="saveOptions">保存</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { reactive, onMounted } from 'vue'
+import { ElMessage } from 'element-plus'
+
+interface ApiItem {
+  api: string
+  summary: string
+  method: string
+  requestBody?: {
+    content?: {
+      'application/json'?: {
+        schema?: {
+          $ref?: string
+          properties?: Record<string, any>
+        }
+      }
+    }
+  }
+}
+
+interface FormItem {
+  name: string
+  description: string
+  type: string
+  format?: string
+  include: boolean
+  required: boolean
+  rule: string
+  options?: Array<{ label: string, value: string }>
+}
+
+const state = reactive({
+  loading: false,
+  filter: {
+    name: 'http://dev.hsfuel.com:8070/app/swagger/app/swagger.json',
+    api: ''
+  },
+  api: [] as ApiItem[],
+  swaggerData: null as any,
+  dialogConfig: {
+    hasTitle: true,
+    hasFooter: true,
+    hasCancelBtn: true,
+    width: '500px',
+    titleVar: 'dialogTitle',
+    visibleVar: 'dialogVisible'
+  },
+  formItems: [] as FormItem[],
+  codePreviewVisible: false,
+  generatedCode: {
+    template: '',
+    script: '',
+    style: ''
+  },
+  optionsDialogVisible: false,
+  currentItem: {
+    name: '',
+    description: '',
+    type: '',
+    options: [] as Array<{ label: string, value: string }>
+  }
+})
+
+// 从接口获取数据
+const onQuery = async () => {
+  try {
+    state.loading = true
+    const response = await fetch(state.filter.name)
+    const swaggerJson = await response.json()
+    state.swaggerData = swaggerJson
+    state.api = []
+    const { paths } = swaggerJson
+    
+    for (const path in paths) {
+      if ('post' in paths[path] || 'put' in paths[path]) {
+        const method = paths[path].post ? 'post' : 'put'
+        const operation = paths[path][method]
+        
+        state.api.push({
+          api: path,
+          summary: operation.summary || '',
+          method: method.toUpperCase(),
+          requestBody: operation.requestBody
+        })
+      }
+    }
+    
+    ElMessage.success('接口加载成功')
+  } catch (error) {
+    console.error('获取接口失败:', error)
+    ElMessage.error('获取接口失败')
+  } finally {
+    state.loading = false
+  }
+}
+
+// 根据$ref获取schema定义
+const getSchemaByRef = (ref: string) => {
+  if (!state.swaggerData || !ref) return null
+  const refPath = ref.replace('#/', '').split('/')
+  let current = state.swaggerData
+  for (const path of refPath) {
+    current = current[path]
+    if (!current) return null
+  }
+  return current
+}
+
+// 解析请求体属性
+const parseRequestBodyProperties = (apiItem: ApiItem) => {
+  if (!apiItem.requestBody?.content?.['application/json']?.schema) return []
+  
+  const schema = apiItem.requestBody.content['application/json'].schema
+  let properties = {}
+  let requiredFields: string[] = []
+  
+  if (schema.$ref) {
+    const refSchema = getSchemaByRef(schema.$ref)
+    if (refSchema?.properties) {
+      properties = refSchema.properties
+      requiredFields = refSchema.required || []
+    }
+  } else if (schema.properties) {
+    properties = schema.properties
+    requiredFields = schema.required || []
+  }
+  
+  return Object.entries(properties).map(([name, prop]: [string, any]) => {
+    const formItem: FormItem = {
+      name,
+      description: prop.description || name,
+      type: prop.type || 'string',
+      format: prop.format,
+      include: true,
+      required: requiredFields.includes(name),
+      rule: requiredFields.includes(name) ? 'required' : ''
+    }
+    
+    // 根据类型和format设置默认的表单组件类型
+    if (formItem.type === 'string') {
+      if (formItem.format === 'date-time') {
+        formItem.type = 'datetime'
+      } else if (formItem.format === 'date') {
+        formItem.type = 'date'
+      } else if (prop.enum) {
+        formItem.type = 'select'
+        formItem.options = prop.enum.map((value: string) => ({
+          label: value,
+          value
+        }))
+      } else if (prop.maxLength > 100) {
+        formItem.type = 'textarea'
+      }
+    } else if (formItem.type === 'integer' || formItem.type === 'number') {
+      formItem.type = 'number'
+    } else if (formItem.type === 'boolean') {
+      formItem.type = 'switch'
+    }
+    
+    return formItem
+  })
+}
+
+// 选择接口后解析请求体
+const onChange = (apiPath: string) => {
+  if (!apiPath) {
+    state.formItems = []
+    return
+  }
+  
+  const selectedApi = state.api.find(item => item.api === apiPath)
+  if (!selectedApi) return
+  
+  state.formItems = parseRequestBodyProperties(selectedApi)
+}
+
+const changeItem = (item: FormItem) => {
+  console.log('表单项变更:', item)
+}
+
+const changeItemType = (item: FormItem) => {
+  console.log('表单项类型变更:', item)
+  // 如果是选择类型,添加默认选项
+  if ((item.type === 'select' || item.type === 'radio' || item.type === 'checkbox') && !item.options) {
+    item.options = [{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]
+  }
+}
+
+const changeItemRule = (item: FormItem) => {
+  console.log('验证规则变更:', item)
+}
+
+// 编辑选项配置
+const editItemOptions = (item: FormItem) => {
+  if (!['select', 'radio', 'checkbox'].includes(item.type)) {
+    ElMessage.warning('当前字段类型不支持选项配置')
+    return
+  }
+  
+  state.currentItem = {
+    name: item.name,
+    description: item.description,
+    type: item.type,
+    options: item.options ? [...item.options] : []
+  }
+  state.optionsDialogVisible = true
+}
+
+// 添加选项
+const addOption = () => {
+  state.currentItem.options.push({
+    label: '',
+    value: ''
+  })
+}
+
+// 删除选项
+const removeOption = (index: number) => {
+  state.currentItem.options.splice(index, 1)
+}
+
+// 保存选项
+const saveOptions = () => {
+  const item = state.formItems.find(item => item.name === state.currentItem.name)
+  if (item) {
+    item.options = state.currentItem.options.filter(opt => opt.label && opt.value)
+  }
+  state.optionsDialogVisible = false
+  ElMessage.success('选项配置已保存')
+}
+
+// 生成弹窗代码
+const generateDialogCode = () => {
+  if (!state.filter.api) {
+    ElMessage.error('请选择弹窗接口来源')
+    return
+  }
+  
+  const selectedItems = state.formItems.filter(item => item.include)
+  if (selectedItems.length === 0) {
+    ElMessage.error('请至少选择一个表单项')
+    return
+  }
+  
+  // 生成模板代码
+  let templateCode = `<el-dialog
+  v-model="${state.dialogConfig.visibleVar}"
+  :title="${state.dialogConfig.titleVar}"
+  width="${state.dialogConfig.width}"
+  :before-close="handleDialogClose"
+>
+  <el-form
+    ref="formRef"
+    :model="formData"
+    :rules="rules"
+    label-width="100px"
+  >\n`
+  
+  // 添加表单项
+  selectedItems.forEach(item => {
+    templateCode += `    <el-form-item label="${item.description}" prop="${item.name}">\n`
+    
+    switch (item.type) {
+      case 'input':
+        templateCode += `      <el-input v-model="formData.${item.name}" placeholder="请输入${item.description}"></el-input>\n`
+        break
+      case 'number':
+        templateCode += `      <el-input-number v-model="formData.${item.name}" placeholder="请输入${item.description}"></el-input-number>\n`
+        break
+      case 'select':
+        templateCode += `      <el-select v-model="formData.${item.name}" placeholder="请选择${item.description}" clearable>\n`
+        if (item.options) {
+          item.options.forEach(opt => {
+            templateCode += `        <el-option label="${opt.label}" value="${opt.value}"></el-option>\n`
+          })
+        }
+        templateCode += `      </el-select>\n`
+        break
+      case 'date':
+        templateCode += `      <el-date-picker
+        v-model="formData.${item.name}"
+        type="date"
+        placeholder="请选择${item.description}"
+        value-format="YYYY-MM-DD"
+      ></el-date-picker>\n`
+        break
+      case 'datetime':
+        templateCode += `      <el-date-picker
+        v-model="formData.${item.name}"
+        type="datetime"
+        placeholder="请选择${item.description}"
+        value-format="YYYY-MM-DD HH:mm:ss"
+      ></el-date-picker>\n`
+        break
+      case 'switch':
+        templateCode += `      <el-switch v-model="formData.${item.name}"></el-switch>\n`
+        break
+      case 'textarea':
+        templateCode += `      <el-input v-model="formData.${item.name}" type="textarea" :rows="3" placeholder="请输入${item.description}"></el-input>\n`
+        break
+      case 'radio':
+        templateCode += `      <el-radio-group v-model="formData.${item.name}">\n`
+        if (item.options) {
+          item.options.forEach(opt => {
+            templateCode += `        <el-radio label="${opt.value}">${opt.label}</el-radio>\n`
+          })
+        }
+        templateCode += `      </el-radio-group>\n`
+        break
+      case 'checkbox':
+        templateCode += `      <el-checkbox-group v-model="formData.${item.name}">\n`
+        if (item.options) {
+          item.options.forEach(opt => {
+            templateCode += `        <el-checkbox label="${opt.value}">${opt.label}</el-checkbox>\n`
+          })
+        }
+        templateCode += `      </el-checkbox-group>\n`
+        break
+      default:
+        templateCode += `      <el-input v-model="formData.${item.name}" placeholder="请输入${item.description}"></el-input>\n`
+    }
+    
+    templateCode += `    </el-form-item>\n\n`
+  })
+  
+  // 添加底部按钮
+  if (state.dialogConfig.hasFooter) {
+    templateCode += `  </el-form>
+  <template #footer>
+    <span class="dialog-footer">\n`
+    
+    if (state.dialogConfig.hasCancelBtn) {
+      templateCode += `      <el-button @click="handleDialogClose">取消</el-button>\n`
+    }
+    
+    templateCode += `      <el-button type="primary" @click="handleSubmit">确定</el-button>
+    </span>
+  </template>
+</el-dialog>`
+  } else {
+    templateCode += `  </el-form>
+</el-dialog>`
+  }
+  
+  // 生成脚本代码
+  let scriptCode = `<script setup lang="ts">
+import { reactive, ref } from 'vue'
+import type { FormInstance, FormRules } from 'element-plus'
+
+const ${state.dialogConfig.visibleVar} = ref(false)
+const ${state.dialogConfig.titleVar} = ref('')
+const formRef = ref<FormInstance>()
+const formData = reactive({\n`
+  
+  // 添加表单数据
+  selectedItems.forEach(item => {
+    if (item.type === 'checkbox') {
+      scriptCode += `  ${item.name}: [] as string[],\n`
+    } else {
+      scriptCode += `  ${item.name}: ${item.type === 'number' ? '0' : item.type === 'switch' ? 'false' : '""'},\n`
+    }
+  })
+  
+  scriptCode += `})
+
+// 验证规则
+const rules = reactive<FormRules>({\n`
+  
+  // 添加验证规则
+  selectedItems.forEach(item => {
+    if (item.required || item.rule) {
+      scriptCode += `  ${item.name}: [\n`
+      
+      if (item.required) {
+        scriptCode += `    { required: true, message: '${item.type === 'select' || item.type === 'radio' || item.type === 'checkbox' ? '请选择' : '请输入'}${item.description}', trigger: '${item.type === 'select' || item.type === 'radio' || item.type === 'checkbox' ? 'change' : 'blur'}' },\n`
+      }
+      
+      if (item.rule === 'email') {
+        scriptCode += `    { type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' },\n`
+      } else if (item.rule === 'phone') {
+        scriptCode += `    { pattern: /^1[3-9]\\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' },\n`
+      } else if (item.rule === 'number') {
+        scriptCode += `    { type: 'number', message: '请输入数字', trigger: 'blur' },\n`
+      }
+      
+      scriptCode += `  ],\n`
+    }
+  })
+  
+  scriptCode += `})
+
+// 打开弹窗
+const openDialog = (title: string, data?: any) => {
+  ${state.dialogConfig.titleVar}.value = title
+  if (data) {
+    Object.assign(formData, data)
+  }
+  ${state.dialogConfig.visibleVar}.value = true
+}
+
+// 关闭弹窗
+const handleDialogClose = () => {
+  formRef.value?.resetFields()
+  ${state.dialogConfig.visibleVar}.value = false
+}
+
+// 提交表单
+const handleSubmit = () => {
+  formRef.value?.validate((valid) => {
+    if (valid) {
+      // 提交逻辑
+      console.log('表单数据:', formData)
+      handleDialogClose()
+    }
+  })
+}
+</` + `script>`
+  
+  // 生成样式代码
+  const styleCode = `<style scoped>
+.dialog-footer {
+  display: flex;
+  justify-content: flex-end;
+}
+</style>`
+  
+  state.generatedCode = {
+    template: templateCode,
+    script: scriptCode,
+    style: styleCode
+  }
+  
+  state.codePreviewVisible = true
+}
+
+// 下载代码
+const downloadCode = () => {
+  const content = `<template>
+${state.generatedCode.template}
+</template>
+
+${state.generatedCode.script}
+
+${state.generatedCode.style}`
+  
+  const blob = new Blob([content], { type: 'text/plain' })
+  const url = URL.createObjectURL(blob)
+  const link = document.createElement('a')
+  link.href = url
+  link.download = 'DialogComponent.vue'
+  document.body.appendChild(link)
+  link.click()
+  document.body.removeChild(link)
+  URL.revokeObjectURL(url)
+  
+  ElMessage.success('代码下载成功')
+}
+
+onMounted(() => {
+  // 初始化加载一些示例数据
+  onChange('')
+})
+</script>
+
+<style scoped lang="scss">
+.layout {
+  position: relative;
+  overflow: hidden;
+  padding: 0px 8px 8px 8px;
+  display: flex;
+  flex-direction: column;
+}
+
+pre {
+  background: #f5f5f5;
+  padding: 10px;
+  border-radius: 4px;
+  overflow: auto;
+  max-height: 60vh;
+}
+
+.mt8 {
+  margin-top: 8px;
+}
+</style>

+ 89 - 23
admin.ui.plus-master/src/views/example/codeGeneration/index.vue

@@ -320,7 +320,7 @@ const onsubmit=()=>{
   let tabVal=state.tableVal.filter(item=>item.value===true)
   //console.log(tabVal)
   let apiCode=`import { AxiosResponse } from 'axios'
-  import { ContentType, HttpClient, RequestParams } from './http-client'
+  import { ContentType, HttpClient, RequestParams } from '/@/api/admin/http-client'
   export class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
     /**
    * No description
@@ -434,13 +434,13 @@ const onsubmit=()=>{
             <el-form-item prop="name" style="width: 100%">`
       for(let i=0;i<selVal.length;i++){
         if(selVal[i].type==='interger'){
-          indexCode=indexCode+`\n<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
+          indexCode=indexCode+`\n<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
                 <el-form-item label="${selVal[i].description}">
                   <el-input-number v-model="state.filter.${selVal[i].name}" />
                 </el-form-item>
               </el-col>`
         }else if(selVal[i].isDate===true){
-          indexCode=indexCode+`\n<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
+          indexCode=indexCode+`\n<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
             <el-form-item label="选择时间">
                   <el-date-picker
                     v-model="state.filter.${selVal[i].name}"
@@ -453,7 +453,7 @@ const onsubmit=()=>{
                 </el-form-item>
               </el-col>`
         }else{
-          indexCode=indexCode+`\n<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
+          indexCode=indexCode+`\n<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
                 <el-form-item label="${selVal[i].description}">
                   <el-input v-model="state.filter.${selVal[i].name}" placeholder="单行输入" clearable></el-input>
                 </el-form-item>
@@ -461,29 +461,49 @@ const onsubmit=()=>{
         }
       }
       indexCode=indexCode+`\n</el-form-item>
-          </el-form>`
-    }
-    if(selBtn.length>0){
-      indexCode=indexCode+`\n<div class="my-flex my-flex-start" >`
-      for(let i=0;i<selBtn.length;i++){
-        if(selBtn[i].name.includes('批量')){
-          selection=true
-        }
-        indexCode=indexCode+`\n<el-button  type="primary" icon="ele-CirclePlus" @click="${selBtn[i].method}"> ${selBtn[i].name} </el-button>`
-      }
-      indexCode=indexCode+`\n</div>`
+          </el-form>
+          
+          <hr>
+
+          `
     }
+if(selBtn.length > 0) {
+  const iconMap = [
+    { keyword: '批量导入', icon: 'ele-UploadFilled' },
+    { keyword: '审核', icon: 'ele-Tickets' },
+    { keyword: '导出', icon: 'ele-Document' },
+    { keyword: '查询', icon: 'ele-Search' },
+    { keyword: '添加', icon: 'ele-Plus' },
+    { keyword: '重置', icon: 'ele-RefreshRight' },
+    { keyword: '上传', icon: 'ele-Upload' },
+    { keyword: '删除', icon: 'ele-Delete' },
+  ];
+  
+  indexCode += `\n<el-row justify="space-between" class="submit-button" style="margin-bottom: -9px;">`;
+  
+  selBtn.forEach(btn => {
+    const match = iconMap.find(item => btn.name.includes(item.keyword));
+    const icon = match?.icon || '';
+    
+    if (match) selection = true;
+    
+    indexCode += `\n<el-button type="primary" icon="${icon}" @click="${btn.method}"> ${btn.name} </el-button>`;
+  });
+  
+  indexCode += `\n</el-row>`;
+}
     indexCode=indexCode+`\n</el-card>
       </el-col>`
   }
   if(tabVal.length>0){
     indexCode=indexCode+`\n<!--表格-->
       <el-col  :xs="24" >
-        <el-card style="height: 70vh" class="my-fill mt8" shadow="hover">`
+        <el-card style="height: 70vh" class="my-fill mt8" shadow="hover">
+        <el-table v-loading="state.loading" stripe :data="state.tableModel" row-key="id" style="width: 100%">`
     if(selection){
       indexCode=indexCode+`\n<el-table-column type="selection" width="50"></el-table-column>`
     }
-    indexCode=indexCode+`\n<el-table v-loading="state.loading" stripe :data="state.tableModel" row-key="id" style="width: 100%">
+    indexCode=indexCode+`\n
         <el-table-column v-for="column in state.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label"  >
         </el-table-column>`
     if(tabBtn.length>0){
@@ -506,8 +526,8 @@ const onsubmit=()=>{
     if(state.isPage){
       indexCode=indexCode+`\n<div class="my-flex my-flex-end" style="margin-top: 20px">
             <el-pagination
-              v-model:currentPage="state.pageInput.CurrentPage"
-              v-model:page-size="state.pageInput.PageSize"
+              v-model:currentPage="pageState.pageInput.CurrentPage"
+              v-model:page-size="pageState.pageInput.PageSize"
               :total="state.total"
               :page-sizes="[10, 15, 20, 50, 100]"
               small
@@ -527,9 +547,17 @@ const onsubmit=()=>{
   <script setup lang="ts">
   import {onBeforeMount, onMounted, reactive, ref, watch} from "vue";
   import eventBus from "/@/utils/mitt";
-  import {Api} from "/@/api/code/api";`
+  import {Api} from "/@/api/code/api";
+  import { useDynamicPageSize } from "/@/composables/useDynamicPageSize";
+
+  // 使用组合式函数获取分页状态
+const pageState = useDynamicPageSize(10, 15);`
+
+
   if(state.isPage&&tabVal.length>0){
-    indexCode=indexCode+`\nimport { pageInput,${tabVal[0].belong} } from "/@/api/code/dto";`
+    indexCode=indexCode+`\nimport { ${tabVal[0].belong} } from "/@/api/code/dto";
+    import type { pageInput } from "/@/api/code/dto"
+    `
   }else if(tabVal.length>0){
     indexCode=indexCode+`\nimport { ${tabVal[0].belong} } from "/@/api/code/dto";`
   }
@@ -571,6 +599,8 @@ const onsubmit=()=>{
   }
   indexCode=indexCode+`\n})
   onMounted(() => {
+    // 初始化分页大小
+    Data.pageInput.pageSize = pageState.pageInput.pageSize; 
     init()
     eventBus.off('refreshView')
     eventBus.on('refreshView', async () => {
@@ -598,7 +628,7 @@ const onsubmit=()=>{
         const init = async () => {
           state.loading = true`
           if(state.isPage){
-            indexCode=indexCode+`\nconst res:any = await new Api().getList({...state.pageInput, Filter:state.filter})
+            indexCode=indexCode+`\nconst res:any = await new Api().getList({...pageState.pageInput, Filter:state.filter})
             state.total = res?.data?.total ?? 0`
           }else{
             indexCode=indexCode+`\nconst res:any = await new Api().getList({...state.filter})`
@@ -625,7 +655,43 @@ const onsubmit=()=>{
       const ${tabBtn[i].method}=(row)=>{}`
     }
   }
-  indexCode=indexCode+`\n</`+`script>`+`\n<style scoped lang="scss">
+  indexCode=indexCode+`\n
+  /**
+* 页条变化
+* @param val
+*/
+const onSizeChange = (val: number) => {
+  Data.pageInput.pageSize = val
+  //需按照页面对象修改Data
+  init()
+}
+
+/**
+ * 页数 变化
+ * @param val
+ */
+const onCurrentChange = (val: number) => {
+  Data.pageInput.currentPage = val
+  //需按照页面对象修改Data
+  init()
+}
+  </`+`script>`+`\n<style scoped lang="scss">
+  .el-input,
+.el-select {
+  width: 240px;
+}
+
+/* 输入框标签固定四个字符宽度 */
+::v-deep .el-form-item__label {
+  // 字体大小14,5个字符,12px右间距
+  width: 14*5px+12px;
+  justify-content: start;
+}
+
+/* 数据表头 设置灰色样式 */
+::v-deep .el-table th.el-table__cell {
+  background-color: #F6F6F6;
+}
   </style>`
   //console.log(indexCode)
   getCodeFile('api.ts',apiCode)