From aa9a0ba9a9415ff94b855c163c16e99eed2a3ca0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 31 May 2022 11:03:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9A=82=E6=97=B6=20=E4=BA=BF=E8=81=94?= =?UTF-8?q?=E8=A1=97=E9=81=93=E5=92=8C=20=E5=BE=AE=E7=AC=91=E5=B4=82?= =?UTF-8?q?=E5=B1=B1=E6=98=BE=E7=A4=BA=20=E7=A4=BE=E5=8C=BA=E6=B2=BB?= =?UTF-8?q?=E7=90=86-=E3=80=8B=E5=A4=9A=E5=85=83=E5=8C=96=E8=8F=9C?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main-shuju/main-navbar.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/views/main-shuju/main-navbar.vue b/src/views/main-shuju/main-navbar.vue index 9fccdcd9c..e0715272f 100644 --- a/src/views/main-shuju/main-navbar.vue +++ b/src/views/main-shuju/main-navbar.vue @@ -164,7 +164,18 @@ export default { // this.showHeader = false; // } this.changeCustomerName(); - this.$store.state.mainShuju.menuList = window.SITE_CONFIG["menuShujuList"]; + const customerId = localStorage.getItem("customerId"); + let siteconfigElement = window.SITE_CONFIG["menuShujuList"]; + //暂时 亿联街道和 微笑崂山显示 社区治理-》多元化菜单 + if ("04c0d396e298f13e57aa5904a657eaa6" != customerId && "3fdd0380deff5b30f45376cdf995d1c1" != customerId){ + for (let index in siteconfigElement){ + if (siteconfigElement[index].id == '6'){ + let newMenuArr = siteconfigElement[index].children.filter(item =>item.id !== 'duoyuanfuwufenxi'); + siteconfigElement[index].children = newMenuArr; + } + } + } + this.$store.state.mainShuju.menuList = siteconfigElement; }, computed: {}, methods: { From 40f6b2cbe83392325e9aac5bf150f3cfec10af28 Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Tue, 31 May 2022 16:22:13 +0800 Subject: [PATCH 2/2] dd --- src/mixins/view-post.js | 167 ++++++++++++++++++ .../partymember/icpartymemberpoint.vue | 4 +- 2 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 src/mixins/view-post.js diff --git a/src/mixins/view-post.js b/src/mixins/view-post.js new file mode 100644 index 000000000..ba5b51bec --- /dev/null +++ b/src/mixins/view-post.js @@ -0,0 +1,167 @@ +import Cookies from 'js-cookie' +import qs from 'qs' +export default { + data () { + /* eslint-disable */ + return { + // 设置属性 + mixinViewModuleOptions: { + createdIsNeed: true, // 此页面是否在创建时,调用查询数据列表接口? + activatedIsNeed: false, // 此页面是否在激活(进入)时,调用查询数据列表接口? + getDataListURL: '', // 数据列表接口,API地址 + getDataListIsPage: false, // 数据列表接口,是否需要分页? + deleteURL: '', // 删除接口,API地址 + deleteIsBatch: false, // 删除接口,是否需要批量? + deleteIsBatchKey: 'id', // 删除接口,批量状态下由那个key进行标记操作?比如:pid,uid... + exportURL: '' // 导出接口,API地址 + }, + // 默认属性 + dataForm: {}, // 查询条件 + dataList: [], // 数据列表 + order: '', // 排序,asc/desc + orderField: '', // 排序,字段 + page: 1, // 当前页码 + limit: 10, // 每页数 + total: 0, // 总条数 + dataListLoading: false, // 数据列表,loading状态 + dataListSelections: [], // 数据列表,多选项 + addOrUpdateVisible: false // 新增/更新,弹窗visible状态 + } + /* eslint-enable */ + }, + created () { + if (this.mixinViewModuleOptions.createdIsNeed) { + this.query() + } + }, + activated () { + if (this.mixinViewModuleOptions.activatedIsNeed) { + this.query() + } + }, + methods: { + // 获取数据列表 + query () { + this.dataListLoading = true + const params = { + order: this.order, + orderField: this.orderField, + page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null, + limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null, + ...this.dataForm + } + this.$http.post( + this.mixinViewModuleOptions.getDataListURL, + params + ).then(({ data: res }) => { + this.dataListLoading = false + if (res.code !== 0) { + this.dataList = [] + this.total = 0 + return this.$message.error(res.msg) + } + this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data + this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0 + this.dataList.forEach(item => { + if (item.gender) { + item.gender = item.gender == '0' ? '女' : item.gender == '1' ? '男' : item.gender + } + }) + }).catch(() => { + this.dataListLoading = false + }) + }, + // 多选 + dataListSelectionChangeHandle (val) { + this.dataListSelections = val + }, + // 排序 + dataListSortChangeHandle (data) { + if (!data.order || !data.prop) { + this.order = '' + this.orderField = '' + return false + } + this.order = data.order.replace(/ending$/, '') + this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase() + this.query() + }, + // 分页, 每页条数 + pageSizeChangeHandle (val) { + this.page = 1 + this.limit = val + this.query() + }, + // 分页, 当前页 + pageCurrentChangeHandle (val) { + this.page = val + this.query() + }, + getDataList: function () { + this.page = 1 + this.query() + }, + // 新增 / 修改 + addOrUpdateHandle (id) { + this.addOrUpdateVisible = true + this.$nextTick(() => { + this.$refs.addOrUpdate.dataForm.id = id + this.$refs.addOrUpdate.init() + }) + }, + // 删除 + deleteHandle (id) { + if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) { + return this.$message({ + message: this.$t('prompt.deleteBatch'), + type: 'warning', + duration: 500 + }) + } + this.$confirm(this.$t('prompt.info', { 'handle': this.$t('delete') }), this.$t('prompt.title'), { + confirmButtonText: this.$t('confirm'), + cancelButtonText: this.$t('cancel'), + type: 'warning' + }).then(() => { + this.$http.delete( + `${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`, + this.mixinViewModuleOptions.deleteIsBatch ? { + 'data': id ? [id] : this.dataListSelections.map(item => item[this.mixinViewModuleOptions.deleteIsBatchKey]) + } : {} + ).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.$message({ + message: this.$t('prompt.success'), + type: 'success', + duration: 500, + onClose: () => { + this.query() + } + }) + }).catch(() => {}) + }).catch(() => {}) + }, + // 导出 + exportHandle () { + var params = qs.stringify({ + 'token': localStorage.getItem('token'), + ...this.dataForm + }) + window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}` + }, + // 时间段控件取值变化事件-清空一个其他都清空 + changeTime (dateValue) { + var startTimeIsNull = this.dataForm.startTime === '' || this.dataForm.startTime === 'null' || this.dataForm.startTime === null + var endTimeIsNull = this.dataForm.endTime === '' || this.dataForm.endTime === 'null' || this.dataForm.endTime === null + if (dateValue === null || dateValue === '' || dateValue === 'null') { + this.dataForm.startTime = '' + this.dataForm.endTime = '' + } else if (startTimeIsNull || endTimeIsNull) { + this.dataForm.startTime = dateValue + this.dataForm.endTime = dateValue + } + } + } +} diff --git a/src/views/modules/partymember/icpartymemberpoint.vue b/src/views/modules/partymember/icpartymemberpoint.vue index ff99cfb9b..6180d89cb 100644 --- a/src/views/modules/partymember/icpartymemberpoint.vue +++ b/src/views/modules/partymember/icpartymemberpoint.vue @@ -183,10 +183,10 @@