智慧农业后台管理页面
xiebin
2022-08-11 7ae4b4b6679ba419cfd92d2a60ed603c2c8a446d
Merge remote-tracking branch 'origin/master'
4 files modified
38 ■■■■■ changed files
src/views/land/cs.vue 14 ●●●●● patch | view | raw | blame | history
src/views/land/getMapDataInThere.vue 2 ●●● patch | view | raw | blame | history
src/views/land/landAdd.vue 21 ●●●●● patch | view | raw | blame | history
src/views/land/landUpdate.vue 1 ●●●● patch | view | raw | blame | history
src/views/land/cs.vue
@@ -105,6 +105,7 @@
                keyword: "",
            },
            query: {},
            farm:{},
            value: true,
            farmingCount: 0,
            landVisible: false,
@@ -128,9 +129,19 @@
        }
    },
    computed: {
        ...mapGetters(["userInfo"]),
        ...mapGetters(["userInfo","$farmId"]),
    },
    watch: {
    '$farmId':{
      handler (newName, oldName) {
        this.farm.id = newName
        //地块页面
        this.onLoad()
      }
    }
  },
    created () {
        this.farm.id = this.$farmId
        this.onLoad(this.page)
    },
    methods: {
@@ -184,6 +195,7 @@
            if(typeof(page) == "undefined" ){
                page = this.page
            }
            Object.assign(params,{farmId:this.farm.id})
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = res.data.data
                this.page.total = data.total
src/views/land/getMapDataInThere.vue
@@ -48,7 +48,7 @@
        currentPolygons: {
            immediate: true,
            handler (newData, oldData) {
                console.log(newData, 5656)
                // console.log(newData, 5656)
                if (newData.length > 0) {
                    this.draw(newData)
src/views/land/landAdd.vue
@@ -51,11 +51,13 @@
                        label: "所属农场",
                        prop: "farmId",
                        type: "tree",
                        value:"",
                        dicData: [],
                        props: {
                            label: "farmName",
                            value: "id"
                        },
                        disabled:true,
                        slot: true,
                        rules: [{
                            required: true,
@@ -106,41 +108,36 @@
        }
    },
    computed: {
        ...mapGetters(["userInfo", "permission", "polygons"]),
        ...mapGetters(["userInfo", "permission", "polygons","$farmId"]),
    },
    mounted () {
        this.initData(this.userInfo.tenant_id)
    },
    methods: {
        initData (tenantId) {
            // getDeptTree(tenantId).then(res => {        console.log(res)
            //   const column = this.findObject(this.option.column, "deptId");
            //   column.dicData = res.data.data;
            // });
            const data = {
                deptId: this.userInfo.dept_id
            }
            getFarmList(data).then(res => {
            getFarmList().then(res => {
                const column = this.findObject(this.option.column, "farmId")
                column.dicData = res.data.data
            })
        },
        //初始化
        init () {
            console.log(22222222222222)
            //清空面的数据
            this.$store.commit('clear_polygon')
            //计算当前时间
            this.visible = true
            this.form.farmId = this.$farmId
        },
        // 表单提交
        submit (row, loading) {
            row['deptId'] = this.userInfo.dept_id
            // row.farmId = this.farm.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
src/views/land/landUpdate.vue
@@ -53,6 +53,7 @@
                        label: "所属农场",
                        prop: "farmId",
                        type: "tree",
                        disabled:true,
                        dicData: [],
                        props: {
                            label: "farmName",