DFS_Shuo_Chen 3 hafta önce
ebeveyn
işleme
d66c974eb0

+ 2 - 2
admin.ui.plus-master/.env.development

@@ -4,9 +4,9 @@ ENV = 'development'
 # 本地环境接口地址
 # VITE_API_URL = 'http://ipos.biz:8070'
 #VITE_API_URL = 'http://47.97.120.160:8070'
-#VITE_API_URL = 'http://localhost:8000'
+VITE_API_URL = 'http://localhost:8000'
 #VITE_API_URL = 'http://imes.hsfuel.com:8070'
-VITE_API_URL = 'http://dev.hsfuel.com:8070'
+#VITE_API_URL = 'http://dev.hsfuel.com:8070'
 # VITE_API_URL = 'http://ipos.biz:8070'
 
 

+ 90 - 0
admin.ui.plus-master/src/api/admin/deviceAuthorization/iFuelDBKeyApi.ts

@@ -0,0 +1,90 @@
+import {ContentType, HttpClient, RequestParams,} from "/@/api/admin/http-client";
+import {AxiosResponse} from "axios/index";
+import {ResultOutputApiResponse} from "./iFuelDBKeyDto";
+
+export class iFuelDBKeyAPI<SecurityDataType = unknown> extends HttpClient<SecurityDataType>{
+
+  /**
+   * No description
+   *
+   * @tags
+   * @name insertiFuelDBKey
+   * @summary 插入iFuel数据库密码
+   * @request POST:/api/app/i-fuel-db-key/inserti-fuel-db-key
+   * @secure
+   */
+  insertiFuelDBKey = (data:any,params: RequestParams = {}) =>
+    this.request<AxiosResponse,any>({
+        path:'/api/app/i-fuel-db-key/inserti-fuel-db-key',
+        method: 'POST',
+        body:data,
+        secure: true,
+        type: ContentType.Json,
+        format: 'json',
+        ...params
+      }
+    )
+
+    
+    /**
+   * No description
+   *
+   * @tags
+   * @name getiFuelDBKeyRecord
+   * @summary 获取iFuel数据库密码记录
+   * @request POST:/api/app/i-fuel-db-key/geti-fuel-db-key-page
+   * @secure
+   */
+    getiFuelDBKeyRecord = (data:any,params: RequestParams = {}) =>
+    this.request<AxiosResponse,any>({
+        path:'/api/app/i-fuel-db-key/geti-fuel-db-key-page',
+        method: 'POST',
+        body:data,
+        secure: true,
+        type: ContentType.Json,
+        format: 'json',
+        ...params
+      }
+    )
+ 
+
+          /**
+   * No description
+   *
+   * @tags
+   * @name GetiFuelDBKey
+   * @summary 查询iFuel数据库密码
+   * @request POST:'/api/app/i-fuel-db-key/geti-fuel-db-key'
+   * @secure
+   */
+GetiFuelDBKey = (query:any ,params: RequestParams = {}) : any  =>
+      this.request<AxiosResponse,any>({
+        path:'/api/app/i-fuel-db-key/geti-fuel-db-key',
+        method: 'POST',
+        query:query,
+        type: ContentType.Json,
+        secure: true,
+        format: 'json',
+        ...params
+      })
+
+          /**
+   * No description
+   *
+   * @tags
+   * @name UpdateiFuelDBKey
+   * @summary 修改iFuel数据库密码
+   * @request POST:'/api/app/i-fuel-db-key/updatei-fuel-db-key'
+   * @secure
+   */
+UpdateiFuelDBKey = (data:any ,params: RequestParams = {}) : any  =>
+      this.request<AxiosResponse,any>({
+        path:'/api/app/i-fuel-db-key/updatei-fuel-db-key',
+        method: 'POST',
+        body:data,
+        type: ContentType.Json,
+        secure: true,
+        format: 'json',
+        ...params
+      })
+}

