fix:面授课编辑附件删除问题,课程大纲问题

This commit is contained in:
wyx
2022-12-20 16:43:40 +08:00
parent 0509b2f979
commit a05136de4f
2 changed files with 25 additions and 3 deletions

View File

@@ -58,7 +58,7 @@
import {defineEmits, defineProps, ref, watch, onMounted} from "vue";
import Upload from "./BaseUpload.vue";
const emit = defineEmits({})
const emit = defineEmits(["changevalue"])
const props = defineProps({
value: String,
})
@@ -98,6 +98,7 @@ function init() {
function del(i) {
uploadRef.value.remove(i)
emit('changevalue', i)
}
</script>

View File

@@ -337,7 +337,7 @@
<span style="margin-right: 10px">附件</span>
</div>
<div class="item_inp">
<FJUpload v-model:value="attach"/>
<FJUpload v-model:value="attach" @changevalue="changevalue"/>
</div>
</div>
</div>
@@ -572,6 +572,23 @@ export default defineComponent({
],
});
// 删除文件返回参数
const changevalue = (e) => {
let arr = state.attach.split(',')
let newarr = []
for(let i=0;i<arr.length;i++){
if(i!==e){
newarr.push(arr[i])
}
}
if(newarr.length==0){
state.attach = "";
}else{
state.attach = newarr.toString()
}
console.log('changevalue', e, newarr, state.attach)
}
const visibleOpen = (offcourseId, name) => {
state.offcourseId = offcourseId;
@@ -588,6 +605,7 @@ export default defineComponent({
};
const visibleClose = () => {
state.ft_hs = false;
valueHtml.value = "";
ft_exit();
emit("visibleClose");
};
@@ -626,6 +644,8 @@ export default defineComponent({
state.attach = "";
state.auditDescription = "";
valueHtml.value = "";
// valueHtml.value = "";
};
@@ -963,7 +983,8 @@ export default defineComponent({
toolbarConfig,
editorConfig,
handleCreated,
choicePic
choicePic,
changevalue
};
},
});