6 次代碼提交 e2379814c2 ... 4cb50cf0cc

作者 SHA1 備註 提交日期
  DOVER-GLOBAL\10090792 4cb50cf0cc feat(软件包下载记录):新增软件包下载记录分页显示功能 1 年之前
  DOVER-GLOBAL\10090792 b3f3015ba0 Merge branch 'features/fuelPage' of http://ipos.biz:3000/adminTk/Web into features/fuelPage 1 年之前
  DOVER-GLOBAL\10090792 6ab1575ea4 添加下载记录 1 年之前
  DOVER-GLOBAL\10090792 a0afd2f91a style油机SDK授权页面):修改“添加”按钮的位置 1 年之前
  DOVER-GLOBAL\10090792 65777a344f style(首页菜单):隐藏"个人中心"、“帮助文档”链接 1 年之前
  LAPTOP-PECVO9TA\17461 4a5d3ddccf style(部件类型、油机SDK授权页面、油机列表):修改页面"操作"列样式 1 年之前

+ 8 - 8
admin.ui.plus-master/package-lock.json

@@ -18,7 +18,7 @@
         "echarts": "^5.4.2",
         "echarts-gl": "^2.0.9",
         "echarts-wordcloud": "^2.1.0",
-        "element-plus": "^2.3.6",
+        "element-plus": "^2.4.3",
         "exceljs": "^4.4.0",
         "file-saver": "^2.0.5",
         "js-cookie": "^3.0.5",
@@ -203,9 +203,9 @@
       }
     },
     "node_modules/@element-plus/icons-vue": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.1.0.tgz",
-      "integrity": "sha512-PSBn3elNoanENc1vnCfh+3WA9fimRC7n+fWkf3rE5jvv+aBohNHABC/KAR5KWPecxWxDTVT1ERpRbOMRcOV/vA==",
+      "version": "2.3.1",
+      "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
+      "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==",
       "peerDependencies": {
         "vue": "^3.2.0"
       }
