|
@@ -4,7 +4,8 @@
|
|
|
<div class="body-content">
|
|
|
<div class="foot">
|
|
|
<Button @click="delNewScoreFile">{{ $t('scoreCalc.delete') }}</Button>
|
|
|
- <div v-if="lists.length !== 0" class="creat-txt">{{ $t('scoreCalc.creatDate') }}:{{$jsFn.secondTimeFormat(this.tableInfo.creatTime)}}</div>
|
|
|
+ <div v-if="lists.length !== 0 && this.tableInfo.creatTime===0" class="creat-txt">{{ $t('scoreCalc.creatDate') }}:--</div>
|
|
|
+ <div v-if="lists.length !== 0 && this.tableInfo.creatTime!==0" class="creat-txt">{{ $t('scoreCalc.creatDate') }}:{{$jsFn.secondTimeFormat(this.tableInfo.creatTime)}}</div>
|
|
|
<div class="button-group">
|
|
|
<div v-if="isSave && lists.length !== 0" class="save-info-ok">
|
|
|
<div>
|
|
@@ -34,7 +35,10 @@
|
|
|
v-bind:key="index">
|
|
|
<Card :class="['ivu-card', { active: list.click }]">
|
|
|
<p><b>{{ list.name }}</b></p>
|
|
|
- <p>{{$jsFn.dateFormat(list.createTime)}}</p>
|
|
|
+ <p style="color:#515a6e;">
|
|
|
+ <Icon type="md-time" style="margin:0px;" v-if="$jsFn.dateFormat(list.createTime) !== ''"/>
|
|
|
+ {{$jsFn.dateFormat(list.createTime)}}
|
|
|
+ </p>
|
|
|
</Card>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -99,19 +103,18 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</Column>
|
|
|
- <Column field="homework" header="" :styles="{ ...commonStyle, width: '90px' }">
|
|
|
+ <Column field="evaluate" header="" :styles="{ ...commonStyle, width: '90px' }">
|
|
|
<template #header>
|
|
|
<div class="div-center">
|
|
|
<div>
|
|
|
- <div @click="changePageTo(Proportion.HomeWorkActRate.id)"
|
|
|
+ <div @click="changePageTo(Proportion.ExamRate.id)"
|
|
|
style=" align-items: center; textDecoration: underline ; cursor: pointer;">
|
|
|
- {{ $t('scoreCalc.th_homework') }}
|
|
|
+ {{ $t('scoreCalc.th_exam') }}
|
|
|
</div>
|
|
|
<div style="display: flex; align-items: center;">
|
|
|
- ( <input type="text" v-model="Proportion.HomeWorkActRate.score"
|
|
|
- @input="onRateChange('homework')"
|
|
|
+ ( <input type="text" v-model="Proportion.ExamRate.score" @input="onRateChange('evaluate')"
|
|
|
style="width: 20px; height: 20px; box-sizing: border-box;"
|
|
|
- :style="{ color: Proportion.HomeWorkActRate.color, margin: '0px 5px', border: 'none', background: 'none' }"
|
|
|
+ :style="{ color: Proportion.ExamRate.color, margin: '0px 5px', border: 'none', background: 'none' }"
|
|
|
maxlength="2">
|
|
|
%)
|
|
|
</div>
|
|
@@ -122,27 +125,28 @@
|
|
|
<div class="div-center" style=" flex-direction: column;">
|
|
|
<div class="div-centerY">
|
|
|
<div class="text-size20">
|
|
|
- {{ rowData.data.homework.score+rowData.data.homework.add }}
|
|
|
+ {{ rowData.data.evaluate.score+rowData.data.evaluate.add }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
- ({{ calculateClassPercent(rowData.data, 'homework') }})
|
|
|
+ ({{ calculateClassPercent(rowData.data, 'evaluate') }})
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</Column>
|
|
|
- <Column field="evaluate" header="" :styles="{ ...commonStyle, width: '90px' }">
|
|
|
+ <Column field="homework" header="" :styles="{ ...commonStyle, width: '90px' }">
|
|
|
<template #header>
|
|
|
<div class="div-center">
|
|
|
<div>
|
|
|
- <div @click="changePageTo(Proportion.ExamRate.id)"
|
|
|
+ <div @click="changePageTo(Proportion.HomeWorkActRate.id)"
|
|
|
style=" align-items: center; textDecoration: underline ; cursor: pointer;">
|
|
|
- {{ $t('scoreCalc.th_exam') }}
|
|
|
+ {{ $t('scoreCalc.th_homework') }}
|
|
|
</div>
|
|
|
<div style="display: flex; align-items: center;">
|
|
|
- ( <input type="text" v-model="Proportion.ExamRate.score" @input="onRateChange('evaluate')"
|
|
|
+ ( <input type="text" v-model="Proportion.HomeWorkActRate.score"
|
|
|
+ @input="onRateChange('homework')"
|
|
|
style="width: 20px; height: 20px; box-sizing: border-box;"
|
|
|
- :style="{ color: Proportion.ExamRate.color, margin: '0px 5px', border: 'none', background: 'none' }"
|
|
|
+ :style="{ color: Proportion.HomeWorkActRate.color, margin: '0px 5px', border: 'none', background: 'none' }"
|
|
|
maxlength="2">
|
|
|
%)
|
|
|
</div>
|
|
@@ -153,15 +157,15 @@
|
|
|
<div class="div-center" style=" flex-direction: column;">
|
|
|
<div class="div-centerY">
|
|
|
<div class="text-size20">
|
|
|
- {{ rowData.data.evaluate.score+rowData.data.evaluate.add }}
|
|
|
+ {{ rowData.data.homework.score+rowData.data.homework.add }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
- ({{ calculateClassPercent(rowData.data, 'evaluate') }})
|
|
|
+ ({{ calculateClassPercent(rowData.data, 'homework') }})
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- </Column>
|
|
|
+ </Column>
|
|
|
<Column v-for="count in table_count" :key="count" field="custom" header=""
|
|
|
:styles="{ ...commonStyle, width: '100px' }">
|
|
|
<template #header>
|
|
@@ -277,7 +281,7 @@
|
|
|
style=" align-items: center; textDecoration: underline ; cursor: pointer;">
|
|
|
{{ $t('scoreCalc.class') }}
|
|
|
</div>
|
|
|
- <div style="display: flex; align-items: center;">
|
|
|
+ <div>
|
|
|
( <input type="text" v-model="Proportion.ScoreCalcActRate.score"
|
|
|
@input="onRateChange('class')"
|
|
|
style="width: 20px; height: 20px; box-sizing: border-box;"
|
|
@@ -289,19 +293,19 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</Column>
|
|
|
- <Column header="" :rowspan="2" :styles="{ ...sticky , ...tableBorder, top:'0px',}"><!--作業-->
|
|
|
+ <Column header="" :rowspan="2" :styles="{ ...sticky , ...tableBorder, top:'0px',}"><!--評量-->
|
|
|
<template #header>
|
|
|
<div class="div-center" style="width: 80px;">
|
|
|
<div>
|
|
|
- <div @click="changePageTo(Proportion.HomeWorkActRate.id)"
|
|
|
+ <div @click="changePageTo(Proportion.ExamRate.id)"
|
|
|
style=" align-items: center; textDecoration: underline ; cursor: pointer;">
|
|
|
- {{ $t('scoreCalc.th_homework') }}
|
|
|
+ {{ $t('scoreCalc.th_exam') }}
|
|
|
</div>
|
|
|
- <div style="display: flex; align-items: center;">
|
|
|
- ( <input type="text" v-model="Proportion.HomeWorkActRate.score"
|
|
|
- @input="onRateChange('homework')"
|
|
|
+ <div>
|
|
|
+ ( <input type="text" v-model="Proportion.ExamRate.score"
|
|
|
+ @input="onRateChange('evaluate')"
|
|
|
style="width: 20px; height: 20px; box-sizing: border-box;"
|
|
|
- :style="{ color: Proportion.HomeWorkActRate.color, margin: '0px 5px', border: 'none', background: 'none' }"
|
|
|
+ :style="{ color: Proportion.ExamRate.color, margin: '0px 5px', border: 'none', background: 'none' }"
|
|
|
maxlength="2">
|
|
|
%)
|
|
|
</div>
|
|
@@ -309,19 +313,19 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</Column>
|
|
|
- <Column header="" :rowspan="2" :styles="{ ...sticky , ...tableBorder, top:'0px',}"><!--評量-->
|
|
|
+ <Column header="" :rowspan="2" :styles="{ ...sticky , ...tableBorder, top:'0px',}"><!--作業-->
|
|
|
<template #header>
|
|
|
<div class="div-center" style="width: 80px;">
|
|
|
<div>
|
|
|
- <div @click="changePageTo(Proportion.ExamRate.id)"
|
|
|
+ <div @click="changePageTo(Proportion.HomeWorkActRate.id)"
|
|
|
style=" align-items: center; textDecoration: underline ; cursor: pointer;">
|
|
|
- {{ $t('scoreCalc.th_exam') }}
|
|
|
+ {{ $t('scoreCalc.th_homework') }}
|
|
|
</div>
|
|
|
- <div style="display: flex; align-items: center;">
|
|
|
- ( <input type="text" v-model="Proportion.ExamRate.score"
|
|
|
- @input="onRateChange('evaluate')"
|
|
|
+ <div>
|
|
|
+ ( <input type="text" v-model="Proportion.HomeWorkActRate.score"
|
|
|
+ @input="onRateChange('homework')"
|
|
|
style="width: 20px; height: 20px; box-sizing: border-box;"
|
|
|
- :style="{ color: Proportion.ExamRate.color, margin: '0px 5px', border: 'none', background: 'none' }"
|
|
|
+ :style="{ color: Proportion.HomeWorkActRate.color, margin: '0px 5px', border: 'none', background: 'none' }"
|
|
|
maxlength="2">
|
|
|
%)
|
|
|
</div>
|
|
@@ -338,7 +342,7 @@
|
|
|
style=" align-items: center; textDecoration: underline ; cursor: pointer;">
|
|
|
{{ Proportion['custom' + (count)].name }}
|
|
|
</div>
|
|
|
- <div style="display: flex; align-items: center;">
|
|
|
+ <div>
|
|
|
( <input type="text" v-model="Proportion['custom' + (count)].score"
|
|
|
@input="onRateChange('custom' + (count))"
|
|
|
style="width: 20px; height: 20px; box-sizing: border-box;"
|
|
@@ -360,8 +364,7 @@
|
|
|
</Column>
|
|
|
<Column header="" :rowspan="2" :styles="tableNoneBackground" />
|
|
|
<Column header="" :rowspan="2" field="total" sortable
|
|
|
- :styles="{ ...sticky , top:'0px',}"
|
|
|
- ><!--總評分-->
|
|
|
+ :styles="{ ...sticky , top:'0px',}"><!--總評分-->
|
|
|
<template #header>
|
|
|
<div class="div-center" style="width: 80px;">
|
|
|
{{ $t('scoreCalc.totalScore') }}
|
|
@@ -386,7 +389,7 @@
|
|
|
style=" align-items: center; textDecoration: underline ; cursor: pointer;">
|
|
|
{{ $t('scoreCalc.attend') }}
|
|
|
</div>
|
|
|
- <div style="display: flex; align-items: center;">
|
|
|
+ <div>
|
|
|
( <input type="text" v-model="Proportion.ScoreCalcAct.attendRate.score"
|
|
|
@input="onRateChange('attend')"
|
|
|
style="width: 20px; height: 20px; box-sizing: border-box;"
|
|
@@ -406,7 +409,7 @@
|
|
|
style=" align-items: center; textDecoration: underline ; cursor: pointer;">
|
|
|
{{ $t('scoreCalc.point') }}
|
|
|
</div>
|
|
|
- <div style="display: flex; align-items: center;">
|
|
|
+ <div>
|
|
|
( <input type="text" v-model="Proportion.ScoreCalcAct.pointRate.score"
|
|
|
@input="onRateChange('point')"
|
|
|
style="width: 20px; height: 20px; box-sizing: border-box;"
|
|
@@ -427,7 +430,7 @@
|
|
|
style=" align-items: center; textDecoration: underline ; cursor: pointer;">
|
|
|
{{ $t('scoreCalc.interactiveScore') }}
|
|
|
</div>
|
|
|
- <div style="display: flex; align-items: center;">
|
|
|
+ <div>
|
|
|
( <input type="text" v-model="Proportion.ScoreCalcAct.interactRate.score"
|
|
|
@input="onRateChange('interact')"
|
|
|
style="width: 20px; height: 20px; box-sizing: border-box;"
|
|
@@ -535,36 +538,36 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</Column>
|
|
|
- <Column field="homework" header="作業" :styles="{ ...tableBorder }">
|
|
|
+ <Column field="evaluate" header="評量" :styles="{ ...tableBorder }">
|
|
|
<template #body="rowData">
|
|
|
<div class="div-center" style=" flex-direction: column;">
|
|
|
- <div class="div-centerY" >
|
|
|
- <div class="text-size20">
|
|
|
- {{ rowData.data.homework.score }}
|
|
|
+ <div class="div-centerY">
|
|
|
+ <div class="text-size20">
|
|
|
+ {{ rowData.data.evaluate.score }}
|
|
|
</div>
|
|
|
- <input type="text" :value="inputNumShow(rowData.data.homework.add)"
|
|
|
- :style="inputColorShow(rowData.data.homework.add)" maxlength="2"
|
|
|
- @change="addOnChange($event, rowData.data.id, 'homework')" />
|
|
|
+ <input type="text" :value="inputNumShow(rowData.data.evaluate.add)"
|
|
|
+ :style="inputColorShow(rowData.data.evaluate.add)" maxlength="2"
|
|
|
+ @change="addOnChange($event, rowData.data.id, 'evaluate')" />
|
|
|
</div>
|
|
|
<div>
|
|
|
- ({{ calculateClassPercent(rowData.data, 'homework') }})
|
|
|
+ ({{ calculateClassPercent(rowData.data, 'evaluate') }})
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</Column>
|
|
|
- <Column field="evaluate" header="評量" :styles="{ ...tableBorder }">
|
|
|
+ <Column field="homework" header="作業" :styles="{ ...tableBorder }">
|
|
|
<template #body="rowData">
|
|
|
<div class="div-center" style=" flex-direction: column;">
|
|
|
- <div class="div-centerY">
|
|
|
- <div class="text-size20">
|
|
|
- {{ rowData.data.evaluate.score }}
|
|
|
+ <div class="div-centerY" >
|
|
|
+ <div class="text-size20">
|
|
|
+ {{ rowData.data.homework.score }}
|
|
|
</div>
|
|
|
- <input type="text" :value="inputNumShow(rowData.data.evaluate.add)"
|
|
|
- :style="inputColorShow(rowData.data.evaluate.add)" maxlength="2"
|
|
|
- @change="addOnChange($event, rowData.data.id, 'evaluate')" />
|
|
|
+ <input type="text" :value="inputNumShow(rowData.data.homework.add)"
|
|
|
+ :style="inputColorShow(rowData.data.homework.add)" maxlength="2"
|
|
|
+ @change="addOnChange($event, rowData.data.id, 'homework')" />
|
|
|
</div>
|
|
|
<div>
|
|
|
- ({{ calculateClassPercent(rowData.data, 'evaluate') }})
|
|
|
+ ({{ calculateClassPercent(rowData.data, 'homework') }})
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -612,7 +615,8 @@
|
|
|
<div class="div-center" style=" flex-direction: column;">
|
|
|
<div class="div-centerY">
|
|
|
<div class="text-size20">
|
|
|
- {{ calculatePR(rowData.index,rowData.data) }}
|
|
|
+ {{ calculatePR(rowData.data) }}
|
|
|
+ <!-- {{ Number(rowData.data.PR) }} -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -809,12 +813,12 @@ export default {
|
|
|
//缺席absent 病假SL 事假PL 公假OL
|
|
|
{ title: this.$t('scoreCalc.absence2'), key: 'absent' }, { title: this.$t('scoreCalc.sickLeave2'), key: 'SL' }, { title: this.$t('scoreCalc.personalLeave2'), key: 'PL' }, { title: this.$t('scoreCalc.publicLeave2'), key: 'OL' },
|
|
|
{ title: this.$t('scoreCalc.attend'), key: 'attend' }, { title: this.$t('scoreCalc.point'), key: 'point' }, { title: this.$t('scoreCalc.interactiveScore'), key: 'interact' },
|
|
|
- { title: this.$t('scoreCalc.class'), key: 'class' }, { title: this.$t('scoreCalc.th_homework'), key: 'homework' }, { title: this.$t('scoreCalc.th_exam'), key: 'evaluate' },
|
|
|
+ { title: this.$t('scoreCalc.class'), key: 'class' }, { title: this.$t('scoreCalc.th_exam'), key: 'evaluate' }, { title: this.$t('scoreCalc.th_homework'), key: 'homework' },
|
|
|
{ title: this.$t('scoreCalc.totalScore'), key: 'total' }, { title: this.$t('scoreCalc.PRScore'), key: 'PR' }
|
|
|
],
|
|
|
table_columns_Simple_print: [//打算輸出的表單格式(簡單)
|
|
|
{ title: this.$t('scoreCalc.IRSnumber'), key: 'irs' },{ title: this.$t('scoreCalc.name'), key: 'name' }, { title: this.$t('scoreCalc.id'), key: 'id' },
|
|
|
- { title: this.$t('scoreCalc.class'), key: 'class' }, { title: this.$t('scoreCalc.th_homework'), key: 'homework' }, { title: this.$t('scoreCalc.th_exam'), key: 'evaluate' },
|
|
|
+ { title: this.$t('scoreCalc.class'), key: 'class' }, { title: this.$t('scoreCalc.th_exam'), key: 'evaluate' }, { title: this.$t('scoreCalc.th_homework'), key: 'homework' },
|
|
|
{ title: this.$t('scoreCalc.totalScore'), key: 'total' }
|
|
|
],
|
|
|
};
|
|
@@ -890,9 +894,10 @@ export default {
|
|
|
lazyLoading.value = false;
|
|
|
}, Math.random() * 1000 + 250);
|
|
|
},
|
|
|
- calculatePR(index,rowData) {//PR值計算
|
|
|
+ calculatePR(rowData) {//PR值計算
|
|
|
+ //console.log("calculatePR in/rowData.total="+rowData.total);
|
|
|
const N = this.table_class_Data_print.length; // 團體總人數
|
|
|
- const studentScore = rowData.total; // 學生的總分
|
|
|
+ const studentScore = this.table_class_Data_print.find(item => item.id === rowData.id).total; // 學生的總分
|
|
|
const sortedScores = this.table_class_Data_print.map(item => item.total).sort((a, b) => b - a);
|
|
|
const studentRank = sortedScores.indexOf(studentScore) + 1;// 學生的排名
|
|
|
// 使用公式計算 PR 值,PR=[(N-R)/N]×100,其中N代表團體總人數,R是某個人的分數在團體中的排名。
|
|
@@ -1011,7 +1016,7 @@ export default {
|
|
|
}
|
|
|
//PR動一個會所有人成績都有變動,因此要全部變更。
|
|
|
for(let j = 0;j< this.table_class_Data.length ; j++){
|
|
|
- this.table_class_Data[j].PR = this.calculatePR(j,this.table_class_Data[j]);
|
|
|
+ this.table_class_Data[j].PR = this.calculatePR(this.table_class_Data[j]);
|
|
|
// console.log("this.table_class_Data[j].total="+this.table_class_Data[j].total);
|
|
|
// console.log("calculatePR()="+this.calculatePR(j,this.table_class_Data[j]));
|
|
|
// console.log("this.table_class_Data[j].PR="+this.table_class_Data[j].PR);
|
|
@@ -1234,13 +1239,7 @@ export default {
|
|
|
getAPI_ScoreCalc_all(score_id) {//讀取成績API表單all成績資料
|
|
|
this.isLoading = true;
|
|
|
if (score_id) this.scoreCalcId = score_id;
|
|
|
- console.log("score_id=" + score_id);//重要的console,成績表的ID
|
|
|
- console.log({
|
|
|
- "id": score_id,
|
|
|
- "grouplistId": this.classInfo.grouplistId,
|
|
|
- "classId": this.classInfo.classId,
|
|
|
- "scope": this.listType,
|
|
|
- });
|
|
|
+ console.log("score_id=" + score_id);//重要的console,成績表的ID
|
|
|
console.log("-------------------");
|
|
|
this.$api.learnActivity.getScoreCalcAll({
|
|
|
"id": score_id,
|
|
@@ -1430,7 +1429,7 @@ export default {
|
|
|
}
|
|
|
//需要等total算完才能繼續算pr,否則會有錯誤
|
|
|
for(let i =0 ; i<this.table_class_Data.length ; i++){
|
|
|
- this.table_class_Data[i].PR = this.calculatePR(i,this.table_class_Data[i]);
|
|
|
+ this.table_class_Data[i].PR = this.calculatePR(this.table_class_Data[i]);
|
|
|
// console.log("i="+i);
|
|
|
// console.log("this.table_class_Data[i].total="+this.table_class_Data[i].total);
|
|
|
// console.log("this.table_class_Data[i].PR="+this.table_class_Data[i].PR);
|
|
@@ -2091,6 +2090,22 @@ export default {
|
|
|
}, 1000);
|
|
|
},
|
|
|
menuClcik(index) {
|
|
|
+ if(!this.isSave){
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: this.$t("scoreCalc.remind"),
|
|
|
+ content: '<p>' + this.$t("scoreCalc.remindMessage6") + '</p>',
|
|
|
+ onOk: async () => {
|
|
|
+ this.menuChangeTable(index);
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ //this.$Message.info('Clicked cancel');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.menuChangeTable(index);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ menuChangeTable(index){
|
|
|
if(index===-1){
|
|
|
this.tableClear();//清空表單資料
|
|
|
this.tableReLoad_fun();//重新加載表單
|
|
@@ -2105,7 +2120,8 @@ export default {
|
|
|
this.tableReLoad_fun();//重新加載表單
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.isSave = true;
|
|
|
},
|
|
|
//拖曳相關--str---↓↓--
|
|
|
allowDrop(e) {//取消默認行為
|