课程库上传附件

This commit is contained in:
zhangyc
2022-12-01 22:19:36 +08:00
parent f1e5288d5d
commit b24b0ce0d0
2 changed files with 172 additions and 25 deletions

View File

@@ -345,6 +345,7 @@ export default {
setup(props, ctx) { setup(props, ctx) {
const options = ref([]); const options = ref([]);
const state = reactive({ const state = reactive({
loading:false,
selfacetvisible: false, selfacetvisible: false,
addhomeworkvisible: false, addhomeworkvisible: false,
addtestvisible: false, addtestvisible: false,

View File

@@ -613,7 +613,7 @@
:key="index" :key="index"
> >
<div class="file_img"> <div class="file_img">
<img :src="item.img" />
</div> </div>
<div class="file_detail"> <div class="file_detail">
<!-- <div class="file_name"> <!-- <div class="file_name">
@@ -1786,6 +1786,8 @@
<div class="select fitems"> <div class="select fitems">
<a-range-picker <a-range-picker
style="width: 440px; height: 40px; border-radius: 8px" style="width: 440px; height: 40px; border-radius: 8px"
:show-time="{ format: 'HH:mm' }"
format="YYYY-MM-DD HH:mm"
v-model:value="xjkkinputV3" v-model:value="xjkkinputV3"
separator="至" separator="至"
:placeholder="[' 开始时间', ' 结束时间']" :placeholder="[' 开始时间', ' 结束时间']"
@@ -1870,12 +1872,13 @@
<span style="margin-right: 3px">完成规则</span> <span style="margin-right: 3px">完成规则</span>
</div> </div>
<div class="b_input"> <div class="b_input">
<!--
<a-checkbox <a-checkbox
v-model:checked="regisCom" v-model:checked="regisCom"
@click="regisCom = !regisCom" @click="regisCom = !regisCom"
> >
<span style="color: #6d7584">报名即完成</span> <span style="color: #6d7584">报名即完成</span>
</a-checkbox> </a-checkbox> -->
<a-checkbox v-model:checked="signCom" @click="signCom = !signCom"> <a-checkbox v-model:checked="signCom" @click="signCom = !signCom">
<span style="color: #6d7584">签到即完成</span> <span style="color: #6d7584">签到即完成</span>
</a-checkbox> </a-checkbox>
@@ -1926,6 +1929,61 @@
</span> </span>
</div> </div>
</div> </div>
<div class="mbl_items12">
<div
class="i12_box1"
v-for="(item, index) in filesList"
:key="index"
>
<div class="file_img">
</div>
<div class="file_detail">
<!-- <div class="file_name">
<span style="color: #6f6f6f">{{ item.name }}</span>
</div> -->
<!-- 条件渲染 s -->
<!-- <div class="file_size">
<span style="color: #999ba3">{{ item.size }}</span>
</div> -->
<div class="file_updata">
<div class="updatabox">
<div class="updatacolor"></div>
<div class="updataxq">上传完成</div>
<!-- <div class="updatacolor2"></div>
<div class="updataxq2">上传失败</div> -->
<!-- <div class="updatacolor3"></div>
<div class="updataxq3">正在上传</div> -->
</div>
<div class="upjd">
<span style="margin: auto 5px">100%</span>
</div>
</div>
<!-- 条件渲染 e -->
</div>
<div class="file_operation">
<div class="fobox">
<span style="color: #4ea6ff" @click="handleDel2(index)">
删除
</span>
</div>
<!-- <div class="fobox">
<span style="color: #4ea6ff">重传</span>
</div>
<div class="fobox">
<span style="color: #4ea6ff">取消</span>
</div> -->
<!-- <div class="fobox">
<span style="color: #4ea6ff; margin-right: 5px">
暂停
</span>
</div>
<div class="fobox">
<span style="color: #4ea6ff">取消</span>
</div> -->
</div>
</div>
</div>
<div class="items_btn"> <div class="items_btn">
<div class="cstm_btn btn5"> <div class="cstm_btn btn5">
<div class="btnText" @click="handleCancelStu">取消</div> <div class="btnText" @click="handleCancelStu">取消</div>
@@ -3308,6 +3366,7 @@ export default defineComponent({
addStudentList: null, //选中列表 addStudentList: null, //选中列表
newCourseName: null, //新建开课名称 newCourseName: null, //新建开课名称
addLoading:false,
}); });
const showStuAdd = () => { const showStuAdd = () => {
@@ -3445,6 +3504,9 @@ export default defineComponent({
const handleDel = (index) => { const handleDel = (index) => {
state.imgList.splice(index, 1); state.imgList.splice(index, 1);
}; };
const handleDel2 = (index) => {
state.fileList.splice(index, 1);
};
// 渲染列表1操作 // 渲染列表1操作
const getTableDate = async () => { const getTableDate = async () => {
@@ -3980,6 +4042,7 @@ export default defineComponent({
state.fileList =[]; state.fileList =[];
}; };
const handlePush = (param) => { const handlePush = (param) => {
state.addLoading = true;
console.log("state.imgList"); console.log("state.imgList");
console.log(state.imgList); console.log(state.imgList);
let files = ""; let files = "";
@@ -4021,6 +4084,7 @@ export default defineComponent({
getTableDate(); getTableDate();
ft_exit(); ft_exit();
rest(); rest();
state.addLoading = false;
// console.log("res.data", res.data); // console.log("res.data", res.data);
if (param === "review") { if (param === "review") {
//新建时点击审核按钮 //新建时点击审核按钮
@@ -4048,6 +4112,7 @@ export default defineComponent({
state.cstm_hs = true; state.cstm_hs = true;
}; };
const handleCancelStu = () => { const handleCancelStu = () => {
state.cstm_hs = false; state.cstm_hs = false;
state.kk_eidt = false; state.kk_eidt = false;
state.xjkkradioV1 = ""; state.xjkkradioV1 = "";
@@ -4060,12 +4125,16 @@ export default defineComponent({
state.checked4 = false; state.checked4 = false;
}; };
const handleSureStu = () => { const handleSureStu = () => {
state.addLoading = false;
let startTime, let startTime,
endTime = 0; endTime = 0;
if (state.xjkkinputV3) { if (state.xjkkinputV3) {
startTime = parseInt(state.xjkkinputV3[0].$d.getTime() / 1000); startTime = parseInt(state.xjkkinputV3[0].$d.getTime() / 1000);
endTime = parseInt(state.xjkkinputV3[1].$d.getTime() / 1000); endTime = parseInt(state.xjkkinputV3[1].$d.getTime() / 1000);
} }
let t=state.signCom?"1,":"0,";
let p= state.comLeave?"1":"0";
let type = t.concat(p);
const postData = { const postData = {
offcourseId: state.offcourseId, offcourseId: state.offcourseId,
offcoursePlanId: state.offcoursePlanId, //开课ID,不传代表新增 offcoursePlanId: state.offcoursePlanId, //开课ID,不传代表新增
@@ -4074,13 +4143,7 @@ export default defineComponent({
applyFlag: state.checked1 ? 1 : 0, applyFlag: state.checked1 ? 1 : 0,
attach: state.filesList.length ? state.filesList.join(",") : "", attach: state.filesList.length ? state.filesList.join(",") : "",
beginTime: startTime, beginTime: startTime,
completeType: state.regisCom completeType:type,
? "1,"
: "0," + state.signCom
? "1,"
: "0," + state.comLeave
? "1"
: "0",
endTime: endTime, endTime: endTime,
evalFlag: state.checked4 ? 1 : 0, evalFlag: state.checked4 ? 1 : 0,
name: state.xjkkinputV1, name: state.xjkkinputV1,
@@ -4100,10 +4163,12 @@ export default defineComponent({
return false; return false;
} }
editPlan(postData).then((res) => { editPlan(postData).then((res) => {
state.addLoading = false;
if (res.data.code === 200) { if (res.data.code === 200) {
getTableDate3(); getTableDate3();
handleCancelStu(); handleCancelStu();
rest(); rest();
} }
}); });
}; };
@@ -4124,20 +4189,14 @@ export default defineComponent({
state.checked1 = item.applyFlag === 1 ? true : false; state.checked1 = item.applyFlag === 1 ? true : false;
state.filesList = item.attach ? item.attach.split(",") : []; state.filesList = item.attach ? item.attach.split(",") : [];
state.xjkkinputV3 = [ state.xjkkinputV3 = [
dayjs(item.beginTime, "YYYY/MM/DD"), dayjs(item.beginTime, "YYYY-MM-DD HH:mm:ss"),
dayjs(item.endTime, "YYYY/MM/DD"), dayjs(item.endTime, "YYYY-MM-DD HH:mm:ss"),
]; ];
options4CurId.value = item.teacherId; options4CurId.value = item.teacherId;
(state.regisCom = item.completeType.split(",")[0] == 1 ? true : false), // (state.regisCom = item.completeType.split(",")[0] == "1" ? true : false),
(state.signCom = item.completeType.split(",")[1] == 1 ? true : false), (state.signCom = item.completeType.split(",")[0] == "1" ? true : false),
(state.comLeave = item.completeType.split(",")[2] == 1 ? true : false), (state.comLeave = item.completeType.split(",")[1] == "1" ? true : false),
(state.completeType = state.regisCom
? "1,"
: "0," + state.signCom
? "1,"
: "0," + state.comLeave
? "1"
: "0"),
(state.checked4 = item.evalFlag === 1 ? true : false); (state.checked4 = item.evalFlag === 1 ? true : false);
state.xjkkinputV1 = item.name; state.xjkkinputV1 = item.name;
if (item.signFlag === 1) { if (item.signFlag === 1) {
@@ -4691,12 +4750,12 @@ export default defineComponent({
console.log(file); console.log(file);
fileUp(formData).then((res) => { fileUp(formData).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
state.fileList.push({ state.filesList.push({
img: res.data.data, img: res.data.data,
name: file.name, name: file.name,
size: file.size, size: file.size,
}); });
console.log(state.imgList); console.log(state.filesList);
// state.hasImgName = res.data.data; // state.hasImgName = res.data.data;
} }
}); });
@@ -4856,6 +4915,7 @@ export default defineComponent({
getdateToTimeFn, getdateToTimeFn,
handlePostSure, handlePostSure,
handleDeleteKaike, handleDeleteKaike,
handleDel2,
handelEditStu, handelEditStu,
handelGuan, handelGuan,
beforeUpload3, beforeUpload3,
@@ -5261,7 +5321,7 @@ export default defineComponent({
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.21); box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.21);
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 10%; top: -100%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
.cst_header { .cst_header {
position: absolute; position: absolute;
@@ -5337,6 +5397,92 @@ export default defineComponent({
} }
} }
} }
.mbl_items12 {
width: 440px;
margin-left: 100px;
.i12_box1 {
display: flex;
align-items: center;
padding: 17px 0px 17px 21px;
border: 1px solid #eff4fc;
border-radius: 8px;
margin-bottom: 10px;
.file_img {
width: 27px;
height: 32px;
background-image: url(@/assets/images/coursewareManage/imgs.png);
margin-right: 22px;
img {
width: 100%;
height: 100%;
}
}
.file_detail {
width: 250px;
margin-right: 21px;
.file_updata {
display: flex;
align-items: center;
.updatabox {
position: relative;
width: 230px;
height: 5px;
background-color: rgba(192, 192, 192, 0.25);
border-radius: 3px;
.updatacolor {
position: absolute;
left: 0;
width: 100%;
height: 5px;
background-color: #57c887;
border-radius: 3px;
}
.updatacolor2 {
position: absolute;
left: 0;
width: 80%;
height: 5px;
background-color: #ff7474;
border-radius: 3px;
}
.updatacolor3 {
position: absolute;
left: 0;
width: 60%;
height: 5px;
background-color: #388be1;
border-radius: 3px;
}
.updataxq {
position: absolute;
right: 2px;
top: -30px;
color: #57c887;
}
.updataxq2 {
position: absolute;
right: 2px;
top: -30px;
color: #ff7474;
}
.updataxq3 {
position: absolute;
right: 2px;
top: -30px;
color: #388be1;
}
}
}
}
.file_operation {
display: flex;
.fobox {
margin-right: 5px;
cursor: pointer;
}
}
}
}
.items_fj { .items_fj {
margin-bottom: 1px; margin-bottom: 1px;
} }
@@ -6073,7 +6219,7 @@ export default defineComponent({
.file_img { .file_img {
width: 27px; width: 27px;
height: 32px; height: 32px;
// background-image: url(@/assets/images/coursewareManage/imgs.png); background-image: url(@/assets/images/coursewareManage/imgs.png);
margin-right: 22px; margin-right: 22px;
img { img {
width: 100%; width: 100%;