智慧农业后台管理页面
shuishen
2022-07-29 d6a0abe9024f87fc517a2b71df0f17c5cadc41a0
合并冲突
45 files modified
6039 ■■■■ changed files
src/views/authority/apiscope.vue 252 ●●●● patch | view | raw | blame | history
src/views/authority/datascope.vue 304 ●●●● patch | view | raw | blame | history
src/views/authority/role.vue 210 ●●●● patch | view | raw | blame | history
src/views/base/region.vue 196 ●●●●● patch | view | raw | blame | history
src/views/desk/notice.vue 130 ●●●● patch | view | raw | blame | history
src/views/farm/farm.vue 169 ●●●● patch | view | raw | blame | history
src/views/farm/farmInfoDetail.vue 91 ●●●● patch | view | raw | blame | history
src/views/farm/farmPaper.vue 115 ●●●● patch | view | raw | blame | history
src/views/farm/farmReport.vue 115 ●●●● patch | view | raw | blame | history
src/views/farm/farmingrecord.vue 155 ●●●● patch | view | raw | blame | history
src/views/farm/getMapDataInThere.vue 155 ●●●● patch | view | raw | blame | history
src/views/farmplant/detection.vue 138 ●●●●● patch | view | raw | blame | history
src/views/farmplant/farmplant copy.vue 239 ●●●● patch | view | raw | blame | history
src/views/farmplant/farmplant.vue 151 ●●●● patch | view | raw | blame | history
src/views/farmplant/farmproductstock copy.vue 119 ●●●● patch | view | raw | blame | history
src/views/farmplant/farmproductstock.vue 316 ●●●● patch | view | raw | blame | history
src/views/farmplant/inventorylist.vue 32 ●●●● patch | view | raw | blame | history
src/views/farmplant/process.vue 218 ●●●● patch | view | raw | blame | history
src/views/farmplant/retrievallist.vue 32 ●●●● patch | view | raw | blame | history
src/views/farmplant/salelist.vue 32 ●●●● patch | view | raw | blame | history
src/views/farmplant/strain.vue 117 ●●●● patch | view | raw | blame | history
src/views/flow/deploy.vue 38 ●●●●● patch | view | raw | blame | history
src/views/flow/follow.vue 97 ●●●● patch | view | raw | blame | history
src/views/flow/manager.vue 180 ●●●● patch | view | raw | blame | history
src/views/flow/model.vue 219 ●●●● patch | view | raw | blame | history
src/views/land/cs.vue patch | view | raw | blame | history
src/views/land/land.vue 155 ●●●● patch | view | raw | blame | history
src/views/land/landAdd.vue 74 ●●●● patch | view | raw | blame | history
src/views/land/landMap.vue 143 ●●●● patch | view | raw | blame | history
src/views/machining/machining.vue 144 ●●●● patch | view | raw | blame | history
src/views/mapPattern/index.vue 31 ●●●●● patch | view | raw | blame | history
src/views/monitor/log/api.vue 51 ●●●● patch | view | raw | blame | history
src/views/monitor/log/error.vue 51 ●●●● patch | view | raw | blame | history
src/views/monitor/log/usual.vue 51 ●●●● patch | view | raw | blame | history
src/views/panorama/panorama.vue 133 ●●●● patch | view | raw | blame | history
src/views/recovery/recovery.vue 145 ●●●● patch | view | raw | blame | history
src/views/remote/remote.vue 127 ●●●● patch | view | raw | blame | history
src/views/report/reportlist.vue 99 ●●●● patch | view | raw | blame | history
src/views/resource/attach.vue 137 ●●●● patch | view | raw | blame | history
src/views/resource/oss.vue 178 ●●●● patch | view | raw | blame | history
src/views/resource/sms.vue 200 ●●●● patch | view | raw | blame | history
src/views/sale/sale.vue 119 ●●●● patch | view | raw | blame | history
src/views/soldr/soldr.vue 119 ●●●● patch | view | raw | blame | history
src/views/soldrecord/soldrecord.vue 123 ●●●● patch | view | raw | blame | history
src/views/statistics/farmplantarea.vue 139 ●●●● patch | view | raw | blame | history
src/views/authority/apiscope.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -17,16 +18,18 @@
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               @tree-load="treeLoad">
            @tree-load="treeLoad"
        >
      <template slot-scope="{row}" slot="menu">
        <el-button type="text"
                <el-button
                    type="text"
                   icon="el-icon-setting"
                   size="small"
                   v-if="permission.api_scope_setting"
                   plain
                   style="border: 0;background-color: transparent !important;"
                   @click.stop="handleDataScope(row)">权限配置
        </el-button>
                    @click.stop="handleDataScope(row)"
                >权限配置</el-button>
      </template>
      <template slot-scope="{row}" slot="source">
        <div style="text-align:center">
@@ -34,11 +37,17 @@
        </div>
      </template>
    </avue-crud>
    <el-drawer :title="`[${scopeMenuName}] 接口权限配置`" :visible.sync="drawerVisible" :direction="direction"
        <el-drawer
            :title="`[${scopeMenuName}] 接口权限配置`"
            :visible.sync="drawerVisible"
            :direction="direction"
               append-to-body
               :before-close="handleDrawerClose" size="1000px">
            :before-close="handleDrawerClose"
            size="1000px"
        >
      <basic-container>
        <avue-crud :option="optionScope"
                <avue-crud
                    :option="optionScope"
                   :data="dataScope"
                   :page="pageScope"
                   v-model="formScope"
@@ -53,17 +62,18 @@
                   @selection-change="selectionChangeScope"
                   @current-change="currentChangeScope"
                   @size-change="sizeChangeScope"
                   @on-load="onLoadScope">
                    @on-load="onLoadScope"
                >
          <template slot="menuLeft">
            <el-button type="danger"
                        <el-button
                            type="danger"
                       size="small"
                       icon="el-icon-delete"
                       plain
                       @click="handleDeleteScope">删 除
            </el-button>
                            @click="handleDeleteScope"
                        >删 除</el-button>
          </template>
          <template slot-scope="{row}"
                    slot="scopeType">
                    <template slot-scope="{row}" slot="scopeType">
            <el-tag>{{row.scopeTypeName}}</el-tag>
          </template>
        </avue-crud>
@@ -79,16 +89,16 @@
    update,
    getLazyMenuList,
    getMenu
  } from "@/api/system/menu";
} from "@/api/system/menu"
  import {
    addApiScope,
    removeApiScope,
    updateApiScope,
    getListApiScope,
    getMenuApiScope
  } from "@/api/system/scope";
  import {mapGetters} from "vuex";
  import iconList from "@/config/iconList";
} from "@/api/system/scope"
import { mapGetters } from "vuex"
import iconList from "@/config/iconList"
  export default {
    data() {
@@ -372,7 +382,7 @@
          ]
        },
        dataScope: []
      };
        }
    },
    computed: {
@@ -383,50 +393,50 @@
          viewBtn: this.vaildData(this.permission.menu_view, false),
          delBtn: this.vaildData(this.permission.menu_delete, false),
          editBtn: this.vaildData(this.permission.menu_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      },
      scopeIds() {
        let ids = [];
            let ids = []
        this.selectionListScope.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      // 菜单管理模块
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -435,39 +445,39 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      searchReset() {
        this.query = {};
        this.parentId = 0;
        this.onLoad(this.page);
            this.query = {}
            this.parentId = 0
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.parentId = '';
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.parentId = ''
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -475,91 +485,91 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getMenu(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            this.loading = true
        getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
                this.data = res.data.data
                this.loading = false
                this.selectionClear()
            })
      },
      treeLoad(tree, treeNode, resolve) {
        const parentId = tree.id;
            const parentId = tree.id
        getLazyMenuList(parentId).then(res => {
          resolve(res.data.data);
        });
                resolve(res.data.data)
            })
      },
      // 数据权限模块
      handleDataScope(row) {
        this.drawerVisible = true;
        this.scopeMenuId = row.id;
        this.scopeMenuName = row.name;
            this.drawerVisible = true
            this.scopeMenuId = row.id
            this.scopeMenuName = row.name
        this.onLoadScope(this.pageScope)
      },
      handleDrawerClose(hide) {
        hide();
            hide()
      },
      rowSaveScope(row, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
            }
        addApiScope(row).then(() => {
          this.onLoadScope(this.pageScope);
                this.onLoadScope(this.pageScope)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowUpdateScope(row, index, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
            }
        updateApiScope(row).then(() => {
          this.onLoadScope(this.pageScope);
                this.onLoadScope(this.pageScope)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowDelScope(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -568,20 +578,20 @@
          type: "warning"
        })
          .then(() => {
            return removeApiScope(row.id);
                    return removeApiScope(row.id)
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
                    this.onLoadScope(this.pageScope)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      handleDeleteScope() {
        if (this.selectionListScope.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -589,54 +599,54 @@
          type: "warning"
        })
          .then(() => {
            return removeApiScope(this.scopeIds);
                    return removeApiScope(this.scopeIds)
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
                    this.onLoadScope(this.pageScope)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crudScope.toggleSelection();
          });
                    })
                    this.$refs.crudScope.toggleSelection()
                })
      },
      beforeOpenScope(done, type) {
        if (["edit", "view"].includes(type)) {
          getMenuApiScope(this.formScope.id).then(res => {
            this.formScope = res.data.data;
          });
                    this.formScope = res.data.data
                })
        }
        done();
            done()
      },
      searchResetScope() {
        this.onLoadScope(this.pageScope);
            this.onLoadScope(this.pageScope)
      },
      searchChangeScope(params, done) {
        this.onLoadScope(this.pageScope, params);
        done();
            this.onLoadScope(this.pageScope, params)
            done()
      },
      selectionChangeScope(list) {
        this.selectionListScope = list;
            this.selectionListScope = list
      },
      currentChangeScope(currentPage) {
        this.pageScope.currentPage = currentPage;
            this.pageScope.currentPage = currentPage
      },
      sizeChangeScope(pageSize) {
        this.pageScope.pageSize = pageSize;
            this.pageScope.pageSize = pageSize
      },
      onLoadScope(page, params = {}) {
        this.scopeLoading = true;
            this.scopeLoading = true
        const values = {
          ...params,
          menuId: this.scopeMenuId,
        }
        getListApiScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
          const data = res.data.data;
          this.pageScope.total = data.total;
          this.dataScope = data.records;
          this.selectionListScope = [];
          this.scopeLoading = false;
        });
                const data = res.data.data
                this.pageScope.total = data.total
                this.dataScope = data.records
                this.selectionListScope = []
                this.scopeLoading = false
            })
      },
    }
  };
src/views/authority/datascope.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -18,16 +19,18 @@
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               @tree-load="treeLoad">
            @tree-load="treeLoad"
        >
      <template slot-scope="{row}" slot="menu">
        <el-button type="text"
                <el-button
                    type="text"
                   icon="el-icon-setting"
                   size="small"
                   v-if="permission.data_scope_setting"
                   plain
                   style="border: 0;background-color: transparent !important;"
                   @click.stop="handleDataScope(row)">权限配置
        </el-button>
                    @click.stop="handleDataScope(row)"
                >权限配置</el-button>
      </template>
      <template slot-scope="{row}" slot="source">
        <div style="text-align:center">
@@ -35,11 +38,17 @@
        </div>
      </template>
    </avue-crud>
    <el-drawer :title="`[${scopeMenuName}] 数据权限配置`" :visible.sync="drawerVisible" :direction="direction"
        <el-drawer
            :title="`[${scopeMenuName}] 数据权限配置`"
            :visible.sync="drawerVisible"
            :direction="direction"
               append-to-body
               :before-close="handleDrawerClose" size="1000px">
            :before-close="handleDrawerClose"
            size="1000px"
        >
      <basic-container>
        <avue-crud :option="optionScope"
                <avue-crud
                    :option="optionScope"
                   :data="dataScope"
                   :page="pageScope"
                   v-model="formScope"
@@ -54,17 +63,18 @@
                   @selection-change="selectionChangeScope"
                   @current-change="currentChangeScope"
                   @size-change="sizeChangeScope"
                   @on-load="onLoadScope">
                    @on-load="onLoadScope"
                >
          <template slot="menuLeft">
            <el-button type="danger"
                        <el-button
                            type="danger"
                       size="small"
                       icon="el-icon-delete"
                       plain
                       @click="handleDeleteScope">删 除
            </el-button>
                            @click="handleDeleteScope"
                        >删 除</el-button>
          </template>
          <template slot-scope="{row}"
                    slot="scopeType">
                    <template slot-scope="{row}" slot="scopeType">
            <el-tag>{{row.scopeTypeName}}</el-tag>
          </template>
        </avue-crud>
@@ -80,17 +90,17 @@
    update,
    getLazyMenuList,
    getMenu
  } from "@/api/system/menu";
} from "@/api/system/menu"
  import {
    addDataScope,
    removeDataScope,
    updateDataScope,
    getListDataScope,
    getMenuDataScope
  } from "@/api/system/scope";
  import {mapGetters} from "vuex";
  import iconList from "@/config/iconList";
  import func from "@/util/func";
} from "@/api/system/scope"
import { mapGetters } from "vuex"
import iconList from "@/config/iconList"
import func from "@/util/func"
  export default {
    data() {
@@ -409,11 +419,11 @@
          ]
        },
        dataScope: []
      };
        }
    },
    watch: {
      'formScope.scopeType'() {
        this.initScope();
            this.initScope()
      }
    },
    computed: {
@@ -424,87 +434,87 @@
          viewBtn: this.vaildData(this.permission.menu_view, false),
          delBtn: this.vaildData(this.permission.menu_delete, false),
          editBtn: this.vaildData(this.permission.menu_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      },
      scopeIds() {
        let ids = [];
            let ids = []
        this.selectionListScope.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      initScope() {
        const scopeType = func.toInt(this.formScope.scopeType);
        const watchMode = this.watchMode;
        let column = "-", name = "暂无";
            const scopeType = func.toInt(this.formScope.scopeType)
            const watchMode = this.watchMode
            let column = "-", name = "暂无"
        if (scopeType === 1) {
          column = "-";
          name = "全部可见";
                column = "-"
                name = "全部可见"
        } else if (scopeType === 2) {
          column = "create_user";
          name = "本人可见";
                column = "create_user"
                name = "本人可见"
        } else if (scopeType === 3) {
          column = "create_dept";
          name = "所在机构可见";
                column = "create_dept"
                name = "所在机构可见"
        } else if (scopeType === 4) {
          column = "create_dept";
          name = "所在机构可见及子级可见";
                column = "create_dept"
                name = "所在机构可见及子级可见"
        } else if (scopeType === 5) {
          column = "";
          name = "自定义";
                column = ""
                name = "自定义"
        }
        this.$refs.crudScope.option.column.filter(item => {
          if (watchMode) {
            if (item.prop === "scopeName") {
              this.formScope.scopeName = `${this.scopeMenuName} [${name}]`;
                        this.formScope.scopeName = `${this.scopeMenuName} [${name}]`
            }
            if (item.prop === "resourceCode") {
              this.formScope.resourceCode = this.scopeMenuCode;
                        this.formScope.resourceCode = this.scopeMenuCode
            }
            if (item.prop === "scopeColumn") {
              this.formScope.scopeColumn = column;
                        this.formScope.scopeColumn = column
            }
          }
          if (item.prop === "scopeValue") {
            item.display = scopeType === 5;
                    item.display = scopeType === 5
          }
        });
            })
      },
      // 菜单管理模块
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -513,39 +523,39 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      searchReset() {
        this.query = {};
        this.parentId = 0;
        this.onLoad(this.page);
            this.query = {}
            this.parentId = 0
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.parentId = '';
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.parentId = ''
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -553,96 +563,96 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getMenu(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      beforeClose(done) {
        this.formScope = {};
        done();
            this.formScope = {}
            done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            this.loading = true
        getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
                this.data = res.data.data
                this.loading = false
                this.selectionClear()
            })
      },
      treeLoad(tree, treeNode, resolve) {
        const parentId = tree.id;
            const parentId = tree.id
        getLazyMenuList(parentId).then(res => {
          resolve(res.data.data);
        });
                resolve(res.data.data)
            })
      },
      // 数据权限模块
      handleDataScope(row) {
        this.drawerVisible = true;
        this.scopeMenuId = row.id;
        this.scopeMenuCode = row.code;
        this.scopeMenuName = row.name;
            this.drawerVisible = true
            this.scopeMenuId = row.id
            this.scopeMenuCode = row.code
            this.scopeMenuName = row.name
        this.onLoadScope(this.pageScope)
      },
      handleDrawerClose(hide) {
        hide();
            hide()
      },
      rowSaveScope(row, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
            }
        addDataScope(row).then(() => {
          this.onLoadScope(this.pageScope);
                this.onLoadScope(this.pageScope)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowUpdateScope(row, index, done, loading) {
        row = {
          ...row,
          menuId: this.scopeMenuId,
        };
            }
        updateDataScope(row).then(() => {
          this.onLoadScope(this.pageScope);
                this.onLoadScope(this.pageScope)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowDelScope(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -651,20 +661,20 @@
          type: "warning"
        })
          .then(() => {
            return removeDataScope(row.id);
                    return removeDataScope(row.id)
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
                    this.onLoadScope(this.pageScope)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      handleDeleteScope() {
        if (this.selectionListScope.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -672,59 +682,59 @@
          type: "warning"
        })
          .then(() => {
            return removeDataScope(this.scopeIds);
                    return removeDataScope(this.scopeIds)
          })
          .then(() => {
            this.onLoadScope(this.pageScope);
                    this.onLoadScope(this.pageScope)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crudScope.toggleSelection();
          });
                    })
                    this.$refs.crudScope.toggleSelection()
                })
      },
      beforeOpenScope(done, type) {
        if (["add"].includes(type)) {
          this.watchMode = true;
          this.initScope();
                this.watchMode = true
                this.initScope()
        }
        if (["edit", "view"].includes(type)) {
          this.watchMode = false;
                this.watchMode = false
          getMenuDataScope(this.formScope.id).then(res => {
            this.formScope = res.data.data;
          });
                    this.formScope = res.data.data
                })
        }
        done();
            done()
      },
      searchResetScope() {
        this.onLoadScope(this.pageScope);
            this.onLoadScope(this.pageScope)
      },
      searchChangeScope(params, done) {
        this.onLoadScope(this.pageScope, params);
        done();
            this.onLoadScope(this.pageScope, params)
            done()
      },
      selectionChangeScope(list) {
        this.selectionListScope = list;
            this.selectionListScope = list
      },
      currentChangeScope(currentPage) {
        this.pageScope.currentPage = currentPage;
            this.pageScope.currentPage = currentPage
      },
      sizeChangeScope(pageSize) {
        this.pageScope.pageSize = pageSize;
            this.pageScope.pageSize = pageSize
      },
      onLoadScope(page, params = {}) {
        this.scopeLoading = true;
            this.scopeLoading = true
        const values = {
          ...params,
          menuId: this.scopeMenuId,
        }
        getListDataScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
          const data = res.data.data;
          this.pageScope.total = data.total;
          this.dataScope = data.records;
          this.selectionListScope = [];
          this.scopeLoading = false;
        });
                const data = res.data.data
                this.pageScope.total = data.total
                this.dataScope = data.records
                this.selectionListScope = []
                this.scopeLoading = false
            })
      },
    }
  };
src/views/authority/role.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -16,71 +17,72 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   v-if="permission.role_delete"
                   plain
                   @click="handleDelete">删 除
        </el-button>
        <el-button size="small"
                    @click="handleDelete"
                >删 除</el-button>
                <el-button
                    size="small"
                   icon="el-icon-setting"
                   @click="handleRole"
                   v-if="userInfo.role_name.includes('admin')"
                   plain>权限设置
        </el-button>
                    plain
                >权限设置</el-button>
      </template>
    </avue-crud>
    <el-dialog title="角色权限配置"
               append-to-body
               :visible.sync="box"
               width="345px">
        <el-dialog title="角色权限配置" append-to-body :visible.sync="box" width="345px">
      <el-tabs type="border-card">
        <el-tab-pane label="菜单权限">
          <el-tree :data="menuGrantList"
                    <el-tree
                        :data="menuGrantList"
                   show-checkbox
                   node-key="id"
                   ref="treeMenu"
                   :default-checked-keys="menuTreeObj"
                   :props="props">
          </el-tree>
                        :props="props"
                    ></el-tree>
        </el-tab-pane>
        <el-tab-pane label="数据权限">
          <el-tree :data="dataScopeGrantList"
                    <el-tree
                        :data="dataScopeGrantList"
                   show-checkbox
                   node-key="id"
                   ref="treeDataScope"
                   :default-checked-keys="dataScopeTreeObj"
                   :props="props">
          </el-tree>
                        :props="props"
                    ></el-tree>
        </el-tab-pane>
        <el-tab-pane label="接口权限">
          <el-tree :data="apiScopeGrantList"
                    <el-tree
                        :data="apiScopeGrantList"
                   show-checkbox
                   node-key="id"
                   ref="treeApiScope"
                   :default-checked-keys="apiScopeTreeObj"
                   :props="props">
          </el-tree>
                        :props="props"
                    ></el-tree>
        </el-tab-pane>
      </el-tabs>
      <span slot="footer"
            class="dialog-footer">
            <span slot="footer" class="dialog-footer">
        <el-button @click="box = false">取 消</el-button>
        <el-button type="primary"
                   @click="submit">确 定</el-button>
                <el-button type="primary" @click="submit">确 定</el-button>
      </span>
    </el-dialog>
  </basic-container>
