| | |
| | | }] |
| | | } |
| | | app.MG.ugc.getTopicMessageList(data).then((res) => { |
| | | debugger |
| | | const list = res.datas.map((item, i) => { |
| | | item.question = [] |
| | | item.bookId = null |
| | |
| | | try { |
| | | const obj = JSON.parse(item.content) |
| | | if (obj.bookId) { |
| | | item.question = obj.content |
| | | item.question = obj.content.map((citem) => { |
| | | return { |
| | | ...citem, |
| | | updateDate: moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss'), |
| | | userId: item.appUserCreator.userId |
| | | } |
| | | }) |
| | | // item.question = obj.content |
| | | item.bookId = obj.bookId |
| | | item.path = obj.path |
| | | item.userName = obj.userName ?? '-' |
| | |
| | | questionTime: moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss') |
| | | } |
| | | }) |
| | | console.log(JSON.stringify(list), 'dialog') |
| | | |
| | | this.setData({ |
| | | dataList: list, |
| | | loading: false |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | // 获取题目列表 |
| | | getQuestions(item) { |
| | |
| | | const qusObj = item.question.find((citem) => citem.cmsItemId == ele.id) |
| | | if (qusObj?.cmsItemId) { |
| | | ele.userAnswer = qusObj.answer |
| | | if (ele.questionType == 'singleChoice' || ele.questionType == 'multipleChoice' || ele.questionType == 'judge') { |
| | | ele.questionOption = ele.questionOption.map(item => { |
| | | return { |
| | | ...item, |
| | | label: item.txt |
| | | } |
| | | }) |
| | | } |
| | | const index = this.findIndexByValue(questionTypeList, ele.questionType) |
| | | if (index > -1) { |
| | | item.questionTypeList[index].data.push(ele) |
| | |
| | | } |
| | | } |
| | | item.questionTypeList = item.questionTypeList.filter((item) => item.data.length > 0) |
| | | if (!item.userName) { |
| | | item.userName = '-' |
| | | } |
| | | newData.push(item) |
| | | } |
| | | return newData.filter((item) => item.questionTypeList.length > 0) |