Merge branch 'master' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage

This commit is contained in:
岳佳鑫
2022-10-31 18:25:56 +08:00
12 changed files with 3874 additions and 3477 deletions

View File

@@ -16,6 +16,8 @@ http.interceptors.request.use(
config.headers.token = token; config.headers.token = token;
} else { } else {
console.log("当前请求页面无token,请执行操作!!!") console.log("当前请求页面无token,请执行操作!!!")
// 此处测试默认配置token
config.headers.token = "123456";
} }
return config; return config;
}, },

View File

@@ -51,13 +51,21 @@ export const createProject = (obj) => http.post('/admin/project/edit', {
"name": obj.name, "name": obj.name,
"notice": obj.notice, "notice": obj.notice,
"noticeFlag": obj.noticeFlag, "noticeFlag": obj.noticeFlag,
"parentId": obj.parentId,
"picUrl": obj.picUrl, "picUrl": obj.picUrl,
"projectId": obj.projectId,
"remark": obj.remark, "remark": obj.remark,
"sourceBelongId": obj.sourceBelongId, "sourceBelongId": obj.sourceBelongId,
"status": obj.status, "status": obj.status,
"systemId": obj.systemId, "systemId": obj.systemId,
"templateId": obj.templateId, "templateId": obj.templateId,
"type": obj.type "type": obj.type
})
// 创建多层项目
export const createStoreyProject = () => http.post('/admin/project/edit', {
})
// 获取项目列表
export const getProjectList = () => http.post('/admin/project/list', {
}) })

63
src/api/indexEval.js Normal file
View File

@@ -0,0 +1,63 @@
import http from "./config";
// import qs from 'qs';
/**
* 接口传参数方式get
* axios.get('/user', {
* params: {
* id: 12345
* name: user
* }
* }).then(res => console.log(res))
*
* 接口传参三种方式post/put/patch
*
* 1.'Content-Type'= 'multipart/form-data',传参格式为 formData。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'multipart/form-data'
* var formData=new FormData();
* formData.append('user',123456);formData.append('pass',12345678);
* axios.post("/notice",formData).then()
*
* 2.'Content-Type'= 'application/x-www-form-urlencoded',传参格式为 query 形式,使用$qs.stringify。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/x-www-form-urlencoded'
* let data = {"code":"1234","name":"yyyy"};
* axios.post(`${this.$url}/test/testRequest`,qs.stringify({data})).then()
*
* 3.'Content-Type'= 'application/json传参格式为 raw (JSON格式)。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/json;charset=UTF-8'
* let data = {"code":"1234","name":"yyyy"}
* axios.post(`${this.$url}/test/testRequest`,data).then()
*
*/
// 接口-请求
//创建测评
export const createEvaluation = (obj) => http.post('/evaluation/createEvaluation', obj,);
//上传组件
export const fileUp = (obj) => http.post('/file/upload', obj,);
//删除测评信息
export const deleteEvaluationById = (obj) => http.post('/evaluation/deleteEvaluationById', { params: obj })
//根据ID获取测评信息详情
export const queryEvaluationDetailById = (obj) => http.post('/evaluation/queryEvaluationDetailById', { params: obj })
//修改测评信息
export const updateEvaluation = (obj) => http.post('/evaluation/updateEvaluation', obj)
// 测试方法
// import * as api from '../../api/index'
// api.getLearnPath({}).then(res => {
// console.log(res)
// }).catch(err => {
// console.log(err)
// })

60
src/api/indexInvist.js Normal file
View File

@@ -0,0 +1,60 @@
import http from "./config";
// import qs from 'qs';
/**
* 接口传参数方式get
* axios.get('/user', {
* params: {
* id: 12345
* name: user
* }
* }).then(res => console.log(res))
*
* 接口传参三种方式post/put/patch
*
* 1.'Content-Type'= 'multipart/form-data',传参格式为 formData。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'multipart/form-data'
* var formData=new FormData();
* formData.append('user',123456);formData.append('pass',12345678);
* axios.post("/notice",formData).then()
*
* 2.'Content-Type'= 'application/x-www-form-urlencoded',传参格式为 query 形式,使用$qs.stringify。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/x-www-form-urlencoded'
* let data = {"code":"1234","name":"yyyy"};
* axios.post(`${this.$url}/test/testRequest`,qs.stringify({data})).then()
*
* 3.'Content-Type'= 'application/json传参格式为 raw (JSON格式)。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/json;charset=UTF-8'
* let data = {"code":"1234","name":"yyyy"}
* axios.post(`${this.$url}/test/testRequest`,data).then()
*
*/
// 接口-请求
//创建评估
export const createAppraiseMessage = (obj) => http.post('/survey/createAppraiseMessage', obj,);
//删除评估信息
export const deleteAppraise = (obj) => http.post('/survey/deleteAppraise', { params: obj })
//根据ID获取评估信息详情
export const queryAppraiseDetailById = (obj) => http.post('/survey/queryAppraiseDetailById', { params: obj })
//修改评估信息
export const updateAppraiseMessage = (obj) => http.post('/survey/updateAppraiseMessage', obj)
// 测试方法
// import * as api from '../../api/index'
// api.getLearnPath({}).then(res => {
// console.log(res)
// }).catch(err => {
// console.log(err)
// })

