考试记录
This commit is contained in:
		| @@ -43,6 +43,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
|  |   import { mapState } from 'vuex' | ||||||
|   export default { |   export default { | ||||||
|     name: 'List', |     name: 'List', | ||||||
|  |  | ||||||
| @@ -57,7 +58,7 @@ | |||||||
|           current: 1, |           current: 1, | ||||||
|           size: 10, |           size: 10, | ||||||
|           title: '', |           title: '', | ||||||
|           status: '' |           areaId: '' | ||||||
|         }, |         }, | ||||||
|         total: 10, |         total: 10, | ||||||
|         colConfigs: [ |         colConfigs: [ | ||||||
| @@ -72,7 +73,11 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     created() { |     computed: { | ||||||
|  |       ...mapState(['user']) | ||||||
|  |     }, | ||||||
|  |  | ||||||
|  |     created () { | ||||||
|       this.getList() |       this.getList() | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| <template> | <template> | ||||||
|   <ai-detail> |   <ai-detail> | ||||||
|     <template slot="title"> |     <template slot="title"> | ||||||
|       <ai-title title="课程详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> |       <ai-title title="学习记录" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> | ||||||
|       </ai-title> |       </ai-title> | ||||||
|     </template> |     </template> | ||||||
|     <template slot="content"> |     <template slot="content"> | ||||||
| @@ -9,16 +9,50 @@ | |||||||
|         <template #content> |         <template #content> | ||||||
|           <ai-wrapper |           <ai-wrapper | ||||||
|             label-width="120px"> |             label-width="120px"> | ||||||
|             <ai-info-item label="题目描述" isLine :value="info.title"></ai-info-item> |             <ai-info-item label="微信昵称" :value="info.nickName"></ai-info-item> | ||||||
|             <ai-info-item label="题目类型" isLine :value="info.title"></ai-info-item> |             <ai-info-item label="手机号" :value="info.phone"></ai-info-item> | ||||||
|             <ai-info-item label="正确答案" isLine :value="info.areaName"></ai-info-item> |             <ai-info-item label="姓名" :value="info.realName"></ai-info-item> | ||||||
|             <ai-info-item label="题目选项" isLine :value="info.contentType"></ai-info-item> |             <ai-info-item label="身份证号" :value="info.idNumber"></ai-info-item> | ||||||
|             <ai-info-item label="正文" isLine> |             <ai-info-item label="地区" :value="info.areaName"></ai-info-item> | ||||||
|               <AiArticle :value="info.content"></AiArticle> |  | ||||||
|             </ai-info-item> |  | ||||||
|           </ai-wrapper> |           </ai-wrapper> | ||||||
|         </template> |         </template> | ||||||
|       </ai-card> |       </ai-card> | ||||||
|  |       <ai-card title="学习记录"> | ||||||
|  |         <template #content> | ||||||
|  |           <ai-wrapper | ||||||
|  |             label-width="98px"> | ||||||
|  |             <ai-info-item label="学习时(分钟)" :value="info.studyDuration"></ai-info-item> | ||||||
|  |           </ai-wrapper> | ||||||
|  |           <ai-table | ||||||
|  |             :tableData="tableData1" | ||||||
|  |             :col-configs="colConfigs1" | ||||||
|  |             :total="total1" | ||||||
|  |             style="margin-top: 6px;" | ||||||
|  |             :current.sync="search1.current" | ||||||
|  |             :size.sync="search1.size" | ||||||
|  |             @getList="getList1"> | ||||||
|  |           </ai-table> | ||||||
|  |         </template> | ||||||
|  |       </ai-card> | ||||||
|  |       <ai-card title="考试记录"> | ||||||
|  |         <template #content> | ||||||
|  |           <ai-wrapper | ||||||
|  |             style="width: 30%" | ||||||
|  |             label-width="56px"> | ||||||
|  |             <ai-info-item label="考试场数" :value="info.examNumber"></ai-info-item> | ||||||
|  |             <ai-info-item label="通过考试" :value="info.passExam"></ai-info-item> | ||||||
|  |           </ai-wrapper> | ||||||
|  |           <ai-table | ||||||
|  |             :tableData="tableData2" | ||||||
|  |             :col-configs="colConfigs2" | ||||||
|  |             :total="total2" | ||||||
|  |             style="margin-top: 6px;" | ||||||
|  |             :current.sync="search2.current" | ||||||
|  |             :size.sync="search2.size" | ||||||
|  |             @getList="getList2"> | ||||||
|  |           </ai-table> | ||||||
|  |         </template> | ||||||
|  |       </ai-card> | ||||||
|     </template> |     </template> | ||||||
|   </ai-detail> |   </ai-detail> | ||||||
| </template> | </template> | ||||||
| @@ -30,32 +64,88 @@ | |||||||
|     props: { |     props: { | ||||||
|       instance: Function, |       instance: Function, | ||||||
|       dict: Object, |       dict: Object, | ||||||
|       params: Object, |       params: Object | ||||||
|       moduleId: String |  | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     data () { |     data () { | ||||||
|       return { |       return { | ||||||
|         info: {}, |         info: {}, | ||||||
|         id: '' |         search1: { | ||||||
|  |           current: 1, | ||||||
|  |           size: 10, | ||||||
|  |           title: '' | ||||||
|  |         }, | ||||||
|  |         search2: { | ||||||
|  |           current: 1, | ||||||
|  |           size: 10, | ||||||
|  |           title: '' | ||||||
|  |         }, | ||||||
|  |         total1: 0, | ||||||
|  |         total2: 0, | ||||||
|  |         tableData1: [], | ||||||
|  |         tableData2: [], | ||||||
|  |         colConfigs1: [ | ||||||
|  |           { prop: 'bizName',  label: '学习课程名称', align: 'left' }, | ||||||
|  |           { prop: 'bizType',  label: '课程类型', align: 'center', format: v => v === '0' ? '学习' : '考试' }, | ||||||
|  |           { prop: 'videoDuration',  label: '视频时长', align: 'center' }, | ||||||
|  |           { prop: 'startTime',  label: '开始学习时间', align: 'center' }, | ||||||
|  |           { prop: 'studyDuration',  label: '学习时长(分钟)', align: 'center' }, | ||||||
|  |           { prop: 'status',  label: '状态', align: 'center', format: v => this.dict.getLabel('qjLearnStatus', v) } | ||||||
|  |         ], | ||||||
|  |         colConfigs2: [ | ||||||
|  |           { prop: 'bizName',  label: '考试名称', align: 'left' }, | ||||||
|  |           { prop: 'phone',  label: '题目数', align: 'center' }, | ||||||
|  |           { prop: 'realName',  label: '通过得分', align: 'center' }, | ||||||
|  |           { prop: 'startTime',  label: '开始考试时间', align: 'center' }, | ||||||
|  |           { prop: 'score',  label: '得分', align: 'center' }, | ||||||
|  |           { prop: 'status',  label: '是否通过', align: 'center', format: v => v === '0' ? '否' : '是' } | ||||||
|  |         ] | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     created () { |     created () { | ||||||
|       if (this.params && this.params.id) { |       this.getInfo(this.params.id) | ||||||
|         this.id = this.params.id |       this.dict.load('qjLearnStatus').then(() => { | ||||||
|         this.getInfo(this.params.id) |         this.getList1() | ||||||
|       } |         this.getList2() | ||||||
|  |       }) | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     methods: { |     methods: { | ||||||
|       getInfo (id) { |       getInfo (id) { | ||||||
|         this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => { |         this.instance.post(`/app/appwechatuserqujing/queryDetailById?id=${id}`).then(res => { | ||||||
|           if (res.code === 0) { |           if (res.code === 0) { | ||||||
|             this.info = res.data |             this.info = res.data | ||||||
|             this.info.pictureUrl = res.data.pictureUrl ? [{ |           } | ||||||
|               url: res.data.pictureUrl |         }) | ||||||
|             }] : [] |       }, | ||||||
|  |  | ||||||
|  |       getList1() { | ||||||
|  |         this.instance.post(`/app/appwechatuserqujinglearnrecord/list`, null, { | ||||||
|  |           params: { | ||||||
|  |             ...this.search1, | ||||||
|  |             bizType: 0, | ||||||
|  |             openId: this.params.openId | ||||||
|  |           } | ||||||
|  |         }).then(res => { | ||||||
|  |           if (res.code == 0) { | ||||||
|  |             this.tableData1 = res.data.records | ||||||
|  |             this.total1 = res.data.total | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |       }, | ||||||
|  |  | ||||||
|  |       getList2 () { | ||||||
|  |         this.instance.post(`/app/appwechatuserqujinglearnrecord/list`, null, { | ||||||
|  |           params: { | ||||||
|  |             ...this.search2, | ||||||
|  |             bizType: 1, | ||||||
|  |             openId: this.params.openId | ||||||
|  |           } | ||||||
|  |         }).then(res => { | ||||||
|  |           if (res.code == 0) { | ||||||
|  |             this.tableData2 = res.data.records | ||||||
|  |             this.total2 = res.data.total | ||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|   | |||||||
| @@ -31,7 +31,7 @@ | |||||||
|         <el-table-column slot="options" width="90px" fixed="right" label="操作" align="center"> |         <el-table-column slot="options" width="90px" fixed="right" label="操作" align="center"> | ||||||
|           <template slot-scope="{ row }"> |           <template slot-scope="{ row }"> | ||||||
|             <div class="table-options"> |             <div class="table-options"> | ||||||
|               <el-button type="text" @click="toDetail(row.id)">详情</el-button> |               <el-button type="text" @click="toDetail(row.id, row.openId)">详情</el-button> | ||||||
|             </div> |             </div> | ||||||
|           </template> |           </template> | ||||||
|         </el-table-column> |         </el-table-column> | ||||||
| @@ -41,6 +41,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
|  |   import { mapState } from 'vuex' | ||||||
|   export default { |   export default { | ||||||
|     name: 'List', |     name: 'List', | ||||||
|  |  | ||||||
| @@ -59,27 +60,31 @@ | |||||||
|         }, |         }, | ||||||
|         total: 10, |         total: 10, | ||||||
|         colConfigs: [ |         colConfigs: [ | ||||||
|           { prop: 'title',  label: '题目', align: 'left' }, |           { prop: 'nickName',  label: '微信昵称', align: 'left' }, | ||||||
|           { prop: 'createUserName',  label: '微信昵称', align: 'center' }, |           { prop: 'phone',  label: '手机号', align: 'center' }, | ||||||
|           { prop: 'createUserName',  label: '手机号', align: 'center' }, |           { prop: 'realName',  label: '姓名', align: 'center' }, | ||||||
|           { prop: 'createUserName',  label: '姓名', align: 'center' }, |           { prop: 'idNumber',  label: '身份证号', align: 'center' }, | ||||||
|           { prop: 'createUserName',  label: '身份证号', align: 'center' }, |           { prop: 'areaName',  label: '地址', align: 'center' }, | ||||||
|           { prop: 'createUserName',  label: '地址', align: 'center' }, |           { prop: 'studyDuration',  label: '学习时长(分钟)', align: 'center' }, | ||||||
|           { prop: 'createUserName',  label: '学习时长(分钟)', align: 'center' }, |           { prop: 'examNumber',  label: '考试场数', align: 'center' }, | ||||||
|           { prop: 'createUserName',  label: '考试场数', align: 'center' }, |           { prop: 'passExam',  label: '通过考试', align: 'center' } | ||||||
|           { prop: 'createUserName',  label: '通过考试', align: 'center' } |  | ||||||
|         ], |         ], | ||||||
|         tableData: [] |         tableData: [] | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|  |     computed: { | ||||||
|  |       ...mapState(['user']) | ||||||
|  |     }, | ||||||
|  |  | ||||||
|     created() { |     created() { | ||||||
|  |       // this.search.areaId = this.user.info.areaId | ||||||
|       this.getList() |       this.getList() | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|     methods: { |     methods: { | ||||||
|       getList() { |       getList() { | ||||||
|         this.instance.post(`/app/appmarketingactivityinfo/list`, null, { |         this.instance.post(`/app/appwechatuserqujing/list`, null, { | ||||||
|           params: { |           params: { | ||||||
|             ...this.search |             ...this.search | ||||||
|           } |           } | ||||||
| @@ -91,22 +96,12 @@ | |||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |  | ||||||
|       remove (id) { |       toDetail (id, openId) { | ||||||
|         this.$confirm('确定删除该活动?').then(() => { |  | ||||||
|           this.instance.post(`/app/appmarketingactivityinfo/delete?id=${id}`).then(res => { |  | ||||||
|             if (res.code == 0) { |  | ||||||
|               this.$message.success('删除成功!') |  | ||||||
|               this.getList() |  | ||||||
|             } |  | ||||||
|           }) |  | ||||||
|         }) |  | ||||||
|       }, |  | ||||||
|  |  | ||||||
|       toDetail (id) { |  | ||||||
|         this.$emit('change', { |         this.$emit('change', { | ||||||
|           type: 'Detail', |           type: 'Detail', | ||||||
|           params: { |           params: { | ||||||
|             id: id || '' |             id: id || '', | ||||||
|  |             openId | ||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       } |       } | ||||||
|   | |||||||
| @@ -139,6 +139,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
|  |   import { mapState } from 'vuex' | ||||||
|   export default { |   export default { | ||||||
|     name: 'AppLearningStatistics', |     name: 'AppLearningStatistics', | ||||||
|     label: '学习统计', |     label: '学习统计', | ||||||
| @@ -155,7 +156,7 @@ | |||||||
|           current: 1, |           current: 1, | ||||||
|           size: 10, |           size: 10, | ||||||
|           title: '', |           title: '', | ||||||
|           status: '' |           areaId: '' | ||||||
|         }, |         }, | ||||||
|         total: 10, |         total: 10, | ||||||
|         colConfigs: [ |         colConfigs: [ | ||||||
| @@ -167,7 +168,12 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|  |     computed: { | ||||||
|  |       ...mapState(['user']) | ||||||
|  |     }, | ||||||
|  |  | ||||||
|     created() { |     created() { | ||||||
|  |       this.search.areaId = this.user.info.areaId | ||||||
|       this.getList() |       this.getList() | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ | |||||||
|       <template v-else-if="!!openType"> |       <template v-else-if="!!openType"> | ||||||
|         <ai-open-data :type="openType" :openid="value"/> |         <ai-open-data :type="openType" :openid="value"/> | ||||||
|       </template> |       </template> | ||||||
|       <template v-else>{{ value || '-' }}</template> |       <template v-else>{{ value || value === 0 ? value : '-' }}</template> | ||||||
|     </div> |     </div> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
|   | |||||||
| @@ -183,7 +183,8 @@ export default { | |||||||
|       if (colConfig.dateFormat) { |       if (colConfig.dateFormat) { | ||||||
|         return moment(row[colConfig.prop]).format(colConfig.dateFormat) |         return moment(row[colConfig.prop]).format(colConfig.dateFormat) | ||||||
|       } |       } | ||||||
|       return row[colConfig.prop] || "-" |  | ||||||
|  |       return row[colConfig.prop] === 0 || row[colConfig.prop] ? row[colConfig.prop] : '-' | ||||||
|     }, |     }, | ||||||
|     /** |     /** | ||||||
|      * 表格方法代理 |      * 表格方法代理 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user