Browse Source

优化

master
dai 3 years ago
parent
commit
6c1c18aba5
  1. 11
      src/assets/scss/main-shuju.scss
  2. 127
      src/views/modules/visual/cpts/tb.vue

11
src/assets/scss/main-shuju.scss

@ -176,9 +176,9 @@
// box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05); // box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05);
background: linear-gradient(180deg, #00023f, #176dec); background: linear-gradient(180deg, #00023f, #176dec);
box-shadow: 0px 3px 16px 0px rgba(187, 187, 227, 0.35); box-shadow: 0px 3px 16px 0px rgba(187, 187, 227, 0.35);
font-size: 18px; font-size: 19px;
.el-menu-item { .el-menu-item {
font-size: 18px; font-size: 19px;
} }
.navbar--colorful { .navbar--colorful {
@ -426,9 +426,10 @@
} }
.el-dropdown { .el-dropdown {
color: #fff; color: #fff;
font-size: 16px;
.el-icon-arrow-down { .el-icon-arrow-down {
width: auto; width: auto;
font-size: 12px; font-size: 16px;
margin: 0 0 0 5px; margin: 0 0 0 5px;
transition: transform 0.3s; transition: transform 0.3s;
} }
@ -472,9 +473,9 @@
.navbar__avatar { .navbar__avatar {
.el-dropdown-link { .el-dropdown-link {
> img { > img {
width: 36px; width: 42px;
height: auto; height: auto;
margin-right: 5px; margin-right: 7px;
border-radius: 100%; border-radius: 100%;
vertical-align: middle; vertical-align: middle;
} }

127
src/views/modules/visual/cpts/tb.vue

@ -1,75 +1,89 @@
<template> <template>
<div class="m-table"> <div class="m-table">
<table class="table" <table class="table" border="0" cellspacing="0" cellpadding="0">
border="0" <col
cellspacing="0" :align="item.align"
cellpadding="0"> :width="item.width"
<col :align="item.align" :key="'col' + index"
:width="item.width" v-for="(item, index) in colList"
:key="'col' + index" />
v-for="(item, index) in colList" />
<thead> <thead>
<tr class="table-header"> <tr class="table-header">
<th class="table-header-th" <th class="table-header-th" v-for="item in header" :key="item">
v-for="item in header"
:key="item">
{{ item }} {{ item }}
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="table-body"> <tbody class="table-body">
<tr class="table-body-tr" <tr
v-for="(value, index) in list" class="table-body-tr"
:key="index" v-for="(value, index) in list"
@click="handleClickRow(index)"> :key="index"
<td class="td" @click="handleClickRow(index)"
v-for="(item, indexs) in value" >
:key="indexs"> <td class="td" v-for="(item, indexs) in value" :key="indexs">
<div v-if="typeof item === 'string' || typeof item === 'number'"> <div
v-if="typeof item === 'string' || typeof item === 'number'"
:title="item"
>
{{ item }} {{ item }}
</div> </div>
<div v-if="typeof item === 'object'&& item.type === 'img'"> <div v-if="typeof item === 'object' && item.type === 'img'">
<!-- <span>{{ item.type+ item.src}}</span> --> <!-- <span>{{ item.type+ item.src}}</span> -->
<img style="width:18px;height:18px" <img style="width: 18px; height: 18px" :src="item.src" alt="" />
:src="item.src"
alt="" />
</div> </div>
<div v-if="typeof item === 'object' && item && item.type == 'index'">
<img v-if="highlightTop3 && index == 0" <div
src="@/assets/img/shuju/top/1.png" v-if="typeof item === 'object' && item && item.type == 'index'"
alt="" /> >
<img v-else-if="highlightTop3 && index == 1" <img
src="@/assets/img/shuju/top/2.png" v-if="highlightTop3 && index == 0"
alt="" /> src="@/assets/img/shuju/top/1.png"
<img v-else-if="highlightTop3 && index == 2" alt=""
src="@/assets/img/shuju/top/3.png" />
alt="" /> <img
v-else-if="highlightTop3 && index == 1"
src="@/assets/img/shuju/top/2.png"
alt=""
/>
<img
v-else-if="highlightTop3 && index == 2"
src="@/assets/img/shuju/top/3.png"
alt=""
/>
<span v-else>{{ index + 1 }}</span> <span v-else>{{ index + 1 }}</span>
</div> </div>
<a v-else-if="typeof item === 'object' && item && item.type == 'operate'"
v-for="btn in item.list" <a
:key="'operate' + index + btn" v-else-if="
@click="handleClickBtn(index, btn)">{{ btn }}</a> typeof item === 'object' && item && item.type == 'operate'
<a v-else-if="typeof item === 'object' && item && item.type == 'people'" "
@click="handleClickPeople(item)">{{ item.name }}</a> v-for="btn in item.list"
:key="'operate' + index + btn"
@click="handleClickBtn(index, btn)"
>{{ btn }}</a
>
<a
v-else-if="
typeof item === 'object' && item && item.type == 'people'
"
@click="handleClickPeople(item)"
>{{ item.name }}</a
>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="table-status" <div class="table-status" v-if="loading">
v-if="loading">
<screen-loading>加载中</screen-loading> <screen-loading>加载中</screen-loading>
</div> </div>
<div class="table-status" <div class="table-status" v-if="list.length == 0 && !loading">
v-if="list.length == 0 && !loading">
<div class="no-data"> <div class="no-data">
<img src="@/assets/img/modules/visual/noData.png" <img src="@/assets/img/modules/visual/noData.png" class="no-data-img" />
class="no-data-img" />
</div> </div>
</div> </div>
</div> </div>
@ -77,7 +91,6 @@
<script> <script>
import ScreenLoading from "./loading"; import ScreenLoading from "./loading";
import Vue from "vue";
export default { export default {
name: "table", name: "table",
@ -138,24 +151,24 @@ export default {
default: false, default: false,
}, },
}, },
data () { data() {
return {}; return {};
}, },
watch: {}, watch: {},
mounted () { }, mounted() {},
created () { }, created() {},
methods: { methods: {
// //
handleClickRow (index) { handleClickRow(index) {
this.$emit("handleClickRow", index); this.$emit("handleClickRow", index);
}, },
handleClickBtn (index, type) { handleClickBtn(index, type) {
this.$emit("operate", index, type); this.$emit("operate", index, type);
}, },
handleClickPeople (item) { handleClickPeople(item) {
this.$router.push({ this.$router.push({
path: `/main-shuju/visual-basicinfo-people/${item.uid}`, path: `/main-shuju/visual-basicinfo-people/${item.uid}`,
}); });
@ -177,9 +190,10 @@ export default {
width: 100%; width: 100%;
height: 50px; height: 50px;
background: rgba(8, 37, 134, 0.85); background: rgba(8, 37, 134, 0.85);
font-size: 16px; font-size: 17px;
font-weight: 400; font-weight: 400;
color: #ffffff; color: #ffffff;
line-height: 50px;
&-th { &-th {
text-align: center; text-align: center;
@ -191,9 +205,10 @@ export default {
&-body { &-body {
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #ffffff; color: #ffffff;
line-height: 40px;
&-tr { &-tr {
box-sizing: border-box; box-sizing: border-box;
@ -214,7 +229,7 @@ export default {
} }
a { a {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #e4dc00; color: #e4dc00;
position: relative; position: relative;

Loading…
Cancel
Save