春风项目四线(合箱线、总装线)
jiang
2024-01-25 901b68695fcdab7e3ff1d5df3df88bd5001b0181
jcdm-ui/src/views/main/pr/tightenReport/index.vue
@@ -14,14 +14,17 @@
            placeholder="请输入工位号"
            @keyup.enter.native="handleQuery"/>
        </el-form-item>
        <el-form-item label-width="120"  label="采集时间" prop="startDate">
            <el-date-picker
              v-model="dateRange"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期">
            </el-date-picker>
        <el-form-item label-width="130" label="保存日期" prop="dateConditions">
          <el-date-picker
            v-model="queryParams.dateConditions"
            type="datetimerange"
            :picker-options="pickerOptions"
            value-format="yyyy-MM-dd HH:mm:ss"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            align="right">
          </el-date-picker>
        </el-form-item>
        <el-form-item style="float: right">
          <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>
@@ -40,7 +43,7 @@
        <el-table-column label="参数值" align="center" prop="paramValue"></el-table-column>
        <el-table-column label="采集时间" align="center" prop="collectionTime" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d}') }}</span>
            <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="状态" align="center" prop="state"></el-table-column>
@@ -110,7 +113,35 @@
        unit: null,
        type: '拧紧数据',
        startDate: null,
        endDate: null
        endDate: null,
        dateConditions: [],
      },
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            picker.$emit('pick', [start, end]);
          }
        }]
      },
    }
  },
@@ -118,21 +149,6 @@
    this.getList();
  },
  methods: {
    //   async fetchData() {
    //     // 构建API请求的URL,使用选择的日期范围作为查询参数
    //     const url = `@/api/main/da/paramCollection/paramCollection?startDate=${this.dateRange[0]}&endDate=${this.dateRange[1]}`;
    //
    //     try {
    //       // 发送API请求,获取查询结果
    //       const response = await fetch(url);
    //       const data = await response.json();
    //       console.log(data); // 处理查询结果,比如在控制台输出或显示在页面上
    //     } catch (error) {
    //       console.error('Error fetching data:', error);
    //     }
    //   },
    // },
    reset() {
      this.form = {