1
0

2 Commits 45d9424c14 ... 8c7ba6861a

Autor SHA1 Mensagem Data
  wyoujia 8c7ba6861a feat(软件包管理): 静态页面的开发 há 1 ano atrás
  wyoujia fa418a1965 feat(软件包管理): 静态页面的开发 há 1 ano atrás

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

@@ -3,5 +3,5 @@ ENV = 'development'
 
 # 本地环境接口地址
 VITE_API_URL = 'http://ipos.biz:8070'
-#VITE_API_URL = 'http://loaclhost:8000'
+#VITE_API_URL = 'http://localhost:8000'
 

+ 1 - 0
admin.ui.plus-master/.env.production

@@ -9,3 +9,4 @@ VITE_PUBLIC_PATH = '/'
 
 # 线上环境接口地址
 VITE_API_URL = 'http://ipos.biz:8070'
+#VITE_API_URL = 'http://localhost:8000'

+ 0 - 0
admin.ui.plus-master/src/README.md


+ 133 - 0
admin.ui.plus-master/src/api/admin/deviceAuthorization/softwarePackageManagementApi.ts

@@ -0,0 +1,133 @@
+import {ContentType, HttpClient, RequestParams} from "/@/api/admin/http-client";
+import {
+  softwarePackageManagement_DtoResult,
+  softwarePackageManagement_PageInput, softwarePackageManagement_TableData
+} from "/@/api/admin/deviceAuthorization/softwarePackageManagementDto";
+import {oilSdkAuthorPageOutput, oilSdkTableModel} from "/@/api/admin/deviceAuthorization/oilSdkAuthorDto";
+
+export class SoftwarePackageManagementApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType>{
+
+  timer = 500
+  /**
+   * No description
+   *
+   * @tags
+   * @name getPageData
+   * @summary 分页查询
+   * @request GET:
+   * @secure
+   */
+  getPageData = (query: softwarePackageManagement_PageInput) =>{
+    return new Promise(resolve => {
+      setTimeout(() => {
+        resolve({
+          success: true,
+          code: 200,
+          msg: '',
+          data: {
+            total: 100,
+            list:[{
+              guid: 1,
+              date: '2020-10-21',
+              softwareType: 0,
+              equipmentType:0,
+              softwareName: 'test',
+              version: 'test',
+              explain: 'test',
+              state: 0,
+              numberOfDownloads: 1234,
+              remark: 'tast',
+              releaseTime: '2020-10-21',
+              uploadTime: '2020-10-21',
+              downloadUrl:'upload/2023/10/27/653b8909-14d2-7870-0097-10007db02419.json',
+              fileName:'22.json'
+            },{
+              guid: 2,
+              date: '2020-10-22',
+              softwareType: 1,
+              equipmentType:1,
+              softwareName: 'test',
+              version: 'test',
+              explain: 'test',
+              state: 1,
+              numberOfDownloads: 3214,
+              remark: 'test',
+              releaseTime: '2020-10-22',
+              uploadTime: '2020-10-22',
+              downloadUrl:'',
+              fileName:'22.json'
+            },{
+              guid: 3,
+              date: '2020-10-23',
+              softwareType: 2,
+              equipmentType:2,
+              softwareName: 'test',
+              version: 'test',
+              explain: 'test',
+              state: 2,
+              numberOfDownloads: 4321,
+              remark: 'tast',
+              releaseTime: '2020-10-23',
+              uploadTime: '2020-10-23',
+              downloadUrl:'',
+              fileName:'22.json'
+            }]
+          }
+        })
+      },this.timer)
+    })
+  }
+    // this.request<softwarePackageManagement_DtoResult, any>({
+    //   path:'/api/app/fueiling-sdk-auth/get-page',
+    //   method: 'GET',
+    //   secure: true,
+    //   type: ContentType.Json,
+    //   format: 'json',
+    //   query:query,
+    //   ...params
+    // })
+
+  /**
+   * No description
+   *
+   * @tags
+   * @name getPageData
+   * @summary 分页查询
+   * @request GET:
+   * @secure
+   */
+  updateData = (data:softwarePackageManagement_TableData) => {
+    return new Promise(resolve => {
+      setTimeout(() => {
+        resolve({
+          success: true,
+          code: 200,
+          msg: '',
+          data: {}
+        })
+      },this.timer)
+    })
+  }
+
+  /**
+   * No description
+   *
+   * @tags
+   * @name getPageData
+   * @summary 分页查询
+   * @request GET:
+   * @secure
+   */
+  addData = (data:softwarePackageManagement_TableData) => {
+    return new Promise(resolve => {
+      setTimeout(() => {
+        resolve({
+          success: true,
+          code: 200,
+          msg: '',
+          data: {}
+        })
+      },this.timer)
+    })
+  }
+}

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