View File

@@ -0,0 +1,13 @@
import http from "./config";
//根据直播Id获取直播信息 query参数
export const getLiveBroadcastInfor = (obj) => http.get('/liveBroadcast', { params: obj })
//创建直播接口
export const createLiveBroadcast = (obj) => http.post('/liveBroadcast/createLiveBroadcast', obj)
//直播信息删除接口
export const deleteLiveBroadcast = (obj) => http.post('/liveBroadcast/deleteLiveBroadcast', obj)
//直播信息修改接口
export const updateLiveBroadcastMessage = (obj) => http.post('/liveBroadcast/updateLiveBroadcastMessage', obj)

0
src/api/indexVote.js Normal file
View File

View File

@@ -1,72 +1,75 @@
<template> <template>
<a-drawer <a-drawer
:visible="addevalVisible" :visible="addevalVisible"
class="drawerStyle addevalDrawer" class="drawerStyle addevalDrawer"
width="80%" width="80%"
title="添加测评" title="添加测评"
placement="right" placement="right"
@after-visible-change="afterVisibleChange" @after-visible-change="afterVisibleChange"
> >
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div class="headerTitle">添加测评</div> <div class="headerTitle">添加测评</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" @click="closeDrawer"
/> />
</div> </div>
<div class="contentMain"> <div class="contentMain">
<div class="main_left"> <div class="main_left">
<div class="main_item"> <div class="main_item">
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/>
</div>
<span style="margin-right: 3px">测评名称</span>
</div>
<div class="btnbox">
<a-input
v-model:value="inputV1"
style="width: 424px; height: 32px"
placeholder="请输入测评名称"
maxlength="20"
/> />
</div> </div>
<span style="margin-right: 3px">测评名称</span>
</div> </div>
<div class="main_item"> <div class="btnbox">
<div class="signbox"> <a-input
<div class="sign"> v-model:value="inputV1"
<img style="width: 424px; height: 32px"
src="@/assets/images/coursewareManage/asterisk.png" placeholder="请输入测评名称"
alt="" maxlength="20"
/> />
</div> </div>
<span style="margin-right: 3px">选择测评</span> </div>
</div> <div class="main_item">
<div class="btnbox"> <div class="signbox">
<a-input <div class="sign">
v-model:value="inputV2" <img
style="width: 424px; height: 32px" src="@/assets/images/coursewareManage/asterisk.png"
placeholder="请输入名称或编码后选择" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">选择测评</span>
</div> </div>
<div class="main_item"> <div class="btnbox">
<div class="signbox"> <a-input
<span style="margin-right: 3px">有效期</span> v-model:value="inputV2"
</div> style="width: 424px; height: 32px"
<div class="btnbox"> placeholder="请输入名称或编码后选择"
<a-range-picker />
style="width: 424px;"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
</div> </div>
<div class="main_item2"> </div>
<div class="main_item">
<div class="signbox">
<span style="margin-right: 3px">有效期</span>
</div>
<div class="btnbox">
<a-range-picker
style="width: 424px"
v-model:value="time"
format="YYYY-MM-DD HH:mm:ss"
@change="onChange"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
</div>
<div class="main_item2">
<div class="signbox"> <div class="signbox">
<span style="margin-right: 3px">图片</span> <span style="margin-right: 3px">图片</span>
</div> </div>
@@ -77,7 +80,7 @@
list-type="picture-card" list-type="picture-card"
class="avatar-uploader" class="avatar-uploader"
:show-upload-list="false" :show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" action="/api/file/upload"
:before-upload="beforeUpload" :before-upload="beforeUpload"
@change="handleChange" @change="handleChange"
> >
@@ -90,200 +93,312 @@
</a-upload> </a-upload>
</div> </div>
</div> </div>
</div>
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
</div> </div>
</div> </div>
</a-drawer> <div class="main_btns">
</template> <button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="createEvalText">确定</button>
</div>
</div>
</a-drawer>
</template>
<script> <script>
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs, ref } from "vue";
const rowSelection = ref({ import { useRouter } from "vue-router";
checkStrictly: false, import * as api from "../../api/indexEval";
onChange: (selectedRowKeys, selectedRows) => { import { message } from "ant-design-vue";
console.log( // import { toDate } from "../../api/method";
`selectedRowKeys: ${selectedRowKeys}`, const router = useRouter();
"selectedRows: ", const rowSelection = ref({
selectedRows checkStrictly: false,
); onChange: (selectedRowKeys, selectedRows) => {
console.log(
`selectedRowKeys: ${selectedRowKeys}`,
"selectedRows: ",
selectedRows
);
},
onSelect: (record, selected, selectedRows) => {
console.log(record, selected, selectedRows);
},
onSelectAll: (selected, selectedRows, changeRows) => {
console.log(selected, selectedRows, changeRows);
},
});
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}
export default {
name: "AddEval",
// components: {
// },
props: {
addevalVisible: {
type: Boolean,
default: false,
}, },
onSelect: (record, selected, selectedRows) => { },
console.log(record, selected, selectedRows); setup(props, ctx) {
}, const state = reactive({
onSelectAll: (selected, selectedRows, changeRows) => { inputV1: "",
console.log(selected, selectedRows, changeRows); inputV2: "",
}, time: undefined,
}); endTime: undefined,
export default { startTime: undefined,
name: "AddEval", });
// components: { const closeDrawer = () => {
// }, ctx.emit("update:addevalVisible", false);
props: { state.inputV1 = "";
addevalVisible: { state.inputV2 = "";
type: Boolean, state.time = undefined;
default: false, };
}, const afterVisibleChange = (bool) => {
}, console.log("state", bool);
setup(props, ctx) { };
const state = reactive({ const onChange = () => {
inputV1: "", state.endTime = state.time[0].$d.toString;
inputV2:"", state.startTime = state.time[1].$d.toString;
}); }
const closeDrawer = () => { //上传组件
ctx.emit("update:addevalVisible", false); const fileList = ref([]);
const loading = ref(false);
const imageUrl = ref('');
const handleChange = info => {
if (info.file.status === 'uploading') {
loading.value = true;
return;
}
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, base64Url => {
imageUrl.value = base64Url;
loading.value = false;
});
}
if (info.file.status === 'error') {
loading.value = false;
message.error('upload error');
}
}
const beforeUpload = file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
}
// const fileUp = () => {
// let obj = {
// file
// }
// }
//创建测评信息
const createEvalText = () => {
if (!state.inputV1) return message.info("请输入测评名称");
console.log(state.time);
console.log(state.time[0]);
console.log(state.time[0].$d.toString);
console.log(state.time[1].$d.toString);
let obj = {
evaluationName: state.inputV1,
createTime: "",
createUser: 0,
evaluationEndTime: state.endTime,
evaluationFlag: "",
evaluationId: "",
evaluationPictureAddress: "",
evaluationStartTime: state.startTime,
evaluationTag: "",
evaluationTypeId: 0,
evaluationTypeName: "",
updateTime: "",
updateUser: 0,
}; };
const afterVisibleChange = (bool) => { api
console.log("state", bool); .createEvaluation(obj)
}; .then((res) => {
return { setTimeout(() => {
...toRefs(state), console.log("创建成功", res);
afterVisibleChange, message.success("创建成功");
closeDrawer, console.log(obj);
rowSelection, // state.createLoading = false;
}; router.push("/leveladd");
}, // getLearnPath();
}; }, 1000);
</script> })
.catch((err) => {
console.log("创建失败", err);
// state.createLoading = false;
});
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
createEvalText,
onChange,
//上传组件
fileList,
loading,
imageUrl,
handleChange,
beforeUpload,
};
},
};
</script>
<style lang="scss"> <style lang="scss">
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addevalDrawer { .addevalDrawer {
.drawerMain { .drawerMain {
.header { .header {
height: 73px; height: 73px;
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.headerTitle { .headerTitle {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
line-height: 25px; line-height: 25px;
margin-left: 24px; margin-left: 24px;
}
} }
.contentMain { }
display: flex; .contentMain {
justify-content: space-between; display: flex;
.main_left { justify-content: space-between;
padding-right: 30px; .main_left {
flex: 1; padding-right: 30px;
border-right: 1px solid #e8e8e8; flex: 1;
.main_item { border-right: 1px solid #e8e8e8;
.main_item {
display: flex;
align-items: center;
margin-bottom: 32px;
.signbox {
width: 120px;
display: flex; display: flex;
justify-content: end;
align-items: center; align-items: center;
margin-bottom: 32px; .sign {
.signbox { margin-right: 5px;
width: 120px;
display: flex;
justify-content: end;
align-items: center;
.sign {
margin-right: 5px;
}
}
.btnbox {
display: flex;
flex: 1;
align-items: center;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 8px;
color: #fff;
}
} }
} }
.main_item2 { .btnbox {
display: flex; display: flex;
align-items: flex-start; flex: 1;
margin-bottom: 32px; align-items: center;
.signbox { .xkbtn {
width: 120px; cursor: pointer;
display: flex; width: 130px;
justify-content: end; height: 40px;
align-items: center; background: #388be1;
.sign { border-radius: 8px;
margin-right: 5px; border: 0;
} margin-right: 8px;
} color: #fff;
.kqszbox {
.qdqtbox {
margin-left: 56px;
}
.setbox {
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-bottom: 24px;
.timerbox {
margin-top: 6px;
margin-right: 32px;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
}
}
.btnbox2 {
display: flex;
flex-direction: column;
justify-content: flex-start;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 16px 8px 32px 0;
color: #fff;
margin-top: 16px;
margin-bottom: 60px;
}
} }
} }
} }
} .main_item2 {
.main_btns { display: flex;
height: 72px; align-items: flex-start;
width: 100%; margin-bottom: 32px;
bottom: 0; .signbox {
left: 0; width: 120px;
display: flex; display: flex;
align-items: center; justify-content: end;
justify-content: center; align-items: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16); .sign {
.btn1 { margin-right: 5px;
width: 100px; }
height: 40px; }
border: 1px solid #4ea6ff; .kqszbox {
border-radius: 8px; .qdqtbox {
color: #4ea6ff; margin-left: 56px;
background-color: #fff; }
cursor: pointer; .setbox {
} display: flex;
.btn2 { flex-wrap: wrap;
cursor: pointer; margin-top: 10px;
width: 100px; margin-bottom: 24px;
height: 40px; .timerbox {
background: #4ea6ff; margin-top: 6px;
border-radius: 8px; margin-right: 32px;
border: 0; display: flex;
margin-left: 15px; align-items: center;
color: #fff; flex-wrap: nowrap;
}
}
}
.btnbox2 {
display: flex;
flex-direction: column;
justify-content: flex-start;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 16px 8px 32px 0;
color: #fff;
margin-top: 16px;
margin-bottom: 60px;
}
}
} }
} }
} }
.main_btns {
height: 72px;
width: 100%;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
.btn1 {
width: 100px;
height: 40px;
border: 1px solid #4ea6ff;
border-radius: 8px;
color: #4ea6ff;
background-color: #fff;
cursor: pointer;
}
.btn2 {
cursor: pointer;
width: 100px;
height: 40px;
background: #4ea6ff;
border-radius: 8px;
border: 0;
margin-left: 15px;
color: #fff;
}
}
} }
</style> }
</style>