+ 56 - 0
admin.ui.plus-master/src/api/admin/deviceAuthorization/iFuelDBKeyDto.ts

@@ -0,0 +1,56 @@
+/** 查询信息输出 */
+  export interface ResultOutputApiResponse{
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  /** 数据 */
+ data?:ApiResponse | null
+}
+      export interface ApiResponse{
+   /** success */
+        success?: boolean
+   /** message */
+        message?: string
+   /** code */
+        code?: string
+   /** data */
+        data?: undefined
+
+}
+
+/** 查询信息输出 */
+  export interface ResultOutputPageOutputiFuelDBKeyDto{
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  /** 数据 */
+ data?:PageOutputiFuelDBKeyDto[] | null
+}
+    export interface PageOutputiFuelDBKeyDto{
+      /**
+      * 数据总数
+      * @format int64
+      */
+      total?: number
+      /** 数据 */
+      list?: iFuelDBKeyDto[] | null
+    }
+    export interface iFuelDBKeyDto{
+   /** 电脑识别号 */
+      computerID?: string
+   /** 密码使用日期 */
+      keyDate?: string
+
+}
+export interface pageInput {
+      /**当前页数 */
+      CurrentPage: number | any
+      /**展示页数 */
+      PageSize: number | any
+    }

+ 46 - 0
admin.ui.plus-master/src/api/admin/deviceAuthorization/iFuelDBKeyRecordApi.ts

@@ -0,0 +1,46 @@
+
+  import { ContentType, HttpClient, RequestParams } from '/@/api/admin/http-client'
+  import {AxiosResponse} from "axios/index";
+
+  export class iFuelDBKeyRecordAPI<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
+    /**
+   * No description
+   *
+   * @tags
+   * @name GetList
+   * @summary 查询列表
+   * @request POST:'/api/app/i-fuel-db-key-record/geti-fuel-db-key-record-page'
+   * @secure
+   */
+getList = (data:any ,params: RequestParams = {}) : any  =>
+      this.request<AxiosResponse,any>({
+        path:'/api/app/i-fuel-db-key-record/geti-fuel-db-key-record-page',
+        method: 'POST',
+        body:data,
+        type: ContentType.Json,
+        secure: true,
+        format: 'json',
+        ...params
+      })
+
+    /**
+   * No description
+   *
+   * @tags
+   * @name GetList
+   * @summary 插入记录
+   * @request POST:'/api/app/i-fuel-db-key-record/inserti-fuel-db-key-record'
+   * @secure
+   */
+insertRecord = (data:any ,params: RequestParams = {}) : any  =>
+      this.request<AxiosResponse,any>({
+        path:'/api/app/i-fuel-db-key-record/inserti-fuel-db-key-record',
+        method: 'POST',
+        body:data,
+        type: ContentType.Json,
+        secure: true,
+        format: 'json',
+        ...params
+      })
+
+    }

+ 37 - 0
admin.ui.plus-master/src/api/admin/deviceAuthorization/iFuelDBKeyRecordDto.ts

@@ -0,0 +1,37 @@
+/** 查询信息输出 */
+  export interface ResultOutputPageOutputiFuelDBKeyRecordDto{
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  /** 数据 */
+ data?:PageOutputiFuelDBKeyRecordDto[] | null
+}
+    export interface PageOutputiFuelDBKeyRecordDto{
+      /**
+      * 数据总数
+      * @format int64
+      */
+      total?: number
+      /** 数据 */
+      list?: iFuelDBKeyRecordDto[] | null
+    }
+    export interface iFuelDBKeyRecordDto{
+   /** id */
+      id?: number
+   /** 电脑识别号 */
+      computerID?: string
+   /** 密码申请日期 */
+      applyDate?: string
+   /** 申请人 */
+      user?: string
+
+}
+export interface pageInput {
+      /**当前页数 */
+      CurrentPage: number | any
+      /**展示页数 */
+      PageSize: number | any
+    }

