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

View File

@@ -337,7 +337,7 @@
<span style="margin-right: 10px">附件</span> <span style="margin-right: 10px">附件</span>
</div> </div>
<div class="item_inp"> <div class="item_inp">
<FJUpload v-model:value="attach"/> <FJUpload v-model:value="attach" @changevalue="changevalue"/>
</div> </div>
</div> </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) => { const visibleOpen = (offcourseId, name) => {
state.offcourseId = offcourseId; state.offcourseId = offcourseId;
@@ -588,6 +605,7 @@ export default defineComponent({
}; };
const visibleClose = () => { const visibleClose = () => {
state.ft_hs = false; state.ft_hs = false;
valueHtml.value = "";
ft_exit(); ft_exit();
emit("visibleClose"); emit("visibleClose");
}; };
@@ -626,6 +644,8 @@ export default defineComponent({
state.attach = ""; state.attach = "";
state.auditDescription = ""; state.auditDescription = "";
valueHtml.value = "";
// valueHtml.value = ""; // valueHtml.value = "";
}; };
@@ -963,7 +983,8 @@ export default defineComponent({
toolbarConfig, toolbarConfig,
editorConfig, editorConfig,
handleCreated, handleCreated,
choicePic choicePic,
changevalue
}; };
}, },
}); });