Commit c33c12431e3b67f3b240def8abe612795d0cb5ae
1 parent
d1837e7a
拉取王哥最新的
Showing
8 changed files
with
212 additions
and
65 deletions
src/api/paperLevel.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | +export default { | |
| 3 | + deletepaperLevel(id) { | |
| 4 | + return request({ | |
| 5 | + url: `/paperLevel/Delete?ids=${id}`, | |
| 6 | + method: 'post' | |
| 7 | + }); | |
| 8 | + }, | |
| 9 | +} | |
| 10 | + | |
| 11 | +export function getpaperLevel(params) { | |
| 12 | + return request({ | |
| 13 | + url: `/paperLevel/Get`, | |
| 14 | + method: 'get', | |
| 15 | + params | |
| 16 | + }) | |
| 17 | +} | |
| 18 | + | |
| 19 | +export function GetpaperLevelList(params) { | |
| 20 | + return request({ | |
| 21 | + url: `/paperLevel/List`, | |
| 22 | + method: 'get', | |
| 23 | + params | |
| 24 | + }) | |
| 25 | +} | |
| 26 | +// 修改 | 保存 | |
| 27 | +export function Save(params) { | |
| 28 | + return request({ | |
| 29 | + url: `/paperLevel/Update`, | |
| 30 | + method: 'post', | |
| 31 | + data: params | |
| 32 | + }) | |
| 33 | +} | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/layout/components/Sidebar/index.vue
| ... | ... | @@ -34,7 +34,8 @@ export default { |
| 34 | 34 | }, |
| 35 | 35 | computed: { |
| 36 | 36 | ...mapGetters([ |
| 37 | - 'sidebar' | |
| 37 | + 'sidebar', | |
| 38 | + 'permissions' | |
| 38 | 39 | ]), |
| 39 | 40 | // routes() { |
| 40 | 41 | // return this.$router.options.routes |
| ... | ... | @@ -59,10 +60,10 @@ export default { |
| 59 | 60 | return !this.sidebar.opened |
| 60 | 61 | } |
| 61 | 62 | }, |
| 62 | - created() { | |
| 63 | - this.routes = getRoutes(); | |
| 63 | + created() { | |
| 64 | + this.routes = getRoutes(this.permissions); | |
| 64 | 65 | this.$bus.$on('relogin',()=>{ |
| 65 | - this.routes = getRoutes(); | |
| 66 | + this.routes = getRoutes(this.permissions); | |
| 66 | 67 | }) |
| 67 | 68 | }, |
| 68 | 69 | } | ... | ... |
src/store/modules/user.js
| ... | ... | @@ -16,7 +16,8 @@ const getDefaultState = () => { |
| 16 | 16 | return { |
| 17 | 17 | token: getToken(), |
| 18 | 18 | name: '', |
| 19 | - avatar: '' | |
| 19 | + avatar: '', | |
| 20 | + permissions: [] | |
| 20 | 21 | } |
| 21 | 22 | } |
| 22 | 23 | |
| ... | ... | @@ -40,6 +41,9 @@ const mutations = { |
| 40 | 41 | state.userInfo = val |
| 41 | 42 | localStorage.userinfo = JSON.stringify(val) |
| 42 | 43 | }, |
| 44 | + setPermissions(state, permissions) { | |
| 45 | + state.permissions = permissions; | |
| 46 | + }, | |
| 43 | 47 | } |
| 44 | 48 | |
| 45 | 49 | const actions = { |
| ... | ... | @@ -60,7 +64,7 @@ const actions = { |
| 60 | 64 | data |
| 61 | 65 | } = response |
| 62 | 66 | commit('SET_TOKEN', data.token) |
| 63 | - commit('SET_USERINFO', data.data) | |
| 67 | + // commit('SET_USERINFO', data.data) | |
| 64 | 68 | setToken(data.token) |
| 65 | 69 | resolve() |
| 66 | 70 | }).catch(error => { |
| ... | ... | @@ -77,7 +81,7 @@ const actions = { |
| 77 | 81 | return new Promise((resolve, reject) => { |
| 78 | 82 | getInfo().then(response => { |
| 79 | 83 | const { |
| 80 | - data | |
| 84 | + data,permissions | |
| 81 | 85 | } = response.data |
| 82 | 86 | if (!data) { |
| 83 | 87 | return reject('Verification failed, please Login again.') |
| ... | ... | @@ -88,6 +92,8 @@ const actions = { |
| 88 | 92 | } = data |
| 89 | 93 | commit('SET_NAME', DisplayName) |
| 90 | 94 | commit('SET_AVATAR', avatar) |
| 95 | + // commit("setPermissions", permissions); | |
| 96 | + commit('SET_USERINFO', data) | |
| 91 | 97 | resolve(data) |
| 92 | 98 | }).catch(error => { |
| 93 | 99 | reject(error) | ... | ... |
src/utils/routerList.js
| ... | ... | @@ -2,15 +2,19 @@ import Layout from '@/layout' |
| 2 | 2 | import { getInfo } from '../store/modules/user.js' |
| 3 | 3 | |
| 4 | 4 | |
| 5 | -export function getRoutes() { | |
| 6 | - | |
| 5 | +export function getRoutes(permissions) { | |
| 7 | 6 | let userInfo = {} |
| 8 | 7 | if (localStorage.userinfo) { |
| 9 | 8 | userInfo = JSON.parse(localStorage.userinfo) |
| 10 | 9 | } |
| 10 | + var permissions = userInfo.permissions || []; | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 11 | 15 | console.log(userInfo) |
| 12 | 16 | let constantRoutes1 = [] |
| 13 | - if (userInfo.UserId == 1) { | |
| 17 | + if (userInfo.UserId == 1 || 1 == 1) { | |
| 14 | 18 | constantRoutes1 = [{ |
| 15 | 19 | path: '/login', |
| 16 | 20 | component: () => |
| ... | ... | @@ -67,7 +71,8 @@ export function getRoutes() { |
| 67 | 71 | name: 'Example', |
| 68 | 72 | meta: { |
| 69 | 73 | title: '题库管理', |
| 70 | - icon: 'el-icon-s-help' | |
| 74 | + icon: 'el-icon-s-help', | |
| 75 | + permissions: ['admin'] | |
| 71 | 76 | }, |
| 72 | 77 | children: [{ |
| 73 | 78 | path: 'QuestionBank', |
| ... | ... | @@ -76,7 +81,8 @@ export function getRoutes() { |
| 76 | 81 | import('@/views/QuestionBank/index'), |
| 77 | 82 | meta: { |
| 78 | 83 | title: '题库', |
| 79 | - icon: 'table' | |
| 84 | + icon: 'table', | |
| 85 | + permissions: ['admin'] | |
| 80 | 86 | } |
| 81 | 87 | },] |
| 82 | 88 | }, |
| ... | ... | @@ -199,7 +205,7 @@ export function getRoutes() { |
| 199 | 205 | name: 'user', |
| 200 | 206 | meta: { |
| 201 | 207 | title: '用户管理', |
| 202 | - icon: 'el-icon-s-help' | |
| 208 | + icon: 'el-icon-s-help' | |
| 203 | 209 | }, |
| 204 | 210 | children: [{ |
| 205 | 211 | path: 'user', |
| ... | ... | @@ -230,18 +236,14 @@ export function getRoutes() { |
| 230 | 236 | title: '图片导入用户', |
| 231 | 237 | } |
| 232 | 238 | }, |
| 233 | - | |
| 234 | - | |
| 235 | - | |
| 236 | - | |
| 237 | 239 | { |
| 238 | 240 | path: 'admin', |
| 239 | 241 | name: 'admin', |
| 240 | - | |
| 241 | 242 | component: () => |
| 242 | 243 | import('@/views/user/adminList'), |
| 243 | 244 | meta: { |
| 244 | 245 | title: '管理员列表', |
| 246 | + permissions: ['admin'] | |
| 245 | 247 | } |
| 246 | 248 | }, |
| 247 | 249 | |
| ... | ... | @@ -259,46 +261,50 @@ export function getRoutes() { |
| 259 | 261 | { |
| 260 | 262 | path: 'userdimset', |
| 261 | 263 | name: 'impouserdimsetrtuser', |
| 262 | - | |
| 264 | + | |
| 263 | 265 | component: () => |
| 264 | 266 | import('@/views/user/userdimset'), |
| 265 | 267 | meta: { |
| 266 | 268 | title: '维度规则设置', |
| 269 | + permissions:['admin' ] | |
| 267 | 270 | } |
| 268 | 271 | }, |
| 269 | 272 | { |
| 270 | - path: 'index', | |
| 271 | - name: 'index', | |
| 272 | - component: () => | |
| 273 | - import('@/views/password/index'), | |
| 274 | - meta: { | |
| 275 | - title: '忘记密码', | |
| 276 | - } | |
| 277 | - }, { | |
| 278 | - path: 'TestPaperClass', | |
| 279 | - name: 'Table', | |
| 280 | - component: () => | |
| 281 | - import('@/views/TestPaper/TestPaperClass'), | |
| 282 | - meta: { | |
| 283 | - title: '分类管理', | |
| 284 | - } | |
| 285 | - }, { | |
| 286 | - path: 'carousel', | |
| 287 | - name: 'carousel', | |
| 288 | - component: () => | |
| 289 | - import('@/views/carousel/index'), | |
| 290 | - meta: { | |
| 291 | - title: '轮播图', | |
| 292 | - } | |
| 293 | - }, { | |
| 294 | - path: 'new', | |
| 295 | - name: 'new', | |
| 296 | - component: () => | |
| 297 | - import('@/views/carousel/new'), | |
| 298 | - meta: { | |
| 299 | - title: '最新资讯', | |
| 300 | - } | |
| 301 | - }] | |
| 273 | + path: 'index', | |
| 274 | + name: 'index', | |
| 275 | + component: () => | |
| 276 | + import('@/views/password/index'), | |
| 277 | + meta: { | |
| 278 | + title: '忘记密码', | |
| 279 | + } | |
| 280 | + }, { | |
| 281 | + path: 'TestPaperClass', | |
| 282 | + name: 'Table', | |
| 283 | + component: () => | |
| 284 | + import('@/views/TestPaper/TestPaperClass'), | |
| 285 | + meta: { | |
| 286 | + title: '分类管理', | |
| 287 | + permissions:['admin' ] | |
| 288 | + } | |
| 289 | + }, { | |
| 290 | + path: 'carousel', | |
| 291 | + name: 'carousel', | |
| 292 | + component: () => | |
| 293 | + import('@/views/carousel/index'), | |
| 294 | + meta: { | |
| 295 | + title: '轮播图', | |
| 296 | + permissions:['admin' ] | |
| 297 | + } | |
| 298 | + }, { | |
| 299 | + path: 'new', | |
| 300 | + name: 'new', | |
| 301 | + component: () => | |
| 302 | + import('@/views/carousel/new'), | |
| 303 | + meta: { | |
| 304 | + title: '最新资讯', | |
| 305 | + permissions:['admin'] | |
| 306 | + } | |
| 307 | + }] | |
| 302 | 308 | }, |
| 303 | 309 | // 404 page must be placed at the end !!! |
| 304 | 310 | { |
| ... | ... | @@ -308,6 +314,7 @@ export function getRoutes() { |
| 308 | 314 | } |
| 309 | 315 | ] |
| 310 | 316 | } else { |
| 317 | + return ; | |
| 311 | 318 | constantRoutes1 = [{ |
| 312 | 319 | path: '/login', |
| 313 | 320 | component: () => |
| ... | ... | @@ -329,7 +336,8 @@ export function getRoutes() { |
| 329 | 336 | name: 'Example', |
| 330 | 337 | meta: { |
| 331 | 338 | title: '题库管理', |
| 332 | - icon: 'el-icon-s-help' | |
| 339 | + icon: 'el-icon-s-help', | |
| 340 | + permissions: ["admin", "user"], | |
| 333 | 341 | }, |
| 334 | 342 | children: [{ |
| 335 | 343 | path: 'QuestionBank', |
| ... | ... | @@ -481,8 +489,7 @@ export function getRoutes() { |
| 481 | 489 | meta: { |
| 482 | 490 | title: '人才库', |
| 483 | 491 | } |
| 484 | - }, | |
| 485 | - | |
| 492 | + } | |
| 486 | 493 | |
| 487 | 494 | ] |
| 488 | 495 | }, { |
| ... | ... | @@ -492,7 +499,8 @@ export function getRoutes() { |
| 492 | 499 | name: 'password', |
| 493 | 500 | meta: { |
| 494 | 501 | title: '系统管理', |
| 495 | - icon: 'el-icon-s-platform' | |
| 502 | + icon: 'el-icon-s-platform', | |
| 503 | + permissions:['admin','user'] | |
| 496 | 504 | }, |
| 497 | 505 | children: [{ |
| 498 | 506 | path: 'index', |
| ... | ... | @@ -509,6 +517,7 @@ export function getRoutes() { |
| 509 | 517 | import('@/views/TestPaper/TestPaperClass'), |
| 510 | 518 | meta: { |
| 511 | 519 | title: '分类管理', |
| 520 | + permissions: ['admin'] | |
| 512 | 521 | } |
| 513 | 522 | }, { |
| 514 | 523 | path: 'carousel', |
| ... | ... | @@ -517,6 +526,7 @@ export function getRoutes() { |
| 517 | 526 | import('@/views/carousel/index'), |
| 518 | 527 | meta: { |
| 519 | 528 | title: '轮播图', |
| 529 | + permissions: ['admin'] | |
| 520 | 530 | } |
| 521 | 531 | }, { |
| 522 | 532 | path: 'new', |
| ... | ... | @@ -525,6 +535,7 @@ export function getRoutes() { |
| 525 | 535 | import('@/views/carousel/new'), |
| 526 | 536 | meta: { |
| 527 | 537 | title: '最新资讯', |
| 538 | + permissions: ['admin'] | |
| 528 | 539 | } |
| 529 | 540 | }] |
| 530 | 541 | }, |
| ... | ... | @@ -538,5 +549,29 @@ export function getRoutes() { |
| 538 | 549 | } |
| 539 | 550 | |
| 540 | 551 | |
| 552 | + function hasPermission(permissions, route) { | |
| 553 | + if (route.meta && route.meta.permissions) { | |
| 554 | + return permissions.some((role) => route.meta.permissions.includes(role)); | |
| 555 | + } else { | |
| 556 | + return true; | |
| 557 | + } | |
| 558 | + } | |
| 559 | + | |
| 560 | + | |
| 561 | + function filterAsyncRoutes(routes, permissions) { | |
| 562 | + const finallyRoutes = []; | |
| 563 | + routes.forEach((route) => { | |
| 564 | + const item = { ...route }; | |
| 565 | + if (hasPermission(permissions, item)) { | |
| 566 | + if (item.children) { | |
| 567 | + item.children = filterAsyncRoutes(item.children, permissions); | |
| 568 | + } | |
| 569 | + finallyRoutes.push(item); | |
| 570 | + } | |
| 571 | + }); | |
| 572 | + return finallyRoutes; | |
| 573 | + } | |
| 574 | + constantRoutes1 = filterAsyncRoutes(constantRoutes1, permissions); | |
| 575 | + | |
| 541 | 576 | return constantRoutes1; |
| 542 | 577 | } |
| 543 | 578 | \ No newline at end of file | ... | ... |
src/views/TestPaper/ManualTestPaper.vue
| ... | ... | @@ -84,7 +84,12 @@ |
| 84 | 84 | </el-cascader> |
| 85 | 85 | </el-form-item> |
| 86 | 86 | |
| 87 | - | |
| 87 | + <el-form-item label="级别" prop="FLevelCount" class="el-form-item-custom" | |
| 88 | + style="margin-bottom: 20px !important;width:100%;"> | |
| 89 | + <el-select v-model="TestPaper.FLevelCount" placeholder="请选择级别" @change="changelevel" style="width:100%"> | |
| 90 | + <el-option v-for="item in levellist" :label="item.title" :value="item.f_count"></el-option> | |
| 91 | + </el-select> | |
| 92 | + </el-form-item> | |
| 88 | 93 | |
| 89 | 94 | <el-form-item label="有效时间" required> |
| 90 | 95 | <el-form-item prop="date"> |
| ... | ... | @@ -135,10 +140,15 @@ |
| 135 | 140 | <ul class="random-list"> |
| 136 | 141 | <li v-for="(item,index) in randomSubjectList" :key="index"> |
| 137 | 142 | <span>试题分类:</span> |
| 138 | - <el-cascader :multiple="false" style="flex:1" v-model="item.QuestionClassId" :options="randomQuestionTypeList" | |
| 139 | - clearable></el-cascader> | |
| 140 | - <span style="margin-left:10px;">试题数量:</span> | |
| 141 | - <el-input-number v-model="item.Count" :min="1" :max="100" label="描述文字" style="margin-left:10px;"> | |
| 143 | + <el-cascader :multiple="false" style="flex:1" @change="(a)=>{ changetype(a,item)}" v-model="item.QuestionClassId" :options="randomQuestionTypeList" | |
| 144 | + clearable> | |
| 145 | + <template slot-scope="{ node, data }"> | |
| 146 | + <span>{{ data.label }}</span> | |
| 147 | + <span v-if="data.subjectCount"> ({{ data.subjectCount || '0' }}) </span> | |
| 148 | + </template> | |
| 149 | + </el-cascader> | |
| 150 | + <span style="margin-left:10px;">试题数量:{{item.maxcount}}</span> | |
| 151 | + <el-input-number v-model="item.Count" :min="1" :max="item.maxcount" label="描述文字" style="margin-left:10px;"> | |
| 142 | 152 | </el-input-number> |
| 143 | 153 | <i class="el-icon-remove-outline" @click="changeSubjectCount(-1,index)" |
| 144 | 154 | style="margin-left:10px;color:#f56c6c;"></i> |
| ... | ... | @@ -173,6 +183,9 @@ |
| 173 | 183 | <script> |
| 174 | 184 | import draggable from "vuedraggable"; |
| 175 | 185 | import { PostRandomGetQuestion, getQuestionList, getQuestionClassList } from "@/api/QuestionBank"; |
| 186 | + import { GetpaperLevelList } from "@/api/paperLevel"; | |
| 187 | + | |
| 188 | + | |
| 176 | 189 | import { GetQuestionClassByType } from "@/api/QuestionClass"; |
| 177 | 190 | import { EditTestPaper, GetToplevel } from "@/api/TestPaper"; |
| 178 | 191 | import { formatTime } from "@/utils/util"; |
| ... | ... | @@ -238,6 +251,7 @@ |
| 238 | 251 | PresentPrice: "0", |
| 239 | 252 | MembershipPrice: "0", |
| 240 | 253 | QuestionBankIds: [], |
| 254 | + FLevelCount:0 | |
| 241 | 255 | }, |
| 242 | 256 | loading: false, |
| 243 | 257 | rules: { |
| ... | ... | @@ -246,7 +260,7 @@ |
| 246 | 260 | required: true, |
| 247 | 261 | message: "不能为空", |
| 248 | 262 | }, |
| 249 | - ], | |
| 263 | + ], | |
| 250 | 264 | PresentPrice: [ |
| 251 | 265 | { |
| 252 | 266 | required: true, |
| ... | ... | @@ -278,6 +292,8 @@ |
| 278 | 292 | }, |
| 279 | 293 | ], |
| 280 | 294 | timeout: 0, |
| 295 | + typelist:[], | |
| 296 | + levellist:[] //等级 | |
| 281 | 297 | }; |
| 282 | 298 | }, |
| 283 | 299 | watch: { |
| ... | ... | @@ -311,6 +327,11 @@ |
| 311 | 327 | if (res.data) { |
| 312 | 328 | this.usertypelist = res.data || []; |
| 313 | 329 | } |
| 330 | + }); | |
| 331 | + GetpaperLevelList({pageSize:1000,sortOrder:'asc'}).then(res => { | |
| 332 | + if (res.data) { | |
| 333 | + this.levellist = res.data.data || []; | |
| 334 | + } | |
| 314 | 335 | }); |
| 315 | 336 | }, |
| 316 | 337 | mounted() { |
| ... | ... | @@ -319,6 +340,25 @@ |
| 319 | 340 | //this.GetList(); |
| 320 | 341 | }, |
| 321 | 342 | methods: { |
| 343 | + changetype(a,item){ | |
| 344 | + var type = this.typelist.find(o=>o.id == item.QuestionClassId[item.QuestionClassId.length-1]); | |
| 345 | + if(type) { | |
| 346 | + item.maxcount = type.subjectCount || 0; | |
| 347 | + if(item.Count > item.maxcount) item.Count = item.maxcount; | |
| 348 | + } | |
| 349 | + }, | |
| 350 | + | |
| 351 | + changelevel(v){ | |
| 352 | + var type = this.levellist.find(o=>o.f_count == v); | |
| 353 | + if(type) { | |
| 354 | + this.TestPaper.FLevelTitle = type.title || ''; | |
| 355 | + } | |
| 356 | + }, | |
| 357 | + getmaxid(item){ | |
| 358 | + var type = this.randomQuestionTypeList.find(o=>o.id == item.QuestionClassId); | |
| 359 | + if(type) return type.subjectCount || 0; | |
| 360 | + else return 0; | |
| 361 | + }, | |
| 322 | 362 | getSubTree(id, list) { |
| 323 | 363 | let result = []; |
| 324 | 364 | result = list.filter((t) => t.ParentId == id); |
| ... | ... | @@ -339,6 +379,7 @@ |
| 339 | 379 | let _this = this; |
| 340 | 380 | getQuestionClassList().then((res) => { |
| 341 | 381 | let alllist = res.data.data; |
| 382 | + this.typelist = alllist; | |
| 342 | 383 | let list = alllist.filter(t => !t.ParentId); |
| 343 | 384 | list = list.map((t) => { |
| 344 | 385 | t.value = t.id; |
| ... | ... | @@ -437,7 +478,11 @@ |
| 437 | 478 | if (this.arr2.length > 0) { |
| 438 | 479 | EditTestPaper(this.TestPaper).then((res) => { |
| 439 | 480 | if (res.data.code == 200) { |
| 440 | - this.$confirm("组卷成功!", "消息"); | |
| 481 | + this.$notify({ | |
| 482 | + title: '组卷成功!', | |
| 483 | + // message: res.data.message, | |
| 484 | + type: 'success' | |
| 485 | + }); | |
| 441 | 486 | this.$router.push({ |
| 442 | 487 | path: '/views/TestPaperList', |
| 443 | 488 | query: { |
| ... | ... | @@ -550,7 +595,7 @@ |
| 550 | 595 | getQuestionList({ |
| 551 | 596 | QuestionClassId: d.id, |
| 552 | 597 | PageIndex: 1, |
| 553 | - PageSize: 1000, | |
| 598 | + PageSize: this.TestPaper.FLevelCount || 1000, | |
| 554 | 599 | }).then((res) => { |
| 555 | 600 | var data = res.data.data.rows || []; |
| 556 | 601 | data = data.filter(o => !this.arr2.find(d => d.id == o.id)); | ... | ... |
src/views/TestPaper/TestPaperList.vue
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | <span>{{ scope.row.id }}</span> |
| 12 | 12 | </template> |
| 13 | 13 | </el-table-column> |
| 14 | - <el-table-column prop="date" label="试卷标题" width="250"> | |
| 14 | + <el-table-column prop="date" label="试卷标题" width="300"> | |
| 15 | 15 | <template slot-scope="scope"> |
| 16 | 16 | <span>{{ scope.row.TestPaperTitle }}</span> |
| 17 | 17 | </template> |
| ... | ... | @@ -52,6 +52,12 @@ |
| 52 | 52 | <span>{{ scope.row.TestPaperClassId | typeFilters}}</span> |
| 53 | 53 | </template> |
| 54 | 54 | </el-table-column> |
| 55 | + | |
| 56 | + <el-table-column prop="FLevelTitle" label="等级" width="100"> | |
| 57 | + <template slot-scope="scope"> | |
| 58 | + <span>{{ scope.row.FLevelTitle }}</span> | |
| 59 | + </template> | |
| 60 | + </el-table-column> | |
| 55 | 61 | <!-- <el-table-column prop="name" label="原价" width="80" v-show="false"> |
| 56 | 62 | <template slot-scope="scope"> |
| 57 | 63 | <span>{{ scope.row.OriginalPrice/100 }}</span> | ... | ... |
src/views/user/adminList.vue
| ... | ... | @@ -22,6 +22,14 @@ |
| 22 | 22 | </el-table-column> |
| 23 | 23 | <el-table-column prop="username" label="登录账号"> |
| 24 | 24 | </el-table-column> |
| 25 | + | |
| 26 | + <el-table-column prop="type" label="类型"> | |
| 27 | + <template slot-scope="scope"> | |
| 28 | + <span>{{ scope.row.type == 0?'超级管理员':'一般管理员' }}</span> | |
| 29 | + </template> | |
| 30 | + </el-table-column> | |
| 31 | + | |
| 32 | + | |
| 25 | 33 | <el-table-column fixed="right" label="操作" width="150"> |
| 26 | 34 | <template slot-scope="scope"> |
| 27 | 35 | <el-dropdown @command="(e)=>{handleCommand(e,scope.row)}"> |
| ... | ... | @@ -55,6 +63,13 @@ |
| 55 | 63 | <el-form-item label="登录账号" style="margin-top: 40px;" prop="username"> |
| 56 | 64 | <el-input v-model="adminUserInfo.username" placeholder="请输入登录账号" style="width: 40%;"></el-input> |
| 57 | 65 | </el-form-item> |
| 66 | + <el-form-item label="类型" style="margin-top: 40px;" prop="type"> | |
| 67 | + <el-radio-group v-model="adminUserInfo.type"> | |
| 68 | + <el-radio :label="0">超级管理员</el-radio> | |
| 69 | + <el-radio :label="5">一般管理员</el-radio> | |
| 70 | + </el-radio-group> | |
| 71 | + </el-form-item> | |
| 72 | + | |
| 58 | 73 | <el-form-item label="密码" prop="password" v-if="title=='添加管理员'"> |
| 59 | 74 | <el-input v-model="adminUserInfo.password " placeholder="请输入密码" show-password style="width: 40%;"></el-input> |
| 60 | 75 | </el-form-item> |
| ... | ... | @@ -208,6 +223,11 @@ |
| 208 | 223 | required: true, |
| 209 | 224 | message: '请输入密码', |
| 210 | 225 | trigger: 'blur' |
| 226 | + }], | |
| 227 | + type: [{ | |
| 228 | + required: true, | |
| 229 | + message: '请输选择用户类型', | |
| 230 | + trigger: 'blur' | |
| 211 | 231 | }] |
| 212 | 232 | } |
| 213 | 233 | } | ... | ... |
vue.config.js
| ... | ... | @@ -39,7 +39,8 @@ module.exports = { |
| 39 | 39 | proxy: { |
| 40 | 40 | '/development': { |
| 41 | 41 | // target: `http://inteview.t1j2.com/`, //后台服务地址 |
| 42 | - target:'http://localhost:8009', | |
| 42 | + target:'http://localhost:8877', | |
| 43 | + // target:'http://localhost:8009', | |
| 43 | 44 | changeOrigin: true, |
| 44 | 45 | pathRewrite: { |
| 45 | 46 | '^/development': '' | ... | ... |