imeik-bizui 2.5.7 → 2.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  # 底价看板(FieldFloorPriceBoard)
2
2
 
3
- > 日期:2026-09-21
3
+ > 日期:2026-09-22
4
4
  > 范围:物资系统 · 会议系统 · 申请中心 · **imeik-bizui**
5
- > 目标:**不在每个系统、每个端重写一遍**——域适配、业务接口、UI/编排都在 bizui;宿主只传业务数据 + 权限
5
+ > 目标:bizui 只负责「选接口 + 拉数 + 看板 UI」;**请求体组装在业务系统**
6
6
 
7
7
  ---
8
8
 
@@ -10,66 +10,42 @@
10
10
 
11
11
  ```
12
12
  imeik-bizui/src/bizui/
13
- ├── api/mms.js # getProductPrice / getProductPriceDetail(mmsRequest)
13
+ ├── api/mms.js # getProductPrice / getProductPriceDetail
14
+ ├── api/applycenter.js # 丽臻底价 overview / detail
14
15
  └── src/
15
- └── FieldFloorPriceBoard/ # 唯一全局组件(index.vue)
16
- ├── index.vue # scene 选适配器
17
- ├── adapters/ # 各域字段 → payload(互不混用 props)
18
- │ ├── SuppliesAdapter.vue
19
- │ ├── MeetingAdapter.vue
20
- │ └── ApplyCenterAdapter.vue
21
- ├── core/ # Board / Dashboard / Detail / normalize / mock
16
+ └── FieldFloorPriceBoard/
17
+ ├── index.vue # scene → 接口映射 + Dashboard
18
+ └── core/ # Board / Dashboard / Detail / normalize / mock
22
19
  ```
23
20
 
24
- `Vue.use(bizui)` 后页面直接写:
21
+ `Vue.use(bizui)` 后:
25
22
 
26
23
  ```vue
27
- <!-- 物资 -->
28
24
  <FieldFloorPriceBoard
29
25
  scene="supplies"
30
- :apply-customer-info="..."
31
- :snapshot-list="..."
32
- :apply-dept-code="..."
33
- :cost-bear-dept-code="..."
34
- :cost-type="..."
35
- :apply-code="..."
36
- :show-detail-link="hasPerm"
37
- />
38
-
39
- <!-- 会议 -->
40
- <FieldFloorPriceBoard scene="meeting" :customer-info="..." :inject-rows="..." ... />
41
-
42
- <!-- 申请中心:业务侧组装好 requestPayload 再传入(字段映射不放组件库) -->
43
- <FieldFloorPriceBoard
44
- scene="applyCenter"
45
26
  :request-payload="payload"
46
27
  :customer-name="..."
47
28
  :show-detail-link="hasPerm"
48
29
  />
49
30
  ```
50
31
 
51
- `scene` 取值:`supplies` | `meeting` | `apply` / `applyCenter`。
32
+ `scene`:`supplies` | `meeting` | `apply` / `applyCenter`。
33
+
34
+ 请求体组装在业务系统(如 `CustomerFloorPriceBoard/buildRequestPayload.js`、`FieldApplyFloorPriceBoard/buildRequestPayload.js`)。
52
35
 
53
- 申请中心请求体组装在业务系统(如 `FieldApplyFloorPriceBoard/buildRequestPayload.js`),适配器只负责调 openApi + 展示。
54
36
  ---
55
37
 
56
- ## 二、分层原则(对齐 bizui 既有写法)
38
+ ## 二、分层原则
57
39
 
58
- 1. **接口写在 `api/mms.js`**,走 `utils/mmsRequest`(按 `$bizui.env` 切网关 + `userTokenFunc`)。
59
- 2. **对外只注册一个全局组件** `FieldFloorPriceBoard`;域差异落在 `adapters/`。
60
- 3. **adapter 互不 import**;共用只依赖本目录 `core` 与 `api/mms`。
61
- 4. **宿主页面尽量薄**:传本域字段 + 权限布尔;不写 debounce / normalize / 看板 UI / 底价 API。
62
- 5. **适配层组装请求**:各 adapter 产出同一份 `requestPayload` 同时作为 overview / detail;`FloorPriceDashboard` 只负责拉数 + 展示。
40
+ 1. **接口**在 `api/mms.js` / `api/applycenter.js`。
41
+ 2. **对外只注册** `FieldFloorPriceBoard`;`index.vue` 按 `scene` 选 fetch。
42
+ 3. **宿主组装** `requestPayload` + 客户名 + 权限;不写 debounce / normalize / 看板 UI。
43
+ 4. **bizui 不解析**各域表单字段(客户对象、快照、注射行等)。
63
44
 
