Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
1884e92b5d
9
core/core-frontend/src/api/permission/organization.ts
Normal file
9
core/core-frontend/src/api/permission/organization.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import request from '@/config/axios'
|
||||
import { param } from 'jquery'
|
||||
|
||||
export const getOrganizations = params => request.post({ url: '/organization/getOrganizations', params }) // 查询企业/部门
|
||||
export const addOrganization = data => request.post({ url: '/organization/addOrganization', data }) // 新增企业/部门
|
||||
export const updateOrganizationById = data => request.post({ url: '/organization/updateOrganizationById', data }) //修改企业/部门
|
||||
export const setIsValid = params => request.post({ url: '/organization/setIsValid', params }) //设置有效状态
|
||||
export const deleteById = id => request.delete({ url: '/organization/deleteById?id=' + id }) //删除
|
||||
export const getOrganizationById = data => request.post({ url: '/organization/getOrganizationById', data })//根据id查询部门
|
8
core/core-frontend/src/api/permission/role.ts
Normal file
8
core/core-frontend/src/api/permission/role.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const listRole = params => request.post({ url: '/role/listRole', params }) // 查询角色
|
||||
export const addRole = data => request.post({ url: '/role/addRole', data }) // 新增角色
|
||||
export const updateRole = data => request.post({ url: '/role/updateRole', data }) //修改企业/部门
|
||||
export const setIsValid = params => request.post({ url: '/role/setIsvaild', params }) //设置有效状态
|
||||
export const deleteRoleById = id => request.post({ url: '/role/deleteRoleById?id=' + id }) //删除
|
||||
export const deleteRoleByIds = id => request.post({ url: '/role/deleteRoleByIds?ids=' + id }) //删除
|
8
core/core-frontend/src/api/permission/user.ts
Normal file
8
core/core-frontend/src/api/permission/user.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export const listRole = params => request.post({ url: '/role/listRole', params }) // 查询角色
|
||||
export const addRole = data => request.post({ url: '/role/addRole', data }) // 新增角色
|
||||
export const updateRole = data => request.post({ url: '/role/updateRole', data }) //修改企业/部门
|
||||
export const setIsValid = params => request.post({ url: '/role/setIsvaild', params }) //设置有效状态
|
||||
export const deleteRoleById = id => request.post({ url: '/role/deleteRoleById?id=' + id }) //删除
|
||||
export const deleteRoleByIds = id => request.post({ url: '/role/deleteRoleByIds?ids=' + id }) //删除
|
17
core/core-frontend/src/assets/perission_role_blue.svg
Normal file
17
core/core-frontend/src/assets/perission_role_blue.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="14px" height="16px" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<mask fill="white" id="clip1">
|
||||
<path d="M 7.00000002051107 1.20490762311076 L 1.1666667076884 3.34846988792694 L 1.1666667076884 7.05457622091785 C 1.16683035500165 9.22011349898006 2.23841542141967 11.2548604854877 4.04950002627538 12.5285573274355 L 7.00000002051107 14.6044281391587 L 9.950500014747 12.5285573274355 C 11.7615846196027 11.2548604854877 12.8331696860207 9.22011349898006 12.833333333334 7.05457622091785 L 12.833333333334 3.34846988792694 L 7.00000002051107 1.20490762311076 Z M 0 7.05457622091785 L 0 2.57001833600967 L 7.00000002051107 0 L 14 2.57227470191427 L 14 7.05570441378589 C 13.9995150339868 9.58193316725237 12.749283822439 11.9554801902586 10.6365000202428 13.4412635728392 L 7.00000002051107 16 L 3.36350002077961 13.4423917657072 C 1.25005100433631 11.956140534005 -0.000261495314253863 9.58160042127119 0 7.05457622091785 Z M 9.33311460383943 6.30658580702723 C 9.33311460383943 7.55266819825866 8.28857900475857 8.56285031035824 7.00000002051107 8.56296713058447 C 5.71111685423601 8.56296714050021 4.66644793717511 7.55275080730723 4.66644793717511 6.30658580702723 C 4.66644793717511 5.0604208067472 5.71111685423601 4.05020447355423 6.99978127050739 4.05020447355423 C 8.28857900475857 4.05032130369622 9.33311460383943 5.06050341579578 9.33311460383943 6.30658580702723 Z M 7.00000002051107 7.43477648367946 C 7.64433222864676 7.43477648367946 8.16666668717733 6.92966831708296 8.16666668717733 6.30658581694297 C 8.16666668717733 5.68350331680296 7.64433222864676 5.17839515020646 7.00000002051107 5.17839515020646 C 6.35566781237561 5.17839515020646 5.83333335384505 5.68350331680296 5.83333335384505 6.30658581694297 C 5.83333335384505 6.92966831708296 6.35566781237561 7.43477648367946 7.00000002051107 7.43477648367946 Z M 6.41666669743213 8.56296713058447 C 6.41666669743213 8.18690358161615 6.61111113845852 7.99887180713196 7.00000002051107 7.99887180713196 C 7.38888890256385 7.99887180713196 7.58333334359025 8.18690358161615 7.58333334359025 8.56296713058447 L 7.58333334359025 11.4556480120751 C 7.58333334359025 11.8317115610434 7.38888890256385 12.0197433355276 7.00000002051107 12.0197433355276 C 6.61111113845852 12.0197433355276 6.41666669743213 11.8317115610434 6.41666669743213 11.4556480120751 L 6.41666669743213 8.56296713058447 Z M 8.16666668717733 9.45536596385807 C 8.55555556923011 9.45536596385807 8.7500000102565 9.64339773834223 8.7500000102565 10.0194612873106 C 8.7500000102565 10.3955248362789 8.55555556923011 10.5835566107631 8.16666668717733 10.5835566107631 L 7.05833334461606 10.5835566107631 C 6.66944446256328 10.5835566107631 6.47500002153688 10.3955248362789 6.47500002153688 10.0194612873106 C 6.47500002153688 9.64339773834223 6.66944446256328 9.45536596385807 7.05833334461606 9.45536596385807 L 8.16666668717733 9.45536596385807 Z " fill-rule="evenodd" />
|
||||
</mask>
|
||||
</defs>
|
||||
<g transform="matrix(1 0 0 1 -1489 -15 )">
|
||||
<path d="M 7.00000002051107 1.20490762311076 L 1.1666667076884 3.34846988792694 L 1.1666667076884 7.05457622091785 C 1.16683035500165 9.22011349898006 2.23841542141967 11.2548604854877 4.04950002627538 12.5285573274355 L 7.00000002051107 14.6044281391587 L 9.950500014747 12.5285573274355 C 11.7615846196027 11.2548604854877 12.8331696860207 9.22011349898006 12.833333333334 7.05457622091785 L 12.833333333334 3.34846988792694 L 7.00000002051107 1.20490762311076 Z M 0 7.05457622091785 L 0 2.57001833600967 L 7.00000002051107 0 L 14 2.57227470191427 L 14 7.05570441378589 C 13.9995150339868 9.58193316725237 12.749283822439 11.9554801902586 10.6365000202428 13.4412635728392 L 7.00000002051107 16 L 3.36350002077961 13.4423917657072 C 1.25005100433631 11.956140534005 -0.000261495314253863 9.58160042127119 0 7.05457622091785 Z M 9.33311460383943 6.30658580702723 C 9.33311460383943 7.55266819825866 8.28857900475857 8.56285031035824 7.00000002051107 8.56296713058447 C 5.71111685423601 8.56296714050021 4.66644793717511 7.55275080730723 4.66644793717511 6.30658580702723 C 4.66644793717511 5.0604208067472 5.71111685423601 4.05020447355423 6.99978127050739 4.05020447355423 C 8.28857900475857 4.05032130369622 9.33311460383943 5.06050341579578 9.33311460383943 6.30658580702723 Z M 7.00000002051107 7.43477648367946 C 7.64433222864676 7.43477648367946 8.16666668717733 6.92966831708296 8.16666668717733 6.30658581694297 C 8.16666668717733 5.68350331680296 7.64433222864676 5.17839515020646 7.00000002051107 5.17839515020646 C 6.35566781237561 5.17839515020646 5.83333335384505 5.68350331680296 5.83333335384505 6.30658581694297 C 5.83333335384505 6.92966831708296 6.35566781237561 7.43477648367946 7.00000002051107 7.43477648367946 Z M 6.41666669743213 8.56296713058447 C 6.41666669743213 8.18690358161615 6.61111113845852 7.99887180713196 7.00000002051107 7.99887180713196 C 7.38888890256385 7.99887180713196 7.58333334359025 8.18690358161615 7.58333334359025 8.56296713058447 L 7.58333334359025 11.4556480120751 C 7.58333334359025 11.8317115610434 7.38888890256385 12.0197433355276 7.00000002051107 12.0197433355276 C 6.61111113845852 12.0197433355276 6.41666669743213 11.8317115610434 6.41666669743213 11.4556480120751 L 6.41666669743213 8.56296713058447 Z M 8.16666668717733 9.45536596385807 C 8.55555556923011 9.45536596385807 8.7500000102565 9.64339773834223 8.7500000102565 10.0194612873106 C 8.7500000102565 10.3955248362789 8.55555556923011 10.5835566107631 8.16666668717733 10.5835566107631 L 7.05833334461606 10.5835566107631 C 6.66944446256328 10.5835566107631 6.47500002153688 10.3955248362789 6.47500002153688 10.0194612873106 C 6.47500002153688 9.64339773834223 6.66944446256328 9.45536596385807 7.05833334461606 9.45536596385807 L 8.16666668717733 9.45536596385807 Z " fill-rule="nonzero" fill="#0089ff" stroke="none" transform="matrix(1 0 0 1 1489 15 )" />
|
||||
<path d="M 7.00000002051107 1.20490762311076 L 1.1666667076884 3.34846988792694 L 1.1666667076884 7.05457622091785 C 1.16683035500165 9.22011349898006 2.23841542141967 11.2548604854877 4.04950002627538 12.5285573274355 L 7.00000002051107 14.6044281391587 L 9.950500014747 12.5285573274355 C 11.7615846196027 11.2548604854877 12.8331696860207 9.22011349898006 12.833333333334 7.05457622091785 L 12.833333333334 3.34846988792694 L 7.00000002051107 1.20490762311076 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 0 7.05457622091785 L 0 2.57001833600967 L 7.00000002051107 0 L 14 2.57227470191427 L 14 7.05570441378589 C 13.9995150339868 9.58193316725237 12.749283822439 11.9554801902586 10.6365000202428 13.4412635728392 L 7.00000002051107 16 L 3.36350002077961 13.4423917657072 C 1.25005100433631 11.956140534005 -0.000261495314253863 9.58160042127119 0 7.05457622091785 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 9.33311460383943 6.30658580702723 C 9.33311460383943 7.55266819825866 8.28857900475857 8.56285031035824 7.00000002051107 8.56296713058447 C 5.71111685423601 8.56296714050021 4.66644793717511 7.55275080730723 4.66644793717511 6.30658580702723 C 4.66644793717511 5.0604208067472 5.71111685423601 4.05020447355423 6.99978127050739 4.05020447355423 C 8.28857900475857 4.05032130369622 9.33311460383943 5.06050341579578 9.33311460383943 6.30658580702723 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 7.00000002051107 7.43477648367946 C 7.64433222864676 7.43477648367946 8.16666668717733 6.92966831708296 8.16666668717733 6.30658581694297 C 8.16666668717733 5.68350331680296 7.64433222864676 5.17839515020646 7.00000002051107 5.17839515020646 C 6.35566781237561 5.17839515020646 5.83333335384505 5.68350331680296 5.83333335384505 6.30658581694297 C 5.83333335384505 6.92966831708296 6.35566781237561 7.43477648367946 7.00000002051107 7.43477648367946 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 6.41666669743213 8.56296713058447 C 6.41666669743213 8.18690358161615 6.61111113845852 7.99887180713196 7.00000002051107 7.99887180713196 C 7.38888890256385 7.99887180713196 7.58333334359025 8.18690358161615 7.58333334359025 8.56296713058447 L 7.58333334359025 11.4556480120751 C 7.58333334359025 11.8317115610434 7.38888890256385 12.0197433355276 7.00000002051107 12.0197433355276 C 6.61111113845852 12.0197433355276 6.41666669743213 11.8317115610434 6.41666669743213 11.4556480120751 L 6.41666669743213 8.56296713058447 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 8.16666668717733 9.45536596385807 C 8.55555556923011 9.45536596385807 8.7500000102565 9.64339773834223 8.7500000102565 10.0194612873106 C 8.7500000102565 10.3955248362789 8.55555556923011 10.5835566107631 8.16666668717733 10.5835566107631 L 7.05833334461606 10.5835566107631 C 6.66944446256328 10.5835566107631 6.47500002153688 10.3955248362789 6.47500002153688 10.0194612873106 C 6.47500002153688 9.64339773834223 6.66944446256328 9.45536596385807 7.05833334461606 9.45536596385807 L 8.16666668717733 9.45536596385807 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
</g>
|
||||
</svg>
|
17
core/core-frontend/src/assets/svg/perission_role_blue.svg
Normal file
17
core/core-frontend/src/assets/svg/perission_role_blue.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="14px" height="16px" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<mask fill="white" id="clip1">
|
||||
<path d="M 7.00000002051107 1.20490762311076 L 1.1666667076884 3.34846988792694 L 1.1666667076884 7.05457622091785 C 1.16683035500165 9.22011349898006 2.23841542141967 11.2548604854877 4.04950002627538 12.5285573274355 L 7.00000002051107 14.6044281391587 L 9.950500014747 12.5285573274355 C 11.7615846196027 11.2548604854877 12.8331696860207 9.22011349898006 12.833333333334 7.05457622091785 L 12.833333333334 3.34846988792694 L 7.00000002051107 1.20490762311076 Z M 0 7.05457622091785 L 0 2.57001833600967 L 7.00000002051107 0 L 14 2.57227470191427 L 14 7.05570441378589 C 13.9995150339868 9.58193316725237 12.749283822439 11.9554801902586 10.6365000202428 13.4412635728392 L 7.00000002051107 16 L 3.36350002077961 13.4423917657072 C 1.25005100433631 11.956140534005 -0.000261495314253863 9.58160042127119 0 7.05457622091785 Z M 9.33311460383943 6.30658580702723 C 9.33311460383943 7.55266819825866 8.28857900475857 8.56285031035824 7.00000002051107 8.56296713058447 C 5.71111685423601 8.56296714050021 4.66644793717511 7.55275080730723 4.66644793717511 6.30658580702723 C 4.66644793717511 5.0604208067472 5.71111685423601 4.05020447355423 6.99978127050739 4.05020447355423 C 8.28857900475857 4.05032130369622 9.33311460383943 5.06050341579578 9.33311460383943 6.30658580702723 Z M 7.00000002051107 7.43477648367946 C 7.64433222864676 7.43477648367946 8.16666668717733 6.92966831708296 8.16666668717733 6.30658581694297 C 8.16666668717733 5.68350331680296 7.64433222864676 5.17839515020646 7.00000002051107 5.17839515020646 C 6.35566781237561 5.17839515020646 5.83333335384505 5.68350331680296 5.83333335384505 6.30658581694297 C 5.83333335384505 6.92966831708296 6.35566781237561 7.43477648367946 7.00000002051107 7.43477648367946 Z M 6.41666669743213 8.56296713058447 C 6.41666669743213 8.18690358161615 6.61111113845852 7.99887180713196 7.00000002051107 7.99887180713196 C 7.38888890256385 7.99887180713196 7.58333334359025 8.18690358161615 7.58333334359025 8.56296713058447 L 7.58333334359025 11.4556480120751 C 7.58333334359025 11.8317115610434 7.38888890256385 12.0197433355276 7.00000002051107 12.0197433355276 C 6.61111113845852 12.0197433355276 6.41666669743213 11.8317115610434 6.41666669743213 11.4556480120751 L 6.41666669743213 8.56296713058447 Z M 8.16666668717733 9.45536596385807 C 8.55555556923011 9.45536596385807 8.7500000102565 9.64339773834223 8.7500000102565 10.0194612873106 C 8.7500000102565 10.3955248362789 8.55555556923011 10.5835566107631 8.16666668717733 10.5835566107631 L 7.05833334461606 10.5835566107631 C 6.66944446256328 10.5835566107631 6.47500002153688 10.3955248362789 6.47500002153688 10.0194612873106 C 6.47500002153688 9.64339773834223 6.66944446256328 9.45536596385807 7.05833334461606 9.45536596385807 L 8.16666668717733 9.45536596385807 Z " fill-rule="evenodd" />
|
||||
</mask>
|
||||
</defs>
|
||||
<g transform="matrix(1 0 0 1 -1489 -15 )">
|
||||
<path d="M 7.00000002051107 1.20490762311076 L 1.1666667076884 3.34846988792694 L 1.1666667076884 7.05457622091785 C 1.16683035500165 9.22011349898006 2.23841542141967 11.2548604854877 4.04950002627538 12.5285573274355 L 7.00000002051107 14.6044281391587 L 9.950500014747 12.5285573274355 C 11.7615846196027 11.2548604854877 12.8331696860207 9.22011349898006 12.833333333334 7.05457622091785 L 12.833333333334 3.34846988792694 L 7.00000002051107 1.20490762311076 Z M 0 7.05457622091785 L 0 2.57001833600967 L 7.00000002051107 0 L 14 2.57227470191427 L 14 7.05570441378589 C 13.9995150339868 9.58193316725237 12.749283822439 11.9554801902586 10.6365000202428 13.4412635728392 L 7.00000002051107 16 L 3.36350002077961 13.4423917657072 C 1.25005100433631 11.956140534005 -0.000261495314253863 9.58160042127119 0 7.05457622091785 Z M 9.33311460383943 6.30658580702723 C 9.33311460383943 7.55266819825866 8.28857900475857 8.56285031035824 7.00000002051107 8.56296713058447 C 5.71111685423601 8.56296714050021 4.66644793717511 7.55275080730723 4.66644793717511 6.30658580702723 C 4.66644793717511 5.0604208067472 5.71111685423601 4.05020447355423 6.99978127050739 4.05020447355423 C 8.28857900475857 4.05032130369622 9.33311460383943 5.06050341579578 9.33311460383943 6.30658580702723 Z M 7.00000002051107 7.43477648367946 C 7.64433222864676 7.43477648367946 8.16666668717733 6.92966831708296 8.16666668717733 6.30658581694297 C 8.16666668717733 5.68350331680296 7.64433222864676 5.17839515020646 7.00000002051107 5.17839515020646 C 6.35566781237561 5.17839515020646 5.83333335384505 5.68350331680296 5.83333335384505 6.30658581694297 C 5.83333335384505 6.92966831708296 6.35566781237561 7.43477648367946 7.00000002051107 7.43477648367946 Z M 6.41666669743213 8.56296713058447 C 6.41666669743213 8.18690358161615 6.61111113845852 7.99887180713196 7.00000002051107 7.99887180713196 C 7.38888890256385 7.99887180713196 7.58333334359025 8.18690358161615 7.58333334359025 8.56296713058447 L 7.58333334359025 11.4556480120751 C 7.58333334359025 11.8317115610434 7.38888890256385 12.0197433355276 7.00000002051107 12.0197433355276 C 6.61111113845852 12.0197433355276 6.41666669743213 11.8317115610434 6.41666669743213 11.4556480120751 L 6.41666669743213 8.56296713058447 Z M 8.16666668717733 9.45536596385807 C 8.55555556923011 9.45536596385807 8.7500000102565 9.64339773834223 8.7500000102565 10.0194612873106 C 8.7500000102565 10.3955248362789 8.55555556923011 10.5835566107631 8.16666668717733 10.5835566107631 L 7.05833334461606 10.5835566107631 C 6.66944446256328 10.5835566107631 6.47500002153688 10.3955248362789 6.47500002153688 10.0194612873106 C 6.47500002153688 9.64339773834223 6.66944446256328 9.45536596385807 7.05833334461606 9.45536596385807 L 8.16666668717733 9.45536596385807 Z " fill-rule="nonzero" fill="#0089ff" stroke="none" transform="matrix(1 0 0 1 1489 15 )" />
|
||||
<path d="M 7.00000002051107 1.20490762311076 L 1.1666667076884 3.34846988792694 L 1.1666667076884 7.05457622091785 C 1.16683035500165 9.22011349898006 2.23841542141967 11.2548604854877 4.04950002627538 12.5285573274355 L 7.00000002051107 14.6044281391587 L 9.950500014747 12.5285573274355 C 11.7615846196027 11.2548604854877 12.8331696860207 9.22011349898006 12.833333333334 7.05457622091785 L 12.833333333334 3.34846988792694 L 7.00000002051107 1.20490762311076 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 0 7.05457622091785 L 0 2.57001833600967 L 7.00000002051107 0 L 14 2.57227470191427 L 14 7.05570441378589 C 13.9995150339868 9.58193316725237 12.749283822439 11.9554801902586 10.6365000202428 13.4412635728392 L 7.00000002051107 16 L 3.36350002077961 13.4423917657072 C 1.25005100433631 11.956140534005 -0.000261495314253863 9.58160042127119 0 7.05457622091785 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 9.33311460383943 6.30658580702723 C 9.33311460383943 7.55266819825866 8.28857900475857 8.56285031035824 7.00000002051107 8.56296713058447 C 5.71111685423601 8.56296714050021 4.66644793717511 7.55275080730723 4.66644793717511 6.30658580702723 C 4.66644793717511 5.0604208067472 5.71111685423601 4.05020447355423 6.99978127050739 4.05020447355423 C 8.28857900475857 4.05032130369622 9.33311460383943 5.06050341579578 9.33311460383943 6.30658580702723 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 7.00000002051107 7.43477648367946 C 7.64433222864676 7.43477648367946 8.16666668717733 6.92966831708296 8.16666668717733 6.30658581694297 C 8.16666668717733 5.68350331680296 7.64433222864676 5.17839515020646 7.00000002051107 5.17839515020646 C 6.35566781237561 5.17839515020646 5.83333335384505 5.68350331680296 5.83333335384505 6.30658581694297 C 5.83333335384505 6.92966831708296 6.35566781237561 7.43477648367946 7.00000002051107 7.43477648367946 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 6.41666669743213 8.56296713058447 C 6.41666669743213 8.18690358161615 6.61111113845852 7.99887180713196 7.00000002051107 7.99887180713196 C 7.38888890256385 7.99887180713196 7.58333334359025 8.18690358161615 7.58333334359025 8.56296713058447 L 7.58333334359025 11.4556480120751 C 7.58333334359025 11.8317115610434 7.38888890256385 12.0197433355276 7.00000002051107 12.0197433355276 C 6.61111113845852 12.0197433355276 6.41666669743213 11.8317115610434 6.41666669743213 11.4556480120751 L 6.41666669743213 8.56296713058447 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
<path d="M 8.16666668717733 9.45536596385807 C 8.55555556923011 9.45536596385807 8.7500000102565 9.64339773834223 8.7500000102565 10.0194612873106 C 8.7500000102565 10.3955248362789 8.55555556923011 10.5835566107631 8.16666668717733 10.5835566107631 L 7.05833334461606 10.5835566107631 C 6.66944446256328 10.5835566107631 6.47500002153688 10.3955248362789 6.47500002153688 10.0194612873106 C 6.47500002153688 9.64339773834223 6.66944446256328 9.45536596385807 7.05833334461606 9.45536596385807 L 8.16666668717733 9.45536596385807 Z " stroke-width="2" stroke="#0099ff" fill="none" transform="matrix(1 0 0 1 1489 15 )" mask="url(#clip1)" />
|
||||
</g>
|
||||
</svg>
|
@ -4,7 +4,8 @@ import { findApplicationById } from "@/api/application/application";
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { computed,reactive, ref, shallowRef, nextTick, watch, onMounted } from 'vue'
|
||||
import Organization from './organization/index.vue'
|
||||
|
||||
import Role from './role/index.vue'
|
||||
import User from './user/index.vue'
|
||||
const projectInfo:any =ref({})
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@ -38,6 +39,8 @@ function menuclick(name){
|
||||
</div>
|
||||
<div class="permission-rightbox">
|
||||
<Organization v-if="curmenu == '组织机构配置'" :applicationId="applicationId" />
|
||||
<Role v-if="curmenu == '系统角色配置'" :applicationId="applicationId" />
|
||||
<User v-if="curmenu == '系统用户配置'" :applicationId="applicationId" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted,reactive} from 'vue'
|
||||
import { ref, onMounted} from 'vue'
|
||||
import icon_permission_del_white from '@/assets/svg/permission_del_white.svg'
|
||||
import icon_permission_edit_white from '@/assets/svg/permission_edit_white.svg'
|
||||
import icon_permission_edit_blue from '@/assets/svg/permission_edit_blue.svg'
|
||||
@ -10,34 +10,44 @@ import icon_add from '@/assets/svg/add_white.svg'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Delete } from '@element-plus/icons-vue'
|
||||
import { ElTable } from 'element-plus'
|
||||
|
||||
import { ElTable,ElTree } from 'element-plus'
|
||||
import { getOrganizations,addOrganization,setIsValid,updateOrganizationById,deleteById,getOrganizationById } from '@/api/permission/organization'
|
||||
const props = defineProps({
|
||||
applicationId:String
|
||||
})
|
||||
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||
const treeData:any = ref([])
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
label: 'orgname'
|
||||
}
|
||||
const treeloading = ref(false);
|
||||
const hoverNodeId = ref(null);
|
||||
const currentNodeId = ref(null);
|
||||
const preventcombo = ref(false)
|
||||
const dialogVisible = ref(false);
|
||||
const title = ref('新增企业');
|
||||
const ruleForm = ref({id:'',app_id:'',orgname: '',orgcode: '',orgtype: ''});
|
||||
const ruleForm = ref();
|
||||
const ruleFormRef = ref<FormInstance>()
|
||||
const rules = ref({
|
||||
orgname: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
],
|
||||
orgcode: [
|
||||
{ required: true, message: '请输入编号', trigger: 'blur' },
|
||||
],
|
||||
})
|
||||
const queryorgname = ref('')
|
||||
const multipleTableRef = ref<InstanceType<typeof ElTable>>()
|
||||
const multipleSelection = ref([])
|
||||
const tableData = ref([{orgname:'23'}])
|
||||
const tableData = ref([])
|
||||
const tableloading = ref(false);
|
||||
const deptdialog = ref(false);
|
||||
const depttitle = ref('新增部门')
|
||||
const deptForm = ref();
|
||||
const deptFormRef = ref<FormInstance>()
|
||||
const deptrules = ref({
|
||||
orgname: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
],
|
||||
})
|
||||
const handleMouseEnter = (node) => {
|
||||
hoverNodeId.value = node.key;
|
||||
};
|
||||
@ -48,9 +58,32 @@ const submitForm = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
console.log('submit!')
|
||||
if(preventcombo.value){
|
||||
return
|
||||
}
|
||||
preventcombo.value = true
|
||||
if(ruleForm.value.id !== ''){
|
||||
updateOrganizationById(ruleForm.value).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '修改成功',
|
||||
})
|
||||
dialogVisible.value = false
|
||||
preventcombo.value = false
|
||||
gettree()
|
||||
})
|
||||
}else{
|
||||
addOrganization(ruleForm.value).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '新增成功',
|
||||
})
|
||||
dialogVisible.value = false
|
||||
preventcombo.value = false
|
||||
gettree()
|
||||
})
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
@ -60,7 +93,206 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
||||
formEl.resetFields()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const deltree = (data:any) => {
|
||||
const deptsubmitForm = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
if(preventcombo.value){
|
||||
return
|
||||
}
|
||||
preventcombo.value = true
|
||||
const params = {
|
||||
id:deptForm.value.id,
|
||||
appId:deptForm.value.appId,
|
||||
orgname: deptForm.value.orgname,
|
||||
orgcode: deptForm.value.orgcode,
|
||||
orgtype: deptForm.value.orgtype,
|
||||
parentid:deptForm.value.parentid,
|
||||
manager:deptForm.value.manager,
|
||||
description:deptForm.value.description,
|
||||
address:deptForm.value.address,
|
||||
isvaild:deptForm.value.isvaild,
|
||||
contactPhone:deptForm.value.contact_phone,
|
||||
contactPerson:deptForm.value.contact_person
|
||||
}
|
||||
if(deptForm.value.id !== ''){
|
||||
updateOrganizationById(params).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '新增成功',
|
||||
})
|
||||
deptdialog.value = false
|
||||
preventcombo.value = false
|
||||
getdept(currentNodeId.value)
|
||||
})
|
||||
}else{
|
||||
addOrganization(params).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '新增成功',
|
||||
})
|
||||
deptdialog.value = false
|
||||
preventcombo.value = false
|
||||
getdept(currentNodeId.value)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
const deptresetForm = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
formEl.resetFields()
|
||||
deptdialog.value = false
|
||||
}
|
||||
const handleSelectionChange = (val:any) => {
|
||||
multipleSelection.value = val
|
||||
}
|
||||
onMounted(() => {
|
||||
treeData.value = []
|
||||
gettree()
|
||||
})
|
||||
function gettree(){
|
||||
treeloading.value = true
|
||||
hoverNodeId.value = null
|
||||
currentNodeId.value = null
|
||||
queryorgname.value = ''
|
||||
treeRef.value!.setCurrentKey(null)
|
||||
const params = {
|
||||
appId: props.applicationId,
|
||||
orgtype:'01',
|
||||
parentid:'0',
|
||||
orgName:''
|
||||
}
|
||||
getOrganizations(params).then(res => {
|
||||
treeData.value = res.data
|
||||
treeloading.value = false
|
||||
})
|
||||
}
|
||||
function getdept(id:any){
|
||||
tableloading.value = true
|
||||
const params = {
|
||||
appId: props.applicationId,
|
||||
orgtype:'02',
|
||||
parentid:id,
|
||||
orgName:''
|
||||
}
|
||||
console.log(params,'params')
|
||||
getOrganizations(params).then(res => {
|
||||
tableData.value = res.data
|
||||
tableloading.value = false
|
||||
if(currentNodeId.value != null){
|
||||
treeRef.value!.setCurrentKey(currentNodeId.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
function querydept(){
|
||||
tableloading.value = true
|
||||
const params = {
|
||||
appId: props.applicationId,
|
||||
orgtype:'02',
|
||||
parentid:currentNodeId.value,
|
||||
orgName:queryorgname.value
|
||||
}
|
||||
getOrganizations(params).then(res => {
|
||||
tableData.value = res.data
|
||||
tableloading.value = false
|
||||
if(currentNodeId.value != null){
|
||||
treeRef.value!.setCurrentKey(currentNodeId.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
function nodeclick(data:any,node:any){
|
||||
currentNodeId.value = node.key
|
||||
getdept(data.id)
|
||||
}
|
||||
function addtree(data:any){
|
||||
ruleForm.value = {
|
||||
id:'',
|
||||
appId:props.applicationId,
|
||||
orgname: '',
|
||||
orgcode: '',
|
||||
orgtype: '01',
|
||||
parentid:'0'
|
||||
}
|
||||
title.value = '新增企业'
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function edittree(data:any){
|
||||
title.value = '修改企业'
|
||||
ruleForm.value = JSON.parse(JSON.stringify(data))
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function deltree(data:any){
|
||||
ElMessageBox.confirm(
|
||||
'确定删除该条信息吗?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
deleteById(data.id).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
})
|
||||
gettree()
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
if(currentNodeId.value != null){
|
||||
treeRef.value!.setCurrentKey(currentNodeId.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
function setisValid(row:any){
|
||||
tableloading.value = true
|
||||
const params = {
|
||||
id:row.id,
|
||||
isvaild:row.isvaild
|
||||
}
|
||||
setIsValid(params).then(res => {
|
||||
console.log(res,'res')
|
||||
if(res.code == '0'){
|
||||
getdept(currentNodeId.value)
|
||||
ElMessage.success('设置成功')
|
||||
}else{
|
||||
ElMessage.error('设置失败')
|
||||
}
|
||||
tableloading.value = false
|
||||
})
|
||||
}
|
||||
function edittable(data:any){
|
||||
depttitle.value = '修改企业'
|
||||
deptForm.value = JSON.parse(JSON.stringify(data))
|
||||
deptdialog.value = true
|
||||
}
|
||||
function deltable(row:any){
|
||||
ElMessageBox.confirm(
|
||||
'确定删除该条信息吗?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
deleteById(row.id).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
})
|
||||
getdept(currentNodeId.value)
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
})
|
||||
}
|
||||
function deltables(){
|
||||
ElMessageBox.confirm(
|
||||
'确定删除该条信息吗?',
|
||||
'提示',
|
||||
@ -71,48 +303,59 @@ const deltree = (data:any) => {
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
const arr = []
|
||||
multipleSelection.value.forEach(e => {
|
||||
arr.push(e.id)
|
||||
});
|
||||
deleteById(arr.join()).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
})
|
||||
getdept(currentNodeId.value)
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
})
|
||||
}
|
||||
const handleSelectionChange = (val:any) => {
|
||||
multipleSelection.value = val
|
||||
}
|
||||
onMounted(() => {
|
||||
treeData.value = []
|
||||
})
|
||||
function nodeclick(data:any,node:any){
|
||||
currentNodeId.value = node.key
|
||||
|
||||
}
|
||||
function addtree(data:any){
|
||||
ruleForm.value = {
|
||||
function addtable(){
|
||||
if(currentNodeId.value == '' || currentNodeId.value == null){
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '请选择企业!',
|
||||
})
|
||||
return
|
||||
}
|
||||
deptForm.value = {
|
||||
id:'',
|
||||
app_id:props.applicationId,
|
||||
appId:props.applicationId,
|
||||
orgname: '',
|
||||
orgcode: '',
|
||||
orgtype: '01'
|
||||
orgtype: '02',
|
||||
parentid:currentNodeId.value,
|
||||
manager:'',
|
||||
description:'',
|
||||
address:'',
|
||||
isvaild:'1',
|
||||
contactPhone:'',
|
||||
contactPerson:''
|
||||
}
|
||||
title.value = '新增企业'
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function edittree(data:any){
|
||||
title.value = '修改企业'
|
||||
ruleForm.value = JSON.parse(JSON.stringify(data))
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function edittable(data:any){
|
||||
}
|
||||
function deltable(data:any){
|
||||
depttitle.value = '新增部门'
|
||||
deptdialog.value = true
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
ruleFormRef.value?.resetFields();
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
function depthandleClose() {
|
||||
deptFormRef.value?.resetFields();
|
||||
deptdialog.value = false
|
||||
}
|
||||
function formatDateTime(dateTimeStr:any){
|
||||
return dateTimeStr.replace('T', ' ');
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="organization-box">
|
||||
@ -122,8 +365,8 @@ function handleClose() {
|
||||
<img src="@/assets/newimg/add.png" style="margin-right: 5px;" alt="">
|
||||
<span>新增企业</span>
|
||||
</div>
|
||||
<el-tree :data="treeData" node-key="id" :props="defaultProps"
|
||||
highlight-current default-expand-all :expand-on-click-node="false"
|
||||
<el-tree v-loading="treeloading" ref="treeRef" :data="treeData" node-key="id" :props="defaultProps"
|
||||
default-expand-all :expand-on-click-node="false" highlight-current
|
||||
@node-click="nodeclick">
|
||||
<template #default="{ node, data }">
|
||||
<div class="custom-tree-node" @mouseenter="handleMouseEnter(node)"
|
||||
@ -139,10 +382,10 @@ function handleClose() {
|
||||
</el-icon>
|
||||
</div>
|
||||
<div style="margin-left: 8px;">
|
||||
<el-icon v-if="currentNodeId === node.key" @click.stop="deltree(data)">
|
||||
<el-icon v-if="currentNodeId === node.key" @click.stop="deltree(data)" style="cursor: pointer;">
|
||||
<icon_permission_del_white class="svg-icon"/>
|
||||
</el-icon>
|
||||
<el-icon v-else @click.stop="deltree(data)">
|
||||
<el-icon v-else @click.stop="deltree(data)" style="cursor: pointer;">
|
||||
<icon_permission_del_blue class="svg-icon" />
|
||||
</el-icon>
|
||||
</div>
|
||||
@ -155,41 +398,48 @@ function handleClose() {
|
||||
<div class="querybox">
|
||||
<div>
|
||||
<el-input v-model="queryorgname" placeholder="请输入部门名称" style="width: 200px;margin-right: 10px;" />
|
||||
<el-button type="primary" style="min-width: 50px;">搜索</el-button>
|
||||
<el-button type="primary" style="min-width: 50px;" @click="querydept">搜索</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" style="min-width: 50px;">
|
||||
<el-button type="primary" style="min-width: 50px;" @click="addtable">
|
||||
<el-icon style="margin-right: 3px;">
|
||||
<icon_add class="svg-icon" />
|
||||
</el-icon>新增
|
||||
</el-button>
|
||||
<el-button :type="tableData.length>0?'primary':''" :disabled="tableData.length>0?false:true" style="min-width: 50px;">
|
||||
<el-button :type="multipleSelection.length>0?'primary':''" :disabled="multipleSelection.length>0?false:true" @click="deltables" style="min-width: 50px;">
|
||||
<el-icon style="margin-right: 3px;"><Delete /></el-icon>删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="tableloading" ref="multipleTableRef" :data="tableData" border style="width: 100%"
|
||||
@selection-change="handleSelectionChange" height="calc(100vh - 175px)">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="orgcode" label="部门编号"/>
|
||||
<el-table-column prop="orgcode" label="部门编号" width="90"/>
|
||||
<el-table-column prop="orgname" label="部门名称"/>
|
||||
<el-table-column prop="manager" label="负责人"/>
|
||||
<el-table-column prop="address" label="联系信息"/>
|
||||
<el-table-column prop="description" label="部门描述"/>
|
||||
<el-table-column prop="contact_person" label="联系人"/>
|
||||
<el-table-column prop="contact_phone" label="联系电话"/>
|
||||
<!-- <el-table-column prop="address" label="联系地址"/> -->
|
||||
<el-table-column prop="isvaild" label="是否有效" width="110">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.isvaild" style="margin-right: 10px;"/>
|
||||
<el-switch v-model="scope.row.isvaild" active-value="1" inactive-value="0" style="margin-right: 10px;" @change="setisValid(scope.row)"/>
|
||||
<span v-if="scope.row.isvaild == '1'" style="color: #0089ff;font-size: 14px;">有效</span>
|
||||
<span v-else-if="scope.row.isvaild == '0'" style="color: #bbbfc4;font-size: 14px;">无效</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lastmodifier" label="最近修改者"/>
|
||||
<el-table-column prop="lastmodifydate" label="最近修改日期"/>
|
||||
<el-table-column prop="lastmodifydate" label="最近修改日期" width="170">
|
||||
<template #default="scope">
|
||||
<span>{{formatDateTime(scope.row.lastmodifydate)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="80">
|
||||
<template #default="scope">
|
||||
<el-icon style="font-size: 16px;margin-right: 18px;" @click="edittable(scope.row)">
|
||||
<el-icon style="font-size: 16px;margin-right: 18px;cursor: pointer;" @click="edittable(scope.row)">
|
||||
<permission_table_edit_blue class="svg-icon"/>
|
||||
</el-icon>
|
||||
<el-icon style="font-size: 16px;" @click="deltable(scope.row)">
|
||||
<el-icon style="font-size: 16px;cursor: pointer;" @click="deltable(scope.row)">
|
||||
<permission_table_del_blue class="svg-icon"/>
|
||||
</el-icon>
|
||||
</template>
|
||||
@ -197,12 +447,12 @@ function handleClose() {
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" :title="title" width="30%" :before-close="handleClose">
|
||||
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="60px" class="demo-ruleForm">
|
||||
<el-form-item label="编号" prop="orgcode">
|
||||
<el-input v-model="ruleForm.orgcode" />
|
||||
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="80px" class="demo-ruleForm">
|
||||
<el-form-item label="企业编号" prop="orgcode">
|
||||
<el-input v-model="ruleForm.orgcode" disabled placeholder="系统自动生成" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="orgname">
|
||||
<el-input v-model="ruleForm.orgname" />
|
||||
<el-form-item label="企业名称" prop="orgname">
|
||||
<el-input v-model="ruleForm.orgname" placeholder="请输入企业名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@ -212,6 +462,37 @@ function handleClose() {
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="deptdialog" :title="depttitle" width="30%" :before-close="depthandleClose">
|
||||
<el-form ref="deptFormRef" :model="deptForm" :rules="deptrules" label-width="80px" class="demo-ruleForm">
|
||||
<el-form-item label="部门编号" prop="orgcode">
|
||||
<el-input v-model="deptForm.orgcode" disabled placeholder="系统自动生成" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门名称" prop="orgname">
|
||||
<el-input v-model="deptForm.orgname" placeholder="请输入部门名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="manager">
|
||||
<el-input v-model="deptForm.manager" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门描述" prop="description">
|
||||
<el-input type="textarea" :rows="4" v-model="deptForm.description" placeholder="请输入部门描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contact_person">
|
||||
<el-input v-model="deptForm.contact_person" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="contact_phone">
|
||||
<el-input v-model="deptForm.contact_phone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系地址" prop="address">
|
||||
<el-input v-model="deptForm.address" placeholder="请输入联系地址" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="deptresetForm(deptFormRef)">取消</el-button>
|
||||
<el-button type="primary" @click="deptsubmitForm(deptFormRef)">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -253,36 +534,6 @@ function handleClose() {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
:deep(.ed-tree){
|
||||
background:#212121;
|
||||
height: calc(100vh - 210px);
|
||||
margin-top: 20px;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
}
|
||||
:deep(.ed-tree-node__content){
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
:deep(.ed-tree-node__content:hover){
|
||||
background: rgba(61,158, 255, 0.1);
|
||||
color: #0089FF;
|
||||
}
|
||||
:deep(.ed-tree--highlight-current .ed-tree-node.is-current>.ed-tree-node__content){
|
||||
background: #409eff;
|
||||
color: #ffffff;
|
||||
}
|
||||
:deep(.custom-tree-node){
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
:deep(.ed-tree-node__content>.ed-tree-node__expand-icon){
|
||||
padding: 2px;
|
||||
}
|
||||
}
|
||||
.organization-rightbox{
|
||||
width: calc(100% - 240px);
|
||||
@ -297,8 +548,60 @@ function handleClose() {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
:deep(.el-tree){
|
||||
background:#212121;
|
||||
height: calc(100vh - 210px);
|
||||
margin-top: 20px;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
}
|
||||
:deep(.el-tree-node__content){
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
:deep(.el-tree-node__content:hover){
|
||||
background: rgba(61,158, 255, 0.1);
|
||||
color: #0089FF;
|
||||
}
|
||||
:deep(.custom-tree-node){
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
:deep(.el-tree-node__content>.ed-tree-node__expand-icon){
|
||||
padding: 2px;
|
||||
}
|
||||
:deep(.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content){
|
||||
background: #409eff;
|
||||
color: #ffffff;
|
||||
}
|
||||
:deep(.el-tree-node:focus>.el-tree-node__content){
|
||||
background:#212121;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-message-box{
|
||||
background: #212121;
|
||||
}
|
||||
.el-message-box__content{
|
||||
color: #ffffff;
|
||||
}
|
||||
.el-message-box__title{
|
||||
color: #ffffff;
|
||||
}
|
||||
.el-message-box__btns .el-button{
|
||||
color: #F2F4F5;
|
||||
background-color: #212121;
|
||||
border: 1px solid #434343;
|
||||
}
|
||||
.el-message-box__btns .el-button--primary{
|
||||
background: #0089ff;
|
||||
border-color: #0089ff;
|
||||
}
|
||||
.ed-form-item__label{
|
||||
color: #D2D2D2;
|
||||
}
|
||||
@ -407,4 +710,31 @@ function handleClose() {
|
||||
border-color: #0089ff;
|
||||
background-color: #0089ff;
|
||||
}
|
||||
.ed-textarea__inner{
|
||||
background-color: #252626;
|
||||
box-sizing: border-box;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(67, 67, 67, 0);
|
||||
border-radius: 4px;
|
||||
box-shadow: none;
|
||||
border: 1px solid #434343;
|
||||
color: #fff;
|
||||
}
|
||||
.ed-textarea__inner:hover{
|
||||
box-shadow: none;
|
||||
border: 1px solid #0089ff;
|
||||
}
|
||||
.ed-textarea__inner:focus{
|
||||
box-shadow: none;
|
||||
border: 1px solid #0089ff;
|
||||
}
|
||||
.ed-input.is-disabled .ed-input__wrapper{
|
||||
border: 1px solid #434343;
|
||||
background: #212121;
|
||||
box-shadow: none;
|
||||
}
|
||||
.el-loading-mask{
|
||||
background-color: rgba(41, 41, 41, 0.9)
|
||||
}
|
||||
</style>
|
@ -0,0 +1,326 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted,reactive} from 'vue'
|
||||
import permission_table_edit_blue from '@/assets/svg/permission_table_edit_blue.svg'
|
||||
import permission_table_del_blue from '@/assets/svg/permission_table_del_blue.svg'
|
||||
import perission_role_blue from '@/assets/svg/perission_role_blue.svg'
|
||||
import icon_add from '@/assets/svg/add_white.svg'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Delete } from '@element-plus/icons-vue'
|
||||
import { ElTable } from 'element-plus'
|
||||
import { listRole,addRole,updateRole,setIsValid,deleteRoleById,deleteRoleByIds } from '@/api/permission/role'
|
||||
const props = defineProps({
|
||||
applicationId:String
|
||||
})
|
||||
const tableloading = ref(false)
|
||||
const dialogVisible = ref(false);
|
||||
const title = ref('新增角色');
|
||||
const preventcombo = ref(false)
|
||||
const ruleForm = ref();
|
||||
const ruleFormRef = ref<FormInstance>()
|
||||
const rules = ref({
|
||||
rolename: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择角色类别', trigger: 'change' },
|
||||
],
|
||||
})
|
||||
const queryrolename = ref('')
|
||||
const multipleTableRef = ref<InstanceType<typeof ElTable>>()
|
||||
const multipleSelection = ref([])
|
||||
const tableData = ref([])
|
||||
const typeoptions = ref([
|
||||
{ value: '1', label: '管理员' },
|
||||
{ value: '2', label: '普通用户' },
|
||||
])
|
||||
const submitForm = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
if(preventcombo.value){
|
||||
return
|
||||
}
|
||||
preventcombo.value = true
|
||||
if(ruleForm.value.id !== ''){
|
||||
updateRole(ruleForm.value).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '修改成功',
|
||||
})
|
||||
dialogVisible.value = false
|
||||
preventcombo.value = false
|
||||
queryrolename.value = ''
|
||||
gettable()
|
||||
})
|
||||
}else{
|
||||
addRole(ruleForm.value).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '新增成功',
|
||||
})
|
||||
dialogVisible.value = false
|
||||
preventcombo.value = false
|
||||
queryrolename.value = ''
|
||||
gettable()
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
const resetForm = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
formEl.resetFields()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
const handleSelectionChange = (val:any) => {
|
||||
multipleSelection.value = val
|
||||
}
|
||||
onMounted(() => {
|
||||
gettable()
|
||||
})
|
||||
function permissionset(row:any){
|
||||
|
||||
}
|
||||
function gettable(){
|
||||
tableloading.value = true
|
||||
const params = {
|
||||
appId: props.applicationId,
|
||||
rolename:''
|
||||
}
|
||||
listRole(params).then(res => {
|
||||
tableData.value = res.data
|
||||
tableloading.value = false
|
||||
})
|
||||
}
|
||||
function querytable(){
|
||||
tableloading.value = true
|
||||
const params = {
|
||||
appId: props.applicationId,
|
||||
rolename:queryrolename.value
|
||||
}
|
||||
listRole(params).then(res => {
|
||||
tableData.value = res.data
|
||||
tableloading.value = false
|
||||
})
|
||||
}
|
||||
function edittable(data:any){
|
||||
title.value = '修改角色'
|
||||
ruleForm.value = JSON.parse(JSON.stringify(data))
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function deltable(row:any){
|
||||
ElMessageBox.confirm(
|
||||
'确定删除该条信息吗?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
deleteRoleById(row.id).then(res => {
|
||||
if(res.code == '0'){
|
||||
gettable()
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
})
|
||||
}else{
|
||||
ElMessage.error('删除失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
function deltables(){
|
||||
ElMessageBox.confirm(
|
||||
'确定删除该条信息吗?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const arr = []
|
||||
multipleSelection.value.forEach(e => {
|
||||
arr.push(e.id)
|
||||
});
|
||||
deleteRoleByIds(arr.join()).then(res => {
|
||||
if(res.data.code == '0'){
|
||||
gettable()
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
})
|
||||
}else{
|
||||
ElMessage.error('删除失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
function addtable(){
|
||||
ruleForm.value = {
|
||||
id:'',
|
||||
appId:props.applicationId,
|
||||
rolename: '',
|
||||
rolecode: '',
|
||||
type: '',
|
||||
description:'',
|
||||
isvaild:'1',
|
||||
}
|
||||
title.value = '新增角色'
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function handleClose() {
|
||||
ruleFormRef.value?.resetFields();
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
function formatDateTime(dateTimeStr:any){
|
||||
return dateTimeStr.replace('T', ' ');
|
||||
}
|
||||
function setisValid(row:any){
|
||||
tableloading.value = true
|
||||
const params = {
|
||||
id:row.id,
|
||||
isvaild:row.isvaild
|
||||
}
|
||||
setIsValid(params).then(res => {
|
||||
console.log(res,'res')
|
||||
if(res.code == '0'){
|
||||
gettable()
|
||||
ElMessage.success('设置成功')
|
||||
}else{
|
||||
ElMessage.error('设置失败')
|
||||
}
|
||||
tableloading.value = false
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="organization-box">
|
||||
<div class="querybox">
|
||||
<div>
|
||||
<el-input v-model="queryrolename" placeholder="请输入角色名称" style="width: 200px;margin-right: 10px;" />
|
||||
<el-button type="primary" style="min-width: 50px;" @click="querytable">搜索</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" style="min-width: 50px;" @click="addtable">
|
||||
<el-icon style="margin-right: 3px;">
|
||||
<icon_add class="svg-icon" />
|
||||
</el-icon>新增
|
||||
</el-button>
|
||||
<el-button :type="multipleSelection.length>0?'primary':''" :disabled="multipleSelection.length>0?false:true" @click="deltables" style="min-width: 50px;">
|
||||
<el-icon style="margin-right: 3px;"><Delete /></el-icon>删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table v-loading="tableloading" ref="multipleTableRef" :data="tableData" border style="width: 100%"
|
||||
@selection-change="handleSelectionChange" height="calc(100vh - 175px)">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="rolecode" label="角色编号" width="130"/>
|
||||
<el-table-column prop="rolename" label="角色名称"/>
|
||||
<el-table-column prop="type" label="角色级别" width="150">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.type == '1'" style="font-size: 14px;">管理员</span>
|
||||
<span v-else-if="scope.row.type == '2'" style="font-size: 14px;">普通用户</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="description" label="角色描述"/>
|
||||
<el-table-column prop="isvaild" label="是否有效" width="110">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.isvaild" active-value="1" inactive-value="0" style="margin-right: 10px;" @change="setisValid(scope.row)"/>
|
||||
<span v-if="scope.row.isvaild == '1'" style="color: #0089ff;font-size: 14px;">有效</span>
|
||||
<span v-else-if="scope.row.isvaild == '0'" style="color: #bbbfc4;font-size: 14px;">无效</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lastmodifier" label="最近修改者" width="120"/>
|
||||
<el-table-column prop="lastmodifydate" label="最近修改日期" width="170">
|
||||
<template #default="scope">
|
||||
<span>{{formatDateTime(scope.row.lastmodifydate)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="100">
|
||||
<template #default="scope">
|
||||
<el-icon title="修改" style="font-size: 16px;cursor: pointer;" @click="edittable(scope.row)">
|
||||
<permission_table_edit_blue class="svg-icon"/>
|
||||
</el-icon>
|
||||
<el-icon title="权限分配" style="font-size: 16px;margin:0px 10px;cursor: pointer;" @click="permissionset(scope.row)">
|
||||
<perission_role_blue class="svg-icon"/>
|
||||
</el-icon>
|
||||
<el-icon title="删除" style="font-size: 16px;cursor: pointer;" @click="deltable(scope.row)">
|
||||
<permission_table_del_blue class="svg-icon"/>
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog v-model="dialogVisible" :title="title" width="30%" :before-close="handleClose">
|
||||
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="80px" class="demo-ruleForm">
|
||||
<el-form-item label="角色编号" prop="rolecode">
|
||||
<el-input v-model="ruleForm.rolecode" disabled placeholder="系统自动生成"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色名称" prop="rolename">
|
||||
<el-input v-model="ruleForm.rolename" placeholder="请输入角色名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色级别" prop="type">
|
||||
<el-select v-model="ruleForm.type" placeholder="请选择角色级别" style="width:100%;">
|
||||
<el-option v-for="item in typeoptions" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色描述" prop="description">
|
||||
<el-input type="textarea" :rows="4" v-model="ruleForm.description" placeholder="请输入角色描述" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="resetForm(ruleFormRef)">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm(ruleFormRef)">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.organization-box{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgb(33,33,33);
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
.querybox{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.ed-select .ed-input.is-focus .ed-input__wrapper{
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.ed-select:hover:not(.ed-select--disabled) .ed-input__wrapper{
|
||||
box-shadow: none;
|
||||
}
|
||||
.ed-select .ed-input__wrapper.is-focus{
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.ed-select__popper.ed-popper{
|
||||
background: rgba(41, 41, 41, 1);
|
||||
border: 1px solid #434343;
|
||||
color: #fff;
|
||||
}
|
||||
.ed-select-dropdown__item{
|
||||
color: #fff;
|
||||
}
|
||||
.ed-select-dropdown__item.hover, .ed-select-dropdown__item:hover{
|
||||
background: #434343;
|
||||
}
|
||||
.ed-select-dropdown__item.selected{
|
||||
color: #0089ff;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,583 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted,reactive} from 'vue'
|
||||
import icon_permission_del_white from '@/assets/svg/permission_del_white.svg'
|
||||
import icon_permission_edit_white from '@/assets/svg/permission_edit_white.svg'
|
||||
import icon_permission_edit_blue from '@/assets/svg/permission_edit_blue.svg'
|
||||
import icon_permission_del_blue from '@/assets/svg/permission_del_blue.svg'
|
||||
import permission_table_edit_blue from '@/assets/svg/permission_table_edit_blue.svg'
|
||||
import permission_table_del_blue from '@/assets/svg/permission_table_del_blue.svg'
|
||||
import icon_add from '@/assets/svg/add_white.svg'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Delete } from '@element-plus/icons-vue'
|
||||
import { ElTable } from 'element-plus'
|
||||
import { getOrganizations,addOrganization,setIsValid,updateOrganizationById,deleteById,getOrganizationById } from '@/api/permission/organization'
|
||||
const props = defineProps({
|
||||
applicationId:String
|
||||
})
|
||||
const treeData:any = ref([])
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
}
|
||||
const hoverNodeId = ref(null);
|
||||
const currentNodeId = ref(null);
|
||||
const dialogVisible = ref(false);
|
||||
const title = ref('新增用户');
|
||||
const ruleForm = ref();
|
||||
const ruleFormRef = ref<FormInstance>()
|
||||
const rules = ref({
|
||||
orgname: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
],
|
||||
orgcode: [
|
||||
{ required: true, message: '请输入编号', trigger: 'blur' },
|
||||
],
|
||||
})
|
||||
const queryorgname = ref('')
|
||||
const multipleTableRef = ref<InstanceType<typeof ElTable>>()
|
||||
const multipleSelection = ref([])
|
||||
const tableData = ref([{orgname:'23'}])
|
||||
const deptdialog = ref(false);
|
||||
const depttitle = ref('新增部门')
|
||||
const deptForm = ref();
|
||||
const deptFormRef = ref<FormInstance>()
|
||||
const deptrules = ref({
|
||||
orgname: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
],
|
||||
orgcode: [
|
||||
{ required: true, message: '请输入编号', trigger: 'blur' },
|
||||
],
|
||||
})
|
||||
const handleMouseEnter = (node) => {
|
||||
hoverNodeId.value = node.key;
|
||||
};
|
||||
const handleMouseLeave = () => {
|
||||
hoverNodeId.value = null;
|
||||
};
|
||||
const submitForm = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
if(ruleForm.value.id !== ''){
|
||||
|
||||
}else{
|
||||
console.log(ruleForm.value,'submit!')
|
||||
addOrganization(ruleForm.value).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '新增成功',
|
||||
})
|
||||
dialogVisible.value = false
|
||||
gettree()
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
const resetForm = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
formEl.resetFields()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const deptsubmitForm = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
if(deptForm.value.id !== ''){
|
||||
|
||||
}else{
|
||||
console.log(deptForm.value,'submit!')
|
||||
addOrganization(deptForm.value).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '新增成功',
|
||||
})
|
||||
dialogVisible.value = false
|
||||
gettree()
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
const deptresetForm = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
formEl.resetFields()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const deltree = (data:any) => {
|
||||
ElMessageBox.confirm(
|
||||
'确定删除该条信息吗?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
})
|
||||
}
|
||||
const handleSelectionChange = (val:any) => {
|
||||
multipleSelection.value = val
|
||||
}
|
||||
onMounted(() => {
|
||||
treeData.value = []
|
||||
gettree()
|
||||
})
|
||||
function gettree(){
|
||||
const params = {
|
||||
appId: props.applicationId,
|
||||
orgtype:'01',
|
||||
parentid:'0',
|
||||
orgName:''
|
||||
}
|
||||
console.log(params,'查询')
|
||||
getOrganizations(params).then(res => {
|
||||
console.log(res,'查询')
|
||||
})
|
||||
}
|
||||
function nodeclick(data:any,node:any){
|
||||
currentNodeId.value = node.key
|
||||
|
||||
}
|
||||
function addtree(data:any){
|
||||
ruleForm.value = {
|
||||
id:'',
|
||||
appId:props.applicationId,
|
||||
orgname: '',
|
||||
orgcode: '',
|
||||
orgtype: '01',
|
||||
parentid:'0'
|
||||
}
|
||||
title.value = '新增企业'
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function edittree(data:any){
|
||||
title.value = '修改企业'
|
||||
ruleForm.value = JSON.parse(JSON.stringify(data))
|
||||
dialogVisible.value = true
|
||||
}
|
||||
function edittable(data:any){
|
||||
depttitle.value = '修改企业'
|
||||
deptForm.value = JSON.parse(JSON.stringify(data))
|
||||
deptdialog.value = true
|
||||
}
|
||||
function deltable(data:any){
|
||||
ElMessageBox.confirm(
|
||||
'确定删除该条信息吗?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
})
|
||||
}
|
||||
function deltables(){
|
||||
ElMessageBox.confirm(
|
||||
'确定删除该条信息吗?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
const arr = []
|
||||
multipleSelection.value.forEach(e => {
|
||||
arr.push(e.id)
|
||||
});
|
||||
deleteById(arr.join()).then(res => {
|
||||
if(res.data.code == '0'){
|
||||
gettree()
|
||||
ElMessage.success('删除成功')
|
||||
}else{
|
||||
ElMessage.error('删除失败')
|
||||
}
|
||||
})
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功',
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
})
|
||||
}
|
||||
function addtable(){
|
||||
if(currentNodeId.value == '' || currentNodeId.value == null){
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '请选择企业!',
|
||||
})
|
||||
return
|
||||
}
|
||||
deptForm.value = {
|
||||
id:'',
|
||||
app_id:props.applicationId,
|
||||
orgname: '',
|
||||
orgcode: '',
|
||||
orgtype: '02',
|
||||
parentid:currentNodeId.value,
|
||||
manager:'',
|
||||
description:'',
|
||||
address:'',
|
||||
isvaild:'1',
|
||||
contactPhone:'',
|
||||
contactPerson:''
|
||||
}
|
||||
depttitle.value = '新增部门'
|
||||
deptdialog.value = true
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
ruleFormRef.value?.resetFields();
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
function depthandleClose() {
|
||||
deptFormRef.value?.resetFields();
|
||||
deptdialog.value = false
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="organization-box">
|
||||
<div class="organization-leftbox">
|
||||
<div class="leftbox-title">列表</div>
|
||||
<el-tree :data="treeData" node-key="id" :props="defaultProps"
|
||||
highlight-current default-expand-all :expand-on-click-node="false"
|
||||
@node-click="nodeclick">
|
||||
</el-tree>
|
||||
</div>
|
||||
<div class="organization-rightbox">
|
||||
<div class="querybox">
|
||||
<div>
|
||||
<el-input v-model="queryorgname" placeholder="请输入用户名称" style="width: 200px;margin-right: 10px;" />
|
||||
<el-button type="primary" style="min-width: 50px;">搜索</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" style="min-width: 50px;" @click="addtable">
|
||||
<el-icon style="margin-right: 3px;">
|
||||
<icon_add class="svg-icon" />
|
||||
</el-icon>新增
|
||||
</el-button>
|
||||
<el-button :type="multipleSelection.length>0?'primary':''" :disabled="multipleSelection.length>0?false:true" @click="deltables" style="min-width: 50px;">
|
||||
<el-icon style="margin-right: 3px;"><Delete /></el-icon>删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="orgcode" label="部门编号"/>
|
||||
<el-table-column prop="orgname" label="部门名称"/>
|
||||
<el-table-column prop="manager" label="负责人"/>
|
||||
<el-table-column prop="description" label="部门描述"/>
|
||||
<el-table-column prop="contactperson" label="联系人"/>
|
||||
<el-table-column prop="contactphone" label="联系电话"/>
|
||||
<el-table-column prop="address" label="联系地址"/>
|
||||
<el-table-column prop="isvaild" label="是否有效" width="110">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.isvaild" style="margin-right: 10px;"/>
|
||||
<span v-if="scope.row.isvaild == '1'" style="color: #0089ff;font-size: 14px;">有效</span>
|
||||
<span v-else-if="scope.row.isvaild == '0'" style="color: #bbbfc4;font-size: 14px;">无效</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lastmodifier" label="最近修改者"/>
|
||||
<el-table-column prop="lastmodifydate" label="最近修改日期"/>
|
||||
<el-table-column fixed="right" label="操作" width="80">
|
||||
<template #default="scope">
|
||||
<el-icon style="font-size: 16px;margin-right: 18px;cursor: pointer;" @click="edittable(scope.row)">
|
||||
<permission_table_edit_blue class="svg-icon"/>
|
||||
</el-icon>
|
||||
<el-icon style="font-size: 16px;cursor: pointer;" @click="deltable(scope.row)">
|
||||
<permission_table_del_blue class="svg-icon"/>
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" :title="title" width="30%" :before-close="handleClose">
|
||||
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="60px" class="demo-ruleForm">
|
||||
<el-form-item label="编号" prop="orgcode">
|
||||
<el-input v-model="ruleForm.orgcode" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="orgname">
|
||||
<el-input v-model="ruleForm.orgname" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="resetForm(ruleFormRef)">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm(ruleFormRef)">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="deptdialog" :title="depttitle" width="30%" :before-close="depthandleClose">
|
||||
<el-form ref="deptFormRef" :model="deptForm" :rules="deptrules" label-width="80px" class="demo-ruleForm">
|
||||
<el-form-item label="部门编号" prop="orgcode">
|
||||
<el-input v-model="deptForm.orgcode" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门名称" prop="orgname">
|
||||
<el-input v-model="deptForm.orgname" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="manager">
|
||||
<el-input v-model="deptForm.manager" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门描述" prop="description">
|
||||
<el-input type="textarea" :rows="4" v-model="deptForm.description" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactPerson">
|
||||
<el-input v-model="deptForm.contactPerson" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="contactPhone">
|
||||
<el-input v-model="deptForm.contactPhone" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系地址" prop="address">
|
||||
<el-input v-model="deptForm.address" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="deptresetForm(deptFormRef)">取消</el-button>
|
||||
<el-button type="primary" @click="deptsubmitForm(deptFormRef)">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.organization-box{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
.organization-leftbox{
|
||||
width: 240px;
|
||||
height: 100%;
|
||||
background: rgb(33,33,33);
|
||||
border-radius: 5px;
|
||||
margin-right: 15px;
|
||||
.leftbox-title{
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
font-family: 'Arial Negreta', 'Arial Normal', 'Arial', sans-serif;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-size: 15px;
|
||||
color: #FFFFFF;
|
||||
border-bottom: 1px solid #282828;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.leftbox-btn{
|
||||
width: 200px;
|
||||
height: 40px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(0, 137, 255, 1);
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
color: #0089FF;
|
||||
margin: 0 auto;
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
:deep(.ed-tree){
|
||||
background:#212121;
|
||||
height: calc(100vh - 210px);
|
||||
margin-top: 20px;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
}
|
||||
:deep(.ed-tree-node__content){
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
:deep(.ed-tree-node__content:hover){
|
||||
background: rgba(61,158, 255, 0.1);
|
||||
color: #0089FF;
|
||||
}
|
||||
:deep(.ed-tree--highlight-current .ed-tree-node.is-current>.ed-tree-node__content){
|
||||
background: #409eff;
|
||||
color: #ffffff;
|
||||
}
|
||||
:deep(.custom-tree-node){
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
:deep(.ed-tree-node__content>.ed-tree-node__expand-icon){
|
||||
padding: 2px;
|
||||
}
|
||||
}
|
||||
.organization-rightbox{
|
||||
width: calc(100% - 240px);
|
||||
height: 100%;
|
||||
background: rgb(33,33,33);
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
}
|
||||
.querybox{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.ed-form-item__label{
|
||||
color: #D2D2D2;
|
||||
}
|
||||
.ed-input__wrapper {
|
||||
background-color: #252626;
|
||||
box-sizing: border-box;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(67, 67, 67, 0);
|
||||
border-radius: 4px;
|
||||
box-shadow: none;
|
||||
border: 1px solid #434343;
|
||||
}
|
||||
.ed-form-item.is-error .ed-input__wrapper{
|
||||
box-shadow: none;
|
||||
border: 1px solid #f54a45;
|
||||
}
|
||||
.ed-input__wrapper.is-focus{
|
||||
box-shadow: none;
|
||||
border: 1px solid #0089ff;
|
||||
}
|
||||
.ed-input__wrapper:hover{
|
||||
box-shadow: none;
|
||||
border: 1px solid #0089ff;
|
||||
}
|
||||
.ed-input__inner{
|
||||
color: #fff;
|
||||
}
|
||||
.ed-button {
|
||||
color: #ffffff;
|
||||
background-color: rgb(54,55,56);
|
||||
border: 1px solid #363636;
|
||||
}
|
||||
.ed-button:focus, .ed-button:hover{
|
||||
color: #ffffff;
|
||||
background-color: rgb(54,55,56);
|
||||
border: 1px solid #363636;
|
||||
}
|
||||
.ed-button--primary{
|
||||
background-color: #0089ff;
|
||||
border-color:#0089ff ;
|
||||
}
|
||||
.ed-button--primary:focus, .ed-button--primary:hover{
|
||||
background-color: #0089ff;
|
||||
border-color:#0089ff ;
|
||||
}
|
||||
.ed-button.is-disabled{
|
||||
color: #949494;
|
||||
background-color: rgb(54,55,56);
|
||||
border: 1px solid rgb(54,55,56);
|
||||
}
|
||||
.ed-button.is-disabled, .ed-button.is-disabled:focus, .ed-button.is-disabled:hover{
|
||||
color: #949494;
|
||||
background-color: rgb(54,55,56);
|
||||
border: 1px solid rgb(54,55,56);
|
||||
}
|
||||
.el-table{
|
||||
background-color: rgb(33,33,33);
|
||||
}
|
||||
.el-table tr{
|
||||
background: rgb(40,40,40);
|
||||
border-color: #434343;
|
||||
}
|
||||
.el-table th.el-table__cell {
|
||||
background-color: rgb(40,40,40);
|
||||
border-color: #434343;
|
||||
}
|
||||
.el-table.is-scrolling-none th.el-table-fixed-column--left, .el-table.is-scrolling-none th.el-table-fixed-column--right {
|
||||
background-color: rgb(40,40,40);
|
||||
}
|
||||
.el-table--border .el-table__inner-wrapper:after, .el-table--border:after, .el-table--border:before, .el-table__inner-wrapper:before{
|
||||
background-color: #434343;
|
||||
}
|
||||
.el-table__border-bottom-patch, .el-table__border-left-patch{
|
||||
background-color: #434343;
|
||||
}
|
||||
.el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf{
|
||||
border-color: #434343;
|
||||
}
|
||||
.ed-checkbox__inner{
|
||||
background: transparent;
|
||||
border-color: #787878;
|
||||
}
|
||||
.ed-checkbox__input.is-disabled .ed-checkbox__inner{
|
||||
background: #434343;
|
||||
border-color: #787878;
|
||||
}
|
||||
.el-table thead{
|
||||
color: #E4E4E4;
|
||||
}
|
||||
.el-table .el-table__cell{
|
||||
background: #212121;
|
||||
color: #F2F4F5;
|
||||
}
|
||||
.el-table__body-wrapper tr td.el-table-fixed-column--left, .el-table__body-wrapper tr td.el-table-fixed-column--right, .el-table__body-wrapper tr th.el-table-fixed-column--left, .el-table__body-wrapper tr th.el-table-fixed-column--right, .el-table__footer-wrapper tr td.el-table-fixed-column--left, .el-table__footer-wrapper tr td.el-table-fixed-column--right, .el-table__footer-wrapper tr th.el-table-fixed-column--left, .el-table__footer-wrapper tr th.el-table-fixed-column--right, .el-table__header-wrapper tr td.el-table-fixed-column--left, .el-table__header-wrapper tr td.el-table-fixed-column--right, .el-table__header-wrapper tr th.el-table-fixed-column--left, .el-table__header-wrapper tr th.el-table-fixed-column--right{
|
||||
background: #212121;
|
||||
}
|
||||
.hover-row > td {
|
||||
background-color: rgb(48,48,48) !important;
|
||||
}
|
||||
.ed-checkbox__input.is-checked .ed-checkbox__inner {
|
||||
background-color: #409eff;
|
||||
border-color: #409eff;
|
||||
}
|
||||
.ed-switch.is-checked .ed-switch__core{
|
||||
border-color: #0089ff;
|
||||
background-color: #0089ff;
|
||||
}
|
||||
.ed-textarea__inner{
|
||||
background-color: #252626;
|
||||
box-sizing: border-box;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(67, 67, 67, 0);
|
||||
border-radius: 4px;
|
||||
box-shadow: none;
|
||||
border: 1px solid #434343;
|
||||
color: #fff;
|
||||
}
|
||||
.ed-textarea__inner:hover{
|
||||
box-shadow: none;
|
||||
border: 1px solid #0089ff;
|
||||
}
|
||||
.ed-textarea__inner:focus{
|
||||
box-shadow: none;
|
||||
border: 1px solid #0089ff;
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user