| | |
| | | fullScreen: true, |
| | | }, |
| | | { |
| | | name: 'agreementAuthorizationRecord', |
| | | path: '/userContent/contentCenter/agreementAuthorizationRecord', |
| | | title: '登录协议授权记录', |
| | | requiresAuth: true, |
| | | icon: 'icon-park-outline:file-text', |
| | | menuType: 'page', |
| | | componentPath: '/userContent/contentCenter/agreementAuthorizationRecord.vue', |
| | | id: 202642903, |
| | | keepAlive: false, |
| | | pid: 302, |
| | | fullScreen: true, |
| | | }, |
| | | { |
| | | name: 'opsAppContent', |
| | | path: '/userContent/contentCenter/opsApp', |
| | | title: '运维APP内容管理', |
| | |
| | | }) { |
| | | return request.Post<Service.ResponseResult<any>>('/maintenance/api/v1/vehicle-description/save', data) |
| | | } |
| | | |
| | | /** 登录协议授权记录 */ |
| | | export interface AgreementAuthorizationRecordPageParams { |
| | | agreementName?: string |
| | | authorizationIp?: string |
| | | authorizationTimeEnd?: string |
| | | authorizationTimeStart?: string |
| | | pageNum: number |
| | | pageSize: number |
| | | userAccount?: string |
| | | userName?: string |
| | | version?: string |
| | | } |
| | | |
| | | export interface AgreementAuthorizationRecordItem { |
| | | agreementAppUserId: number |
| | | agreementName: string |
| | | agreementType: number |
| | | authorizationIp: string |
| | | authorizationTime: string |
| | | createBy: string |
| | | createTime: string |
| | | deleted: boolean |
| | | id: number |
| | | updateBy: string |
| | | updateTime: string |
| | | userAccount: string |
| | | userName: string |
| | | version: string |
| | | } |
| | | |
| | | export function fetchAgreementAuthorizationRecordPageList(data: AgreementAuthorizationRecordPageParams) { |
| | | return request.Post<Service.ResponseResult<Service.PageData<AgreementAuthorizationRecordItem>>>('/operation/api/v1/mini-program/agreementAuthorizationRecord/pageList', data) |
| | | } |
| | | |
| | | export function exportAgreementAuthorizationRecord(data: AgreementAuthorizationRecordPageParams) { |
| | | const method = request.Post('/operation/api/v1/mini-program/agreementAuthorizationRecord/exportExcel', data, { responseType: 'blob' }) |
| | | method.meta = { ...method.meta, isBlob: true } |
| | | return method |
| | | } |
| New file |
| | |
| | | <script setup lang="tsx"> |
| | | import type { DataTableColumns, FormInst } from 'naive-ui' |
| | | import { NButton, NCard, NDataTable, NDatePicker, NForm, NFormItem, NGi, NInput, NTooltip } from 'naive-ui' |
| | | import dayjs from 'dayjs' |
| | | import { computed, onMounted, ref } from 'vue' |
| | | import Pagination from '@/components/common/Pagination.vue' |
| | | import SearchPanel from '@/components/custom/SearchPanel.vue' |
| | | import { useBoolean } from '@/hooks' |
| | | import { |
| | | exportAgreementAuthorizationRecord, |
| | | fetchAgreementAuthorizationRecordPageList, |
| | | } from '@/service/api/contentCenter' |
| | | import { downloadFile } from '@/utils' |
| | | import noDataImg from '@/assets/element-img/no-data.png' |
| | | |
| | | const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(false) |
| | | const message = window.$message |
| | | |
| | | const initialModel = { |
| | | agreementName: '', |
| | | userName: '', |
| | | userAccount: '', |
| | | version: '', |
| | | authorizationIp: '', |
| | | timeRange: null as [number, number] | null, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | } |
| | | |
| | | const model = ref({ ...initialModel }) |
| | | const formRef = ref<FormInst | null>(null) |
| | | const count = ref(0) |
| | | const listData = ref<any[]>([]) |
| | | |
| | | const filterItems = computed(() => [ |
| | | { |
| | | label: '协议标题', |
| | | path: 'agreementName', |
| | | render: () => <NInput v-model:value={model.value.agreementName} placeholder="请输入" />, |
| | | }, |
| | | { |
| | | label: '用户姓名', |
| | | path: 'userName', |
| | | render: () => <NInput v-model:value={model.value.userName} placeholder="请输入" />, |
| | | }, |
| | | { |
| | | label: '用户账号', |
| | | path: 'userAccount', |
| | | render: () => <NInput v-model:value={model.value.userAccount} placeholder="请输入" />, |
| | | }, |
| | | { |
| | | label: '协议版本号', |
| | | path: 'version', |
| | | render: () => <NInput v-model:value={model.value.version} placeholder="请输入" />, |
| | | }, |
| | | { |
| | | label: '授权IP', |
| | | path: 'authorizationIp', |
| | | render: () => <NInput v-model:value={model.value.authorizationIp} placeholder="请输入" />, |
| | | }, |
| | | { |
| | | label: '授权时间', |
| | | path: 'timeRange', |
| | | render: () => ( |
| | | <NDatePicker |
| | | v-model:value={model.value.timeRange} |
| | | type="datetimerange" |
| | | clearable |
| | | format="yyyy/MM/dd HH:mm:ss" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | ), |
| | | }, |
| | | ]) |
| | | |
| | | const columns = computed<DataTableColumns<any>>(() => [ |
| | | { |
| | | title: '序号', |
| | | key: 'index', |
| | | width: 80, |
| | | resizable: true, |
| | | render: (_row, index) => <span>{(model.value.pageNum - 1) * model.value.pageSize + index + 1}</span>, |
| | | }, |
| | | { |
| | | title: '协议标题', |
| | | key: 'agreementName', |
| | | minWidth: 260, |
| | | ellipsis: true, |
| | | resizable: true, |
| | | render: row => ( |
| | | <NTooltip trigger="hover" placement="top" max-width="500px"> |
| | | {{ |
| | | trigger: () => <span class="cursor-pointer">{row.agreementName || '-'}</span>, |
| | | default: () => row.agreementName || '-', |
| | | }} |
| | | </NTooltip> |
| | | ), |
| | | }, |
| | | { |
| | | title: '版本号', |
| | | key: 'version', |
| | | width: 120, |
| | | ellipsis: true, |
| | | resizable: true, |
| | | render: row => <span>{row.version || '-'}</span>, |
| | | }, |
| | | { |
| | | title: '用户姓名', |
| | | key: 'userName', |
| | | width: 140, |
| | | ellipsis: true, |
| | | resizable: true, |
| | | render: row => <span>{row.userName || '-'}</span>, |
| | | }, |
| | | { |
| | | title: '用户账号', |
| | | key: 'userAccount', |
| | | width: 160, |
| | | ellipsis: true, |
| | | resizable: true, |
| | | render: row => <span>{row.userAccount || '-'}</span>, |
| | | }, |
| | | { |
| | | title: '授权时间', |
| | | key: 'authorizationTime', |
| | | width: 180, |
| | | ellipsis: true, |
| | | resizable: true, |
| | | render: row => ( |
| | | <span> |
| | | {row.authorizationTime ? dayjs(row.authorizationTime).format('YYYY/MM/DD HH:mm') : '-'} |
| | | </span> |
| | | ), |
| | | }, |
| | | { |
| | | title: '授权IP', |
| | | key: 'authorizationIp', |
| | | width: 150, |
| | | ellipsis: true, |
| | | resizable: true, |
| | | render: row => <span>{row.authorizationIp || '-'}</span>, |
| | | }, |
| | | ]) |
| | | |
| | | function buildQueryParams() { |
| | | return { |
| | | agreementName: model.value.agreementName || undefined, |
| | | authorizationIp: model.value.authorizationIp || undefined, |
| | | authorizationTimeEnd: model.value.timeRange |
| | | ? dayjs(model.value.timeRange[1]).endOf('second').toISOString() |
| | | : undefined, |
| | | authorizationTimeStart: model.value.timeRange |
| | | ? dayjs(model.value.timeRange[0]).startOf('second').toISOString() |
| | | : undefined, |
| | | pageNum: model.value.pageNum, |
| | | pageSize: model.value.pageSize, |
| | | userAccount: model.value.userAccount || undefined, |
| | | userName: model.value.userName || undefined, |
| | | version: model.value.version || undefined, |
| | | } |
| | | } |
| | | |
| | | async function getList() { |
| | | startLoading() |
| | | try { |
| | | const res = await fetchAgreementAuthorizationRecordPageList(buildQueryParams()) |
| | | if (res.code === 200 && res.data) { |
| | | listData.value = res.data.records || [] |
| | | count.value = res.data.total || 0 |
| | | } |
| | | else { |
| | | listData.value = [] |
| | | count.value = 0 |
| | | } |
| | | } |
| | | finally { |
| | | endLoading() |
| | | } |
| | | } |
| | | |
| | | function handleSearch() { |
| | | model.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function handleResetSearch() { |
| | | model.value = { ...initialModel } |
| | | handleSearch() |
| | | } |
| | | |
| | | function changePage(page: number, pageSize: number) { |
| | | model.value.pageNum = page |
| | | model.value.pageSize = pageSize |
| | | getList() |
| | | } |
| | | |
| | | async function handleExport() { |
| | | const response = await exportAgreementAuthorizationRecord(buildQueryParams()) |
| | | if (response instanceof Blob) { |
| | | downloadFile(response, `登录协议授权记录_${dayjs().format('YYYYMMDDHHmmss')}.xlsx`) |
| | | message?.success('导出成功') |
| | | } |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="roboTaxi w-full h-full"> |
| | | <div class="roboTaxi-form-card mb-12px"> |
| | | <NForm ref="formRef" :model="model" label-placement="left" inline :show-feedback="false"> |
| | | <SearchPanel> |
| | | <NGi v-for="item in filterItems" :key="item.path"> |
| | | <NFormItem :label="item.label" :path="item.path"> |
| | | <component :is="item.render" /> |
| | | </NFormItem> |
| | | </NGi> |
| | | <template #action> |
| | | <NButton @click="handleResetSearch"> |
| | | {{ $t('common.reset') }} |
| | | </NButton> |
| | | <NButton type="primary" @click="handleSearch"> |
| | | {{ $t('common.search') }} |
| | | </NButton> |
| | | </template> |
| | | </SearchPanel> |
| | | </NForm> |
| | | </div> |
| | | |
| | | <NCard class="flex-1 robotaxi-table-card" content-style="display: flex; flex-direction: column; flex: 1; min-height: 0;"> |
| | | <template #header> |
| | | <n-flex justify="flex-end" align="center"> |
| | | <NButton @click="handleExport"> |
| | | 导出 |
| | | </NButton> |
| | | </n-flex> |
| | | </template> |
| | | <div class="flex-1 flex flex-col h-full"> |
| | | <NDataTable |
| | | class="flex-1" |
| | | :columns="columns" |
| | | :data="listData" |
| | | :loading="loading" |
| | | flex-height |
| | | :bordered="false" |
| | | :scroll-x="1100" |
| | | :header-height="18" |
| | | :row-height="18" |
| | | > |
| | | <template #empty> |
| | | <div class="flex-center"> |
| | | <img :src="noDataImg" style="width:123px;height:125px" @error="(e: any) => { e.target.src = 'https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/9bed493b-a6aa-4ef6-ac10-7f67f5c6adc5.png' }"> |
| | | </div> |
| | | </template> |
| | | </NDataTable> |
| | | <Pagination :count="count" :page="model.pageNum" :page-size="model.pageSize" class="robotaxi-pagination mt-12px" @change="changePage" /> |
| | | </div> |
| | | </NCard> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | operation/api/v1/mini-program/agreementAuthorizationRecord/pageList 列表 post json |
| | | { |
| | | "agreementName": "string", 协议名称 |
| | | "authorizationIp": "string", 授权IP |
| | | "authorizationTimeEnd": "2026-06-15T02:55:29.046Z", 授权结束时间 |
| | | "authorizationTimeStart": "2026-06-15T02:55:29.046Z", 授权开始时间 |
| | | "pageNum": 0, |
| | | "pageSize": 0, |
| | | "userAccount": "string", 用户账号 |
| | | "userName": "string", 用户姓名 |
| | | "version": "string" 版本号 |
| | | } |
| | | |
| | | |
| | | { |
| | | "code": 0, |
| | | "data": { |
| | | "current": 0, |
| | | "hasNextPage": true, |
| | | "hasPrevPage": true, |
| | | "pages": 0, |
| | | "records": [ |
| | | { |
| | | "agreementAppUserId": 0, |
| | | "agreementName": "string", |
| | | "agreementType": 0, |
| | | "authorizationIp": "string", |
| | | "authorizationTime": "2026-06-15T02:55:29.074Z", |
| | | "createBy": "string", |
| | | "createTime": "2026-06-15T02:55:29.074Z", |
| | | "deleted": true, |
| | | "id": 0, |
| | | "updateBy": "string", |
| | | "updateTime": "2026-06-15T02:55:29.074Z", |
| | | "userAccount": "string", |
| | | "userName": "string", |
| | | "version": "string" |
| | | } |
| | | ], |
| | | "size": 0, |
| | | "startIndex": 0, |
| | | "total": 0 |
| | | }, |
| | | "msg": "string" |
| | | } |
| | | |
| | | |
| | | operation/api/v1/mini-program/agreementAuthorizationRecord/exportExcel 导出 post json |
| | | { |
| | | "agreementName": "string", 协议名称 |
| | | "authorizationIp": "string", 授权IP |
| | | "authorizationTimeEnd": "2026-06-15T02:55:29.046Z", 授权结束时间 |
| | | "authorizationTimeStart": "2026-06-15T02:55:29.046Z", 授权开始时间 |
| | | "pageNum": 0, |
| | | "pageSize": 0, |
| | | "userAccount": "string", 用户账号 |
| | | "userName": "string", 用户姓名 |
| | | "version": "string" 版本号 |
| | | } |
| | | |