From 4522ab3fe8bd45ee753ef187448c1e884bbc601f Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 18 Apr 2024 11:09:27 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_web
---
src/views/article/rotation.vue | 129 ++++++++++++++++++++++++++++++++++++++-----
1 files changed, 114 insertions(+), 15 deletions(-)
diff --git a/src/views/article/rotation.vue b/src/views/article/rotation.vue
index 9b8ae35..9f2219a 100644
--- a/src/views/article/rotation.vue
+++ b/src/views/article/rotation.vue
@@ -1,4 +1,4 @@
-<!-- 走访日志 -->
+<!-- 轮播图 -->
<template>
<basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
@@ -33,7 +33,9 @@
export default {
data() {
return {
- form: {},
+ form: {
+ publicFlag: 2
+ },
query: {},
loading: true,
page: {
@@ -92,6 +94,29 @@
label: "综治",
value: 2
}
+ ],
+ rules: [{
+ required: true,
+ message: "请选择类型",
+ trigger: "blur",
+ }, ],
+ }, {
+ width: 110,
+ labelWidth: 100,
+ label: "是否公开",
+ prop: "publicFlag",
+ span: 12,
+ searchSpan: 4,
+ type: "select",
+ type: "select",
+ dicData: [{
+ label: "公开",
+ value: 2
+ }, {
+ label: "限定公开",
+ value: 1
+ },
+
]
},
{
@@ -104,7 +129,9 @@
multiple: true,
tags: true,
hide: true,
- dateType: "string",
+ dataType: "string",
+ addDisplay: false,
+ editDisplay: false,
type: "tree",
dicUrl: "/api/blade-system/region/tree?deptNature={{type}}",
props: {
@@ -118,24 +145,28 @@
}, ],
},
{
- label: "范围",
- prop: "districtIds",
+ label: "公开范围",
+ prop: "rotationRange",
width: 156,
labelWidth: 100,
tags: true,
type: "tree",
multiple: true,
- dicData: [],
- // rules: [{
- // required: true,
- // message: "请选择范围",
- // trigger: "blur",
- // }, ],
+ // dateType: "string",
+ dataType: "string",
+ editDisplay: false,
+ addDisplay: false,
+ cascader: ['articleId'],
+ dicUrl: "/api/blade-district/district/getDistrictTree?filterFlag=1",
+ rules: [{
+ required: true,
+ message: "请选择范围",
+ trigger: "blur",
+ }, ],
props: {
label: "name",
value: 'id'
},
- // hide: true,
},
{
hide: true,
@@ -144,10 +175,12 @@
prop: "articleId",
search: false,
viewDisabled: false,
+ editDisplay: false,
+ addDisplay: false,
type: 'select',
- dicUrl: `/api/blade-article/article/getArticleByDistrictId?type=4&eventType=1&districtId={{districtId}}`,
+ dicUrl: `/api/blade-article/article/getArticleByDistrictId?type=4&eventType=1&districtId={{rotationRange}}`,
formslot: true,
- cascader: ['vote'],
+ // cascader: ['vote'],
props: {
label: "title",
value: "id"
@@ -206,7 +239,41 @@
data: [],
}
},
- watch: {},
+ watch: {
+ 'form.publicFlag': {
+ handler(newData) {
+ const column = this.findObject(this.option.column, "rotationRange")
+ if (newData == 1) {
+ column.editDisplay = true
+ column.addDisplay = true
+ } else {
+ column.editDisplay = false
+ column.addDisplay = false
+ }
+
+ const column2 = this.findObject(this.option.column, "articleId")
+ if (newData == 1) {
+ column2.editDisplay = true
+ column2.addDisplay = true
+ } else {
+ column2.editDisplay = false
+ column2.addDisplay = false
+ }
+ },
+ },
+ 'form.type': {
+ handler(newData) {
+ const column = this.findObject(this.option.column, "communityCode")
+ if (newData != 3) {
+ column.editDisplay = true
+ column.addDisplay = true
+ } else {
+ column.editDisplay = false
+ column.addDisplay = false
+ }
+ },
+ },
+ },
computed: {
...mapGetters(["permission", "userInfo"]),
permissionList() {
@@ -227,6 +294,16 @@
},
methods: {
rowSave(row, done, loading) {
+ // if (row.rotationRange) {
+ // row.rotationRange = JSON.stringify(row.rotationRange)
+ // }
+ if (row.communityCode) {
+ row.communityCode = JSON.stringify(row.communityCode)
+ }
+ if (row.publicFlag == 2) {
+ row.rotationRange = ''
+ // row.rotationRange = JSON.stringify(row.rotationRange)
+ }
if (row.url.length > 0) {
var urls = []
var split = row.url.split(",")
@@ -252,6 +329,16 @@
)
},
rowUpdate(row, index, done, loading) {
+ // if (row.rotationRange) {
+ // row.rotationRange = JSON.stringify(row.rotationRange)
+ // }
+ if (row.communityCode) {
+ row.communityCode = JSON.stringify(row.communityCode)
+ }
+ if (row.publicFlag == 2) {
+ row.rotationRange = ''
+ // row.rotationRange = JSON.stringify(row.rotationRange)
+ }
if (row.url.length > 0) {
var urls = []
var split = row.url.split(",")
@@ -336,6 +423,12 @@
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.communityCode) {
+ // this.form.communityCode = JSON.parse(this.form.communityCode)
+ // }
if (this.form.url.length > 0) {
var urls = []
var names = this.form.url.split(",")
@@ -389,6 +482,12 @@
this.page.total = data.total
this.data = data.records
this.data.forEach(item => {
+ // if (item.rotationRange) {
+ // item.rotationRange = JSON.parse(item.rotationRange)
+ // }
+ // if (item.communityCode) {
+ // item.communityCode = JSON.parse(item.communityCode)
+ // }
if (item.url.length > 0) {
var urls = []
var names = item.url.split(",")
--
Gitblit v1.9.3