xiebin
2022-09-19 09ee4f46546548070be3abdc6223fad88553fa5e
src/views/taskinfo/taskinfo.vue
@@ -28,16 +28,24 @@
                   @click="handleDelete">删 除
        </el-button>
      </template>
      <template slot="routeRangeForm">
        <open-layers-map ref="OpenLayersMap" @toData="toData" :routeRange="form.routeRange"></open-layers-map>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/taskinfo/taskinfo";
  import option from "@/const/taskinfo/taskinfo";
  import {mapGetters} from "vuex";
  import OpenLayersMap from "@/components/OpenLayersMap";
  export default {
    components: { OpenLayersMap },
    data() {
      return {
        form: {},
@@ -149,6 +157,7 @@
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
            this.form.routeRange = '\'' + this.form.routeRange + '\''
          });
        } else {
          const date = new Date()
@@ -157,6 +166,8 @@
          const strDate = date.getDate()
          this.form.startTime = `${year}-${month}-${strDate} 00:00:00`
          this.form.endTime = `${year}-${month}-${strDate} 23:59:59`
          this.form.source = 'SYSTEMNEW'
          this.form.state = '0'
        }
        done();
      },
@@ -165,7 +176,6 @@
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        params
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
@@ -196,6 +206,9 @@
          this.loading = false;
          this.selectionClear();
        });
      },
      toData(toData) {
        this.form.routeRange = toData
      }
    }
  };