Commit b2df02b0 by 张立顺

第一bug修复

1 parent 86f6b477
<template> <template>
<div class="glsx-table"> <div class="glsx-table">
<el-scrollbar :native="false" wrapStyle="" wrapClass="" viewClass="" viewStyle="" noresize="false" tag="section"> <el-scrollbar :native="false"
<el-table id="initTable" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" :highlight-current-row="true" :stripe="true" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle"> wrapStyle=""
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column> wrapClass=""
<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> viewClass=""
<el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :align="item.align || 'center'" :sortable="item.sortable"> viewStyle=""
noresize="false"
tag="section">
<el-table id="initTable"
:ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'"
:data="getListApi ? data : tableData"
:row-key="tableParams.mutiSelectUniqueKey || ''"
v-loading="loading"
:height="tableHeightValues"
:border="border"
:tableId="tableId"
:highlight-current-row="true"
:stripe="true"
@sort-change="sortChange"
@selection-change="handleSelect"
:size="size"
:header-cell-style="headerStyle">
<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-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:align="item.align || 'center'"
:sortable="item.sortable">
<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 : '' }" :title="item.formatter(scope.row)" v-text="item.formatter(scope.row)"></span> <span class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }"
:title="item.formatter(scope.row)"
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 : '' }" :title="scope.row[item.prop]" v-text="scope.row[item.prop]"></span> <span class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }"
:title="scope.row[item.prop]"
v-text="scope.row[item.prop]"></span>
</template> </template>
<template v-else> <template v-else>
<span class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" :title="tableData[scope.$index][item.prop]" v-text="tableData[scope.$index][item.prop]"></span> <span class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }"
:title="tableData[scope.$index][item.prop]"
v-text="tableData[scope.$index][item.prop]"></span>
</template> </template>
<template v-if="item.addSymbol"> <template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span> <span v-text="item.addSymbol"></span>
</template> </template>
</template> </template>
</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">
<slot name="auth-button" :scope="scope.row"></slot> <slot name="auth-button"
:scope="scope.row"></slot>
</template> </template>
</el-table-column> </el-table-column>
<template slot="empty" class="emptyBg"> <template slot="empty"
<img class="noDataImg" :src="noDataImg" v-if="noDataImg" alt="" /> class="emptyBg">
<img class="noDataImg"
:src="noDataImg"
v-if="noDataImg"
alt="" />
<div>{{ noDataText }}</div> <div>{{ noDataText }}</div>
<slot name="additionalContent"></slot> <slot name="additionalContent"></slot>
</template> </template>
</el-table> </el-table>
</el-scrollbar> </el-scrollbar>
<el-pagination v-if="hasPage" background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page[this.pageConf.pageNum]" :page-sizes="[10, 20, 30, 40]" :page-size="page[this.pageConf.pageSize]" :total="getListApi ? total : tableTotal" :layout="layout"></el-pagination> <el-pagination v-if="hasPage"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page[this.pageConf.pageNum]"
:page-sizes="[10, 20, 30, 40]"
:page-size="page[this.pageConf.pageSize]"
:total="getListApi ? total : tableTotal"
:layout="layout"></el-pagination>
</div> </div>
</template> </template>
...@@ -76,7 +142,7 @@ export default { ...@@ -76,7 +142,7 @@ export default {
}, },
headerStyle: { headerStyle: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
//表格需要多传入一个id的情况 //表格需要多传入一个id的情况
tableId: { tableId: {
...@@ -86,7 +152,7 @@ export default { ...@@ -86,7 +152,7 @@ export default {
// 搜索条件 // 搜索条件
searchForm: { searchForm: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
// 是否定制表头 // 是否定制表头
isCustomHead: { isCustomHead: {
......
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
<span slot="footer"> <span slot="footer">
<el-button :size="size" <el-button :size="size"
type="primary" type="primary"
@click="getList">查询</el-button> @click="resetTable">查询</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<!-- : :hasPage="false" <!-- : :hasPage="false"
:hasNum="false" :tableData="storeList" --> :getListApi="getListApi"
:tableData="storeList" -->
<GLTable ref="storeRef" <GLTable ref="storeRef"
:noDataImg="url" :noDataImg="url"
:tableTotal="total" :tableTotal="total"
...@@ -27,7 +29,8 @@ ...@@ -27,7 +29,8 @@
:tableParams="tableParams" :tableParams="tableParams"
:pageConf="pageConf" :pageConf="pageConf"
@refreshTable="getList" @refreshTable="getList"
:getListApi="getListApi" :tableData="storeList"
:hasNum="false"
:setTableFinishFun="setTableFinishFun"> :setTableFinishFun="setTableFinishFun">
<div slot="radioHtml" <div slot="radioHtml"
class="store-table" class="store-table"
...@@ -58,7 +61,7 @@ export default { ...@@ -58,7 +61,7 @@ export default {
}, },
getListApi: this.$apis.common.getMerchantList, getListApi: this.$apis.common.getMerchantList,
total: 0, total: 0,
// storeList: [], storeList: [],
heightBox: 200, heightBox: 200,
merchantId: '', merchantId: '',
merchantName: '', merchantName: '',
...@@ -81,10 +84,15 @@ export default { ...@@ -81,10 +84,15 @@ export default {
labelWidth: '10px' labelWidth: '10px'
} }
], ],
pageConfig: {
pageSize: 10,
currentPage: 1
},
// 表格 // 表格
// getListApi: this.$apis.common.getstaffTreeListApi, // getListApi: this.$apis.common.getstaffTreeListApi,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
// tableOption: true, // tableOption: true,
// 行数据的key // 行数据的key
// mutiSelectUniqueKey: 'staffId', // mutiSelectUniqueKey: 'staffId',
...@@ -99,11 +107,11 @@ export default { ...@@ -99,11 +107,11 @@ export default {
width: 80, width: 80,
addHtml: 'radioHtml' addHtml: 'radioHtml'
}, },
// { {
// label: '序号', label: '序号',
// prop: 'idx', prop: 'idx',
// width: 80 width: 80
// }, },
{ {
label: '商户名称', label: '商户名称',
prop: 'merchantName', prop: 'merchantName',
...@@ -151,32 +159,44 @@ export default { ...@@ -151,32 +159,44 @@ export default {
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425 this.heightBox = clientHeight - 0.15 * clientHeight - 425
this.merchantId = this.merchantInfo this.merchantId = this.merchantInfo
// this.getList() this.getList()
}, },
methods: { methods: {
getList() { getList(pageCon) {
// var params = { console.log(pageCon, 'pageCon')
// merchantId: this.merchantId, pageCon && (this.pageConfig = pageCon)
// ...this.searchForm var params = {
// // merchantId: '44209390', merchantId: this.merchantId,
// } ...this.searchForm,
this.$refs.storeRef.refreshTable() ...this.pageConfig
// merchantId: '44209390',
}
console.log(params)
this.$apis.common.getMerchantList(params).then(res => {
console.log(res)
this.storeList = res.list
this.total = res.total
// this.$apis.common.getSimpleMerchantList(params).then(res => {
// console.log(res)
// this.storeList = res
// // this.storeList = res.staffUnitList // // this.storeList = res.staffUnitList
// // this.total = res.total
// // var page = this.$refs.staffRef.page // // var page = this.$refs.staffRef.page
// // // 添加序号 // // // 添加序号
// this.storeList.forEach((item, index) => { // pageConfig
// item.idx = index + 1 let nowIndex = this.pageConfig.pageSize * (this.pageConfig.currentPage - 1)
// }) console.log(nowIndex)
this.storeList.forEach((item, index) => {
item.idx = index + 1 + nowIndex
})
console.log(this.storeList)
// this.$refs.staffRef.tableHeightValues = '460px' // this.$refs.staffRef.tableHeightValues = '460px'
// }) // })
})
},
resetTable() {
this.$refs.storeRef && this.$refs.storeRef.refreshTable()
this.getList()
}, },
setTableFinishFun() { setTableFinishFun() {
// console.log(this.$refs.staffRef.data) // console.log(this.$refs.staffRef.data)
// this.storeList = this.$refs.staffRef.data // this.storeList = this.$refs.staffRef.data
......
...@@ -146,14 +146,13 @@ ...@@ -146,14 +146,13 @@
@click="handleExport('liveData')">导出</el-button> @click="handleExport('liveData')">导出</el-button>
</div> </div>
<!-- :searchForm="tableSearchForm" --> <!-- :searchForm="tableSearchForm" -->
<GLTable ref="dataTableRef" <GLTable ref="dataTableRefDetailPage"
:getListApi="getLiveDetailPage" :getListApi="getLiveDetailPage"
:noDataImg="url" :noDataImg="url"
:tableParams="liveTableParams" :tableParams="liveTableParams"
:searchForm="LiveTableSearchForm" :searchForm="LiveTableSearchForm"
:pageConf="pageConf" :pageConf="pageConf"
:beforeSearchFn="beforeSearchFn" :beforeSearchFn="beforeSearchFn">
@setTableFinishFun="setTableFinishFun">
<div slot="weChatName" <div slot="weChatName"
class="flex-align" class="flex-align"
slot-scope="scope"> slot-scope="scope">
...@@ -222,7 +221,8 @@ export default { ...@@ -222,7 +221,8 @@ export default {
} }
], ],
searchRankForm: { searchRankForm: {
statDimension: '1' statDimension: '1',
shareName: ''
}, },
searchFormRankData: [ searchFormRankData: [
{ {
...@@ -234,6 +234,12 @@ export default { ...@@ -234,6 +234,12 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionsName: 'statusList' optionsName: 'statusList'
},
{
label: '员工名称',
name: 'shareName',
type: 'input',
maxlength: 100
} }
], ],
getListApi: this.$apis.seckillActivity.getRankListApi, getListApi: this.$apis.seckillActivity.getRankListApi,
...@@ -405,6 +411,7 @@ export default { ...@@ -405,6 +411,7 @@ export default {
getParams() { getParams() {
let { activityId } = this.$route.query, let { activityId } = this.$route.query,
params = JSON.parse(JSON.stringify(this.searchRankForm)) params = JSON.parse(JSON.stringify(this.searchRankForm))
console.log(params)
params.activityId = activityId params.activityId = activityId
return params return params
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!