View File

@@ -64,7 +64,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-range-picker <a-range-picker
style="width: 424px" style="width: 424px"
:placeholder="[' 开始时间', ' 结束时间']" :placeholder="[' 开始时间', ' 结束时间']"
/> />
</div> </div>
@@ -85,14 +85,18 @@
</div> </div>
</div> </div>
<div class="main_btns"> <div class="main_btns">
<button class="btn1">取消</button> <button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2">确定</button> <button class="btn2" @click="createInvist">确定</button>
</div> </div>
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs, ref } from "vue";
import { useRouter } from "vue-router";
import * as api from "../../api/indexInvist";
import { message } from "ant-design-vue";
const router = useRouter();
const options1 = ref([ const options1 = ref([
{ {
value: "value1", value: "value1",
@@ -132,16 +136,56 @@ export default {
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addinvistVisible", false); ctx.emit("update:addinvistVisible", false);
state.inputV1 = "";
state.textV1 = "";
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);
}; };
//创建评估信息
const createInvist = () => {
if (!state.inputV1) return message.info("请输入测评名称");
// if (!state.inputV2) return message.info("请选择测评");
// if (!state.organizationSelectName) return message.info("请选择归属组织");
// state.createLoading = true;
let obj = {
appraiseName: state.inputV1,
appraiseEndTime: "",
appraiseExplain: state.textV1,
appraiseFlag: "",
appraiseId: 0,
appraiseStartTime: "",
appraiseTag: "",
createTime: "",
createUser: 0,
researchId: 0,
researchName: "",
updateTime: "",
updateUser: 0,
};
api
.createAppraiseMessage(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
// state.createLoading = false;
router.push("/leveladd");
// getLearnPath();
}, 1000);
})
.catch((err) => {
console.log("创建失败", err);
// state.createLoading = false;
});
};
return { return {
...toRefs(state), ...toRefs(state),
afterVisibleChange, afterVisibleChange,
closeDrawer, closeDrawer,
rowSelection, rowSelection,
options1, options1,
createInvist,
}; };
}, },
}; };

