| | |
| | | export default { |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 450, |
| | | border: false, |
| | | viewBtn: true, |
| | | selection: true, |
| | | excelBtn: true, |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: 'ID', |
| | | prop: 'id', |
| | | searchSpan: 4, |
| | | // search: true, |
| | | display: false, |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 450, |
| | | border: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | excelBtn: true, |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: 'ID', |
| | | prop: 'id', |
| | | searchSpan: 4, |
| | | // search: true, |
| | | display: false, |
| | | }, |
| | | { |
| | | label: '名称', |
| | | prop: 'name', |
| | | searchSpan: 4, |
| | | search: true, |
| | | label: '名称', |
| | | prop: 'name', |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, |
| | | { |
| | | label: '电话', |
| | | prop: 'telephone', |
| | | searchSpan: 4, |
| | | search: true, |
| | | label: '电话', |
| | | prop: 'telephone', |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, |
| | | { |
| | | label: '描述', |
| | | prop: 'remark', |
| | | searchSpan: 4, |
| | | // search: true, |
| | | label: '描述', |
| | | prop: 'remark', |
| | | searchSpan: 4, |
| | | // search: true, |
| | | }, |
| | | ] |
| | | ] |
| | | } |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: 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" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | <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"> |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删 |
| | | 除 |
| | | </el-button> |
| | | |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.article_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | |
| | | </template> |
| | | <template slot-scope="{ row }" slot="iswords"> |
| | | <el-tag>{{ |
| | | row.iswords == "1" ? "是" : row.iswords == "0" ? "否" : "是" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="iswords"> |
| | | <el-tag |
| | | >{{ |
| | | row.iswords == "1" ? "是" : row.iswords == "0" ? "否" : "是" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="iscomment"> |
| | | <el-tag>{{ |
| | | row.iscomment == "1" ? "开启" : row.iscomment == "0" ? "关闭" : "关闭" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="iscomment"> |
| | | <el-tag |
| | | >{{ |
| | | row.iscomment == "1" ? "开启" : row.iscomment == "0" ? "关闭" : "关闭" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | </basic-container> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getListWords, remove, update, add, getNotice, upcomment} from "@/api/article/article"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getListWords, remove, update, add, getNotice, upcomment } from "@/api/article/article" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 350, |
| | | border: false, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | excelBtn: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "资讯标题", |
| | | prop: "title", |
| | | span: 24, |
| | | row: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入资讯标题", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | export default { |
| | | data () { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | { |
| | | label: "资讯封面", |
| | | prop: "url", |
| | | // align:'center', |
| | | width: 80, |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | // hide: true, |
| | | span: 24, |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 350, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | excelBtn: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "资讯标题", |
| | | prop: "title", |
| | | span: 24, |
| | | row: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入资讯标题", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "资讯封面", |
| | | prop: "url", |
| | | // align:'center', |
| | | width: 80, |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | // hide: true, |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "资讯来源", |
| | | prop: "sourceName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入资讯类型", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "资讯类型", |
| | | prop: "articleType", |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | searchSpan: 3, |
| | | checkStrictly: true, |
| | | dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1411214799056932865", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | search: true, |
| | | type: "tree", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择资讯类型", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "发布时间", |
| | | prop: "dateTime", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | searchSpan: 5, |
| | | searchRange: true, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择发布时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "发布时间", |
| | | prop: "createTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | }, |
| | | { |
| | | label: "敏感词预警", |
| | | prop: "iswords", |
| | | searchSpan: 3, |
| | | width: 80, |
| | | value: "0", |
| | | slot: true, |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "否", |
| | | value: "0", |
| | | }, |
| | | { |
| | | label: "是", |
| | | value: "1", |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "敏感词提取", |
| | | prop: "wordsContent", |
| | | }, |
| | | { |
| | | label: "预警次数", |
| | | prop: "iscomment", |
| | | width: 80, |
| | | }, |
| | | { |
| | | label: "视频", |
| | | prop: "videoUrl", |
| | | type: "upload", |
| | | accept: "video/mp4", |
| | | display: false, |
| | | hide: true, |
| | | span: 24, |
| | | listType: "picture-img", |
| | | action: "/api/depl/put-depl", |
| | | propsHttp: { |
| | | url: "data", |
| | | }, |
| | | }, |
| | | { |
| | | label: "资讯内容", |
| | | prop: "content", |
| | | component: "AvueUeditor", |
| | | options: { |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | // customConfig: { |
| | | // lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3'] |
| | | // },//wangEditor编辑的配置 |
| | | props: { |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | }, |
| | | hide: true, |
| | | minRows: 6, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "资讯来源", |
| | | prop: "sourceName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入资讯类型", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "资讯类型", |
| | | prop: "articleType", |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | searchSpan: 3, |
| | | checkStrictly: true, |
| | | dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1411214799056932865", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | search: true, |
| | | type: "tree", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择资讯类型", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "发布时间", |
| | | prop: "dateTime", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | searchSpan: 5, |
| | | searchRange: true, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择发布时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "发布时间", |
| | | prop: "createTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | }, |
| | | { |
| | | label: "敏感词预警", |
| | | prop: "iswords", |
| | | searchSpan: 3, |
| | | width: 80, |
| | | value: "0", |
| | | slot: true, |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "否", |
| | | value: "0", |
| | | }, |
| | | { |
| | | label: "是", |
| | | value: "1", |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "敏感词提取", |
| | | prop: "wordsContent", |
| | | }, |
| | | { |
| | | label: "预警次数", |
| | | prop: "iscomment", |
| | | width: 80, |
| | | }, |
| | | { |
| | | label: "视频", |
| | | prop: "videoUrl", |
| | | type: "upload", |
| | | accept: "video/mp4", |
| | | display: false, |
| | | hide: true, |
| | | span: 24, |
| | | listType: "picture-img", |
| | | action: "/api/depl/put-depl", |
| | | propsHttp: { |
| | | url: "data", |
| | | }, |
| | | }, |
| | | { |
| | | label: "资讯内容", |
| | | prop: "content", |
| | | component: "AvueUeditor", |
| | | options: { |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | // customConfig: { |
| | | // lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3'] |
| | | // },//wangEditor编辑的配置 |
| | | props: { |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | }, |
| | | hide: true, |
| | | minRows: 6, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | data: [], |
| | | } |
| | | }, |
| | | watch: { |
| | | "form.articleType": { |
| | | handler(val) { |
| | | if (val) { |
| | | var videoUrl = this.findObject(this.option.column, "videoUrl"); |
| | | var content = this.findObject(this.option.column, "content"); |
| | | if (val.indexOf('ksp') != -1) { |
| | | videoUrl.display = true; |
| | | content.display = false; |
| | | videoUrl.rules = [ |
| | | { |
| | | required: false, |
| | | message: "请选择视频", |
| | | trigger: "blur", |
| | | }, |
| | | ]; |
| | | } else { |
| | | videoUrl.display = false; |
| | | content.display = true; |
| | | videoUrl.rules = ""; |
| | | } |
| | | } |
| | | }, |
| | | immediate: true, |
| | | } |
| | | "form.articleType": { |
| | | handler (val) { |
| | | if (val) { |
| | | var videoUrl = this.findObject(this.option.column, "videoUrl") |
| | | var content = this.findObject(this.option.column, "content") |
| | | if (val.indexOf('ksp') != -1) { |
| | | videoUrl.display = true |
| | | content.display = false |
| | | videoUrl.rules = [ |
| | | { |
| | | required: false, |
| | | message: "请选择视频", |
| | | trigger: "blur", |
| | | }, |
| | | ] |
| | | } else { |
| | | videoUrl.display = false |
| | | content.display = true |
| | | videoUrl.rules = "" |
| | | } |
| | | } |
| | | }, |
| | | immediate: true, |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.article_add, true), |
| | | viewBtn: this.vaildData(this.permission.article_view, true), |
| | | delBtn: this.vaildData(this.permission.article_delete, true), |
| | | editBtn: this.vaildData(this.permission.article_edit, true), |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ...mapGetters(["permission"]), |
| | | permissionList () { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.article_add, true), |
| | | viewBtn: this.vaildData(this.permission.article_view, true), |
| | | delBtn: this.vaildData(this.permission.article_delete, true), |
| | | editBtn: this.vaildData(this.permission.article_edit, true), |
| | | } |
| | | }, |
| | | ids () { |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | if (row.videoUrl.length == 0) { |
| | | row.videoUrl = ""; |
| | | rowSave (row, done, loading) { |
| | | if (row.videoUrl.length == 0) { |
| | | row.videoUrl = "" |
| | | } |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ) |
| | | }, |
| | | rowUpdate (row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ) |
| | | }, |
| | | rowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset () { |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange (params, done) { |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange (list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear () { |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen (done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getNotice(this.form.id).then((res) => { |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | // con |
| | | done() |
| | | }, |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange () { |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad (page, params = {}) { |
| | | const { dateTime } = this.query |
| | | let values = { |
| | | ...params, |
| | | } |
| | | if (dateTime) { |
| | | values = { |
| | | ...params, |
| | | startTime: dateTime[0], |
| | | endTime: dateTime[1], |
| | | ...this.query, |
| | | } |
| | | values.dateTime = null |
| | | } |
| | | this.loading = true |
| | | getListWords(page.currentPage, page.pageSize, values).then((res) => { |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | updateFb (row) { |
| | | if (row.publish == "0") { |
| | | row.publish = "1" |
| | | } else { |
| | | row.publish = "0" |
| | | } |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ) |
| | | }, |
| | | kqcomment () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据开启评论?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | return upcomment(this.ids, "1") |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | gbcomment () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据开启评论?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | return upcomment(this.ids, "0") |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | } |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getNotice(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | // con |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const {dateTime} = this.query; |
| | | let values = { |
| | | ...params, |
| | | }; |
| | | if (dateTime) { |
| | | values = { |
| | | ...params, |
| | | startTime: dateTime[0], |
| | | endTime: dateTime[1], |
| | | ...this.query, |
| | | }; |
| | | values.dateTime = null; |
| | | } |
| | | this.loading = true; |
| | | getListWords(page.currentPage, page.pageSize, values).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | updateFb(row) { |
| | | if (row.publish == "0") { |
| | | row.publish = "1"; |
| | | } else { |
| | | row.publish = "0"; |
| | | } |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | kqcomment() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据开启评论?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | return upcomment(this.ids, "1"); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | gbcomment() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据开启评论?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | return upcomment(this.ids, "0"); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | } |
| | | }, |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .avue-upload__icon { |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | * Copyright (c) 2024 by shuishen, All Rights Reserved. |
| | | --> |
| | | <template> |
| | | <div> |
| | | <el-dialog title="" append-to-body :visible.sync="popupTableShow" width="80%" :before-close="handleClose"> |
| | | <span slot="title" class="dialog-footer"> |
| | | {{ ontitle }} |
| | | </span> |
| | | <div> |
| | | <el-dialog title="" append-to-body :visible.sync="popupTableShow" width="80%" :before-close="handleClose"> |
| | | <span slot="title" class="dialog-footer"> |
| | | {{ ontitle }} |
| | | </span> |
| | | |
| | | <div id="" v-if="editFlag"> |
| | | <avue-form @submit="handleSubmit" :option="optionDiscuss" @reset-change="handleReset" v-model="disCussFrom"> |
| | | </avue-form> |
| | | </div> |
| | | <div id="" v-if="editFlag"> |
| | | <avue-form @submit="handleSubmit" :option="optionDiscuss" @reset-change="handleReset" v-model="disCussFrom"> |
| | | </avue-form> |
| | | </div> |
| | | |
| | | <div id="" v-if="!editFlag"> |
| | | <avue-crud :table-loading="loading" :option="optionList" :data="data" v-model="form" ref="crud" |
| | | @row-update="rowUpdate" @row-del="rowDel"> |
| | | <template slot="menuLeft" v-if="!editFlag"> |
| | | <el-button type="primary" size="small" plain icon="el-icon-circle-plus-outline" @click="add()">添加 |
| | | </el-button> |
| | | </template> |
| | | <template #icon="scope"> |
| | | <i :class="scope.row.icon" style="font-size:14px"></i> |
| | | </template> |
| | | <template #menu="{ row, size }"> |
| | | <el-button v-if="row.level === 1" :size="size" text type="primary" @click="edit(row)">编辑</el-button> |
| | | <el-button v-if="row.level === 1" :size="size" text type="danger" @click="deletes(row)">删除</el-button> |
| | | <el-button v-if="row.level === 2" :size="size" text type="primary" @click="openUser(row, 1)"> |
| | | 选择此项人数:{{ row.number }} 详情</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | </el-dialog> |
| | | <div id="" v-if="!editFlag"> |
| | | <avue-crud :table-loading="loading" :option="optionList" :data="data" v-model="form" ref="crud" |
| | | @row-update="rowUpdate" @row-del="rowDel"> |
| | | <template slot="menuLeft" v-if="!editFlag"> |
| | | <el-button type="primary" size="small" plain icon="el-icon-circle-plus-outline" @click="add()">添加 |
| | | </el-button> |
| | | </template> |
| | | <template #icon="scope"> |
| | | <i :class="scope.row.icon" style="font-size:14px"></i> |
| | | </template> |
| | | <template #menu="{ row, size }"> |
| | | <el-button v-if="row.level === 1" :size="size" text type="primary" @click="edit(row)">编辑</el-button> |
| | | <el-button v-if="row.level === 1" :size="size" text type="danger" |
| | | @click="deletes(row)">删除</el-button> |
| | | <el-button v-if="row.level === 2" :size="size" text type="primary" @click="openUser(row, 1)"> |
| | | 选择此项人数:{{ row.number }} 详情</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="" append-to-body :visible.sync="popupTableUserShow" width="80%" :before-close="userHandleClose"> |
| | | <avue-crud :data="userData" :page="userPage" :option="userOption" @search-change="searchChange" |
| | | @search-reset="searchReset"></avue-crud> |
| | | </el-dialog> |
| | | </div> |
| | | <el-dialog title="" append-to-body :visible.sync="popupTableUserShow" width="80%" :before-close="userHandleClose"> |
| | | <avue-crud :data="userData" :page="userPage" :option="userOption" @search-change="searchChange" |
| | | @search-reset="searchReset"></avue-crud> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | import { |
| | | getListPd, |
| | | getDetailPd, |
| | | addPd, |
| | | updatePd, |
| | | removePd |
| | | } from "@/api/discuss/publicDiscuss" |
| | | } from "@/api/discuss/publicDiscuss" |
| | | |
| | | import { |
| | | import { |
| | | getPage |
| | | } from "@/api/discuss/userTopics" |
| | | } from "@/api/discuss/userTopics" |
| | | |
| | | import website from '@/config/website' |
| | | import website from '@/config/website' |
| | | |
| | | |
| | | import { |
| | | import { |
| | | getLists, |
| | | getList, |
| | | getDetail, |
| | | add, |
| | | update, |
| | | remove |
| | | } from "@/api/discuss/topics" |
| | | } from "@/api/discuss/topics" |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | popupTableShow: false, |
| | | popupTableUserShow: false, |
| | | export default { |
| | | data () { |
| | | return { |
| | | popupTableShow: false, |
| | | popupTableUserShow: false, |
| | | |
| | | loading: true, |
| | | loading: true, |
| | | |
| | | ontitle: '编辑议题', |
| | | editFlag: false, |
| | | ontitle: '编辑议题', |
| | | editFlag: false, |
| | | |
| | | disCussFrom: { |
| | | discussContent: '', |
| | | optionRange: 0, |
| | | sort: 1, |
| | | optionContent: '', |
| | | optionDetail: '', |
| | | number: '', |
| | | createTime: '', |
| | | updateTime: '', |
| | | deleteFlag: '', |
| | | articleId: '', |
| | | parentId: '', |
| | | level: '', |
| | | children: [{ |
| | | optionContent: '', |
| | | optionDetail: '', |
| | | number: '', |
| | | createTime: '', |
| | | updateTime: '', |
| | | deleteFlag: '', |
| | | articleId: '', |
| | | parentId: '', |
| | | level: '', |
| | | }] |
| | | }, |
| | | optionDiscuss: { |
| | | emptyText: '取消', |
| | | column: [{ |
| | | label: '议题', |
| | | prop: 'discussContent', |
| | | type: 'input', |
| | | row: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: '请输入议题', |
| | | trigger: 'blur' |
| | | }], |
| | | }, |
| | | { |
| | | label: '选项范围', |
| | | prop: 'optionRange', |
| | | type: 'radio', |
| | | value: 0, |
| | | button: true, |
| | | row: true, |
| | | dicData: [{ |
| | | label: '多选', |
| | | value: 1 |
| | | }, { |
| | | label: '单选', |
| | | value: 0 |
| | | }], |
| | | rules: [{ |
| | | required: true, |
| | | message: '请选项范围', |
| | | trigger: 'blur' |
| | | }], |
| | | }, |
| | | // { |
| | | // label: '排序', |
| | | // prop: 'sort', |
| | | // controlsPosition: '', |
| | | // type: 'number' |
| | | // }, |
| | | { |
| | | label: '选项内容', |
| | | prop: 'children', |
| | | type: 'dynamic', |
| | | span: 24, |
| | | children: { |
| | | column: [{ |
| | | label: '选项标题', |
| | | prop: 'optionContent', |
| | | type: 'input', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请输入选项标题', |
| | | trigger: 'blur' |
| | | }] |
| | | }, { |
| | | label: '选项说明', |
| | | prop: 'optionDetail', |
| | | type: 'input', |
| | | disCussFrom: { |
| | | discussContent: '', |
| | | optionRange: 0, |
| | | sort: 1, |
| | | optionContent: '', |
| | | optionDetail: '', |
| | | number: '', |
| | | createTime: '', |
| | | updateTime: '', |
| | | deleteFlag: '', |
| | | articleId: '', |
| | | parentId: '', |
| | | level: '', |
| | | children: [{ |
| | | optionContent: '', |
| | | optionDetail: '', |
| | | number: '', |
| | | createTime: '', |
| | | updateTime: '', |
| | | deleteFlag: '', |
| | | articleId: '', |
| | | parentId: '', |
| | | level: '', |
| | | }] |
| | | } |
| | | }, |
| | | ] |
| | | }, |
| | | |
| | | // 表单数据 |
| | | form: {}, |
| | | data: [], |
| | | optionList: { |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | border: true, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | defaultExpandAll: true, |
| | | rowKey: 'id', |
| | | rowParentKey: 'parentId', |
| | | column: [{ |
| | | label: '标题', |
| | | prop: 'discussContent', |
| | | optionDiscuss: { |
| | | emptyText: '取消', |
| | | column: [{ |
| | | label: '议题', |
| | | prop: 'discussContent', |
| | | type: 'input', |
| | | row: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: '请输入议题', |
| | | trigger: 'blur' |
| | | }], |
| | | }, |
| | | { |
| | | label: '选项范围', |
| | | prop: 'optionRange', |
| | | type: 'radio', |
| | | value: 0, |
| | | button: true, |
| | | row: true, |
| | | dicData: [{ |
| | | label: '多选', |
| | | value: 1 |
| | | }, { |
| | | label: '单选', |
| | | value: 0 |
| | | }], |
| | | rules: [{ |
| | | required: true, |
| | | message: '请选项范围', |
| | | trigger: 'blur' |
| | | }], |
| | | }, |
| | | // { |
| | | // label: '排序', |
| | | // prop: 'sort', |
| | | // controlsPosition: '', |
| | | // type: 'number' |
| | | // }, |
| | | { |
| | | label: '选项内容', |
| | | prop: 'children', |
| | | type: 'dynamic', |
| | | span: 24, |
| | | children: { |
| | | column: [{ |
| | | label: '选项标题', |
| | | prop: 'optionContent', |
| | | type: 'input', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请输入选项标题', |
| | | trigger: 'blur' |
| | | }] |
| | | }, { |
| | | label: '选项说明', |
| | | prop: 'optionDetail', |
| | | type: 'input', |
| | | }] |
| | | } |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | label: '选项内容', |
| | | prop: 'optionContent', |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | articleId: '', |
| | | // 表单数据 |
| | | form: {}, |
| | | data: [], |
| | | optionList: { |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | border: true, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | defaultExpandAll: true, |
| | | rowKey: 'id', |
| | | rowParentKey: 'parentId', |
| | | column: [{ |
| | | label: '标题', |
| | | prop: 'discussContent', |
| | | }, |
| | | { |
| | | label: '选项内容', |
| | | prop: 'optionContent', |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | userData: [], |
| | | userOption: { |
| | | labelWidth: 96, |
| | | searchLabelWidth: 96, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | // menuWidth: 500, |
| | | menu: false, |
| | | articleId: '', |
| | | |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | //stripe:true, |
| | | index: true, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | viewBtn: false, |
| | | selection: true, |
| | | delBtn: false, |
| | | excelBtn: true, |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: '姓名', |
| | | prop: 'name', |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, { |
| | | label: '头像', |
| | | type: 'upload', |
| | | listType: "picture-img", |
| | | prop: 'avatar' |
| | | }, { |
| | | label: '手机', |
| | | prop: 'phone', |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, { |
| | | label: '小区', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | | prop: 'addressName' |
| | | }, { |
| | | label: '签名', |
| | | type: 'upload', |
| | | listType: "picture-img", |
| | | prop: 'signaturePath' |
| | | }, { |
| | | label: '时间', |
| | | prop: 'createTime' |
| | | }] |
| | | }, |
| | | // 分页信息 |
| | | userPage: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | query: {}, |
| | | } |
| | | userData: [], |
| | | userOption: { |
| | | labelWidth: 96, |
| | | searchLabelWidth: 96, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | // menuWidth: 500, |
| | | menu: false, |
| | | |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | viewBtn: false, |
| | | selection: true, |
| | | delBtn: false, |
| | | excelBtn: true, |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: '姓名', |
| | | prop: 'name', |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, { |
| | | label: '头像', |
| | | type: 'upload', |
| | | listType: "picture-img", |
| | | prop: 'avatar' |
| | | }, { |
| | | label: '手机', |
| | | prop: 'phone', |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, { |
| | | label: '小区', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | | prop: 'addressName' |
| | | }, { |
| | | label: '签名', |
| | | type: 'upload', |
| | | listType: "picture-img", |
| | | prop: 'signaturePath' |
| | | }, { |
| | | label: '时间', |
| | | prop: 'createTime' |
| | | }] |
| | | }, |
| | | // 分页信息 |
| | | userPage: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | query: {}, |
| | | } |
| | | }, |
| | | |
| | | watch: {}, |
| | | |
| | | methods: { |
| | | |
| | | userHandleClose() { |
| | | userHandleClose () { |
| | | |
| | | this.popupTableUserShow = false |
| | | }, |
| | | this.popupTableUserShow = false |
| | | }, |
| | | |
| | | searchReset() { |
| | | this.query = {} |
| | | this.getUserPage(this.userPage) |
| | | }, |
| | | |
| | | searchChange(params, done) { |
| | | this.query = params |
| | | this.userPage.currentPage = 1 |
| | | this.getUserPage(this.userPage, params) |
| | | done() |
| | | }, |
| | | initData(newData) { |
| | | this.editFlag = false |
| | | this.popupTableShow = true |
| | | this.articleId = newData.id |
| | | this.query.level = 1 |
| | | this.query.articleId = this.articleId |
| | | this.onLoad(this.userPage, this.query) |
| | | }, |
| | | // initData(newData) { |
| | | // this.editFlag = false |
| | | // this.popupTableShow = true |
| | | // this.articleId = newData.id |
| | | |
| | | // this.onLoad() |
| | | // }, |
| | | |
| | | handleClose() { |
| | | this.popupTableShow = false |
| | | this.disCussFrom = {} |
| | | }, |
| | | |
| | | handleSubmit(form, done) { |
| | | done() |
| | | form.articleId = this.articleId |
| | | |
| | | add(form).then( |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | form = {} |
| | | this.editFlag = false |
| | | |
| | | let params = { |
| | | level: 1, |
| | | articleId: this.articleId |
| | | } |
| | | |
| | | getLists(1, 100, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.data = data |
| | | }) |
| | | }, |
| | | (error) => { |
| | | window.console.log(error) |
| | | } |
| | | ) |
| | | }, |
| | | |
| | | handleReset() { |
| | | this.editFlag = false |
| | | }, |
| | | |
| | | // 提交修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | done() |
| | | if (!row.id) { |
| | | addPd(row).then(() => { |
| | | this.onLoad() |
| | | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | } else { |
| | | updatePd(row).then(() => { |
| | | this.onLoad() |
| | | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | searchReset () { |
| | | this.query = {} |
| | | this.getUserPage(this.userPage) |
| | | }, |
| | | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | searchChange (params, done) { |
| | | this.query = params |
| | | this.userPage.currentPage = 1 |
| | | this.getUserPage(this.userPage, params) |
| | | done() |
| | | }, |
| | | initData (newData) { |
| | | this.editFlag = false |
| | | this.popupTableShow = true |
| | | this.articleId = newData.id |
| | | this.query.level = 1 |
| | | this.query.articleId = this.articleId |
| | | this.onLoad(this.userPage, this.query) |
| | | }, |
| | | // initData(newData) { |
| | | // this.editFlag = false |
| | | // this.popupTableShow = true |
| | | // this.articleId = newData.id |
| | | |
| | | // this.onLoad() |
| | | // }, |
| | | |
| | | handleClose () { |
| | | this.popupTableShow = false |
| | | this.disCussFrom = {} |
| | | }, |
| | | |
| | | handleSubmit (form, done) { |
| | | done() |
| | | form.articleId = this.articleId |
| | | |
| | | add(form).then( |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | form = {} |
| | | this.editFlag = false |
| | | |
| | | let params = { |
| | | level: 1, |
| | | articleId: this.articleId |
| | | } |
| | | |
| | | getLists(1, 100, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.data = data |
| | | }) |
| | | }, |
| | | (error) => { |
| | | window.console.log(error) |
| | | } |
| | | ) |
| | | }, |
| | | |
| | | handleReset () { |
| | | this.editFlag = false |
| | | }, |
| | | |
| | | // 提交修改 |
| | | rowUpdate (row, index, done, loading) { |
| | | done() |
| | | if (!row.id) { |
| | | addPd(row).then(() => { |
| | | this.onLoad() |
| | | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | } else { |
| | | updatePd(row).then(() => { |
| | | this.onLoad() |
| | | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | rowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | }) |
| | | }, |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.getUserPage(this.userPage) |
| | | |
| | | add() { |
| | | this.editFlag = true |
| | | }, |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | edit(row) { |
| | | this.disCussFrom = row |
| | | this.editFlag = true |
| | | }, |
| | | add () { |
| | | this.editFlag = true |
| | | }, |
| | | |
| | | deletes(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad() |
| | | edit (row) { |
| | | this.disCussFrom = row |
| | | this.editFlag = true |
| | | }, |
| | | |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | deletes (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | }) |
| | | }, |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad() |
| | | |
| | | openUser(row, type = 0) { |
| | | this.popupTableUserShow = true |
| | | this.query = {} |
| | | if (type == 0) { |
| | | this.userParams = { |
| | | articleId: row.id |
| | | } |
| | | } else { |
| | | this.userParams = { |
| | | topicsId: row.id |
| | | } |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | openUser (row, type = 0) { |
| | | this.popupTableUserShow = true |
| | | this.query = {} |
| | | if (type == 0) { |
| | | this.userParams = { |
| | | articleId: row.id |
| | | } |
| | | } else { |
| | | this.userParams = { |
| | | topicsId: row.id |
| | | } |
| | | } |
| | | this.getUserPage(this.userPage, this.userParams) |
| | | }, |
| | | |
| | | getUserPage (page, params = {}) { |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.userPage.total = data.total |
| | | this.userData = data.records |
| | | this.userData.forEach(item => { |
| | | if (item.avatar.length > 0) { |
| | | item.avatar = website.minioUrl + item.avatar |
| | | } |
| | | if (item.signaturePath && item.signaturePath.length > 0) { |
| | | item.signaturePath = website.minioUrl + item.signaturePath |
| | | // console.log("=====>", item.signaturePath) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | onLoad (page, params = {}) { |
| | | this.loading = true |
| | | getLists(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.data = data |
| | | this.loading = false |
| | | }) |
| | | } |
| | | this.getUserPage(this.userPage, this.userParams) |
| | | }, |
| | | |
| | | getUserPage(page, params = {}) { |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.userPage.total = data.total |
| | | this.userData = data.records |
| | | this.userData.forEach(item => { |
| | | if (item.avatar.length > 0) { |
| | | item.avatar = website.minioUrl + item.avatar |
| | | } |
| | | if (item.signaturePath && item.signaturePath.length > 0) { |
| | | item.signaturePath = website.minioUrl + item.signaturePath |
| | | // console.log("=====>", item.signaturePath) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | onLoad(page, params = {}) { |
| | | this.loading = true |
| | | getLists(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.data = data |
| | | this.loading = false |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |
| | |
| | | <template> |
| | | |
| | | <div> |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisiblesUser" width="80%" :before-close="userHandleClose"> |
| | | <avue-crud ref="DataUser" :option="userOption" :data="dataUser" v-model="dataUser" :page="pageUser" |
| | | @search-change="searchChange" @search-reset="searchReset"></avue-crud> |
| | | </el-dialog> |
| | | </div> |
| | | <div> |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisiblesUser" width="80%" :before-close="userHandleClose"> |
| | | <avue-crud ref="DataUser" :option="userOption" :data="dataUser" v-model="dataUser" :page="pageUser" |
| | | @search-change="searchChange" @search-reset="searchReset"></avue-crud> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | |
| | | <!-- </basicContainer> --> |
| | | <!-- </basicContainer> --> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | import { |
| | | getListPd, |
| | | getDetailPd, |
| | | addPd, |
| | | updatePd, |
| | | removePd, |
| | | } from "@/api/discuss/publicDiscuss" |
| | | import { |
| | | } from "@/api/discuss/publicDiscuss" |
| | | import { |
| | | getPageUser, |
| | | } from "@/api/discuss/userPublicEnroll" |
| | | import option from "@/option/discuss/publicDiscuss" |
| | | import { |
| | | } from "@/api/discuss/userPublicEnroll" |
| | | import option from "@/option/discuss/publicDiscuss" |
| | | import { |
| | | mapGetters |
| | | } from "vuex" |
| | | import { |
| | | } from "vuex" |
| | | import { |
| | | getDictionary |
| | | } from '@/api/system/dict' |
| | | } from '@/api/system/dict' |
| | | |
| | | import website from '@/config/website' |
| | | import website from '@/config/website' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | option1: { |
| | | menu: false, |
| | | addBtn: false, |
| | | column: [{ |
| | | label: '姓名', |
| | | prop: 'name' |
| | | }, { |
| | | label: '头像', |
| | | prop: 'avatar' |
| | | }, { |
| | | label: '手机', |
| | | prop: 'phone' |
| | | }, { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | | prop: 'addressName' |
| | | }, { |
| | | label: '时间', |
| | | prop: 'createTime' |
| | | }] |
| | | }, |
| | | discussForm: { |
| | | ontitle: '', |
| | | title: '', |
| | | openFlag: 0, |
| | | numberRestrictions: 0, |
| | | voteRestrictions: 0, |
| | | userRestrictions: 0, |
| | | endTime: '', |
| | | articleId: '', |
| | | createTime: '', |
| | | updateTime: '', |
| | | deleteFlag: '', |
| | | repeatVote: 0, |
| | | voteNumberPublic: 0, |
| | | appointUser: '', |
| | | userIds: '', |
| | | eventType: 1, |
| | | }, |
| | | |
| | | dialogVisibles: false, |
| | | dialogVisiblesUser: false, |
| | | // 弹框标题 |
| | | title: '', |
| | | // 是否展示弹框 |
| | | box: false, |
| | | // 是否显示查询 |
| | | search: true, |
| | | // 加载中 |
| | | loading: true, |
| | | // 是否为查看模式 |
| | | view: false, |
| | | // 查询信息 |
| | | query: {}, |
| | | // 分页信息 |
| | | page: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | |
| | | // 分页信息 |
| | | pageUser: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | // 表单数据 |
| | | form: {}, |
| | | // 选择行 |
| | | selectionList: [], |
| | | userOption: { |
| | | labelWidth: 96, |
| | | searchLabelWidth: 96, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | // menuWidth: 500, |
| | | menu: false, |
| | | |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | //stripe:true, |
| | | index: true, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | viewBtn: false, |
| | | selection: true, |
| | | delBtn: false, |
| | | excelBtn: true, |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: '姓名', |
| | | prop: 'name', |
| | | search: true, |
| | | }, { |
| | | label: '头像', |
| | | type: 'upload', |
| | | listType: "picture-img", |
| | | prop: 'avatar' |
| | | export default { |
| | | data () { |
| | | return { |
| | | option1: { |
| | | menu: false, |
| | | addBtn: false, |
| | | column: [{ |
| | | label: '姓名', |
| | | prop: 'name' |
| | | }, { |
| | | label: '头像', |
| | | prop: 'avatar' |
| | | }, { |
| | | label: '手机', |
| | | prop: 'phone' |
| | | }, { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | | prop: 'addressName' |
| | | }, { |
| | | label: '时间', |
| | | prop: 'createTime' |
| | | }] |
| | | }, |
| | | { |
| | | label: '签名', |
| | | type: 'upload', |
| | | listType: "picture-img", |
| | | prop: 'signaturePath' |
| | | discussForm: { |
| | | ontitle: '', |
| | | title: '', |
| | | openFlag: 0, |
| | | numberRestrictions: 0, |
| | | voteRestrictions: 0, |
| | | userRestrictions: 0, |
| | | endTime: '', |
| | | articleId: '', |
| | | createTime: '', |
| | | updateTime: '', |
| | | deleteFlag: '', |
| | | repeatVote: 0, |
| | | voteNumberPublic: 0, |
| | | appointUser: '', |
| | | userIds: '', |
| | | eventType: 1, |
| | | }, |
| | | { |
| | | label: '手机', |
| | | prop: 'phone', |
| | | search: true, |
| | | }, { |
| | | label: '小区', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | | prop: 'addressName' |
| | | }, { |
| | | label: '时间', |
| | | prop: 'createTime' |
| | | } |
| | | ] |
| | | }, |
| | | // 表单列表 |
| | | data: [], |
| | | dataUser: [], |
| | | } |
| | | |
| | | dialogVisibles: false, |
| | | dialogVisiblesUser: false, |
| | | // 弹框标题 |
| | | title: '', |
| | | // 是否展示弹框 |
| | | box: false, |
| | | // 是否显示查询 |
| | | search: true, |
| | | // 加载中 |
| | | loading: true, |
| | | // 是否为查看模式 |
| | | view: false, |
| | | // 查询信息 |
| | | query: {}, |
| | | // 分页信息 |
| | | page: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | |
| | | // 分页信息 |
| | | pageUser: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | // 表单数据 |
| | | form: {}, |
| | | // 选择行 |
| | | selectionList: [], |
| | | userOption: { |
| | | labelWidth: 96, |
| | | searchLabelWidth: 96, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | // menuWidth: 500, |
| | | menu: false, |
| | | |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | viewBtn: false, |
| | | selection: true, |
| | | delBtn: false, |
| | | excelBtn: true, |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: '姓名', |
| | | prop: 'name', |
| | | search: true, |
| | | }, { |
| | | label: '头像', |
| | | type: 'upload', |
| | | listType: "picture-img", |
| | | prop: 'avatar' |
| | | }, |
| | | { |
| | | label: '签名', |
| | | type: 'upload', |
| | | listType: "picture-img", |
| | | prop: 'signaturePath' |
| | | }, |
| | | { |
| | | label: '手机', |
| | | prop: 'phone', |
| | | search: true, |
| | | }, { |
| | | label: '小区', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | | prop: 'addressName' |
| | | }, { |
| | | label: '时间', |
| | | prop: 'createTime' |
| | | } |
| | | ] |
| | | }, |
| | | // 表单列表 |
| | | data: [], |
| | | dataUser: [], |
| | | } |
| | | }, |
| | | mounted() { |
| | | // this.init(); |
| | | // this.onLoad(this.page); |
| | | mounted () { |
| | | // this.init(); |
| | | // this.onLoad(this.page); |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | ids() { |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | ...mapGetters(["permission"]), |
| | | ids () { |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.query = {} |
| | | this.getUser(this.userPage) |
| | | }, |
| | | searchReset () { |
| | | this.query = {} |
| | | this.getUser(this.userPage) |
| | | }, |
| | | |
| | | searchChange(params, done) { |
| | | this.query = params |
| | | this.userPage.currentPage = 1 |
| | | this.getUser(this.userPage, params) |
| | | done() |
| | | }, |
| | | init(data) { |
| | | this.houseCode = data.houseCode |
| | | this.onLoad(this.page) |
| | | }, |
| | | getUser(page, params) { |
| | | getPageUser(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.pageUser.total = data.total |
| | | this.dataUser = data.records |
| | | this.dataUser.forEach(item => { |
| | | if (item.avatar.length > 0) { |
| | | item.avatar = website.minioUrl + item.avatar |
| | | searchChange (params, done) { |
| | | this.query = params |
| | | this.userPage.currentPage = 1 |
| | | this.getUser(this.userPage, params) |
| | | done() |
| | | }, |
| | | init (data) { |
| | | this.houseCode = data.houseCode |
| | | this.onLoad(this.page) |
| | | }, |
| | | getUser (page, params) { |
| | | getPageUser(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.pageUser.total = data.total |
| | | this.dataUser = data.records |
| | | this.dataUser.forEach(item => { |
| | | if (item.avatar.length > 0) { |
| | | item.avatar = website.minioUrl + item.avatar |
| | | } |
| | | if (item.signaturePath && item.signaturePath.length > 0) { |
| | | item.signaturePath = website.minioUrl + item.signaturePath |
| | | console.log("=====>", item.signaturePath) |
| | | } |
| | | }) |
| | | this.loading = false |
| | | // this.selectionClear() |
| | | }) |
| | | }, |
| | | userHandleClose () { |
| | | this.dialogVisiblesUser = false |
| | | this.dataUser = [] |
| | | // this.$refs.DataUser && this.$refs.DataUser.resetForm() |
| | | // console.log(this.$refs, 90999) |
| | | }, |
| | | |
| | | openUser (row) { |
| | | this.dialogVisiblesUser = true |
| | | let params = { |
| | | articleId: row.id |
| | | } |
| | | if (item.signaturePath && item.signaturePath.length > 0) { |
| | | item.signaturePath = website.minioUrl + item.signaturePath |
| | | console.log("=====>", item.signaturePath) |
| | | this.getUser(this.pageUser, params) |
| | | }, |
| | | |
| | | openDilog (row, type) { |
| | | this.dialogVisibles = true |
| | | this.discussForm = row |
| | | let times = new Date(row.endTime).getTime() |
| | | this.discussForm.endTime = times |
| | | console.table(this.discussForm) |
| | | if (type == 0) { |
| | | this.discussForm.ontitle = '公益报名' |
| | | } else { |
| | | this.discussForm.ontitle = '创建议题' |
| | | } |
| | | }) |
| | | this.loading = false |
| | | // this.selectionClear() |
| | | }) |
| | | }, |
| | | userHandleClose() { |
| | | this.dialogVisiblesUser = false |
| | | this.dataUser = [] |
| | | // this.$refs.DataUser && this.$refs.DataUser.resetForm() |
| | | // console.log(this.$refs, 90999) |
| | | }, |
| | | }, |
| | | |
| | | openUser(row) { |
| | | this.dialogVisiblesUser = true |
| | | let params = { |
| | | articleId: row.id |
| | | } |
| | | this.getUser(this.pageUser, params) |
| | | }, |
| | | |
| | | openDilog(row, type) { |
| | | this.dialogVisibles = true |
| | | this.discussForm = row |
| | | let times = new Date(row.endTime).getTime() |
| | | this.discussForm.endTime = times |
| | | console.table(this.discussForm) |
| | | if (type == 0) { |
| | | this.discussForm.ontitle = '公益报名' |
| | | } else { |
| | | this.discussForm.ontitle = '创建议题' |
| | | } |
| | | }, |
| | | |
| | | searchHide() { |
| | | this.search = !this.search |
| | | }, |
| | | searchChange() { |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchReset() { |
| | | this.query = {} |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page) |
| | | }, |
| | | handleSubmit(form, done) { |
| | | done() |
| | | if (!this.discussForm.id) { |
| | | addPd(this.discussForm).then(() => { |
| | | this.dialogVisibles = false |
| | | searchHide () { |
| | | this.search = !this.search |
| | | }, |
| | | searchChange () { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | } else { |
| | | updatePd(this.discussForm).then(() => { |
| | | this.dialogVisibles = false |
| | | }, |
| | | searchReset () { |
| | | this.query = {} |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }, |
| | | handleSubmit (form, done) { |
| | | done() |
| | | if (!this.discussForm.id) { |
| | | addPd(this.discussForm).then(() => { |
| | | this.dialogVisibles = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | } else { |
| | | updatePd(this.discussForm).then(() => { |
| | | this.dialogVisibles = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | handleAdd () { |
| | | this.title = '新增' |
| | | this.form = {} |
| | | this.box = true |
| | | }, |
| | | handleEdit (row) { |
| | | this.title = '编辑' |
| | | this.box = true |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data |
| | | }) |
| | | }) |
| | | }, |
| | | handleView (row) { |
| | | this.title = '查看' |
| | | this.view = true |
| | | this.box = true |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data |
| | | }) |
| | | }, |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removePd(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.selectionClear() |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | rowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | beforeClose (done) { |
| | | done() |
| | | this.form = {} |
| | | this.view = false |
| | | }, |
| | | selectionChange (list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear () { |
| | | this.selectionList = [] |
| | | // this.$refs.table.clearSelection(); |
| | | }, |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage |
| | | this.onLoad(this.page) |
| | | }, |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize |
| | | this.onLoad(this.page) |
| | | }, |
| | | onLoad (page, params = { |
| | | eventType: 0 |
| | | }) { |
| | | this.loading = true |
| | | getListPd(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | }, |
| | | handleAdd() { |
| | | this.title = '新增' |
| | | this.form = {} |
| | | this.box = true |
| | | }, |
| | | handleEdit(row) { |
| | | this.title = '编辑' |
| | | this.box = true |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data |
| | | }) |
| | | }, |
| | | handleView(row) { |
| | | this.title = '查看' |
| | | this.view = true |
| | | this.box = true |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removePd(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.selectionClear() |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | beforeClose(done) { |
| | | done() |
| | | this.form = {} |
| | | this.view = false |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = [] |
| | | // this.$refs.table.clearSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage |
| | | this.onLoad(this.page) |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize |
| | | this.onLoad(this.page) |
| | | }, |
| | | onLoad(page, params = { |
| | | eventType: 0 |
| | | }) { |
| | | this.loading = true |
| | | getListPd(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .el-pagination { |
| | | .el-pagination { |
| | | margin-top: 20px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: false, |
| | |
| | | <style> |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | }</style> |
| | | } |
| | | </style> |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: false, |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | addBtn: false, |