@bytenew/bn-bus-ui 1.1.463 → 1.1.464

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.
Files changed (167) hide show
  1. package/dist/assocTableSearch-Bfe96864.js +349 -0
  2. package/dist/assocTableSearch.css +1 -0
  3. package/dist/bn-bus-ui.es.js +65 -0
  4. package/dist/bn-bus-ui.umd.js +49 -0
  5. package/dist/chooseIPaasData-COrrvQKZ.js +391 -0
  6. package/dist/chooseIPaasData.css +1 -0
  7. package/dist/defaultSet-CzN1ec_d.js +297 -0
  8. package/dist/defaultSet.css +1 -0
  9. package/dist/fileFormData-D_Q1vylE.js +53 -0
  10. package/dist/formItemFooter-BvptZj_u.js +108 -0
  11. package/dist/formItemFooter.css +1 -0
  12. package/dist/funcExprDialog-BguNs9fl.js +139 -0
  13. package/dist/funcExprDialog.css +1 -0
  14. package/dist/index-0oB7QocU.js +44 -0
  15. package/dist/index-69fRP0M8.js +89 -0
  16. package/dist/index-BdklTJtF.js +66 -0
  17. package/dist/index-Bu3jHlby.js +45 -0
  18. package/dist/index-BxWx5kpG.js +89 -0
  19. package/dist/index-C5LQ0OSs.js +183 -0
  20. package/dist/index-C8YhrrUN.js +51 -0
  21. package/dist/index-COuPCIzB.js +45 -0
  22. package/dist/index-CSvVyjxx.js +178 -0
  23. package/dist/index-DCv51EXX.js +109 -0
  24. package/dist/index-DUSI6MuC.js +135 -0
  25. package/dist/index-DVzxs2vR.js +58 -0
  26. package/dist/index-Dd4b8zNb.js +746 -0
  27. package/dist/index-Md-ZlkCW.js +66 -0
  28. package/dist/index-hsSIY2FP.js +221 -0
  29. package/dist/index-n13-H3_Y.js +118 -0
  30. package/dist/index-wUl5aPUD.js +64 -0
  31. package/dist/index.css +1 -0
  32. package/dist/index2.css +1 -0
  33. package/dist/index3.css +1 -0
  34. package/dist/index4.css +1 -0
  35. package/dist/index5.css +1 -0
  36. package/dist/index6.css +1 -0
  37. package/dist/index7.css +1 -0
  38. package/dist/install-CNjs0u5x.js +23299 -0
  39. package/dist/install.css +1 -0
  40. package/dist/setOption-CXOifQcx.js +329 -0
  41. package/dist/setOption.css +1 -0
  42. package/dist/setRelationOption-C7VDhej7.js +5217 -0
  43. package/dist/setRelationOption.css +1 -0
  44. package/package.json +4 -20
  45. package/install.js +0 -134
  46. package/packages/BnAddress/index.vue +0 -141
  47. package/packages/BnAddressParse/index.vue +0 -75
  48. package/packages/BnAdvancedFilter/BnFilterView.vue +0 -145
  49. package/packages/BnAdvancedFilter/index.vue +0 -345
  50. package/packages/BnAdvancedFilter/util.js +0 -171
  51. package/packages/BnCascader/BnCascader.vue +0 -543
  52. package/packages/BnCascader/BnCascaderPanel.vue +0 -1331
  53. package/packages/BnCascader/cascaderDisplay.js +0 -102
  54. package/packages/BnCheck/BnCheck.vue +0 -253
  55. package/packages/BnColumnConfig/columnConfigDialog.vue +0 -134
  56. package/packages/BnColumnConfig/component/childrenFormSetting/assocTable.vue +0 -143
  57. package/packages/BnColumnConfig/component/childrenFormSetting/assocTableSearch.vue +0 -314
  58. package/packages/BnColumnConfig/component/childrenFormSetting/index.vue +0 -243
  59. package/packages/BnColumnConfig/component/defaultSet/defaultSet.vue +0 -114
  60. package/packages/BnColumnConfig/component/defaultSet/stringDefault.vue +0 -210
  61. package/packages/BnColumnConfig/component/funcExprDialog/funcExprDialog.vue +0 -126
  62. package/packages/BnColumnConfig/component/packageFilter/index.vue +0 -141
  63. package/packages/BnColumnConfig/component/paraExplainSet/index.vue +0 -156
  64. package/packages/BnColumnConfig/component/setOption/setOption.vue +0 -321
  65. package/packages/BnColumnConfig/component/setRelationOption/ConditionList.vue +0 -277
  66. package/packages/BnColumnConfig/component/setRelationOption/LevelHeader.vue +0 -144
  67. package/packages/BnColumnConfig/component/setRelationOption/setRelationOption.vue +0 -642
  68. package/packages/BnColumnConfig/data.js +0 -129
  69. package/packages/BnColumnConfig/index.scss +0 -23
  70. package/packages/BnColumnConfig/index.vue +0 -309
  71. package/packages/BnCondVal/BnCondVal.vue +0 -112
  72. package/packages/BnCondVal/itemVal/dateRegVal.vue +0 -39
  73. package/packages/BnCondVal/itemVal/dateVal.vue +0 -39
  74. package/packages/BnCondVal/itemVal/numRegVal.vue +0 -67
  75. package/packages/BnCondVal/itemVal/numVal.vue +0 -44
  76. package/packages/BnCondVal/itemVal/relationVal.vue +0 -73
  77. package/packages/BnCondVal/itemVal/selectColumnVal.vue +0 -58
  78. package/packages/BnCondVal/itemVal/selectVal.vue +0 -59
  79. package/packages/BnCondVal/itemVal/stringVal.vue +0 -156
  80. package/packages/BnCondition/index.vue +0 -551
  81. package/packages/BnCondition/util.js +0 -232
  82. package/packages/BnDatePicker/BnDatePicker.vue +0 -194
  83. package/packages/BnDrop/BnDrop.vue +0 -917
  84. package/packages/BnEmptyTip/BnEmptyTip.vue +0 -107
  85. package/packages/BnExportOrder/BnExportOrder.vue +0 -241
  86. package/packages/BnExportOrder/validatorCode.vue +0 -94
  87. package/packages/BnFileView/BnFileView.vue +0 -271
  88. package/packages/BnFileView/FileDetail.vue +0 -125
  89. package/packages/BnFileView/videoPreview.vue +0 -70
  90. package/packages/BnFilterOption/BnFilterOption.vue +0 -160
  91. package/packages/BnFunExpr/BnFunExpr.vue +0 -608
  92. package/packages/BnImportOrder/BnImportOrder.vue +0 -323
  93. package/packages/BnImportTemplate/BnImportTemplate.vue +0 -866
  94. package/packages/BnImportTemplate/assets/merge_tip_img.png +0 -0
  95. package/packages/BnImportTemplate/assets/sheet_tip.png +0 -0
  96. package/packages/BnImportTemplate/assets/xls.png +0 -0
  97. package/packages/BnImportTemplate/components/ImportTemplateTrigger.vue +0 -198
  98. package/packages/BnImportTemplate/components/TemplateEditDialog.vue +0 -340
  99. package/packages/BnImportTemplate/components/TemplateFieldsConfig.vue +0 -401
  100. package/packages/BnImportTemplate/components/TemplateListDialog.vue +0 -297
  101. package/packages/BnInpNum/BnInpNum.vue +0 -165
  102. package/packages/BnMenus/BnMenus.vue +0 -502
  103. package/packages/BnMenus/MenuItem.vue +0 -321
  104. package/packages/BnOrderCard/BnOrderCard.vue +0 -389
  105. package/packages/BnOrderCard/orderRemark.vue +0 -178
  106. package/packages/BnOrderCard/util.js +0 -94
  107. package/packages/BnOrderDetail/BnOrderDetail.vue +0 -338
  108. package/packages/BnOrderDetail/filterLogByUser.vue +0 -108
  109. package/packages/BnOrderDetail/orderLogs.vue +0 -53
  110. package/packages/BnOrderDetail/showSubForm/index.vue +0 -41
  111. package/packages/BnOrderDetail/showSubForm/showChildTable.vue +0 -61
  112. package/packages/BnOrderDetail/showSubForm/showTimeLine.vue +0 -131
  113. package/packages/BnOrderDetail/showSubForm/tableCellCopy.vue +0 -84
  114. package/packages/BnOrderShare/index.vue +0 -378
  115. package/packages/BnOrderShare/shareUrlInp.vue +0 -54
  116. package/packages/BnRadio/BnRadio.vue +0 -181
  117. package/packages/BnRelation/BnRelation.vue +0 -120
  118. package/packages/BnSelect/BnSelect.vue +0 -485
  119. package/packages/BnSmartForm/BnBatchForm.vue +0 -334
  120. package/packages/BnSmartForm/BnBatchFormDialog.vue +0 -423
  121. package/packages/BnSmartForm/BnSmartElf/elfLog/index.vue +0 -57
  122. package/packages/BnSmartForm/BnSmartElf/index.vue +0 -95
  123. package/packages/BnSmartForm/BnSmartFormPsychic.js +0 -629
  124. package/packages/BnSmartForm/BnSmartFormUtil.js +0 -524
  125. package/packages/BnSmartForm/addressForm/index.vue +0 -73
  126. package/packages/BnSmartForm/checkboxForm/index.vue +0 -99
  127. package/packages/BnSmartForm/childrenForm/childFormFile.vue +0 -237
  128. package/packages/BnSmartForm/childrenForm/childrenFormBody.vue +0 -260
  129. package/packages/BnSmartForm/childrenForm/index.vue +0 -110
  130. package/packages/BnSmartForm/childrenForm/searchInventory.vue +0 -115
  131. package/packages/BnSmartForm/chooseAssocTable/chooseAssocTable.vue +0 -451
  132. package/packages/BnSmartForm/chooseAssocTable/chooseChildGood.vue +0 -229
  133. package/packages/BnSmartForm/chooseAssocTable/tableCellCopy.vue +0 -84
  134. package/packages/BnSmartForm/chooseChildOrder/chooseChildOrder.vue +0 -158
  135. package/packages/BnSmartForm/chooseIPaasData/chooseIPaasData.vue +0 -307
  136. package/packages/BnSmartForm/chooseIPaasData/tableCellCopy.vue +0 -84
  137. package/packages/BnSmartForm/choosePackage/choosePackage.vue +0 -361
  138. package/packages/BnSmartForm/dateDualForm/index.vue +0 -37
  139. package/packages/BnSmartForm/dateForm/index.vue +0 -38
  140. package/packages/BnSmartForm/fileForm/fileFormData.js +0 -50
  141. package/packages/BnSmartForm/fileForm/index.vue +0 -240
  142. package/packages/BnSmartForm/formItemFooter/formItemFooter.vue +0 -38
  143. package/packages/BnSmartForm/formItemTop/formItemTop.vue +0 -42
  144. package/packages/BnSmartForm/index.vue +0 -1201
  145. package/packages/BnSmartForm/numberForm/index.vue +0 -63
  146. package/packages/BnSmartForm/radioForm/index.vue +0 -72
  147. package/packages/BnSmartForm/receiveForm/index.vue +0 -112
  148. package/packages/BnSmartForm/relationForm/index.vue +0 -82
  149. package/packages/BnSmartForm/scoreForm/index.vue +0 -39
  150. package/packages/BnSmartForm/selectForm/index.vue +0 -55
  151. package/packages/BnSmartForm/showValForm/index.vue +0 -42
  152. package/packages/BnSmartForm/showValForm/showValFormTable.vue +0 -104
  153. package/packages/BnSmartForm/smartFormsCommon.scss +0 -43
  154. package/packages/BnSmartForm/stringForm/index.vue +0 -170
  155. package/packages/BnVirtPopover/index.vue +0 -319
  156. package/packages/BnWebLog/BnWebLog.vue +0 -140
  157. package/packages/BnWorkSettingDrop/advancedOptions.js +0 -112
  158. package/packages/BnWorkSettingDrop/benBenAIUtil.js +0 -89
  159. package/packages/BnWorkSettingDrop/index.vue +0 -292
  160. package/packages/font/iconfont.css +0 -243
  161. package/packages/font/iconfont.ttf +0 -0
  162. package/packages/font/iconfont.woff +0 -0
  163. package/packages/font/iconfont.woff2 +0 -0
  164. package/utils/addressParse-old.js +0 -645
  165. package/utils/addressParse.js +0 -735
  166. package/utils/config.js +0 -68
  167. package/utils/index.js +0 -1171
