bl-common-vue3 3.8.75 → 3.8.77

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.75",
3
+ "version": "3.8.77",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "description": "bailing vue3 common components lib",
@@ -611,6 +611,36 @@ const utils = {
611
611
  }
612
612
  return true;
613
613
  },
614
+
615
+ modalSuccess: ({
616
+ title = null,
617
+ content = null,
618
+ }) => {
619
+ Modal.success({
620
+ title: () => title,
621
+ content: () => content,
622
+ });
623
+ },
624
+
625
+ modalError: ({
626
+ title = null,
627
+ content = null,
628
+ }) => {
629
+ Modal.error({
630
+ title: () => title,
631
+ content: () => content,
632
+ });
633
+ },
634
+
635
+ modalWarning: ({
636
+ title = null,
637
+ content = null,
638
+ }) => {
639
+ Modal.warning({
640
+ title: () => title,
641
+ content: () => content,
642
+ });
643
+ }
614
644
  };
615
645
 
616
646
  export default utils;
@@ -9,7 +9,19 @@
9
9
  </div>
10
10
 
11
11
  <!-- 二维码弹框 -->
12
- <QrcodeModal :visible="qrcodeModalVisible" :isCopy="true" :download="false" :urls="annexUploadPageUrl" @cancel="handleCancelQrcode" @request="handleRequest" :zIndex="visible ? 1001 : 1000" :title="t('BlMobileAnnexUpload.index-1')"></QrcodeModal>
12
+ <QrcodeModal
13
+ :visible="qrcodeModalVisible"
14
+ :isCopy="true"
15
+ :download="false"
16
+ :size="260"
17
+ :widthRatio="2"
18
+ :urls="annexUploadPageUrl"
19
+ @cancel="handleCancelQrcode"
20
+ @request="handleRequest"
21
+ :zIndex="visible ? 1001 : 1000"
22
+ :title="t('BlMobileAnnexUpload.index-1')"
23
+ :tip="t('BlMobileAnnexUpload.index.676543-0')"
24
+ ></QrcodeModal>
13
25
 
14
26
  <!-- 批量上传弹框 -->
15
27
  <bl-modal
@@ -44,7 +56,7 @@
44
56
  </a-table>
45
57
 
46
58
  </bl-modal>
47
-
59
+
48
60
  <!-- 预览图片 -->
49
61
  <div style="display: none">
50
62
  <a-image-preview-group v-if="imgList?.length" :preview="{ visible: previewVisible, onVisibleChange: vis => (previewVisible = vis), current: currentImgNum}">>
@@ -183,8 +195,11 @@ export default defineComponent({
183
195
  uploadConfig[key] = cfg;
184
196
  });
185
197
 
198
+ let tokenName = utils.getCommonLocal("org_token_name");
199
+ let token = tokenName ? localStorage.getItem(tokenName) : '';
200
+
186
201
  const h5Domain = (props.h5Domain || location.origin).replace(/\/$/, "");
187
- state.annexUploadPageUrl = `${h5Domain}/h5_orgs/pages/common/annexUpload?key=${encodeURIComponent(state.key || "")}&uploadConfig=${encodeURIComponent(JSON.stringify(uploadConfig))}`;
202
+ state.annexUploadPageUrl = `${h5Domain}/h5_orgs/pages/common/annexUpload?key=${encodeURIComponent(state.key || "")}&uploadConfig=${encodeURIComponent(JSON.stringify(uploadConfig))}&uploadToken=${encodeURIComponent(token || "")}`;
188
203
  };
189
204
 
190
205
  // 获取key
@@ -143,6 +143,7 @@ export default defineComponent({
143
143
  formData.append(key, props.extraParams[key]);
144
144
  })
145
145
  }
