新增俩接口,新增一些变量

This commit is contained in:
Cold
2025-12-26 15:35:11 +08:00
parent 73373ad7a1
commit da615ab897
5 changed files with 295 additions and 22 deletions

View File

@@ -3,11 +3,11 @@
<el-card shadow="hover">
<div class="system-user-search mb15">
<el-form :inline="true">
<el-form-item label="客服ID">
<el-form-item label="客服账号">
<el-input
size="default"
v-model="tableData.param.customerServiceId"
placeholder="请输入客服ID"
v-model="tableData.param.accountName"
placeholder="请输入客服账号"
class="w-50 m-2"
clearable
@keyup.enter="handleSearch"
@@ -44,7 +44,7 @@
</div>
<el-table :data="tableData.data" style="width: 100%" v-loading="tableData.loading">
<el-table-column type="index" label="序号" width="60" />
<el-table-column prop="customerServiceId" label="客服ID" show-overflow-tooltip></el-table-column>
<el-table-column prop="accountName" label="客服账号" show-overflow-tooltip></el-table-column>
<el-table-column prop="isDisabled" label="客服状态" show-overflow-tooltip>
<template #default="scope">
<el-button
@@ -70,11 +70,14 @@
{{ formatTime(row.updatedAt) }}
</template>
</el-table-column>
<el-table-column label="操作" width="220">
<el-table-column label="操作" width="300">
<template #default="scope">
<el-button style="color: deepskyblue" size="small" text type="primary" class="op-btn-edit" @click="onOpenEditRole(scope.row)">
<el-button style="color: deepskyblue" size="small" text type="primary" @click="onOpenEditRole(scope.row)">
<el-icon><ele-EditPen /></el-icon>修改
</el-button>
<el-button style="color: #e6a23c" size="small" text type="warning" @click="onOpenPromptConfig(scope.row)">
<el-icon><ele-SetUp /></el-icon>配置提示词
</el-button>
</template>
</el-table-column>
</el-table>
@@ -87,6 +90,7 @@
/>
</el-card>
<EditAccount ref="editRoleRef" @refresh="getList" />
<PromptConfig ref="promptConfigRef" @refresh="getList" />
</div>
</template>
@@ -94,12 +98,13 @@
import { ref, reactive, onMounted } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import EditAccount from './component/editAccount.vue';
import PromptConfig from './component/promptConfig.vue';
import { addAccount, getaccountList, updatestate } from '/@/api/customerService/account';
// 定义类型接口
interface TableDataItem {
id: string;
customerServiceId: string;
accountName: string;
isDisabled: number; // 修正应该是isDisabled而不是status
platform: string;
creator: string;
@@ -110,7 +115,7 @@ interface TableDataItem {
}
interface TableParam {
customerServiceId: string;
accountName: string;
platform: string;
pageNum: number;
pageSize: number;
@@ -126,7 +131,7 @@ interface TableState {
// 初始参数(用于重置)
const initialParam: TableParam = {
customerServiceId: '',
accountName: '',
platform: '',
pageNum: 1,
pageSize: 10,
@@ -155,7 +160,7 @@ const getList = async () => {
const queryParams: any = {
pageNum: tableData.param.pageNum,
pageSize: tableData.param.pageSize,
customerServiceId: tableData.param.customerServiceId || undefined,
accountName: tableData.param.accountName || undefined,
platform: tableData.param.platform || undefined,
};
@@ -247,7 +252,7 @@ const formatTime = (time: string | number | Date): string => {
*/
const handleStatusChange = async (row: TableDataItem) => {
try {
await ElMessageBox.confirm(`确定要${row.isDisabled == 1 ? '禁用' : '启用'}客服账号 "${row.customerServiceId}" 吗?`, '提示', {
await ElMessageBox.confirm(`确定要${row.isDisabled == 1 ? '禁用' : '启用'}客服账号 "${row.accountName}" 吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
@@ -290,6 +295,13 @@ const onOpenEditRole = (row: any) => {
editRoleRef.value?.openDialog(row);
};
/**
* 打开提示词配置对话框
*/
const onOpenPromptConfig = (row: any) => {
promptConfigRef.value?.openDialog(row);
};
// 生命周期
onMounted(() => {
getList();