Commit 1b39abc7 by xiaohai

增加了表头可配置项

parent c96a2868
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "@gic-test/vue-gic-member-group",
"description": "vue-gic-member-group Plugin",
"version": "1.0.24",
"version": "1.0.26",
"license": "MIT",
"private": false,
"author": "fairyly",
......
......@@ -13,6 +13,7 @@
</el-input>
</div>
<el-table
v-loading="loading"
v-loadmore="loadmore"
ref="originTable"
:data="tableData"
......@@ -25,11 +26,11 @@
</el-table-column>
<el-table-column
label="分组名称"
min-width="170"
show-overflow-tooltip>
<template slot-scope="scope">
<el-popover
placement="top-start"
width="200"
trigger="hover">
<span>{{ scope.row.describle }}</span>
<a slot="reference" class="pointer" :href="'#/memberGroupDetail?memberTagGroupId='+scope.row.memberTagGroupId">{{ scope.row.groupName }}</a>
......@@ -37,15 +38,17 @@
</template>
</el-table-column>
<el-table-column
v-if="headerList.indexOf('isRealTime') > -1"
label="是否实时"
width="120px">
min-width="80px">
<template slot-scope="scope">
{{scope.row.isRealTime == 1? '实时':'非实时'}}
</template>
</el-table-column>
<el-table-column
v-if="headerList.indexOf('latestUpdateTime') > -1"
label="最近更新时间"
width="200px"
min-width="120px"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.latestUpdateTime | formatTimeYMD }}
......@@ -53,11 +56,11 @@
</template>
</el-table-column>
<el-table-column
v-if="headerList.indexOf('updateType') > -1"
label="更新频率"
width="150px"
min-width="100px"
show-overflow-tooltip>
<template slot-scope="scope">
<!-- {{ scope.row.updateType == 1 ? '每天一次' : scope.row.updateType == 2 ? (scope.row.updateDay ? '每周'+ weekArr[scope.row.updateDay - 1] : '每周一次') : (scope.row.updateDay ? '每月' + scope.row.updateDay + '号' : '每月一次')}} -->
<template v-if="scope.row.isRealTime == 0">
{{scope.row.updateType, scope.row.updateDay | formatUpdateFrequency}}
</template>
......@@ -67,17 +70,19 @@
</template>
</el-table-column>
<el-table-column
v-if="headerList.indexOf('effectiveStatus') > -1"
prop="state"
label="状态"
width="100px">
min-width="60px">
<template slot-scope="scope">
{{scope.row.effectiveStatus == 1? '有效':'失效'}}
</template>
</el-table-column>
<el-table-column
v-if="headerList.indexOf('effectiveDate') > -1"
prop="recentUpdateDate"
label="到期时间"
width="200px"
min-width="100px"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.effectiveDate | formatTimeYMD }}
......@@ -85,9 +90,11 @@
</template>
</el-table-column>
<el-table-column
v-if="headerList.indexOf('handle') > -1"
min-width="60px"
label="操作">
<template slot-scope="scope">
<router-link :to="{path:'/memberGroupDetail',query:{memberTagGroupId:scope.row.memberTagGroupId}}" class="edit-btn el-button--text p-r-20">详情</router-link>
<router-link :to="{path:'/memberGroupDetail',query:{memberTagGroupId:scope.row.memberTagGroupId}}" class="edit-btn el-button--text">详情</router-link>
</template>
</el-table-column>
</el-table>
......@@ -160,6 +167,12 @@
projectName: {
type: String,
default: 'memberTag'
},
headerList: {
type: Array,
default() {
return ['isRealTime', 'latestUpdateTime', 'updateType', 'effectiveStatus', 'effectiveDate', 'handle'];
}
}
},
data() {
......@@ -174,7 +187,8 @@
selectionToTransfer: [], // 穿梭窗选入数据
selectionToRemove: [], // 已选的将要删除的选入数据
countOfCoverTotal: 0,
totalPage: 1
totalPage: 1,
loading: false
};
},
directives: {
......@@ -224,19 +238,23 @@
*/
getGroupList() {
const that = this;
that.loading = true;
that.axios.get(`${that.baseUrl}/gic-member-tag-web/member-tag-group/findList.json?requestProject=${that.projectName}&pageSize=${that.pageSize}&pageNum=${that.currentPage}&groupName=${that.dataSearch}&effectiveStatus=${1}`)
.then(res => {
if (res.data.errorCode == 1) {
that.tableData = that.tableData.concat(res.data.result.result);
that.totalPage = res.data.result.totalPage;
that.loading = false;
return;
}
that.loading = false;
that.$message.error({
duration: 1000,
message: res.data.message
});
})
.catch(error => {
that.loading = false;
that.$message.error({
duration: 1000,
message: error.message
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment