Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_web
| | |
| | | label: "", |
| | | value: 1, |
| | | }, |
| | | ]; |
| | | ] |
| | | |
| | | export const entityDic = [ |
| | | { |
| | |
| | | label: "Date", |
| | | value: "java.util.Date", |
| | | }, |
| | | ]; |
| | | ] |
| | | |
| | | export const componentDic = [ |
| | | { |
| | |
| | | label: "日期框", |
| | | value: "date", |
| | | }, |
| | | ]; |
| | | ] |
| | | |
| | | export const queryDic = [ |
| | | { |
| | |
| | | label: "右模糊", |
| | | value: "likeright", |
| | | }, |
| | | ]; |
| | | ] |
| | | |
| | | export const templateDic = [ |
| | | { |
| | |
| | | label: "树表", |
| | | value: "tree", |
| | | }, |
| | | ]; |
| | | ] |
| | | |
| | | export const option = { |
| | | height: "auto", |
| | |
| | | prop: "datasourceId", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 60, |
| | | span: 24, |
| | | type: "select", |
| | | dicUrl: "/api/blade-develop/datasource/select", |
| | |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }; |
| | | } |
| | | |
| | | export const optionModel = { |
| | | border: true, |
| | |
| | | cell: true, |
| | | }, |
| | | ], |
| | | }; |
| | | } |
| | |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 450, |
| | | border: false, |
| | | border: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | excelBtn: true, |
| | |
| | | label: "字典编号", |
| | | prop: "code", |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | slot: true, |
| | | span: 24, |
| | | rules: [ |
| | |
| | | label: "字典名称", |
| | | prop: "dictValue", |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | align: "center", |
| | | rules: [ |
| | | { |
| | |
| | | hide: true |
| | | } |
| | | ] |
| | | }; |
| | | } |
| | | |
| | | export const optionChild = { |
| | | height: 'auto', |
| | |
| | | hide: true |
| | | } |
| | | ] |
| | | }; |
| | | } |
| | |
| | | hide: true, |
| | | }, |
| | | ], |
| | | }; |
| | | } |
| | | |
| | | export const optionChild = { |
| | | height: "auto", |
| | |
| | | prop: "dictValue", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | align: "center", |
| | | rules: [ |
| | | { |
| | |
| | | // hide: true |
| | | }, |
| | | ], |
| | | }; |
| | | } |
| | |
| | | label: "字典编号", |
| | | prop: "code", |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | slot: true, |
| | | span: 24, |
| | | rules: [ |
| | |
| | | hide: true |
| | | } |
| | | ] |
| | | }; |
| | | } |
| | | |
| | | export const optionChild = { |
| | | height: 'auto', |
| | |
| | | hide: true |
| | | } |
| | | ] |
| | | }; |
| | | } |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | row: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入文章标题", |
| | |
| | | prop: 'phone', |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 46, |
| | | }, |
| | | { |
| | | width: 110, |
| | |
| | | <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" |
| | | > |
| | | <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 slot-scope="{ row }" slot="iswords"> |
| | | <el-tag |
| | | >{{ |
| | | <el-tag>{{ |
| | | row.iswords == "1" ? "是" : row.iswords == "0" ? "否" : "是" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="iscomment"> |
| | | <el-tag |
| | | >{{ |
| | | <el-tag>{{ |
| | | row.iscomment == "1" ? "开启" : row.iscomment == "0" ? "关闭" : "关闭" |
| | | }} |
| | | </el-tag> |
| | |
| | | </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() { |
| | |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 350, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | "form.articleType": { |
| | | handler(val) { |
| | | if (val) { |
| | | var videoUrl = this.findObject(this.option.column, "videoUrl"); |
| | | var content = this.findObject(this.option.column, "content"); |
| | | 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.display = true |
| | | content.display = false |
| | | videoUrl.rules = [ |
| | | { |
| | | required: false, |
| | | message: "请选择视频", |
| | | trigger: "blur", |
| | | }, |
| | | ]; |
| | | ] |
| | | } else { |
| | | videoUrl.display = false; |
| | | content.display = true; |
| | | videoUrl.rules = ""; |
| | | videoUrl.display = false |
| | | content.display = true |
| | | videoUrl.rules = "" |
| | | } |
| | | } |
| | | }, |
| | |
| | | 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 = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | if (row.videoUrl.length == 0) { |
| | | row.videoUrl = ""; |
| | | row.videoUrl = "" |
| | | } |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getNotice(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | // con |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const {dateTime} = this.query; |
| | | 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; |
| | | 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(); |
| | | }); |
| | | 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"; |
| | | row.publish = "1" |
| | | } else { |
| | | row.publish = "0"; |
| | | row.publish = "0" |
| | | } |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | kqcomment() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据开启评论?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | return upcomment(this.ids, "1"); |
| | | return upcomment(this.ids, "1") |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | gbcomment() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据开启评论?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | return upcomment(this.ids, "0"); |
| | | return upcomment(this.ids, "0") |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | } |
| | | }, |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | |
| | | </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 === 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> |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | editBtn: false, |
| | |
| | | <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" |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | editBtn: false, |
| | |
| | | <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.article_delete" @click="handleDelete">删 |
| | | 除 |
| | |
| | | 参与用户 |
| | | </el-button> |
| | | |
| | | <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)"> |
| | | <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" |
| | | @click.stop="updateFb(row)"> |
| | | 撤销 |
| | | </el-button> |
| | | |
| | | <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" @click.stop="updateFb(row)"> |
| | | <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" |
| | | @click.stop="updateFb(row)"> |
| | | 发布 |
| | | </el-button> |
| | | </template> |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: false, |
| | |
| | | row: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入议事标题", |
| | |
| | | <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.article_delete" @click="handleDelete">删 |
| | | 除 |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: false, |
| | |
| | | row: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入文章标题", |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | span: 12, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 46, |
| | | }, |
| | | { |
| | | width: 110, |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | @row-del="rowDel" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | @tree-load="treeLoad"> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" |
| | | :permission="permissionList" :before-open="beforeOpen" @row-del="rowDel" @row-update="rowUpdate" |
| | | @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad"> |
| | | <template slot-scope="{row}" slot="menu"> |
| | | <el-button type="text" |
| | | icon="el-icon-setting" |
| | | size="small" |
| | | v-if="permission.api_scope_setting" |
| | | plain |
| | | style="border: 0;background-color: transparent !important;" |
| | | @click.stop="handleDataScope(row)">权限配置 |
| | | <el-button type="text" icon="el-icon-setting" size="small" v-if="permission.api_scope_setting" plain |
| | | style="border: 0;background-color: transparent !important;" @click.stop="handleDataScope(row)">权限配置 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="source"> |
| | |
| | | </div> |
| | | </template> |
| | | </avue-crud> |
| | | <el-drawer :title="`[${scopeMenuName}] 接口权限配置`" :visible.sync="drawerVisible" :direction="direction" |
| | | append-to-body |
| | | <el-drawer :title="`[${scopeMenuName}] 接口权限配置`" :visible.sync="drawerVisible" :direction="direction" append-to-body |
| | | :before-close="handleDrawerClose" size="1000px"> |
| | | <basic-container> |
| | | <avue-crud :option="optionScope" |
| | | :data="dataScope" |
| | | :page="pageScope" |
| | | v-model="formScope" |
| | | :table-loading="scopeLoading" |
| | | ref="crudScope" |
| | | @row-del="rowDelScope" |
| | | @row-update="rowUpdateScope" |
| | | @row-save="rowSaveScope" |
| | | :before-open="beforeOpenScope" |
| | | @search-change="searchChangeScope" |
| | | @search-reset="searchResetScope" |
| | | @selection-change="selectionChangeScope" |
| | | @current-change="currentChangeScope" |
| | | @size-change="sizeChangeScope" |
| | | @on-load="onLoadScope"> |
| | | <avue-crud :option="optionScope" :data="dataScope" :page="pageScope" v-model="formScope" |
| | | :table-loading="scopeLoading" ref="crudScope" @row-del="rowDelScope" @row-update="rowUpdateScope" |
| | | @row-save="rowSaveScope" :before-open="beforeOpenScope" @search-change="searchChangeScope" |
| | | @search-reset="searchResetScope" @selection-change="selectionChangeScope" |
| | | @current-change="currentChangeScope" @size-change="sizeChangeScope" @on-load="onLoadScope"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDeleteScope">删 除 |
| | | <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDeleteScope">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="scopeType"> |
| | | <template slot-scope="{row}" slot="scopeType"> |
| | | <el-tag>{{row.scopeTypeName}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | update, |
| | | getLazyMenuList, |
| | | getMenu |
| | | } from "@/api/system/menu"; |
| | | } from "@/api/system/menu" |
| | | import { |
| | | addApiScope, |
| | | removeApiScope, |
| | | updateApiScope, |
| | | getListApiScope, |
| | | getMenuApiScope |
| | | } from "@/api/system/scope"; |
| | | import {mapGetters} from "vuex"; |
| | | import iconList from "@/config/iconList"; |
| | | } from "@/api/system/scope" |
| | | import { mapGetters } from "vuex" |
| | | import iconList from "@/config/iconList" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | label: "菜单名称", |
| | | prop: "name", |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | label: "菜单编号", |
| | | prop: "code", |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | ] |
| | | }, |
| | | dataScope: [] |
| | | }; |
| | | } |
| | | }, |
| | | |
| | | computed: { |
| | |
| | | viewBtn: this.vaildData(this.permission.menu_view, false), |
| | | delBtn: this.vaildData(this.permission.menu_delete, false), |
| | | editBtn: this.vaildData(this.permission.menu_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | scopeIds() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionListScope.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | // 菜单管理模块 |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.parentId = 0; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.parentId = 0 |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.parentId = ''; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.parentId = '' |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getMenu(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | this.data = res.data.data |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | const parentId = tree.id |
| | | getLazyMenuList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | }); |
| | | resolve(res.data.data) |
| | | }) |
| | | }, |
| | | // 数据权限模块 |
| | | handleDataScope(row) { |
| | | this.drawerVisible = true; |
| | | this.scopeMenuId = row.id; |
| | | this.scopeMenuName = row.name; |
| | | this.drawerVisible = true |
| | | this.scopeMenuId = row.id |
| | | this.scopeMenuName = row.name |
| | | this.onLoadScope(this.pageScope) |
| | | }, |
| | | handleDrawerClose(hide) { |
| | | hide(); |
| | | hide() |
| | | }, |
| | | rowSaveScope(row, done, loading) { |
| | | row = { |
| | | ...row, |
| | | menuId: this.scopeMenuId, |
| | | }; |
| | | } |
| | | addApiScope(row).then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdateScope(row, index, done, loading) { |
| | | row = { |
| | | ...row, |
| | | menuId: this.scopeMenuId, |
| | | }; |
| | | } |
| | | updateApiScope(row).then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDelScope(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeApiScope(row.id); |
| | | return removeApiScope(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDeleteScope() { |
| | | if (this.selectionListScope.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeApiScope(this.scopeIds); |
| | | return removeApiScope(this.scopeIds) |
| | | }) |
| | | .then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crudScope.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crudScope.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpenScope(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getMenuApiScope(this.formScope.id).then(res => { |
| | | this.formScope = res.data.data; |
| | | }); |
| | | this.formScope = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchResetScope() { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | }, |
| | | searchChangeScope(params, done) { |
| | | this.onLoadScope(this.pageScope, params); |
| | | done(); |
| | | this.onLoadScope(this.pageScope, params) |
| | | done() |
| | | }, |
| | | selectionChangeScope(list) { |
| | | this.selectionListScope = list; |
| | | this.selectionListScope = list |
| | | }, |
| | | currentChangeScope(currentPage) { |
| | | this.pageScope.currentPage = currentPage; |
| | | this.pageScope.currentPage = currentPage |
| | | }, |
| | | sizeChangeScope(pageSize) { |
| | | this.pageScope.pageSize = pageSize; |
| | | this.pageScope.pageSize = pageSize |
| | | }, |
| | | onLoadScope(page, params = {}) { |
| | | this.scopeLoading = true; |
| | | this.scopeLoading = true |
| | | const values = { |
| | | ...params, |
| | | menuId: this.scopeMenuId, |
| | | } |
| | | getListApiScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.pageScope.total = data.total; |
| | | this.dataScope = data.records; |
| | | this.selectionListScope = []; |
| | | this.scopeLoading = false; |
| | | }); |
| | | const data = res.data.data |
| | | this.pageScope.total = data.total |
| | | this.dataScope = data.records |
| | | this.selectionListScope = [] |
| | | this.scopeLoading = false |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | :before-close="beforeClose" |
| | | @row-del="rowDel" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | @tree-load="treeLoad"> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" |
| | | :permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" @row-del="rowDel" |
| | | @row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad"> |
| | | <template slot-scope="{row}" slot="menu"> |
| | | <el-button type="text" |
| | | icon="el-icon-setting" |
| | | size="small" |
| | | v-if="permission.data_scope_setting" |
| | | plain |
| | | style="border: 0;background-color: transparent !important;" |
| | | @click.stop="handleDataScope(row)">权限配置 |
| | | <el-button type="text" icon="el-icon-setting" size="small" v-if="permission.data_scope_setting" plain |
| | | style="border: 0;background-color: transparent !important;" @click.stop="handleDataScope(row)">权限配置 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="source"> |
| | |
| | | </div> |
| | | </template> |
| | | </avue-crud> |
| | | <el-drawer :title="`[${scopeMenuName}] 数据权限配置`" :visible.sync="drawerVisible" :direction="direction" |
| | | append-to-body |
| | | <el-drawer :title="`[${scopeMenuName}] 数据权限配置`" :visible.sync="drawerVisible" :direction="direction" append-to-body |
| | | :before-close="handleDrawerClose" size="1000px"> |
| | | <basic-container> |
| | | <avue-crud :option="optionScope" |
| | | :data="dataScope" |
| | | :page="pageScope" |
| | | v-model="formScope" |
| | | :table-loading="scopeLoading" |
| | | ref="crudScope" |
| | | @row-del="rowDelScope" |
| | | @row-update="rowUpdateScope" |
| | | @row-save="rowSaveScope" |
| | | :before-open="beforeOpenScope" |
| | | @search-change="searchChangeScope" |
| | | @search-reset="searchResetScope" |
| | | @selection-change="selectionChangeScope" |
| | | @current-change="currentChangeScope" |
| | | @size-change="sizeChangeScope" |
| | | @on-load="onLoadScope"> |
| | | <avue-crud :option="optionScope" :data="dataScope" :page="pageScope" v-model="formScope" |
| | | :table-loading="scopeLoading" ref="crudScope" @row-del="rowDelScope" @row-update="rowUpdateScope" |
| | | @row-save="rowSaveScope" :before-open="beforeOpenScope" @search-change="searchChangeScope" |
| | | @search-reset="searchResetScope" @selection-change="selectionChangeScope" |
| | | @current-change="currentChangeScope" @size-change="sizeChangeScope" @on-load="onLoadScope"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDeleteScope">删 除 |
| | | <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDeleteScope">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="scopeType"> |
| | | <template slot-scope="{row}" slot="scopeType"> |
| | | <el-tag>{{row.scopeTypeName}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | update, |
| | | getLazyMenuList, |
| | | getMenu |
| | | } from "@/api/system/menu"; |
| | | } from "@/api/system/menu" |
| | | import { |
| | | addDataScope, |
| | | removeDataScope, |
| | | updateDataScope, |
| | | getListDataScope, |
| | | getMenuDataScope |
| | | } from "@/api/system/scope"; |
| | | import {mapGetters} from "vuex"; |
| | | import iconList from "@/config/iconList"; |
| | | import func from "@/util/func"; |
| | | } from "@/api/system/scope" |
| | | import { mapGetters } from "vuex" |
| | | import iconList from "@/config/iconList" |
| | | import func from "@/util/func" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | label: "菜单名称", |
| | | prop: "name", |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | label: "菜单编号", |
| | | prop: "code", |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | ] |
| | | }, |
| | | dataScope: [] |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'formScope.scopeType'() { |
| | | this.initScope(); |
| | | this.initScope() |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | viewBtn: this.vaildData(this.permission.menu_view, false), |
| | | delBtn: this.vaildData(this.permission.menu_delete, false), |
| | | editBtn: this.vaildData(this.permission.menu_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | scopeIds() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionListScope.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | initScope() { |
| | | const scopeType = func.toInt(this.formScope.scopeType); |
| | | const watchMode = this.watchMode; |
| | | let column = "-", name = "暂无"; |
| | | const scopeType = func.toInt(this.formScope.scopeType) |
| | | const watchMode = this.watchMode |
| | | let column = "-", name = "暂无" |
| | | if (scopeType === 1) { |
| | | column = "-"; |
| | | name = "全部可见"; |
| | | column = "-" |
| | | name = "全部可见" |
| | | } else if (scopeType === 2) { |
| | | column = "create_user"; |
| | | name = "本人可见"; |
| | | column = "create_user" |
| | | name = "本人可见" |
| | | } else if (scopeType === 3) { |
| | | column = "create_dept"; |
| | | name = "所在机构可见"; |
| | | column = "create_dept" |
| | | name = "所在机构可见" |
| | | } else if (scopeType === 4) { |
| | | column = "create_dept"; |
| | | name = "所在机构可见及子级可见"; |
| | | column = "create_dept" |
| | | name = "所在机构可见及子级可见" |
| | | } else if (scopeType === 5) { |
| | | column = ""; |
| | | name = "自定义"; |
| | | column = "" |
| | | name = "自定义" |
| | | } |
| | | this.$refs.crudScope.option.column.filter(item => { |
| | | if (watchMode) { |
| | | if (item.prop === "scopeName") { |
| | | this.formScope.scopeName = `${this.scopeMenuName} [${name}]`; |
| | | this.formScope.scopeName = `${this.scopeMenuName} [${name}]` |
| | | } |
| | | if (item.prop === "resourceCode") { |
| | | this.formScope.resourceCode = this.scopeMenuCode; |
| | | this.formScope.resourceCode = this.scopeMenuCode |
| | | } |
| | | if (item.prop === "scopeColumn") { |
| | | this.formScope.scopeColumn = column; |
| | | this.formScope.scopeColumn = column |
| | | } |
| | | } |
| | | if (item.prop === "scopeValue") { |
| | | item.display = scopeType === 5; |
| | | item.display = scopeType === 5 |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | // 菜单管理模块 |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.parentId = 0; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.parentId = 0 |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.parentId = ''; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.parentId = '' |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getMenu(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | beforeClose(done) { |
| | | this.formScope = {}; |
| | | done(); |
| | | this.formScope = {} |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | this.data = res.data.data |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | const parentId = tree.id |
| | | getLazyMenuList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | }); |
| | | resolve(res.data.data) |
| | | }) |
| | | }, |
| | | // 数据权限模块 |
| | | handleDataScope(row) { |
| | | this.drawerVisible = true; |
| | | this.scopeMenuId = row.id; |
| | | this.scopeMenuCode = row.code; |
| | | this.scopeMenuName = row.name; |
| | | this.drawerVisible = true |
| | | this.scopeMenuId = row.id |
| | | this.scopeMenuCode = row.code |
| | | this.scopeMenuName = row.name |
| | | this.onLoadScope(this.pageScope) |
| | | }, |
| | | handleDrawerClose(hide) { |
| | | hide(); |
| | | hide() |
| | | }, |
| | | rowSaveScope(row, done, loading) { |
| | | row = { |
| | | ...row, |
| | | menuId: this.scopeMenuId, |
| | | }; |
| | | } |
| | | addDataScope(row).then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdateScope(row, index, done, loading) { |
| | | row = { |
| | | ...row, |
| | | menuId: this.scopeMenuId, |
| | | }; |
| | | } |
| | | updateDataScope(row).then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDelScope(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeDataScope(row.id); |
| | | return removeDataScope(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDeleteScope() { |
| | | if (this.selectionListScope.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeDataScope(this.scopeIds); |
| | | return removeDataScope(this.scopeIds) |
| | | }) |
| | | .then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crudScope.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crudScope.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpenScope(done, type) { |
| | | if (["add"].includes(type)) { |
| | | this.watchMode = true; |
| | | this.initScope(); |
| | | this.watchMode = true |
| | | this.initScope() |
| | | } |
| | | if (["edit", "view"].includes(type)) { |
| | | this.watchMode = false; |
| | | this.watchMode = false |
| | | getMenuDataScope(this.formScope.id).then(res => { |
| | | this.formScope = res.data.data; |
| | | }); |
| | | this.formScope = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchResetScope() { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | }, |
| | | searchChangeScope(params, done) { |
| | | this.onLoadScope(this.pageScope, params); |
| | | done(); |
| | | this.onLoadScope(this.pageScope, params) |
| | | done() |
| | | }, |
| | | selectionChangeScope(list) { |
| | | this.selectionListScope = list; |
| | | this.selectionListScope = list |
| | | }, |
| | | currentChangeScope(currentPage) { |
| | | this.pageScope.currentPage = currentPage; |
| | | this.pageScope.currentPage = currentPage |
| | | }, |
| | | sizeChangeScope(pageSize) { |
| | | this.pageScope.pageSize = pageSize; |
| | | this.pageScope.pageSize = pageSize |
| | | }, |
| | | onLoadScope(page, params = {}) { |
| | | this.scopeLoading = true; |
| | | this.scopeLoading = true |
| | | const values = { |
| | | ...params, |
| | | menuId: this.scopeMenuId, |
| | | } |
| | | getListDataScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.pageScope.total = data.total; |
| | | this.dataScope = data.records; |
| | | this.selectionListScope = []; |
| | | this.scopeLoading = false; |
| | | }); |
| | | const data = res.data.data |
| | | this.pageScope.total = data.total |
| | | this.dataScope = data.records |
| | | this.selectionListScope = [] |
| | | this.scopeLoading = false |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | |
| | | prop: "roleName", |
| | | search: true, |
| | | span: 24, |
| | | searchLabelWidth: 76, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | label: "角色别名", |
| | | prop: "roleAlias", |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | row: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | span: 12, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=haveType", |
| | | dataType: "number", |
| | |
| | | label: "打卡人员", |
| | | prop: "name", |
| | | search: true, |
| | | searchSpan: 4 |
| | | searchSpan: 4, |
| | | searchLabelWidth: 76, |
| | | }, |
| | | { |
| | | label: "打卡时间", |
| | |
| | | searchLabelWidth: 66, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 46, |
| | | dataType: "number", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=reportForRepairsType", |
| | |
| | | searchSpan: 4, |
| | | width: 100, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入事件名称", |
| | |
| | | <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.community_delete" @click="handleDelete">删 除 |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.community_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | prop: "name", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | span: 12, |
| | | rules: [{ |
| | | required: true, |
| | |
| | | prop: "name", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | span: 12, |
| | | rules: [ |
| | | { |
| | |
| | | prop: "executionId", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 60, |
| | | width: 320, |
| | | }, |
| | | { |
| | |
| | | prop: 'key', |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | }, |
| | | { |
| | | width: 150, |
| | |
| | | prop: 'modelKey', |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | overHidden: true |
| | | }, |
| | | { |
| | |
| | | prop: "gridmanName", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 66, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | prop: "communityName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属社区", |
| | |
| | | label: "业委会名称", |
| | | prop: "name", |
| | | search: true, |
| | | searchLabelWidth: 124, |
| | | searchLabelWidth: 90, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入业委会名称", |
| | |
| | | prop: "serviceId", |
| | | width: '120', |
| | | searchSpan: 4, |
| | | search: true |
| | | search: true, |
| | | searchLabelWidth: 60, |
| | | }, |
| | | { |
| | | label: "服务host", |
| | |
| | | prop: "serviceId", |
| | | searchSpan: 4, |
| | | search: true, |
| | | width: '120' |
| | | width: '120', |
| | | searchLabelWidth: 60, |
| | | }, |
| | | { |
| | | label: "服务host", |
| | |
| | | label: "服务id", |
| | | prop: "serviceId", |
| | | searchSpan: 4, |
| | | search: true |
| | | search: true, |
| | | searchLabelWidth: 60, |
| | | }, |
| | | { |
| | | label: "服务host", |
| | |
| | | prop: "placeName", |
| | | searchSpan: 5, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入场所名称", |
| | |
| | | width: 120, |
| | | display: false, |
| | | label: '是否有二维码', |
| | | searchLabelWidth: 110, |
| | | searchLabelWidth: 104, |
| | | prop: 'source', |
| | | type: "select", |
| | | search: true, |
| | |
| | | prop: "name", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 46, |
| | | width: 260, |
| | | rules: [{ |
| | | required: true, |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | row: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入招标标题", |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | row: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入收支标题", |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | row: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 46, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入业主大会标题", |
| | |
| | | prop: "areaId", |
| | | search: true, |
| | | searchSpan: searchSpan, |
| | | searchLabelWidth: 76, |
| | | width: 150, |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/region/tree", |
| | |
| | | prop: "districtName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入小区名称", |
| | |
| | | }, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | disabled: false, |
| | | type: "select", |
| | | rules: [{ |
| | |
| | | }, |
| | | searchSpan, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | disabled: false, |
| | | type: "select", |
| | | rules: [{ |
| | |
| | | label: "付款人", |
| | | prop: "payUser", |
| | | searchSpan: searchSpan, |
| | | searchLabelWidth: 80, |
| | | searchLabelWidth: 90, |
| | | search: true, |
| | | rules: [{ |
| | | required: 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.propertyCompany_delete" |
| | | @click="handleDelete">删 除 |
| | |
| | | label: "物业公司名称", |
| | | prop: "name", |
| | | searchSpan: 5, |
| | | searchLabelWidth: 124, |
| | | searchLabelWidth: 104, |
| | | search: true, |
| | | span: 18, |
| | | row: true, |
| | |
| | | |
| | | |
| | | addProperty(row) { |
| | | this.$refs.propertyEdit.init(row); |
| | | this.$refs.propertyEdit.init(row) |
| | | }, |
| | | |
| | | aliSubmit(form, done) { |
| | |
| | | prop: "districtName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入小区名称", |
| | |
| | | parent: false, |
| | | prop: "houseName", |
| | | searchSpan: 4, |
| | | searchLabelWidth: 50, |
| | | display: false, |
| | | search: 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.article_delete" @click="handleDelete">删 |
| | | 除 |
| | |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | addBtn: false, |
| | |
| | | span: 24, |
| | | row: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 50, |
| | | search: true, |
| | | rules: [{ |
| | | required: 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">删 除 |
| | |
| | | prop: "districtName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入小区名称", |
| | |
| | | <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.propertyCompany_delete" |
| | | @click="handleDelete">删 除 |
| | |
| | | label: "物业公司名称", |
| | | prop: "name", |
| | | searchSpan: 5, |
| | | searchLabelWidth: 124, |
| | | searchLabelWidth: 104, |
| | | search: true, |
| | | span: 18, |
| | | row: true, |
| | |
| | | label: "社会信用代码", |
| | | prop: "socialCreditCode", |
| | | searchSpan: 5, |
| | | // searchLabelWidth: 124, |
| | | searchLabelWidth: 124, |
| | | search: true, |
| | | span: 18, |
| | | row: true, |
| | |
| | | |
| | | |
| | | addProperty(row) { |
| | | this.$refs.propertyEdit.init(row); |
| | | this.$refs.propertyEdit.init(row) |
| | | }, |
| | | |
| | | aliSubmit(form, done) { |
| | |
| | | label: "姓名", |
| | | prop: "name", |
| | | searchSpan: 3, |
| | | searchLabelWidth: 66, |
| | | searchLabelWidth: 50, |
| | | search: true, |
| | | rules: [{ |
| | | required: 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-scope="{row, size, index}" slot="menu"> |
| | | <el-button :size="size" type="text" icon="el-icon-view" v-if="permission.bail_view" plain @click="lookDetail(row, 0)">查 看 |
| | | <el-button :size="size" type="text" icon="el-icon-view" v-if="permission.bail_view" plain |
| | | @click="lookDetail(row, 0)">查 看 |
| | | </el-button> |
| | | <el-button :size="size" type="text" icon="el-icon-s-check" v-if="row.status == 1 && permission.bail_check" plain |
| | | @click="lookDetail(row, 1)">审 核 |
| | | <el-button :size="size" type="text" icon="el-icon-s-check" v-if="row.status == 1 && permission.bail_check" |
| | | plain @click="lookDetail(row, 1)">审 核 |
| | | </el-button> |
| | | <el-button :size="size" type="text" icon="el-icon-delete" v-if="permission.bail_del" plain @click="rowDel(row)">删 除 |
| | | <el-button :size="size" type="text" icon="el-icon-delete" v-if="permission.bail_del" plain |
| | | @click="rowDel(row)">删 除 |
| | | </el-button> |
| | | </template> |
| | | |
| | |
| | | label: "社区", |
| | | prop: "communityName", |
| | | searchSpan: 4, |
| | | searchLabelWidth: 66, |
| | | searchLabelWidth: 46, |
| | | search: true, |
| | | hide: true, |
| | | }, |
| | |
| | | ...mapGetters(["permission", "userInfo"]), |
| | | permissionList() { |
| | | |
| | | console.log("permission===>",this.permission); |
| | | console.log("permission===>", this.permission) |
| | | |
| | | return { |
| | | addBtn: this.vaildData(this.permission.bail_add, false), |
| | |
| | | <style> |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | } |
| | | </style> |
| | | }</style> |
| | |
| | | <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-scope="{row, size}" slot="menu"> |
| | | <el-button type="text" :size="size" icon="el-icon-view" v-if="permission.place_view" plain |
| | |
| | | label: "社区", |
| | | prop: "communityName", |
| | | searchSpan: 4, |
| | | searchLabelWidth: 66, |
| | | searchLabelWidth: 46, |
| | | search: true, |
| | | hide: true, |
| | | }, |
| | |
| | | prop: "name", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 60, |
| | | slot: true, |
| | | }, |
| | | { |
| | |
| | | prop: "domainUrl", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入附件域名", |
| | |
| | | value: 1, |
| | | span: 24, |
| | | width: 120, |
| | | searchLabelWidth: 50, |
| | | searchLabelWidth: 46, |
| | | row: true, |
| | | dicUrl: "/api/blade-system/dict/dictionary?code=oss", |
| | | props: { |
| | |
| | | value: 1, |
| | | span: 24, |
| | | width: 100, |
| | | searchLabelWidth: 66, |
| | | searchLabelWidth: 46, |
| | | row: true, |
| | | dicUrl: "/api/blade-system/dict/dictionary?code=sms", |
| | | props: { |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | @row-del="rowDel" |
| | | v-model="form" |
| | | ref="crud" |
| | | :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"> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" @row-del="rowDel" v-model="form" |
| | | ref="crud" :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 type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.client_delete" |
| | | <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.client_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/system/client"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, add, update, remove } from "@/api/system/client" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | label: "应用id", |
| | | prop: "clientId", |
| | | search: true, |
| | | searchLabelWidth: 60, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入客户端id", |
| | |
| | | label: "应用密钥", |
| | | prop: "clientSecret", |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入客户端密钥", |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.client_view), |
| | | delBtn: this.vaildData(this.permission.client_delete), |
| | | editBtn: this.vaildData(this.permission.client_edit) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(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(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |
| | |
| | | label: "机构名称", |
| | | prop: "deptName", |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入机构名称", |
| | |
| | | label: "机构全称", |
| | | prop: "fullName", |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入机构全称", |
| | |
| | | update, |
| | | add, |
| | | getMenu |
| | | } from "@/api/system/menu"; |
| | | } from "@/api/system/menu" |
| | | import { |
| | | mapGetters |
| | | } from "vuex"; |
| | | import iconList from "@/config/iconList"; |
| | | import func from "@/util/func"; |
| | | } from "vuex" |
| | | import iconList from "@/config/iconList" |
| | | import func from "@/util/func" |
| | | import { |
| | | getMenuTree |
| | | } from "@/api/system/menu"; |
| | | } from "@/api/system/menu" |
| | | |
| | | |
| | | import { |
| | | getTreeList |
| | | } from "@/api/label/label"; |
| | | } from "@/api/label/label" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | label: "菜单名称", |
| | | prop: "name", |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入菜单名称", |
| | |
| | | }, |
| | | data: [], |
| | | labelList: [], |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'form.category'() { |
| | | const category = func.toInt(this.form.category); |
| | | const category = func.toInt(this.form.category) |
| | | this.$refs.crud.option.column.filter(item => { |
| | | if (item.prop === "path") { |
| | | item.rules[0].required = category === 1; |
| | | item.rules[0].required = category === 1 |
| | | } |
| | | if (item.prop === 'isOpen') { |
| | | item.disabled = category === 2; |
| | | item.disabled = category === 2 |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | }, |
| | | computed: { |
| | |
| | | viewBtn: this.vaildData(this.permission.menu_view, false), |
| | | delBtn: this.vaildData(this.permission.menu_delete, false), |
| | | editBtn: this.vaildData(this.permission.menu_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | initData() { |
| | | getMenuTree().then(res => { |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | const column = this.findObject(this.option.column, "parentId") |
| | | column.dicData = res.data.data |
| | | }) |
| | | |
| | | // getTreeList().then(res => { |
| | | // console.log(JSON.stringify(res.data.data)) |
| | | const column = this.findObject(this.option.column, "labelList"); |
| | | column.dicData = this.labelList; |
| | | const column = this.findObject(this.option.column, "labelList") |
| | | column.dicData = this.labelList |
| | | // }); |
| | | }, |
| | | handleAdd(row) { |
| | | this.parentId = row.id; |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.value = row.id; |
| | | column.addDisabled = true; |
| | | this.$refs.crud.rowAdd(); |
| | | this.parentId = row.id |
| | | const column = this.findObject(this.option.column, "parentId") |
| | | column.value = row.id |
| | | column.addDisabled = true |
| | | this.$refs.crud.rowAdd() |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then((res) => { |
| | | // 获取新增数据的相关字段 |
| | | const data = res.data.data; |
| | | row.id = data.id; |
| | | const data = res.data.data |
| | | row.id = data.id |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | // 数据回调进行刷新 |
| | | done(row); |
| | | done(row) |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | // 数据回调进行刷新 |
| | | done(row); |
| | | done(row) |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row, index, done) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | // 数据回调进行刷新 |
| | | done(row); |
| | | }); |
| | | done(row) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | // 刷新表格数据并重载 |
| | | this.data = []; |
| | | this.parentId = 0; |
| | | this.$refs.crud.refreshTable(); |
| | | this.$refs.crud.toggleSelection(); |
| | | this.data = [] |
| | | this.parentId = 0 |
| | | this.$refs.crud.refreshTable() |
| | | this.$refs.crud.toggleSelection() |
| | | // 表格数据重载 |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.parentId = 0; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.parentId = 0 |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.parentId = ''; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.parentId = '' |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["add", "edit"].includes(type)) { |
| | | this.initData(); |
| | | this.initData() |
| | | } |
| | | if (["edit", "view"].includes(type)) { |
| | | getMenu(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | beforeClose(done) { |
| | | this.parentId = ""; |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.value = ""; |
| | | column.addDisabled = false; |
| | | done(); |
| | | this.parentId = "" |
| | | const column = this.findObject(this.option.column, "parentId") |
| | | column.value = "" |
| | | column.addDisabled = false |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getLazyList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | this.data = res.data.data |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | getTreeList().then(res => { |
| | | this.labelList = res.data.data; |
| | | }); |
| | | this.labelList = res.data.data |
| | | }) |
| | | }, |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | const parentId = tree.id |
| | | getLazyList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | }); |
| | | resolve(res.data.data) |
| | | }) |
| | | // getTreeList().then(res => { |
| | | // console.log(JSON.stringify(res.data.data)) |
| | | const column = this.findObject(this.option.column, "labelList"); |
| | | column.dicData = this.labelList; |
| | | const column = this.findObject(this.option.column, "labelList") |
| | | column.dicData = this.labelList |
| | | // }); |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList" |
| | | :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" |
| | | @row-del="rowDel" @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 type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.post_delete" |
| | | <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.post_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="category"> |
| | | <template slot-scope="{row}" slot="category"> |
| | | <el-tag>{{row.categoryName}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/system/post"; |
| | | import {mapGetters} from "vuex"; |
| | | import website from "@/config/website"; |
| | | import { getList, getDetail, add, update, remove } from "@/api/system/post" |
| | | import { mapGetters } from "vuex" |
| | | import website from "@/config/website" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | dataType: "number", |
| | | slot: true, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择岗位类型", |
| | |
| | | label: "岗位编号", |
| | | prop: "postCode", |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入岗位编号", |
| | |
| | | label: "岗位名称", |
| | | prop: "postName", |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入岗位名称", |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.post_view, false), |
| | | delBtn: this.vaildData(this.permission.post_delete, false), |
| | | editBtn: this.vaildData(this.permission.post_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(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(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model="form" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | @row-del="rowDel" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page" |
| | | :permission="permissionList" :before-open="beforeOpen" @row-del="rowDel" @row-update="rowUpdate" |
| | | @row-save="rowSave" @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 type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | v-if="permission.tenant_delete" |
| | | plain |
| | | <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.tenant_delete" plain |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-tooltip class="item" effect="dark" content="给租户配置账号额度、过期时间等授权信息" placement="top"> |
| | | <el-button size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('administrator')" |
| | | icon="el-icon-setting" |
| | | <el-button size="small" plain v-if="userInfo.role_name.includes('administrator')" icon="el-icon-setting" |
| | | @click="handleSetting">授权配置 |
| | | </el-button> |
| | | </el-tooltip> |
| | | <el-tooltip class="item" effect="dark" content="给租户配置独立数据源以实现数据库隔离" placement="top"> |
| | | <el-button size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('administrator')" |
| | | icon="el-icon-coin" |
| | | <el-button size="small" plain v-if="userInfo.role_name.includes('administrator')" icon="el-icon-coin" |
| | | @click="handleDatasource">数据源配置 |
| | | </el-button> |
| | | </el-tooltip> |
| | | <el-tooltip class="item" effect="dark" content="将菜单产品包与租户配置绑定" placement="top"> |
| | | <el-button size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('administrator')" |
| | | icon="el-icon-notebook-1" |
| | | @click="handlePackage">产品包配置 |
| | | <el-button size="small" plain v-if="userInfo.role_name.includes('administrator')" |
| | | icon="el-icon-notebook-1" @click="handlePackage">产品包配置 |
| | | </el-button> |
| | | </el-tooltip> |
| | | <el-tooltip class="item" effect="dark" content="将自定义的菜单集合定制为租户绑定的菜单产品包" placement="top"> |
| | | <el-button size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('administrator')" |
| | | icon="el-icon-notebook-2" |
| | | @click="handlePackageSetting">产品包管理 |
| | | <el-button size="small" plain v-if="userInfo.role_name.includes('administrator')" |
| | | icon="el-icon-notebook-2" @click="handlePackageSetting">产品包管理 |
| | | </el-button> |
| | | </el-tooltip> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="accountNumber"> |
| | | <template slot-scope="{row}" slot="accountNumber"> |
| | | <el-tag>{{ row.accountNumber > 0 ? row.accountNumber : '不限制' }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="expireTime"> |
| | | <template slot-scope="{row}" slot="expireTime"> |
| | | <el-tag>{{ row.expireTime ? row.expireTime : '不限制' }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="租户授权配置" |
| | | append-to-body |
| | | :visible.sync="box" |
| | | width="450px"> |
| | | <el-dialog title="租户授权配置" append-to-body :visible.sync="box" width="450px"> |
| | | <avue-form :option="settingOption" v-model="settingForm" @submit="handleSubmit"/> |
| | | </el-dialog> |
| | | <el-dialog title="租户数据源配置" |
| | | append-to-body |
| | | :visible.sync="datasourceBox" |
| | | width="450px"> |
| | | <el-dialog title="租户数据源配置" append-to-body :visible.sync="datasourceBox" width="450px"> |
| | | <avue-form :option="datasourceOption" v-model="datasourceForm" @submit="handleDatasourceSubmit"/> |
| | | </el-dialog> |
| | | <el-dialog title="租户产品包配置" |
| | | append-to-body |
| | | :visible.sync="packageBox" |
| | | width="450px"> |
| | | <el-dialog title="租户产品包配置" append-to-body :visible.sync="packageBox" width="450px"> |
| | | <avue-form ref="formPackage" :option="packageOption" v-model="packageForm" @submit="handlePackageSubmit"/> |
| | | </el-dialog> |
| | | <el-dialog title="租户产品包管理" |
| | | append-to-body |
| | | :visible.sync="packageSettingBox" |
| | | width="1000px"> |
| | | <el-dialog title="租户产品包管理" append-to-body :visible.sync="packageSettingBox" width="1000px"> |
| | | <tenant-package></tenant-package> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, remove, update, add, setting, datasource, packageInfo, packageSetting} from "@/api/system/tenant"; |
| | | import {getDetail as packageDetail} from "@/api/system/tenantpackage"; |
| | | import {mapGetters} from "vuex"; |
| | | import {getMenuTree} from "@/api/system/menu"; |
| | | import {validatenull} from "@/util/validate"; |
| | | import { getList, getDetail, remove, update, add, setting, datasource, packageInfo, packageSetting } from "@/api/system/tenant" |
| | | import { getDetail as packageDetail } from "@/api/system/tenantpackage" |
| | | import { mapGetters } from "vuex" |
| | | import { getMenuTree } from "@/api/system/menu" |
| | | import { validatenull } from "@/util/validate" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | prop: "tenantId", |
| | | width: 100, |
| | | search: true, |
| | | searchLabelWidth: 60, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | span: 24, |
| | |
| | | }, |
| | | ] |
| | | }, |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'packageForm.packageId'() { |
| | | if (!validatenull(this.packageForm.packageId)) { |
| | | packageDetail(this.packageForm.packageId).then(res => { |
| | | this.packageForm.menuId = res.data.data.menuId; |
| | | this.initData(); |
| | | }); |
| | | this.packageForm.menuId = res.data.data.menuId |
| | | this.initData() |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | |
| | | viewBtn: this.vaildData(this.permission.tenant_view, false), |
| | | delBtn: this.vaildData(this.permission.tenant_delete, false), |
| | | editBtn: this.vaildData(this.permission.tenant_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | tenantId() { |
| | | return this.selectionList[0].tenantId; |
| | | return this.selectionList[0].tenantId |
| | | } |
| | | }, |
| | | methods: { |
| | | initData() { |
| | | getMenuTree().then(res => { |
| | | const column = this.findObject(this.packageOption.column, "menuId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | const column = this.findObject(this.packageOption.column, "menuId") |
| | | column.dicData = res.data.data |
| | | }) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | const data = res.data.data; |
| | | const data = res.data.data |
| | | if (!(data.accountNumber > 0)) { |
| | | data.accountNumber = "不限制"; |
| | | data.accountNumber = "不限制" |
| | | } |
| | | if (!data.expireTime) { |
| | | data.expireTime = "不限制"; |
| | | data.expireTime = "不限制" |
| | | } |
| | | this.form = data; |
| | | }); |
| | | this.form = data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleSetting() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | if (this.selectionList.length === 1) { |
| | | getDetail(this.selectionList[0].id).then(res => { |
| | | const data = res.data.data; |
| | | this.settingForm.accountNumber = data.accountNumber; |
| | | this.settingForm.expireTime = data.expireTime; |
| | | }); |
| | | const data = res.data.data |
| | | this.settingForm.accountNumber = data.accountNumber |
| | | this.settingForm.expireTime = data.expireTime |
| | | }) |
| | | } else { |
| | | this.settingForm.accountNumber = -1; |
| | | this.settingForm.expireTime = ''; |
| | | this.settingForm.accountNumber = -1 |
| | | this.settingForm.expireTime = '' |
| | | } |
| | | this.box = true; |
| | | this.box = true |
| | | }, |
| | | handleDatasource() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | if (this.selectionList.length !== 1) { |
| | | this.$message.warning("只能选择一条数据"); |
| | | return; |
| | | this.$message.warning("只能选择一条数据") |
| | | return |
| | | } |
| | | getDetail(this.selectionList[0].id).then(res => { |
| | | const data = res.data.data; |
| | | this.datasourceForm.datasourceId = data.datasourceId; |
| | | }); |
| | | this.datasourceBox = true; |
| | | const data = res.data.data |
| | | this.datasourceForm.datasourceId = data.datasourceId |
| | | }) |
| | | this.datasourceBox = true |
| | | }, |
| | | handlePackage() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | if (this.selectionList.length !== 1) { |
| | | this.$message.warning("只能选择一条数据"); |
| | | return; |
| | | this.$message.warning("只能选择一条数据") |
| | | return |
| | | } |
| | | if (this.selectionList.length === 1) { |
| | | packageInfo(this.selectionList[0].id).then(res => { |
| | | const data = res.data.data; |
| | | this.packageForm.packageId = data.id; |
| | | this.packageForm.menuId = data.menuId; |
| | | }); |
| | | const data = res.data.data |
| | | this.packageForm.packageId = data.id |
| | | this.packageForm.menuId = data.menuId |
| | | }) |
| | | } else { |
| | | this.packageForm.menuId = ''; |
| | | this.packageForm.menuId = '' |
| | | } |
| | | this.packageBox = true; |
| | | this.packageBox = true |
| | | //更新字典远程数据 |
| | | setTimeout(() => { |
| | | const form = this.$refs.formPackage; |
| | | form.updateDic('packageId'); |
| | | }, 10); |
| | | const form = this.$refs.formPackage |
| | | form.updateDic('packageId') |
| | | }, 10) |
| | | }, |
| | | handlePackageSetting() { |
| | | this.packageSettingBox = true; |
| | | this.packageSettingBox = true |
| | | }, |
| | | handleSubmit(form, done, loading) { |
| | | setting(this.ids, form).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!" |
| | | }); |
| | | done(); |
| | | this.box = false; |
| | | }) |
| | | done() |
| | | this.box = false |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | handleDatasourceSubmit(form, done, loading) { |
| | | datasource(this.tenantId, form.datasourceId).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!" |
| | | }); |
| | | done(); |
| | | this.datasourceBox = false; |
| | | }) |
| | | done() |
| | | this.datasourceBox = false |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | handlePackageSubmit(form, done, loading) { |
| | | packageSetting(this.tenantId, form.packageId).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!" |
| | | }); |
| | | done(); |
| | | this.packageBox = false; |
| | | }) |
| | | done() |
| | | this.packageBox = false |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(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(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList" |
| | | :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" |
| | | @row-del="rowDel" @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 type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.topmenu_delete" |
| | | <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.topmenu_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-button size="small" |
| | | icon="el-icon-delete" |
| | | @click="handleMenuSetting" |
| | | v-if="permission.topmenu_setting" |
| | | <el-button size="small" icon="el-icon-delete" @click="handleMenuSetting" v-if="permission.topmenu_setting" |
| | | plain>菜单配置 |
| | | </el-button> |
| | | </template> |
| | |
| | | <el-input-number v-model="row.sort" @change="sortChange(row)" :min="1" :max="100"></el-input-number> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="下级菜单配置" |
| | | append-to-body |
| | | :visible.sync="box" |
| | | width="345px"> |
| | | <el-dialog title="下级菜单配置" append-to-body :visible.sync="box" width="345px"> |
| | | |
| | | <el-tree :data="menuGrantList" |
| | | show-checkbox |
| | | node-key="id" |
| | | ref="treeMenu" |
| | | :default-checked-keys="menuTreeObj" |
| | | <el-tree :data="menuGrantList" show-checkbox node-key="id" ref="treeMenu" :default-checked-keys="menuTreeObj" |
| | | :props="props"> |
| | | </el-tree> |
| | | |
| | | <span slot="footer" |
| | | class="dialog-footer"> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="box = false">取 消</el-button> |
| | | <el-button type="primary" |
| | | @click="submit">确 定</el-button> |
| | | <el-button type="primary" @click="submit">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove, grant, grantTree, getTopTree} from "@/api/system/topmenu"; |
| | | import {mapGetters} from "vuex"; |
| | | import iconList from "@/config/iconList"; |
| | | import { getList, getDetail, add, update, remove, grant, grantTree, getTopTree } from "@/api/system/topmenu" |
| | | import { mapGetters } from "vuex" |
| | | import iconList from "@/config/iconList" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | label: "菜单名", |
| | | prop: "name", |
| | | search: true, |
| | | searchLabelWidth: 60, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入菜单名", |
| | |
| | | label: "菜单编号", |
| | | prop: "code", |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入菜单编号", |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.topmenu_view, false), |
| | | delBtn: this.vaildData(this.permission.topmenu_delete, false), |
| | | editBtn: this.vaildData(this.permission.topmenu_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | idsArray() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids; |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids |
| | | } |
| | | }, |
| | | methods: { |
| | | submit() { |
| | | const menuList = this.$refs.treeMenu.getCheckedKeys(); |
| | | const menuList = this.$refs.treeMenu.getCheckedKeys() |
| | | grant(this.idsArray, menuList).then(() => { |
| | | this.box = false; |
| | | this.box = false |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.onLoad(this.page); |
| | | }); |
| | | }) |
| | | this.onLoad(this.page) |
| | | }) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleMenuSetting() { |
| | | if (this.selectionList.length !== 1) { |
| | | this.$message.warning("只能选择一条数据"); |
| | | return; |
| | | this.$message.warning("只能选择一条数据") |
| | | return |
| | | } |
| | | this.menuTreeObj = []; |
| | | this.menuTreeObj = [] |
| | | grantTree() |
| | | .then(res => { |
| | | this.menuGrantList = res.data.data.menu; |
| | | this.menuGrantList = res.data.data.menu |
| | | getTopTree(this.ids).then(res => { |
| | | this.menuTreeObj = res.data.data.menu; |
| | | this.box = true; |
| | | }); |
| | | }); |
| | | this.menuTreeObj = res.data.data.menu |
| | | this.box = true |
| | | }) |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | sortChange(row) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | }, error => { |
| | | window.console.log(error); |
| | | }); |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(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(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | |
| | | <el-col :span="19"> |
| | | <basic-container> |
| | | <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" |
| | | v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave" |
| | | :before-open="beforeOpen" :page.sync="page" @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-del="rowDel" @row-update="rowUpdate" |
| | | @row-save="rowSave" :before-open="beforeOpen" :page.sync="page" @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 type="danger" size="small" plain icon="el-icon-delete" v-if="permission.user_delete" |
| | | @click="handleDelete">删 除 |
| | |
| | | </avue-crud> |
| | | <el-dialog title="用户角色配置" append-to-body :visible.sync="roleBox" width="345px"> |
| | | |
| | | <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" ref="treeRole" |
| | | :default-checked-keys="roleTreeObj" :props="props"> |
| | | <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" |
| | | ref="treeRole" :default-checked-keys="roleTreeObj" :props="props"> |
| | | </el-tree> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | label: "登录账号", |
| | | prop: "account", |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | display: false |
| | | }, |
| | | // { |
| | |
| | | value: "dictKey", |
| | | }, |
| | | search: true, |
| | | searchLabelWidth: 46, |
| | | row: true, |
| | | }, |
| | | { |
| | |
| | | label: "类型", |
| | | prop: "type", |
| | | span: 12, |
| | | searchLabelWidth: 66, |
| | | searchLabelWidth: 46, |
| | | searchSpan: 4, |
| | | search: true, |
| | | dataType: "number", |
| | |
| | | { |
| | | label: "模块名", |
| | | prop: "codeName", |
| | | searchLabelWidth: 80, |
| | | searchLabelWidth: 60, |
| | | searchSpan: 4, |
| | | search: true, |
| | | display: false, |
| | |
| | | prop: "tenantRelationship", |
| | | search: true, |
| | | searchSpan: 3, |
| | | searchLabelWidth: 66, |
| | | searchLabelWidth: 46, |
| | | width: 100, |
| | | type: "select", |
| | | dicData: [{ |
| | |
| | | label: "姓名", |
| | | prop: "name", |
| | | searchSpan: 3, |
| | | searchLabelWidth: 66, |
| | | searchLabelWidth: 46, |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | |
| | | parent: false, |
| | | prop: "address", |
| | | display: false, |
| | | searchLabelWidth: 66, |
| | | searchLabelWidth: 46, |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, |
| | |
| | | prop: "category", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | hide: true, |
| | | width: 100, |
| | | }, |
| | |
| | | prop: 'processDefinitionName', |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 100, |
| | | }, |
| | | { |
| | | label: '当前步骤', |
| | |
| | | prop: "category", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | hide: true, |
| | | width: 100, |
| | | }, |
| | |
| | | prop: "category", |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | }, |
| | | { |
| | | label: '流程标识', |