Преглед изворни кода

Merge branch 'main' into release

sheldon пре 2 месеци
родитељ
комит
cc5ebc9b40

+ 7 - 1
src/api/index.ts

@@ -82,7 +82,13 @@ api.interceptors.response.use(
      * 请求出错时 error 会返回错误信息
      */
     const { code, msg } = response.data
-    console.log(code, msg)
+    console.log(code, msg, 444444)
+    if(code === -90){
+      toast.error('Error', {
+        description: '克隆服务异常,请联系管理员',
+      })
+      return Promise.reject(response.data)
+    }
     // if (typeof response.data === 'object') {
     //   console.log(response.data,3333444)
     //   if (response.data.status === 1) {

+ 0 - 1
src/views/role-management/components/SearchForm.vue

@@ -3,7 +3,6 @@ import { Refresh, Search } from '@element-plus/icons-vue'
 import { ElButton, ElCol, ElForm, ElFormItem, ElInput, ElOption, ElRow, ElSelect } from 'element-plus'
 import { ref } from 'vue'
 type TSearchParams = {
-  name: string,
   nameOrTags: string,
 }
 interface Props {

+ 36 - 5
src/views/role-management/index.vue

@@ -16,6 +16,7 @@ import SearchForm from './components/SearchForm.vue'
 import type { TAgent } from '@/types/role'
 import { anycallPage, updateTopFlag, type TRole } from '@/api/modules/anycallService'
 import { formatDateGeneral } from '@/utils'
+import { toast } from 'vue-sonner'
 
 const tableRef = ref()
 
@@ -32,7 +33,31 @@ const editCallingsFormVisible = ref(false)
 
 const importedResultDialogVisible = ref(false)
 const importedFile = ref<UploadFile | null>(null)
-const importedResult = ref('')
+const importedResult = ref<{name: string, msg: string}[]>([
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+  // {name: 'test1.csv', msg: '成功'},
+])
 // 搜索参数
 const searchParams = ref({
   // name: '',
@@ -94,9 +119,13 @@ const  handleRecommend = async (id: string, topFlag: boolean) => {
 function handleUploadSuccess(res:any, file: any) {
   console.log(res, file)
   if(res.code === 0){
-    importedResult.value = res.data
+    importedResult.value = res.data as {name: string, msg: string}[]
     importedResultDialogVisible.value = true
+    return
   }
+  toast.error('Error', {
+    description: res.msg || '导入失败',
+  })
 }
 
 
@@ -146,7 +175,7 @@ onMounted(async () => {
 
 <template>
   <div class="absolute-container">
-    <div class="p-4 pb-0 bg-white">
+    <div class="p-4 pb-0 bg-white dark-bg-black/50">
       <SearchForm v-model="searchParams" :loading="loading" @search="handleSearch" @reset="handleReset" />
     </div>
 
@@ -239,9 +268,11 @@ onMounted(async () => {
     <ElDialog title="导入结果" v-model="importedResultDialogVisible" align-center
       width="800" :z-index="2000" :close-on-click-modal="false">
         <div class="max-h-200 overflow-y-auto leading-6">
-          {{ importedResult }}
+          <el-table  :data="importedResult" stripe style="width: 100%;" height="450">
+            <el-table-column prop="name" label="name" width="180" />
+            <el-table-column prop="msg" label="message" min-width="180" />
+          </el-table>
         </div>
-
       </ElDialog>
   </div>
 </template>

+ 1 - 1
src/views/voice-management/index.vue

@@ -181,7 +181,7 @@ onMounted(async () => {
 
 <template>
   <div class="absolute-container">
-    <div class="p-4 pb-0 bg-white">
+    <div class="p-4 pb-0 bg-white dark-bg-black/50">
       <SearchForm v-model="searchParams" @search="handleSearch" @reset="handleReset"></SearchForm>
     </div>
     <FaPageMain class="flex-1 overflow-auto" main-class="flex-1 flex flex-col overflow-auto">