diff --git a/src/components/action_button/index.vue b/src/components/action_button/index.vue index be2be56e6f7c1b75fc3523bd6f96b1cea326d3d6..818e4ca63f604b216da9d72984a142a1ad1f7173 100644 --- a/src/components/action_button/index.vue +++ b/src/components/action_button/index.vue @@ -50,20 +50,38 @@ export default { }, row: Object, }, + watch: { + row() { + this.init(); + }, + }, + data() { + return { + buttonsArr: [], + }; + }, + created() { + this.init(); + }, computed: { basicBtns() { - return this.buttons.length > 3 ? this.buttons.slice(0, 3) : this.buttons; + return this.buttonsArr.length > 3 ? this.buttonsArr.slice(0, 3) : this.buttonsArr; }, moreBtns() { - return this.buttons.length > 3 ? this.buttons.slice(3) : []; + return this.buttonsArr.length > 3 ? this.buttonsArr.slice(3) : []; }, }, - methods: { getDelUrl(url, row) { if (isFunction(url)) return url(row); return url; }, + init() { + this.buttons.map((i) => { + i.__hidden__ = i.isHidden && i.isHidden(this.row); + }); + this.buttonsArr = this.buttons.filter((i) => !i.__hidden__); + }, }, }; diff --git a/src/components/popconfirm_delete/index.vue b/src/components/popconfirm_delete/index.vue index 89b6993b115a4fa6696125098cd24c90b8584205..b478ee47a84c2b5da9761425088d361a5cacfe9d 100644 --- a/src/components/popconfirm_delete/index.vue +++ b/src/components/popconfirm_delete/index.vue @@ -6,11 +6,11 @@ diff --git a/src/pages/system/view/organization/usermanagement/form.vue b/src/pages/system/view/organization/usermanagement/form.vue index 7b8a493fe11a49ccf06d45305af2b6c0f8c476b6..6c75f9139a3a3325b832529a9a55b1e5ca16ee93 100644 --- a/src/pages/system/view/organization/usermanagement/form.vue +++ b/src/pages/system/view/organization/usermanagement/form.vue @@ -1,30 +1,70 @@