mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 03:16:44 +08:00
fix:面授课新建开课附件上传、开课按钮重置问题修改
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
<div class="select addTimeBox">
|
||||
<div class="addTime">创建时间:</div>
|
||||
<a-range-picker
|
||||
:value="dateTime"
|
||||
style="width: 420px"
|
||||
format="YYYY-MM-DD"
|
||||
valueFormat="YYYY-MM-DD"
|
||||
@@ -14,14 +15,29 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {defineEmits} from "vue";
|
||||
import {defineEmits,ref} from "vue";
|
||||
|
||||
const emit = defineEmits(["update:beginTime", "update:endTime"]);
|
||||
|
||||
const dateTime = ref([null,null]);
|
||||
|
||||
const resetTime = () => {
|
||||
dateTime.value = [null,null]
|
||||
emit("update:beginTime", null);
|
||||
emit("update:endTime", null);
|
||||
}
|
||||
|
||||
function change(e) {
|
||||
console.log(e)
|
||||
dateTime.value = [e[0],e[1]]
|
||||
emit("update:beginTime", e[0]);
|
||||
emit("update:endTime", e[1]);
|
||||
}
|
||||
|
||||
//暴露resetTime方法
|
||||
defineExpose({
|
||||
resetTime
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.addTimeBox {
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
<div class="mii_ipt">
|
||||
<div class="ipt_name"></div>
|
||||
<div class="fi_input">
|
||||
<RangePicker v-model:beginTime="params.createBeginTime" v-model:endTime="params.createEndTime"/>
|
||||
<RangePicker ref="resetTime" v-model:beginTime="params.createBeginTime" v-model:endTime="params.createEndTime"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mi_btns" style="margin-left: 0">
|
||||
<div class="btn btn2" @click="search">
|
||||
<div class="search"></div>
|
||||
@@ -319,7 +319,7 @@
|
||||
<span style="margin-right: 3px"></span>
|
||||
</div>
|
||||
<div class="b_input">
|
||||
<FJUpload v-model:value="formData.attachName"/>
|
||||
<FJUpload v-model:value="formData.attach" @changevalue="changevalue"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -428,7 +428,9 @@ const params = ref({
|
||||
type: props.type,
|
||||
offcourseId: "",
|
||||
draftTaskId: "",
|
||||
taskId: ""
|
||||
taskId: "",
|
||||
createBeginTime: '',
|
||||
createEndTime: '',
|
||||
});
|
||||
const validated = ref(0);
|
||||
const dateTime = ref([]);
|
||||
@@ -449,7 +451,7 @@ const formData = useResetRef({
|
||||
assessmentId: "",
|
||||
workInfo: {},
|
||||
examInfo: {},
|
||||
attachName: "",
|
||||
attach: "",
|
||||
type: props.type,
|
||||
offcourseId: "",
|
||||
draftTaskId: "",
|
||||
@@ -498,12 +500,14 @@ function search() {
|
||||
tableRef.value.fetch();
|
||||
}
|
||||
|
||||
const resetTime = ref();
|
||||
function reset() {
|
||||
tableRef.value.reset({
|
||||
type: props.type,
|
||||
offcourseId: params.value.offcourseId,
|
||||
draftTaskId: params.value.draftTaskId,
|
||||
});
|
||||
resetTime.value.resetTime();
|
||||
}
|
||||
|
||||
const closeDrawer = () => {
|
||||
@@ -576,6 +580,23 @@ function openDrawer(row) {
|
||||
|
||||
const disabledDate = (current) => current && current < dayjs().startOf("day");
|
||||
|
||||
// 删除文件返回参数
|
||||
const changevalue = (e) => {
|
||||
let arr = formData.value.attach.split(",");
|
||||
let newarr = [];
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (i !== e) {
|
||||
newarr.push(arr[i]);
|
||||
}
|
||||
}
|
||||
if (newarr.length == 0) {
|
||||
formData.value.attach = "";
|
||||
} else {
|
||||
formData.value.attach = newarr.toString();
|
||||
}
|
||||
console.log("changevalue", e, newarr, formData.value.attach);
|
||||
}
|
||||
|
||||
defineExpose({ openDrawer });
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user