From 0411b19ca8bd385338f313433c63d8d027398237 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 09 Jan 2024 18:53:50 +0800
Subject: [PATCH] 共治力量下页面调整
---
src/views/property/partyOrganization.vue | 912 ++++++++++++++++++++++++++++----------------------------
1 files changed, 457 insertions(+), 455 deletions(-)
diff --git a/src/views/property/partyOrganization.vue b/src/views/property/partyOrganization.vue
index 4475df4..90983f9 100644
--- a/src/views/property/partyOrganization.vue
+++ b/src/views/property/partyOrganization.vue
@@ -1,478 +1,480 @@
<template>
- <basic-container>
- <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" v-model="form"
- :permission="permissionList" @search-change="searchChange" @search-reset="searchReset"
- @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
- :before-open="beforeOpen"
- @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
- @refresh-change="refreshChange" @on-load="onLoad">
+ <basic-container>
+ <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" v-model="form"
+ :permission="permissionList" @search-change="searchChange" @search-reset="searchReset" @row-update="rowUpdate"
+ @row-save="rowSave" @row-del="rowDel" :before-open="beforeOpen" @selection-change="selectionChange"
+ @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
- <template slot-scope="{row}" slot="phone">
- <el-button type="text" @click="showStringDispose(row, 'phoneNumberflag')">
- {{ textDispose(row, 'phoneNumberflag', 'phone') }}
- </el-button>
- </template>
+ <template slot-scope="{row, size}" slot="phone">
+ <el-button :size="size" type="text" @click="showStringDispose(row, 'phoneNumberflag')">
+ {{ textDispose(row, 'phoneNumberflag', 'phone') }}
+ </el-button>
+ </template>
- <template slot-scope="scope" slot="menu">
- <el-button type="text" icon="el-icon-circle-plus-outline" size="small"
- @click="manageMember(scope.row)">党成员
- </el-button>
- </template>
- </avue-crud>
+ <template slot-scope="{row, size, index}" slot="menu">
+ <el-button :size="size" type="text" icon="el-icon-circle-plus-outline" @click="manageMember(row)">党成员
+ </el-button>
+ </template>
+ </avue-crud>
- <el-drawer title="党成员" size="60%" append-to-body :visible.sync="memberFlag" :direction="'rtl'">
- <PartyOrganizationMember ref="partyOrganizationMember" />
- </el-drawer>
-
- </basic-container>
+ <el-drawer title="党成员" size="60%" append-to-body :visible.sync="memberFlag" :direction="'rtl'">
+ <PartyOrganizationMember ref="partyOrganizationMember" />
+ </el-drawer>
+ </basic-container>
</template>
<script>
-import {mapGetters} from "vuex";
-import {getDetail,getList,add,update,remove} from "@/api/partyOrganization/partyOrganization";
-import website from "@/config/website";
-import func from "@/util/func";
-import {validatePhone} from "@/util/validate";
-import PartyOrganizationMember from "@/views/property/components/partyOrganizationMember.vue";
+import { mapGetters } from "vuex"
+import { getDetail, getList, add, update, remove } from "@/api/partyOrganization/partyOrganization"
+import website from "@/config/website"
+import func from "@/util/func"
+import { validatePhone } from "@/util/validate"
+import PartyOrganizationMember from "@/views/property/components/partyOrganizationMember.vue"
const searchSpan = 4
export default {
- name: "partyOrganization",
- components: {PartyOrganizationMember},
- data () {
- return {
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- },
- datetime: "",
- selectionList: [],
- memberFlag: false,
- option: {
- // menu: false,
- // addBtn: false,
- border: true,
- index: true,
- selection: false,
- height: "auto",
- calcHeight: 54,
- dialogWidth: 950,
- tip: false,
- searchShow: true,
- searchMenuSpan: 3,
- //stripe:true,
- viewBtn: true,
- excelBtn: true,
- dialogClickModal: false,
- column: [
- {
- parent: false,
- label: "所属社区",
- prop: "areaId",
- search: true,
- searchSpan: searchSpan,
- width: 150,
- type: "tree",
- dicUrl: "/api/blade-system/region/tree",
- props: {
- label: "name",
- value: "id"
+ name: "partyOrganization",
+ components: { PartyOrganizationMember },
+ data () {
+ return {
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
},
- rules: [
- {
- required: true,
- message: "请选择所属社区",
- trigger: ["blur","change"]
- },
- ],
- },
+ datetime: "",
+ selectionList: [],
+ memberFlag: false,
+ option: {
+ labelWidth: 120,
+ searchLabelWidth: 96,
+ searchShow: true,
+ searchMenuSpan: 3,
+ menuWidth: 280,
- {
- label: "组织名称",
- prop: "organizationName",
- searchSpan: searchSpan,
- search: true,
- rules: [{
- required: true,
- message: "请输入组织名称",
- trigger: ["blur","change"]
- },],
- },
+ // menu: false,
+ // addBtn: false,
+ border: true,
+ index: true,
+ selection: false,
+ height: "auto",
+ calcHeight: 54,
+ dialogWidth: 950,
+ tip: false,
+ //stripe:true,
+ viewBtn: true,
+ excelBtn: true,
+ dialogClickModal: false,
+ column: [
+ {
+ parent: false,
+ label: "所属社区",
+ prop: "areaId",
+ search: true,
+ searchSpan: searchSpan,
+ width: 150,
+ type: "tree",
+ dicUrl: "/api/blade-system/region/tree",
+ props: {
+ label: "name",
+ value: "id"
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择所属社区",
+ trigger: ["blur", "change"]
+ },
+ ],
+ },
- {
- label: "组织类型",
- prop: "organizationType",
- checkStrictly: true,
- hide:true,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=organizationType",
- props: {
- label: "dictValue",
- value: "dictKey",
+ {
+ label: "组织名称",
+ prop: "organizationName",
+ searchSpan: searchSpan,
+ search: true,
+ rules: [{
+ required: true,
+ message: "请输入组织名称",
+ trigger: ["blur", "change"]
+ },],
+ },
+
+ {
+ label: "组织类型",
+ prop: "organizationType",
+ checkStrictly: true,
+ hide: true,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=organizationType",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ type: "select",
+ rules: [{
+ required: true,
+ message: "请选择组织类型",
+ trigger: ["blur", "change"]
+ },],
+ },
+
+ {
+ label: "支部类型",
+ prop: "branchType",
+ checkStrictly: true,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=branchType",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ type: "select",
+ rules: [{
+ required: true,
+ message: "请选择支部类型",
+ trigger: ["blur", "change"]
+ },],
+ },
+
+ {
+ width: 110,
+ label: "负责人",
+ prop: "chargePerson",
+ rules: [{
+ required: true,
+ message: "请输入负责人",
+ trigger: ["blur", "change"]
+ }]
+ },
+ {
+ width: 110,
+ label: "姓名",
+ prop: "name",
+ searchSpan: searchSpan,
+ searchLabelWidth: 66,
+ searchPlaceholder: "请输入负责人或党成员",
+ hide: true,
+ display: false,
+ search: true
+ },
+ {
+ width: 120,
+ label: "手机号",
+ prop: "phone",
+ slot: true,
+ rules: [{
+ required: true,
+ message: "请输入手机号",
+ validator: validatePhone,
+ trigger: ["blur", "change"],
+ }]
+ },
+
+ {
+ label: "成立时间",
+ prop: "establishmentDate",
+ hide: true,
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ row: true,
+ rules: [{
+ required: true,
+ message: "请选择成立时间",
+ trigger: ["blur", "change"]
+ }]
+ },
+
+ {
+ label: "图片",
+ prop: "urls",
+ hide: true,
+ type: "upload",
+ listType: "picture-img",
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ propsHttp: {
+ res: "data",
+ name: 'name',
+ url: "link",
+ },
+ row: true
+ },
+ {
+ label: "排序",
+ prop: "sort",
+ hide: true,
+ type: 'number',
+ value: 999,
+ rules: [{
+ required: true,
+ message: "请输入排序",
+ trigger: ["blur", "change"],
+ },],
+ },
+
+ {
+ label: "状态",
+ hide: true,
+ prop: "status",
+ type: 'radio',
+ button: true,
+ activeColor: "#13ce66",
+ inactiveColor: "#ccc",
+ dicData: [
+ {
+ label: "正常",
+ value: 1
+ },
+ {
+ label: "关闭",
+ value: 2
+ },
+
+ ],
+ value: 1,
+ rules: [{
+ required: true,
+ message: "请输入排序",
+ trigger: ["blur", "change"]
+ },],
+ },
+
+ {
+ label: "简介",
+ prop: "profile",
+ span: 24,
+ component: "AvueUeditor",
+ options: {
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ props: {
+ res: "data",
+ url: "link",
+ },
+ },
+ hide: true,
+ minRows: 6,
+ },
+
+ {
+ label: "党成员数",
+ prop: "memberCount",
+ display: false,
+ },
+ ],
},
- type: "select",
- rules: [{
- required: true,
- message: "请选择组织类型",
- trigger: ["blur","change"]
- }, ],
- },
-
- {
- label: "支部类型",
- prop: "branchType",
- checkStrictly: true,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=branchType",
- props: {
- label: "dictValue",
- value: "dictKey",
- },
- type: "select",
- rules: [{
- required: true,
- message: "请选择支部类型",
- trigger: ["blur","change"]
- }, ],
- },
-
- {
- label: "负责人",
- prop: "chargePerson",
- rules: [{
- required: true,
- message: "请输入负责人",
- trigger: ["blur","change"]
- }]
- },
- {
- label: "姓名",
- prop: "name",
- searchSpan: searchSpan,
- searchPlaceholder:"请输入负责人或党成员",
- hide:true,
- display: false,
- search: true
- },
- {
- label: "手机号",
- prop: "phone",
- slot: true,
- rules: [{
- required: true,
- message: "请输入手机号",
- validator: validatePhone,
- trigger: ["blur","change"],
- }]
- },
-
- {
- label: "成立时间",
- prop: "establishmentDate",
- hide:true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- row:true,
- rules: [{
- required: true,
- message: "请选择成立时间",
- trigger: ["blur","change"]
- }]
- },
-
- {
- label: "图片",
- prop: "urls",
- hide:true,
- type: "upload",
- listType: "picture-img",
- action: "/api/blade-resource/oss/endpoint/put-file",
- propsHttp: {
- res: "data",
- name: 'name',
- url: "link",
- },
- row:true
- },
- {
- label: "排序",
- prop: "sort",
- hide:true,
- type: 'number',
- value:999,
- rules: [{
- required: true,
- message: "请输入排序",
- trigger: ["blur","change"],
- },],
- },
-
- {
- label: "状态",
- hide:true,
- prop: "status",
- type: 'radio',
- button:true,
- activeColor: "#13ce66",
- inactiveColor: "#ccc",
- dicData: [
- {
- label: "正常",
- value: 1
- },
- {
- label: "关闭",
- value:2
- },
-
- ],
- value:1,
- rules: [{
- required: true,
- message: "请输入排序",
- trigger: ["blur","change"]
- },],
- },
-
- {
- label: "简介",
- prop: "profile",
- span:24,
- component: "AvueUeditor",
- options: {
- action: "/api/blade-resource/oss/endpoint/put-file",
- props: {
- res: "data",
- url: "link",
- },
- },
- hide: true,
- minRows: 6,
- },
-
- {
- label: "党成员数",
- prop: "memberCount",
- display:false,
- },
- ],
- },
- data: [],
- }
- },
- watch: {},
- computed: {
- ...mapGetters(["permission", "userInfo"]),
- permissionList () {
- return {
- addBtn: this.vaildData(this.permission.gridWorkLog_add, true),
- viewBtn: this.vaildData(this.permission.gridWorkLog_view, true),
- delBtn: this.vaildData(this.permission.gridWorkLog_delete, true),
- editBtn: this.vaildData(this.permission.gridWorkLog_edit, true),
- }
- },
- ids () {
- let ids = []
- this.selectionList.forEach((ele) => {
- ids.push(ele.id)
- })
- return ids.join(",")
- },
- textDispose () {
- return (row, flag, type) => {
- if (row[flag] || row[type] == null) {
- return row[type]
- } else {
- if (type == 'idCard') {
- return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
- } else {
- return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
- }
+ data: [],
}
- }
},
- },
- methods: {
- showStringDispose (row, type) {
- row[type] = !row[type]
- },
- manageMember (row) {
- this.memberFlag = true
- var that = this
- this.$nextTick(() => {
- that.$refs.partyOrganizationMember.init(row)
- })
- },
- rowSave (row, done, loading) {
- row.urls = func.join(row.urls)
- if (row.urls.length > 0) {
- var urls = []
- var split = row.urls.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.urls = urls.join(",")
- }
- add(row).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
- },
- rowUpdate (row, index, done, loading) {
- if (row.urls.length > 0) {
- var urls = []
- var split = row.urls.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.urls = urls.join(",")
- }
- update(row).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
- },
- rowDel (row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(row.id)
- })
- .then(() => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- })
- },
- // handleDelete() {
- // if (this.selectionList.length === 0) {
- // this.$message.warning("请选择至少一条数据");
- // return;
- // }
- // this.$confirm("确定将选择数据删除?", {
- // confirmButtonText: "确定",
- // cancelButtonText: "取消",
- // type: "warning",
- // })
- // .then(() => {
- // return remove(this.ids);
- // })
- // .then(() => {
- // this.onLoad(this.page);
- // this.$message({
- // type: "success",
- // message: "操作成功!",
- // });
- // this.$refs.crud.toggleSelection();
- // });
- // },
- beforeOpen (done, type) {
- if (["edit", "view"].includes(type)) {
- getDetail(this.form.id).then((res) => {
- this.form = res.data.data
- const column = this.findObject(this.option.column, "principalId")
- let arr = []
- this.form.urls = website.minioUrl + this.form.urls
- arr.push(this.form.areaId)
- column.defaultExpandedKeys = arr
- })
- }
- // con
- done()
- },
- searchReset () {
- this.query = {}
- this.onLoad(this.page)
- },
- searchChange (params, done) {
- this.query = params
- this.page.currentPage = 1
- this.onLoad(this.page, params)
- done()
- },
- selectionChange (list) {
- this.selectionList = list
- },
- selectionClear () {
- this.selectionList = []
- this.$refs.crud.toggleSelection()
- },
-
- currentChange (currentPage) {
- this.page.currentPage = currentPage
- },
- sizeChange (pageSize) {
- this.page.pageSize = pageSize
- },
- refreshChange () {
- this.onLoad(this.page, this.query)
- },
- onLoad (page, params = {}) {
- this.loading = true
-
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
- const data = {
- ...res.data.data,
- records: res.data.data.records.map(item => {
+ watch: {},
+ computed: {
+ ...mapGetters(["permission", "userInfo"]),
+ permissionList () {
return {
- ...item,
- 'phoneNumberflag': false,
- 'idCardflag': false
+ addBtn: this.vaildData(this.permission.gridWorkLog_add, true),
+ viewBtn: this.vaildData(this.permission.gridWorkLog_view, true),
+ delBtn: this.vaildData(this.permission.gridWorkLog_delete, true),
+ editBtn: this.vaildData(this.permission.gridWorkLog_edit, true),
}
- })
- }
-
- this.page.total = data.total
- this.data = data.records.map(item => {
- if (item.imageUrl && item.imageUrl.length > 0) {
- var urls = []
- var names = item.imageUrl.split(",")
- names.forEach(name => {
- urls.push(website.minioUrl + name)
+ },
+ ids () {
+ let ids = []
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id)
})
- item.imageUrl = urls.join(",")
- }
+ return ids.join(",")
+ },
+ textDispose () {
+ return (row, flag, type) => {
+ if (row[flag] || row[type] == null) {
+ return row[type]
+ } else {
+ if (type == 'idCard') {
+ return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+ } else {
+ return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+ }
+ }
+ }
+ },
+ },
+ methods: {
+ showStringDispose (row, type) {
+ row[type] = !row[type]
+ },
+ manageMember (row) {
+ this.memberFlag = true
+ var that = this
+ this.$nextTick(() => {
+ that.$refs.partyOrganizationMember.init(row)
+ })
+ },
+ rowSave (row, done, loading) {
+ row.urls = func.join(row.urls)
+ if (row.urls.length > 0) {
+ var urls = []
+ var split = row.urls.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.urls = urls.join(",")
+ }
+ add(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ rowUpdate (row, index, done, loading) {
+ if (row.urls.length > 0) {
+ var urls = []
+ var split = row.urls.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.urls = urls.join(",")
+ }
+ update(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ rowDel (row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ })
+ },
+ // handleDelete() {
+ // if (this.selectionList.length === 0) {
+ // this.$message.warning("请选择至少一条数据");
+ // return;
+ // }
+ // this.$confirm("确定将选择数据删除?", {
+ // confirmButtonText: "确定",
+ // cancelButtonText: "取消",
+ // type: "warning",
+ // })
+ // .then(() => {
+ // return remove(this.ids);
+ // })
+ // .then(() => {
+ // this.onLoad(this.page);
+ // this.$message({
+ // type: "success",
+ // message: "操作成功!",
+ // });
+ // this.$refs.crud.toggleSelection();
+ // });
+ // },
+ beforeOpen (done, type) {
+ if (["edit", "view"].includes(type)) {
+ getDetail(this.form.id).then((res) => {
+ this.form = res.data.data
+ const column = this.findObject(this.option.column, "principalId")
+ let arr = []
+ this.form.urls = website.minioUrl + this.form.urls
+ arr.push(this.form.areaId)
+ column.defaultExpandedKeys = arr
+ })
+ }
+ // con
+ done()
+ },
+ searchReset () {
+ this.query = {}
+ this.onLoad(this.page)
+ },
+ searchChange (params, done) {
+ this.query = params
+ this.page.currentPage = 1
+ this.onLoad(this.page, params)
+ done()
+ },
+ selectionChange (list) {
+ this.selectionList = list
+ },
+ selectionClear () {
+ this.selectionList = []
+ this.$refs.crud.toggleSelection()
+ },
- return item
- })
+ currentChange (currentPage) {
+ this.page.currentPage = currentPage
+ },
+ sizeChange (pageSize) {
+ this.page.pageSize = pageSize
+ },
+ refreshChange () {
+ this.onLoad(this.page, this.query)
+ },
+ onLoad (page, params = {}) {
+ this.loading = true
- this.loading = false
- this.selectionClear()
- })
- }
- },
+ getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+ const data = {
+ ...res.data.data,
+ records: res.data.data.records.map(item => {
+ return {
+ ...item,
+ 'phoneNumberflag': false,
+ 'idCardflag': false
+ }
+ })
+ }
+
+ this.page.total = data.total
+ this.data = data.records.map(item => {
+ if (item.imageUrl && item.imageUrl.length > 0) {
+ var urls = []
+ var names = item.imageUrl.split(",")
+ names.forEach(name => {
+ urls.push(website.minioUrl + name)
+ })
+ item.imageUrl = urls.join(",")
+ }
+
+ return item
+ })
+
+ this.loading = false
+ this.selectionClear()
+ })
+ }
+ },
}
</script>
-<style scoped>
-
-</style>
+<style scoped></style>
--
Gitblit v1.9.3