<template>
|
<div>
|
<div class="zixuancontainer">
|
<Newheader></Newheader>
|
<div>
|
<el-table :data="zixuanlist" :highlight-current-row="false" border style="width: 100%"
|
:height="tableHeight" @row-click="handleTableRow" v-loading="loading"
|
element-loading-spinner="el-icon-loading" element-loading-background="rgba(37,38,42, 0.8)"
|
:header-cell-style="{ 'padding': '2px 0', 'background': 'rgb(37,38,42)', 'color': '#9d9d9d', 'font-size': '12px' }">
|
<el-table-column prop="date" label="排序">
|
<template slot-scope="scope">
|
<span>
|
{{ scope.$index + 1 }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="indexName" label="名称">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.indexName ? scope.row.indexName : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="indexCode" label="代码">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.indexCode ? scope.row.indexCode : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="floatRate" label="涨幅%">
|
<template slot-scope="scope">
|
<span class="contents" :class="scope.row.floatRate < 0 ? 'greens' : 'reds'">
|
{{ scope.row.floatRate ? (scope.row.floatRate + '%') : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="currentPoint" label="现价">
|
<template slot-scope="scope">
|
<span class="contents" :class="scope.row.floatRate < 0 ? 'greens' : 'reds'">
|
{{ scope.row.currentPoint ? scope.row.currentPoint : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="floatPoint" label="涨跌">
|
<template slot-scope="scope">
|
<span class="contents" :class="scope.row.floatRate < 0 ? 'greens' : 'reds'">
|
{{ scope.row.floatPoint ? scope.row.floatPoint : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<Newfooter></Newfooter>
|
</div>
|
</div>
|
</template>
|
<script>
|
import * as api from "../../axios/api";
|
import Newheader from '@/components/newheader';
|
import Newfooter from '@/components/newfooters';
|
export default {
|
components: {
|
Newheader,
|
Newfooter
|
},
|
data() {
|
return {
|
windowWidth: document.documentElement.clientWidth, //实时屏幕宽度
|
windowHeight: document.documentElement.clientHeight, //实时屏幕高
|
tableHeight: (document.documentElement.clientHeight - 74) + 'px',
|
keyWords: '',
|
pageNum: 1,
|
pageSize: 20,
|
zixuanlist: [],
|
loading: true,
|
}
|
},
|
computed: {
|
},
|
watch: {
|
windowHeight(val) {
|
let that = this;
|
console.log("实时屏幕高度:", val, that.windowHeight);
|
},
|
windowWidth(val) {
|
let that = this;
|
console.log("实时屏幕宽度:", val, that.windowHeight);
|
}
|
},
|
mounted() {
|
var that = this;
|
window.onresize = () => {
|
return (() => {
|
window.fullHeight = document.documentElement.clientHeight;
|
window.fullWidth = document.documentElement.clientWidth;
|
that.windowHeight = window.fullHeight; // 高
|
that.windowWidth = window.fullWidth; // 宽
|
that.$nextTick(() => {
|
that.tableHeight = (that.windowHeight - 70) + 'px'
|
})
|
})()
|
};
|
this.getzixuan()
|
},
|
methods: {
|
async getzixuan() {
|
var that = this;
|
var opt = {
|
keyWords: this.keyWords,
|
pageNum: this.pageNum,
|
pageSize: this.pageSize,
|
};
|
var data = await api.getListMarket(opt);
|
if (data.data.length > 0) {
|
for (const i in data.data) {
|
this.zixuanlist.push(data.data[i])
|
}
|
setTimeout(() => {
|
this.loading = false;
|
}, 1000);
|
}
|
},
|
handleTableRow(row, event, column) {
|
console.log(row, event, column)
|
this.$router.push({
|
path: '/hqchartdetail',
|
query: {
|
code: row.indexGid,
|
stock_type: row.indexGid.substring(0,2),
|
is_zhishu: row.indexCode,
|
sok: row.type ? row.type : 0
|
}
|
})
|
}
|
}
|
}
|
</script>
|
<style lang="less" scoped>
|
/deep/ .el-table__body td {
|
color: #fff !important;
|
}
|
|
/deep/ .el-table tbody tr:hover>td,
|
.el-table tbody tr:hover>tr,
|
.el-table tbody tr:hover .el-table tbody tr td {
|
background-color: rgb(33, 59, 76) !important;
|
background: rgb(33, 59, 76) !important;
|
}
|
|
// /deep/.el-table--enable-row-hover .el-table__body tr:hover > td {
|
// background-color: rgb(19, 75, 132) !important; //颜色必须是rgb
|
// }
|
/deep/ .el-table__body-wrapper {
|
background-color: rgb(37, 38, 42) !important;
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-corner {
|
width: 8px;
|
height: 8px;
|
display: none;
|
}
|
|
/deep/ .el-table--border::after,
|
.el-table--group::after,
|
.el-table::before {
|
background-color: rgb(37, 38, 42);
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
|
background: rgb(37, 38, 42);
|
/*滚动条里面小方块*/
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-track {
|
// -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
border-radius: unset;
|
/*滚动条的背景区域的圆角*/
|
background-color: rgb(37, 38, 42);
|
/*滚动条的背景颜色*/
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
|
border-radius: unset;
|
/*滚动条的圆角*/
|
// -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
background-color: rgb(50, 51, 55);
|
/*滚动条的背景颜色*/
|
}
|
|
.greens {
|
color: rgb(22, 135, 64) !important;
|
}
|
|
.blues {
|
color: rgb(3, 182, 191) !important;
|
}
|
|
.reds {
|
color: rgb(237, 58, 59) !important;
|
}
|
|
.zixuancontainer {
|
background: #25262a;
|
height: calc(100vh - 34px);
|
overflow: unset;
|
}
|
</style>
|