| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | form: { |
| | | publicFlag: 1 |
| | | }, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | |
| | | value: 2 |
| | | } |
| | | ] |
| | | }, { |
| | | width: 110, |
| | | labelWidth: 100, |
| | | label: "是否公开", |
| | | prop: "publicFlag", |
| | | span: 12, |
| | | searchSpan: 4, |
| | | type: "select", |
| | | // search: true, |
| | | // cascader: ["communityCode"], |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "不公开", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "公开", |
| | | value: 2 |
| | | } |
| | | ] |
| | | }, |
| | | // { |
| | | // width: 156, |
| | |
| | | tags: true, |
| | | type: "tree", |
| | | multiple: true, |
| | | editDisplay: false, |
| | | cascader: ['articleId'], |
| | | dicUrl: "/api/blade-district/district/getDistrictTree?filterFlag=1", |
| | | rules: [{ |
| | |
| | | prop: "articleId", |
| | | search: false, |
| | | viewDisabled: false, |
| | | editDisplay: false, |
| | | type: 'select', |
| | | dicUrl: `/api/blade-article/article/getArticleByDistrictId?type=4&eventType=1&districtId={{rotationRange}}`, |
| | | formslot: true, |
| | |
| | | data: [], |
| | | } |
| | | }, |
| | | watch: {}, |
| | | watch: { |
| | | 'form.publicFlag': { |
| | | handler(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 |
| | | } |
| | | |
| | | }, |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | | permissionList() { |
| | |
| | | }, |
| | | 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(",") |
| | |
| | | ) |
| | | }, |
| | | 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(",") |
| | |
| | | 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(",") |
| | |
| | | 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(",") |