View File

@@ -1,3 +1,4 @@
<!-- 直播抽屉 -->
<template> <template>
<a-drawer <a-drawer
:visible="addliveVisible" :visible="addliveVisible"
@@ -63,6 +64,8 @@
<div class="btnbox"> <div class="btnbox">
<a-range-picker <a-range-picker
style="width: 424px" style="width: 424px"
v-model:value="time"
format="YYYY-MM-DD HH:MM"
:placeholder="[' 开始时间', ' 结束时间']" :placeholder="[' 开始时间', ' 结束时间']"
/> />
</div> </div>
@@ -114,7 +117,7 @@
list-type="picture-card" list-type="picture-card"
class="avatar-uploader" class="avatar-uploader"
:show-upload-list="false" :show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" action="/api/file/upload"
:before-upload="beforeUpload" :before-upload="beforeUpload"
@change="handleChange" @change="handleChange"
> >
@@ -195,18 +198,32 @@
<div class="timerbox"> <div class="timerbox">
<span>开始前</span> <span>开始前</span>
<a-input-number <a-input-number
:min="0" :max="30" :precision="0" :min="0"
style="width: 88px; height: 32px;border-radius: 8px;overflow: hidden;" :max="30"
:v-model:value="inputV6" :precision="0"
style="
width: 88px;
height: 32px;
border-radius: 8px;
overflow: hidden;
"
v-model:value="inputV6"
></a-input-number> ></a-input-number>
<span style="color: #999999; margin-left: 8px">分钟</span> <span style="color: #999999; margin-left: 8px">分钟</span>
</div> </div>
<div class="timerbox"> <div class="timerbox">
<span>开始后</span> <span>开始后</span>
<a-input-number <a-input-number
:min="0" :max="30" :precision="0" :min="0"
style="width: 88px; height: 32px;border-radius: 8px;overflow: hidden;" :max="30"
:v-model:value="inputV7" :precision="0"
style="
width: 88px;
height: 32px;
border-radius: 8px;
overflow: hidden;
"
v-model:value="inputV7"
></a-input-number> ></a-input-number>
<span style="color: #999999; margin-left: 8px">分钟</span> <span style="color: #999999; margin-left: 8px">分钟</span>
</div> </div>
@@ -218,9 +235,16 @@
<div class="timerbox"> <div class="timerbox">
<span>结束前</span> <span>结束前</span>
<a-input-number <a-input-number
:min="0" :max="30" :precision="0" :min="0"
style="width: 88px; height: 32px;border-radius: 8px;overflow: hidden;" :max="30"
:v-model:value="inputV8" :precision="0"
style="
width: 88px;
height: 32px;
border-radius: 8px;
overflow: hidden;
"
v-model:value="inputV8"
></a-input-number> ></a-input-number>
<span style="color: #999999; margin-left: 8px" <span style="color: #999999; margin-left: 8px"
>分钟提前签退则记为早退</span >分钟提前签退则记为早退</span
@@ -235,8 +259,8 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-radio-group v-model:value="radioV1"> <a-radio-group v-model:value="radioV1">
<a-radio v-model:checked="checked" :value="1" @click="cloradio1">仅签到</a-radio> <a-radio :value="1" @click="cloradio1">仅签到</a-radio>
<a-radio v-model:checked="checked" :value="2" @click="cloradio1" <a-radio :value="2" @click="cloradio1"
>签到签退全部完成</a-radio >签到签退全部完成</a-radio
> >
</a-radio-group> </a-radio-group>
@@ -256,63 +280,65 @@
</div> </div>
<div class="main_btns"> <div class="main_btns">
<button class="btn1">取消</button> <button class="btn1">取消</button>
<button class="btn2">确定</button> <button class="btn2" @click="createLiveBroadcast">确定</button>
</div> </div>
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs, ref } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/indexLiveBroadcast";
const options1 = ref([ const options1 = ref([
{ {
value: "value1", value: "value1",
label: "请选择状态", label: "请选择状态",
}, },
]); ]);
const columns1 = [ // const columns1 = [
{ // {
title: "课程编号", // title: "课程编号",
width: "20%", // width: "20%",
dataIndex: "num", // dataIndex: "num",
key: "num", // key: "num",
align: "center", // align: "center",
}, // },
{ // {
title: "名称", // title: "名称",
width: "20%", // width: "20%",
dataIndex: "name", // dataIndex: "name",
key: "name", // key: "name",
align: "center", // align: "center",
}, // },
{ // {
title: "内容分类", // title: "内容分类",
width: "13%", // width: "13%",
dataIndex: "content", // dataIndex: "content",
key: "content", // key: "content",
align: "center", // align: "center",
}, // },
{ // {
title: "授课教师", // title: "授课教师",
width: "13%", // width: "13%",
dataIndex: "teacher", // dataIndex: "teacher",
key: "teacher", // key: "teacher",
align: "center", // align: "center",
}, // },
{ // {
title: "创建人", // title: "创建人",
width: "13%", // width: "13%",
dataIndex: "creator", // dataIndex: "creator",
key: "creator", // key: "creator",
align: "center", // align: "center",
}, // },
{ // {
title: "完成时间", // title: "完成时间",
width: "20%", // width: "20%",
dataIndex: "time", // dataIndex: "time",
key: "time", // key: "time",
align: "center", // align: "center",
}, // },
]; // ];
const rowSelection = ref({ const rowSelection = ref({
checkStrictly: false, checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => { onChange: (selectedRowKeys, selectedRows) => {
@@ -427,19 +453,21 @@ export default {
currentPage: 1, currentPage: 1,
tableDataTotal: 100, tableDataTotal: 100,
pageSize: 10, pageSize: 10,
inputV1: "", inputV1: "", //*直播名称
inputV2: "", time: "", //*直播时间
inputV3: "", inputV2: "", //*直播时长
inputV4: "", inputV3: "", //*授课老师
inputV5: "", fileList: [], //直播封面
inputV6: "", inputV4: "", //直播链接
inputV7: "", inputV5: "", //回放链接
inputV8: "", inputV6: "", //活动开始前多少分钟结束签到
inputV7: "", //活动开始后多少分钟结束签到
inputV8: "", //结束前多少分钟开始签退
textV1: "", textV1: "",
radioV1: "", radioV1: "", //标准设置的单选
switchC1: "", switchC1: "",
checkedC1: "", checkedC1: "",
checkedC2: "", checkedC2: true,
playback: false, playback: false,
}); });
const closeDrawer = () => { const closeDrawer = () => {
@@ -454,19 +482,72 @@ export default {
state.playback = !state.playback; state.playback = !state.playback;
}; };
const cloradio1 = (value) => { const cloradio1 = (value) => {
if (value != "") { console.log(value.target._value); //点击的选项
if (state.radioV1 === value.target._value) {
state.radioV1 = ""; state.radioV1 = "";
} }
} };
//创建直播
const createLiveBroadcast = () => {
if (!state.inputV1) return message.info("请输入直播名称");
if (!state.time) return message.info("请输入直播时间");
if (!state.inputV2) return message.info("请输入直播时长");
const regular = /^[+]{0,1}(\d+)$/;
if (!regular.test(state.inputV2)) {
return message.info("直播时长需大于0");
}
// if (!state.inputV3) return message.info("请输入授课老师");
let check = state.checkedC2 * 1;
let startTime = state.time[0].$d;
let endTime = state.time[1].$d;
console.log(startTime); //时间需要处理
console.log(endTime);
let obj = {
afterSignIn: state.inputV6,
beforeSignIn: state.inputV7,
createTime: "",
createUser: 0,
// liveCover: state.fileList,//直播封面
liveDuration: state.inputV2,
// liveEndTime: endTime,
// liveStartTime: startTime,
liveExplain: state.textV1,
liveFlag: "",
liveId: 0,
liveLink: state.inputV4,
liveName: state.inputV1,
livePlayback: "",
livePlaybackLink: state.inputV5,
liveTag: "",
liveTeacherId: 0,
otherSettings: check, //1或0
signOutTime: state.inputV8,
standardSettings: state.radioV1, //1或2
updateTime: "",
updateUser: 0,
};
api
.createLiveBroadcast(obj)
.then((res) => {
console.log(res.data.data, 1111);
})
.catch((err) => {
console.log(err, 2222);
});
};
return { return {
...toRefs(state), ...toRefs(state),
afterVisibleChange, afterVisibleChange,
closeDrawer, closeDrawer,
PlayBack, PlayBack,
options1, options1,
columns1, // columns1,
rowSelection, rowSelection,
cloradio1, cloradio1,
createLiveBroadcast,
}; };
}, },
}; };

