From d6a0abe9024f87fc517a2b71df0f17c5cadc41a0 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 29 Jul 2022 16:02:25 +0800
Subject: [PATCH] 合并冲突

---
 src/views/land/landMap.vue |  627 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 310 insertions(+), 317 deletions(-)

diff --git a/src/views/land/landMap.vue b/src/views/land/landMap.vue
index 200db54..d856a25 100644
--- a/src/views/land/landMap.vue
+++ b/src/views/land/landMap.vue
@@ -1,344 +1,337 @@
 <template>
-  <basic-container>
-    <avue-crud
-      class="tablesss"
-      :before-open="beforeOpen"
-      :option="option"
-      :data="data"
-      :page.sync="page"
-      v-model="form"
-      ref="crud"
-      :permission="permissionList"
-      @on-load="onLoad"
-      :table-loading="loading"
-      @row-save="rowSave"
-      @search-change="searchChange"
-      @search-reset="searchReset"
-      @row-update="rowUpdate"
-      @row-del="rowDel"
-      @selection-change="selectionChange"
-      @refresh-change="refreshChange"
-    >
-      <template slot="menuLeft">
-        <el-button
-          type="danger"
-          size="small"
-          plain
-          icon="el-icon-delete"
-          v-if="permission.rail_delete"
-          @click="handleDelete"
-        >删 除
-        </el-button>
-      </template>
-      <!-- 地图插入 -->
-      <template slot-scope="{ type, disabled }" slot="lineForm">
-        <getMapDataInThere
-          ref="getMapData"
-          id="getMapData"
-          @setMapData="setMapData"
-        ></getMapDataInThere>
-      </template>
-    </avue-crud>
-  </basic-container>
+    <basic-container>
+        <avue-crud
+            class="tablesss"
+            :before-open="beforeOpen"
+            :option="option"
+            :data="data"
+            :page.sync="page"
+            v-model="form"
+            ref="crud"
+            :permission="permissionList"
+            @on-load="onLoad"
+            :table-loading="loading"
+            @row-save="rowSave"
+            @search-change="searchChange"
+            @search-reset="searchReset"
+            @row-update="rowUpdate"
+            @row-del="rowDel"
+            @selection-change="selectionChange"
+            @refresh-change="refreshChange"
+        >
+            <template slot="menuLeft">
+                <el-button
+                    type="danger"
+                    size="small"
+                    plain
+                    icon="el-icon-delete"
+                    v-if="permission.rail_delete"
+                    @click="handleDelete"
+                >删 除</el-button>
+            </template>
+            <!-- 地图插入 -->
+            <template slot-scope="{ type, disabled }" slot="lineForm">
+                <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>
+            </template>
+        </avue-crud>
+    </basic-container>
 </template>
 
 <script>
-import {getList, add, update, remove,getDetail} from "@/api/land/land";
-import getMapDataInThere from "./getMapDataInThere.vue";
+import { getList, add, update, remove, getDetail } from "@/api/land/land"
+import getMapDataInThere from "./getMapDataInThere.vue"
 
