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", "name": "@gic-test/vue-gic-member-group",
"description": "vue-gic-member-group Plugin", "description": "vue-gic-member-group Plugin",
"version": "1.0.24", "version": "1.0.26",
"license": "MIT", "license": "MIT",
"private": false, "private": false,
"author": "fairyly", "author": "fairyly",
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
</el-input> </el-input>
</div> </div>
<el-table <el-table
v-loading="loading"
v-loadmore="loadmore" v-loadmore="loadmore"
ref="originTable" ref="originTable"
:data="tableData" :data="tableData"
...@@ -25,11 +26,11 @@ ...@@ -25,11 +26,11 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="分组名称" label="分组名称"
min-width="170"
show-overflow-tooltip> show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
placement="top-start" placement="top-start"
width="200"
trigger="hover"> trigger="hover">
<span>{{ scope.row.describle }}</span> <span>{{ scope.row.describle }}</span>
<a slot="reference" class="pointer" :href="'#/memberGroupDetail?memberTagGroupId='+scope.row.memberTagGroupId">{{ scope.row.groupName }}</a> <a slot="reference" class="pointer" :href="'#/memberGroupDetail?memberTagGroupId='+scope.row.memberTagGroupId">{{ scope.row.groupName }}</a>
...@@ -37,15 +38,17 @@ ...@@ -37,15 +38,17 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="headerList.indexOf('isRealTime') > -1"
label="是否实时" label="是否实时"
width="120px"> min-width="80px">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.isRealTime == 1? '实时':'非实时'}} {{scope.row.isRealTime == 1? '实时':'非实时'}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="headerList.indexOf('latestUpdateTime') > -1"
label="最近更新时间" label="最近更新时间"
width="200px" min-width="120px"
show-overflow-tooltip> show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.latestUpdateTime | formatTimeYMD }} {{ scope.row.latestUpdateTime | formatTimeYMD }}
...@@ -53,11 +56,11 @@ ...@@ -53,11 +56,11 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="headerList.indexOf('updateType') > -1"
label="更新频率" label="更新频率"
width="150px" min-width="100px"
show-overflow-tooltip> show-overflow-tooltip>
<template slot-scope="scope"> <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"> <template v-if="scope.row.isRealTime == 0">
{{scope.row.updateType, scope.row.updateDay | formatUpdateFrequency}} {{scope.row.updateType, scope.row.updateDay | formatUpdateFrequency}}
</template> </template>
...@@ -67,17 +70,19 @@ ...@@ -67,17 +70,19 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="headerList.indexOf('effectiveStatus') > -1"
prop="state" prop="state"
label="状态" label="状态"
width="100px"> min-width="60px">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.effectiveStatus == 1? '有效':'失效'}} {{scope.row.effectiveStatus == 1? '有效':'失效'}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="headerList.indexOf('effectiveDate') > -1"
prop="recentUpdateDate" prop="recentUpdateDate"
label="到期时间" label="到期时间"
width="200px" min-width="100px"
show-overflow-tooltip> show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.effectiveDate | formatTimeYMD }} {{ scope.row.effectiveDate | formatTimeYMD }}
...@@ -85,9 +90,11 @@ ...@@ -85,9 +90,11 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="headerList.indexOf('handle') > -1"
min-width="60px"
label="操作"> label="操作">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -160,6 +167,12 @@ ...@@ -160,6 +167,12 @@
projectName: { projectName: {
type: String, type: String,
default: 'memberTag' default: 'memberTag'
},
headerList: {
type: Array,
default() {
return ['isRealTime', 'latestUpdateTime', 'updateType', 'effectiveStatus', 'effectiveDate', 'handle'];
}
} }
}, },
data() { data() {
...@@ -174,7 +187,8 @@ ...@@ -174,7 +187,8 @@
selectionToTransfer: [], // 穿梭窗选入数据 selectionToTransfer: [], // 穿梭窗选入数据
selectionToRemove: [], // 已选的将要删除的选入数据 selectionToRemove: [], // 已选的将要删除的选入数据
countOfCoverTotal: 0, countOfCoverTotal: 0,
totalPage: 1 totalPage: 1,
loading: false
}; };
}, },
directives: { directives: {
...@@ -224,19 +238,23 @@ ...@@ -224,19 +238,23 @@
*/ */
getGroupList() { getGroupList() {
const that = this; 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}`) 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 => { .then(res => {
if (res.data.errorCode == 1) { if (res.data.errorCode == 1) {
that.tableData = that.tableData.concat(res.data.result.result); that.tableData = that.tableData.concat(res.data.result.result);
that.totalPage = res.data.result.totalPage; that.totalPage = res.data.result.totalPage;
that.loading = false;
return; return;
} }
that.loading = false;
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
message: res.data.message message: res.data.message
}); });
}) })
.catch(error => { .catch(error => {
that.loading = false;
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
message: error.message 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