|
@@ -1,24 +1,70 @@
|
|
<template>
|
|
<template>
|
|
<div class="board-container">
|
|
<div class="board-container">
|
|
<div class="header">
|
|
<div class="header">
|
|
- <img src="../assets/logo.png" style="margin-left: 10px; margin-top: 10px;" >
|
|
|
|
|
|
+ <img src="../assets/logo.png" style="margin-left: 10px; margin-top: 10px;">
|
|
</div>
|
|
</div>
|
|
<div class="title_info">
|
|
<div class="title_info">
|
|
<el-card shadow="always" style="background-color: rgb(201,235,251); border-radius: 5px;">
|
|
<el-card shadow="always" style="background-color: rgb(201,235,251); border-radius: 5px;">
|
|
<p class="item_name">{{ itemName }}</p>
|
|
<p class="item_name">{{ itemName }}</p>
|
|
- <p class="scope_cycleName">{{type}} {{ scope }} 类 {{ cycleName }} 专家评分公示</p>
|
|
|
|
|
|
+ <p class="scope_cycleName">{{ type }} {{ scope }} 类 {{ cycleName }} 专家评分公示</p>
|
|
</el-card>
|
|
</el-card>
|
|
</div>
|
|
</div>
|
|
<div class="analysis_collect">
|
|
<div class="analysis_collect">
|
|
<span class="name"><i class="el-icon-s-data"></i>评分项平均得分</span>
|
|
<span class="name"><i class="el-icon-s-data"></i>评分项平均得分</span>
|
|
- <el-table :data="analysisData" border style="width: 100% ;" stripe highlight-current-row>
|
|
|
|
- <el-table-column prop="questionName" label="评分项" align="center">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="avgScore" label="平均得分" align="center">
|
|
|
|
- </el-table-column>
|
|
|
|
|
|
+ <!-- <el-row :gutter="20">
|
|
|
|
+ <el-col :span="6" v-for="(item, index ) in analysisData">
|
|
|
|
+ <el-card shadow="never">
|
|
|
|
+ <span style="font-weight: 900; letter-spacing: 3px;">
|
|
|
|
+ {{ item.questionName }}
|
|
|
|
+ </span>
|
|
|
|
+ <span style="float: right; color: red;">
|
|
|
|
+ {{ item.avgScore }}
|
|
|
|
+ </span>
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row> -->
|
|
|
|
+ <el-table :data="analysisData" :span-method="objectSpanMethod"
|
|
|
|
+ style="width: 100% ;letter-spacing: 2px; color: black; " border="border">
|
|
|
|
+ <el-table-column v-for="item in tableColumn" :key="item.prop" :prop="item.prop" :label="item.label"
|
|
|
|
+ align="center" min-width="180" />
|
|
</el-table>
|
|
</el-table>
|
|
|
|
+ <!-- <y-page-list-layout>
|
|
|
|
+ <el-table :data="analysisData" slot="table" style="width: 100%;" border="border">
|
|
|
|
+ <el-table-column v-if="analysisData != null && analysisData.length > 0" label="名称" align="center" width="150px">
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <span style=" letter-spacing: 3px;">{{ row.questionName }}-{{ row.avgScore }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column v-if="analysisData != null && analysisData.length > 0" label="定级因素" align="center">
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <div style="margin-bottom: 10px; letter-spacing: 3px;" v-for="(item, index) in row.children">{{ item.questionName }}-{{ item.avgScore }}</div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column v-if="analysisData != null && analysisData.length > 0" label="一级因子" align="center">
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <div v-for="(item, index) in row.children">
|
|
|
|
+ <div style=" margin-bottom: 10px; letter-spacing: 3px;" v-for="(item1, index) in item.children">
|
|
|
|
+ {{ item1.questionName }}-{{ item1.avgScore }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column v-if="analysisData != null && analysisData.length > 0" label="二级因子" align="center">
|
|
|
|
+ <template slot-scope="{row}">
|
|
|
|
+ <div v-for="(item, index) in row.children">
|
|
|
|
+ <div v-for="(item1, index) in item.children">
|
|
|
|
+ <div style=" margin-bottom: 10px; letter-spacing: 3px;" v-for="(item2, index) in item1.children">
|
|
|
|
+ {{ item2.questionName }}-{{ item2.avgScore }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </y-page-list-layout> -->
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
- <div class="origin_collect">
|
|
|
|
|
|
+ <!-- <div class="origin_collect">
|
|
<span class="name"><i class="el-icon-s-data"></i>专家评分值</span>
|
|
<span class="name"><i class="el-icon-s-data"></i>专家评分值</span>
|
|
<el-table :data="originData" border style="width: 100%" stripe highlight-current-row>
|
|
<el-table :data="originData" border style="width: 100%" stripe highlight-current-row>
|
|
<el-table-column prop="professorNo" label="专家编号" align="center">
|
|
<el-table-column prop="professorNo" label="专家编号" align="center">
|
|
@@ -30,11 +76,11 @@
|
|
<el-table-column prop="created" label="专家评分时间" align="center">
|
|
<el-table-column prop="created" label="专家评分时间" align="center">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
<div class="user_size">
|
|
<div class="user_size">
|
|
- <span v-for="(u,index) in userSize">
|
|
|
|
|
|
+ <span v-for="(u, index) in userSize">
|
|
<i class="el-icon-s-custom" style="color: green; font-size: xx-large;"></i>
|
|
<i class="el-icon-s-custom" style="color: green; font-size: xx-large;"></i>
|
|
- </span>
|
|
|
|
|
|
+ </span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -42,11 +88,13 @@
|
|
<script>
|
|
<script>
|
|
import YPageListLayout from '@/components/custom/YPageListLayout'
|
|
import YPageListLayout from '@/components/custom/YPageListLayout'
|
|
import WebSocketClient from '../utils/WebSocketClient.js'
|
|
import WebSocketClient from '../utils/WebSocketClient.js'
|
|
|
|
+import { getMergeCells } from '../utils/table.js'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'Dashboard',
|
|
name: 'Dashboard',
|
|
components: {
|
|
components: {
|
|
YPageListLayout,
|
|
YPageListLayout,
|
|
|
|
+ getMergeCells
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -56,49 +104,66 @@ export default {
|
|
itemName: "",
|
|
itemName: "",
|
|
scope: "",
|
|
scope: "",
|
|
cycleName: "",
|
|
cycleName: "",
|
|
- type:null,
|
|
|
|
|
|
+ type: null,
|
|
messages: [],
|
|
messages: [],
|
|
error: null,
|
|
error: null,
|
|
client: {
|
|
client: {
|
|
- messages:[
|
|
|
|
- {data:"*"},
|
|
|
|
- {userSize:0}
|
|
|
|
|
|
+ messages: [
|
|
|
|
+ { data: "*" },
|
|
|
|
+ { userSize: 0 }
|
|
]
|
|
]
|
|
},
|
|
},
|
|
- userSize:0
|
|
|
|
-
|
|
|
|
|
|
+ userSize: 0,
|
|
|
|
+ tableColumn: [
|
|
|
|
+ { prop: 'name', label: '名称' },
|
|
|
|
+ { prop: 'element', label: '定级因素' },
|
|
|
|
+ { prop: 'element1', label: '一级因子' },
|
|
|
|
+ { prop: 'element2', label: '二级因子' },
|
|
|
|
+ ],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- watch:{
|
|
|
|
- client:{
|
|
|
|
|
|
+ computed: {
|
|
|
|
+ // 获取所有单元格合并数据
|
|
|
|
+ spanArr() {
|
|
|
|
+ if (!this.tableColumn.length) return []
|
|
|
|
+ const mergeCols = ['name', 'element', 'element1', 'element2'] // 需要合并的列(字段)
|
|
|
|
+ return getMergeCells(this.analysisData, this.tableColumn, mergeCols)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ client: {
|
|
deep: true,
|
|
deep: true,
|
|
- handler(newValue,oldValue){
|
|
|
|
- let data = newValue.messages[(newValue.messages.length)-1]
|
|
|
|
- if (data != undefined){
|
|
|
|
- if (data.data !=null){
|
|
|
|
|
|
+ handler(newValue, oldValue) {
|
|
|
|
+ let data = newValue.messages[(newValue.messages.length) - 1]
|
|
|
|
+ if (data != undefined) {
|
|
|
|
+ if (data.data != null) {
|
|
this.getAnalysisList();
|
|
this.getAnalysisList();
|
|
this.getOriginList();
|
|
this.getOriginList();
|
|
}
|
|
}
|
|
- if (data.userSize != undefined){
|
|
|
|
- this.userSize = (data.userSize)-1;
|
|
|
|
|
|
+ if (data.userSize != undefined) {
|
|
|
|
+ this.userSize = (data.userSize) - 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted(){
|
|
|
|
|
|
+ mounted() {
|
|
this.init();
|
|
this.init();
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getAnalysisList();
|
|
this.getAnalysisList();
|
|
- this.getOriginList();
|
|
|
|
|
|
+ // this.getOriginList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- init(){
|
|
|
|
- if (typeof(WebSocket) === "undefined"){
|
|
|
|
|
|
+ objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
|
+ return this.spanArr[rowIndex][columnIndex]
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ init() {
|
|
|
|
+ if (typeof (WebSocket) === "undefined") {
|
|
console.log("您的浏览器不支持socket")
|
|
console.log("您的浏览器不支持socket")
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
// 创建 WebSocketClient 实例并连接到服务端 API 接口
|
|
// 创建 WebSocketClient 实例并连接到服务端 API 接口
|
|
this.client = new WebSocketClient('wss://kps.scdayou.com/ws/apo/ws')
|
|
this.client = new WebSocketClient('wss://kps.scdayou.com/ws/apo/ws')
|
|
this.client.connect()
|
|
this.client.connect()
|
|
@@ -106,16 +171,12 @@ export default {
|
|
},
|
|
},
|
|
getAnalysisList() {
|
|
getAnalysisList() {
|
|
const that = this
|
|
const that = this
|
|
- this.$api.dashboard.getAnalysisList()
|
|
|
|
|
|
+ this.$api.dashboard.getMergeData()
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- let tScore = res.data[0].avgScore
|
|
|
|
- if (tScore==null){
|
|
|
|
- that.analysisData = null;
|
|
|
|
- }else{
|
|
|
|
- that.analysisData = res.data
|
|
|
|
- }
|
|
|
|
- setTimeout(() => {
|
|
|
|
- }, 200)
|
|
|
|
|
|
+ that.analysisData = res.data.analysisData;
|
|
|
|
+ that.itemName = res.data.itemName;
|
|
|
|
+ that.cycleName = res.data.cycleName;
|
|
|
|
+ that.type = res.data.typeName;
|
|
})
|
|
})
|
|
.catch(() => {
|
|
.catch(() => {
|
|
that.listLoading = false
|
|
that.listLoading = false
|
|
@@ -125,15 +186,11 @@ export default {
|
|
const that = this
|
|
const that = this
|
|
this.$api.dashboard.getOriginList()
|
|
this.$api.dashboard.getOriginList()
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- that.itemName = res.data[0].itemName;
|
|
|
|
- that.scope = res.data[0].scope;
|
|
|
|
- that.cycleName = res.data[0].cycleName;
|
|
|
|
- that.type = res.data[0].type;
|
|
|
|
- if (res.data[0].score ==null){
|
|
|
|
|
|
+ if (res.data[0].score == null) {
|
|
that.originData = null;
|
|
that.originData = null;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
that.originData = res.data;
|
|
that.originData = res.data;
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
}, 200)
|
|
}, 200)
|
|
@@ -144,11 +201,11 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
destoryed() {
|
|
destoryed() {
|
|
- // 在组件销毁前断开 WebSocket 连接
|
|
|
|
|
|
+ // 在组件销毁前断开 WebSocket 连接
|
|
this.client.disconnect()
|
|
this.client.disconnect()
|
|
console.log("websocket 断开")
|
|
console.log("websocket 断开")
|
|
},
|
|
},
|
|
- beforeDestory(){
|
|
|
|
|
|
+ beforeDestory() {
|
|
this.client.disconnect()
|
|
this.client.disconnect()
|
|
console.log("websocket 断开")
|
|
console.log("websocket 断开")
|
|
}
|
|
}
|
|
@@ -159,13 +216,12 @@ export default {
|
|
.header {
|
|
.header {
|
|
height: 80px;
|
|
height: 80px;
|
|
padding: 0;
|
|
padding: 0;
|
|
- background-color: #ffffff;
|
|
|
|
|
|
+ background-color: #ffffff;
|
|
vertical-align: middle;
|
|
vertical-align: middle;
|
|
display: flex;
|
|
display: flex;
|
|
position: relative;
|
|
position: relative;
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
-
|
|
|
|
.left {
|
|
.left {
|
|
margin: 0;
|
|
margin: 0;
|
|
padding-left: 10px;
|
|
padding-left: 10px;
|
|
@@ -180,8 +236,7 @@ export default {
|
|
overflow: auto; */
|
|
overflow: auto; */
|
|
top: -10;
|
|
top: -10;
|
|
background-image: linear-gradient(to top, #ace0f9 0%, #ffffff 100%);
|
|
background-image: linear-gradient(to top, #ace0f9 0%, #ffffff 100%);
|
|
- height: 1200px;
|
|
|
|
- overflow:auto;
|
|
|
|
|
|
+ overflow: auto;
|
|
}
|
|
}
|
|
|
|
|
|
.item_name {
|
|
.item_name {
|
|
@@ -195,7 +250,7 @@ export default {
|
|
letter-spacing: 1px;
|
|
letter-spacing: 1px;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
color: red;
|
|
color: red;
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
.title_info {
|
|
.title_info {
|
|
@@ -206,9 +261,10 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.analysis_collect {
|
|
.analysis_collect {
|
|
- margin-top: 2%;
|
|
|
|
|
|
+ margin-top: 1%;
|
|
width: 70%;
|
|
width: 70%;
|
|
margin-left: 15%;
|
|
margin-left: 15%;
|
|
|
|
+ height: 1200px;
|
|
}
|
|
}
|
|
|
|
|
|
.origin_collect {
|
|
.origin_collect {
|
|
@@ -217,18 +273,19 @@ export default {
|
|
margin-bottom: 2%;
|
|
margin-bottom: 2%;
|
|
margin-left: 15%;
|
|
margin-left: 15%;
|
|
}
|
|
}
|
|
-.name{
|
|
|
|
|
|
+
|
|
|
|
+.name {
|
|
/* font-family: 'Courier New', Courier, monospace; */
|
|
/* font-family: 'Courier New', Courier, monospace; */
|
|
margin-bottom: 5px;
|
|
margin-bottom: 5px;
|
|
letter-spacing: 1px;
|
|
letter-spacing: 1px;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
font-size: small;
|
|
font-size: small;
|
|
}
|
|
}
|
|
-.user_size{
|
|
|
|
- position:absolute;
|
|
|
|
- right:30px;
|
|
|
|
- top:1%;
|
|
|
|
|
|
+
|
|
|
|
+.user_size {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 30px;
|
|
|
|
+ top: 1%;
|
|
height: 40px;
|
|
height: 40px;
|
|
}
|
|
}
|
|
-
|
|
|
|
</style>
|
|
</style>
|