Merge branch 'master' of http://yun.pashanhoo.com:9090/bdc/bdcjg-web
Showing
13 changed files
with
812 additions
and
1382 deletions
| ... | @@ -78,12 +78,12 @@ export const api = { | ... | @@ -78,12 +78,12 @@ export const api = { |
| 78 | crudPut: crud + '/rest/put', // crudPut | 78 | crudPut: crud + '/rest/put', // crudPut |
| 79 | crudDel: crud + '/rest/delete', // crudDel | 79 | crudDel: crud + '/rest/delete', // crudDel |
| 80 | crudMetadata: crud + '/rest/metadata', //crudMetadata | 80 | crudMetadata: crud + '/rest/metadata', //crudMetadata |
| 81 | crudBusiness : crud + '/rest/business', // crudBusiness | 81 | crudBusiness: crud + '/rest/business', // crudBusiness |
| 82 | crudDatasources : crud + '/rest/datasources', // crudDatasources | 82 | crudDatasources: crud + '/rest/datasources', // crudDatasources |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | // 根据code获取字典 params={isTree:true}) | 85 | // 根据code获取字典 params={isTree:true}) |
| 86 | export function getDictItems(code, params = {}) { | 86 | export function getDictItems (code, params = {}) { |
| 87 | return request({ | 87 | return request({ |
| 88 | url: `${api.baseDataCategory}/${code}/base-datas`, | 88 | url: `${api.baseDataCategory}/${code}/base-datas`, |
| 89 | method: 'get', | 89 | method: 'get', |
| ... | @@ -91,21 +91,21 @@ export function getDictItems(code, params = {}) { | ... | @@ -91,21 +91,21 @@ export function getDictItems(code, params = {}) { |
| 91 | }) | 91 | }) |
| 92 | } | 92 | } |
| 93 | // 获取一级字典值下级接口 | 93 | // 获取一级字典值下级接口 |
| 94 | export function getDictItemsChild(id) { | 94 | export function getDictItemsChild (id) { |
| 95 | return request({ | 95 | return request({ |
| 96 | url: `${api.baseData}/dict/${id}`, | 96 | url: `${api.baseData}/dict/${id}`, |
| 97 | method: 'get' | 97 | method: 'get' |
| 98 | }) | 98 | }) |
| 99 | } | 99 | } |
| 100 | // 获取传入字段的所有级别字典值 | 100 | // 获取传入字段的所有级别字典值 |
| 101 | export function getAllDictItems(name) { | 101 | export function getAllDictItems (name) { |
| 102 | return request({ | 102 | return request({ |
| 103 | url: `${api.baseDataCategory}/${name}/base-datas`, | 103 | url: `${api.baseDataCategory}/${name}/base-datas`, |
| 104 | method: 'get' | 104 | method: 'get' |
| 105 | }) | 105 | }) |
| 106 | } | 106 | } |
| 107 | // get公共方法 | 107 | // get公共方法 |
| 108 | export function getAction(url, params = {}) { | 108 | export function getAction (url, params = {}) { |
| 109 | return request({ | 109 | return request({ |
| 110 | url, | 110 | url, |
| 111 | method: 'get', | 111 | method: 'get', |
| ... | @@ -113,7 +113,7 @@ export function getAction(url, params = {}) { | ... | @@ -113,7 +113,7 @@ export function getAction(url, params = {}) { |
| 113 | }) | 113 | }) |
| 114 | } | 114 | } |
| 115 | // post公共方法 | 115 | // post公共方法 |
| 116 | export function postAction(url, data = null) { | 116 | export function postAction (url, data = null) { |
| 117 | return request({ | 117 | return request({ |
| 118 | url, | 118 | url, |
| 119 | method: 'post', | 119 | method: 'post', |
| ... | @@ -121,7 +121,7 @@ export function postAction(url, data = null) { | ... | @@ -121,7 +121,7 @@ export function postAction(url, data = null) { |
| 121 | }) | 121 | }) |
| 122 | } | 122 | } |
| 123 | // method= {post | put} | 123 | // method= {post | put} |
| 124 | export function httpAction(url, data, method) { | 124 | export function httpAction (url, data, method) { |
| 125 | return request({ | 125 | return request({ |
| 126 | url, | 126 | url, |
| 127 | method, | 127 | method, |
| ... | @@ -129,7 +129,7 @@ export function httpAction(url, data, method) { | ... | @@ -129,7 +129,7 @@ export function httpAction(url, data, method) { |
| 129 | }) | 129 | }) |
| 130 | } | 130 | } |
| 131 | // put公共方法 | 131 | // put公共方法 |
| 132 | export function putAction(url, data = null) { | 132 | export function putAction (url, data = null) { |
| 133 | return request({ | 133 | return request({ |
| 134 | url, | 134 | url, |
| 135 | method: 'put', | 135 | method: 'put', |
| ... | @@ -137,7 +137,7 @@ export function putAction(url, data = null) { | ... | @@ -137,7 +137,7 @@ export function putAction(url, data = null) { |
| 137 | }) | 137 | }) |
| 138 | } | 138 | } |
| 139 | // delete | 139 | // delete |
| 140 | export function deleteAction(url, data = null) { | 140 | export function deleteAction (url, data = null) { |
| 141 | return request({ | 141 | return request({ |
| 142 | url, | 142 | url, |
| 143 | method: 'delete', | 143 | method: 'delete', |
| ... | @@ -146,7 +146,7 @@ export function deleteAction(url, data = null) { | ... | @@ -146,7 +146,7 @@ export function deleteAction(url, data = null) { |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | // 批量删除 | 148 | // 批量删除 |
| 149 | export function deleteBranch(url, data) { | 149 | export function deleteBranch (url, data) { |
| 150 | return request({ | 150 | return request({ |
| 151 | url, | 151 | url, |
| 152 | method: 'delete', | 152 | method: 'delete', | ... | ... |
| ... | @@ -121,3 +121,6 @@ export const getRoleAuthorityList = ( | ... | @@ -121,3 +121,6 @@ export const getRoleAuthorityList = ( |
| 121 | export const roleAuthority = (id, permissionDtos) => { | 121 | export const roleAuthority = (id, permissionDtos) => { |
| 122 | return putAction(`${api.rolePermissions}/${id}`, permissionDtos) | 122 | return putAction(`${api.rolePermissions}/${id}`, permissionDtos) |
| 123 | } | 123 | } |
| 124 | export const updateUserPassword = (data) => { | ||
| 125 | return putAction(`${api.users}/update-password`, data) | ||
| 126 | } | ... | ... |
| ... | @@ -29,14 +29,14 @@ export default { | ... | @@ -29,14 +29,14 @@ export default { |
| 29 | sidebarRight, | 29 | sidebarRight, |
| 30 | }, | 30 | }, |
| 31 | computed: { | 31 | computed: { |
| 32 | ...mapGetters(["sidebar", "dicData"]), | 32 | ...mapGetters(["sidebar", "dicData","userInfo"]), |
| 33 | logoName() { | 33 | logoName() { |
| 34 | return this.dicData['sysCode'] && this.dicData['sysCode'].filter(item => | 34 | return this.dicData['sysCode'] && this.dicData['sysCode'].filter(item => |
| 35 | item.DCODE == "systemTitle" | 35 | item.DCODE == "systemTitle" |
| 36 | ) | 36 | ) |
| 37 | }, | 37 | }, |
| 38 | userName(){ | 38 | userName(){ |
| 39 | return this.$store.state.userInfo ? this.$store.state.userInfo.name : "" | 39 | return this.userInfo ? this.userInfo.name : "" |
| 40 | } | 40 | } |
| 41 | }, | 41 | }, |
| 42 | methods: { | 42 | methods: { | ... | ... |
| ... | @@ -6,8 +6,7 @@ | ... | @@ -6,8 +6,7 @@ |
| 6 | label-width="100px" | 6 | label-width="100px" |
| 7 | :model="form" | 7 | :model="form" |
| 8 | class="form-wrapper" | 8 | class="form-wrapper" |
| 9 | :rules="rules" | 9 | :rules="rules"> |
| 10 | > | ||
| 11 | <el-form-item label="用户名:" required> | 10 | <el-form-item label="用户名:" required> |
| 12 | <el-input v-model="form.loginName" clearable disabled /> | 11 | <el-input v-model="form.loginName" clearable disabled /> |
| 13 | </el-form-item> | 12 | </el-form-item> |
| ... | @@ -19,9 +18,7 @@ | ... | @@ -19,9 +18,7 @@ |
| 19 | <el-radio | 18 | <el-radio |
| 20 | v-for="(item, index) in sexList" | 19 | v-for="(item, index) in sexList" |
| 21 | :key="index" | 20 | :key="index" |
| 22 | :label="item.value" | 21 | :label="item.value">{{ item.name }}</el-radio> |
| 23 | >{{ item.name }}</el-radio | ||
| 24 | > | ||
| 25 | </el-radio-group> | 22 | </el-radio-group> |
| 26 | </el-form-item> | 23 | </el-form-item> |
| 27 | <el-form-item label="身份证号:" prop="idCard"> | 24 | <el-form-item label="身份证号:" prop="idCard"> |
| ... | @@ -30,7 +27,7 @@ | ... | @@ -30,7 +27,7 @@ |
| 30 | <el-form-item label="手机号码:" prop="mobilePhone"> | 27 | <el-form-item label="手机号码:" prop="mobilePhone"> |
| 31 | <el-input v-model="form.mobilePhone" clearable /> | 28 | <el-input v-model="form.mobilePhone" clearable /> |
| 32 | </el-form-item> | 29 | </el-form-item> |
| 33 | <el-form-item label="办公电话:" prop="telephone"> | 30 | <el-form-item label="办公电话:"> |
| 34 | <el-input v-model="form.telephone" clearable /> | 31 | <el-input v-model="form.telephone" clearable /> |
| 35 | </el-form-item> | 32 | </el-form-item> |
| 36 | <el-form-item label="办公地址:"> | 33 | <el-form-item label="办公地址:"> |
| ... | @@ -45,200 +42,117 @@ | ... | @@ -45,200 +42,117 @@ |
| 45 | </template> | 42 | </template> |
| 46 | 43 | ||
| 47 | <script> | 44 | <script> |
| 48 | // import { api, getAction, putAction, getDictItems } from '@api/manageApi' | 45 | import { api, getAction, putAction, getDictItems } from '@/api/manageApi' |
| 49 | export default { | 46 | export default { |
| 50 | props: { | 47 | props: { |
| 51 | // userInfo: { | 48 | userInfo: { |
| 52 | // type: Object, | 49 | type: Object, |
| 53 | // default: null | 50 | default: null |
| 54 | // } | 51 | } |
| 55 | }, | 52 | }, |
| 56 | data() { | 53 | data () { |
| 57 | return { | 54 | return { |
| 58 | form: { | 55 | form: {}, |
| 59 | id: "3127e455-43ba-45ff-9326-0e02ef89485e", | 56 | sexList: [], |
| 60 | name: "超级管理员", | 57 | rules: { |
| 61 | sort: 1, | 58 | mobilePhone: [ |
| 62 | loginName: "admin", | 59 | { |
| 63 | email: null, | 60 | pattern: |
| 64 | lastLoginTime: null, | 61 | /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, |
| 65 | mobilePhone: "18291003568", | 62 | message: '手机号码格式有误', |
| 66 | isLocked: false, | 63 | trigger: 'blur' |
| 67 | status: "ACTIVE", | 64 | } |
| 68 | passwordChangeTime: "2021-12-10T08:01:01.569+0000", | 65 | ], |
| 69 | idCard: "612725202111021521", | 66 | idCard: [ |
| 70 | departmentId: "2eae5304-544f-4f5b-b354-8f5d47433c9b", | 67 | { |
| 71 | departmentName: null, | 68 | pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, |
| 72 | organizationId: "0bca67ae-1d9e-4b41-b057-f165586d24aa", | 69 | message: '身份证号格式有误', |
| 73 | sex: "0", | 70 | trigger: 'blur' |
| 74 | isDuty: true, | 71 | } |
| 75 | code: "123324", | 72 | ] |
| 76 | jobLevel: null, | 73 | } |
| 77 | telephone: "028-87720898", | 74 | } |
| 78 | address: "办公地点修改测试", | 75 | }, |
| 79 | }, | 76 | watch: { |
| 80 | sexList: [], | 77 | userInfo: { |
| 81 | rules: { | 78 | handler: function (val) { |
| 82 | mobilePhone: [ | 79 | if (val) { |
| 83 | { | 80 | this.getUserInfo(val.id) |
| 84 | pattern: | 81 | } |
| 85 | /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, | 82 | } |
| 86 | message: "手机号码格式有误", | 83 | } |
| 87 | trigger: "blur", | 84 | }, |
| 88 | }, | 85 | mounted () { |
| 89 | ], | 86 | this.sexList = [ |
| 90 | idCard: [ | 87 | { |
| 91 | { | 88 | "name": "男", |
| 92 | pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, | 89 | "value": "0", |
| 93 | message: "身份证号格式有误", | 90 | }, |
| 94 | trigger: "blur", | 91 | { |
| 95 | }, | 92 | |
| 96 | ], | 93 | "name": "女", |
| 97 | telephone: [ | 94 | "value": "1", |
| 98 | { | 95 | }, |
| 99 | pattern: /\d{3}-\d{8}|\d{4}-\d{7}/, | 96 | |
| 100 | message: "办公电话格式有误", | 97 | { |
| 101 | trigger: "blur", | 98 | "name": "保密", |
| 102 | }, | 99 | "value": "2", |
| 103 | ], | ||
| 104 | }, | ||
| 105 | }; | ||
| 106 | }, | ||
| 107 | watch: { | ||
| 108 | // userInfo: { | ||
| 109 | // handler: function(val) { | ||
| 110 | // if (val) { | ||
| 111 | // this.getUserInfo(val.id) | ||
| 112 | // } | ||
| 113 | // } | ||
| 114 | // } | ||
| 115 | }, | ||
| 116 | mounted() { | ||
| 117 | // getDictItems('XB').then((res) => { | ||
| 118 | // if (res.status === 1) { | ||
| 119 | this.sexList = [ | ||
| 120 | { | ||
| 121 | id: "079c72b2-f3de-4a4f-b2a1-e5c8f085cc5f", | ||
| 122 | createdAt: "2021-06-11T02:42:02.000+0000", | ||
| 123 | updatedAt: "2021-09-03T09:21:46.000+0000", | ||
| 124 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 125 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 126 | sort: 2, | ||
| 127 | name: "男", | ||
| 128 | description: "", | ||
| 129 | code: "N362", | ||
| 130 | value: "0", | ||
| 131 | parentId: null, | ||
| 132 | baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019", | ||
| 133 | version: 1, | ||
| 134 | valid: true, | ||
| 135 | standard: false, | ||
| 136 | standardName: null, | ||
| 137 | standardValue: null, | ||
| 138 | children: [], | ||
| 139 | commonName: "男(N362)", | ||
| 140 | }, | ||
| 141 | { | ||
| 142 | id: "4d6f845d-6f6a-4848-8fc2-a3760764c196", | ||
| 143 | createdAt: "2021-06-11T02:42:12.000+0000", | ||
| 144 | updatedAt: "2021-09-03T09:21:46.000+0000", | ||
| 145 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 146 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 147 | sort: 1, | ||
| 148 | name: "女", | ||
| 149 | description: "", | ||
| 150 | code: "N922", | ||
| 151 | value: "1", | ||
| 152 | parentId: null, | ||
| 153 | baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019", | ||
| 154 | version: 1, | ||
| 155 | valid: true, | ||
| 156 | standard: false, | ||
| 157 | standardName: null, | ||
| 158 | standardValue: null, | ||
| 159 | children: [], | ||
| 160 | commonName: "女(N922)", | ||
| 161 | }, | ||
| 162 | { | ||
| 163 | id: "637c360b-d4e2-4afb-aa18-33624cf3abcb", | ||
| 164 | createdAt: "2021-06-11T02:42:29.000+0000", | ||
| 165 | updatedAt: "2021-09-03T09:21:43.000+0000", | ||
| 166 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 167 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 168 | sort: 0, | ||
| 169 | name: "保密", | ||
| 170 | description: "", | ||
| 171 | code: "BM816", | ||
| 172 | value: "2", | ||
| 173 | parentId: null, | ||
| 174 | baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019", | ||
| 175 | version: 1, | ||
| 176 | valid: true, | ||
| 177 | standard: false, | ||
| 178 | standardName: null, | ||
| 179 | standardValue: null, | ||
| 180 | children: [], | ||
| 181 | commonName: "保密(BM816)", | ||
| 182 | }, | ||
| 183 | ]; | ||
| 184 | // } else { | ||
| 185 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 186 | // } | ||
| 187 | // }) | ||
| 188 | }, | ||
| 189 | methods: { | ||
| 190 | // getUserInfo(id) { | ||
| 191 | // getAction(`${api.users}/${id}`).then((res) => { | ||
| 192 | // if (res.status === 1) { | ||
| 193 | 100 | ||
| 194 | // } else { | 101 | } |
| 195 | // this.$message.error({ message: res.message, showClose: true }) | 102 | ] |
| 196 | // } | ||
| 197 | // }) | ||
| 198 | // }, | ||
| 199 | // 更新信息 | ||
| 200 | updateInfo() { | ||
| 201 | // this.$refs.form.validate((valid) => { | ||
| 202 | // if (valid) { | ||
| 203 | // putAction(`${api.users}/${this.form.id}`, this.form).then((res) => { | ||
| 204 | // if (res.status === 1) { | ||
| 205 | // this.$message.success({ message: res.message, showClose: true }) | ||
| 206 | // this.getUserInfo(this.form.id) | ||
| 207 | // } else { | ||
| 208 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 209 | // } | ||
| 210 | // }) | ||
| 211 | // } | ||
| 212 | // }) | ||
| 213 | }, | 103 | }, |
| 214 | }, | 104 | methods: { |
| 215 | }; | 105 | getUserInfo (id) { |
| 106 | getAction(`${api.users}/${id}`).then((res) => { | ||
| 107 | if (res.status === 1) { | ||
| 108 | this.form = res.content | ||
| 109 | } else { | ||
| 110 | this.$message.error({ message: res.message, showClose: true }) | ||
| 111 | } | ||
| 112 | }) | ||
| 113 | }, | ||
| 114 | updateInfo () { | ||
| 115 | this.$refs.form.validate((valid) => { | ||
| 116 | if (valid) { | ||
| 117 | putAction(`${api.users}/${this.form.id}`, this.form).then((res) => { | ||
| 118 | if (res.status === 1) { | ||
| 119 | this.$message.success({ message: res.message, showClose: true }) | ||
| 120 | this.getUserInfo(this.form.id) | ||
| 121 | } else { | ||
| 122 | this.$message.error({ message: res.message, showClose: true }) | ||
| 123 | } | ||
| 124 | }) | ||
| 125 | } | ||
| 126 | }) | ||
| 127 | } | ||
| 128 | } | ||
| 129 | } | ||
| 216 | </script> | 130 | </script> |
| 217 | 131 | ||
| 218 | <style scoped lang="scss"> | 132 | <style scoped lang="scss"> |
| 219 | .user-info { | 133 | .user-info { |
| 220 | margin: 0.1875rem 1.0417rem; | 134 | margin: 0.1875rem 1.0417rem; |
| 221 | background: #ffffff; | 135 | background: #ffffff; |
| 222 | max-height: 90%; | 136 | max-height: 90%; |
| 223 | overflow-y: auto; | 137 | overflow-y: auto; |
| 224 | .form-wrapper { | 138 | .form-wrapper { |
| 225 | padding: 24px 120px 0px; | 139 | padding: 24px 120px 0px; |
| 226 | .el-form-item { | 140 | .el-form-item { |
| 227 | margin-bottom: 24px; | 141 | margin-bottom: 24px; |
| 228 | .el-form-item__label { | 142 | .el-form-item__label { |
| 229 | color: #747e8c; | 143 | color: #747e8c; |
| 230 | } | 144 | } |
| 231 | ::v-deep .el-input .el-input__inner { | 145 | ::v-deep .el-input .el-input__inner { |
| 232 | padding: 0 8px; | 146 | padding: 0 8px; |
| 233 | height: 40px; | 147 | height: 40px; |
| 234 | line-height: 40px; | 148 | line-height: 40px; |
| 235 | border: 1px solid #6BC1FC; | 149 | border: 1px solid #6bc1fc; |
| 150 | } | ||
| 236 | } | 151 | } |
| 237 | } | 152 | } |
| 153 | .bottom-wrapper { | ||
| 154 | padding: 32px 120px 24px; | ||
| 155 | text-align: right; | ||
| 156 | } | ||
| 238 | } | 157 | } |
| 239 | .bottom-wrapper { | ||
| 240 | padding: 32px 120px 24px; | ||
| 241 | text-align: right; | ||
| 242 | } | ||
| 243 | } | ||
| 244 | </style> | 158 | </style> | ... | ... |
| ... | @@ -15,69 +15,74 @@ | ... | @@ -15,69 +15,74 @@ |
| 15 | </div> | 15 | </div> |
| 16 | <div class="from-clues-content"> | 16 | <div class="from-clues-content"> |
| 17 | <div class="contentbox"> | 17 | <div class="contentbox"> |
| 18 | <base-set v-show="isshow" /> | 18 | <base-set v-show="isshow" :user-info="userData" /> |
| 19 | <password-edit v-show="!isshow" /> | 19 | <password-edit v-show="!isshow" :user-info="userData" /> |
| 20 | </div> | 20 | </div> |
| 21 | </div> | 21 | </div> |
| 22 | </div> | 22 | </div> |
| 23 | </template> | 23 | </template> |
| 24 | <script> | 24 | <script> |
| 25 | import "@/utils/flexible.js"; | 25 | import "@/utils/flexible.js"; |
| 26 | import BaseSet from "./base-set.vue"; | 26 | import BaseSet from "./base-set.vue"; |
| 27 | import PasswordEdit from "./password-edit.vue"; | 27 | import PasswordEdit from "./password-edit.vue"; |
| 28 | export default { | 28 | export default { |
| 29 | components: { | 29 | components: { |
| 30 | BaseSet, | 30 | BaseSet, |
| 31 | PasswordEdit, | 31 | PasswordEdit, |
| 32 | }, | ||
| 33 | data() { | ||
| 34 | return { | ||
| 35 | active: "baseSet", | ||
| 36 | isshow: true, | ||
| 37 | }; | ||
| 38 | }, | ||
| 39 | computed: {}, | ||
| 40 | watch: {}, | ||
| 41 | created() {}, | ||
| 42 | mounted() {}, | ||
| 43 | methods: { | ||
| 44 | information() { | ||
| 45 | this.isshow = true; | ||
| 46 | }, | 32 | }, |
| 47 | password() { | 33 | data () { |
| 48 | this.isshow = false; | 34 | return { |
| 35 | isshow: true, | ||
| 36 | userData: null | ||
| 37 | }; | ||
| 49 | }, | 38 | }, |
| 50 | }, | 39 | computed: { |
| 51 | }; | 40 | departmentid () { |
| 41 | return this.$store.state.user.userInfo; | ||
| 42 | }, | ||
| 43 | }, | ||
| 44 | watch: {}, | ||
| 45 | created () { }, | ||
| 46 | mounted () { | ||
| 47 | if (this.departmentid) { | ||
| 48 | this.userData = this.departmentid | ||
| 49 | } | ||
| 50 | |||
| 51 | }, | ||
| 52 | methods: { | ||
| 53 | information () { | ||
| 54 | this.isshow = true; | ||
| 55 | }, | ||
| 56 | password () { | ||
| 57 | this.isshow = false; | ||
| 58 | }, | ||
| 59 | }, | ||
| 60 | }; | ||
| 52 | </script> | 61 | </script> |
| 53 | 62 | ||
| 54 | <style scoped lang="scss"> | 63 | <style scoped lang="scss"> |
| 55 | @import "~@/styles/mixin.scss"; | 64 | @import "~@/styles/mixin.scss"; |
| 56 | @import "~@/styles/public.scss"; | 65 | @import "~@/styles/public.scss"; |
| 57 | .information{ | 66 | .information { |
| 58 | .btnColRight{ | 67 | .btnColRight { |
| 59 | margin-top: 20px; | 68 | margin-top: 20px; |
| 60 | } | 69 | } |
| 61 | /deep/.content { | 70 | /deep/.content { |
| 62 | .el-input__inner{ | 71 | .el-input__inner { |
| 63 | background: none; | 72 | background: none; |
| 64 | } | 73 | } |
| 65 | .user-info { | 74 | .user-info { |
| 66 | background: none; | 75 | background: none; |
| 67 | } | 76 | } |
| 77 | } | ||
| 78 | /deep/.el-tabs { | ||
| 79 | .el-tabs__content { | ||
| 80 | height: 100%; | ||
| 81 | width: 100%; | ||
| 82 | } | ||
| 83 | } | ||
| 84 | .contentbox { | ||
| 85 | height: 3.0854rem; | ||
| 68 | } | 86 | } |
| 69 | /deep/.el-tabs { | ||
| 70 | |||
| 71 | .el-tabs__content { | ||
| 72 | height: 100%; | ||
| 73 | width: 100%; | ||
| 74 | |||
| 75 | |||
| 76 | } | 87 | } |
| 77 | } | ||
| 78 | .contentbox{ | ||
| 79 | height: 3.0854rem; | ||
| 80 | } | ||
| 81 | } | ||
| 82 | |||
| 83 | </style> | 88 | </style> | ... | ... |
| ... | @@ -6,31 +6,27 @@ | ... | @@ -6,31 +6,27 @@ |
| 6 | label-width="100px" | 6 | label-width="100px" |
| 7 | :model="form" | 7 | :model="form" |
| 8 | class="form-wrapper" | 8 | class="form-wrapper" |
| 9 | :rules="rules" | 9 | :rules="rules"> |
| 10 | > | 10 | <el-form-item label="旧密码:" prop="oldPassword"> |
| 11 | <el-form-item label="旧密码:" required prop="oldPassword"> | ||
| 12 | <el-input | 11 | <el-input |
| 13 | v-model="form.oldPassword" | 12 | v-model="form.oldPassword" |
| 14 | clearable | 13 | clearable |
| 15 | type="password" | 14 | type="password" |
| 16 | show-password | 15 | show-password /> |
| 17 | /> | ||
| 18 | </el-form-item> | 16 | </el-form-item> |
| 19 | <el-form-item label="新密码:" required prop="newPassword"> | 17 | <el-form-item label="新密码:" prop="newPassword"> |
| 20 | <el-input | 18 | <el-input |
| 21 | v-model="form.newPassword" | 19 | v-model="form.newPassword" |
| 22 | clearable | 20 | clearable |
| 23 | type="password" | 21 | type="password" |
| 24 | show-password | 22 | show-password /> |
| 25 | /> | ||
| 26 | </el-form-item> | 23 | </el-form-item> |
| 27 | <el-form-item label="确认密码:" required prop="confirmPassword"> | 24 | <el-form-item label="确认密码:" prop="confirmPassword"> |
| 28 | <el-input | 25 | <el-input |
| 29 | v-model="form.confirmPassword" | 26 | v-model="form.confirmPassword" |
| 30 | clearable | 27 | clearable |
| 31 | type="password" | 28 | type="password" |
| 32 | show-password | 29 | show-password /> |
| 33 | /> | ||
| 34 | </el-form-item> | 30 | </el-form-item> |
| 35 | </el-form> | 31 | </el-form> |
| 36 | <div class="bottom-wrapper"> | 32 | <div class="bottom-wrapper"> |
| ... | @@ -41,96 +37,95 @@ | ... | @@ -41,96 +37,95 @@ |
| 41 | </template> | 37 | </template> |
| 42 | 38 | ||
| 43 | <script> | 39 | <script> |
| 44 | // import { updateUserPassword } from '@api/organizationManage' | 40 | import { updateUserPassword } from "@/api/quanxianmanagement"; |
| 45 | export default { | 41 | export default { |
| 46 | props: { | 42 | props: { |
| 47 | // userInfo: { | 43 | userInfo: { |
| 48 | // type: Object, | 44 | type: Object, |
| 49 | // default: null | 45 | default: null |
| 50 | // } | ||
| 51 | }, | ||
| 52 | data() { | ||
| 53 | return { | ||
| 54 | form: {}, | ||
| 55 | sexList: [], | ||
| 56 | userId: '', | ||
| 57 | rules: { | ||
| 58 | oldPassword: [ | ||
| 59 | { required: true, message: '旧密码不能为空', trigger: 'blur' } | ||
| 60 | ], | ||
| 61 | newPassword: [ | ||
| 62 | { required: true, message: '新密码不能为空', trigger: 'blur' } | ||
| 63 | ], | ||
| 64 | confirmPassword: [ | ||
| 65 | { required: true, message: '确认密码不能为空', trigger: 'blur' }, | ||
| 66 | { validator: this.validatorConfirmPassword, trigger: 'blur' } | ||
| 67 | ] | ||
| 68 | } | 46 | } |
| 69 | } | 47 | }, |
| 70 | }, | 48 | data () { |
| 71 | computed: {}, | 49 | return { |
| 72 | watch: { | 50 | form: {}, |
| 73 | // userInfo: { | 51 | sexList: [], |
| 74 | // handler: function(val) { | 52 | userId: '', |
| 75 | // if (val) { | 53 | rules: { |
| 76 | // this.userId = val.id | 54 | oldPassword: [ |
| 77 | // } | 55 | { required: true, message: '旧密码不能为空', trigger: 'blur' } |
| 78 | // } | 56 | ], |
| 79 | // } | 57 | newPassword: [ |
| 80 | }, | 58 | { required: true, message: '新密码不能为空', trigger: 'blur' } |
| 81 | mounted() {}, | 59 | ], |
| 82 | methods: { | 60 | confirmPassword: [ |
| 83 | validatorConfirmPassword(rule, value, callback) { | 61 | { required: true, message: '确认密码不能为空', trigger: 'blur' }, |
| 84 | const { newPassword } = this.form | 62 | { validator: this.validatorConfirmPassword, trigger: 'blur' } |
| 85 | if (value !== newPassword) { | 63 | ] |
| 86 | callback('两次输入密码不一致') | 64 | } |
| 87 | } else { | 65 | } |
| 88 | callback() | 66 | }, |
| 67 | computed: {}, | ||
| 68 | watch: { | ||
| 69 | userInfo: { | ||
| 70 | handler: function (val) { | ||
| 71 | if (val) { | ||
| 72 | this.userId = val.id | ||
| 73 | } | ||
| 74 | } | ||
| 89 | } | 75 | } |
| 90 | }, | 76 | }, |
| 91 | // 确认修改 | 77 | mounted () { }, |
| 92 | updatePassword() { | 78 | methods: { |
| 93 | // this.$refs.form.validate((valid) => { | 79 | validatorConfirmPassword (rule, value, callback) { |
| 94 | // if (valid) { | 80 | const { newPassword } = this.form |
| 95 | // const params = Object.assign({}, this.form, { id: this.userId }) | 81 | if (value !== newPassword) { |
| 96 | // updateUserPassword(params).then((res) => { | 82 | callback('两次输入密码不一致') |
| 97 | // if (res.status === 1) { | 83 | } else { |
| 98 | // this.$message.success({ message: res.message, showClose: true }) | 84 | callback() |
| 99 | // } else { | 85 | } |
| 100 | // this.$message.error({ message: res.message, showClose: true }) | 86 | }, |
| 101 | // } | 87 | updatePassword () { |
| 102 | // }) | 88 | this.$refs.form.validate((valid) => { |
| 103 | // } | 89 | if (valid) { |
| 104 | // }) | 90 | const params = Object.assign({}, this.form, { id: this.userId }) |
| 91 | updateUserPassword(params).then((res) => { | ||
| 92 | if (res.status === 1) { | ||
| 93 | this.$message.success({ message: res.message, showClose: true }) | ||
| 94 | } else { | ||
| 95 | this.$message.error({ message: res.message, showClose: true }) | ||
| 96 | } | ||
| 97 | }) | ||
| 98 | } | ||
| 99 | }) | ||
| 100 | } | ||
| 105 | } | 101 | } |
| 106 | } | 102 | } |
| 107 | } | ||
| 108 | </script> | 103 | </script> |
| 109 | 104 | ||
| 110 | <style scoped lang="scss"> | 105 | <style scoped lang="scss"> |
| 111 | .user-info { | 106 | .user-info { |
| 112 | margin: 36px 200px; | 107 | margin: 36px 200px; |
| 113 | background: #ffffff; | 108 | background: #ffffff; |
| 114 | max-height: 90%; | 109 | max-height: 90%; |
| 115 | overflow-y: auto; | 110 | overflow-y: auto; |
| 116 | .form-wrapper { | 111 | .form-wrapper { |
| 117 | padding: 24px 120px 0px; | 112 | padding: 24px 120px 0px; |
| 118 | .el-form-item { | 113 | .el-form-item { |
| 119 | margin-bottom: 24px; | 114 | margin-bottom: 24px; |
| 120 | .el-form-item__label { | 115 | .el-form-item__label { |
| 121 | color: #747e8c; | 116 | color: #747e8c; |
| 122 | } | 117 | } |
| 123 | ::v-deep .el-input .el-input__inner { | 118 | ::v-deep .el-input .el-input__inner { |
| 124 | padding: 0 8px; | 119 | padding: 0 8px; |
| 125 | height: 40px; | 120 | height: 40px; |
| 126 | line-height: 40px; | 121 | line-height: 40px; |
| 127 | border: 1px solid #6BC1FC; | 122 | border: 1px solid #6bc1fc; |
| 123 | } | ||
| 128 | } | 124 | } |
| 129 | } | 125 | } |
| 126 | .bottom-wrapper { | ||
| 127 | padding: 32px 120px 24px; | ||
| 128 | text-align: right; | ||
| 129 | } | ||
| 130 | } | 130 | } |
| 131 | .bottom-wrapper { | ||
| 132 | padding: 32px 120px 24px; | ||
| 133 | text-align: right; | ||
| 134 | } | ||
| 135 | } | ||
| 136 | </style> | 131 | </style> | ... | ... |
| 1 | <template> | ||
| 2 | <div class="content"> | ||
| 3 | <div class="user-info"> | ||
| 4 | <el-form | ||
| 5 | ref="form" | ||
| 6 | label-width="100px" | ||
| 7 | :model="form" | ||
| 8 | class="form-wrapper" | ||
| 9 | :rules="rules" | ||
| 10 | > | ||
| 11 | <el-form-item label="用户名:" required> | ||
| 12 | <el-input v-model="form.loginName" clearable disabled /> | ||
| 13 | </el-form-item> | ||
| 14 | <el-form-item label="姓名:"> | ||
| 15 | <el-input v-model="form.name" clearable /> | ||
| 16 | </el-form-item> | ||
| 17 | <el-form-item label="性别:"> | ||
| 18 | <el-radio-group v-model="form.sex"> | ||
| 19 | <el-radio | ||
| 20 | v-for="(item, index) in sexList" | ||
| 21 | :key="index" | ||
| 22 | :label="item.value" | ||
| 23 | >{{ item.name }}</el-radio | ||
| 24 | > | ||
| 25 | </el-radio-group> | ||
| 26 | </el-form-item> | ||
| 27 | <el-form-item label="身份证号:" prop="idCard"> | ||
| 28 | <el-input v-model="form.idCard" clearable /> | ||
| 29 | </el-form-item> | ||
| 30 | <el-form-item label="手机号码:" prop="mobilePhone"> | ||
| 31 | <el-input v-model="form.mobilePhone" clearable /> | ||
| 32 | </el-form-item> | ||
| 33 | <el-form-item label="办公电话:" prop="telephone"> | ||
| 34 | <el-input v-model="form.telephone" clearable /> | ||
| 35 | </el-form-item> | ||
| 36 | <el-form-item label="办公地址:"> | ||
| 37 | <el-input v-model="form.address" clearable /> | ||
| 38 | </el-form-item> | ||
| 39 | </el-form> | ||
| 40 | <div class="bottom-wrapper"> | ||
| 41 | <el-button type="primary" @click="updateInfo">更新信息</el-button> | ||
| 42 | </div> | ||
| 43 | </div> | ||
| 44 | </div> | ||
| 45 | </template> | ||
| 46 | |||
| 47 | <script> | ||
| 48 | // import { api, getAction, putAction, getDictItems } from '@api/manageApi' | ||
| 49 | export default { | ||
| 50 | props: { | ||
| 51 | // userInfo: { | ||
| 52 | // type: Object, | ||
| 53 | // default: null | ||
| 54 | // } | ||
| 55 | }, | ||
| 56 | data() { | ||
| 57 | return { | ||
| 58 | form: { | ||
| 59 | id: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 60 | name: "超级管理员", | ||
| 61 | sort: 1, | ||
| 62 | loginName: "admin", | ||
| 63 | email: null, | ||
| 64 | lastLoginTime: null, | ||
| 65 | mobilePhone: "18291003568", | ||
| 66 | isLocked: false, | ||
| 67 | status: "ACTIVE", | ||
| 68 | passwordChangeTime: "2021-12-10T08:01:01.569+0000", | ||
| 69 | idCard: "612725202111021521", | ||
| 70 | departmentId: "2eae5304-544f-4f5b-b354-8f5d47433c9b", | ||
| 71 | departmentName: null, | ||
| 72 | organizationId: "0bca67ae-1d9e-4b41-b057-f165586d24aa", | ||
| 73 | sex: "0", | ||
| 74 | isDuty: true, | ||
| 75 | code: "123324", | ||
| 76 | jobLevel: null, | ||
| 77 | telephone: "028-87720898", | ||
| 78 | address: "办公地点修改测试", | ||
| 79 | }, | ||
| 80 | sexList: [], | ||
| 81 | rules: { | ||
| 82 | mobilePhone: [ | ||
| 83 | { | ||
| 84 | pattern: | ||
| 85 | /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, | ||
| 86 | message: "手机号码格式有误", | ||
| 87 | trigger: "blur", | ||
| 88 | }, | ||
| 89 | ], | ||
| 90 | idCard: [ | ||
| 91 | { | ||
| 92 | pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, | ||
| 93 | message: "身份证号格式有误", | ||
| 94 | trigger: "blur", | ||
| 95 | }, | ||
| 96 | ], | ||
| 97 | telephone: [ | ||
| 98 | { | ||
| 99 | pattern: /\d{3}-\d{8}|\d{4}-\d{7}/, | ||
| 100 | message: "办公电话格式有误", | ||
| 101 | trigger: "blur", | ||
| 102 | }, | ||
| 103 | ], | ||
| 104 | }, | ||
| 105 | }; | ||
| 106 | }, | ||
| 107 | watch: { | ||
| 108 | // userInfo: { | ||
| 109 | // handler: function(val) { | ||
| 110 | // if (val) { | ||
| 111 | // this.getUserInfo(val.id) | ||
| 112 | // } | ||
| 113 | // } | ||
| 114 | // } | ||
| 115 | }, | ||
| 116 | mounted() { | ||
| 117 | // getDictItems('XB').then((res) => { | ||
| 118 | // if (res.status === 1) { | ||
| 119 | this.sexList = [ | ||
| 120 | { | ||
| 121 | id: "079c72b2-f3de-4a4f-b2a1-e5c8f085cc5f", | ||
| 122 | createdAt: "2021-06-11T02:42:02.000+0000", | ||
| 123 | updatedAt: "2021-09-03T09:21:46.000+0000", | ||
| 124 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 125 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 126 | sort: 2, | ||
| 127 | name: "男", | ||
| 128 | description: "", | ||
| 129 | code: "N362", | ||
| 130 | value: "0", | ||
| 131 | parentId: null, | ||
| 132 | baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019", | ||
| 133 | version: 1, | ||
| 134 | valid: true, | ||
| 135 | standard: false, | ||
| 136 | standardName: null, | ||
| 137 | standardValue: null, | ||
| 138 | children: [], | ||
| 139 | commonName: "男(N362)", | ||
| 140 | }, | ||
| 141 | { | ||
| 142 | id: "4d6f845d-6f6a-4848-8fc2-a3760764c196", | ||
| 143 | createdAt: "2021-06-11T02:42:12.000+0000", | ||
| 144 | updatedAt: "2021-09-03T09:21:46.000+0000", | ||
| 145 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 146 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 147 | sort: 1, | ||
| 148 | name: "女", | ||
| 149 | description: "", | ||
| 150 | code: "N922", | ||
| 151 | value: "1", | ||
| 152 | parentId: null, | ||
| 153 | baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019", | ||
| 154 | version: 1, | ||
| 155 | valid: true, | ||
| 156 | standard: false, | ||
| 157 | standardName: null, | ||
| 158 | standardValue: null, | ||
| 159 | children: [], | ||
| 160 | commonName: "女(N922)", | ||
| 161 | }, | ||
| 162 | { | ||
| 163 | id: "637c360b-d4e2-4afb-aa18-33624cf3abcb", | ||
| 164 | createdAt: "2021-06-11T02:42:29.000+0000", | ||
| 165 | updatedAt: "2021-09-03T09:21:43.000+0000", | ||
| 166 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 167 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
| 168 | sort: 0, | ||
| 169 | name: "保密", | ||
| 170 | description: "", | ||
| 171 | code: "BM816", | ||
| 172 | value: "2", | ||
| 173 | parentId: null, | ||
| 174 | baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019", | ||
| 175 | version: 1, | ||
| 176 | valid: true, | ||
| 177 | standard: false, | ||
| 178 | standardName: null, | ||
| 179 | standardValue: null, | ||
| 180 | children: [], | ||
| 181 | commonName: "保密(BM816)", | ||
| 182 | }, | ||
| 183 | ]; | ||
| 184 | // } else { | ||
| 185 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 186 | // } | ||
| 187 | // }) | ||
| 188 | }, | ||
| 189 | methods: { | ||
| 190 | // getUserInfo(id) { | ||
| 191 | // getAction(`${api.users}/${id}`).then((res) => { | ||
| 192 | // if (res.status === 1) { | ||
| 193 | |||
| 194 | // } else { | ||
| 195 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 196 | // } | ||
| 197 | // }) | ||
| 198 | // }, | ||
| 199 | // 更新信息 | ||
| 200 | updateInfo() { | ||
| 201 | // this.$refs.form.validate((valid) => { | ||
| 202 | // if (valid) { | ||
| 203 | // putAction(`${api.users}/${this.form.id}`, this.form).then((res) => { | ||
| 204 | // if (res.status === 1) { | ||
| 205 | // this.$message.success({ message: res.message, showClose: true }) | ||
| 206 | // this.getUserInfo(this.form.id) | ||
| 207 | // } else { | ||
| 208 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 209 | // } | ||
| 210 | // }) | ||
| 211 | // } | ||
| 212 | // }) | ||
| 213 | }, | ||
| 214 | }, | ||
| 215 | }; | ||
| 216 | </script> | ||
| 217 | |||
| 218 | <style scoped lang="scss"> | ||
| 219 | .user-info { | ||
| 220 | margin: 0.1875rem 1.0417rem; | ||
| 221 | background: #ffffff; | ||
| 222 | max-height: 90%; | ||
| 223 | overflow-y: auto; | ||
| 224 | .form-wrapper { | ||
| 225 | padding: 24px 120px 0px; | ||
| 226 | .el-form-item { | ||
| 227 | margin-bottom: 24px; | ||
| 228 | .el-form-item__label { | ||
| 229 | color: #747e8c; | ||
| 230 | } | ||
| 231 | ::v-deep .el-input .el-input__inner { | ||
| 232 | padding: 0 8px; | ||
| 233 | height: 40px; | ||
| 234 | line-height: 40px; | ||
| 235 | border: 1px solid #6BC1FC; | ||
| 236 | } | ||
| 237 | } | ||
| 238 | } | ||
| 239 | .bottom-wrapper { | ||
| 240 | padding: 32px 120px 24px; | ||
| 241 | text-align: right; | ||
| 242 | } | ||
| 243 | } | ||
| 244 | </style> |
| 1 | <template> | ||
| 2 | <div class="information from-clues"> | ||
| 3 | <div class="from-clues-header"> | ||
| 4 | <el-form ref="ruleForm" label-width="100px"> | ||
| 5 | <el-form-item> | ||
| 6 | <Breadcrumb /> | ||
| 7 | </el-form-item> | ||
| 8 | <el-row class="mb-5"> | ||
| 9 | <el-col :span="3" class="btnColRight"> | ||
| 10 | <btn nativeType="cx" @click="information">基本信息</btn> | ||
| 11 | <btn nativeType="cx" @click="password">修改密码</btn> | ||
| 12 | </el-col> | ||
| 13 | </el-row> | ||
| 14 | </el-form> | ||
| 15 | </div> | ||
| 16 | <div class="from-clues-content"> | ||
| 17 | <div class="contentbox"> | ||
| 18 | <base-set v-show="isshow" /> | ||
| 19 | <password-edit v-show="!isshow" /> | ||
| 20 | </div> | ||
| 21 | </div> | ||
| 22 | </div> | ||
| 23 | </template> | ||
| 24 | <script> | ||
| 25 | import "@/utils/flexible.js"; | ||
| 26 | import BaseSet from "./base-set.vue"; | ||
| 27 | import PasswordEdit from "./password-edit.vue"; | ||
| 28 | export default { | ||
| 29 | components: { | ||
| 30 | BaseSet, | ||
| 31 | PasswordEdit, | ||
| 32 | }, | ||
| 33 | data() { | ||
| 34 | return { | ||
| 35 | active: "baseSet", | ||
| 36 | isshow: true, | ||
| 37 | }; | ||
| 38 | }, | ||
| 39 | computed: {}, | ||
| 40 | watch: {}, | ||
| 41 | created() {}, | ||
| 42 | mounted() {}, | ||
| 43 | methods: { | ||
| 44 | information() { | ||
| 45 | this.isshow = true; | ||
| 46 | }, | ||
| 47 | password() { | ||
| 48 | this.isshow = false; | ||
| 49 | }, | ||
| 50 | }, | ||
| 51 | }; | ||
| 52 | </script> | ||
| 53 | |||
| 54 | <style scoped lang="scss"> | ||
| 55 | @import "~@/styles/mixin.scss"; | ||
| 56 | @import "~@/styles/public.scss"; | ||
| 57 | .information{ | ||
| 58 | .btnColRight{ | ||
| 59 | margin-top: 20px; | ||
| 60 | } | ||
| 61 | /deep/.content { | ||
| 62 | .el-input__inner{ | ||
| 63 | background: none; | ||
| 64 | } | ||
| 65 | .user-info { | ||
| 66 | background: none; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | /deep/.el-tabs { | ||
| 70 | |||
| 71 | .el-tabs__content { | ||
| 72 | height: 100%; | ||
| 73 | width: 100%; | ||
| 74 | |||
| 75 | |||
| 76 | } | ||
| 77 | } | ||
| 78 | .contentbox{ | ||
| 79 | height: 3.0854rem; | ||
| 80 | } | ||
| 81 | } | ||
| 82 | |||
| 83 | </style> |
| 1 | <template> | ||
| 2 | <div class="content"> | ||
| 3 | <div class="user-info"> | ||
| 4 | <el-form | ||
| 5 | ref="form" | ||
| 6 | label-width="100px" | ||
| 7 | :model="form" | ||
| 8 | class="form-wrapper" | ||
| 9 | :rules="rules" | ||
| 10 | > | ||
| 11 | <el-form-item label="旧密码:" required prop="oldPassword"> | ||
| 12 | <el-input | ||
| 13 | v-model="form.oldPassword" | ||
| 14 | clearable | ||
| 15 | type="password" | ||
| 16 | show-password | ||
| 17 | /> | ||
| 18 | </el-form-item> | ||
| 19 | <el-form-item label="新密码:" required prop="newPassword"> | ||
| 20 | <el-input | ||
| 21 | v-model="form.newPassword" | ||
| 22 | clearable | ||
| 23 | type="password" | ||
| 24 | show-password | ||
| 25 | /> | ||
| 26 | </el-form-item> | ||
| 27 | <el-form-item label="确认密码:" required prop="confirmPassword"> | ||
| 28 | <el-input | ||
| 29 | v-model="form.confirmPassword" | ||
| 30 | clearable | ||
| 31 | type="password" | ||
| 32 | show-password | ||
| 33 | /> | ||
| 34 | </el-form-item> | ||
| 35 | </el-form> | ||
| 36 | <div class="bottom-wrapper"> | ||
| 37 | <el-button type="primary" @click="updatePassword">确认修改</el-button> | ||
| 38 | </div> | ||
| 39 | </div> | ||
| 40 | </div> | ||
| 41 | </template> | ||
| 42 | |||
| 43 | <script> | ||
| 44 | // import { updateUserPassword } from '@api/organizationManage' | ||
| 45 | export default { | ||
| 46 | props: { | ||
| 47 | // userInfo: { | ||
| 48 | // type: Object, | ||
| 49 | // default: null | ||
| 50 | // } | ||
| 51 | }, | ||
| 52 | data() { | ||
| 53 | return { | ||
| 54 | form: {}, | ||
| 55 | sexList: [], | ||
| 56 | userId: '', | ||
| 57 | rules: { | ||
| 58 | oldPassword: [ | ||
| 59 | { required: true, message: '旧密码不能为空', trigger: 'blur' } | ||
| 60 | ], | ||
| 61 | newPassword: [ | ||
| 62 | { required: true, message: '新密码不能为空', trigger: 'blur' } | ||
| 63 | ], | ||
| 64 | confirmPassword: [ | ||
| 65 | { required: true, message: '确认密码不能为空', trigger: 'blur' }, | ||
| 66 | { validator: this.validatorConfirmPassword, trigger: 'blur' } | ||
| 67 | ] | ||
| 68 | } | ||
| 69 | } | ||
| 70 | }, | ||
| 71 | computed: {}, | ||
| 72 | watch: { | ||
| 73 | // userInfo: { | ||
| 74 | // handler: function(val) { | ||
| 75 | // if (val) { | ||
| 76 | // this.userId = val.id | ||
| 77 | // } | ||
| 78 | // } | ||
| 79 | // } | ||
| 80 | }, | ||
| 81 | mounted() {}, | ||
| 82 | methods: { | ||
| 83 | validatorConfirmPassword(rule, value, callback) { | ||
| 84 | const { newPassword } = this.form | ||
| 85 | if (value !== newPassword) { | ||
| 86 | callback('两次输入密码不一致') | ||
| 87 | } else { | ||
| 88 | callback() | ||
| 89 | } | ||
| 90 | }, | ||
| 91 | // 确认修改 | ||
| 92 | updatePassword() { | ||
| 93 | // this.$refs.form.validate((valid) => { | ||
| 94 | // if (valid) { | ||
| 95 | // const params = Object.assign({}, this.form, { id: this.userId }) | ||
| 96 | // updateUserPassword(params).then((res) => { | ||
| 97 | // if (res.status === 1) { | ||
| 98 | // this.$message.success({ message: res.message, showClose: true }) | ||
| 99 | // } else { | ||
| 100 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 101 | // } | ||
| 102 | // }) | ||
| 103 | // } | ||
| 104 | // }) | ||
| 105 | } | ||
| 106 | } | ||
| 107 | } | ||
| 108 | </script> | ||
| 109 | |||
| 110 | <style scoped lang="scss"> | ||
| 111 | .user-info { | ||
| 112 | margin: 36px 200px; | ||
| 113 | background: #ffffff; | ||
| 114 | max-height: 90%; | ||
| 115 | overflow-y: auto; | ||
| 116 | .form-wrapper { | ||
| 117 | padding: 24px 120px 0px; | ||
| 118 | .el-form-item { | ||
| 119 | margin-bottom: 24px; | ||
| 120 | .el-form-item__label { | ||
| 121 | color: #747e8c; | ||
| 122 | } | ||
| 123 | ::v-deep .el-input .el-input__inner { | ||
| 124 | padding: 0 8px; | ||
| 125 | height: 40px; | ||
| 126 | line-height: 40px; | ||
| 127 | border: 1px solid #6BC1FC; | ||
| 128 | } | ||
| 129 | } | ||
| 130 | } | ||
| 131 | .bottom-wrapper { | ||
| 132 | padding: 32px 120px 24px; | ||
| 133 | text-align: right; | ||
| 134 | } | ||
| 135 | } | ||
| 136 | </style> |
| ... | @@ -4,8 +4,7 @@ | ... | @@ -4,8 +4,7 @@ |
| 4 | :title="title" | 4 | :title="title" |
| 5 | :show.sync="visible" | 5 | :show.sync="visible" |
| 6 | :width="'767px'" | 6 | :width="'767px'" |
| 7 | @close="close()" | 7 | @close="close()"> |
| 8 | > | ||
| 9 | <template slot="content"> | 8 | <template slot="content"> |
| 10 | <el-form ref="form" :model="form" :rules="rules"> | 9 | <el-form ref="form" :model="form" :rules="rules"> |
| 11 | <el-row :gutter="24"> | 10 | <el-row :gutter="24"> |
| ... | @@ -25,20 +24,18 @@ | ... | @@ -25,20 +24,18 @@ |
| 25 | :props="setProps" | 24 | :props="setProps" |
| 26 | placeholder="请选择上级菜单" | 25 | placeholder="请选择上级菜单" |
| 27 | clearable | 26 | clearable |
| 28 | @change="handleChange" | 27 | @change="handleChange" /> |
| 29 | /> | ||
| 30 | </el-form-item> | 28 | </el-form-item> |
| 31 | </el-col> | 29 | </el-col> |
| 32 | 30 | ||
| 33 | </el-row> | 31 | </el-row> |
| 34 | <el-row :gutter="24"> | 32 | <el-row :gutter="24"> |
| 35 | <el-col :span="12"> | 33 | <el-col :span="12"> |
| 36 | <el-form-item label="代码:" prop="code" label-width="54px"> | 34 | <el-form-item label="代码:" prop="code" label-width="54px"> |
| 37 | <el-input | 35 | <el-input |
| 38 | v-model="codeComputed" | 36 | v-model="codeComputed" |
| 39 | placeholder="请输入菜单代码" | 37 | placeholder="请输入菜单代码" |
| 40 | :disabled="type === 1" | 38 | :disabled="type === 1" /> |
| 41 | /> | ||
| 42 | </el-form-item> | 39 | </el-form-item> |
| 43 | </el-col> | 40 | </el-col> |
| 44 | </el-row> | 41 | </el-row> |
| ... | @@ -54,14 +51,12 @@ | ... | @@ -54,14 +51,12 @@ |
| 54 | <el-form-item label="浏览器跳转模式:" label-width="124px"> | 51 | <el-form-item label="浏览器跳转模式:" label-width="124px"> |
| 55 | <el-select | 52 | <el-select |
| 56 | v-model="form.jumpMode" | 53 | v-model="form.jumpMode" |
| 57 | placeholder="请选择浏览器跳转模式" | 54 | placeholder="请选择浏览器跳转模式"> |
| 58 | > | ||
| 59 | <el-option | 55 | <el-option |
| 60 | v-for="item in jumpModeList" | 56 | v-for="item in jumpModeList" |
| 61 | :key="item.value" | 57 | :key="item.value" |
| 62 | :label="item.name" | 58 | :label="item.name" |
| 63 | :value="item.value" | 59 | :value="item.value" /> |
| 64 | /> | ||
| 65 | </el-select> | 60 | </el-select> |
| 66 | </el-form-item> | 61 | </el-form-item> |
| 67 | </el-col> | 62 | </el-col> |
| ... | @@ -71,13 +66,11 @@ | ... | @@ -71,13 +66,11 @@ |
| 71 | <el-form-item | 66 | <el-form-item |
| 72 | label="配置参数:" | 67 | label="配置参数:" |
| 73 | label-width="124px" | 68 | label-width="124px" |
| 74 | class="form-item-mb0" | 69 | class="form-item-mb0"> |
| 75 | > | ||
| 76 | <!-- 配置参数 --> | 70 | <!-- 配置参数 --> |
| 77 | <JsonEditor | 71 | <JsonEditor |
| 78 | :result-infos="form.metadata" | 72 | :result-infos="form.metadata" |
| 79 | @getJsonString="getJsonString" | 73 | @getJsonString="getJsonString" /> |
| 80 | /> | ||
| 81 | </el-form-item> | 74 | </el-form-item> |
| 82 | </el-col> | 75 | </el-col> |
| 83 | </el-row> | 76 | </el-row> |
| ... | @@ -86,11 +79,9 @@ | ... | @@ -86,11 +79,9 @@ |
| 86 | <template slot="footer"> | 79 | <template slot="footer"> |
| 87 | <el-button class="cancel-button" @click="close()">取消</el-button> | 80 | <el-button class="cancel-button" @click="close()">取消</el-button> |
| 88 | 81 | ||
| 89 | |||
| 90 | <el-button | 82 | <el-button |
| 91 | type="primary" | 83 | type="primary" |
| 92 | @click="submitForm()" | 84 | @click="submitForm()">保存</el-button> |
| 93 | >保存</el-button> | ||
| 94 | </template> | 85 | </template> |
| 95 | </Dialog> | 86 | </Dialog> |
| 96 | <!-- 图标列表 --> | 87 | <!-- 图标列表 --> |
| ... | @@ -99,186 +90,186 @@ | ... | @@ -99,186 +90,186 @@ |
| 99 | </template> | 90 | </template> |
| 100 | 91 | ||
| 101 | <script> | 92 | <script> |
| 102 | import Dialog from "@/components/Dialog/"; | 93 | import Dialog from "@/components/Dialog/"; |
| 103 | import { getParentMenuListAction } from '@/api/quanxianmanagement' | 94 | import { getParentMenuListAction } from '@/api/quanxianmanagement' |
| 104 | import JsonEditor from '@/components/JsonEditors' | 95 | import JsonEditor from '@/components/JsonEditors' |
| 105 | import IconList from '@/components/IconList' | 96 | import IconList from '@/components/IconList' |
| 106 | import { validateCode } from '@/utils/validate'; | 97 | import { validateCode } from '@/utils/validate'; |
| 107 | import { api, httpAction } from '@/api/manageApi' | 98 | import { api, httpAction } from '@/api/manageApi' |
| 108 | export default { | 99 | export default { |
| 109 | name: 'MenuModal', | 100 | name: 'MenuModal', |
| 110 | components: { | 101 | components: { |
| 111 | IconList, | 102 | IconList, |
| 112 | JsonEditor, | 103 | JsonEditor, |
| 113 | Dialog | 104 | Dialog |
| 114 | }, | ||
| 115 | props: { | ||
| 116 | productId: { | ||
| 117 | type: String, | ||
| 118 | default: '' | ||
| 119 | } | ||
| 120 | }, | ||
| 121 | data() { | ||
| 122 | return { | ||
| 123 | form: { | ||
| 124 | icon: '', | ||
| 125 | code: '' | ||
| 126 | }, | ||
| 127 | rules: { | ||
| 128 | name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }], | ||
| 129 | code: [ | ||
| 130 | { required: true, message: '必填', trigger: 'blur' }, | ||
| 131 | { validator: validateCode, trigger: 'blur' } | ||
| 132 | ] | ||
| 133 | }, | ||
| 134 | title: '', | ||
| 135 | type: '', | ||
| 136 | visible: false, | ||
| 137 | parentMenuList: [], | ||
| 138 | menuKey: 0, | ||
| 139 | jumpModeList: [ | ||
| 140 | { name: '在当前页面显示', value: 1 }, | ||
| 141 | { name: '跳转到新页面', value: 2 } | ||
| 142 | ], | ||
| 143 | setProps: { | ||
| 144 | value: 'id', | ||
| 145 | label: 'name', | ||
| 146 | children: 'children', | ||
| 147 | expandTrigger: 'hover', | ||
| 148 | checkStrictly: true, // 可取消关联,选择任意一级选项 | ||
| 149 | emitPath: false | ||
| 150 | }, | ||
| 151 | dataUrl: api.menus | ||
| 152 | } | ||
| 153 | }, | ||
| 154 | computed: { | ||
| 155 | codeComputed: { | ||
| 156 | get: function() { | ||
| 157 | return this.form.code | ||
| 158 | }, | ||
| 159 | set: function(val) { | ||
| 160 | this.form.code = val.toUpperCase() | ||
| 161 | } | ||
| 162 | } | ||
| 163 | }, | ||
| 164 | created() {}, | ||
| 165 | mounted() {}, | ||
| 166 | methods: { | ||
| 167 | // 获取父级菜单 | ||
| 168 | getParentMenuList(id) { | ||
| 169 | |||
| 170 | getParentMenuListAction(id).then((res) => { | ||
| 171 | if (res.status === 1) { | ||
| 172 | const list = this.$dealArrChildren(res.content) | ||
| 173 | if (id) { | ||
| 174 | this.parentMenuList = this.$dealArrDisabled( | ||
| 175 | this.$deepCopy(list), | ||
| 176 | id | ||
| 177 | ) | ||
| 178 | this.menuKey++ | ||
| 179 | } else { | ||
| 180 | this.parentMenuList = list | ||
| 181 | } | ||
| 182 | } else { | ||
| 183 | this.$message.error({ message: res.message, showClose: true }) | ||
| 184 | } | ||
| 185 | }) | ||
| 186 | }, | ||
| 187 | getIconList() { | ||
| 188 | this.$refs.iconList.show(true) | ||
| 189 | }, | ||
| 190 | getIconName(data) { | ||
| 191 | this.form.icon = data | ||
| 192 | }, | 105 | }, |
| 193 | // 配置参数 | 106 | props: { |
| 194 | getJsonString(data) { | 107 | productId: { |
| 195 | this.form.metadata = data | 108 | type: String, |
| 196 | }, | 109 | default: '' |
| 197 | // 新增菜单 | 110 | } |
| 198 | add() { | ||
| 199 | this.getParentMenuList("2925fdeb-ddeb-4c15-8ee0-7bc3aa75ec2b") | ||
| 200 | this.visible = true | ||
| 201 | this.type = 0 | ||
| 202 | this.form.jumpMode = 1 | ||
| 203 | }, | 111 | }, |
| 204 | // 编辑菜单 | 112 | data () { |
| 205 | edit(record) { | 113 | return { |
| 206 | this.type = 1 | 114 | form: { |
| 207 | // 若有id为编辑 | 115 | icon: '', |
| 208 | if (record.id) { | 116 | code: '' |
| 209 | this.$nextTick(() => { | 117 | }, |
| 210 | this.form = Object.assign({}, record) | 118 | rules: { |
| 211 | this.getParentMenuList(this.productId) | 119 | name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }], |
| 212 | }) | 120 | code: [ |
| 121 | { required: true, message: '必填', trigger: 'blur' }, | ||
| 122 | { validator: validateCode, trigger: 'blur' } | ||
| 123 | ] | ||
| 124 | }, | ||
| 125 | title: '', | ||
| 126 | type: '', | ||
| 127 | visible: false, | ||
| 128 | parentMenuList: [], | ||
| 129 | menuKey: 0, | ||
| 130 | jumpModeList: [ | ||
| 131 | { name: '在当前页面显示', value: 1 }, | ||
| 132 | { name: '跳转到新页面', value: 2 } | ||
| 133 | ], | ||
| 134 | setProps: { | ||
| 135 | value: 'id', | ||
| 136 | label: 'name', | ||
| 137 | children: 'children', | ||
| 138 | expandTrigger: 'hover', | ||
| 139 | checkStrictly: true, // 可取消关联,选择任意一级选项 | ||
| 140 | emitPath: false | ||
| 141 | }, | ||
| 142 | dataUrl: api.menus | ||
| 213 | } | 143 | } |
| 214 | this.visible = true | ||
| 215 | }, | 144 | }, |
| 216 | // 选择上级菜单 | 145 | computed: { |
| 217 | handleChange(value) { | 146 | codeComputed: { |
| 218 | this.form.parentId = value | 147 | get: function () { |
| 148 | return this.form.code | ||
| 149 | }, | ||
| 150 | set: function (val) { | ||
| 151 | this.form.code = val.toUpperCase() | ||
| 152 | } | ||
| 153 | } | ||
| 219 | }, | 154 | }, |
| 220 | // 保存 | 155 | created () { }, |
| 221 | submitForm(submitType) { | 156 | mounted () { }, |
| 222 | this.$refs.form.validate((valid) => { | 157 | methods: { |
| 223 | if (valid) { | 158 | // 获取父级菜单 |
| 224 | let method = '' | 159 | getParentMenuList (id) { |
| 225 | let url = '' | 160 | |
| 226 | const formData = this.form | 161 | getParentMenuListAction(id).then((res) => { |
| 227 | formData.productId = this.productId | 162 | if (res.status === 1) { |
| 228 | if (!formData.id) { | 163 | const list = this.$dealArrChildren(res.content) |
| 229 | method = 'post' | 164 | if (id) { |
| 230 | url = this.dataUrl | 165 | this.parentMenuList = this.$dealArrDisabled( |
| 166 | this.$deepCopy(list), | ||
| 167 | id | ||
| 168 | ) | ||
| 169 | this.menuKey++ | ||
| 170 | } else { | ||
| 171 | this.parentMenuList = list | ||
| 172 | } | ||
| 231 | } else { | 173 | } else { |
| 232 | method = 'put' | 174 | this.$message.error({ message: res.message, showClose: true }) |
| 233 | url = `${this.dataUrl}/${formData.id}` | ||
| 234 | } | 175 | } |
| 235 | httpAction(url, formData, method) | 176 | }) |
| 236 | .then((res) => { | 177 | }, |
| 237 | if (res.status === 1) { | 178 | getIconList () { |
| 238 | this.$message.success({ | 179 | this.$refs.iconList.show(true) |
| 239 | message: res.message, | 180 | }, |
| 240 | showClose: true | 181 | getIconName (data) { |
| 241 | }) | 182 | this.form.icon = data |
| 183 | }, | ||
| 184 | // 配置参数 | ||
| 185 | getJsonString (data) { | ||
| 186 | this.form.metadata = data | ||
| 187 | }, | ||
| 188 | // 新增菜单 | ||
| 189 | add () { | ||
| 190 | this.getParentMenuList(this.productId) | ||
| 191 | this.visible = true | ||
| 192 | this.type = 0 | ||
| 193 | this.form.jumpMode = 1 | ||
| 194 | }, | ||
| 195 | // 编辑菜单 | ||
| 196 | edit (record) { | ||
| 197 | this.type = 1 | ||
| 198 | // 若有id为编辑 | ||
| 199 | if (record.id) { | ||
| 200 | this.$nextTick(() => { | ||
| 201 | this.form = Object.assign({}, record) | ||
| 202 | this.getParentMenuList(this.productId) | ||
| 203 | }) | ||
| 204 | } | ||
| 205 | this.visible = true | ||
| 206 | }, | ||
| 207 | // 选择上级菜单 | ||
| 208 | handleChange (value) { | ||
| 209 | this.form.parentId = value | ||
| 210 | }, | ||
| 211 | // 保存 | ||
| 212 | submitForm (submitType) { | ||
| 213 | this.$refs.form.validate((valid) => { | ||
| 214 | if (valid) { | ||
| 215 | let method = '' | ||
| 216 | let url = '' | ||
| 217 | const formData = this.form | ||
| 218 | formData.productId = this.productId | ||
| 219 | if (!formData.id) { | ||
| 220 | method = 'post' | ||
| 221 | url = this.dataUrl | ||
| 222 | } else { | ||
| 223 | method = 'put' | ||
| 224 | url = `${this.dataUrl}/${formData.id}` | ||
| 225 | } | ||
| 226 | httpAction(url, formData, method) | ||
| 227 | .then((res) => { | ||
| 228 | if (res.status === 1) { | ||
| 229 | this.$message.success({ | ||
| 230 | message: res.message, | ||
| 231 | showClose: true | ||
| 232 | }) | ||
| 242 | 233 | ||
| 243 | this.resetForm() | 234 | this.resetForm() |
| 244 | this.$emit('ok') | 235 | this.$emit('ok') |
| 245 | } else { | 236 | } else { |
| 246 | this.$message.error({ message: res.message, showClose: true }) | 237 | this.$message.error({ message: res.message, showClose: true }) |
| 247 | } | 238 | } |
| 248 | }) | 239 | }) |
| 249 | .catch((err) => { | 240 | .catch((err) => { |
| 250 | console.log(err) | 241 | console.log(err) |
| 251 | }) | 242 | }) |
| 243 | } | ||
| 244 | }) | ||
| 245 | }, | ||
| 246 | resetForm () { | ||
| 247 | this.$refs.form.resetFields() | ||
| 248 | this.form = { | ||
| 249 | icon: '', | ||
| 250 | code: '' | ||
| 252 | } | 251 | } |
| 253 | }) | 252 | }, |
| 254 | }, | 253 | close () { |
| 255 | resetForm() { | 254 | this.resetForm() |
| 256 | this.$refs.form.resetFields() | 255 | this.visible = false |
| 257 | this.form = { | ||
| 258 | icon: '', | ||
| 259 | code: '' | ||
| 260 | } | 256 | } |
| 261 | }, | ||
| 262 | close() { | ||
| 263 | this.resetForm() | ||
| 264 | this.visible = false | ||
| 265 | } | 257 | } |
| 266 | } | 258 | } |
| 267 | } | ||
| 268 | </script> | 259 | </script> |
| 269 | <style scoped lang="scss"> | 260 | <style scoped lang="scss"> |
| 270 | /deep/.el-dialog__header { | 261 | /deep/.el-dialog__header { |
| 271 | text-align: center; | 262 | text-align: center; |
| 272 | margin-bottom: 10px; | 263 | margin-bottom: 10px; |
| 273 | .el-dialog__title { | 264 | .el-dialog__title { |
| 274 | color: white; | 265 | color: white; |
| 266 | } | ||
| 275 | } | 267 | } |
| 276 | } | ||
| 277 | 268 | ||
| 278 | /deep/.el-form-item__label{ | 269 | /deep/.el-form-item__label { |
| 279 | color: white; | 270 | color: white; |
| 280 | } | 271 | } |
| 281 | /deep/.el-input__inner{ | 272 | /deep/.el-input__inner { |
| 282 | background-color: #07388B; | 273 | background-color: #07388b; |
| 283 | } | 274 | } |
| 284 | </style> | 275 | </style> | ... | ... |
| ... | @@ -15,7 +15,7 @@ | ... | @@ -15,7 +15,7 @@ |
| 15 | <el-tab-pane label="菜单配置" name="second"></el-tab-pane> | 15 | <el-tab-pane label="菜单配置" name="second"></el-tab-pane> |
| 16 | </el-tabs> | 16 | </el-tabs> |
| 17 | <lb-table | 17 | <lb-table |
| 18 | v-show="activeName == 'first'" | 18 | v-if="activeName == 'first'" |
| 19 | ref="multipleTable" | 19 | ref="multipleTable" |
| 20 | :pagination="false" | 20 | :pagination="false" |
| 21 | :column="usertableData.column" | 21 | :column="usertableData.column" |
| ... | @@ -26,7 +26,7 @@ | ... | @@ -26,7 +26,7 @@ |
| 26 | </lb-table> | 26 | </lb-table> |
| 27 | <lb-table | 27 | <lb-table |
| 28 | :key="menukey" | 28 | :key="menukey" |
| 29 | v-show="activeName == 'second'" | 29 | v-if="activeName == 'second'" |
| 30 | ref="multipleTable1" | 30 | ref="multipleTable1" |
| 31 | :pagination="false" | 31 | :pagination="false" |
| 32 | :column="menutableData.column" | 32 | :column="menutableData.column" |
| ... | @@ -55,14 +55,8 @@ | ... | @@ -55,14 +55,8 @@ |
| 55 | menutableData: { | 55 | menutableData: { |
| 56 | column: [ | 56 | column: [ |
| 57 | { | 57 | { |
| 58 | label: "序号", | ||
| 59 | type: "index", | ||
| 60 | width: "50", | ||
| 61 | // index: this.indexMethod, | ||
| 62 | }, | ||
| 63 | { | ||
| 64 | prop: "name", | 58 | prop: "name", |
| 65 | width: 330, | 59 | width: 830, |
| 66 | label: "菜单名称", | 60 | label: "菜单名称", |
| 67 | } | 61 | } |
| 68 | ].concat([ | 62 | ].concat([ | ... | ... |
| ... | @@ -15,9 +15,7 @@ | ... | @@ -15,9 +15,7 @@ |
| 15 | v-for="(item, index) in sexList" | 15 | v-for="(item, index) in sexList" |
| 16 | :key="index" | 16 | :key="index" |
| 17 | v-model="form.sex" | 17 | v-model="form.sex" |
| 18 | :label="item.value" | 18 | :label="item.value">{{ item.name }}</el-radio> |
| 19 | >{{ item.name }}</el-radio | ||
| 20 | > | ||
| 21 | </el-form-item> | 19 | </el-form-item> |
| 22 | </el-col> | 20 | </el-col> |
| 23 | <el-col :span="6"> | 21 | <el-col :span="6"> |
| ... | @@ -36,8 +34,7 @@ | ... | @@ -36,8 +34,7 @@ |
| 36 | <el-input | 34 | <el-input |
| 37 | v-model="form.loginName" | 35 | v-model="form.loginName" |
| 38 | :disabled="showLoginName" | 36 | :disabled="showLoginName" |
| 39 | placeholder="用户名" | 37 | placeholder="用户名" /> |
| 40 | /> | ||
| 41 | </el-form-item> | 38 | </el-form-item> |
| 42 | </el-col> | 39 | </el-col> |
| 43 | </el-row> | 40 | </el-row> |
| ... | @@ -51,12 +48,10 @@ | ... | @@ -51,12 +48,10 @@ |
| 51 | <el-form-item | 48 | <el-form-item |
| 52 | label="手机号码:" | 49 | label="手机号码:" |
| 53 | prop="mobilePhone" | 50 | prop="mobilePhone" |
| 54 | label-width="72px" | 51 | label-width="72px"> |
| 55 | > | ||
| 56 | <el-input | 52 | <el-input |
| 57 | v-model="form.mobilePhone" | 53 | v-model="form.mobilePhone" |
| 58 | placeholder="手机号码" | 54 | placeholder="手机号码" /> |
| 59 | /> | ||
| 60 | </el-form-item> | 55 | </el-form-item> |
| 61 | </el-col> | 56 | </el-col> |
| 62 | </el-row> | 57 | </el-row> |
| ... | @@ -65,14 +60,12 @@ | ... | @@ -65,14 +60,12 @@ |
| 65 | <el-form-item label="最高职务级别:" label-width="100px"> | 60 | <el-form-item label="最高职务级别:" label-width="100px"> |
| 66 | <el-select | 61 | <el-select |
| 67 | v-model="form.jobLevel" | 62 | v-model="form.jobLevel" |
| 68 | placeholder="最高职务级别" | 63 | placeholder="最高职务级别"> |
| 69 | > | ||
| 70 | <el-option | 64 | <el-option |
| 71 | v-for="item in levelList" | 65 | v-for="item in levelList" |
| 72 | :key="item.value" | 66 | :key="item.value" |
| 73 | :label="item.name" | 67 | :label="item.name" |
| 74 | :value="item.value" | 68 | :value="item.value" /> |
| 75 | /> | ||
| 76 | </el-select> | 69 | </el-select> |
| 77 | </el-form-item> | 70 | </el-form-item> |
| 78 | </el-col> | 71 | </el-col> |
| ... | @@ -87,8 +80,7 @@ | ... | @@ -87,8 +80,7 @@ |
| 87 | <el-form-item | 80 | <el-form-item |
| 88 | label="办公地点:" | 81 | label="办公地点:" |
| 89 | label-width="100px" | 82 | label-width="100px" |
| 90 | class="form-item-mb0" | 83 | class="form-item-mb0"> |
| 91 | > | ||
| 92 | <el-input v-model="form.address" placeholder="办公地点" /> | 84 | <el-input v-model="form.address" placeholder="办公地点" /> |
| 93 | </el-form-item> | 85 | </el-form-item> |
| 94 | </el-col> | 86 | </el-col> |
| ... | @@ -103,87 +95,87 @@ | ... | @@ -103,87 +95,87 @@ |
| 103 | </template> | 95 | </template> |
| 104 | 96 | ||
| 105 | <script> | 97 | <script> |
| 106 | import { api, httpAction } from '@/api/manageApi' | 98 | import { api, httpAction } from '@/api/manageApi' |
| 107 | import Dialog from "@/components/Dialog/"; | 99 | import Dialog from "@/components/Dialog/"; |
| 108 | export default { | 100 | export default { |
| 109 | name: "", | 101 | name: "", |
| 110 | components: { Dialog }, | 102 | components: { Dialog }, |
| 111 | props: {}, | 103 | props: {}, |
| 112 | data() { | 104 | data () { |
| 113 | return { | 105 | return { |
| 114 | form: { | 106 | form: { |
| 115 | sex: "0", | 107 | sex: "0", |
| 116 | }, | 108 | }, |
| 117 | rules: { | 109 | rules: { |
| 118 | name: [{ required: true, message: "请输入姓名", trigger: "blur" }], | 110 | name: [{ required: true, message: "请输入姓名", trigger: "blur" }], |
| 119 | code: [{ required: true, message: "请输入工号", trigger: "blur" }], | 111 | code: [{ required: true, message: "请输入工号", trigger: "blur" }], |
| 120 | mobilePhone: [{ validator: "sddd", trigger: "blur" }], | 112 | mobilePhone: [{ validator: "sddd", trigger: "blur" }], |
| 121 | loginName: [ | 113 | loginName: [ |
| 122 | { required: true, message: "请输入用户名", trigger: "blur" }, | 114 | { required: true, message: "请输入用户名", trigger: "blur" }, |
| 123 | ], | 115 | ], |
| 124 | }, | 116 | }, |
| 125 | title: "", | 117 | title: "", |
| 126 | visible: false, | 118 | visible: false, |
| 127 | showLoginName: false, | 119 | showLoginName: false, |
| 128 | sexList: [{lable:"0",value:"0",name:"男"},{lable:"1",value:"1",name:"女"}], | 120 | sexList: [{ lable: "0", value: "0", name: "男" }, { lable: "1", value: "1", name: "女" }], |
| 129 | levelList: [{lable:"0",value:"0",name:"干事"},{lable:"1",value:"1",name:"经理"}], | 121 | levelList: [{ lable: "0", value: "0", name: "干事" }, { lable: "1", value: "1", name: "经理" }], |
| 130 | dataUrl: api.users | 122 | dataUrl: api.users |
| 131 | }; | 123 | }; |
| 132 | }, | ||
| 133 | computed: { | ||
| 134 | departmentid() { | ||
| 135 | return this.$store.state.user.userInfo; | ||
| 136 | }, | ||
| 137 | }, | ||
| 138 | watch: {}, | ||
| 139 | created() {}, | ||
| 140 | mounted() {}, | ||
| 141 | methods: { | ||
| 142 | // initDictConfig() { | ||
| 143 | // getDictItems('XB').then((res) => { | ||
| 144 | // if (res.status === 1) { | ||
| 145 | // this.sexList = res.content | ||
| 146 | // } else { | ||
| 147 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 148 | // } | ||
| 149 | // }) | ||
| 150 | // getDictItems('ZWJB').then((res) => { | ||
| 151 | // if (res.status === 1) { | ||
| 152 | // this.levelList = res.content | ||
| 153 | // } else { | ||
| 154 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 155 | // } | ||
| 156 | // }) | ||
| 157 | // }, | ||
| 158 | // 添加人员 | ||
| 159 | add() { | ||
| 160 | this.visible = true; | ||
| 161 | // this.type = 0 | ||
| 162 | this.showLoginName = false | ||
| 163 | }, | 124 | }, |
| 164 | // 编辑 | 125 | computed: { |
| 165 | edit(record) { | 126 | departmentid () { |
| 166 | // this.initDictConfig() | 127 | return this.$store.state.user.userInfo; |
| 167 | this.showLoginName = true | 128 | }, |
| 168 | // 若有id为编辑 | ||
| 169 | if (record) { | ||
| 170 | this.$nextTick(() => { | ||
| 171 | this.form = Object.assign({}, record) | ||
| 172 | }) | ||
| 173 | } | ||
| 174 | this.visible = true | ||
| 175 | }, | ||
| 176 | handleChange(value) { | ||
| 177 | this.form.departmentId = value; | ||
| 178 | }, | 129 | }, |
| 179 | // 保存 | 130 | watch: {}, |
| 180 | submitForm(submitType) { | 131 | created () { }, |
| 132 | mounted () { }, | ||
| 133 | methods: { | ||
| 134 | // initDictConfig() { | ||
| 135 | // getDictItems('XB').then((res) => { | ||
| 136 | // if (res.status === 1) { | ||
| 137 | // this.sexList = res.content | ||
| 138 | // } else { | ||
| 139 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 140 | // } | ||
| 141 | // }) | ||
| 142 | // getDictItems('ZWJB').then((res) => { | ||
| 143 | // if (res.status === 1) { | ||
| 144 | // this.levelList = res.content | ||
| 145 | // } else { | ||
| 146 | // this.$message.error({ message: res.message, showClose: true }) | ||
| 147 | // } | ||
| 148 | // }) | ||
| 149 | // }, | ||
| 150 | // 添加人员 | ||
| 151 | adds () { | ||
| 152 | this.visible = true; | ||
| 153 | // this.type = 0 | ||
| 154 | this.showLoginName = false | ||
| 155 | }, | ||
| 156 | // 编辑 | ||
| 157 | edit (record) { | ||
| 158 | // this.initDictConfig() | ||
| 159 | this.showLoginName = true | ||
| 160 | // 若有id为编辑 | ||
| 161 | if (record) { | ||
| 162 | this.$nextTick(() => { | ||
| 163 | this.form = Object.assign({}, record) | ||
| 164 | }) | ||
| 165 | } | ||
| 166 | this.visible = true | ||
| 167 | }, | ||
| 168 | handleChange (value) { | ||
| 169 | this.form.departmentId = value; | ||
| 170 | }, | ||
| 171 | // 保存 | ||
| 172 | submitForm (submitType) { | ||
| 181 | this.$refs.form.validate((valid) => { | 173 | this.$refs.form.validate((valid) => { |
| 182 | if (valid) { | 174 | if (valid) { |
| 183 | let method = '' | 175 | let method = '' |
| 184 | let url = '' | 176 | let url = '' |
| 185 | this.form.organizationId=this.departmentid.organizationId; | 177 | this.form.organizationId = this.departmentid.organizationId; |
| 186 | this.form.departmentId=this.departmentid.departmentId; | 178 | this.form.departmentId = this.departmentid.departmentId; |
| 187 | const formData = this.form | 179 | const formData = this.form |
| 188 | if (!formData.id) { | 180 | if (!formData.id) { |
| 189 | method = 'post' | 181 | method = 'post' |
| ... | @@ -197,11 +189,11 @@ export default { | ... | @@ -197,11 +189,11 @@ export default { |
| 197 | if (res.status === 1) { | 189 | if (res.status === 1) { |
| 198 | this.$message.success({ message: res.message, showClose: true }) | 190 | this.$message.success({ message: res.message, showClose: true }) |
| 199 | 191 | ||
| 200 | this.resetForm() | 192 | this.resetForm() |
| 201 | 193 | ||
| 202 | this.close() | 194 | this.close() |
| 203 | 195 | ||
| 204 | this.$emit('ok') | 196 | this.$emit('ok') |
| 205 | } else { | 197 | } else { |
| 206 | this.$message.error({ message: res.message, showClose: true }) | 198 | this.$message.error({ message: res.message, showClose: true }) |
| 207 | } | 199 | } |
| ... | @@ -212,30 +204,30 @@ export default { | ... | @@ -212,30 +204,30 @@ export default { |
| 212 | } | 204 | } |
| 213 | }) | 205 | }) |
| 214 | }, | 206 | }, |
| 215 | resetForm() { | 207 | resetForm () { |
| 216 | this.form = { | 208 | this.form = { |
| 217 | sex: '0' | 209 | sex: '0' |
| 210 | } | ||
| 211 | this.$refs.form.resetFields() | ||
| 212 | }, | ||
| 213 | close () { | ||
| 214 | this.resetForm() | ||
| 215 | this.visible = false | ||
| 218 | } | 216 | } |
| 219 | this.$refs.form.resetFields() | ||
| 220 | }, | 217 | }, |
| 221 | close() { | 218 | }; |
| 222 | this.resetForm() | ||
| 223 | this.visible = false | ||
| 224 | } | ||
| 225 | }, | ||
| 226 | }; | ||
| 227 | </script> | 219 | </script> |
| 228 | <style scoped lang="scss"> | 220 | <style scoped lang="scss"> |
| 229 | /deep/.el-input__inner { | 221 | /deep/.el-input__inner { |
| 230 | background: #07388B; | 222 | background: #07388b; |
| 231 | border-radius: 2px; | 223 | border-radius: 2px; |
| 232 | border: 1px solid #6BC1FC; | 224 | border: 1px solid #6bc1fc; |
| 233 | } | 225 | } |
| 234 | /deep/.el-textarea__inner{ | 226 | /deep/.el-textarea__inner { |
| 235 | background: #07388B; | 227 | background: #07388b; |
| 236 | color: #fff; | 228 | color: #fff; |
| 237 | } | 229 | } |
| 238 | /deep/.el-form-item__label{ | 230 | /deep/.el-form-item__label { |
| 239 | color:#fff; | 231 | color: #fff; |
| 240 | } | 232 | } |
| 241 | </style> | 233 | </style> | ... | ... |
| ... | @@ -25,296 +25,295 @@ | ... | @@ -25,296 +25,295 @@ |
| 25 | :column="tableData.columns" | 25 | :column="tableData.columns" |
| 26 | :data="tableData.data" | 26 | :data="tableData.data" |
| 27 | :expand-row-keys="keyList" | 27 | :expand-row-keys="keyList" |
| 28 | row-key="dictid" | 28 | row-key="dictid"> |
| 29 | > | ||
| 30 | </lb-table> | 29 | </lb-table> |
| 31 | </div> | 30 | </div> |
| 32 | <edit-dialog ref="dialogForm" @ok="reloadTableData"/> | 31 | <EditDialog ref="dialogForm" @ok="reloadTableData" /> |
| 33 | </div> | 32 | </div> |
| 34 | </template> | 33 | </template> |
| 35 | <script> | 34 | <script> |
| 36 | import { | 35 | import { |
| 37 | getUuid, | 36 | getUuid, |
| 38 | judgeSort, | 37 | judgeSort, |
| 39 | realMove, | 38 | realMove, |
| 40 | findParents, | 39 | findParents, |
| 41 | removeTreeListItem, | 40 | removeTreeListItem, |
| 42 | } from "@/utils/operation"; | 41 | } from "@/utils/operation"; |
| 43 | import { | 42 | import { |
| 44 | resetPassword, | 43 | resetPassword, |
| 45 | getUserList, | 44 | getUserList, |
| 46 | } from "@/api/quanxianmanagement"; | 45 | } from "@/api/quanxianmanagement"; |
| 47 | import { api, deleteAction } from '@/api/manageApi' | 46 | import { api, deleteAction } from '@/api/manageApi' |
| 48 | import data from "./data"; | 47 | import data from "./data"; |
| 49 | import { deleteDomStr } from '@/utils/proDomStr' | 48 | import { deleteDomStr } from '@/utils/proDomStr' |
| 50 | import sjsbTask from "@/api/sjsbTask.js"; | 49 | import sjsbTask from "@/api/sjsbTask.js"; |
| 51 | import tableMixin from "@/mixins/tableMixin.js"; | 50 | import tableMixin from "@/mixins/tableMixin.js"; |
| 52 | import EditDialog from "./edit-dialog.vue"; | 51 | import EditDialog from "./edit-dialog.vue"; |
| 53 | export default { | 52 | export default { |
| 54 | name: "menus", | 53 | name: "menus", |
| 55 | mixins: [tableMixin], | 54 | mixins: [tableMixin], |
| 56 | components: { | 55 | components: { |
| 57 | EditDialog, | 56 | EditDialog, |
| 58 | }, | 57 | }, |
| 59 | data() { | 58 | data () { |
| 60 | return { | 59 | return { |
| 61 | taskData: null, | 60 | taskData: null, |
| 62 | keyList: [], | 61 | keyList: [], |
| 63 | form: { | 62 | form: { |
| 64 | job_name: "", | 63 | job_name: "", |
| 65 | currentPage: 1, | 64 | currentPage: 1, |
| 66 | }, | ||
| 67 | queryParam: {}, | ||
| 68 | selectType: "0", | ||
| 69 | queryName: "", | ||
| 70 | organizationId: "", // 组织机构ID | ||
| 71 | departmentId: "", // 部门ID | ||
| 72 | departmentList: [], // 部门列表 | ||
| 73 | levelList: [], // 职务级别 | ||
| 74 | sexList: [], | ||
| 75 | typeOptions: [ | ||
| 76 | { | ||
| 77 | value: "0", | ||
| 78 | label: "姓名", | ||
| 79 | }, | ||
| 80 | { | ||
| 81 | value: "1", | ||
| 82 | label: "工号", | ||
| 83 | }, | ||
| 84 | { | ||
| 85 | value: "2", | ||
| 86 | label: "部门", | ||
| 87 | }, | ||
| 88 | { | ||
| 89 | value: "3", | ||
| 90 | label: "机构", | ||
| 91 | }, | 65 | }, |
| 92 | ], | 66 | queryParam: {}, |
| 93 | 67 | selectType: "0", | |
| 94 | selectionList: [], | 68 | queryName: "", |
| 95 | tableData: { | 69 | organizationId: "", // 组织机构ID |
| 96 | columns: [ | 70 | departmentId: "", // 部门ID |
| 71 | departmentList: [], // 部门列表 | ||
| 72 | levelList: [], // 职务级别 | ||
| 73 | sexList: [], | ||
| 74 | typeOptions: [ | ||
| 75 | { | ||
| 76 | value: "0", | ||
| 77 | label: "姓名", | ||
| 78 | }, | ||
| 79 | { | ||
| 80 | value: "1", | ||
| 81 | label: "工号", | ||
| 82 | }, | ||
| 97 | { | 83 | { |
| 98 | label: "序号", | 84 | value: "2", |
| 99 | type: "index", | 85 | label: "部门", |
| 100 | width: "50", | ||
| 101 | index: this.indexMethod, | ||
| 102 | }, | 86 | }, |
| 103 | ] | 87 | { |
| 104 | .concat(data.columns()) | 88 | value: "3", |
| 105 | .concat([ | 89 | label: "机构", |
| 106 | { | ||
| 107 | label: "负责人", | ||
| 108 | render: (h, scope) => { | ||
| 109 | return ( | ||
| 110 | <i v-show={scope.row.isDuty!==null} class="el-icon-check" /> | ||
| 111 | ) | ||
| 112 | } | ||
| 113 | }, | 90 | }, |
| 91 | ], | ||
| 92 | |||
| 93 | selectionList: [], | ||
| 94 | tableData: { | ||
| 95 | columns: [ | ||
| 114 | { | 96 | { |
| 115 | label: "排序", | 97 | label: "序号", |
| 116 | width: 280, | 98 | type: "index", |
| 117 | render: (h, scope) => { | 99 | width: "50", |
| 118 | return ( | 100 | index: this.indexMethod, |
| 119 | <div> | ||
| 120 | <el-button | ||
| 121 | type="text" | ||
| 122 | disabled={scope.row.isTop} | ||
| 123 | onClick={() => { | ||
| 124 | this.moveUpward(scope.$index, scope.row); | ||
| 125 | }} | ||
| 126 | > | ||
| 127 | 上移 | ||
| 128 | </el-button> | ||
| 129 | <el-button | ||
| 130 | type="text" | ||
| 131 | disabled={scope.row.isBottom} | ||
| 132 | onClick={() => { | ||
| 133 | this.moveDown(scope.$index, scope.row); | ||
| 134 | }} | ||
| 135 | > | ||
| 136 | 下移 | ||
| 137 | </el-button> | ||
| 138 | </div> | ||
| 139 | ); | ||
| 140 | }, | ||
| 141 | }, | 101 | }, |
| 142 | { | 102 | ] |
| 143 | label: "操作", | 103 | .concat(data.columns()) |
| 144 | width: 380, | 104 | .concat([ |
| 145 | render: (h, scope) => { | 105 | { |
| 146 | return ( | 106 | label: "负责人", |
| 147 | <div> | 107 | render: (h, scope) => { |
| 148 | <el-button | 108 | return ( |
| 149 | type="text" | 109 | <i v-show={scope.row.isDuty !== null} class="el-icon-check" /> |
| 150 | size="mini" | 110 | ) |
| 151 | icon="el-icon-video-pause" | 111 | } |
| 152 | onClick={() => { | ||
| 153 | this.resetPassword(scope.row.id); | ||
| 154 | }} | ||
| 155 | > | ||
| 156 | 重置 | ||
| 157 | </el-button> | ||
| 158 | <el-button | ||
| 159 | type="text" | ||
| 160 | size="mini" | ||
| 161 | icon="el-icon-edit" | ||
| 162 | onClick={() => { | ||
| 163 | this.handleEdit(scope.row); | ||
| 164 | }} | ||
| 165 | > | ||
| 166 | 修改 | ||
| 167 | </el-button> | ||
| 168 | <el-button | ||
| 169 | type="text" | ||
| 170 | size="mini" | ||
| 171 | icon="el-icon-delete" | ||
| 172 | style="color:#F56C6C" | ||
| 173 | onClick={() => { | ||
| 174 | this.handleDelete(scope.row.id, scope.row.name); | ||
| 175 | }} | ||
| 176 | > | ||
| 177 | 删除 | ||
| 178 | </el-button> | ||
| 179 | </div> | ||
| 180 | ); | ||
| 181 | }, | 112 | }, |
| 182 | }, | 113 | { |
| 183 | ]), | 114 | label: "排序", |
| 184 | data: [], | 115 | width: 280, |
| 185 | }, | 116 | render: (h, scope) => { |
| 186 | pageData: { | 117 | return ( |
| 187 | total: 5, | 118 | <div> |
| 188 | pageSize: 15, | 119 | <el-button |
| 189 | current: 1, | 120 | type="text" |
| 190 | }, | 121 | disabled={scope.row.isTop} |
| 191 | }; | 122 | onClick={() => { |
| 192 | }, | 123 | this.moveUpward(scope.$index, scope.row); |
| 193 | created() { | 124 | }} |
| 194 | this.getTableList(); | 125 | > |
| 195 | }, | 126 | 上移 |
| 196 | computed: { | 127 | </el-button> |
| 197 | departmentid() { | 128 | <el-button |
| 198 | return this.$store.state.user.userInfo; | 129 | type="text" |
| 130 | disabled={scope.row.isBottom} | ||
| 131 | onClick={() => { | ||
| 132 | this.moveDown(scope.$index, scope.row); | ||
| 133 | }} | ||
| 134 | > | ||
| 135 | 下移 | ||
| 136 | </el-button> | ||
| 137 | </div> | ||
| 138 | ); | ||
| 139 | }, | ||
| 140 | }, | ||
| 141 | { | ||
| 142 | label: "操作", | ||
| 143 | width: 380, | ||
| 144 | render: (h, scope) => { | ||
| 145 | return ( | ||
| 146 | <div> | ||
| 147 | <el-button | ||
| 148 | type="text" | ||
| 149 | size="mini" | ||
| 150 | icon="el-icon-video-pause" | ||
| 151 | onClick={() => { | ||
| 152 | this.resetPassword(scope.row.id); | ||
| 153 | }} | ||
| 154 | > | ||
| 155 | 重置 | ||
| 156 | </el-button> | ||
| 157 | <el-button | ||
| 158 | type="text" | ||
| 159 | size="mini" | ||
| 160 | icon="el-icon-edit" | ||
| 161 | onClick={() => { | ||
| 162 | this.handleEdit(scope.row); | ||
| 163 | }} | ||
| 164 | > | ||
| 165 | 修改 | ||
| 166 | </el-button> | ||
| 167 | <el-button | ||
| 168 | type="text" | ||
| 169 | size="mini" | ||
| 170 | icon="el-icon-delete" | ||
| 171 | style="color:#F56C6C" | ||
| 172 | onClick={() => { | ||
| 173 | this.handleDelete(scope.row.id, scope.row.name); | ||
| 174 | }} | ||
| 175 | > | ||
| 176 | 删除 | ||
| 177 | </el-button> | ||
| 178 | </div> | ||
| 179 | ); | ||
| 180 | }, | ||
| 181 | }, | ||
| 182 | ]), | ||
| 183 | data: [], | ||
| 184 | }, | ||
| 185 | pageData: { | ||
| 186 | total: 5, | ||
| 187 | pageSize: 15, | ||
| 188 | current: 1, | ||
| 189 | }, | ||
| 190 | }; | ||
| 199 | }, | 191 | }, |
| 200 | }, | 192 | created () { |
| 201 | methods: { | 193 | this.getTableList(); |
| 202 | handleAdd() { | ||
| 203 | this.$refs.dialogForm.add(); | ||
| 204 | this.$refs.dialogForm.title = "添加"; | ||
| 205 | }, | 194 | }, |
| 206 | getTableList() { | 195 | computed: { |
| 207 | this.loading = true; | 196 | departmentid () { |
| 208 | this.queryParam = { | 197 | return this.$store.state.user.userInfo; |
| 209 | organizationId: this.departmentid.organizationId, | 198 | }, |
| 210 | departmentId: this.departmentid.departmentId, | ||
| 211 | }; | ||
| 212 | getUserList(this.queryParam).then((res) => { | ||
| 213 | if (res.status === 1) { | ||
| 214 | this.loading = false; | ||
| 215 | this.tableData.data = res.content; | ||
| 216 | this.tableData.data = judgeSort(this.tableData.data); | ||
| 217 | } else { | ||
| 218 | this.$message.error({ message: res.message, showClose: true }); | ||
| 219 | } | ||
| 220 | }); | ||
| 221 | }, | 199 | }, |
| 200 | methods: { | ||
| 201 | handleAdd () { | ||
| 202 | this.$refs.dialogForm.adds(); | ||
| 203 | this.$refs.dialogForm.title = "添加"; | ||
| 204 | }, | ||
| 205 | getTableList () { | ||
| 206 | this.loading = true; | ||
| 207 | this.queryParam = { | ||
| 208 | organizationId: this.departmentid.organizationId, | ||
| 209 | departmentId: this.departmentid.departmentId, | ||
| 210 | }; | ||
| 211 | getUserList(this.queryParam).then((res) => { | ||
| 212 | if (res.status === 1) { | ||
| 213 | this.loading = false; | ||
| 214 | this.tableData.data = res.content; | ||
| 215 | this.tableData.data = judgeSort(this.tableData.data); | ||
| 216 | } else { | ||
| 217 | this.$message.error({ message: res.message, showClose: true }); | ||
| 218 | } | ||
| 219 | }); | ||
| 220 | }, | ||
| 222 | 221 | ||
| 223 | // 重置用户密码 | 222 | // 重置用户密码 |
| 224 | resetPassword(data) { | 223 | resetPassword (data) { |
| 225 | const ids = [] | 224 | const ids = [] |
| 226 | if (data instanceof Array) { | 225 | if (data instanceof Array) { |
| 227 | data.forEach((item) => { | 226 | data.forEach((item) => { |
| 228 | ids.push(item.id) | 227 | ids.push(item.id) |
| 229 | }) | 228 | }) |
| 230 | } else { | 229 | } else { |
| 231 | ids.push(data) | 230 | ids.push(data) |
| 232 | } | 231 | } |
| 233 | if (ids.length === 0) { | 232 | if (ids.length === 0) { |
| 234 | this.$message({ | 233 | this.$message({ |
| 235 | message: '请选择需要重置密码的用户!', | 234 | message: '请选择需要重置密码的用户!', |
| 236 | showClose: true | 235 | showClose: true |
| 237 | }) | 236 | }) |
| 238 | return | 237 | return |
| 239 | } | 238 | } |
| 240 | this.$confirm( | 239 | this.$confirm( |
| 241 | `<div class="customer-message-wrapper"> | 240 | `<div class="customer-message-wrapper"> |
| 242 | <h5 class="title">确定要重置密码吗</h5> | 241 | <h5 class="title">确定要重置密码吗</h5> |
| 243 | <p class="result">执行后,数据将 | 242 | <p class="result">执行后,数据将 |
| 244 | <span >无法恢复</span> | 243 | <span >无法恢复</span> |
| 245 | </p> | 244 | </p> |
| 246 | </div>`, | 245 | </div>`, |
| 247 | '执行确认', | 246 | '执行确认', |
| 248 | { | 247 | { |
| 248 | dangerouslyUseHTMLString: true, | ||
| 249 | customClass: 'customer-delete', | ||
| 250 | confirmButtonText: '确定', | ||
| 251 | cancelButtonText: '取消', | ||
| 252 | type: 'warning' | ||
| 253 | } | ||
| 254 | ) | ||
| 255 | .then(() => { | ||
| 256 | resetPassword(ids).then((res) => { | ||
| 257 | if (res.status === 1) { | ||
| 258 | this.$message.success({ message: res.message, showClose: true }) | ||
| 259 | this.getTableList() | ||
| 260 | } else { | ||
| 261 | this.$message.error({ message: res.message, showClose: true }) | ||
| 262 | } | ||
| 263 | }) | ||
| 264 | }) | ||
| 265 | .catch(() => { }) | ||
| 266 | }, | ||
| 267 | // 上移下移 | ||
| 268 | moveUpward (index, row) { | ||
| 269 | realMove(row.dictid, "UP", this.tableData.data); | ||
| 270 | this.key++; | ||
| 271 | let id = findParents(this.tableData.data, row.dictid); | ||
| 272 | this.keyList = id; | ||
| 273 | }, | ||
| 274 | moveDown (index, row) { | ||
| 275 | realMove(row.dictid, "DOWN", this.tableData.data); | ||
| 276 | this.key++; | ||
| 277 | let id = findParents(this.tableData.data, row.dictid); | ||
| 278 | this.keyList = id; | ||
| 279 | }, | ||
| 280 | // 修改人员信息 | ||
| 281 | handleEdit (row) { | ||
| 282 | this.$refs.dialogForm.edit(row); | ||
| 283 | this.$refs.dialogForm.title = "修改"; | ||
| 284 | }, | ||
| 285 | // 删除 | ||
| 286 | handleDelete (id, content) { | ||
| 287 | this.$confirm(deleteDomStr(content), '执行确认', { | ||
| 249 | dangerouslyUseHTMLString: true, | 288 | dangerouslyUseHTMLString: true, |
| 250 | customClass: 'customer-delete', | 289 | customClass: 'customer-delete', |
| 251 | confirmButtonText: '确定', | 290 | confirmButtonText: '确定', |
| 252 | cancelButtonText: '取消', | 291 | cancelButtonText: '取消', |
| 253 | type: 'warning' | 292 | type: 'warning' |
| 254 | } | ||
| 255 | ) | ||
| 256 | .then(() => { | ||
| 257 | resetPassword(ids).then((res) => { | ||
| 258 | if (res.status === 1) { | ||
| 259 | this.$message.success({ message: res.message, showClose: true }) | ||
| 260 | this.getTableList() | ||
| 261 | } else { | ||
| 262 | this.$message.error({ message: res.message, showClose: true }) | ||
| 263 | } | ||
| 264 | }) | ||
| 265 | }) | 293 | }) |
| 266 | .catch(() => {}) | 294 | .then(() => { |
| 267 | }, | 295 | deleteAction(`${api.users}/${id}`).then((res) => { |
| 268 | // 上移下移 | 296 | if (res.status === 1) { |
| 269 | moveUpward(index, row) { | 297 | this.$message.success({ message: res.message, showClose: true }) |
| 270 | realMove(row.dictid, "UP", this.tableData.data); | 298 | } else { |
| 271 | this.key++; | 299 | this.$message.error({ message: res.message, showClose: true }) |
| 272 | let id = findParents(this.tableData.data, row.dictid); | 300 | } |
| 273 | this.keyList = id; | 301 | this.getTableList() |
| 274 | }, | 302 | }) |
| 275 | moveDown(index, row) { | ||
| 276 | realMove(row.dictid, "DOWN", this.tableData.data); | ||
| 277 | this.key++; | ||
| 278 | let id = findParents(this.tableData.data, row.dictid); | ||
| 279 | this.keyList = id; | ||
| 280 | }, | ||
| 281 | // 修改人员信息 | ||
| 282 | handleEdit(row) { | ||
| 283 | this.$refs.dialogForm.edit(row); | ||
| 284 | this.$refs.dialogForm.title = "修改"; | ||
| 285 | }, | ||
| 286 | // 删除 | ||
| 287 | handleDelete(id, content) { | ||
| 288 | this.$confirm(deleteDomStr(content), '执行确认', { | ||
| 289 | dangerouslyUseHTMLString: true, | ||
| 290 | customClass: 'customer-delete', | ||
| 291 | confirmButtonText: '确定', | ||
| 292 | cancelButtonText: '取消', | ||
| 293 | type: 'warning' | ||
| 294 | }) | ||
| 295 | .then(() => { | ||
| 296 | deleteAction(`${api.users}/${id}`).then((res) => { | ||
| 297 | if (res.status === 1) { | ||
| 298 | this.$message.success({ message: res.message, showClose: true }) | ||
| 299 | } else { | ||
| 300 | this.$message.error({ message: res.message, showClose: true }) | ||
| 301 | } | ||
| 302 | this.getTableList() | ||
| 303 | }) | 303 | }) |
| 304 | }) | 304 | .catch(() => { }) |
| 305 | .catch(() => {}) | 305 | }, |
| 306 | }, | 306 | // 新增回显 |
| 307 | // 新增回显 | 307 | reloadTableData () { |
| 308 | reloadTableData() { | 308 | this.getTableList() |
| 309 | this.getTableList() | 309 | }, |
| 310 | }, | 310 | }, |
| 311 | }, | 311 | }; |
| 312 | }; | ||
| 313 | </script> | 312 | </script> |
| 314 | <style scoped lang="scss"> | 313 | <style scoped lang="scss"> |
| 315 | @import "~@/styles/mixin.scss"; | 314 | @import "~@/styles/mixin.scss"; |
| 316 | @import "~@/styles/public.scss"; | 315 | @import "~@/styles/public.scss"; |
| 317 | .btnColRight { | 316 | .btnColRight { |
| 318 | margin-top: 20px; | 317 | margin-top: 20px; |
| 319 | } | 318 | } |
| 320 | </style> | 319 | </style> | ... | ... |
-
Please register or sign in to post a comment