提交 d45f7b6a authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 daa6b8cd
......@@ -85,8 +85,15 @@ export default {
const [first = {}] = response
this.active = first
this.types = response
if (this.$route.query.id) {
const index = response.findIndex(item => item.id === this.$route.query.id)
const query = this.$route.query
if (query.id || query.channel) {
let index = 0
if (query.id) {
index = response.findIndex(item => item.id === query.id)
}
if (query.channel) {
index = response.findIndex(item => item.form_name === query.channel)
}
this.tapParam[0].selectIndex = index
this.active = response[index]
}
......
......@@ -4,29 +4,50 @@
<div class="con-box">
<div class="total-core">
<div class="title">{{ $t('pages.grade.credit.totalCredits') }}</div>
<div class="core">{{score.total}}</div>
<el-progress ref="credit_total" :text-inside="true" :stroke-width="30" :percentage="percent1" color="#df9d75"></el-progress>
<div class="core">{{ score.total }}</div>
<el-progress
ref="credit_total"
:text-inside="true"
:stroke-width="30"
:percentage="percent1"
color="#df9d75"
></el-progress>
</div>
<el-row :gutter="20">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<div class="compulsory-core">
<div class="title">{{ $t('pages.grade.credit.compCredits') }}</div>
<div class="core">{{score.must}}</div>
<el-progress ref="credit_must" :text-inside="true" :stroke-width="30" :percentage="percent2" color="#8ca4cf"></el-progress>
<div class="core">{{ score.must }}</div>
<el-progress
ref="credit_must"
:text-inside="true"
:stroke-width="30"
:percentage="percent2"
color="#8ca4cf"
></el-progress>
</div>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<div class="elective-core">
<div class="title">{{ $t('pages.grade.credit.eleCredits') }}</div>
<div class="core">{{score.unmust}}</div>
<el-progress ref="credit_unmust" :text-inside="true" :stroke-width="30" :percentage="percent3" color="#66c6bd"></el-progress>
<div class="core">{{ score.unmust }}</div>
<el-progress
ref="credit_unmust"
:text-inside="true"
:stroke-width="30"
:percentage="percent3"
color="#66c6bd"
></el-progress>
</div>
</el-col>
</el-row>
<div class="color-box">
<div class="color" style="background: #8ca4cf;"></div><div class="txt">{{ $t('pages.grade.credit.compCredits') }}</div>
<div class="color" style="background: #66c6bd;"></div><div class="txt">{{ $t('pages.grade.credit.eleCredits') }}</div>
<div class="color" style="background: #df9d75;"></div><div class="txt">{{ $t('pages.grade.credit.allCredits') }}</div>
<div class="color" style="background: #8ca4cf"></div>
<div class="txt">{{ $t('pages.grade.credit.compCredits') }}</div>
<div class="color" style="background: #66c6bd"></div>
<div class="txt">{{ $t('pages.grade.credit.eleCredits') }}</div>
<div class="color" style="background: #df9d75"></div>
<div class="txt">{{ $t('pages.grade.credit.allCredits') }}</div>
</div>
<m-page
:tableHead="tableHead"
......@@ -35,7 +56,7 @@
:objFn="objFn"
:tableConfig="tableConfig"
/>
<div style="height: 0.3rem;"></div>
<div style="height: 0.3rem"></div>
</div>
</div>
</template>
......@@ -45,7 +66,7 @@ import mPage from '@/components/comTable/mPage.vue'
export default {
components: { mPage },
data () {
data() {
return {
percent1: 0,
percent2: 0,
......@@ -72,43 +93,63 @@ export default {
{ prop: 'credit', label: this.$t('pages.grade.credit.credit'), minWidth: '40', fix: false },
{ prop: 'score', label: this.$t('pages.grade.credit.grade'), minWidth: '40', fix: false },
// { prop: '', label: this.$t('pages.grade.credit')'', minWidth: '', fix: false, goObj: { routerName: '', params: {} } }, // 点击跳转页面并传参数
{ prop: 'operate-x', label: this.$t('pages.grade.credit.operate'), width: '80px', fix: false, commandArr: [{ command: 're-start', name: '重修' }, { command: 're-start', name: '已申请' }] }
{
prop: 'operate-x',
label: this.$t('pages.grade.credit.operate'),
width: '80px',
fix: false,
commandArr: [
{ command: 're-start', name: '重修' },
{ command: 're-start', name: '已申请' }
]
}
],
tableData: [],
params: { keywords: '', curPage: 1, pageSize: 100, total: '' },
objFn: {
paramsFn: (_this) => { return {} },
paramsFn: _this => {
return {}
},
nameAPI: 'getCredit',
actionClass: 'Grade',
// nameExcel: 'getStatSummaryExcel',
nameExcel: 'getExportExcel3_4_14',
callback: (_this, data) => {
this.score = data
this.percent1 = Math.floor(this.score.myTotal / this.score.total * 100) || 0
this.percent2 = Math.floor(this.score.myMust / this.score.must * 100) || 0
this.percent3 = Math.floor(this.score.myUnmust / (this.score.unmust ? this.score.unmust : 1) * 100) || 0
this.percent1 = Math.floor((this.score.myTotal / this.score.total) * 100) || 0
this.percent2 = Math.floor((this.score.myMust / this.score.must) * 100) || 0
this.percent3 = Math.floor((this.score.myUnmust / (this.score.unmust ? this.score.unmust : 1)) * 100) || 0
// console.log(111, this.score, this.percent1, this.percent2, this.percent3)
this.$refs.credit_total.$el.children[0].children[0].children[0].children[0].innerHTML = this.score.myTotal + '(分)'
this.$refs.credit_must.$el.children[0].children[0].children[0].children[0].innerHTML = this.score.myMust + '(分)'
this.$refs.credit_unmust.$el.children[0].children[0].children[0].children[0].innerHTML = this.score.myUnmust + '(分)'
this.$refs.credit_total.$el.children[0].children[0].children[0].children[0].innerHTML =
this.score.myTotal + '(分)'
this.$refs.credit_must.$el.children[0].children[0].children[0].children[0].innerHTML =
this.score.myMust + '(分)'
this.$refs.credit_unmust.$el.children[0].children[0].children[0].children[0].innerHTML =
this.score.myUnmust + '(分)'
_this.params.total = 100
data = data.list
data.forEach((elem, i) => {
elem.index = i + 1 + (_this.params.curPage - 1) * _this.params.pageSize
elem.passed = elem.passed !== 0 ? (elem.passed === 2 ? this.$t('pages.grade.credit.unpublished') : this.$t('pages.grade.credit.passed')) : this.$t('pages.grade.credit.failed')
elem.passed =
elem.passed !== 0
? elem.passed === 2
? this.$t('pages.grade.credit.unpublished')
: this.$t('pages.grade.credit.passed')
: this.$t('pages.grade.credit.failed')
_this.tableData.push(elem)
})
}
}
}
},
mounted () {
this.VueEvent.$off('command-tablelist-x').$on('command-tablelist-x', (data) => {
mounted() {
this.VueEvent.$off('command-tablelist-x').$on('command-tablelist-x', data => {
if (data.command.command === 're-start') {
const _data = data.tableData[data.index - 1]
window.localStorage.setItem('rebuild', JSON.stringify(_data))
this.$router.push({ path: '/app/grade/rebuild' })
this.$router.push({ path: '/app/offices', query: { channel: 'retake' } })
// const _data = data.tableData[data.index - 1]
// window.localStorage.setItem('rebuild', JSON.stringify(_data))
// this.$router.push({ path: '/app/grade/rebuild' })
}
})
}
......@@ -116,7 +157,9 @@ export default {
</script>
<style lang="scss" scoped>
.total-core, .compulsory-core, .elective-core {
.total-core,
.compulsory-core,
.elective-core {
margin-top: 0.1rem;
font-size: 16px;
line-height: 36px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论