@@ -0,0 +1,117 @@
+/**
+ *  设备授权管理 - 软件包管理
+ *  数据对象的Dto
+ * */
+
+
+import {columnsProps, pageInput} from "/@/api/admin/shareDto/shareDto";
+
+/**
+ * 软件包管理查询条件
+ */
+export  interface softwarePackageManagement_SearchFilter{
+  /**软件类型 */
+  softwareType?: string | number,
+  /**软件名称 */
+  softwareName?: string,
+  /**版本 */
+  version?: string,
+  /**设备类型*/
+  equipmentType?: string | number,
+  /**开始的时间 */
+  BeginTime?: string | null,
+  /**开始的时间 */
+  EndTime?: string | null,
+}
+
+/**
+ * 软件包列表  表格信息
+ */
+export  interface softwarePackageManagement_TableData{
+  /**id*/
+  guid: number,
+  /**日期*/
+  date?: string,
+  /**软件类型*/
+  softwareType?: number | null | string,
+  /**设备类型*/
+  equipmentType?: number | null | string,
+  /**软件名称*/
+  softwareName?: string | null,
+  /**版本号*/
+  version?: string | null,
+  /**说明*/
+  explain?: string | null,
+  /**状态*/
+  state?: string | null | number,
+  /**下载次数*/
+  numberOfDownloads?: number | null,
+  /**备注*/
+  remark?: string | null
+  /**发布日期*/
+  releaseTime?: string | null
+  /**上传日期*/
+  uploadTime?: string | null
+  /**下载地址*/
+  downloadUrl?: string | null
+  /**文件名*/
+  fileName?: string | null
+}
+
+/**
+ * 软件包管理数据对象
+ */
+
+export  interface softwarePackageManagement_AllDto{
+  time: string,
+  /**加载显示 */
+  loading: boolean,
+  /**条件查询模块 */
+  Filter: softwarePackageManagement_SearchFilter,
+  /**表格信息 */
+  tableModel: softwarePackageManagement_TableData [] | [],
+  /**动态表头 */
+  dynamicColumns: columnsProps [] | [],
+  /**分页标识 */
+  pageInput: pageInput,
+  /**分页总数 */
+  total: number,
+}
+
+/**结果输出*/
+export interface softwarePackageManagement_DtoResult {
+  /** 是否成功标记 */
+  success?: boolean
+  /** 编码 */
+  code?: string | null
+  /** 消息 */
+  msg?: string | null
+  /** 分页信息输出 */
+  data?: softwarePackageManagement_PageOutput
+}
+
+/** 分页信息输出*/
+export interface softwarePackageManagement_PageOutput{
+  /**
+   * 数据总数
+   * @format int64
+   */
+  total?: number
+  /** 数据 */
+  list?: softwarePackageManagement_TableData[] | null
+}
+
+/** 分页信息输入 */
+export interface softwarePackageManagement_PageInput {
+  /**
+   * 当前页标
+   * @format int32
+   */
+  CurrentPage?: number
+  /**
+   * 每页大小
+   * @format int32
+   */
+  PageSize?: number
+  Filter?: softwarePackageManagement_SearchFilter
+}

+ 88 - 0
admin.ui.plus-master/src/components/my-upload-file/index.vue

