课程库上传附件

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) {
const options = ref([]);
const state = reactive({
loading:false,
selfacetvisible: false,
addhomeworkvisible: false,
addtestvisible: false,

View File

@@ -613,7 +613,7 @@
:key="index"
>
<div class="file_img">
<img :src="item.img" />
</div>
<div class="file_detail">
<!-- <div class="file_name">
@@ -1786,6 +1786,8 @@
<div class="select fitems">
<a-range-picker
style="width: 440px; height: 40px; border-radius: 8px"
:show-time="{ format: 'HH:mm' }"
format="YYYY-MM-DD HH:mm"
v-model:value="xjkkinputV3"
separator="至"
:placeholder="[' 开始时间', ' 结束时间']"
@@ -1870,12 +1872,13 @@
<span style="margin-right: 3px">完成规则</span>
</div>
<div class="b_input">
<!--
<a-checkbox
v-model:checked="regisCom"
@click="regisCom = !regisCom"
>
<span style="color: #6d7584">报名即完成</span>
</a-checkbox>
</a-checkbox> -->
<a-checkbox v-model:checked="signCom" @click="signCom = !signCom">
<span style="color: #6d7584">签到即完成</span>
</a-checkbox>
@@ -1926,6 +1929,61 @@
</span>
</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="cstm_btn btn5">
<div class="btnText" @click="handleCancelStu">取消</div>
@@ -3308,6 +3366,7 @@ export default defineComponent({
addStudentList: null, //选中列表
newCourseName: null, //新建开课名称
addLoading:false,
});
const showStuAdd = () => {
@@ -3445,6 +3504,9 @@ export default defineComponent({
const handleDel = (index) => {
state.imgList.splice(index, 1);
};
const handleDel2 = (index) => {
state.fileList.splice(index, 1);
};
// 渲染列表1操作
const getTableDate = async () => {
@@ -3980,6 +4042,7 @@ export default defineComponent({
state.fileList =[];
};
const handlePush = (param) => {
state.addLoading = true;
console.log("state.imgList");
console.log(state.imgList);
let files = "";
@@ -4021,6 +4084,7 @@ export default defineComponent({
getTableDate();
ft_exit();
rest();
state.addLoading = false;
// console.log("res.data", res.data);
if (param === "review") {
//新建时点击审核按钮
@@ -4048,6 +4112,7 @@ export default defineComponent({
state.cstm_hs = true;
};
const handleCancelStu = () => {
state.cstm_hs = false;
state.kk_eidt = false;
state.xjkkradioV1 = "";
@@ -4060,12 +4125,16 @@ export default defineComponent({
state.checked4 = false;
};
const handleSureStu = () => {
state.addLoading = false;
let startTime,
endTime = 0;
if (state.xjkkinputV3) {
startTime = parseInt(state.xjkkinputV3[0].$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 = {
offcourseId: state.offcourseId,
offcoursePlanId: state.offcoursePlanId, //开课ID,不传代表新增
@@ -4074,13 +4143,7 @@ export default defineComponent({
applyFlag: state.checked1 ? 1 : 0,
attach: state.filesList.length ? state.filesList.join(",") : "",
beginTime: startTime,
completeType: state.regisCom
? "1,"
: "0," + state.signCom
? "1,"
: "0," + state.comLeave
? "1"
: "0",
completeType:type,
endTime: endTime,
evalFlag: state.checked4 ? 1 : 0,
name: state.xjkkinputV1,
@@ -4100,10 +4163,12 @@ export default defineComponent({
return false;
}
editPlan(postData).then((res) => {
state.addLoading = false;
if (res.data.code === 200) {
getTableDate3();
handleCancelStu();
rest();
}
});
};
@@ -4124,20 +4189,14 @@ export default defineComponent({
state.checked1 = item.applyFlag === 1 ? true : false;
state.filesList = item.attach ? item.attach.split(",") : [];
state.xjkkinputV3 = [
dayjs(item.beginTime, "YYYY/MM/DD"),
dayjs(item.endTime, "YYYY/MM/DD"),
dayjs(item.beginTime, "YYYY-MM-DD HH:mm:ss"),
dayjs(item.endTime, "YYYY-MM-DD HH:mm:ss"),
];
options4CurId.value = item.teacherId;
(state.regisCom = item.completeType.split(",")[0] == 1 ? true : false),
(state.signCom = item.completeType.split(",")[1] == 1 ? true : false),
(state.comLeave = item.completeType.split(",")[2] == 1 ? true : false),
(state.completeType = state.regisCom
? "1,"
: "0," + state.signCom
? "1,"
: "0," + state.comLeave
? "1"
: "0"),
// (state.regisCom = item.completeType.split(",")[0] == "1" ? true : false),
(state.signCom = item.completeType.split(",")[0] == "1" ? true : false),
(state.comLeave = item.completeType.split(",")[1] == "1" ? true : false),
(state.checked4 = item.evalFlag === 1 ? true : false);
state.xjkkinputV1 = item.name;
if (item.signFlag === 1) {
@@ -4691,12 +4750,12 @@ export default defineComponent({
console.log(file);
fileUp(formData).then((res) => {
if (res.data.code === 200) {
state.fileList.push({
state.filesList.push({
img: res.data.data,
name: file.name,
size: file.size,
});
console.log(state.imgList);
console.log(state.filesList);
// state.hasImgName = res.data.data;
}
});
@@ -4856,6 +4915,7 @@ export default defineComponent({
getdateToTimeFn,
handlePostSure,
handleDeleteKaike,
handleDel2,
handelEditStu,
handelGuan,
beforeUpload3,
@@ -5261,7 +5321,7 @@ export default defineComponent({
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.21);
position: absolute;
left: 50%;
top: 10%;
top: -100%;
transform: translate(-50%, -50%);
.cst_header {
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 {
margin-bottom: 1px;
}
@@ -6073,7 +6219,7 @@ export default defineComponent({
.file_img {
width: 27px;
height: 32px;
// background-image: url(@/assets/images/coursewareManage/imgs.png);
background-image: url(@/assets/images/coursewareManage/imgs.png);
margin-right: 22px;
img {
width: 100%;