p-pc-ui 1.2.8 → 1.3.0

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.
@@ -235,6 +235,16 @@ const initFormState = (renderData: FormDataItem[], initFromData = {}) => {
235
235
  url: renderItem.baseOssUrl + val,
236
236
  };
237
237
  });
238
+ } else if (renderItem.type == "uploadTos") {
239
+ if (!_.isArray(initValue)) {
240
+ initValue = [initValue];
241
+ }
242
+ initValue = initValue.map((val) => {
243
+ return {
244
+ key: val,
245
+ url: renderItem.baseTosUrl + val,
246
+ };
247
+ });
238
248
  } else if (renderItem.type == "editor") {
239
249
  initValue = initValue.replace(/\<\<图片替换地址\>\>/g, renderItem.baseOssUrl);
240
250
  }
@@ -278,9 +288,8 @@ const getFormData = async (options: { no_check?: Boolean } = {}) => {
278
288
  if (renderItem?.visibleHook && !renderItem.visibleHook(formData)) {
279
289
  continue;
280
290
  }
281
-
282
291
  // 上传到oss
283
- else if (renderItem.type == "uploadOss") {
292
+ else if (renderItem.type == "uploadOss" || renderItem.type == "uploadTos") {
284
293
  const fileData = toRaw(formData[key]);
285
294
  const keys = fileData.map((val) => {
286
295
  return val?.response?.key || val.key;
@@ -11,7 +11,7 @@
11
11
  <script lang="ts" setup>
12
12
  import { ref, reactive, onMounted } from "vue";
13
13
  import { message, Modal } from "ant-design-vue";
14
- import * as _ from "../../../utils/dataUtils";
14
+ import * as _ from "../../utils/dataUtils";
15
15
  import PForm from "../p-form/p-form.vue";
16
16
  import type { FormDataItem } from "../p-form/index.d";
17
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "p-pc-ui",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "module": "dist/index.ts",
6
6
  "main": "dist/index.ts",