|
|
@@ -48,7 +48,7 @@ import { ElMessage, ElTree } from 'element-plus'
|
|
|
import { formatDate } from '@/filters'
|
|
|
import { useDataTable, useDataFilter } from '@/hooks/datatable'
|
|
|
import { queryTHJFriends, queryInvestorLevelGroup } from '@/services/api/common'
|
|
|
-import { useLoginStore } from '@/stores'
|
|
|
+import { useLoginStore, useUserStore } from '@/stores'
|
|
|
import { decryptAES } from '@/utils/websocket/crypto'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
import AppFilter from '@pc/components/base/table-filter/index.vue'
|
|
|
@@ -56,10 +56,12 @@ import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
|
|
|
interface TreeData {
|
|
|
label: string;
|
|
|
+ userid: number;
|
|
|
children?: TreeData[];
|
|
|
}
|
|
|
|
|
|
const { getUserId } = useLoginStore()
|
|
|
+const { getAccountName } = useUserStore()
|
|
|
const { dataList, total, pageIndex, pageSize } = useDataTable<Model.THJFriendsRsp>()
|
|
|
const { filterOptons, getQueryParams } = useDataFilter<Model.THJFriendsReq>()
|
|
|
const loading = shallowRef(false)
|
|
|
@@ -68,7 +70,8 @@ const filterText = shallowRef('')
|
|
|
const userId = shallowRef(getUserId()) // 当前用户ID
|
|
|
|
|
|
const treeList = reactive<TreeData[]>([{
|
|
|
- label: '登录用户',
|
|
|
+ label: getAccountName() ?? '登录用户',
|
|
|
+ userid: userId.value,
|
|
|
children: []
|
|
|
}])
|
|
|
|
|
|
@@ -91,7 +94,6 @@ filterOptons.selectList = [
|
|
|
|
|
|
filterOptons.inputList = [
|
|
|
{ label: '名称', keys: ['customername'] },
|
|
|
- { label: '手机号', keys: ['mobile'] },
|
|
|
]
|
|
|
|
|
|
filterOptons.buttonList = [
|
|
|
@@ -120,7 +122,11 @@ const getAuthStatusName = (status: number) => {
|
|
|
// 获取手机号码
|
|
|
const getPhoneNumber = (value: string) => {
|
|
|
const phoneNumber = decryptAES(value)
|
|
|
- return phoneNumber
|
|
|
+ if (userId.value == getUserId()) {
|
|
|
+ return phoneNumber
|
|
|
+ }
|
|
|
+ const reg = /^(\d{3})\d{4}(\d{4})$/
|
|
|
+ return phoneNumber?.replace(reg, '$1****$2')
|
|
|
}
|
|
|
|
|
|
const getTHJFriends = (params: Partial<Model.THJFriendsReq> = {}) => {
|
|
|
@@ -138,7 +144,8 @@ const getTHJFriends = (params: Partial<Model.THJFriendsReq> = {}) => {
|
|
|
|
|
|
if (treeList[0].children?.length === 0) {
|
|
|
treeList[0].children = res.data.map((e) => ({
|
|
|
- label: e.customername
|
|
|
+ label: e.customername,
|
|
|
+ userid: e.frienduserid,
|
|
|
}))
|
|
|
}
|
|
|
},
|
|
|
@@ -149,9 +156,11 @@ const getTHJFriends = (params: Partial<Model.THJFriendsReq> = {}) => {
|
|
|
}
|
|
|
|
|
|
// 当节点被点击的时候触发
|
|
|
-const onNodeClick = (data: TreeData) => {
|
|
|
- console.log(data)
|
|
|
- onSearch()
|
|
|
+const onNodeClick = ({ userid }: TreeData) => {
|
|
|
+ if (userId.value !== userid) {
|
|
|
+ userId.value = userid
|
|
|
+ onSearch()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 过滤树节点
|