Commit e4bdcf29 by luyt

add: 1低版本浏览器的hover竖线的兼容

2tip提示框调整
1 parent d62c16f5
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -1682,7 +1682,6 @@ ...@@ -1682,7 +1682,6 @@
"thread-loader": "^2.1.3", "thread-loader": "^2.1.3",
"url-loader": "^2.2.0", "url-loader": "^2.2.0",
"vue-loader": "^15.9.2", "vue-loader": "^15.9.2",
"vue-loader-v16": "npm:vue-loader@^16.1.0",
"vue-style-loader": "^4.1.2", "vue-style-loader": "^4.1.2",
"webpack": "^4.0.0", "webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.8.0", "webpack-bundle-analyzer": "^3.8.0",
...@@ -1701,8 +1700,6 @@ ...@@ -1701,8 +1700,6 @@
"version": "4.3.0", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": { "requires": {
"color-convert": "^2.0.1" "color-convert": "^2.0.1"
} }
...@@ -1711,8 +1708,6 @@ ...@@ -1711,8 +1708,6 @@
"version": "4.1.2", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": { "requires": {
"ansi-styles": "^4.1.0", "ansi-styles": "^4.1.0",
"supports-color": "^7.1.0" "supports-color": "^7.1.0"
...@@ -1722,8 +1717,6 @@ ...@@ -1722,8 +1717,6 @@
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": { "requires": {
"color-name": "~1.1.4" "color-name": "~1.1.4"
} }
...@@ -1731,23 +1724,17 @@ ...@@ -1731,23 +1724,17 @@
"color-name": { "color-name": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
"dev": true,
"optional": true
}, },
"has-flag": { "has-flag": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
"dev": true,
"optional": true
}, },
"loader-utils": { "loader-utils": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
"dev": true,
"optional": true,
"requires": { "requires": {
"big.js": "^5.2.2", "big.js": "^5.2.2",
"emojis-list": "^3.0.0", "emojis-list": "^3.0.0",
...@@ -1767,8 +1754,6 @@ ...@@ -1767,8 +1754,6 @@
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": { "requires": {
"has-flag": "^4.0.0" "has-flag": "^4.0.0"
} }
...@@ -1777,8 +1762,6 @@ ...@@ -1777,8 +1762,6 @@
"version": "16.8.3", "version": "16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": { "requires": {
"chalk": "^4.1.0", "chalk": "^4.1.0",
"hash-sum": "^2.0.0", "hash-sum": "^2.0.0",
...@@ -2694,8 +2677,7 @@ ...@@ -2694,8 +2677,7 @@
"big.js": { "big.js": {
"version": "5.2.2", "version": "5.2.2",
"resolved": "https://registry.nlark.com/big.js/download/big.js-5.2.2.tgz", "resolved": "https://registry.nlark.com/big.js/download/big.js-5.2.2.tgz",
"integrity": "sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg=", "integrity": "sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg="
"dev": true
}, },
"binary-extensions": { "binary-extensions": {
"version": "2.2.0", "version": "2.2.0",
...@@ -4919,8 +4901,7 @@ ...@@ -4919,8 +4901,7 @@
"emojis-list": { "emojis-list": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/emojis-list/download/emojis-list-3.0.0.tgz", "resolved": "https://registry.npm.taobao.org/emojis-list/download/emojis-list-3.0.0.tgz",
"integrity": "sha1-VXBmIEatKeLpFucariYKvf9Pang=", "integrity": "sha1-VXBmIEatKeLpFucariYKvf9Pang="
"dev": true
}, },
"encodeurl": { "encodeurl": {
"version": "1.0.2", "version": "1.0.2",
...@@ -6827,8 +6808,7 @@ ...@@ -6827,8 +6808,7 @@
"hash-sum": { "hash-sum": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/hash-sum/download/hash-sum-2.0.0.tgz", "resolved": "https://registry.npm.taobao.org/hash-sum/download/hash-sum-2.0.0.tgz",
"integrity": "sha1-gdAbtd6OpKIUrV1urRtSNGCwtFo=", "integrity": "sha1-gdAbtd6OpKIUrV1urRtSNGCwtFo="
"dev": true
}, },
"hash.js": { "hash.js": {
"version": "1.1.7", "version": "1.1.7",
...@@ -7885,7 +7865,6 @@ ...@@ -7885,7 +7865,6 @@
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.nlark.com/json5/download/json5-2.2.0.tgz", "resolved": "https://registry.nlark.com/json5/download/json5-2.2.0.tgz",
"integrity": "sha1-Lf7+cgxrpSXZ69kJlQ8FFTFsiaM=", "integrity": "sha1-Lf7+cgxrpSXZ69kJlQ8FFTFsiaM=",
"dev": true,
"requires": { "requires": {
"minimist": "^1.2.5" "minimist": "^1.2.5"
} }
...@@ -8586,8 +8565,7 @@ ...@@ -8586,8 +8565,7 @@
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.5",
"resolved": "https://registry.nlark.com/minimist/download/minimist-1.2.5.tgz", "resolved": "https://registry.nlark.com/minimist/download/minimist-1.2.5.tgz",
"integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=", "integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI="
"dev": true
}, },
"minipass": { "minipass": {
"version": "3.1.5", "version": "3.1.5",
......
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
visible: false, visible: false,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: '最近开播', label: '最近开播',
...@@ -79,7 +79,19 @@ export default { ...@@ -79,7 +79,19 @@ export default {
{ {
label: '直播间名称', label: '直播间名称',
prop: 'name', prop: 'name',
line: 1 line: 1,
// children:[
// {
// label: '直播间名称1',
// prop: 'name1',
// line: 1,
// },
// {
// label: '直播间名称2',
// prop: 'name2',
// line: 1,
// },
// ]
}, },
{ {
label: '房间号', label: '房间号',
...@@ -114,11 +126,11 @@ export default { ...@@ -114,11 +126,11 @@ export default {
label: '直播状态3', label: '直播状态3',
prop: 'liveStatus3', prop: 'liveStatus3',
line: 1, line: 1,
addHtml: 'shareImgUrl' addHtml: 'shareImgUrl',
}, },
{ {
label: '直播状态4', label: '直播状态4',
prop: 'liveStatus3', prop: 'liveStatus4',
line: 1, line: 1,
addHtml: 'shareImgUrl' addHtml: 'shareImgUrl'
}, },
...@@ -145,24 +157,50 @@ export default { ...@@ -145,24 +157,50 @@ export default {
tableData: [ tableData: [
{ {
name: '王小虎王小虎王小虎王', name: '王小虎王小虎王小虎王',
liveStatus3:'132',
liveStatus4:'789',
name1:'123',
name2:'123',
}, },
{ {
name: '王小虎王小虎王小虎王王小虎王小虎王小虎王', name: '王小虎王小虎王小虎王王小虎王小虎王小虎王',
liveStatus3:'132',
liveStatus4:'789',
name1:'123',
name2:'123',
}, },
{ {
name: '王小虎', name: '王小虎',
name1:'123',
name2:'123',
}, },
{ {
name: '王小虎王小虎王小虎王', name: '王小虎王小虎王小虎王',
liveStatus3:'132',
liveStatus4:'789',
name1:'123',
name2:'123',
}, },
{ {
name: '王小虎王小虎王小虎王王小虎王小虎王小虎王', name: '王小虎王小虎王小虎王王小虎王小虎王小虎王',
liveStatus3:'132',
liveStatus4:'789',
name1:'123',
name2:'123',
}, },
{ {
name: '王小虎', name: '王小虎',
liveStatus3:'132',
liveStatus4:'789',
name1:'123',
name2:'123',
}, },
{ {
name: '王小虎王小虎王小虎王', name: '王小虎王小虎王小虎王',
liveStatus3:'132',
liveStatus4:'789',
name1:'123',
name2:'123',
} }
] ]
} }
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
import App from './App.vue' import App from './App.vue'
// element ui组件 // element ui组件
import '@/plugins/element.js' import '@/plugins/element.js'
// import '@/theme/theme.scss' import '@/theme/theme.scss'
import '../dist/glsx-components.css' // import '../dist/glsx-components.css'
//开发完成后,本地测试使用我们第二次封装的组件 //开发完成后,本地测试使用我们第二次封装的组件
import './index' import './index'
......
<template> <template>
<div class="gl-sub-table">
<el-table v-bind="$attrs" v-on="$listeners"> <el-table v-bind="$attrs" v-on="$listeners">
<!-- 插槽 --> <!-- 插槽 -->
<slot></slot> <slot></slot>
</el-table> </el-table>
</div>
</template> </template>
<script> <script>
export default { export default {
name: "GlSubTable", name: 'GlSubTable',
data () { data() {
return { return {}
}; }
},
// created () { // created () {
// console.log(this.$attrs) // console.log(this.$attrs)
// console.log(this.$listeners) // console.log(this.$listeners)
......
<template> <template>
<div class="gl-sub-table-column">
<el-table-column v-bind="$attrs" v-on="$listeners"> <el-table-column v-bind="$attrs" v-on="$listeners">
<!-- 插槽 --> <!-- 插槽 -->
<slot></slot> <!-- <slot name="default" v-bind="scope"></slot> -->
<!-- <slot name="default" v-bind:scope="scope"></slot> -->
<template slot="header" slot-scope="scope">
<slot name="header" v-bind="scope">{{ scope.column.label }}</slot>
</template>
<template slot-scope="scope">
<slot v-bind="scope">{{ scope.row[$attrs.prop] }}</slot>
</template>
</el-table-column> </el-table-column>
</div>
</template> </template>
<script> <script>
export default { export default {
name: "GlsubTableColumn", name: 'GlsubTableColumn',
data () { data() {
return { return {}
};
}, },
// created () { // created () {
// console.log('attrs',this.$attrs) // console.log('attrs',this.$attrs)
...@@ -20,5 +25,4 @@ export default { ...@@ -20,5 +25,4 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
// .gl-sub-table-column {}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="glsx-table"> <div class="glsx-table">
<el-table id="initTable" v-bind="$attrs" v-on="$listeners" :key="componentKey" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-class-name="tableParams.rowClassName" :row-style="tableParams.rowStyle" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle" :show-summary="tableParams.showSummary" :summary-method="tableParams.summaryMethod"> <el-table id="initTable" v-bind="$attrs" v-on="$listeners" :key="componentKey" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-class-name="tableParams.rowClassName" :row-style="tableParams.rowStyle" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle" :show-summary="tableParams.showSummary" :summary-method="tableParams.summaryMethod">
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column> <el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true" ></el-table-column>
<el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column> <el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column>
<el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable" :render-header="item.renderHeader"> <el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'center'" :sortable="item.sortable" :render-header="item.renderHeader">
<template slot-scope="scope"> <template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
<span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="item.formatter(scope.row)"></span> <el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= 10 * item.line" placement="top" popper-class="base-popper" trigger="hover" :content="item.formatter(scope.row)">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="item.formatter(scope.row)"></span>
</el-popover>
<!-- <span>{{scope.row}}-{{item.prop}}</span> -->
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="item.formatter(scope.row)"></span>
</template> </template>
<template v-else-if="getListApi"> <template v-else-if="getListApi">
<span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="scope.row[item.prop]"></span> <el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= 10 * item.line" placement="top" popper-class="base-popper" trigger="hover" :content="scope.row[item.prop]">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="scope.row[item.prop]"></span>
</el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="scope.row[item.prop]"></span>
</template> </template>
<!-- <template v-else-if="item.labelchildren">
<el-table-column v-for="(labelitem, labelindex) in tableColumns.labelchildren" :key="'labelindex'+labelindex">
<span>123456</span>
</el-table-column> -->
<!-- <span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span> -->
<!-- </template> -->
<template v-else> <template v-else>
<!-- 大于10或 20个字节长度 --> <!-- 大于10或 20个字节长度 -->
<el-popover v-if="tableData[scope.$index][item.prop] && tableData[scope.$index][item.prop].length >= 10 * item.line" placement="top" width="200" trigger="hover" :content="tableData[scope.$index][item.prop]"> <el-popover v-if="tableData[scope.$index][item.prop] && tableData[scope.$index][item.prop].length >= 10 * item.line" placement="top" popper-class="base-popper" trigger="hover" :content="tableData[scope.$index][item.prop]">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span> <span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span>
</el-popover> </el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span> <span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span>
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
</template> </template>
<!-- 递归 --> <!-- 递归 -->
<sub-el-table-column v-if="item.children" :data="item.children"></sub-el-table-column> <sub-el-table-column v-if="item.children" :data="item.children" :tableData="tableData" :getListApi="getListApi"></sub-el-table-column>
</el-table-column> </el-table-column>
<el-table-column v-if="tableParams.tableOption" label="操作" :align="tableParams.tableOption.align || 'center'" :width="tableParams.tableOption.width || '200'" fixed="right"> <el-table-column v-if="tableParams.tableOption" label="操作" :align="tableParams.tableOption.align || 'center'" :width="tableParams.tableOption.width || '200'" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -308,6 +309,7 @@ export default { ...@@ -308,6 +309,7 @@ export default {
this.$refs[this.tableParams.mutiSelectName + 'MutiTable'].doLayout() this.$refs[this.tableParams.mutiSelectName + 'MutiTable'].doLayout()
}) })
// 表格请求到数据 // 表格请求到数据
console.log('表格请求到数据this.data',this.data)
this.$emit('setTableFinishFun', this.data) this.$emit('setTableFinishFun', this.data)
}) })
.catch(() => { .catch(() => {
...@@ -338,6 +340,11 @@ export default { ...@@ -338,6 +340,11 @@ export default {
}, },
mounted() { mounted() {
setTimeout(()=>{
console.log('tableColumns',this.tableColumns)
this.$refs[this.tableParams.mutiSelectName + 'MutiTable'].doLayout()
})
this.isCustomHead ? this.findShowHeadCol() : (this.tableColumns = this.tableParams.tableColumns) this.isCustomHead ? this.findShowHeadCol() : (this.tableColumns = this.tableParams.tableColumns)
this.page = {} this.page = {}
this.page[this.pageConf.pageSize] = 10 this.page[this.pageConf.pageSize] = 10
...@@ -362,7 +369,7 @@ export default { ...@@ -362,7 +369,7 @@ export default {
} }
</script> </script>
<style> <style lang="scss">
.a-click { .a-click {
cursor: pointer; cursor: pointer;
} }
...@@ -451,21 +458,43 @@ export default { ...@@ -451,21 +458,43 @@ export default {
/* .el-table */ /* .el-table */
.el-table .el-table__body tr.hover-row { .el-table .el-table__body tr.hover-row {
position: relative; position: relative;
/* z-index: 100; */
box-shadow: 0px 3px 10px 0px rgba(60, 58, 96, 0.3), 0px 1px 0px 0px rgba(255, 255, 255, 0.85); box-shadow: 0px 3px 10px 0px rgba(60, 58, 96, 0.3), 0px 1px 0px 0px rgba(255, 255, 255, 0.85);
} }
.el-table__body tr.hover-row>td{
background-color: #f4f4fc !important;
}
.el-table .el-table__body tr.hover-row > td.el-table__cell { .el-table .el-table__body tr.hover-row > td.el-table__cell {
background-color: #f4f4fc; background-color: #f4f4fc !important;
}
.el-table tbody tr {
position: relative;
} }
.el-table .el-table__body tr.hover-row::after { .el-table tbody tr:hover {
box-shadow: 0px 3px 10px 0px rgba(60, 58, 96, 0.3), 0px 1px 0px 0px rgba(255, 255, 255, 0.85);
}
.el-table tbody .el-table__row:hover {
.el-table__cell:first-child {
// .el-table__cell:first-child .cell
// background-color:red!important;
position: relative;
&:after {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
display: inline-block; display: block;
content: ''; content: "";
width: 5px; width: 5px;
height: 100%; height: 100%;
background-color: #5850ff; background-color: #5850ff;
}
}
} }
/* 样式新增光亮tr */ /* 样式新增光亮tr */
// 气泡(基础用法)
.base-popper {
padding: 10px !important;
max-width: 380px !important;
}
</style> </style>
...@@ -4,11 +4,19 @@ ...@@ -4,11 +4,19 @@
<template slot-scope="scope"> <template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
<span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="item.formatter(scope.row)"></span> <el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= 10 * item.line" placement="top" popper-class="base-popper" trigger="hover" :content="item.formatter(scope.row)">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="item.formatter(scope.row)"></span>
</el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="item.formatter(scope.row)"></span>
</template> </template>
<template v-else-if="getListApi"> <template v-else-if="getListApi">
<span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="scope.row[item.prop]"></span> <el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= 10 * item.line" placement="top" popper-class="base-popper" trigger="hover" :content="scope.row[item.prop]">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="scope.row[item.prop]"></span>
</el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="scope.row[item.prop]"></span>
</template> </template>
<!-- <template v-else-if="item.labelchildren"> <!-- <template v-else-if="item.labelchildren">
<el-table-column v-for="(labelitem, labelindex) in tableColumns.labelchildren" :key="'labelindex'+labelindex"> <el-table-column v-for="(labelitem, labelindex) in tableColumns.labelchildren" :key="'labelindex'+labelindex">
<span>123456</span> <span>123456</span>
...@@ -29,7 +37,7 @@ ...@@ -29,7 +37,7 @@
</template> </template>
<!-- 递归 --> <!-- 递归 -->
<sub-el-table-column v-if="item.children" :data="item.children"></sub-el-table-column> <sub-el-table-column v-if="item.children" :data="item.children" :tableData="tableData" :getListApi="getListApi"></sub-el-table-column>
</el-table-column> </el-table-column>
</div> </div>
</template> </template>
...@@ -42,6 +50,16 @@ export default { ...@@ -42,6 +50,16 @@ export default {
data: { data: {
type: Array, type: Array,
default: () => [] default: () => []
},
// 表格数据-外部传入
tableData: {
type: Array,
default: () => []
},
// 获取列表接口
getListApi: {
type: Function,
default: null
} }
}, },
computed: { computed: {
......
...@@ -342,11 +342,11 @@ $dackColor: #4f48e6; ...@@ -342,11 +342,11 @@ $dackColor: #4f48e6;
} }
.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell { .el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell {
background-color: #f4f3ff; background-color: #f4f4fc;
} }
.el-table__body tr.current-row > td.el-table__cell { .el-table__body tr.current-row > td.el-table__cell {
background-color: #f4f3ff; background-color: #f4f4fc;
} }
.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell { .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
...@@ -357,7 +357,7 @@ $dackColor: #4f48e6; ...@@ -357,7 +357,7 @@ $dackColor: #4f48e6;
.el-table__body tr.hover-row.el-table__row--striped.current-row > td.el-table__cell, .el-table__body tr.hover-row.el-table__row--striped.current-row > td.el-table__cell,
.el-table__body tr.hover-row.el-table__row--striped > td.el-table__cell, .el-table__body tr.hover-row.el-table__row--striped > td.el-table__cell,
.el-table__body tr.hover-row > td.el-table__cell { .el-table__body tr.hover-row > td.el-table__cell {
background-color: #f4f3ff; background-color: #f4f4fc;
} }
/* 分页 */ /* 分页 */
...@@ -469,8 +469,8 @@ $dackColor: #4f48e6; ...@@ -469,8 +469,8 @@ $dackColor: #4f48e6;
display: block; display: block;
} }
.el-table--enable-row-hover .el-table__body tr:hover { .el-table--enable-row-hover .el-table__body tr:hover {
background: #f4f3ff !important; background: #f4f4fc !important;
} }
.el-table tbody tr:hover > td { .el-table tbody tr:hover > td {
background: #f4f3ff !important; background: #f4f4fc !important;
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!