{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\components\\dialog\\ViewDefinedDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\components\\dialog\\ViewDefinedDialog.vue","mtime":1675214576839},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport req from '@/request.js'\r\nexport default {\r\n  data() {\r\n    return {\r\n      dialogVisible: false,\r\n      header: [],\r\n      dataList: [],\r\n      arr_: [],\r\n      arr: [],\r\n      count: 0,\r\n      loading: false,\r\n      searchForm: {\r\n        id: '',\r\n        projectId: '',\r\n        projectName: '',\r\n        projectType: '',\r\n        endMoney: '',\r\n        startMoney: '',\r\n        createTime: '',\r\n      },\r\n      optionYears: [], //顶部搜索年份选择数组\r\n      isRefresh: true, // 是否刷新数据\r\n      downloading: false, // 是否导出加载中\r\n    }\r\n  },\r\n  computed: {\r\n    noMore() {\r\n      return this.count >= this.arr.length\r\n    },\r\n    disabled() {\r\n      return this.loading || this.noMore\r\n    },\r\n  },\r\n  mounted() {\r\n    this.getYear()\r\n  },\r\n  watch: {\r\n    // 监听json数据变化，重新渲染文件夹内容\r\n    dataList(newVal) {\r\n      this.isRefresh = false\r\n      if (true) {\r\n        this.$nextTick(() => {\r\n          // $nextTick 是在 DOM 更新循环结束之后执行延迟回调\r\n          this.isRefresh = true\r\n        })\r\n      }\r\n    },\r\n  },\r\n  methods: {\r\n    handleChange(val, obj) {\r\n      if (val) {\r\n        this.searchForm.projectId = val\r\n        this.searchForm.projectName = obj.projectName\r\n      }\r\n    },\r\n    handleReset() {\r\n      this.searchForm.projectId = ''\r\n      this.searchForm.projectName = ''\r\n      this.searchForm.projectType = ''\r\n      this.searchForm.createTime = ''\r\n      this.searchForm.startMoney = ''\r\n      this.searchForm.endMoney = ''\r\n      this.$http\r\n        .post('${cqxy}/biz/menuFieldTemp/v1/getDataById', this.searchForm)\r\n        .then((res) => {\r\n          this.open(res.data.value)\r\n        })\r\n    },\r\n    handleDownload() {\r\n     let search = this.cloneObj(this.searchForm)\r\n      for (let i in search) {\r\n        if (search[i] && typeof search[i] !== 'undefined') {\r\n          if (i == 'createTime') {\r\n            search.startTime = `${search[i]}-01-01`\r\n            search.endTime = `${search[i]}-12-31`\r\n          }\r\n        }\r\n      }\r\n      delete search.createTime\r\n        this.downloading = true\r\n        req\r\n          .downloadPostCopy(\r\n            '${cqxy}/biz/menuFieldTemp/v1/exportDataById',\r\n            search\r\n          )\r\n          .then((res) => {\r\n            this.downloading = false\r\n          })\r\n          .catch((res) => {\r\n            this.downloading = false\r\n          })\r\n    },\r\n    // 拷贝对象\r\n    cloneObj(obj) {\r\n      let clone = {}\r\n      for (let i of Object.keys(obj)) {\r\n        clone[i] = obj[i]\r\n      }\r\n      return clone\r\n    },\r\n    handleSearch() {\r\n      let search = this.cloneObj(this.searchForm)\r\n      for (let i in search) {\r\n        if (search[i] && typeof search[i] !== 'undefined') {\r\n          if (i == 'createTime') {\r\n            search.startTime = `${search[i]}-01-01`\r\n            search.endTime = `${search[i]}-12-31`\r\n          }\r\n        }\r\n      }\r\n      delete search.createTime\r\n      this.$http\r\n        .post('${cqxy}/biz/menuFieldTemp/v1/getDataById', search)\r\n        .then((res) => {\r\n          this.open(res.data.value)\r\n        })\r\n      // }\r\n    },\r\n    //获取顶部搜索的年份区间\r\n    getYear() {\r\n      const myDate = new Date()\r\n      const startYear = 2006 //起始年份\r\n      const endYear = myDate.getFullYear() //结束年份\r\n      for (let i = endYear; i >= startYear; i--) {\r\n        this.optionYears.push({\r\n          label: i + '年',\r\n          value: i,\r\n        })\r\n      }\r\n    },\r\n    open(data) {\r\n      if (data.id) {\r\n        this.templeteId = data.id\r\n        this.searchForm.id = this.templeteId\r\n        if (data.flag) {\r\n          this.searchForm.projectId = data.projectId\r\n          this.searchForm.projectName = data.projectName\r\n        }\r\n      }\r\n      this.arr = []\r\n      this.dataList = []\r\n      this.count = 0\r\n      this.dialogVisible = true\r\n      this.header = data.header\r\n      data.dataList.forEach((item, index) => {\r\n        item.forEach((item1) => {\r\n          let obj = {\r\n            name: item1,\r\n            showTooltip: false,\r\n          }\r\n          this.arr_.push(obj)\r\n        })\r\n        this.arr.push(this.arr_)\r\n        this.arr_ = []\r\n      })\r\n    },\r\n    load() {\r\n      // console.log('44444444')\r\n      this.count += 5\r\n      this.dataList = this.arr.slice(0, this.count)\r\n    },\r\n    handleClose(done) {\r\n      done()\r\n    },\r\n    isShowTooltip(obj, row) {\r\n      const TemporaryTag = document.createElement('span')\r\n      TemporaryTag.innerText = row.name\r\n      TemporaryTag.className = 'getTextWidth'\r\n      document.querySelector('body').appendChild(TemporaryTag)\r\n      const currentWidth = document.querySelector('.getTextWidth').offsetWidth\r\n      document.querySelector('.getTextWidth').remove()\r\n\r\n      /* cellWidth为表格容器的宽度*/\r\n      const cellWidth = obj.target.offsetWidth\r\n      /* 当文本宽度小于||等于容器宽度两倍时，代表文本显示未超过两行  可以 cellWidth *2，3，4....  */\r\n      currentWidth <= cellWidth * 2\r\n        ? (row.showTooltip = false)\r\n        : (row.showTooltip = true)\r\n    },\r\n  },\r\n}\r\n",null]}