@@ -0,0 +1,88 @@
+<template>
+  <el-upload
+    class="upload-demo"
+    v-model:file-list="fileList"
+    drag
+    :headers="{ Authorization:  'Bearer ' + useUserInfoStores.getToken()}"
+    :action='baseUrl+"/api/admin/file/upload-file"'
+    :on-success="handleAvatarSuccess"
+    :before-upload="beforeAvatarUpload"
+  >
+    <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+    <div class="el-upload__text">
+      将文件拖到此处/<em>点击上传</em>
+    </div>
+    <template #tip>
+      <div class="el-upload__tip">
+        软件包上传
+      </div>
+    </template>
+  </el-upload>
+</template>
+
+<script setup lang="ts">
+import {UploadFilled} from "@element-plus/icons-vue";
+import { useUserInfo } from '/@/stores/userInfo'
+import {ElMessage, UploadProps, UploadUserFile} from "element-plus";
+import {onMounted, ref, watch} from "vue";
+
+const useUserInfoStores = useUserInfo()
+
+
+//接受父组件的传值
+const props = defineProps({
+  file:{} as any
+})
+
+const emits = defineEmits(['onUpload'])
+
+// eslint-disable-next-line vue/no-dupe-keys
+const file = ref(props.file)
+
+
+// const isShow = ref(props.isShow)
+
+const fileList = ref<UploadUserFile[]>([])
+
+
+const baseUrl = import.meta.env.VITE_API_URL
+
+watch(() => props.file.fileUrl, (val)=> {
+  file.value.fileUrl = val
+  if(file.value.fileUrl) {
+    fileList.value = [{name:file.value.fileName,url:file.value.fileUrl} as UploadUserFile]
+  }else{
+    fileList.value = []
+  }
+})
+watch(() => props.file.fileName, (val)=> file.value.fileName = val)
+
+const handleAvatarSuccess: UploadProps['onSuccess'] = (
+  response,
+) => {
+  const res = response?.data
+  fileList.value = [{name:res.fileName+res.extension,url:res.linkUrl}]
+  file.value.fileUrl = res.fileDirectory +'/'+ res.fileGuid + res.extension
+  file.value.fileName = res.fileName+res.extension
+  emits('onUpload',file.value)
+}
+
+const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
+  if (rawFile.size / 1024 / 1024 > 10) {
+    ElMessage.error('文件超过10MB!')
+    return false
+  }
+  return true
+}
+
+onMounted(()=>{
+  if(file.value.fileUrl) fileList.value = [{name:file.value.fileName,url:file.value.fileUrl} as UploadUserFile]
+})
+
+
+
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 5 - 1
admin.ui.plus-master/src/stores/globalCacheStore.ts

@@ -14,7 +14,11 @@ const arr =
     'componentTypeListStatus',
     'productionLogListStatus',
     'groupLogoKeyKeyType',
