| | |
| | | import request from '@/router/axios'; |
| | | import request from "@/router/axios"; |
| | | |
| | | export const getList = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/page', |
| | | method: 'get', |
| | | url: "/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/page", |
| | | method: "get", |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/remove', |
| | | method: 'post', |
| | | url: "/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/remove", |
| | | method: "post", |
| | | params: { |
| | | ids, |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const add = (row) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/saveOrUpdate', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | url: "/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/saveOrUpdate", |
| | | method: "post", |
| | | data: row, |
| | | }); |
| | | }; |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/saveOrUpdate', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | url: "/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/saveOrUpdate", |
| | | method: "post", |
| | | data: row, |
| | | }); |
| | | }; |
| | | |
| | | export const getPropertyCompanyDistrict = (id) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/detail', |
| | | method: 'get', |
| | | url: "/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/detail", |
| | | method: "get", |
| | | params: { |
| | | id |
| | | } |
| | | }) |
| | | } |
| | | id, |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const getPropertyCompanyList = () => { |
| | | return request({ |
| | | url: "/api/blade-propertyCompany/propertyCompany/getPropertyCompanyList", |
| | | method: "get", |
| | | }); |
| | | }; |
| | |
| | | type: "switch", |
| | | activeColor: "#13ce66", |
| | | inactiveColor: "#ccc", |
| | | value: '1', |
| | | dicData: [{ |
| | | label: "关闭", |
| | | value: "0", |
| | |
| | | </el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row, size }" slot="iscomment"> |
| | | <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text"> |
| | | </el-tag> |
| | | <template slot-scope="{ row }" slot="iscomment"> |
| | | <el-switch @change="iscommentInput($event, row)" v-model="row.iscomment" :active-value="'1'" |
| | | :inactive-value="'0'" active-color="#13ce66" inactive-color="#ccc"> |
| | | </el-switch> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | |
| | | label: "评论区", |
| | | prop: "iscomment", |
| | | slot: true, |
| | | type: "select", |
| | | type: "switch", |
| | | activeColor: "#13ce66", |
| | | inactiveColor: "#ccc", |
| | | value: '1', |
| | | dicData: [{ |
| | | label: "关闭", |
| | | value: "0", |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | iscommentInput (e, data) { |
| | | upcomment(data.id, e).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | openDilog (row, type) { |
| | | this.dialogVisibles = true |
| | |
| | | </el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row, size }" slot="iscomment"> |
| | | <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text"> |
| | | </el-tag> |
| | | <template slot-scope="{ row }" slot="iscomment"> |
| | | <el-switch @change="iscommentInput($event, row)" v-model="row.iscomment" :active-value="'1'" |
| | | :inactive-value="'0'" active-color="#13ce66" inactive-color="#ccc"> |
| | | </el-switch> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | |
| | | label: "评论区", |
| | | prop: "iscomment", |
| | | slot: true, |
| | | type: "select", |
| | | type: "switch", |
| | | activeColor: "#13ce66", |
| | | inactiveColor: "#ccc", |
| | | value: '1', |
| | | dicData: [{ |
| | | label: "关闭", |
| | | value: "0", |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | iscommentInput (e, data) { |
| | | upcomment(data.id, e).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | openDilog (row, type) { |
| | | this.dialogVisibles = true |
| | |
| | | </el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row, size }" slot="iscomment"> |
| | | <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text"> |
| | | </el-tag> |
| | | <template slot-scope="{ row }" slot="iscomment"> |
| | | <el-switch @change="iscommentInput($event, row)" v-model="row.iscomment" :active-value="'1'" |
| | | :inactive-value="'0'" active-color="#13ce66" inactive-color="#ccc"> |
| | | </el-switch> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | |
| | | label: "评论区", |
| | | prop: "iscomment", |
| | | slot: true, |
| | | type: "select", |
| | | type: "switch", |
| | | activeColor: "#13ce66", |
| | | inactiveColor: "#ccc", |
| | | value: '1', |
| | | dicData: [{ |
| | | label: "关闭", |
| | | value: "0", |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | iscommentInput (e, data) { |
| | | upcomment(data.id, e).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | openDilog (row, type) { |
| | | this.dialogVisibles = true |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel" |
| | | v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen" |
| | | @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" |
| | | :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompanyDistrict_delete" |
| | | @click="handleDelete">删 除 |
| | |
| | | remove, |
| | | update, |
| | | add, |
| | | getPropertyCompanyDistrict |
| | | getPropertyCompanyDistrict, |
| | | getPropertyCompanyList |
| | | } from "@/api/property/propertyCompanyDistrict" |
| | | import { |
| | | mapGetters |
| | |
| | | }, |
| | | |
| | | { |
| | | disabled: true, |
| | | hide: true, |
| | | label: '物业公司', |
| | | prop: 'propertyCompanyId', |
| | | type: 'tree', |
| | | span: 12, |
| | | dicUrl: `/api/blade-propertyCompany/propertyCompany/getPropertyCompanyList`, |
| | | dicData: [], |
| | | cascader: ['userId', 'principal'], |
| | | nodeClick: (data, node, nodeComp) => { |
| | | // this.$message.success(JSON.stringify(data)) |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | initData () { |
| | | getPropertyCompanyList().then(res => { |
| | | const column = this.findObject(this.option.column, "propertyCompanyId") |
| | | column.dicData = res.data.data |
| | | |
| | | this.form.propertyCompanyId = res.data.data[0].id |
| | | }) |
| | | }, |
| | | |
| | | rowSave(row, done, loading) { |
| | | row.userId = func.join(row.userId) |
| | | add(row).then( |
| | |
| | | } |
| | | ) |
| | | }, |
| | | |
| | | rowUpdate(row, index, done, loading) { |
| | | row.userId = func.join(row.userId) |
| | | update(row).then( |
| | |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["add", "edit"].includes(type)) { |
| | | this.initData() |
| | | } |
| | | |
| | | if (["edit", "view"].includes(type)) { |
| | | getPropertyCompanyDistrict(this.form.id).then((res) => { |
| | | this.form = res.data.data |