Merge branch 'user-modify'

# Conflicts:
#	src/api/ThirdApi.js
This commit is contained in:
yuping
2023-08-25 16:10:34 +08:00
36 changed files with 386 additions and 170 deletions

View File

@@ -28,8 +28,8 @@ import BreadCrumb from "@/components/BreadCrumb";
import zhCN from "ant-design-vue/es/locale/zh_CN";
import * as api1 from "@/api/index1";
import * as api2 from "@/api/index";
import {boeRequest, request} from "@/api/request";
import {USER_PERMISSION} from "@/api/apis";
import {request} from "@/api/request";
import {USER_PERMISSION, VALIDATE_TOKEN} from "@/api/apis";
const store = useStore();
const isLogin = ref(false);
@@ -37,13 +37,11 @@ const isLogin = ref(false);
console.log("版本3.1.2------------");
// 监听关闭浏览器
let time1 = ref(0);
let time2 = ref(0);
onMounted(() => {
init()
window.addEventListener('beforeunload', e => beforeunloadHandler(e));
window.addEventListener('unload', e => unloadHandler(e));
})
@@ -53,18 +51,7 @@ function beforeunloadHandler() {
time1.value = new Date().getTime();
}
function init() {
getUserInfo();
getUserPermission();
initDict("content_type"); //内容分类
initDict("project_level"); //项目级别
initDict("project_sys"); //培训分类
initDict("project_pic"); //项目封面
initDict("router_pic"); //路径图封面
initDict("course_pic"); //课程封面
initDict("job_type"); //岗位
initDict("band"); //band
}
function unloadHandler() {
time2.value = new Date().getTime() - time1.value;
@@ -74,23 +61,6 @@ function unloadHandler() {
}
}
async function getUserInfo() {
const userInfo = await api2.userInfo();
store.commit("SET_USER", userInfo.data.data);
}
async function initDict(key) {
const list = await getDictList(key);
store.commit("SET_DICT", {key, data: list});
}
function getUserPermission(){
request(USER_PERMISSION,{permissionType:'PAGE'}).then(res=>{
store.commit("SET_PERMISSION", res.result.flatMap(t=>t?.permissionPageList.map(s=>s.url)));
})
}
const getDictList = (param) => api1.getDictTree({code: param,}).then((res) => res.data.data);
</script>
<style lang="scss">
#app {
@@ -109,6 +79,7 @@ const getDictList = (param) => api1.getDictTree({code: param,}).then((res) => re
text-align: center !important;
}
}
.ant-table-tbody > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td {
background: #f6f9fd;
}

View File

@@ -12,6 +12,10 @@ export const CASE_PAGE = "/systemapi/xboe/m/boe/cases/pagelist post formData";
export const EXAM_PAPER_PAGE = "/systemapi/xboe/m/exam/paper/querylist post formData";
export const TEST_PAGE = "/api/b1/system/quiz/quiz-list post formData";
export const ONLINE_PAGE = "/systemapi/xboe/m/course/manage/pagelist post formData";
export const LOGOUT = "/userbasic/logout post";
export const REFRESH_TOKEN_API = "/userbasic/refreshToken";
export const COURSE_AUDIT = "/xboe/m/course/manage/audit post formData";
export const OTHER_AUDIT = "/xboe/m/course/audit/appoint post formData";
export const ONLINE_COURSE_DEL = (id, courseId) => `/systemapi/xboe/school/study/course/delete-signup?id=${id}&couserId=${courseId} post`;

View File

