diff --git a/src/api/issue/index.ts b/src/api/issue/index.ts index 8d59c0a..394388e 100644 --- a/src/api/issue/index.ts +++ b/src/api/issue/index.ts @@ -16,7 +16,7 @@ import { request } from '@/utils/request'; export function fetchIssueList(data: API.SearchListParams) { return request>( { - url: 'issue/list', + url: 'question/list', method: 'post', data, }, @@ -34,7 +34,7 @@ export function fetchIssueList(data: API.SearchListParams) { export function fetchIssuePageList(data: API.SearchPageListParams) { return request>( { - url: 'issue/page', + url: 'question/list', method: 'post', data, }, @@ -51,7 +51,7 @@ export function fetchIssuePageList(data: API.SearchPageListParams) { */ export function createIssue(data: API.IssueType) { return request({ - url: 'issue/create', + url: 'question/create', method: 'post', data, }); @@ -64,7 +64,7 @@ export function createIssue(data: API.IssueType) { */ export function updateIssue(data: API.IssueType) { return request({ - url: 'issue/update', + url: 'question/update', method: 'post', data, }); @@ -75,7 +75,7 @@ export function updateIssue(data: API.IssueType) { */ export function findOneById(params: { id: string }) { return request({ - url: `issue/getById`, + url: `question/getById`, method: 'get', params, }); @@ -86,7 +86,7 @@ export function findOneById(params: { id: string }) { */ export function deleteIssueById(params: API.DeleteIssueParams) { return request({ - url: `issue/delById`, + url: `question/delById`, method: 'post', params, }); @@ -97,7 +97,7 @@ export function deleteIssueById(params: API.DeleteIssueParams) { */ export function deleteBatchIssueById(data: API.DeleteBatchIssueParams) { return request({ - url: `issue/deleteBatch`, + url: `question/delete`, method: 'delete', data, }); diff --git a/src/api/issue/model.d.ts b/src/api/issue/model.d.ts index 1b549b0..319fe4d 100644 --- a/src/api/issue/model.d.ts +++ b/src/api/issue/model.d.ts @@ -2,13 +2,48 @@ declare namespace API { /** 问题工单类型 */ type IssueType = { id?: string; - title: string; - content: string; + agent?: string; // 代理商 + attribute?: string; // 问题属性 + billcode?: string; // 问题号 + contacts?: string; // 联系人 + contactsEmail?: string; // 联系人邮箱 + contactsMobile?: string; // 联系人手机号 + createTime?: string; // 创建时间 + createUserid?: number; // 创建人ID + customer?: string; // 客户 + description?: string; // 问题描述 + dr?: number; // 删除标记 + product?: string; // 产品 + serviceNumber?: string; // 服务号 + state?: number; // 状态 + title?: string; // 问题标题 + updateTime?: string; // 更新时间 + updateUserid?: number; // 更新人ID + version?: string; // 版本 + fileList?: any[]; // 附件列表 }; type CreateIssueParams = { - title: string; - content: string; + id?: string; + agent?: string; // 代理商 + attribute?: string; // 问题属性 + billcode?: string; // 问题号 + contacts?: string; // 联系人 + contactsEmail?: string; // 联系人邮箱 + contactsMobile?: string; // 联系人手机号 + createTime?: string; // 创建时间 + createUserid?: number; // 创建人ID + customer?: string; // 客户 + description?: string; // 问题描述 + dr?: number; // 删除标记 + product?: string; // 产品 + serviceNumber?: string; // 服务号 + state?: number; // 状态 + title?: string; // 问题标题 + updateTime?: string; // 更新时间 + updateUserid?: number; // 更新人ID + version?: string; // 版本 + fileList?: any[]; // 附件列表 }; type DeleteIssueParams = { diff --git a/src/api/upload/index.ts b/src/api/upload/index.ts new file mode 100644 index 0000000..7988d20 --- /dev/null +++ b/src/api/upload/index.ts @@ -0,0 +1,15 @@ +import { request } from '@/utils/request'; + +/** + * @description 附件上传 + * @param {} data + * @returns + */ +export function commonUpload(data) { + return request({ + url: `/file/upload`, + method: 'post', + data, + timeout: 30000, + }); +} diff --git a/src/api/upload/model.d.ts b/src/api/upload/model.d.ts new file mode 100644 index 0000000..29454fa --- /dev/null +++ b/src/api/upload/model.d.ts @@ -0,0 +1,3 @@ +declare namespace API { + +} \ No newline at end of file diff --git a/src/locales/lang/en-US/routes/system.ts b/src/locales/lang/en-US/routes/system.ts index 695d8a6..ea8b90e 100644 --- a/src/locales/lang/en-US/routes/system.ts +++ b/src/locales/lang/en-US/routes/system.ts @@ -10,4 +10,5 @@ export default { system: 'system', dictionary: 'Dictionary', user: 'User', + admin: 'Admin', }; diff --git a/src/locales/lang/zh-CN/routes/system.ts b/src/locales/lang/zh-CN/routes/system.ts index 6da83bd..eb3fde5 100644 --- a/src/locales/lang/zh-CN/routes/system.ts +++ b/src/locales/lang/zh-CN/routes/system.ts @@ -2,4 +2,5 @@ export default { system: '系统管理', dictionary: '字典维护', user: '用户管理', + admin: '管理员管理', }; diff --git a/src/router/staticModules/question.ts b/src/router/staticModules/question.ts index 2628ff4..0ea735a 100644 --- a/src/router/staticModules/question.ts +++ b/src/router/staticModules/question.ts @@ -12,7 +12,7 @@ const routes: Array = [ component: RouterView, meta: { title: t('routes.question.question'), - icon: 'icon-issue', + icon: 'icon-kehucanshupeizhi', }, children: [ { @@ -20,7 +20,7 @@ const routes: Array = [ name: `${moduleName}-issue`, meta: { title: t('routes.question.issue'), - icon: 'icon-issue', + icon: 'icon-icon_shiyongwendang', }, component: () => import(/* webpackChunkName: "question-issue" */ '@/views/question/issue/index.vue'), diff --git a/src/router/staticModules/system.ts b/src/router/staticModules/system.ts index c3b9c69..cb7daa7 100644 --- a/src/router/staticModules/system.ts +++ b/src/router/staticModules/system.ts @@ -42,7 +42,18 @@ const routes: Array = [ keepAlive: true, }, component: () => - import(/* webpackChunkName: "tenant-user" */ '@/views/system/user/index.vue'), + import(/* webpackChunkName: "system-user" */ '@/views/system/user/index.vue'), + }, + { + path: 'admin', + name: `${moduleName}-admin`, + meta: { + title: t('routes.system.admin'), + icon: 'icon-yonghu1', + keepAlive: true, + }, + component: () => + import(/* webpackChunkName: "system-admin" */ '@/views/system/admin/index.vue'), }, ], }, diff --git a/src/utils/fileUtils.ts b/src/utils/fileUtils.ts new file mode 100644 index 0000000..dce01e8 --- /dev/null +++ b/src/utils/fileUtils.ts @@ -0,0 +1,25 @@ +export function downloadByData(data: BlobPart, filename: string, mime?: string, bom?: BlobPart) { + const blobData = typeof bom !== 'undefined' ? [bom, data] : [data]; + const blob = new Blob(blobData, { type: mime || 'application/vnd.ms-excel' }); + + const blobURL = window.URL.createObjectURL(blob); + const tempLink = document.createElement('a'); + tempLink.style.display = 'none'; + tempLink.href = blobURL; + tempLink.setAttribute('download', filename); + if (typeof tempLink.download === 'undefined') { + tempLink.setAttribute('target', '_blank'); + } + document.body.appendChild(tempLink); + tempLink.click(); + document.body.removeChild(tempLink); + window.URL.revokeObjectURL(blobURL); +} + +export function getFileExtension(filename: string): string | null { + const dotIndex = filename.lastIndexOf('.'); + if (dotIndex === -1) { + return null; // 文件名中不存在扩展名 + } + return filename.slice(dotIndex + 1).toLowerCase(); +} \ No newline at end of file diff --git a/src/views/dashboard/welcome/index.vue b/src/views/dashboard/welcome/index.vue index 72e3ca1..6f7a6d8 100644 --- a/src/views/dashboard/welcome/index.vue +++ b/src/views/dashboard/welcome/index.vue @@ -7,6 +7,8 @@ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE -->