Lou
2024-04-03 d6bcbf09ab54fb46f5e690de0c08ea2b638d7f91
src/views/article/rotation.vue
@@ -102,7 +102,8 @@
              prop: "publicFlag",
              span: 12,
              searchSpan: 4,
              search: true,
              type: "select",
              // search: true,
              // cascader: ["communityCode"],
              type: "select",
              dicData: [{
@@ -167,6 +168,7 @@
              prop: "articleId",
              search: false,
              viewDisabled: false,
              editDisplay: false,
              type: 'select',
              dicUrl: `/api/blade-article/article/getArticleByDistrictId?type=4&eventType=1&districtId={{rotationRange}}`,
              formslot: true,
@@ -232,13 +234,20 @@
    watch: {
      'form.publicFlag': {
        handler(newData) {
          // console.log('** ** ** ** ** ** **', newData)
          const column = this.findObject(this.option.column, "rotationRange")
          if (newData == 1) {
            column.editDisplay = true
          } else {
            column.editDisplay = false
          }
          const column2 = this.findObject(this.option.column, "articleId")
          if (newData == 1) {
            column2.editDisplay = true
          } else {
            column2.editDisplay = false
          }
        },
      },
    },
@@ -262,6 +271,13 @@
    },
    methods: {
      rowSave(row, done, loading) {
        if (row.rotationRange) {
          row.rotationRange = JSON.stringify(row.rotationRange)
        }
        if (row.publicFlag == 2) {
          row.rotationRange = []
          row.rotationRange = JSON.stringify(row.rotationRange)
        }
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
@@ -287,6 +303,13 @@
        )
      },
      rowUpdate(row, index, done, loading) {
        if (row.rotationRange) {
          row.rotationRange = JSON.stringify(row.rotationRange)
        }
        if (row.publicFlag == 2) {
          row.rotationRange = []
          row.rotationRange = JSON.stringify(row.rotationRange)
        }
        if (row.url.length > 0) {
          var urls = []
          var split = row.url.split(",")
@@ -371,6 +394,9 @@
        if (["edit", "view"].includes(type)) {
          getRotation(this.form.id).then((res) => {
            this.form = res.data.data
            if (this.form.rotationRange) {
              this.form.rotationRange = JSON.parse(this.form.rotationRange)
            }
            if (this.form.url.length > 0) {
              var urls = []
              var names = this.form.url.split(",")
@@ -424,6 +450,9 @@
          this.page.total = data.total
          this.data = data.records
          this.data.forEach(item => {
            if (item.rotationRange) {
              item.rotationRange = JSON.parse(item.rotationRange)
            }
            if (item.url.length > 0) {
              var urls = []
              var names = item.url.split(",")