From 413a3b118a985fe4556b9bd1dd47fc187dcb9f3c Mon Sep 17 00:00:00 2001 From: yys <47@gamerwa.com> Date: Thu, 23 Apr 2026 17:52:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=AE=A1=E7=90=86=E7=AB=AF=E5=9B=A2?= =?UTF-8?q?=E9=98=9F=E5=90=8D=E7=A7=B0=E7=BB=9F=E4=B8=80=E6=94=B9=E6=88=90?= =?UTF-8?q?=E5=9B=A2=E9=98=9F=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-ui/src/api/subteam.js | 3 ++ admin-ui/src/mixins/secondLevelDeptFilter.js | 31 +++++++++++ .../views/ai/balanceChangeRecord/index.vue | 40 +++++--------- admin-ui/src/views/ai/data/index.vue | 18 ++----- admin-ui/src/views/ai/dept/index.vue | 50 ++++++++++++++---- .../src/views/ai/groupchargeorder/index.vue | 25 ++++++--- admin-ui/src/views/ai/order/index.vue | 25 ++++++--- admin-ui/src/views/ai/record/index.vue | 26 +++++++--- admin-ui/src/views/system/dept/index.vue | 52 +++++++++++++++---- 9 files changed, 188 insertions(+), 82 deletions(-) create mode 100644 admin-ui/src/mixins/secondLevelDeptFilter.js diff --git a/admin-ui/src/api/subteam.js b/admin-ui/src/api/subteam.js index f0406fc..c53e7e5 100644 --- a/admin-ui/src/api/subteam.js +++ b/admin-ui/src/api/subteam.js @@ -73,6 +73,9 @@ export function listSubteamUserBalance(query) { return request({ url: '/subteam/user-balance/list', method: 'get', params: query }) } +/** 导出:POST /subteam/user-balance/export(与列表相同查询参数 + beginTime/endTime) */ +export const subteamUserBalanceExportUrl = 'subteam/user-balance/export' + export function getSubteamUserBalance(id) { return request({ url: '/subteam/user-balance/' + id, method: 'get' }) } diff --git a/admin-ui/src/mixins/secondLevelDeptFilter.js b/admin-ui/src/mixins/secondLevelDeptFilter.js new file mode 100644 index 0000000..0866e73 --- /dev/null +++ b/admin-ui/src/mixins/secondLevelDeptFilter.js @@ -0,0 +1,31 @@ +import { listDept as listAiDept } from "@/api/ai/dept" + +/** + * 与「统计数据」页(ai/data)一致:仅启用状态,且 ancestors 深度为 2 的团队,供筛选下拉使用。 + * 系统团队页(system/dept)请覆写 secondLevelDeptListRequest,改为调用 /system/dept/list。 + */ +export default { + data() { + return { + secondLevelDeptOptions: [] + } + }, + methods: { + /** @param {object} params 如 { status: '0' } */ + secondLevelDeptListRequest(params) { + return listAiDept(params) + }, + loadSecondLevelDeptOptions() { + this.secondLevelDeptListRequest({ status: "0" }).then(response => { + const allDeptList = response.data || [] + this.secondLevelDeptOptions = allDeptList.filter(item => this.isSecondLevelDept(item)) + }) + }, + isSecondLevelDept(dept) { + if (!dept || !dept.ancestors) { + return false + } + return String(dept.ancestors).split(",").filter(Boolean).length === 2 + } + } +} diff --git a/admin-ui/src/views/ai/balanceChangeRecord/index.vue b/admin-ui/src/views/ai/balanceChangeRecord/index.vue index cf7d247..daa0a99 100644 --- a/admin-ui/src/views/ai/balanceChangeRecord/index.vue +++ b/admin-ui/src/views/ai/balanceChangeRecord/index.vue @@ -17,14 +17,20 @@ /> - + > + + { - this.deptOptions = this.handleTree(res.data, "deptId"); - }); - }, - deptNormalizer(node) { - if (node.children && !node.children.length) { - delete node.children; - } - return { - id: node.deptId, - label: node.deptName, - children: node.children - }; - }, /** 西式千分位(en-US),积分为整数 */ formatPointsWestern(value) { if (value === null || value === undefined || value === "") { diff --git a/admin-ui/src/views/ai/data/index.vue b/admin-ui/src/views/ai/data/index.vue index 8695bb9..57f8315 100644 --- a/admin-ui/src/views/ai/data/index.vue +++ b/admin-ui/src/views/ai/data/index.vue @@ -22,7 +22,7 @@ style="width: 220px" > import { listData } from "@/api/ai/data" -import { listDept } from "@/api/ai/dept" +import secondLevelDeptFilter from "@/mixins/secondLevelDeptFilter" export default { name: "TeamConsumeData", + mixins: [secondLevelDeptFilter], data() { return { loading: false, @@ -125,7 +126,6 @@ export default { total: 0, dataList: [], aggregate: null, - deptOptions: [], dateRange: [], queryParams: { pageNum: 1, @@ -194,18 +194,6 @@ export default { initDefaultDateRange() { this.dateRange = this.buildLastMonthDateRange() }, - loadSecondLevelDeptOptions() { - listDept({ status: "0" }).then(response => { - const allDeptList = response.data || [] - this.deptOptions = allDeptList.filter(item => this.isSecondLevelDept(item)) - }) - }, - isSecondLevelDept(dept) { - if (!dept || !dept.ancestors) { - return false - } - return String(dept.ancestors).split(",").filter(Boolean).length === 2 - }, syncDateRangeToQuery() { if (Array.isArray(this.dateRange) && this.dateRange.length === 2) { this.queryParams.startDate = this.dateRange[0] diff --git a/admin-ui/src/views/ai/dept/index.vue b/admin-ui/src/views/ai/dept/index.vue index 77732f3..768a54b 100644 --- a/admin-ui/src/views/ai/dept/index.vue +++ b/admin-ui/src/views/ai/dept/index.vue @@ -1,16 +1,24 @@