收藏
回答

代码依赖分析异常?

  


   getCarData() {
      const that = this;
    let comment = {};


    function loadCarData(moduleId, dataPath) {
      const carData = require(dataPath);
      comment = {
        ...carData.carInfos,
      };
      if (moduleId === "4") {
        let carInfoNotRe = [...comment.carInfoNotRe];
        if (that.data.type === "1") {
          // 牵引车-带罐
          carInfoNotRe = [...carInfoNotRe, ...carData.tractorGuanArray];
          that.data.params.withTankCar = "1";
        } else if (that.data.type === "2") {
          // 牵引车-带挂
          carInfoNotRe = [...carInfoNotRe, ...carData.tractorGuaArray];
          that.data.params.withTrailer = "1";
        } else {
          // 牵引车
          carInfoNotRe = [...carInfoNotRe, ...carData.tractorArray];
        }
        comment.carInfoNotRe = carInfoNotRe;
      } else if (moduleId === "6") {
        let carInfoNotRe = [...comment.carInfoNotRe];
        if (that.data.type === "1") {
          carInfoNotRe = [...carInfoNotRe, ...carData.truckColdArray];
          that.data.params.withTankCar = "1";
        } else {
          carInfoNotRe = [...carInfoNotRe, ...carData.truckArray];
        }
        comment.carInfoNotRe = carInfoNotRe;
      }
    }
    switch (that.data.params.modelid) {
      case "4": //牵引车
        loadCarData(that.data.params.modelid, "../configuration/tractor_data");
        break;
      case "6": //"载货车"
        loadCarData(that.data.params.modelid, "../configuration/truck_data");
        break;
      case "12": //挂车
        loadCarData(that.data.params.modelid, "../configuration/trailer_data");
        break;
      case "13": //自卸车
        loadCarData(that.data.params.modelid, "../configuration/dumptruck_data");
        break;
      case "7": //混凝土搅拌车
        loadCarData(that.data.params.modelid, "../configuration/mixer_data");
        break;
      case "15": //散装物料车
        loadCarData(that.data.params.modelid, "../configuration/bulkmaterial_data");
        break;
      case "16": //油罐车
        loadCarData(that.data.params.modelid, "../configuration/oiltank_data");
        break;
      case "17": //冷藏车
        loadCarData(that.data.params.modelid, "../configuration/refrigerated_data");
        break;
      case "14": //其他车型
        loadCarData(that.data.params.modelid, "../configuration/othervehicle_data");
        break;
      case "18": //洒水车
        loadCarData(that.data.params.modelid, "../configuration/sprinkler_data");
        break;
      case "19": //吊车
        loadCarData(that.data.params.modelid, "../configuration/crane_data");
        break;
      case "20": //混凝土泵车
        loadCarData(that.data.params.modelid, "../configuration/concretepump_data");
        break;
    }
    that.setData({
      carInfos: comment,
    });
    that.initValidate();

  但是引用的数据都正常,也在project.config.json设置了导入,昨天运行加上导入就不提示了 今天打开又提示

"packOptions": {
    "ignore": [],
    "include": [
      {
        "value": "pages/publishauction/configuration",
        "type": "folder"
      }
    ]
  },


最后一次编辑于  07-31
回答关注问题邀请回答
收藏
登录 后发表内容