更新:修改开发服务器的主机地址,优化用户模块的表格功能,增加排序和搜索功能,更新静态配置的API地址

This commit is contained in:
2026-05-09 14:48:27 +08:00
parent bc641cddad
commit fd5655824d
3 changed files with 53 additions and 10 deletions

View File

@@ -33,10 +33,7 @@
<el-form-item>
<el-button
size="small"
@click="
pageIndex = 1;
getDataList();
"
@click="handleSearch()"
>查询</el-button
>
<el-button
@@ -57,10 +54,12 @@
</el-form-item>
</el-form>
<el-table
ref="dataTable"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;"
@sort-change="handleSortChange"
>
<!-- <el-table-column type="selection" header-align="center" align="center" width="50">
</el-table-column> -->
@@ -138,6 +137,18 @@
</div>
</template>
</el-table-column>
<el-table-column
min-width="120"
prop="createTime"
header-align="center"
align="center"
sortable="custom"
label="注册时间"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
min-width="140"
prop="nickname"
@@ -153,6 +164,18 @@
<span v-else v-html="computedVipType(scope.row.userVips)"> </span>
</template>
</el-table-column>
<el-table-column
min-width="120"
prop="migrationTime"
header-align="center"
align="center"
sortable="custom"
label="迁移时间"
>
<template slot-scope="scope">
{{ scope.row.migrationTime }}
</template>
</el-table-column>
<el-table-column
min-width="170"
prop="tel"
@@ -613,7 +636,10 @@ export default {
data() {
return {
dataForm: {
key: ""
key: "",
vipType: "",
sortKey: "",
sortValue: ""
},
pointFormRules: {
pointAmount: [
@@ -676,6 +702,21 @@ export default {
this.getDataList();
},
methods: {
handleSortChange({ prop, order }) {
this.dataForm.sortKey = prop
this.dataForm.sortValue = order
console.log(this.dataForm.sortKey, this.dataForm.sortValue)
this.getDataList()
},
handleSearch() {
this.pageIndex = 1;
this.dataForm.sortKey = ""
this.dataForm.sortValue = ""
this.$nextTick(() => {
this.$refs.dataTable.clearSort()
})
this.getDataList();
},
//批量开通课程
addOpenCourse() {
this.$router.push("/user-add-course");
@@ -793,7 +834,9 @@ export default {
page: this.pageIndex,
limit: this.pageSize,
key: this.dataForm.key,
vipType: this.dataForm.vipType
vipType: this.dataForm.vipType,
sortKey: this.dataForm.sortKey,
sortValue: this.dataForm.sortValue
})
// params: this.$http.adornParams({
// 'page': 1,