Browse Source

项目信息管理接口对接 组件动态

duxiangyu 3 years ago
parent
commit
c1acac0f51

+ 1 - 1
package.json

@@ -16,7 +16,7 @@
     "font-awesome": "^4.7.0",
     "handsontable-pro": "^3.0.0",
     "jquery": "^3.3.1",
-    "meri-design": "^1.5.515",
+    "meri-design": "^1.5.517",
     "moment": "^2.29.1",
     "spark-md5": "^3.0.2",
     "vue-router": "^3.5.3",

+ 39 - 33
src/components/project-manage/components/basic.vue

@@ -1,8 +1,14 @@
 <template>
   <div class="basic-container">
-    <Title :name="itemProps.label" />
+    <Title :name="name" />
     <div class="basic-content">
-      <GeoComp v-if="itemProps.label === '地理位置'" @change="geoChange" />
+      <div class="basic-line">
+        项目ID:<span>{{ info.id }}</span>
+      </div>
+      <div class="basic-line">
+        项目本地名称:<span>{{ info.localName }}</span>
+      </div>
+      <!-- <GeoComp v-if="itemProps.label === '地理位置'" @change="geoChange" />
       <div
         :class="['basic-item', { all: item.dataType === 'ATTACHMENT' }]"
         v-for="(item, index) in itemProps.child"
@@ -16,7 +22,7 @@
           :formItemObj="item"
           :info="info"
         />
-      </div>
+      </div> -->
 
       <!-- <div class="basic-line">
         项目本地名称:<span>{{ info.localName }}</span>
@@ -26,15 +32,15 @@
 </template>
 <script>
 import Title from "./title.vue";
-import { dataTypeEnum } from "../index.vue";
+// import { dataTypeEnum } from "../index.vue";
 // import FormItem from "./formItem.vue";
-import FormItem from "../form/form.vue";
-import GeoComp from "./geo.vue";
+// import FormItem from "../form/form.vue";
+// import GeoComp from "./geo.vue";
 export default {
   components: {
     Title,
-    FormItem,
-    GeoComp,
+    // FormItem,
+    // GeoComp,
   },
   props: {
     itemProps: {
@@ -58,21 +64,21 @@ export default {
     filterType(type) {
       return dataTypeEnum[type];
     },
-    filterClass(type) {
-      let className = "";
-      switch (type) {
-        case "ATTACHMENT":
-        case "long":
-          className = "all";
-          return;
-      }
-    },
-    geoChange(info) {
-      console.log(info, "asdqasd");
-      this.info.infos.longitude = info.lng;
-      this.info.infos.latitude = info.lat;
-      this.info.infos.address = info.district;
-    },
+    // filterClass(type) {
+    //   let className = "";
+    //   switch (type) {
+    //     case "ATTACHMENT":
+    //     case "long":
+    //       className = "all";
+    //       return;
+    //   }
+    // },
+    // geoChange(info) {
+    //   console.log(info, "asdqasd");
+    //   this.info.infos.longitude = info.lng;
+    //   this.info.infos.latitude = info.lat;
+    //   this.info.infos.address = info.district;
+    // },
   },
 };
 </script>
@@ -98,15 +104,15 @@ export default {
       width: 100%;
     }
   }
-  // &-line {
-  //   font-size: 14px;
-  //   color: #646c73;
-  //   span {
-  //     color: #1f2429;
-  //   }
-  //   &:nth-child(2) {
-  //     margin-left: 157px;
-  //   }
-  // }
+  &-line {
+    font-size: 14px;
+    color: #646c73;
+    span {
+      color: #1f2429;
+    }
+    &:nth-child(2) {
+      margin-left: 157px;
+    }
+  }
 }
 </style>

+ 12 - 11
src/components/project-manage/components/geo.vue

@@ -24,11 +24,11 @@ export default {
       type: Object,
       default: () => {
         return {
-          district: "", // 省市区县
+          // district: "", // 省市区县
           address: "", // 详细地址
-          lng: "", // 经度
-          lat: "", // 纬度
-          level: null, // 抗震设防烈度
+          longitude: "", // 经度
+          latitude: "", // 纬度
+          // level: null, // 抗震设防烈度
         };
       },
     },