</template>
<script>
  import {add, getList, getRole, getRoleTreeById, grant, grantTree, remove, update} from "@/api/system/role";
  import {mapGetters} from "vuex";
  import website from '@/config/website';
import { add, getList, getRole, getRoleTreeById, grant, grantTree, remove, update } from "@/api/system/role"
import { mapGetters } from "vuex"
import website from '@/config/website'
  export default {
    data() {
@@ -200,7 +202,7 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
      ...mapGetters(["userInfo", "permission"]),
@@ -210,69 +212,69 @@
          viewBtn: this.vaildData(this.permission.role_view, false),
          delBtn: this.vaildData(this.permission.role_delete, false),
          editBtn: this.vaildData(this.permission.role_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
                ids.push(ele.id)
        });
        return ids.join(",");
            })
            return ids.join(",")
      },
      idsArray() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids;
                ids.push(ele.id)
            })
            return ids
      }
    },
    methods: {
      initData(roleId){
        getRoleTreeById(roleId).then(res => {
          const column = this.findObject(this.option.column, "parentId");
          column.dicData = res.data.data;
        });
                const column = this.findObject(this.option.column, "parentId")
                column.dicData = res.data.data
            })
      },
      submit() {
        const menuList = this.$refs.treeMenu.getCheckedKeys();
        const dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
        const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
            const menuList = this.$refs.treeMenu.getCheckedKeys()
            const dataScopeList = this.$refs.treeDataScope.getCheckedKeys()
            const apiScopeList = this.$refs.treeApiScope.getCheckedKeys()
        grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => {
          this.box = false;
                this.box = false
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.onLoad(this.page);
        });
                })
                this.onLoad(this.page)
            })
      },
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -281,65 +283,65 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      beforeOpen(done, type) {
        if (["add", "edit"].includes(type)) {
          this.initData(this.form.id);
                this.initData(this.form.id)
        }
        done();
            done()
      },
      handleRole() {
        if (this.selectionList.length !== 1) {
          this.$message.warning("只能选择一条数据");
          return;
                this.$message.warning("只能选择一条数据")
                return
        }
        this.menuTreeObj = [];
        this.dataScopeTreeObj = [];
        this.apiScopeTreeObj = [];
            this.menuTreeObj = []
            this.dataScopeTreeObj = []
            this.apiScopeTreeObj = []
        grantTree()
          .then(res => {
            this.menuGrantList = res.data.data.menu;
            this.dataScopeGrantList = res.data.data.dataScope;
            this.apiScopeGrantList = res.data.data.apiScope;
                    this.menuGrantList = res.data.data.menu
                    this.dataScopeGrantList = res.data.data.dataScope
                    this.apiScopeGrantList = res.data.data.apiScope
            getRole(this.ids).then(res => {
              this.menuTreeObj = res.data.data.menu;
              this.dataScopeTreeObj = res.data.data.dataScope;
              this.apiScopeTreeObj = res.data.data.apiScope;
              this.box = true;
            });
          });
                        this.menuTreeObj = res.data.data.menu
                        this.dataScopeTreeObj = res.data.data.dataScope
                        this.apiScopeTreeObj = res.data.data.apiScope
                        this.box = true
                    })
                })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -347,33 +349,33 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            this.loading = true
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          this.data = res.data.data;
          this.loading = false;
          this.selectionClear();
        });
                this.data = res.data.data
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/base/region.vue
@@ -12,37 +12,71 @@
    <el-col :span="15">
      <basic-container>
        <el-button-group>
          <el-button v-if="permission.region_add" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="addChildren">新增下级</el-button>
          <el-button v-if="permission.region_delete" type="primary" size="small" icon="el-icon-delete" @click="handleDelete">删除</el-button>
          <el-button v-if="permission.region_import" type="primary" size="small" icon="el-icon-upload2" @click="handleImport">导入</el-button>
          <el-button v-if="permission.region_export" type="primary" size="small" icon="el-icon-download" @click="handleExport">导出</el-button>
          <el-button v-if="permission.region_debug" type="primary" size="small" icon="el-icon-video-play" @click="handleDebug">调试</el-button>
                    <el-button
                        v-if="permission.region_add"
                        type="primary"
                        size="small"
                        icon="el-icon-circle-plus-outline"
                        @click="addChildren"
                    >新增下级</el-button>
                    <el-button
                        v-if="permission.region_delete"
                        type="primary"
                        size="small"
                        icon="el-icon-delete"
                        @click="handleDelete"
                    >删除</el-button>
                    <el-button
                        v-if="permission.region_import"
                        type="primary"
                        size="small"
                        icon="el-icon-upload2"
                        @click="handleImport"
                    >导入</el-button>
                    <el-button
                        v-if="permission.region_export"
                        type="primary"
                        size="small"
                        icon="el-icon-download"
                        @click="handleExport"
                    >导出</el-button>
                    <el-button
                        v-if="permission.region_debug"
                        type="primary"
                        size="small"
                        icon="el-icon-video-play"
                        @click="handleDebug"
                    >调试</el-button>
        </el-button-group>
      </basic-container>
      <basic-container>
        <avue-form ref="form" :option="regionOption" v-model="regionForm" @submit="handleSubmit">
                <avue-form
                    ref="form"
                    :option="regionOption"
                    v-model="regionForm"
                    @submit="handleSubmit"
                >
          <template slot="code" slot-scope="{}">
            <el-input placeholder="请输入 区划子编号" v-model="regionForm.subCode">
              <template slot="prepend">{{regionForm.parentCode}}</template>
            </el-input>
          </template>
        </avue-form>
        <el-dialog title="行政区划数据导入"
                   append-to-body
                   :visible.sync="excelBox"
                   width="555px">
          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
                <el-dialog title="行政区划数据导入" append-to-body :visible.sync="excelBox" width="555px">
                    <avue-form
                        :option="excelOption"
                        v-model="excelForm"
                        :upload-after="uploadAfter"
                    >
            <template slot="excelTemplate">
              <el-button type="primary" @click="handleTemplate">
                点击下载<i class="el-icon-download el-icon--right"></i>
                                点击下载
                                <i class="el-icon-download el-icon--right"></i>
              </el-button>
            </template>
          </avue-form>
        </el-dialog>
        <el-dialog title="行政区划数据调试"
                   append-to-body
                   :visible.sync="debugBox"
                   width="350px">
                <el-dialog title="行政区划数据调试" append-to-body :visible.sync="debugBox" width="350px">
          <avue-form :option="debugOption" v-model="debugForm"/>
        </el-dialog>
      </basic-container>
@@ -51,15 +85,15 @@
</template>
<script>
  import {getLazyTree, getDetail, submit, remove} from "@/api/base/region";
  import {exportBlob} from "@/api/common";
  import {mapGetters} from "vuex";
  import {validatenull} from "@/util/validate";
  import {downloadXls} from "@/util/util";
  import {dateNow} from "@/util/date";
  import {getToken} from "@/util/auth";
  import NProgress from 'nprogress';
  import 'nprogress/nprogress.css';
import { getLazyTree, getDetail, submit, remove } from "@/api/base/region"
import { exportBlob } from "@/api/common"
import { mapGetters } from "vuex"
import { validatenull } from "@/util/validate"
import { downloadXls } from "@/util/util"
import { dateNow } from "@/util/date"
import { getToken } from "@/util/auth"
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
  export default {
    data() {
@@ -72,7 +106,7 @@
          nodeKey: 'id',
          lazy: true,
          treeLoad: function (node, resolve) {
            const parentCode = (node.level === 0) ? "00" : node.data.id;
                    const parentCode = (node.level === 0) ? "00" : node.data.id
            getLazyTree(parentCode).then(res => {
              resolve(res.data.data.map(item => {
                return {
@@ -80,7 +114,7 @@
                  leaf: !item.hasChildren
                }
              }))
            });
                    })
          },
          addBtn: false,
          menu: false,
@@ -275,16 +309,16 @@
            }
          ]
        }
      };
        }
    },
    watch: {
      'regionForm.subCode'() {
        this.regionForm.code = this.regionForm.parentCode + this.regionForm.subCode;
            this.regionForm.code = this.regionForm.parentCode + this.regionForm.subCode
      },
      'excelForm.isCovered'() {
        if (this.excelForm.isCovered !== '') {
          const column = this.findObject(this.excelOption.column, "excelFile");
          column.action = `/api/blade-system/region/import-region?isCovered=${this.excelForm.isCovered}`;
                const column = this.findObject(this.excelOption.column, "excelFile")
                column.action = `/api/blade-system/region/import-region?isCovered=${this.excelForm.isCovered}`
        }
      }
    },