@@ -1946,12 +1946,12 @@
       }
     },
     "node_modules/element-plus": {
-      "version": "2.3.6",
-      "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.3.6.tgz",
-      "integrity": "sha512-GLz0pXUYI2zRfIgyI6W7SWmHk6dSEikP9yR++hsQUyy63+WjutoiGpA3SZD4cGPSXUzRFeKfVr8CnYhK5LqXZw==",
+      "version": "2.4.3",
+      "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.4.3.tgz",
+      "integrity": "sha512-b3q26j+lM4SBqiyzw8HybybGnP2pk4MWgrnzzzYW5qKQUgV6EG1Zg7nMCfgCVccI8tNvZoTiUHb2mFaiB9qT8w==",
       "dependencies": {
         "@ctrl/tinycolor": "^3.4.1",
-        "@element-plus/icons-vue": "^2.0.6",
+        "@element-plus/icons-vue": "^2.3.1",
         "@floating-ui/dom": "^1.0.1",
         "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
         "@types/lodash": "^4.14.182",

+ 1 - 1
admin.ui.plus-master/package.json

@@ -22,7 +22,7 @@
     "echarts": "^5.4.2",
     "echarts-gl": "^2.0.9",
     "echarts-wordcloud": "^2.1.0",
-    "element-plus": "^2.3.6",
+    "element-plus": "^2.4.3",
     "exceljs": "^4.4.0",
     "file-saver": "^2.0.5",
     "js-cookie": "^3.0.5",

+ 17 - 4
admin.ui.plus-master/src/api/admin/deviceAuthorization/softwarePackageManagementApi.ts

@@ -3,7 +3,7 @@ import { AxiosResponse } from 'axios'
 import {ContentType, HttpClient, RequestParams} from "/@/api/admin/http-client";
 import {
   softwarePackageManagement_DtoResult,
-  softwarePackageManagement_PageInput, softwarePackageManagement_TableData,softwarePackageManagement_SearchFilter
+  softwarePackageManagement_PageInput, softwarePackageManagement_TableData,ResultOutputPageOutputDownloadRecordDto,pageInputDownloadRecordDto
 } from "/@/api/admin/deviceAuthorization/softwarePackageManagementDto";
 import {oilSdkAuthorPageOutput, oilSdkTableModel} from "/@/api/admin/deviceAuthorization/oilSdkAuthorDto";
 
@@ -173,7 +173,7 @@ export class SoftwarePackageManagementApi<SecurityDataType = unknown> extends Ht
    * @request GET:
    * @secure
    */
-  addData = (data:softwarePackageManagement_TableData) => 
+  addData = (data:softwarePackageManagement_TableData) =>
   this.request<AxiosResponse, any>({
     path: `/api/app/software/upload-file`,
     method: 'POST',
@@ -192,7 +192,7 @@ export class SoftwarePackageManagementApi<SecurityDataType = unknown> extends Ht
    * @request GET:
    * @secure
    */
-/* DownloadFile = (data:softwarePackageManagement_TableData) => 
+/* DownloadFile = (data:softwarePackageManagement_TableData) =>
 this.request<AxiosResponse, any>({
   path: `/api/app/software/download-file`,
   method: 'GET',
@@ -211,7 +211,7 @@ DownloadFile = async (data: softwarePackageManagement_TableData) => {
       type: ContentType.Json,
       format: 'json',
       responseType: 'blob', // 添加这一行
-    }); 
+    });
     const filename =  data.fileName?.toString();
     const blob = new Blob([response.data], { type: 'application/x-rar-compressed' });
     const link = document.createElement('a');
@@ -223,4 +223,17 @@ DownloadFile = async (data: softwarePackageManagement_TableData) => {
     console.error('下载失败:', error);
   }
 };
+    getDownloadData = (data: pageInputDownloadRecordDto,params: RequestParams = {}) =>
+    this.request<ResultOutputPageOutputDownloadRecordDto, any>({
+      path: `/api/app/software/get-download-record`,
+      method: 'POST',
+      body: data,
+      secure: true,
+      type: ContentType.Json,
+      format: 'json',
+      ...params
+    }).then((res) => {
+      //console.log('getDownloadData result:', res);
+      return res;
+    })
 }

+ 74 - 0
admin.ui.plus-master/src/api/admin/deviceAuthorization/softwarePackageManagementDto.ts

@@ -116,3 +116,77 @@ export interface softwarePackageManagement_PageInput {
   Filter?: softwarePackageManagement_SearchFilter
 }
 
+/**
+ * And=0,Or=1
+ * @format int32
+ */
+export type DynamicFilterLogic = 0 | 1
+
+/**
+ * Contains=0,StartsWith=1,EndsWith=2,NotContains=3,NotStartsWith=4,NotEndsWith=5,Equal=6,Equals=7,Eq=8,NotEqual=9,GreaterThan=10,GreaterThanOrEqual=11,LessThan=12,LessThanOrEqual=13,Range=14,DateRange=15,Any=16,NotAny=17,Custom=18
+ * @format int32
+ */
+export type DynamicFilterOperator = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18
+export interface DynamicFilterInfo {
+  field?: string | null
+  /** Contains=0,StartsWith=1,EndsWith=2,NotContains=3,NotStartsWith=4,NotEndsWith=5,Equal=6,Equals=7,Eq=8,NotEqual=9,GreaterThan=10,GreaterThanOrEqual=11,LessThan=12,LessThanOrEqual=13,Range=14,DateRange=15,Any=16,NotAny=17,Custom=18 */
+  operator?: DynamicFilterOperator
+  value?: string
+  /** And=0,Or=1 */
+  logic?: DynamicFilterLogic
+  filters?: DynamicFilterInfo[] | null
+}
+/**
+ * 软件包下载记录列表信息
+ */
+export  interface DownloadRecordDto{
+  /**id*/
+  fileId: number,
+  /**文件名称*/
+  fileName?: string,
+  /**文件路径*/
+  filePath?: string,
+  /**下载时间*/
+  downloadTime?: string,
+  /**下载人员*/
+  downloadedBy?: string,
+}
+
+/** 分页信息输出*/
+export interface PageOutputDownloadRecordDto{
+  /**
+   * 数据总数
+   * @format int64
+   */
+  total?: number
+  /** 数据 */
+  list?: DownloadRecordDto[] | null
+}
+
+/**结果输出*/
+export interface ResultOutputPageOutputDownloadRecordDto{
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  /** 分页信息输出 */
+  data?: PageOutputDownloadRecordDto
+}
+
+/** 分页信息输入 */
+export interface pageInputDownloadRecordDto{
+  /**
+   * 当前页标
+   * @format int32
+   */
+  CurrentPage?: number
+  /**
+   * 每页大小
+   * @format int32
+   */
+  PageSize?: number
+  dynamicFilter?: DynamicFilterInfo
+  filter?: DownloadRecordDto
+}

+ 2 - 0
admin.ui.plus-master/src/layout/component/columnsAside.vue

@@ -131,7 +131,9 @@ const onColumnsAsideDown = (k: number) => {
 // 设置/过滤路由(非静态路由/是否显示在菜单中)
 const setFilterRoutes = () => {
   state.columnsAsideList = filterRoutesFun(routesList.value)
+  console.log(state.columnsAsideList)
   state.columnsAsideList=state.columnsAsideList.filter(route=>route.meta.title!=='个人中心'&&route.meta.title!=='帮助文档')
+  console.log(state.columnsAsideList)
   const resData: MittMenu = setSendChildren(route.path)
   if (Object.keys(resData).length <= 0) return false
   onColumnsAsideDown(resData.item?.k)

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

@@ -48,13 +48,11 @@
                   <el-button type="primary" icon="ele-RefreshRight" @click="onReset"> 重置 </el-button>
                 </el-form-item>
               </el-col>
-              <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
-                <el-form-item>
-                  <el-button  type="primary" icon="ele-CirclePlus" @click="onAdd"> 添加 </el-button>
-                </el-form-item>
-              </el-col>
             </el-form-item>
           </el-form>
+          <div class="my-flex my-flex-start" >
+            <el-button  type="primary" icon="ele-CirclePlus" @click="onAdd"> 添加 </el-button>
+          </div>
           <div class="my-flex my-flex-end" >
             <el-button type="primary" icon="ele-UploadFilled" @click="uploadFiles"> 批量导入 </el-button>
             <el-button type="primary" icon="ele-Document" @click="exportTable(sdkData.tableModel,sdkData.dynamicColumns)"> 导出表格 </el-button>

+ 1 - 1
admin.ui.plus-master/src/views/admin/authorize/softwarePackageManagement/components/form-edit.vue

@@ -62,7 +62,7 @@ import eventBus from "/@/utils/mitt";
 import {softwarePackageManagement_TableData} from "/@/api/admin/deviceAuthorization/softwarePackageManagementDto";
 import {useGlobalCacheStore} from "/@/stores/globalCacheStore";
 import {SoftwarePackageManagementApi} from "/@/api/admin/deviceAuthorization/softwarePackageManagementApi";
-import { de } from "element-plus/es/locale";
+//import { de } from "element-plus/es/locale";
 
 const MyUploadFile = defineAsyncComponent(() => import('/@/components/my-upload-file/index.vue'))
 

+ 69 - 35
admin.ui.plus-master/src/views/admin/authorize/softwarePackageManagement/components/table-download.vue

@@ -1,13 +1,26 @@
 <template>
     <div class="admin-authorize-editInfo">
-      <el-dialog :title="formData.titleText" v-model="formData.isShowDialog" draggable width="769px">
-        <el-table :model="formData.downloadData"
-               v-loading="formData.loading"
-               size="default">
-        <el-table-column prop="field1" label="字段1" align="center"></el-table-column>
-        <el-table-column prop="field2" label="字段2" align="center"></el-table-column>
-        <el-table-column prop="field3" label="字段3" align="center"></el-table-column>
-      </el-table>
+      <el-dialog :title="titleText" v-model="isShowDialog" draggable width="769px">
+          <el-table stripe :data="softwareDownloadData.tableModel"
+               v-loading="softwareDownloadData.loading"
+               size="default"
+               style="height: 40vh" class="my-fill mt8" shadow="hover">
+          <el-table-column v-for="column in softwareDownloadData.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label" align="center" >
+          </el-table-column>
+        </el-table>
+        <div class="my-flex my-flex-end" style="margin-top: 20px">
+            <el-pagination
+              v-model:currentPage="softwareDownloadData.pageInput.CurrentPage"
+              v-model:page-size="softwareDownloadData.pageInput.PageSize"
+              :total="softwareDownloadData.total"
+              :page-sizes="[10, 20, 50, 100]"
+              small
+              background
+              @size-change="onSizeChange"
+              @current-change="onCurrentChange"
+              layout="total, sizes, prev, pager, next, jumper"
+            />
+          </div>
         <template #footer>
           <span class="dialog-footer">
             <el-button type="primary" icon="ele-CircleClose" @click="onClose" size="default">关闭</el-button>
@@ -19,44 +32,65 @@
 
   <script setup lang="ts">
   import { reactive, ref, watch} from "vue";
-  import {softwarePackageManagement_TableData} from "/@/api/admin/deviceAuthorization/softwarePackageManagementDto";
+  import {DownloadRecordDto,pageInputDownloadRecordDto} from "/@/api/admin/deviceAuthorization/softwarePackageManagementDto";
+  import {SoftwarePackageManagementApi} from "/@/api/admin/deviceAuthorization/softwarePackageManagementApi";
 
 
-  /**获取全局缓存*/
+  /**软件包下载记录管理对象*/
+const softwareDownloadData = reactive({
+  loading: false,
+  filterModel: {
+    fileId:0,
+    /**文件名称 */
+    fileName: "",
+    /**下载时间 */
+    downloadTime: "2020-11-22",
+    /**下载人员 */
+    downloadedBy: "",
+  },
+  total: 0,
+  pageInput: {
+    currentPage: 1,
+    pageSize: 10,
+  } as pageInputDownloadRecordDto,
+  tableModel: [] as Array<DownloadRecordDto>,
+  /**动态表头 */
+  dynamicColumns: [
+    { prop: 'fileName', label: '文件名称' },
+    { prop: 'downloadTime', label: '下载时间' },
+    { prop: 'downloadedBy', label: '下载人员' },
+  ]
+})
 
-
-
-  /**数据对象 */
-  const formData = reactive({
-    loading: false,
-    titleText:'下载记录',
-    isShowDialog: false,
-    downloadData:{} as softwarePackageManagement_TableData,
-  })
-
-
-  /**
-   * 表单对象
-   */
+  const isShowDialog=ref(false)
+  const titleText=ref('下载记录')
   const formRef = ref()
 
-  const openDialog = (val) => {
-    if(val){
-      formData.downloadData = JSON.parse(JSON.stringify(val))
-    }else {
-      formData.downloadData = {} as softwarePackageManagement_TableData
-    }
-    formData.isShowDialog = true
-    formData.isShowDialog = true
+  const openDialog = async (id) => {
+    softwareDownloadData.filterModel.fileId=id
+    softwareDownloadData.loading = true
+    const res:any = await new SoftwarePackageManagementApi().getDownloadData({...softwareDownloadData.pageInput,filter:softwareDownloadData.filterModel})
+    softwareDownloadData.tableModel = res?.data?.list ?? []
+    softwareDownloadData.total = res?.data?.total ?? 0
+    softwareDownloadData.loading = false
+    isShowDialog.value = true
   }
+  /**页条数变化*/
+const onSizeChange = () => {
+  openDialog(softwareDownloadData.filterModel.fileId)
+}
+
+/**页数变化*/
+const onCurrentChange = () =>{
+  openDialog(softwareDownloadData.filterModel.fileId)
+}
   //关闭弹窗
   const onClose = () => {
-    formData.downloadData = {} as softwarePackageManagement_TableData
-    formData.isShowDialog = false
+    isShowDialog.value = false
   }
 
   /***监听弹窗关   闭表单验证*/
-  watch(() => formData.isShowDialog,(newVal) => {
+  watch(() => isShowDialog.value,(newVal) => {
     if(newVal) formRef.value?.resetFields()
   })
 

+ 44 - 27
admin.ui.plus-master/src/views/admin/authorize/softwarePackageManagement/index.vue

@@ -71,7 +71,7 @@
               </template>
             </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"
@@ -119,7 +119,7 @@
                   type="primary"
                   icon="ele-Tickets"
                   size="small"
-                  @click="onDownloadRecord(row)"
+                  @click="onDownloadRecord(row.guid)"
                   :underline="false"
                   target="_blank"
                 >下载记录</el-link>
@@ -139,7 +139,7 @@
               layout="total, sizes, prev, pager, next, jumper"
             />
           </div>
-          <template> 
+          <template>
             <a ref="downloadLink" style="display: none;"></a>
           </template>
         </el-card>
@@ -162,6 +162,8 @@ import {
 import type {pageInput} from "/@/api/admin/shareDto/shareDto";
 import eventBus from "/@/utils/mitt";
 import {SoftwarePackageManagementApi} from "/@/api/admin/deviceAuthorization/softwarePackageManagementApi";
+import { storeToRefs } from 'pinia'
+import { useUserInfo } from '/@/stores/userInfo'
 
 /**引入组件*/
 const EditDialog = defineAsyncComponent(() => import('./components/form-edit.vue'))
@@ -325,28 +327,43 @@ const onRelease = (row) => {
 
 /**下载*/
 const onDownload = (row) => {
-  var RowData =  JSON.parse(JSON.stringify(row))
-  const params = RowData as softwarePackageManagement_TableData
-  //const link = downloadLink.value;
-  //const url = `http://localhost:8000/api/app/software/download-file`;
-  //link.href = url;
-  //link.click();
-  const filename =  params.fileName?.toString();
-  /* var res =  new SoftwarePackageManagementApi().DownloadFile(row as softwarePackageManagement_TableData) */
-  const fileUrl = import.meta.env.VITE_API_URL +'/api/app/software/download-file?guid='+params.guid; // 替换为实际文件URL
-                    fetch(fileUrl)
-                        .then(response => response.blob())
-                        .then(blob => {
-                            const link = document.createElement('a');
-                            link.href = URL.createObjectURL(blob);
-                            link.download = filename;
-                            link.click();
-                        })
-                        .catch(error => {
-                            console.error('下载失败:', error);
-                        });
- // var res =  new SoftwarePackageManagementApi().DownloadFile(RowData as softwarePackageManagement_TableData)
-  
+  softwareData.loading = true;
+  var RowData =  JSON.parse(JSON.stringify(row))
+  const params = RowData as softwarePackageManagement_TableData
+  //const link = downloadLink.value;
+  //const url = `http://localhost:8000/api/app/software/download-file`;
+  //link.href = url;
+  //link.click();
+  const filename =  params.fileName?.toString();
+  const { userInfos } = storeToRefs(useUserInfo());
+  const accessToken = userInfos.value.token
+  const token = `Bearer ${accessToken}`
+  var myHeaders = new Headers();
+myHeaders.append("Authorization", token);
+
+const requestOptions: RequestInit = {
+  method: 'GET',
+  headers: myHeaders,
+  redirect: 'follow', // 此处使用枚举值 'follow'
+};
+
+  /* var res =  new SoftwarePackageManagementApi().DownloadFile(row as softwarePackageManagement_TableData) */
+  const fileUrl = import.meta.env.VITE_API_URL +'/api/app/software/download-file?guid='+params.guid; // 替换为实际文件URL
+                    fetch(fileUrl,requestOptions)
+                        .then(response => response.blob())
+                        .then(blob => {
+                            const link = document.createElement('a');
+                            link.href = URL.createObjectURL(blob);
+                            link.download = filename;
+                            link.click();
+                            softwareData.loading = false
+                        })
+                        .catch(error => {
+                            console.error('下载失败:', error);
+                            softwareData.loading = false
+                        });
+ // var res =  new SoftwarePackageManagementApi().DownloadFile(RowData as softwarePackageManagement_TableData)
 }
 
 /**失效*/
@@ -359,8 +376,8 @@ const onFailure = (row) => {
 }
 
 /**下载记录*/
-const onDownloadRecord = (row) => {
-  downloadDialogRef.value.openDialog(row)
+const onDownloadRecord = (id) => {
+  downloadDialogRef.value.openDialog(id)
   //alert('下载记录')
 }
 

+ 6 - 0
package-lock.json

@@ -0,0 +1,6 @@
+{
+  "name": "Web",
+  "lockfileVersion": 3,
+  "requires": true,
+  "packages": {}
+}