From 5c17ea827a55299613e603ac5a2d13b533bd038b Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Mon, 29 Jan 2024 18:12:41 +0800
Subject: [PATCH] 新增九小类型,是否阵地及分类

---
 src/views/place/index.vue                  |  114 ++++++++++++++++++++++
 src/views/place/components/baseAllInfo.vue |  142 +++++++++++++++++++++++++---
 2 files changed, 237 insertions(+), 19 deletions(-)

diff --git a/src/views/place/components/baseAllInfo.vue b/src/views/place/components/baseAllInfo.vue
index 3017158..c4691da 100644
--- a/src/views/place/components/baseAllInfo.vue
+++ b/src/views/place/components/baseAllInfo.vue
@@ -43,7 +43,7 @@
 import boxTitle from "./boxTitle"
 
 export default {
-    data () {
+    data() {
         //手机号格式校验
         let validatorPhone = function (rule, value, callback) {
             if (value) {
@@ -242,7 +242,6 @@
                         label: "九小场所",
                         prop: "isNine",
                         type: "select",
-                        row:true,
                         dicData: [
                             {
                                 label: "是",
@@ -255,7 +254,53 @@
                         ],
                         hide: true,
                     },
-
+                    {
+                        span: 12,
+                        label: "九小分类",
+                        prop: "nineType",
+                        type: "select",
+                        display:false,
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=nineType",
+                        dataType: "number",
+                        hide: true,
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey",
+                        },
+                    },
+                    {
+                        span: 12,
+                        label: "是否阵地",
+                        prop: "isFront",
+                        type: "select",
+                        display:false,
+                        dicData: [
+                            {
+                                label: "是",
+                                value: 1,
+                            },
+                            {
+                                label: "否",
+                                value: 2,
+                            }
+                        ],
+                        hide: true,
+                    },
+                    {
+                        span: 12,
+                        label: "阵地分类",
+                        prop: "frontType",
+                        type: "select",
+                        display:false,
+                        row: true,
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=frontType",
+                        dataType: "number",
+                        hide: true,
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey",
+                        },
+                    },
                     {
                         label: "场所照片",
                         prop: "imageUrls",
@@ -396,10 +441,73 @@
 
     inject: ["placeElement"],
 
-    watch: {},
+    watch: {
+        'form.isNine': {
+            handler(newData) {
+                if (newData) {
+                    let nineTypeColumn = this.findObject(
+                        this.option.column,
+                        'nineType'
+                    )
+                    let isFrontColumn = this.findObject(
+                        this.option.column,
+                        'isFront'
+                    )
+                    let frontTypeColumn = this.findObject(
+                        this.option.column,
+                        'frontType'
+                    )
 
+                    if (newData == 1) {
+                        nineTypeColumn.display = true
+                    } else {
+                        nineTypeColumn.display = false
+                        isFrontColumn.display = false
+                        frontTypeColumn.display = false
+                    }
+                }
+            },
+        },
+        'form.nineType': {
+            handler(newData) {
+                if (newData) {
+                    let isFrontColumn = this.findObject(
+                        this.option.column,
+                        'isFront'
+                    )
+                    let frontTypeColumn = this.findObject(
+                        this.option.column,
+                        'frontType'
+                    )
+
+                    if (newData == 1) {
+                        isFrontColumn.display = true
+                    } else {
+                        isFrontColumn.display = false
+                        frontTypeColumn.display = false
+                    }
+                }
+            },
+        },
+        'form.isFront': {
+            handler(newData) {
+                if (newData) {
+                    let frontTypeColumn = this.findObject(
+                        this.option.column,
+                        'frontType'
+                    )
+
+                    if (newData == 1) {
+                        frontTypeColumn.display = true
+                    } else {
+                        frontTypeColumn.display = false
+                    }
+                }
+            },
+        },
+    },
     methods: {
-        initOpen (newData) {
+        initOpen(newData) {
             this.curRow = newData
             this.roleBox = true
             this.baseShow = false
@@ -482,7 +590,7 @@
                 )
         },
 
-        locationDispose (data) {
+        locationDispose(data) {
             data = data.split(",")
 
             return {
@@ -492,13 +600,13 @@
             }
         },
 
-        selectionClear () {
+        selectionClear() {
             this.$nextTick(() => {
                 this.$refs.crud && this.$refs.crud.toggleSelection()
             })
         },
 
-        houseHoldRowUpdate (row, index, done, loading) {
+        houseHoldRowUpdate(row, index, done, loading) {
             holdUpdate(row).then(
                 () => {
                     this.holdOnLoad(this.holdPage)
@@ -515,7 +623,7 @@
             )
         },
 
-        houseHoldRowDel (row) {
+        houseHoldRowDel(row) {
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
@@ -534,7 +642,7 @@
                 })
         },
 
-        houseHoldRowSave (row, done, loading) {
+        houseHoldRowSave(row, done, loading) {
             holdAdd({
                 ...row,
                 placeId: this.curRow.id,
@@ -555,11 +663,11 @@
             )
         },
 
-        refreshHoldChange () {
+        refreshHoldChange() {
             this.holdOnLoad(this.holdPage)
         },
 
-        holdOnLoad (holdPage, params = {}) {
+        holdOnLoad(holdPage, params = {}) {
             if (!this.curRow.id) return
 
             let values = {
@@ -580,15 +688,15 @@
             )
         },
 
-        holdCurrentChange (currentPage) {
+        holdCurrentChange(currentPage) {
             this.holdPage.currentPage = currentPage
         },
 
-        holdSizeChange (pageSize) {
+        holdSizeChange(pageSize) {
             this.holdPage.pageSize = pageSize
         },
 
-        desposeImage (data) {
+        desposeImage(data) {
             if (data.length > 0) {
                 var urls = []
                 var split = data.split(",").filter((item) => item != "")
@@ -602,7 +710,7 @@
             return data
         },
 
-        dataUpdate () {
+        dataUpdate() {
             const that = this
 
             let imageUrls = this.desposeImage(this.form.imageUrls)
@@ -658,7 +766,7 @@
             })
         },
 
-        roleBoxClose () {
+        roleBoxClose() {
             this.form = {}
             this.placeForm = {}
 
diff --git a/src/views/place/index.vue b/src/views/place/index.vue
index 0406a8f..61493e8 100644
--- a/src/views/place/index.vue
+++ b/src/views/place/index.vue
@@ -339,7 +339,6 @@
                         label: "九小场所",
                         prop: "isNine",
                         type: "select",
-                        row: true,
                         dicData: [
                             {
                                 label: "是",
@@ -351,6 +350,53 @@
                             }
                         ],
                         hide: true,
+                    },
+                    {
+                        span: 12,
+                        label: "九小分类",
+                        prop: "nineType",
+                        type: "select",
+                        display:false,
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=nineType",
+                        dataType: "number",
+                        hide: true,
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey",
+                        },
+                    },
+                    {
+                        span: 12,
+                        label: "是否阵地",
+                        prop: "isFront",
+                        type: "select",
+                        display:false,
+                        dicData: [
+                            {
+                                label: "是",
+                                value: 1,
+                            },
+                            {
+                                label: "否",
+                                value: 2,
+                            }
+                        ],
+                        hide: true,
+                    },
+                    {
+                        span: 12,
+                        label: "阵地分类",
+                        prop: "frontType",
+                        type: "select",
+                        display:false,
+                        row: true,
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=frontType",
+                        dataType: "number",
+                        hide: true,
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey",
+                        },
                     },
 
                     {
@@ -449,7 +495,71 @@
 
     components: { auditBase, baseAllInfo },
 
-    watch: {},
+    watch: {
+        'form.isNine': {
+            handler(newData) {
+                if (newData) {
+                    let nineTypeColumn = this.findObject(
+                        this.option.column,
+                        'nineType'
+                    )
+                    let isFrontColumn = this.findObject(
+                        this.option.column,
+                        'isFront'
+                    )
+                    let frontTypeColumn = this.findObject(
+                        this.option.column,
+                        'frontType'
+                    )
+
+                    if (newData == 1) {
+                        nineTypeColumn.display = true
+                    } else {
+                        nineTypeColumn.display = false
+                        isFrontColumn.display = false
+                        frontTypeColumn.display = false
+                    }
+                }
+            },
+        },
+        'form.nineType': {
+            handler(newData) {
+                if (newData) {
+                    let isFrontColumn = this.findObject(
+                        this.option.column,
+                        'isFront'
+                    )
+                    let frontTypeColumn = this.findObject(
+                        this.option.column,
+                        'frontType'
+                    )
+
+                    if (newData == 1) {
+                        isFrontColumn.display = true
+                    } else {
+                        isFrontColumn.display = false
+                        frontTypeColumn.display = false
+                    }
+                }
+            },
+        },
+        'form.isFront': {
+            handler(newData) {
+                if (newData) {
+                    let frontTypeColumn = this.findObject(
+                        this.option.column,
+                        'frontType'
+                    )
+
+                    if (newData == 1) {
+                        frontTypeColumn.display = true
+                    } else {
+                        frontTypeColumn.display = false
+                    }
+                }
+            },
+        },
+    },
 
     computed: {
         ...mapGetters(["permission", "userInfo"]),

--
Gitblit v1.9.3