bug修复

This commit is contained in:
李东进1
2023-02-26 01:21:43 +08:00
parent 8508380bad
commit 64a659eaaf
3 changed files with 16 additions and 6 deletions

View File

@@ -37,7 +37,7 @@
<!-- 中间部分 --> <!-- 中间部分 -->
<div class="middletitle"> <div class="middletitle">
<div class="title"> <div class="title">
{{ state.info.discussDtoList[0].discussName }} {{ state.info.discussDtoList[0].discussExplain }}
</div> </div>
<button class="btn" @click="showPostModal">发表帖子</button> <button class="btn" @click="showPostModal">发表帖子</button>
</div> </div>
@@ -108,7 +108,7 @@
<!-- 详细内容 --> <!-- 详细内容 -->
<!-- 富文本 --> <!-- 富文本 -->
<el-dialog title="" top="" v-model="dialogVisible" :show-close="false" <el-dialog title="" top="" v-model="dialogVisible" :show-close="false" :loading="loading"
style="display:flex;justify-content:center;align-items:center;flex-direction: column;" style="display:flex;justify-content:center;align-items:center;flex-direction: column;"
width="80%"> width="80%">
<div style="width:100%;margin-bottom: 12px;"> <div style="width:100%;margin-bottom: 12px;">
@@ -162,6 +162,7 @@ import store from "@/store";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { fileUp } from "../../api/request"; import { fileUp } from "../../api/request";
import {useTaskPage} from "@/api/useCommon"; import {useTaskPage} from "@/api/useCommon";
import {ElLoading} from "element-plus";
const userInfo = computed(() => store.state.userInfo); const userInfo = computed(() => store.state.userInfo);
const router = useRouter(); const router = useRouter();
@@ -175,6 +176,7 @@ const {nextPage,prevPage,hasPrev, hasNext} = useTaskPage()
const dialogVisible = ref(false); const dialogVisible = ref(false);
const titleName = ref(""); const titleName = ref("");
const loading = ref(false);
const state = reactive({ const state = reactive({
activeName: "first", activeName: "first",
@@ -204,11 +206,12 @@ editorConfig.MENU_CONF["uploadImage"] = {
// 自定义上传 // 自定义上传
async customUpload(file, insertFn) { async customUpload(file, insertFn) {
const formData = new FormData(); const formData = new FormData();
console.log(1,file);
formData.append("file", file); formData.append("file", file);
fileUp(formData).then((res) => { fileUp(formData).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
// 最后插入图片 url alt href // 最后插入图片 url alt href
insertFn(res.data.data, file.name, res.data.data); insertFn(import.meta.env.VITE_FILE_PATH+res.data.data, file.name, import.meta.env.VITE_FILE_PATH+res.data.data);
} }
}); });
}, },
@@ -309,6 +312,11 @@ function cancelPost() {
} }
// 发表帖子发布操作 // 发表帖子发布操作
const postAdd = () => { const postAdd = () => {
loading.value = ElLoading.service({
lock: true,
text: "Loading",
background: "rgba(0, 0, 0, 0.7)",
});
console.log('用户信息', userInfo.value) console.log('用户信息', userInfo.value)
let obj = { let obj = {
"collectionNum": 0, "collectionNum": 0,
@@ -338,6 +346,7 @@ const postAdd = () => {
getPostList(state.info.discussDtoList[0].id); getPostList(state.info.discussDtoList[0].id);
titleName.value = ""; titleName.value = "";
valueHtml.value = ""; valueHtml.value = "";
loading.value.close()
} }
}).catch(err=>{ }).catch(err=>{
console.log(err) console.log(err)

View File

@@ -103,9 +103,10 @@
useRequest(QueryEvaluationDetailById(courseId), {}, (e)=>{ useRequest(QueryEvaluationDetailById(courseId), {}, (e)=>{
console.log(e) console.log(e)
state.datainfo = e.data state.datainfo = e.data
console.log('我是获取的外链基本信息12', state.dataInfo)
}) })
console.log('我是获取的外链基本信息', state.dataInfo) console.log('我是获取的外链基本信息4', state.dataInfo)
const userInfo = computed(() => store.state.userInfo); const userInfo = computed(() => store.state.userInfo);

View File

@@ -99,13 +99,13 @@
//获取基本信息 //获取基本信息
request(LINKGETONE, {linkId:courseId}).then(res=>{ request(LINKGETONE, {linkId:courseId}).then(res=>{
console.log(res) console.log("我是获取的外链基本信息1",res)
state.datainfo = res.data state.datainfo = res.data
}).catch(err=>{ }).catch(err=>{
console.log(err) console.log(err)
}); });
console.log('我是获取的外链基本信息', state.dataInfo) console.log('我是获取的外链基本信息5', state.dataInfo)
// 查看外链 // 查看外链
const handleClick = (url) => { const handleClick = (url) => {