Showing
6 changed files
with
1257 additions
and
6 deletions
src/views/arrival-list/dialog.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + class="entryDialog classCUploadDialog" | ||
| 4 | + :title="title" | ||
| 5 | + :visible.sync="outerVisible" | ||
| 6 | + :show-close="false" | ||
| 7 | + width="25%" | ||
| 8 | + :close-on-click-modal="false" | ||
| 9 | + :destroy-on-close="true" | ||
| 10 | + v-loading="loadings.dialogLoading" | ||
| 11 | + @close="close" | ||
| 12 | + > | ||
| 13 | + <div class="modelItem"> | ||
| 14 | + <el-form | ||
| 15 | + v-if="type != 'menuChange'" | ||
| 16 | + class="fedexFormStyle" | ||
| 17 | + ref="formData" | ||
| 18 | + :model="formData" | ||
| 19 | + :rules="rules" | ||
| 20 | + label-position="top" | ||
| 21 | + size="small" | ||
| 22 | + > | ||
| 23 | + <Formitem label="角色名称" prop="roleName" type="edit"> | ||
| 24 | + <el-input | ||
| 25 | + type="text" | ||
| 26 | + class="inputShadow" | ||
| 27 | + id="inputInner-edit-roleName" | ||
| 28 | + resize="none" | ||
| 29 | + v-model="formData.roleName" | ||
| 30 | + clearable | ||
| 31 | + placeholder="" | ||
| 32 | + ></el-input> | ||
| 33 | + </Formitem> | ||
| 34 | + </el-form> | ||
| 35 | + <el-tree | ||
| 36 | + ref="tree" | ||
| 37 | + class="menuTree" | ||
| 38 | + v-else | ||
| 39 | + :data="treeData" | ||
| 40 | + show-checkbox | ||
| 41 | + default-expand-all | ||
| 42 | + node-key="id" | ||
| 43 | + :default-expanded-keys="expandedKeys" | ||
| 44 | + :default-checked-keys="checkedKeys" | ||
| 45 | + :props="defaultProps" | ||
| 46 | + @check="treeCheckChange" | ||
| 47 | + > | ||
| 48 | + </el-tree> | ||
| 49 | + </div> | ||
| 50 | + <div class="dialogOption entrySave"> | ||
| 51 | + <el-button | ||
| 52 | + class="entrySaveButton" | ||
| 53 | + :disabled="loadings.submitLoading" | ||
| 54 | + @click="submit" | ||
| 55 | + >确 定</el-button | ||
| 56 | + > | ||
| 57 | + <el-button | ||
| 58 | + class="entrySaveButton" | ||
| 59 | + :disabled="loadings.uploadLoading" | ||
| 60 | + @click="close" | ||
| 61 | + >关 闭</el-button | ||
| 62 | + > | ||
| 63 | + </div> | ||
| 64 | + </el-dialog> | ||
| 65 | +</template> | ||
| 66 | + | ||
| 67 | +<script> | ||
| 68 | +import { | ||
| 69 | + addRoleData, | ||
| 70 | + updateRoleData, | ||
| 71 | + updateRoleMenuData, | ||
| 72 | + getMenuByRoleId, | ||
| 73 | +} from "@/api/system/user.js"; | ||
| 74 | +import { getRouters } from "@/api/menu"; | ||
| 75 | +export default { | ||
| 76 | + props: { | ||
| 77 | + outerVisible: { | ||
| 78 | + type: Boolean, | ||
| 79 | + default: false, | ||
| 80 | + }, | ||
| 81 | + title: { | ||
| 82 | + type: String, | ||
| 83 | + default: "新增角色", | ||
| 84 | + }, | ||
| 85 | + type: { | ||
| 86 | + type: String, | ||
| 87 | + default: "", | ||
| 88 | + }, | ||
| 89 | + active: { | ||
| 90 | + type: Object, | ||
| 91 | + default: null, | ||
| 92 | + }, | ||
| 93 | + }, | ||
| 94 | + watch: { | ||
| 95 | + outerVisible(val) { | ||
| 96 | + if (val) { | ||
| 97 | + this.loadings.dialogLoading = false; | ||
| 98 | + if (this.type == "update") { | ||
| 99 | + this.formData = this.active; | ||
| 100 | + } else if (this.type == "menuChange") { | ||
| 101 | + this.formData = this.active; | ||
| 102 | + this.searchTreeData(); | ||
| 103 | + this.loadCheckedKeys();//加载已绑定的菜单 | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + }, | ||
| 107 | + }, | ||
| 108 | + data() { | ||
| 109 | + return { | ||
| 110 | + formData: { | ||
| 111 | + roleName: "", | ||
| 112 | + }, | ||
| 113 | + treeData: [], | ||
| 114 | + treeCheckData: [], | ||
| 115 | + expandedKeys: [], | ||
| 116 | + checkedKeys: [], | ||
| 117 | + rules: { | ||
| 118 | + roleName: [ | ||
| 119 | + { | ||
| 120 | + required: true, | ||
| 121 | + trigger: "blur", | ||
| 122 | + message: "角色名称不能为空!", | ||
| 123 | + }, | ||
| 124 | + ], | ||
| 125 | + }, | ||
| 126 | + defaultProps: { | ||
| 127 | + children: "children", | ||
| 128 | + label: "label", | ||
| 129 | + }, | ||
| 130 | + searchForm: {}, | ||
| 131 | + loadings: { | ||
| 132 | + dialogLoading: false, | ||
| 133 | + uploadLoading: false, | ||
| 134 | + submitLoading: false, | ||
| 135 | + }, | ||
| 136 | + loadingText: "", | ||
| 137 | + }; | ||
| 138 | + }, | ||
| 139 | + methods: { | ||
| 140 | + //查询菜单数据 | ||
| 141 | + searchTreeData() { | ||
| 142 | + this.loadings.dialogLoading = true; | ||
| 143 | + getRouters() | ||
| 144 | + .then((res) => { | ||
| 145 | + if (res.code === "200") { | ||
| 146 | + let arr = []; | ||
| 147 | + res.data.forEach((item) => { | ||
| 148 | + let status = true; | ||
| 149 | + if (item.parentMenuId == 0) { | ||
| 150 | + let obj = { | ||
| 151 | + id: item.menuId, | ||
| 152 | + label: item.menuName, | ||
| 153 | + children: [], | ||
| 154 | + }; | ||
| 155 | + arr.forEach((menuItem) => { | ||
| 156 | + if (menuItem.id == item.menuId) { | ||
| 157 | + status = false; | ||
| 158 | + menuItem.label = item.menuName; | ||
| 159 | + } | ||
| 160 | + }); | ||
| 161 | + if (status) { | ||
| 162 | + arr.push(obj); | ||
| 163 | + } | ||
| 164 | + } else { | ||
| 165 | + let obj = { | ||
| 166 | + id: item.menuId, | ||
| 167 | + label: item.menuName, | ||
| 168 | + }; | ||
| 169 | + arr.forEach((menuItem) => { | ||
| 170 | + if (menuItem.id == item.parentMenuId) { | ||
| 171 | + status = false; | ||
| 172 | + menuItem.children.push(obj); | ||
| 173 | + } | ||
| 174 | + }); | ||
| 175 | + if (status) { | ||
| 176 | + arr.push({ | ||
| 177 | + id: item.parentMenuId, | ||
| 178 | + label: "", | ||
| 179 | + children: [obj], | ||
| 180 | + }); | ||
| 181 | + } | ||
| 182 | + } | ||
| 183 | + }); | ||
| 184 | + this.treeData = arr; | ||
| 185 | + } else { | ||
| 186 | + this.alertWarningMsg(res.message); | ||
| 187 | + } | ||
| 188 | + this.loadings.dialogLoading = false; | ||
| 189 | + }) | ||
| 190 | + .catch((err) => { | ||
| 191 | + console.log(err); | ||
| 192 | + this.loadings.dialogLoading = false; | ||
| 193 | + }); | ||
| 194 | + }, | ||
| 195 | + //数据保存 | ||
| 196 | + submit() { | ||
| 197 | + this.loadings.dialogLoading = true; | ||
| 198 | + let obj = {}; | ||
| 199 | + if (this.type == "add") { | ||
| 200 | + this.$refs.formData.validate((valid) => { | ||
| 201 | + if (valid) { | ||
| 202 | + obj.roleName = this.formData.roleName; | ||
| 203 | + this.addapi(obj); | ||
| 204 | + } else { | ||
| 205 | + this.loadings.dialogLoading = false; | ||
| 206 | + } | ||
| 207 | + }); | ||
| 208 | + } else if (this.type == "update") { | ||
| 209 | + this.$refs.formData.validate((valid) => { | ||
| 210 | + if (valid) { | ||
| 211 | + obj.roleId = this.formData.roleId; | ||
| 212 | + obj.roleName = this.formData.roleName; | ||
| 213 | + this.updateapi(obj); | ||
| 214 | + } else { | ||
| 215 | + this.loadings.dialogLoading = false; | ||
| 216 | + } | ||
| 217 | + }); | ||
| 218 | + } else if (this.type == "menuChange") { | ||
| 219 | + obj.menuId = this.treeCheckData; // 使用合并后的选中节点 | ||
| 220 | + obj.roleId = this.formData.roleId; | ||
| 221 | + this.menuChangeapi(obj); | ||
| 222 | + } | ||
| 223 | + }, | ||
| 224 | + //新增 | ||
| 225 | + addapi(val) { | ||
| 226 | + addRoleData(val) | ||
| 227 | + .then((res) => { | ||
| 228 | + if (res.code === "200") { | ||
| 229 | + this.msgSuccess(res.message); | ||
| 230 | + this.close(); | ||
| 231 | + } else { | ||
| 232 | + this.alertWarningMsg(res.message); | ||
| 233 | + this.loadings.dialogLoading = false; | ||
| 234 | + } | ||
| 235 | + }) | ||
| 236 | + .catch((err) => { | ||
| 237 | + console.log(err); | ||
| 238 | + this.loadings.dialogLoading = false; | ||
| 239 | + }); | ||
| 240 | + }, | ||
| 241 | + //修改 | ||
| 242 | + updateapi(val) { | ||
| 243 | + updateRoleData(val) | ||
| 244 | + .then((res) => { | ||
| 245 | + if (res.code === "200") { | ||
| 246 | + this.msgSuccess(res.message); | ||
| 247 | + this.close(); | ||
| 248 | + } else { | ||
| 249 | + this.alertWarningMsg(res.message); | ||
| 250 | + this.loadings.dialogLoading = false; | ||
| 251 | + } | ||
| 252 | + }) | ||
| 253 | + .catch((err) => { | ||
| 254 | + console.log(err); | ||
| 255 | + this.loadings.dialogLoading = false; | ||
| 256 | + }); | ||
| 257 | + }, | ||
| 258 | + //菜单权限修改 | ||
| 259 | + menuChangeapi(val) { | ||
| 260 | + updateRoleMenuData(val) | ||
| 261 | + .then((res) => { | ||
| 262 | + if (res.code === "200") { | ||
| 263 | + this.msgSuccess(res.message); | ||
| 264 | + this.close(); | ||
| 265 | + this.$store.dispatch('GenerateRoutes') | ||
| 266 | + } else { | ||
| 267 | + this.alertWarningMsg(res.message); | ||
| 268 | + this.loadings.dialogLoading = false; | ||
| 269 | + } | ||
| 270 | + }) | ||
| 271 | + .catch((err) => { | ||
| 272 | + console.log(err); | ||
| 273 | + this.loadings.dialogLoading = false; | ||
| 274 | + }); | ||
| 275 | + }, | ||
| 276 | + treeCheckChange(data, checked) { | ||
| 277 | + console.log(data, checked); | ||
| 278 | + let arr = []; | ||
| 279 | + arr = checked.checkedKeys.concat(checked.halfCheckedKeys); | ||
| 280 | + this.treeCheckData = arr; | ||
| 281 | + }, | ||
| 282 | + close() { | ||
| 283 | + this.formData = { | ||
| 284 | + roleName: "", | ||
| 285 | + }; | ||
| 286 | + this.checkedKeys = [] | ||
| 287 | + this.$emit("close"); | ||
| 288 | + }, | ||
| 289 | + // 加载已绑定的菜单 | ||
| 290 | + loadCheckedKeys() { | ||
| 291 | + if (this.formData.roleId) { | ||
| 292 | + getMenuByRoleId(this.formData.roleId) | ||
| 293 | + .then((res) => { | ||
| 294 | + if (res.code === "200") { | ||
| 295 | + this.checkedKeys = res.data.filter(item => item.isBinding && (item.parentMenuId!=0 ) ).map(item => item.menuId); | ||
| 296 | + //console.log('初始 checkedKeys:', this.checkedKeys); | ||
| 297 | + this.$nextTick(() => { | ||
| 298 | + this.$refs.tree.setCheckedKeys(this.checkedKeys); | ||
| 299 | + this.updateTreeCheckData(); | ||
| 300 | + }); | ||
| 301 | + } else { | ||
| 302 | + this.alertWarningMsg(res.message); | ||
| 303 | + } | ||
| 304 | + }) | ||
| 305 | + .catch((err) => { | ||
| 306 | + console.log(err); | ||
| 307 | + }); | ||
| 308 | + } | ||
| 309 | + }, | ||
| 310 | + //加载选中的节点及半选中的父节点 | ||
| 311 | + updateTreeCheckData() { | ||
| 312 | + const checkedKeys = this.$refs.tree.getCheckedKeys(); | ||
| 313 | + const halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys(); | ||
| 314 | + this.treeCheckData = checkedKeys.concat(halfCheckedKeys); | ||
| 315 | + //console.log('合并后的 treeCheckData:', this.treeCheckData); | ||
| 316 | + }, | ||
| 317 | + | ||
| 318 | + }, | ||
| 319 | +}; | ||
| 320 | +</script> | ||
| 321 | + | ||
| 322 | +<style lang="scss" scoped> | ||
| 323 | +@import "@/assets/styles/variables.scss"; | ||
| 324 | + | ||
| 325 | +.menuTree { | ||
| 326 | + max-width: 350px; | ||
| 327 | + max-height: 300px; | ||
| 328 | + overflow: auto; | ||
| 329 | + margin: 0 auto; | ||
| 330 | + border: 1px solid #999; | ||
| 331 | + padding: 10px; | ||
| 332 | +} | ||
| 333 | +</style> |
src/views/arrival-list/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="entrySreach"> | ||
| 3 | + <el-form | ||
| 4 | + class="fedexFormStyle fedexformSreach fedexformSreachBottomBorder" | ||
| 5 | + ref="sreachForm" | ||
| 6 | + :model="sreachFormData" | ||
| 7 | + label-position="top" | ||
| 8 | + size="small" | ||
| 9 | + > | ||
| 10 | + <el-row class="row-border"> | ||
| 11 | + <!-- 角色名称 --> | ||
| 12 | + <el-col :span="5"> | ||
| 13 | + <Formitem label="物流运单编号" prop="logisticsNo"> | ||
| 14 | + <el-input | ||
| 15 | + type="text" | ||
| 16 | + class="inputShadow" | ||
| 17 | + id="inputInner--logisticsNo" | ||
| 18 | + resize="none" | ||
| 19 | + v-model="sreachFormData.logisticsNo" | ||
| 20 | + clearable | ||
| 21 | + placeholder="" | ||
| 22 | + ></el-input> | ||
| 23 | + </Formitem> | ||
| 24 | + </el-col> | ||
| 25 | + <el-col :span="5"> | ||
| 26 | + <Formitem label="物流运单编号" prop="roleName"> | ||
| 27 | + <el-input | ||
| 28 | + type="text" | ||
| 29 | + class="inputShadow" | ||
| 30 | + id="inputInner--roleName" | ||
| 31 | + resize="none" | ||
| 32 | + v-model="sreachFormData.roleName" | ||
| 33 | + clearable | ||
| 34 | + placeholder="" | ||
| 35 | + ></el-input> | ||
| 36 | + </Formitem> | ||
| 37 | + </el-col> | ||
| 38 | + <el-col :span="5"> | ||
| 39 | + <Formitem label="物流运单编号" prop="roleName"> | ||
| 40 | + <el-input | ||
| 41 | + type="text" | ||
| 42 | + class="inputShadow" | ||
| 43 | + id="inputInner--roleName" | ||
| 44 | + resize="none" | ||
| 45 | + v-model="sreachFormData.roleName" | ||
| 46 | + clearable | ||
| 47 | + placeholder="" | ||
| 48 | + ></el-input> | ||
| 49 | + </Formitem> | ||
| 50 | + </el-col> | ||
| 51 | + <el-col :span="5"> | ||
| 52 | + <Formitem label="物流运单编号" prop="roleName"> | ||
| 53 | + <el-input | ||
| 54 | + type="text" | ||
| 55 | + class="inputShadow" | ||
| 56 | + id="inputInner--roleName" | ||
| 57 | + resize="none" | ||
| 58 | + v-model="sreachFormData.roleName" | ||
| 59 | + clearable | ||
| 60 | + placeholder="" | ||
| 61 | + ></el-input> | ||
| 62 | + </Formitem> | ||
| 63 | + </el-col> | ||
| 64 | + <el-col :span="2"> | ||
| 65 | + <el-form-item class="textCenter"> | ||
| 66 | + <el-button | ||
| 67 | + class="entrySreachButton" | ||
| 68 | + type="text" | ||
| 69 | + icon="el-icon-search" | ||
| 70 | + :loading="loadings.searchLoading" | ||
| 71 | + @click="search(0)" | ||
| 72 | + ></el-button> | ||
| 73 | + </el-form-item> | ||
| 74 | + </el-col> | ||
| 75 | + <el-col :span="2"> | ||
| 76 | + <el-form-item class="textCenter"> | ||
| 77 | + <el-button | ||
| 78 | + type="text" | ||
| 79 | + size="small" | ||
| 80 | + icon="el-icon-refresh" | ||
| 81 | + @click="clear" | ||
| 82 | + > | ||
| 83 | + 重置 | ||
| 84 | + </el-button> | ||
| 85 | + </el-form-item> | ||
| 86 | + </el-col> | ||
| 87 | + </el-row> | ||
| 88 | + </el-form> | ||
| 89 | + <div class="optionButton"> | ||
| 90 | + <el-button | ||
| 91 | + class="entrySaveButton" | ||
| 92 | + icon="el-icon-plus" | ||
| 93 | + size="small" | ||
| 94 | + @click="addRole" | ||
| 95 | + > | ||
| 96 | + 新增角色 | ||
| 97 | + </el-button> | ||
| 98 | + </div> | ||
| 99 | + <Table | ||
| 100 | + class="fedexDetialTable fedexSreachTable" | ||
| 101 | + ref="entryTable" | ||
| 102 | + :data="tableData" | ||
| 103 | + :headerData="headerData" | ||
| 104 | + :maxHeight="tableMaxheight" | ||
| 105 | + :border="true" | ||
| 106 | + :pagination="true" | ||
| 107 | + :order="false" | ||
| 108 | + :loading="loadings.searchLoading" | ||
| 109 | + :page="page.pageIndex" | ||
| 110 | + :pageSizes="[20, 30, 50, 100]" | ||
| 111 | + :totalCount="page.total" | ||
| 112 | + @sizeChange="sizeChange" | ||
| 113 | + @currentChange="currentChange" | ||
| 114 | + :selection="false" | ||
| 115 | + :selectFixed="false" | ||
| 116 | + :rowSelectDataType="false" | ||
| 117 | + > | ||
| 118 | + <template slot="optionColumn"> | ||
| 119 | + <el-table-column align="left" label="操作"> | ||
| 120 | + <template slot-scope="scope"> | ||
| 121 | + <el-button type="text" @click="update(scope.row)"> | ||
| 122 | + 角色修改 | ||
| 123 | + </el-button> | ||
| 124 | + <el-button type="text" @click="muenChange(scope.row)"> | ||
| 125 | + 权限绑定 | ||
| 126 | + </el-button> | ||
| 127 | + </template> | ||
| 128 | + </el-table-column> | ||
| 129 | + </template> | ||
| 130 | + </Table> | ||
| 131 | + <DialogVue | ||
| 132 | + :outerVisible="outerVisible" | ||
| 133 | + :title="dialogTitle" | ||
| 134 | + :type="editType" | ||
| 135 | + :active="activeData" | ||
| 136 | + @close="dialogClose" | ||
| 137 | + /> | ||
| 138 | + </div> | ||
| 139 | +</template> | ||
| 140 | + | ||
| 141 | +<script> | ||
| 142 | +import { getRoleList } from "@/api/system/user.js"; | ||
| 143 | +import DialogVue from "./dialog.vue"; | ||
| 144 | +import { addMenu } from "@/api/menu"; | ||
| 145 | +export default { | ||
| 146 | + name: "ArrivalList", | ||
| 147 | + components: { | ||
| 148 | + DialogVue, | ||
| 149 | + }, | ||
| 150 | + data() { | ||
| 151 | + return { | ||
| 152 | + sreachFormData: { | ||
| 153 | + logisticsNo: "", | ||
| 154 | + }, | ||
| 155 | + page: { | ||
| 156 | + pageIndex: 1, | ||
| 157 | + pageSize: 20, | ||
| 158 | + total: 0, | ||
| 159 | + }, | ||
| 160 | + activeData: null, | ||
| 161 | + tableData: [], | ||
| 162 | + headerData: [ | ||
| 163 | + { | ||
| 164 | + name: "角色名", | ||
| 165 | + value: "roleName", | ||
| 166 | + width: "", | ||
| 167 | + align: "left", | ||
| 168 | + }, | ||
| 169 | + ], | ||
| 170 | + loadings: { | ||
| 171 | + searchLoading: false, | ||
| 172 | + }, | ||
| 173 | + tableMaxheight: null, | ||
| 174 | + outerVisible: false, | ||
| 175 | + dialogTitle: "", | ||
| 176 | + editType: "", | ||
| 177 | + }; | ||
| 178 | + }, | ||
| 179 | + created() { | ||
| 180 | + this.search(0); | ||
| 181 | + }, | ||
| 182 | + mounted() { | ||
| 183 | + this.tableMaxheight = window.innerHeight - 300; | ||
| 184 | + }, | ||
| 185 | + methods: { | ||
| 186 | + // 清空 | ||
| 187 | + clear() { | ||
| 188 | + this.sreachFormData = { | ||
| 189 | + roleName: "", | ||
| 190 | + }; | ||
| 191 | + this.search(1); | ||
| 192 | + }, | ||
| 193 | + //查询 | ||
| 194 | + search(val) { | ||
| 195 | + this.loadings.searchLoading = true; | ||
| 196 | + if (val == 0) { | ||
| 197 | + this.page.pageIndex = 1; | ||
| 198 | + } | ||
| 199 | + let obj = this.sreachFormData; | ||
| 200 | + obj.pageIndex = this.page.pageIndex; | ||
| 201 | + obj.pageSize = this.page.pageSize; | ||
| 202 | + getRoleList(obj) | ||
| 203 | + .then((res) => { | ||
| 204 | + if (res.code === "200") { | ||
| 205 | + this.tableData = res.data.value; | ||
| 206 | + this.page.total = res.data.totalItems; | ||
| 207 | + this.tableData.forEach((item, idx) => { | ||
| 208 | + item.index = idx; | ||
| 209 | + }); | ||
| 210 | + } else { | ||
| 211 | + this.alertWarningMsg(res.message); | ||
| 212 | + } | ||
| 213 | + this.loadings.searchLoading = false; | ||
| 214 | + }) | ||
| 215 | + .catch((err) => { | ||
| 216 | + console.log(err); | ||
| 217 | + this.loadings.searchLoading = false; | ||
| 218 | + }); | ||
| 219 | + }, | ||
| 220 | + addRole() { | ||
| 221 | + this.dialogTitle = "新增角色"; | ||
| 222 | + this.editType = "add"; | ||
| 223 | + this.outerVisible = true; | ||
| 224 | + }, | ||
| 225 | + // 新增菜单用,可以不麻烦后端--------- | ||
| 226 | + addMenuFn() { | ||
| 227 | + let params = { | ||
| 228 | + icon: "", | ||
| 229 | + menuName: "运抵单查询", | ||
| 230 | + order: 4.4, | ||
| 231 | + parentMenuId: 90, | ||
| 232 | + physicalUrl: "/arrival-list", | ||
| 233 | + url: "", | ||
| 234 | + }; | ||
| 235 | + addMenu(params).then((res) => { | ||
| 236 | + console.log(res); | ||
| 237 | + }); | ||
| 238 | + }, | ||
| 239 | + update(val) { | ||
| 240 | + this.dialogTitle = "修改角色"; | ||
| 241 | + this.editType = "update"; | ||
| 242 | + this.outerVisible = true; | ||
| 243 | + this.activeData = val; | ||
| 244 | + }, | ||
| 245 | + muenChange(val) { | ||
| 246 | + this.dialogTitle = "绑定权限"; | ||
| 247 | + this.editType = "menuChange"; | ||
| 248 | + this.outerVisible = true; | ||
| 249 | + this.activeData = val; | ||
| 250 | + }, | ||
| 251 | + dialogClose() { | ||
| 252 | + this.outerVisible = false; | ||
| 253 | + this.activeData = null; | ||
| 254 | + this.search(1); | ||
| 255 | + }, | ||
| 256 | + //分页 | ||
| 257 | + currentChange(val) { | ||
| 258 | + this.page.pageIndex = val.page; | ||
| 259 | + this.search(1); | ||
| 260 | + }, | ||
| 261 | + sizeChange(val) { | ||
| 262 | + this.page.pageSize = val; | ||
| 263 | + this.search(1); | ||
| 264 | + }, | ||
| 265 | + input() { | ||
| 266 | + this.$forceUpdate(); | ||
| 267 | + }, | ||
| 268 | + }, | ||
| 269 | +}; | ||
| 270 | +</script> | ||
| 271 | + | ||
| 272 | +<style scoped lang="scss"> | ||
| 273 | +@import "@/assets/styles/variables.scss"; | ||
| 274 | +.entrySreach { | ||
| 275 | + height: 100%; | ||
| 276 | + background-color: $menuLightBg; | ||
| 277 | + | ||
| 278 | + .entrySreachButton { | ||
| 279 | + display: inline-block; | ||
| 280 | + font-size: 20px; | ||
| 281 | + color: $fedexButton !important; | ||
| 282 | + } | ||
| 283 | + | ||
| 284 | + .optionButton { | ||
| 285 | + padding: 10px; | ||
| 286 | + text-align: left; | ||
| 287 | + | ||
| 288 | + .el-button { | ||
| 289 | + color: $fedexButton; | ||
| 290 | + border-color: $fedexButton !important; | ||
| 291 | + | ||
| 292 | + svg { | ||
| 293 | + display: inline-block; | ||
| 294 | + margin-right: 5px; | ||
| 295 | + fill: $fedexButton; | ||
| 296 | + } | ||
| 297 | + } | ||
| 298 | + | ||
| 299 | + .entrySaveButton:hover, | ||
| 300 | + .entrySaveButton:focus { | ||
| 301 | + color: $menuLightBg !important; | ||
| 302 | + background-color: $fedexButton !important; | ||
| 303 | + } | ||
| 304 | + } | ||
| 305 | +} | ||
| 306 | + | ||
| 307 | +.texttareaTip { | ||
| 308 | + position: absolute; | ||
| 309 | + top: 52%; | ||
| 310 | + right: 20px; | ||
| 311 | + transform: translate(0, -50%); | ||
| 312 | + z-index: 10; | ||
| 313 | +} | ||
| 314 | +</style> |
src/views/log-list/dialog.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + class="entryDialog classCUploadDialog" | ||
| 4 | + :title="title" | ||
| 5 | + :visible.sync="outerVisible" | ||
| 6 | + :show-close="false" | ||
| 7 | + width="25%" | ||
| 8 | + :close-on-click-modal="false" | ||
| 9 | + :destroy-on-close="true" | ||
| 10 | + v-loading="loadings.dialogLoading" | ||
| 11 | + @close="close" | ||
| 12 | + > | ||
| 13 | + <div class="modelItem"> | ||
| 14 | + <el-form | ||
| 15 | + v-if="type != 'menuChange'" | ||
| 16 | + class="fedexFormStyle" | ||
| 17 | + ref="formData" | ||
| 18 | + :model="formData" | ||
| 19 | + :rules="rules" | ||
| 20 | + label-position="top" | ||
| 21 | + size="small" | ||
| 22 | + > | ||
| 23 | + <Formitem label="角色名称" prop="roleName" type="edit"> | ||
| 24 | + <el-input | ||
| 25 | + type="text" | ||
| 26 | + class="inputShadow" | ||
| 27 | + id="inputInner-edit-roleName" | ||
| 28 | + resize="none" | ||
| 29 | + v-model="formData.roleName" | ||
| 30 | + clearable | ||
| 31 | + placeholder="" | ||
| 32 | + ></el-input> | ||
| 33 | + </Formitem> | ||
| 34 | + </el-form> | ||
| 35 | + <el-tree | ||
| 36 | + ref="tree" | ||
| 37 | + class="menuTree" | ||
| 38 | + v-else | ||
| 39 | + :data="treeData" | ||
| 40 | + show-checkbox | ||
| 41 | + default-expand-all | ||
| 42 | + node-key="id" | ||
| 43 | + :default-expanded-keys="expandedKeys" | ||
| 44 | + :default-checked-keys="checkedKeys" | ||
| 45 | + :props="defaultProps" | ||
| 46 | + @check="treeCheckChange" | ||
| 47 | + > | ||
| 48 | + </el-tree> | ||
| 49 | + </div> | ||
| 50 | + <div class="dialogOption entrySave"> | ||
| 51 | + <el-button | ||
| 52 | + class="entrySaveButton" | ||
| 53 | + :disabled="loadings.submitLoading" | ||
| 54 | + @click="submit" | ||
| 55 | + >确 定</el-button | ||
| 56 | + > | ||
| 57 | + <el-button | ||
| 58 | + class="entrySaveButton" | ||
| 59 | + :disabled="loadings.uploadLoading" | ||
| 60 | + @click="close" | ||
| 61 | + >关 闭</el-button | ||
| 62 | + > | ||
| 63 | + </div> | ||
| 64 | + </el-dialog> | ||
| 65 | +</template> | ||
| 66 | + | ||
| 67 | +<script> | ||
| 68 | +import { | ||
| 69 | + addRoleData, | ||
| 70 | + updateRoleData, | ||
| 71 | + updateRoleMenuData, | ||
| 72 | + getMenuByRoleId, | ||
| 73 | +} from "@/api/system/user.js"; | ||
| 74 | +import { getRouters } from "@/api/menu"; | ||
| 75 | +export default { | ||
| 76 | + props: { | ||
| 77 | + outerVisible: { | ||
| 78 | + type: Boolean, | ||
| 79 | + default: false, | ||
| 80 | + }, | ||
| 81 | + title: { | ||
| 82 | + type: String, | ||
| 83 | + default: "新增角色", | ||
| 84 | + }, | ||
| 85 | + type: { | ||
| 86 | + type: String, | ||
| 87 | + default: "", | ||
| 88 | + }, | ||
| 89 | + active: { | ||
| 90 | + type: Object, | ||
| 91 | + default: null, | ||
| 92 | + }, | ||
| 93 | + }, | ||
| 94 | + watch: { | ||
| 95 | + outerVisible(val) { | ||
| 96 | + if (val) { | ||
| 97 | + this.loadings.dialogLoading = false; | ||
| 98 | + if (this.type == "update") { | ||
| 99 | + this.formData = this.active; | ||
| 100 | + } else if (this.type == "menuChange") { | ||
| 101 | + this.formData = this.active; | ||
| 102 | + this.searchTreeData(); | ||
| 103 | + this.loadCheckedKeys();//加载已绑定的菜单 | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + }, | ||
| 107 | + }, | ||
| 108 | + data() { | ||
| 109 | + return { | ||
| 110 | + formData: { | ||
| 111 | + roleName: "", | ||
| 112 | + }, | ||
| 113 | + treeData: [], | ||
| 114 | + treeCheckData: [], | ||
| 115 | + expandedKeys: [], | ||
| 116 | + checkedKeys: [], | ||
| 117 | + rules: { | ||
| 118 | + roleName: [ | ||
| 119 | + { | ||
| 120 | + required: true, | ||
| 121 | + trigger: "blur", | ||
| 122 | + message: "角色名称不能为空!", | ||
| 123 | + }, | ||
| 124 | + ], | ||
| 125 | + }, | ||
| 126 | + defaultProps: { | ||
| 127 | + children: "children", | ||
| 128 | + label: "label", | ||
| 129 | + }, | ||
| 130 | + searchForm: {}, | ||
| 131 | + loadings: { | ||
| 132 | + dialogLoading: false, | ||
| 133 | + uploadLoading: false, | ||
| 134 | + submitLoading: false, | ||
| 135 | + }, | ||
| 136 | + loadingText: "", | ||
| 137 | + }; | ||
| 138 | + }, | ||
| 139 | + methods: { | ||
| 140 | + //查询菜单数据 | ||
| 141 | + searchTreeData() { | ||
| 142 | + this.loadings.dialogLoading = true; | ||
| 143 | + getRouters() | ||
| 144 | + .then((res) => { | ||
| 145 | + if (res.code === "200") { | ||
| 146 | + let arr = []; | ||
| 147 | + res.data.forEach((item) => { | ||
| 148 | + let status = true; | ||
| 149 | + if (item.parentMenuId == 0) { | ||
| 150 | + let obj = { | ||
| 151 | + id: item.menuId, | ||
| 152 | + label: item.menuName, | ||
| 153 | + children: [], | ||
| 154 | + }; | ||
| 155 | + arr.forEach((menuItem) => { | ||
| 156 | + if (menuItem.id == item.menuId) { | ||
| 157 | + status = false; | ||
| 158 | + menuItem.label = item.menuName; | ||
| 159 | + } | ||
| 160 | + }); | ||
| 161 | + if (status) { | ||
| 162 | + arr.push(obj); | ||
| 163 | + } | ||
| 164 | + } else { | ||
| 165 | + let obj = { | ||
| 166 | + id: item.menuId, | ||
| 167 | + label: item.menuName, | ||
| 168 | + }; | ||
| 169 | + arr.forEach((menuItem) => { | ||
| 170 | + if (menuItem.id == item.parentMenuId) { | ||
| 171 | + status = false; | ||
| 172 | + menuItem.children.push(obj); | ||
| 173 | + } | ||
| 174 | + }); | ||
| 175 | + if (status) { | ||
| 176 | + arr.push({ | ||
| 177 | + id: item.parentMenuId, | ||
| 178 | + label: "", | ||
| 179 | + children: [obj], | ||
| 180 | + }); | ||
| 181 | + } | ||
| 182 | + } | ||
| 183 | + }); | ||
| 184 | + this.treeData = arr; | ||
| 185 | + } else { | ||
| 186 | + this.alertWarningMsg(res.message); | ||
| 187 | + } | ||
| 188 | + this.loadings.dialogLoading = false; | ||
| 189 | + }) | ||
| 190 | + .catch((err) => { | ||
| 191 | + console.log(err); | ||
| 192 | + this.loadings.dialogLoading = false; | ||
| 193 | + }); | ||
| 194 | + }, | ||
| 195 | + //数据保存 | ||
| 196 | + submit() { | ||
| 197 | + this.loadings.dialogLoading = true; | ||
| 198 | + let obj = {}; | ||
| 199 | + if (this.type == "add") { | ||
| 200 | + this.$refs.formData.validate((valid) => { | ||
| 201 | + if (valid) { | ||
| 202 | + obj.roleName = this.formData.roleName; | ||
| 203 | + this.addapi(obj); | ||
| 204 | + } else { | ||
| 205 | + this.loadings.dialogLoading = false; | ||
| 206 | + } | ||
| 207 | + }); | ||
| 208 | + } else if (this.type == "update") { | ||
| 209 | + this.$refs.formData.validate((valid) => { | ||
| 210 | + if (valid) { | ||
| 211 | + obj.roleId = this.formData.roleId; | ||
| 212 | + obj.roleName = this.formData.roleName; | ||
| 213 | + this.updateapi(obj); | ||
| 214 | + } else { | ||
| 215 | + this.loadings.dialogLoading = false; | ||
| 216 | + } | ||
| 217 | + }); | ||
| 218 | + } else if (this.type == "menuChange") { | ||
| 219 | + obj.menuId = this.treeCheckData; // 使用合并后的选中节点 | ||
| 220 | + obj.roleId = this.formData.roleId; | ||
| 221 | + this.menuChangeapi(obj); | ||
| 222 | + } | ||
| 223 | + }, | ||
| 224 | + //新增 | ||
| 225 | + addapi(val) { | ||
| 226 | + addRoleData(val) | ||
| 227 | + .then((res) => { | ||
| 228 | + if (res.code === "200") { | ||
| 229 | + this.msgSuccess(res.message); | ||
| 230 | + this.close(); | ||
| 231 | + } else { | ||
| 232 | + this.alertWarningMsg(res.message); | ||
| 233 | + this.loadings.dialogLoading = false; | ||
| 234 | + } | ||
| 235 | + }) | ||
| 236 | + .catch((err) => { | ||
| 237 | + console.log(err); | ||
| 238 | + this.loadings.dialogLoading = false; | ||
| 239 | + }); | ||
| 240 | + }, | ||
| 241 | + //修改 | ||
| 242 | + updateapi(val) { | ||
| 243 | + updateRoleData(val) | ||
| 244 | + .then((res) => { | ||
| 245 | + if (res.code === "200") { | ||
| 246 | + this.msgSuccess(res.message); | ||
| 247 | + this.close(); | ||
| 248 | + } else { | ||
| 249 | + this.alertWarningMsg(res.message); | ||
| 250 | + this.loadings.dialogLoading = false; | ||
| 251 | + } | ||
| 252 | + }) | ||
| 253 | + .catch((err) => { | ||
| 254 | + console.log(err); | ||
| 255 | + this.loadings.dialogLoading = false; | ||
| 256 | + }); | ||
| 257 | + }, | ||
| 258 | + //菜单权限修改 | ||
| 259 | + menuChangeapi(val) { | ||
| 260 | + updateRoleMenuData(val) | ||
| 261 | + .then((res) => { | ||
| 262 | + if (res.code === "200") { | ||
| 263 | + this.msgSuccess(res.message); | ||
| 264 | + this.close(); | ||
| 265 | + this.$store.dispatch('GenerateRoutes') | ||
| 266 | + } else { | ||
| 267 | + this.alertWarningMsg(res.message); | ||
| 268 | + this.loadings.dialogLoading = false; | ||
| 269 | + } | ||
| 270 | + }) | ||
| 271 | + .catch((err) => { | ||
| 272 | + console.log(err); | ||
| 273 | + this.loadings.dialogLoading = false; | ||
| 274 | + }); | ||
| 275 | + }, | ||
| 276 | + treeCheckChange(data, checked) { | ||
| 277 | + console.log(data, checked); | ||
| 278 | + let arr = []; | ||
| 279 | + arr = checked.checkedKeys.concat(checked.halfCheckedKeys); | ||
| 280 | + this.treeCheckData = arr; | ||
| 281 | + }, | ||
| 282 | + close() { | ||
| 283 | + this.formData = { | ||
| 284 | + roleName: "", | ||
| 285 | + }; | ||
| 286 | + this.checkedKeys = [] | ||
| 287 | + this.$emit("close"); | ||
| 288 | + }, | ||
| 289 | + // 加载已绑定的菜单 | ||
| 290 | + loadCheckedKeys() { | ||
| 291 | + if (this.formData.roleId) { | ||
| 292 | + getMenuByRoleId(this.formData.roleId) | ||
| 293 | + .then((res) => { | ||
| 294 | + if (res.code === "200") { | ||
| 295 | + this.checkedKeys = res.data.filter(item => item.isBinding && (item.parentMenuId!=0 ) ).map(item => item.menuId); | ||
| 296 | + //console.log('初始 checkedKeys:', this.checkedKeys); | ||
| 297 | + this.$nextTick(() => { | ||
| 298 | + this.$refs.tree.setCheckedKeys(this.checkedKeys); | ||
| 299 | + this.updateTreeCheckData(); | ||
| 300 | + }); | ||
| 301 | + } else { | ||
| 302 | + this.alertWarningMsg(res.message); | ||
| 303 | + } | ||
| 304 | + }) | ||
| 305 | + .catch((err) => { | ||
| 306 | + console.log(err); | ||
| 307 | + }); | ||
| 308 | + } | ||
| 309 | + }, | ||
| 310 | + //加载选中的节点及半选中的父节点 | ||
| 311 | + updateTreeCheckData() { | ||
| 312 | + const checkedKeys = this.$refs.tree.getCheckedKeys(); | ||
| 313 | + const halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys(); | ||
| 314 | + this.treeCheckData = checkedKeys.concat(halfCheckedKeys); | ||
| 315 | + //console.log('合并后的 treeCheckData:', this.treeCheckData); | ||
| 316 | + }, | ||
| 317 | + | ||
| 318 | + }, | ||
| 319 | +}; | ||
| 320 | +</script> | ||
| 321 | + | ||
| 322 | +<style lang="scss" scoped> | ||
| 323 | +@import "@/assets/styles/variables.scss"; | ||
| 324 | + | ||
| 325 | +.menuTree { | ||
| 326 | + max-width: 350px; | ||
| 327 | + max-height: 300px; | ||
| 328 | + overflow: auto; | ||
| 329 | + margin: 0 auto; | ||
| 330 | + border: 1px solid #999; | ||
| 331 | + padding: 10px; | ||
| 332 | +} | ||
| 333 | +</style> |
src/views/log-list/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="entrySreach"> | ||
| 3 | + <el-form | ||
| 4 | + class="fedexFormStyle fedexformSreach fedexformSreachBottomBorder" | ||
| 5 | + ref="sreachForm" | ||
| 6 | + :model="sreachFormData" | ||
| 7 | + label-position="top" | ||
| 8 | + size="small" | ||
| 9 | + > | ||
| 10 | + <el-row class="row-border"> | ||
| 11 | + <!-- 角色名称 --> | ||
| 12 | + <el-col :span="5"> | ||
| 13 | + <Formitem label="角色名称" prop="roleName"> | ||
| 14 | + <el-input | ||
| 15 | + type="text" | ||
| 16 | + class="inputShadow" | ||
| 17 | + id="inputInner--roleName" | ||
| 18 | + resize="none" | ||
| 19 | + v-model="sreachFormData.roleName" | ||
| 20 | + clearable | ||
| 21 | + placeholder="" | ||
| 22 | + ></el-input> | ||
| 23 | + </Formitem> | ||
| 24 | + </el-col> | ||
| 25 | + <el-col :span="2"> | ||
| 26 | + <el-form-item class="textCenter"> | ||
| 27 | + <el-button | ||
| 28 | + class="entrySreachButton" | ||
| 29 | + type="text" | ||
| 30 | + icon="el-icon-search" | ||
| 31 | + :loading="loadings.searchLoading" | ||
| 32 | + @click="search(0)" | ||
| 33 | + ></el-button> | ||
| 34 | + </el-form-item> | ||
| 35 | + </el-col> | ||
| 36 | + </el-row> | ||
| 37 | + </el-form> | ||
| 38 | + <div class="optionButton"> | ||
| 39 | + <el-button | ||
| 40 | + class="entrySaveButton" | ||
| 41 | + icon="el-icon-plus" | ||
| 42 | + size="small" | ||
| 43 | + @click="addRole" | ||
| 44 | + > | ||
| 45 | + 新增角色 | ||
| 46 | + </el-button> | ||
| 47 | + </div> | ||
| 48 | + <Table | ||
| 49 | + class="fedexDetialTable fedexSreachTable" | ||
| 50 | + ref="entryTable" | ||
| 51 | + :data="tableData" | ||
| 52 | + :headerData="headerData" | ||
| 53 | + :maxHeight="tableMaxheight" | ||
| 54 | + :border="true" | ||
| 55 | + :pagination="true" | ||
| 56 | + :order="false" | ||
| 57 | + :loading="loadings.searchLoading" | ||
| 58 | + :page="page.pageIndex" | ||
| 59 | + :pageSizes="[20, 30, 50, 100]" | ||
| 60 | + :totalCount="page.total" | ||
| 61 | + @sizeChange="sizeChange" | ||
| 62 | + @currentChange="currentChange" | ||
| 63 | + :selection="false" | ||
| 64 | + :selectFixed="false" | ||
| 65 | + :rowSelectDataType="false" | ||
| 66 | + > | ||
| 67 | + <template slot="optionColumn"> | ||
| 68 | + <el-table-column align="left" label="操作"> | ||
| 69 | + <template slot-scope="scope"> | ||
| 70 | + <el-button type="text" @click="update(scope.row)"> | ||
| 71 | + 角色修改 | ||
| 72 | + </el-button> | ||
| 73 | + <el-button type="text" @click="muenChange(scope.row)"> | ||
| 74 | + 权限绑定 | ||
| 75 | + </el-button> | ||
| 76 | + </template> | ||
| 77 | + </el-table-column> | ||
| 78 | + </template> | ||
| 79 | + </Table> | ||
| 80 | + <DialogVue | ||
| 81 | + :outerVisible="outerVisible" | ||
| 82 | + :title="dialogTitle" | ||
| 83 | + :type="editType" | ||
| 84 | + :active="activeData" | ||
| 85 | + @close="dialogClose" | ||
| 86 | + /> | ||
| 87 | + </div> | ||
| 88 | +</template> | ||
| 89 | + | ||
| 90 | +<script> | ||
| 91 | +import { getRoleList } from "@/api/system/user.js"; | ||
| 92 | +import DialogVue from "./dialog.vue"; | ||
| 93 | +import { addMenu } from "@/api/menu"; | ||
| 94 | +export default { | ||
| 95 | + name: "LogList", | ||
| 96 | + components: { | ||
| 97 | + DialogVue, | ||
| 98 | + }, | ||
| 99 | + data() { | ||
| 100 | + return { | ||
| 101 | + sreachFormData: { | ||
| 102 | + roleName: "", | ||
| 103 | + }, | ||
| 104 | + page: { | ||
| 105 | + pageIndex: 1, | ||
| 106 | + pageSize: 20, | ||
| 107 | + total: 0, | ||
| 108 | + }, | ||
| 109 | + activeData: null, | ||
| 110 | + tableData: [], | ||
| 111 | + headerData: [ | ||
| 112 | + { | ||
| 113 | + name: "角色名", | ||
| 114 | + value: "roleName", | ||
| 115 | + width: "", | ||
| 116 | + align: "left", | ||
| 117 | + }, | ||
| 118 | + ], | ||
| 119 | + loadings: { | ||
| 120 | + searchLoading: false, | ||
| 121 | + }, | ||
| 122 | + tableMaxheight: null, | ||
| 123 | + outerVisible: false, | ||
| 124 | + dialogTitle: "", | ||
| 125 | + editType: "", | ||
| 126 | + }; | ||
| 127 | + }, | ||
| 128 | + created() { | ||
| 129 | + this.search(0); | ||
| 130 | + }, | ||
| 131 | + mounted() { | ||
| 132 | + this.tableMaxheight = window.innerHeight - 300; | ||
| 133 | + }, | ||
| 134 | + methods: { | ||
| 135 | + //查询 | ||
| 136 | + search(val) { | ||
| 137 | + this.loadings.searchLoading = true; | ||
| 138 | + if (val == 0) { | ||
| 139 | + this.page.pageIndex = 1; | ||
| 140 | + } | ||
| 141 | + let obj = this.sreachFormData; | ||
| 142 | + obj.pageIndex = this.page.pageIndex; | ||
| 143 | + obj.pageSize = this.page.pageSize; | ||
| 144 | + getRoleList(obj) | ||
| 145 | + .then((res) => { | ||
| 146 | + if (res.code === "200") { | ||
| 147 | + this.tableData = res.data.value; | ||
| 148 | + this.page.total = res.data.totalItems; | ||
| 149 | + this.tableData.forEach((item, idx) => { | ||
| 150 | + item.index = idx; | ||
| 151 | + }); | ||
| 152 | + } else { | ||
| 153 | + this.alertWarningMsg(res.message); | ||
| 154 | + } | ||
| 155 | + this.loadings.searchLoading = false; | ||
| 156 | + }) | ||
| 157 | + .catch((err) => { | ||
| 158 | + console.log(err); | ||
| 159 | + this.loadings.searchLoading = false; | ||
| 160 | + }); | ||
| 161 | + }, | ||
| 162 | + addRole() { | ||
| 163 | + this.dialogTitle = "新增角色"; | ||
| 164 | + this.editType = "add"; | ||
| 165 | + this.outerVisible = true; | ||
| 166 | + }, | ||
| 167 | + // 新增菜单用,可以不麻烦后端--------- | ||
| 168 | + addMenuFn() { | ||
| 169 | + let params = { | ||
| 170 | + icon: "", | ||
| 171 | + menuName: "运抵单查询", | ||
| 172 | + order: 4.4, | ||
| 173 | + parentMenuId: 90, | ||
| 174 | + physicalUrl: "/arrival-list", | ||
| 175 | + url: "", | ||
| 176 | + }; | ||
| 177 | + addMenu(params).then((res) => { | ||
| 178 | + console.log(res); | ||
| 179 | + }); | ||
| 180 | + }, | ||
| 181 | + update(val) { | ||
| 182 | + this.dialogTitle = "修改角色"; | ||
| 183 | + this.editType = "update"; | ||
| 184 | + this.outerVisible = true; | ||
| 185 | + this.activeData = val; | ||
| 186 | + }, | ||
| 187 | + muenChange(val) { | ||
| 188 | + this.dialogTitle = "绑定权限"; | ||
| 189 | + this.editType = "menuChange"; | ||
| 190 | + this.outerVisible = true; | ||
| 191 | + this.activeData = val; | ||
| 192 | + }, | ||
| 193 | + dialogClose() { | ||
| 194 | + this.outerVisible = false; | ||
| 195 | + this.activeData = null; | ||
| 196 | + this.search(1); | ||
| 197 | + }, | ||
| 198 | + //分页 | ||
| 199 | + currentChange(val) { | ||
| 200 | + this.page.pageIndex = val.page; | ||
| 201 | + this.search(1); | ||
| 202 | + }, | ||
| 203 | + sizeChange(val) { | ||
| 204 | + this.page.pageSize = val; | ||
| 205 | + this.search(1); | ||
| 206 | + }, | ||
| 207 | + input() { | ||
| 208 | + this.$forceUpdate(); | ||
| 209 | + }, | ||
| 210 | + }, | ||
| 211 | +}; | ||
| 212 | +</script> | ||
| 213 | + | ||
| 214 | +<style scoped lang="scss"> | ||
| 215 | +@import "@/assets/styles/variables.scss"; | ||
| 216 | +.entrySreach { | ||
| 217 | + height: 100%; | ||
| 218 | + background-color: $menuLightBg; | ||
| 219 | + | ||
| 220 | + .entrySreachButton { | ||
| 221 | + display: inline-block; | ||
| 222 | + font-size: 20px; | ||
| 223 | + color: $fedexButton !important; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + .optionButton { | ||
| 227 | + padding: 10px; | ||
| 228 | + text-align: left; | ||
| 229 | + | ||
| 230 | + .el-button { | ||
| 231 | + color: $fedexButton; | ||
| 232 | + border-color: $fedexButton !important; | ||
| 233 | + | ||
| 234 | + svg { | ||
| 235 | + display: inline-block; | ||
| 236 | + margin-right: 5px; | ||
| 237 | + fill: $fedexButton; | ||
| 238 | + } | ||
| 239 | + } | ||
| 240 | + | ||
| 241 | + .entrySaveButton:hover, | ||
| 242 | + .entrySaveButton:focus { | ||
| 243 | + color: $menuLightBg !important; | ||
| 244 | + background-color: $fedexButton !important; | ||
| 245 | + } | ||
| 246 | + } | ||
| 247 | +} | ||
| 248 | + | ||
| 249 | +.texttareaTip { | ||
| 250 | + position: absolute; | ||
| 251 | + top: 52%; | ||
| 252 | + right: 20px; | ||
| 253 | + transform: translate(0, -50%); | ||
| 254 | + z-index: 10; | ||
| 255 | +} | ||
| 256 | +</style> |
| ... | @@ -164,7 +164,6 @@ export default { | ... | @@ -164,7 +164,6 @@ export default { |
| 164 | // this.dialogTitle = "新增菜单"; | 164 | // this.dialogTitle = "新增菜单"; |
| 165 | // this.editType = "add"; | 165 | // this.editType = "add"; |
| 166 | // this.outerVisible = true; | 166 | // this.outerVisible = true; |
| 167 | - | ||
| 168 | // let params = { | 167 | // let params = { |
| 169 | // icon: "", | 168 | // icon: "", |
| 170 | // menuName: "监管场所管理", | 169 | // menuName: "监管场所管理", |
| ... | @@ -173,11 +172,11 @@ export default { | ... | @@ -173,11 +172,11 @@ export default { |
| 173 | // physicalUrl: "/supervise-place-manage", | 172 | // physicalUrl: "/supervise-place-manage", |
| 174 | // url: "", | 173 | // url: "", |
| 175 | // }; | 174 | // }; |
| 176 | - deleteMenu({ | 175 | + // deleteMenu({ |
| 177 | - menuId: 1, | 176 | + // menuId: 1, |
| 178 | - }).then((res) => { | 177 | + // }).then((res) => { |
| 179 | - console.log(res); | 178 | + // console.log(res); |
| 180 | - }); | 179 | + // }); |
| 181 | // addMenu(params).then((res) => { | 180 | // addMenu(params).then((res) => { |
| 182 | // console.log(res); | 181 | // console.log(res); |
| 183 | // }); | 182 | // }); | ... | ... |
| ... | @@ -90,6 +90,7 @@ | ... | @@ -90,6 +90,7 @@ |
| 90 | <script> | 90 | <script> |
| 91 | import { getRoleList } from "@/api/system/user.js"; | 91 | import { getRoleList } from "@/api/system/user.js"; |
| 92 | import DialogVue from "./dialog.vue"; | 92 | import DialogVue from "./dialog.vue"; |
| 93 | +import { addMenu } from "@/api/menu"; | ||
| 93 | export default { | 94 | export default { |
| 94 | name: "RoleConfig", | 95 | name: "RoleConfig", |
| 95 | components: { | 96 | components: { |
| ... | @@ -162,6 +163,21 @@ export default { | ... | @@ -162,6 +163,21 @@ export default { |
| 162 | this.dialogTitle = "新增角色"; | 163 | this.dialogTitle = "新增角色"; |
| 163 | this.editType = "add"; | 164 | this.editType = "add"; |
| 164 | this.outerVisible = true; | 165 | this.outerVisible = true; |
| 166 | + // this.addMenuFn(); | ||
| 167 | + }, | ||
| 168 | + // 新增菜单用,可以不麻烦后端--------- | ||
| 169 | + addMenuFn() { | ||
| 170 | + let params = { | ||
| 171 | + icon: "", | ||
| 172 | + menuName: "运抵单查询", | ||
| 173 | + order: 2.4, | ||
| 174 | + parentMenuId: 98, | ||
| 175 | + physicalUrl: "/arrival-list", | ||
| 176 | + url: "", | ||
| 177 | + }; | ||
| 178 | + addMenu(params).then((res) => { | ||
| 179 | + console.log(res); | ||
| 180 | + }); | ||
| 165 | }, | 181 | }, |
| 166 | update(val) { | 182 | update(val) { |
| 167 | this.dialogTitle = "修改角色"; | 183 | this.dialogTitle = "修改角色"; | ... | ... |
-
Please register or login to post a comment