@@ -1,112 +0,0 @@
1
- /**
2
- * 工单高级设置项配置
3
- *
4
- * 与开放平台 editBusTable.advancedOptions 及接口返回的 tableInfo.advanced 字段对应。
5
- *
6
- * 后台配置 -> 接口 advanced 字段映射:
7
- * | 后台 advancedOptions.type | tableInfo.advanced 字段 | 说明 |
8
- * |--------------------------|-------------------------------|-------------------------------|
9
- * | orderRemark | automaticRemark.enable | 订单备注 |
10
- * | notice | notice.enable | 消息通知 |
11
- * | tb/jxz/flyPigeon/... | buyerNotice.enable + platforms| 买家通知(前端合并为一项) |
12
- * | autoDistribute | autoDistribute.enable | 自动分配 |
13
- * | columnPsychic | columnPsychic.enable | 组件显隐 |
14
- * | submitCheck | submitCheck.enable | 提交校验 |
15
- * | shareConfig | shareConfig.enable | 分享配置 |
16
- * | benBenAIOrder | benBenAIOrder.enable | 犇犇AI建单 |
17
- * | dataSynchronization | dataSynchronization.enable | 数据同步 |
18
- */
19
-
20
- /** 买家通知支持的平台类型,对应 buyerNotice.platforms 数组元素 */
21
- export const BUYER_NOTICE_PLATFORMS = ['tb', 'jxz', 'flyPigeon', 'jdPop', 'jdSelf', 'pdd', 'ks'];
22
-
23
- /**
24
- * 高级设置菜单项完整配置
25
- *
26
- * @typedef {Object} AdvancedSettingOption
27
- * @property {string} type - 设置项唯一标识,也作为 iframe 路由 type(除非指定 routeType)
28
- * @property {string} title - 下拉菜单展示文案
29
- * @property {string} icon - bnUIcon 图标类名
30
- * @property {string} advancedKey - 对应 tableInfo.advanced 下的字段名,通过 enable 控制显隐
31
- * @property {string} [routeType] - iframe 路由 type,当与 type 不一致时使用(如数据同步)
32
- * @property {string} [iconClass] - 图标附加样式类
33
- */
34
- export const ADVANCED_SETTING_OPTIONS = [
35
- {
36
- type: 'benBenAIOrder',
37
- title: '犇犇AI建单',
38
- icon: 'bnUIcon-benAi',
39
- advancedKey: 'benBenAIOrder',
40
- iconClass: 'w-color-red w-font-weight600 w-font17',
41
- },
42
- {
43
- type: 'buyerNotice',
44
- title: '买家通知',
45
- icon: 'bnUIcon-bell',
46
- advancedKey: 'buyerNotice',
47
- iconClass: 'w-color-orange',
48
- },
49
- {
50
- type: 'notice',
51
- title: '消息通知',
52
- icon: 'bnUIcon-message',
53
- advancedKey: 'notice',
54
- iconClass: 'w-color-orange',
55
- },
56
- {
57
- type: 'automaticRemark',
58
- title: '订单备注',
59
- icon: 'bnUIcon-remarks',
60
- advancedKey: 'automaticRemark',
61
- iconClass: 'w-color-orange',
62
- },
63
- {
64
- type: 'autoDistribute',
65
- title: '自动分配',
66
- icon: 'bnUIcon-robot',
67
- advancedKey: 'autoDistribute',
68
- iconClass: 'w-color-orange',
69
- },
70
- {
71
- type: 'columnPsychic',
72
- title: '组件显隐',
73
- icon: 'bnUIcon-psychic',
74
- advancedKey: 'columnPsychic',
75
- iconClass: 'w-color-orange w-font17',
76
- },
77
- {
78
- type: 'submitCheck',
79
- title: '提交校验',
80
- icon: 'bnUIcon-submitCheck',
81
- advancedKey: 'submitCheck',
82
- iconClass: 'w-color-orange w-font17',
83
- },
84
- {
85
- type: 'shareConfig',
86
- title: '分享配置',
87
- icon: 'bnUIcon-share',
88
- advancedKey: 'shareConfig',
89
- iconClass: 'w-color-orange',
90
- },
91
- {
92
- type: 'dataSynchronization',
93
- title: '数据同步',
94
- icon: 'bnUIcon-linkage',
95
- advancedKey: 'dataSynchronization',
96
- // 后台字段为 dataSynchronization,iframe 路由为 simpleDataSynchronization
97
- routeType: 'simpleDataSynchronization',
98
- iconClass: 'w-color-orange',
99
- },
100
- ];
101
-
102
- /**
103
- * 根据 tableInfo.advanced 获取当前表可见的高级设置菜单项
104
- * @param {Object} advanced - tableInfo.advanced 对象
105
- * @returns {AdvancedSettingOption[]}
106
- */
107
- export function getVisibleAdvancedOptions(advanced) {
108
- if (!advanced) return [];
109
- return ADVANCED_SETTING_OPTIONS.filter(
110
- (option) => advanced[option.advancedKey]?.enable === true,
111
- );
112
- }
@@ -1,89 +0,0 @@
1
- /**
2
- * 犇犇AI建单 & 普通高级设置 iframe URL 构建工具
3
- *
4
- * 普通设置页走 app.html#/simpleOrderFun/{appId}/{tableId}/{type}
5
- * 犇犇AI建单走 agent.html#/settingCenter/aiCreateOrder/{tabName}
6
- */
7
-
8
- /** 犇犇AI建单全屏面板 Tab 配置 */
9
- export const BENBEN_AI_TABS = [
10
- { label: '建单配置', name: 'editConfig' },
11
- { label: '数据分析', name: 'dataAnalyze' },
12
- { label: '调优中心', name: 'tuningCenter' },
13
- ];
14
-
15
- /**
16
- * 各 Tab 对应的 defaultGetBaseUrl 入参 type
17
- * dataAnalyze 使用 agent 域名但路由不同,type 传 undefined 走默认 agent 逻辑
18
- */
19
- export const SETTING_TAB_BASE_TYPE = {
20
- editConfig: 'benBenAIOrder',
21
- dataAnalyze: undefined,
22
- tuningCenter: 'benBenAIOrder',
23
- };
24
-
25
- /**
26
- * 根据当前环境和设置项类型,获取 iframe 基础 URL
27
- *
28
- * 本地开发:
29
- * - benBenAIOrder -> http://localhost:5177(agent 项目)
30
- * - 其他 -> http://localhost:8088(app 项目)
31
- * 生产环境:
32
- * - benBenAIOrder -> /agent.html
33
- * - 其他 -> /app.html
34
- *
35
- * @param {string} type - 设置项 type,如 benBenAIOrder、buyerNotice
36
- * @param {string} baseUrl - 普通设置默认基础路径,默认 /app.html
37
- * @returns {string}
38
- */
39
- export function defaultGetBaseUrl(type, baseUrl = '/app.html') {
40
- const host = window.location.host;
41
- if (host.includes('localhost')) {
42
- return type === 'benBenAIOrder' ? 'http://localhost:5177' : 'http://localhost:8088';
43
- }
44
- return type === 'benBenAIOrder' ? '/agent.html' : baseUrl;
45
- }
46
-
47
- /**
48
- * 将基础 URL 补全为带 .html 的路径
49
- * @param {string} base - 如 http://localhost:8088 或 /app.html
50
- * @param {string} fallback - 缺省 html 文件名,如 app.html
51
- */
52
- function resolveHtmlBase(base, fallback) {
53
- if (base.endsWith('.html')) return base;
54
- if (base.startsWith('http')) return `${base}/${fallback}`;
55
- return `/${fallback}`;
56
- }
57
-
58
- /**
59
- * 构建普通高级设置 iframe 地址
60
- * 示例:/app.html#/simpleOrderFun/50802/1744458/buyerNotice?tableCode=anw_install
61
- *
62
- * @param {string} base - defaultGetBaseUrl 返回值
63
- * @param {Object} tableInfo - 含 appId、tableId、tableCode
64
- * @param {string} type - iframe 路由 type
65
- */
66
- export function buildSimpleOrderFunUrl(base, tableInfo, type) {
67
- const { appId, tableId, tableCode } = tableInfo;
68
- const prefix = resolveHtmlBase(base, 'app.html');
69
- return `${prefix}#/simpleOrderFun/${appId}/${tableId}/${type}?tableCode=${tableCode}`;
70
- }
71
-
72
- /**
73
- * 构建犇犇AI建单配置页 iframe 地址
74
- * 示例:/agent.html#/settingCenter/aiCreateOrder/editConfig?tableId=...&full=true&tableMode=true
75
- */
76
- export function buildBenBenSettingUrl(base, tableInfo, tabName) {
77
- const { appId, tableId, tableCode, name } = tableInfo;
78
- const prefix = base.endsWith('.html') || base.startsWith('http') ? base : '/agent.html';
79
- return `${prefix}#/settingCenter/aiCreateOrder/${tabName}?tableId=${tableId}&appId=${appId}&tableCode=${tableCode}&tableName=${encodeURIComponent(name || '')}&full=true&tableMode=true`;
80
- }
81
-
82
- /**
83
- * 构建犇犇AI建单「数据分析」Tab iframe 地址
84
- * 示例:/agent.html#/simpleBrain/268625922244?tableId=...&tableName=...
85
- */
86
- export function buildBenBenAnalyzeUrl(base, tableInfo, brainId) {
87
- const prefix = base.endsWith('.html') || base.startsWith('http') ? base : '/agent.html';
88
- return `${prefix}#/simpleBrain/${brainId}?tableId=${tableInfo.tableId}&tableName=${encodeURIComponent(tableInfo.name || '')}`;
89
- }
@@ -1,292 +0,0 @@
1
- <template>
2
- <div class="BnWorkSettingDrop">
3
- <!-- 有可用高级设置项时展示下拉菜单 -->
4
- <el-dropdown v-if="visibleOptions.length" trigger="click">
5
- <div class="BnWorkSettingDrop-title w-flex-center w-cursor-pointer">
6
- <slot>{{ tableInfo.name }}</slot>
7
- <span class="bnUIcon bnUIcon-setting w-margin-left3 w-color-gray"></span>
8
- </div>
9
- <template #dropdown>
10
- <el-dropdown-menu>
11
- <el-dropdown-item
12
- v-for="item in visibleOptions"
13
- :key="item.type"
14
- @click="openSetting(item.type)"
15
- >
16
- <span
17
- :class="['bnUIcon', item.icon, 'w-margin-right5', item.iconClass]"
18
- ></span>{{ item.title }}
19
- </el-dropdown-item>
20
- </el-dropdown-menu>
21
- </template>
22
- </el-dropdown>
23
- <!-- 无可用设置项时仅展示表名 -->
24
- <div v-else class="BnWorkSettingDrop-title w-flex-center">
25
- <slot>{{ tableInfo.name }}</slot>
26
- </div>
27
-
28
- <!-- 全屏设置面板:普通项走 simpleOrderFun 路由,犇犇AI建单走 agent 独立页 -->
29
- <div class="BnWorkSettingDrop-panel" v-if="show">
30
- <div class="BnWorkSettingDrop-panel-header">
31
- <div class="BnWorkSettingDrop-panel-header-left">
32
- <el-page-header :icon="ArrowLeft" @back="closeSetting">
33
- <template #content>
34
- <span class="text-large font-600 mr-3">{{ tableInfo.name }}</span>
35
- </template>
36
- </el-page-header>
37
- <!-- 犇犇AI建单专属 Tab:建单配置 / 数据分析 / 调优中心 -->
38
- <el-tabs
39
- v-if="isBenBenAIOrder"
40
- v-model="activeTab"
41
- class="BnWorkSettingDrop-tabs"
42
- @tab-change="handleBenBenTabChange"
43
- >
44
- <el-tab-pane
45
- v-for="tab in benBenTabs"
46
- :key="tab.name"
47
- :label="tab.label"
48
- :name="tab.name"
49
- />
50
- </el-tabs>
51
- </div>
52
- <!-- 建单配置 Tab 下的 AI 建单开关,需 postFunc 拉取配置后才展示 -->
53
- <el-switch
54
- v-if="isBenBenAIOrder && activeTab === 'editConfig' && isShowSwitch"
55
- v-model="optStatus"
56
- :active-value="1"
57
- :inactive-value="0"
58
- @change="handleBenBenAIOrderChange"
59
- />
60
- </div>
61
- <iframe
62
- class="BnWorkSettingDrop-panel-main"
63
- ref="iframe"
64
- allow="clipboard-write"
65
- :key="url"
66
- sandbox="allow-scripts allow-same-origin allow-downloads allow-forms allow-popups allow-top-navigation allow-pointer-lock allow-modals allow-presentation allow-popups-to-escape-sandbox allow-orientation-lock allow-top-navigation-by-user-activation"
67
- :src="url"
68
- ></iframe>
69
- </div>
70
- </div>
71
- </template>
72
-
73
- <script>
74
- /**
75
- * 工单高级设置下拉菜单 + 全屏 iframe 配置面板
76
- *
77
- * 使用方式:
78
- * <BnWorkSettingDrop :tableInfo="tableInfo" :postFunc="post" @close="queryTableInfo" />
79
- *
80
- * tableInfo 需包含:name、appId、tableId、tableCode、advanced
81
- * advanced 各字段 enable 控制菜单项显隐,配置来源见 advancedOptions.js
82
- */
83
- import { ArrowLeft } from '@element-plus/icons-vue';
84
- import { getVisibleAdvancedOptions, ADVANCED_SETTING_OPTIONS } from './advancedOptions.js';
85
- import {
86
- BENBEN_AI_TABS,
87
- SETTING_TAB_BASE_TYPE,
88
- defaultGetBaseUrl,
89
- buildSimpleOrderFunUrl,
90
- buildBenBenSettingUrl,
91
- buildBenBenAnalyzeUrl,
92
- } from './benBenAIUtil.js';
93
-
94
- /** 犇犇AI建单「数据分析」Tab 默认大脑 ID,可被 advanced.benBenAIOrder.brainId 覆盖 */
95
- const DEFAULT_BRAIN_ID = '268625922244';
96
-
97
- export default {
98
- name: 'BnWorkSettingDrop',
99
- props: {
100
- /** 表完整信息,至少含 name、appId、tableId、tableCode、advanced */
101
- tableInfo: {
102
- type: Object,
103
- default: () => ({}),
104
- },
105
- /** 项目统一请求方法,用于犇犇AI建单开关的 get / edit 接口 */
106
- postFunc: {
107
- type: Function,
108
- default: null,
109
- },
110
- },
111
- emits: ['close'],
112
- data() {
113
- return {
114
- ArrowLeft,
115
- /** 是否展示全屏设置面板 */
116
- show: false,
117
- /** 当前 iframe 地址 */
118
- url: '',
119
- /** 当前 iframe 基础域名(app.html 或 agent.html) */
120
- localUrl: '',
121
- /** 当前是否为犇犇AI建单模式(决定 header 是否展示 Tab 和开关) */
122
- isBenBenAIOrder: false,
123
- /** 犇犇AI建单当前 Tab */
124
- activeTab: 'editConfig',
125
- benBenTabs: BENBEN_AI_TABS,
126
- /** AI 建单开关状态:0 关闭 / 1 开启 */
127
- optStatus: 0,
128
- /** 是否展示 AI 建单开关(接口返回有效配置后才为 true) */
129
- isShowSwitch: false,
130
- /** 犇犇AI建单配置缓存,含 id、open_status 等 */
131
- benbenAIOrderConfig: {},
132
- };
133
- },
134
- computed: {
135
- /** 根据 tableInfo.advanced 各 enable 字段过滤出可见菜单项 */
136
- visibleOptions() {
137
- return getVisibleAdvancedOptions(this.tableInfo?.advanced);
138
- },
139
- /** 数据分析 Tab 使用的大脑 ID */
140
- brainId() {
141
- return this.tableInfo?.advanced?.benBenAIOrder?.brainId || DEFAULT_BRAIN_ID;
142
- },
143
- },
144
- methods: {
145
- /**
146
- * 打开指定高级设置项
147
- * @param {string} type 设置项类型,如 buyerNotice、benBenAIOrder,见 advancedOptions.js
148
- */
149
- openSetting(type) {
150
- const option = ADVANCED_SETTING_OPTIONS.find((item) => item.type === type);
151
- // routeType 用于 advanced 字段名与 iframe 路由不一致的场景,如 dataSynchronization -> simpleDataSynchronization
152
- const routeType = option?.routeType || type;
153
- this.localUrl = defaultGetBaseUrl(type);
154
- if (type === 'benBenAIOrder') {
155
- this.isBenBenAIOrder = true;
156
- this.activeTab = 'editConfig';
157
- this.url = buildBenBenSettingUrl(this.localUrl, this.tableInfo, 'editConfig');
158
- this.loadBenBenAIOrderConfig();
159
- } else {
160
- this.isBenBenAIOrder = false;
161
- this.url = buildSimpleOrderFunUrl(this.localUrl, this.tableInfo, routeType);
162
- }
163
- this.$nextTick(() => {
164
- this.show = true;
165
- });
166
- },
167
- /** 供外部 ref 编程式调用,如 $refs.setting.open('notice') */
168
- open(type) {
169
- this.openSetting(type);
170
- },
171
- /** 犇犇AI建单 Tab 切换,各 Tab 对应不同 iframe 地址 */
172
- handleBenBenTabChange(tabName) {
173
- if (!this.isBenBenAIOrder) return;
174
-
175
- this.localUrl = defaultGetBaseUrl(SETTING_TAB_BASE_TYPE[tabName]);
176
- if (tabName === 'dataAnalyze') {
177
- this.url = buildBenBenAnalyzeUrl(this.localUrl, this.tableInfo, this.brainId);
178
- } else {
179
- if (tabName === 'editConfig') {
180
- this.loadBenBenAIOrderConfig();
181
- }
182
- this.url = buildBenBenSettingUrl(this.localUrl, this.tableInfo, tabName);
183
- }
184
- },
185
- /** 获取犇犇AI建单配置,决定是否展示开关及当前开关状态 */
186
- loadBenBenAIOrderConfig() {
187
- if (!this.postFunc) {
188
- this.benbenAIOrderConfig = {};
189
- this.isShowSwitch = false;
190
- this.optStatus = 0;
191
- return;
192
- }
193
- this.postFunc('/agent/config/table/get', { table_id: this.tableInfo.tableId })
194
- .then((res) => {
195
- if (res?.code === 0 && res.data) {
196
- this.benbenAIOrderConfig = res.data;
197
- this.optStatus = res.data.open_status;
198
- this.isShowSwitch = true;
199
- } else {
200
- this.benbenAIOrderConfig = {};
201
- this.isShowSwitch = false;
202
- this.optStatus = 0;
203
- }
204
- })
205
- .catch(() => {
206
- this.benbenAIOrderConfig = {};
207
- this.isShowSwitch = false;
208
- this.optStatus = 0;
209
- });
210
- },
211
- /** 切换犇犇AI建单开关,失败时回滚 optStatus */
212
- handleBenBenAIOrderChange() {
213
- if (!this.postFunc) return;
214
- this.postFunc('/agent/config/table/edit_open_status', {
215
- id: this.benbenAIOrderConfig.id,
216
- open_status: this.optStatus,
217
- }).then((res) => {
218
- if (res?.code !== 0) {
219
- this.optStatus = this.optStatus === 1 ? 0 : 1;
220
- }
221
- }).catch(() => {
222
- this.optStatus = this.optStatus === 1 ? 0 : 1;
223
- });
224
- },
225
- /** 关闭全屏面板并重置状态,触发 close 事件供父组件刷新 tableInfo */
226
- closeSetting() {
227
- this.show = false;
228
- this.url = '';
229
- this.localUrl = '';
230
- this.isBenBenAIOrder = false;
231
- this.activeTab = 'editConfig';
232
- this.isShowSwitch = false;
233
- this.optStatus = 0;
234
- this.benbenAIOrderConfig = {};
235
- this.$emit('close');
236
- },
237
- },
238
- };
239
- </script>
240
-
241
- <style scoped lang="scss">
242
- .BnWorkSettingDrop {
243
- &-title {
244
- margin-bottom: 16px;
245
- padding-right: 20px;
246
- font-size: 16px;
247
- font-weight: 500;
248
- }
249
-
250
- &-panel {
251
- position: fixed;
252
- left: 0;
253
- right: 0;
254
- top: 0;
255
- bottom: 0;
256
- overflow: auto;
257
- z-index: 100;
258
- background: #fff;
259
-
260
- &-header {
261
- height: 42px;
262
- padding: 0 20px;
263
- display: flex;
264
- align-items: center;
265
- justify-content: space-between;
266
- border-bottom: 1px solid #e5e5e5;
267
-
268
- &-left {
269
- display: flex;
270
- align-items: center;
271
- min-width: 0;
272
- }
273
- }
274
-
275
- &-main {
276
- width: 100%;
277
- height: calc(100% - 47px);
278
- border: none;
279
- }
280
- }
281
-
282
- &-tabs {
283
- :deep(.el-tabs__header) {
284
- margin-bottom: 0;
285
- }
286
-
287
- :deep(.el-tabs__nav-wrap::after) {
288
- display: none;
289
- }
290
- }
291
- }
292
- </style>