|
@@ -27,7 +27,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4" class="mb20">
|
|
|
- <el-form-item label="有效时间">
|
|
|
+ <el-form-item label="失效时间">
|
|
|
<el-date-picker
|
|
|
v-model="sdkData.time"
|
|
|
type="datetimerange"
|
|
@@ -50,10 +50,9 @@
|
|
|
</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-CirclePlus" @click="onAdd"> 添加 </el-button>
|
|
|
+ <el-button type="primary" icon="ele-Tickets" @click="onAuditRecord()"> 审核 </el-button>
|
|
|
<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>
|
|
|
</div>
|
|
@@ -62,8 +61,14 @@
|
|
|
<!--表格-->
|
|
|
<el-col :xs="24" >
|
|
|
<el-card style="height: 70vh" class="my-fill mt8" shadow="hover">
|
|
|
- <el-table v-loading="sdkData.loading" stripe :data="sdkData.tableModel" row-key="id" style="width: 100%">
|
|
|
- <el-table-column v-for="column in sdkData.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label" />
|
|
|
+ <el-table ref="multipleTableRef"
|
|
|
+ v-loading="sdkData.loading"
|
|
|
+ stripe :data="sdkData.tableModel"
|
|
|
+ row-key="id"
|
|
|
+ style="width: 100%"
|
|
|
+ @row-click="onOilSdkRowClick" >
|
|
|
+ <el-table-column type="selection" width="50"></el-table-column>
|
|
|
+ <el-table-column v-for="column in sdkData.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label" show-overflow-tooltip />
|
|
|
<el-table-column label="操作" fixed="right" header-align="center" align="center" class="right-operation" width="100">
|
|
|
<template #default="{ row }">
|
|
|
<el-link
|
|
@@ -75,7 +80,7 @@
|
|
|
:underline="false"
|
|
|
target="_blank"
|
|
|
>编辑</el-link>
|
|
|
- <el-link
|
|
|
+ <!-- <el-link
|
|
|
class="my-el-link mr12 ml12"
|
|
|
v-if="showAudit(row)"
|
|
|
type="primary"
|
|
@@ -84,7 +89,7 @@
|
|
|
@click="onAuditRecord(row)"
|
|
|
:underline="false"
|
|
|
target="_blank"
|
|
|
- >审核</el-link>
|
|
|
+ >审核</el-link> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -105,22 +110,29 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<EditDialog ref="editDialogRef" />
|
|
|
+ <AuditDialog ref="auditDialogRef" />
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="authorize/fuelingsdk">
|
|
|
-import {defineAsyncComponent, onMounted, reactive, ref, watch, onBeforeMount} from "vue";
|
|
|
-import {OilSdkAuthorDto, oilSdkFilterModel, oilSdkTableModel} from "/@/api/admin/deviceAuthorization/oilSdkAuthorDto";
|
|
|
+import {defineAsyncComponent, onMounted, reactive, ref, watch, onBeforeMount,getCurrentInstance} from "vue";
|
|
|
+import {OilSdkAuthorDto, oilSdkFilterModel, oilSdkTableModel,oilSdkAuthorPageOutput,FueilingSdkAuthInput} from "/@/api/admin/deviceAuthorization/oilSdkAuthorDto";
|
|
|
import {OilSdkAuthorAPI} from "/@/api/admin/deviceAuthorization/oilSdkAuthor";
|
|
|
import type {pageInput} from "/@/api/admin/shareDto/shareDto";
|
|
|
import eventBus from "/@/utils/mitt";
|
|
|
import * as ExcelJS from 'exceljs';
|
|
|
import * as FileSaver from 'file-saver';
|
|
|
+import { ElTable } from 'element-plus'
|
|
|
/**引入组件*/
|
|
|
const EditDialog = defineAsyncComponent(() => import('/src/views/admin/authorize/fuelingsdk/components/form-edit.vue'))
|
|
|
+const AuditDialog = defineAsyncComponent(() => import('/src/views/admin/authorize/fuelingsdk/components/form-audit.vue'))
|
|
|
|
|
|
const editDialogRef = ref()
|
|
|
+const auditDialogRef = ref()
|
|
|
+
|
|
|
+const multipleTableRef=ref<InstanceType<typeof ElTable>>()
|
|
|
+const { proxy } = getCurrentInstance() as any
|
|
|
|
|
|
/**sdk授权页面对象 */
|
|
|
const sdkData = reactive({
|
|
@@ -151,7 +163,7 @@ const sdkData = reactive({
|
|
|
{ prop: 'projectName', label: '项目名称' },
|
|
|
{ prop: 'sn', label: '设备SN号' },
|
|
|
{ prop: 'key', label: '授权码' },
|
|
|
- { prop: 'expiedTime', label: '有效时间' },
|
|
|
+ { prop: 'expiedTime', label: '失效时间' },
|
|
|
{ prop: 'state', label: '状态' },
|
|
|
{ prop: 'remark', label: '备注' },
|
|
|
],
|
|
@@ -329,15 +341,23 @@ const editTableData = (row) => {
|
|
|
editDialogRef.value.openDialog(row)
|
|
|
}
|
|
|
/**审核弹窗 */
|
|
|
-const onAuditRecord=(row)=>{
|
|
|
- console.log(row.key)
|
|
|
-}
|
|
|
-/**授权码为空时显示审核按钮 */
|
|
|
-const showAudit=(row):boolean=>{
|
|
|
- if(row.key){
|
|
|
- return false
|
|
|
+const onAuditRecord=()=>{
|
|
|
+ const selectionRows = multipleTableRef.value!.getSelectionRows() as FueilingSdkAuthInput
|
|
|
+ //console.log(selectionRows)
|
|
|
+
|
|
|
+ if (!((selectionRows.length as number) > 0)) {
|
|
|
+ proxy.$modal.msgWarning('请选择要审核的数据')
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ auditDialogRef.value.openDialog(selectionRows)
|
|
|
}
|
|
|
- return true
|
|
|
+
|
|
|
+}
|
|
|
+const onOilSdkRowClick=(row: FueilingSdkAuthInput)=> {
|
|
|
+ // TODO: improvement typing when refactor table
|
|
|
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
+ // @ts-expect-error
|
|
|
+ multipleTableRef.value!.toggleRowSelection(row, undefined)
|
|
|
}
|
|
|
</script>
|
|
|
|