@bytenew/bn-bus-ui 1.1.462 → 1.1.463
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.
- package/install.js +134 -0
- package/package.json +20 -4
- package/packages/BnAddress/index.vue +141 -0
- package/packages/BnAddressParse/index.vue +75 -0
- package/packages/BnAdvancedFilter/BnFilterView.vue +145 -0
- package/packages/BnAdvancedFilter/index.vue +345 -0
- package/packages/BnAdvancedFilter/util.js +171 -0
- package/packages/BnCascader/BnCascader.vue +543 -0
- package/packages/BnCascader/BnCascaderPanel.vue +1331 -0
- package/packages/BnCascader/cascaderDisplay.js +102 -0
- package/packages/BnCheck/BnCheck.vue +253 -0
- package/packages/BnColumnConfig/columnConfigDialog.vue +134 -0
- package/packages/BnColumnConfig/component/childrenFormSetting/assocTable.vue +143 -0
- package/packages/BnColumnConfig/component/childrenFormSetting/assocTableSearch.vue +314 -0
- package/packages/BnColumnConfig/component/childrenFormSetting/index.vue +243 -0
- package/packages/BnColumnConfig/component/defaultSet/defaultSet.vue +114 -0
- package/packages/BnColumnConfig/component/defaultSet/stringDefault.vue +210 -0
- package/packages/BnColumnConfig/component/funcExprDialog/funcExprDialog.vue +126 -0
- package/packages/BnColumnConfig/component/packageFilter/index.vue +141 -0
- package/packages/BnColumnConfig/component/paraExplainSet/index.vue +156 -0
- package/packages/BnColumnConfig/component/setOption/setOption.vue +321 -0
- package/packages/BnColumnConfig/component/setRelationOption/ConditionList.vue +277 -0
- package/packages/BnColumnConfig/component/setRelationOption/LevelHeader.vue +144 -0
- package/packages/BnColumnConfig/component/setRelationOption/setRelationOption.vue +642 -0
- package/packages/BnColumnConfig/data.js +129 -0
- package/packages/BnColumnConfig/index.scss +23 -0
- package/packages/BnColumnConfig/index.vue +309 -0
- package/packages/BnCondVal/BnCondVal.vue +112 -0
- package/packages/BnCondVal/itemVal/dateRegVal.vue +39 -0
- package/packages/BnCondVal/itemVal/dateVal.vue +39 -0
- package/packages/BnCondVal/itemVal/numRegVal.vue +67 -0
- package/packages/BnCondVal/itemVal/numVal.vue +44 -0
- package/packages/BnCondVal/itemVal/relationVal.vue +73 -0
- package/packages/BnCondVal/itemVal/selectColumnVal.vue +58 -0
- package/packages/BnCondVal/itemVal/selectVal.vue +59 -0
- package/packages/BnCondVal/itemVal/stringVal.vue +156 -0
- package/packages/BnCondition/index.vue +551 -0
- package/packages/BnCondition/util.js +232 -0
- package/packages/BnDatePicker/BnDatePicker.vue +194 -0
- package/packages/BnDrop/BnDrop.vue +917 -0
- package/packages/BnEmptyTip/BnEmptyTip.vue +107 -0
- package/packages/BnExportOrder/BnExportOrder.vue +241 -0
- package/packages/BnExportOrder/validatorCode.vue +94 -0
- package/packages/BnFileView/BnFileView.vue +271 -0
- package/packages/BnFileView/FileDetail.vue +125 -0
- package/packages/BnFileView/videoPreview.vue +70 -0
- package/packages/BnFilterOption/BnFilterOption.vue +160 -0
- package/packages/BnFunExpr/BnFunExpr.vue +608 -0
- package/packages/BnImportOrder/BnImportOrder.vue +323 -0
- package/packages/BnImportTemplate/BnImportTemplate.vue +866 -0
- package/packages/BnImportTemplate/assets/merge_tip_img.png +0 -0
- package/packages/BnImportTemplate/assets/sheet_tip.png +0 -0
- package/packages/BnImportTemplate/assets/xls.png +0 -0
- package/packages/BnImportTemplate/components/ImportTemplateTrigger.vue +198 -0
- package/packages/BnImportTemplate/components/TemplateEditDialog.vue +340 -0
- package/packages/BnImportTemplate/components/TemplateFieldsConfig.vue +401 -0
- package/packages/BnImportTemplate/components/TemplateListDialog.vue +297 -0
- package/packages/BnInpNum/BnInpNum.vue +165 -0
- package/packages/BnMenus/BnMenus.vue +502 -0
- package/packages/BnMenus/MenuItem.vue +321 -0
- package/packages/BnOrderCard/BnOrderCard.vue +389 -0
- package/packages/BnOrderCard/orderRemark.vue +178 -0
- package/packages/BnOrderCard/util.js +94 -0
- package/packages/BnOrderDetail/BnOrderDetail.vue +338 -0
- package/packages/BnOrderDetail/filterLogByUser.vue +108 -0
- package/packages/BnOrderDetail/orderLogs.vue +53 -0
- package/packages/BnOrderDetail/showSubForm/index.vue +41 -0
- package/packages/BnOrderDetail/showSubForm/showChildTable.vue +61 -0
- package/packages/BnOrderDetail/showSubForm/showTimeLine.vue +131 -0
- package/packages/BnOrderDetail/showSubForm/tableCellCopy.vue +84 -0
- package/packages/BnOrderShare/index.vue +378 -0
- package/packages/BnOrderShare/shareUrlInp.vue +54 -0
- package/packages/BnRadio/BnRadio.vue +181 -0
- package/packages/BnRelation/BnRelation.vue +120 -0
- package/packages/BnSelect/BnSelect.vue +485 -0
- package/packages/BnSmartForm/BnBatchForm.vue +334 -0
- package/packages/BnSmartForm/BnBatchFormDialog.vue +423 -0
- package/packages/BnSmartForm/BnSmartElf/elfLog/index.vue +57 -0
- package/packages/BnSmartForm/BnSmartElf/index.vue +95 -0
- package/packages/BnSmartForm/BnSmartFormPsychic.js +629 -0
- package/packages/BnSmartForm/BnSmartFormUtil.js +524 -0
- package/packages/BnSmartForm/addressForm/index.vue +73 -0
- package/packages/BnSmartForm/checkboxForm/index.vue +99 -0
- package/packages/BnSmartForm/childrenForm/childFormFile.vue +237 -0
- package/packages/BnSmartForm/childrenForm/childrenFormBody.vue +260 -0
- package/packages/BnSmartForm/childrenForm/index.vue +110 -0
- package/packages/BnSmartForm/childrenForm/searchInventory.vue +115 -0
- package/packages/BnSmartForm/chooseAssocTable/chooseAssocTable.vue +451 -0
- package/packages/BnSmartForm/chooseAssocTable/chooseChildGood.vue +229 -0
- package/packages/BnSmartForm/chooseAssocTable/tableCellCopy.vue +84 -0
- package/packages/BnSmartForm/chooseChildOrder/chooseChildOrder.vue +158 -0
- package/packages/BnSmartForm/chooseIPaasData/chooseIPaasData.vue +307 -0
- package/packages/BnSmartForm/chooseIPaasData/tableCellCopy.vue +84 -0
- package/packages/BnSmartForm/choosePackage/choosePackage.vue +361 -0
- package/packages/BnSmartForm/dateDualForm/index.vue +37 -0
- package/packages/BnSmartForm/dateForm/index.vue +38 -0
- package/packages/BnSmartForm/fileForm/fileFormData.js +50 -0
- package/packages/BnSmartForm/fileForm/index.vue +240 -0
- package/packages/BnSmartForm/formItemFooter/formItemFooter.vue +38 -0
- package/packages/BnSmartForm/formItemTop/formItemTop.vue +42 -0
- package/packages/BnSmartForm/index.vue +1201 -0
- package/packages/BnSmartForm/numberForm/index.vue +63 -0
- package/packages/BnSmartForm/radioForm/index.vue +72 -0
- package/packages/BnSmartForm/receiveForm/index.vue +112 -0
- package/packages/BnSmartForm/relationForm/index.vue +82 -0
- package/packages/BnSmartForm/scoreForm/index.vue +39 -0
- package/packages/BnSmartForm/selectForm/index.vue +55 -0
- package/packages/BnSmartForm/showValForm/index.vue +42 -0
- package/packages/BnSmartForm/showValForm/showValFormTable.vue +104 -0
- package/packages/BnSmartForm/smartFormsCommon.scss +43 -0
- package/packages/BnSmartForm/stringForm/index.vue +170 -0
- package/packages/BnVirtPopover/index.vue +319 -0
- package/packages/BnWebLog/BnWebLog.vue +140 -0
- package/packages/BnWorkSettingDrop/advancedOptions.js +112 -0
- package/packages/BnWorkSettingDrop/benBenAIUtil.js +89 -0
- package/packages/BnWorkSettingDrop/index.vue +292 -0
- package/packages/font/iconfont.css +243 -0
- package/packages/font/iconfont.ttf +0 -0
- package/packages/font/iconfont.woff +0 -0
- package/packages/font/iconfont.woff2 +0 -0
- package/utils/addressParse-old.js +645 -0
- package/utils/addressParse.js +735 -0
- package/utils/config.js +68 -0
- package/utils/index.js +1171 -0
- package/dist/assocTableSearch-CmzOXI5w.js +0 -349
- package/dist/assocTableSearch.css +0 -1
- package/dist/bn-bus-ui.es.js +0 -65
- package/dist/bn-bus-ui.umd.js +0 -49
- package/dist/chooseIPaasData-jkTJEMKT.js +0 -391
- package/dist/chooseIPaasData.css +0 -1
- package/dist/defaultSet-CiYuSOzT.js +0 -297
- package/dist/defaultSet.css +0 -1
- package/dist/fileFormData-D_Q1vylE.js +0 -53
- package/dist/formItemFooter-BpnVUUgV.js +0 -108
- package/dist/formItemFooter.css +0 -1
- package/dist/funcExprDialog-BMc-n5FL.js +0 -139
- package/dist/funcExprDialog.css +0 -1
- package/dist/index-8GQJARcF.js +0 -44
- package/dist/index-8apT0r8m.js +0 -66
- package/dist/index-BOFu3qAH.js +0 -183
- package/dist/index-BSKXuSid.js +0 -89
- package/dist/index-BhYvDd_Q.js +0 -45
- package/dist/index-BhqkeVFc.js +0 -45
- package/dist/index-CK7_Ou7F.js +0 -89
- package/dist/index-Cfb8D3Fg.js +0 -58
- package/dist/index-D1fGD0mX.js +0 -51
- package/dist/index-DE_eQGbT.js +0 -746
- package/dist/index-DfgiBqzS.js +0 -221
- package/dist/index-Dobi0ms9.js +0 -66
- package/dist/index-DuyQNxe0.js +0 -118
- package/dist/index-DxpJkrN7.js +0 -64
- package/dist/index-FGHeG46m.js +0 -109
- package/dist/index-P2M7CUTe.js +0 -178
- package/dist/index-xCz2zysE.js +0 -135
- package/dist/index.css +0 -1
- package/dist/index2.css +0 -1
- package/dist/index3.css +0 -1
- package/dist/index4.css +0 -1
- package/dist/index5.css +0 -1
- package/dist/index6.css +0 -1
- package/dist/index7.css +0 -1
- package/dist/install--7IU60oV.js +0 -23103
- package/dist/install.css +0 -1
- package/dist/setOption-DehYZpZr.js +0 -329
- package/dist/setOption.css +0 -1
- package/dist/setRelationOption-BL-AFUoF.js +0 -5217
- package/dist/setRelationOption.css +0 -1
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="show" id="batchEditForm" class="bn-batch-form-dialog">
|
|
3
|
+
<div class="bn-batch-form-dialog-main">
|
|
4
|
+
<div class="bn-batch-form-dialog-main-top">
|
|
5
|
+
<slot name="top" :select-count="selectCount">
|
|
6
|
+
<span>
|
|
7
|
+
批量编辑
|
|
8
|
+
<span class="w-color-gray w-font12">
|
|
9
|
+
已选择 <span class="w-color-blue">{{ selectCount }}</span> 条工单
|
|
10
|
+
</span>
|
|
11
|
+
</span>
|
|
12
|
+
</slot>
|
|
13
|
+
<span class="sIcon sIcon-close" @click="handleClose"></span>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="w-padding20">
|
|
16
|
+
<slot name="tip">
|
|
17
|
+
<div class="w-tip bn-batch-form-dialog-tip">
|
|
18
|
+
<div>
|
|
19
|
+
<span class="bn-batch-form-dialog-tip-num">1.</span>
|
|
20
|
+
<span class="w-color-orange">批量编辑不支持组件触发拉取,</span>
|
|
21
|
+
<span class="w-color-gray">例如:订单号、ERP订单号、物流单号、运单号等组件不允许批量修改。</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<span class="bn-batch-form-dialog-tip-num">2.</span>
|
|
25
|
+
<span class="w-color-gray">不可编辑的工单组件不支持批量修改。</span>
|
|
26
|
+
</div>
|
|
27
|
+
<div>
|
|
28
|
+
<span class="bn-batch-form-dialog-tip-num">3.</span>
|
|
29
|
+
<span class="w-color-gray">手动添加需要修改的组件,注意:如添加的组件最后保存时值为空,则会清空工单组件数据。</span>
|
|
30
|
+
</div>
|
|
31
|
+
<slot name="tip-extra"></slot>
|
|
32
|
+
</div>
|
|
33
|
+
</slot>
|
|
34
|
+
<div class="bn-batch-form-dialog-component-row">
|
|
35
|
+
<BnDrop v-model="formComponent" :options="editComponents" :option-props="{ value: 'columnCode', label: 'name' }" multiple>
|
|
36
|
+
<span class="w-color-blue w-font13 w-cursor-pointer">请选择组件</span>
|
|
37
|
+
</BnDrop>
|
|
38
|
+
<el-popconfirm
|
|
39
|
+
v-if="formComponent.length > 0"
|
|
40
|
+
title="确定要清空所有已选组件吗?"
|
|
41
|
+
confirm-button-text="确定"
|
|
42
|
+
cancel-button-text="取消"
|
|
43
|
+
@confirm="clearAllComponents"
|
|
44
|
+
>
|
|
45
|
+
<template #reference>
|
|
46
|
+
<span class="bn-batch-form-dialog-clear-all">
|
|
47
|
+
<span class="sIcon sIcon-delete"></span>
|
|
48
|
+
一键清空组件
|
|
49
|
+
</span>
|
|
50
|
+
</template>
|
|
51
|
+
</el-popconfirm>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div v-if="formComponent.length > 0" v-loading="loading" class="bn-batch-form-dialog-main-body">
|
|
55
|
+
<slot name="form" :form-component="formComponent" :form-val="formVal" :loading="loading">
|
|
56
|
+
<BnBatchForm
|
|
57
|
+
ref="smartForm"
|
|
58
|
+
v-model="formVal"
|
|
59
|
+
:components="formComponent"
|
|
60
|
+
:extend-post="mergedExtendPost"
|
|
61
|
+
:post-func="postFunc"
|
|
62
|
+
></BnBatchForm>
|
|
63
|
+
</slot>
|
|
64
|
+
</div>
|
|
65
|
+
<div v-if="formComponent.length == 0" class="bn-batch-form-dialog-empty">
|
|
66
|
+
<slot name="empty">
|
|
67
|
+
<BnEmptyTip tip="请先选择要修改的组件" />
|
|
68
|
+
</slot>
|
|
69
|
+
</div>
|
|
70
|
+
<div class="bn-batch-form-dialog-main-bottom">
|
|
71
|
+
<slot
|
|
72
|
+
name="footer"
|
|
73
|
+
:loading="loading"
|
|
74
|
+
:submit="submitTask"
|
|
75
|
+
:remember-components="rememberComponents"
|
|
76
|
+
:select-count="selectCount"
|
|
77
|
+
>
|
|
78
|
+
<el-checkbox v-model="rememberComponents" @change="saveRememberFlag">记住本次编辑组件,下次默认加载</el-checkbox>
|
|
79
|
+
<el-button
|
|
80
|
+
type="primary"
|
|
81
|
+
:loading="loading"
|
|
82
|
+
@click="submitTask"
|
|
83
|
+
>
|
|
84
|
+
提交
|
|
85
|
+
</el-button>
|
|
86
|
+
</slot>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
<script>
|
|
92
|
+
import { cloneDeep } from 'lodash';
|
|
93
|
+
import BnBatchForm from './BnBatchForm.vue';
|
|
94
|
+
|
|
95
|
+
const DEFAULT_SUBMIT_URL = '/biztable/content/updateBatch';
|
|
96
|
+
|
|
97
|
+
export default {
|
|
98
|
+
name: 'BnBatchFormDialog',
|
|
99
|
+
components: { BnBatchForm },
|
|
100
|
+
props: {
|
|
101
|
+
// 表信息 { tableCode, appId, tableId },appId/projectId 从中提取传给 BnBatchForm
|
|
102
|
+
tableInfo: {
|
|
103
|
+
type: Object,
|
|
104
|
+
required: true,
|
|
105
|
+
},
|
|
106
|
+
// 工作表组件列表,组件内部会筛选可批量编辑的子集
|
|
107
|
+
componentList: {
|
|
108
|
+
type: Array,
|
|
109
|
+
required: true,
|
|
110
|
+
},
|
|
111
|
+
// 已选工单 id 列表,用于展示数量及提交
|
|
112
|
+
selectData: {
|
|
113
|
+
type: Array,
|
|
114
|
+
required: true,
|
|
115
|
+
},
|
|
116
|
+
// 系统来源标识,区分调用方系统,会作为扩展参数传入 BnBatchForm, 例如 费用(finance_center)、安维(anwei)
|
|
117
|
+
source: {
|
|
118
|
+
type: String,
|
|
119
|
+
required: true,
|
|
120
|
+
},
|
|
121
|
+
// 接口请求函数,由外部传入,传给 BnBatchForm 子组件及内部提交请求共用
|
|
122
|
+
// 调用方式:postFunc(url, data),默认 POST 请求
|
|
123
|
+
postFunc: {
|
|
124
|
+
type: Function,
|
|
125
|
+
required: true,
|
|
126
|
+
},
|
|
127
|
+
// 用户 ID,用于记住本次编辑组件,可选
|
|
128
|
+
userId: [String, Number],
|
|
129
|
+
// 是否启用组件内部提交请求,false 时由业务层通过 submit 事件自行处理
|
|
130
|
+
useInnerRequest: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: true,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
emits: ['submitSuccess', 'submit', 'close'],
|
|
136
|
+
data() {
|
|
137
|
+
return {
|
|
138
|
+
show: false,
|
|
139
|
+
loading: false,
|
|
140
|
+
formComponent: [],
|
|
141
|
+
editComponents: [],
|
|
142
|
+
formVal: {},
|
|
143
|
+
rememberComponents: false,
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
computed: {
|
|
147
|
+
mergedExtendPost() {
|
|
148
|
+
const base = {
|
|
149
|
+
appId: this.tableInfo?.appId,
|
|
150
|
+
projectId: this.tableInfo?.tableId,
|
|
151
|
+
source: this.source,
|
|
152
|
+
};
|
|
153
|
+
// userId 缺失时不写入 undefined
|
|
154
|
+
if (this.userId != null) base.userId = this.userId;
|
|
155
|
+
return base;
|
|
156
|
+
},
|
|
157
|
+
selectCount() {
|
|
158
|
+
return this.selectData.length || 0;
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
methods: {
|
|
162
|
+
getColumnCode(item) {
|
|
163
|
+
if (item == null) return null;
|
|
164
|
+
return typeof item === 'object' ? item.columnCode : item;
|
|
165
|
+
},
|
|
166
|
+
extractColumnCodes(components = []) {
|
|
167
|
+
return components.map(item => this.getColumnCode(item)).filter(code => code != null && code !== '');
|
|
168
|
+
},
|
|
169
|
+
restoreFormComponents(columnCodes = []) {
|
|
170
|
+
const normalizedCodes = this.extractColumnCodes(columnCodes);
|
|
171
|
+
if (!normalizedCodes.length || !this.editComponents.length) return;
|
|
172
|
+
const components = normalizedCodes.map(code => this.editComponents.find(item => item.columnCode === code)).filter(Boolean);
|
|
173
|
+
if (components.length) {
|
|
174
|
+
this.formComponent = components;
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
getStorageKey() {
|
|
178
|
+
const tableId = this.tableInfo?.tableId;
|
|
179
|
+
return this.userId && tableId ? `batchEditForm_components_v1_${this.userId}_${tableId}` : null;
|
|
180
|
+
},
|
|
181
|
+
getStoredState() {
|
|
182
|
+
const key = this.getStorageKey();
|
|
183
|
+
if (!key) return null;
|
|
184
|
+
try {
|
|
185
|
+
return JSON.parse(localStorage.getItem(key) || '{}');
|
|
186
|
+
} catch {
|
|
187
|
+
return {};
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
// 提交成功时调用:持久化 remember 标记 + 当前组件列表
|
|
191
|
+
saveStoredState() {
|
|
192
|
+
const key = this.getStorageKey();
|
|
193
|
+
if (!key) return;
|
|
194
|
+
localStorage.setItem(
|
|
195
|
+
key,
|
|
196
|
+
JSON.stringify({
|
|
197
|
+
remember: this.rememberComponents,
|
|
198
|
+
columnCodes: this.rememberComponents ? this.extractColumnCodes(this.formComponent) : [],
|
|
199
|
+
})
|
|
200
|
+
);
|
|
201
|
+
},
|
|
202
|
+
// checkbox 变更时调用:仅持久化 remember 标记;取消勾选时同步清空已记忆的组件列表
|
|
203
|
+
saveRememberFlag() {
|
|
204
|
+
const key = this.getStorageKey();
|
|
205
|
+
if (!key) return;
|
|
206
|
+
const stored = this.getStoredState() || {};
|
|
207
|
+
localStorage.setItem(
|
|
208
|
+
key,
|
|
209
|
+
JSON.stringify({
|
|
210
|
+
...stored,
|
|
211
|
+
remember: this.rememberComponents,
|
|
212
|
+
columnCodes: this.rememberComponents ? stored.columnCodes || [] : [],
|
|
213
|
+
})
|
|
214
|
+
);
|
|
215
|
+
},
|
|
216
|
+
// 读取并应用缓存状态:还原 rememberComponents 标记及已记忆的组件列表
|
|
217
|
+
// 返回原始 stored 对象,供调用方做二次还原(如 nextTick 兜底)
|
|
218
|
+
loadStoredState() {
|
|
219
|
+
const stored = this.getStoredState();
|
|
220
|
+
if (!stored || !Object.keys(stored).length) return stored;
|
|
221
|
+
// 兼容旧版仅缓存 columnCodes 的数据
|
|
222
|
+
if (stored.remember === undefined && stored.columnCodes?.length) {
|
|
223
|
+
this.rememberComponents = true;
|
|
224
|
+
} else {
|
|
225
|
+
this.rememberComponents = !!stored.remember;
|
|
226
|
+
}
|
|
227
|
+
if (this.rememberComponents && stored.columnCodes?.length) {
|
|
228
|
+
this.restoreFormComponents(stored.columnCodes);
|
|
229
|
+
}
|
|
230
|
+
return stored;
|
|
231
|
+
},
|
|
232
|
+
handleClose() {
|
|
233
|
+
this.show = false;
|
|
234
|
+
this.$emit('close');
|
|
235
|
+
},
|
|
236
|
+
clearAllComponents() {
|
|
237
|
+
this.formComponent = [];
|
|
238
|
+
this.formVal = {};
|
|
239
|
+
},
|
|
240
|
+
open() {
|
|
241
|
+
// 筛选可批量编辑的组件:
|
|
242
|
+
// - searchKey=2 为触发拉取类组件(订单号、运单号等),不支持批量修改
|
|
243
|
+
// - valueEditable=1 为值不可编辑组件,不允许批量修改
|
|
244
|
+
// - isEditable=1 为可编辑组件,仅保留此类
|
|
245
|
+
this.editComponents = cloneDeep(
|
|
246
|
+
(this.componentList || []).filter(i => {
|
|
247
|
+
const extra = i.extraInfo || {};
|
|
248
|
+
if (extra.searchKey == 2) return false;
|
|
249
|
+
if (extra.valueEditable == 1) return false;
|
|
250
|
+
return extra.isEditable == 1;
|
|
251
|
+
})
|
|
252
|
+
);
|
|
253
|
+
this.formComponent = [];
|
|
254
|
+
this.formVal = {};
|
|
255
|
+
this.rememberComponents = false;
|
|
256
|
+
// 先读取缓存再开窗,避免重复读取 localStorage
|
|
257
|
+
const stored = this.loadStoredState();
|
|
258
|
+
this.show = true;
|
|
259
|
+
// 弹窗挂载后再补一次还原,避免 v-if 重建子组件时序问题
|
|
260
|
+
if (stored?.columnCodes?.length) {
|
|
261
|
+
this.$nextTick(() => {
|
|
262
|
+
if (this.rememberComponents && !this.formComponent.length) {
|
|
263
|
+
this.restoreFormComponents(stored.columnCodes);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
buildPostData() {
|
|
269
|
+
return {
|
|
270
|
+
tableCode: this.tableInfo?.tableCode,
|
|
271
|
+
contents: this.formVal.contents,
|
|
272
|
+
ids: this.selectData || [],
|
|
273
|
+
};
|
|
274
|
+
},
|
|
275
|
+
internalBatchEditTask(data) {
|
|
276
|
+
return this.postFunc(DEFAULT_SUBMIT_URL, data);
|
|
277
|
+
},
|
|
278
|
+
handleSubmitSuccess(res, postData) {
|
|
279
|
+
this.saveStoredState();
|
|
280
|
+
this.show = false;
|
|
281
|
+
this.$emit('submitSuccess', res, postData);
|
|
282
|
+
},
|
|
283
|
+
submitTask() {
|
|
284
|
+
// 校验表单:内置 BnBatchForm 走 checkFormContent;自定义 #form slot 时无 ref 则跳过,由业务层自行校验
|
|
285
|
+
if (!this.validateForm()) return;
|
|
286
|
+
const postData = this.buildPostData();
|
|
287
|
+
if (!this.useInnerRequest) {
|
|
288
|
+
this.saveStoredState();
|
|
289
|
+
this.$emit('submit', postData);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
this.loading = true;
|
|
293
|
+
this.internalBatchEditTask(postData)
|
|
294
|
+
.then(res => {
|
|
295
|
+
this.loading = false;
|
|
296
|
+
if (!res.code) {
|
|
297
|
+
this.handleSubmitSuccess(res, postData);
|
|
298
|
+
}
|
|
299
|
+
})
|
|
300
|
+
.catch(() => {
|
|
301
|
+
this.loading = false;
|
|
302
|
+
});
|
|
303
|
+
},
|
|
304
|
+
// 校验表单内容,返回 true 表示通过
|
|
305
|
+
validateForm() {
|
|
306
|
+
if (!this.$refs.smartForm) return true;
|
|
307
|
+
const check = this.$refs.smartForm.checkFormContent?.();
|
|
308
|
+
return !!check?.checked;
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
</script>
|
|
313
|
+
|
|
314
|
+
<style scoped lang="scss">
|
|
315
|
+
.bn-batch-form-dialog {
|
|
316
|
+
position: fixed;
|
|
317
|
+
top: 40px;
|
|
318
|
+
left: var(--menu-width, 258px);
|
|
319
|
+
bottom: 0;
|
|
320
|
+
right: 0;
|
|
321
|
+
background: rgba(0, 0, 0, 0.3);
|
|
322
|
+
z-index: 999;
|
|
323
|
+
|
|
324
|
+
&-tip {
|
|
325
|
+
font-size: 12px;
|
|
326
|
+
color: #999;
|
|
327
|
+
margin-bottom: 10px;
|
|
328
|
+
// 给 tip 区限定最大高度,内容过多时内部滚动,避免挤压底部
|
|
329
|
+
max-height: 132px;
|
|
330
|
+
overflow: auto;
|
|
331
|
+
|
|
332
|
+
div {
|
|
333
|
+
margin-bottom: 10px;
|
|
334
|
+
|
|
335
|
+
&:last-child {
|
|
336
|
+
margin-bottom: 0;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
&-num {
|
|
341
|
+
font-size: 14px;
|
|
342
|
+
font-weight: bold;
|
|
343
|
+
color: #409eff;
|
|
344
|
+
margin-right: 6px;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
&-empty {
|
|
349
|
+
display: flex;
|
|
350
|
+
flex: 1;
|
|
351
|
+
min-height: 0;
|
|
352
|
+
flex-direction: column;
|
|
353
|
+
align-items: center;
|
|
354
|
+
justify-content: center;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// main 保持原有高度不变,改为纵向 flex,子元素按内容自适应
|
|
358
|
+
&-main {
|
|
359
|
+
position: relative;
|
|
360
|
+
display: flex;
|
|
361
|
+
flex-direction: column;
|
|
362
|
+
margin: 20px auto;
|
|
363
|
+
height: calc(100% - 50px);
|
|
364
|
+
width: 68%;
|
|
365
|
+
background: #fff;
|
|
366
|
+
|
|
367
|
+
&-top {
|
|
368
|
+
flex-shrink: 0;
|
|
369
|
+
display: flex;
|
|
370
|
+
justify-content: space-between;
|
|
371
|
+
align-items: center;
|
|
372
|
+
padding: 0 20px;
|
|
373
|
+
height: 42px;
|
|
374
|
+
border-bottom: 1px solid #eee;
|
|
375
|
+
color: #666;
|
|
376
|
+
|
|
377
|
+
.sIcon-close {
|
|
378
|
+
cursor: pointer;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// body 占据剩余空间,高度自适应,内容溢出时内部滚动
|
|
383
|
+
&-body {
|
|
384
|
+
position: relative;
|
|
385
|
+
flex: 1;
|
|
386
|
+
min-height: 0;
|
|
387
|
+
overflow: auto;
|
|
388
|
+
width: 100%;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
&-bottom {
|
|
392
|
+
flex-shrink: 0;
|
|
393
|
+
display: flex;
|
|
394
|
+
justify-content: space-between;
|
|
395
|
+
align-items: center;
|
|
396
|
+
padding: 0 20px;
|
|
397
|
+
height: 60px;
|
|
398
|
+
border-top: 1px solid #eee;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
&-component-row {
|
|
403
|
+
display: flex;
|
|
404
|
+
align-items: center;
|
|
405
|
+
justify-content: space-between;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
&-clear-all {
|
|
409
|
+
display: inline-flex;
|
|
410
|
+
align-items: center;
|
|
411
|
+
flex-shrink: 0;
|
|
412
|
+
margin-left: 12px;
|
|
413
|
+
font-size: 13px;
|
|
414
|
+
color: #409eff;
|
|
415
|
+
cursor: pointer;
|
|
416
|
+
|
|
417
|
+
.sIcon {
|
|
418
|
+
margin-right: 4px;
|
|
419
|
+
font-size: 14px;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
</style>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="elfLog">
|
|
3
|
+
<div class="elfLog-top">
|
|
4
|
+
<img src="https://banniu-work.oss-cn-zhangjiakou.aliyuncs.com/125_10030158_26e18a1f306bad541a1713b86e6d1030.png">
|
|
5
|
+
</div>
|
|
6
|
+
<div class="elfLog-content">
|
|
7
|
+
<div class="elfLog-content-time">{{ log.time }}</div>
|
|
8
|
+
<div class="elfLog-content-warp">
|
|
9
|
+
<span>{{log.content}}</span>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: "index",
|
|
18
|
+
props: {
|
|
19
|
+
log: Object,
|
|
20
|
+
animation:Boolean
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style scoped lang="scss">
|
|
26
|
+
.elfLog {
|
|
27
|
+
position: relative;
|
|
28
|
+
display: flex;
|
|
29
|
+
width: 100%;
|
|
30
|
+
|
|
31
|
+
&-top {
|
|
32
|
+
img {
|
|
33
|
+
width: 30px;
|
|
34
|
+
height: 30px;
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-content {
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
|
|
42
|
+
&-time {
|
|
43
|
+
font-size: 12px;
|
|
44
|
+
color: #888;
|
|
45
|
+
margin-bottom: 2px;
|
|
46
|
+
}
|
|
47
|
+
&-warp{
|
|
48
|
+
padding: 4px;
|
|
49
|
+
border-radius: 4px;
|
|
50
|
+
background: #ffdc83;
|
|
51
|
+
color: #000;
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
font-family: 'Courier New', monospace;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
表单操作动作日志,点击保存的时候传给后端,定时每个月清除。就用类似gpt的风格
|
|
3
|
+
-->
|
|
4
|
+
<template>
|
|
5
|
+
<div class="BnSmartElf">
|
|
6
|
+
<div class="BnSmartElf-head">
|
|
7
|
+
<span>建单助手</span>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="BnSmartElf-logs">
|
|
10
|
+
<el-scrollbar height="100%" ref="scrollbarRef">
|
|
11
|
+
<div class="BnSmartElf-logs-item" v-for="(item,index) in logs" :key="index">
|
|
12
|
+
<elfLog :log="item"></elfLog>
|
|
13
|
+
</div>
|
|
14
|
+
</el-scrollbar>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="BnSmartElf-bac" @mouseenter="close = true" @mouseleave="close = false" @click="$emit('close')">
|
|
17
|
+
<img src="https://banniu-work.oss-cn-zhangjiakou.aliyuncs.com/125_10030158_34d142cdae778fe5751269e3ebb078be.png" v-show="!close">
|
|
18
|
+
<el-tooltip content="点我关闭" placement="top" :hide-after="0" :show-arrow="false">
|
|
19
|
+
<img src="https://banniu-work.oss-cn-zhangjiakou.aliyuncs.com/125_10030158_a3e8db53df86fa2143e8d5238fc5dac0.png" v-show="close">
|
|
20
|
+
</el-tooltip>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<script>
|
|
25
|
+
import elfLog from "./elfLog/index.vue";
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: "index",
|
|
29
|
+
components: {elfLog},
|
|
30
|
+
props: {logs: Array},
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
close: false,
|
|
34
|
+
scrollbarRef: null
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
mounted() {
|
|
38
|
+
this.scrollbarRef = this.$refs.scrollbarRef;
|
|
39
|
+
this.scrollbarRef.scrollTo({top: 99999, behavior: "smooth"})
|
|
40
|
+
},
|
|
41
|
+
watch: {
|
|
42
|
+
logs: {
|
|
43
|
+
handler() {
|
|
44
|
+
if (this.scrollbarRef) {
|
|
45
|
+
this.scrollbarRef.scrollTo({top: 99999, behavior: "smooth"})
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
deep: true,
|
|
49
|
+
immediate: true,
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
<style scoped lang="scss">
|
|
55
|
+
.BnSmartElf {
|
|
56
|
+
position: relative;
|
|
57
|
+
width: 100%;
|
|
58
|
+
height: 100%;
|
|
59
|
+
padding-bottom: 16px;
|
|
60
|
+
|
|
61
|
+
&-head {
|
|
62
|
+
height: 36px;
|
|
63
|
+
padding: 0 10px;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
line-height: 36px;
|
|
66
|
+
color: #777;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&-logs {
|
|
70
|
+
position: relative;
|
|
71
|
+
height: calc(100% - 20px);
|
|
72
|
+
|
|
73
|
+
&-item {
|
|
74
|
+
padding: 0 10px;
|
|
75
|
+
margin-bottom: 8px;
|
|
76
|
+
|
|
77
|
+
&:last-child {
|
|
78
|
+
margin-bottom: 200px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&-bac {
|
|
84
|
+
position: absolute;
|
|
85
|
+
bottom: 10px;
|
|
86
|
+
right: 10px;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
|
|
89
|
+
img {
|
|
90
|
+
width: 70px;
|
|
91
|
+
opacity: .7;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
</style>
|