|
|
|
@ -32,9 +32,9 @@ |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="region in regionList" |
|
|
|
:key="region.value" |
|
|
|
:label="region.label" |
|
|
|
:value="region.value" |
|
|
|
:key="region.id" |
|
|
|
:label="region.text_cn" |
|
|
|
:value="region.market" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
@ -100,6 +100,7 @@ |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import { ref, reactive, computed, onMounted } from 'vue'; |
|
|
|
import { marketListApi, userMListApi } from '../../api/userPermissions' |
|
|
|
|
|
|
|
// 搜索表单 |
|
|
|
const searchForm = reactive({ |
|
|
|
@ -114,41 +115,7 @@ const sortProp = ref(null); |
|
|
|
const sortOrder = ref(null); |
|
|
|
|
|
|
|
// 表格数据 |
|
|
|
const tableData = ref([ |
|
|
|
{ |
|
|
|
"id": 3, |
|
|
|
"dccode": "DC44972906", |
|
|
|
"dcname": "qwdasdas", |
|
|
|
"market": "越南", |
|
|
|
"phone_country": "+86", |
|
|
|
"phone": "17861484999", |
|
|
|
"email": "q61w4588746@163.com", |
|
|
|
"created_at": "2025-10-30 16:56:44", |
|
|
|
"expire_time": "2099-12-31 23:59:59" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": 2, |
|
|
|
"dccode": "DC73412532", |
|
|
|
"dcname": "S1wire", |
|
|
|
"market": "中国", |
|
|
|
"phone_country": "+86", |
|
|
|
"phone": "1831572969", |
|
|
|
"email": "91224746@163.com", |
|
|
|
"created_at": "2025-10-29 19:54:48", |
|
|
|
"expire_time": "2099-12-31 23:59:59" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"id": 1, |
|
|
|
"dccode": "DC30454647", |
|
|
|
"dcname": "EthanAZ", |
|
|
|
"market": "中国", |
|
|
|
"phone_country": "+86", |
|
|
|
"phone": "18315796169", |
|
|
|
"email": "91224588746@163.com", |
|
|
|
"created_at": "2025-10-29 18:47:43", |
|
|
|
"expire_time": "2026-01-01 19:02:46" |
|
|
|
} |
|
|
|
]); |
|
|
|
const tableData = ref([]); |
|
|
|
const tableLoading = ref(false); |
|
|
|
const datatotal = ref(0) |
|
|
|
|
|
|
|
@ -157,21 +124,15 @@ const currentPage = ref(1); // 对应分页当前页 |
|
|
|
const pageSize = ref(10); // 对应分页每页条数 |
|
|
|
|
|
|
|
// 地区下拉框相关 |
|
|
|
const regionList = ref([ |
|
|
|
{ label: '香港', value: '香港' }, |
|
|
|
{ label: '马来西亚', value: '马来西亚' }, |
|
|
|
{ label: '泰国', value: '泰国' }, |
|
|
|
{ label: '新加坡', value: '新加坡' }, |
|
|
|
{ label: '越南', value: '越南' } |
|
|
|
]); |
|
|
|
const regionList = ref([]); |
|
|
|
const isRegionLoading = ref(false); |
|
|
|
|
|
|
|
// 获取地区列表 |
|
|
|
const fetchRegionList = async () => { |
|
|
|
try { |
|
|
|
isRegionLoading.value = true; |
|
|
|
// 下面添加方法 |
|
|
|
|
|
|
|
const data = await marketListApi(); |
|
|
|
regionList.value = data.list; |
|
|
|
} catch (error) { |
|
|
|
console.error('获取地区列表失败:', error); |
|
|
|
regionList.value = []; |
|
|
|
@ -194,8 +155,9 @@ const fetchTableData = async () => { |
|
|
|
page: currentPage.value, |
|
|
|
page_size: pageSize.value |
|
|
|
}; |
|
|
|
datatotal.value = 3; |
|
|
|
|
|
|
|
const data = await userMListApi(requestParams); |
|
|
|
tableData.value = data.list |
|
|
|
datatotal.value = data.total |
|
|
|
} catch (error) { |
|
|
|
console.error('获取表格数据失败:', error); |
|
|
|
tableData.value = []; |
|
|
|
@ -242,7 +204,6 @@ const resetBn = () => { |
|
|
|
currentPage.value = 1; |
|
|
|
pageSize.value = 10; |
|
|
|
fetchTableData(); |
|
|
|
console.log('表单已重置,排序已取消'); |
|
|
|
}; |
|
|
|
|
|
|
|
// 编辑 |
|
|
|
@ -271,6 +232,7 @@ const handleCurrentChange = (val) => { |
|
|
|
// 排序事件 |
|
|
|
const handleSortChange = (sort) => { |
|
|
|
const { prop, order } = sort; |
|
|
|
|
|
|
|
// 仅允许created_at(注册时间)和expire_time(到期时间)排序 |
|
|
|
if (!['created_at', 'expire_time'].includes(prop)) return; |
|
|
|
|
|
|
|
@ -279,7 +241,7 @@ const handleSortChange = (sort) => { |
|
|
|
sortOrder.value = order; // 保存当前排序方式 |
|
|
|
|
|
|
|
fetchTableData(); |
|
|
|
console.log(`排序字段:${sortProp.value},排序方式:${sortOrder.value}`); |
|
|
|
// console.log(`排序字段:${sortProp.value},排序方式:${sortOrder.value}`); |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
|