diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index aeb48d4..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,213 +0,0 @@ -/* eslint-env node */ -module.exports = { - 'root': true, - 'env': { - 'browser': true, - 'node': true, - 'es6': true - }, - 'parser': 'vue-eslint-parser', - 'parserOptions': { - 'parser': '@typescript-eslint/parser', - 'ecmaVersion': 2020, - 'sourceType': 'module', - 'jsxPragma': 'React', - 'ecmaFeatures': { - 'jsx': true, - 'tsx': true - } - }, - 'plugins': ['@typescript-eslint', 'import'], - 'extends': [ - 'plugin:vue/vue3-essential', - 'plugin:@typescript-eslint/recommended', - 'eslint:recommended' - ], - 'globals': { - defineEmits: 'readonly', - defineProps: 'readonly', - defineExpose: 'readonly', - withDefaults: 'readonly', - WeixinJSBridge: 'readonly', - ElLoading: 'readonly', - ElMessage: 'readonly', - ElMessageBox: 'readonly', - ElNotification: 'readonly' - }, - 'rules': { - 'vue/no-multiple-template-root': 'off', - 'vue/multi-word-component-names': 'off', - 'vue/singleline-html-element-content-newline': 'off', - 'vue/multiline-html-element-content-newline': 'off', - 'vue/no-v-html': 'off', - 'accessor-pairs': 2, - 'arrow-spacing': [2, { - 'before': true, - 'after': true - }], - 'block-spacing': [2, 'always'], - 'brace-style': [2, '1tbs', { - 'allowSingleLine': true - }], - 'camelcase': [0, { - 'properties': 'always' - }], - 'comma-dangle': [2, 'never'], - 'comma-spacing': [2, { - 'before': false, - 'after': true - }], - 'comma-style': [2, 'last'], - 'constructor-super': 2, - 'curly': [2, 'multi-line'], - 'dot-location': [2, 'property'], - 'eol-last': 2, - 'eqeqeq': ['error', 'always', { 'null': 'ignore' }], - 'generator-star-spacing': [2, { - 'before': true, - 'after': true - }], - 'handle-callback-err': [2, '^(err|error)$'], - 'indent': [2, 2, { - 'SwitchCase': 1 - }], - 'jsx-quotes': [2, 'prefer-single'], - 'key-spacing': [2, { - 'beforeColon': false, - 'afterColon': true - }], - 'keyword-spacing': [2, { - 'before': true, - 'after': true - }], - 'new-cap': [2, { - 'newIsCap': true, - 'capIsNew': false - }], - 'new-parens': 2, - 'no-array-constructor': 2, - 'no-caller': 2, - 'no-console': 'off', - 'no-class-assign': 2, - 'no-cond-assign': 2, - 'no-const-assign': 2, - 'no-control-regex': 0, - 'no-delete-var': 2, - 'no-dupe-args': 2, - 'no-dupe-class-members': 2, - 'no-dupe-keys': 2, - 'no-duplicate-case': 2, - 'no-empty-character-class': 2, - 'no-empty-pattern': 2, - 'no-eval': 2, - 'no-ex-assign': 2, - 'no-extend-native': 2, - 'no-extra-bind': 2, - 'no-extra-boolean-cast': 2, - 'no-extra-parens': [2, 'functions'], - 'no-fallthrough': 2, - 'no-floating-decimal': 2, - 'no-func-assign': 2, - 'no-implied-eval': 2, - 'no-inner-declarations': [2, 'functions'], - 'no-invalid-regexp': 2, - 'no-irregular-whitespace': 2, - 'no-iterator': 2, - 'no-label-var': 2, - 'no-labels': [2, { - 'allowLoop': false, - 'allowSwitch': false - }], - 'no-lone-blocks': 2, - 'no-mixed-spaces-and-tabs': 2, - 'no-multi-spaces': 2, - 'no-multi-str': 2, - 'no-multiple-empty-lines': [2, { - 'max': 1 - }], - 'no-native-reassign': 2, - 'no-negated-in-lhs': 2, - 'no-new-object': 2, - 'no-new-require': 2, - 'no-new-symbol': 2, - 'no-new-wrappers': 2, - 'no-obj-calls': 2, - 'no-octal': 2, - 'no-octal-escape': 2, - 'no-path-concat': 2, - 'no-proto': 2, - 'no-redeclare': 2, - 'no-regex-spaces': 2, - 'no-return-assign': [2, 'except-parens'], - 'no-self-assign': 2, - 'no-self-compare': 2, - 'no-sequences': 2, - 'no-shadow-restricted-names': 2, - 'no-spaced-func': 2, - 'no-sparse-arrays': 2, - 'no-this-before-super': 2, - 'no-throw-literal': 2, - 'no-trailing-spaces': 2, - 'no-undef': 2, - 'no-undef-init': 2, - 'no-unexpected-multiline': 2, - 'no-unmodified-loop-condition': 2, - 'no-unneeded-ternary': [2, { - 'defaultAssignment': false - }], - 'no-unreachable': 2, - 'no-unsafe-finally': 2, - 'no-unused-vars': [2, { - 'vars': 'all', - 'args': 'none' - }], - 'no-useless-call': 2, - 'no-useless-computed-key': 2, - 'no-useless-constructor': 2, - 'no-useless-escape': 0, - 'no-whitespace-before-property': 2, - 'no-with': 2, - 'one-var': [2, { - 'initialized': 'never' - }], - 'operator-linebreak': [2, 'after', { - 'overrides': { - '?': 'before', - ':': 'before' - } - }], - 'padded-blocks': [2, 'never'], - 'quotes': [2, 'single', { - 'avoidEscape': true, - 'allowTemplateLiterals': true - }], - 'semi': [2, 'always'], - 'semi-spacing': [2, { - 'before': false, - 'after': true - }], - 'space-before-blocks': [2, 'always'], - 'space-before-function-paren': 'off', - 'space-in-parens': [2, 'never'], - 'space-infix-ops': 2, - 'space-unary-ops': [2, { - 'words': true, - 'nonwords': false - }], - 'spaced-comment': [2, 'always', { - 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] - }], - 'template-curly-spacing': [2, 'never'], - 'use-isnan': 2, - 'valid-typeof': 2, - 'wrap-iife': [2, 'any'], - 'yield-star-spacing': [2, 'both'], - 'yoda': [2, 'never'], - 'prefer-const': 2, - 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, - 'object-curly-spacing': [2, 'always', { - objectsInObjects: false - }], - 'array-bracket-spacing': [2, 'never'] - } -}; diff --git a/components.d.ts b/components.d.ts index b350e78..eaf85bb 100644 --- a/components.d.ts +++ b/components.d.ts @@ -13,11 +13,12 @@ declare module '@vue/runtime-core' { DropdownMenu: typeof import('./src/components/Share/DropdownMenu.vue')['default'] Dropzone: typeof import('./src/components/Dropzone/index.vue')['default'] EditorImage: typeof import('./src/components/Tinymce/components/EditorImage.vue')['default'] - ElAlert: typeof import('element-plus/es')['ElAlert'] + ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] + ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElCard: typeof import('element-plus/es')['ElCard'] ElCol: typeof import('element-plus/es')['ElCol'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] @@ -47,7 +48,6 @@ declare module '@vue/runtime-core' { ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElTableRow: typeof import('element-plus/es')['ElTableRow'] ElTag: typeof import('element-plus/es')['ElTag'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElUpload: typeof import('element-plus/es')['ElUpload'] diff --git a/src/api/project.js b/src/api/project.js new file mode 100644 index 0000000..fe66bd1 --- /dev/null +++ b/src/api/project.js @@ -0,0 +1,233 @@ +import request from '@/utils/request'; + +function getCurrentTimestamp() { + return new Date().getTime(); +} +const api = 'http://nbxt.oa.x-lf.cn' + +//我负责的页面获取项目 +export function GetProject(page, pageSize, token) { + return request({ + url:api + '/project/my/get', + method: 'get', + params: { page, pageSize }, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//新增项目 +export function AddProject(data, token) { + return request({ + url:api + '/project/add', + method: 'post', + data, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//删除项目 +export function DeleteProject(id, token) { + return request({ + url:api + '/project/delete', + method: 'delete', + params:{ id }, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//编辑项目 +export function EditProject(id, data, token) { + return request({ + url:api + '/project/edit', + method: 'put', + params:{ id }, + data, + headers: { + 'Authorization': 'Bearer ' + token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//根据项目名字模糊查询 +export function GetProjectByName(name, token) { + return request({ + url:api + '/project/get/name', + method: 'get', + params: { name }, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//根据项目id查询子系统 +export function GetChildSysById(projectId, token) { + return request({ + url:api + "/module/get?projectId=" + projectId , + method: 'get', + params: { projectId }, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//根据项目名和子系统名查询子模块 +export function GetChildSysByName(projectName, childName, token) { + return request({ + url:api + '/project/module/get/name', + method: 'get', + params: { projectName, childName }, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//新增子系统 +export function AddChildSystem(data, token) { + return request({ + url:api + '/project/child/add', + method: 'post', + data, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//删除子系统 +export function DeleteChildSystem(id, token) { + return request({ + url:api + '/project/child/delete', + method: 'delete', + params:{ id }, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//编辑子系统 +export function EditChildSystem(id, data, token) { + return request({ + url:api + "/project/child/edit", + method: 'put', + data, + params: id, + headers: { + 'Authorization': 'Bearer ' + token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//根据子系统id获取子模块 +export function GetChildModById(sysId, token) { + return request({ + url:api + "/module/get/min?sysId=" + sysId , + method: 'get', + params: { sysId }, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//新增子模块 +export function AddChildModule(data, token) { + return request({ + url:api + '/project/module/add', + method: 'post', + data, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//删除子模块 +export function DeleteChildModule(id, token) { + return request({ + url:api + '/project/module/delete', + method: 'delete', + params:{ id }, + headers: { + 'Authorization':'Bearer '+ token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//编辑子模块 +export function EditChildModule(id, data, token) { + return request({ + url:api + "/project/module/edit", + method: 'put', + data, + params:{ id }, + headers: { + 'Authorization': 'Bearer ' + token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + + +//子模块详情 +export function ModuleDetails(id, token) { + return request({ + url:api + "/project/module/id", + method: 'get', + params:{ id }, + headers: { + 'Authorization': 'Bearer ' + token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} + +//指定项目负责人 +export function GetAppointOptions( token) { + return request({ + url:api + "/project/pri", + method: 'get', + headers: { + 'Authorization': 'Bearer ' + token, + 'content-type': 'application/json;charset=utf-8', + 'Timestamp': getCurrentTimestamp() + } + }); +} diff --git a/src/api/user.js b/src/api/user.js index ab887fe..78b5f7e 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -1,5 +1,4 @@ import request from '@/utils/request'; - const api = 'http://nbxt.oa.x-lf.cn' function getCurrentTimestamp() { @@ -7,7 +6,7 @@ function getCurrentTimestamp() { } export function login(data) { return request({ - url: api+ '/auth/login', + url: api + '/auth/login', method: 'post', data, headers: { @@ -31,7 +30,7 @@ export function getInfo(token) { export function logout(token) { return request({ - url: api +'/auth/logout', + url:api+ '/auth/logout', method: 'get', headers: { 'Authorization':'Bearer '+token, diff --git a/src/router/modules/manage.ts b/src/router/modules/manage.ts index 7dd06da..ed6a8f6 100644 --- a/src/router/modules/manage.ts +++ b/src/router/modules/manage.ts @@ -5,8 +5,8 @@ const Layout = () => import('@/layout/index.vue') const manageRouter = { path: '/myslef', component: Layout, - - + + meta: { alwaysShow: false, // 始终显示根菜单 title: '个人项目', @@ -14,39 +14,59 @@ const manageRouter = { roles: ['admin', 'teacher_user'] }, children: [ + //我负责的以及子页面 { path: 'charge', component: () => import('@/views/personal/project/charge.vue'), name: 'Charge', meta: { title: '我负责的', icon: 'user', affix: true } }, + { + path: 'childSysCharge', + component: () => import('@/views/personal/project/childSystem/charge.vue'), + name: 'ChildSysCharge', + meta: { title: '我负责的 / 子系统', breadcrumb: true , hidden: true }, + + }, + { + path: 'childModCharge', + component: () => import('@/views/personal/project/childmodel/charge.vue'), + name: 'ChildModCharge', + meta: { title: '我负责的 / 子系统 / 子模块', breadcrumb: true , hidden: true } + }, + { + path:'chargeDetail', + component: () => import('@/views/personal/project/detail/charge.vue'), + name: 'ChargeDetail', + meta: { title: '我负责的 / 子系统 / 子模块 / 详情', breadcrumb: true , hidden: true } + }, + //我管理的以及子页面 - { path: 'manage', component: () => import('@/views/personal/project/manage.vue'), name: 'Manage', meta: { title: '我管理的', icon: 'user', affix: true, }, - + }, { path: 'childSysManage', component: () => import('@/views/personal/project/childSystem/manage.vue'), name: 'ChildSysManage', - meta: { title: '我管理的 / 子系统', breadcrumb: true , hidden: true }, - + meta: { title: '我管理的 / 子系统', breadcrumb: true , hidden: true }, + }, { path: 'childModManage', - component: () => import('@/views/personal/project/childModel/manage.vue'), + component: () => import('@/views/personal/project/childmodel/manage.vue'), name: 'ChildModManage', - meta: { title: '我管理的 / 子系统 / 子模块', breadcrumb: true , hidden: true } + meta: { title: '我管理的 / 子系统 / 子模块', breadcrumb: true , hidden: true } }, { path:'manageDetail', component:()=>import('@/views/personal/project/detail/manage.vue'), name: 'ManageDetail', - meta: { title: '我管理的 / 子系统 / 子模块 / 详情', breadcrumb: true , hidden: true } + meta: { title: '我管理的 / 子系统 / 子模块 / 详情', breadcrumb: true , hidden: true } }, //我参与的以及子界面 { @@ -59,23 +79,23 @@ const manageRouter = { path: 'childSysParticipate', component: () => import('@/views/personal/project/childSystem/participate.vue'), name: 'ChildSysParticipate', - meta: { title: '我参与的 / 子系统', breadcrumb: true , hidden: true ,affix:false}, - + meta: { title: '我参与的 / 子系统', breadcrumb: true , hidden: true ,affix:false}, + }, { path: 'childModParticipate', - component: () => import('@/views/personal/project/childModel/participate.vue'), + component: () => import('@/views/personal/project/childmodel/participate.vue'), name: 'ChildModParticipate', - meta: { title: '我参与的 / 子系统 / 子模块', breadcrumb: true , hidden: true } + meta: { title: '我参与的 / 子系统 / 子模块', breadcrumb: true , hidden: true } }, { path: 'participateDetail', component:()=>import('@/views/personal/project/detail/participate.vue'), name: 'ParticipateDetail', - meta: { title: '我参与的 / 子系统 / 子模块 /详情', breadcrumb: true , hidden: true } + meta: { title: '我参与的 / 子系统 / 子模块 /详情', breadcrumb: true , hidden: true } } ] } -export default manageRouter \ No newline at end of file +export default manageRouter diff --git a/src/views/personal/project/charge.vue b/src/views/personal/project/charge.vue index 5cd477b..93fbd8e 100644 --- a/src/views/personal/project/charge.vue +++ b/src/views/personal/project/charge.vue @@ -1,3 +1,683 @@ \ No newline at end of file +
+ + + +
+ + + + + + +
+ + + + 查询 + + + + 重置 + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + 未开始 + 进行中 + 已完成 + 已暂停 + + + + + + + + + 上传文档 + + + + + + +
+ +
+ + + + 确认删除该项目吗? + + + + + + 确认删除该项目吗? + + + + + + + + + + + + + + + + + + + + + 未开始 + 进行中 + 已完成 + 已暂停 + + + + + + + + + +
+ +
+
+
+ +
+
+ + diff --git a/src/views/personal/project/childSystem/charge.vue b/src/views/personal/project/childSystem/charge.vue new file mode 100644 index 0000000..4cd2c88 --- /dev/null +++ b/src/views/personal/project/childSystem/charge.vue @@ -0,0 +1,689 @@ + + + diff --git a/src/views/personal/project/childmodel/charge.vue b/src/views/personal/project/childmodel/charge.vue new file mode 100644 index 0000000..9b589c9 --- /dev/null +++ b/src/views/personal/project/childmodel/charge.vue @@ -0,0 +1,685 @@ + + + diff --git a/src/views/personal/project/detail/charge.vue b/src/views/personal/project/detail/charge.vue new file mode 100644 index 0000000..1e513b8 --- /dev/null +++ b/src/views/personal/project/detail/charge.vue @@ -0,0 +1,155 @@ + + + diff --git a/src/views/personal/project/manage.vue b/src/views/personal/project/manage.vue index fc3fc29..da20d04 100644 --- a/src/views/personal/project/manage.vue +++ b/src/views/personal/project/manage.vue @@ -189,20 +189,20 @@ const fetchData = () => { project.then(res => { const data = res.data.data.list; const dataTotal = res.data.data.total; - - + + total.value = dataTotal; - + if (data) { const newData = data.map(item => parseData(item)); console.log(newData); - + tableData.value = newData; console.log(tableData.value); - + initialTableData.value = tableData.value.slice(); } else { console.log("没有可用数据"); @@ -337,13 +337,13 @@ const showEditDialog = () => { const idToEdit = selectedIds.value[0]; // 由于是编辑,只选中一个进行编辑 const projectToEdit = tableData.value.find(project => project.id === idToEdit); - + if (projectToEdit) { editFormData.value = { ...projectToEdit }; editFormData.value.tags = projectToEdit.tags.tags; editFormData.value.files = projectToEdit.files.URI; - - + + isDialogVisible.value = true; } else { ElMessage.error('选中的项目未找到'); @@ -369,7 +369,7 @@ const submitEditForm = async () => { status: editFormData.value.status } console.log(body); - + editProject(body, editFormData.value.id, getToken()).then(res => { console.log(res); if (res.data.code === 200) { @@ -384,13 +384,8 @@ const submitEditForm = async () => { console.log(err); ElMessage.error('更新失败'); }); - - - }; - - \ No newline at end of file +