+ 162 - 0
admin.ui.plus-master/src/views/admin/authorize/iFuelDBKey/add.vue

@@ -0,0 +1,162 @@
+<template>
+<el-dialog
+  v-model="dialogVisible"
+  :title="dialogTitle"
+  width="500px"
+  :before-close="handleDialogClose"
+>
+  <el-form
+    ref="formRef"
+    :model="formData"
+    :rules="rules"
+    label-width="100px"
+  >
+    <el-form-item label="电脑识别号" prop="computerID">
+      <el-input id = "iComputerID" v-model="formData.computerID" placeholder="请输入电脑识别号"></el-input>
+    </el-form-item>
+  </el-form>
+  
+    <el-label id="Hint" hidden>注意:更新密码后电脑密码也要更新。需要更新按确定继续</el-label>
+
+  <template #footer>
+    <span class="dialog-footer">
+      <el-button @click="handleDialogClose">取消</el-button>
+      <el-button type="primary" @click="handleSubmit">确定</el-button>
+    </span>
+  </template>
+</el-dialog>
+</template>
+
+
+
+<script setup lang="ts">
+import eventBus from "/@/utils/mitt";
+import { reactive, ref ,onMounted} from 'vue'
+import type { FormInstance, FormRules } from 'element-plus'
+import { iFuelDBKeyAPI } from '/@/api/admin/deviceAuthorization/iFuelDBKeyAPI'
+import type { ResultOutputApiResponse } from '/@/api/admin/deviceAuthorization/iFuelDBKeyDto'
+import {AxiosResponse} from "axios/index"
+import emitter from '/@/utils/mitt'  
+
+
+const dialogVisible = ref(false)
+const dialogTitle = ref('')
+const formRef = ref<FormInstance>()
+const formData = reactive({
+  computerID: "",
+  keyDate: "",
+})
+
+// 验证规则
+const rules = reactive<FormRules>({
+  computerID: [
+    { required: true, message: '请输入电脑识别号', trigger: 'blur' },
+  ],
+})
+
+
+
+
+
+// 打开弹窗
+const openDialog = () => {
+
+  dialogVisible.value = true
+}
+
+// 关闭弹窗
+const handleDialogClose = () => {
+  formRef.value?.resetFields()
+  dialogVisible.value = false
+
+emitter.emit('component-closed');
+
+}
+
+document.addEventListener('DOMContentLoaded', function() {
+    // 页面加载完成后执行的函数
+    console.log('DOM fully loaded and parsed');
+    // 在这里调用你的函数
+    yourFunction();
+});
+
+function yourFunction() {
+    // 你的函数逻辑
+    console.log('Your function is called after page load');
+}
+
+function getCurrentDate(): string {
+  const now = new Date();
+  const year = now.getFullYear();
+  const month = String(now.getMonth() + 1).padStart(2, '0');
+  const day = String(now.getDate()).padStart(2, '0');
+  return `${year}-${month}-${day}`;
+}
+
+
+
+
+
+// 提交表单
+const handleSubmit = async() => {
+    
+  formRef.value?.validate((valid) => {
+    if (valid) {
+
+
+    formData.keyDate = getCurrentDate();
+
+
+    const res =  new iFuelDBKeyAPI().insertiFuelDBKey(formData) .then(response => {
+    if (response.success === true) {
+    
+     if(response.data.success)
+     {
+        new iFuelDBKeyAPI().GetiFuelDBKey({ computerID:formData.computerID }).then(response2 => {
+        if (response2.success === true) {
+
+            alert("创建成功。\r\n密码:"+response2.data);
+            handleDialogClose() 
+        }
+         })
+     }
+     else
+     {
+        var msg = response.data.message;
+        if(msg.includes("Duplicate entry") && msg.includes("ifueldbkey.PRIMARY"))
+        {
+            alert("该电脑识别号已存在") 
+        }
+        else
+        {
+            alert("创建失败"+response.data.message)
+        }
+     }
+    } else {
+     
+    }
+  })
+  .catch(error => {
+    console.error("网络或服务器错误:", error.message);
+  });
+
+
+
+    
+
+    }
+  })
+}
+
+
+defineExpose({
+  openDialog,
+})
+</script>
+
+<style scoped>
+.dialog-footer {
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 235 - 0
admin.ui.plus-master/src/views/admin/authorize/iFuelDBKey/index.vue

@@ -0,0 +1,235 @@
+
+<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="电脑识别号">
+                  <el-input v-model="state.filter.computerID" 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-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-Tickets"
+                  @click="onDataDetail(row)"
+                  :underline="false"
+                  target="_blank"
+                >查看密码</el-link>
+<el-link
+                  class="my-el-link mr12 ml12"
+                  type="primary"
+                  icon="ele-EditPen"
+                  @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="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-row>
+    <AddComponentDialog ref="AddComponentDialogRef" />
+    <UpdateComponentDialog ref="UpdateComponentDialogRef" />
+    </div>
+  </template>
+  <script setup lang="ts">
+  import {onBeforeMount, onMounted, reactive, ref, watch,defineAsyncComponent} from "vue";
+  import eventBus from "/@/utils/mitt";
+  import { iFuelDBKeyAPI } from '/@/api/admin/deviceAuthorization/iFuelDBKeyApi'
+import { iFuelDBKeyDto } from '/@/api/admin/deviceAuthorization/iFuelDBKeyDto'
+  import { useDynamicPageSize } from "/@/composables/useDynamicPageSize";
+import { iFuelDBKeyRecordAPI } from '/@/api/admin/deviceAuthorization/iFuelDBKeyRecordApi'
+import { AuthApi } from '/@/api/admin/Auth'
+import emitter from '/@/utils/mitt'  
+
+
+
+// 引入组件
+const AddComponentDialog = defineAsyncComponent(() => import('./add.vue'))
+const UpdateComponentDialog = defineAsyncComponent(() => import('./update.vue'))
+
+// 定义变量内容
+const AddComponentDialogRef = ref()
+const UpdateComponentDialogRef = ref()
+
+  // 使用组合式函数获取分页状态
+const pageState = useDynamicPageSize(10, 15);
+import type { pageInput } from "/@/api/admin/shareDto/shareDto";
+import { getDate } from "date-fns";
+    
+/**数据对象*/
+  const state = reactive({
+    /**加载显示 */
+    loading: false,
+    /**条件查询模块 */
+      filter: {
+/**电脑识别号 */
+        computerID: "",},
+  /**表格信息 */
+tableModel: [] as iFuelDBKeyDto,
+    /**动态表头 */
+    dynamicColumns: [
+{ prop: 'computerID', label: '电脑识别号' }],
+/**分页标识 */
+    pageInput:{
+      CurrentPage: 1,
+      PageSize: 10,
+    } as pageInput,
+    /**分页总数 */
+    total: 0,
+})
+  onMounted(() => {
+    // 初始化分页大小
+    state.pageInput.PageSize = pageState.pageInput.pageSize; 
+    init()
+    eventBus.off('refreshView')
+    eventBus.on('refreshView', async () => {
+      await init()
+    })
+    console.log()
+  })
+  onBeforeMount(() => {
+    eventBus.off('refreshView')
+  })
+
+ emitter.on('component-closed', () => {
+  console.log('组件已关闭');
+  // 执行原页面函数
+init();
+});
+
+  /**
+  * 监听变换
+  */
+  watch(() => {})
+/**条件查询 */
+          const onQuery = () => {
+          init()
+        }
+        /**初始化 */
+        const init = async () => {
+          state.loading = true
+const res:any = await new iFuelDBKeyAPI().getiFuelDBKeyRecord({...pageState.pageInput, Filter:state.filter})
+            state.total = res?.data?.total ?? 0
+state.tableModel = res?.data?.list ?? []
+          state.loading = false
+        }
+
+        function getCurrentFormattedTime(): string {
+  const now = new Date();
+  
+  const year = now.getFullYear();
+  const month = String(now.getMonth() + 1).padStart(2, '0');
+  const day = String(now.getDate()).padStart(2, '0');
+  const hours = String(now.getHours()).padStart(2, '0');
+  const minutes = String(now.getMinutes()).padStart(2, '0');
+  const seconds = String(now.getSeconds()).padStart(2, '0');
+  
+  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+}
+
+/**添加 */
+        const onAdd=()=>{
+          AddComponentDialogRef.value.openDialog()
+        }
+/**编辑 */
+      const onDateUpdate=(row)=>{
+          UpdateComponentDialogRef.value.openDialog(row)}
+/**详情 */
+      const onDataDetail= async(row)=>{
+
+    const name: any = await new AuthApi().getUserProfile()
+        var data = row;
+
+        data.applyDate = getCurrentFormattedTime();
+        data.user = name.data.name;
+        
+        await new iFuelDBKeyRecordAPI().insertRecord(data)
+
+        const res = await new iFuelDBKeyAPI().GetiFuelDBKey({ computerID:row.computerID}).catch()
+        
+
+        alert("密码:"+res.data)
+
+
+      }
+
+  /**
+* 页条变化
+* @param val
+*/
+const onSizeChange = (val: number) => {
+  state.pageInput.PageSize = val
+  //需按照页面对象修改Data
+  init()
+}
+
+/**
+ * 页数 变化
+ * @param val
+ */
+const onCurrentChange = (val: number) => {
+  state.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>

+ 172 - 0
admin.ui.plus-master/src/views/admin/authorize/iFuelDBKey/update.vue

@@ -0,0 +1,172 @@
+<template>
+<el-dialog
+  v-model="dialogVisible"
+  :title="dialogTitle"
+  width="500px"
+  :before-close="handleDialogClose"
+>
+  <el-form
+    ref="formRef"
+    :model="formData"
+    :rules="rules"
+    label-width="100px"
+  >
+    <el-form-item label="电脑识别号" prop="computerID">
+      <el-input id = "iComputerID" readonly="true" v-model="formData.computerID" placeholder="请输入电脑识别号"></el-input>
+    </el-form-item>
+  </el-form>
+  
+    <el-label id="Hint" >注意:更新密码后电脑密码也要更新。需要更新按确定继续</el-label>
+
+  <template #footer>
+    <span class="dialog-footer">
+      <el-button @click="handleDialogClose">取消</el-button>
+      <el-button type="primary" @click="handleSubmit">确定</el-button>
+    </span>
+  </template>
+</el-dialog>
+</template>
+
+
+
+<script setup lang="ts">
+import eventBus from "/@/utils/mitt";
+import { reactive, ref ,onMounted} from 'vue'
+import type { FormInstance, FormRules } from 'element-plus'
+import { iFuelDBKeyAPI } from '/@/api/admin/deviceAuthorization/iFuelDBKeyAPI'
+import type { ResultOutputApiResponse } from '/@/api/admin/deviceAuthorization/iFuelDBKeyDto'
+import {AxiosResponse} from "axios/index"
+import { AuthApi } from '/@/api/admin/Auth'
+
+const dialogVisible = ref(false)
+const dialogTitle = ref('')
+const formRef = ref<FormInstance>()
+const formData = reactive({
+  computerID: "",
+  keyDate: "",
+})
+
+// 验证规则
+const rules = reactive<FormRules>({
+  computerID: [
+    { required: true, message: '请输入电脑识别号', trigger: 'blur' },
+  ],
+})
+
+
+
+// 打开弹窗
+const openDialog = (row) => {
+console.log(row)
+  
+   formData.computerID = row.computerID;
+
+
+  dialogVisible.value = true
+}
+
+// 关闭弹窗
+const handleDialogClose = () => {
+  formRef.value?.resetFields()
+  dialogVisible.value = false
+}
+
+document.addEventListener('DOMContentLoaded', function() {
+    // 页面加载完成后执行的函数
+    console.log('DOM fully loaded and parsed');
+    // 在这里调用你的函数
+    yourFunction();
+});
+
+function yourFunction() {
+    // 你的函数逻辑
+    console.log('Your function is called after page load');
+}
+
+function getCurrentDate(): string {
+  const now = new Date();
+  const year = now.getFullYear();
+  const month = String(now.getMonth() + 1).padStart(2, '0');
+  const day = String(now.getDate()).padStart(2, '0');
+  return `${year}-${month}-${day}`;
+}
+
+
+
+
+
+// 提交表单
+const handleSubmit = async() => {
+    
+  formRef.value?.validate((valid) => {
+    if (valid) {
+
+
+    formData.keyDate = getCurrentDate();
+
+    var oldkey = "";
+        new iFuelDBKeyAPI().GetiFuelDBKey({ computerID:formData.computerID}).then(res => {
+            if (res.success === true) {
+                oldkey = res.data;
+
+                new iFuelDBKeyAPI().UpdateiFuelDBKey(formData) .then(response => {
+                if (response.success === true) {
+                
+                if(response.data.success)
+                {
+                    new iFuelDBKeyAPI().GetiFuelDBKey({ computerID:formData.computerID }).then(response2 => {
+                    if (response2.success === true) {
+
+
+                        alert("更新成功。\r\n原密码:"+ oldkey + "\r\n新密码:"+response2.data);
+                        handleDialogClose() 
+                    }
+                    else
+                    {
+                        alert("更新失败")
+                    }
+                    })
+                }
+                else
+                {
+                    var msg = response.data.message;
+                    
+                    alert("更新失败"+response.data.message)
+                    
+                }
+                } else {
+                alert("更新失败")
+                }
+            })
+            .catch(error => {
+                console.error("网络或服务器错误:", error.message);
+            });
+                
+        }
+        })
+        .catch(error => {
+            console.error("网络或服务器错误:", error.message);
+        });
+
+
+  
+
+
+    
+
+    }
+  })
+}
+
+
+defineExpose({
+  openDialog,
+})
+</script>
+
+<style scoped>
+.dialog-footer {
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 190 - 0
admin.ui.plus-master/src/views/admin/authorize/iFuelDBKeyRecord/index.vue

@@ -0,0 +1,190 @@
+
+<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-row>
+<el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="6" class="mb20">
+                <el-form-item label="电脑识别号">
+                  <el-input v-model="state.filter.computerID" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+</el-row>
+<el-row>
+<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-row>
+<el-row>
+<el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="6" class="mb20">
+            <el-form-item label="申请时间范围">
+                  <el-date-picker
+                    v-model="state.filter.TimeRange"
+                    type="datetimerange"
+                    value-format="YYYY-MM-DD HH:mm:ss"
+                    range-separator="To"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                  />
+                </el-form-item>
+              </el-col>
+</el-row>
+</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-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>
+<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-row>
+    </div>
+  </template>
+  <script setup lang="ts">
+import {onBeforeMount, onMounted, reactive, ref, watch} from "vue";
+import eventBus from "/@/utils/mitt"
+import { iFuelDBKeyRecordAPI } from '/@/api/admin/deviceAuthorization/iFuelDBKeyRecordApi'
+import { iFuelDBKeyRecordDto } from '/@/api/admin/deviceAuthorization/iFuelDBKeyRecordDto'
+import { useDynamicPageSize } from "/@/composables/useDynamicPageSize";
+
+import type { pageInput } from "/@/api/admin/shareDto/shareDto";
+
+  // 使用组合式函数获取分页状态
+const pageState = useDynamicPageSize(10, 15);
+    
+/**数据对象*/
+  const state = reactive({
+    /**加载显示 */
+    loading: false,
+    /**条件查询模块 */
+      filter: {
+/**电脑识别号 */
+        computerID: "",
+/**密码申请开始日期 */
+        applyBeginDate: "",
+/**密码申请结束日期 */
+        applyEndDate: "",
+/**密码申请日期范围 */
+        TimeRange: [],
+/**申请人 */
+        user: "",},
+  /**表格信息 */
+tableModel: [] as iFuelDBKeyRecordDto,
+    /**动态表头 */
+    dynamicColumns: [
+{ prop: 'computerID', label: '电脑识别号' },
+{ prop: 'applyDate', label: '密码申请日期' },
+{ prop: 'user', label: '申请人' },],
+/**分页标识 */
+    pageInput:{
+      CurrentPage: 1,
+      PageSize: 10,
+    } as pageInput,
+    /**分页总数 */
+    total: 0,
+})
+  onMounted(() => {
+    // 初始化分页大小
+    state.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
+
+          Filter:state.filter.applyBeginDate = state.filter.TimeRange.length > 0? state.filter.TimeRange[0] : "";
+          Filter:state.filter.applyEndDate = state.filter.TimeRange.length > 1? state.filter.TimeRange[1] : "";
+const res:any = await new iFuelDBKeyRecordAPI().getList(
+    {...pageState.pageInput, Filter:state.filter})
+            state.total = res?.data?.total ?? 0
+state.tableModel = res?.data?.list ?? []
+          state.loading = false
+        }
+
+  /**
+* 页条变化
+* @param val
+*/
+const onSizeChange = (val: number) => {
+  state.pageInput.PageSize = val
+  //需按照页面对象修改Data
+  init()
+}
+
+/**
+ * 页数 变化
+ * @param val
+ */
+const onCurrentChange = (val: number) => {
+  state.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>

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

@@ -205,6 +205,13 @@ const onCurrentChange = (val: number) => {
   onQuery()
 }
 
+  onMounted(() => {
+    eventBus.off('refreshView')
+    eventBus.on('refreshView', async () => {
+ 
+    })
+  })
+
   /**
   * 监听变换
   */

+ 9 - 2
admin.ui.plus-master/src/views/example/codeGeneration/index.vue

@@ -133,10 +133,11 @@ const change=(k)=>{
 }
 //解析页面接口数据
 const onQuery = async () => {
+  state.api = []
   fetch(state.filter.name)
     .then(response=>response.json())
     .then(swaggerJson=>{
-      // console.log(swaggerJson)
+       console.log(swaggerJson)
       dataJson.value=swaggerJson
       const {paths} =dataJson.value
       // console.log(paths)
@@ -157,7 +158,7 @@ const onQuery = async () => {
           //console.log(path)
           //console.log(paths[path].get.responses['200'].content['application/json'].schema['$ref'])
         }
-        if('post' in paths[path]){
+        else if('post' in paths[path]){
           let summary:any=paths[path].post.summary?paths[path].post.summary:''
           // if(summary===''||summary.includes('查询')||summary.includes('获取')||summary.includes('管理')||summary.includes('表')||summary.includes('')){
             let api:any=path
@@ -174,6 +175,11 @@ const onQuery = async () => {
             //console.log(paths[path].post.responses['200'].content['application/json'].schema['$ref'])
             //console.log(paths[path].post.requestBody)
           }
+          else
+          {
+             console.log(paths[path])
+
+          }
           //console.log(path)
           //console.log(paths[path])
         }
@@ -181,6 +187,7 @@ const onQuery = async () => {
       //console.log(state.api)
     )
     .catch(error=>{
+      alert('Error fetch Swagger Json')
       console.log('Error fetch Swagger Json :',error)
     })
 }