146
+ formData.needMsg = true;
146
147
  context.emit("request", {
147
148
  params: {
148
149
  method: props.requestInfo.serviceType,
@@ -154,22 +155,22 @@ export default defineComponent({
154
155
  const defaultNext = () => {
155
156
  loading.value = false;
156
157
  fileList.value = [];
157
- context.emit("refresh", res);
158
+ context.emit("refresh", res.data);
158
159
  }
159
160
 
160
- if (res.fileUrl) {
161
+ if (res.data.fileUrl) {
161
162
  loading.value = false;
162
163
  utils.modalConfirm({
163
164
  title: t('CustomImport.index.951685-4'),
164
165
  content: h("div", { style: "color:#666;" }, [
165
- h( "div", {}, t('CustomImport.index.951685-5', [res.errorRow])),
166
+ h( "div", {}, t('CustomImport.index.951685-5', [res.data.errorRow])),
166
167
  h( "div", {}, t('CustomImport.index.951685-6') ),
167
168
  ]),
168
169
  okText: t('CustomImport.index.951685-7'),
169
170
  cancelText: t('CustomImport.index.951685-8'),
170
171
  onOk() {
171
172
  const iframe = document.createElement("iframe");
172
- iframe.src = res.fileUrl;
173
+ iframe.src = res.data.fileUrl;
173
174
  iframe.style.display = "none";
174
175
  document.body.appendChild(iframe);
175
176
  setTimeout(() => {
@@ -179,11 +180,13 @@ export default defineComponent({
179
180
  });
180
181
  return;
181
182
  }
182
- if (res.errorFileKey) {
183
+ if (res.data.errorFileKey) {
183
184
  defaultNext();
184
185
  return;
185
186
  }
186
- message.success(t('CustomImport.index.951685-9'));
187
+ utils.modalSuccess({
188
+ title: res.msg || t('CustomImport.index.951685-9'),
189
+ });
187
190
  loading.value = false;
188
191
  fileList.value = [];
189
192
  context.emit("success");
@@ -174,18 +174,23 @@ export default defineComponent({
174
174
  }
175
175
  const { importInfo } = props;
176
176
  if (importInfo.url) {
177
+ importInfo.extra['needMsg'] = true
177
178
  context.emit("request", {
178
179
  params: {
179
180
  ...importInfo,
180
181
  },
181
- success: () => {
182
- message.success(t('ImportFile.index.452353-6'));
182
+ success: (res) => {
183
+ utils.modalSuccess({
184
+ title: res.msg || t('ImportFile.index.452353-6'),
185
+ });
183
186
  context.emit("success", {
184
187
  file: state.fileList[0],
185
188
  });
186
189
  },
187
- fail: () => {
188
- message.error(t('ImportFile.index.452353-7'));
190
+ fail: (res) => {
191
+ utils.modalError({
192
+ title: res.msg || t('ImportFile.index.452353-7'),
193
+ });
189
194
  context.emit("fail", {
190
195
  file: state.fileList[0],
191
196
  });
@@ -1,13 +1,18 @@
1
1
  <template>
2
2
  <bl-modal
3
3
  :visible="visible"
4
- :title="titleProps"
5
4
  centered
6
5
  :footer="null"
7
6
  @cancel="handleClose"
8
7
  :width="modalWidth"
9
8
  :zIndex="zIndex"
10
9
  >
10
+ <template #title>
11
+ <div>
12
+ {{titleProps}}
13
+ <span v-if="tip" class="tip-info">({{tip}})</span>
14
+ </div>
15
+ </template>
11
16
  <Row :gutter="[12, 12]" :wrap="true">
12
17
  <Col
13
18
  :span="24"
@@ -131,7 +136,15 @@ export default defineComponent({
131
136
  zIndex: {
132
137
  type: Number,
133
138
  default: 1000
134
- }
139
+ },
140
+ tip: {
141
+ type: String,
142
+ default: "",
143
+ },
144
+ widthRatio: {
145
+ type: Number,
146
+ default: 3,
147
+ },
135
148
  },
136
149
  setup(props, { emit }) {
137
150
  const state = reactive({
@@ -176,7 +189,7 @@ export default defineComponent({
176
189
  method: "get",
177
190
  server: "/public",
178
191
  url: "/qrcode",
179
- extra: { qrCode: url },
192
+ extra: { qrCode: url, shortLink:1 },
180
193
  },
181
194
  success: (res) => {
182
195
  if (typeof props.urls === 'string') {
@@ -194,7 +207,7 @@ export default defineComponent({
194
207
  const { size, urls } = props;
195
208
  let length = "string" === typeof urls ? 1 : urls.length;
196
209
  length = length < 3 ? length : 3;
197
- state.modalWidth = size * 3 + 150;
210
+ state.modalWidth = (size * (props.widthRatio || 3)) + 150;
198
211
  state.colNum = 24 / length;
199
212
  };
200
213
 
@@ -219,11 +232,11 @@ export default defineComponent({
219
232
 
220
233
  // 复制
221
234
  const copy = (url) => {
222
- let ele = document.createElement("input");
223
- ele.setAttribute("value", url);
224
- document.body.appendChild(ele);
225
- ele.select();
226
- document.execCommand("copy");
235
+ let ele = document.createElement("input");
236
+ ele.setAttribute("value", url);
237
+ document.body.appendChild(ele);
238
+ ele.select();
239
+ document.execCommand("copy");
227
240
  document.body.removeChild(ele);
228
241
  message.success(t('QrcodeModal.index.612016-2'))
229
242
  }
@@ -259,4 +272,8 @@ export default defineComponent({
259
272
  .ml-10 {
260
273
  margin-left: 10px;
261
274
  }
275
+ .tip-info {
276
+ font-size: 12px;
277
+ color: rgba(0, 0, 0, 0.4);
278
+ }
262
279
  </style>
@@ -513,5 +513,6 @@
513
513
  "ApprovalDetail.index.683625-3": "審批需要手寫簽名,系統還未記錄過您的簽名。第一次請前往移動端審批,完成手寫簽名!",
514
514
  "DepartmentUser.index.555981-0": "清除選項",
515
515
  "DepartmentUser.index.555981-1": "展開",
516
- "DepartmentUser.index.555981-2": "收起"
516
+ "DepartmentUser.index.555981-2": "收起",
517
+ "BlMobileAnnexUpload.index.676543-0": "該二維碼十五分鐘內有效"
517
518
  }
@@ -513,5 +513,6 @@
513
513
  "ApprovalDetail.index.683625-3": "A handwritten signature is required for approval, and the system has not yet recorded your signature. For the first time, please go to the mobile terminal for approval to complete the handwritten signature!",
514
514
  "DepartmentUser.index.555981-0": "Clear Options",
515
515
  "DepartmentUser.index.555981-1": "expand",
516
- "DepartmentUser.index.555981-2": "fold up"
516
+ "DepartmentUser.index.555981-2": "fold up",
517
+ "BlMobileAnnexUpload.index.676543-0": "This QR code is valid for fifteen minutes"
517
518
  }
@@ -513,5 +513,6 @@
513
513
  "ApprovalDetail.index.683625-3": "承認には手書きの署名が必要ですが、システムはまだあなたの署名を記録していません。初めての場合は、モバイル端末で承認に進み、手書きの署名を完了してください!",
514
514
  "DepartmentUser.index.555981-0": "パージオプション",
515
515
  "DepartmentUser.index.555981-1": "展開",
516
- "DepartmentUser.index.555981-2": "畳む"
516
+ "DepartmentUser.index.555981-2": "畳む",
517
+ "BlMobileAnnexUpload.index.676543-0": "このQRコードは15分間有効です"
517
518
  }
@@ -412,5 +412,6 @@
412
412
  "ApprovalDetail.index.683625-3": "審批需要手寫簽名,系統還未記錄過您的簽名。第一次請前往移動端審批,完成手寫簽名!",
413
413
  "DepartmentUser.index.555981-0": "清除選項",
414
414
  "DepartmentUser.index.555981-1": "展開",
415
- "DepartmentUser.index.555981-2": "收起"
415
+ "DepartmentUser.index.555981-2": "收起",
416
+ "BlMobileAnnexUpload.index.676543-0": "該二維碼十五分鐘內有效"
416
417
  }
@@ -513,5 +513,6 @@
513
513
  "ApprovalDetail.index.683625-3": "审批需要手写签名,系统还未记录过您的签名。第一次请前往移动端审批,完成手写签名!",
514
514
  "DepartmentUser.index.555981-0": "清除选项",
515
515
  "DepartmentUser.index.555981-1": "展开",
516
- "DepartmentUser.index.555981-2": "收起"
516
+ "DepartmentUser.index.555981-2": "收起",
517
+ "BlMobileAnnexUpload.index.676543-0": "该二维码十五分钟内有效"
517
518
  }