|
@@ -2,7 +2,7 @@
|
|
import { Search, Plus } from '@element-plus/icons-vue'
|
|
import { Search, Plus } from '@element-plus/icons-vue'
|
|
import { apiCustomerUser } from '@/api/customer'
|
|
import { apiCustomerUser } from '@/api/customer'
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
-import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
|
+import { ElMessage, ElMessageBox,dayjs } from 'element-plus'
|
|
import EnableUser from './components/EnableUser.vue'
|
|
import EnableUser from './components/EnableUser.vue'
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -14,7 +14,9 @@ const filterState = reactive({
|
|
register: '',
|
|
register: '',
|
|
subscribe: '',
|
|
subscribe: '',
|
|
regsiterTime: [],
|
|
regsiterTime: [],
|
|
- createTime: []
|
|
|
|
|
|
+ createTime: [],
|
|
|
|
+ sortType:'',
|
|
|
|
+ sortVal:''
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
@@ -37,7 +39,8 @@ const tableColOpt = [
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '用户状态',
|
|
label: '用户状态',
|
|
- key: 'Status'
|
|
|
|
|
|
+ key: 'Status',
|
|
|
|
+ width: '100px'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '有效期',
|
|
label: '有效期',
|
|
@@ -46,12 +49,14 @@ const tableColOpt = [
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '到期时长',
|
|
label: '到期时长',
|
|
- key: 'ExpirationTime',
|
|
|
|
- sort: true
|
|
|
|
|
|
+ key: 'RestDate',
|
|
|
|
+ sort: true,
|
|
|
|
+ width: '120px'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '是否注册',
|
|
label: '是否注册',
|
|
- key: 'IsRegistered'
|
|
|
|
|
|
+ key: 'IsRegistered',
|
|
|
|
+ width: '100px'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '注册时间',
|
|
label: '注册时间',
|
|
@@ -89,6 +94,8 @@ async function getUserList() {
|
|
RegisterEndDate: filterState.regsiterTime ? filterState.regsiterTime[1] : '',
|
|
RegisterEndDate: filterState.regsiterTime ? filterState.regsiterTime[1] : '',
|
|
CreateStartDate: filterState.createTime ? filterState.createTime[0] : '',
|
|
CreateStartDate: filterState.createTime ? filterState.createTime[0] : '',
|
|
CreateEndDate: filterState.createTime ? filterState.createTime[1] : '',
|
|
CreateEndDate: filterState.createTime ? filterState.createTime[1] : '',
|
|
|
|
+ SortParam:filterState.sortType,
|
|
|
|
+ SortType:filterState.sortVal
|
|
})
|
|
})
|
|
tableLoading.value = false
|
|
tableLoading.value = false
|
|
if (res.Ret === 200) {
|
|
if (res.Ret === 200) {
|
|
@@ -104,6 +111,14 @@ function handlePageChange(e) {
|
|
function handleTableSort(e) {
|
|
function handleTableSort(e) {
|
|
// console.log(e);
|
|
// console.log(e);
|
|
const { order, prop } = e//order:"descending",prop: "RegisterTime"
|
|
const { order, prop } = e//order:"descending",prop: "RegisterTime"
|
|
|
|
+ filterState.sortType=prop
|
|
|
|
+ if(!order){
|
|
|
|
+ filterState.sortVal=''
|
|
|
|
+ }else{
|
|
|
|
+ filterState.sortVal=order==='descending'?'desc':'asc'
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ handleFilterList()
|
|
}
|
|
}
|
|
function handleFilterList() {
|
|
function handleFilterList() {
|
|
page.value = 1
|
|
page.value = 1
|
|
@@ -160,7 +175,15 @@ function handleDelUser(row) {
|
|
}).catch(() => { })
|
|
}).catch(() => { })
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+// 跳转详情
|
|
|
|
+function handleGoDetail(e){
|
|
|
|
+ router.push({
|
|
|
|
+ path:'/customer/userDetail',
|
|
|
|
+ query:{
|
|
|
|
+ id:e.UserId
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|
|
@@ -259,6 +282,7 @@ function handleDelUser(row) {
|
|
element-loading-text="数据加载中..."
|
|
element-loading-text="数据加载中..."
|
|
v-loading="tableLoading"
|
|
v-loading="tableLoading"
|
|
@sort-change="handleTableSort"
|
|
@sort-change="handleTableSort"
|
|
|
|
+ @row-click="handleGoDetail"
|
|
>
|
|
>
|
|
<el-table-column
|
|
<el-table-column
|
|
v-for="column in tableColOpt"
|
|
v-for="column in tableColOpt"
|
|
@@ -293,11 +317,6 @@ function handleDelUser(row) {
|
|
<span v-else-if="column.key === 'IsSubscribed'">{{
|
|
<span v-else-if="column.key === 'IsSubscribed'">{{
|
|
row.IsSubscribed ? "是" : "否"
|
|
row.IsSubscribed ? "是" : "否"
|
|
}}</span>
|
|
}}</span>
|
|
- <span
|
|
|
|
- v-else-if="column.key === 'RealName'"
|
|
|
|
- @click="$router.push('/customer/userDetail?id=' + row.UserId)"
|
|
|
|
- >{{ row[column.key] }}</span
|
|
|
|
- >
|
|
|
|
<span v-else-if="column.key === 'ValidStartTime'"
|
|
<span v-else-if="column.key === 'ValidStartTime'"
|
|
>{{ formatTime(row.ValidStartTime, "YYYY-MM-DD") }}~{{
|
|
>{{ formatTime(row.ValidStartTime, "YYYY-MM-DD") }}~{{
|
|
formatTime(row.ValidEndTime, "YYYY-MM-DD")
|
|
formatTime(row.ValidEndTime, "YYYY-MM-DD")
|
|
@@ -318,7 +337,7 @@ function handleDelUser(row) {
|
|
v-permission="'user:edit'"
|
|
v-permission="'user:edit'"
|
|
type="primary"
|
|
type="primary"
|
|
link
|
|
link
|
|
- @click="handleEditUser(row)"
|
|
|
|
|
|
+ @click.stop="handleEditUser(row)"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
@@ -326,7 +345,7 @@ function handleDelUser(row) {
|
|
type="danger"
|
|
type="danger"
|
|
link
|
|
link
|
|
v-if="row.Status"
|
|
v-if="row.Status"
|
|
- @click="handleDisabledUser(row)"
|
|
|
|
|
|
+ @click.stop="handleDisabledUser(row)"
|
|
>禁用</el-button
|
|
>禁用</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
@@ -334,14 +353,14 @@ function handleDelUser(row) {
|
|
type="primary"
|
|
type="primary"
|
|
link
|
|
link
|
|
v-else
|
|
v-else
|
|
- @click="handleEnableUser(row)"
|
|
|
|
|
|
+ @click.stop="handleEnableUser(row)"
|
|
>启用</el-button
|
|
>启用</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
v-permission="'user:delete'"
|
|
v-permission="'user:delete'"
|
|
type="danger"
|
|
type="danger"
|
|
link
|
|
link
|
|
- @click="handleDelUser(row)"
|
|
|
|
|
|
+ @click.stop="handleDelUser(row)"
|
|
>删除</el-button
|
|
>删除</el-button
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|