Browse Source

修改bug

milestone-20260404-后台整改需求
zhaowenkang 1 week ago
parent
commit
c38f4767ca
  1. 7
      src/views/UserPermissions/LogDeepMate.vue
  2. 10
      src/views/UserPermissions/MarketTerm.vue
  3. 119
      src/views/UserPermissions/UserList.vue

7
src/views/UserPermissions/LogDeepMate.vue

@ -26,7 +26,7 @@
<el-table-column prop="source" label="Token来源" align="center" header-align="center"/>
<el-table-column prop="type" label="类型" align="center" header-align="center"/>
<el-table-column prop="num" label="数量" align="center" header-align="center"/>
<el-table-column prop="created_at" label="操作时间" align="center" header-align="center"/>
<el-table-column prop="created_at" label="操作时间" align="center" header-align="center" sortable="custom"/>
<el-table-column prop="remark" label="备注" align="center" header-align="center">
<template #default="scope">
<el-tooltip :content="scope.row.remark" placement="top">
@ -95,7 +95,8 @@ const logTableData = async (jwcode) => {
token: token,
jwcode: jwcode,
page: currentPage.value,
page_size: pageSize.value
page_size: pageSize.value,
sort_order: sortOrder.value || ''
};
const data = await logDeepMateApi(requestParams);
tableData.value = data.list
@ -133,7 +134,7 @@ const handleCurrentChange = (val) => {
const handleSortChange = (sort) => {
const { prop, order } = sort;
sortProp.value = prop;
sortOrder.value = order;
sortOrder.value = order === 'ascending' ? 'asc' : 'desc';
logTableData(targetId.value);
};
</script>

10
src/views/UserPermissions/MarketTerm.vue

@ -90,10 +90,10 @@
{{ (currentPage - 1) * pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="jwcode" label="账号" align="center" header-align="center" width="120"/>
<el-table-column prop="username" label="姓名" align="center" header-align="center" width="150"/>
<el-table-column prop="jwcode" label="账号" align="center" header-align="center"/>
<el-table-column prop="username" label="姓名" align="center" header-align="center"/>
<!-- <el-table-column prop="origin_name" label="来源" align="center" header-align="center" width="200"/> -->
<el-table-column prop="country" label="地区" align="center" header-align="center" width="150"/>
<el-table-column prop="country" label="地区" align="center" header-align="center"/>
<!-- <el-table-column prop="dialingCode" label="手机区号" align="center" header-align="center" width="80"/> -->
<!-- <el-table-column prop="mobiles" label="手机号" align="center" header-align="center" width="200"/> -->
<!-- <el-table-column prop="emails" label="邮箱" align="center" header-align="center" width="200"/> -->
@ -108,8 +108,8 @@
</el-tooltip>
</template>
</el-table-column> -->
<el-table-column prop="regtime" label="注册时间" align="center" header-align="center" sortable="custom" width="200"/>
<el-table-column prop="expire_time" label="到期时间" align="center" header-align="center" sortable="custom" width="200"/>
<el-table-column prop="regtime" label="注册时间" align="center" header-align="center" sortable="custom"/>
<el-table-column prop="expire_time" label="到期时间" align="center" header-align="center" sortable="custom"/>
<el-table-column label="操作" width="180" align="center" header-align="center" fixed="right">
<template #default="scope">
<el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>

119
src/views/UserPermissions/UserList.vue

@ -10,7 +10,7 @@
v-model="searchForm.dccode"
placeholder="请输入ID"
clearable
style="width: 140px;"
style="height: 36px; width: 140px;"
/>
</div>
<div class="search-item">
@ -19,7 +19,7 @@
v-model="searchForm.name"
placeholder="请输入姓名"
clearable
style="width: 140px;"
style="height: 36px; width: 140px;"
/>
</div>
<div class="search-item">
@ -54,7 +54,7 @@
v-for="region in regionList"
:key="region.ID"
:label="region.Name"
:value="region.Name"
:value="region.ID"
/>
</el-select>
</div>
@ -64,7 +64,7 @@
v-model="searchForm.is_login"
placeholder="请选择是否登录"
clearable
style="width: 140px;"
style="width: 160px;"
>
<el-option label="已登录" :value="1" />
<el-option label="未登录" :value="0" />
@ -117,12 +117,14 @@
<!-- 数据表格 -->
<el-table
ref="tableRef"
:data="tableData"
style="width: 100%; margin-top: 20px;"
header-cell-class-name="table-header"
class="table-rounded"
:loading="tableLoading"
:header-cell-style="{background:'#f5f7fa', color:'#606266', fontWeight:'600'}"
@sort-change="handleSortChange"
>
<el-table-column prop="id" label="序号" align="center" header-align="center" width="60">
<template #default="scope">
@ -162,12 +164,12 @@
<el-tag v-else type="info" size="small" effect="light">未登录</el-tag>
</template>
</el-table-column>
<el-table-column prop="reg_time" label="注册时间" align="center" header-align="center" width="160">
<el-table-column prop="reg_time" label="注册时间" align="center" header-align="center" width="160" sortable="custom">
<template #default="scope">
{{ scope.row.reg_time }}
</template>
</el-table-column>
<el-table-column prop="last_login_time" label="登录时间" align="center" header-align="center" width="160">
<el-table-column prop="last_login_time" label="登录时间" align="center" header-align="center" width="160" sortable="custom">
<template #default="scope">
{{ scope.row.last_login_time }}
</template>
@ -226,12 +228,35 @@ const isOriginLoading = ref(false);
//
const tableData = ref([]);
const tableLoading = ref(false);
const tableRef = ref(null) //
const total = ref(0);
//
const currentPage = ref(1);
const pageSize = ref(10);
//
const sortParams = ref({
sortField: '',
sortOrder: ''
})
//
const handleSortChange = ({ prop, order }) => {
sortParams.value.sortField = prop || ''
if (order === 'ascending') {
sortParams.value.sortOrder = '1'
} else if (order === 'descending') {
sortParams.value.sortOrder = '0'
} else {
sortParams.value.sortField = ''
sortParams.value.sortOrder = ''
}
fetchTableData()
}
//
const fetchRegionList = async () => {
try {
@ -264,18 +289,12 @@ const fetchOriginList = async () => {
};
//
const isEmail = (value) => {
const checkRegisterType = (value) => {
const trimmedValue = value?.trim() || '';
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailRegex.test(trimmedValue);
};
const isPhone = (value) => {
const trimmedValue = value?.trim() || '';
const phoneRegex = /^\d{11}$/;
return phoneRegex.test(trimmedValue);
};
//
const fetchTableData = async () => {
try {
@ -283,8 +302,8 @@ const fetchTableData = async () => {
//
const registerType = searchForm.register_type?.trim() || '';
const isEmailValue = isEmail(registerType);
const isPhoneValue = isPhone(registerType);
const checkResult = checkRegisterType(registerType);
const requestParams = {
token: token,
page: currentPage.value,
@ -294,15 +313,15 @@ const fetchTableData = async () => {
origin_id: searchForm.origin_id,
country: searchForm.country,
is_login: searchForm.is_login,
phone: isPhoneValue ? registerType : '',
is_phone: isPhoneValue ? 1 : 0,
email: isEmailValue ? registerType : '',
phone: checkResult ? '' : registerType,
is_phone: checkResult ? 0 : 1,
email: checkResult ? registerType : '',
reg_time_start: searchForm.regTimeRange && searchForm.regTimeRange[0] ? searchForm.regTimeRange[0] : '',
reg_time_end: searchForm.regTimeRange && searchForm.regTimeRange[1] ? searchForm.regTimeRange[1] : '',
list_login_time_start: searchForm.loginTimeRange && searchForm.loginTimeRange[0] ? searchForm.loginTimeRange[0] : '',
list_login_time_end: searchForm.loginTimeRange && searchForm.loginTimeRange[1] ? searchForm.loginTimeRange[1] : '',
reg_time_asc: '',
list_login_time_asc: ''
reg_time_asc: sortParams.value.sortField === 'reg_time' ? sortParams.value.sortOrder : '',
list_login_time_asc: sortParams.value.sortField === 'last_login_time' ? sortParams.value.sortOrder : '',
};
const data = await userListApi(requestParams);
@ -320,6 +339,8 @@ const fetchTableData = async () => {
//
const handleSearch = () => {
currentPage.value = 1;
sortParams.value.sortField = '';
sortParams.value.sortOrder = '';
fetchTableData();
};
@ -328,8 +349,7 @@ const handleExport = async () => {
try {
//
const registerType = searchForm.register_type?.trim() || '';
const isEmailValue = isEmail(registerType);
const isPhoneValue = isPhone(registerType);
const checkResult = checkRegisterType(registerType);
const requestParams = {
token: token,
@ -338,13 +358,15 @@ const handleExport = async () => {
origin_id: searchForm.origin_id,
country: searchForm.country,
is_login: searchForm.is_login,
phone: isPhoneValue ? registerType : '',
is_phone: isPhoneValue ? 1 : 0,
email: isEmailValue ? registerType : '',
phone: checkResult ? '' : registerType,
is_phone: checkResult ? 0 : 1,
email: checkResult ? registerType : '',
reg_time_start: searchForm.regTimeRange && searchForm.regTimeRange[0] ? searchForm.regTimeRange[0] : '',
reg_time_end: searchForm.regTimeRange && searchForm.regTimeRange[1] ? searchForm.regTimeRange[1] : '',
list_login_time_start: searchForm.loginTimeRange && searchForm.loginTimeRange[0] ? searchForm.loginTimeRange[0] : '',
list_login_time_end: searchForm.loginTimeRange && searchForm.loginTimeRange[1] ? searchForm.loginTimeRange[1] : ''
list_login_time_end: searchForm.loginTimeRange && searchForm.loginTimeRange[1] ? searchForm.loginTimeRange[1] : '',
reg_time_asc: sortParams.value.sortField === 'reg_time' ? sortParams.value.sortOrder : '',
list_login_time_asc: sortParams.value.sortField === 'last_login_time' ? sortParams.value.sortOrder : '',
};
await exportUserListApi(requestParams);
@ -364,6 +386,7 @@ const handleViewExport = () => {
//
const handleReset = () => {
tableRef.value.clearSort(); //
searchForm.dccode = '';
searchForm.name = '';
searchForm.origin_id = '';
@ -372,6 +395,8 @@ const handleReset = () => {
searchForm.register_type = '';
searchForm.regTimeRange = [];
searchForm.loginTimeRange = [];
sortParams.value.sortField = '';
sortParams.value.sortOrder = '';
currentPage.value = 1;
pageSize.value = 10;
fetchTableData();
@ -400,17 +425,24 @@ onMounted(() => {
<style scoped>
/* 页面容器 */
.page-container {
padding: 20px;
background: #fff;
min-height: calc(100vh - 40px);
position: relative;
min-height: 600px;
}
/* 搜索区域 */
.search-container {
background: #fefaf9;
display: flex;
height: auto;
flex-direction: column;
justify-content: center;
align-items: flex-start;
gap: 12px;
align-self: stretch;
border-radius: 8px;
padding: 20px;
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);
background: #FEFAF9;
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25);
padding: 15px;
margin-bottom: 20px;
}
.search-form {
@ -433,10 +465,13 @@ onMounted(() => {
}
.form-label {
font-size: 14px;
font-weight: 800 !important;
font-size: 15px;
text-align: left;
color: #333;
white-space: nowrap;
font-weight: 500;
margin: 13px 0;
font-family: "SimHei", "Heiti SC", "Microsoft YaHei", sans-serif !important;
display: block;
}
.button-group {
@ -475,8 +510,16 @@ onMounted(() => {
/* 分页 */
.demo-pagination-block {
display: flex;
justify-content: center;
margin-top: 20px;
padding: 10px 0;
width: 100%;
height: 44px;
padding: 0 16px;
align-items: center;
gap: 16px;
position: absolute;
margin-top: 10px;
border-radius: 0 0 3px 3px;
border-top: 1px solid #EAEAEA;
background: #FEFBFB;
box-sizing: border-box;
}
</style>
Loading…
Cancel
Save