diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts
new file mode 100644
index 0000000..3fe9a62
--- /dev/null
+++ b/src/utils/exportUtils.ts
@@ -0,0 +1,20 @@
+/**
+ * 导出文件工具
+ * @param blob 文件
+ * @param fileName 导出文件名
+ */
+export function exportFile(blob: Blob, fileName: string) {
+ if (window.navigator && (window.navigator as any).msSaveOrOpenBlob) {
+ (navigator as any).msSaveBlob(blob, fileName)
+ }
+ else {
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob) // 创建下载的链接
+ downloadElement.href = href
+ downloadElement.download = fileName
+ document.body.appendChild(downloadElement)
+ downloadElement.click() // 点击下载
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放blob对象
+ }
+}
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts
new file mode 100644
index 0000000..3fe9a62
--- /dev/null
+++ b/src/utils/exportUtils.ts
@@ -0,0 +1,20 @@
+/**
+ * 导出文件工具
+ * @param blob 文件
+ * @param fileName 导出文件名
+ */
+export function exportFile(blob: Blob, fileName: string) {
+ if (window.navigator && (window.navigator as any).msSaveOrOpenBlob) {
+ (navigator as any).msSaveBlob(blob, fileName)
+ }
+ else {
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob) // 创建下载的链接
+ downloadElement.href = href
+ downloadElement.download = fileName
+ document.body.appendChild(downloadElement)
+ downloadElement.click() // 点击下载
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放blob对象
+ }
+}
diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts
new file mode 100644
index 0000000..e532b1a
--- /dev/null
+++ b/src/utils/exportXlsx.ts
@@ -0,0 +1,90 @@
+import * as XLSX from 'xlsx'
+console.log(XLSX)
+
+/*
+ * @description:
+ * @param {Object} json 服务端发过来的数据
+ * @param {String} name 导出Excel文件名字
+ * @param {String} titleArr 导出Excel表头
+ * @param {String} sheetName 导出sheetName名字
+ * @return:
+ */
+export interface excelType {
+ json: object
+ name: string
+ titleArr: string[]
+ sheetName: string
+}
+export function exportExcel(params: excelType) {
+ /* convert state to workbook */
+ const data = []
+ const keyArray = []
+ const getLength = function (obj: object) {
+ let count = 0
+ for (const i in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, i)) {
+ // if (obj.hasOwnProperty(i)) {
+ count++
+ }
+ }
+ return count
+ }
+ for (const key1 in params.json) {
+ if (Object.prototype.hasOwnProperty.call(params.json, key1)) {
+ const element = (params.json as { [key: string]: object })[key1]
+ const rowDataArray = []
+ for (const key2 in element) {
+ if (Object.prototype.hasOwnProperty.call(element, key2)) {
+ const element2 = (element as { [key: string]: object })[key2]
+ rowDataArray.push(element2)
+ if (keyArray.length < getLength(element)) {
+ keyArray.push(key2)
+ }
+ console.log(keyArray, 'keyArray')
+ }
+ }
+ data.push(rowDataArray)
+ }
+ }
+ // keyArray为英文字段表头
+ data.splice(0, 0, keyArray as any, params.titleArr as any)
+ console.log('data', data)
+ const ws = XLSX.utils.aoa_to_sheet(data)
+ const wb = XLSX.utils.book_new()
+ // 此处隐藏英文字段表头
+ const wsrows = [{ hidden: true }]
+ /* 设置worksheet每列的最大宽度 */
+ const colWidth = data.map(row => row.map((val) => {
+ /* 先判断是否为null/undefined */
+ if (val == null) {
+ return {
+ wch: 10,
+ }
+ }
+ /* 再判断是否为中文 */
+ else if (val.toString().charCodeAt(0) > 255) {
+ return {
+ wch: val.toString().length * 2,
+ }
+ }
+ else {
+ return {
+ wch: val.toString().length,
+ }
+ }
+ }))
+ /* 以第一行为初始值 */
+ const result = colWidth[0]
+ for (let i = 1; i < colWidth.length; i++) {
+ for (let j = 0; j < colWidth[i].length; j++) {
+ if (result[j].wch < colWidth[i][j].wch) {
+ result[j].wch = colWidth[i][j].wch
+ }
+ }
+ }
+ ws['!cols'] = result
+ ws['!rows'] = wsrows // ws - worksheet
+ XLSX.utils.book_append_sheet(wb, ws, params.sheetName)
+ /* generate file and send to client */
+ XLSX.writeFile(wb, `${params.name}.xlsx`)
+}
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts
new file mode 100644
index 0000000..3fe9a62
--- /dev/null
+++ b/src/utils/exportUtils.ts
@@ -0,0 +1,20 @@
+/**
+ * 导出文件工具
+ * @param blob 文件
+ * @param fileName 导出文件名
+ */
+export function exportFile(blob: Blob, fileName: string) {
+ if (window.navigator && (window.navigator as any).msSaveOrOpenBlob) {
+ (navigator as any).msSaveBlob(blob, fileName)
+ }
+ else {
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob) // 创建下载的链接
+ downloadElement.href = href
+ downloadElement.download = fileName
+ document.body.appendChild(downloadElement)
+ downloadElement.click() // 点击下载
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放blob对象
+ }
+}
diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts
new file mode 100644
index 0000000..e532b1a
--- /dev/null
+++ b/src/utils/exportXlsx.ts
@@ -0,0 +1,90 @@
+import * as XLSX from 'xlsx'
+console.log(XLSX)
+
+/*
+ * @description:
+ * @param {Object} json 服务端发过来的数据
+ * @param {String} name 导出Excel文件名字
+ * @param {String} titleArr 导出Excel表头
+ * @param {String} sheetName 导出sheetName名字
+ * @return:
+ */
+export interface excelType {
+ json: object
+ name: string
+ titleArr: string[]
+ sheetName: string
+}
+export function exportExcel(params: excelType) {
+ /* convert state to workbook */
+ const data = []
+ const keyArray = []
+ const getLength = function (obj: object) {
+ let count = 0
+ for (const i in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, i)) {
+ // if (obj.hasOwnProperty(i)) {
+ count++
+ }
+ }
+ return count
+ }
+ for (const key1 in params.json) {
+ if (Object.prototype.hasOwnProperty.call(params.json, key1)) {
+ const element = (params.json as { [key: string]: object })[key1]
+ const rowDataArray = []
+ for (const key2 in element) {
+ if (Object.prototype.hasOwnProperty.call(element, key2)) {
+ const element2 = (element as { [key: string]: object })[key2]
+ rowDataArray.push(element2)
+ if (keyArray.length < getLength(element)) {
+ keyArray.push(key2)
+ }
+ console.log(keyArray, 'keyArray')
+ }
+ }
+ data.push(rowDataArray)
+ }
+ }
+ // keyArray为英文字段表头
+ data.splice(0, 0, keyArray as any, params.titleArr as any)
+ console.log('data', data)
+ const ws = XLSX.utils.aoa_to_sheet(data)
+ const wb = XLSX.utils.book_new()
+ // 此处隐藏英文字段表头
+ const wsrows = [{ hidden: true }]
+ /* 设置worksheet每列的最大宽度 */
+ const colWidth = data.map(row => row.map((val) => {
+ /* 先判断是否为null/undefined */
+ if (val == null) {
+ return {
+ wch: 10,
+ }
+ }
+ /* 再判断是否为中文 */
+ else if (val.toString().charCodeAt(0) > 255) {
+ return {
+ wch: val.toString().length * 2,
+ }
+ }
+ else {
+ return {
+ wch: val.toString().length,
+ }
+ }
+ }))
+ /* 以第一行为初始值 */
+ const result = colWidth[0]
+ for (let i = 1; i < colWidth.length; i++) {
+ for (let j = 0; j < colWidth[i].length; j++) {
+ if (result[j].wch < colWidth[i][j].wch) {
+ result[j].wch = colWidth[i][j].wch
+ }
+ }
+ }
+ ws['!cols'] = result
+ ws['!rows'] = wsrows // ws - worksheet
+ XLSX.utils.book_append_sheet(wb, ws, params.sheetName)
+ /* generate file and send to client */
+ XLSX.writeFile(wb, `${params.name}.xlsx`)
+}
diff --git a/src/views/login.vue b/src/views/login.vue
index 6e2b685..17dbad3 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -28,13 +28,17 @@
const redirect = ref(route.query.redirect?.toString() ?? '/')
// 是否需要验证码
const showKaptcha = ref(false)
+// 公钥
const publicKey = ref('')
+// sid
+const sid = ref('')
// 获取系统基础配置: 公钥,是否开启验证码
function getBaseConfig() {
userStore.getBaseConfig().then((res) => {
showKaptcha.value = res.kaptcha
publicKey.value = res.publicKey
+ sid.value = res.sid
ElMessage({
message: '连接服务器成功',
type: 'success',
@@ -68,6 +72,7 @@
loading.value = true
// 表单对象
const finalForm = {
+ sid: sid.value,
username: loginForm.value.username,
password: '',
kaptcha: loginForm.value.kaptcha,
@@ -248,7 +253,7 @@
-
+
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts
new file mode 100644
index 0000000..3fe9a62
--- /dev/null
+++ b/src/utils/exportUtils.ts
@@ -0,0 +1,20 @@
+/**
+ * 导出文件工具
+ * @param blob 文件
+ * @param fileName 导出文件名
+ */
+export function exportFile(blob: Blob, fileName: string) {
+ if (window.navigator && (window.navigator as any).msSaveOrOpenBlob) {
+ (navigator as any).msSaveBlob(blob, fileName)
+ }
+ else {
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob) // 创建下载的链接
+ downloadElement.href = href
+ downloadElement.download = fileName
+ document.body.appendChild(downloadElement)
+ downloadElement.click() // 点击下载
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放blob对象
+ }
+}
diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts
new file mode 100644
index 0000000..e532b1a
--- /dev/null
+++ b/src/utils/exportXlsx.ts
@@ -0,0 +1,90 @@
+import * as XLSX from 'xlsx'
+console.log(XLSX)
+
+/*
+ * @description:
+ * @param {Object} json 服务端发过来的数据
+ * @param {String} name 导出Excel文件名字
+ * @param {String} titleArr 导出Excel表头
+ * @param {String} sheetName 导出sheetName名字
+ * @return:
+ */
+export interface excelType {
+ json: object
+ name: string
+ titleArr: string[]
+ sheetName: string
+}
+export function exportExcel(params: excelType) {
+ /* convert state to workbook */
+ const data = []
+ const keyArray = []
+ const getLength = function (obj: object) {
+ let count = 0
+ for (const i in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, i)) {
+ // if (obj.hasOwnProperty(i)) {
+ count++
+ }
+ }
+ return count
+ }
+ for (const key1 in params.json) {
+ if (Object.prototype.hasOwnProperty.call(params.json, key1)) {
+ const element = (params.json as { [key: string]: object })[key1]
+ const rowDataArray = []
+ for (const key2 in element) {
+ if (Object.prototype.hasOwnProperty.call(element, key2)) {
+ const element2 = (element as { [key: string]: object })[key2]
+ rowDataArray.push(element2)
+ if (keyArray.length < getLength(element)) {
+ keyArray.push(key2)
+ }
+ console.log(keyArray, 'keyArray')
+ }
+ }
+ data.push(rowDataArray)
+ }
+ }
+ // keyArray为英文字段表头
+ data.splice(0, 0, keyArray as any, params.titleArr as any)
+ console.log('data', data)
+ const ws = XLSX.utils.aoa_to_sheet(data)
+ const wb = XLSX.utils.book_new()
+ // 此处隐藏英文字段表头
+ const wsrows = [{ hidden: true }]
+ /* 设置worksheet每列的最大宽度 */
+ const colWidth = data.map(row => row.map((val) => {
+ /* 先判断是否为null/undefined */
+ if (val == null) {
+ return {
+ wch: 10,
+ }
+ }
+ /* 再判断是否为中文 */
+ else if (val.toString().charCodeAt(0) > 255) {
+ return {
+ wch: val.toString().length * 2,
+ }
+ }
+ else {
+ return {
+ wch: val.toString().length,
+ }
+ }
+ }))
+ /* 以第一行为初始值 */
+ const result = colWidth[0]
+ for (let i = 1; i < colWidth.length; i++) {
+ for (let j = 0; j < colWidth[i].length; j++) {
+ if (result[j].wch < colWidth[i][j].wch) {
+ result[j].wch = colWidth[i][j].wch
+ }
+ }
+ }
+ ws['!cols'] = result
+ ws['!rows'] = wsrows // ws - worksheet
+ XLSX.utils.book_append_sheet(wb, ws, params.sheetName)
+ /* generate file and send to client */
+ XLSX.writeFile(wb, `${params.name}.xlsx`)
+}
diff --git a/src/views/login.vue b/src/views/login.vue
index 6e2b685..17dbad3 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -28,13 +28,17 @@
const redirect = ref(route.query.redirect?.toString() ?? '/')
// 是否需要验证码
const showKaptcha = ref(false)
+// 公钥
const publicKey = ref('')
+// sid
+const sid = ref('')
// 获取系统基础配置: 公钥,是否开启验证码
function getBaseConfig() {
userStore.getBaseConfig().then((res) => {
showKaptcha.value = res.kaptcha
publicKey.value = res.publicKey
+ sid.value = res.sid
ElMessage({
message: '连接服务器成功',
type: 'success',
@@ -68,6 +72,7 @@
loading.value = true
// 表单对象
const finalForm = {
+ sid: sid.value,
username: loginForm.value.username,
password: '',
kaptcha: loginForm.value.kaptcha,
@@ -248,7 +253,7 @@
-
+
diff --git a/src/views/system/notice/noteList.vue b/src/views/system/notice/noteList.vue
index 10a4cbe..ce72aac 100644
--- a/src/views/system/notice/noteList.vue
+++ b/src/views/system/notice/noteList.vue
@@ -1,13 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts
new file mode 100644
index 0000000..3fe9a62
--- /dev/null
+++ b/src/utils/exportUtils.ts
@@ -0,0 +1,20 @@
+/**
+ * 导出文件工具
+ * @param blob 文件
+ * @param fileName 导出文件名
+ */
+export function exportFile(blob: Blob, fileName: string) {
+ if (window.navigator && (window.navigator as any).msSaveOrOpenBlob) {
+ (navigator as any).msSaveBlob(blob, fileName)
+ }
+ else {
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob) // 创建下载的链接
+ downloadElement.href = href
+ downloadElement.download = fileName
+ document.body.appendChild(downloadElement)
+ downloadElement.click() // 点击下载
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放blob对象
+ }
+}
diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts
new file mode 100644
index 0000000..e532b1a
--- /dev/null
+++ b/src/utils/exportXlsx.ts
@@ -0,0 +1,90 @@
+import * as XLSX from 'xlsx'
+console.log(XLSX)
+
+/*
+ * @description:
+ * @param {Object} json 服务端发过来的数据
+ * @param {String} name 导出Excel文件名字
+ * @param {String} titleArr 导出Excel表头
+ * @param {String} sheetName 导出sheetName名字
+ * @return:
+ */
+export interface excelType {
+ json: object
+ name: string
+ titleArr: string[]
+ sheetName: string
+}
+export function exportExcel(params: excelType) {
+ /* convert state to workbook */
+ const data = []
+ const keyArray = []
+ const getLength = function (obj: object) {
+ let count = 0
+ for (const i in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, i)) {
+ // if (obj.hasOwnProperty(i)) {
+ count++
+ }
+ }
+ return count
+ }
+ for (const key1 in params.json) {
+ if (Object.prototype.hasOwnProperty.call(params.json, key1)) {
+ const element = (params.json as { [key: string]: object })[key1]
+ const rowDataArray = []
+ for (const key2 in element) {
+ if (Object.prototype.hasOwnProperty.call(element, key2)) {
+ const element2 = (element as { [key: string]: object })[key2]
+ rowDataArray.push(element2)
+ if (keyArray.length < getLength(element)) {
+ keyArray.push(key2)
+ }
+ console.log(keyArray, 'keyArray')
+ }
+ }
+ data.push(rowDataArray)
+ }
+ }
+ // keyArray为英文字段表头
+ data.splice(0, 0, keyArray as any, params.titleArr as any)
+ console.log('data', data)
+ const ws = XLSX.utils.aoa_to_sheet(data)
+ const wb = XLSX.utils.book_new()
+ // 此处隐藏英文字段表头
+ const wsrows = [{ hidden: true }]
+ /* 设置worksheet每列的最大宽度 */
+ const colWidth = data.map(row => row.map((val) => {
+ /* 先判断是否为null/undefined */
+ if (val == null) {
+ return {
+ wch: 10,
+ }
+ }
+ /* 再判断是否为中文 */
+ else if (val.toString().charCodeAt(0) > 255) {
+ return {
+ wch: val.toString().length * 2,
+ }
+ }
+ else {
+ return {
+ wch: val.toString().length,
+ }
+ }
+ }))
+ /* 以第一行为初始值 */
+ const result = colWidth[0]
+ for (let i = 1; i < colWidth.length; i++) {
+ for (let j = 0; j < colWidth[i].length; j++) {
+ if (result[j].wch < colWidth[i][j].wch) {
+ result[j].wch = colWidth[i][j].wch
+ }
+ }
+ }
+ ws['!cols'] = result
+ ws['!rows'] = wsrows // ws - worksheet
+ XLSX.utils.book_append_sheet(wb, ws, params.sheetName)
+ /* generate file and send to client */
+ XLSX.writeFile(wb, `${params.name}.xlsx`)
+}
diff --git a/src/views/login.vue b/src/views/login.vue
index 6e2b685..17dbad3 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -28,13 +28,17 @@
const redirect = ref(route.query.redirect?.toString() ?? '/')
// 是否需要验证码
const showKaptcha = ref(false)
+// 公钥
const publicKey = ref('')
+// sid
+const sid = ref('')
// 获取系统基础配置: 公钥,是否开启验证码
function getBaseConfig() {
userStore.getBaseConfig().then((res) => {
showKaptcha.value = res.kaptcha
publicKey.value = res.publicKey
+ sid.value = res.sid
ElMessage({
message: '连接服务器成功',
type: 'success',
@@ -68,6 +72,7 @@
loading.value = true
// 表单对象
const finalForm = {
+ sid: sid.value,
username: loginForm.value.username,
password: '',
kaptcha: loginForm.value.kaptcha,
@@ -248,7 +253,7 @@
-
+
diff --git a/src/views/system/notice/noteList.vue b/src/views/system/notice/noteList.vue
index 10a4cbe..ce72aac 100644
--- a/src/views/system/notice/noteList.vue
+++ b/src/views/system/notice/noteList.vue
@@ -1,13 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/certificate/certificate.vue b/src/views/system/tool/certificate/certificate.vue
index 8fc66b5..2d44769 100644
--- a/src/views/system/tool/certificate/certificate.vue
+++ b/src/views/system/tool/certificate/certificate.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts
new file mode 100644
index 0000000..3fe9a62
--- /dev/null
+++ b/src/utils/exportUtils.ts
@@ -0,0 +1,20 @@
+/**
+ * 导出文件工具
+ * @param blob 文件
+ * @param fileName 导出文件名
+ */
+export function exportFile(blob: Blob, fileName: string) {
+ if (window.navigator && (window.navigator as any).msSaveOrOpenBlob) {
+ (navigator as any).msSaveBlob(blob, fileName)
+ }
+ else {
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob) // 创建下载的链接
+ downloadElement.href = href
+ downloadElement.download = fileName
+ document.body.appendChild(downloadElement)
+ downloadElement.click() // 点击下载
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放blob对象
+ }
+}
diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts
new file mode 100644
index 0000000..e532b1a
--- /dev/null
+++ b/src/utils/exportXlsx.ts
@@ -0,0 +1,90 @@
+import * as XLSX from 'xlsx'
+console.log(XLSX)
+
+/*
+ * @description:
+ * @param {Object} json 服务端发过来的数据
+ * @param {String} name 导出Excel文件名字
+ * @param {String} titleArr 导出Excel表头
+ * @param {String} sheetName 导出sheetName名字
+ * @return:
+ */
+export interface excelType {
+ json: object
+ name: string
+ titleArr: string[]
+ sheetName: string
+}
+export function exportExcel(params: excelType) {
+ /* convert state to workbook */
+ const data = []
+ const keyArray = []
+ const getLength = function (obj: object) {
+ let count = 0
+ for (const i in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, i)) {
+ // if (obj.hasOwnProperty(i)) {
+ count++
+ }
+ }
+ return count
+ }
+ for (const key1 in params.json) {
+ if (Object.prototype.hasOwnProperty.call(params.json, key1)) {
+ const element = (params.json as { [key: string]: object })[key1]
+ const rowDataArray = []
+ for (const key2 in element) {
+ if (Object.prototype.hasOwnProperty.call(element, key2)) {
+ const element2 = (element as { [key: string]: object })[key2]
+ rowDataArray.push(element2)
+ if (keyArray.length < getLength(element)) {
+ keyArray.push(key2)
+ }
+ console.log(keyArray, 'keyArray')
+ }
+ }
+ data.push(rowDataArray)
+ }
+ }
+ // keyArray为英文字段表头
+ data.splice(0, 0, keyArray as any, params.titleArr as any)
+ console.log('data', data)
+ const ws = XLSX.utils.aoa_to_sheet(data)
+ const wb = XLSX.utils.book_new()
+ // 此处隐藏英文字段表头
+ const wsrows = [{ hidden: true }]
+ /* 设置worksheet每列的最大宽度 */
+ const colWidth = data.map(row => row.map((val) => {
+ /* 先判断是否为null/undefined */
+ if (val == null) {
+ return {
+ wch: 10,
+ }
+ }
+ /* 再判断是否为中文 */
+ else if (val.toString().charCodeAt(0) > 255) {
+ return {
+ wch: val.toString().length * 2,
+ }
+ }
+ else {
+ return {
+ wch: val.toString().length,
+ }
+ }
+ }))
+ /* 以第一行为初始值 */
+ const result = colWidth[0]
+ for (let i = 1; i < colWidth.length; i++) {
+ for (let j = 0; j < colWidth[i].length; j++) {
+ if (result[j].wch < colWidth[i][j].wch) {
+ result[j].wch = colWidth[i][j].wch
+ }
+ }
+ }
+ ws['!cols'] = result
+ ws['!rows'] = wsrows // ws - worksheet
+ XLSX.utils.book_append_sheet(wb, ws, params.sheetName)
+ /* generate file and send to client */
+ XLSX.writeFile(wb, `${params.name}.xlsx`)
+}
diff --git a/src/views/login.vue b/src/views/login.vue
index 6e2b685..17dbad3 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -28,13 +28,17 @@
const redirect = ref(route.query.redirect?.toString() ?? '/')
// 是否需要验证码
const showKaptcha = ref(false)
+// 公钥
const publicKey = ref('')
+// sid
+const sid = ref('')
// 获取系统基础配置: 公钥,是否开启验证码
function getBaseConfig() {
userStore.getBaseConfig().then((res) => {
showKaptcha.value = res.kaptcha
publicKey.value = res.publicKey
+ sid.value = res.sid
ElMessage({
message: '连接服务器成功',
type: 'success',
@@ -68,6 +72,7 @@
loading.value = true
// 表单对象
const finalForm = {
+ sid: sid.value,
username: loginForm.value.username,
password: '',
kaptcha: loginForm.value.kaptcha,
@@ -248,7 +253,7 @@
-
+
diff --git a/src/views/system/notice/noteList.vue b/src/views/system/notice/noteList.vue
index 10a4cbe..ce72aac 100644
--- a/src/views/system/notice/noteList.vue
+++ b/src/views/system/notice/noteList.vue
@@ -1,13 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/certificate/certificate.vue b/src/views/system/tool/certificate/certificate.vue
index 8fc66b5..2d44769 100644
--- a/src/views/system/tool/certificate/certificate.vue
+++ b/src/views/system/tool/certificate/certificate.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/document/addDDialog.vue b/src/views/system/tool/document/addDDialog.vue
new file mode 100644
index 0000000..43df934
--- /dev/null
+++ b/src/views/system/tool/document/addDDialog.vue
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts
new file mode 100644
index 0000000..3fe9a62
--- /dev/null
+++ b/src/utils/exportUtils.ts
@@ -0,0 +1,20 @@
+/**
+ * 导出文件工具
+ * @param blob 文件
+ * @param fileName 导出文件名
+ */
+export function exportFile(blob: Blob, fileName: string) {
+ if (window.navigator && (window.navigator as any).msSaveOrOpenBlob) {
+ (navigator as any).msSaveBlob(blob, fileName)
+ }
+ else {
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob) // 创建下载的链接
+ downloadElement.href = href
+ downloadElement.download = fileName
+ document.body.appendChild(downloadElement)
+ downloadElement.click() // 点击下载
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放blob对象
+ }
+}
diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts
new file mode 100644
index 0000000..e532b1a
--- /dev/null
+++ b/src/utils/exportXlsx.ts
@@ -0,0 +1,90 @@
+import * as XLSX from 'xlsx'
+console.log(XLSX)
+
+/*
+ * @description:
+ * @param {Object} json 服务端发过来的数据
+ * @param {String} name 导出Excel文件名字
+ * @param {String} titleArr 导出Excel表头
+ * @param {String} sheetName 导出sheetName名字
+ * @return:
+ */
+export interface excelType {
+ json: object
+ name: string
+ titleArr: string[]
+ sheetName: string
+}
+export function exportExcel(params: excelType) {
+ /* convert state to workbook */
+ const data = []
+ const keyArray = []
+ const getLength = function (obj: object) {
+ let count = 0
+ for (const i in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, i)) {
+ // if (obj.hasOwnProperty(i)) {
+ count++
+ }
+ }
+ return count
+ }
+ for (const key1 in params.json) {
+ if (Object.prototype.hasOwnProperty.call(params.json, key1)) {
+ const element = (params.json as { [key: string]: object })[key1]
+ const rowDataArray = []
+ for (const key2 in element) {
+ if (Object.prototype.hasOwnProperty.call(element, key2)) {
+ const element2 = (element as { [key: string]: object })[key2]
+ rowDataArray.push(element2)
+ if (keyArray.length < getLength(element)) {
+ keyArray.push(key2)
+ }
+ console.log(keyArray, 'keyArray')
+ }
+ }
+ data.push(rowDataArray)
+ }
+ }
+ // keyArray为英文字段表头
+ data.splice(0, 0, keyArray as any, params.titleArr as any)
+ console.log('data', data)
+ const ws = XLSX.utils.aoa_to_sheet(data)
+ const wb = XLSX.utils.book_new()
+ // 此处隐藏英文字段表头
+ const wsrows = [{ hidden: true }]
+ /* 设置worksheet每列的最大宽度 */
+ const colWidth = data.map(row => row.map((val) => {
+ /* 先判断是否为null/undefined */
+ if (val == null) {
+ return {
+ wch: 10,
+ }
+ }
+ /* 再判断是否为中文 */
+ else if (val.toString().charCodeAt(0) > 255) {
+ return {
+ wch: val.toString().length * 2,
+ }
+ }
+ else {
+ return {
+ wch: val.toString().length,
+ }
+ }
+ }))
+ /* 以第一行为初始值 */
+ const result = colWidth[0]
+ for (let i = 1; i < colWidth.length; i++) {
+ for (let j = 0; j < colWidth[i].length; j++) {
+ if (result[j].wch < colWidth[i][j].wch) {
+ result[j].wch = colWidth[i][j].wch
+ }
+ }
+ }
+ ws['!cols'] = result
+ ws['!rows'] = wsrows // ws - worksheet
+ XLSX.utils.book_append_sheet(wb, ws, params.sheetName)
+ /* generate file and send to client */
+ XLSX.writeFile(wb, `${params.name}.xlsx`)
+}
diff --git a/src/views/login.vue b/src/views/login.vue
index 6e2b685..17dbad3 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -28,13 +28,17 @@
const redirect = ref(route.query.redirect?.toString() ?? '/')
// 是否需要验证码
const showKaptcha = ref(false)
+// 公钥
const publicKey = ref('')
+// sid
+const sid = ref('')
// 获取系统基础配置: 公钥,是否开启验证码
function getBaseConfig() {
userStore.getBaseConfig().then((res) => {
showKaptcha.value = res.kaptcha
publicKey.value = res.publicKey
+ sid.value = res.sid
ElMessage({
message: '连接服务器成功',
type: 'success',
@@ -68,6 +72,7 @@
loading.value = true
// 表单对象
const finalForm = {
+ sid: sid.value,
username: loginForm.value.username,
password: '',
kaptcha: loginForm.value.kaptcha,
@@ -248,7 +253,7 @@
-
+
diff --git a/src/views/system/notice/noteList.vue b/src/views/system/notice/noteList.vue
index 10a4cbe..ce72aac 100644
--- a/src/views/system/notice/noteList.vue
+++ b/src/views/system/notice/noteList.vue
@@ -1,13 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/certificate/certificate.vue b/src/views/system/tool/certificate/certificate.vue
index 8fc66b5..2d44769 100644
--- a/src/views/system/tool/certificate/certificate.vue
+++ b/src/views/system/tool/certificate/certificate.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/document/addDDialog.vue b/src/views/system/tool/document/addDDialog.vue
new file mode 100644
index 0000000..43df934
--- /dev/null
+++ b/src/views/system/tool/document/addDDialog.vue
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/document/document.vue b/src/views/system/tool/document/document.vue
index e7627b7..0643a0d 100644
--- a/src/views/system/tool/document/document.vue
+++ b/src/views/system/tool/document/document.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts
new file mode 100644
index 0000000..3fe9a62
--- /dev/null
+++ b/src/utils/exportUtils.ts
@@ -0,0 +1,20 @@
+/**
+ * 导出文件工具
+ * @param blob 文件
+ * @param fileName 导出文件名
+ */
+export function exportFile(blob: Blob, fileName: string) {
+ if (window.navigator && (window.navigator as any).msSaveOrOpenBlob) {
+ (navigator as any).msSaveBlob(blob, fileName)
+ }
+ else {
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob) // 创建下载的链接
+ downloadElement.href = href
+ downloadElement.download = fileName
+ document.body.appendChild(downloadElement)
+ downloadElement.click() // 点击下载
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放blob对象
+ }
+}
diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts
new file mode 100644
index 0000000..e532b1a
--- /dev/null
+++ b/src/utils/exportXlsx.ts
@@ -0,0 +1,90 @@
+import * as XLSX from 'xlsx'
+console.log(XLSX)
+
+/*
+ * @description:
+ * @param {Object} json 服务端发过来的数据
+ * @param {String} name 导出Excel文件名字
+ * @param {String} titleArr 导出Excel表头
+ * @param {String} sheetName 导出sheetName名字
+ * @return:
+ */
+export interface excelType {
+ json: object
+ name: string
+ titleArr: string[]
+ sheetName: string
+}
+export function exportExcel(params: excelType) {
+ /* convert state to workbook */
+ const data = []
+ const keyArray = []
+ const getLength = function (obj: object) {
+ let count = 0
+ for (const i in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, i)) {
+ // if (obj.hasOwnProperty(i)) {
+ count++
+ }
+ }
+ return count
+ }
+ for (const key1 in params.json) {
+ if (Object.prototype.hasOwnProperty.call(params.json, key1)) {
+ const element = (params.json as { [key: string]: object })[key1]
+ const rowDataArray = []
+ for (const key2 in element) {
+ if (Object.prototype.hasOwnProperty.call(element, key2)) {
+ const element2 = (element as { [key: string]: object })[key2]
+ rowDataArray.push(element2)
+ if (keyArray.length < getLength(element)) {
+ keyArray.push(key2)
+ }
+ console.log(keyArray, 'keyArray')
+ }
+ }
+ data.push(rowDataArray)
+ }
+ }
+ // keyArray为英文字段表头
+ data.splice(0, 0, keyArray as any, params.titleArr as any)
+ console.log('data', data)
+ const ws = XLSX.utils.aoa_to_sheet(data)
+ const wb = XLSX.utils.book_new()
+ // 此处隐藏英文字段表头
+ const wsrows = [{ hidden: true }]
+ /* 设置worksheet每列的最大宽度 */
+ const colWidth = data.map(row => row.map((val) => {
+ /* 先判断是否为null/undefined */
+ if (val == null) {
+ return {
+ wch: 10,
+ }
+ }
+ /* 再判断是否为中文 */
+ else if (val.toString().charCodeAt(0) > 255) {
+ return {
+ wch: val.toString().length * 2,
+ }
+ }
+ else {
+ return {
+ wch: val.toString().length,
+ }
+ }
+ }))
+ /* 以第一行为初始值 */
+ const result = colWidth[0]
+ for (let i = 1; i < colWidth.length; i++) {
+ for (let j = 0; j < colWidth[i].length; j++) {
+ if (result[j].wch < colWidth[i][j].wch) {
+ result[j].wch = colWidth[i][j].wch
+ }
+ }
+ }
+ ws['!cols'] = result
+ ws['!rows'] = wsrows // ws - worksheet
+ XLSX.utils.book_append_sheet(wb, ws, params.sheetName)
+ /* generate file and send to client */
+ XLSX.writeFile(wb, `${params.name}.xlsx`)
+}
diff --git a/src/views/login.vue b/src/views/login.vue
index 6e2b685..17dbad3 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -28,13 +28,17 @@
const redirect = ref(route.query.redirect?.toString() ?? '/')
// 是否需要验证码
const showKaptcha = ref(false)
+// 公钥
const publicKey = ref('')
+// sid
+const sid = ref('')
// 获取系统基础配置: 公钥,是否开启验证码
function getBaseConfig() {
userStore.getBaseConfig().then((res) => {
showKaptcha.value = res.kaptcha
publicKey.value = res.publicKey
+ sid.value = res.sid
ElMessage({
message: '连接服务器成功',
type: 'success',
@@ -68,6 +72,7 @@
loading.value = true
// 表单对象
const finalForm = {
+ sid: sid.value,
username: loginForm.value.username,
password: '',
kaptcha: loginForm.value.kaptcha,
@@ -248,7 +253,7 @@
-
+
diff --git a/src/views/system/notice/noteList.vue b/src/views/system/notice/noteList.vue
index 10a4cbe..ce72aac 100644
--- a/src/views/system/notice/noteList.vue
+++ b/src/views/system/notice/noteList.vue
@@ -1,13 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/certificate/certificate.vue b/src/views/system/tool/certificate/certificate.vue
index 8fc66b5..2d44769 100644
--- a/src/views/system/tool/certificate/certificate.vue
+++ b/src/views/system/tool/certificate/certificate.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/document/addDDialog.vue b/src/views/system/tool/document/addDDialog.vue
new file mode 100644
index 0000000..43df934
--- /dev/null
+++ b/src/views/system/tool/document/addDDialog.vue
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/document/document.vue b/src/views/system/tool/document/document.vue
index e7627b7..0643a0d 100644
--- a/src/views/system/tool/document/document.vue
+++ b/src/views/system/tool/document/document.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/signature/addDDialog.vue b/src/views/system/tool/signature/addDDialog.vue
index 06ff5ca..f9a49e2 100644
--- a/src/views/system/tool/signature/addDDialog.vue
+++ b/src/views/system/tool/signature/addDDialog.vue
@@ -6,7 +6,7 @@
import type { signType } from '../tool_interface'
import { getUserList } from '@/api/system/user'
import { uploadApi } from '@/api/system/notice'
-import { addApi, listPageApi, updateApi } from '@/api/system/tool'
+import { addApi, listPageDetailApi, updateApi } from '@/api/system/tool'
import type { userType } from '@/views/system/user/user-interface'
const emits = defineEmits(['resetData'])
const ruleFormRef = ref() // from组件
@@ -67,7 +67,7 @@
ruleForm.id = row.id
ruleForm.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
// 获取详情列表
- listPageApi({ ...row }).then((res) => {
+ listPageDetailApi({ ...row }).then((res) => {
ruleForm.userIdList = res.data.rows[0].userIdList
})
// 修改
@@ -82,7 +82,7 @@
ruleForm.userIdList = row.userIdList
ruleForm.signDirector = row.signDirector
// 获取详情列表
- listPageApi({ ...row }).then((res) => {
+ listPageDetailApi({ ...row }).then((res) => {
ruleForm.userIdList = res.data.rows[0].userIdList
})
}
diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
index 7c8c260..9f38397 100644
--- a/src/api/system/notice.ts
+++ b/src/api/system/notice.ts
@@ -5,7 +5,22 @@
const prefix = 'system'
// 获取公告列表/详情
-export function getNoticeeApi(data: object) {
+export interface listParamsType {
+ noticeNo: string // 编号
+ noticePublisher: string // 发布人
+ noticeTime: string // 发布时间
+ noticeTitle: string // 标题
+ limit: number
+ offset: number
+}
+export function getNoticeeApi(data: listParamsType) {
+ return request({
+ url: `${prefix}/notice/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+export function getNoticeDetail(data: object) {
return request({
url: `${prefix}/notice/listPage`,
method: 'post',
@@ -28,3 +43,4 @@
data,
})
}
+
diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts
index c50a242..2257d08 100644
--- a/src/api/system/tool.ts
+++ b/src/api/system/tool.ts
@@ -1,4 +1,5 @@
import request from '../index'
+import type { queryType } from '@/views/system/tool/tool_interface'
const prefix = 'system/'
// 签名/签章新增
@@ -42,7 +43,15 @@
})
}
// 签名/签章列表/详情(分页)
-export function listPageApi(data: object) {
+export function listPageApi(data: queryType) {
+ return request({
+ url: `${prefix}sign/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 签名/签章列表/详情
+export function listPageDetailApi(data: object) {
return request({
url: `${prefix}sign/listPage`,
method: 'post',
@@ -57,3 +66,52 @@
data,
})
}
+// 原始记录模板/证书报告模板列表(分页)
+export interface listParamsType {
+ templateNo: string // 编号
+ templateName: string // 名称
+ templateCreator: string // 负责人
+ createTime: string // 创建时间
+ limit: number
+ offset: number
+ templateType: string
+}
+export function templatePage(data: listParamsType) {
+ return request({
+ url: `${prefix}/template/listPage?limit=${data.limit}&offset=${data.offset}`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表/详情(
+export function templatePageDetail(data: object) {
+ return request({
+ url: `${prefix}/template/listPage`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表删除
+export function templateDelete(data: object) {
+ return request({
+ url: `${prefix}/template/delete`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表新建
+export function templateAdd(data: object) {
+ return request({
+ url: `${prefix}/template/add`,
+ method: 'post',
+ data,
+ })
+}
+// 原始记录模板/证书报告模板列表更新
+export function templateUpdate(data: object) {
+ return request({
+ url: `${prefix}/template/update`,
+ method: 'post',
+ data,
+ })
+}
diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts
index 0e746bc..5a45736 100644
--- a/src/router/modules/system.ts
+++ b/src/router/modules/system.ts
@@ -23,6 +23,7 @@
auth: '/sys/area',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/area',
},
},
],
@@ -47,6 +48,7 @@
auth: '/sys/resource',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/resource',
},
},
],
@@ -71,6 +73,7 @@
auth: '/sys/dept',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dept',
},
},
],
@@ -95,6 +98,7 @@
auth: '/sys/role',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/role',
},
},
],
@@ -119,6 +123,7 @@
auth: '/sys/mgr',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/user',
},
},
],
@@ -143,6 +148,7 @@
auth: '/sys/dict',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/dict',
},
},
],
@@ -191,6 +197,7 @@
auth: '/sys/tenantSys/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/tenant',
},
},
],
@@ -215,6 +222,7 @@
auth: '/sys/log/biz/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/business',
},
},
],
@@ -239,6 +247,7 @@
auth: '/sys/log/error/list',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/error',
},
},
],
@@ -263,6 +272,7 @@
auth: '/sys/loginLog',
sidebar: false,
breadcrumb: true,
+ activeMenu: '/loginDiary',
},
},
],
diff --git a/src/utils/exportUtils.ts b/src/utils/exportUtils.ts
new file mode 100644
index 0000000..3fe9a62
--- /dev/null
+++ b/src/utils/exportUtils.ts
@@ -0,0 +1,20 @@
+/**
+ * 导出文件工具
+ * @param blob 文件
+ * @param fileName 导出文件名
+ */
+export function exportFile(blob: Blob, fileName: string) {
+ if (window.navigator && (window.navigator as any).msSaveOrOpenBlob) {
+ (navigator as any).msSaveBlob(blob, fileName)
+ }
+ else {
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob) // 创建下载的链接
+ downloadElement.href = href
+ downloadElement.download = fileName
+ document.body.appendChild(downloadElement)
+ downloadElement.click() // 点击下载
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放blob对象
+ }
+}
diff --git a/src/utils/exportXlsx.ts b/src/utils/exportXlsx.ts
new file mode 100644
index 0000000..e532b1a
--- /dev/null
+++ b/src/utils/exportXlsx.ts
@@ -0,0 +1,90 @@
+import * as XLSX from 'xlsx'
+console.log(XLSX)
+
+/*
+ * @description:
+ * @param {Object} json 服务端发过来的数据
+ * @param {String} name 导出Excel文件名字
+ * @param {String} titleArr 导出Excel表头
+ * @param {String} sheetName 导出sheetName名字
+ * @return:
+ */
+export interface excelType {
+ json: object
+ name: string
+ titleArr: string[]
+ sheetName: string
+}
+export function exportExcel(params: excelType) {
+ /* convert state to workbook */
+ const data = []
+ const keyArray = []
+ const getLength = function (obj: object) {
+ let count = 0
+ for (const i in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, i)) {
+ // if (obj.hasOwnProperty(i)) {
+ count++
+ }
+ }
+ return count
+ }
+ for (const key1 in params.json) {
+ if (Object.prototype.hasOwnProperty.call(params.json, key1)) {
+ const element = (params.json as { [key: string]: object })[key1]
+ const rowDataArray = []
+ for (const key2 in element) {
+ if (Object.prototype.hasOwnProperty.call(element, key2)) {
+ const element2 = (element as { [key: string]: object })[key2]
+ rowDataArray.push(element2)
+ if (keyArray.length < getLength(element)) {
+ keyArray.push(key2)
+ }
+ console.log(keyArray, 'keyArray')
+ }
+ }
+ data.push(rowDataArray)
+ }
+ }
+ // keyArray为英文字段表头
+ data.splice(0, 0, keyArray as any, params.titleArr as any)
+ console.log('data', data)
+ const ws = XLSX.utils.aoa_to_sheet(data)
+ const wb = XLSX.utils.book_new()
+ // 此处隐藏英文字段表头
+ const wsrows = [{ hidden: true }]
+ /* 设置worksheet每列的最大宽度 */
+ const colWidth = data.map(row => row.map((val) => {
+ /* 先判断是否为null/undefined */
+ if (val == null) {
+ return {
+ wch: 10,
+ }
+ }
+ /* 再判断是否为中文 */
+ else if (val.toString().charCodeAt(0) > 255) {
+ return {
+ wch: val.toString().length * 2,
+ }
+ }
+ else {
+ return {
+ wch: val.toString().length,
+ }
+ }
+ }))
+ /* 以第一行为初始值 */
+ const result = colWidth[0]
+ for (let i = 1; i < colWidth.length; i++) {
+ for (let j = 0; j < colWidth[i].length; j++) {
+ if (result[j].wch < colWidth[i][j].wch) {
+ result[j].wch = colWidth[i][j].wch
+ }
+ }
+ }
+ ws['!cols'] = result
+ ws['!rows'] = wsrows // ws - worksheet
+ XLSX.utils.book_append_sheet(wb, ws, params.sheetName)
+ /* generate file and send to client */
+ XLSX.writeFile(wb, `${params.name}.xlsx`)
+}
diff --git a/src/views/login.vue b/src/views/login.vue
index 6e2b685..17dbad3 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -28,13 +28,17 @@
const redirect = ref(route.query.redirect?.toString() ?? '/')
// 是否需要验证码
const showKaptcha = ref(false)
+// 公钥
const publicKey = ref('')
+// sid
+const sid = ref('')
// 获取系统基础配置: 公钥,是否开启验证码
function getBaseConfig() {
userStore.getBaseConfig().then((res) => {
showKaptcha.value = res.kaptcha
publicKey.value = res.publicKey
+ sid.value = res.sid
ElMessage({
message: '连接服务器成功',
type: 'success',
@@ -68,6 +72,7 @@
loading.value = true
// 表单对象
const finalForm = {
+ sid: sid.value,
username: loginForm.value.username,
password: '',
kaptcha: loginForm.value.kaptcha,
@@ -248,7 +253,7 @@
-
+
diff --git a/src/views/system/notice/noteList.vue b/src/views/system/notice/noteList.vue
index 10a4cbe..ce72aac 100644
--- a/src/views/system/notice/noteList.vue
+++ b/src/views/system/notice/noteList.vue
@@ -1,13 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/certificate/certificate.vue b/src/views/system/tool/certificate/certificate.vue
index 8fc66b5..2d44769 100644
--- a/src/views/system/tool/certificate/certificate.vue
+++ b/src/views/system/tool/certificate/certificate.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/document/addDDialog.vue b/src/views/system/tool/document/addDDialog.vue
new file mode 100644
index 0000000..43df934
--- /dev/null
+++ b/src/views/system/tool/document/addDDialog.vue
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/document/document.vue b/src/views/system/tool/document/document.vue
index e7627b7..0643a0d 100644
--- a/src/views/system/tool/document/document.vue
+++ b/src/views/system/tool/document/document.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/signature/addDDialog.vue b/src/views/system/tool/signature/addDDialog.vue
index 06ff5ca..f9a49e2 100644
--- a/src/views/system/tool/signature/addDDialog.vue
+++ b/src/views/system/tool/signature/addDDialog.vue
@@ -6,7 +6,7 @@
import type { signType } from '../tool_interface'
import { getUserList } from '@/api/system/user'
import { uploadApi } from '@/api/system/notice'
-import { addApi, listPageApi, updateApi } from '@/api/system/tool'
+import { addApi, listPageDetailApi, updateApi } from '@/api/system/tool'
import type { userType } from '@/views/system/user/user-interface'
const emits = defineEmits(['resetData'])
const ruleFormRef = ref() // from组件
@@ -67,7 +67,7 @@
ruleForm.id = row.id
ruleForm.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
// 获取详情列表
- listPageApi({ ...row }).then((res) => {
+ listPageDetailApi({ ...row }).then((res) => {
ruleForm.userIdList = res.data.rows[0].userIdList
})
// 修改
@@ -82,7 +82,7 @@
ruleForm.userIdList = row.userIdList
ruleForm.signDirector = row.signDirector
// 获取详情列表
- listPageApi({ ...row }).then((res) => {
+ listPageDetailApi({ ...row }).then((res) => {
ruleForm.userIdList = res.data.rows[0].userIdList
})
}
diff --git a/src/views/system/tool/signature/signature.vue b/src/views/system/tool/signature/signature.vue
index fc5a60b..001b5b3 100644
--- a/src/views/system/tool/signature/signature.vue
+++ b/src/views/system/tool/signature/signature.vue
@@ -1,12 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/certificate/certificate.vue b/src/views/system/tool/certificate/certificate.vue
index 8fc66b5..2d44769 100644
--- a/src/views/system/tool/certificate/certificate.vue
+++ b/src/views/system/tool/certificate/certificate.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/document/addDDialog.vue b/src/views/system/tool/document/addDDialog.vue
new file mode 100644
index 0000000..43df934
--- /dev/null
+++ b/src/views/system/tool/document/addDDialog.vue
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ ruleForm.minioFileName }}
+
+ 上传
+
+
+ 附件
+
+
+
+
+
+ 发布
+
+
+ 关闭
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/document/document.vue b/src/views/system/tool/document/document.vue
index e7627b7..0643a0d 100644
--- a/src/views/system/tool/document/document.vue
+++ b/src/views/system/tool/document/document.vue
@@ -1,19 +1,51 @@
-
+
-
+
-
+
-
+
+
+
+
-
+
重置
-
-
-
-
+
+
+
+
新建
-
+
导出
-
+
打印
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
-
-
-
- 查看{{ $index }}
-
-
-
-
-
+
+
+
+
+
+ {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
+
+
+
+
+
+
+
+ 编辑
+
+
+ 详情
+
+
+ 下载
+
+
+ 删除
+
+
+
+
+
+
+
diff --git a/src/views/system/tool/signature/addDDialog.vue b/src/views/system/tool/signature/addDDialog.vue
index 06ff5ca..f9a49e2 100644
--- a/src/views/system/tool/signature/addDDialog.vue
+++ b/src/views/system/tool/signature/addDDialog.vue
@@ -6,7 +6,7 @@
import type { signType } from '../tool_interface'
import { getUserList } from '@/api/system/user'
import { uploadApi } from '@/api/system/notice'
-import { addApi, listPageApi, updateApi } from '@/api/system/tool'
+import { addApi, listPageDetailApi, updateApi } from '@/api/system/tool'
import type { userType } from '@/views/system/user/user-interface'
const emits = defineEmits(['resetData'])
const ruleFormRef = ref() // from组件
@@ -67,7 +67,7 @@
ruleForm.id = row.id
ruleForm.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
// 获取详情列表
- listPageApi({ ...row }).then((res) => {
+ listPageDetailApi({ ...row }).then((res) => {
ruleForm.userIdList = res.data.rows[0].userIdList
})
// 修改
@@ -82,7 +82,7 @@
ruleForm.userIdList = row.userIdList
ruleForm.signDirector = row.signDirector
// 获取详情列表
- listPageApi({ ...row }).then((res) => {
+ listPageDetailApi({ ...row }).then((res) => {
ruleForm.userIdList = res.data.rows[0].userIdList
})
}
diff --git a/src/views/system/tool/signature/signature.vue b/src/views/system/tool/signature/signature.vue
index fc5a60b..001b5b3 100644
--- a/src/views/system/tool/signature/signature.vue
+++ b/src/views/system/tool/signature/signature.vue
@@ -1,12 +1,13 @@