Browse Source

列表加滚动条,加jquery,备用

V1.0
tianqian 2 years ago
parent
commit
4fe0f810ed
  1. 1
      public/index.html
  2. 4
      public/jquery-3.1.1.min.js
  3. 654
      src/views/dataBoard/cpts/tb.vue

1
public/index.html

@ -8,6 +8,7 @@
content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,viewport-fit=cover" /> content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,viewport-fit=cover" />
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" /> <link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
<script src="<%= BASE_URL %>jquery-3.1.1.min.js"></script>
<!-- 站点配置 --> <!-- 站点配置 -->
<script> <script>
window.SITE_CONFIG = {} window.SITE_CONFIG = {}

4
public/jquery-3.1.1.min.js

File diff suppressed because one or more lines are too long

654
src/views/dataBoard/cpts/tb.vue

@ -2,442 +2,376 @@
<div> <div>
<div class="m-table"> <div class="m-table">
<table class="table" border="0" cellspacing="0" cellpadding="0"> <table class="table" border="0" cellspacing="0" cellpadding="0">
<col <col :align="item.align" :width="item.width" :key="'col' + index" v-for="(item, index) in colList" />
:align="item.align"
:width="item.width"
:key="'col' + index"
v-for="(item, index) in colList"
/>
<thead> <thead>
<tr class="table-header"> <tr class="table-header" >
<th <th class="table-header-th" v-for="item in header" :key="item">
class="table-header-th"
v-for="item in header"
:key="item"
>
{{ item }} {{ item }}
</th> </th>
</tr> </tr>
</thead> </thead></table>
<!-- <el-scrollbar :style="{height:treeHeight}" <el-scrollbar :style="{height:treeHeight}" class="g-scrollar">
class="g-scrollar"> --> <table class="table" border="0" cellspacing="0" cellpadding="0">
<tbody v-if="!loading" class="table-body"> <col :align="item.align" :width="item.width" :key="'col' + index" v-for="(item, index) in colList" />
<tr
class="table-body-tr" <tbody v-if="!loading" class="table-body" style="width: 1886px;">
v-for="(value, index) in list" <tr class="table-body-tr" v-for="(value, index) in list" :key="index"
:key="index" @click="handleClickRow(index)">
@click="handleClickRow(index)" <td class="td" v-for="(item, indexs) in value" :key="indexs">
> <div v-if="
<td
class="td"
v-for="(item, indexs) in value"
:key="indexs"
>
<div
v-if="
typeof item === 'string' || typeof item === 'string' ||
typeof item === 'number' typeof item === 'number'
" " :title="item">
:title="item" {{ item }}
> </div>
{{ item }} <div v-if="
</div>
<div
v-if="
typeof item === 'object' || typeof item === 'object' ||
typeof item.type === 'object' typeof item.type === 'object'
" " :title="item.name" :class="item.class">
:title="item.name" {{ item.name }}
:class="item.class" </div>
> <div v-if="
{{ item.name }}
</div>
<div
v-if="
typeof item === 'object' && typeof item === 'object' &&
item.type === 'img' item.type === 'img'
" ">
> <!-- <span>{{ item.type+ item.src}}</span> -->
<!-- <span>{{ item.type+ item.src}}</span> --> <img style="width: 18px; height: 18px" :src="item.src" alt="" />
<img </div>
style="width: 18px; height: 18px" <div v-if="
:src="item.src"
alt=""
/>
</div>
<div
v-if="
typeof item === 'object' && typeof item === 'object' &&
item && item &&
item.type == 'index' item.type == 'index'
" ">
> <img v-if="highlightTop3 && index == 0" src="@/assets/img/shuju/top/1.png" alt="" />
<img <img v-else-if="highlightTop3 && index == 1" 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" src="@/assets/img/shuju/top/3.png"
alt="" alt="" />
/> <span v-else>{{ index + 1 }}</span>
<img </div>
v-else-if="highlightTop3 && index == 1" <a v-else-if="
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>
</div>
<a
v-else-if="
typeof item === 'object' && typeof item === 'object' &&
item && item &&
item.type == 'operate' item.type == 'operate'
" " fixed v-for="btn in item.list" :key="'operate' + index + btn"
fixed @click.stop="handleClickBtn(index, btn)">{{ btn }}</a>
v-for="btn in item.list" <a v-else-if="
:key="'operate' + index + btn"
@click.stop="handleClickBtn(index, btn)"
>{{ btn }}</a
>
<a
v-else-if="
typeof item === 'object' && typeof item === 'object' &&
item && item &&
item.type == 'people' item.type == 'people'
" " @click="handleClickPeople(item)">{{ item.name }}</a>
@click="handleClickPeople(item)" </td>
>{{ item.name }}</a </tr>
> </tbody>
</td> <!-- </div> -->
</tr>
</tbody>
<!-- </el-scrollbar> -->
</table>
</table></el-scrollbar>
<div class="table-status" v-if="loading"> <div class="table-status" v-if="loading">
<screen-loading>加载中</screen-loading> <screen-loading>加载中</screen-loading>
</div> </div>
<div class="table-status" v-if="list.length == 0 && !loading"> <div class="table-status" v-if="list.length == 0 && !loading">
<div class="no-data"> <div class="no-data">
<img <img src="~@/assets/images/shuju/renfang/index/empty.png" class="no-data-img" />
src="~@/assets/images/shuju/renfang/index/empty.png"
class="no-data-img"
/>
</div> </div>
</div> </div>
</div> </div>
<div class="m-pagination"> <div class="m-pagination">
<el-pagination <el-pagination :current-page="pageNo" :page-size="pageSize" background :total="total" layout="total">
:current-page="pageNo"
:page-size="pageSize"
background
:total="total"
layout="total"
>
</el-pagination> </el-pagination>
<el-pagination <el-pagination :current-page="pageNo" :page-size="pageSize" background :total="total"
:current-page="pageNo" layout="prev, pager, next, jumper, sizes" @current-change="handlePageNoChange"
:page-size="pageSize" @size-change="handleSizeChange">
background
:total="total"
layout="prev, pager, next, jumper, sizes"
@current-change="handlePageNoChange"
@size-change="handleSizeChange"
>
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import ScreenLoading from "./loading"; import ScreenLoading from "./loading";
import { mapGetters } from "vuex"; import {
mapGetters
export default { } from "vuex";
name: "list", export default {
components: { name: "list",
ScreenLoading, components: {
}, ScreenLoading,
props: {
//
colList: {
type: Array,
default: () => {
return [
// {
// align: "center",
// width: "50%",
// },
];
},
}, },
// props: {
header: { //
type: Array, colList: {
required: false, type: Array,
default: () => { default: () => {
return []; return [
// {
// align: "center",
// width: "50%",
// },
];
},
}, },
}, //
// header: {
list: { type: Array,
type: Array, required: false,
required: false, default: () => {
default: () => { return [];
return []; },
},
//
list: {
type: Array,
required: false,
default: () => {
return [];
},
},
//
total: {
type: Number,
default: 0,
},
loading: {
type: Boolean,
default: true,
},
highlightTop3: {
type: Boolean,
default: false,
}, },
}, },
// data() {
total: { return {
type: Number, pageSize: parseInt(localStorage.getItem("dataBoard_PageSize")) || 20,
default: 0, pageNo: 1,
}, };
loading: {
type: Boolean,
default: true,
},
highlightTop3: {
type: Boolean,
default: false,
},
},
data() {
return {
pageSize:
parseInt(localStorage.getItem("dataBoard_PageSize")) || 20,
pageNo: 1,
};
},
watch: {},
computed: {
treeHeight() {
return this.$store.state.inIframe
? this.clientHeight - 300 + this.iframeHeight + "px"
: this.clientHeight - 300 + "px";
}, },
treeWidth() { watch: {},
return document.documentElement.clientWidth; computed: {
treeHeight() {
return this.$store.state.inIframe ? this.clientHeight - 385 + this.iframeHeight + "px" : this
.clientHeight - 385 + "px";
},
treeWidth() {
return document.documentElement.clientWidth;
},
...mapGetters(["clientHeight", "iframeHeight"]),
}, },
mounted() {
...mapGetters(["clientHeight", "iframeHeight"]),
},
mounted() {},
created() {},
activated(){
this.pageNo = 1
},
methods: {
//
handleClickRow(index) {
this.$emit("handleClickRow", index);
},
handleClickBtn(index, type) {
this.$emit("operate", index, type);
}, },
handleClickPeople(item) { created() {},
this.$router.push({ activated() {
path: `/main-shuju/visual-basicinfo-people/${item.uid}`, this.pageNo = 1
});
},
handlePageNoChange(val) {
this.pageNo = val
this.$emit("handlePageNoChange", val);
}, },
handleSizeChange(val) { methods: {
this.$emit("handleSizeChange", val); //
handleClickRow(index) {
this.$emit("handleClickRow", index);
},
handleClickBtn(index, type) {
this.$emit("operate", index, type);
},
handleClickPeople(item) {
this.$router.push({
path: `/main-shuju/visual-basicinfo-people/${item.uid}`,
});
},
handlePageNoChange(val) {
this.pageNo = val
this.$emit("handlePageNoChange", val);
},
handleSizeChange(val) {
this.$emit("handleSizeChange", val);
},
}, },
}, };
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.m-table { .m-table {
margin-top: 9px; margin-top: 9px;
// width: 100%; // width: 100%;
overflow: hidden; overflow: hidden;
min-height: 300px; min-height: 300px;
.table {
box-sizing: border-box;
width: 100%;
border: none;
table-layout: fixed;
&-header {
width: 100%;
height: 56px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(255, 255, 255, 0.65);
line-height: 20px;
&-th { .table {
text-align: left;
border: none;
padding: 18px 5px 18px 24px;
// width: calc(100% / 5);
}
}
&-body {
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
font-size: 14px; border: none;
font-family: PingFangSC-Regular, PingFang SC; table-layout: fixed;
font-weight: 400;
color: #ffffff;
line-height: 20px;
&-tr { &-header {
box-sizing: border-box;
width: 100%; width: 100%;
min-height: 56px; height: 56px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(255, 255, 255, 0.65);
line-height: 20px;
.td { &-th {
box-sizing: border-box;
text-align: left; text-align: left;
border: none; border: none;
padding: 18px 5px 18px 24px; padding: 18px 5px 18px 24px;
// width: calc(100% / 5);
}
}
> div { &-body {
overflow: hidden; box-sizing: border-box;
white-space: nowrap; width: 100%;
text-overflow: ellipsis; font-size: 14px;
word-wrap: normal; font-family: PingFangSC-Regular, PingFang SC;
} font-weight: 400;
color: #ffffff;
line-height: 20px;
a { &-tr {
font-size: 14px; box-sizing: border-box;
font-family: PingFangSC-Regular, PingFang SC; width: 100%;
font-weight: 400; min-height: 56px;
color: #1a95ff;
line-height: 20px; .td {
cursor: pointer; box-sizing: border-box;
text-align: left;
border: none;
padding: 18px 5px 18px 24px;
>div {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-wrap: normal;
}
a {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #1a95ff;
line-height: 20px;
cursor: pointer;
}
} }
} }
&-tr:nth-child(2n-1) {
background: rgba(26, 149, 255, 0.15);
}
// &-tr:hover {
// background: url("../../../../assets/img/modules/visual/hover-bac.png")
// no-repeat center;
// background-size: 100% 100%;
// }
} }
&-tr:nth-child(2n-1) { /deep/ .el-scrollbar__wrap {
background: rgba(26, 149, 255, 0.15); width: 100% !important;
overflow-x: hidden !important;
} }
}
// &-tr:hover { .g-scrollar {
// background: url("../../../../assets/img/modules/visual/hover-bac.png") width: 100%;
// no-repeat center; overflow-x: hidden;
// background-size: 100% 100%;
// }
} }
/deep/ .el-scrollbar__wrap { .orange {
width: 100% !important; color: #FFAA00
overflow-x: hidden !important;
} }
}
.g-scrollar {
width: 100%;
}
.orange{
color:#FFAA00
}
.green{
color:#04C790
}
.table-status {
position: relative;
height: 300px;
// .green {
.no-data { color: #04C790
&-img { }
position: absolute;
top: 0; .table-status {
left: 0; position: relative;
right: 0; height: 300px;
bottom: 0;
margin: auto; //
width: 120px; .no-data {
&-img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: 120px;
}
} }
} }
} }
} /deep/ .el-scrollbar__wrap {
width: 100% !important;
.m-pagination { overflow-x: hidden !important;
box-sizing: border-box; }
margin-top: 24px; .m-pagination {
width: 100%; box-sizing: border-box;
height: 40px; margin-top: 24px;
display: flex; width: 100%;
justify-content: space-between; height: 40px;
display: flex;
justify-content: space-between;
/deep/ .el-pagination.is-background .el-pager li:not(.disabled).active { /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #ffffff;
border-radius: 2px;
border: 1px solid rgba(26, 149, 255, 0.45);
background: #1a95ff;
}
color: #ffffff; /deep/ .el-pagination .el-pager li {
border-radius: 2px; font-size: 14px;
border: 1px solid rgba(26, 149, 255, 0.45); font-family: PingFangSC-Regular, PingFang SC;
background: #1a95ff; font-weight: 400;
} color: rgba(255, 255, 255, 0.65);
border-radius: 2px;
border: 1px solid rgba(26, 149, 255, 0.45);
background: #00023a;
}
/deep/ .el-pagination .el-pager li { /deep/ .el-pagination .btn-prev {
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: rgba(255, 255, 255, 0.65); color: rgba(255, 255, 255, 0.65);
border-radius: 2px; border-radius: 2px;
border: 1px solid rgba(26, 149, 255, 0.45); border: 1px solid rgba(26, 149, 255, 0.45);
background: #00023a; background: #00023a;
} }
/deep/ .el-pagination .btn-prev { /deep/ .el-pagination .btn-next {
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: rgba(255, 255, 255, 0.65); color: rgba(255, 255, 255, 0.65);
border-radius: 2px; border-radius: 2px;
border: 1px solid rgba(26, 149, 255, 0.45); border: 1px solid rgba(26, 149, 255, 0.45);
background: #00023a; background: #00023a;
} }
/deep/ .el-pagination .btn-next { /deep/ .el-pagination__editor.el-input .el-input__inner {
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: rgba(255, 255, 255, 0.65); color: rgba(255, 255, 255, 0.65);
border-radius: 2px; border-radius: 2px;
border: 1px solid rgba(26, 149, 255, 0.45); border: 1px solid rgba(26, 149, 255, 0.45);
background: #00023a; background: #00023a;
} }
/deep/ .el-pagination__editor.el-input .el-input__inner {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(255, 255, 255, 0.65);
border-radius: 2px;
border: 1px solid rgba(26, 149, 255, 0.45);
background: #00023a;
}
/deep/ .el-pagination .el-select .el-input .el-input__inner { /deep/ .el-pagination .el-select .el-input .el-input__inner {
margin-left: 14px; margin-left: 14px;
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: rgba(255, 255, 255, 0.65); color: rgba(255, 255, 255, 0.65);
border-radius: 2px; border-radius: 2px;
border: 1px solid rgba(26, 149, 255, 0.45); border: 1px solid rgba(26, 149, 255, 0.45);
background: #00023a; background: #00023a;
}
} }
}
</style> </style>
Loading…
Cancel
Save