diff --git a/src/api/dict/index.ts b/src/api/dict/index.ts index 310ecd9..0ea688d 100644 --- a/src/api/dict/index.ts +++ b/src/api/dict/index.ts @@ -55,11 +55,11 @@ export function deleteDict(data: API.DeleteDictParams) { * @param { fieldTypeId:string} data * @returns */ -export function fetchDictValueListByType(data: { fieldTypeName: string }) { +export function fetchDictValueListByType(params: { typeName: string }) { return request({ - url: `/dict/query`, - method: 'post', - data, + url: `/dict/list`, + method: 'get', + params, }); } @@ -143,3 +143,5 @@ export function deleteBatchDictValueById(data: API.DeleteBatchDictValueParams) { data, }); } + + diff --git a/src/api/issue/index.ts b/src/api/issue/index.ts index 394388e..145f81e 100644 --- a/src/api/issue/index.ts +++ b/src/api/issue/index.ts @@ -70,6 +70,19 @@ export function updateIssue(data: API.IssueType) { }); } +/** + * @description 修改状态 + * @param {IssueType} data + * @returns + */ +export function updateIssueState(data: { id: string; state: number; remark: string }) { + return request({ + url: 'question/changeState', + method: 'post', + data, + }); +} + /** * @description 查询单条 */ diff --git a/src/api/issue/model.d.ts b/src/api/issue/model.d.ts index 319fe4d..3f26455 100644 --- a/src/api/issue/model.d.ts +++ b/src/api/issue/model.d.ts @@ -14,6 +14,9 @@ declare namespace API { description?: string; // 问题描述 dr?: number; // 删除标记 product?: string; // 产品 + productId?: string; // 产品ID + version?: string; // 版本 + versionId?: string; // 版本ID serviceNumber?: string; // 服务号 state?: number; // 状态 title?: string; // 问题标题 diff --git a/src/api/knowledgeBase/index.ts b/src/api/knowledgeBase/index.ts new file mode 100644 index 0000000..bcf3603 --- /dev/null +++ b/src/api/knowledgeBase/index.ts @@ -0,0 +1,104 @@ +/* + * @Author: AaronWu 2463371514@qq.com + * @Date: 2025-04-01 09:09:04 + * @LastEditors: AaronWu 2463371514@qq.com + * @LastEditTime: 2025-04-01 11:34:26 + * @FilePath: /KnowledgeBaseSupportManage/src/api/user/index.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import type { BaseResponse } from '@/utils/request'; +import { request } from '@/utils/request'; +/** + * @description 查询列表 + * @param {SearchListParams} data + * @returns + */ +export function fetchKnowledgeBaseList(data: API.SearchListParams) { + return request>( + { + url: 'question/list', + method: 'post', + data, + }, + { + isGetDataDirectly: false, + }, + ); +} + +/** + * @description 查询分页列表 + * @param {SearchPageListParams} data + * @returns + */ +export function fetchKnowledgeBasePageList(data: API.SearchPageListParams) { + return request>( + { + url: 'question/list', + method: 'post', + data, + }, + { + isGetDataDirectly: false, + }, + ); +} + +/** + * @description 新增单条 + * @param {KnowledgeBaseType} data + * @returns + */ +export function createKnowledgeBase(data: API.KnowledgeBaseType) { + return request({ + url: 'question/create', + method: 'post', + data, + }); +} + +/** + * @description 修改单条 + * @param {KnowledgeBaseType} data + * @returns + */ +export function updateKnowledgeBase(data: API.KnowledgeBaseType) { + return request({ + url: 'question/update', + method: 'post', + data, + }); +} + +/** + * @description 查询单条 + */ +export function findOneById(params: { id: string }) { + return request({ + url: `question/getById`, + method: 'get', + params, + }); +} + +/** + * @description 删除单条 ?id=${data.id} + */ +export function deleteKnowledgeBaseById(params: API.DeleteKnowledgeBaseParams) { + return request({ + url: `question/delById`, + method: 'post', + params, + }); +} + +/** + * @description 删除多条 + */ +export function deleteBatchKnowledgeBaseById(data: API.DeleteBatchKnowledgeBaseParams) { + return request({ + url: `question/delete`, + method: 'delete', + data, + }); +} diff --git a/src/api/knowledgeBase/model.d.ts b/src/api/knowledgeBase/model.d.ts new file mode 100644 index 0000000..ba3bf41 --- /dev/null +++ b/src/api/knowledgeBase/model.d.ts @@ -0,0 +1,57 @@ +declare namespace API { + /** 问题工单类型 */ + type KnowledgeBaseType = { + 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; // 产品 + productId?: string; // 产品ID + version?: string; // 版本 + versionId?: string; // 版本ID + serviceNumber?: string; // 服务号 + state?: number; // 状态 + title?: string; // 问题标题 + updateTime?: string; // 更新时间 + updateUserid?: number; // 更新人ID + version?: string; // 版本 + fileList?: any[]; // 附件列表 + }; + + type CreateKnowledgeBaseParams = { + 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 DeleteKnowledgeBaseParams = { + id: string; + }; + + type DeleteBatchKnowledgeBaseParams = string[]; +} diff --git a/src/api/login/index.ts b/src/api/login/index.ts index ed1c6df..59c28a9 100644 --- a/src/api/login/index.ts +++ b/src/api/login/index.ts @@ -31,7 +31,7 @@ export function register(data: API.RegisterParams) { */ export function getUserInfo() { return request({ - url: 'userInfo', + url: 'currentuser', method: 'get', }); } diff --git a/src/api/prodVersion/index.ts b/src/api/prodVersion/index.ts new file mode 100644 index 0000000..2d9c0f9 --- /dev/null +++ b/src/api/prodVersion/index.ts @@ -0,0 +1,106 @@ +import type { BaseResponse } from '@/utils/request'; +import { request } from '@/utils/request'; + +/** + * @description 查询类别列表 + * @param {SearchPageListParams} data + * @returns + */ +export function fetchProdList(data) { + return request>({ + url: `/product/list`, + method: 'post', + data, + }); +} + +/** + * @description 新增单条 + * @param {ProdType} data + * @returns + */ +export function createProd(data: API.ProdType) { + return request({ + url: `/product/create`, + method: 'post', + data, + }); +} + +/** + * @description 修改单条 + * @param {ProdType} data + * @returns + */ +export function updateProd(data: API.ProdType) { + return request({ + url: `/product/update`, + method: 'post', + data, + }); +} + +/** + * @description 删除 + */ +export function deleteProd(data: API.DeleteProdParams) { + return request({ + url: `/product/delete?id=${data.id}`, + method: 'delete', + }); +} + +/** + * @description 根据字典类型查询字典值分页列表 + * @param {SearchPageListParams} params + * @returns + */ +export function fetchVersionPageList(params: API.SearchPageListParams) { + return request>( + { + url: `/productVersion/list`, + method: 'get', + params, + }, + { + isGetDataDirectly: false, + }, + ); +} + +/** + * @description 新增单条 + * @param {VersionType} data + * @returns + */ +export function createVersion(data: API.VersionType) { + return request({ + url: `/productVersion/create`, + method: 'post', + data, + }); +} + +/** + * @description 修改单条 + * @param {VersionType} data + * @returns + */ +export function updateVersion(data: API.VersionType) { + return request({ + url: `/productVersion/update`, + method: 'post', + data, + }); +} + +/** + * @description 删除多条 + */ +export function deleteBatchVersionById(data: API.DeleteBatchVersionParams) { + return request({ + url: `/productVersion/delete`, + method: 'delete', + data, + }); +} diff --git a/src/api/prodVersion/model.d.ts b/src/api/prodVersion/model.d.ts new file mode 100644 index 0000000..93d9f69 --- /dev/null +++ b/src/api/prodVersion/model.d.ts @@ -0,0 +1,23 @@ +declare namespace API { + type ProdType = { + id?: string; + name: string; + }; + + type DeleteProdParams = { + id: string; + }; + + type VersionType = { + id?: string; + productId: string; + name: string; + remark?: string; + }; + + type DeleteVersionParams = { + id: string; + }; + + type DeleteBatchVersionParams = string[]; +} diff --git a/src/api/typings.d.ts b/src/api/typings.d.ts index 9f85704..1543c74 100644 --- a/src/api/typings.d.ts +++ b/src/api/typings.d.ts @@ -18,7 +18,7 @@ declare namespace API { /** 查询分页列表参数 */ type SearchPageListParams = { [key: string]: any; - model: SearchListParams; + model?: SearchListParams; current: number; size: number; sort?: string; diff --git a/src/assets/icons/back.svg b/src/assets/icons/back.svg new file mode 100644 index 0000000..edf712d --- /dev/null +++ b/src/assets/icons/back.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/dev.svg b/src/assets/icons/dev.svg new file mode 100644 index 0000000..21ca1f8 --- /dev/null +++ b/src/assets/icons/dev.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/end.svg b/src/assets/icons/end.svg new file mode 100644 index 0000000..a567f5f --- /dev/null +++ b/src/assets/icons/end.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/init.svg b/src/assets/icons/init.svg new file mode 100644 index 0000000..ee729c3 --- /dev/null +++ b/src/assets/icons/init.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/knowledge.svg b/src/assets/icons/knowledge.svg new file mode 100644 index 0000000..626624b --- /dev/null +++ b/src/assets/icons/knowledge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/test.svg b/src/assets/icons/test.svg new file mode 100644 index 0000000..a628c50 --- /dev/null +++ b/src/assets/icons/test.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/core/dynamic-table/src/components/table-action.vue b/src/components/core/dynamic-table/src/components/table-action.vue index e7016ca..cfcc282 100644 --- a/src/components/core/dynamic-table/src/components/table-action.vue +++ b/src/components/core/dynamic-table/src/components/table-action.vue @@ -7,26 +7,29 @@ v-bind="actionItem.popConfirm" >
- + + + - - {{ actionItem.label }} - + + {{ actionItem.label }} + + - +
diff --git a/src/enums/dictEnum.ts b/src/enums/dictEnum.ts new file mode 100644 index 0000000..4b60c06 --- /dev/null +++ b/src/enums/dictEnum.ts @@ -0,0 +1,3 @@ +export enum DictEnum { + QUESTION_TYPE = '问题属性', +} diff --git a/src/locales/lang/en-US/routes/question.ts b/src/locales/lang/en-US/routes/question.ts index a8e58c5..5902622 100644 --- a/src/locales/lang/en-US/routes/question.ts +++ b/src/locales/lang/en-US/routes/question.ts @@ -9,4 +9,5 @@ export default { question: 'question', issue: 'Issue', + issueDetail: 'Issue Detail', }; diff --git a/src/locales/lang/en-US/routes/system.ts b/src/locales/lang/en-US/routes/system.ts index ea8b90e..6e6229b 100644 --- a/src/locales/lang/en-US/routes/system.ts +++ b/src/locales/lang/en-US/routes/system.ts @@ -11,4 +11,5 @@ export default { dictionary: 'Dictionary', user: 'User', admin: 'Admin', + prodVersion: 'Production Version', }; diff --git a/src/locales/lang/zh-CN/routes/question.ts b/src/locales/lang/zh-CN/routes/question.ts index 4bfebf2..7f4b0f5 100644 --- a/src/locales/lang/zh-CN/routes/question.ts +++ b/src/locales/lang/zh-CN/routes/question.ts @@ -9,4 +9,5 @@ export default { question: '问题管理', issue: '工单管理', + issueDetail: '工单详情', }; diff --git a/src/locales/lang/zh-CN/routes/system.ts b/src/locales/lang/zh-CN/routes/system.ts index eb3fde5..68d70c4 100644 --- a/src/locales/lang/zh-CN/routes/system.ts +++ b/src/locales/lang/zh-CN/routes/system.ts @@ -3,4 +3,5 @@ export default { dictionary: '字典维护', user: '用户管理', admin: '管理员管理', + prodVersion: '产品版本管理', }; diff --git a/src/router/staticModules/question.ts b/src/router/staticModules/question.ts index 0ea735a..550a35c 100644 --- a/src/router/staticModules/question.ts +++ b/src/router/staticModules/question.ts @@ -21,10 +21,22 @@ const routes: Array = [ meta: { title: t('routes.question.issue'), icon: 'icon-icon_shiyongwendang', + keepAlive: true, }, component: () => import(/* webpackChunkName: "question-issue" */ '@/views/question/issue/index.vue'), }, + { + path: 'issueDetail', + name: `${moduleName}-issueDetail`, + meta: { + title: t('routes.question.issueDetail'), + icon: 'icon-icon_shiyongwendang', + hideInMenu: true, + }, + component: () => + import(/* webpackChunkName: "question-issue" */ '@/views/question/issue/detail.vue'), + }, ], }, ]; diff --git a/src/router/staticModules/system.ts b/src/router/staticModules/system.ts index cb7daa7..a59a8b7 100644 --- a/src/router/staticModules/system.ts +++ b/src/router/staticModules/system.ts @@ -55,6 +55,17 @@ const routes: Array = [ component: () => import(/* webpackChunkName: "system-admin" */ '@/views/system/admin/index.vue'), }, + { + path: 'prodVersion', + name: `${moduleName}-prodVersion`, + meta: { + title: t('routes.system.prodVersion'), + icon: 'icon-ziyuan', + keepAlive: true, + }, + component: () => + import(/* webpackChunkName: "system-prodVersion" */ '@/views/system/prodVersion/index.vue'), + }, ], }, ]; diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index d815a99..2ab173f 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,7 +1,7 @@ import { defineStore } from 'pinia'; import type { RouteRecordRaw } from 'vue-router'; import { store } from '@/store'; -import { login } from '@/api/login'; +import { login, getUserInfo } from '@/api/login'; import { ACCESS_TOKEN_KEY } from '@/enums/cacheEnum'; import { ACCESS_TOKEN_NAME } from '@/enums/cacheEnum'; import { Storage } from '@/utils/Storage'; @@ -73,7 +73,7 @@ export const useUserStore = defineStore({ async login(params: API.LoginParams) { try { const res = await login(params); - console.log('res: ', res); + console.log('res2222: ', res); this.setToken(res.tokenValue, res.tokenName); return this.afterLogin(); @@ -86,10 +86,16 @@ export const useUserStore = defineStore({ async afterLogin() { try { // const [userInfo, { perms, menus }] = await Promise.all([getInfo(), permmenu()]); - this.perms = perms; - this.name = userInfo.name; - this.avatar = userInfo.headImg; - this.userInfo = userInfo as any; + const userInfo = await getUserInfo(); + console.log('userInfo: ', userInfo); + // this.perms = perms; + this.name = userInfo.account; + // this.avatar = userInfo.headImg; + this.userInfo = { + ...userInfo, + name: userInfo.account, + username: userInfo.username, + }; // 生成路由 const generatorResult = await generatorDynamicRouter([]); console.timeEnd('generatorDynamicRouter'); diff --git a/src/utils/dict.ts b/src/utils/dict.ts new file mode 100644 index 0000000..949c925 --- /dev/null +++ b/src/utils/dict.ts @@ -0,0 +1,20 @@ +import { fetchDictValueListByType } from '@/api/dict'; + +export const getDictionaryByTypeName = async (name: string) => { + const res = await fetchDictValueListByType({ typeName: name }); + if (res && Array.isArray(res) && res.length) { + return res + .filter((e) => e.enable === 1) + .map((e) => { + return { + label: e.dictValue, + value: e.dictValue, + }; + }); + } +}; + +export const getLabelByDictId = ( + options: Array<{ label: string; value: string }>, + id: string, +) => {}; diff --git a/src/views/question/issue/columns.tsx b/src/views/question/issue/columns.tsx index 74d6bda..ab26c88 100644 --- a/src/views/question/issue/columns.tsx +++ b/src/views/question/issue/columns.tsx @@ -1,8 +1,13 @@ import type { TableColumn } from '@/components/core/dynamic-table'; import { stateTypeList } from './data'; import { Tag } from 'ant-design-vue'; +import { DictEnum } from '@/enums/dictEnum'; +import { getDictionaryByTypeName } from '@/utils/dict'; export type TableListItem = API.IssueType; export type TableColumnItem = TableColumn; + +// const questionTypeList = await getDictionaryByTypeName(DictEnum.QUESTION_TYPE); + // 数据项类型 // export type ListItemType = typeof tableData[number]; // 使用TableColumn 将会限制dataIndex的类型,但换来的是dataIndex有类型提示 @@ -30,11 +35,30 @@ export const baseColumns: TableColumnItem[] = [ required: false, }, }, + // { + // title: '问题属性', + // align: 'center', + // dataIndex: 'attribute', + // width: 150, + // formItemProps: { + // defaultValue: undefined, + // required: false, + // component: 'Select', + // componentProps: { + // options: questionTypeList, + // }, + // }, + // customRender: ({ record }) => { + // const label = questionTypeList?.find((e) => e.value === record.attribute)?.label; + + // return
{{ label }}
; + // }, + // }, { title: '问题号', align: 'center', dataIndex: 'billcode', - width: 150, + width: 200, formItemProps: { defaultValue: '', required: false, @@ -62,6 +86,17 @@ export const baseColumns: TableColumnItem[] = [ required: false, }, }, + { + title: '版本', + align: 'center', + dataIndex: 'version', + width: 150, + hideInSearch: true, + formItemProps: { + defaultValue: '', + required: false, + }, + }, { title: '代理商', align: 'center', diff --git a/src/views/question/issue/detail.vue b/src/views/question/issue/detail.vue new file mode 100644 index 0000000..a8c763f --- /dev/null +++ b/src/views/question/issue/detail.vue @@ -0,0 +1,150 @@ + + + + + diff --git a/src/views/question/issue/formSchemas.tsx b/src/views/question/issue/formSchemas.tsx index d357dfd..09ac62f 100644 --- a/src/views/question/issue/formSchemas.tsx +++ b/src/views/question/issue/formSchemas.tsx @@ -5,32 +5,53 @@ import { message, Button } from 'ant-design-vue'; import { getFileExtension } from '@/utils/fileUtils'; import { UploadOutlined } from '@ant-design/icons-vue'; import { stateTypeList } from './data'; -import { url } from 'inspector'; -import component from '@/locales/lang/en-US/component'; +import { DictEnum } from '@/enums/dictEnum'; +import { getDictionaryByTypeName } from '@/utils/dict'; +import { fetchProdList, fetchVersionPageList } from '@/api/prodVersion'; +const questionTypeList = await getDictionaryByTypeName(DictEnum.QUESTION_TYPE); // 编辑页字段 export const getEditFormSchema: ( row?: Partial, isDetail?: boolean, ) => FormSchema[] = (record = {}, isDetail = false) => { + console.log('questionTypeList: ', questionTypeList); + return [ { - field: 'title', + field: 'billcode', component: 'Input', - label: '问题标题', + label: '问题号', + dynamicDisabled: true, colProps: { - span: 12, + span: 24, }, - rules: [{ required: true }], }, - { - field: 'billcode', + field: 'title', component: 'Input', - label: '问题号', + componentProps: { + showCount: true, + maxlength: 150, + }, + label: '问题标题', colProps: { span: 12, }, + rules: [{ required: true }], }, + // { + // label: '问题属性', + // field: 'arrtibute', + // component: 'Select', + // componentProps: { + // options: questionTypeList, + // }, + // colProps: { + // span: 12, + // }, + // rules: [{ required: true, type: 'string' }], + // }, + { field: 'customer', component: 'Input', @@ -40,29 +61,70 @@ export const getEditFormSchema: ( }, }, { - field: 'product', - component: 'Input', + field: 'productId', + component: 'Select', + componentProps: ({ formModel, formInstance }) => { + return { + request: async () => { + const data = (await fetchProdList({})) as any; + return data.map((e) => { + return { + label: e.name, + value: e.id, + }; + }); + }, + onChange: async (e) => { + console.log('e: ', e); + const { data } = await fetchVersionPageList({ + productId: e, + current: 1, + size: 999, + }); + if (data && Array.isArray(data) && data.length) { + formInstance?.setFieldsValue({ + versionId: data[0].id, + }); + formInstance.updateSchema({ + field: 'versionId', + componentProps: { + options: data.map((e) => { + return { + label: e.name, + value: e.id, + }; + }), + }, + }); + } + }, + }; + }, label: '产品', colProps: { span: 12, }, }, { - field: 'agent', - component: 'Input', - label: '代理商', + field: 'versionId', + component: 'Select', + componentProps: { + options: [], + }, + label: '版本', colProps: { span: 12, }, }, { - field: 'attribute', + field: 'agent', component: 'Input', - label: '问题属性', + label: '代理商', colProps: { span: 12, }, }, + { field: 'serviceNumber', component: 'Input', @@ -94,6 +156,14 @@ export const getEditFormSchema: ( colProps: { span: 12, }, + rules: [ + { + required: false, + message: '请输入正确格式的电话号码', + pattern: + /^(1(3[0-9]|4[01456879]|5[0-3,5-9]|6[2567]|7[0-8]|8[0-9]|9[0-3,5-9])\d{8})$|^0\d{2,3}-?\d{7,8}$/, + }, + ], }, { field: 'state', @@ -113,6 +183,8 @@ export const getEditFormSchema: ( componentProps: { rows: 4, placeholder: '请输入问题描述', + showCount: true, + maxlength: 150, }, label: '问题描述', colProps: { @@ -120,9 +192,10 @@ export const getEditFormSchema: ( }, rules: [{ required: true }], }, + { label: '描述附件', - field: 'fileList', + field: 'files', component: 'Upload', componentProps: { disabled: isDetail, @@ -138,7 +211,7 @@ export const getEditFormSchema: ( console.log('file: ', file); // 限制允许上传的文件类型 - const allowedTypes = ['xlsx', 'xls', 'doc', 'docx', 'pdf']; + const allowedTypes = ['xlsx', 'xls', 'doc', 'docx', 'pdf', 'jpg', 'jpeg', 'png']; // 检查文件类型 const fileType = getFileExtension(file.name) || 'unknown'; @@ -167,5 +240,27 @@ export const getEditFormSchema: ( }, rules: [{ required: false }], }, + { + label: '解决方案', + field: 'solution', + colProps: { + span: 24, + }, + // rules: [{ required: true, type: 'array' }], + slot: 'solution', + }, ] as any; }; + +export const getFlowFormSchema: (row?: Partial) => FormSchema[] = (record = {}) => { + return [ + { + field: 'remark', + component: 'InputTextArea', + label: '文字补充内容', + colProps: { + span: 24, + }, + }, + ]; +}; diff --git a/src/views/question/issue/index.vue b/src/views/question/issue/index.vue index a884a35..ecfbe6e 100644 --- a/src/views/question/issue/index.vue +++ b/src/views/question/issue/index.vue @@ -31,7 +31,7 @@ + + + + + - diff --git a/src/views/system/prodVersion/Tree.vue b/src/views/system/prodVersion/Tree.vue new file mode 100644 index 0000000..07134f0 --- /dev/null +++ b/src/views/system/prodVersion/Tree.vue @@ -0,0 +1,325 @@ + + diff --git a/src/views/system/prodVersion/columns.tsx b/src/views/system/prodVersion/columns.tsx new file mode 100644 index 0000000..d6683f2 --- /dev/null +++ b/src/views/system/prodVersion/columns.tsx @@ -0,0 +1,30 @@ +/* + * @Author: AaronWu 2463371514@qq.com + * @Date: 2025-04-01 13:43:34 + * @LastEditors: AaronWu 2463371514@qq.com + * @LastEditTime: 2025-04-01 13:52:02 + * @FilePath: /IssueSupportManage/src/views/system/dictionary/columns.tsx + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import type { TableColumn } from '@/components/core/dynamic-table'; + +export type TableListItem = API.VersionType; +export type TableColumnItem = TableColumn; + +// 数据项类型 +// export type ListItemType = typeof tableData[number]; +// 使用TableColumn 将会限制dataIndex的类型,但换来的是dataIndex有类型提示 +export const baseColumns: TableColumnItem[] = [ + { + title: '版本名称', + align: 'center', + dataIndex: 'name', + width: 150, + ellipsis: true, + resizable: true, + formItemProps: { + defaultValue: '', + required: false, + }, + }, +]; diff --git a/src/views/system/prodVersion/formSchemas.ts b/src/views/system/prodVersion/formSchemas.ts new file mode 100644 index 0000000..f75a87b --- /dev/null +++ b/src/views/system/prodVersion/formSchemas.ts @@ -0,0 +1,48 @@ +import type { FormSchema } from '@/components/core/schema-form/'; + +// 列表编辑页字段 +export const editFormSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + vShow: false, + }, + { + label: '版本名称', + field: 'name', + component: 'Input', + colProps: { + span: 24, + }, + rules: [{ required: true }], + }, + { + label:'备注', + field: 'remark', + component: 'InputTextArea', + colProps: { + span: 24, + }, + rules: [{ required: false }], + } +]; + +// 新增产品表单 +export const prodFormSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + vShow: false, + }, + { + label: '名称', + field: 'name', + component: 'Input', + colProps: { + span: 24, + }, + rules: [{ required: true }], + }, +]; diff --git a/src/views/system/prodVersion/index.vue b/src/views/system/prodVersion/index.vue new file mode 100644 index 0000000..689dd0b --- /dev/null +++ b/src/views/system/prodVersion/index.vue @@ -0,0 +1,241 @@ + + + + + + diff --git a/src/views/system/prodVersion/mockData.ts b/src/views/system/prodVersion/mockData.ts new file mode 100644 index 0000000..d7c39bc --- /dev/null +++ b/src/views/system/prodVersion/mockData.ts @@ -0,0 +1,14 @@ +/* + * @Author: AaronWu 2463371514@qq.com + * @Date: 2025-04-01 13:24:31 + * @LastEditors: AaronWu 2463371514@qq.com + * @LastEditTime: 2025-04-01 13:25:12 + * @FilePath: /IssueSupportManage/src/views/system/dictionary/mockData.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +export const mockTree: any[] = [ + { + id: 1, + name: '字典类别', + }, +];