style:菜单
Showing
7 changed files
with
413 additions
and
409 deletions
| 1 | /* | 1 | /* |
| 2 | * @Description: | 2 | * @Description: |
| 3 | * @Autor: renchao | 3 | * @Autor: renchao |
| 4 | * @LastEditTime: 2023-03-24 17:24:52 | 4 | * @LastEditTime: 2023-03-24 17:28:37 |
| 5 | */ | 5 | */ |
| 6 | import Vue from 'vue' | 6 | import Vue from 'vue' |
| 7 | import router from "./router"; | 7 | import router from "./router"; |
| ... | @@ -33,7 +33,6 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -33,7 +33,6 @@ router.beforeEach(async (to, from, next) => { |
| 33 | if (!hasUser) { | 33 | if (!hasUser) { |
| 34 | store.dispatch("user/getUserInfo"); | 34 | store.dispatch("user/getUserInfo"); |
| 35 | } | 35 | } |
| 36 | debugger | ||
| 37 | if (hasAddRoute) { | 36 | if (hasAddRoute) { |
| 38 | next(); | 37 | next(); |
| 39 | } else { | 38 | } else { | ... | ... |
| ... | @@ -3,7 +3,7 @@ | ... | @@ -3,7 +3,7 @@ |
| 3 | <!-- 表单部分 --> | 3 | <!-- 表单部分 --> |
| 4 | <div class="from-clues-header"> | 4 | <div class="from-clues-header"> |
| 5 | <el-form @submit.native.prevent :model="ruleForm" label-width="120px"> | 5 | <el-form @submit.native.prevent :model="ruleForm" label-width="120px"> |
| 6 | <el-form-item> | 6 | <el-form-item v-if="BASE_API.THEME == 'jg'"> |
| 7 | <Breadcrumb /> | 7 | <Breadcrumb /> |
| 8 | </el-form-item> | 8 | </el-form-item> |
| 9 | <el-row :gutter="20"> | 9 | <el-row :gutter="20"> | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Author: xiaomiao 1158771342@qq.com | 2 | * @Author: xiaomiao 1158771342@qq.com |
| 3 | * @Date: 2023-03-09 20:54:28 | 3 | * @Date: 2023-03-09 20:54:28 |
| 4 | * @LastEditors: xiaomiao 1158771342@qq.com | 4 | * @LastEditors: Please set LastEditors |
| 5 | * @LastEditTime: 2023-03-16 19:40:40 | 5 | * @LastEditTime: 2023-03-27 09:13:22 |
| 6 | * @FilePath: \上报\bdcjg-web\src\views\system\information\index.vue | 6 | * @FilePath: \上报\bdcjg-web\src\views\system\information\index.vue |
| 7 | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | 7 | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| 8 | --> | 8 | --> |
| ... | @@ -10,7 +10,7 @@ | ... | @@ -10,7 +10,7 @@ |
| 10 | <div class="information from-clues"> | 10 | <div class="information from-clues"> |
| 11 | <div class="from-clues-header"> | 11 | <div class="from-clues-header"> |
| 12 | <el-form ref="ruleForm" label-width="100px"> | 12 | <el-form ref="ruleForm" label-width="100px"> |
| 13 | <el-form-item> | 13 | <el-form-item v-if="BASE_API.THEME == 'jg'"> |
| 14 | <Breadcrumb /> | 14 | <Breadcrumb /> |
| 15 | </el-form-item> | 15 | </el-form-item> |
| 16 | <el-row class="mb-5"> | 16 | <el-row class="mb-5"> |
| ... | @@ -34,60 +34,64 @@ | ... | @@ -34,60 +34,64 @@ |
| 34 | </div> | 34 | </div> |
| 35 | </template> | 35 | </template> |
| 36 | <script> | 36 | <script> |
| 37 | import "@/utils/flexible.js"; | 37 | import "@/utils/flexible.js"; |
| 38 | import BaseSet from "./base-set.vue"; | 38 | import BaseSet from "./base-set.vue"; |
| 39 | import PasswordEdit from "./password-edit.vue"; | 39 | import PasswordEdit from "./password-edit.vue"; |
| 40 | export default { | 40 | export default { |
| 41 | components: { | 41 | components: { |
| 42 | BaseSet, | 42 | BaseSet, |
| 43 | PasswordEdit, | 43 | PasswordEdit, |
| 44 | }, | ||
| 45 | data () { | ||
| 46 | return { | ||
| 47 | isshow: true, | ||
| 48 | }; | ||
| 49 | }, | ||
| 50 | computed: { | ||
| 51 | userData () { | ||
| 52 | return this.$store.state.user.userInfo; | ||
| 44 | }, | 53 | }, |
| 45 | data () { | 54 | }, |
| 46 | return { | 55 | watch: {}, |
| 47 | isshow: true, | 56 | created () { }, |
| 48 | }; | 57 | mounted () { }, |
| 58 | methods: { | ||
| 59 | information () { | ||
| 60 | this.isshow = true; | ||
| 49 | }, | 61 | }, |
| 50 | computed: { | 62 | password () { |
| 51 | userData () { | 63 | this.isshow = false; |
| 52 | return this.$store.state.user.userInfo; | ||
| 53 | }, | ||
| 54 | }, | 64 | }, |
| 55 | watch: {}, | 65 | }, |
| 56 | created () { }, | 66 | }; |
| 57 | mounted () { }, | ||
| 58 | methods: { | ||
| 59 | information () { | ||
| 60 | this.isshow = true; | ||
| 61 | }, | ||
| 62 | password () { | ||
| 63 | this.isshow = false; | ||
| 64 | }, | ||
| 65 | }, | ||
| 66 | }; | ||
| 67 | </script> | 67 | </script> |
| 68 | 68 | ||
| 69 | <style scoped lang="scss"> | 69 | <style scoped lang="scss"> |
| 70 | @import "~@/styles/mixin.scss"; | 70 | @import "~@/styles/mixin.scss"; |
| 71 | .information { | 71 | |
| 72 | .information { | ||
| 73 | display: flex; | ||
| 74 | flex-direction: column; | ||
| 75 | |||
| 76 | .btnColRight { | ||
| 77 | margin-top: 10px; | ||
| 72 | display: flex; | 78 | display: flex; |
| 73 | flex-direction: column; | 79 | justify-content: center; |
| 74 | .btnColRight { | 80 | // background-color: cadetblue; |
| 75 | margin-top: 10px; | 81 | height: 30px; |
| 76 | display: flex; | 82 | } |
| 77 | justify-content: center; | 83 | |
| 78 | // background-color: cadetblue; | 84 | /deep/.content { |
| 79 | height: 30px; | 85 | .el-input__inner { |
| 80 | } | 86 | background: none; |
| 81 | /deep/.content { | ||
| 82 | .el-input__inner { | ||
| 83 | background: none; | ||
| 84 | } | ||
| 85 | .user-info { | ||
| 86 | background: none; | ||
| 87 | } | ||
| 88 | } | 87 | } |
| 89 | .boxin { | 88 | |
| 90 | flex: 1; | 89 | .user-info { |
| 90 | background: none; | ||
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | </style> | 93 | |
| 94 | .boxin { | ||
| 95 | flex: 1; | ||
| 96 | } | ||
| 97 | }</style> | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | <div class="timedTask from-clues"> | 2 | <div class="timedTask from-clues"> |
| 3 | <div class="from-clues-header"> | 3 | <div class="from-clues-header"> |
| 4 | <el-form ref="ruleForm" :model="form" label-width="100px"> | 4 | <el-form ref="ruleForm" :model="form" label-width="100px"> |
| 5 | <el-form-item> | 5 | <el-form-item v-if="BASE_API.THEME == 'jg'"> |
| 6 | <Breadcrumb /> | 6 | <Breadcrumb /> |
| 7 | </el-form-item> | 7 | </el-form-item> |
| 8 | <el-row class="mb-5"> | 8 | <el-row class="mb-5"> | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | <div class="timedTask from-clues"> | 2 | <div class="timedTask from-clues"> |
| 3 | <div class="from-clues-header"> | 3 | <div class="from-clues-header"> |
| 4 | <el-form ref="ruleForm" :model="form" label-width="100px"> | 4 | <el-form ref="ruleForm" :model="form" label-width="100px"> |
| 5 | <el-form-item> | 5 | <el-form-item v-if="BASE_API.THEME == 'jg'"> |
| 6 | <Breadcrumb /> | 6 | <Breadcrumb /> |
| 7 | </el-form-item> | 7 | </el-form-item> |
| 8 | <el-row class="mb-5"> | 8 | <el-row class="mb-5"> | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | <div class="timedTask from-clues"> | 2 | <div class="timedTask from-clues"> |
| 3 | <div class="from-clues-header"> | 3 | <div class="from-clues-header"> |
| 4 | <el-form ref="form" :model="form" label-width="80px"> | 4 | <el-form ref="form" :model="form" label-width="80px"> |
| 5 | <el-form-item> | 5 | <el-form-item v-if="BASE_API.THEME == 'jg'"> |
| 6 | <Breadcrumb /> | 6 | <Breadcrumb /> |
| 7 | </el-form-item> | 7 | </el-form-item> |
| 8 | <el-row> | 8 | <el-row> | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | <div class="timedTask from-clues"> | 2 | <div class="timedTask from-clues"> |
| 3 | <div class="from-clues-header"> | 3 | <div class="from-clues-header"> |
| 4 | <el-form ref="ruleForm" :model="form" label-width="100px"> | 4 | <el-form ref="ruleForm" :model="form" label-width="100px"> |
| 5 | <el-form-item> | 5 | <el-form-item v-if="BASE_API.THEME == 'jg'"> |
| 6 | <Breadcrumb /> | 6 | <Breadcrumb /> |
| 7 | </el-form-item> | 7 | </el-form-item> |
| 8 | <el-row class="mt-10"> | 8 | <el-row class="mt-10"> |
| ... | @@ -38,388 +38,389 @@ | ... | @@ -38,388 +38,389 @@ |
| 38 | </div> | 38 | </div> |
| 39 | </template> | 39 | </template> |
| 40 | <script> | 40 | <script> |
| 41 | import { | 41 | import { |
| 42 | getUuid, | 42 | getUuid, |
| 43 | judgeSort, | 43 | judgeSort, |
| 44 | realMove, | 44 | realMove, |
| 45 | findParents, | 45 | findParents, |
| 46 | removeTreeListItem, | 46 | removeTreeListItem, |
| 47 | } from "@/utils/operation"; | 47 | } from "@/utils/operation"; |
| 48 | import { | 48 | import { |
| 49 | resetPassword, | 49 | resetPassword, |
| 50 | getUserList, getUserLists | 50 | getUserList, getUserLists |
| 51 | } from "@/api/personnelManage"; | 51 | } from "@/api/personnelManage"; |
| 52 | import { api, deleteAction, getAction } from '@/api/manageApi' | 52 | import { api, deleteAction, getAction } from '@/api/manageApi' |
| 53 | import data from "./data"; | 53 | import data from "./data"; |
| 54 | import { deleteDomStr } from '@/utils/proDomStr' | 54 | import { deleteDomStr } from '@/utils/proDomStr' |
| 55 | import tableMixin from "@/mixins/tableMixin.js"; | 55 | import tableMixin from "@/mixins/tableMixin.js"; |
| 56 | import EditDialog from "./edit-dialog.vue"; | 56 | import EditDialog from "./edit-dialog.vue"; |
| 57 | import { updateOrder } from "@/api/orders" | 57 | import { updateOrder } from "@/api/orders" |
| 58 | export default { | 58 | export default { |
| 59 | name: "menus", | 59 | name: "menus", |
| 60 | mixins: [tableMixin], | 60 | mixins: [tableMixin], |
| 61 | components: { | 61 | components: { |
| 62 | EditDialog, | 62 | EditDialog, |
| 63 | }, | 63 | }, |
| 64 | data () { | 64 | data () { |
| 65 | return { | 65 | return { |
| 66 | isDialog: false, | 66 | isDialog: false, |
| 67 | taskData: null, | 67 | taskData: null, |
| 68 | keyList: [], | 68 | keyList: [], |
| 69 | form: { | 69 | form: { |
| 70 | loginName: "", | 70 | loginName: "", |
| 71 | name: "", | 71 | name: "", |
| 72 | code: "", | 72 | code: "", |
| 73 | }, | ||
| 74 | queryParam: {}, | ||
| 75 | selectType: "0", | ||
| 76 | queryName: "", | ||
| 77 | organizationId: "", // 组织机构ID | ||
| 78 | departmentId: "", // 部门ID | ||
| 79 | departmentList: [], // 部门列表 | ||
| 80 | levelList: [], // 职务级别 | ||
| 81 | sexList: [], | ||
| 82 | typeOptions: [ | ||
| 83 | { | ||
| 84 | value: "0", | ||
| 85 | label: "姓名", | ||
| 73 | }, | 86 | }, |
| 74 | queryParam: {}, | 87 | { |
| 75 | selectType: "0", | 88 | value: "1", |
| 76 | queryName: "", | 89 | label: "工号", |
| 77 | organizationId: "", // 组织机构ID | 90 | }, |
| 78 | departmentId: "", // 部门ID | 91 | { |
| 79 | departmentList: [], // 部门列表 | 92 | value: "2", |
| 80 | levelList: [], // 职务级别 | 93 | label: "部门", |
| 81 | sexList: [], | 94 | }, |
| 82 | typeOptions: [ | 95 | { |
| 83 | { | 96 | value: "3", |
| 84 | value: "0", | 97 | label: "机构", |
| 85 | label: "姓名", | 98 | }, |
| 86 | }, | 99 | ], |
| 87 | { | 100 | |
| 88 | value: "1", | 101 | selectionList: [], |
| 89 | label: "工号", | 102 | tableData: { |
| 90 | }, | 103 | columns: [ |
| 91 | { | ||
| 92 | value: "2", | ||
| 93 | label: "部门", | ||
| 94 | }, | ||
| 95 | { | 104 | { |
| 96 | value: "3", | 105 | label: "序号", |
| 97 | label: "机构", | 106 | type: "index", |
| 107 | width: "50", | ||
| 108 | index: this.indexMethod, | ||
| 98 | }, | 109 | }, |
| 99 | ], | 110 | ] |
| 111 | .concat(data.columns()) | ||
| 112 | .concat([ | ||
| 113 | { | ||
| 114 | label: "职位", | ||
| 115 | render: (h, scope) => { | ||
| 116 | return ( | ||
| 117 | <div v-show={scope.row.jobLevel !== null}>{scope.row.jobLevel ? "干事" : "经理"}</div> | ||
| 118 | ) | ||
| 100 | 119 | ||
| 101 | selectionList: [], | 120 | } |
| 102 | tableData: { | 121 | }, |
| 103 | columns: [ | ||
| 104 | { | 122 | { |
| 105 | label: "序号", | 123 | label: "负责人", |
| 106 | type: "index", | 124 | render: (h, scope) => { |
| 107 | width: "50", | 125 | return ( |
| 108 | index: this.indexMethod, | 126 | <i v-show={scope.row.isDuty !== null} class="el-icon-check" /> |
| 127 | ) | ||
| 128 | } | ||
| 109 | }, | 129 | }, |
| 110 | ] | 130 | { |
| 111 | .concat(data.columns()) | 131 | label: "排序", |
| 112 | .concat([ | 132 | width: 300, |
| 113 | { | 133 | render: (h, scope) => { |
| 114 | label: "职位", | 134 | return ( |
| 115 | render: (h, scope) => { | 135 | <div> |
| 116 | return ( | 136 | <el-button |
| 117 | <div v-show={scope.row.jobLevel !== null}>{scope.row.jobLevel ? "干事" : "经理"}</div> | 137 | type="text" |
| 118 | ) | 138 | class='movebtnColor' |
| 119 | 139 | disabled={scope.row.isTop} | |
| 120 | } | 140 | onClick={() => { |
| 121 | }, | 141 | this.updateOrder(scope.row, 'TOP'); |
| 122 | { | 142 | }} |
| 123 | label: "负责人", | 143 | > |
| 124 | render: (h, scope) => { | 144 | 置顶 |
| 125 | return ( | 145 | </el-button> |
| 126 | <i v-show={scope.row.isDuty !== null} class="el-icon-check" /> | 146 | <el-button |
| 127 | ) | 147 | type="text" |
| 128 | } | 148 | class='movebtnColor' |
| 149 | disabled={scope.row.isTop} | ||
| 150 | onClick={() => { | ||
| 151 | this.updateOrder(scope.row, 'UP'); | ||
| 152 | }} | ||
| 153 | > | ||
| 154 | 上移 | ||
| 155 | </el-button> | ||
| 156 | <el-button | ||
| 157 | type="text" | ||
| 158 | class='movebtnColor' | ||
| 159 | disabled={scope.row.isBottom} | ||
| 160 | onClick={() => { | ||
| 161 | this.updateOrder(scope.row, 'DOWN'); | ||
| 162 | }} | ||
| 163 | > | ||
| 164 | 下移 | ||
| 165 | </el-button> | ||
| 166 | <el-button | ||
| 167 | type="text" | ||
| 168 | size="mini" | ||
| 169 | class='movebtnColor' | ||
| 170 | disabled={scope.row.isBottom} | ||
| 171 | onClick={() => { | ||
| 172 | this.updateOrder(scope.row, 'BOTTOM'); | ||
| 173 | }} | ||
| 174 | > | ||
| 175 | 置底 | ||
| 176 | </el-button> | ||
| 177 | </div> | ||
| 178 | ); | ||
| 129 | }, | 179 | }, |
| 130 | { | 180 | }, |
| 131 | label: "排序", | 181 | { |
| 132 | width: 300, | 182 | label: "操作", |
| 133 | render: (h, scope) => { | 183 | width: 380, |
| 134 | return ( | 184 | render: (h, scope) => { |
| 135 | <div> | 185 | return ( |
| 136 | <el-button | 186 | <div> |
| 137 | type="text" | 187 | <el-button |
| 138 | class='movebtnColor' | 188 | type="text" |
| 139 | disabled={scope.row.isTop} | 189 | size="mini" |
| 140 | onClick={() => { | 190 | class='resetbtnColor' |
| 141 | this.updateOrder(scope.row, 'TOP'); | 191 | onClick={() => { |
| 142 | }} | 192 | this.resetPassword(scope.row.id); |
| 143 | > | 193 | }} |
| 144 | 置顶 | 194 | > |
| 145 | </el-button> | 195 | 重置 |
| 146 | <el-button | 196 | </el-button> |
| 147 | type="text" | 197 | <el-button |
| 148 | class='movebtnColor' | 198 | type="text" |
| 149 | disabled={scope.row.isTop} | 199 | size="mini" |
| 150 | onClick={() => { | 200 | class='successColor' |
| 151 | this.updateOrder(scope.row, 'UP'); | 201 | onClick={() => { |
| 152 | }} | 202 | this.handleEdit(scope.row); |
| 153 | > | 203 | }} |
| 154 | 上移 | 204 | > |
| 155 | </el-button> | 205 | 修改 |
| 156 | <el-button | 206 | </el-button> |
| 157 | type="text" | 207 | <el-button |
| 158 | class='movebtnColor' | 208 | type="text" |
| 159 | disabled={scope.row.isBottom} | 209 | size="mini" |
| 160 | onClick={() => { | 210 | class='delColor' |
| 161 | this.updateOrder(scope.row, 'DOWN'); | 211 | onClick={() => { |
| 162 | }} | 212 | this.handleDelete(scope.row.id, scope.row.name); |
| 163 | > | 213 | }} |
| 164 | 下移 | 214 | > |
| 165 | </el-button> | 215 | 删除 |
| 166 | <el-button | 216 | </el-button> |
| 167 | type="text" | 217 | </div> |
| 168 | size="mini" | 218 | ); |
| 169 | class='movebtnColor' | ||
| 170 | disabled={scope.row.isBottom} | ||
| 171 | onClick={() => { | ||
| 172 | this.updateOrder(scope.row, 'BOTTOM'); | ||
| 173 | }} | ||
| 174 | > | ||
| 175 | 置底 | ||
| 176 | </el-button> | ||
| 177 | </div> | ||
| 178 | ); | ||
| 179 | }, | ||
| 180 | }, | 219 | }, |
| 220 | }, | ||
| 221 | ]), | ||
| 222 | data: [], | ||
| 223 | }, | ||
| 224 | }; | ||
| 225 | }, | ||
| 226 | created () { | ||
| 227 | this.getTableList(); | ||
| 228 | }, | ||
| 229 | computed: { | ||
| 230 | departmentid () { | ||
| 231 | return this.$store.state.user.userInfo; | ||
| 232 | }, | ||
| 233 | }, | ||
| 234 | methods: { | ||
| 235 | handleAdd () { | ||
| 236 | this.isDialog = true | ||
| 237 | this.$refs.dialogForm.adds(); | ||
| 238 | this.$refs.dialogForm.title = "添加"; | ||
| 239 | }, | ||
| 240 | // 查询 | ||
| 241 | getTableList () { | ||
| 242 | this.queryParam = { | ||
| 243 | name: this.form.name, | ||
| 244 | code: this.form.code, | ||
| 245 | loginName: this.form.loginName, | ||
| 246 | }; | ||
| 247 | getUserLists(this.queryParam).then((res) => { | ||
| 248 | if (res.status === 1) { | ||
| 249 | this.loading = false; | ||
| 250 | this.tableData.data = res.content; | ||
| 251 | this.tableData.data = judgeSort(this.tableData.data); | ||
| 252 | let arr = [] | ||
| 253 | this.tableData.data.forEach((item) => { | ||
| 254 | arr.push(item.departmentId) | ||
| 255 | }) | ||
| 256 | this.getDepts(arr) | ||
| 257 | } else { | ||
| 258 | this.$message.error({ message: res.message, showClose: true }) | ||
| 259 | } | ||
| 260 | }) | ||
| 261 | }, | ||
| 262 | // 获取组织机构 | ||
| 263 | getDepts (deptIdArr) { | ||
| 264 | let params = { | ||
| 265 | queryOptions: { | ||
| 266 | conditionGroup: { | ||
| 267 | conditions: [ | ||
| 181 | { | 268 | { |
| 182 | label: "操作", | 269 | property: "id", |
| 183 | width: 380, | 270 | value: deptIdArr, |
| 184 | render: (h, scope) => { | 271 | operator: "IN", |
| 185 | return ( | ||
| 186 | <div> | ||
| 187 | <el-button | ||
| 188 | type="text" | ||
| 189 | size="mini" | ||
| 190 | class='resetbtnColor' | ||
| 191 | onClick={() => { | ||
| 192 | this.resetPassword(scope.row.id); | ||
| 193 | }} | ||
| 194 | > | ||
| 195 | 重置 | ||
| 196 | </el-button> | ||
| 197 | <el-button | ||
| 198 | type="text" | ||
| 199 | size="mini" | ||
| 200 | class='successColor' | ||
| 201 | onClick={() => { | ||
| 202 | this.handleEdit(scope.row); | ||
| 203 | }} | ||
| 204 | > | ||
| 205 | 修改 | ||
| 206 | </el-button> | ||
| 207 | <el-button | ||
| 208 | type="text" | ||
| 209 | size="mini" | ||
| 210 | class='delColor' | ||
| 211 | onClick={() => { | ||
| 212 | this.handleDelete(scope.row.id, scope.row.name); | ||
| 213 | }} | ||
| 214 | > | ||
| 215 | 删除 | ||
| 216 | </el-button> | ||
| 217 | </div> | ||
| 218 | ); | ||
| 219 | }, | ||
| 220 | }, | 272 | }, |
| 221 | ]), | 273 | ], |
| 222 | data: [], | 274 | queryRelation: "AND", |
| 275 | }, | ||
| 276 | orderBys: [], | ||
| 223 | }, | 277 | }, |
| 224 | }; | 278 | }; |
| 225 | }, | 279 | getAction(api.departments, params).then( |
| 226 | created () { | 280 | (res) => { |
| 227 | this.getTableList(); | 281 | let deptsList = res.content; |
| 228 | }, | 282 | deptsList.forEach((ele) => { |
| 229 | computed: { | ||
| 230 | departmentid () { | ||
| 231 | return this.$store.state.user.userInfo; | ||
| 232 | }, | ||
| 233 | }, | ||
| 234 | methods: { | ||
| 235 | handleAdd () { | ||
| 236 | this.isDialog = true | ||
| 237 | this.$refs.dialogForm.adds(); | ||
| 238 | this.$refs.dialogForm.title = "添加"; | ||
| 239 | }, | ||
| 240 | // 查询 | ||
| 241 | getTableList () { | ||
| 242 | this.queryParam = { | ||
| 243 | name: this.form.name, | ||
| 244 | code: this.form.code, | ||
| 245 | loginName: this.form.loginName, | ||
| 246 | }; | ||
| 247 | getUserLists(this.queryParam).then((res) => { | ||
| 248 | if (res.status === 1) { | ||
| 249 | this.loading = false; | ||
| 250 | this.tableData.data = res.content; | ||
| 251 | this.tableData.data = judgeSort(this.tableData.data); | ||
| 252 | let arr = [] | ||
| 253 | this.tableData.data.forEach((item) => { | 283 | this.tableData.data.forEach((item) => { |
| 254 | arr.push(item.departmentId) | 284 | if (ele.id == item.departmentId) { |
| 255 | }) | 285 | item.departmentName = ele.name |
| 256 | this.getDepts(arr) | 286 | } |
| 257 | } else { | ||
| 258 | this.$message.error({ message: res.message, showClose: true }) | ||
| 259 | } | ||
| 260 | }) | ||
| 261 | }, | ||
| 262 | // 获取组织机构 | ||
| 263 | getDepts (deptIdArr) { | ||
| 264 | let params = { | ||
| 265 | queryOptions: { | ||
| 266 | conditionGroup: { | ||
| 267 | conditions: [ | ||
| 268 | { | ||
| 269 | property: "id", | ||
| 270 | value: deptIdArr, | ||
| 271 | operator: "IN", | ||
| 272 | }, | ||
| 273 | ], | ||
| 274 | queryRelation: "AND", | ||
| 275 | }, | ||
| 276 | orderBys: [], | ||
| 277 | }, | ||
| 278 | }; | ||
| 279 | getAction(api.departments, params).then( | ||
| 280 | (res) => { | ||
| 281 | let deptsList = res.content; | ||
| 282 | deptsList.forEach((ele) => { | ||
| 283 | this.tableData.data.forEach((item) => { | ||
| 284 | if (ele.id == item.departmentId) { | ||
| 285 | item.departmentName = ele.name | ||
| 286 | } | ||
| 287 | }) | ||
| 288 | }) | 287 | }) |
| 288 | }) | ||
| 289 | 289 | ||
| 290 | }, | 290 | }, |
| 291 | (err) => { | 291 | (err) => { |
| 292 | console.log("err :", err); | 292 | console.log("err :", err); |
| 293 | } | 293 | } |
| 294 | ); | 294 | ); |
| 295 | }, | 295 | }, |
| 296 | // getTableList () { | 296 | // getTableList () { |
| 297 | // this.loading = true; | 297 | // this.loading = true; |
| 298 | 298 | ||
| 299 | // getUserList().then((res) => { | 299 | // getUserList().then((res) => { |
| 300 | // if (res.status === 1) { | 300 | // if (res.status === 1) { |
| 301 | // console.log("res人员列表", res); | 301 | // console.log("res人员列表", res); |
| 302 | // this.loading = false; | 302 | // this.loading = false; |
| 303 | // this.tableData.data = res.content; | 303 | // this.tableData.data = res.content; |
| 304 | // this.tableData.data = judgeSort(this.tableData.data); | 304 | // this.tableData.data = judgeSort(this.tableData.data); |
| 305 | // } else { | 305 | // } else { |
| 306 | // this.$message.error({ message: res.message, showClose: true }); | 306 | // this.$message.error({ message: res.message, showClose: true }); |
| 307 | // } | 307 | // } |
| 308 | // }); | 308 | // }); |
| 309 | // }, | 309 | // }, |
| 310 | 310 | ||
| 311 | // 重置用户密码 | 311 | // 重置用户密码 |
| 312 | resetPassword (data) { | 312 | resetPassword (data) { |
| 313 | const ids = [] | 313 | const ids = [] |
| 314 | if (data instanceof Array) { | 314 | if (data instanceof Array) { |
| 315 | data.forEach((item) => { | 315 | data.forEach((item) => { |
| 316 | ids.push(item.id) | 316 | ids.push(item.id) |
| 317 | }) | 317 | }) |
| 318 | } else { | 318 | } else { |
| 319 | ids.push(data) | 319 | ids.push(data) |
| 320 | } | 320 | } |
| 321 | if (ids.length === 0) { | 321 | if (ids.length === 0) { |
| 322 | this.$message({ | 322 | this.$message({ |
| 323 | message: '请选择需要重置密码的用户!', | 323 | message: '请选择需要重置密码的用户!', |
| 324 | showClose: true | 324 | showClose: true |
| 325 | }) | 325 | }) |
| 326 | return | 326 | return |
| 327 | } | 327 | } |
| 328 | this.$confirm( | 328 | this.$confirm( |
| 329 | `<div class="customer-message-wrapper"> | 329 | `<div class="customer-message-wrapper"> |
| 330 | <h5 class="title">确定要重置密码吗</h5> | 330 | <h5 class="title">确定要重置密码吗</h5> |
| 331 | <p class="result">执行后,数据将 | 331 | <p class="result">执行后,数据将 |
| 332 | <span >无法恢复</span> | 332 | <span >无法恢复</span> |
| 333 | </p> | 333 | </p> |
| 334 | </div>`, | 334 | </div>`, |
| 335 | '执行确认', | 335 | '执行确认', |
| 336 | { | 336 | { |
| 337 | dangerouslyUseHTMLString: true, | ||
| 338 | customClass: 'customer-delete', | ||
| 339 | confirmButtonText: '确定', | ||
| 340 | cancelButtonText: '取消', | ||
| 341 | type: 'warning' | ||
| 342 | } | ||
| 343 | ) | ||
| 344 | .then(() => { | ||
| 345 | resetPassword(ids).then((res) => { | ||
| 346 | if (res.status === 1) { | ||
| 347 | this.$message.success({ message: res.message, showClose: true }) | ||
| 348 | this.getTableList() | ||
| 349 | } else { | ||
| 350 | this.$message.error({ message: res.message, showClose: true }) | ||
| 351 | } | ||
| 352 | }) | ||
| 353 | }) | ||
| 354 | .catch(() => { }) | ||
| 355 | }, | ||
| 356 | //排序 | ||
| 357 | updateOrder (record, operate) { | ||
| 358 | const findIndex = this.tableData.data.findIndex(item => item.id === record.id) | ||
| 359 | let swapId = '' | ||
| 360 | if (operate === 'UP') { | ||
| 361 | swapId = this.tableData.data[findIndex - 1].id | ||
| 362 | } else if (operate === 'DOWN') { | ||
| 363 | swapId = this.tableData.data[findIndex + 1].id | ||
| 364 | } | ||
| 365 | updateOrder('/rest/users', record, operate, swapId).then(res => { | ||
| 366 | if (res.status === 1) { | ||
| 367 | this.$message.success({ message: res.message, showClose: true }) | ||
| 368 | this.getTableList(); | ||
| 369 | } else { | ||
| 370 | this.$message.error({ message: res.message, showClose: true }) | ||
| 371 | } | ||
| 372 | }) | ||
| 373 | }, | ||
| 374 | |||
| 375 | // 修改人员信息 | ||
| 376 | handleEdit (row) { | ||
| 377 | console.log("rowwwww", row); | ||
| 378 | this.isDialog = true | ||
| 379 | this.$refs.dialogForm.edit(row); | ||
| 380 | this.$refs.dialogForm.title = "修改"; | ||
| 381 | }, | ||
| 382 | // 删除 | ||
| 383 | handleDelete (id, content) { | ||
| 384 | this.$confirm(deleteDomStr(content), '执行确认', { | ||
| 385 | dangerouslyUseHTMLString: true, | 337 | dangerouslyUseHTMLString: true, |
| 386 | customClass: 'customer-delete', | 338 | customClass: 'customer-delete', |
| 387 | confirmButtonText: '确定', | 339 | confirmButtonText: '确定', |
| 388 | cancelButtonText: '取消', | 340 | cancelButtonText: '取消', |
| 389 | type: 'warning' | 341 | type: 'warning' |
| 390 | }) | 342 | } |
| 391 | .then(() => { | 343 | ) |
| 392 | deleteAction(`${api.users}/${id}`).then((res) => { | 344 | .then(() => { |
| 393 | if (res.status === 1) { | 345 | resetPassword(ids).then((res) => { |
| 394 | this.$message.success({ message: res.message, showClose: true }) | 346 | if (res.status === 1) { |
| 395 | } else { | 347 | this.$message.success({ message: res.message, showClose: true }) |
| 396 | this.$message.error({ message: res.message, showClose: true }) | ||
| 397 | } | ||
| 398 | this.getTableList() | 348 | this.getTableList() |
| 399 | }) | 349 | } else { |
| 350 | this.$message.error({ message: res.message, showClose: true }) | ||
| 351 | } | ||
| 400 | }) | 352 | }) |
| 401 | .catch(() => { }) | 353 | }) |
| 402 | }, | 354 | .catch(() => { }) |
| 403 | // 新增回显 | ||
| 404 | reloadTableData () { | ||
| 405 | this.getTableList() | ||
| 406 | }, | ||
| 407 | }, | 355 | }, |
| 408 | }; | 356 | //排序 |
| 357 | updateOrder (record, operate) { | ||
| 358 | const findIndex = this.tableData.data.findIndex(item => item.id === record.id) | ||
| 359 | let swapId = '' | ||
| 360 | if (operate === 'UP') { | ||
| 361 | swapId = this.tableData.data[findIndex - 1].id | ||
| 362 | } else if (operate === 'DOWN') { | ||
| 363 | swapId = this.tableData.data[findIndex + 1].id | ||
| 364 | } | ||
| 365 | updateOrder('/rest/users', record, operate, swapId).then(res => { | ||
| 366 | if (res.status === 1) { | ||
| 367 | this.$message.success({ message: res.message, showClose: true }) | ||
| 368 | this.getTableList(); | ||
| 369 | } else { | ||
| 370 | this.$message.error({ message: res.message, showClose: true }) | ||
| 371 | } | ||
| 372 | }) | ||
| 373 | }, | ||
| 374 | |||
| 375 | // 修改人员信息 | ||
| 376 | handleEdit (row) { | ||
| 377 | console.log("rowwwww", row); | ||
| 378 | this.isDialog = true | ||
| 379 | this.$refs.dialogForm.edit(row); | ||
| 380 | this.$refs.dialogForm.title = "修改"; | ||
| 381 | }, | ||
| 382 | // 删除 | ||
| 383 | handleDelete (id, content) { | ||
| 384 | this.$confirm(deleteDomStr(content), '执行确认', { | ||
| 385 | dangerouslyUseHTMLString: true, | ||
| 386 | customClass: 'customer-delete', | ||
| 387 | confirmButtonText: '确定', | ||
| 388 | cancelButtonText: '取消', | ||
| 389 | type: 'warning' | ||
| 390 | }) | ||
| 391 | .then(() => { | ||
| 392 | deleteAction(`${api.users}/${id}`).then((res) => { | ||
| 393 | if (res.status === 1) { | ||
| 394 | this.$message.success({ message: res.message, showClose: true }) | ||
| 395 | } else { | ||
| 396 | this.$message.error({ message: res.message, showClose: true }) | ||
| 397 | } | ||
| 398 | this.getTableList() | ||
| 399 | }) | ||
| 400 | }) | ||
| 401 | .catch(() => { }) | ||
| 402 | }, | ||
| 403 | // 新增回显 | ||
| 404 | reloadTableData () { | ||
| 405 | this.getTableList() | ||
| 406 | }, | ||
| 407 | }, | ||
| 408 | }; | ||
| 409 | </script> | 409 | </script> |
| 410 | <style scoped lang="scss"> | 410 | <style scoped lang="scss"> |
| 411 | @import "~@/styles/mixin.scss"; | 411 | @import "~@/styles/mixin.scss"; |
| 412 | // .btnColRight { | 412 | |
| 413 | // height: 30px; | 413 | // .btnColRight { |
| 414 | // .button { | 414 | // height: 30px; |
| 415 | // position: absolute; | 415 | // .button { |
| 416 | // left: 30px; | 416 | // position: absolute; |
| 417 | // } | 417 | // left: 30px; |
| 418 | // } | 418 | // } |
| 419 | /deep/.el-button.is-disabled.el-button--text { | 419 | // } |
| 420 | width: 64px; | 420 | /deep/.el-button.is-disabled.el-button--text { |
| 421 | height: 28px; | 421 | width: 64px; |
| 422 | background: rgba(255, 255, 255, 0.1); | 422 | height: 28px; |
| 423 | border-radius: 16px; | 423 | background: rgba(255, 255, 255, 0.1); |
| 424 | } | 424 | border-radius: 16px; |
| 425 | } | ||
| 425 | </style> | 426 | </style> | ... | ... |
-
Please register or sign in to post a comment