@@ -60,8 +60,8 @@ export default {
           resizeEnable: true,
         });
         this.addMarker(Amap, {
-          lng: this.geoFormData.lng,
-          lat: this.geoFormData.lat,
+          lng: this.geoFormData.longitude,
+          lat: this.geoFormData.latitude,
         });
         Amap.plugin(["AMap.PlaceSearch", "AMap.AutoComplete"], () => {
           const autoOptions = {
@@ -76,11 +76,11 @@ export default {
               this.setLocation(Amap, location);
               this.addMarker(Amap, location, e.poi.name);
               const { district, address } = e.poi;
-              this.geoFormData.district = district;
-              this.geoFormData.address = address;
-              this.geoFormData.lng = location.lng.toString();
-              this.geoFormData.lat = location.lat.toString();
-              this.geoFormData.level = null;
+              // this.geoFormData.district = district;
+              this.geoFormData.address = district + address;
+              this.geoFormData.longitude = location.lng.toString();
+              this.geoFormData.latitude = location.lat.toString();
+              // this.geoFormData.level = null;
               this.$emit("change", this.geoFormData);
             }
           });
@@ -129,6 +129,7 @@ export default {
 <style lang="less" scoped>
 .geo-container {
   width: 100%;
+  margin-bottom: 24px;
   .geo-content {
     width: 100%;
     height: 100%;

+ 7 - 0
src/components/project-manage/form/form.vue

@@ -8,6 +8,7 @@
       :unit="formItemObj.unit"
       :selectData="formItemObj.dataSource"
       :formItemObj="formItemObj"
+      :info="info"
       @change="change"
     />
   </div>
@@ -58,6 +59,12 @@ export default {
     change(val) {
       let pathArr = this.splitPath(this.formItemObj.path);
       // this.info[pathArr[0]][pathArr[1]] = val;
+      console.log(
+        "%c [ pathArr, value $emit ]: ",
+        "color: #bf2c9f; background: pink; font-size: 13px;",
+        pathArr,
+        val
+      );
       $Bus.$emit("formInfoChange", { pathArr: pathArr, value: val });
     },
     splitPath(path) {

+ 17 - 8
src/components/project-manage/form/index.vue

@@ -4,7 +4,10 @@
     <div class="basic-content">
       <GeoComp v-if="itemProps.label === '地理位置'" @change="geoChange" />
       <div
-        :class="['basic-item', { all: item.dataType === 'ATTACHMENT' }]"
+        :class="[
+          'basic-item',
+          { all: item.dataType === 'ATTACHMENT' || item.code === 'projIntro' },
+        ]"
         v-for="(item, index) in itemProps.child"
         :key="item.id"
         v-if="item.visible"
@@ -25,11 +28,13 @@
   </div>
 </template>
 <script>
-import Title from "./title.vue";
+import Title from "../components/title.vue";
 import { dataTypeEnum } from "../index.vue";
 // import FormItem from "./formItem.vue";
-import FormItem from "../form/index.vue";
-import GeoComp from "./geo.vue";
+import FormItem from "../form/form.vue";
+// import GeoComp from "./geo.vue";
+import GeoComp from "../components/geo.vue";
+import { $Bus } from "@/utils/Bus";
 export default {
   components: {
     Title,
@@ -68,10 +73,14 @@ export default {
       }
     },
     geoChange(info) {
-      console.log(info, "asdqasd");
-      this.info.infos.longitude = info.lng;
-      this.info.infos.latitude = info.lat;
-      this.info.infos.address = info.district;
+      let entries = Object.entries(info);
+      entries = entries.map((i) => {
+        return {
+          pathArr: ["infos", i[0]],
+          value: i[1],
+        };
+      });
+      $Bus.$emit("formInfoChange", entries);
     },
   },
 };

+ 25 - 2
src/components/project-manage/form/items/ImageUpload.vue

@@ -140,7 +140,7 @@ import Left from "../static/iconSvg/left.svg";
 import Download from "../static/iconSvg/download.svg";
 import OriginalSize from "../static/iconSvg/original_size.svg";
 import SmallImage from "../static/iconSvg/small_image.svg";
-
+import { fileHttpUtils } from "@/utils/http/fileHttpUtils";
 // import {Message} from '../Message';
 // import ajax from '../static/utils/Ajax';
 
@@ -489,7 +489,7 @@ export default {
     /**
      * 上传文
      */
-    featchUpload(fileItem) {
+    async featchUpload(fileItem) {
       const _currentIndex = this.renderImageList.findIndex(
         (item) => item.name === fileItem.name
       );
@@ -515,6 +515,29 @@ export default {
         "color: #bf2c9f; background: pink; font-size: 13px;",
         fileItem
       );
+      const fileHttpInstance = new fileHttpUtils();
+      const uploadResult = await fileHttpInstance.uploadFiles({
+        uploadProgressCall: function (_obj) {
+          console.log("uploadProgressCall", _obj);
+        },
+        oneUploadedCall: function (_obj) {
+          console.log("oneUploadedCall", _obj);
+          const _data =
+            typeof response === "string" ? JSON.parse(response) : response;
+          //         _this.handleData(fileItem, _data, 'done');
+        },
+        files: [
+          {
+            fileName: fileItem.name,
+            file: fileItem,
+          },
+        ],
+      });
+      console.log(
+        "%c [ 上传完成 ]: ",
+        "color: #bf2c9f; background: pink; font-size: 13px;",
+        uploadResult
+      );
       // ajax({
       //     type: 'POST',
       //     url: `${this.hosts}${this.action}`,

+ 38 - 3
src/components/project-manage/form/items/date.vue

@@ -1,8 +1,14 @@
 <template>
-  <PickerDate :date="value" @change="date1Change" />
+  <PickerDate
+    :date="value"
+    @change="date1Change"
+    :range="formItemObj.isRegion"
+  />
 </template>
 
 <script>
+import { $Bus } from "@/utils/Bus";
+
 export default {
   props: {
     initValue: {
@@ -11,14 +17,43 @@ export default {
         return "";
       },
     },
+    formItemObj: {
+      type: Object,
+      default: () => {
+        return { isRegion: false };
+      },
+    },
   },
+  computed: {},
   data() {
     return {
-      value: this.initValue,
+      value: this.filterInitValue(this.initValue),
     };
   },
+  mounted() {
+    console.log(this.formItemObj.isRegion);
+  },
   methods: {
-    date1Change() {},
+    filterInitValue(str) {
+      if (!str) return str;
+      if (!this.formItemObj.isRegion) {
+        return this.getYearMonthDay(str);
+      } else {
+      }
+
+      return str;
+    },
+    date1Change(e) {
+      const date = e.replace(/\./g, "");
+
+      this.$emit("change", date);
+    },
+    getYearMonthDay(str) {
+      let year = str.slice(0, 4);
+      let month = str.slice(4, 6);
+      let day = str.slice(6, 8);
+      return `${year}.${month}.${day}`;
+    },
   },
 };
 </script>

+ 138 - 26
src/components/project-manage/form/items/input.vue

@@ -1,25 +1,50 @@
 <template>
   <!-- 输出框 -->
-  <Input
-    v-model="value"
-    :width="250"
-    :placeholder="placeholder"
-    :disabled="isDisabled"
-    :type="formItemObj.name === '项目简介' ? 'textarea' : 'input'"
-    :rows="6"
-    :right-button="
-      unit
-        ? [
-            {
-              id: '1',
-              name: unit,
-              checked: 'checked',
-            },
-          ]
-        : []
-    "
-    @input="change"
-  ></Input>
+  <div>
+    <div v-if="formItemObj.isMultiple" class="inputs">
+      <div v-for="(item, index) in value" :key="index" class="input-item">
+        <Input
+          v-model="item.value"
+          :placeholder="placeholder"
+          @input="change"
+        ></Input>
+        <img
+          class="img"
+          src="@/assets/images/project/Add.png"
+          @click="inputHandle('plus')"
+          v-if="value.length === 1 || index > 0"
+        />
+        <img
+          class="img"
+          src="@/assets/images/project/Delete.png"
+          @click="inputHandle('reduce', index)"
+          v-if="value.length > 1"
+        />
+      </div>
+    </div>
+    <Input
+      v-else
+      v-model="value"
+      :width="250"
+      :placeholder="placeholder"
+      :disabled="isDisabled"
+      :type="formItemObj.name === '项目简介' ? 'textarea' : 'input'"
+      :rows="6"
+      :errorInfo="errorInfo"
+      :right-button="
+        unit
+          ? [
+              {
+                id: '1',
+                name: unit,
+                checked: 'checked',
+              },
+            ]
+          : []
+      "
+      @input="change"
+    />
+  </div>
 </template>
 <script>
 export default {
@@ -39,22 +64,109 @@ export default {
     formItemObj: {
       type: Object,
       default: () => {
+        return { isMultiple: false };
+      },
+    },
+    info: {
+      type: Object,
+      default: () => {
         return {};
       },
     },
   },
+  computed: {
+    trueValue() {
+      if (typeof this.value === "number") {
+        return this.value.toString();
+      }
+
+      if (Array.isArray(this.value)) {
+        return this.value.filter((i) => i.value).map((i) => i.value);
+      }
+      return this.value;
+    },
+  },
   data() {
     return {
-      value:
-        typeof this.initValue === "number"
-          ? this.initValue.toString()
-          : this.initValue,
+      errorInfo: "",
+      value: this.filterInitValue(this.initValue),
     };
   },
+  mounted() {
+    // console.log(this.formItemObj.isMultiple);
+  },
   methods: {
-    change() {
-      this.$emit("change", this.value);
+    filterInitValue(init) {
+      if (typeof init === "number") {
+        return init.toString();
+      }
+      if (this.formItemObj.isMultiple) {
+        if (typeof init === "string") {
+          return [{ value: init }];
+        }
+        return init.map((i) => {
+          return {
+            value: i,
+          };
+        });
+      } else {
+        return init;
+      }
+    },
+    change(e) {
+      // this.$emit("change", this.value);
+      console.log(this.trueValue);
+      this.errorInfo = "";
+      const isNum = /^[0-9]+.?[0-9]*$/;
+      if (!["STRING", "TEXT"].includes(this.formItemObj.dataType)) {
+        if (!isNum.test(e)) {
+          this.errorInfo = "仅支持数字输入";
+          return;
+        }
+      }
+
+      this.$emit("change", this.trueValue);
+    },
+    inputHandle(type, index) {
+      if (type === "plus") {
+        this.value.push({ value: "" });
+      } else {
+        if (this.value.length === 1) return;
+        console.log(this.value);
+        this.value.splice(index, 1);
+      }
+    },
+  },
+  watch: {
+    info: {
+      handler(info) {
+        let pathArr = this.formItemObj.path.split(".");
+        if (pathArr.length > 1 && info[pathArr[0]].hasOwnProperty(pathArr[1])) {
+          this.value = this.filterInitValue(info[pathArr[0]][pathArr[1]]);
+        } else if (pathArr.length === 1) {
+          this.value = this.filterInitValue(info[pathArr[0]]);
+        }
+      },
+      deep: true,
     },
   },
 };
 </script>
+<style lang="less" scoped>
+.inputs {
+  display: flex;
+  flex-direction: column;
+  .input-item {
+    display: flex;
+    align-items: center;
+    .img {
+      &:nth-child(2) {
+        margin: 0 10px;
+      }
+    }
+    &:not(:nth-child(1)) {
+      margin-top: 8px;
+    }
+  }
+}
+</style>

+ 1 - 1
src/components/project-manage/form/items/label.vue

@@ -23,7 +23,7 @@ export default {
   props: {
     labelWidth: {
       type: Number,
-      default: 120,
+      default: 140,
     },
     popText: {
       type: String,

+ 20 - 9
src/components/project-manage/form/items/select.vue

@@ -1,11 +1,6 @@
 <template>
   <!-- 选择框 -->
-  <MCascade
-    width="180"
-    v-model="value"
-    :data="mapList(selectData)"
-    @change="change"
-  />
+  <PTreeSelect v-model="singleId" :data="treeList" @change="change" />
 </template>
 
 <script>
@@ -15,17 +10,24 @@ export default {
     initValue: {
       type: [String, Number, Array, Object],
       default: () => {
-        return [];
+        return "";
       },
     },
   },
   data() {
     return {
-      value: this.initValue === "" ? [] : [],
+      singleId: "12",
+      treeList: [{ id: "1", name: "11" }],
     };
   },
   methods: {
-    change(result) {},
+    openNode() {
+      console.log(111);
+    },
+    change(item) {
+      console.log(item, 111);
+      // this.$emit("change", result);
+    },
     mapList(list) {
       let _list = list.map((i) => {
         return {
@@ -35,6 +37,7 @@ export default {
         };
       });
       let tree = this.listToTree(_list);
+      console.log(tree);
       return tree;
     },
     listToTree(list) {
@@ -57,5 +60,13 @@ export default {
       return tree;
     },
   },
+  watch: {
+    value: {
+      handler(val) {
+        console.log(val);
+      },
+      deep: true,
+    },
+  },
 };
 </script>

+ 60 - 18
src/components/project-manage/index.vue

@@ -1,10 +1,11 @@
 <template>
-  <div class="container">
+  <div class="container" v-if="!refresh">
     <div class="left">
       <Anchor @goAnchor="goAnchor" :anchorList="anchorList" />
     </div>
     <div class="right">
-      <Basic
+      <Basic name="基础信息" :info="info" />
+      <Form
         v-for="(item, index) in anchorList"
         :key="index"
         :itemProps="item"
@@ -22,13 +23,15 @@
 <script>
 import Anchor from "./components/anchor.vue";
 import Basic from "./components/basic.vue";
+import Form from "./form/index.vue";
 import Geo from "./components/geo.vue";
 import Project from "./components/project.vue";
 import Business from "./components/business.vue";
 import { mapState } from "vuex";
 import ScanController from "@/controller/old-adm/ScanController";
 import Dic from "@/controller/old-adm/dicController";
-import Form from "./form/form.vue";
+import { IndexLoading } from "meri-design";
+import { $Bus } from "@/utils/Bus";
 export const dataTypeEnum = {
   INTEGER: "input",
   DOUBLE: "input",
@@ -42,8 +45,8 @@ export const dataTypeEnum = {
 };
 export default {
   components: {
-    Anchor,
     Basic,
+    Anchor,
     Geo,
     Project,
     Business,
@@ -53,6 +56,7 @@ export default {
     return {
       anchorList: [],
       info: {},
+      refresh: false,
     };
   },
   computed: {
@@ -62,10 +66,11 @@ export default {
   mounted() {
     this.getInfo();
     this.getDict();
+    this.initEvent();
   },
   methods: {
-    getDict() {
-      Dic.getDataDictionary({
+    async getDict() {
+      return Dic.getDataDictionary({
         type: "project",
         filters: `projectId=${this.projectId}`,
       }).then((res) => {
@@ -94,19 +99,13 @@ export default {
         console.log(keys);
       });
     },
-    getInfo() {
-      ScanController.getAllProject({
+    async getInfo() {
+      return ScanController.getAllProject({
         filters: `projectId=${this.projectId}`,
       }).then((res) => {
         console.log(res);
         if (res.content.length) {
           let info = res.content[0];
-          // const { id, localName, infos } = info;
-          // this.info.basic.id = id;
-          // this.info.basic.localName = localName;
-
-          // this.info.geo.lng = infos.longitude;
-          // this.info.geo.lat = infos.latitude;
           this.info = info;
         }
       });
@@ -120,16 +119,59 @@ export default {
       }
     },
     save() {
-      ScanController.updateProjectInfo({ content: this.info }).then((res) => {
-        console.log(res);
+      ScanController.updateProjectInfo({ content: [this.info] }).then((res) => {
+        this.$message.success("保存成功");
       });
       console.log(this.info);
     },
+    initEvent() {
+      $Bus.$on("formInfoChange", (values) => {
+        console.log(
+          "%c [ pathArr, value $on ]: ",
+          "color: #bf2c9f; background: pink; font-size: 13px;",
+          values
+        );
+        if (Array.isArray(values)) {
+          values.forEach((item) => {
+            const { pathArr, value } = item;
+            if (pathArr.length > 1) {
+              if (this.info[pathArr[0]].hasOwnProperty(pathArr[1])) {
+                this.$set(this.info[pathArr[0]], pathArr[1], value);
+              } else {
+                this.$set(this.info[pathArr[0]], pathArr[1], value);
+              }
+            } else if (pathArr.length === 1) {
+              this.info[pathArr[0]] = value;
+            }
+          });
+        } else {
+          const { pathArr, value } = values;
+          if (pathArr.length > 1) {
+            if (this.info[pathArr[0]].hasOwnProperty(pathArr[1])) {
+              this.$set(this.info[pathArr[0]], pathArr[1], value);
+            } else {
+              this.$set(this.info[pathArr[0]], pathArr[1], value);
+            }
+          } else if (pathArr.length === 1) {
+            this.info[pathArr[0]] = value;
+          }
+        }
+        console.log(this.info, "info");
+      });
+    },
   },
   watch: {
     projectId() {
-      this.getInfo();
-      this.getDict();
+      this.loading = IndexLoading();
+      this.refresh = true;
+      Promise.all([this.getInfo(), this.getDict()]).then(() => {
+        console.log(222);
+        this.refresh = false;
+        IndexLoading.remove(this.loading);
+      });
+      // this.getInfo();
+      // this.getDict();
+      // this.openLoading();
     },
   },
 };

+ 2 - 1
src/meri.js

@@ -1,5 +1,5 @@
 import Vue from 'vue'
-import {Button, Input, MSelect, Icon, Popover, ImageUpload, Modal, MCascade, PickerDate, Divider} from 'meri-design'
+import {Button, Input, MSelect, Icon, Popover, ImageUpload, Modal, MCascade, PickerDate, Divider, PTreeSelect} from 'meri-design'
 
 Vue.use(Button)
 Vue.use(Input)
@@ -11,3 +11,4 @@ Vue.use(Modal)
 Vue.use(MCascade)
 Vue.use(PickerDate)
 Vue.use(Divider)
+Vue.use(PTreeSelect)

+ 106 - 42
src/utils/http/basic/axiosUtils.ts

@@ -7,7 +7,7 @@ import axios from "axios";
 import vueStore from "@/store";
 import { logicConfig } from "@/logicConfig";
 import { toolUtils } from "@/utils/toolUtils";
-import SparkMD5 from 'spark-md5';
+import SparkMD5 from "spark-md5";
 
 var CancelToken = axios.CancelToken;
 var cancel;
@@ -57,7 +57,12 @@ export class axiosUtils {
 
       var _newParamStr = toolUtils.objectKeyToUrlParam(data);
 
-      var newUrl = urlPrefix + '?' + _newParamStr + (_newParamStr ? '&' : '') + urlParamStr;
+      var newUrl =
+        urlPrefix +
+        "?" +
+        _newParamStr +
+        (_newParamStr ? "&" : "") +
+        urlParamStr;
 
       let response = await this.customRequest(newUrl, {}, {}, "get");
       return response;
@@ -130,11 +135,14 @@ export class axiosUtils {
     } catch (err) {
       // throw err;
       console.error(err);
-      return toolUtils.resultConstructor(logicConfig.resultObj.failure, null, '请求异常,' + err.message);
+      return toolUtils.resultConstructor(
+        logicConfig.resultObj.failure,
+        null,
+        "请求异常," + err.message
+      );
     }
   }
 
-
   /**
    * 上传文件
    * @param _paramobj 格式如下:
@@ -144,7 +152,7 @@ export class axiosUtils {
    *    oneUploadedCall 每上传完一个后的回调函数,函数参数为object,格式如下:{fileName:'文件名称',fileId:'文件ID'}
    *    userId:'不传时,默认会取vuex中user.id',
    *    files 数组或者object,示例
-   *    { 
+   *    {
    *      groupCode:'不传时,默认会取vuex中selectProject.groupCode',
    *      projectId:'不传时,默认会取vuex中selectProject.id',
    *      fileName:'文件名称',
@@ -152,7 +160,7 @@ export class axiosUtils {
    *      file:文件信息,假设有一个input type为file id为txtFile的标签,那么file为document.getElementById('txtFile').files[0]
    *    }
    * }
-   * @returns 
+   * @returns
    */
   protected async uploadFiles(_paramobj: any) {
     //注意,这里的this 指向的是实例化的子类
@@ -160,6 +168,11 @@ export class axiosUtils {
     let userId = _paramobj.userId || vueStore.state.user.id;
     let fileServiceUrl = _paramobj.fileServiceUrl;
     let files = _paramobj.files;
+    console.log(
+      "%c [ files ]: ",
+      "color: #bf2c9f; background: pink; font-size: 13px;",
+      files
+    );
     try {
       let waitFiles = files instanceof Array == true ? files : [files];
       //上传成功的文件数量
@@ -167,45 +180,84 @@ export class axiosUtils {
 
       for (let i = 0; i < waitFiles.length; i++) {
         let _currFileObj = waitFiles[i];
-
+        console.log(
+          "%c [ _currFileObj ]: ",
+          "color: #bf2c9f; background: pink; font-size: 13px;",
+          _currFileObj
+        );
         //获取文件md5
         let fileContentMd5 = await getFileContentMd5(_currFileObj);
         //获取文件上传地址
-        let getUploadResult = await getUploadUrl(fileContentMd5 as string, _currFileObj);
+        let getUploadResult = await getUploadUrl(
+          fileContentMd5 as string,
+          _currFileObj
+        );
         switch (getUploadResult.result) {
           case logicConfig.resultObj.success:
             let getUploadData = getUploadResult.data || {};
             //uploadCode 200 代表已经上传过了;    201  代表需上传
-            switch (getUploadData.uploadCode) { 
+            switch (getUploadData.uploadCode) {
               case 201:
                 //获取文件地址上传成功时进行上传
-                let uploadUrl = ((getUploadData.content || [])[0] || {}).uploadUrl;
+                let uploadUrl = ((getUploadData.content || [])[0] || {})
+                  .uploadUrl;
                 if (!uploadUrl)
-                  return toolUtils.resultConstructor(logicConfig.resultObj.failure, null, '未获取到文件' + _currFileObj.fileName + '的上传地址');
+                  return toolUtils.resultConstructor(
+                    logicConfig.resultObj.failure,
+                    null,
+                    "未获取到文件" + _currFileObj.fileName + "的上传地址"
+                  );
                 //开始上传
-                await upload(uploadUrl, _currFileObj.file, function (progressObj) {
-                  if (typeof _paramobj.uploadProgressCall == 'function') {
-                    let uploadedFileSize = progressObj.loaded / progressObj.total * _currFileObj.file.size;
-                    _paramobj.uploadProgressCall({ uploadedTotal: uploadedFileSize, fileName: _currFileObj.fileName });
+                await upload(
+                  uploadUrl,
+                  _currFileObj.file,
+                  function (progressObj) {
+                    if (typeof _paramobj.uploadProgressCall == "function") {
+                      let uploadedFileSize =
+                        (progressObj.loaded / progressObj.total) *
+                        _currFileObj.file.size;
+                      _paramobj.uploadProgressCall({
+                        uploadedTotal: uploadedFileSize,
+                        fileName: _currFileObj.fileName,
+                      });
+                    }
                   }
-                });
+                );
               case 200:
                 ++uploadedCount;
-                if (typeof _paramobj.oneUploadedCall == 'function') {
-                  _paramobj.oneUploadedCall({ fileName: _currFileObj.fileName, fileId: getUploadData.id });
+                if (typeof _paramobj.oneUploadedCall == "function") {
+                  _paramobj.oneUploadedCall({
+                    fileName: _currFileObj.fileName,
+                    fileId: getUploadData.id,
+                  });
                 }
                 break;
             }
             break;
           default:
-            return toolUtils.resultConstructor(logicConfig.resultObj.failure, null, '获取文件' + _currFileObj.fileName + '的上传地址时出错:' + getUploadResult.message);
+            return toolUtils.resultConstructor(
+              logicConfig.resultObj.failure,
+              null,
+              "获取文件" +
+                _currFileObj.fileName +
+                "的上传地址时出错:" +
+                getUploadResult.message
+            );
         }
         if (uploadedCount == waitFiles.length)
-          return toolUtils.resultConstructor(logicConfig.resultObj.success, null, null);
+          return toolUtils.resultConstructor(
+            logicConfig.resultObj.success,
+            null,
+            null
+          );
       }
     } catch (error) {
       console.error(error);
-      return toolUtils.resultConstructor(logicConfig.resultObj.failure, null, error.message);
+      return toolUtils.resultConstructor(
+        logicConfig.resultObj.failure,
+        null,
+        error.message
+      );
     }
 
     //获取文件内容的md5值
@@ -219,13 +271,13 @@ export class axiosUtils {
         let spark = new SparkMD5.ArrayBuffer();
         let fileReader = new FileReader();
         fileReader.onload = function (e) {
-          spark.append(e.target.result);                   // Append array buffer
+          spark.append(e.target.result); // Append array buffer
           currentChunk++;
           if (currentChunk < chunks) {
             loadNext();
           } else {
             let fileContentMd5 = spark.end();
-            console.info('computed hash', fileContentMd5);  // Compute hash
+            console.info("computed hash", fileContentMd5); // Compute hash
             //文件md5获取完成后,调用后台接口获取上传地址
             // let getUploadResult = await getUploadUrl(fileContentMd5, _fileObj.fileName, file.size);
             resolve(fileContentMd5);
@@ -233,56 +285,68 @@ export class axiosUtils {
         };
 
         fileReader.onerror = function (e) {
-          let errStr = '文件:' + _fileObj.fileName + '读取错误:';
+          let errStr = "文件:" + _fileObj.fileName + "读取错误:";
           console.error(e);
           reject(errStr);
         };
 
         function loadNext() {
           var start = currentChunk * chunkSize,
-            end = ((start + chunkSize) >= file.size) ? file.size : start + chunkSize;
+            end =
+              start + chunkSize >= file.size ? file.size : start + chunkSize;
 
           fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
         }
 
         loadNext();
       });
-    };
+    }
 
     //获取文件上传地址
     async function getUploadUrl(fileContentMd5: string, _fileObj: any) {
       let fileName = _fileObj.fileName;
       let fileSize = _fileObj.file.size;
       let projectId = _fileObj.projectId || vueStore.state.selectProject.id;
-      let groupCode = _fileObj.groupCode || vueStore.state.selectProject.groupCode;
+      let groupCode =
+        _fileObj.groupCode || vueStore.state.selectProject.groupCode;
       //应用ID暂时用不上
-      let appId = '';
+      let appId = "";
 
-      let getUploadUrl = toolUtils.getBaseHttpUrl(fileServiceUrl, 'file/initSingleUpload') +
-        '?userId=' + userId + '&projectId=' + projectId + '&groupCode=' + groupCode + '&appId=';
+      let getUploadUrl =
+        toolUtils.getBaseHttpUrl(fileServiceUrl, "file/initSingleUpload") +
+        "?userId=" +
+        userId +
+        "&projectId=" +
+        projectId +
+        "&groupCode=" +
+        groupCode +
+        "&appId=";
 
       let paramObj = {
         fileMd5: fileContentMd5,
         fileName: fileName,
         fileBucket: (window as any).__systemConf.baseRouteUrl,
-        fileSize: fileSize
+        fileSize: fileSize,
       };
-      return await _this.customRequest(getUploadUrl, null, paramObj, 'post');
-    };
+      return await _this.customRequest(getUploadUrl, null, paramObj, "post");
+    }
 
     //上传
     async function upload(uploadUrl, file, uploadProgressCall) {
       return new Promise((resolve, reject) => {
         var formData = new FormData();
-        formData.append('file', file);
-        axios.put(uploadUrl, formData, {
-          onUploadProgress: uploadProgressCall
-        }).then(function (res) {
-          resolve(res);
-        }).catch(function (error) {
-          reject(error);
-        });
+        formData.append("file", file);
+        axios
+          .put(uploadUrl, formData, {
+            onUploadProgress: uploadProgressCall,
+          })
+          .then(function (res) {
+            resolve(res);
+          })
+          .catch(function (error) {
+            reject(error);
+          });
       });
     }
-  };
+  }
 }