64
45
  ```
65
- ┌──────────────────────────────────────────────────────────────┐
66
- │ bizui │
67
- │ api/mms + FieldFloorPriceBoard(core/adapters) │
68
- └──────────────────────────────▲───────────────────────────────┘
69
- │ scene + 本域 props
70
- ┌──────────┴──────────┐
71
- 物资 / 会议 / 申请中心 PC·H5
72
- <FieldFloorPriceBoard />
46
+ 业务系统:表单字段 → requestPayload
47
+ ↓
48
+ bizui: scene 选接口 → Dashboard 拉数 → Board / Detail
73
49
  ```
74
50
 
75
51
  ---
@@ -78,32 +54,23 @@ imeik-bizui/src/bizui/
78
54
 
79
55
  | 类型 | 内容 |
80
56
  | --- | --- |
81
- | 概述入参 | `customUniqueCode`、`businessLineNumber`、`isGroupCustomer`、`applyDeptCode`、`costBearDeptCode`、`costType`、`materialList[]`(允许 `[]`) |
82
- | 明细入参 | 与概述同形(含 `applyCode` + 表单字段);接口自取所需字段 |
83
- | 展示 | 看板 `normalizeOverview`;明细顶部汇总取概览;**差距 = 申请后 − 申请底价(前端算)**,变低红 / 变高绿 |
57
+ | Props | `scene`、`requestPayload`、`customerName`、`showDetailLink`、`useMock`、`emptyText` |
58
+ | 物资/会议入参 | `customUniqueCode`、`businessLineNumber`、`isGroupCustomer`、`applyDeptCode`、`costBearDeptCode`、`costType`、`materialList[]`(允许 `[]`) |
59
+ | 申请中心入参 | 见丽臻底价接口文档 |
60
+ | 展示 | 看板 `normalizeOverview`;明细顶部汇总取概览;**差距 = 申请后 − 标准(前端算)** |
84
61
 
85
62
  ---
86
63
 
87
- ## 四、各域列表映射
64
+ ## 四、scene → 接口
88
65
 
89
- | 域 | scene | adapter | 物料来源 |
90
- | --- | --- | --- | --- |
91
- | 物资 | `supplies` | `adapters/SuppliesAdapter.vue` | `snapshotList`(组合拆子项) |
92
- | 会议 | `meeting` | `adapters/MeetingAdapter.vue` | inject / deduct / materialRows |
93
- | 申请中心 | `apply` / `applyCenter` | `adapters/ApplyCenterAdapter.vue` | `productLines` |
94
-
95
- ---
96
-
97
- ## 五、落地顺序
98
-
99
- | 阶段 | 内容 |
100
- | --- | --- |
101
- | **P0** | 物资页挂 `FieldFloorPriceBoard scene="supplies"`(联调后关闭 `use-mock`) |
102
- | **P1** | bizui 发版;会议/申请中心确认字段后补齐 adapter |
103
- | **P2** | 物资 H5 直接复用同一全局组件 |
66
+ | 域 | scene | 接口 |
67
+ | --- | --- | --- |
68
+ | 物资 | `supplies` | `mms.getProductPrice` / `getProductPriceDetail` |
69
+ | 会议 | `meeting` | 同上 |
70
+ | 申请中心 | `apply` / `applyCenter` | `applycenter` 丽臻底价 overview / detail |
104
71
 
105
72
  ---
106
73
 
107
- ## 六、一句话
74
+ ## 五、一句话
108
75
 
109
- **bizui 收齐「域适配 + mms 底价 API + 看板」;宿主 `Vue.use(bizui)` 后挂 `<FieldFloorPriceBoard scene="..." />` 传本域数据即可。**
76
+ **业务侧拼好 `requestPayload`;bizui 按 `scene` 调对应底价接口并展示。**
@@ -2,19 +2,11 @@
2
2
  通用底价看板(展示 + 拉数编排)
3
3
 
4
4
  职责:防抖请求、normalize、看板/明细 UI。
