refactor(executor/people): 加 executorList 兜底, SQL 硬编码 unit_type='executor' (跟 sponsor 同模式)

- mapper BizPersonMapper.xml 新增 selectExecutorList, SQL 内硬编码 unit_type + parent_user_id=当前主账号
- controller 加 GET /business/person/executorList
- service / mapper 接口同步声明 selectExecutorList
- 前端 api/business/person.js 加 listExecutorPerson
- executor/People.vue 改调 listExecutorPerson, 删 bizList + unitType 参数

效果: executor 端人员列表也走专属接口, 前端传 unitType 绕不开 SQL 兜底
This commit is contained in:
郭庆泰
2026-08-18 01:42:05 +08:00
parent ce9de7c880
commit 50c2678ec6
7 changed files with 57 additions and 5 deletions
+12
View File
@@ -17,3 +17,15 @@ export async function listSponsorPerson(query) {
total: payload?.total || 0
}
}
/**
* executor 端专属人员列表 (同 sponsor: SQL 硬编码 unit_type='executor', 前端传 unitType 也绕不开)
*/
export async function listExecutorPerson(query) {
const { data } = await request({ url: '/business/person/executorList', method: 'get', params: query })
const payload = data?.data || data
return {
rows: payload?.rows || [],
total: payload?.total || 0
}
}
+6 -5
View File
@@ -95,7 +95,8 @@
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { bizList, bizUpdate } from '@/api/public'
import { bizUpdate } from '@/api/public'
import { listExecutorPerson } from '@/api/business/person'
import { ElMessage, ElMessageBox } from 'element-plus'
import { translatePersonRole } from '@/utils/roleMap'
@@ -113,10 +114,10 @@ const viewOpen = ref(false)
async function loadList() {
loading.value = true
try {
// request.js 拦截器已归一化为 {code, msg, data: {total, rows}}, 实际数据在 r.data
const r = await bizList('person', { pageNum: page.pageNum, pageSize: page.pageSize, ...q, unitType: 'executor' })
list.value = (r.data && r.data.rows) || r.rows || []
page.total = (r.data && r.data.total) || r.total || 0
// 走 executor 专属接口, SQL 硬编码 unit_type='executor' + parent_user_id=主账号 (前端绕不开)
const r = await listExecutorPerson({ pageNum: page.pageNum, pageSize: page.pageSize, ...q })
list.value = r.rows || []
page.total = r.total || 0
} finally { loading.value = false }
}