后台页面补丁
This commit is contained in:
parent
25f546333c
commit
b39ef26930
@ -2,5 +2,5 @@
|
||||
NODE_ENV = 'production'
|
||||
|
||||
# 打包模式连测试服
|
||||
#VUE_APP_BASE_API = './api-test'
|
||||
VUE_APP_BASE_API = './api-test'
|
||||
VUE_APP_BASE_API = '/'
|
||||
|
12
components.d.ts
vendored
12
components.d.ts
vendored
@ -13,24 +13,18 @@ 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']
|
||||
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']
|
||||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
||||
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
|
||||
ElCol: typeof import('element-plus/es')['ElCol']
|
||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
||||
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
|
||||
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
@ -46,7 +40,6 @@ declare module '@vue/runtime-core' {
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTag: typeof import('element-plus/es')['ElTag']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
ErrorLog: typeof import('./src/components/ErrorLog/index.vue')['default']
|
||||
GithubCorner: typeof import('./src/components/GithubCorner/index.vue')['default']
|
||||
Hamburger: typeof import('./src/components/Hamburger/index.vue')['default']
|
||||
@ -73,7 +66,4 @@ declare module '@vue/runtime-core' {
|
||||
UploadExcel: typeof import('./src/components/UploadExcel/index.vue')['default']
|
||||
VueCountTo: typeof import('./src/components/vue-count-to/vue-countTo.vue')['default']
|
||||
}
|
||||
export interface ComponentCustomProperties {
|
||||
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ const tokens = {
|
||||
},
|
||||
editor: {
|
||||
token: 'editor-token'
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
const users = {
|
||||
@ -20,13 +20,13 @@ const users = {
|
||||
introduction: 'I am an editor',
|
||||
avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
|
||||
name: 'Normal Editor'
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default [
|
||||
// user login
|
||||
{
|
||||
url: '/vue-element-admin/user/login',
|
||||
url: '/auth/login',
|
||||
method: 'post',
|
||||
response: config => {
|
||||
const { username } = config.body;
|
||||
|
7
package-lock.json
generated
7
package-lock.json
generated
@ -30,6 +30,7 @@
|
||||
"xlsx": "0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/sortablejs": "^1.15.8",
|
||||
"@vitejs/plugin-vue": "3.2.0",
|
||||
"@vitejs/plugin-vue-jsx": "2.1.1",
|
||||
"@vue/cli-plugin-typescript": "5.0.8",
|
||||
@ -1211,6 +1212,12 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/sortablejs": {
|
||||
"version": "1.15.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.15.8.tgz",
|
||||
"integrity": "sha512-b79830lW+RZfwaztgs1aVPgbasJ8e7AXtZYHTELNXZPsERt4ymJdjV4OccDbHQAvHrCcFpbF78jkm0R6h/pZVg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/web-bluetooth": {
|
||||
"version": "0.0.16",
|
||||
"resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz",
|
||||
|
@ -33,6 +33,7 @@
|
||||
"xlsx": "0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/sortablejs": "^1.15.8",
|
||||
"@vitejs/plugin-vue": "3.2.0",
|
||||
"@vitejs/plugin-vue-jsx": "2.1.1",
|
||||
"@vue/cli-plugin-typescript": "5.0.8",
|
||||
|
@ -1,10 +1,17 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function fetchList(query) {
|
||||
function getCurrentTimestamp() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
export function SystemGetByProjId(projectId, token) {
|
||||
return request({
|
||||
url: '/vue-element-admin/article/list',
|
||||
url: '/module/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
params: { projectId },
|
||||
headers: {
|
||||
'Authorization':'Bearer '+token,
|
||||
'content-type': 'application/json;charset=utf-8',
|
||||
'Timestamp': getCurrentTimestamp()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -90,6 +90,7 @@ export default defineComponent({
|
||||
console.log('5989569898')
|
||||
// store.user().login()
|
||||
await store.user().logout();
|
||||
console.log('hhhh')
|
||||
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ export default defineComponent({
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(store.app, ['sidebar']),
|
||||
...mapState(store.app, ['Sidebar']),
|
||||
...mapState(store.permission, {
|
||||
permission_routes: 'routes'
|
||||
}),
|
||||
|
@ -121,7 +121,7 @@ export const asyncRoutes:RouteRecordRaw[] = [
|
||||
alwaysShow: true, // will always show the root menu
|
||||
title: 'Permission',
|
||||
icon: 'lock',
|
||||
roles: ['admin', 'editor','teacher_user'] // you can set roles in root nav
|
||||
roles: ['admin', 'editor','teacher_user', 'xiao_lfeng'] // you can set roles in root nav
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
@ -10,22 +10,16 @@ const service = axios.create({
|
||||
timeout: 10000 // request timeout
|
||||
});
|
||||
|
||||
const service2 = axios.create({
|
||||
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
|
||||
// withCredentials: true, // send cookies when cross-domain requests
|
||||
timeout: 5000 // request timeout
|
||||
});
|
||||
|
||||
// request interceptor
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
// do something before request is sent
|
||||
|
||||
console.log('wwww')
|
||||
if (store.user().token) {
|
||||
// let each request carry token
|
||||
// ['X-Token'] is a custom headers key
|
||||
// please modify it according to the actual situation
|
||||
config.headers['token'] = getToken();
|
||||
config.headers['Token'] = getToken();
|
||||
}
|
||||
return config;
|
||||
},
|
||||
@ -36,6 +30,8 @@ service.interceptors.request.use(
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
// response interceptor
|
||||
service.interceptors.response.use(
|
||||
/**
|
||||
@ -88,74 +84,6 @@ service.interceptors.response.use(
|
||||
}
|
||||
);
|
||||
|
||||
service2.interceptors.request.use(
|
||||
config => {
|
||||
// do something before request is sent
|
||||
|
||||
if (store.user().token) {
|
||||
// let each request carry token
|
||||
// ['X-Token'] is a custom headers key
|
||||
// please modify it according to the actual situation
|
||||
config.headers['X-Token'] = getToken();
|
||||
}
|
||||
return config;
|
||||
},
|
||||
error => {
|
||||
// do something with request error
|
||||
console.log(error); // for debug
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
// response interceptor
|
||||
service2.interceptors.response.use(
|
||||
/**
|
||||
* If you want to get http information such as headers or status
|
||||
* Please return response => response
|
||||
*/
|
||||
|
||||
/**
|
||||
* Determine the request status by custom code
|
||||
* Here is just an example
|
||||
* You can also judge the status by HTTP Status Code
|
||||
*/
|
||||
response => {
|
||||
const res = response.data;
|
||||
|
||||
// if the custom code is not 20000, it is judged as an error.
|
||||
if (res.code !== 20000) {
|
||||
ElMessage({
|
||||
message: res.message || 'Error',
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
});
|
||||
|
||||
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
|
||||
if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
|
||||
// to re-login
|
||||
ElMessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
|
||||
confirmButtonText: 'Re-Login',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
store.user().resetToken();
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
return Promise.reject(new Error(res.message || 'Error'));
|
||||
} else {
|
||||
return res;
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error); // for debug
|
||||
ElMessage({
|
||||
message: error.message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
});
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
export default { service, service2 };
|
||||
export default service ;
|
||||
|
@ -15,7 +15,7 @@ export function isExternal(path) {
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
export function validUsername(str) {
|
||||
const valid_map = ['admin', 'editor', 'teacher_user'];
|
||||
const valid_map = ['admin', 'editor', 'teacher_user', 'xiao_lfeng'];
|
||||
return valid_map.indexOf(str.trim()) >= 0;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { defineComponent, h } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
created() {
|
||||
// console.log('redirect', this.$route);
|
||||
//console.log('redirect', this.$route);
|
||||
const { params, query } = this.$route;
|
||||
const { path } = params;
|
||||
this.$router.replace({ path: '/' + path, query });
|
||||
|
@ -32,17 +32,51 @@
|
||||
<el-card style="max-width: 100vw;margin: 1.5vw;">
|
||||
<div>
|
||||
<el-table :data="tableData" ref="multipleTableRef" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="date" label="序号"/>
|
||||
<el-table-column prop="name" label="项目名称"/>
|
||||
<el-table-column prop="address" label="工作量" />
|
||||
<el-table-column prop="address" label="周期" />
|
||||
<el-table-column prop="address" label="负责人" />
|
||||
<el-table-column prop="address" label="状态" />
|
||||
<el-table-column prop="address" label="标签" />
|
||||
<el-table-column prop="address" label="文档(点击下载)" />
|
||||
<el-table-column prop="address" label="截止时间" />
|
||||
<el-table-column prop="address" label="操作" />
|
||||
<el-table-column prop="id" label="序号">
|
||||
<template v-slot="{row}">
|
||||
<span>{{ row.id }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="子系统称">
|
||||
<template v-slot="{row}">
|
||||
<span>{{ row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workLoad" label="工作量">
|
||||
<template v-slot="{row}">
|
||||
<span>{{ row.workLoad }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cycle" label="周期">
|
||||
<template v-slot="{row}">
|
||||
<span>{{ row.cycle }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="principalId" label="负责人">
|
||||
<template v-slot="{row}">
|
||||
<span>{{ row.principalId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态">
|
||||
<template v-slot="{row}">
|
||||
<span>{{ row.status }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="description" label="子系统简介">
|
||||
<template v-slot="{row}">
|
||||
<span>{{ row.description }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="id" label="文档(点击下载)">
|
||||
<template v-slot="{row}">
|
||||
<span>{{ row.id }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="completeTime" label="截止时间">
|
||||
<template v-slot="{row}">
|
||||
<span>{{ row.completeTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: center;margin-top: 2vh">
|
||||
@ -90,8 +124,8 @@ const tableData = [
|
||||
},
|
||||
];
|
||||
</script>
|
||||
<!--
|
||||
<template>
|
||||
|
||||
<!--<template>
|
||||
<div class="app-container">
|
||||
<!– Note that row-key is necessary to get a correct row order. –>
|
||||
<el-table ref="dragTable" v-loading="listLoading" :data="list" row-key="id" border fit highlight-current-row style="width: 100%">
|
||||
@ -156,20 +190,22 @@ const tableData = [
|
||||
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { fetchList } from '@/api/article';
|
||||
import Sortable from 'sortablejs';
|
||||
import { SystemGetByProjId } from '@/api/article';
|
||||
import Sortable from "sortablejs";
|
||||
import { parseTime } from '@/utils';
|
||||
const token: string | null = window.localStorage.getItem('token')
|
||||
|
||||
export default defineComponent({
|
||||
name: 'DragTable',
|
||||
data() {
|
||||
return {
|
||||
list: null,
|
||||
list: [],
|
||||
total: null,
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
/* page: 1,
|
||||
limit: 10 */
|
||||
projectId:'',
|
||||
},
|
||||
sortable: null,
|
||||
oldList: [],
|
||||
@ -191,7 +227,7 @@ export default defineComponent({
|
||||
},
|
||||
async getList() {
|
||||
this.listLoading = true;
|
||||
const { data } = await fetchList(this.listQuery);
|
||||
const { data } = await SystemGetByProjId(this.listQuery, token);
|
||||
this.list = data.items;
|
||||
this.total = data.total;
|
||||
this.listLoading = false;
|
||||
@ -222,7 +258,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>-->
|
||||
|
||||
<style>
|
||||
.sortable-ghost{
|
||||
@ -245,4 +281,3 @@ export default defineComponent({
|
||||
margin-top: 15px;
|
||||
}
|
||||
</style>
|
||||
-->
|
||||
|
Loading…
x
Reference in New Issue
Block a user