-import {mapGetters} from "vuex";
+import { mapGetters } from "vuex"
 
 export default {
-  components: {
-    getMapDataInThere
-  },
-  data() {
-    return {
-      loading: true,
-      selectionList: [],
-      page: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 0
-      },
-      form: {},
-      query: {},
-      data: [],
-      option: {
-        index: true,
-        tip: false,
-        addBtn: true,
-        viewBtn: true,
-        searchMenuSpan: 6,
-        height: 583,
-        menuWidth: 300,
-        border: true,
-        align: "center",
-        selection: true,
-        column: [
-          {
-            label: "地块名称",
-            search: true,
-            prop: "landName",
-            rules: [{
-              required: true,
-              message: "请输入地块名称",
-              trigger: "blur"
-            }]
-          },
-          {
-            label: "地块类型",
-            type: "select",
-            prop: "landType",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=land",
-            props: {
-              label: "dictValue",
-              value: "dictKey"
+    components: {
+        getMapDataInThere
+    },
+    data () {
+        return {
+            loading: true,
+            selectionList: [],
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0
             },
-            dataType: "number",
-            search: true,
-            rules: [{
-              required: true,
-              message: "请选择地块类型",
-              trigger: "blur"
-            }]
-          },
-          {
-            label: "地块面积",
-            span: 6,
-            addDisplay: false,
-            disabled: true,
-            gutter: 20,
-            tip: '绘制轮廓后自动计算',
-            prop: "landArea",
-          },
-          // {
-          //   label: "地块范围",
-          //   prop: "landRange",
-          // },
-          // {
-          //   label: "状态 (0:已耕种 1:未耕种)",
-          //   prop: "type",
-          //   rules: [{
-          //     required: true,
-          //     message: "请输入状态 (0:已耕种 1:未耕种)",
-          //     trigger: "blur"
-          //   }]
-          // },
-          {
-            label: "面积单位",
-            prop: "landUnit",
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=landunit",
-            props: {
-              label: "dictValue",
-              value: "dictKey"
-            },
-            dataType: "number",
-            span: 6,
-          },
-          {
-            label: "路线展示",
-            labelWidth: "0",
-            prop: "line",
-            className: "mapClass",
-            hide: true,
-            display: true,
-            span: 24,
-            formslot: true,
-            addDisplay: true
-          }
-        ],
-      }
-    };
-  },
-  created() {
-    // this.getRailLazyTree();
-  },
-  computed: {
-    ...mapGetters(["userInfo", "permission", "polygons"]),
-    permissionList() {
-      return {
-        addBtn: this.vaildData(this.permission.land_add, false),
-        viewBtn: this.vaildData(this.permission.land_view, false),
-        delBtn: this.vaildData(this.permission.land_delete, false),
-        editBtn: this.vaildData(this.permission.land_edit, false)
-      };
-    },
-    ids() {
-      let ids = [];
-      this.selectionList.forEach(ele => {
-        ids.push(ele.id);
-      });
-      return ids.join(",");
-    }
-  },
-  mounted() {
-  },
-  methods: {
-    rowSave(row, done, loading) {
-      if (this.polygons.length == 0) {
-        //没有面的数据
-        this.$refs.getMapData.isCheck = true;
-        loading();
-      } else {
-        //如果有值,空间坐标转换
-        let pol = this.polygons;
-        let polLength = this.polygons.length - 1;
-        let usePolygons = "";
-        for (let k in pol) {
-          usePolygons += pol[k].lng + "," + pol[k].lat;
-          if (k != polLength) {
-            usePolygons += ";";
-          }
-        }
-        //设置坐标点
-        row.userId = this.userInfo.user_id;
-        row.landRange = usePolygons;
-      }
-      add(row).then(() => {
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        loading();
-        window.console.log(error);
-      });
-    },
-    rowUpdate(row, index, done, loading) {
-      update(row).then(() => {
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        loading();
-        console.log(error);
-      });
-    },
-    rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return remove(row.id);
-        })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-        });
-    },
-    handleDelete() {
-      if (this.selectionList.length === 0) {
-        this.$message.warning("请选择至少一条数据");
-        return;
-      }
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return remove(this.ids);
-        })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          this.$refs.crud.toggleSelection();
-        });
-    },
-    beforeOpen(done, type) {
-      if (["edit", "view"].includes(type)) {
-        // getDetail(this.form.id).then(res => {
-        //   this.form = res.data.data;
-        // });
-        getDetail(this.form.id).then((res) => {
-          if (res.data.code == 200) {
-            this.form = res.data.data;
-            let usePolygons = this.form.landRange
-              .split("POLYGON((")[1]
-              .split("))")[0]
-              .split(",");
-            for (let k in usePolygons) {
-              usePolygons[k] = {
-                lng: +usePolygons[k].split(" ")[0],
-                lat: +usePolygons[k].split(" ")[1],
-              };
+            form: {},
+            query: {},
+            data: [],
+            option: {
+                index: true,
+                tip: false,
+                addBtn: true,
+                viewBtn: true,
+                searchMenuSpan: 6,
+                height: 583,
+                menuWidth: 300,
+                border: true,
+                align: "center",
+                selection: true,
+                column: [
+                    {
+                        label: "地块名称",
+                        search: true,
+                        prop: "landName",
+                        rules: [{
+                            required: true,
+                            message: "请输入地块名称",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: "地块类型",
+                        type: "select",
+                        prop: "landType",
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=land",
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey"
+                        },
+                        dataType: "number",
+                        search: true,
+                        rules: [{
+                            required: true,
+                            message: "请选择地块类型",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: "地块面积",
+                        span: 6,
+                        addDisplay: false,
+                        disabled: true,
+                        gutter: 20,
+                        tip: '绘制轮廓后自动计算',
+                        prop: "landArea",
+                    },
+                    // {
+                    //   label: "地块范围",
+                    //   prop: "landRange",
+                    // },
+                    // {
+                    //   label: "状态 (0:已耕种 1:未耕种)",
+                    //   prop: "type",
+                    //   rules: [{
+                    //     required: true,
+                    //     message: "请输入状态 (0:已耕种 1:未耕种)",
+                    //     trigger: "blur"
+                    //   }]
+                    // },
+                    {
+                        label: "面积单位",
+                        prop: "landUnit",
+                        type: "select",
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=landunit",
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey"
+                        },
+                        dataType: "number",
+                        span: 6,
+                    },
+                    {
+                        label: "路线展示",
+                        labelWidth: "0",
+                        prop: "line",
+                        className: "mapClass",
+                        hide: true,
+                        display: true,
+                        span: 24,
+                        formslot: true,
+                        addDisplay: true
+                    }
+                ],
             }
-            this.$refs.getMapData.draw(usePolygons);
-          }
-        });
-      }
-      done();
+        }
     },
-    searchReset() {
-      this.query = {};
-      this.onLoad(this.page);
+    created () {
+        // this.getRailLazyTree();
     },
-    searchChange(params, done) {
-      this.query = params;
-      this.page.currentPage = 1;
-      this.onLoad(this.page, params);
-      done();
+    computed: {
+        ...mapGetters(["userInfo", "permission", "polygons"]),
+        permissionList () {
+            return {
+                addBtn: this.vaildData(this.permission.land_add, false),
+                viewBtn: this.vaildData(this.permission.land_view, false),
+                delBtn: this.vaildData(this.permission.land_delete, false),
+                editBtn: this.vaildData(this.permission.land_edit, false)
+            }
+        },
+        ids () {
+            let ids = []
+            this.selectionList.forEach(ele => {
+                ids.push(ele.id)
+            })
+            return ids.join(",")
+        }
     },
-    selectionChange(list) {
-      this.selectionList = list;
+    mounted () {
     },
-    selectionClear() {
-      this.selectionList = [];
-      this.$refs.crud.toggleSelection();
-    },
-    currentChange(currentPage) {
-      this.page.currentPage = currentPage;
-    },
-    sizeChange(pageSize) {
-      this.page.pageSize = pageSize;
-    },
-    refreshChange() {
-      this.onLoad(this.page, this.query);
-    },
-    onLoad(page, params = {}) {
-      this.loading = true;
-      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
-        const data = res.data.data;
-        this.page.total = data.total;
-        this.data = data.records;
-        this.loading = false;
-        this.selectionClear();
-      });
+    methods: {
+        rowSave (row, done, loading) {
+            if (this.polygons.length == 0) {
+                //没有面的数据
+                this.$refs.getMapData.isCheck = true
+                loading()
+            } else {
+                //如果有值,空间坐标转换
+                let pol = this.polygons
+                let polLength = this.polygons.length - 1
+                let usePolygons = ""
+                for (let k in pol) {
+                    usePolygons += pol[k].lng + "," + pol[k].lat
+                    if (k != polLength) {
+                        usePolygons += ";"
+                    }
+                }
+                //设置坐标点
+                row.userId = this.userInfo.user_id
+                row.landRange = usePolygons
+            }
+            add(row).then(() => {
+                this.onLoad(this.page)
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                })
+                done()
+            }, error => {
+                loading()
+                window.console.log(error)
+            })
+        },
+        rowUpdate (row, index, done, loading) {
+            update(row).then(() => {
+                this.onLoad(this.page)
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                })
+                done()
+            }, error => {
+                loading()
+                console.log(error)
+            })
+        },
+        rowDel (row) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    return remove(row.id)
+                })
+                .then(() => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    })
+                })
+        },
+        handleDelete () {
+            if (this.selectionList.length === 0) {
+                this.$message.warning("请选择至少一条数据")
+                return
+            }
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    return remove(this.ids)
+                })
+                .then(() => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    })
+                    this.$refs.crud.toggleSelection()
+                })
+        },
+        beforeOpen (done, type) {
+            if (["edit", "view"].includes(type)) {
+                // getDetail(this.form.id).then(res => {
+                //   this.form = res.data.data;
+                // });
+                getDetail(this.form.id).then((res) => {
+                    if (res.data.code == 200) {
+                        this.form = res.data.data
+                        let usePolygons = this.form.landRange
+                            .split("POLYGON((")[1]
+                            .split("))")[0]
+                            .split(",")
+                        for (let k in usePolygons) {
+                            usePolygons[k] = {
+                                lng: +usePolygons[k].split(" ")[0],
+                                lat: +usePolygons[k].split(" ")[1],
+                            }
+                        }
+                        this.$refs.getMapData.draw(usePolygons)
+                    }
+                })
+            }
+            done()
+        },
+        searchReset () {
+            this.query = {}
+            this.onLoad(this.page)
+        },
+        searchChange (params, done) {
+            this.query = params
+            this.page.currentPage = 1
+            this.onLoad(this.page, params)
+            done()
+        },
+        selectionChange (list) {
+            this.selectionList = list
+        },
+        selectionClear () {
+            this.selectionList = []
+            this.$refs.crud.toggleSelection()
+        },
+        currentChange (currentPage) {
+            this.page.currentPage = currentPage
+        },
+        sizeChange (pageSize) {
+            this.page.pageSize = pageSize
+        },
+        refreshChange () {
+            this.onLoad(this.page, this.query)
+        },
+        onLoad (page, params = {}) {
+            this.loading = true
+            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+                const data = res.data.data
+                this.page.total = data.total
+                this.data = data.records
+                this.loading = false
+                this.selectionClear()
+            })
+        }
     }
-  }
 };
 </script>
 
 <style lang="scss">
-
 .mapClass div label {
-  display: none;
+    display: none;
 }
 
 .mapClassMain {
-  padding-left: 5rem !important;
+    padding-left: 5rem !important;
 }
 
-
 #getMapData {
-  width: calc(100% + 90px);
-  position: relative;
-  left: -90px;
-  height: 400px;
+    width: calc(100% + 90px);
+    position: relative;
+    left: -90px;
+    height: 400px;
 }
 </style>

--
Gitblit v1.9.3