Commit 55fa78e7 by yangming

cdn

1 parent 81e21776
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"core-js": "^3.4.4", "core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.2.4", "glsx-components": "^1.2.8",
"glsx-table": "^1.0.9", "glsx-table": "^1.0.9",
"vue-draggable-resizable": "^2.3.0" "vue-draggable-resizable": "^2.3.0"
}, },
......
<template> <template>
<div class="basic-panel"> <div class="basic-panel">
<el-tooltip class="item" effect="dark" :content="content" placement="top" v-show="tooltipStatus"> <el-tooltip class="item" effect="dark" :content="content" placement="top" v-if="tooltipStatus">
<div class="basic-title-s">{{ content }}</div> <div class="basic-title">{{ content | ellipsis(this) }}</div>
</el-tooltip> </el-tooltip>
<div class="basic-title" v-show="!tooltipStatus">{{ content }}</div> <div class="basic-title" v-else>{{ content | ellipsis(this) }}</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -14,9 +14,9 @@ export default { ...@@ -14,9 +14,9 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
titleWid: { textLength: {
type: Number, type: Number,
default: 100 default: 8
} }
}, },
data() { data() {
...@@ -24,28 +24,26 @@ export default { ...@@ -24,28 +24,26 @@ export default {
tooltipStatus: false tooltipStatus: false
} }
}, },
watch: { filters: {
content: { ellipsis(value,that) {
handler(value) { console.log(value,that)
const title = document.querySelector('.basic-title') if (value.length > that.textLength) {
console.log(title, value) that.tooltipStatus = true
if (title.innerText == value) { return value.slice(0, that.textLength) + '...'
this.tooltipStatus = false }
} else { return value
this.tooltipStatus = true
}
},
deep: true
} }
}, },
mounted() { mounted() {
const title = document.querySelector('.basic-title-s') // this.$nextTick(() => {
console.log(title.innerText, this.content) // const title = document.querySelector('.basic-title-s')
if (title.innerText == this.content) { // console.log(title.innerText, this.content)
this.tooltipStatus = false // if (title.innerText == this.content) {
} else { // this.tooltipStatus = false
this.tooltipStatus = true // } else {
} // this.tooltipStatus = true
// }
// })
} }
} }
</script> </script>
...@@ -54,11 +52,4 @@ export default { ...@@ -54,11 +52,4 @@ export default {
.basic-panel { .basic-panel {
display: inline-block; display: inline-block;
} }
.basic-title,.basic-title-s {
width: 100%;
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
</style> </style>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
import Vue from 'vue' import Vue from 'vue'
import apis from './api' import apis from './api'
import './public-path' import './public-path'
import './components'
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup' import { start } from '@/setup'
Vue.config.productionTip = false Vue.config.productionTip = false
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
<GLTable ref="table" @refreshTable="handleSearch" :searchForm="tableSearchForm" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams"> <GLTable v-loading="loading" ref="table" @refreshTable="handleSearch" :searchForm="tableSearchForm" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams">
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLButton type="text" @click="handleDetail(scope.scope)" fn="到店咨询客户数据">数据</GLButton> <GLButton type="text" @click="handleDetail(scope.scope)" fn="到店咨询客户数据">数据</GLButton>
<GLButton type="text" @click="handleEdit(scope.scope)" fn="活码编辑">修改</GLButton> <GLButton type="text" @click="handleEdit(scope.scope)" fn="活码编辑">修改</GLButton>
...@@ -37,13 +37,14 @@ ...@@ -37,13 +37,14 @@
<el-popover trigger="hover" placement="top" v-if="scope.scope.staffName.split(',').length > 3"> <el-popover trigger="hover" placement="top" v-if="scope.scope.staffName.split(',').length > 3">
<div class="accountType-row" v-for="(item, index) in scope.scope.staffName.split(',')" :key="index"> <div class="accountType-row" v-for="(item, index) in scope.scope.staffName.split(',')" :key="index">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ item }} <GLTitle :content="item" textLength="4"></GLTitle>
</div> </div>
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-show="index < 4"> <div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-show="index < 4">
<div class="accountType-row"> <div class="accountType-row">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ index == 3 && scope.scope.staffName.split(',').length > 3 ? '...(' + scope.scope.staffName.split(',').length + ')' : item }} <span v-if="index == 3 && scope.scope.staffName.split(',').length > 3">{{'...(' + scope.scope.staffName.split(',').length + ')'}}</span>
<GLTitle :content="item" textLength="4" v-else></GLTitle>
</div> </div>
</div> </div>
</div> </div>
...@@ -51,7 +52,7 @@ ...@@ -51,7 +52,7 @@
<div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-else> <div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-else>
<div class="accountType-row"> <div class="accountType-row">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ item }} <GLTitle :content="item" textLength="4"></GLTitle>
</div> </div>
</div> </div>
</div> </div>
...@@ -64,18 +65,21 @@ ...@@ -64,18 +65,21 @@
</div> </div>
<div slot="tagging" slot-scope="scope" class="tag-panel"> <div slot="tagging" slot-scope="scope" class="tag-panel">
<el-popover trigger="hover" placement="top" v-if="scope.scope.taggingList && scope.scope.taggingList.length > 3"> <el-popover trigger="hover" placement="top" v-if="scope.scope.taggingList && scope.scope.taggingList.length > 3">
<div :title="item.name" class="accountType-row accountType-row-tag" v-for="(item, index) in scope.scope.taggingList" :key="index"> <!-- <div :title="item.name" class="accountType-row accountType-row-tag" v-for="(item, index) in scope.scope.taggingList" :key="index">
{{ item.name.length > 8 ? item.name.substring(0, 8) + '...' : item.name }} {{ item.name.length > 8 ? item.name.substring(0, 8) + '...' : item.name }}
</div> </div> -->
<GLTitle :content="item.name" class="accountType-row accountType-row-tag" v-for="(item, index) in scope.scope.taggingList" :key="index"></GLTitle>
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<div v-for="(item, index) in scope.scope.taggingList" :key="index" v-show="index < 4"> <div v-for="(item, index) in scope.scope.taggingList" :key="index" v-show="index < 4">
<div :title="item.name" class="accountType-row accountType-row-tag">{{ index == 3 && scope.scope.taggingList.length > 3 ? '...(' + scope.scope.taggingList.length + ')' : item.name.length > 8 ? item.name.substring(0, 8) + '...' : item.name }}</div> <div :title="item.name" class="accountType-row accountType-row-tag" v-if="index == 3 && scope.scope.taggingList.length > 3">{{'...(' + scope.scope.taggingList.length + ')'}}</div>
<GLTitle :content="item.name" class="accountType-row accountType-row-tag" v-else></GLTitle>
</div> </div>
</div> </div>
</el-popover> </el-popover>
<template v-if="scope.scope.taggingList && scope.scope.taggingList.length <= 3 && scope.scope.taggingList.length > 0"> <template v-if="scope.scope.taggingList && scope.scope.taggingList.length <= 3 && scope.scope.taggingList.length > 0">
<div v-for="(item, index) in scope.scope.taggingList" :key="index"> <div v-for="(item, index) in scope.scope.taggingList" :key="index">
<div :title="item.name" class="accountType-row accountType-row-tag">{{ item.name.length > 8 ? item.name.substring(0, 8) + '...' : item.name }}</div> <GLTitle :content="item.name" class="accountType-row accountType-row-tag"></GLTitle>
<!-- <div :title="item.name" class="accountType-row accountType-row-tag">{{ item.name.length > 8 ? item.name.substring(0, 8) + '...' : item.name }}</div> -->
</div> </div>
</template> </template>
<div v-if="!scope.scope.taggingList || (scope.scope.taggingList && scope.scope.taggingList.length == 0)">--</div> <div v-if="!scope.scope.taggingList || (scope.scope.taggingList && scope.scope.taggingList.length == 0)">--</div>
...@@ -98,6 +102,7 @@ export default { ...@@ -98,6 +102,7 @@ export default {
name: 'channelList', name: 'channelList',
data() { data() {
return { return {
loading: false,
tableSearchForm: {}, tableSearchForm: {},
tableData: [], tableData: [],
tableParams: { tableParams: {
...@@ -234,7 +239,9 @@ export default { ...@@ -234,7 +239,9 @@ export default {
pageSize: this.$refs.table.page.pageSize, pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum pageNum: this.$refs.table.page.pageNum
} }
this.loading = true;
this.$apis.channel.listChannelCodeByPage(params).then(res => { this.$apis.channel.listChannelCodeByPage(params).then(res => {
this.loading = false;
if (res) { if (res) {
this.tableData = res.data this.tableData = res.data
this.tableData.forEach(item => { this.tableData.forEach(item => {
...@@ -389,6 +396,7 @@ export default { ...@@ -389,6 +396,7 @@ export default {
} }
i { i {
color: #75acff; color: #75acff;
margin-right: 3px;
} }
// &::before { // &::before {
// content: ''; // content: '';
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!