View File

@@ -17,9 +17,9 @@
> --> > -->
<div <div
class="items" class="items"
:class=" isactive == index && isActive == true ? 'active' : '' " :class="isactive == index && isActive == true ? 'active' : ''"
@click="changebgc(index)" @click="changebgc(index)"
v-for="( item , index ) in level" v-for="(item, index) in level"
:key="item.id" :key="item.id"
> >
<div class="items1"> <div class="items1">
@@ -49,7 +49,7 @@
centered="true" centered="true"
:footer="null" :footer="null"
:closable="clos" :closable="clos"
wrapClassName="AddLevel" wrapClassName="AddLevell"
> >
<div class="header"> <div class="header">
<div class="headmain"> <div class="headmain">
@@ -1204,7 +1204,7 @@ export default {
display: block; display: block;
clear: both; clear: both;
} }
.AddLevel { .AddLevell {
.ant-modal { .ant-modal {
width: 624px !important; width: 624px !important;
height: 388px !important; height: 388px !important;
@@ -1535,7 +1535,7 @@ export default {
} }
.active { .active {
opacity: 1; opacity: 1;
transition:all .5s; transition: all 0.5s;
} }
} }
} }

View File

@@ -42,6 +42,7 @@
border: 1px solid rgba(78, 166, 255, 1); border: 1px solid rgba(78, 166, 255, 1);
border-radius: 5px; border-radius: 5px;
cursor: pointer; cursor: pointer;
position: relative;
overflow: hidden; overflow: hidden;
"> ">
<a-upload v-model:file-list="fileList" name="file" list-type="picture-card" class="avatar-uploader" <a-upload v-model:file-list="fileList" name="file" list-type="picture-card" class="avatar-uploader"
@@ -77,8 +78,8 @@
<div class="in select"> <div class="in select">
<a-select :getPopupContainer="triggerNode => { <a-select :getPopupContainer="triggerNode => {
return triggerNode.parentNode || document.body return triggerNode.parentNode || document.body
}" :value="classifySelect1" placeholder="请选择项目经理" style="width: 100%" :options="classifyList1" allowClear }" :value="classifySelect1" placeholder="请选择项目经理" style="width: 100%" :options="classifyList1"
showSearch> @change="classificationChange1" allowClear showSearch>
</a-select> </a-select>
</div> </div>
</div> </div>
@@ -118,7 +119,7 @@
<div class="inname">项目级别</div> <div class="inname">项目级别</div>
</div> </div>
<div class="in"> <div class="in">
<a-input v-model:value="valueE" placeholder="集团级/组织级/现地级/部门级" /> <a-input v-model:value="valueE1" placeholder="集团级/组织级/现地级/部门级" />
</div> </div>
</div> </div>
<div class="name"> <div class="name">
@@ -127,7 +128,7 @@
<div class="inname">培训体系</div> <div class="inname">培训体系</div>
</div> </div>
<div class="in"> <div class="in">
<a-input v-model:value="valueE" placeholder="集团级/组织级/现地级/部门级" /> <a-input v-model:value="valueE2" placeholder="集团级/组织级/现地级/部门级" />
</div> </div>
</div> </div>
<div class="name"> <div class="name">
@@ -152,7 +153,7 @@
<div> <div>
<img v-if="fileList1.length < 6" class="fileimg" src="../../assets/images/projectadd/enclosure.png" /> <img v-if="fileList1.length < 6" class="fileimg" src="../../assets/images/projectadd/enclosure.png" />
<a-upload :disabled="fileList1.length > 5" :before-upload="beforeUpload1" v-model:file-list="fileList1" <a-upload :disabled="fileList1.length > 5" :before-upload="beforeUpload1" v-model:file-list="fileList1"
name="file" action="/api/file/upload" :headers="headers" @change="handleChange1"> @remove="removeFile" name="file" action="/api/file/upload" :headers="headers" @change="handleChange1">
<!-- <a-button> --> <!-- <a-button> -->
<!-- <upload-outlined></upload-outlined> --> <!-- <upload-outlined></upload-outlined> -->
<span v-if="fileList1.length > 5" class="filetext">上传数量已经达到最大值</span> <span v-if="fileList1.length > 5" class="filetext">上传数量已经达到最大值</span>
@@ -196,7 +197,10 @@ export default {
classifySelect: null, classifySelect: null,
classifySelectId: null, classifySelectId: null,
checked: false, checked: false,
checked1: false checked1: false,
valueE: null,
valueE1: null,
valueE2: null
}); });
const projectName = ref(''); const projectName = ref('');
@@ -224,6 +228,7 @@ export default {
const fileList1 = ref([]); const fileList1 = ref([]);
const loading = ref(false); const loading = ref(false);
const imageUrl = ref(''); const imageUrl = ref('');
let picUrl = '';
const handleChange = (info) => { const handleChange = (info) => {
if (info.file.status === 'uploading') { if (info.file.status === 'uploading') {
@@ -232,6 +237,7 @@ export default {
} }
if (info.file.status === 'done') { if (info.file.status === 'done') {
console.log('上传图片返回的信息 %o', info) console.log('上传图片返回的信息 %o', info)
picUrl = info.file.response.data;
// Get this url from response in real world. // Get this url from response in real world.
getBase64(info.file.originFileObj, (base64Url) => { getBase64(info.file.originFileObj, (base64Url) => {
imageUrl.value = base64Url; imageUrl.value = base64Url;
@@ -246,6 +252,8 @@ export default {
let uplodaFileCount = false; let uplodaFileCount = false;
let attach = "";
let attachData = "";
const handleChange1 = (info) => { const handleChange1 = (info) => {
if (info.file.status === 'uploading') { if (info.file.status === 'uploading') {
loading.value = true; loading.value = true;
@@ -253,6 +261,19 @@ export default {
} }
if (info.file.status === 'done') { if (info.file.status === 'done') {
console.log('上传附件返回的信息 %o', info, info.fileList.length, uplodaFileCount) console.log('上传附件返回的信息 %o', info, info.fileList.length, uplodaFileCount)
let attachStr = "";
attachData = info.fileList;
for (let i = 0; i < attachData.length; i++) {
if (attachData.length - 1 == i) {
attachStr += attachData[i].response.data;
} else {
attachStr += attachData[i].response.data + ',';
}
}
console.log(attachStr)
attach = attachStr;
if (info.fileList.length > 5) { if (info.fileList.length > 5) {
uplodaFileCount = true; uplodaFileCount = true;
} else { } else {
@@ -287,12 +308,18 @@ export default {
}) })
}; };
let beginTime = "";
let endTime = "";
const onRangeChange = (value, dateString) => { const onRangeChange = (value, dateString) => {
console.log('Selected Time: ', value); console.log('Selected Time: ', value);
// 项目时间选择函数 // 项目时间选择函数
console.log('Formatted Selected Time: ', dateString); console.log('Formatted Selected Time: ', dateString);
console.log('Formatted Selected TimeStamp', new Date(dateString[0]).getTime())
beginTime = new Date(dateString[0]).getTime();
endTime = new Date(dateString[1]).getTime();
}; };
// 项目经理 后续接口调用 // 项目经理 后续接口调用
const classifyList1 = ref([ const classifyList1 = ref([
{ value: 1, label: '李俊国' }, { value: 1, label: '李俊国' },
@@ -300,22 +327,56 @@ export default {
{ value: 3, label: '刘孟君' }, { value: 3, label: '刘孟君' },
]); ]);
let manager = "";
let managerId = "";
const classificationChange1 = (key) => {
console.log(`selected ${key}`);
console.log(classifyList1.value[key - 1].label)
manager = String(classifyList1.value[key - 1].label)
managerId = String(key)
};
// 资源归属 sourceBelongId 后续给接口 // 资源归属 sourceBelongId 后续给接口
// 项目说明 // 项目说明
const remark = ref(''); const remark = ref('');
let courseSyncFlag = 0;
const changeChecked = () => { const changeChecked = () => {
console.log(state.checked) console.log(state.checked)
state.checked ? state.checked = false : state.checked = true; state.checked ? state.checked = false : state.checked = true;
courseSyncFlag = state.checked ? 1 : 0;
} }
let boeFlag = 0;
const changeChecked1 = () => { const changeChecked1 = () => {
console.log(state.checked1) console.log(state.checked1)
state.checked1 ? state.checked1 = false : state.checked1 = true; state.checked1 ? state.checked1 = false : state.checked1 = true;
boeFlag = state.checked1 ? 1 : 0;
} }
const removeFile = (file) => {
const index = fileList1.value.indexOf(file);
const newFileList = fileList1.value.slice();
newFileList.splice(index, 1);
fileList1.value = newFileList;
let attachStr = "";
if (newFileList.length == 0) {
attachStr = "";
}
for (let i = 0; i < fileList1["value"].length; i++) {
console.log(fileList1["value"][i].response.data)
if (fileList1["value"].length - 1 == i) {
attachStr += fileList1["value"][i].response.data;
} else {
attachStr += fileList1["value"][i].response.data + ',';
}
}
attach = attachStr;
}
const errorMsgs = { const errorMsgs = {
"name": "请输入项目名称", "name": "请输入项目名称",
"type": "请选择项目分类", "type": "请选择项目分类",
@@ -333,31 +394,29 @@ export default {
const createProject = () => { const createProject = () => {
let obj = { let obj = {
"attach": "1",
"beginTime": 0,
"boeFlag": 0,
"category": 0,
"courseSyncFlag": 0,
"endTime": 0,
"level": 0,
"manager": "",
"managerId": "",
"name": projectName["value"], "name": projectName["value"],
"type": projectType,
"picUrl": picUrl,
"beginTime": beginTime,
"endTime": endTime,
"manager": manager,
"managerId": managerId,
"sourceBelongId": 11,
"remark": remark["value"],
"courseSyncFlag": courseSyncFlag,
"level": 3,
"systemId": 4,
"boeFlag": boeFlag,
"attach": attach,
"templateId": 10,
"category": 0,
"notice": "", "notice": "",
"noticeFlag": 0, "noticeFlag": 0,
"parentId": 0, "status": 0
"picUrl": "",
"projectId": 0,
"remark": remark["value"],
"sourceBelongId": 0,
"status": 0,
"systemId": 0,
"templateId": 0,
"type": projectType
} }
console.log('提交的数据格式 %o', obj) console.log('提交的数据格式 %o', obj)
for (let i in errorMsgs) {
for (let i in obj) {
console.log(obj[i]) console.log(obj[i])
if (obj[i] === "") { if (obj[i] === "") {
message.destroy() message.destroy()
@@ -378,6 +437,7 @@ export default {
projectName, projectName,
classifyList, classifyList,
classificationChange, classificationChange,
classificationChange1,
fileList, fileList,
fileList1, fileList1,
loading, loading,
@@ -392,7 +452,8 @@ export default {
changeChecked, changeChecked,
changeChecked1, changeChecked1,
uplodaFileCount, uplodaFileCount,
createProject createProject,
removeFile
}; };
} }
}; };
@@ -443,6 +504,11 @@ export default {
} }
} }
// 修改 antd upload 样式
.ant-upload {
border-width: 0px;
}
.content { .content {
display: flex; display: flex;

File diff suppressed because it is too large Load Diff