@@ -26,9 +26,12 @@ export const ASSESSMENT_DETAIL = (assessmentId)=>`/assessment/queryAssessmentDet
export const USER_LIST_PAGE = "/admin/thirdApi/user/list";
//学员列表 没有分页数据 只能通过名称检索 速度较快
export const USER_LIST = "/admin/thirdApi/user/searchList";
export const USER_LIST = "/admin/thirdApi/user/list";
export const ORG_LIST = "/admin/thirdApi/org/list";
export const ORG_CHILD_LIST = "/admin/thirdApi/org/info";
export const AUDIENCE_LIST = "/admin/thirdApi/audience/userAudiences";
export const USER_PERMISSION = "/admin/thirdApi/permission/listByUser";
export const VALIDATE_TOKEN = "/admin/thirdApi/validateToken";
export const REFRESH_TOKEN = "/admin/thirdApi/refreshToken";
export const USER_INFO = "/admin/CheckUser/userInfo";

View File

@@ -8,6 +8,7 @@
*/
import http from "./config";
import qs from "qs";
import {getCookieForName} from "@/api/method";
// import { getCookie } from '../api/method'
/**
* 接口传参数方式get
@@ -188,7 +189,7 @@ export const auditStudentBatch = (obj) => http.post('/admin/student/auditStudent
// //面授课批量导入成绩
export const batchImportScore = (obj) =>
http.post('/admin/student/importHomeWork', obj, {
headers: { "Content-Type": "multipart/form-data" },
headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") },
});
//数据导入状态
export const getImportStatus = (uuid) => http.get('/admin/student/getImportStatus', { params: { uuid: uuid } })
@@ -197,7 +198,7 @@ export const getImportStatus = (uuid) => http.get('/admin/student/getImportStatu
// export const exportHomeWork=(obj)=>http.get('admin/student/exportHomeWork',{params:obj})
// 面授课导入学员
export const FaceTeachImportStudent = (obj) => http.post('/admin/student/importStudent', obj, { headers: { "Content-Type": "multipart/form-data" } })
export const FaceTeachImportStudent = (obj) => http.post('/admin/student/importStudent', obj, { headers: { "Content-Type": "multipart/form-data" },token:getCookieForName("token") })
//成绩录入
export const updateStudent = (obj) => http.post('/admin/student/homeWorkScoreEntry', obj)
@@ -227,7 +228,7 @@ export const createExamination = (obj) => http.post('/examination/createExaminat
//催促考试
export const batchSendMessage = (obj) => http.post('/admin/taskmanage/batchSendMessage', obj)
// 外部考试导入成绩
export const ImportExternalExamScore = (obj) => http.post('/admin/external/exam/manage/importExternalExamScore', obj, { headers: { "Content-Type": "multipart/form-data" } })
export const ImportExternalExamScore = (obj) => http.post('/admin/external/exam/manage/importExternalExamScore', obj, { headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") } })
//分组
export const changeGroupByStudentId = (obj) => http.post('/admin/student/changeGroupByStudentId', obj)
//导入小组

View File

@@ -1,4 +1,5 @@
import http from "./config";
import {getCookieForName} from "@/api/method";
// import qs from 'qs';
/**
@@ -42,13 +43,13 @@ export const createEvaluation = (obj) =>
//上传组件
export const fileUp = (data) =>
http.post("/file/upload", data, {
headers: { "Content-Type": "multipart/form-data" },
headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") },
});
//上传文件
export const baseVoteupload = (data) =>
http.post("/vote/baseVoteupload", data, {
headers: { "Content-Type": "multipart/form-data" },
headers: { "Content-Type": "multipart/form-data",token:getCookieForName("token") },
});
//删除测评信息

View File

@@ -1,5 +1,6 @@
import http from "./config";
import qs from "qs";
import {getCookieForName} from "@/api/method";
/**
* 接口传参数方式get
@@ -44,7 +45,7 @@ import qs from "qs";
export const baseVoteupload = (obj) =>
http.post("/vote/baseVoteupload", obj, {
headers: {
token: "123",
token: getCookieForName("token"),
"Content-Type": "multipart/form-data",
},
});

View File

@@ -1,8 +1,10 @@
import {isRef, reactive, ref, toRefs, unref, watch, watchEffect} from "vue";
import {getCookieForName, throttle} from "@/api/method";
import {getCookieForName, setCookie, throttle} from "@/api/method";
import JSONBigInt from "json-bigint";
import router from "@/router";
import {message} from "ant-design-vue";
import {REFRESH_TOKEN, VALIDATE_TOKEN} from "@/api/apis";
import {REFRESH_TOKEN_API} from "@/api/ThirdApi";
const JSONBigIntStr = JSONBigInt({ storeAsString: true });
@@ -79,68 +81,68 @@ export function useBoeApiPage(_url, params = {}, config = {
};
}
export function useBoeApi(_url, params = {}, config = {
init: true,
result: res => res.result,
}) {
// export function useBoeApi(_url, params = {}, config = {
// init: true,
// result: res => res.result,
// }) {
//
// const state = reactive({
// data: [],
// loading: false,
// });
// watch(() => params, () => {
// fetch();
// });
//
// function fetch() {
// state.loading = true;
// return boeRequest(_url, params).then(r => {
// state.data = config.result(r);
// state.loading = false;
// });
// }
//
// config.init && fetch();
// return {
// ...toRefs(state),
// fetch,
// };
// }
const state = reactive({
data: [],
loading: false,
});
watch(() => params, () => {
fetch();
});
function fetch() {
state.loading = true;
return boeRequest(_url, params).then(r => {
state.data = config.result(r);
state.loading = false;
});
}
config.init && fetch();
return {
...toRefs(state),
fetch,
};
}
export function useBoeUserListPage(_url, params = {}, init = true) {
const state = reactive({
data: [],
loading: false,
total: 0,
totalPage: 0,
page: 1,
...params
});
watch(() => params.keyword, throttle(fetch, 600));
watch(() => params.page, fetch);
function fetch() {
state.loading = true;
if (!params.keyword) {
state.loading = false;
return;
}
return boeRequest(_url, params).then(r => {
state.data = params.page === 1 ? r.result.userInfoList : [...state.data, ...r.result.userInfoList];
state.totalPage = r.result.totalPage;
state.total = r.result.totalElement;
state.loading = false;
});
}
init && fetch();
return {
...toRefs(state),
fetch,
};
}
// export function useBoeUserListPage(_url, params = {}, init = true) {
//
// const state = reactive({
// data: [],
// loading: false,
// total: 0,
// totalPage: 0,
// page: 1,
// ...params
// });
//
// watch(() => params.keyword, throttle(fetch, 600));
// watch(() => params.page, fetch);
//
// function fetch() {
// state.loading = true;
// if (!params.keyword) {
// state.loading = false;
// return;
// }
// return boeRequest(_url, params).then(r => {
// state.data = params.page === 1 ? r.result.userInfoList : [...state.data, ...r.result.userInfoList];
// state.totalPage = r.result.totalPage;
// state.total = r.result.totalElement;
// state.loading = false;
// });
// }
//
// init && fetch();
// return {
// ...toRefs(state),
// fetch,
// };
// }
export function useNewRowsPageNoInit(_url, params) {
const state = reactive({
data: [],
@@ -247,6 +249,57 @@ export function useRowsPage(_url, params, init = true) {
};
}
/**
* 分页只返回 total 无分页信息
* @param _url
* @param params
* @param init
* @param listing
*/
export function useTotalPage(_url, params, init = true,listing = false) {
const state = reactive({
data: [],
total: 1,
current: 1,
pages: 1,
pageNo: 1,
pageSize: 10,
loading: false
});
if (isRef(params) && listing) {
watch(params.value, () => {
fetch();
});
}
if (isRef(_url)) {
watchEffect(fetch);
} else {
init && fetch();
}
function reset() {
state.data = [];
state.loading = false;
}
function fetch() {
state.loading = true;
return request(unref(_url), unref(params)).then(r => {
state.data = r.data.list;
state.total = r.data.total;
state.loading = false;
});
}
return {
...toRefs(state),
fetch,
reset,
};
}
export function usePage(_url, params, init = true,listing = false) {
const state = reactive({
@@ -291,6 +344,42 @@ export function usePage(_url, params, init = true,listing = false) {
reset,
};
}
export function useThrottlePage(_url, params = {}, init = true) {
const state = reactive({
data: [],
loading: false,
total: 0,
totalPage: 0,
page: 1,
pageNo: 1,
...params
});
watch(() => params.keyword, throttle(fetch, 600));
watch(() => params.page, fetch);
function fetch() {
state.loading = true;
if (!params.keyword) {
state.loading = false;
return;
}
return request(_url, params).then(r => {
state.data = params.pageNo === 1 ? r.data.list : [...state.data, ...r.data.list];
state.totalPage = r.data.total/10 || 1;
state.total = r.data.total;
state.loading = false;
});
}
init && fetch();
return {
...toRefs(state),
fetch,
};
}
export function useRequest(_url, params, init = true) {
@@ -318,7 +407,32 @@ export function useRequest(_url, params, init = true) {
fetchData,
};
}
export function useArrayRequest(_url, params, init = true) {
const data = ref([]);
const loading = ref(false);
if (isRef(params)) {
watch(params.value, () => {
fetchData();
});
}
function fetchData() {
loading.value = true;
request(_url, unref(params)).then(r => {
data.value = r.data;
loading.value = false;
});
}
init && fetchData();
return {
data,
loading,
fetchData,
};
}
export async function boeRequest(_url, params = {}) {
const s = _url.split(" ");
let url = s[0];
@@ -380,13 +494,20 @@ export async function request(_url, params) {
if (res.code === 0 || res.code === 200) {
return res;
}
if (res.code === 1000) {
if (res.code === 1000 || res.code === 1002) {
(process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ?
router.push({path: 'login', query: { returnUrl: router.currentRoute.value.fullPath }}) :
(window.location.href = process.env.VUE_APP_LOGIN_URL + encodeURIComponent(window.location.protocol + process.env.VUE_APP_BOE_API_URL + process.env.VUE_APP_BASE + router.currentRoute.value.fullPath))
localStorage.removeItem('refreshPage')
return Promise.reject(res);
}else if(res.code=== 1001){
return boeRequest(REFRESH_TOKEN_API).then((res)=>{
if(res.code===0 || res.code === 200){
return request(_url, params)
}
})
}
//刷新token
res.show ? message.error(res.msg):message.error('系统接口数据异常,请联系管理员');
return Promise.reject(res);
});

View File

@@ -174,26 +174,26 @@
<router-link to="/researchmanage">评估管理</router-link>
</a-menu-item>
<a-sub-menu key="sub6">
<template #icon>
<div class="imgBox">
<img
style="width: 22px; height: 22px"
src="../assets/images/navleft/review.png"
/>
</div>
</template>
<template #title>系统管理</template>
<a-menu-item key="sub6-1">
<span
:class="{
circleActive: selectedKeys[0] === 'sub6-1',
circle: selectedKeys[0]!=='sub6-1',
}"
></span>
<router-link to="/dictmanage">字典管理</router-link>
</a-menu-item>
</a-sub-menu>
<!-- <a-sub-menu key="sub6">-->
<!-- <template #icon>-->
<!-- <div class="imgBox">-->
<!-- <img-->
<!-- style="width: 22px; height: 22px"-->
<!-- src="../assets/images/navleft/review.png"-->
<!-- />-->
<!-- </div>-->
<!-- </template>-->
<!-- <template #title>系统管理</template>-->
<!-- <a-menu-item key="sub6-1">-->
<!-- <span-->
<!-- :class="{-->
<!-- circleActive: selectedKeys[0] === 'sub6-1',-->
<!-- circle: selectedKeys[0]!=='sub6-1',-->
<!-- }"-->
<!-- ></span>-->
<!-- <router-link to="/dictmanage">字典管理</router-link>-->
<!-- </a-menu-item>-->
<!-- </a-sub-menu>-->
<a-menu-item key="sub5" v-if="checkMenu('systemManage')">
<div class="imgBox">
@@ -438,7 +438,6 @@
/>
</div>
<a target="_blank" :href="oldManage">旧版管理员界面</a>
<!-- <router-link target="_blank" to="/oldsystemmanage">旧版管理员界面</router-link> -->
</a-menu-item>
<a-menu-item key="sub17" v-if="checkMenu('ReadingClubManage')">
<div class="imgBox">

View File

@@ -49,6 +49,8 @@ import {computed, reactive} from "vue";
import {studentUrl,teacherUrl} from "@/api/method";
import router from "@/router";
import {useStore, createStore} from "vuex";
import {boeRequest, request} from "@/api/request";
import {LOGOUT} from "@/api/ThirdApi";
const store = useStore();
@@ -83,9 +85,11 @@ const changeRole = (value) => {
}
});
};
const logOut = () => {
const logOut = async () => {
await boeRequest(LOGOUT,{from:'pc'})
store.replaceState(createStore({state: {openpages: []}}).state);
localStorage.clear();
sessionStorage.clear();
(process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ? router.push({path: '/login'}) : (window.location.href = window.location.protocol + process.env.VUE_APP_LOGIN_URL)
};
</script>

View File

@@ -5,6 +5,7 @@
:show-upload-list="showUploadList"
:multiple="multiple"
:before-upload="beforeUpload"
:headers="headers"
@change="handleChange"
ref="imageRef"
>
@@ -17,6 +18,7 @@
import {defineProps, defineEmits, defineExpose, ref, watch} from "vue";
import {message} from "ant-design-vue";
import {FILE_UPLOAD_URL} from "@/api/config";
import {getCookieForName} from "@/api/method";
const props = defineProps({
value: {
@@ -41,7 +43,7 @@ const emit = defineEmits({})
const files = ref([])
const imageRef = ref()
const headers = { token: getCookieForName("token") };
watch(props, () => {
props.value.length !== files.value.length && (files.value = props.value)
})

View File

@@ -31,6 +31,7 @@
:data="data"
:multiple="true"
:name="name"
:headers="headers"
:accept="accept"
:action="uploadUrl"
@change="handleChange"
@@ -99,6 +100,7 @@ import {getImportStatus} from "@/api/index1";
import {useTimeout} from "@/utils/useCommon";
import err from "@/assets/images/err.png";
import success from "@/assets/images/success.png";
import {getCookieForName} from "@/api/method";
const props = defineProps({
url: String,
@@ -115,6 +117,7 @@ const props = defineProps({
const emit = defineEmits({});
const visible = ref(false);
const fileList = ref([]);
const headers = { token: getCookieForName("token") };
const uploadUrl = ref(process.env.VUE_APP_BASE_API + props.url);
const { start } = useTimeout(async ({ uuid, file }) => {
const { data: { data: upData } } = await getImportStatus(uuid);

View File

@@ -35,6 +35,7 @@
v-model:fileList="fileList"
:action="importStudent"
name="uploadFile"
:headers="headers"
:multiple="false"
@change="handleChange"
:data="{
@@ -187,6 +188,7 @@ import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import { useStore } from "vuex";
import {getCookieForName} from "@/api/method";
export default {
name: "ImpStu",
props: {
@@ -222,7 +224,7 @@ export default {
showBottomBar: false, // 显示底部成功条数和失败条数
fileName: "",
});
const headers = { token: getCookieForName("token") };
const userInfo = computed(() => store.state.userInfo);
const closeDrawer = () => {
@@ -341,6 +343,7 @@ export default {
userInfo,
closeDrawer,
// change,
headers,
handleChange,
BATCH_IMPORT_SCORE,
downloadEeeorData,

View File

@@ -86,6 +86,7 @@
</div>
<div class="item_inp" style="background-color: #fff;">
<a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
:headers="headers"
:before-upload="beforeUpload">
<img class="i_upload_img" v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div class="i_upload" v-else>
@@ -227,6 +228,7 @@ import AddInvistRoot from "@/components/drawers/AddInvistRoot.vue";
import { Form, message } from "ant-design-vue";
import { fileUp } from "../../api/indexEval";
import {useResetRef} from "@/utils/useCommon";
import {getCookieForName} from "@/api/method";
const removePG = () => {
formData.value.assessmentId = "";
@@ -243,6 +245,7 @@ const props = defineProps({
taskList: [],
});
const visible = ref(false);
const headers = { token: getCookieForName("token") };
const formData = useResetRef({
liveName: "",
liveLink: "",

View File

@@ -33,6 +33,7 @@
:action="importScore"
name="uploadFile"
:multiple="true"
:headers="headers"
@change="handleChange"
:showUploadList="false"
:data="{
@@ -195,6 +196,7 @@ import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import {getCookieForName} from "@/api/method";
export default {
name: "EScore",
@@ -255,6 +257,7 @@ export default {
process.env.VUE_APP_FILE_PATH,
template: process.env.VUE_APP_UP_LOAD_STUDENT_SCORE_TEMPLATE,
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("closeDraw", true);
ctx.emit("update:eScorevisibleExternalExternal", false);
@@ -405,6 +408,7 @@ export default {
BATCH_IMPORT_SCORE,
beforeUpload,
handleUpload,
headers,
removeUpload,
downloadEeeorData,
};

View File

@@ -21,6 +21,7 @@
<div class="right">
<div style="height: 176px; margin-bottom: 20px">
<a-upload-dragger v-model:fileList="fileList" :action="importHomeWork" name="uploadFile" :multiple="true"
:headers="headers"
@change="handleChange" :showUploadList="false" :data="{
type: type,
taskId: Number(id),
@@ -155,6 +156,7 @@ import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import {getCookieForName} from "@/api/method";
export default {
name: "EScore",
props: {
@@ -201,6 +203,8 @@ export default {
downloadErrUrl: null, //下载失败数据
fileName: "",
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("update:eScorevisible", false);
state.fileList = [];
@@ -344,6 +348,7 @@ export default {
closeDrawer,
handleChange,
downTemplate,
headers,
BATCH_IMPORT_SCORE,
beforeUpload,
handleUpload,

View File

@@ -30,6 +30,7 @@
:action="importLeader"
name="uploadFile"
:multiple="true"
:headers="headers"
@change="handleChange"
:showUploadList="false"
>
@@ -252,6 +253,7 @@ import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import {getCookieForName} from "@/api/method";
export default {
name: "ImportStu",
props: {
@@ -279,6 +281,7 @@ export default {
process.env.VUE_APP_FILE_PATH,
template: process.env.VUE_APP_UP_LOAD_STUDENT_SCORE_TEMPLATE,
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("closeDraw", true);
ctx.emit("update:TaskFaceImpStuvisible", false);
@@ -422,6 +425,7 @@ export default {
afterVisibleChange,
closeDrawer,
handleChange,
headers,
downTemplate,
BATCH_IMPORT_SCORE,
beforeUpload,

View File

@@ -31,6 +31,7 @@
:action="importLeader"
name="uploadFile"
:multiple="true"
:headers="headers"
@change="handleChange"
:showUploadList="false"
>
@@ -183,6 +184,7 @@ import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
import {getCookieForName} from "@/api/method";
export default {
name: "TaskImpStu",
props: {
@@ -221,6 +223,8 @@ export default {
process.env.VUE_APP_FILE_PATH,
template: process.env.VUE_APP_UP_LOAD_STUDENT_SCORE_TEMPLATE,
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("closeDraw", true);
ctx.emit("update:TaskFaceImpStuvisible", false);
@@ -364,6 +368,7 @@ export default {
return {
...toRefs(state),
headers,
afterVisibleChange,
closeDrawer,
handleChange,

View File

@@ -59,6 +59,7 @@
style="width: 200px"
list-type="picture-card"
class="avatar-uploader"
:headers="headers"
:show-upload-list="false"
:before-upload="beforeUpload"
>
@@ -326,6 +327,7 @@ import CreateCertificate from "../../../components/drawers/project/CreateCertifi
import { message } from "ant-design-vue";
import * as api from "@/api/index1";
import { fileUp } from "../../../api/indexEval";
import {getCookieForName} from "@/api/method";
export default {
name: "AddCertificate",
components: {
@@ -380,6 +382,8 @@ export default {
fileType: ["jpg", "jpeg", "png", "gif", "svg", "bmp"],
});
const headers = { token: getCookieForName("token") };
const reset = () => {
state.certificateName = null;
state.certificateRemark = null;
@@ -673,6 +677,7 @@ export default {
};
return {
...toRefs(state),
headers,
afterVisibleChange,
closeDrawer,
selectCondition,

View File

@@ -68,6 +68,7 @@
style="width: 200px"
list-type="picture-card"
class="avatar-uploader"
:headers="headers"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@@ -118,6 +119,7 @@ import * as apiTask from "../../../api/indexTaskadd";
import { message } from "ant-design-vue";
import { RouterEditTask } from "@/api/indexTask";
import { addTempTask } from "../../../api/indexTaskadd";
import {getCookieForName} from "@/api/method";
export default {
name: "AddRef",
props: {
@@ -178,6 +180,7 @@ export default {
title: null,
isClick: false,
});
const headers = { token: getCookieForName("token") };
const closeDrawer = () => {
ctx.emit("update:CCertificate", false);
ctx.emit("update:edit", false);
@@ -335,6 +338,7 @@ export default {
};
return {
...toRefs(state),
headers,
afterVisibleChange,
closeDrawer,
handleFinish,

View File

@@ -31,6 +31,7 @@
:data="data"
:multiple="true"
:accept="accept"
:headers="headers"
:action="uploadUrl"
@change="handleChange"
v-model:file-list="fileList"
@@ -95,6 +96,7 @@ import {getImportStatus} from "@/api/index1";
import {useTimeout} from "@/utils/useCommon";
import err from "@/assets/images/err.png";
import success from "@/assets/images/success.png";
import {getCookieForName} from "@/api/method";
const props = defineProps({
url: String,
@@ -109,6 +111,7 @@ const emit = defineEmits({})
const visible = ref(false)
const fileList = ref([])
const uploadUrl = ref(process.env.VUE_APP_BASE_API + props.url);
const headers = { token: getCookieForName("token") };
const {start} = useTimeout(async ({uuid,file}) => {
const {data: {data: upData}} = await getImportStatus(uuid)
file.uploadState = upData;

View File

@@ -24,7 +24,7 @@
:load-data="onLoadData"
:tree-data="options"
:fieldNames="{
children: 'treeChildList',
children: 'directChildList',
label: 'name',
value: 'id',
}"
@@ -36,7 +36,7 @@
</template>
<script setup>
import { defineEmits, defineProps, ref, watch } from "vue";
import {boeRequest, useBoeApi, useRequest} from "@/api/request";
import {request, useArrayRequest, useRequest} from "@/api/request";
import {ORG_CHILD_LIST, ORG_LIST} from "@/api/apis";
const props = defineProps({
@@ -50,7 +50,7 @@ const props = defineProps({
const emit = defineEmits({});
const stuTreeExpandedKeys = ref([]);
const labelValue = ref({ value: props.value, label: props.name });
const { data: options, loading: orgLoading } = useRequest(
const { data: options, loading: orgLoading } = useArrayRequest(
ORG_LIST,
{ keyword: "" },
);
@@ -66,9 +66,9 @@ watch(props, () => {
});
function onLoadData(treeNode) {
return boeRequest(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
return request(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
(r) => {
treeNode.dataRef.treeChildList = r.result.directChildList;
treeNode.dataRef.directChildList = r.data;
options.value = [...options.value];
}
);
@@ -83,7 +83,6 @@ function change(
},
}
) {
console.log("label2222", label, namePath, value);
emit("update:name", label);
emit("update:fullName", namePath);
emit("update:value", value);

View File

@@ -37,7 +37,7 @@
</template>
<script setup>
import {defineEmits, defineProps, ref, watch, watchEffect} from "vue";
import {boeRequest, useBoeApi, useRequest} from "@/api/request";
import {request, useRequest} from "@/api/request";
import { ORG_CHILD_LIST, ORG_LIST } from "@/api/ThirdApi";
const props = defineProps({
@@ -80,9 +80,9 @@ watch(props, () => {
});
function onLoadData(treeNode) {
return boeRequest(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
return request(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
(r) => {
treeNode.dataRef.treeChildList = r.result.directChildList;
treeNode.dataRef.treeChildList = r.data;
options.value = [...options.value];
}
);

View File

@@ -28,7 +28,7 @@
</template>
<script setup>
import {computed, defineEmits, defineProps, onMounted, ref, watch} from "vue";
import {useBoeUserListPage, usePage} from "@/api/request";
import {useThrottlePage} from "@/api/request";
import {USER_LIST} from "@/api/apis";
const props = defineProps({
@@ -56,9 +56,9 @@ const emit = defineEmits({})
const isOpen = ref(false)
const memberParam = ref({keyword: '', page: 1, pageSize: 20})
const memberParam = ref({keyword: '', pageNo:1, pageSize: 20})
const {data: userList, loading} = usePage(USER_LIST, memberParam.value, false)
const {data: userList, loading} = useThrottlePage(USER_LIST, memberParam.value, false)
const options = computed(() => userList.value.filter(e => !(props.value + '').includes(e.id)).map(e => ({
label: e.realName + e.userNo,
@@ -83,7 +83,7 @@ onMounted(() => {
const memberScroll = ({target: {scrollHeight, scrollTop, clientHeight}}) => {
scrollHeight === (clientHeight + scrollTop) && memberParam.value.page++
scrollHeight === (clientHeight + scrollTop) && memberParam.value.pageNo++
};
//搜索学员
@@ -92,19 +92,20 @@ const searchMember = (keyword) => {
loading.value = true
isOpen.value = true
userList.value = []
memberParam.value.page = 1
memberParam.value.pageNo = 1
memberParam.value.keyword = keyword
console.log('searchMember', memberParam.value)
};
function blur() {
isOpen.value = false
memberParam.value.keyword = ''
memberParam.value.page = 1
memberParam.value.pageNo = 1
}
function change(e, l) {
memberParam.value.keyword = ''
memberParam.value.page = 1
memberParam.value.pageNo = 1
isOpen.value = false
Array.isArray(l) && (selectOptions.value = l)
Array.isArray(selectOptions.value) && emit('onChange', e, l, selectOptions.value.find(e => e.departId)?.departId, selectOptions.value.find(e => e.departId)?.departName, selectOptions.value.find(e => e.departId)?.orgName)

View File

@@ -132,7 +132,7 @@
</div>
<div class="tableBox tabb">
<BaseTable ref="auditTableRef" :columns="audiColums" :url="AUDIENCE_LIST" page-key="pageNo"
v-model:params="audienceName"
v-model:params="audienceName" :request="useTotalPage"
v-model:selectedRows="auditSelectRows" v-model:selectedRowKeys="auditSelectRowKeys"
type="checkbox"></BaseTable>
</div>
@@ -296,7 +296,7 @@
<script setup>
import {message} from "ant-design-vue";
import {computed, defineEmits, defineProps, ref, watch} from "vue";
import {boeRequest, useBoeApi, useBoeApiPage, useBoeApiUserInfoPage, useBoeApiAuditPage, usePage, useNewRowsPageNoInit, request, useRequest} from "@/api/request";
import {useNewRowsPageNoInit, request, useRequest, useTotalPage} from "@/api/request";
import {
saveStu,
} from "@/api/index1";
@@ -507,14 +507,6 @@ const audiColums = ref([
align: "center",
className: "h",
},
{
title: "类型",
dataIndex: "audienceType",
key: "audienceType",
width: 40,
align: "center",
className: "h",
},
]);
const orgSelectKeys = ref([]);
const auditTableRef = ref();

View File

@@ -22,6 +22,7 @@
<a-upload
v-show="!item.imgVal"
class="in uploadBtn"
:headers="headers"
:show-upload-list="false"
:before-upload="beforeUpload"
>
@@ -50,6 +51,7 @@
import { reactive, toRefs, ref } from "vue";
import { message } from "ant-design-vue";
import { fileUp } from "../../api/indexEval";
import {getCookieForName} from "@/api/method";
export default {
name: "VoteQuestionItem",
@@ -66,6 +68,7 @@ export default {
const state = reactive({
hasImgName: "",
});
const headers = { token: getCookieForName("token") };
const handleInput = (value) => {
console.log(value.target.value);
@@ -121,6 +124,7 @@ export default {
handleDel,
handleCancel,
beforeUpload,
headers,
};
},
};

View File

@@ -13,7 +13,7 @@
<div class="delete" @click="handleDel">删除</div>
</div>
<div class="name uploadContent">
<a-upload v-show="!formData.optionPictureAddress" class="in uploadBtn" :show-upload-list="false" :before-upload="beforeUpload">
<a-upload v-show="!formData.optionPictureAddress" class="in uploadBtn" :headers="headers" :show-upload-list="false" :before-upload="beforeUpload">
<div class="addimg">+添加图片</div>
</a-upload>
<div v-show="formData.optionPictureAddress" class="picture" style="position: relative">
@@ -35,13 +35,14 @@
import { defineEmits, defineProps, ref } from "vue";
import { message } from "ant-design-vue";
import { fileUp } from "../../api/indexEval";
import {getCookieForName} from "@/api/method";
const props = defineProps({
item: {},
index: Number
})
const emit = defineEmits(['del'])
const headers = { token: getCookieForName("token") };
const formData = ref(props.item)
const beforeUpload = (file) => {

View File

@@ -16,6 +16,10 @@ import 'element-plus/dist/index.css'
import "@/assets/scss/common.scss"
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import {request} from "@/api/request";
import {USER_INFO, USER_PERMISSION, VALIDATE_TOKEN} from "@/api/apis";
import * as api1 from "@/api/index1";
import {getCookieForName} from "@/api/method";
// import axios from 'axios'
// axios.defaults.withCredentials = true;
// import zhCN from 'ant-design-vue/es/locale/zh_CN';
@@ -25,7 +29,51 @@ app.config.warnHandler = () => null;
// app.use(ElementPlus, {
// locale: zhCn,
// })
router.beforeEach(async (to, from, next) => {
if (!getCookieForName("token")) {
window.location.href = process.env.VUE_APP_LOGIN_URL + encodeURIComponent(window.location.protocol + process.env.VUE_APP_BOE_API_URL + process.env.VUE_APP_BASE + router.currentRoute.value.fullPath)
return
}
//第一次进入 没有用户信息
if(!store.state.userInfo.userId){
try{
await request(VALIDATE_TOKEN)
await getUserInfo()
await getUserPermission();
init()
}catch (e){
console.log('token失效 跳转到登录页')
}
}
next();
})
app.use(Antd);
app.use(router);
app.use(store);
app.mount('#app');
async function getUserPermission() {
return request(USER_PERMISSION, {permissionType: 'PAGE'}).then(res => {
store.commit("SET_PERMISSION", res.data?.map(s => s.url));
})
}
async function getUserInfo() {
const userInfo = await request(USER_INFO);
store.commit("SET_USER", userInfo.data);
}
async function initDict(key) {
const list = await getDictList(key);
store.commit("SET_DICT", {key, data: list});
}
const getDictList = (param) => api1.getDictTree({code: param,}).then((res) => res.data.data);
async function init() {
initDict("content_type"); //内容分类
initDict("project_level"); //项目级别
initDict("project_sys"); //培训分类
initDict("project_pic"); //项目封面
initDict("router_pic"); //路径图封面
initDict("course_pic"); //课程封面
initDict("job_type"); //岗位
initDict("band"); //band
}

View File

@@ -612,6 +612,7 @@
<div class="item_inp">
<a-upload
multiple
:headers="headers"
:show-upload-list="false"
:before-upload="beforeUpload2"
>
@@ -1051,6 +1052,7 @@
<div class="item_inp">
<a-upload
multiple
:headers="headers"
:show-upload-list="false"
:before-upload="beforeUpload2"
>
@@ -2356,6 +2358,7 @@
<a-upload
name="file"
:show-upload-list="false"
:headers="headers"
:before-upload="beforeUpload3"
>
<div class="upload_box">
@@ -3142,6 +3145,7 @@ import ProjectManager from "@/components/project/ProjectManagerNew";
import SeeModal from "./components/seeModal.vue";
import * as moment from "moment";
import {getCookieForName} from "@/api/method";
//列表表格
const columns1 = [
@@ -3923,7 +3927,7 @@ export default defineComponent({
assessmentName: "",
assessmentVisible: false,
});
const headers = { token: getCookieForName("token") };
const showStuAdd = (record) => {
state.selectCourseId = record.offcoursePlanId;
state.shipType = 2;
@@ -5690,6 +5694,7 @@ export default defineComponent({
};
return {
...toRefs(state),
headers,
getdateToDateFn,
moment,
getdateToTimeFn,

View File

@@ -685,6 +685,7 @@
v-if="docChecked == true"
v-model:file-list="fileList"
name="file"
:headers="headers"
:action="uploadAction"
@change="handleChange"
>
@@ -1415,6 +1416,7 @@ import ImpoterGroupLeader from "@/components/drawers/project/ImpoterGroupLeader.
import TaskImpStu from "../../components/drawers/TaskFaceIn";
import { checkPer,fixDoublePer } from "@/utils/utils";
import {getCookieForName} from "@/api/method";
export default {
name: "LevelAdd",
@@ -1446,6 +1448,7 @@ export default {
const router = useRouter();
const route = useRoute();
const stuRef = ref();
const headers = { token: getCookieForName("token") };
// const store = useStore();
const state = reactive({
createId: null,
@@ -2911,6 +2914,7 @@ export default {
...toRefs(state),
...toRefs(levelList),
stuRef,
headers,
clearChooseStu,
showDeleteALLModal,
closeDeleteALLModal,

View File

@@ -104,6 +104,7 @@
class="avatar-uploader"
:show-upload-list="false"
action="/api/file/upload"
:headers="headers"
:before-upload="beforeUpload"
@change="handleChange"
:disabled="viewDetail ? true : false"
@@ -401,7 +402,7 @@ import { useRouter, useRoute } from "vue-router";
import dayjs from "dayjs";
import * as api from "../../api/index";
import * as api1 from "../../api/index1";
import { toDate, scrollLoad } from "../../api/method";
import {toDate, scrollLoad, getCookieForName} from "../../api/method";
import { useStore } from "vuex";
export default {
name: "projectAdd",
@@ -413,7 +414,7 @@ export default {
const isEdit = ref(false);
let peojectID = "";
let paraentID = "";
const headers = { token: getCookieForName("token") };
const state = reactive({
classifySelect: null,
classifySelectId: null,
@@ -1040,7 +1041,7 @@ export default {
uplodaFileCount,
createProject,
removeFile,
headers,
isEdit,
backPage,
dateFormatList,

View File

@@ -606,6 +606,7 @@
v-model:file-list="fileList"
name="file"
:action="uploadAction"
:headers="headers"
@change="handleChange2"
>
<span
@@ -759,6 +760,7 @@ import {useRoute, useRouter} from "vue-router";
import {scoreRule, setScoreRule} from "@/api/indexTaskadd";
import ProjectLevel from "@/components/project/ProjectLevel";
import TrainClass from "@/components/project/TrainClass";
import {getCookieForName} from "@/api/method";
export default defineComponent({
name: "LibraryAdd",
@@ -924,6 +926,8 @@ export default defineComponent({
editFlag: false,
uploadAction: process.env.VUE_APP_BASE_API + '/file/uploadunlimit'
});
const headers = { token: getCookieForName("token") };
const value = ref("");
const textnum = "150";
const routered = useRouter();
@@ -1397,6 +1401,7 @@ export default defineComponent({
return {
...toRefs(state),
headers,
value,
projectId,
textnum,

View File

@@ -1337,6 +1337,7 @@
"
v-model:file-list="fileList"
name="file"
:headers="headers"
:action="uploadAction"
@change="handleChange"
>
@@ -2309,7 +2310,7 @@ import { message, Modal } from "ant-design-vue";
import * as apitl from "../../api/index";
import { getTask } from "../../api/indexTaskadd";
import { editProjDoc } from "../../api/indexTaskadd";
import { toDate } from "../../api/method";
import {getCookieForName, toDate} from "../../api/method";
import projSet from "../../components/Modals/projSet";
import { overview } from "../../api/indexProjStu";
import TwoDimensionalCode from "../../components/TwoDimensionalCode.vue";
@@ -2362,6 +2363,8 @@ export default {
setup() {
const store = useStore();
const route = useRoute();
const headers = { token: getCookieForName("token") };
const state = reactive({
createId: "",
permissions: "",
@@ -4912,6 +4915,7 @@ export default {
return {
...toRefs(state),
...toRefs(levelList),
headers,
stageChange,
showStudent,
settingTopFlag,

View File

@@ -68,7 +68,7 @@ shan<!-- 评估管理页面 -->
<a-space style="padding-right: 10px">
<a-button
v-if="
record.releaseStatus === '1' && checkPer(record.permissions)
record.releaseStatus === '1'
"
@click="handleOper(record, 'push')"
type="link"
@@ -76,7 +76,7 @@ shan<!-- 评估管理页面 -->
</a-button>
<a-button
v-if="
record.releaseStatus === '1' && checkPer(record.permissions)
record.releaseStatus === '1'
"
@click="editOper(record)"
type="link"
@@ -84,7 +84,7 @@ shan<!-- 评估管理页面 -->
</a-button>
<a-button
v-if="
record.releaseStatus === '1' && checkPer(record.permissions)
record.releaseStatus === '1'
"
@click="handleEditPage(record.id)"
type="link"
@@ -92,7 +92,7 @@ shan<!-- 评估管理页面 -->
</a-button>
<a-button
v-if="
record.releaseStatus === '2' && checkPer(record.permissions)
record.releaseStatus === '2'
"
@click="toManage(record.id, record)"
type="link"
@@ -106,7 +106,7 @@ shan<!-- 评估管理页面 -->
</a-button>
<a-button
v-if="
record.releaseStatus === '2' && checkPer(record.permissions)
record.releaseStatus === '2'
"
@click="() => handleOper(record, 'withdraw')"
type="link"
@@ -114,7 +114,7 @@ shan<!-- 评估管理页面 -->
</a-button>
<a-button
v-if="
record.releaseStatus === '2' && checkPer(record.permissions)
record.releaseStatus === '2'
"
@click="handleOper(record, 'end')"
type="link"
@@ -122,7 +122,7 @@ shan<!-- 评估管理页面 -->
</a-button>
<a-button
v-if="
record.releaseStatus !== '2' && checkPer(record.permissions)
record.releaseStatus !== '2'
"
@click="handleOper(record, 'del')"
type="link"

View File

@@ -27,6 +27,7 @@
<a-upload
v-show="!item[imgKey]"
class="in uploadBtn"
:headers="headers"
:show-upload-list="false"
:before-upload="beforeUpload"
>
@@ -53,9 +54,12 @@
<script setup>
import {message} from "ant-design-vue";
import {fileUp} from "@/api/indexEval";
import {getCookieForName} from "@/api/method";
const props = defineProps({ index: Number, list: Array, item: Object ,nameKey:String,imgKey:String});
const VUE_APP_FILE_PATH = process.env.VUE_APP_FILE_PATH;
const headers = { token: getCookieForName("token") };
const handleCancel = () => props.item[props.imgKey] = "";
const handleDel = () => props.item.id?(props.item.deleted = true):(props.list.splice(props.index, 1))
const beforeUpload = (file) => {

View File

@@ -28,6 +28,7 @@
name="avatar"
action="/api/file/upload"
list-type="picture-card"
:headers="headers"
class="avatar-uploader"
:show-upload-list="false"
:before-upload="beforeUpload"
@@ -139,6 +140,7 @@ import html2canvas from "html2canvas";
import TwoDimensionalCode from "../../components/TwoDimensionalCode.vue";
import SubsetManage from "../../components/drawers/SubsetManage.vue";
import AddGroup from "../../components/drawers/AddGroup.vue";
import {getCookieForName} from "@/api/method";
export default {
name: "SystemManage",
components: {
@@ -262,7 +264,7 @@ export default {
Svisible: false,
Avisible: false,
});
const headers = { token: getCookieForName("token") };
const showDrawer = () => {
state.visible = true;
};
@@ -456,7 +458,7 @@ export default {
downloadQr,
changeCodevisible,
changeCodevisible2,
headers,
onSelectChange,
randomgroup,
showAddGroup,