5
- 不负责:各业务域字段映射、拼概述/明细入参 —— 由 FieldFloorPriceBoard/adapters/* 完成。
6
- 推荐用法:业务侧挂 <FieldFloorPriceBoard scene="supplies|meeting|applyCenter" />;高级场景可直接传 overviewPayload + fetchOverview。
5
+ 不负责:各业务域字段映射、拼请求体 —— 由业务系统组装后经 FieldFloorPriceBoard 传入。
7
6
 
8
- 推荐用法(适配层):
9
- <FloorPriceDashboard
10
- :overview-payload="overviewPayload" // 已组装好的 getProductPrice 入参;缺参传 null
11
- :detail-payload="detailPayload" // 与 overview 同结构;可带 applyCode + 表单字段,接口自取
12
- :customer-name="..."
13
- :fetch-overview="getProductPrice"
14
- :fetch-detail="getProductPriceDetail"
15
- />
16
-
17
- 受控用法(外部已拉数):传 overview + loadDetail / detail
7
+ 推荐:业务侧挂 <FieldFloorPriceBoard scene="..." :request-payload="..." />
8
+ 高级:直接传 overviewPayload + fetchOverview / fetchDetail
9
+ 受控:外部已拉数时传 overview + loadDetail / detail
18
10
  -->
19
11
  <template>
20
12
  <div class="floor-price-dashboard">
@@ -1,40 +1,105 @@
1
1
  <!--
2
2
  底价看板对外入口(bizui 全局注册 FieldFloorPriceBoard)
3
- 通过 scene 选择域适配器;各域 props 互不混用,由对应 adapter 承接。
3
+
4
+ 请求体由业务侧组装后传入;本组件只按 scene 选接口 + 交给 Dashboard 拉数展示。
5
+
6
+ 用法:
7
+ <FieldFloorPriceBoard
8
+ scene="supplies"
9
+ :request-payload="payload"
10
+ :customer-name="name"
11
+ :show-detail-link="hasPerm"
12
+ />
4
13
  -->
5
14
  <template>
6
- <component :is="adapter" v-bind="$attrs" v-on="$listeners" />
15
+ <FloorPriceDashboard
16
+ :overview-payload="requestPayload"
17
+ :detail-payload="requestPayload"
18
+ :customer-name="customerName"
19
+ :fetch-overview="useMock ? null : sceneApi.fetchOverview"
20
+ :fetch-detail="useMock ? null : sceneApi.fetchDetail"
21
+ :use-demo="useMock"
22
+ :show-title="false"
23
+ :show-detail-link="showDetailLink"
24
+ :empty-text="resolvedEmptyText"
25
+ />
7
26
  </template>
8
27
 
9
28
  <script>
10
- import SuppliesAdapter from './adapters/SuppliesAdapter.vue'
11
- import MeetingAdapter from './adapters/MeetingAdapter.vue'
12
- import ApplyCenterAdapter from './adapters/ApplyCenterAdapter.vue'
29
+ import FloorPriceDashboard from './core/FloorPriceDashboard.vue'
30
+ import { getProductPrice, getProductPriceDetail } from '../../api/mms'
31
+ import { getLizhenBasePriceOverview, getLizhenBasePriceDetail } from '../../api/applycenter'
13
32
 
14
- const ADAPTERS = {
15
- supplies: SuppliesAdapter,
16
- meeting: MeetingAdapter,
17
- applyCenter: ApplyCenterAdapter
33
+ /** scene → 底价接口;payload 组装在业务系统 */
34
+ const SCENE_API = {
35
+ supplies: {
36
+ fetchOverview: getProductPrice,
37
+ fetchDetail: getProductPriceDetail,
38
+ emptyText: '请选择客户后查看底价'
39
+ },
40
+ meeting: {
41
+ fetchOverview: getProductPrice,
42
+ fetchDetail: getProductPriceDetail,
43
+ emptyText: '请选择客户后查看底价'
44
+ },
45
+ applyCenter: {
46
+ fetchOverview: getLizhenBasePriceOverview,
47
+ fetchDetail: getLizhenBasePriceDetail,
48
+ emptyText: '请选择合作机构后查看底价'
49
+ }
18
50
  }
51
+ SCENE_API.apply = SCENE_API.applyCenter
19
52
 
20
53
  export default {
21
54
  name: 'FieldFloorPriceBoard',
22
- inheritAttrs: false,
55
+ components: {
56
+ FloorPriceDashboard
57
+ },
23
58
  props: {
24
59
  /**
25
- * 业务域:supplies | meeting | applyCenter
60
+ * 业务域:supplies | meeting | applyCenter(apply 同 applyCenter)
26
61
  */
27
62
  scene: {
28
63
  type: String,
29
64
  required: true,
30
65
  validator(v) {
31
- return Object.prototype.hasOwnProperty.call(ADAPTERS, v)
66
+ return Object.prototype.hasOwnProperty.call(SCENE_API, v)
32
67
  }
68
+ },
69
+ /**
70
+ * 业务侧组装好的请求体;null 表示不发请求
71
+ * 物资/会议:对齐 getProductPrice;申请中心:对齐丽臻底价文档
72
+ */
73
+ requestPayload: {
74
+ type: Object,
75
+ default: null
76
+ },
77
+ /** 看板展示用客户名 */
78
+ customerName: {
79
+ type: String,
80
+ default: ''
81
+ },
82
+ showDetailLink: {
83
+ type: Boolean,
84
+ default: true
85
+ },
86
+ /** true 时不调接口,Dashboard 走 mock */
87
+ useMock: {
88
+ type: Boolean,
89
+ default: false
90
+ },
91
+ /** 空态文案;不传则按 scene 默认 */
92
+ emptyText: {
93
+ type: String,
94
+ default: ''
33
95
  }
34
96
  },
35
97
  computed: {
36
- adapter() {
37
- return ADAPTERS[this.scene]
98
+ sceneApi() {
99
+ return SCENE_API[this.scene]
100
+ },
101
+ resolvedEmptyText() {
102
+ return this.emptyText || this.sceneApi.emptyText
38
103
  }
39
104
  }
40
105
  }