-    'groupKeyGroupStatus']
+    'groupKeyGroupStatus',
+    'softwareType',
+    'equipmentType',
+    'softwarePackageStatus'
+  ]
 
 export const useGlobalCacheStore = defineStore('globalCacheStore', {
   state: () => ({

+ 0 - 0
admin.ui.plus-master/src/views/admin/authorize/README.md → admin.ui.plus-master/src/views/admin/authorize/fuelingsdk/README.md


+ 3 - 3
admin.ui.plus-master/src/views/admin/authorize/components/form-edit.vue → admin.ui.plus-master/src/views/admin/authorize/fuelingsdk/components/form-edit.vue

@@ -69,9 +69,9 @@
 
 <script setup lang="ts">
 import {reactive, ref, watch} from "vue";
-import {oilSdkTableModel} from "/@/api/admin/deviceAuthorization/oilSdkAuthorDto";
-import {OilSdkAuthorAPI} from "/@/api/admin/deviceAuthorization/oilSdkAuthor";
-import eventBus from "/@/utils/mitt";
+import {oilSdkTableModel} from "/src/api/admin/deviceAuthorization/oilSdkAuthorDto";
+import {OilSdkAuthorAPI} from "/src/api/admin/deviceAuthorization/oilSdkAuthor";
+import eventBus from "/src/utils/mitt";
 import {FormRules} from "element-plus";
 
 enum Form {

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

@@ -1,4 +1,3 @@
-<!--部件电子档案-->
 <template>
   <div class="layout-pd" >
     <el-row>
@@ -110,9 +109,10 @@ import type {pageInput} from "/@/api/admin/shareDto/shareDto";
 import eventBus from "/@/utils/mitt";
 
 /**引入组件*/
-const EditDialog = defineAsyncComponent(() => import('./components/form-edit.vue'))
+const EditDialog = defineAsyncComponent(() => import('/src/views/admin/authorize/fuelingsdk/components/form-edit.vue'))
 
 const editDialogRef = ref()
+
 /**sdk授权页面对象 */
 const sdkData = reactive({
   time:'',

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

@@ -0,0 +1,181 @@
+<template>
+  <div class="admin-authorize-editInfo">
+    <el-dialog :title="formData.titleText" v-model="formData.isShowDialog" draggable width="769px">
+      <el-form :model="formData.editData"
+               :rules="rules"
+               ref="formRef"
+               v-loading="formData.loading"
+               size="default"
+               label-width="80px">
+        <el-row :gutter="35">
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+            <el-form-item label="软件类型" prop="softwareType">
+              <el-select  v-model="formData.editData.softwareType" placeholder="请选择软件类型" >
+                <el-option v-for="(value, key) in softwareType" :key="key" :label="value[1].name"  :value="Number(value[1].value)" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+            <el-form-item label="设备类型" prop="equipmentType">
+              <el-select  v-model="formData.editData.equipmentType" placeholder="请选择设备类型" >
+                <el-option v-for="(value, key) in equipmentType" :key="key" :label="value[1].name"  :value="Number(value[1].value)" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+            <el-form-item label="软件包名" prop="softwareName">
+              <el-input v-model="formData.editData.softwareName" placeholder="请输入软件包名" clearable></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+            <el-form-item label="版本" prop="version">
+              <el-input v-model="formData.editData.version" placeholder="请输入版本" clearable></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+            <el-form-item label="说明" prop="explain">
+              <el-input v-model="formData.editData.explain" placeholder="请输入说明" rows="6" clearable type="textarea"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+            <el-form-item label="备注" prop="remark">
+              <el-input v-model="formData.editData.remark" placeholder="请输入备注" rows="6" clearable type="textarea"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <MyUploadFile  :file="{fileUrl:formData.editData.downloadUrl,fileName:formData.editData.fileName}"  @onUpload="onUpload"/>
+      </el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="onCancel" icon="ele-CircleClose" size="default">取 消</el-button>
+          <el-button type="primary" :icon="formData.editIcon" @click="onSubmit" size="default">{{formData.buttonText}}</el-button>
+        </span>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup lang="ts">
+import {defineAsyncComponent, reactive, ref, watch} from "vue";
+import {FormRules} from "element-plus";
+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";
+
+const MyUploadFile = defineAsyncComponent(() => import('/@/components/my-upload-file/index.vue'))
+
+/**获取全局缓存*/
+const globalCacheStore = useGlobalCacheStore()
+/**设备类型缓存*/
+const equipmentType = ref(globalCacheStore.getGlobalStore().get('equipmentType'))
+/**软件类型缓存*/
+const softwareType = ref(globalCacheStore.getGlobalStore().get('softwareType'))
+
+enum Form {
+  ADD,
+  UPDATE
+}
+
+
+/**数据对象 */
+const formData = reactive({
+  loading: false,
+  formType: Form,
+  titleText:'',
+  editIcon:'',
+  buttonText:'',
+  isShowDialog: false,
+  editData:{} as softwarePackageManagement_TableData,
+})
+
+
+/**表单校验*/
+const rules = reactive<FormRules>({
+  softwareType: [
+    { required: true, message: '请选择软件类型', trigger: 'blur' },
+  ],
+  equipmentType: [
+    { required: true, message: '请选择设备类型', trigger: 'blur' },
+  ],
+  softwareName: [
+    { required: true, message: '请输入软件包名', trigger: 'blur' },
+  ],
+  version: [
+    { required: true, message: '请输入版本号', trigger: 'blur' },
+  ],
+})
+
+/**
+ * 表单对象
+ */
+const formRef = ref()
+
+const openDialog = (val) => {
+  if(val){
+    formData.editData = JSON.parse(JSON.stringify(val))
+    formData.titleText = '更新软件包'
+    formData.buttonText = '更新'
+    //更新操作
+    formData.formType = Form.UPDATE
+    formData.editIcon = 'ele-Refresh'
+  }else {
+    formData.editData = {} as softwarePackageManagement_TableData
+    formData.titleText = '添加软件包'
+    formData.buttonText = '添加'
+    //添加操作
+    formData.formType = Form.ADD
+    formData.editIcon = 'ele-CirclePlus'
+  }
+  formData.isShowDialog = true
+  formData.isShowDialog = true
+}
+
+const onCancel = () => {
+  formData.editData = {} as softwarePackageManagement_TableData
+  formData.isShowDialog = false
+}
+
+/***监听弹窗关   闭表单验证*/
+watch(() => formData.isShowDialog,(newVal) => {
+  if(newVal) formRef.value?.resetFields()
+})
+
+const onUpload = (val) => {
+  formData.editData.downloadUrl = val.fileUrl
+  formData.editData.fileName = val.fileName
+}
+
+const onSubmit =  () => {
+  formRef.value.validate(async (valid: boolean) =>{
+    if(!valid) return
+
+    formData.loading = true
+    let res = {} as any
+    console.log(formData.editData)
+    if(formData.formType === Form.UPDATE){
+      res = await new SoftwarePackageManagementApi().updateData(formData.editData)
+    }else if(formData.formType === Form.ADD){
+      res = await new SoftwarePackageManagementApi().updateData(formData.editData)
+    }else {
+      formData.loading = false
+      return
+    }
+
+    if(res?.success){
+      eventBus.emit('refreshView')
+      formData.isShowDialog = false
+      formData.editData = {} as softwarePackageManagement_TableData
+    }
+
+    formData.loading = false
+  })
+}
+
+defineExpose({
+  openDialog,
+})
+</script>
+<style scoped lang="scss">
+
+</style>

+ 357 - 0
admin.ui.plus-master/src/views/admin/authorize/softwarePackageManagement/index.vue

@@ -0,0 +1,357 @@
+<template>
+  <div class="layout-pd">
+    <el-row>
+      <!--操作-->
+      <el-col :xs="24" >
+        <el-card class="mt8"  shadow="hover" >
+          <el-form :model="softwareData.Filter" :inline="true" @submit.stop.prevent>
+            <el-form-item prop="name" style="width: 100%">
+              <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
+                <el-form-item label="软件类型">
+                  <el-select  v-model="softwareData.Filter.softwareType" placeholder="请选择软件类型" >
+                    <el-option v-for="(value, key) in softwareType" :key="key" :label="value[1].name"  :value="Number(value[1].value)" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
+                <el-form-item label="软件名称">
+                  <el-input v-model="softwareData.Filter.softwareName" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
+                <el-form-item label="版本">
+                  <el-input v-model="softwareData.Filter.version" placeholder="单行输入" clearable></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
+                <el-form-item label="设备类型">
+                  <el-select  v-model="softwareData.Filter.equipmentType" placeholder="请选择设备类型" >
+                    <el-option v-for="(value, key) in equipmentType" :key="key" :label="value[1].name"  :value="Number(value[1].value)" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
+                <el-form-item label="选择时间">
+                  <el-date-picker
+                    v-model="softwareData.time"
+                    type="datetimerange"
+                    value-format="YYYY-MM-DD HH:mm:ss"
+                    range-separator="To"
+                    start-placeholder="Start date"
+                    end-placeholder="End date"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
+                <el-form-item>
+                </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-Search" @click="onQuery"> 查询 </el-button>
+                  <el-button type="primary" icon="ele-RefreshRight" @click="onReset"> 重置 </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>
+        </el-card>
+      </el-col>
+      <!--表格-->
+      <el-col  :xs="24" >
+        <el-card style="height: 70vh" class="my-fill mt8" shadow="hover">
+          <el-table v-loading="softwareData.loading" stripe :data="softwareData.tableModel" row-key="id" style="width: 100%">
+            <el-table-column v-for="column in softwareData.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label"  >
+              <template #default="{ row }">
+                <span :style="getColor(column.prop,row)">
+                  {{getProp(column.prop,row)}}
+                </span>
+              </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"
+                  v-if="row.state === 0"
+                  type="primary"
+                  icon="ele-Upload"
+                  size="small"
+                  @click="onRelease(row)"
+                  :underline="false"
+                  target="_blank"
+                >发布</el-link>
+                <el-link
+                  class="my-el-link mr12 ml12"
+                  v-if="row.state === 0"
+                  type="primary"
+                  icon="ele-Edit"
+                  size="small"
+                  @click="editTableData(row)"
+                  :underline="false"
+                  target="_blank"
+                >编辑</el-link>
+                <el-link
+                  class="my-el-link mr12 ml12"
+                  v-if="row.state === 1"
+                  type="primary"
+                  icon="ele-Download"
+                  size="small"
+                  @click="onDownload(row)"
+                  :underline="false"
+                  target="_blank"
+                >下载</el-link>
+                <el-link
+                  class="my-el-link mr12 ml12"
+                  v-if="row.state === 1"
+                  type="primary"
+                  icon="ele-WarningFilled"
+                  size="small"
+                  @click="onFailure(row)"
+                  :underline="false"
+                  target="_blank"
+                >失效</el-link>
+                <el-link
+                  class="my-el-link mr12 ml12"
+                  v-if="row.state !== 0"
+                  type="primary"
+                  icon="ele-Tickets"
+                  size="small"
+                  @click="onDownloadRecord(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="softwareData.pageInput.CurrentPage"
+              v-model:page-size="softwareData.pageInput.PageSize"
+              :total="softwareData.total"
+              :page-sizes="[10, 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>
+    <EditDialog ref="editDialogRef" />
+  </div>
+</template>
+
+<script setup lang="ts">
+
+import {defineAsyncComponent, onBeforeMount, onMounted, reactive, ref, watch} from "vue";
+import {useGlobalCacheStore} from "/@/stores/globalCacheStore";
+import {
+  softwarePackageManagement_AllDto,
+  softwarePackageManagement_SearchFilter,
+  softwarePackageManagement_TableData
+} from "/@/api/admin/deviceAuthorization/softwarePackageManagementDto";
+import type {pageInput} from "/@/api/admin/shareDto/shareDto";
+import eventBus from "/@/utils/mitt";
+import {SoftwarePackageManagementApi} from "/@/api/admin/deviceAuthorization/softwarePackageManagementApi";
+/**引入组件*/
+const EditDialog = defineAsyncComponent(() => import('./components/form-edit.vue'))
+// import {pageInput} from "/@/api/admin/shareDto/shareDto";
+const editDialogRef = ref()
+
+/**获取全局缓存*/
+const globalCacheStore = useGlobalCacheStore()
+/**设备类型缓存*/
+const equipmentType = ref(globalCacheStore.getGlobalStore().get('equipmentType'))
+/**软件类型缓存*/
+const softwareType = ref(globalCacheStore.getGlobalStore().get('softwareType'))
+/**软件包状态缓存*/
+const softwarePackageStatus = ref(globalCacheStore.getGlobalStore().get('softwarePackageStatus'))
+
+/**软件包管理对象*/
+const softwareData = reactive({
+  time:'',
+  /**加载显示 */
+  loading: false,
+  /**条件查询模块 */
+  Filter: {
+    /**软件类型 */
+    softwareType: "",
+    /**软件名称 */
+    softwareName: "",
+    /**版本 */
+    version: "",
+    /**设备类型*/
+    equipmentType: "",
+    /**开始的时间 */
+    BeginTime: null,
+    /**开始的时间 */
+    EndTime: null,
+  } as softwarePackageManagement_SearchFilter,
+  /**表格信息 */
+  tableModel: [] as softwarePackageManagement_TableData,
+  /**动态表头 */
+  dynamicColumns: [
+    { prop: 'date', label: '日期' },
+    { prop: 'softwareType', label: '软件类型' },
+    { prop: 'equipmentType', label: '设备类型' },
+    { prop: 'softwareName', label: '软件名称' },
+    { prop: 'version', label: '版本号' },
+    { prop: 'explain', label: '说明' },
+    { prop: 'state', label: '状态' },
+    { prop: 'numberOfDownloads', label: '下载次数' },
+    { prop: 'remark', label: '备注' },
+    { prop: 'releaseTime', label: '发布日期' },
+    { prop: 'uploadTime', label: '上传日期' },
+  ],
+  /**分页标识 */
+  pageInput:{
+    CurrentPage: 1,
+    PageSize: 10,
+  } as pageInput,
+  /**分页总数 */
+  total: 0,
+} as softwarePackageManagement_AllDto)
+
+
+/**条件查询 */
+const onQuery = () => {
+  init()
+}
+
+/**将Filter对象成.的连接方式*/
+const flattenObject = (obj, parentKey = '') => {
+  const result = {};
+  for (const key in obj) {
+    if (obj.hasOwnProperty(key)) {
+      const newKey = parentKey ? `${parentKey}.${key}` : key;
+      if (typeof obj[key] === 'object' && !Array.isArray(obj[key])) {
+        const flattened = flattenObject(obj[key], newKey);
+        Object.assign(result, flattened);
+      } else {
+        result[newKey] = obj[key];
+      }
+    }
+  }
+
+  return result;
+}
+
+/**初始化 */
+const init = async () => {
+  softwareData.loading = true
+  const query = flattenObject({ Filter: softwareData.Filter})
+  const res:any = await new SoftwarePackageManagementApi().getPageData({...softwareData.pageInput, ...query})
+  softwareData.tableModel = res?.data?.list ?? []
+  softwareData.total = res?.data?.total ?? 0
+  softwareData.loading = false
+}
+
+onMounted(() => {
+  init()
+  eventBus.off('refreshView')
+  eventBus.on('refreshView', async () => {
+    await init()
+  })
+  console.log()
+})
+
+onBeforeMount(() => {
+  eventBus.off('refreshView')
+})
+
+/**
+ * 监听时间变换
+ */
+watch(() => softwareData.time, (newVal ) => {
+  if(newVal.length === 0){
+    return
+  }
+  softwareData.Filter.BeginTime = newVal?.[0].toString()
+  softwareData.Filter.EndTime = newVal?.[1].toString()
+})
+
+/**重置查询条件 */
+const resetQuery = () => {
+  softwareData.Filter.softwareType = ''
+  softwareData.Filter.softwareName = ''
+  softwareData.Filter.version = ''
+  softwareData.Filter.equipmentType = ''
+  softwareData.Filter.BeginTime =  ''
+  softwareData.Filter.EndTime = ''
+  softwareData.time = ''
+  softwareData.pageInput.CurrentPage = 1
+}
+
+/**重置 */
+const onReset = () => {
+  resetQuery()
+  init()
+}
+
+/**添加*/
+const onAdd = () => {
+  editDialogRef.value.openDialog()
+}
+
+/**编辑弹窗 */
+const editTableData = (row) => {
+  editDialogRef.value.openDialog(row)
+}
+
+/**发布*/
+const onRelease = (row) => {
+  alert('发布')
+}
+
+/**下载*/
+const onDownload = (row) => {
+  alert('下载')
+}
+
+/**失效*/
+const onFailure = (row) => {
+  alert('失效')
+}
+
+/**下载记录*/
+const onDownloadRecord = (row) => {
+  alert('下载记录')
+}
+
+/**页条数变化*/
+const onSizeChange = () => {
+  init()
+}
+
+/**页数变化*/
+const onCurrentChange = () =>{
+  init()
+}
+
+/**过滤数字的属性*/
+const getProp = (val,row) => {
+  if(val === 'softwareType') return softwareType.value.get(String(row[val])).name
+  if(val === 'equipmentType') return equipmentType.value.get(String(row[val])).name
+  if(val === 'state') return softwarePackageStatus.value.get(String(row[val])).name
+  return row[val]
+}
+
+const getColor = (val,row) => {
+  if(val === 'state') {
+    const code = softwarePackageStatus.value.get(String(row[val])).code.split('_')
+    return {color:code[1]}
+  }
+  return {}
+}
+
+</script>
+
+<style scoped lang="scss">
+.el-link{
+  padding: 5px;
+}
+</style>

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

@@ -230,7 +230,7 @@
         </el-card>
       </el-col>
 
-      <!--生命周期-->
+      <!--生产日志-->
       <el-col :xs="24">
         <el-card style="height: 40vh" class="mt8 my-fill" shadow="hover" header="生命周期">
           <el-table v-loading="lifeCycle.loading"  stripe :data="lifeCycle.list" row-key="id" style="width: 100%">