@@ -296,19 +330,19 @@
          viewBtn: this.vaildData(this.permission.region_view, false),
          delBtn: this.vaildData(this.permission.region_delete, false),
          editBtn: this.vaildData(this.permission.region_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      initTree() {
        this.treeData = [];
            this.treeData = []
        getLazyTree(this.topCode).then(res => {
          this.treeData = res.data.data.map(item => {
            return {
@@ -316,51 +350,51 @@
              leaf: !item.hasChildren
            }
          })
        });
            })
      },
      nodeClick(data) {
        const column = this.findObject(this.regionOption.column, "parentCode");
        column.disabled = true;
        this.treeCode = data.id;
        this.treeParentCode = data.parentId;
            const column = this.findObject(this.regionOption.column, "parentCode")
            column.disabled = true
            this.treeCode = data.id
            this.treeParentCode = data.parentId
        getDetail(this.treeCode).then(res => {
          this.regionForm = res.data.data;
          this.regionForm.subCode = this.regionForm.code.replace(this.regionForm.parentCode, '');
                this.regionForm = res.data.data
                this.regionForm.subCode = this.regionForm.code.replace(this.regionForm.parentCode, '')
        })
      },
      addChildren() {
        if (validatenull(this.regionForm.code) || validatenull(this.regionForm.name)) {
          this.$message.warning("请先选择一项区划");
          return;
                this.$message.warning("请先选择一项区划")
                return
        }
        this.regionForm.parentCode = this.regionForm.code;
        this.regionForm.parentName = this.regionForm.name;
        this.regionForm.code = '';
        this.regionForm.subCode = '';
        this.regionForm.name = '';
        this.regionForm.regionLevel = (this.regionForm.regionLevel === 5) ? 5 : this.regionForm.regionLevel + 1;
            this.regionForm.parentCode = this.regionForm.code
            this.regionForm.parentName = this.regionForm.name
            this.regionForm.code = ''
            this.regionForm.subCode = ''
            this.regionForm.name = ''
            this.regionForm.regionLevel = (this.regionForm.regionLevel === 5) ? 5 : this.regionForm.regionLevel + 1
      },
      handleSubmit(form, done, loading) {
        const parentCode = form.parentCode === this.topCode ? '' : form.parentCode;
        form.code = parentCode + form.subCode;
            const parentCode = form.parentCode === this.topCode ? '' : form.parentCode
            form.code = parentCode + form.subCode
        submit(form).then(() => {
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.initTree();
          this.regionForm.subCode = '';
          this.$refs.form.resetForm();
          done();
                })
                this.initTree()
                this.regionForm.subCode = ''
                this.$refs.form.resetForm()
                done()
        }, error => {
          loading();
          window.console.log(error);
        });
                loading()
                window.console.log(error)
            })
      },
      handleDelete() {
        if (validatenull(this.regionForm.code)) {
          this.$message.warning("请先选择一项区划");
          return;
                this.$message.warning("请先选择一项区划")
                return
        }
        this.$confirm(`确定将 [${this.regionForm.name}] 数据删除?`, {
          confirmButtonText: "确定",
@@ -368,29 +402,29 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.treeCode);
                    return remove(this.treeCode)
          })
          .then(() => {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.initTree();
            this.regionForm.subCode = '';
            this.$refs.form.resetForm();
          });
                    })
                    this.initTree()
                    this.regionForm.subCode = ''
                    this.$refs.form.resetForm()
                })
      },
      uploadAfter(res, done, loading, column) {
        window.console.log(column);
        this.excelBox = false;
        this.initTree();
        done();
            window.console.log(column)
            this.excelBox = false
            this.initTree()
            done()
      },
      handleDebug() {
        this.debugBox = true;
            this.debugBox = true
      },
      handleImport() {
        this.excelBox = true;
            this.excelBox = true
      },
      handleExport() {
        this.$confirm("是否导出行政区划数据?", "提示", {
@@ -398,16 +432,16 @@
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          NProgress.start();
                NProgress.start()
          exportBlob(`/api/blade-system/region/export-region?${this.website.tokenHeader}=${getToken()}`).then(res => {
            downloadXls(res.data, `行政区划数据${dateNow()}.xlsx`);
            NProgress.done();
                    downloadXls(res.data, `行政区划数据${dateNow()}.xlsx`)
                    NProgress.done()
          })
        });
            })
      },
      handleTemplate() {
        exportBlob(`/api/blade-system/region/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
          downloadXls(res.data, "行政区划模板.xlsx");
                downloadXls(res.data, "行政区划模板.xlsx")
        })
      },
    }
src/views/desk/notice.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -17,18 +18,19 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.notice_delete"
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
      <template slot-scope="{row}"
                slot="category">
            <template slot-scope="{row}" slot="category">
        <el-tag>{{row.categoryName}}</el-tag>
      </template>
    </avue-crud>
@@ -36,8 +38,8 @@
</template>
<script>
  import {getList, remove, update, add, getNotice} from "@/api/desk/notice";
  import {mapGetters} from "vuex";
import { getList, remove, update, add, getNotice } from "@/api/desk/notice"
import { mapGetters } from "vuex"
  export default {
    data() {
@@ -143,7 +145,7 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
      ...mapGetters(["permission"]),
@@ -153,42 +155,42 @@
          viewBtn: this.vaildData(this.permission.notice_view, false),
          delBtn: this.vaildData(this.permission.notice_delete, false),
          editBtn: this.vaildData(this.permission.notice_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -197,37 +199,37 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -235,56 +237,56 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getNotice(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const {releaseTimeRange} = this.query;
            const { releaseTimeRange } = this.query
        let values = {
          ...params,
          ...this.query
        };
            }
        if (releaseTimeRange) {
          values = {
            ...values,
            releaseTime_datege: releaseTimeRange[0],
            releaseTime_datelt: releaseTimeRange[1],
          };
          values.releaseTimeRange = null;
        }
        this.loading = true;
                values.releaseTimeRange = null
            }
            this.loading = true
        getList(page.currentPage, page.pageSize, values).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/farm/farm.vue
@@ -28,16 +28,11 @@
          icon="el-icon-delete"
          v-if="permission.farm_delete"
          @click="handleDelete"
        >删 除
        </el-button>
                >删 除</el-button>
      </template>
      <!-- 地图插入 -->
      <template slot-scope="{ type, disabled }" slot="lineForm">
        <getMapDataInThere
          ref="getMapData"
          id="getMapData"
          @setMapData="setMapData"
        ></getMapDataInThere>
                <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
@@ -45,19 +40,17 @@
          type="text"
          size="mini"
          @click="goToFarmDetail(row)"
          :size="size"
        >查看
        </el-button>
                >查看</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import getMapDataInThere from "./getMapDataInThere.vue";
import getMapDataInThere from "./getMapDataInThere.vue"
import { getList,add,update, remove,getDetails } from "@/api/farm/farm";
import { mapGetters } from "vuex";
import { getList, add, update, remove, getDetails } from "@/api/farm/farm"
import { mapGetters } from "vuex"
export default {
  components: {
@@ -233,7 +226,7 @@
          }
        ],
      }
    };
        }
  },
  created() {
    // this.getRailLazyTree();
@@ -246,70 +239,70 @@
        viewBtn: this.vaildData(this.permission.farm_delete, false),
        delBtn: this.vaildData(this.permission.farm_delete, false),
        editBtn: this.vaildData(this.permission.farm_delete, false)
      };
            }
    },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    }
  },
  mounted() {
  },
  methods: {
    rowSave(row, done, loading) {
      row['tenantId'] = this.userInfo.tenant_id;
      row['deptId'] = this.userInfo.dept_id;
            row['tenantId'] = this.userInfo.tenant_id
            row['deptId'] = this.userInfo.dept_id
      if (this.polygonsFarm.length == 0) {
        //没有面的数据
        this.$refs.getMapData.isCheck = true;
        loading();
                this.$refs.getMapData.isCheck = true
                loading()
      } else {
        //如果有值,空间坐标转换
        let pol = this.polygonsFarm;
        let polLength = this.polygonsFarm.length - 1;
        let usePolygons = "";
                let pol = this.polygonsFarm
                let polLength = this.polygonsFarm.length - 1
                let usePolygons = ""
        for (let k in pol) {
          usePolygons += pol[k].lng + "," + pol[k].lat;
                    usePolygons += pol[k].lng + "," + pol[k].lat
          if (k != polLength) {
            usePolygons += ";";
                        usePolygons += ";"
          }
        }
        //设置坐标点
        row.position = usePolygons;
                row.position = usePolygons
      }
      add(row).then(() => {
        this.onLoad(this.page);
                this.onLoad(this.page)
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        window.console.log(error);
      });
                loading()
                window.console.log(error)
            })
    },
    rowUpdate(row, index, done, loading) {
      if (this.polygonsFarm.length == 0) {
        //没有面的数据
        this.$refs.getMapData.isCheck = true;
        loading();
                this.$refs.getMapData.isCheck = true
                loading()
      } else {
        //如果有值,空间坐标转换
        let pol = this.polygonsFarm;
        let polLength = this.polygonsFarm.length - 1;
        let usePolygons = "";
                let pol = this.polygonsFarm
                let polLength = this.polygonsFarm.length - 1
                let usePolygons = ""
        for (let k in pol) {
          usePolygons += pol[k].lng + "," + pol[k].lat;
                    usePolygons += pol[k].lng + "," + pol[k].lat
          if (k != polLength) {
            usePolygons += ";";
                        usePolygons += ";"
          }
        }
        //设置坐标点
        row.position = usePolygons;
                row.position = usePolygons
      }
      // 修改
      update(row).then((res) => {
@@ -317,17 +310,17 @@
          this.$message({
            message: "操作成功",
            type: "success",
          });
          this.refreshChange();
          done();
                    })
                    this.refreshChange()
                    done()
        } else {
          this.$message({
            message: "操作失败",
            type: "warning",
          });
          done();
                    })
                    done()
        }
      });
            })
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
@@ -336,20 +329,20 @@
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -357,89 +350,88 @@
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      //先清空面的数据
      this.$store.commit('clear_polygonsFarm');
            this.$store.commit('clear_polygonsFarm')
      if (["edit", "view"].includes(type)) {
        getDetails(this.form.id).then((res) => {
          if (res.data.code == 200) {
            this.form = res.data.data;
                        this.form = res.data.data
            let usePolygons = this.form.position
              .split("POLYGON((")[1]
              .split("))")[0]
              .split(",");
                            .split(",")
            for (let k in usePolygons) {
              usePolygons[k] = {
                lng: +usePolygons[k].split(" ")[0],
                lat: +usePolygons[k].split(" ")[1],
              };
            }
            this.$refs.getMapData.draw(usePolygons);
          }
        });
                        this.$refs.getMapData.draw(usePolygons)
      }
      done();
                })
            }
            done()
    },
    //查看农场详情
    goToFarmDetail(row) {
      this.$router.push({
        path: `/farm/farmInfoDetail`,
        query: row
      });
            })
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
            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();
      });
                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;
}
@@ -447,7 +439,6 @@
.mapClassMain {
  padding-left: 5rem !important;
}
#getMapData {
  width: calc(100% + 90px);
src/views/farm/farmInfoDetail.vue
@@ -3,12 +3,7 @@
      <!-- 基本信息 -->
      <el-tab-pane label="基本信息" name="tab1">
        <basic-container>
          <avue-form
            ref="form"
            v-model="objBase"
            :option="optionBase"
            @submit="submitBase"
          >
                <avue-form ref="form" v-model="objBase" :option="optionBase" @submit="submitBase">
            <!-- 地图插入 -->
            <template slot-scope="{}" slot="position">
              <getMapDataInThere
@@ -22,25 +17,21 @@
      </el-tab-pane>
      <!-- 检测报告信息 -->
      <el-tab-pane label="检测报告信息" name="tab2">
        <farmReport
        :farmId="farmId"
        ></farmReport>
            <farmReport :farmId="farmId"></farmReport>
      </el-tab-pane>
      <!-- 认证证书信息 -->
      <el-tab-pane label="认证证书信息" name="tab3">
        <farmPaper
        :farmId="farmId"
        ></farmPaper>
            <farmPaper :farmId="farmId"></farmPaper>
      </el-tab-pane>
    </el-tabs>
</template>
<script>
import getMapDataInThere from "./getMapDataInThere.vue";
import farmPaper from "./farmPaper.vue";
import farmReport from "./farmReport.vue";
import { update, getDetails } from "@/api/farm/farm";
import { mapGetters } from "vuex";
import getMapDataInThere from "./getMapDataInThere.vue"
import farmPaper from "./farmPaper.vue"
import farmReport from "./farmReport.vue"
import { update, getDetails } from "@/api/farm/farm"
import { mapGetters } from "vuex"
export default {
  components: {
@@ -181,73 +172,73 @@
          },
        ],
      },
    };
        }
  },
  computed: {
    ...mapGetters(["userInfo", "permission", "polygonsFarm"]),
  },
  created(){
      this.farmId = this.$route.query.id;
        this.farmId = this.$route.query.id
  },
  mounted() {
    var flag = false,
            i = 0,
            ind = null;
            ind = null
    this.$store.state.tags.tagList.forEach((item, index) => {
        if (item.label == "农场详情信息") {
            if (flag == false) {
                ind = index;
                flag = true;
                    ind = index
                    flag = true
            }
            i++;
                i++
        }
    });
        })
    if (i > 1) {
        this.$store.state.tags.tagList.splice(ind, 1);
            this.$store.state.tags.tagList.splice(ind, 1)
    }
    var that = this;
        var that = this
    //先清空面的数据
    this.$store.commit('clear_polygonsFarm');
        this.$store.commit('clear_polygonsFarm')
    this.$nextTick(() => {
      getDetails(this.$route.query.id).then((res) => {
        if (res.data.code == 200) {
          that.objBase = res.data.data;
          that.farmId = that.objBase.id;
                    that.objBase = res.data.data
                    that.farmId = that.objBase.id
          let usePolygons = that.objBase.position
            .split("POLYGON((")[1]
            .split("))")[0]
            .split(",");
                        .split(",")
          for (let k in usePolygons) {
            usePolygons[k] = {
              lng: +usePolygons[k].split(" ")[0],
              lat: +usePolygons[k].split(" ")[1],
            };
          }
          this.$refs.getMapData.draw(usePolygons);
        }
      });
    });
                    this.$refs.getMapData.draw(usePolygons)
                }
            })
        })
  },
  methods: {
    //农场基本信息提交
    submitBase(form, loading, done) {
      if (this.polygonsFarm.length == 0) {
        //没有面的数据
        this.$refs.getMapData.isCheck = true;
        loading();
                this.$refs.getMapData.isCheck = true
                loading()
      } else {
        //如果有值,空间坐标转换
        let pol = this.polygonsFarm;
        let polLength = this.polygonsFarm.length - 1;
        let usePolygons = "";
                let pol = this.polygonsFarm
                let polLength = this.polygonsFarm.length - 1
                let usePolygons = ""
        for (let k in pol) {
          usePolygons += pol[k].lng + "," + pol[k].lat;
                    usePolygons += pol[k].lng + "," + pol[k].lat
          if (k != polLength) {
            usePolygons += ";";
                        usePolygons += ";"
          }
        }
        //设置坐标点
        form.position = usePolygons;
                form.position = usePolygons
      }
      // 修改
      update(form).then((res) => {
@@ -255,21 +246,21 @@
          this.$message({
            message: "操作成功",
            type: "success",
          });
          this.refreshChange();
          done();
                    })
                    this.refreshChange()
                    done()
        } else {
          this.$message({
            message: "操作失败",
            type: "warning",
          });
          done();
                    })
                    done()
        }
      });
            })
    },
    setMapData(val) {
      this.LineData = val[0];
      this.PointData = val[1];
            this.LineData = val[0]
            this.PointData = val[1]
    },
  },
  watch: {},
src/views/farm/farmPaper.vue
@@ -27,16 +27,15 @@
          icon="el-icon-delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper";
import { mapGetters } from "vuex";
import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper"
import { mapGetters } from "vuex"
export default {
  props: ["farmId"],
  data() {
@@ -130,7 +129,7 @@
        ],
      },
      data: [],
    };
        }
  },
  created() {},
  computed: {
@@ -144,50 +143,50 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {},
  methods: {
    //新增
    rowSave(row, done, loading) {
      row["farmId"] = this.farmId;
      row["type"] = 2;
            row["farmId"] = this.farmId
            row["type"] = 2
      save(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          window.console.log(error);
                    loading()
                    window.console.log(error)
        }
      );
            )
    },
    //修改
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          console.log(error);
                    loading()
                    console.log(error)
        }
      );
            )
    },
    //删除
    rowDel(row) {
@@ -197,20 +196,20 @@
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -218,66 +217,66 @@
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      params['type'] = 2;
      params['farmId'] = this.farmId;
      this.loading = true;
            params['type'] = 2
            params['farmId'] = this.farmId
            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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
src/views/farm/farmReport.vue
@@ -27,16 +27,15 @@
          icon="el-icon-delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
 
<script>
import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper";
import { mapGetters } from "vuex";
import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper"
import { mapGetters } from "vuex"
export default {
  props: ["farmId"],
  data() {
@@ -130,7 +129,7 @@
        ],
      },
      data: [],
    };
        }
  },
  created() {},
  computed: {
@@ -144,50 +143,50 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {},
  methods: {
    //新增
    rowSave(row, done, loading) {
      row["farmId"] = this.farmId;
      row["type"] = 1;
            row["farmId"] = this.farmId
            row["type"] = 1
      save(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          window.console.log(error);
                    loading()
                    window.console.log(error)
        }
      );
            )
    },
    //修改
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          console.log(error);
                    loading()
                    console.log(error)
        }
      );
            )
    },
    //删除
    rowDel(row) {
@@ -197,20 +196,20 @@
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -218,66 +217,66 @@
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params['type'] = 1;
      params['farmId'] = this.farmId;
            this.loading = true
            params['type'] = 1
            params['farmId'] = this.farmId
      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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
src/views/farm/farmingrecord.vue
@@ -27,8 +27,7 @@
          icon="el-icon-delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
@@ -41,11 +40,11 @@
  update,
  remove,
  save,
} from "@/api/farm/farmingrecord";
import { getLandList } from "@/api/land/land";
import { getUserList } from "@/api/system/user";
import { selectStockFa } from "@/api/stockfactory/stockfactory";
import { mapGetters } from "vuex";
} from "@/api/farm/farmingrecord"
import { getLandList } from "@/api/land/land"
import { getUserList } from "@/api/system/user"
import { selectStockFa } from "@/api/stockfactory/stockfactory"
import { mapGetters } from "vuex"
export default {
  data() {
    return {
@@ -244,23 +243,23 @@
        ],
      },
      data: [],
    };
        }
  },
  watch: {
    "form.type": {
      handler(val) {
        var stockIdcolumn = this.findObject(this.option.column, "stockId");
                var stockIdcolumn = this.findObject(this.option.column, "stockId")
        if (val === "0" || val == 4 || val == 5 || val == 8 || val == 9) {
          stockIdcolumn.display = true;
                    stockIdcolumn.display = true
        } else {
          stockIdcolumn.display = false;
                    stockIdcolumn.display = false
        }
      },
      immediate: true,
    }
  },
  created() {
    this.initData();
        this.initData()
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
@@ -273,81 +272,81 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {
  },
  methods: {
    getType(){
      return this.type;
            return this.type
    },
    //初始化数据
    initData() {
      var that = this;
            var that = this
      //获取农地数据
      getLandList(this.userInfo.dept_id).then((res) => {
        if (res.data.code == 200) {
          var landIdcolumn = that.findObject(that.option.column, "landId");
          that.landList = res.data.data;
          landIdcolumn.dicData = res.data.data;
                    var landIdcolumn = that.findObject(that.option.column, "landId")
                    that.landList = res.data.data
                    landIdcolumn.dicData = res.data.data
        }
      });
            })
      //获取操作人
      const user = {
        tenantId: this.userInfo.tenant_id,
      };
            }
      getUserList(user).then((res) => {
        if (res.data.code == 200) {
          var operatorcolumn = that.findObject(that.option.column, "operator");
          operatorcolumn.dicData = res.data.data;
                    var operatorcolumn = that.findObject(that.option.column, "operator")
                    operatorcolumn.dicData = res.data.data
        }
      });
            })
      //获取农资
      selectStockFa().then((res) => {
        if (res.data.code == 200) {
          var stockIdcolumn = that.findObject(that.option.column, "stockId");
          stockIdcolumn.dicData = res.data.data;
                    var stockIdcolumn = that.findObject(that.option.column, "stockId")
                    stockIdcolumn.dicData = res.data.data
        }
      });
            })
    },
    //新增
    rowSave(row, done, loading) {
      save(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          window.console.log(error);
                    loading()
                    window.console.log(error)
        }
      );
            )
    },
    //修改
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          console.log(error);
                    loading()
                    console.log(error)
        }
      );
            )
    },
    //删除
    rowDel(row) {
@@ -357,20 +356,20 @@
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -378,57 +377,57 @@
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
      var datas = this.$route.query.id;
      params.landId=datas;
      params['tenantId'] = this.userInfo.tenant_id;
      params['deptId'] = this.userInfo.dept_id;
            this.loading = true
            var datas = this.$route.query.id
            params.landId = datas
            params['tenantId'] = this.userInfo.tenant_id
            params['deptId'] = this.userInfo.dept_id
      if (this.landId) {
        params['landId'] = this.landId
      }
@@ -437,12 +436,12 @@
        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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
src/views/farm/getMapDataInThere.vue
@@ -2,25 +2,20 @@
  <div class="getMapData" :key="Refresh">
    <MapInThere ref="getMapDataRefs" />
    <div class="notDatas" v-show="isCheck">
      <div style="color: red">*</div>
      未绘画区域
            <div style="color: red">*</div>未绘画区域
    </div>
    <div class="controlMapWindowTitle">
      <el-button-group>
        <el-button type="primary" icon="el-icon-finished" @click="drawFace"
          >绘画区域</el-button
        >
        <el-button type="danger" @click="giveUp" icon="el-icon-close"
          >取消</el-button
        >
                <el-button type="primary" icon="el-icon-finished" @click="drawFace">绘画区域</el-button>
                <el-button type="danger" @click="giveUp" icon="el-icon-close">取消</el-button>
      </el-button-group>
    </div>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
import MapInThere from "@/components/map/mainFarm.vue";
import { mapGetters } from "vuex"
import MapInThere from "@/components/map/mainFarm.vue"
export default {
  name: "getMapData",
  components: {
@@ -33,14 +28,14 @@
    ourDatas: {
      handler(val) {
        this.checkDom("getMapDataRefs", (dom) => {
          dom.onceOnlodad(val);
        });
                    dom.onceOnlodad(val)
                })
      },
      deep: true,
    },
    polygons() {
      if (this.polygonsFarm.length > 0) {
        this.isCheck = false;
                this.isCheck = false
      }
    },
  },
@@ -57,31 +52,31 @@
      ourDatas: [],
      nowId: 0,
      isCheck: false,
    };
        }
  },
  mounted() {
   
  },
  methods: {
    draw(usePolygons) {
      this.$store.commit("setpolygonsFarm", usePolygons); //用vuex传最终数据
            this.$store.commit("setpolygonsFarm", usePolygons) //用vuex传最终数据
      this.doThat(usePolygons)
    },
    doThat(val) {
      this.checkDom("getMapDataRefs", (dom) => {
          dom.addLines(val);
                dom.addLines(val)
          // 移动位置
          dom.move(val);
      });
                dom.move(val)
            })
    },
    drawFace() {
      this.$refs.getMapDataRefs.drawStart();
            this.$refs.getMapDataRefs.drawStart()
    },
    giveUp() {
      this.$refs.getMapDataRefs.closeDraw();
            this.$refs.getMapDataRefs.closeDraw()
    },
    openDrawLineMethod() {
      let id = this.nowId++;
            let id = this.nowId++
      this.ourDatas.push({
        label: "路径" + +id,
        value: "",
@@ -89,10 +84,10 @@
        notPath: false,
        isLine: true,
        id: +id,
      });
            })
    },
    openDrawPointMethod() {
      let id = this.nowId++;
            let id = this.nowId++
      this.ourDatas.push({
        label: "标点" + +id,
        value: "",
@@ -100,50 +95,50 @@
        notPath: false,
        isLine: false,
        id: +id,
      });
            })
    },
    deleteRowOurs(index) {
      this.ourDatas.splice(index, 1);
            this.ourDatas.splice(index, 1)
    },
    backMapDataOurData(val, index) {
      if (val == "line") {
        this.ourDatas[index].value = this.rotesData;
                this.ourDatas[index].value = this.rotesData
      } else if (val == "point") {
        this.ourDatas[index].value = this.pointData;
                this.ourDatas[index].value = this.pointData
      } else if (val == "notData") {
        this.ourDatas[index].value = "";
                this.ourDatas[index].value = ""
      }
      //单个验证
      this.myRules(index);
            this.myRules(index)
    },
    //以上是添加数据集方法
    //选择map数据
    openMap(val, num, value) {
      this.MapDataShow = true;
      this.openTitle = val;
      this.$refs.getMapDataRefs.init(val, num, value);
            this.MapDataShow = true
            this.openTitle = val
            this.$refs.getMapDataRefs.init(val, num, value)
    },
    closeOpenedMap() {
      this.MapDataShow = false;
            this.MapDataShow = false
      // this.openTitle = "";
    },
    //下面是旧代码
    editInit(val) {
      //查看情况逆转String成为当页可使用数据,并做动作
      this.reverseMapData(val);
            this.reverseMapData(val)
    },
    viewInit(val) {
      //查看情况逆转String成为当页可使用数据,并做动作
      this.reverseMapData(val);
      this.fromView = true; //查看数据不可改
            this.reverseMapData(val)
            this.fromView = true //查看数据不可改
    },
    reverseMapData(val, label) {
      //解释数据
      let rname = val[0][0].split(";"),
        r = val[0][1].split(";"),
        pname = val[1][0].split(";"),
        p = val[1][1].split(";");
      this.ourDatas = [];
                p = val[1][1].split(";")
            this.ourDatas = []
      for (let k in r) {
        this.ourDatas.push({
          label: "路径" + (+k + 1),
@@ -152,10 +147,10 @@
          notPath: false,
          isLine: true,
          id: this.ourDatas.length,
        });
                })
      }
      for (let k in p) {
        let potion = p[k].split(",");
                let potion = p[k].split(",")
        this.ourDatas.push({
          label: "标点" + (+k + 1),
          value: [+potion[0], +potion[1]],
@@ -163,71 +158,71 @@
          notPath: false,
          isLine: false,
          id: this.ourDatas.length,
        });
                })
      }
      this.nowId = +this.ourDatas.length + 1;
            this.nowId = +this.ourDatas.length + 1
    },
    myRules(index) {
      //单个验证
      if (this.ourDatas[index].name && this.ourDatas[index].value) {
        this.ourDatas[index].notPath = false;
                this.ourDatas[index].notPath = false
      } else {
        this.ourDatas[index].notPath = 2;
                this.ourDatas[index].notPath = 2
      }
    },
    //自定义验证
    myRulesUse() {
      //把一个数组拆开两个来对应之前的数据
      let ourData = this.ourDatas;
      let lineBefor = [];
      let pointBefor = [];
            let ourData = this.ourDatas
            let lineBefor = []
            let pointBefor = []
      for (let o in ourData) {
        if (ourData[o].isLine) {
          lineBefor.push(ourData[o]);
                    lineBefor.push(ourData[o])
        } else {
          pointBefor.push(ourData[o]);
                    pointBefor.push(ourData[o])
        }
      }
      let line = this.changeMapData(lineBefor, "name");
      let point = this.changeMapData(pointBefor, "name");
            let line = this.changeMapData(lineBefor, "name")
            let point = this.changeMapData(pointBefor, "name")
      if (line[0] == "namenot" || point[0] == "namenot") {
        //需要显示验证失败合集
        let errorId = [];
                let errorId = []
        if (line[0] == "namenot") {
          errorId.push(...line[1]);
                    errorId.push(...line[1])
        }
        if (point[0] == "namenot") {
          errorId.push(...point[1]);
                    errorId.push(...point[1])
        }
        for (let x in this.ourDatas) {
          let flog = true;
                    let flog = true
          for (let k in errorId) {
            if (errorId[k] == this.ourDatas[x].id) {
              flog = false;
                            flog = false
            }
          }
          if (flog) {
            this.ourDatas[x].notPath = false;
                        this.ourDatas[x].notPath = false
          } else {
            this.ourDatas[x].notPath = 2;
                        this.ourDatas[x].notPath = 2
          }
        }
        return false;
                return false
      } else {
        for (let i in this.ourDatas) {
          this.ourDatas[i].notPath = false;
                    this.ourDatas[i].notPath = false
        }
        return [line, point];
                return [line, point]
      }
    },
    //规则
    changeMapData(item, names) {
      let name = "",
        value = "",
        notData = [];
      let itemLength = item.length - 1;
                notData = []
            let itemLength = item.length - 1
      for (let k in item) {
        let inItem = item[k];
                let inItem = item[k]
        for (let kin in inItem) {
          if (
            inItem[kin] == "" &&
@@ -235,52 +230,52 @@
            kin != "isLine" &&
            kin != "id"
          ) {
            notData.push(inItem.id);
            break;
                        notData.push(inItem.id)
                        break
          }
          if (kin == names) {
            name += inItem[kin];
                        name += inItem[kin]
            if (k != itemLength) {
              name += ";";
                            name += ";"
            }
          }
          if (kin == "value") {
            value += inItem[kin];
                        value += inItem[kin]
            if (k != itemLength) {
              value += ";";
                            value += ";"
            }
          }
        }
      }
      return notData.length > 0 ? [names + "not", notData] : [name, value];
            return notData.length > 0 ? [names + "not", notData] : [name, value]
    },
    checkDom(name, fn) {
      //  声明定时器
      let that = this;
      var timer = null;
            let that = this
            var timer = null
      //  检查dom是否执行完成
      function checkDom() {
        let dom = that.$refs[name];
                let dom = that.$refs[name]
        if (dom) {
          //  执行dom加载完成后的操作
          //  清除定时器
          if (!timer) {
            clearTimeout(timer);
                        clearTimeout(timer)
          }
          if (fn) {
            //回调函数
            fn(dom);
            return;
                        fn(dom)
                        return
          } else {
            return dom;
                        return dom
          }
        } else {
          //  自我调用
          timer = setTimeout(checkDom, 100);
                    timer = setTimeout(checkDom, 100)
        }
      }
      //  首次执行
      checkDom();
            checkDom()
    },
  },
};
src/views/farmplant/detection.vue
@@ -1,8 +1,4 @@
<<<<<<< HEAD
  <template>
=======
<template>
>>>>>>> adf4c52344cf6f0ea16d1f01410258648c9f5356
  <div>
    <el-dialog
      title="检测报告"
@@ -40,23 +36,15 @@
          icon="el-icon-delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
                    >删 除</el-button>
      </template>
    </avue-crud>
  </el-dialog>
</div>
</template>
<<<<<<< HEAD
=======
>>>>>>> adf4c52344cf6f0ea16d1f01410258648c9f5356
<script>
import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper";
import { mapGetters } from "vuex";
import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper"
import { mapGetters } from "vuex"
export default {
  props: ["farmId"],
  data() {
@@ -151,7 +139,7 @@
        ],
      },
      data: [],
    };
        }
  },
  created() { 
    
@@ -167,57 +155,57 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {
   },
  methods: {
    init(id) {
      this.visible = true;
      this.farmPlantId = id;
      this.onLoad(this.page);
            this.visible = true
            this.farmPlantId = id
            this.onLoad(this.page)
    },
    //新增
    rowSave(row, done, loading) {
      row["farmId"] = this.farmPlantId;
            row["farmId"] = this.farmPlantId
      //种养品
      row["type"] = 3;
            row["type"] = 3
      save(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          window.console.log(error);
                    loading()
                    window.console.log(error)
        }
      );
            )
    },
    //修改
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          console.log(error);
                    loading()
                    console.log(error)
        }
      );
            )
    },
    //删除
    rowDel(row) {
@@ -227,20 +215,20 @@
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -248,76 +236,70 @@
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params['type'] = 3;
      params['farmId'] = this.farmPlantId;
            this.loading = true
            params['type'] = 3
            params['farmId'] = this.farmPlantId
      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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
</script>
<<<<<<< HEAD
<style>
</style>
=======
<style>
</style>
>>>>>>> adf4c52344cf6f0ea16d1f01410258648c9f5356
src/views/farmplant/farmplant copy.vue
@@ -27,17 +27,16 @@
          icon="el-icon-delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import { getDetail, getList, update, remove, save } from "@/api/farmplant/farmplant";
import { getLandList } from "@/api/land/land";
import { mapGetters } from "vuex";
import { getDetail, getList, update, remove, save } from "@/api/farmplant/farmplant"
import { getLandList } from "@/api/land/land"
import { mapGetters } from "vuex"
export default {
  data() {
    return {
@@ -370,29 +369,29 @@
        ],
      },
      data: [],
    };
        }
  },
  watch: {
    "form.farmType": {
      handler(val) {
        var splantcolumn = this.findObject(this.option.column,"plant");
        var plantingWaycolumn = this.findObject(this.option.column, "plantingWay");
        var jobWaycolumn = this.findObject(this.option.column, "jobWay");
        var transplanTimecolumn = this.findObject(this.option.column, "transplanTime");
        var recoveryTimecolumn = this.findObject(this.option.column, "recoveryTime");
        var percolumn = this.findObject(this.option.column, "per");
        var plantNumbercolumn = this.findObject(this.option.column, "plantNumber");
        var plantSpacingcolumn = this.findObject(this.option.column, "plantSpacing");
        var seedingTimecolumn = this.findObject(this.option.column, "seedingTime");
        var breedcolumn = this.findObject(this.option.column, "breed");
                var splantcolumn = this.findObject(this.option.column, "plant")
                var plantingWaycolumn = this.findObject(this.option.column, "plantingWay")
                var jobWaycolumn = this.findObject(this.option.column, "jobWay")
                var transplanTimecolumn = this.findObject(this.option.column, "transplanTime")
                var recoveryTimecolumn = this.findObject(this.option.column, "recoveryTime")
                var percolumn = this.findObject(this.option.column, "per")
                var plantNumbercolumn = this.findObject(this.option.column, "plantNumber")
                var plantSpacingcolumn = this.findObject(this.option.column, "plantSpacing")
                var seedingTimecolumn = this.findObject(this.option.column, "seedingTime")
                var breedcolumn = this.findObject(this.option.column, "breed")
        // var landIdcolumn = this.findObject(this.option.column, "landId");
        // landIdcolumn.dicData = this.landList;
        if (val === '0') {
          //种职业
          splantcolumn.display = true;
          splantcolumn.label = "种植标准";
          plantingWaycolumn.display = true;
          plantingWaycolumn.label = "种植方式";
                    splantcolumn.display = true
                    splantcolumn.label = "种植标准"
                    plantingWaycolumn.display = true
                    plantingWaycolumn.label = "种植方式"
          plantingWaycolumn.dicData=[
              {
                label:"移栽",
@@ -403,13 +402,13 @@
                value:"1"
              },
            ]
          jobWaycolumn.display = true;
          transplanTimecolumn.display = true;
          transplanTimecolumn.label="移栽时间";
          recoveryTimecolumn.display = true;
          recoveryTimecolumn.label="预计采收时间";
          percolumn.display = true;
          percolumn.label = "预计亩产";
                    jobWaycolumn.display = true
                    transplanTimecolumn.display = true
                    transplanTimecolumn.label = "移栽时间"
                    recoveryTimecolumn.display = true
                    recoveryTimecolumn.label = "预计采收时间"
                    percolumn.display = true
                    percolumn.label = "预计亩产"
          percolumn.rules=[
              {
                required: false,
@@ -417,28 +416,28 @@
                trigger: "blur",
              }, 
            ],
          plantNumbercolumn.display = true;
          plantSpacingcolumn.display = true;
          seedingTimecolumn.display = false;
          breedcolumn.display = false;
                        plantNumbercolumn.display = true
                    plantSpacingcolumn.display = true
                    seedingTimecolumn.display = false
                    breedcolumn.display = false
        } else if(val ==1){
          //水产业
          splantcolumn.display = false;
          plantingWaycolumn.display = false;
          jobWaycolumn.display = true;
          transplanTimecolumn.display = false;
          recoveryTimecolumn.display = false;
          percolumn.display = false;
          plantNumbercolumn.display = false;
          plantSpacingcolumn.display = false;
          seedingTimecolumn.display = true;
          breedcolumn.display = true;
                    splantcolumn.display = false
                    plantingWaycolumn.display = false
                    jobWaycolumn.display = true
                    transplanTimecolumn.display = false
                    recoveryTimecolumn.display = false
                    percolumn.display = false
                    plantNumbercolumn.display = false
                    plantSpacingcolumn.display = false
                    seedingTimecolumn.display = true
                    breedcolumn.display = true
        }else if(val ==2){
          //禽畜业
          splantcolumn.display = true;
          splantcolumn.label = "养殖标准";
          plantingWaycolumn.display = true;
          plantingWaycolumn.label = "养殖方式";
                    splantcolumn.display = true
                    splantcolumn.label = "养殖标准"
                    plantingWaycolumn.display = true
                    plantingWaycolumn.label = "养殖方式"
          plantingWaycolumn.dicData=[
              {
                label:"放养",
@@ -453,13 +452,13 @@
                value:"2"
              },
            ]
          jobWaycolumn.display = true;
          transplanTimecolumn.display = true;
          transplanTimecolumn.label="养殖开始时间";
          recoveryTimecolumn.display = true;
          recoveryTimecolumn.label="预计出栏时间";
          percolumn.display = true;
          percolumn.label = "养殖数量";
                    jobWaycolumn.display = true
                    transplanTimecolumn.display = true
                    transplanTimecolumn.label = "养殖开始时间"
                    recoveryTimecolumn.display = true
                    recoveryTimecolumn.label = "预计出栏时间"
                    percolumn.display = true
                    percolumn.label = "养殖数量"
          percolumn.rules=[
              {
                required: true,
@@ -467,28 +466,28 @@
                trigger: "blur",
              },  
            ],
          plantNumbercolumn.display = false;
          plantSpacingcolumn.display = false;
          seedingTimecolumn.display = false;
          breedcolumn.display = false;
                        plantNumbercolumn.display = false
                    plantSpacingcolumn.display = false
                    seedingTimecolumn.display = false
                    breedcolumn.display = false
        }else{
          splantcolumn.display = false;
          plantingWaycolumn.display = false;
          jobWaycolumn.display = false;
          transplanTimecolumn.display = false;
          recoveryTimecolumn.display = false;
          percolumn.display = false;
          plantNumbercolumn.display = false;
          plantSpacingcolumn.display = false;
          seedingTimecolumn.display = false;
          breedcolumn.display = false;
                    splantcolumn.display = false
                    plantingWaycolumn.display = false
                    jobWaycolumn.display = false
                    transplanTimecolumn.display = false
                    recoveryTimecolumn.display = false
                    percolumn.display = false
                    plantNumbercolumn.display = false
                    plantSpacingcolumn.display = false
                    seedingTimecolumn.display = false
                    breedcolumn.display = false
        }
      },
      immediate: true
    },
  },
  created() {
    this.initData();
        this.initData()
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
@@ -501,24 +500,24 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {},
  methods: {
    //初始化数据
    initData(){
      var that = this;
            var that = this
      //获取农地数据
      getLandList(this.userInfo.user_id).then((res)=>{
          if(res.data.code==200){
              var landIdcolumn = that.findObject(that.option.column,"landId");
              that.landList = res.data.data;
              landIdcolumn.dicData = res.data.data;
                    var landIdcolumn = that.findObject(that.option.column, "landId")
                    that.landList = res.data.data
                    landIdcolumn.dicData = res.data.data
          }
      })
    },
@@ -526,35 +525,35 @@
    rowSave(row, done, loading) {
      save(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          window.console.log(error);
                    loading()
                    window.console.log(error)
        }
      );
            )
    },
    //修改
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          console.log(error);
                    loading()
                    console.log(error)
        }
      );
            )
    },
    //删除
    rowDel(row) {
@@ -564,20 +563,20 @@
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -585,64 +584,64 @@
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
            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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
src/views/farmplant/farmplant.vue
@@ -27,8 +27,7 @@
          icon="el-icon-delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
                >删 除</el-button>
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
@@ -36,8 +35,7 @@
          :size="size"
          icon="el-icon-money"
          @click="handleDetection(row)"
          >检测报告
        </el-button>
                >检测报告</el-button>
      </template>
    </avue-crud>
    <!-- 检测报告 -->
@@ -46,11 +44,11 @@
</template>
 
<script>
import { getDetail, getList, update, remove, save } from "@/api/farmplant/farmplant";
import { getStrainList } from "@/api/farmplant/strain";
import { getLandList } from "@/api/land/land";
import { mapGetters } from "vuex";
import detection from "./detection.vue";
import { getDetail, getList, update, remove, save } from "@/api/farmplant/farmplant"
import { getStrainList } from "@/api/farmplant/strain"
import { getLandList } from "@/api/land/land"
import { mapGetters } from "vuex"
import detection from "./detection.vue"
export default {
  components: {
    detection
@@ -411,7 +409,7 @@
        ],
      },
      data: [],
    };
        }
  },
  watch: {
    // "form.farmType": {
@@ -530,11 +528,11 @@
  },
  mounted(){
    if(this.activeName =="tab1"){
          this.option.height = 520;
            this.option.height = 520
        }
  },
  created() {
    this.initData();
        this.initData()
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
@@ -547,73 +545,68 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  methods: {
    //初始化数据
    initData(){
      var that = this;
            var that = this
      //获取农地数据
      getLandList(this.userInfo.dept_id).then((res)=>{
          if(res.data.code==200){
              var landIdcolumn = that.findObject(that.option.column,"landId");
              that.landList = res.data.data;
              landIdcolumn.dicData = res.data.data;
                    var landIdcolumn = that.findObject(that.option.column, "landId")
                    that.landList = res.data.data
                    landIdcolumn.dicData = res.data.data
          }
      })
      //获取农产品数据
      getStrainList(0).then((res)=>{
          if(res.data.code==200){
              var strainId = that.findObject(that.option.column,"strainId");
              strainId.dicData = res.data.data;
                    var strainId = that.findObject(that.option.column, "strainId")
                    strainId.dicData = res.data.data
          }
      })
<<<<<<< HEAD
=======
>>>>>>> adf4c52344cf6f0ea16d1f01410258648c9f5356
    },
    //新增
    rowSave(row, done, loading) {
      row['farmType'] = 0;
      row['createUser'] = this.userInfo.user_id;
            row['farmType'] = 0
            row['createUser'] = this.userInfo.user_id
      save(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          window.console.log(error);
                    loading()
                    window.console.log(error)
        }
      );
            )
    },
    //修改
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          console.log(error);
                    loading()
                    console.log(error)
        }
      );
            )
    },
    //删除
    rowDel(row) {
@@ -623,20 +616,20 @@
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -644,73 +637,73 @@
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      params['tenantId'] = this.userInfo.tenant_id;
      params['deptId'] = this.userInfo.dept_id;
      this.loading = true;
            params['tenantId'] = this.userInfo.tenant_id
            params['deptId'] = this.userInfo.dept_id
            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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
    //检测报告
    handleDetection(row){
      this.detectionVisible = true;
            this.detectionVisible = true
      this.$nextTick(() => {
        this.$refs.detection.init(row.id);
      });
                this.$refs.detection.init(row.id)
            })
    },
  },
};
src/views/farmplant/farmproductstock copy.vue
@@ -27,8 +27,7 @@
          icon="el-icon-delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
@@ -41,9 +40,9 @@
  update,
  remove,
  save,
} from "@/api/farmplant/farmproductstock";
import { getStrainList } from "@/api/farmplant/strain";
import { mapGetters } from "vuex";
} from "@/api/farmplant/farmproductstock"
import { getStrainList } from "@/api/farmplant/strain"
import { mapGetters } from "vuex"
export default {
  data() {
    return {
@@ -206,10 +205,10 @@
        ],
      },
      data: [],
    };
        }
  },
  created() {
    this.initData();
        this.initData()
    
  },
  computed: {
@@ -223,59 +222,59 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {},
  methods: {
    initData(){
      var that = this;
            var that = this
      //获取农产品数据
      getStrainList(0).then((res)=>{
          if(res.data.code==200){
              var strainId = that.findObject(that.option.column,"strainId");
              strainId.dicData = res.data.data;
                    var strainId = that.findObject(that.option.column, "strainId")
                    strainId.dicData = res.data.data
          }
      })
    },
    //新增
    rowSave(row, done, loading) {
      row['strainType'] =0;
            row['strainType'] = 0
      save(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          window.console.log(error);
                    loading()
                    window.console.log(error)
        }
      );
            )
    },
    //修改
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          console.log(error);
                    loading()
                    console.log(error)
        }
      );
            )
    },
    //删除
    rowDel(row) {
@@ -285,20 +284,20 @@
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -306,64 +305,64 @@
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
            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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
src/views/farmplant/farmproductstock.vue
@@ -19,28 +19,50 @@
    <div class="table">
      <div class="content">
        <div class="farm" v-for="(item, index) in data" :key="index">
          <div class="farm-img"><img :src="item.url" class="img"/></div>
                    <div class="farm-img">
                        <img :src="item.url" class="img" />
                    </div>
          <!-- <div class="farm-img">
            <img src="../../../public/img/map.png" class="img" />
          </div> -->
          <div class="cai">{{ item.strainName }}</div>
          <div class="area">库存量:<span>{{ item.weight }}</span>公斤</div>
          <div class="btn">
            <el-button style="width: 65px;" plain size="small" @click="openWindow(0,item)">
              <span style="color: #5abf78">销售</span></el-button
            >
            <el-button style="width: 65px;padding-left:8px" plain size="small" @click="openWindow(1,item)">
              <span>库存损耗</span>
            </el-button
            >
                    <div class="area">
                        库存量:
                        <span>{{ item.weight }}</span>公斤
          </div>
          <div class="btn">
            <el-button style="width: 65px;" plain size="small" @click="openWindow(3,item)"
            ><span style="color: #5abf78">出库</span>
                        <el-button
                            style="width: 65px;"
                            plain
                            size="small"
                            @click="openWindow(0,item)"
                        >
                            <span style="color: #5abf78">销售</span>
            </el-button>
            <el-button style="width: 65px;" plain size="small" @click="openWindow(2,item)">
              加工
                        <el-button
                            style="width: 65px;padding-left:8px"
                            plain
                            size="small"
                            @click="openWindow(1,item)"
                        >
                            <span>库存损耗</span>
            </el-button>
                    </div>
                    <div class="btn">
                        <el-button
                            style="width: 65px;"
                            plain
                            size="small"
                            @click="openWindow(3,item)"
                        >
                            <span style="color: #5abf78">出库</span>
                        </el-button>
                        <el-button
                            style="width: 65px;"
                            plain
                            size="small"
                            @click="openWindow(2,item)"
                        >加工</el-button>
          </div>
        </div>
      </div>
@@ -55,8 +77,7 @@
        background
        layout="total, prev, pager, next"
        :total="page.total"
      >
      </el-pagination>
            ></el-pagination>
    </div>
    <!--销售-->
    <el-dialog
@@ -122,22 +143,22 @@
              size="large"
              :options="options"
              @change="handleChange"
              v-model="saleDestination">
            </el-cascader>
                            v-model="saleDestination"
                        ></el-cascader>
          </div>
        </template>
        <template slot-scope="{disabled,size}" slot="saleNum">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum"><i slot="suffix"
                                                                                    style="font-style:normal;margin-right: 5px;">公斤</i>
                        <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
            </el-input>
            <div style="text-align: right;color: #ffb218">可销售量:{{ form.weight }}公斤</div>
          </div>
        </template>
        <template slot-scope="{disabled,size}" slot="salePrice">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice"><i slot="suffix"
                                                                                      style="font-style:normal;margin-right: 5px;">元/公斤</i>
                        <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">元/公斤</i>
            </el-input>
          </div>
        </template>
@@ -168,8 +189,8 @@
        </template>
        <template slot-scope="{disabled,size}" slot="saleNum">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入损耗数量" v-model="formKC.saleNum"><i slot="suffix"
                                                                                      style="font-style:normal;margin-right: 5px;">公斤</i>
                        <el-input type="number" placeholder="请输入损耗数量" v-model="formKC.saleNum">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
            </el-input>
            <div style="text-align: right;color: #ffb218">库存量:{{ formKC.weight }}公斤</div>
          </div>
@@ -202,16 +223,16 @@
        </template>
        <template slot-scope="{disabled,size}" slot="saleNum">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入加工数量" v-model="formJG.saleNum"><i slot="suffix"
                                                                                      style="font-style:normal;margin-right: 5px;">公斤</i>
                        <el-input type="number" placeholder="请输入加工数量" v-model="formJG.saleNum">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
            </el-input>
            <div style="text-align: right;color: #ffb218">库存量:{{ formJG.weight }}公斤</div>
          </div>
        </template>
        <template slot-scope="{disabled,size}" slot="processNum">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入产品数量" v-model="formJG.processNum"><i slot="suffix"
                                                                                         style="font-style:normal;margin-right: 5px;">公斤</i>
                        <el-input type="number" placeholder="请输入产品数量" v-model="formJG.processNum">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
            </el-input>
          </div>
        </template>
@@ -249,14 +270,14 @@
              size="large"
              :options="optionck"
              @change="handleChangeck"
              v-model="saleDestination">
            </el-cascader>
                            v-model="saleDestination"
                        ></el-cascader>
          </div>
        </template>
        <template slot-scope="{disabled,size}" slot="saleNum">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入出库数量" v-model="formCK.saleNum"><i slot="suffix"
                                                                                      style="font-style:normal;margin-right: 5px;">公斤</i>
                        <el-input type="number" placeholder="请输入出库数量" v-model="formCK.saleNum">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
            </el-input>
            <div style="text-align: right;color: #ffb218">可出库量:{{ formCK.weight }}公斤</div>
          </div>
@@ -276,7 +297,6 @@
      </avue-form>
    </el-dialog>
  </div>
</template>
<script>
@@ -286,20 +306,20 @@
  update,
  remove,
  save,
} from "@/api/farmplant/farmproductstock";
} from "@/api/farmplant/farmproductstock"
import {
  add, addKC
} from "@/api/sale/sale";
} from "@/api/sale/sale"
import {
  addjg
} from "@/api/process/process";
} from "@/api/process/process"
import {
  addck
} from "@/api/retrieval/retrieval";
import {mapGetters} from "vuex";
} from "@/api/retrieval/retrieval"
import { mapGetters } from "vuex"
import {regionData} from 'element-china-area-data'
export default {
@@ -714,7 +734,7 @@
      },
      selectionList: [],
      data: [],
    };
        }
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
@@ -727,128 +747,128 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {
  },
  created() {
    this.initData();
        this.initData()
    //初始化列表数据
    this.onLoad(this.page);
        this.onLoad(this.page)
  },
  methods: {
    onSubmit() {
      console.log("submit!");
            console.log("submit!")
    },
    //销售
    submitSole() {
      var that = this;
            var that = this
      this.$refs.form.validate((vaild, done) => {
        if (vaild) {
          add(this.form).then(() => {
            this.onLoad(this.page);
                        this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                        })
            //提交完成,关闭窗口清空数据
            that.cleanData();
            done();
                        that.cleanData()
                        done()
          }, error => {
            window.console.log(error);
                        window.console.log(error)
            //提交失败,关闭窗口清空数据
            that.cleanData();
            done();
          });
                        that.cleanData()
                        done()
                    })
        }
      })
    },
    //加工产品
    submitJGloss() {
      var that = this;
            var that = this
      this.$refs.form.validate((vaild, done) => {
        if (vaild) {
          addjg(this.formJG).then(() => {
            this.onLoad(this.page);
                        this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                        })
            //提交完成,关闭窗口清空数据
            that.cleanJGData();
            done();
                        that.cleanJGData()
                        done()
          }, error => {
            window.console.log(error);
                        window.console.log(error)
            //提交失败,关闭窗口清空数据
            that.cleanJGData();
            done();
          });
                        that.cleanJGData()
                        done()
                    })
        }
      })
    },
    //库存消耗
    submitKCloss() {
      var that = this;
            var that = this
      this.$refs.form.validate((vaild, done) => {
        if (vaild) {
          addKC(this.formKC).then(() => {
            this.onLoad(this.page);
                        this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                        })
            //提交完成,关闭窗口清空数据
            that.cleanKCData();
            done();
                        that.cleanKCData()
                        done()
          }, error => {
            window.console.log(error);
                        window.console.log(error)
            //提交失败,关闭窗口清空数据
            that.cleanKCData();
            done();
          });
                        that.cleanKCData()
                        done()
                    })
        }
      })
    },
    //出库
    submitCK() {
      var that = this;
            var that = this
      this.$refs.form.validate((vaild, done) => {
        if (vaild) {
          addck(this.formCK).then(() => {
            this.onLoad(this.page);
                        this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                        })
            //提交完成,关闭窗口清空数据
            that.cleanCKData();
            done();
                        that.cleanCKData()
                        done()
          }, error => {
            window.console.log(error);
                        window.console.log(error)
            //提交失败,关闭窗口清空数据
            that.cleanCKData();
            done();
          });
                        that.cleanCKData()
                        done()
                    })
        }
      })
    },
    handleChange(value) {
      if (value != null) {
        this.form.saleDestination = value[0];
        this.form.city = value[1];
        this.form.county = value[2];
                this.form.saleDestination = value[0]
                this.form.city = value[1]
                this.form.county = value[2]
      }
    },
    handleChangeck(value) {
      if (value != null) {
        this.formCK.saleDestination = value[0];
        this.formCK.city = value[1];
        this.formCK.county = value[2];
                this.formCK.saleDestination = value[0]
                this.formCK.city = value[1]
                this.formCK.county = value[2]
      }
    },
    initData() {
@@ -863,94 +883,93 @@
    },
    openWindow(index, data) {
      if (index == 0) {
        this.form.name = this.userInfo.nick_name;
        this.form.createUser = this.userInfo.user_id;
        this.form.weight = data.weight;
        this.form.proid = data.id;
        this.form.landId = data.landId;
        this.form.strainId = data.strainId;
        this.form.strainName = data.strainName;
        this.visible = true;
                this.form.name = this.userInfo.nick_name
                this.form.createUser = this.userInfo.user_id
                this.form.weight = data.weight
                this.form.proid = data.id
                this.form.landId = data.landId
                this.form.strainId = data.strainId
                this.form.strainName = data.strainName
                this.visible = true
      } else if (index == 1) {
        this.formKC.name = this.userInfo.nick_name;
        this.formKC.createUser = this.userInfo.user_id;
        this.formKC.weight = data.weight;
        this.formKC.proid = data.id;
        this.formKC.landId = data.landId;
        this.formKC.strainId = data.strainId;
        this.formKC.strainName = data.strainName;
        this.visibleKC = true;
                this.formKC.name = this.userInfo.nick_name
                this.formKC.createUser = this.userInfo.user_id
                this.formKC.weight = data.weight
                this.formKC.proid = data.id
                this.formKC.landId = data.landId
                this.formKC.strainId = data.strainId
                this.formKC.strainName = data.strainName
                this.visibleKC = true
      } else if (index == 2) {
        this.formJG.name = this.userInfo.nick_name;
        this.formJG.createUser = this.userInfo.user_id;
        this.formJG.proid = data.id;
        this.formJG.landId = data.landId;
        this.formJG.weight = data.weight;
        this.formJG.strainId = data.strainId;
        this.formJG.strainName = data.strainName;
        this.visibleJG = true;
                this.formJG.name = this.userInfo.nick_name
                this.formJG.createUser = this.userInfo.user_id
                this.formJG.proid = data.id
                this.formJG.landId = data.landId
                this.formJG.weight = data.weight
                this.formJG.strainId = data.strainId
                this.formJG.strainName = data.strainName
                this.visibleJG = true
      } else if (index == 3) {
        this.formCK.name = this.userInfo.nick_name;
        this.formCK.createUser = this.userInfo.user_id;
        this.formCK.weight = data.weight;
        this.formCK.proid = data.id;
        this.formCK.landId = data.landId;
        this.formCK.strainId = data.strainId;
        this.formCK.strainName = data.strainName;
        this.visibleCK = true;
                this.formCK.name = this.userInfo.nick_name
                this.formCK.createUser = this.userInfo.user_id
                this.formCK.weight = data.weight
                this.formCK.proid = data.id
                this.formCK.landId = data.landId
                this.formCK.strainId = data.strainId
                this.formCK.strainName = data.strainName
                this.visibleCK = true
      }
    },
    cleanData() {
      var that = this;
      that.form.saleDestination = "";
      that.$refs.form.resetFields();
      that.visible = false;
            var that = this
            that.form.saleDestination = ""
            that.$refs.form.resetFields()
            that.visible = false
    },
    cleanCKData() {
      var that = this;
      that.formCK.saleDestination = "";
      that.$refs.form.resetFields();
      that.visibleCK = false;
            var that = this
            that.formCK.saleDestination = ""
            that.$refs.form.resetFields()
            that.visibleCK = false
    },
    cleanKCData() {
      var that = this;
      that.$refs.form.resetFields();
      that.visibleKC = false;
            var that = this
            that.$refs.form.resetFields()
            that.visibleKC = false
    },
    cleanJGData() {
      var that = this;
      that.$refs.form.resetFields();
      that.visibleJG = false;
            var that = this
            that.$refs.form.resetFields()
            that.visibleJG = false
    },
    handleSizeChange(val) {
      this.page.pageSize = val;
      this.onLoad(this.page);
            this.page.pageSize = val
            this.onLoad(this.page)
    },
    handleCurrentChange(val) {
      this.page.currentPage = val;
      this.onLoad(this.page);
            this.page.currentPage = val
            this.onLoad(this.page)
    },
    onLoad(page, params = {}) {
      params['tenantId'] = this.userInfo.tenant_id;
      params['deptId'] = this.userInfo.dept_id;
            params['tenantId'] = this.userInfo.tenant_id
            params['deptId'] = this.userInfo.dept_id
      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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
</script>
<style lang="scss" scoped>
.body {
  background-color: #fff;
  width: 98%;
@@ -1016,8 +1035,6 @@
          text-align: center;
          margin-top: 8px;
        }
      }
    }
  }
@@ -1027,5 +1044,4 @@
    text-align: center;
  }
}
</style>
src/views/farmplant/inventorylist.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
      <avue-crud :option="option"
        <avue-crud
            :option="option"
             :table-loading="loading"
             :data="data"
             ref="crud"
@@ -13,8 +14,8 @@
             @current-change="currentChange"
             @size-change="sizeChange"
             @refresh-change="refreshChange"
             @on-load="onLoad">
      </avue-crud>
            @on-load="onLoad"
        ></avue-crud>
  </basic-container>
</template>
@@ -91,43 +92,42 @@
                ],
            },
            data:[],
        };
        }
    },
    methods: {
        currentChange(currentPage) {
            this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
        },
        sizeChange(pageSize) {
            this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
        },
        refreshChange() {
            this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
        },
        onLoad(page, params = {}) {
            this.loading = true;
            this.loading = true
            getInventoryPage(page.currentPage,page.pageSize,Object.assign(params, this.query)).then((res)=>{
                if(res.data.code == 200){
                    this.data = res.data.data.records
                    this.page.total = res.data.data.total
                    this.loading = false;
                    this.loading = false
                }
            })
        },
        searchReset() {
            this.query = {};
            this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange(params, done) {
            this.query = params;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
    }
}
</script>
<style>
</style>
src/views/farmplant/process.vue
@@ -19,12 +19,17 @@
    <div class="table">
      <div class="content">
        <div class="farm" v-for="(item, index) in data" :key="index">
          <div class="farm-img"><img :src="item.tpurl" class="img"/></div>
                    <div class="farm-img">
                        <img :src="item.tpurl" class="img" />
                    </div>
          <!-- <div class="farm-img">
            <img src="../../../public/img/map.png" class="img" />
          </div> -->
          <div class="cai">{{ item.processName }}</div>
          <div class="area">库存量:<span>{{ item.processNum }}</span>公斤</div>
                    <div class="area">
                        库存量:
                        <span>{{ item.processNum }}</span>公斤
                    </div>
<!--          <div class="btn">-->
<!--            <el-button style="width: 65px;" plain size="small" @click="openWindow(0,item)">-->
<!--              <span style="color: #5abf78">销售</span></el-button-->
@@ -55,8 +60,7 @@
        background
        layout="total, prev, pager, next"
        :total="page.total"
      >
      </el-pagination>
            ></el-pagination>
    </div>
    <el-dialog
@@ -84,22 +88,22 @@
              size="large"
              :options="options"
              @change="handleChange"
              v-model="saleDestination">
            </el-cascader>
                            v-model="saleDestination"
                        ></el-cascader>
          </div>
        </template>
        <template slot-scope="{disabled,size}" slot="saleNum">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum"><i slot="suffix"
                                                                                    style="font-style:normal;margin-right: 5px;">公斤</i>
                        <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
            </el-input>
            <div style="text-align: right;color: #ffb218">可销售量:{{ form.weight }}公斤</div>
          </div>
        </template>
        <template slot-scope="{disabled,size}" slot="salePrice">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice"><i slot="suffix"
                                                                                      style="font-style:normal;margin-right: 5px;">元/公斤</i>
                        <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">元/公斤</i>
            </el-input>
          </div>
        </template>
@@ -110,7 +114,6 @@
        </template>
      </avue-form>
    </el-dialog>
    <el-dialog
      title="农产品库存损耗"
@@ -131,8 +134,8 @@
        </template>
        <template slot-scope="{disabled,size}" slot="saleNum">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入损耗数量" v-model="formKC.saleNum"><i slot="suffix"
                                                                                      style="font-style:normal;margin-right: 5px;">公斤</i>
                        <el-input type="number" placeholder="请输入损耗数量" v-model="formKC.saleNum">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
            </el-input>
            <div style="text-align: right;color: #ffb218">库存量:{{ formKC.weight }}公斤</div>
          </div>
@@ -165,16 +168,16 @@
        </template>
        <template slot-scope="{disabled,size}" slot="saleNum">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入加工数量" v-model="formJG.saleNum"><i slot="suffix"
                                                                                      style="font-style:normal;margin-right: 5px;">公斤</i>
                        <el-input type="number" placeholder="请输入加工数量" v-model="formJG.saleNum">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
            </el-input>
            <div style="text-align: right;color: #ffb218">库存量:{{ formJG.weight }}公斤</div>
          </div>
        </template>
        <template slot-scope="{disabled,size}" slot="processNum">
          <div style="margin-bottom: -20px">
            <el-input type="number" placeholder="请输入产品数量" v-model="formJG.processNum"><i slot="suffix"
                                                                                      style="font-style:normal;margin-right: 5px;">公斤</i>
                        <el-input type="number" placeholder="请输入产品数量" v-model="formJG.processNum">
                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
            </el-input>
          </div>
        </template>
@@ -187,22 +190,21 @@
      </avue-form>
    </el-dialog>
  </div>
</template>
<script>
import {
  getList,
} from "@/api/process/process";
} from "@/api/process/process"
import {
  add, addKC
} from "@/api/sale/sale";
} from "@/api/sale/sale"
import {
  addjg
} from "@/api/process/process";
import {mapGetters} from "vuex";
} from "@/api/process/process"
import { mapGetters } from "vuex"
import {regionData} from 'element-china-area-data'
export default {
@@ -524,7 +526,7 @@
      },
      selectionList: [],
      data: [],
    };
        }
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
@@ -537,96 +539,96 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {
  },
  created() {
    this.initData();
        this.initData()
    //初始化列表数据
    this.onLoad(this.page);
        this.onLoad(this.page)
  },
  methods: {
    onSubmit() {
      console.log("submit!");
            console.log("submit!")
    },
    submitSole() {
      var that = this;
            var that = this
      this.$refs.form.validate((vaild, done) => {
        if (vaild) {
          add(this.form).then(() => {
            this.onLoad(this.page);
                        this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                        })
            //提交完成,关闭窗口清空数据
            that.cleanData();
            done();
                        that.cleanData()
                        done()
          }, error => {
            window.console.log(error);
                        window.console.log(error)
            //提交失败,关闭窗口清空数据
            that.cleanData();
            done();
          });
                        that.cleanData()
                        done()
                    })
        }
      })
    },
    //加工产品
    submitJGloss() {
      var that = this;
            var that = this
      this.$refs.form.validate((vaild, done) => {
        if (vaild) {
          addjg(this.formJG).then(() => {
            this.onLoad(this.page);
                        this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                        })
            //提交完成,关闭窗口清空数据
            that.cleanJGData();
            done();
                        that.cleanJGData()
                        done()
          }, error => {
            window.console.log(error);
                        window.console.log(error)
            //提交失败,关闭窗口清空数据
            that.cleanJGData();
            done();
          });
                        that.cleanJGData()
                        done()
                    })
        }
      })
    },
    submitKCloss() {
      var that = this;
            var that = this
      this.$refs.form.validate((vaild, done) => {
        if (vaild) {
          addKC(this.formKC).then(() => {
            this.onLoad(this.page);
                        this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                        })
            //提交完成,关闭窗口清空数据
            that.cleanKCData();
            done();
                        that.cleanKCData()
                        done()
          }, error => {
            window.console.log(error);
                        window.console.log(error)
            //提交失败,关闭窗口清空数据
            that.cleanKCData();
            done();
          });
                        that.cleanKCData()
                        done()
                    })
        }
      })
    },
    handleChange(value) {
      if (value != null) {
        this.form.saleDestination = value[0];
        this.form.city = value[1];
        this.form.county = value[2];
                this.form.saleDestination = value[0]
                this.form.city = value[1]
                this.form.county = value[2]
      }
    },
@@ -642,80 +644,79 @@
    },
    openWindow(index, data) {
      if (index == 0) {
        this.form.name = this.userInfo.nick_name;
        this.form.createUser = this.userInfo.user_id;
        this.form.weight = data.weight;
        this.form.proid=data.id;
        this.form.landId=data.landId;
        this.form.strainId = data.strainId;
        this.form.strainName = data.strainName;
        this.visible = true;
                this.form.name = this.userInfo.nick_name
                this.form.createUser = this.userInfo.user_id
                this.form.weight = data.weight
                this.form.proid = data.id
                this.form.landId = data.landId
                this.form.strainId = data.strainId
                this.form.strainName = data.strainName
                this.visible = true
      } else if (index == 1) {
        this.formKC.name = this.userInfo.nick_name;
        this.formKC.createUser = this.userInfo.user_id;
        this.formKC.weight = data.weight;
        this.formKC.proid=data.id;
        this.formKC.landId=data.landId;
        this.formKC.strainId = data.strainId;
        this.formKC.strainName = data.strainName;
        this.visibleKC = true;
                this.formKC.name = this.userInfo.nick_name
                this.formKC.createUser = this.userInfo.user_id
                this.formKC.weight = data.weight
                this.formKC.proid = data.id
                this.formKC.landId = data.landId
                this.formKC.strainId = data.strainId
                this.formKC.strainName = data.strainName
                this.visibleKC = true
      }
      else if (index == 2) {
        this.formJG.name = this.userInfo.nick_name;
        this.formJG.createUser = this.userInfo.user_id;
        this.formJG.proid=data.id;
        this.formJG.landId=data.landId;
        this.formJG.weight = data.weight;
        this.formJG.strainId = data.strainId;
        this.formJG.strainName = data.strainName;
        this.visibleJG = true;
                this.formJG.name = this.userInfo.nick_name
                this.formJG.createUser = this.userInfo.user_id
                this.formJG.proid = data.id
                this.formJG.landId = data.landId
                this.formJG.weight = data.weight
                this.formJG.strainId = data.strainId
                this.formJG.strainName = data.strainName
                this.visibleJG = true
      }
    },
    cleanData() {
      var that = this;
      that.form.saleDestination = "";
      that.$refs.form.resetFields();
      that.visible = false;
            var that = this
            that.form.saleDestination = ""
            that.$refs.form.resetFields()
            that.visible = false
    },
    cleanKCData() {
      var that = this;
      that.$refs.form.resetFields();
      that.visibleKC = false;
            var that = this
            that.$refs.form.resetFields()
            that.visibleKC = false
    },
    cleanJGData() {
      var that = this;
      that.$refs.form.resetFields();
      that.visibleJG = false;
            var that = this
            that.$refs.form.resetFields()
            that.visibleJG = false
    },
    handleSizeChange(val) {
      this.page.pageSize = val;
      this.onLoad(this.page);
            this.page.pageSize = val
            this.onLoad(this.page)
    },
    handleCurrentChange(val) {
      this.page.currentPage = val;
      this.onLoad(this.page);
            this.page.currentPage = val
            this.onLoad(this.page)
    },
    onLoad(page, params = {}) {
      params['tenantId'] = this.userInfo.tenant_id;
      params['deptId'] = this.userInfo.dept_id;
            params['tenantId'] = this.userInfo.tenant_id
            params['deptId'] = this.userInfo.dept_id
      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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
</script>
<style lang="scss" scoped>
.body {
  background-color: #fff;
  width: 98%;
@@ -781,8 +782,6 @@
          text-align: center;
          margin-top: 8px;
        }
      }
    }
  }
@@ -792,5 +791,4 @@
    text-align: center;
  }
}
</style>
src/views/farmplant/retrievallist.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -13,8 +14,8 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    </avue-crud>
            @on-load="onLoad"
        ></avue-crud>
  </basic-container>
</template>
@@ -91,42 +92,41 @@
                ],
            },
            data:[],
        };
        }
    },
    methods: {
        currentChange(currentPage) {
            this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
        },
        sizeChange(pageSize) {
            this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
        },
        refreshChange() {
            this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
        },
        onLoad(page, params = {}) {
            this.loading = true;
            this.loading = true
            getPage(page.currentPage,page.pageSize,Object.assign(params, this.query)).then((res)=>{
                if(res.data.code == 200){
                    this.data = res.data.data.records
                    this.page.total = res.data.data.total
                    this.loading = false;
                    this.loading = false
                }
            })
        },
        searchReset() {
            this.query = {};
            this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange(params, done) {
            this.query = params;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
    }
}
</script>
<style>
</style>
src/views/farmplant/salelist.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
        <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -13,8 +14,8 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    </avue-crud>
            @on-load="onLoad"
        ></avue-crud>
  </basic-container>
</template>
@@ -95,43 +96,42 @@
                ],
            },
            data:[],
        };
        }
    },
    methods: {
        currentChange(currentPage) {
            this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
        },
        sizeChange(pageSize) {
            this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
        },
        refreshChange() {
            this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
        },
        onLoad(page, params = {}) {
            this.loading = true;
            this.loading = true
            getPage(page.currentPage,page.pageSize,Object.assign(params, this.query)).then((res)=>{
                if(res.data.code == 200){
                    this.data = res.data.data.records
                    this.page.total = res.data.data.total
                    this.loading = false;
                    this.loading = false
                }
            })
        },
        searchReset() {
            this.query = {};
            this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
        },
        searchChange(params, done) {
            this.query = params;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
    }
}
</script>
<style>
</style>
src/views/farmplant/strain.vue
@@ -27,8 +27,7 @@
          icon="el-icon-delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
@@ -41,8 +40,8 @@
  update,
  remove,
  save,
} from "@/api/farmplant/strain";
import { mapGetters } from "vuex";
} from "@/api/farmplant/strain"
import { mapGetters } from "vuex"
export default {
  data() {
    return {
@@ -146,7 +145,7 @@
        ],
      },
      data: [],
    };
        }
  },
  created() {},
  computed: {
@@ -160,51 +159,51 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {},
  methods: {
    //新增
    rowSave(row, done, loading) {
      row['strainType'] =0;
      row['tenantId'] = this.userInfo.tenant_id;
      row['deptId'] = this.userInfo.dept_id;
            row['strainType'] = 0
            row['tenantId'] = this.userInfo.tenant_id
            row['deptId'] = this.userInfo.dept_id
      save(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          window.console.log(error);
                    loading()
                    window.console.log(error)
        }
      );
            )
    },
    //修改
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          console.log(error);
                    loading()
                    console.log(error)
        }
      );
            )
    },
    //删除
    rowDel(row) {
@@ -214,20 +213,20 @@
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -235,66 +234,66 @@
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      params['tenantId'] = this.userInfo.tenant_id;
      params['deptId'] = this.userInfo.dept_id;
      this.loading = true;
            params['tenantId'] = this.userInfo.tenant_id
            params['deptId'] = this.userInfo.dept_id
            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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
src/views/flow/deploy.vue
@@ -1,12 +1,18 @@
<template>
  <basic-container>
    <avue-form ref="form" :option="option" v-model="form" :upload-before="uploadBefore" :upload-after="uploadAfter"/>
        <avue-form
            ref="form"
            :option="option"
            v-model="form"
            :upload-before="uploadBefore"
            :upload-after="uploadAfter"
        />
  </basic-container>
</template>
<script>
  import {deployUpload} from "@/api/flow/flow";
  import {flowCategory} from "@/util/flow";
import { deployUpload } from "@/api/flow/flow"
import { flowCategory } from "@/util/flow"
  export default {
    data() {
@@ -107,27 +113,27 @@
      'form.flowMode'() {
        this.$refs.form.option.column.filter(item => {
          if (item.prop === "tenantId") {
            item.display = this.form.flowMode === 2;
                    item.display = this.form.flowMode === 2
          }
        });
            })
      }
    },
    methods: {
      uploadBefore(file, done) {
        this.$message.success('部署开始');
        this.file = file;
            this.$message.success('部署开始')
            this.file = file
        done()
      },
      uploadAfter(res, done, loading) {
        if (!this.form.flowCategory) {
          this.$message.warning('清先选择流程类型');
                this.$message.warning('清先选择流程类型')
          loading()
          return false;
                return false
        }
        if (this.form.flowMode === 2 && !this.form.tenantId) {
          this.$message.warning('清先选择对应租户');
          loading();
          return false;
                this.$message.warning('清先选择对应租户')
                loading()
                return false
        }
        if (res.success) {
          deployUpload(
@@ -135,18 +141,18 @@
            (this.form.tenantId) ? this.form.tenantId.join(",") : "",
            [this.file]
          ).then(res => {
            const data = res.data;
                    const data = res.data
            if (data.success) {
              done()
            } else {
              this.$message.error(data.msg);
                        this.$message.error(data.msg)
              loading()
            }
          })
        } else {
          this.$message.warning('请上传 bpmn20.xml 标准格式文件');
                this.$message.warning('请上传 bpmn20.xml 标准格式文件')
          loading()
          return false;
                return false
        }
      },
    }
src/views/flow/follow.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -14,37 +15,29 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
      <template slot-scope="{row}"
                slot="suspensionState">
            @on-load="onLoad"
        >
            <template slot-scope="{row}" slot="suspensionState">
        <el-tag>{{row.suspensionState===1?'激活':'挂起'}}</el-tag>
      </template>
    </avue-crud>
    <el-dialog title="流程删除"
               append-to-body
               :visible.sync="followBox"
               width="20%">
      <el-form :model="form"
               ref="form"
               label-width="80px">
        <el-dialog title="流程删除" append-to-body :visible.sync="followBox" width="20%">
            <el-form :model="form" ref="form" label-width="80px">
        <el-form-item label="删除理由">
          <el-input v-model="deleteReason"
                    placeholder="请输入删除理由" />
                    <el-input v-model="deleteReason" placeholder="请输入删除理由" />
        </el-form-item>
      </el-form>
      <span slot="footer"
            class="dialog-footer">
            <span slot="footer" class="dialog-footer">
        <el-button @click="followBox = false">关 闭</el-button>
        <el-button type="primary"
                   @click="handleDelete">确 定</el-button>
                <el-button type="primary" @click="handleDelete">确 定</el-button>
      </span>
    </el-dialog>
  </basic-container>
</template>
<script>
  import {mapGetters} from "vuex";
  import {followList, deleteProcessInstance} from "@/api/flow/flow";
import { mapGetters } from "vuex"
import { followList, deleteProcessInstance } from "@/api/flow/flow"
  export default {
    data() {
@@ -114,28 +107,28 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          delBtn: this.vaildData(this.permission.flow_follow_delete, false),
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      rowDel(row) {
        this.followBox = true;
        this.selectionId = row.id;
        this.processInstanceId = row.processInstanceId;
            this.followBox = true
            this.selectionId = row.id
            this.processInstanceId = row.processInstanceId
      },
      handleDelete() {
        this.$confirm("确定将选择数据删除?", {
@@ -144,52 +137,52 @@
          type: "warning"
        })
          .then(() => {
            return deleteProcessInstance({deleteReason: this.deleteReason, processInstanceId: this.processInstanceId});
                    return deleteProcessInstance({ deleteReason: this.deleteReason, processInstanceId: this.processInstanceId })
          })
          .then(() => {
            this.onLoad(this.page);
            this.followBox = false;
                    this.onLoad(this.page)
                    this.followBox = false
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            this.loading = true
        followList(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();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/flow/manager.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -13,7 +14,8 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-radio-group v-model="mode" size="small">
          <el-radio-button label="1">通用流程</el-radio-button>
@@ -21,75 +23,71 @@
        </el-radio-group>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button type="text"
                <el-button
                    type="text"
                   size="small"
                   icon="el-icon-refresh"
                   v-if="permission.flow_manager_state"
                   @click.stop="handleState(scope.row,scope.index)">变更状态
        </el-button>
        <el-button type="text"
                    @click.stop="handleState(scope.row,scope.index)"
                >变更状态</el-button>
                <el-button
                    type="text"
                   size="small"
                   icon="el-icon-search"
                   v-if="permission.flow_manager_image"
                   @click.stop="handleImage(scope.row,scope.index)">流程图
        </el-button>
        <el-button type="text"
                    @click.stop="handleImage(scope.row,scope.index)"
                >流程图</el-button>
                <el-button
                    type="text"
                   size="small"
                   icon="el-icon-delete"
                   v-if="permission.flow_manager_remove"
                   @click.stop="handleSlotDelete(scope.row,scope.index)">删除
        </el-button>
                    @click.stop="handleSlotDelete(scope.row,scope.index)"
                >删除</el-button>
      </template>
      <template slot-scope="{row}"
                slot="tenantId">
            <template slot-scope="{row}" slot="tenantId">
        <el-tag>{{row.tenantId===''?'通用':row.tenantId}}</el-tag>
      </template>
      <template slot-scope="{row}"
                slot="version">
            <template slot-scope="{row}" slot="version">
        <el-tag>v{{row.version}}</el-tag>
      </template>
      <template slot-scope="{row}"
                slot="suspensionState">
            <template slot-scope="{row}" slot="suspensionState">
        <el-tag>{{row.suspensionState===1?'激活':'挂起'}}</el-tag>
      </template>
      <template slot-scope="{row}"
                slot="category">
            <template slot-scope="{row}" slot="category">
        <el-tag>{{row.categoryName}}</el-tag>
      </template>
    </avue-crud>
    <flow-design is-dialog :is-display.sync="flowBox" :process-definition-id="processDefinitionId"></flow-design>
    <el-dialog title="流程变更"
               append-to-body
               :visible.sync="stateBox"
               width="20%">
      <el-form :model="form"
               ref="form"
               label-width="80px">
        <flow-design
            is-dialog
            :is-display.sync="flowBox"
            :process-definition-id="processDefinitionId"
        ></flow-design>
        <el-dialog title="流程变更" append-to-body :visible.sync="stateBox" width="20%">
            <el-form :model="form" ref="form" label-width="80px">
        <el-form-item label="流程状态">
          <el-select v-model="flowState" placeholder="请选择" value="">
                    <el-select v-model="flowState" placeholder="请选择" value>
            <el-option
              v-for="item in stateOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
                            :value="item.value"
                        ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer"
            class="dialog-footer">
            <span slot="footer" class="dialog-footer">
        <el-button @click="stateBox = false">关 闭</el-button>
        <el-button type="primary"
                   @click="handleDoState">确 定</el-button>
                <el-button type="primary" @click="handleDoState">确 定</el-button>
      </span>
    </el-dialog>
  </basic-container>
</template>
<script>
  import {mapGetters} from "vuex";
  import {managerList, changeState, deleteDeployment} from "@/api/flow/flow";
  import {flowCategory} from "@/util/flow";
import { mapGetters } from "vuex"
import { managerList, changeState, deleteDeployment } from "@/api/flow/flow"
import { flowCategory } from "@/util/flow"
  export default {
    data() {
@@ -189,11 +187,11 @@
          ]
        },
        data: []
      };
        }
    },
    watch: {
      'mode'() {
        this.onLoad(this.page);
            this.onLoad(this.page)
      }
    },
    computed: {
@@ -201,45 +199,45 @@
      permissionList() {
        return {
          delBtn: this.vaildData(this.permission.flow_manager_remove, false),
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      },
      deploymentIds() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.deploymentId);
        });
        return ids.join(",");
                ids.push(ele.deploymentId)
            })
            return ids.join(",")
      }
    },
    methods: {
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -247,16 +245,16 @@
          type: "warning"
        })
          .then(() => {
            return deleteDeployment(this.deploymentIds);
                    return deleteDeployment(this.deploymentIds)
          })
          .then(() => {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
            this.onLoad(this.page);
          });
                    })
                    this.$refs.crud.toggleSelection()
                    this.onLoad(this.page)
                })
      },
      handleSlotDelete(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -265,73 +263,73 @@
          type: "warning"
        })
          .then(() => {
            return deleteDeployment(row.deploymentId);
                    return deleteDeployment(row.deploymentId)
          })
          .then(() => {
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
            this.onLoad(this.page);
          });
                    })
                    this.$refs.crud.toggleSelection()
                    this.onLoad(this.page)
                })
      },
      handleState(row) {
        this.stateBox = true;
        this.selectionId = row.id;
            this.stateBox = true
            this.selectionId = row.id
      },
      handleDoState() {
        if (!this.flowState) {
          this.$message({
            type: "warn",
            message: "请先选择流程状态!"
          });
          return;
                })
                return
        }
        changeState({processId: this.selectionId, state: this.flowState}).then(res => {
          const data = res.data;
                const data = res.data
          if (data.success) {
            this.$message({
              type: "success",
              message: data.msg
            });
            this.stateBox = false;
            this.onLoad(this.page);
                    })
                    this.stateBox = false
                    this.onLoad(this.page)
          } else {
            this.$message({
              type: "warn",
              message: data.msg
            });
                    })
          }
        })
      },
      handleImage(row) {
        this.processDefinitionId = row.id;
        this.flowBox = true;
            this.processDefinitionId = row.id
            this.flowBox = true
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        const values = {
          ...params,
          category: (params.category) ? flowCategory(params.category) : null,
          mode: this.mode
        };
        this.loading = true;
            }
            this.loading = true
        managerList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/flow/model.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -12,108 +13,113 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="primary"
                <el-button
                    type="primary"
                   size="mini"
                   icon="el-icon-circle-plus"
                   v-if="permission.flow_model_create"
                   plain
                   @click="handleCreate">创 建
        </el-button>
        <el-button type="danger"
                    @click="handleCreate"
                >创 建</el-button>
                <el-button
                    type="danger"
                   size="mini"
                   icon="el-icon-delete"
                   v-if="permission.flow_model_delete"
                   plain
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
      <template slot-scope="scope"
                slot="menu">
        <el-button type="text"
            <template slot-scope="scope" slot="menu">
                <el-button
                    type="text"
                   size="mini"
                   icon="el-icon-setting"
                   v-if="permission.flow_model_update"
                   @click.stop="handleUpdate(scope.row,scope.index)">配置
        </el-button>
        <el-button type="text"
                    @click.stop="handleUpdate(scope.row,scope.index)"
                >配置</el-button>
                <el-button
                    type="text"
                   size="mini"
                   icon="el-icon-upload2"
                   v-if="permission.flow_model_deploy"
                   @click.stop="handleDeploy(scope.row,scope.index)">部署
        </el-button>
        <el-button type="text"
                    @click.stop="handleDeploy(scope.row,scope.index)"
                >部署</el-button>
                <el-button
                    type="text"
                   size="mini"
                   icon="el-icon-delete"
                   v-if="permission.flow_model_delete"
                   @click.stop="handleSlotDelete(scope.row,scope.index)">删除
        </el-button>
                    @click.stop="handleSlotDelete(scope.row,scope.index)"
                >删除</el-button>
      </template>
      <template slot-scope="{row}"
                slot="version">
            <template slot-scope="{row}" slot="version">
        <el-tag>v{{ row.version }}</el-tag>
      </template>
    </avue-crud>
    <el-dialog title="流程配置"
        <el-dialog
            title="流程配置"
               append-to-body
               destroy-on-close
               :visible.sync="flowBox"
               :close-on-press-escape="false"
               :fullscreen="true"
               :before-close="handleNutflowClose"
               custom-class="wf-dialog">
      <wf-design-base v-if="nutflowOption.step === 1"
            custom-class="wf-dialog"
        >
            <wf-design-base
                v-if="nutflowOption.step === 1"
                      class="animated fadeIn"
                      style="height: calc(100vh - 108px);"
                      ref="wf-design"
                      :options="nutflowOption.step1"></wf-design-base>
      <wf-design-base v-if="nutflowOption.step === 2"
                :options="nutflowOption.step1"
            ></wf-design-base>
            <wf-design-base
                v-if="nutflowOption.step === 2"
                      class="animated fadeIn"
                      style="height: calc(100vh - 108px);"
                      ref="wf-design-view"
                      :options="nutflowOption.step2"></wf-design-base>
      <span slot="footer"
            class="avue-dialog__footer">
        <el-button size="small"
                   @click="handleNutflowClose(() => {}, true)">取 消</el-button>
        <el-button v-if="nutflowOption.step === 1"
                :options="nutflowOption.step2"
            ></wf-design-base>
            <span slot="footer" class="avue-dialog__footer">
                <el-button size="small" @click="handleNutflowClose(() => {}, true)">取 消</el-button>
                <el-button
                    v-if="nutflowOption.step === 1"
                   size="small"
                   type="success"
                   @click="handleStep(1)">下 一 步</el-button>
        <el-button v-if="nutflowOption.step === 2"
                    @click="handleStep(1)"
                >下 一 步</el-button>
                <el-button
                    v-if="nutflowOption.step === 2"
                   size="small"
                   type="success"
                   @click="handleStep(-1)">上 一 步</el-button>
        <el-button v-if="nutflowOption.step === 2"
                    @click="handleStep(-1)"
                >上 一 步</el-button>
                <el-button
                    v-if="nutflowOption.step === 2"
                   size="small"
                   type="primary"
                   @click="handleSubmitModel">确 定</el-button>
                    @click="handleSubmitModel"
                >确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="流程部署"
               append-to-body
               :visible.sync="deployBox"
               width="20%">
      <avue-form ref="form"
                 :option="optionDeploy"
                 v-model="form"
                 @submit="handleSubmit"/>
      <span slot="footer"
            class="dialog-footer">
        <el-dialog title="流程部署" append-to-body :visible.sync="deployBox" width="20%">
            <avue-form ref="form" :option="optionDeploy" v-model="form" @submit="handleSubmit" />
            <span slot="footer" class="dialog-footer">
        <el-button @click="deployBox = false">取 消</el-button>
        <el-button type="primary"
                   @click="handleDoDeploy"
                   :loading="deployLoading">确 定</el-button>
                <el-button type="primary" @click="handleDoDeploy" :loading="deployLoading">确 定</el-button>
      </span>
    </el-dialog>
  </basic-container>
</template>
<script>
import {mapGetters} from "vuex";
import {modelList, removeModel, deployModel, submitModel, detail} from "@/api/flow/flow";
import {flowCategory} from "@/util/flow";
import { mapGetters } from "vuex"
import { modelList, removeModel, deployModel, submitModel, detail } from "@/api/flow/flow"
import { flowCategory } from "@/util/flow"
export default {
  data() {
@@ -265,25 +271,25 @@
          minimap: true,
        }
      }
    };
        }
  },
  watch: {
    'form.flowMode'() {
      this.$refs.form.option.column.filter(item => {
        if (item.prop === "tenantId") {
          item.display = this.form.flowMode === 2;
                    item.display = this.form.flowMode === 2
        }
      });
            })
    }
  },
  computed: {
    ...mapGetters(["permission"]),
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    }
  },
  methods: {
@@ -343,53 +349,53 @@
      }
    },
    handleSubmit(form, done) {
      this.deployLoading = true;
            this.deployLoading = true
      deployModel({
        modelId: this.selectionId,
        category: flowCategory(form.categoryValue),
        tenantIds: form.tenantId.join(",")
      }).then(res => {
        const data = res.data;
                const data = res.data
        if (data.success) {
          this.$message({
            type: "success",
            message: data.msg
          });
          done();
          this.$refs.form.resetForm();
          this.deployBox = false;
          this.deployLoading = false;
                    })
                    done()
                    this.$refs.form.resetForm()
                    this.deployBox = false
                    this.deployLoading = false
        } else {
          done();
          this.deployLoading = false;
                    done()
                    this.deployLoading = false
          this.$message({
            type: "warn",
            message: data.msg
          });
                    })
        }
      })
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -397,19 +403,19 @@
        type: "warning"
      })
        .then(() => {
          return removeModel(this.ids);
                    return removeModel(this.ids)
        })
        .then(() => {
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
          this.onLoad(this.page);
        });
                    })
                    this.$refs.crud.toggleSelection()
                    this.onLoad(this.page)
                })
    },
    handleCreate() {
      this.flowBox = true;
            this.flowBox = true
    },
    handleUpdate(row) {
      detail({id: row.id}).then(res => {
@@ -417,15 +423,15 @@
        const {modelEditorXml} = data
        this.$set(this.nutflowOption.step1, 'xml', modelEditorXml)
        this.$set(this.nutflowOption, 'process', data)
        this.flowBox = true;
                this.flowBox = true
      })
    },
    handleDeploy(row) {
      this.deployBox = true;
      this.selectionId = row.id;
            this.deployBox = true
            this.selectionId = row.id
    },
    handleDoDeploy() {
      this.$refs.form.submit();
            this.$refs.form.submit()
    },
    handleSlotDelete(row) {
      this.$confirm("确定将选择数据删除?", {
@@ -434,42 +440,41 @@
        type: "warning"
      })
        .then(() => {
          return removeModel(row.id);
                    return removeModel(row.id)
        })
        .then(() => {
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
          this.onLoad(this.page);
        });
                    })
                    this.$refs.crud.toggleSelection()
                    this.onLoad(this.page)
                })
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
            this.loading = true
      modelList(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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    }
  }
};
</script>
<style lang="scss">
.wf-dialog {
  .el-dialog__body {
    padding: 5px;
src/views/land/cs.vue
src/views/land/land.vue
@@ -27,16 +27,11 @@
          icon="el-icon-delete"
          v-if="permission.rail_delete"
          @click="handleDelete"
        >删 除
        </el-button>
                >删 除</el-button>
      </template>
      <!-- 地图插入 -->
      <template slot-scope="{ type, disabled }" slot="lineForm">
        <getMapDataInThere
          ref="getMapData"
          id="getMapData"
          @setMapData="setMapData"
        ></getMapDataInThere>
                <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
@@ -45,28 +40,24 @@
          size="mini"
          @click="start(row)"
          :size="size"
        >农事记录
        </el-button
        >
                >农事记录</el-button>
        <el-button
          icon="el-icon-circle-plus-outline"
          type="text"
          size="mini"
          @click="startc(row)"
          :size="size"
        >采收记录
        </el-button
        >
                >采收记录</el-button>
      </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: {
@@ -170,7 +161,7 @@
          }
        ],
      }
    };
        }
  },
  created() {
    // this.getRailLazyTree();
@@ -183,14 +174,14 @@
        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 = [];
            let ids = []
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    }
  },
  mounted() {
@@ -199,47 +190,47 @@
    rowSave(row, done, loading) {
      if (this.polygons.length == 0) {
        //没有面的数据
        this.$refs.getMapData.isCheck = true;
        loading();
                this.$refs.getMapData.isCheck = true
                loading()
      } else {
        //如果有值,空间坐标转换
        let pol = this.polygons;
        let polLength = this.polygons.length - 1;
        let usePolygons = "";
                let pol = this.polygons
                let polLength = this.polygons.length - 1
                let usePolygons = ""
        for (let k in pol) {
          usePolygons += pol[k].lng + "," + pol[k].lat;
                    usePolygons += pol[k].lng + "," + pol[k].lat
          if (k != polLength) {
            usePolygons += ";";
                        usePolygons += ";"
          }
        }
        //设置坐标点
        row.userId = this.userInfo.user_id;
        row.landRange = usePolygons;
                row.userId = this.userInfo.user_id
                row.landRange = usePolygons
      }
      add(row).then(() => {
        this.onLoad(this.page);
                this.onLoad(this.page)
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        window.console.log(error);
      });
                loading()
                window.console.log(error)
            })
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(() => {
        this.onLoad(this.page);
                this.onLoad(this.page)
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        console.log(error);
      });
                loading()
                console.log(error)
            })
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
@@ -248,20 +239,20 @@
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -269,16 +260,16 @@
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
@@ -287,78 +278,77 @@
        // });
        getDetail(this.form.id).then((res) => {
          if (res.data.code == 200) {
            this.form = res.data.data;
                        this.form = res.data.data
            let usePolygons = this.form.landRange
              .split("POLYGON((")[1]
              .split("))")[0]
              .split(",");
                            .split(",")
            for (let k in usePolygons) {
              usePolygons[k] = {
                lng: +usePolygons[k].split(" ")[0],
                lat: +usePolygons[k].split(" ")[1],
              };
            }
            this.$refs.getMapData.draw(usePolygons);
          }
        });
                        this.$refs.getMapData.draw(usePolygons)
      }
      done();
                })
            }
            done()
    },
    //农事操作
    start(row) {
      this.$router.push({
        path: `/farmingrecord`,
        query: row
      });
            })
    },
    startc(row) {
      this.$router.push({
        path: `/recovery`,
        query: row
      });
            })
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
            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();
      });
                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;
}
@@ -366,7 +356,6 @@
.mapClassMain {
  padding-left: 5rem !important;
}
#getMapData {
  width: calc(100% + 90px);
src/views/land/landAdd.vue
@@ -10,11 +10,7 @@
    <avue-form ref="form" v-model="form" :option="option" @submit="submit">
      <!-- 地图插入 -->
      <template slot-scope="{ type, disabled }" slot="line">
        <getMapDataInThere
          ref="getMapData"
          id="getMapData"
          @setMapData="setMapData"
        ></getMapDataInThere>
                <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>
      </template>
    </avue-form>
  </el-dialog>
@@ -22,12 +18,12 @@
<script>
import {mapGetters} from "vuex";
import {getFarmList} from "@/api/farm/farm";
import {getDeptTree} from "@/api/system/dept";
import {add} from "@/api/land/land";
import website from '@/config/website';
import getMapDataInThere from "./getMapDataInThere.vue";
import { mapGetters } from "vuex"
import { getFarmList } from "@/api/farm/farm"
import { getDeptTree } from "@/api/system/dept"
import { add } from "@/api/land/land"
import website from '@/config/website'
import getMapDataInThere from "./getMapDataInThere.vue"
export default {
  components: {
@@ -107,13 +103,13 @@
        ],
      },
      visible: false,
    };
        }
  },
  computed: {
    ...mapGetters(["userInfo", "permission", "polygons"]),
  },
  mounted() {
    this.initData(this.userInfo.tenant_id);
        this.initData(this.userInfo.tenant_id)
  },
  methods: {
    initData(tenantId) {
@@ -126,57 +122,57 @@
          deptId:this.userInfo.dept_id
        }
      getFarmList(data).then(res => {
          const column = this.findObject(this.option.column, "farmId");
          column.dicData = res.data.data;
        });
                const column = this.findObject(this.option.column, "farmId")
                column.dicData = res.data.data
            })
    },
    //初始化
    init() {
      //清空面的数据
      this.$store.commit('clear_polygon');
            this.$store.commit('clear_polygon')
      //计算当前时间
      this.visible = true;
            this.visible = true
    },
    // 表单提交
    submit(row, loading) {
      row['deptId'] = this.userInfo.dept_id;
      var that = this;
            row['deptId'] = this.userInfo.dept_id
            var that = this
      if (this.polygons.length == 0) {
        //没有面的数据
        this.$refs.getMapData.isCheck = true;
        loading();
                this.$refs.getMapData.isCheck = true
                loading()
      } else {
        //如果有值,空间坐标转换
        let pol = this.polygons;
        let polLength = this.polygons.length - 1;
        let usePolygons = "";
                let pol = this.polygons
                let polLength = this.polygons.length - 1
                let usePolygons = ""
        for (let k in pol) {
          usePolygons += pol[k].lng + "," + pol[k].lat;
                    usePolygons += pol[k].lng + "," + pol[k].lat
          if (k != polLength) {
            usePolygons += ";";
                        usePolygons += ";"
          }
        }
        //设置坐标点
        row.userId = this.userInfo.user_id;
        row.landRange = usePolygons;
                row.userId = this.userInfo.user_id
                row.landRange = usePolygons
      }
      add(row).then(() => {
        that.$emit("refreshOnLoad");
        that.$refs.form.resetFields();
        that.visible = false;
                that.$emit("refreshOnLoad")
                that.$refs.form.resetFields()
                that.visible = false
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        window.console.log(error);
      });
                loading()
                window.console.log(error)
            })
    },
    setMapData(val) {
      this.LineData = val[0];
      this.PointData = val[1];
            this.LineData = val[0]
            this.PointData = val[1]
    },
  },
};
src/views/land/landMap.vue
@@ -27,26 +27,21 @@
          icon="el-icon-delete"
          v-if="permission.rail_delete"
          @click="handleDelete"
        >删 除
        </el-button>
                >删 除</el-button>
      </template>
      <!-- 地图插入 -->
      <template slot-scope="{ type, disabled }" slot="lineForm">
        <getMapDataInThere
          ref="getMapData"
          id="getMapData"
          @setMapData="setMapData"
        ></getMapDataInThere>
                <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: {
@@ -150,7 +145,7 @@
          }
        ],
      }
    };
        }
  },
  created() {
    // this.getRailLazyTree();
@@ -163,14 +158,14 @@
        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 = [];
            let ids = []
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    }
  },
  mounted() {
@@ -179,47 +174,47 @@
    rowSave(row, done, loading) {
      if (this.polygons.length == 0) {
        //没有面的数据
        this.$refs.getMapData.isCheck = true;
        loading();
                this.$refs.getMapData.isCheck = true
                loading()
      } else {
        //如果有值,空间坐标转换
        let pol = this.polygons;
        let polLength = this.polygons.length - 1;
        let usePolygons = "";
                let pol = this.polygons
                let polLength = this.polygons.length - 1
                let usePolygons = ""
        for (let k in pol) {
          usePolygons += pol[k].lng + "," + pol[k].lat;
                    usePolygons += pol[k].lng + "," + pol[k].lat
          if (k != polLength) {
            usePolygons += ";";
                        usePolygons += ";"
          }
        }
        //设置坐标点
        row.userId = this.userInfo.user_id;
        row.landRange = usePolygons;
                row.userId = this.userInfo.user_id
                row.landRange = usePolygons
      }
      add(row).then(() => {
        this.onLoad(this.page);
                this.onLoad(this.page)
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        window.console.log(error);
      });
                loading()
                window.console.log(error)
            })
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(() => {
        this.onLoad(this.page);
                this.onLoad(this.page)
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        console.log(error);
      });
                loading()
                console.log(error)
            })
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
@@ -228,20 +223,20 @@
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -249,16 +244,16 @@
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
@@ -267,65 +262,64 @@
        // });
        getDetail(this.form.id).then((res) => {
          if (res.data.code == 200) {
            this.form = res.data.data;
                        this.form = res.data.data
            let usePolygons = this.form.landRange
              .split("POLYGON((")[1]
              .split("))")[0]
              .split(",");
                            .split(",")
            for (let k in usePolygons) {
              usePolygons[k] = {
                lng: +usePolygons[k].split(" ")[0],
                lat: +usePolygons[k].split(" ")[1],
              };
            }
            this.$refs.getMapData.draw(usePolygons);
          }
        });
                        this.$refs.getMapData.draw(usePolygons)
      }
      done();
                })
            }
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
            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();
      });
                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;
}
@@ -333,7 +327,6 @@
.mapClassMain {
  padding-left: 5rem !important;
}
#getMapData {
  width: calc(100% + 90px);
src/views/machining/machining.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -17,31 +18,32 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.machining_delete"
                   @click="handleDelete">删 除
        </el-button>
        <el-button type="success"
                    @click="handleDelete"
                >删 除</el-button>
                <el-button
                    type="success"
                   size="small"
                   plain
                   icon="el-icon-upload2"
                   @click="handleImport">导入
        </el-button>
                    @click="handleImport"
                >导入</el-button>
      </template>
    </avue-crud>
    <el-dialog title="用户数据导入"
               append-to-body
               :visible.sync="excelBox"
               width="555px">
        <el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px">
      <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
        <template slot="excelTemplate">
          <el-button type="primary" @click="handleTemplate">
            点击下载<i class="el-icon-download el-icon--right"></i>
                        点击下载
                        <i class="el-icon-download el-icon--right"></i>
          </el-button>
        </template>
      </avue-form>
@@ -50,8 +52,8 @@
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/machining/machining";
import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/machining/machining"
import { mapGetters } from "vuex"
export default {
  data() {
@@ -184,7 +186,7 @@
        ]
      },
      data: []
    };
        }
  },
  computed: {
    ...mapGetters(["permission"]),
@@ -194,42 +196,42 @@
        viewBtn: this.vaildData(this.permission.machining_view, false),
        delBtn: this.vaildData(this.permission.machining_delete, false),
        editBtn: this.vaildData(this.permission.machining_edit, false)
      };
            }
    },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    }
  },
  methods: {
    rowSave(row, done, loading) {
      add(row).then(() => {
        this.onLoad(this.page);
                this.onLoad(this.page)
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        window.console.log(error);
      });
                loading()
                window.console.log(error)
            })
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(() => {
        this.onLoad(this.page);
                this.onLoad(this.page)
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        console.log(error);
      });
                loading()
                console.log(error)
            })
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
@@ -238,20 +240,20 @@
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -259,69 +261,69 @@
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then(res => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
            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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
    handleImport() {
      this.excelBox = true;
            this.excelBox = true
    },
    uploadAfter(res, done, loading, column) {
      window.console.log(column);
      this.excelBox = false;
      this.refreshChange();
      done();
            window.console.log(column)
            this.excelBox = false
            this.refreshChange()
            done()
    },
  }
};
src/views/mapPattern/index.vue
@@ -19,7 +19,7 @@
            </div>
            <div class="out" @click="goToBack">
                <img src="../../../public/img/out.png" />
                <span>&nbsp;&nbsp;退出</span>
                <span>&nbsp;&nbsp;返回</span>
            </div>
        </div>
        <div class="farm-plant">
@@ -38,15 +38,19 @@
        </div>
        <div class="land-info">
            <div class="content">
                <span>有轮廓的地块:</span>
                <div>
                    有轮廓的地块:
                <span
                    style="font-size: 26px;font-weight: bold;color: #5ABF78;"
                >&nbsp;{{landIsAreaStatistic[0]}}</span>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <span>无轮廓的地块:</span>
                    >{{landIsAreaStatistic[0]}}</span>
                </div>
                <div>
                    无轮廓的地块:
                <span
                    style="font-size: 26px;font-weight: bold;color: #E3B745;"
                >&nbsp;{{landIsAreaStatistic[1]}}</span>
                    >{{landIsAreaStatistic[1]}}</span>
                </div>
            </div>
        </div>
        <div class="farm-land">
@@ -90,7 +94,7 @@
            landList: [],
            farmInfo: {},
            landAreaInfo: {},
            landIsAreaStatistic: null,
            landIsAreaStatistic: [0, 0],
        }
    },
@@ -179,6 +183,7 @@
        //获取地块轮廓统计信息
        getLandIsAreaStatistic () {
            getLandIsAreaStatistic(this.userInfo.farmId).then(res => {
                console.log(res)
                this.landIsAreaStatistic = res.data.data
            })
        }
@@ -264,17 +269,23 @@
    top: 112px;
    .content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: auto;
        padding: 0 40px;
        width: 431px;
        height: 56px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 28px 28px 28px 28px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 16px;
        font-weight: 400;
        color: #ffffff;
        & > div {
            display: flex;
            align-items: center;
        }
    }
}
src/views/monitor/log/api.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -13,14 +14,14 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    </avue-crud>
            @on-load="onLoad"
        ></avue-crud>
  </basic-container>
</template>
<script>
  import {getApiList, getApiLogs} from "@/api/logs";
  import {mapGetters} from "vuex";
import { getApiList, getApiLogs } from "@/api/logs"
import { mapGetters } from "vuex"
  export default {
    data() {
@@ -105,7 +106,7 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
@@ -113,45 +114,45 @@
      permissionList() {
        return {
          viewBtn: this.vaildData(this.permission.log_api_view, false)
        };
            }
      }
    },
    methods: {
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getApiLogs(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            this.loading = true
        getApiList(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;
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
            })
      }
    }
  };
src/views/monitor/log/error.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -13,14 +14,14 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    </avue-crud>
            @on-load="onLoad"
        ></avue-crud>
  </basic-container>
</template>
<script>
  import {getErrorList, getErrorLogs} from "@/api/logs";
  import {mapGetters} from "vuex";
import { getErrorList, getErrorLogs } from "@/api/logs"
import { mapGetters } from "vuex"
  export default {
    data() {
@@ -110,52 +111,52 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          viewBtn: this.vaildData(this.permission.log_error_view, false)
        };
            }
      }
    },
    methods: {
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getErrorLogs(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            this.loading = true
        getErrorList(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;
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
            })
      }
    }
  };
src/views/monitor/log/usual.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -13,14 +14,14 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
    </avue-crud>
            @on-load="onLoad"
        ></avue-crud>
  </basic-container>
</template>
<script>
  import {getUsualList, getUsualLogs} from "@/api/logs";
  import {mapGetters} from "vuex";
import { getUsualList, getUsualLogs } from "@/api/logs"
import { mapGetters } from "vuex"
  export default {
    data() {
@@ -110,52 +111,52 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          viewBtn: this.vaildData(this.permission.log_usual_view, false)
        };
            }
      }
    },
    methods: {
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getUsualLogs(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            this.loading = true
        getUsualList(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;
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
            })
      }
    }
  };
src/views/panorama/panorama.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -17,15 +18,17 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.panorama_delete"
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
      <template slot-scope="{ type, disabled }" slot="chouseJdWdForm">
        <chousePoint @setData="getMapDatas" ref="chousePointRef"></chousePoint>
@@ -35,9 +38,9 @@
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/panorama/panorama";
  import {getPage} from "@/api/panorama/panorama";
  import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/panorama/panorama"
import { getPage } from "@/api/panorama/panorama"
import { mapGetters } from "vuex"
  export default {
    data() {
      return {
@@ -134,7 +137,7 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
      ...mapGetters(["permission"]),
@@ -144,47 +147,47 @@
          viewBtn: this.vaildData(this.permission.panorama_view, false),
          delBtn: this.vaildData(this.permission.panorama_delete, false),
          editBtn: this.vaildData(this.permission.panorama_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      getMapDatas(res) {
        this.form["jd"] = res[0];
        this.form["wd"] = res[1];
        this.form["addressName"] = res[2];
            this.form["jd"] = res[0]
            this.form["wd"] = res[1]
            this.form["addressName"] = res[2]
      },
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          loading();
          window.console.log(error);
        });
                loading()
                window.console.log(error)
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          loading();
          console.log(error);
        });
                loading()
                console.log(error)
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -193,20 +196,20 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -214,23 +217,23 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then((res) => {
            this.form = res.data.data;
                    this.form = res.data.data
            if (type == "edit") {
              let that = this;
                        let that = this
              this.$store.commit("readDom", {
                this: that,
                refName: "chousePointRef",
@@ -239,49 +242,49 @@
                    jd: this.form.jd,
                    wd: this.form.wd,
                    name: this.form.addressName,
                  });
                                })
                },
              });
                        })
            }
          });
                })
        }
        done();
            done()
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            this.loading = true
        getPage(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();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/recovery/recovery.vue
@@ -27,19 +27,18 @@
          icon="el-icon-delete"
          plain
          @click="handleDelete"
          >删 除
        </el-button>
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import { getDetail, getList, update, remove, save } from "@/api/farmplant/recovery";
import { getStrainList } from "@/api/farmplant/strain";
import { getLandList } from "@/api/land/land";
import { getUserList } from "@/api/system/user";
import { mapGetters } from "vuex";
import { getDetail, getList, update, remove, save } from "@/api/farmplant/recovery"
import { getStrainList } from "@/api/farmplant/strain"
import { getLandList } from "@/api/land/land"
import { getUserList } from "@/api/system/user"
import { mapGetters } from "vuex"
export default {
  props:[
    "type","activeName"
@@ -259,12 +258,12 @@
        ],
      },
      data: [],
    };
        }
  },
  created() {
    this.initData();
        this.initData()
    if(this.activeName =="tab3"){
      this.option.height = 520;
            this.option.height = 520
    }
  },
  computed: {
@@ -278,80 +277,80 @@
    //   };
    // },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {},
  methods: {
    //初始化数据
    initData(){
      var that = this;
            var that = this
      //获取农地数据
      getLandList(this.userInfo.dept_id).then((res)=>{
          if(res.data.code==200){
              var landIdcolumn = that.findObject(that.option.column,"landId");
              that.landList = res.data.data;
              landIdcolumn.dicData = res.data.data;
                    var landIdcolumn = that.findObject(that.option.column, "landId")
                    that.landList = res.data.data
                    landIdcolumn.dicData = res.data.data
          }
      })
      //获取农产品数据
      getStrainList(0).then((res)=>{
          if(res.data.code==200){
              var strainId = that.findObject(that.option.column,"strainId");
              strainId.dicData = res.data.data;
                    var strainId = that.findObject(that.option.column, "strainId")
                    strainId.dicData = res.data.data
          }
      })
      //获取操作人
      const user = {
        tenantId: this.userInfo.tenant_id,
      };
            }
      getUserList(user).then((res) => {
        if (res.data.code == 200) {
          var operatorcolumn = that.findObject(that.option.column, "operator");
          operatorcolumn.dicData = res.data.data;
                    var operatorcolumn = that.findObject(that.option.column, "operator")
                    operatorcolumn.dicData = res.data.data
        }
      });
            })
    },
    //新增
    rowSave(row, done, loading) {
      row['farmType'] = 0;
      row['createUser'] = this.userInfo.user_id;
            row['farmType'] = 0
            row['createUser'] = this.userInfo.user_id
      save(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          window.console.log(error);
                    loading()
                    window.console.log(error)
        }
      );
            )
    },
    //修改
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
                    })
                    done()
        },
        (error) => {
          loading();
          console.log(error);
                    loading()
                    console.log(error)
        }
      );
            )
    },
    //删除
    rowDel(row) {
@@ -361,20 +360,20 @@
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -382,66 +381,66 @@
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      params['tenantId'] = this.userInfo.tenant_id;
      params['deptId'] = this.userInfo.dept_id;
      this.loading = true;
            params['tenantId'] = this.userInfo.tenant_id
            params['deptId'] = this.userInfo.dept_id
            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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    },
  },
};
src/views/remote/remote.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -17,23 +18,25 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.remote_delete"
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/remote/remote";
import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/remote/remote"
import { mapGetters } from "vuex"
export default {
  data() {
@@ -209,7 +212,7 @@
        ]
      },
      data: []
    };
        }
  },
  computed: {
    ...mapGetters(["permission"]),
@@ -219,42 +222,42 @@
        viewBtn: this.vaildData(this.permission.remote_view, false),
        delBtn: this.vaildData(this.permission.remote_delete, false),
        editBtn: this.vaildData(this.permission.remote_edit, false)
      };
            }
    },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    }
  },
  methods: {
    rowSave(row, done, loading) {
      add(row).then(() => {
        this.onLoad(this.page);
                this.onLoad(this.page)
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        window.console.log(error);
      });
                loading()
                window.console.log(error)
            })
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(() => {
        this.onLoad(this.page);
                this.onLoad(this.page)
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
                })
                done()
      }, error => {
        loading();
        console.log(error);
      });
                loading()
                console.log(error)
            })
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
@@ -263,20 +266,20 @@
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        });
                    })
                })
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -284,73 +287,73 @@
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then(res => {
          this.form = res.data.data;
        });
                    this.form = res.data.data
                })
      }
      done();
            done()
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      const {releaseTimeRange} = this.query;
            const { releaseTimeRange } = this.query
      let values = {
        ...params,
        ...this.query
      };
            }
      if (releaseTimeRange) {
        values = {
          ...values,
          releaseTime_datege: releaseTimeRange[0],
          releaseTime_datelt: releaseTimeRange[1],
        };
        values.releaseTimeRange = null;
      }
      this.loading = true;
                values.releaseTimeRange = null
            }
            this.loading = true
      getList(page.currentPage, page.pageSize, values).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    }
  }
};
src/views/report/reportlist.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -14,14 +15,16 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button
@@ -30,16 +33,14 @@
          size="small"
          @click.stop="handleDesign(scope.row.name)"
          v-if="userInfo.role_name.includes('admin')"
        >设计
        </el-button>
                >设计</el-button>
        <el-button
          type="text"
          icon="el-icon-view"
          size="small"
          @click.stop="handlePreview(scope.row.name)"
          v-if="userInfo.role_name.includes('admin')"
        >预览
        </el-button>
                >预览</el-button>
      </template>
      <template slot-scope="{row}" slot="name">
        <el-tag style="cursor:pointer" @click="handlePreview(row.name)">{{ row.name }}</el-tag>
@@ -49,8 +50,8 @@
</template>
<script>
import {getList, remove} from "@/api/report/report";
import {mapGetters} from "vuex";
import { getList, remove } from "@/api/report/report"
import { mapGetters } from "vuex"
export default {
  data() {
@@ -93,7 +94,7 @@
        ]
      },
      data: []
    };
        }
  },
  computed: {
    ...mapGetters(["userInfo", "permission"]),
@@ -103,22 +104,22 @@
        viewBtn: false,
        delBtn: true,
        editBtn: false
      };
            }
    },
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    }
  },
  methods: {
    handlePreview(name) {
      this.$router.push({path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`});
            this.$router.push({ path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}` })
    },
    handleDesign(name) {
      this.$router.push({path: `/myiframe/urlPath?name=designer-${name}&src=${this.website.reportUrl}/designer?_u=blade-${name}`});
            this.$router.push({ path: `/myiframe/urlPath?name=designer-${name}&src=${this.website.reportUrl}/designer?_u=blade-${name}` })
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
@@ -127,37 +128,37 @@
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
                    return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        });
                    })
                })
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
                this.$message.warning("请选择至少一条数据")
                return
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -165,35 +166,35 @@
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
                    return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page);
                    this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
                    })
                    this.$refs.crud.toggleSelection()
                })
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
            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();
      });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
    }
  }
};
src/views/resource/attach.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -15,49 +16,53 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="primary"
                <el-button
                    type="primary"
                   size="small"
                   plain
                   v-if="permission.attach_upload"
                   icon="el-icon-upload2"
                   @click="handleUpload">上 传
        </el-button>
        <el-button type="danger"
                    @click="handleUpload"
                >上 传</el-button>
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.attach_delete"
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button type="text"
                <el-button
                    type="text"
                   icon="el-icon-download"
                   size="small"
                   v-if="permission.attach_download"
                   @click="handleDownload(scope.row)">下载
        </el-button>
                    @click="handleDownload(scope.row)"
                >下载</el-button>
      </template>
      <template slot-scope="{row}"
                slot="attachSize">
            <template slot-scope="{row}" slot="attachSize">
        <el-tag>{{`${row.attachSize} KB`}}</el-tag>
      </template>
    </avue-crud>
    <el-dialog title="附件管理"
               append-to-body
               :visible.sync="attachBox"
               width="555px">
      <avue-form ref="form" :option="attachOption" v-model="attachForm" :upload-after="uploadAfter">
      </avue-form>
        <el-dialog title="附件管理" append-to-body :visible.sync="attachBox" width="555px">
            <avue-form
                ref="form"
                :option="attachOption"
                v-model="attachForm"
                :upload-after="uploadAfter"
            ></avue-form>
    </el-dialog>
  </basic-container>
</template>
<script>
  import {getList, getDetail, remove} from "@/api/resource/attach";
  import {mapGetters} from "vuex";
import { getList, getDetail, remove } from "@/api/resource/attach"
import { mapGetters } from "vuex"
  export default {
    data() {
@@ -164,7 +169,7 @@
            }
          ]
        }
      };
        }
    },
    computed: {
      ...mapGetters(["permission"]),
@@ -174,28 +179,28 @@
          editBtn: false,
          viewBtn: false,
          delBtn: this.vaildData(this.permission.attach_delete, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      handleUpload() {
        this.attachBox = true;
            this.attachBox = true
      },
      uploadAfter(res, done, loading, column) {
        window.console.log(column);
        this.attachBox = false;
        this.refreshChange();
        done();
            window.console.log(column)
            this.attachBox = false
            this.refreshChange()
            done()
      },
      handleDownload(row) {
        window.open(`${row.link}`);
            window.open(`${row.link}`)
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -204,20 +209,20 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -225,60 +230,60 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            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();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/resource/oss.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -17,52 +18,51 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.oss_delete"
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button type="text"
                <el-button
                    type="text"
                   icon="el-icon-video-play"
                   size="small"
                   v-if="userInfo.role_name.includes('admin')"
                   @click="handleDebug(scope.row)">调试
        </el-button>
        <el-button type="text"
                    @click="handleDebug(scope.row)"
                >调试</el-button>
                <el-button
                    type="text"
                   icon="el-icon-circle-check"
                   size="small"
                   v-if="permission.oss_enable"
                   @click.stop="handleEnable(scope.row)">启用
        </el-button>
                    @click.stop="handleEnable(scope.row)"
                >启用</el-button>
      </template>
      <template slot-scope="{row}"
                slot="status">
            <template slot-scope="{row}" slot="status">
        <el-tag>{{row.statusName}}</el-tag>
      </template>
      <template slot-scope="{row}"
                slot="category">
            <template slot-scope="{row}" slot="category">
        <el-tag>{{row.categoryName}}</el-tag>
      </template>
    </avue-crud>
    <el-dialog title="对象存储上传调试"
               append-to-body
               :visible.sync="box"
               width="550px">
        <el-dialog title="对象存储上传调试" append-to-body :visible.sync="box" width="550px">
      <avue-form ref="form" :option="debugOption" v-model="debugForm" @submit="handleSubmit"/>
    </el-dialog>
  </basic-container>
</template>
<script>
  import {getList, getDetail, add, update, remove, enable} from "@/api/resource/oss";
  import {mapGetters} from "vuex";
  import func from "@/util/func";
import { getList, getDetail, add, update, remove, enable } from "@/api/resource/oss"
import { mapGetters } from "vuex"
import func from "@/util/func"
  export default {
    data() {
@@ -234,23 +234,23 @@
            },
          ]
        }
      };
        }
    },
    watch: {
      'form.category'() {
        const category = func.toInt(this.form.category);
            const category = func.toInt(this.form.category)
        this.$refs.crud.option.column.filter(item => {
          if (item.prop === "appId") {
            item.display = category === 4;
                    item.display = category === 4
          }
          if (item.prop === "region") {
            item.display = category === 4;
                    item.display = category === 4
          }
        });
            })
      },
      'debugForm.code'() {
        const column = this.findObject(this.debugOption.column, "backgroundUrl");
        column.action = `/api/blade-resource/oss/endpoint/put-file?code=${this.debugForm.code}`;
            const column = this.findObject(this.debugOption.column, "backgroundUrl")
            column.action = `/api/blade-resource/oss/endpoint/put-file?code=${this.debugForm.code}`
      }
    },
    computed: {
@@ -261,42 +261,42 @@
          viewBtn: this.vaildData(this.permission.oss_view),
          delBtn: this.vaildData(this.permission.oss_delete),
          editBtn: this.vaildData(this.permission.oss_edit)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -305,32 +305,32 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      handleEnable(row) {
        this.$confirm("是否确定启用这条配置?", {
@@ -339,33 +339,33 @@
          type: "warning"
        })
          .then(() => {
            return enable(row.id);
                    return enable(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      handleDebug(row) {
        this.box = true;
        this.debugForm.code = row.ossCode;
        this.debugForm.backgroundUrl = '';
            this.box = true
            this.debugForm.code = row.ossCode
            this.debugForm.backgroundUrl = ''
      },
      handleSubmit(form, done) {
        this.$message({
          type: "success",
          message: `获取到图片地址:[${form.backgroundUrl}]`
        });
        done();
            })
            done()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -373,43 +373,43 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            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();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/resource/sms.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -17,52 +18,51 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.sms_delete"
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button type="text"
                <el-button
                    type="text"
                   icon="el-icon-video-play"
                   size="small"
                   v-if="userInfo.role_name.includes('admin')"
                   @click="handleDebug(scope.row)">调试
        </el-button>
        <el-button type="text"
                    @click="handleDebug(scope.row)"
                >调试</el-button>
                <el-button
                    type="text"
                   icon="el-icon-circle-check"
                   size="small"
                   v-if="permission.sms_enable"
                   @click.stop="handleEnable(scope.row)">启用
        </el-button>
                    @click.stop="handleEnable(scope.row)"
                >启用</el-button>
      </template>
      <template slot-scope="{row}"
                slot="status">
            <template slot-scope="{row}" slot="status">
        <el-tag>{{row.statusName}}</el-tag>
      </template>
      <template slot-scope="{row}"
                slot="category">
            <template slot-scope="{row}" slot="category">
        <el-tag>{{row.categoryName}}</el-tag>
      </template>
    </avue-crud>
    <el-dialog title="手机短信发送调试"
               append-to-body
               :visible.sync="box"
               width="550px">
        <el-dialog title="手机短信发送调试" append-to-body :visible.sync="box" width="550px">
      <avue-form :option="debugOption" v-model="debugForm" @submit="handleSend"/>
    </el-dialog>
  </basic-container>
</template>
<script>
  import {getList, getDetail, add, update, remove, enable, send} from "@/api/resource/sms";
  import {mapGetters} from "vuex";
  import func from "@/util/func";
import { getList, getDetail, add, update, remove, enable, send } from "@/api/resource/sms"
import { mapGetters } from "vuex"
import func from "@/util/func"
  export default {
    data() {
@@ -227,45 +227,45 @@
            },
          ]
        }
      };
        }
    },
    watch: {
      'form.category'() {
        const category = func.toInt(this.form.category);
            const category = func.toInt(this.form.category)
        this.$refs.crud.option.column.filter(item => {
          if (item.prop === "templateId") {
            if (category === 1) {
              item.label = "模版内容";
                        item.label = "模版内容"
            } else {
              item.label = "模版ID";
                        item.label = "模版ID"
            }
          }
          if (item.prop === "accessKey") {
            if (category === 1) {
              item.label = "apiKey";
                        item.label = "apiKey"
            } else if (category === 4) {
              item.label = "appId";
                        item.label = "appId"
            } else {
              item.label = "accessKey";
                        item.label = "accessKey"
            }
          }
          if (item.prop === "secretKey") {
            item.display = category !== 1;
                    item.display = category !== 1
            if (category === 4) {
              item.label = "appKey";
                        item.label = "appKey"
            } else {
              item.label = "secretKey";
                        item.label = "secretKey"
            }
          }
          if (item.prop === "regionId") {
            if (category === 3) {
              item.display = true;
              item.value = "cn-hangzhou";
                        item.display = true
                        item.value = "cn-hangzhou"
            } else {
              item.display = false;
                        item.display = false
            }
          }
        });
            })
      }
    },
    computed: {
@@ -276,42 +276,42 @@
          viewBtn: this.vaildData(this.permission.sms_view, false),
          delBtn: this.vaildData(this.permission.sms_delete, false),
          editBtn: this.vaildData(this.permission.sms_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -320,15 +320,15 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      handleEnable(row) {
        this.$confirm("是否确定启用这条配置?", {
@@ -337,39 +337,39 @@
          type: "warning"
        })
          .then(() => {
            return enable(row.id);
                    return enable(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      handleDebug(row) {
        this.box = true;
        this.debugForm.code = row.smsCode;
            this.box = true
            this.debugForm.code = row.smsCode
      },
      handleSend(form, done, loading) {
        send(form.code, form.phones, form.params).then((res) => {
          this.$message({
            type: "success",
            message: "发送成功!"
          });
          done();
          window.console.log(res);
          this.box = false;
                })
                done()
                window.console.log(res)
                this.box = false
        }, error => {
          window.console.log(error);
          loading();
        });
                window.console.log(error)
                loading()
            })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -377,60 +377,60 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            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();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/sale/sale.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -17,23 +18,25 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.sale_delete"
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/sale/sale";
  import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/sale/sale"
import { mapGetters } from "vuex"
  export default {
    data() {
@@ -116,7 +119,7 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
      ...mapGetters(["permission"]),
@@ -126,42 +129,42 @@
          viewBtn: this.vaildData(this.permission.sale_view, false),
          delBtn: this.vaildData(this.permission.sale_delete, false),
          editBtn: this.vaildData(this.permission.sale_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          loading();
          window.console.log(error);
        });
                loading()
                window.console.log(error)
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          loading();
          console.log(error);
        });
                loading()
                console.log(error)
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -170,20 +173,20 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -191,60 +194,60 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            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();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/soldr/soldr.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -17,23 +18,25 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.soldr_delete"
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
  import {getList, getDetail, add, update, remove} from "@/api/soldr/soldr";
  import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/soldr/soldr"
import { mapGetters } from "vuex"
  export default {
    data() {
@@ -125,7 +128,7 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
      ...mapGetters(["permission"]),
@@ -135,42 +138,42 @@
          viewBtn: this.vaildData(this.permission.soldr_view, false),
          delBtn: this.vaildData(this.permission.soldr_delete, false),
          editBtn: this.vaildData(this.permission.soldr_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          loading();
          window.console.log(error);
        });
                loading()
                window.console.log(error)
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          loading();
          console.log(error);
        });
                loading()
                console.log(error)
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -179,20 +182,20 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -200,60 +203,60 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
            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();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/soldrecord/soldrecord.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container>
    <avue-crud :option="option"
        <avue-crud
            :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
@@ -17,23 +18,25 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
            @on-load="onLoad"
        >
      <template slot="menuLeft">
        <el-button type="danger"
                <el-button
                    type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.soldrecord_delete"
                   @click="handleDelete">删 除
        </el-button>
                    @click="handleDelete"
                >删 除</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
  import {getList, getDetail, add, update, remove,getListbg} from "@/api/soldrecord/soldrecord";
  import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove, getListbg } from "@/api/soldrecord/soldrecord"
import { mapGetters } from "vuex"
  export default {
    data() {
@@ -121,7 +124,7 @@
          ]
        },
        data: []
      };
        }
    },
    computed: {
      ...mapGetters(["permission"]),
@@ -131,42 +134,42 @@
          viewBtn: this.vaildData(this.permission.soldrecord_view, false),
          delBtn: this.vaildData(this.permission.soldrecord_delete, false),
          editBtn: this.vaildData(this.permission.soldrecord_edit, false)
        };
            }
      },
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          loading();
          window.console.log(error);
        });
                loading()
                window.console.log(error)
            })
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
                this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
                })
                done()
        }, error => {
          loading();
          console.log(error);
        });
                loading()
                console.log(error)
            })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -175,20 +178,20 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
@@ -196,62 +199,62 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
                    return remove(this.ids)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
                    })
                    this.$refs.crud.toggleSelection()
                })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
                    this.form = res.data.data
                })
        }
        done();
            done()
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true;
        var datas = this.$route.query;
        params.stockId1=datas.sid;
            this.loading = true
            var datas = this.$route.query
            params.stockId1 = datas.sid
        getListbg(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();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
src/views/statistics/farmplantarea.vue
@@ -15,15 +15,14 @@
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
    >
    </avue-crud>
        ></avue-crud>
  </basic-container>
</template>
<script>
import { getFarmPlantStatistics } from "@/api/farmplant/farmplant";
import { getStrainList } from "@/api/farmplant/strain";
import { mapGetters } from "vuex";
import { getFarmPlantStatistics } from "@/api/farmplant/farmplant"
import { getStrainList } from "@/api/farmplant/strain"
import { mapGetters } from "vuex"
export default {
  data() {
    return {
@@ -129,19 +128,19 @@
        ],
      },
      data: [],
    };
        }
  },
  created() {
    this.initData();
        this.initData()
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    ids() {
      let ids = [];
            let ids = []
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
    },
  },
  mounted() {
@@ -149,133 +148,133 @@
      startTime:this.getStartTime(),
      endTime:this.getEndTime()
    }
    this.onLoad(this.page,params);
        this.onLoad(this.page, params)
  },
  methods: {
    //合计计算
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
            const { columns, data } = param
            const sums = []
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
                    sums[index] = "合计"
                    return
        }
        if (index === 1) {
          const values = data.map((item) => Number(item[column.property]));
                    const values = data.map((item) => Number(item[column.property]))
          if (!values.every((value) => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => {
              const value = Number(curr);
                            const value = Number(curr)
              if (!isNaN(value)) {
                return prev + curr;
                                return prev + curr
              } else {
                return prev;
                                return prev
              }
            }, 0);
            sums[index] += " 亩";
                        }, 0)
                        sums[index] += " 亩"
          } else {
            sums[index] = "N/A";
                        sums[index] = "N/A"
          }
        }
      });
      return sums;
            })
            return sums
    },
    getStartTime() {
      var myDate = new Date();
      var year = myDate.getFullYear();
            var myDate = new Date()
            var year = myDate.getFullYear()
      //获取当前月份(0-11,0代表1月,所以要加1);
      var month = myDate.getMonth() + 1;
            var month = myDate.getMonth() + 1
      //获取当前日(1-31)
      var day = myDate.getDate();
            var day = myDate.getDate()
      if (month < 10) {
        month = "0" + month;
                month = "0" + month
      }
      if (day >= 0 && day <= 9) {
        day = "0" + day;
                day = "0" + day
      }
      var firstDay = year + "-" + month + "-01";
            var firstDay = year + "-" + month + "-01"
      // this.query['startTime'] = firstDay;
      return firstDay;
            return firstDay
    },
    getEndTime() {
      var myDate = new Date();
      var year = myDate.getFullYear();
            var myDate = new Date()
            var year = myDate.getFullYear()
      //获取当前月份(0-11,0代表1月,所以要加1);
      var month = myDate.getMonth() + 1;
            var month = myDate.getMonth() + 1
      //获取当前日(1-31)
      var day = myDate.getDate();
            var day = myDate.getDate()
      if (month < 10) {
        month = "0" + month;
                month = "0" + month
      }
      if (day >= 0 && day <= 9) {
        day = "0" + day;
                day = "0" + day
      }
      var thisDay = year + "-" + month + "-" + day;
            var thisDay = year + "-" + month + "-" + day
      // this.query['endTime'] = thisDay;
      return thisDay;
            return thisDay
    },
    initData() {
      var that = this;
            var that = this
      //获取农产品数据
      getStrainList(0).then((res) => {
        if (res.data.code == 200) {
          var strainId = that.findObject(that.option.column, "strainId");
          strainId.dicData = res.data.data;
                    var strainId = that.findObject(that.option.column, "strainId")
                    strainId.dicData = res.data.data
        }
      });
            })
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
            this.query = {}
            this.onLoad(this.page)
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
    },
    selectionChange(list) {
      this.selectionList = list;
            this.selectionList = list
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
            this.selectionList = []
            this.$refs.crud.toggleSelection()
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
            this.page.currentPage = currentPage
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
            this.page.pageSize = pageSize
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
            this.onLoad(this.page, this.query)
    },
    onLoad(page, params = {}) {
      this.loading = true;
      const { releaseTimeRange } = this.query;
      params['tenantId'] = this.userInfo.tenant_id;
      params['deptId'] = this.userInfo.dept_id;
            this.loading = true
            const { releaseTimeRange } = this.query
            params['tenantId'] = this.userInfo.tenant_id
            params['deptId'] = this.userInfo.dept_id
      let values = {
        ...params,
      };
            }
      if (releaseTimeRange) {
        values = {
          ...params,
          startTime: releaseTimeRange[0],
          endTime: releaseTimeRange[1],
          ...this.query,
        };
        values.releaseTimeRange = null;
                }
                values.releaseTimeRange = null
      }
      getFarmPlantStatistics(page.currentPage, page.pageSize, values).then(
        (res) => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
                    const data = res.data.data
                    this.page.total = data.total
                    this.data = data.records
                    this.loading = false
                    this.selectionClear()
        }
      );
            )
    },
  },
};