bl-common-vue3 3.8.68 → 3.8.70

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bl-common-vue3",
3
- "version": "3.8.68",
3
+ "version": "3.8.70",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "description": "bailing vue3 common components lib",
@@ -225,6 +225,41 @@ const utils = {
225
225
  });
226
226
  },
227
227
 
228
+ /**
229
+ * @description: 确认弹框(删除确认) 重写是为了多语言
230
+ * @param {*} 同ant design api
231
+ */
232
+ modalConfirm: ({
233
+ title = t('common.basic.tips'),
234
+ content = {},
235
+ centered = true,
236
+ onOk,
237
+ onCancel,
238
+ okType = "primary",
239
+ okText = t('common.button.ok'),
240
+ cancelText = t('common.button.cancel')
241
+ }) => {
242
+ const getContainer = () => {
243
+ return window?.rawDocument?.body || document?.body;
244
+ };
245
+ Modal.confirm({
246
+ title: () => title,
247
+ content: () => content ? content : '',
248
+ okText: () => okText,
249
+ icon: () => createVNode(ExclamationCircleOutlined),
250
+ okType,
251
+ cancelText: () => cancelText,
252
+ centered,
253
+ getContainer,
254
+ onOk() {
255
+ onOk && onOk();
256
+ },
257
+ onCancel() {
258
+ onCancel && onCancel();
259
+ },
260
+ });
261
+ },
262
+
228
263
  /**
229
264
  * @description: 数组处理成树 (递归)
230
265
  */
