|
@@ -6,7 +6,7 @@
|
|
|
<cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"> </cSearch>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="two">
|
|
|
- <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel"> </cTable>
|
|
|
+ <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @chat="toChat" @edit="toEdit" @del="toDel"> </cTable>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -32,6 +32,7 @@
|
|
|
import type { Ref } from 'vue';
|
|
|
import { onMounted, ref, getCurrentInstance } from 'vue';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
// 接口
|
|
|
import { UserStore } from '@/stores/users/user';
|
|
|
import { DictDataStore } from '@/stores/basic/dictData'; // 字典表
|
|
@@ -39,6 +40,8 @@ import type { IQueryResult } from '@/util/types.util';
|
|
|
const userAxios = UserStore();
|
|
|
const dictAxios = DictDataStore();
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
+// 路由
|
|
|
+const router = useRouter();
|
|
|
// 加载中
|
|
|
const loading: Ref<any> = ref(false);
|
|
|
let list: Ref<any> = ref([]);
|
|
@@ -57,7 +60,8 @@ let fields: Ref<any[]> = ref([
|
|
|
// 操作
|
|
|
let opera: Ref<any[]> = ref([
|
|
|
{ label: '修改', method: 'edit' },
|
|
|
- { label: '删除', method: 'del', confirm: true, type: 'danger' }
|
|
|
+ { label: '删除', method: 'del', confirm: true, type: 'danger' },
|
|
|
+ { label: '聊天记录', method: 'chat' }
|
|
|
]);
|
|
|
// 查询数据
|
|
|
let searchForm: Ref<any> = ref({});
|
|
@@ -119,6 +123,10 @@ const toEdit = async (data: any) => {
|
|
|
dialog.value = { title: '信息管理', show: true, type: '1' };
|
|
|
}
|
|
|
};
|
|
|
+// 聊天记录
|
|
|
+const toChat = async (data: any) => {
|
|
|
+ router.push({ path: '/user/chat', query: { id: data._id } });
|
|
|
+};
|
|
|
// 删除
|
|
|
const toDel = async (data: any) => {
|
|
|
let res: IQueryResult = await userAxios.del(data._id);
|