Commit 00ff56e6 by 李伟康

Merge branch 'feature/586/lwk' into 'SAAS+V5.8.6'

style: 调整src/views/serviceCentre/examinationManagement/下的代码格式与组件规范

See merge request !986
2 parents 227f7276 25111e9a
Pipeline #257 for 00ff56e6 failed in 0 seconds
<template> <template>
<div class="left-container"> <div class="left-container">
<div class="data-view"> <div class="data-view">
<div v-for="item in submitArr" :key="item.name" class="item"> <div v-for="item in submitArr"
<div class="name">{{ item.name }}</div> :key="item.name"
<div class="value">{{ item.value(dataView) }}</div> class="item">
<div class="name">
{{ item.name }}
</div>
<div class="value">
{{ item.value(dataView) }}
</div>
</div> </div>
</div> </div>
<div class="examination-result"> <div class="examination-result">
<div class="title">考试结果等级分布</div> <div class="title">
<echart-bar 考试结果等级分布
class="echart" </div>
:xData="xData" <EchartBar id="resultRef"
:yData="yData" class="echart"
id="resultRef" :x-data="xData"
></echart-bar> :y-data="yData">
</EchartBar>
<div class="hint"> <div class="hint">
<div <div v-for="(item, index) in queryData.examLevelDTOS"
v-for="(item, index) in queryData.examLevelDTOS" :key="index"
class="item" class="item">
:key="index"
>
<span>{{ item.levelName }}:</span> <span>{{ item.levelName }}:</span>
<span>{{ item.minScore + "-" + item.maxScore }}</span> <span>{{ `${item.minScore}-${item.maxScore}` }}</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import echartBar from "./echartBar.vue" import echartBar from "./echartBar.vue";
export default { export default {
components: { echartBar }, components: { EchartBar: echartBar },
props: { props: {
dataView: { dataView: {
type: Object, type: Object,
default: () => {} default: () => {},
}, },
queryData: { queryData: {
type: Object, type: Object,
default: () => {} default: () => {},
} },
}, },
watch: {
dataView: {
handler(newValue, oldValue) {
this.initEchartData(newValue)
},
deep: true,
immediate: true
}
},
data() { data() {
return { return {
submitArr: [ submitArr: [
{ {
name: "已提交人数", name: "已提交人数",
value: (obj) => { value: (obj) => {
console.log(obj) console.log(obj);
return obj.submitted || obj.submitted === 0 ? obj.submitted : "-" return obj.submitted || obj.submitted === 0 ? obj.submitted : "-";
} },
}, },
{ {
name: "已提交人均得分", name: "已提交人均得分",
value: (obj) => { value: (obj) => {
return obj.avg || obj.avg === 0 ? obj.avg : "-" return obj.avg || obj.avg === 0 ? obj.avg : "-";
} },
} },
], ],
xData: [], xData: [],
yData: [] yData: [],
} };
}, },
methods: { watch: {
initEchartData(data) { dataView: {
console.log(data) handler(newValue, oldValue) {
let xData = [] this.initEchartData(newValue);
data.scoreDistributions.forEach((item) => { },
xData.push(item.levelName) deep: true,
}) immediate: true,
this.xData = xData },
this.yData = data.scoreDistributions },
} methods: {
} initEchartData(data) {
} console.log(data);
let xData = [];
data.scoreDistributions.forEach((item) => {
xData.push(item.levelName);
});
this.xData = xData;
this.yData = data.scoreDistributions;
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.left-container { .left-container {
min-width: 800px; // min-width: 800px;
.data-view { .data-view {
display: flex; display: flex;
align-items: center; align-items: center;
.item { .item {
flex: 1; flex: 1;
height: 100px; height: 100px;
border-radius: 4px; border-radius: 4px;
background: #f8faff; background: #f8faff;
margin-right: 16px; margin-right: 16px;
padding: 16px 20px; padding: 16px 20px;
box-sizing: border-box; box-sizing: border-box;
margin-bottom: 16px; margin-bottom: 16px;
.name { .name {
color: #333333; color: #333333;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
margin-bottom: 8px; margin-bottom: 8px;
} }
.value { .value {
color: #1d1d1d; color: #1d1d1d;
font-size: 32px; font-size: 32px;
font-weight: 500; font-weight: 500;
} }
} }
} }
.examination-result { .examination-result {
position: relative; position: relative;
.title { .title {
color: #333333; color: #333333;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
} }
.hint { .hint {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
position: absolute; position: absolute;
top: 52px; top: 52px;
right: 45px; right: 45px;
.item { .item {
display: flex; display: flex;
align-items: center; align-items: center;
color: #000000a6; color: #000000a6;
font-size: 11px; font-size: 11px;
font-weight: 400; font-weight: 400;
margin-bottom: 7px; margin-bottom: 7px;
} }
} }
} }
} }
</style> </style>
...@@ -2,107 +2,112 @@ ...@@ -2,107 +2,112 @@
<template> <template>
<div class="dataView"> <div class="dataView">
<d2-container> <d2-container>
<div class="title">数据概览</div> <div class="title">
数据概览
</div>
<div class="content"> <div class="content">
<div class="left"> <div class="left">
<left-data-view <LeftDataView :data-view="dataViewObj"
:dataView="dataViewObj" :query-data="queryData">
:queryData="queryData" </LeftDataView>
></left-data-view>
</div> </div>
<div class="right"> <div class="right">
<right-data-view :dataView="dataViewObj"></right-data-view> <RightDataView :data-view="dataViewObj"></RightDataView>
</div> </div>
</div> </div>
<div class="database"> <div class="database">
<dataTable :dataView="dataViewObj" :queryData="queryData"> </dataTable> <DataTable :data-view="dataViewObj" :query-data="queryData">
</DataTable>
</div> </div>
</d2-container> </d2-container>
</div> </div>
</template> </template>
<script> <script>
import leftDataView from "./components/leftView.vue" import { getLevelExamOverView } from "@api/serviceCentre";
import rightDataView from "./components/rightView.vue" import dataTable from "./components/dataTable.vue";
import dataTable from "./components/dataTable.vue" import leftDataView from "./components/leftView.vue";
import { getLevelExamOverView } from "@api/serviceCentre" import rightDataView from "./components/rightView.vue";
export default { export default {
name: "dataView", name: "dataView",
components: { components: {
leftDataView, LeftDataView: leftDataView,
rightDataView, RightDataView: rightDataView,
dataTable DataTable: dataTable,
}, },
data() { props: {
return { queryData: {
dataViewObj: { type: Object,
submitted: 0, default: () => {},
avg: 0, },
topPersons: [], },
scoreDistributions: [] data() {
} return {
} dataViewObj: {
}, submitted: 0,
props: { avg: 0,
queryData: { topPersons: [],
type: Object, scoreDistributions: [],
default: () => {} },
} };
}, },
watch: { watch: {
queryData: { queryData: {
handler(val) { handler(val) {
setTimeout(() => { setTimeout(() => {
this.getLevelExamOverViewData() this.getLevelExamOverViewData();
}, 0) }, 0);
}, },
deep: true, deep: true,
immediate: true immediate: true,
} },
}, },
mounted() { mounted() {
this.getLevelExamOverViewData() this.getLevelExamOverViewData();
}, },
methods: { methods: {
async getLevelExamOverViewData() { async getLevelExamOverViewData() {
try { try {
let params = { let params = {
id: this.queryData.id id: this.queryData.id,
} };
let result = await getLevelExamOverView(params) let result = await getLevelExamOverView(params);
console.log(result) console.log(result);
this.dataViewObj = result this.dataViewObj = result;
} catch (err) { } catch (err) {
this.$message.error(err?.message || "获取失败") this.$message.error(err?.message || "获取失败");
} }
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dataView { .dataView {
padding: 0 20px; padding: 0 20px;
.title { .title {
height: 50px; height: 50px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
background: #ffffff; background: #ffffff;
color: #333333; color: #333333;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
padding: 13px 0 13px 20px; padding: 13px 0 13px 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.content { .content {
background: #ffffff; background: #ffffff;
padding: 16px 20px; padding: 16px 20px;
display: flex; display: flex;
.left { width: 100%;
width: calc(100% - 376px); box-sizing: border-box;
} .left {
} width: calc(100% - 376px);
.database { }
background: #ffffff; }
} .database {
background: #ffffff;
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!