mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-22 17:26:46 +08:00
Merge branch 'master' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage
This commit is contained in:
@@ -1,72 +1,75 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:visible="addevalVisible"
|
||||
class="drawerStyle addevalDrawer"
|
||||
width="80%"
|
||||
title="添加测评"
|
||||
placement="right"
|
||||
@after-visible-change="afterVisibleChange"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">添加测评</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
<div class="main_left">
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
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"
|
||||
<a-drawer
|
||||
:visible="addevalVisible"
|
||||
class="drawerStyle addevalDrawer"
|
||||
width="80%"
|
||||
title="添加测评"
|
||||
placement="right"
|
||||
@after-visible-change="afterVisibleChange"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">添加测评</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
<div class="main_left">
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">测评名称:</span>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">选择测评:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="inputV2"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入名称或编码后选择"
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="inputV1"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入测评名称"
|
||||
maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">选择测评:</span>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">有效期:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-range-picker
|
||||
style="width: 424px;"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="inputV2"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入名称或编码后选择"
|
||||
/>
|
||||
</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">
|
||||
<span style="margin-right: 3px">图片:</span>
|
||||
</div>
|
||||
@@ -77,7 +80,7 @@
|
||||
list-type="picture-card"
|
||||
class="avatar-uploader"
|
||||
:show-upload-list="false"
|
||||
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
|
||||
action="/api/file/upload"
|
||||
:before-upload="beforeUpload"
|
||||
@change="handleChange"
|
||||
>
|
||||
@@ -90,200 +93,312 @@
|
||||
</a-upload>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn1">取消</button>
|
||||
<button class="btn2">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<div class="main_btns">
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="createEvalText">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
const rowSelection = ref({
|
||||
checkStrictly: false,
|
||||
onChange: (selectedRowKeys, selectedRows) => {
|
||||
console.log(
|
||||
`selectedRowKeys: ${selectedRowKeys}`,
|
||||
"selectedRows: ",
|
||||
selectedRows
|
||||
);
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import * as api from "../../api/indexEval";
|
||||
import { message } from "ant-design-vue";
|
||||
// import { toDate } from "../../api/method";
|
||||
const router = useRouter();
|
||||
const rowSelection = ref({
|
||||
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);
|
||||
},
|
||||
onSelectAll: (selected, selectedRows, changeRows) => {
|
||||
console.log(selected, selectedRows, changeRows);
|
||||
},
|
||||
});
|
||||
export default {
|
||||
name: "AddEval",
|
||||
// components: {
|
||||
// },
|
||||
props: {
|
||||
addevalVisible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
inputV1: "",
|
||||
inputV2:"",
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addevalVisible", false);
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
inputV1: "",
|
||||
inputV2: "",
|
||||
time: undefined,
|
||||
endTime: undefined,
|
||||
startTime: undefined,
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addevalVisible", false);
|
||||
state.inputV1 = "";
|
||||
state.inputV2 = "";
|
||||
state.time = undefined;
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
};
|
||||
const onChange = () => {
|
||||
state.endTime = state.time[0].$d.toString;
|
||||
state.startTime = state.time[1].$d.toString;
|
||||
}
|
||||
//上传组件
|
||||
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) => {
|
||||
console.log("state", bool);
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
rowSelection,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
api
|
||||
.createEvaluation(obj)
|
||||
.then((res) => {
|
||||
setTimeout(() => {
|
||||
console.log("创建成功", res);
|
||||
message.success("创建成功");
|
||||
console.log(obj);
|
||||
// state.createLoading = false;
|
||||
router.push("/leveladd");
|
||||
// getLearnPath();
|
||||
}, 1000);
|
||||
})
|
||||
.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">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
.addevalDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
line-height: 25px;
|
||||
margin-left: 24px;
|
||||
}
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
.addevalDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
line-height: 25px;
|
||||
margin-left: 24px;
|
||||
}
|
||||
.contentMain {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.main_left {
|
||||
padding-right: 30px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
.main_item {
|
||||
}
|
||||
.contentMain {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.main_left {
|
||||
padding-right: 30px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
.main_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 32px;
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
margin-bottom: 32px;
|
||||
.signbox {
|
||||
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;
|
||||
}
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.main_item2 {
|
||||
.btnbox {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32px;
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
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_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;
|
||||
.main_item2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32px;
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.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_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>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-range-picker
|
||||
style="width: 424px"
|
||||
style="width: 424px"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</div>
|
||||
@@ -85,14 +85,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn1">取消</button>
|
||||
<button class="btn2">确定</button>
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="createInvist">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
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([
|
||||
{
|
||||
value: "value1",
|
||||
@@ -132,16 +136,56 @@ export default {
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addinvistVisible", false);
|
||||
state.inputV1 = "";
|
||||
state.textV1 = "";
|
||||
};
|
||||
const afterVisibleChange = (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 {
|
||||
...toRefs(state),
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
rowSelection,
|
||||
options1,
|
||||
rowSelection,
|
||||
options1,
|
||||
createInvist,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<!-- 直播抽屉 -->
|
||||
<template>
|
||||
<a-drawer
|
||||
:visible="addliveVisible"
|
||||
@@ -63,6 +64,8 @@
|
||||
<div class="btnbox">
|
||||
<a-range-picker
|
||||
style="width: 424px"
|
||||
v-model:value="time"
|
||||
format="YYYY-MM-DD HH:MM"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</div>
|
||||
@@ -114,7 +117,7 @@
|
||||
list-type="picture-card"
|
||||
class="avatar-uploader"
|
||||
:show-upload-list="false"
|
||||
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
|
||||
action="/api/file/upload"
|
||||
:before-upload="beforeUpload"
|
||||
@change="handleChange"
|
||||
>
|
||||
@@ -195,18 +198,32 @@
|
||||
<div class="timerbox">
|
||||
<span>开始前:</span>
|
||||
<a-input-number
|
||||
:min="0" :max="30" :precision="0"
|
||||
style="width: 88px; height: 32px;border-radius: 8px;overflow: hidden;"
|
||||
:v-model:value="inputV6"
|
||||
:min="0"
|
||||
:max="30"
|
||||
:precision="0"
|
||||
style="
|
||||
width: 88px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
"
|
||||
v-model:value="inputV6"
|
||||
></a-input-number>
|
||||
<span style="color: #999999; margin-left: 8px">分钟</span>
|
||||
</div>
|
||||
<div class="timerbox">
|
||||
<span>开始后:</span>
|
||||
<a-input-number
|
||||
:min="0" :max="30" :precision="0"
|
||||
style="width: 88px; height: 32px;border-radius: 8px;overflow: hidden;"
|
||||
:v-model:value="inputV7"
|
||||
:min="0"
|
||||
:max="30"
|
||||
:precision="0"
|
||||
style="
|
||||
width: 88px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
"
|
||||
v-model:value="inputV7"
|
||||
></a-input-number>
|
||||
<span style="color: #999999; margin-left: 8px">分钟</span>
|
||||
</div>
|
||||
@@ -218,9 +235,16 @@
|
||||
<div class="timerbox">
|
||||
<span>结束前:</span>
|
||||
<a-input-number
|
||||
:min="0" :max="30" :precision="0"
|
||||
style="width: 88px; height: 32px;border-radius: 8px;overflow: hidden;"
|
||||
:v-model:value="inputV8"
|
||||
:min="0"
|
||||
:max="30"
|
||||
:precision="0"
|
||||
style="
|
||||
width: 88px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
"
|
||||
v-model:value="inputV8"
|
||||
></a-input-number>
|
||||
<span style="color: #999999; margin-left: 8px"
|
||||
>分钟(提前签退则记为早退)</span
|
||||
@@ -235,8 +259,8 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-radio-group v-model:value="radioV1">
|
||||
<a-radio v-model:checked="checked" :value="1" @click="cloradio1">仅签到</a-radio>
|
||||
<a-radio v-model:checked="checked" :value="2" @click="cloradio1"
|
||||
<a-radio :value="1" @click="cloradio1">仅签到</a-radio>
|
||||
<a-radio :value="2" @click="cloradio1"
|
||||
>签到、签退全部完成</a-radio
|
||||
>
|
||||
</a-radio-group>
|
||||
@@ -256,63 +280,65 @@
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn1">取消</button>
|
||||
<button class="btn2">确定</button>
|
||||
<button class="btn2" @click="createLiveBroadcast">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import * as api from "../../api/indexLiveBroadcast";
|
||||
const options1 = ref([
|
||||
{
|
||||
value: "value1",
|
||||
label: "请选择状态",
|
||||
},
|
||||
]);
|
||||
const columns1 = [
|
||||
{
|
||||
title: "课程编号",
|
||||
width: "20%",
|
||||
dataIndex: "num",
|
||||
key: "num",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "名称",
|
||||
width: "20%",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "内容分类",
|
||||
width: "13%",
|
||||
dataIndex: "content",
|
||||
key: "content",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "授课教师",
|
||||
width: "13%",
|
||||
dataIndex: "teacher",
|
||||
key: "teacher",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "创建人",
|
||||
width: "13%",
|
||||
dataIndex: "creator",
|
||||
key: "creator",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "完成时间",
|
||||
width: "20%",
|
||||
dataIndex: "time",
|
||||
key: "time",
|
||||
align: "center",
|
||||
},
|
||||
];
|
||||
// const columns1 = [
|
||||
// {
|
||||
// title: "课程编号",
|
||||
// width: "20%",
|
||||
// dataIndex: "num",
|
||||
// key: "num",
|
||||
// align: "center",
|
||||
// },
|
||||
// {
|
||||
// title: "名称",
|
||||
// width: "20%",
|
||||
// dataIndex: "name",
|
||||
// key: "name",
|
||||
// align: "center",
|
||||
// },
|
||||
// {
|
||||
// title: "内容分类",
|
||||
// width: "13%",
|
||||
// dataIndex: "content",
|
||||
// key: "content",
|
||||
// align: "center",
|
||||
// },
|
||||
// {
|
||||
// title: "授课教师",
|
||||
// width: "13%",
|
||||
// dataIndex: "teacher",
|
||||
// key: "teacher",
|
||||
// align: "center",
|
||||
// },
|
||||
// {
|
||||
// title: "创建人",
|
||||
// width: "13%",
|
||||
// dataIndex: "creator",
|
||||
// key: "creator",
|
||||
// align: "center",
|
||||
// },
|
||||
// {
|
||||
// title: "完成时间",
|
||||
// width: "20%",
|
||||
// dataIndex: "time",
|
||||
// key: "time",
|
||||
// align: "center",
|
||||
// },
|
||||
// ];
|
||||
const rowSelection = ref({
|
||||
checkStrictly: false,
|
||||
onChange: (selectedRowKeys, selectedRows) => {
|
||||
@@ -427,19 +453,21 @@ export default {
|
||||
currentPage: 1,
|
||||
tableDataTotal: 100,
|
||||
pageSize: 10,
|
||||
inputV1: "",
|
||||
inputV2: "",
|
||||
inputV3: "",
|
||||
inputV4: "",
|
||||
inputV5: "",
|
||||
inputV6: "",
|
||||
inputV7: "",
|
||||
inputV8: "",
|
||||
inputV1: "", //*直播名称
|
||||
time: "", //*直播时间
|
||||
inputV2: "", //*直播时长
|
||||
inputV3: "", //*授课老师
|
||||
fileList: [], //直播封面
|
||||
inputV4: "", //直播链接
|
||||
inputV5: "", //回放链接
|
||||
inputV6: "", //活动开始前多少分钟结束签到
|
||||
inputV7: "", //活动开始后多少分钟结束签到
|
||||
inputV8: "", //结束前多少分钟开始签退
|
||||
textV1: "",
|
||||
radioV1: "",
|
||||
radioV1: "", //标准设置的单选
|
||||
switchC1: "",
|
||||
checkedC1: "",
|
||||
checkedC2: "",
|
||||
checkedC2: true,
|
||||
playback: false,
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
@@ -454,19 +482,72 @@ export default {
|
||||
state.playback = !state.playback;
|
||||
};
|
||||
const cloradio1 = (value) => {
|
||||
if (value != "") {
|
||||
console.log(value.target._value); //点击的选项
|
||||
if (state.radioV1 === value.target._value) {
|
||||
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 {
|
||||
...toRefs(state),
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
PlayBack,
|
||||
options1,
|
||||
columns1,
|
||||
// columns1,
|
||||
rowSelection,
|
||||
cloradio1,
|
||||
createLiveBroadcast,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user