@@ -485,10 +485,9 @@ export default defineComponent({
485
485
 
486
486
  // 删除文件
487
487
  const deleteFile = (id) => {
488
- Modal.confirm({
489
- title:
490
- t('AttachmentInfo.index.559728-11'),
491
- icon: createVNode(ExclamationCircleOutlined),
488
+ utils.modalConfirm({
489
+ title: t('AttachmentInfo.index.559728-11'),
490
+ content: '',
492
491
  okText: t('common.button.ok'),
493
492
  cancelText: t('common.button.cancel'),
494
493
  onOk() {
@@ -140,9 +140,9 @@ export default {
140
140
  uploadList: [],
141
141
  });
142
142
  const onCancel = () => {
143
- Modal.confirm({
143
+ utils.modalConfirm({
144
144
  title: t('modules.MultipleAddAttachments.414571-2'),
145
- icon: createVNode(ExclamationCircleOutlined),
145
+ content: '',
146
146
  okText: t('common.button.ok'),
147
147
  cancelText: t('common.button.cancel'),
148
148
  onOk() {
@@ -212,9 +212,9 @@ export default {
212
212
  };
213
213
 
214
214
  const deleteItem = (index) => {
215
- Modal.confirm({
215
+ utils.modalConfirm({
216
216
  title: t('LinkLibrary.MiniList.891083-6'),
217
- icon: createVNode(ExclamationCircleOutlined),
217
+ content: '',
218
218
  okText: t('common.button.ok'),
219
219
  cancelText: t('common.button.cancel'),
220
220
  onOk() {
@@ -308,7 +308,7 @@ export default defineComponent({
308
308
 
309
309
  // 取消
310
310
  const onCancel = () => {
311
- Modal.confirm({
311
+ utils.modalConfirm({
312
312
  title: t("modules.MultipleAddAttachments.414571-2"),
313
313
  icon: createVNode(ExclamationCircleOutlined),
314
314
  okText: t("common.button.ok"),
@@ -87,7 +87,7 @@
87
87
  </template>
88
88
 
89
89
  <script>
90
- import { cloneDeep } from "lodash";
90
+ import { cloneDeep } from "lodash";
91
91
  import {defineComponent, reactive, toRefs, watch, createVNode, computed} from "vue";
92
92
  import { message, Drawer, Space, Button, InputNumber, Checkbox, RadioGroup, Modal} from "ant-design-vue";
93
93
  import draggable from "vuedraggable";
@@ -217,9 +217,9 @@ export default defineComponent({
217
217
  };
218
218
 
219
219
  const restoreDefault = () => {
220
- Modal.confirm({
221
- title: () => t('ColumnSetting.index.391089-9'),
222
- icon: () => createVNode(ExclamationCircleOutlined),
220
+ utils.modalConfirm({
221
+ title: t('ColumnSetting.index.391089-9'),
222
+ content: '',
223
223
  okText: t('common.button.confirm'),
224
224
  cancelText: t('common.button.cancel'),
225
225
  onOk: () => {
@@ -158,17 +158,11 @@ export default defineComponent({
158
158
 
159
159
  if (res.fileUrl) {
160
160
  loading.value = false;
161
- Modal.confirm({
161
+ utils.modalConfirm({
162
162
  title: t('CustomImport.index.951685-4'),
163
- icon: createVNode(ExclamationCircleOutlined),
164
- content: () =>
165
- h("div", { style: "color:#666;" }, [
166
- h("div", {}, t('CustomImport.index.951685-5', [res.errorRow])),
167
- h(
168
- "div",
169
- {},
170
- t('CustomImport.index.951685-6')
171
- ),
163
+ content: h("div", { style: "color:#666;" }, [
164
+ h( "div", {}, t('CustomImport.index.951685-5', [res.errorRow])),
165
+ h( "div", {}, t('CustomImport.index.951685-6') ),
172
166
  ]),
173
167
  okText: t('CustomImport.index.951685-7'),
174
168
  cancelText: t('CustomImport.index.951685-8'),
@@ -2720,9 +2720,9 @@ export default defineComponent({
2720
2720
 
2721
2721
  const handleOperationClick = (item, info) => {
2722
2722
  if (item.key == "del") {
2723
- Modal.confirm({
2724
- title: () => t("common.confirm.delete"),
2725
- icon: () => createVNode(ExclamationCircleOutlined),
2723
+ utils.modalConfirm({
2724
+ title: t("common.confirm.delete"),
2725
+ content: '',
2726
2726
  okText: t("common.button.confirm"),
2727
2727
  cancelText: t("common.button.cancel"),
2728
2728
  onOk: () => {
@@ -205,10 +205,9 @@ export default defineComponent({
205
205
  };
206
206
 
207
207
  const deleteClick = (id) => {
208
- Modal.confirm({
209
- title: () => t('common.basic.tips'),
210
- icon: () => createVNode(ExclamationCircleOutlined),
211
- content: () => t('LinkLibrary.MiniList.891083-6'),
208
+ utils.modalConfirm({
209
+ title: t('common.basic.tips'),
210
+ content: t('LinkLibrary.MiniList.891083-6'),
212
211
  onOk() {
213
212
  context.emit("request", {
214
213
  params: {
@@ -334,10 +334,9 @@ export default defineComponent({
334
334
  state.dataList.splice(index, 1);
335
335
  };
336
336
  const handleSettingRemove = (id) => {
337
- Modal.confirm({
338
- title: () => t('common.basic.tips'),
339
- content: () => t('common.confirm.delete'),
340
- icon: () => createVNode(ExclamationCircleOutlined),
337
+ utils.modalConfirm({
338
+ title: t('common.basic.tips'),
339
+ content: t('common.confirm.delete'),
341
340
  okType: "danger",
342
341
  centered: true,
343
342
  onOk() {
@@ -105,7 +105,7 @@ export default defineComponent({
105
105
  }
106
106
  state.owner_id = option.value;
107
107
  state.SelectTenant = option
108
- context.emit("noChangeNewInfo" , state.owner_id , state.SelectTenant);
108
+ context.emit("selectcancel" , state.owner_id , state.SelectTenant);
109
109
  };
110
110
 
111
111
  //清除功能,如果不需要清除功能可以不调用
@@ -134,7 +134,7 @@ export default defineComponent({
134
134
  if(selectTenant) {
135
135
  state.SelectTenant = selectTenant;
136
136
  if (props.needNewInfo) {
137
- context.emit("selectcancel" , state.owner_id , state.SelectTenant);
137
+ context.emit("noChangeNewInfo" , state.owner_id , state.SelectTenant);
138
138
  }
139
139
  } else {
140
140
  // 没有找到,清空选中
@@ -148,11 +148,9 @@ export default defineComponent({
148
148
 
149
149
  // 水电表重置
150
150
  const getEnergyReset = (record) => {
151
- Modal.confirm({
152
- title: () => t('common.basic.tips'),
153
- icon: createVNode(ExclamationCircleOutlined),
154
- content: () =>
155
- t('ViewEnergyList.index.921424-6', [record.type_name]),
151
+ utils.modalConfirm({
152
+ title: t('common.basic.tips'),
153
+ content: t('ViewEnergyList.index.921424-6', [record.type_name]),
156
154
  okText: t('common.button.ok'),
157
155
  cancelText: t('common.button.cancel'),
158
156
  onOk() {