Commit 63deedae0dfc58ee6126449e91cbb703657842a0

Authored by yangzhi
2 parents 6239b676 b32564ca

Merge branch 'develop_interview' of 39.98.150.180:antissoft/antissoft.dati.admin…

… into develop_interview
src/api/log.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +
  4 +
  5 +//用户列表
  6 +export function GetList(params) {
  7 + return request({
  8 + url: `/SystemLogs/List`,
  9 + method: 'get',
  10 + params
  11 + })
  12 +}
  13 +
  14 +
  15 +
  16 +export function ChangeClass(id,type) {
  17 + return request({
  18 + url: `/Users/ChangeClass?id=${id}&type=${type}`,
  19 + method: 'post',
  20 + })
  21 +}
0 22 \ No newline at end of file
... ...
src/api/role.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +export function GetInfo(id) {
  4 + return request({
  5 + url: `/role/Get?id=${id}`,
  6 + method: 'get',
  7 + })
  8 +}
  9 +
  10 +
  11 +export function GetUserList(param) {
  12 + return request({
  13 + url: `/role/List`,
  14 + method: 'get',
  15 + param
  16 + })
  17 +}
  18 +export function UsersCreate(data) {
  19 + return request({
  20 + url: `/role/Create`,
  21 + method: 'post',
  22 + data
  23 + })
  24 +}
  25 +
  26 +export function UsersUpdate(data) {
  27 + return request({
  28 + url: `/role/Update`,
  29 + method: 'post',
  30 + data
  31 + })
  32 +}
  33 +
  34 +export function UsersDelete(data) {
  35 + return request({
  36 + url: `/role/Delete`,
  37 + method: 'post',
  38 + params: data
  39 + })
  40 +}
  41 +
  42 +
  43 +//权限菜单列表
  44 +export async function GetMenueRole() {
  45 + return request({
  46 + url: `/role/GetMenueRole`,
  47 + method: 'get'
  48 + })
  49 +}
  50 +
  51 + //权限菜单列表
  52 +export function GetMenue() {
  53 + return request({
  54 + url: `/role/GetMenue`,
  55 + method: 'get'
  56 + })
  57 +}
  58 +
  59 +
0 60 \ No newline at end of file
... ...
src/api/setting.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +export function GetInfo(id) {
  4 + return request({
  5 + url: `/Setting/Get?id=${id}`,
  6 + method: 'get',
  7 + })
  8 +}
  9 +
  10 +export function Create(data) {
  11 + return request({
  12 + url: `/Setting/Create`,
  13 + method: 'post',
  14 + data
  15 + })
  16 +}
  17 +
  18 +export function Update(data) {
  19 + return request({
  20 + url: `/Setting/Update`,
  21 + method: 'post',
  22 + data
  23 + })
  24 +}
  25 +
  26 +export function Delete(data) {
  27 + return request({
  28 + url: `/Setting/Delete`,
  29 + method: 'post',
  30 + params: data
  31 + })
  32 +}
  33 +
  34 +
0 35 \ No newline at end of file
... ...
src/api/user.js
... ... @@ -87,6 +87,15 @@ export function GetUserListByAdmin(data) {
87 87 data
88 88 })
89 89 }
  90 +
  91 +
  92 +export function GetUserListByAdminSimple(data) {
  93 + return request({
  94 + url: `/Users/GetUserListByAdminSimple`,
  95 + method: 'post',
  96 + data
  97 + })
  98 +}
90 99 //修改管理员密码
91 100 export function UpdateCurrentPasswordById(data) {
92 101 return request({
... ... @@ -211,3 +220,9 @@ export function saveTypeSetting(data) {
211 220 }
212 221  
213 222  
  223 +export function ChangeClass(id,type) {
  224 + return request({
  225 + url: `/Users/ChangeClass?id=${id}&type=${type}`,
  226 + method: 'post',
  227 + })
  228 +}
214 229 \ No newline at end of file
... ...
src/permission.js
... ... @@ -19,7 +19,6 @@ router.beforeEach(async(to, from, next) => {
19 19  
20 20 // determine whether the user has logged in
21 21 const hasToken = getToken()
22   -
23 22 if (hasToken) {
24 23 if (to.path === '/login') {
25 24 // if is logged in, redirect to the home page
... ...
src/router/index.js
... ... @@ -30,9 +30,9 @@ import { getRoutes } from "@/utils/routerList.js"
30 30 * constantRoutes
31 31 * a base page that does not have permission requirements
32 32 * all roles can be accessed
33   - */
34   -export const constantRoutes = getRoutes();
35   -
  33 + */
  34 +export const constantRoutes = getRoutes();
  35 +
36 36 const createRouter = () => new Router({
37 37 // mode: 'history', // require service support
38 38 scrollBehavior: () => ({
... ...
src/utils/request.js
... ... @@ -19,13 +19,16 @@ const service = axios.create({
19 19 service.interceptors.request.use(
20 20 config => {
21 21 // do something before request is sent
22   -
23   - if (store.getters.token) {
  22 +
  23 + if (store && store.getters && store.getters.token) {
24 24 // let each request carry token
25 25 // ['X-Token'] is a custom headers key
26 26 // please modify it according to the actual situation
27 27 config.headers['Authorization'] = getToken()
28 28 }
  29 + else if(localStorage.token){
  30 + config.headers['Authorization'] = localStorage.token
  31 + }
29 32 return config
30 33 },
31 34 error => {
... ...
src/utils/routerList.js
1 1 import Layout from '@/layout'
2 2 import { getInfo } from '../store/modules/user.js'
3   -
  3 +import { GetMenueRole } from '@/api/role'
4 4  
5 5 export function getRoutes(permissions) {
6 6 let userInfo = {}
... ... @@ -9,569 +9,853 @@ export function getRoutes(permissions) {
9 9 }
10 10 var permissions = userInfo.permissions || [];
11 11  
  12 + // var roles = await GetMenueRole();
  13 + // roles = roles.data.map(o=>o.code);
12 14  
13   -
14   -
15   - console.log(userInfo)
16 15 let constantRoutes1 = []
17 16 if (userInfo.UserId == 1 || 1 == 1) {
18 17 constantRoutes1 = [{
19   - path: '/login',
20   - component: () =>
21   - import ('@/views/login/index'),
22   - hidden: true
23   - },
24   -
25   - {
26   - path: '/404',
27   - component: () =>
28   - import ('@/views/404'),
29   - hidden: true
30   - },
31   -
32   - {
33   - path: '/answerDetail',
34   - name: '答题详情',
35   - component: () =>
36   - import ('@/views/AnswerResult/detail.vue'),
37   - hidden: true
38   - },
39   -
40   -
41   - {
42   - path: '/',
43   - component: Layout,
44   - redirect: '/dashboard',
45   - children: [{
46   - path: 'dashboard',
47   - name: '首页',
  18 + path: '/login',
48 19 component: () =>
49   - import ('@/views/dashboard/index'),
50   - meta: {
51   - title: '首页',
52   - icon: 'dashboard'
53   - }
54   - }, {
55   - path: 'live',
56   - name: '直播观看',
57   - component: () =>
58   - import ('@/views/live/index'),
59   - meta: {
60   - title: '直播',
61   - icon: 'video'
62   - },
  20 + import ('@/views/login/index'),
63 21 hidden: true
64   - }]
65   - },
66   -
67   - {
68   - path: '/example',
69   - component: Layout,
70   - redirect: '/example/table',
71   - name: 'Example',
72   - meta: {
73   - title: '题库管理',
74   - icon: 'el-icon-s-help',
75   - permissions: ['admin']
76 22 },
77   - children: [{
78   - path: 'QuestionBank',
79   - name: 'Table',
  23 +
  24 + {
  25 + path: '/404',
80 26 component: () =>
81   - import ('@/views/QuestionBank/index'),
82   - meta: {
83   - title: '题库',
84   - icon: 'table',
85   - permissions: ['admin']
86   - }
87   - }, ]
88   - },
89   - // {
90   - // path: '/moduleIndex',
91   - // component: Layout,
92   - // redirect: '/module/index',
93   - // name: 'module',
94   - // meta: {
95   - // title: '面试题',
96   - // icon: 'el-icon-s-help'
97   - // },
98   - // children: [{
99   - // path: 'index',
100   - // name: 'index',
101   - // component: () =>
102   - // import ('@/views/TestPaper/index'),
103   - // hidden: true,
104   - // meta: {
105   - // title: '试卷维护',
106   - // icon: 'table'
107   - // }
108   - // }, ]
109   - // },
110   - // {
111   - // path: '/realQuestion',
112   - // component: Layout,
113   - // redirect: '/module/realQuestion',
114   - // name: 'realQuestion',
115   - // meta: {
116   - // title: '历年真题',
117   - // icon: 'el-icon-s-help'
118   - // },
119   - // children: [{
120   - // path: 'recharge',
121   - // name: 'recharge',
122   - // component: () =>
123   - // import ('@/views/module/realQuestion'),
124   - // meta: {
125   - // title: '历年真题',
126   - // icon: 'el-icon-s-management'
127   - // }
128   - // }]
129   - // },
130   -
131   - {
132   - path: '/views',
133   - component: Layout,
134   - redirect: '/views/TestPaper',
135   - name: 'TestPaper',
136   - meta: {
137   - title: '试卷管理',
138   - icon: 'el-icon-s-help'
139   - },
140   - children: [{
141   - path: 'TestPaperList',
142   - name: 'Table',
143   - component: () =>
144   - import ('@/views/TestPaper/TestPaperList'),
145   - meta: {
146   - title: '试卷列表',
147   - icon: 'table'
148   - }
149   - },
150   - {
151   - path: 'index',
152   - name: 'index',
153   - component: () =>
154   - import ('@/views/TestPaper/index'),
155   - hidden: true,
156   - meta: {
157   - title: '试卷维护',
158   - icon: 'table'
159   - }
160   - },
161   - {
162   - path: 'ManualTestPaper',
163   - name: 'Table',
164   - component: () =>
165   - import ('@/views/TestPaper/ManualTestPaper'),
166   - meta: {
167   - title: '组卷',
168   - icon: 'table'
169   - }
170   - },
171   -
172   - ]
173   - },
174   - // {
175   - // path: '/order',
176   - // component: Layout,
177   - // redirect: '/',
178   - // name: 'order',
179   - // meta: {
180   - // title: '订单管理',
181   - // icon: 'el-icon-s-marketing'
182   - // },
183   - // children: [{
184   - // path: 'recharge',
185   - // name: 'recharge',
186   - // component: () =>
187   - // import('@/views/order/rechargeList'),
188   - // meta: {
189   - // title: '充值记录',
190   - // }
191   - // }, {
192   - // path: 'shop',
193   - // name: 'shop',
194   - // component: () =>
195   - // import('@/views/order/shopList'),
196   - // meta: {
197   - // title: '购买记录',
198   - // }
199   - // }]
200   - // },
201   - {
202   - path: '/user',
203   - component: Layout,
204   - redirect: '/',
205   - name: 'user',
206   - meta: {
207   - title: '用户管理',
208   - icon: 'el-icon-s-help'
  27 + import ('@/views/404'),
  28 + hidden: true
209 29 },
210   - children: [{
211   - path: 'user',
212   - name: 'User',
213   - component: () =>
214   - import ('@/views/user/userlist'),
215   - meta: {
216   - title: '人才库',
217   - }
218   - },
219   - {
220   - path: 'interviewSchedule',
221   - name: 'interviewSchedule',
222   - component: () =>
223   - import ('@/views/user/InterviewSchedule'),
224   - meta: {
225   - title: '面试时间表',
226   - }
227   - },
228   -
229   - {
230   - path: 'importuser',
231   - name: 'importuser',
232 30  
233   - component: () =>
234   - import ('@/views/user/picuserimport'),
235   - meta: {
236   - title: '图片导入用户',
237   - }
238   - },
239   - {
240   - path: 'admin',
241   - name: 'admin',
242   - component: () =>
243   - import ('@/views/user/adminList'),
244   - meta: {
245   - title: '管理员列表',
246   - permissions: ['admin']
247   - }
248   - },
249   -
250   - ]
251   - }, {
252   - path: '/password',
253   - component: Layout,
254   - redirect: '/',
255   - name: 'password',
256   - meta: {
257   - title: '系统管理',
258   - icon: 'el-icon-s-platform'
  31 + {
  32 + path: '/answerDetail',
  33 + name: '答题详情',
  34 + component: () =>
  35 + import ('@/views/AnswerResult/detail.vue'),
  36 + hidden: true
259 37 },
260   - children: [{
261   - path: 'userdimset',
262   - name: 'impouserdimsetrtuser',
263 38  
  39 +
  40 + <<
  41 + << << < HEAD {
  42 + path: '/',
  43 + component: Layout,
  44 + redirect: '/dashboard',
  45 + children: [{
  46 + path: 'dashboard',
  47 + name: '首页',
264 48 component: () =>
265   - import ('@/views/user/userdimset'),
266   - meta: {
267   - title: '维度规则设置',
268   - permissions: ['admin']
269   - }
270   - },
271   - {
272   - path: 'index',
273   - name: 'index',
274   - component: () =>
275   - import ('@/views/password/index'),
276   - meta: {
277   - title: '忘记密码',
278   - }
279   - }, {
280   - path: 'TestPaperClass',
281   - name: 'Table',
282   - component: () =>
283   - import ('@/views/TestPaper/TestPaperClass'),
284   - meta: {
285   - title: '分类管理',
286   - permissions: ['admin']
287   - }
288   - }, {
289   - path: 'carousel',
290   - name: 'carousel',
291   - component: () =>
292   - import ('@/views/carousel/index'),
  49 + import ('@/views/dashboard/index'),
293 50 meta: {
294   - title: '轮播图',
295   - permissions: ['admin']
  51 + title: '首页',
  52 + icon: 'dashboard'
296 53 }
297 54 }, {
298   - path: 'new',
299   - name: 'new',
300   - component: () =>
301   - import ('@/views/carousel/new'),
302   - meta: {
303   - title: '最新资讯',
304   - permissions: ['admin']
305   - }
306   - }
307   - ]
308   - },
309   - // 404 page must be placed at the end !!!
310   - {
311   - path: '*',
312   - redirect: '/404',
313   - hidden: true
314   - }
315   - ]
316   - } else {
317   - return;
318   - constantRoutes1 = [{
319   - path: '/login',
320   - component: () =>
321   - import ('@/views/login/index'),
322   - hidden: true
323   - },
324   -
325   - {
326   - path: '/404',
327   - component: () =>
328   - import ('@/views/404'),
329   - hidden: true
330   - },
331   -
332   - {
333   - path: '/example',
334   - component: Layout,
335   - redirect: '/example/table',
336   - name: 'Example',
337   - meta: {
338   - title: '题库管理',
339   - icon: 'el-icon-s-help',
340   - permissions: ["admin", "user"],
341   - },
342   - children: [{
343   - path: 'QuestionBank',
344   - name: 'Table',
345   - component: () =>
346   - import ('@/views/QuestionBank/index'),
347   - meta: {
348   - title: '题库',
349   - icon: 'table'
350   - }
351   - }, ]
352   - },
353   - {
354   - path: '/moduleIndex',
355   - component: Layout,
356   - redirect: '/module/index',
357   - name: 'module',
358   - meta: {
359   - title: '面试题',
360   - icon: 'el-icon-s-help'
361   - },
362   - children: [{
363   - path: 'recharge',
364   - name: 'recharge',
365   - component: () =>
366   - import ('@/views/module/index'),
367   - meta: {
368   - title: '面试题',
369   - icon: 'el-icon-s-operation'
370   - }
371   - },
372   - {
373   - path: 'index',
374   - name: 'index',
  55 + path: 'live',
  56 + name: '直播观看',
375 57 component: () =>
376   - import ('@/views/TestPaper/index'),
377   - hidden: true,
  58 + import ('@/views/live/index'),
378 59 meta: {
379   - title: '试卷维护',
380   - icon: 'table'
381   - }
382   - },
383   - ]
384   - },
385   - // {
386   - // path: '/realQuestion',
387   - // component: Layout,
388   - // redirect: '/module/realQuestion',
389   - // name: 'realQuestion',
390   - // meta: {
391   - // title: '历年真题',
392   - // icon: 'el-icon-s-help'
393   - // },
394   - // children: [{
395   - // path: 'recharge',
396   - // name: 'recharge',
397   - // component: () =>
398   - // import ('@/views/module/realQuestion'),
399   - // meta: {
400   - // title: '历年真题',
401   - // icon: 'el-icon-s-management'
402   - // }
403   - // }]
404   - // },
405   -
406   - {
407   - path: '/views',
408   - component: Layout,
409   - redirect: '/views/TestPaper',
410   - name: 'TestPaper',
411   - meta: {
412   - title: '试卷管理',
413   - icon: 'el-icon-s-help'
  60 + title: '直播',
  61 + icon: 'video'
  62 + },
  63 + hidden: true
  64 + }]
414 65 },
415   - children: [{
416   - path: 'TestPaperList',
417   - name: 'Table',
418   - component: () =>
419   - import ('@/views/TestPaper/TestPaperList'),
420   - meta: {
421   - title: '试卷列表',
422   - icon: 'table'
423   - }
424   - },
425   - {
426   - path: 'index',
427   - name: 'index',
428   - component: () =>
429   - import ('@/views/TestPaper/index'),
430   - hidden: true,
431   - meta: {
432   - title: '试卷维护',
433   - icon: 'table'
434   - }
435   - },
436   - // {
437   - // path: 'ManualTestPaper',
438   - // name: 'Table',
439   - // component: () => import('@/views/TestPaper/ManualTestPaper'),
440   - // meta: {
441   - // title: '组卷',
442   - // icon: 'table'
443   - // }
444   - // },
445   -
446   - ]
447   - },
448   - // {
449   - // path: '/order',
450   - // component: Layout,
451   - // redirect: '/',
452   - // name: 'order',
453   - // meta: {
454   - // title: '订单管理',
455   - // icon: 'el-icon-s-marketing'
456   - // },
457   - // children: [{
458   - // path: 'recharge',
459   - // name: 'recharge',
460   - // component: () =>
461   - // import('@/views/order/rechargeList'),
462   - // meta: {
463   - // title: '充值记录',
464   - // }
465   - // }, {
466   - // path: 'shop',
467   - // name: 'shop',
468   - // component: () =>
469   - // import('@/views/order/shopList'),
470   - // meta: {
471   - // title: '购买记录',
472   - // }
473   - // }]
474   - // },
475   - {
476   - path: '/user',
477   - component: Layout,
478   - redirect: '/',
479   - name: 'user',
480   - meta: {
481   - title: '用户管理',
482   - icon: 'el-icon-s-help'
483   - },
484   - children: [{
485   - path: 'user',
486   - name: 'User',
487   - component: () =>
488   - import ('@/views/user/userlist'),
489   - meta: {
490   - title: '人才库',
491   - }
492   - }
493   -
494   - ]
495   - }, {
496   - path: '/password',
497   - component: Layout,
498   - redirect: '/',
499   - name: 'password',
500   - meta: {
501   - title: '系统管理',
502   - icon: 'el-icon-s-platform',
503   - permissions: ['admin', 'user']
504   - },
505   - children: [{
506   - path: 'index',
507   - name: 'index',
508   - component: () =>
509   - import ('@/views/password/index'),
510   - meta: {
511   - title: '忘记密码',
512   - }
513   - }, {
514   - path: 'TestPaperClass',
515   - name: 'Table',
516   - component: () =>
517   - import ('@/views/TestPaper/TestPaperClass'),
518   - meta: {
519   - title: '分类管理',
520   - permissions: ['admin']
521   - }
522   - }, {
523   - path: 'carousel',
524   - name: 'carousel',
525   - component: () =>
526   - import ('@/views/carousel/index'),
527   - meta: {
528   - title: '轮播图',
529   - permissions: ['admin']
530   - }
531   - }, {
532   - path: 'new',
533   - name: 'new',
534   - component: () =>
535   - import ('@/views/carousel/new'),
536   - meta: {
537   - title: '最新资讯',
538   - permissions: ['admin']
539   - }
540   - }]
541   - },
542   - // 404 page must be placed at the end !!!
543   - {
544   - path: '*',
545   - redirect: '/404',
546   - hidden: true
547   - }
548   - ]
549   - }
550 66  
  67 + {
  68 + path: '/example',
  69 + component: Layout,
  70 + redirect: '/example/table',
  71 + name: 'Example',
  72 + ===
  73 + === = {
  74 + code: 'home',
  75 + path: '/',
  76 + component: Layout,
  77 + redirect: '/dashboard',
  78 + children: [{
  79 + path: 'dashboard',
  80 + name: '首页',
  81 + component: () =>
  82 + import ('@/views/dashboard/index'),
  83 + >>>
  84 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  85 + meta: {
  86 + title: '题库管理',
  87 + icon: 'el-icon-s-help',
  88 + permissions: ['admin']
  89 + },
  90 + children: [{
  91 + path: 'QuestionBank',
  92 + name: 'Table',
  93 + component: () =>
  94 + import ('@/views/QuestionBank/index'),
  95 + meta: {
  96 + title: '题库',
  97 + icon: 'table',
  98 + permissions: ['admin']
  99 + }
  100 + }, ]
  101 + },
  102 + // {
  103 + // path: '/moduleIndex',
  104 + // component: Layout,
  105 + // redirect: '/module/index',
  106 + // name: 'module',
  107 + // meta: {
  108 + // title: '面试题',
  109 + // icon: 'el-icon-s-help'
  110 + // },
  111 + // children: [{
  112 + // path: 'index',
  113 + // name: 'index',
  114 + // component: () =>
  115 + // import ('@/views/TestPaper/index'),
  116 + // hidden: true,
  117 + // meta: {
  118 + // title: '试卷维护',
  119 + // icon: 'table'
  120 + // }
  121 + // }, ]
  122 + // },
  123 + // {
  124 + // path: '/realQuestion',
  125 + // component: Layout,
  126 + // redirect: '/module/realQuestion',
  127 + // name: 'realQuestion',
  128 + // meta: {
  129 + // title: '历年真题',
  130 + // icon: 'el-icon-s-help'
  131 + // },
  132 + // children: [{
  133 + // path: 'recharge',
  134 + // name: 'recharge',
  135 + // component: () =>
  136 + // import ('@/views/module/realQuestion'),
  137 + // meta: {
  138 + // title: '历年真题',
  139 + // icon: 'el-icon-s-management'
  140 + // }
  141 + // }]
  142 + // },
551 143  
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   - }
  144 + {
  145 + path: '/views',
  146 + component: Layout,
  147 + redirect: '/views/TestPaper',
  148 + name: 'TestPaper',
  149 + meta: {
  150 + title: '试卷管理',
  151 + icon: 'el-icon-s-help'
  152 + },
  153 + children: [{
  154 + path: 'TestPaperList',
  155 + name: 'Table',
  156 + component: () =>
  157 + import ('@/views/TestPaper/TestPaperList'),
  158 + meta: {
  159 + title: '试卷列表',
  160 + icon: 'table'
  161 + }
  162 + },
  163 + {
  164 + path: 'index',
  165 + name: 'index',
  166 + component: () =>
  167 + import ('@/views/TestPaper/index'),
  168 + hidden: true,
  169 + meta: {
  170 + title: '试卷维护',
  171 + icon: 'table'
  172 + }
  173 + },
  174 + {
  175 + path: 'ManualTestPaper',
  176 + name: 'Table',
  177 + component: () =>
  178 + import ('@/views/TestPaper/ManualTestPaper'),
  179 + meta: {
  180 + title: '组卷',
  181 + icon: 'table'
  182 + }
  183 + },
559 184  
  185 + <<
  186 + << << < HEAD
  187 + ]
  188 + },
  189 + // {
  190 + // path: '/order',
  191 + // component: Layout,
  192 + // redirect: '/',
  193 + // name: 'order',
  194 + // meta: {
  195 + // title: '订单管理',
  196 + // icon: 'el-icon-s-marketing'
  197 + // },
  198 + // children: [{
  199 + // path: 'recharge',
  200 + // name: 'recharge',
  201 + // component: () =>
  202 + // import('@/views/order/rechargeList'),
  203 + // meta: {
  204 + // title: '充值记录',
  205 + // }
  206 + // }, {
  207 + // path: 'shop',
  208 + // name: 'shop',
  209 + // component: () =>
  210 + // import('@/views/order/shopList'),
  211 + // meta: {
  212 + // title: '购买记录',
  213 + // }
  214 + // }]
  215 + // },
  216 + {
  217 + path: '/user',
  218 + component: Layout,
  219 + redirect: '/',
  220 + name: 'user',
  221 + ===
  222 + === = {
  223 + code: 'example',
  224 + path: '/example',
  225 + component: Layout,
  226 + redirect: '/example/table',
  227 + name: 'Example',
  228 + meta: {
  229 + title: '题库管理',
  230 + icon: 'el-icon-s-help',
  231 + permissions: ['admin']
  232 + },
  233 + children: [{
  234 + code: '题库',
  235 + path: 'QuestionBank',
  236 + name: 'Table',
  237 + component: () =>
  238 + import ('@/views/QuestionBank/index'),
  239 + >>>
  240 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  241 + meta: {
  242 + title: '用户管理',
  243 + icon: 'el-icon-s-help'
  244 + },
  245 + children: [{
  246 + path: 'user',
  247 + name: 'User',
  248 + component: () =>
  249 + import ('@/views/user/userlist'),
  250 + meta: {
  251 + title: '人才库',
  252 + }
  253 + },
  254 + {
  255 + path: 'interviewSchedule',
  256 + name: 'interviewSchedule',
  257 + component: () =>
  258 + import ('@/views/user/InterviewSchedule'),
  259 + meta: {
  260 + title: '面试时间表',
  261 + }
  262 + },
560 263  
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);
  264 + <<
  265 + << << < HEAD {
  266 + path: 'importuser',
  267 + name: 'importuser',
  268 +
  269 + component: () =>
  270 + import ('@/views/user/picuserimport'),
  271 + meta: {
  272 + title: '图片导入用户',
  273 + }
  274 + },
  275 + {
  276 + path: 'admin',
  277 + name: 'admin',
  278 + component: () =>
  279 + import ('@/views/user/adminList'),
  280 + meta: {
  281 + title: '管理员列表',
  282 + permissions: ['admin']
  283 + }
  284 + },
  285 +
  286 + ]
  287 + }, {
  288 + path: '/password',
  289 + component: Layout,
  290 + redirect: '/',
  291 + name: 'password',
  292 + ===
  293 + === = {
  294 + code: '试卷管理',
  295 + path: '/views',
  296 + component: Layout,
  297 + redirect: '/views/TestPaper',
  298 + name: 'TestPaper',
  299 + meta: {
  300 + title: '试卷管理',
  301 + icon: 'el-icon-s-help'
  302 + },
  303 + children: [{
  304 + code: '试卷列表',
  305 + path: 'TestPaperList',
  306 + name: 'Table',
  307 + component: () =>
  308 + import ('@/views/TestPaper/TestPaperList'),
  309 + >>>
  310 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  311 + meta: {
  312 + title: '系统管理',
  313 + icon: 'el-icon-s-platform'
  314 + },
  315 + children: [{
  316 + path: 'userdimset',
  317 + name: 'impouserdimsetrtuser',
  318 +
  319 + component: () =>
  320 + import ('@/views/user/userdimset'),
  321 + meta: {
  322 + title: '维度规则设置',
  323 + permissions: ['admin']
  324 + }
  325 + },
  326 + {
  327 + path: 'index',
  328 + name: 'index',
  329 + component: () =>
  330 + import ('@/views/password/index'),
  331 + meta: {
  332 + title: '忘记密码',
  333 + }
  334 + }, {
  335 + path: 'TestPaperClass',
  336 + name: 'Table',
  337 + component: () =>
  338 + import ('@/views/TestPaper/TestPaperClass'),
  339 + meta: {
  340 + title: '分类管理',
  341 + permissions: ['admin']
  342 + }
  343 + }, {
  344 + path: 'carousel',
  345 + name: 'carousel',
  346 + component: () =>
  347 + import ('@/views/carousel/index'),
  348 + meta: {
  349 + title: '轮播图',
  350 + permissions: ['admin']
  351 + }
  352 + }, {
  353 + path: 'new',
  354 + name: 'new',
  355 + component: () =>
  356 + import ('@/views/carousel/new'),
  357 + meta: {
  358 + title: '最新资讯',
  359 + permissions: ['admin']
  360 + }
  361 + }
  362 + ]
  363 + },
  364 + // 404 page must be placed at the end !!!
  365 + {
  366 + path: '*',
  367 + redirect: '/404',
  368 + hidden: true
  369 + }
  370 + ]
  371 + }
  372 + else {
  373 + return;
  374 + constantRoutes1 = [{
  375 + path: '/login',
  376 + component: () =>
  377 + import ('@/views/login/index'),
  378 + hidden: true
  379 + },
  380 +
  381 + { <<
  382 + << << < HEAD
  383 + path: '/404',
  384 + ===
  385 + === =
  386 + code: '组卷',
  387 + path: 'ManualTestPaper',
  388 + name: 'Table',
  389 + >>>
  390 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  391 + component: () =>
  392 + import ('@/views/404'),
  393 + hidden: true
  394 + },
  395 +
  396 + <<
  397 + << << < HEAD {
  398 + path: '/example',
  399 + component: Layout,
  400 + redirect: '/example/table',
  401 + name: 'Example',
  402 + ===
  403 + === =
  404 + ]
  405 + },
  406 + // {
  407 + // path: '/order',
  408 + // component: Layout,
  409 + // redirect: '/',
  410 + // name: 'order',
  411 + // meta: {
  412 + // title: '订单管理',
  413 + // icon: 'el-icon-s-marketing'
  414 + // },
  415 + // children: [{
  416 + // path: 'recharge',
  417 + // name: 'recharge',
  418 + // component: () =>
  419 + // import('@/views/order/rechargeList'),
  420 + // meta: {
  421 + // title: '充值记录',
  422 + // }
  423 + // }, {
  424 + // path: 'shop',
  425 + // name: 'shop',
  426 + // component: () =>
  427 + // import('@/views/order/shopList'),
  428 + // meta: {
  429 + // title: '购买记录',
  430 + // }
  431 + // }]
  432 + // },
  433 + {
  434 + code: '用户管理',
  435 + path: '/user',
  436 + component: Layout,
  437 + redirect: '/',
  438 + name: 'user',
  439 + meta: {
  440 + title: '用户管理',
  441 + icon: 'el-icon-s-help'
  442 + },
  443 + children: [{
  444 + code: '人才库',
  445 + path: 'user',
  446 + name: 'User',
  447 + component: () =>
  448 + import ('@/views/user/userlist'),
  449 + >>>
  450 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  451 + meta: {
  452 + title: '题库管理',
  453 + icon: 'el-icon-s-help',
  454 + permissions: ["admin", "user"],
  455 + },
  456 + children: [{
  457 + path: 'QuestionBank',
  458 + name: 'Table',
  459 + component: () =>
  460 + import ('@/views/QuestionBank/index'),
  461 + meta: {
  462 + title: '题库',
  463 + icon: 'table'
  464 + }
  465 + }, ]
  466 + },
  467 + { <<
  468 + << << < HEAD
  469 + path: '/moduleIndex',
  470 + component: Layout,
  471 + redirect: '/module/index',
  472 + name: 'module',
  473 + ===
  474 + === =
  475 + code: '面试时间表',
  476 + path: 'interviewSchedule',
  477 + name: 'interviewSchedule',
  478 + component: () =>
  479 + import ('@/views/user/InterviewSchedule'),
  480 + >>>
  481 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  482 + meta: {
  483 + title: '面试题',
  484 + icon: 'el-icon-s-help'
  485 + },
  486 + children: [{
  487 + path: 'recharge',
  488 + name: 'recharge',
  489 + component: () =>
  490 + import ('@/views/module/index'),
  491 + meta: {
  492 + title: '面试题',
  493 + icon: 'el-icon-s-operation'
  494 + }
  495 + },
  496 + {
  497 + path: 'index',
  498 + name: 'index',
  499 + component: () =>
  500 + import ('@/views/TestPaper/index'),
  501 + hidden: true,
  502 + meta: {
  503 + title: '试卷维护',
  504 + icon: 'table'
  505 + }
  506 + },
  507 + ]
  508 + },
  509 + // {
  510 + // path: '/realQuestion',
  511 + // component: Layout,
  512 + // redirect: '/module/realQuestion',
  513 + // name: 'realQuestion',
  514 + // meta: {
  515 + // title: '历年真题',
  516 + // icon: 'el-icon-s-help'
  517 + // },
  518 + // children: [{
  519 + // path: 'recharge',
  520 + // name: 'recharge',
  521 + // component: () =>
  522 + // import ('@/views/module/realQuestion'),
  523 + // meta: {
  524 + // title: '历年真题',
  525 + // icon: 'el-icon-s-management'
  526 + // }
  527 + // }]
  528 + // },
  529 +
  530 + { <<
  531 + << << < HEAD
  532 + path: '/views',
  533 + component: Layout,
  534 + redirect: '/views/TestPaper',
  535 + name: 'TestPaper',
  536 + ===
  537 + === =
  538 + code: 'importuser',
  539 + path: 'importuser',
  540 + name: 'importuser',
  541 +
  542 + component: () =>
  543 + import ('@/views/user/picuserimport'),
  544 + >>>
  545 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  546 + meta: {
  547 + title: '试卷管理',
  548 + icon: 'el-icon-s-help'
  549 + },
  550 + children: [{
  551 + path: 'TestPaperList',
  552 + name: 'Table',
  553 + component: () =>
  554 + import ('@/views/TestPaper/TestPaperList'),
  555 + meta: {
  556 + title: '试卷列表',
  557 + icon: 'table'
  558 + }
  559 + },
  560 + {
  561 + path: 'index',
  562 + name: 'index',
  563 + component: () =>
  564 + import ('@/views/TestPaper/index'),
  565 + hidden: true,
  566 + meta: {
  567 + title: '试卷维护',
  568 + icon: 'table'
  569 + }
  570 + },
  571 + // {
  572 + // path: 'ManualTestPaper',
  573 + // name: 'Table',
  574 + // component: () => import('@/views/TestPaper/ManualTestPaper'),
  575 + // meta: {
  576 + // title: '组卷',
  577 + // icon: 'table'
  578 + // }
  579 + // },
  580 +
  581 + ]
  582 + },
  583 + // {
  584 + // path: '/order',
  585 + // component: Layout,
  586 + // redirect: '/',
  587 + // name: 'order',
  588 + // meta: {
  589 + // title: '订单管理',
  590 + // icon: 'el-icon-s-marketing'
  591 + // },
  592 + // children: [{
  593 + // path: 'recharge',
  594 + // name: 'recharge',
  595 + // component: () =>
  596 + // import('@/views/order/rechargeList'),
  597 + // meta: {
  598 + // title: '充值记录',
  599 + // }
  600 + // }, {
  601 + // path: 'shop',
  602 + // name: 'shop',
  603 + // component: () =>
  604 + // import('@/views/order/shopList'),
  605 + // meta: {
  606 + // title: '购买记录',
  607 + // }
  608 + // }]
  609 + // },
  610 + { <<
  611 + << << < HEAD
  612 + path: '/user',
  613 + component: Layout,
  614 + redirect: '/',
  615 + name: 'user',
  616 + meta: {
  617 + title: '用户管理',
  618 + icon: 'el-icon-s-help'
  619 + },
  620 + children: [{
  621 + path: 'user',
  622 + name: 'User',
  623 + component: () =>
  624 + import ('@/views/user/userlist'),
  625 + meta: {
  626 + title: '人才库',
  627 + } ===
  628 + === =
  629 + code: 'admin',
  630 + path: 'admin',
  631 + name: 'admin',
  632 + component: () =>
  633 + import ('@/views/user/adminList'),
  634 + meta: {
  635 + title: '管理员列表',
  636 + permissions: ['admin']
  637 + }
  638 + },
  639 +
  640 + ]
  641 + }, {
  642 + code: '系统管理',
  643 + path: '/system',
  644 + component: Layout,
  645 + redirect: '/',
  646 + name: 'password',
  647 + meta: {
  648 + title: '系统管理',
  649 + icon: 'el-icon-s-platform'
  650 + },
  651 + children: [{
  652 + code: 'userdimset',
  653 + path: 'userdimset',
  654 + name: 'impouserdimsetrtuser',
  655 +
  656 + component: () =>
  657 + import ('@/views/user/userdimset'),
  658 + meta: {
  659 + title: '维度规则设置',
  660 + permissions: ['admin'] >>>
  661 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  662 + }
  663 +
  664 + ]
  665 + },
  666 + {
  667 + path: '/password',
  668 + component: Layout,
  669 + redirect: '/',
  670 + name: 'password',
  671 + meta: {
  672 + title: '系统管理',
  673 + icon: 'el-icon-s-platform',
  674 + permissions: ['admin', 'user']
  675 + },
  676 + children: [{
  677 + path: 'index',
  678 + name: 'index',
  679 + component: () =>
  680 + import ('@/views/password/index'),
  681 + meta: {
  682 + title: '忘记密码',
  683 + }
  684 + },
  685 + {
  686 + code: 'settings',
  687 + path: 'settings',
  688 + name: 'settings',
  689 + component: () =>
  690 + import ('@/views/settings/index'),
  691 + meta: {
  692 + title: '系统设置',
  693 + }
  694 + },
  695 + {
  696 + code: 'TestPaperClass',
  697 + path: 'TestPaperClass',
  698 + name: 'Table',
  699 + component: () =>
  700 + import ('@/views/TestPaper/TestPaperClass'),
  701 + meta: {
  702 + title: '分类管理',
  703 + permissions: ['admin']
  704 + }
  705 + }, {
  706 + code: 'carousel',
  707 + path: 'carousel',
  708 + name: 'carousel',
  709 + component: () =>
  710 + import ('@/views/carousel/index'),
  711 + meta: {
  712 + title: '轮播图',
  713 + permissions: ['admin']
  714 + }
  715 + }, {
  716 + code: 'new',
  717 + path: 'new',
  718 + name: 'new',
  719 + component: () =>
  720 + import ('@/views/carousel/new'),
  721 + meta: {
  722 + title: '最新资讯',
  723 + permissions: ['admin']
  724 + } <<
  725 + << << < HEAD
  726 + }
  727 + ] ===
  728 + === =
  729 + },
  730 + {
  731 + code: 'rolelist',
  732 + path: 'role',
  733 + name: 'rolelist',
  734 + component: () =>
  735 + import ('@/views/user/rolelist'),
  736 + meta: {
  737 + title: '角色权限',
  738 + permissions: ['admin']
  739 + }
  740 + },
  741 + {
  742 + code: 'logs',
  743 + path: 'logs',
  744 + name: 'logs',
  745 +
  746 + component: () =>
  747 + import ('@/views/user/loglist'),
  748 + meta: {
  749 + title: '系统日志',
  750 + }
  751 + },
  752 +
  753 +
  754 + ]
  755 + },
  756 + // 404 page must be placed at the end !!!
  757 + {
  758 + path: '*',
  759 + redirect: '/404',
  760 + hidden: true
  761 + }
  762 + ]
  763 + } else {
  764 + return;
  765 + constantRoutes1 = [{
  766 + path: '/login',
  767 + component: () =>
  768 + import ('@/views/login/index'),
  769 + hidden: true
  770 + },
  771 +
  772 + {
  773 + path: '/404',
  774 + component: () =>
  775 + import ('@/views/404'),
  776 + hidden: true
  777 + },
  778 +
  779 + {
  780 + path: '/example',
  781 + component: Layout,
  782 + redirect: '/example/table',
  783 + name: 'Example',
  784 + meta: {
  785 + title: '题库管理',
  786 + icon: 'el-icon-s-help',
  787 + permissions: ["admin", "user"],
  788 + },
  789 + children: [{
  790 + path: 'QuestionBank',
  791 + name: 'Table',
  792 + component: () =>
  793 + import ('@/views/QuestionBank/index'),
  794 + meta: {
  795 + title: '题库',
  796 + icon: 'table'
  797 + }
  798 + }, ]
  799 + },
  800 + {
  801 + path: '/moduleIndex',
  802 + component: Layout,
  803 + redirect: '/module/index',
  804 + name: 'module',
  805 + meta: {
  806 + title: '面试题',
  807 + icon: 'el-icon-s-help'
  808 + },
  809 + children: [{
  810 + path: 'recharge',
  811 + name: 'recharge',
  812 + component: () =>
  813 + import ('@/views/module/index'),
  814 + meta: {
  815 + title: '面试题',
  816 + icon: 'el-icon-s-operation'
  817 + } >>>
  818 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  819 + },
  820 + // 404 page must be placed at the end !!!
  821 + {
  822 + path: '*',
  823 + redirect: '/404',
  824 + hidden: true
  825 + }
  826 + ]
  827 + }
  828 +
  829 +
  830 + function hasPermission(permissions, route) {
  831 + if (route.meta && route.meta.permissions) {
  832 + return permissions.some((role) => route.meta.permissions.includes(role));
  833 + } else {
  834 + return true;
  835 + }
  836 + }
  837 +
  838 +
  839 + function filterAsyncRoutes(routes, permissions) {
  840 + const finallyRoutes = [];
  841 + routes.forEach((route) => { <<
  842 + << << < HEAD
  843 + const item = {...route };
  844 + if (hasPermission(permissions, item)) { ===
  845 + === =
  846 + const item = {...route };
  847 + // if (hasPermission(permissions, item)) {
  848 + if (permissions.includes(item.code) || !item.code) { >>>
  849 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  850 + if (item.children) {
  851 + item.children = filterAsyncRoutes(item.children, permissions);
  852 + }
  853 + finallyRoutes.push(item);
  854 + }
  855 + });
  856 + return finallyRoutes;
  857 + }
  858 + constantRoutes1 = filterAsyncRoutes(constantRoutes1, permissions);
575 859  
576   - return constantRoutes1;
577   -}
578 860 \ No newline at end of file
  861 + return constantRoutes1;
  862 + }
579 863 \ No newline at end of file
... ...
src/views/QuestionBank/components/EditDimension.vue
1 1 <template>
2   - <el-dialog title="维度编辑" :visible.sync="dialogFormVisible" @closed="handleclose" width="75%">
  2 + <el-dialog title="编辑" :visible.sync="dialogFormVisible" @closed="handleclose" width="75%">
3 3 <el-form :model="data">
  4 + <el-form-item label="上级分类" style="padding-top: 5px">
  5 +
  6 +
  7 + <el-cascader filterable v-model="data.ParentId" style="width: 400px"
  8 + :props="{ emitPath: false ,checkStrictly:true}" :clearable="true" :options="QuestionClass">
  9 +
  10 + <template slot-scope="{ node, data }">
  11 + <span>{{ data.label }}</span>
  12 + <span v-if="!node.isLeaf"> ({{ data.subjectCount || 0 }}) </span>
  13 + </template>
  14 +
  15 +
  16 + </el-cascader>
  17 + </el-form-item>
4 18 <el-form-item label="名称">
5 19 <el-input v-model="data.ClassificationName"></el-input>
  20 +
6 21 </el-form-item>
7 22  
8   - <el-form-item label="规则">
  23 + <el-form-item label="规则" v-show="level ==3">
9 24 <div style="padding:10px 5px 0px 5px">
10 25 <el-table v-if="data.rules" :data="data.rules" style="width: 100%;">
11 26 <el-table-column align="left" label="状态">
... ... @@ -34,7 +49,7 @@
34 49 </el-option>
35 50 </el-select>
36 51 <el-input style="width:20%;margin-right:1%" type="number" v-model="row.StartScore"
37   - :placeholder="'开始分值'">
  52 + :placeholder="'开始分值'">
38 53 </el-input>
39 54 <el-select style="width:18%;margin-right:1%" v-model="row.EndFormula" placeholder="规则" clearable>
40 55 <el-option v-for="item in ruleOptions" :key="item.value" :label="item.label" :value="item.value">
... ... @@ -99,7 +114,9 @@
99 114 getQuestionClass,
100 115  
101 116 } from "@/api/QuestionClass";
102   -
  117 + import {
  118 + getQuestionClassList
  119 + } from "@/api/QuestionBank";
103 120  
104 121 export default {
105 122 components: {
... ... @@ -122,7 +139,8 @@
122 139 activeName: '',
123 140 dialogFormVisible: false,
124 141 form: {},
125   -
  142 + level:0,
  143 + QuestionClass: [],
126 144 ruleOptions: [
127 145 { label: '大于', value: '>' },
128 146 { label: '小于', value: '<' },
... ... @@ -156,8 +174,64 @@
156 174 },
157 175 created() {
158 176 // this.show();
  177 +
  178 + },
  179 + mounted(){
  180 +
159 181 },
160   - methods: {
  182 + methods: {
  183 + getSubTree(id, list) {
  184 + let result = [];
  185 + result = list.filter((t) => t.ParentId == id);
  186 + if (result.length) {
  187 + result = result.map((item) => {
  188 + item.children = this.getSubTree(item.id, list);
  189 + return item;
  190 + });
  191 + }
  192 + return result;
  193 + },
  194 + getQuestionClassListHeadler(node) {
  195 + var classtype = node.data.ClassType || 0;
  196 + let _this = this;
  197 + getQuestionClassList().then((res) => {
  198 + let list = [{id:0,ClassificationName:'顶级',ClassType : classtype}];
  199 + res.data.data.forEach(o=>{list.push(o);});
  200 + var rootlist = list.filter(o=> o.ClassType == classtype && (!o.ParentId || o.ParentId == 0 )).map((t) => {
  201 + t.value = t.id;
  202 + t.label = t.ClassificationName;
  203 + return t;
  204 + });
  205 + // let firstClass = list.find((t) => t.id == 6);
  206 + // firstClass.children = this.getSubTree(6, list);
  207 + // let secondClass = list.find((t) => t.id == 1);
  208 + // secondClass.children = this.getSubTree(1, list);
  209 + this.QuestionClass = rootlist;
  210 + var firstlist = rootlist.filter(o => o.ClassType == 0 && o.ParentId == 0).map(o => {
  211 + o.children = this.getSubTree(o.id, list);
  212 + return o;
  213 + });
  214 +
  215 + var twolist = rootlist.filter(o => o.ClassType == 2 && o.ParentId == 0).map(o => {
  216 + o.children = this.getSubTree(o.id, list);
  217 + return o;
  218 +
  219 + });
  220 + // _this.$nextTick(()=>{
  221 + // if(_this.currentEditNode){
  222 + // _this.$refs.tree.getNode(_this.currentEditNode.parent).loaded = false
  223 + // _this.$refs.tree.getNode(_this.currentEditNode.parent).expand();
  224 + // _this.$refs.tree.getNode(_this.currentEditNode.parent).expanded=true;
  225 + // _this.$forceUpdate()
  226 +
  227 + // }
  228 +
  229 + // });
  230 +
  231 + // this.firstTreeData = [firstClass];
  232 + // this.secondTreeData = [secondClass];
  233 + });
  234 + },
161 235 handleclose(){
162 236 this.dialogFormVisible = false;
163 237 this.$emit('close',this.data);
... ... @@ -242,7 +316,10 @@
242 316 this.tableData = tmpdata
243 317 } catch (e) { }
244 318 },
245   - show(id) {
  319 + show(id,node) {
  320 + this.getQuestionClassListHeadler(node);
  321 +
  322 + if(node) this.level = node.level;
246 323 this.data = {
247 324 // id: Date.parse(new Date()) + '_' + Math.ceil(Math.random() * 99999),
248 325 // key: Date.parse(new Date()) + '_' + Math.ceil(Math.random() * 99999),
... ... @@ -264,10 +341,10 @@
264 341  
265 342 this.dialogFormVisible = true;
266 343 getQuestionClass({ id }).then(res => {
267   -
  344 +
268 345 if (res) {
269 346 var data = res.data.data;
270   - if (!data.rules) {
  347 + if (!data.rules || data.rules.length <1) {
271 348 data.rules = [
272 349 {
273 350 QuestionClassId: 0,
... ...
src/views/QuestionBank/index.vue
... ... @@ -7,7 +7,7 @@
7 7 <label style="font-size: 18px">题目分类</label>
8 8 </div>
9 9  
10   - <div :style="{ height: TableColHeight + 'px' }" class="areadiv"
  10 + <div :style="{ height: TableColHeight + 'px','overflow-y':'auto' }" class="areadiv"
11 11 style="margin: 10px 0 0 0; padding: 5px 0 0 0">
12 12 <el-tabs v-model="activeTab" @tab-click="handleTabsClick" style="padding: 0 20px" :stretch="true">
13 13 <el-tab-pane label="专业类" name="first"></el-tab-pane>
... ... @@ -15,16 +15,17 @@
15 15 </el-tabs>
16 16 <el-button type="button" size="mini" style="width:100%;margin-bottom:10px"
17 17 @click="showClassDialog(null,0,activeTab == 'first' ? 0 : 2)">
18   - 添加顶级
  18 + 添加顶级
19 19 </el-button>
20 20 <el-tree :data="activeTab == 'first' ? firstTreeData : secondTreeData"
21   - :default-expanded-keys="currentExpend" :props="activeTab == 'first' ? firstTreeData : secondTreeData"
22   - @node-click="handleNodeClick" class="eltree" :expand-on-click-node="false" ref="tree">
  21 + :props="activeTab == 'first' ? firstTreeData : secondTreeData" @node-click="handleNodeClick"
  22 + class="eltree" :expand-on-click-node="false" node-key="value" :default-expanded-keys="defaultexpand"
  23 + @node-expand="handleNodeExpand" ref="tree">
23 24 <span class="custom-tree-node" slot-scope="{ node, data }">
24   - <span>{{ node.label }}</span>
  25 + <span>[{{data.id}}] {{ node.label }} ({{data.subjectCount || 0}})</span>
25 26 <span style="">
26 27 <!-- v-if="activeTab == 'first'?true:node.level<2?true:false" -->
27   - <el-button type="text" size="mini" @click="showClassDialog(node)">
  28 + <el-button type="text" size="mini" @click="showClassDialog(node)" v-if="node.level <3">
28 29 添加下级
29 30 </el-button>
30 31 <el-button type="text" v-if="activeTab == 'second' || 1==1" @click="handleEditDimension(node, data)">
... ... @@ -50,8 +51,9 @@
50 51 </el-button>
51 52 <el-button type="danger" @click="handleChangeCat">批量修改分类
52 53 </el-button>
53   - <el-button type="danger" @click="handleChangeType">批量修改题型
54   - </el-button>
  54 + <el-button type="danger" @click="dialogFormVisible = true">导入题目</el-button>
  55 + <!-- <el-button type="danger" @click="handleChangeType">批量修改题型
  56 + </el-button> -->
55 57 </div>
56 58 <div class="areadiv" :style="{ height: TableColHeight + 'px' }">
57 59 <el-table :data="QuestList" id="QuestionTable" border style="
... ... @@ -66,28 +68,28 @@
66 68 <span>{{ scope.row.id }}</span>
67 69 </template>
68 70 </el-table-column>
69   - <el-table-column prop="date" label="题目类型" width="100">
  71 + <el-table-column prop="date" label="题目类型" width="110" sortable>
70 72 <template slot-scope="scope">
71 73 <span style="padding-left: 10px">{{
72 74 scope.row.subjectName
73 75 }}</span>
74 76 </template>
75 77 </el-table-column>
76   - <el-table-column prop="QuestionClassName" label="分类" width="100">
  78 + <el-table-column prop="QuestionClassName" label="分类" width="110" sortable>
77 79 <template slot-scope="scope">
78 80 <span style="padding-left: 10px">{{
79 81 scope.row.QuestionClassName
80 82 }}</span>
81 83 </template>
82 84 </el-table-column>
83   - <el-table-column prop="name" label="分数" width="80">
  85 + <el-table-column prop="name" label="分数" width="90" sortable>
84 86 <template slot-scope="scope">
85 87 <span style="padding-left: 10px">{{
86 88 scope.row.fraction
87 89 }}</span>
88 90 </template>
89 91 </el-table-column>
90   - <el-table-column prop="name" label="单项分数" width="80">
  92 + <el-table-column prop="name" label="单项分数" width="110" sortable>
91 93 <template slot-scope="scope">
92 94 <span style="padding-left: 10px">{{
93 95 scope.row.singleFraction
... ... @@ -150,26 +152,39 @@
150 152 :close-on-click-modal="false">
151 153 <el-form ref="QuestionClassInfo" :model="QuestionClassInfo" label-width="70px">
152 154 <el-form-item label="分类名称">
  155 +
153 156 <el-input v-model="QuestionClassInfo.ClassificationName" placeholder="请输入分类名称"></el-input>
154 157 </el-form-item>
  158 +
  159 +
  160 +
155 161 </el-form>
156   - {{QuestionClassInfo}}
  162 + <!-- {{QuestionClassInfo}} -->
157 163 <el-button @click="CreateQuestionClassHealder" style="margin: 10px 0 0 0; float: right" type="primary">确定
158 164 </el-button>
159 165 <div style="clear: both"></div>
160 166 </el-dialog>
161 167 <el-dialog title="编辑题目" :visible.sync="dialogsubjectlVisible" @close="closeDialog" width="800px"
162 168 :close-on-click-modal="false">
163   - <el-form ref="Dataform" :model="Dataform" label-width="60px">
  169 +
  170 + <el-form ref="Dataform" :model="Dataform" label-width="60px" :rules="rules">
164 171 <div style="padding:10px">
165 172 <el-alert v-if="FormClassType==2" title="选项的维度分值如不设置将按照分值规则自动计算" type="warning"></el-alert>
166 173 </div>
167   - <el-form-item label="题目">
  174 + <el-form-item label="题目" prop="subject">
168 175 <el-input v-model="Dataform.subject" placeholder="请输入题目名称"></el-input>
169 176 </el-form-item>
170   - <el-form-item label="分类" style="padding-top: 5px">
171   - <el-cascader @change="changequestionclass" v-model="Dataform.QuestionClassId" style="width: 400px"
  177 + <el-form-item label="分类" style="padding-top: 5px" prop="QuestionClassId">
  178 +
  179 + <el-cascader @change="changequestionclass" filterable v-model="Dataform.QuestionClassId" style="width: 400px"
172 180 :props="{ emitPath: false ,checkStrictly:true}" :clearable="true" :options="QuestionClass">
  181 +
  182 + <template slot-scope="{ node, data }">
  183 + <span>{{ data.label }}</span>
  184 + <span v-if="!node.isLeaf"> ({{ data.subjectCount || 0 }}) </span>
  185 + </template>
  186 +
  187 +
173 188 </el-cascader>
174 189 </el-form-item>
175 190 <el-form-item label="题型" style="padding-top: 5px">
... ... @@ -190,9 +205,12 @@
190 205 <template slot="prepend">{{ scope.row.option }}</template>
191 206 </el-input>
192 207  
193   - <el-input placeholder="维度分值" v-model="scope.row.score" class="optionInput"
  208 + <!-- <el-input placeholder="维度分值" v-model="scope.row.score" class="optionInput"
194 209 style="width:21% !important;margin-left:1%">
195   - </el-input>
  210 + </el-input> -->
  211 +
  212 + <el-input-number v-model="scope.row.score" class="optionInput" :min="0" :step="5" placeholder="分值"
  213 + style="width:21% !important;margin-left:1%"></el-input-number>
196 214 <!-- v-if="FormClassType==2" -->
197 215 <el-select v-model="scope.row.scorerule" class="optionInput" placeholder="分值规则"
198 216 style="width:20% !important;margin-left:1%">
... ... @@ -200,7 +218,7 @@
200 218 <el-option v-for="sritem in scoreRules" :label="sritem" :value="sritem">{{sritem}}</el-option>
201 219 </el-select>
202 220 <i class="el-icon-circle-plus el-icon" @click="Addlist"></i>
203   - <i class="el-icon-remove el-icon" @click="RemoveList(scope)" v-if="scope.$index != 0"></i>
  221 + <i class="el-icon-remove el-icon" @click="RemoveList(scope)" v-if="subjectContent.length >1"></i>
204 222 </template>
205 223 </el-table-column>
206 224  
... ... @@ -269,6 +287,59 @@
269 287 </el-button>
270 288 <div style="clear: both"></div>
271 289 </el-dialog>
  290 +
  291 +
  292 +
  293 +
  294 +
  295 + <el-dialog title="导入" :visible.sync="dialogFormVisible">
  296 +
  297 +
  298 +
  299 +
  300 + <el-upload class="upload-demo" style="width:80%" :headers="{Authorization:token}" drag
  301 + :on-success="handleSuccess"
  302 + action="/api/QuestionBank/import" :limit="1">
  303 + <i class="el-icon-upload"></i>
  304 + <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  305 + <div class="el-upload__tip" slot="tip">只能上传excel文件,条数尽量不要太多控制在1000内
  306 + <br>
  307 + <br>
  308 + <br>
  309 + <span style="color:red;line-height:20px;font-size:16px">
  310 + 注意:
  311 + <br>
  312 + 1.导入每个选项格式 分为三段 用” @@ “ 隔开 选项内容@@选项分值@@选项权重(权重 分为三个 高 中 低) <br /> 例如:
  313 + <p>选项A 今天感觉怎么样@@10@@高</p>
  314 + <p>选项B 内容@@10@@高</p>
  315 + <p>选项C 内容@@5@@中</p>
  316 + <p>选项D 内容@@8@@低</p>
  317 +
  318 + </span>
  319 +
  320 + <br>
  321 + <span style="color:red;line-height:20px;font-size:16px">
  322 + 2.分类编号 从后台题库管理左侧分类的名称前获取 [1] 只需填写中间的数字即可
  323 + </span>
  324 +
  325 + <br>
  326 +
  327 + <span style="color:red;line-height:20px;font-size:16px">
  328 + 3.多选题 多选题选项 多个用 英文,隔开 如: A,B,C
  329 + </span>
  330 +
  331 + <br>
  332 + <el-link :href="BASE_URL + '/temp/题目导入模板.xlsx'" target="_blank" type="primary">点击下载导入模板</el-link>
  333 +
  334 + </div>
  335 + </el-upload>
  336 +
  337 +
  338 +
  339 +
  340 + </el-dialog>
  341 +
  342 +
272 343 <EditDimension ref="editDimensionDialog" :model="currentEditDimension" @close="closeEditDim" @save="saveEditDim">
273 344 </EditDimension>
274 345 </div>
... ... @@ -285,6 +356,12 @@
285 356 } from "@/api/QuestionBank";
286 357 import { parseTime } from "@/utils/index.js";
287 358 import EditDimension from "./components/EditDimension.vue";
  359 +
  360 + import {
  361 + getToken
  362 + } from '@/utils/auth'
  363 +
  364 +
288 365 export default {
289 366 filters: {},
290 367 components: {
... ... @@ -292,9 +369,12 @@
292 369 },
293 370 data() {
294 371 return {
  372 + token: getToken(),
  373 + dialogFormVisible: false,
295 374 FormClassType: 0,
296 375 loading: false,
297 376 currentEditDimension: {},
  377 + defaultexpand: [],
298 378 activeTab: "first",
299 379 parameter: {
300 380 pageIndex: 1,
... ... @@ -351,7 +431,19 @@
351 431 CreatClassId: 0,
352 432 scoreRules: ['高', '中', '低'],
353 433 currentEditNode: undefined,
354   - currentExpend: [1]
  434 + currentExpend: [1],
  435 + rules: {
  436 + subject: [
  437 + { required: true, message: '题目名称必填', trigger: 'blur' }
  438 + ],
  439 + subjectType: [
  440 + { required: true, message: '请选择分类', trigger: 'change' }
  441 + ],
  442 + QuestionClassId: [
  443 + { required: true, message: '请选择分类', trigger: 'change' }
  444 + ]
  445 + }
  446 +
355 447 };
356 448 },
357 449 created() { },
... ... @@ -370,7 +462,14 @@
370 462 methods: {
371 463 closeEditDim(data) {
372 464 },
373   -
  465 + handleSuccess(res) {
  466 + var msg = '';
  467 + if(res.data.data){
  468 + msg = `导入完成 共:${res.data.data.tableCount}个题目 成功 ${res.data.data.SuccessCount}个题目`;
  469 + }
  470 + this.$message.success(msg);
  471 + this.GetList();
  472 + },
374 473 saveEditDim(data) {
375 474 // if(this.currentEditNode && this.currentEditNode.parent)
376 475 // this.currentExpend=[this.currentEditNode.parent.data.id];
... ... @@ -467,6 +566,7 @@
467 566 this.dialogsubjectlVisible = true
468 567 },
469 568 changequestionclass(a, b, c) {
  569 + debugger;
470 570 var item = this.QuestionClass.find(o => o.id == a);
471 571 if (item) this.FormClassType = item.ClassType;
472 572 },
... ... @@ -474,7 +574,7 @@
474 574 handleEditDimension(node, data) {
475 575 console.log(data);
476 576 // this.$refs.editDimensionDialog.dialogFormVisible = true;
477   - this.$refs.editDimensionDialog.show(data.id);
  577 + this.$refs.editDimensionDialog.show(data.id, node);
478 578 this.currentEditDimension = data;
479 579 this.currentEditNode = node;
480 580 },
... ... @@ -487,13 +587,30 @@
487 587 this.loading = true;
488 588 // console.log(node, data);
489 589 // console.log(this.API);
490   - this.API.deleteQuestionClass(data.value).then((res) => {
491   -
492   - this.getQuestionClassListHeadler();
493 590  
  591 + setTimeout(() => {
494 592 this.loading = false;
495   - this.$message.success('操作成功!');
  593 +
  594 + }, 1000);
  595 + this.$confirm("确认删除该分类信息吗?", "提示", {
  596 + confirmButtonText: "确定",
  597 + cancelButtonText: "取消",
  598 + type: "warning",
  599 + }).then(() => {
  600 + this.API.deleteQuestionClass(data.value).then((res) => {
  601 + if (res.data.success) {
  602 + this.getQuestionClassListHeadler();
  603 + this.$message.success('操作成功!');
  604 + }
  605 + else {
  606 + this.$message.error(res.data.message || '删除失败!');
  607 + }
  608 +
  609 + });
496 610 });
  611 +
  612 +
  613 +
497 614 },
498 615 closeClassDialog() {
499 616 this.dialogClassIVIsible = false;
... ... @@ -538,15 +655,20 @@
538 655 this.dialogsubjectlVisible = true;
539 656 });
540 657 },
541   - showClassDialog(node, parent, type) {
  658 + showClassDialog(node, parent, type) {
  659 + this.QuestionClassInfo.ClassificationName = '';
  660 + this.$forceUpdate();
542 661 this.dialogClassIVIsible = true;
543 662 console.log(node);
544   - if (parent && parent == 0) this.QuestionClassInfo.ParentId = 0;
  663 + if (parent == 0) {
  664 + this.QuestionClassInfo.ParentId = 0;
  665 + }
545 666 if (node)
546 667 this.QuestionClassInfo.ParentId = node.data.value;
547 668 if (type) this.QuestionClassInfo.ClassType = type;
548 669 else if (node.data.ClassType) this.QuestionClassInfo.ClassType = node.data.ClassType;
549 670  
  671 +
550 672 // alert(this.QuestionClassInfo.ParentId);
551 673 },
552 674 //关闭弹框的事件
... ... @@ -608,10 +730,15 @@
608 730 item.option = String.fromCharCode(64 + parseInt(index + 1));
609 731 });
610 732 },
  733 + handleNodeExpand(a, b, c) {
  734 + this.defaultexpand = [a.id];
  735 + },
611 736 handleNodeClick(val) {
612 737 if (this.loading) return;
613 738 this.parameter.QuestionClassId = val.value;
614 739 this.parameter.pageIndex = 1;
  740 + this.Dataform.QuestionClassId = val.value;
  741 + this.defaultexpand = [val.value];
615 742 this.GetList();
616 743 },
617 744 DelQuestionBankEventHeadler(id) {
... ... @@ -631,22 +758,31 @@
631 758 });
632 759 },
633 760 EditQuestionHeadler() {
634   - let reg = new RegExp('"', "g");
635   - //this.Dataform.subjectContent = JSON.stringify(this.subjectContent).replace(reg, "\"");
636   - this.Dataform.subjectContent = this.subjectContent;
637   - if (typeof this.Dataform.answer != "string")
638   - //判断是否为字符串
639   - this.Dataform.answer = this.Dataform.answer.join(",");
640   - var _this = this;
641   - EditQuestion(this.Dataform).then((res) => {
642   - if (res.data.code == 200) {
643   - _this.GetList();
644   - this.$message(res.data.message);
645   - setTimeout(function () {
646   - _this.dialogsubjectlVisible = false;
647   - }, 10);
  761 + this.$refs['Dataform'].validate((valid) => {
  762 + if (valid) {
  763 +
  764 + let reg = new RegExp('"', "g");
  765 + //this.Dataform.subjectContent = JSON.stringify(this.subjectContent).replace(reg, "\"");
  766 + this.Dataform.subjectContent = this.subjectContent;
  767 + if (typeof this.Dataform.answer != "string")
  768 + //判断是否为字符串
  769 + this.Dataform.answer = this.Dataform.answer.join(",");
  770 + var _this = this;
  771 + EditQuestion(this.Dataform).then((res) => {
  772 + if (res.data.code == 200) {
  773 + _this.GetList();
  774 + this.$message.success(res.data.message);
  775 + setTimeout(function () {
  776 + _this.dialogsubjectlVisible = false;
  777 + }, 10);
  778 + }
  779 + });
  780 + } else {
  781 + console.log('error submit!!');
  782 + return false;
648 783 }
649 784 });
  785 +
650 786 },
651 787 GetList() {
652 788 let _this = this;
... ... @@ -723,7 +859,7 @@
723 859 }
724 860  
725 861 /deep/.el-form-item {
726   - margin-bottom: 5px;
  862 + /* margin-bottom: 5px; */
727 863 }
728 864  
729 865 /deep/.el-radio {
... ...
src/views/TestPaper/ManualTestPaper copy.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <div id="id_test_video" style="width:100%; height:auto;"></div>
  4 + <el-row :gutter="20">
  5 + <el-col :span="6" :style="{'height':contentHeight+'px'}" v-show="TestPaper.FLevelCount && TestPaper.FLevelCount >0">
  6 + <div class="grid-content bg-purple">
  7 + <el-tabs v-model="activeTab" style="padding: 0 20px" :stretch="true">
  8 + <el-tab-pane label="专业类" name="6"></el-tab-pane>
  9 + <el-tab-pane label="测评类" name="1"></el-tab-pane>
  10 + </el-tabs>
  11 + <div style="padding:0 10px">
  12 + <el-input size="small" placeholder="输入关键字搜索" v-model="parameter.keyWord"></el-input>
  13 + </div>
  14 + <div style="padding:10.5px">
  15 + <el-button type="primary" @click="randomSubject" style="width:100%">随机抽题</el-button>
  16 + </div>
  17 +
  18 + <draggable :options="{animation:380,filter:'.unmover'}" group="itxst" v-model="arr1" @end="end1"
  19 + @add="RemoveHere" :move="onMove" class="infinite-list" :style="{'height':contentHeight-80+'px'}"
  20 + infinite-scroll-disabled="disabled" v-infinite-scroll="load" style="overflow:auto">
  21 +
  22 + <li v-for="i in arr1" class="infinite-list-item" :key="i.id" v-if="!classarr.some(o=>o == i.id)">{{
  23 + i.subject }}</li>
  24 + <p v-if="loading" style="text-align: center;color: #cdcdcd;" class="unmover">加载中...</p>
  25 + <p v-if="noMore" style="text-align: center;color: #cdcdcd;" class="unmover">没有更多了</p>
  26 + </draggable>
  27 +
  28 + </div>
  29 + </el-col>
  30 + <el-col :span="10" :style="{'height':contentHeight+'px'}">
  31 + <div class="grid-content bg-purple">
  32 + <div class="areahead">
  33 + <!-- <span v-show="!edit" style="font-weight: bold;">{{ TestPaper.TestPaperTitle }}</span> -->
  34 + <!-- <el-input v-show="edit" style="width: 400px;" v-model="TestPaper.TestPaperTitle"></el-input>
  35 + <i :class="{'el-icon-edit': !edit, 'el-icon-check': edit}" @click="edit = !edit"
  36 + style="margin-left: 5px;cursor: pointer;"></i> -->
  37 + 题目内容
  38 + </div>
  39 +
  40 + <draggable :options="{animation:380}" group="itxst" v-model="arr2" class="infinite-list" @end="end2"
  41 + @add="ComeHere" :style="{'height':contentHeight-60+'px'}" style="overflow:auto;padding-top: 10px;">
  42 + <li v-for="(i,index) in arr2" class="infinite-list-item">
  43 + <label> {{index+1}}. [{{i.subjectName}}]{{ i.subject }}</label>
  44 + <div v-for="item in JSON.parse(i.subjectContent)">
  45 + <p class="option-p">{{item.option}}:{{item.optionContent}}</p>
  46 + </div>
  47 + </li>
  48 + </li>
  49 + </draggable>
  50 +
  51 +
  52 + </div>
  53 + </el-col>
  54 + <el-col :span="8" :style="{'height':contentHeight+'px'}">
  55 + <div class="grid-content bg-purple">
  56 + <div class="areahead">组卷基本信息</div>
  57 + <el-form ref="form" class="testPaper-manager" :rules="rules" :model="TestPaper" label-width="100px">
  58 + <el-form-item label="试卷名称:" prop="TestPaperTitle" required class="el-form-item-custom">
  59 + <el-input v-model="TestPaper.TestPaperTitle"></el-input>
  60 + </el-form-item>
  61 + <el-form-item label="题目数量:" class="el-form-item-custom">
  62 +
  63 + </el-form-item>
  64 + <el-form-item label="题型数量:" class="el-form-item-custom">
  65 + <span style="margin-right: 10px;">单选题:{{TestPaper.SingleNumber}}</span>
  66 + <span style="margin-right: 10px;">多选题:{{TestPaper.MultipleNumber}}</span>
  67 + <span style="margin-right: 10px;">主观题:{{TestPaper.SubjectiveNumber}}</span>
  68 + <span style="margin-right: 10px;">主观题:{{TestPaper.VoiceNumber}}</span>
  69 + </el-form-item>
  70 + <el-form-item label="题目总分:" class="el-form-item-custom">
  71 + {{TestPaper.TotalScore || ''}}
  72 + </el-form-item>
  73 +
  74 + <el-form-item label="工种" prop="UserTypeOfWork" required class="el-form-item-custom"
  75 + style="margin-bottom: 20px !important;width:100%;">
  76 + <el-select v-model="TestPaper.UserTypeOfWork" placeholder="请选择工种" style="width:100%">
  77 + <el-option v-for="item in usertypelist" :label="item.name" :value="item.id"></el-option>
  78 + </el-select>
  79 + </el-form-item>
  80 + <el-form-item label="分类" class="el-form-item-custom" prop="QuestionClassId" >
  81 + <el-cascader class="testpaper-input" v-model="TestPaper.QuestionClassId"
  82 + style="width:100%;margin-bottom: 20px;" :props="{emitPath:false}" :clearable=true
  83 + :options="QuestionClass">
  84 + </el-cascader>
  85 + </el-form-item>
  86 +
  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>
  93 +
  94 + <el-form-item label="有效时间" required>
  95 + <el-form-item prop="date">
  96 + <el-date-picker v-model="TestPaper.date" @change="changetimestartend" type="datetimerange"
  97 + format="yyyy-MM-dd hh:mm:ss" range-separator="至" start-placeholder="开始时间" style="width:100%"
  98 + end-placeholder="结束时间">
  99 + </el-date-picker>
  100 + </el-form-item>
  101 + </el-form-item>
  102 + <el-form-item label="总时长控制" prop="AnswerTime">
  103 + <el-input class="testpaper-input" type="number" placeholder="总时长控制(分钟)" v-model="TestPaper.AnswerTime">
  104 + </el-input>
  105 + </el-form-item>
  106 +
  107 + <el-form-item label="试卷原价:" prop="OriginalPrice" v-show="false">
  108 + <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
  109 + v-model="TestPaper.OriginalPrice" :precision="0">
  110 + <template slot="append">元</template>
  111 + </el-input>
  112 + </el-form-item>
  113 + <el-form-item label="试卷价格:" prop="PresentPrice" v-show="false">
  114 + <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
  115 + v-model="TestPaper.PresentPrice">
  116 + <template slot="append">元</template>
  117 + </el-input>
  118 + </el-form-item>
  119 + <el-form-item label="会员价:" prop="MembershipPrice" v-show="false">
  120 + <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
  121 + v-model="TestPaper.MembershipPrice">
  122 + <template slot="append">元</template>
  123 + </el-input>
  124 + </el-form-item>
  125 + <el-form-item label="试卷简介:">
  126 + <el-input class="testpaper-input" :rows="10" type="textarea" v-model="TestPaper.Describe">
  127 + </el-input>
  128 + </el-form-item>
  129 + <el-button type="primary" style="float: right;" @click="SubmitTestPaper">保存
  130 + </el-button>
  131 + </el-form>
  132 + </div>
  133 + </el-col>
  134 + </el-row>
  135 +
  136 +
  137 +
  138 + <el-dialog title="随机抽题" :visible.sync="dialogTableVisible">
  139 +
  140 + <ul class="random-list">
  141 + <li v-for="(item,index) in randomSubjectList" :key="index">
  142 + <span>试题分类:</span>
  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;">
  152 + </el-input-number>
  153 + <i class="el-icon-remove-outline" @click="changeSubjectCount(-1,index)"
  154 + style="margin-left:10px;color:#f56c6c;"></i>
  155 + <i class="el-icon-circle-plus" @click="changeSubjectCount(1)" style="margin-left:10px;color:#67C23A;"></i>
  156 + </li>
  157 + </ul>
  158 + <div slot="footer">
  159 + <el-button @click="randomCancel">取消</el-button>
  160 + <el-button type="primary" @click="randomSubmit">确定</el-button>
  161 + </div>
  162 + </el-dialog>
  163 +
  164 + </div>
  165 +</template>
  166 +<style lang="scss" scoped>
  167 + .random-list {
  168 + display: flex;
  169 + flex-direction: column;
  170 +
  171 + li {
  172 + margin-bottom: 20px;
  173 + display: flex;
  174 + align-items: center;
  175 +
  176 + [class^="el-icon"] {
  177 + font-size: 24px;
  178 + cursor: pointer;
  179 + }
  180 + }
  181 + }
  182 +</style>
  183 +<script>
  184 + import draggable from "vuedraggable";
  185 + import { PostRandomGetQuestion, getQuestionList, getQuestionClassList } from "@/api/QuestionBank";
  186 + import { GetpaperLevelList } from "@/api/paperLevel";
  187 +
  188 +
  189 + import { GetQuestionClassByType } from "@/api/QuestionClass";
  190 + import { EditTestPaper, GetToplevel } from "@/api/TestPaper";
  191 + import { formatTime } from "@/utils/util";
  192 + import {
  193 + GetTypeSetting
  194 + } from '@/api/user'
  195 + export default {
  196 + //注册draggable组件
  197 + components: {
  198 + draggable,
  199 + },
  200 + data() {
  201 + return {
  202 + randomSubjectList: [
  203 + {
  204 + QuestionClassId: "",
  205 + Count: "",
  206 + },
  207 + {
  208 + QuestionClassId: "",
  209 + Count: "",
  210 + },
  211 + ],
  212 + randomQuestionTypeList: [],
  213 + dynamicValidateForm: {
  214 + domains: [
  215 + {
  216 + value: "",
  217 + },
  218 + ],
  219 + email: "",
  220 + },
  221 + usertypelist: [], //工种
  222 + dialogTableVisible: false,
  223 + loadingType: false,
  224 + activeTab: "6",
  225 + parameter: {
  226 + pageIndex: 0,
  227 + pageSize: 20,
  228 + sort: "id",
  229 + sortOrder: 1,
  230 + keyWord: "",
  231 + QuestionClassId: 6,
  232 + status: 1,
  233 + },
  234 + contentHeight: 0,
  235 + count: 0,
  236 + edit: false,
  237 + arr1: [],
  238 + arr2: [],
  239 + classarr: [],
  240 + moveId: -1,
  241 + TestPaper: {
  242 + TestPaperTitle: "未命名试卷标题",
  243 + TestPaperClassId: 0,
  244 + TotalScore: 0,
  245 + Describe: "",
  246 + SingleNumber: 0,
  247 + MultipleNumber: 0,
  248 + SubjectiveNumber: 0,
  249 + VoiceNumber:0,
  250 + OriginalPrice: "0",
  251 + PresentPrice: "0",
  252 + MembershipPrice: "0",
  253 + QuestionBankIds: [],
  254 + FLevelCount:0
  255 + },
  256 + loading: false,
  257 + rules: {
  258 + OriginalPrice: [
  259 + {
  260 + required: true,
  261 + message: "不能为空",
  262 + },
  263 + ],
  264 + PresentPrice: [
  265 + {
  266 + required: true,
  267 + message: "不能为空",
  268 + },
  269 + ],
  270 + UserTypeOfWork: [
  271 + {
  272 + required: true,
  273 + message: "请选择工种",
  274 + },
  275 + ], QuestionClassId: [
  276 + {
  277 + required: true,
  278 + message: "请选择分类",
  279 + },
  280 + ],date: [
  281 + {
  282 + required: true,
  283 + message: "请选择时间段",
  284 + },
  285 + ],
  286 + TestPaperTitle: [
  287 + {
  288 + required: true,
  289 + message: "请填写试卷名称",
  290 + }
  291 + ],
  292 +
  293 + AnswerTime: [
  294 + {
  295 + required: true,
  296 + message: "请填写试总时长控制",
  297 + },
  298 +
  299 + ],
  300 + },
  301 + QuestionClass: [],
  302 + treeData: [
  303 + {
  304 + value: 0,
  305 + label: "全部",
  306 + },
  307 + ],
  308 + timeout: 0,
  309 + typelist:[],
  310 + levellist:[] //等级
  311 + };
  312 + },
  313 + watch: {
  314 + activeTab() {
  315 + console.log("activeTab watch");
  316 + this.search();
  317 + },
  318 + "parameter.keyWord": {
  319 + handler() {
  320 + clearTimeout(this.timeout);
  321 + this.timeout = setTimeout(() => {
  322 + this.search();
  323 + }, 200);
  324 + },
  325 + },
  326 + },
  327 + computed: {
  328 + noMore() {
  329 + return this.arr1.length >= this.count;
  330 + },
  331 + disabled() {
  332 + return this.loading || this.noMore;
  333 + },
  334 + },
  335 + created() {
  336 + this.getQuestionClassListHeadler();
  337 + this.getQuestionClassListHeadler2();
  338 +
  339 +
  340 + GetTypeSetting({}).then(res => {
  341 + if (res.data) {
  342 + this.usertypelist = res.data || [];
  343 + }
  344 + });
  345 + GetpaperLevelList({pageSize:1000,sortOrder:'asc'}).then(res => {
  346 + if (res.data) {
  347 + this.levellist = res.data.data || [];
  348 + }
  349 + });
  350 + },
  351 + mounted() {
  352 + //计算页面内容区域的高度
  353 + this.contentHeight = window.innerHeight - 90;
  354 + //this.GetList();
  355 + },
  356 + methods: {
  357 + changetype(a,item){
  358 + var type = this.typelist.find(o=>o.id == item.QuestionClassId[item.QuestionClassId.length-1]);
  359 + if(type) {
  360 + item.maxcount = type.subjectCount || 0;
  361 + if(item.Count > item.maxcount) item.Count = item.maxcount;
  362 + }
  363 + },
  364 +
  365 + changelevel(v){
  366 + debugger;
  367 + var type = this.levellist.find(o=>o.f_count == v);
  368 + if(type) {
  369 + this.TestPaper.FLevelTitle = type.title || '';
  370 + }
  371 + },
  372 + getmaxid(item){
  373 + var type = this.randomQuestionTypeList.find(o=>o.id == item.QuestionClassId);
  374 + if(type) return type.subjectCount || 0;
  375 + else return 0;
  376 + },
  377 + getSubTree(id, list) {
  378 + let result = [];
  379 + result = list.filter((t) => t.ParentId == id);
  380 + if (result.length) {
  381 + result = result.map((item) => {
  382 + item.value = item.id;
  383 + item.label = item.ClassificationName;
  384 + item.children = this.getSubTree(item.id, list);
  385 + if (!item.children || !item.children.length) {
  386 + delete item.children;
  387 + }
  388 + return item;
  389 + });
  390 + }
  391 + return result;
  392 + },
  393 + getQuestionClassListHeadler2() {
  394 + let _this = this;
  395 + getQuestionClassList().then((res) => {
  396 + let alllist = res.data.data;
  397 + this.typelist = alllist;
  398 + let list = alllist.filter(t => !t.ParentId);
  399 + list = list.map((t) => {
  400 + t.value = t.id;
  401 + t.label = t.ClassificationName;
  402 + t.children = this.getSubTree(t.id, alllist);
  403 + if (!t.children || !t.children.length) {
  404 + delete t.children;
  405 + }
  406 + return t;
  407 + });
  408 + this.randomQuestionTypeList = list;
  409 + });
  410 + },
  411 + randomCancel() {
  412 + this.dialogTableVisible = false;
  413 + },
  414 + randomSubmit() {
  415 + var list = JSON.parse(JSON.stringify(this.randomSubjectList));
  416 + if (list.findIndex((t) => !t.QuestionClassId || !t.QuestionClassId.length || !t.Count) > -1) {
  417 + this.$message.warning("参数不完整");
  418 + return;
  419 + }
  420 +
  421 + list = list.map(t => {
  422 + t.QuestionClassId = t.QuestionClassId.pop();
  423 + return t;
  424 + });
  425 + PostRandomGetQuestion(list).then((res) => {
  426 + let list = res.data.data;
  427 + this.arr2 = list;
  428 + this.dialogTableVisible = false;
  429 + if (!list.length) {
  430 + this.$message.warning('所选分类没有试题');
  431 + }else{
  432 + this.TestPaper.SingleNumber = list.filter(t=>t.subjectType == 1).length;
  433 + this.TestPaper.MultipleNumber = list.filter(t=>t.subjectType == 2).length;
  434 + this.TestPaper.SubjectiveNumber = list.filter(t=>t.subjectType == 3).length;
  435 + this.TestPaper.VoiceNumber = list.filter(t=>t.subjectType == 4).length;
  436 + }
  437 + });
  438 + },
  439 + changeSubjectCount(type, index) {
  440 + if (type > 0) {
  441 + this.randomSubjectList.push({
  442 + QuestionClassId: "",
  443 + Count: "",
  444 + });
  445 + } else {
  446 + this.randomSubjectList.splice(index, 1);
  447 + }
  448 + },
  449 + randomSubject() {
  450 + this.dialogTableVisible = true;
  451 + },
  452 + submitForm(formName) {
  453 + this.$refs[formName].validate((valid) => {
  454 + if (valid) {
  455 + alert("submit!");
  456 + } else {
  457 + console.log("error submit!!");
  458 + return false;
  459 + }
  460 + });
  461 + },
  462 + resetForm(formName) {
  463 + this.$refs[formName].resetFields();
  464 + },
  465 + removeDomain(item) {
  466 + var index = this.dynamicValidateForm.domains.indexOf(item);
  467 + if (index !== -1) {
  468 + this.dynamicValidateForm.domains.splice(index, 1);
  469 + }
  470 + },
  471 + addDomain() {
  472 + this.dynamicValidateForm.domains.push({
  473 + value: "",
  474 + key: Date.now(),
  475 + });
  476 + },
  477 + changetimestartend(val, aa) {
  478 + this.TestPaper.EffectiveStartTime = formatTime(val[0]);
  479 + this.TestPaper.EffectiveEndTime = formatTime(val[1]);
  480 + },
  481 + search() {
  482 + this.parameter.pageIndex = 1;
  483 + this.parameter.QuestionClassId = Number(this.activeTab);
  484 + this.GetList();
  485 + },
  486 + SubmitTestPaper() {
  487 +
  488 + this.$refs['form'].validate((valid) => {
  489 +
  490 + if(!this.TestPaper.TestPaperTitle){
  491 + this.$notify({
  492 + title: '试卷标题必填!',
  493 + // message: res.data.message,
  494 + type: 'warning'
  495 + });
  496 + return;
  497 + }
  498 + if (valid) {
  499 + this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id);
  500 + var d = this.TestPaper;
  501 + if (this.arr2.length > 0) {
  502 + EditTestPaper(this.TestPaper).then((res) => {
  503 + if (res.data.code == 200) {
  504 + this.$notify({
  505 + title: '组卷成功!',
  506 + // message: res.data.message,
  507 + type: 'success'
  508 + });
  509 + this.$router.push({
  510 + path: '/views/TestPaperList',
  511 + query: {
  512 + }
  513 + })
  514 + } else {
  515 + this.$confirm("组卷失败!", "消息");
  516 + }
  517 + });
  518 + } else {
  519 + this.$confirm("试题没有题目!", "消息");
  520 + }
  521 + } else {
  522 +
  523 + return false;
  524 + }
  525 + });
  526 +
  527 +
  528 +
  529 + },
  530 + load() {
  531 + this.loading = true;
  532 + this.parameter.pageIndex++;
  533 + this.GetList();
  534 + this.loading = false;
  535 + },
  536 + GetList() {
  537 + if (this.parameter.QuestionClassId == "1") {
  538 + if (!this.loadingType)
  539 + GetQuestionClassByType({ ClassType: 2 }).then((res) => {
  540 + var classarr = res.data.data || [];
  541 + this.arr1 = classarr.map((rs) => {
  542 + rs.subject = rs.subjectName = rs.ClassificationName+'('+(rs.subjectCount || 0)+')';
  543 + rs.type = "wd";
  544 + rs.subjectContent = "[]";
  545 + return rs;
  546 + });
  547 + this.loadingType = true;
  548 + });
  549 + } else {
  550 + getQuestionList(this.parameter).then((res) => {
  551 + if (this.parameter.pageIndex == 1) {
  552 + this.arr1 = [];
  553 + }
  554 + res.data.data.rows.forEach((item, i) => {
  555 + this.arr1.push(item);
  556 + });
  557 + this.count = res.data.data.total;
  558 + this.$forceUpdate();
  559 + });
  560 + }
  561 + },
  562 + end1(e) {
  563 + var that = this;
  564 + if (that.arr1.length < 10) {
  565 + this.load();
  566 + }
  567 +
  568 + var items = this.arr2.filter(function (m) {
  569 + return m.id == that.moveId;
  570 + });
  571 +
  572 + //如果左边
  573 + if (items.length < 2) return;
  574 + this.arr2.splice(e.newDraggableIndex, 1);
  575 +
  576 + // SingleNumber:0,
  577 + // MultipleNumber:0,
  578 + // SubjectiveNumber:0,
  579 + },
  580 + //从右边移除到左边
  581 + RemoveHere(e) {
  582 + if (e.item._underlying_vm_.subjectType == 1) {
  583 + this.TestPaper.SingleNumber -= 1;
  584 + }
  585 + if (e.item._underlying_vm_.subjectType == 2) {
  586 + this.TestPaper.MultipleNumber -= 1;
  587 + }
  588 + if (e.item._underlying_vm_.subjectType == 3) {
  589 + this.TestPaper.SubjectiveNumber -= 1;
  590 + }
  591 + if (e.item._underlying_vm_.subjectType == 4) {
  592 + this.TestPaper.VoiceNumber -= 1;
  593 + }
  594 +
  595 + this.TestPaper.TotalScore -= e.item._underlying_vm_.fraction;
  596 + this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id);
  597 + },
  598 + //从左边添加到右边
  599 + ComeHere(e) {
  600 + var d = e.item._underlying_vm_;
  601 + if (e.item._underlying_vm_.subjectType == 1) {
  602 + this.TestPaper.SingleNumber += 1;
  603 + }
  604 + if (e.item._underlying_vm_.subjectType == 2) {
  605 + this.TestPaper.MultipleNumber += 1;
  606 + }
  607 + if (e.item._underlying_vm_.subjectType == 3) {
  608 + this.TestPaper.SubjectiveNumber += 1;
  609 + }
  610 + if (e.item._underlying_vm_.subjectType == 4) {
  611 + this.TestPaper.VoiceNumber += 1;
  612 + }
  613 + this.TestPaper.TotalScore += e.item._underlying_vm_.fraction;
  614 +
  615 + this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id);
  616 +
  617 + if (d.type == "wd") {
  618 + getQuestionList({
  619 + QuestionClassId: d.id,
  620 + PageIndex: 1,
  621 + PageSize: this.TestPaper.FLevelCount || 1000,
  622 + }).then((res) => {
  623 + var data = res.data.data.rows || [];
  624 + data = data.filter(o => !this.arr2.find(d => d.id == o.id));
  625 + this.arr2 = this.arr2.filter((o) => o.type != "wd");
  626 + // this.arr1.splice(this.arr1.findIndex(o=>o.id == d.id),1)
  627 + this.classarr.push(d.id);
  628 + // var test = this.arr2;
  629 + this.arr2.push(...data);
  630 + data.forEach((rs) => {
  631 + if (rs.subjectType == 1) {
  632 + this.TestPaper.SingleNumber += 1;
  633 + }
  634 + if (rs.subjectType == 2) {
  635 + this.TestPaper.MultipleNumber += 1;
  636 + }
  637 + if (rs.subjectType == 3) {
  638 + this.TestPaper.SubjectiveNumber += 1;
  639 + }
  640 + if (rs.subjectType == 4) {
  641 + this.TestPaper.VoiceNumber += 1;
  642 + }
  643 + });
  644 + });
  645 + }
  646 + },
  647 + //右边往左边拖动时的事件
  648 + end2(e) {
  649 + var that = this;
  650 + var items = this.arr1.filter(function (m) {
  651 + return m.id == that.moveId;
  652 + });
  653 + //如果左边
  654 + if (items.length < 2) return;
  655 + this.arr1.splice(e.newDraggableIndex, 1);
  656 + },
  657 + //move回调方法
  658 + onMove(e, originalEvent) {
  659 + //this.moveId = e.relatedContext.element.id;
  660 + return true;
  661 + },
  662 + getQuestionClassListHeadler() {
  663 + let _this = this;
  664 + GetToplevel().then((res) => {
  665 + var gettree = function (titem) {
  666 + titem.children = [];
  667 + let childrenList = res.data.data.filter(
  668 + (u) => u.ParentId == titem.value
  669 + );
  670 + if (childrenList.length == 0) titem.children = undefined;
  671 + res.data.data
  672 + .filter((u) => u.ParentId == titem.value)
  673 + .forEach((item, i) => {
  674 + var model = {
  675 + value: item.id,
  676 + label: item.ClassTitle,
  677 + };
  678 + gettree(model);
  679 + titem.children.push(model);
  680 + });
  681 + };
  682 + res.data.data
  683 + .filter((u) => u.ParentId == 0)
  684 + .forEach((item, i) => {
  685 + var model = {
  686 + value: item.id,
  687 + label: item.ClassTitle,
  688 + };
  689 + gettree(model);
  690 + _this.QuestionClass.push(model);
  691 + _this.treeData.push(model);
  692 + });
  693 + });
  694 + },
  695 + },
  696 + };
  697 +</script>
  698 +
  699 +<style lang="scss" scoped>
  700 + .el-row {
  701 +
  702 + /* margin-bottom: 20px; */
  703 + &:last-child {
  704 + margin-bottom: 0;
  705 + }
  706 + }
  707 +
  708 + .el-col {
  709 + border-radius: 4px;
  710 + }
  711 +
  712 + .bg-purple-dark {
  713 + background: #99a9bf;
  714 + }
  715 +
  716 + .bg-purple {
  717 + background: #efefef;
  718 + }
  719 +
  720 + .bg-purple-light {
  721 + background: #e5e9f2;
  722 + }
  723 +
  724 + .grid-content {
  725 + border-radius: 4px;
  726 + min-height: 36px;
  727 + height: 100%;
  728 + }
  729 +
  730 + .row-bg {
  731 + padding: 10px 0;
  732 + background-color: #f9fafc;
  733 + }
  734 +
  735 + .infinite-list {
  736 + list-style: none;
  737 + margin: 0px;
  738 + padding: 0px;
  739 +
  740 + &::-webkit-scrollbar {
  741 + width: 6px;
  742 + }
  743 +
  744 + //滚动条小方块
  745 + &::-webkit-scrollbar-thumb {
  746 + border-radius: 10px;
  747 + background: #304156;
  748 + }
  749 +
  750 + //滚动条轨道
  751 + &::-webkit-scrollbar-track {
  752 + // border-radius: 10px;
  753 + height: 100px;
  754 + background: #cdcdcd;
  755 + }
  756 +
  757 + .infinite-list-item {
  758 + padding: 10px;
  759 + min-height: 60px;
  760 + width: 95%;
  761 + margin: auto;
  762 + background-color: #fff;
  763 + margin-bottom: 10px;
  764 + border-radius: 5px;
  765 + box-shadow: 0 0 5px #cdcdcd;
  766 +
  767 + &:first-child {
  768 + margin-top: 10px;
  769 + }
  770 + }
  771 + }
  772 +
  773 + .option-p {
  774 + line-height: 15px;
  775 + }
  776 +
  777 + .areahead {
  778 + text-align: center;
  779 + height: 60px;
  780 + line-height: 60px;
  781 + border-bottom: 1px solid #cdcdcd;
  782 + }
  783 +
  784 + .testPaper-manager {
  785 + margin: 10px 20px 10px 10px;
  786 + }
  787 +
  788 + .testPaper-manager .el-form-item {
  789 + margin-bottom: 20px;
  790 + }
  791 +
  792 + .el-form-item-custom {
  793 + margin-bottom: 0px !important;
  794 + }
  795 +
  796 + .testpaper-input {
  797 + //max-width: 400px;
  798 + }
  799 +</style>
0 800 \ No newline at end of file
... ...
src/views/TestPaper/ManualTestPaper.vue
1 1 <template>
2 2 <div class="app-container">
3 3 <div id="id_test_video" style="width:100%; height:auto;"></div>
  4 + <div style="width: 100%;text-align: right;background: #efefef;height: 60px;vertical-align: middle;line-height: 60px;padding-right: 10px;">
  5 +
  6 + <el-button style="margin-top: 12px;" @click="next" v-if="active==1">下一步</el-button>
  7 + <el-button style="margin-top: 12px;z-index:888888888" @click="next" v-if="active==2">编辑基本信息</el-button>
  8 + <el-button type="primary" style="" v-if="active==2" @click="SubmitTestPaper">保存
  9 + </el-button>
  10 + </div>
4 11 <el-row :gutter="20">
5   - <el-col :span="6" :style="{'height':contentHeight+'px'}">
6   - <div class="grid-content bg-purple">
7   - <el-tabs v-model="activeTab" style="padding: 0 20px" :stretch="true">
8   - <el-tab-pane label="专业类" name="6"></el-tab-pane>
9   - <el-tab-pane label="测评类" name="1"></el-tab-pane>
10   - </el-tabs>
11   - <div style="padding:0 10px">
12   - <el-input size="small" placeholder="输入关键字搜索" v-model="parameter.keyWord"></el-input>
13   - </div>
14   - <div style="padding:10.5px">
15   - <el-button type="primary" @click="randomSubject" style="width:100%">随机抽题</el-button>
16   - </div>
17 12  
18   - <draggable :options="{animation:380,filter:'.unmover'}" group="itxst" v-model="arr1" @end="end1"
19   - @add="RemoveHere" :move="onMove" class="infinite-list" :style="{'height':contentHeight-80+'px'}"
20   - infinite-scroll-disabled="disabled" v-infinite-scroll="load" style="overflow:auto">
21 13  
22   - <li v-for="i in arr1" class="infinite-list-item" :key="i.id" v-if="!classarr.some(o=>o == i.id)">{{
23   - i.subject }}</li>
24   - <p v-if="loading" style="text-align: center;color: #cdcdcd;" class="unmover">加载中...</p>
25   - <p v-if="noMore" style="text-align: center;color: #cdcdcd;" class="unmover">没有更多了</p>
26   - </draggable>
  14 + <el-steps :active="active" finish-status="success" simple style="margin:0px 10px">
  15 + <el-step title="基本信息"></el-step>
  16 + <el-step title="组卷"></el-step>
  17 + </el-steps>
27 18  
28   - </div>
29   - </el-col>
30   - <el-col :span="10" :style="{'height':contentHeight+'px'}">
31   - <div class="grid-content bg-purple">
32   - <div class="areahead">
33   - <!-- <span v-show="!edit" style="font-weight: bold;">{{ TestPaper.TestPaperTitle }}</span> -->
34   - <!-- <el-input v-show="edit" style="width: 400px;" v-model="TestPaper.TestPaperTitle"></el-input>
35   - <i :class="{'el-icon-edit': !edit, 'el-icon-check': edit}" @click="edit = !edit"
36   - style="margin-left: 5px;cursor: pointer;"></i> -->
37   - 题目内容
38   - </div>
39 19  
40   - <draggable :options="{animation:380}" group="itxst" v-model="arr2" class="infinite-list" @end="end2"
41   - @add="ComeHere" :style="{'height':contentHeight-60+'px'}" style="overflow:auto;padding-top: 10px;">
42   - <li v-for="(i,index) in arr2" class="infinite-list-item">
43   - <label> {{index+1}}. [{{i.subjectName}}]{{ i.subject }}</label>
44   - <div v-for="item in JSON.parse(i.subjectContent)">
45   - <p class="option-p">{{item.option}}:{{item.optionContent}}</p>
46   - </div>
47   - </li>
48   - </li>
49   - </draggable>
50 20  
  21 + <el-col :span="8" :style="{'height':contentHeight+'px'}" class="jinyongtop">
  22 + <div class="jinyong" v-if="active!=1">
51 23  
52 24 </div>
53   - </el-col>
54   - <el-col :span="8" :style="{'height':contentHeight+'px'}">
55 25 <div class="grid-content bg-purple">
56 26 <div class="areahead">组卷基本信息</div>
57 27 <el-form ref="form" class="testPaper-manager" :rules="rules" :model="TestPaper" label-width="100px">
58   - <el-form-item label="试卷名称:" prop="TestPaperTitle" required class="el-form-item-custom">
59   - <el-input v-model="TestPaper.TestPaperTitle"></el-input>
60   - </el-form-item>
61   - <el-form-item label="题目数量:" class="el-form-item-custom">
62   -
  28 + <el-form-item label="试卷名称:" prop="TestPaperTitle" required class="el-form-item-custom">
  29 + <el-input v-model="TestPaper.TestPaperTitle"></el-input>
63 30 </el-form-item>
  31 + <!-- <el-form-item label="题目数量:" class="el-form-item-custom">
  32 +
  33 + </el-form-item> -->
64 34 <el-form-item label="题型数量:" class="el-form-item-custom">
65 35 <span style="margin-right: 10px;">单选题:{{TestPaper.SingleNumber}}</span>
66 36 <span style="margin-right: 10px;">多选题:{{TestPaper.MultipleNumber}}</span>
... ... @@ -77,15 +47,15 @@
77 47 <el-option v-for="item in usertypelist" :label="item.name" :value="item.id"></el-option>
78 48 </el-select>
79 49 </el-form-item>
80   - <el-form-item label="分类" class="el-form-item-custom" prop="QuestionClassId" >
  50 + <el-form-item label="分类" class="el-form-item-custom" prop="QuestionClassId">
81 51 <el-cascader class="testpaper-input" v-model="TestPaper.QuestionClassId"
82 52 style="width:100%;margin-bottom: 20px;" :props="{emitPath:false}" :clearable=true
83 53 :options="QuestionClass">
84 54 </el-cascader>
85 55 </el-form-item>
86 56  
87   - <el-form-item label="级别" prop="FLevelCount" class="el-form-item-custom"
88   - style="margin-bottom: 20px !important;width:100%;">
  57 + <el-form-item label="级别" prop="FLevelCount" class="el-form-item-custom"
  58 + style="margin-bottom: 20px !important;width:100%;">
89 59 <el-select v-model="TestPaper.FLevelCount" placeholder="请选择级别" @change="changelevel" style="width:100%">
90 60 <el-option v-for="item in levellist" :label="item.title" :value="item.f_count"></el-option>
91 61 </el-select>
... ... @@ -93,7 +63,7 @@
93 63  
94 64 <el-form-item label="有效时间" required>
95 65 <el-form-item prop="date">
96   - <el-date-picker v-model="TestPaper.date" @change="changetimestartend" type="datetimerange"
  66 + <el-date-picker v-model="TestPaper.date" @change="changetimestartend" type="datetimerange"
97 67 format="yyyy-MM-dd hh:mm:ss" range-separator="至" start-placeholder="开始时间" style="width:100%"
98 68 end-placeholder="结束时间">
99 69 </el-date-picker>
... ... @@ -126,24 +96,79 @@
126 96 <el-input class="testpaper-input" :rows="10" type="textarea" v-model="TestPaper.Describe">
127 97 </el-input>
128 98 </el-form-item>
129   - <el-button type="primary" style="float: right;" @click="SubmitTestPaper">保存
130   - </el-button>
  99 +
131 100 </el-form>
132 101 </div>
133 102 </el-col>
  103 + <el-col :span="6" :style="{'height':contentHeight+'px'}" class="jinyongtop">
  104 + <div class="jinyong" v-if="active==1">
  105 +
  106 + </div>
  107 + <div class="grid-content bg-purple">
  108 + <el-tabs v-model="activeTab" style="padding: 0 20px" :stretch="true">
  109 + <el-tab-pane label="专业类" name="6"></el-tab-pane>
  110 + <el-tab-pane label="测评类" name="1"></el-tab-pane>
  111 + </el-tabs>
  112 + <div style="padding:0 10px">
  113 + <el-input size="small" placeholder="输入关键字搜索" v-model="parameter.keyWord"></el-input>
  114 + </div>
  115 + <div style="padding:10.5px">
  116 + <el-button type="primary" @click="randomSubject" style="width:100%">随机抽题</el-button>
  117 + </div>
  118 +
  119 + <draggable :options="{animation:380,filter:'.unmover'}" group="itxst" v-model="arr1" @end="end1"
  120 + @add="RemoveHere" :move="onMove" class="infinite-list" :style="{'height':contentHeight-80+'px'}"
  121 + infinite-scroll-disabled="disabled" v-infinite-scroll="load" style="overflow:auto">
  122 +
  123 + <li v-for="i in arr1" class="infinite-list-item" :key="i.id" v-if="!classarr.some(o=>o == i.id)">{{
  124 + i.subject }}</li>
  125 + <p v-if="loading" style="text-align: center;color: #cdcdcd;" class="unmover">加载中...</p>
  126 + <p v-if="noMore" style="text-align: center;color: #cdcdcd;" class="unmover">没有更多了</p>
  127 + </draggable>
  128 +
  129 + </div>
  130 + </el-col>
  131 + <el-col :span="10" :style="{'height':contentHeight+'px'}" class="jinyongtop">
  132 + <div class="jinyong" v-if="active==1">
  133 +
  134 + </div>
  135 + <div class="grid-content bg-purple">
  136 + <div class="areahead">
  137 + <!-- <span v-show="!edit" style="font-weight: bold;">{{ TestPaper.TestPaperTitle }}</span> -->
  138 + <!-- <el-input v-show="edit" style="width: 400px;" v-model="TestPaper.TestPaperTitle"></el-input>
  139 + <i :class="{'el-icon-edit': !edit, 'el-icon-check': edit}" @click="edit = !edit"
  140 + style="margin-left: 5px;cursor: pointer;"></i> -->
  141 + 题目内容
  142 + </div>
  143 +
  144 + <draggable :options="{animation:380}" group="itxst" v-model="arr2" class="infinite-list" @end="end2"
  145 + @add="ComeHere" :style="{'height':contentHeight-60+'px'}" style="overflow:auto;padding-top: 10px;">
  146 + <li v-for="(i,index) in arr2" class="infinite-list-item">
  147 + <label> {{index+1}}. [{{i.subjectName}}]{{ i.subject }}</label>
  148 + <div v-for="item in JSON.parse(i.subjectContent)">
  149 + <p class="option-p">{{item.option}}:{{item.optionContent}}</p>
  150 + </div>
  151 + </li>
  152 + </li>
  153 + </draggable>
  154 +
  155 +
  156 + </div>
  157 + </el-col>
  158 +
134 159 </el-row>
135 160  
136 161  
137 162  
138   - <el-dialog title="随机抽题" :visible.sync="dialogTableVisible">
  163 + <el-dialog title="随机抽题" :visible.sync="dialogTableVisible" style="margin-left:30%;">
139 164  
140 165 <ul class="random-list">
141 166 <li v-for="(item,index) in randomSubjectList" :key="index">
142 167 <span>试题分类:</span>
143   - <el-cascader :multiple="false" style="flex:1" @change="(a)=>{ changetype(a,item)}" v-model="item.QuestionClassId" :options="randomQuestionTypeList"
144   - clearable>
  168 + <el-cascader :multiple="false" style="flex:1" @change="(a)=>{ changetype(a,item)}"
  169 + v-model="item.QuestionClassId" :options="randomQuestionTypeList" clearable>
145 170 <template slot-scope="{ node, data }">
146   - <span>{{ data.label }}</span>
  171 + <span>{{ data.label }}</span>
147 172 <span v-if="data.subjectCount"> ({{ data.subjectCount || '0' }}) </span>
148 173 </template>
149 174 </el-cascader>
... ... @@ -179,13 +204,31 @@
179 204 }
180 205 }
181 206 }
  207 +
  208 + .jinyongtop {
  209 + position: relative;
  210 + }
  211 +
  212 + .jinyong {
  213 + width: 100%;
  214 + position: absolute;
  215 + width: 100%;
  216 + top: 0px;
  217 + left: opx;
  218 + right: 0;
  219 + left: 0;
  220 + bottom: 0;
  221 + z-index: 8888;
  222 + opacity: 0.1;
  223 + background:black;
  224 + }
182 225 </style>
183 226 <script>
184 227 import draggable from "vuedraggable";
185 228 import { PostRandomGetQuestion, getQuestionList, getQuestionClassList } from "@/api/QuestionBank";
186 229 import { GetpaperLevelList } from "@/api/paperLevel";
187 230  
188   -
  231 +
189 232 import { GetQuestionClassByType } from "@/api/QuestionClass";
190 233 import { EditTestPaper, GetToplevel } from "@/api/TestPaper";
191 234 import { formatTime } from "@/utils/util";
... ... @@ -199,6 +242,7 @@
199 242 },
200 243 data() {
201 244 return {
  245 + active: 1,
202 246 randomSubjectList: [
203 247 {
204 248 QuestionClassId: "",
... ... @@ -246,12 +290,12 @@
246 290 SingleNumber: 0,
247 291 MultipleNumber: 0,
248 292 SubjectiveNumber: 0,
249   - VoiceNumber:0,
  293 + VoiceNumber: 0,
250 294 OriginalPrice: "0",
251 295 PresentPrice: "0",
252 296 MembershipPrice: "0",
253 297 QuestionBankIds: [],
254   - FLevelCount:0
  298 + FLevelCount: null
255 299 },
256 300 loading: false,
257 301 rules: {
... ... @@ -260,7 +304,7 @@
260 304 required: true,
261 305 message: "不能为空",
262 306 },
263   - ],
  307 + ],
264 308 PresentPrice: [
265 309 {
266 310 required: true,
... ... @@ -275,22 +319,39 @@
275 319 ], QuestionClassId: [
276 320 {
277 321 required: true,
278   - message: "请选择分类",
  322 + message: "请选择分类",
  323 + },
  324 + ]
  325 +
  326 + , FLevelCount: [
  327 + {
  328 + required: true,
  329 + message: "请选择级别",
279 330 },
280   - ],date: [
  331 + ]
  332 +
  333 +
  334 +
  335 + , date: [
281 336 {
282 337 required: true,
283   - message: "请选择时间段",
  338 + message: "请选择时间段",
284 339 },
285 340 ],
286 341 TestPaperTitle: [
287 342 {
288 343 required: true,
289   - message: "请填写试卷名称",
290   - },
  344 + message: "请填写试卷名称",
  345 + }
291 346 ],
292 347  
293   -
  348 + AnswerTime: [
  349 + {
  350 + required: true,
  351 + message: "请填写试总时长控制",
  352 + },
  353 +
  354 + ],
294 355 },
295 356 QuestionClass: [],
296 357 treeData: [
... ... @@ -300,8 +361,8 @@
300 361 },
301 362 ],
302 363 timeout: 0,
303   - typelist:[],
304   - levellist:[] //等级
  364 + typelist: [],
  365 + levellist: [] //等级
305 366 };
306 367 },
307 368 watch: {
... ... @@ -335,8 +396,8 @@
335 396 if (res.data) {
336 397 this.usertypelist = res.data || [];
337 398 }
338   - });
339   - GetpaperLevelList({pageSize:1000,sortOrder:'asc'}).then(res => {
  399 + });
  400 + GetpaperLevelList({ pageSize: 1000, sortOrder: 'asc' }).then(res => {
340 401 if (res.data) {
341 402 this.levellist = res.data.data || [];
342 403 }
... ... @@ -348,23 +409,40 @@
348 409 //this.GetList();
349 410 },
350 411 methods: {
351   - changetype(a,item){
352   - var type = this.typelist.find(o=>o.id == item.QuestionClassId[item.QuestionClassId.length-1]);
353   - if(type) {
  412 + next() {
  413 + var _this = this;
  414 + console.log(this.active);
  415 + if(this.active == 1)
  416 + {
  417 + _this.$refs['form'].validate((valid) => {
  418 + if(valid){
  419 + this.active = 2;
  420 + }
  421 + });
  422 + }
  423 + else{
  424 + if (this.active++ >=2) this.active = 1;
  425 +
  426 + }
  427 +
  428 + },
  429 + changetype(a, item) {
  430 + var type = this.typelist.find(o => o.id == item.QuestionClassId[item.QuestionClassId.length - 1]);
  431 + if (type) {
354 432 item.maxcount = type.subjectCount || 0;
355   - if(item.Count > item.maxcount) item.Count = item.maxcount;
  433 + if (item.Count > item.maxcount) item.Count = item.maxcount;
356 434 }
357 435 },
358 436  
359   - changelevel(v){
360   - var type = this.levellist.find(o=>o.f_count == v);
361   - if(type) {
  437 + changelevel(v) {
  438 + var type = this.levellist.find(o => o.f_count == v);
  439 + if (type) {
362 440 this.TestPaper.FLevelTitle = type.title || '';
363 441 }
364 442 },
365   - getmaxid(item){
366   - var type = this.randomQuestionTypeList.find(o=>o.id == item.QuestionClassId);
367   - if(type) return type.subjectCount || 0;
  443 + getmaxid(item) {
  444 + var type = this.randomQuestionTypeList.find(o => o.id == item.QuestionClassId);
  445 + if (type) return type.subjectCount || 0;
368 446 else return 0;
369 447 },
370 448 getSubTree(id, list) {
... ... @@ -421,11 +499,11 @@
421 499 this.dialogTableVisible = false;
422 500 if (!list.length) {
423 501 this.$message.warning('所选分类没有试题');
424   - }else{
425   - this.TestPaper.SingleNumber = list.filter(t=>t.subjectType == 1).length;
426   - this.TestPaper.MultipleNumber = list.filter(t=>t.subjectType == 2).length;
427   - this.TestPaper.SubjectiveNumber = list.filter(t=>t.subjectType == 3).length;
428   - this.TestPaper.VoiceNumber = list.filter(t=>t.subjectType == 4).length;
  502 + } else {
  503 + this.TestPaper.SingleNumber = list.filter(t => t.subjectType == 1).length;
  504 + this.TestPaper.MultipleNumber = list.filter(t => t.subjectType == 2).length;
  505 + this.TestPaper.SubjectiveNumber = list.filter(t => t.subjectType == 3).length;
  506 + this.TestPaper.VoiceNumber = list.filter(t => t.subjectType == 4).length;
429 507 }
430 508 });
431 509 },
... ... @@ -479,21 +557,29 @@
479 557 SubmitTestPaper() {
480 558  
481 559 this.$refs['form'].validate((valid) => {
482   -
483   - if (valid) {
  560 +
  561 + if (!this.TestPaper.TestPaperTitle) {
  562 + this.$notify({
  563 + title: '试卷标题必填!',
  564 + // message: res.data.message,
  565 + type: 'warning'
  566 + });
  567 + return;
  568 + }
  569 + if (valid) {
484 570 this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id);
485 571 var d = this.TestPaper;
486 572 if (this.arr2.length > 0) {
487 573 EditTestPaper(this.TestPaper).then((res) => {
488 574 if (res.data.code == 200) {
489 575 this.$notify({
490   - title: '组卷成功!',
491   - // message: res.data.message,
492   - type: 'success'
493   - });
  576 + title: '组卷成功!',
  577 + // message: res.data.message,
  578 + type: 'success'
  579 + });
494 580 this.$router.push({
495 581 path: '/views/TestPaperList',
496   - query: {
  582 + query: {
497 583 }
498 584 })
499 585 } else {
... ... @@ -524,7 +610,7 @@
524 610 GetQuestionClassByType({ ClassType: 2 }).then((res) => {
525 611 var classarr = res.data.data || [];
526 612 this.arr1 = classarr.map((rs) => {
527   - rs.subject = rs.subjectName = rs.ClassificationName+'('+(rs.subjectCount || 0)+')';
  613 + rs.subject = rs.subjectName = rs.ClassificationName + '(' + (rs.subjectCount || 0) + ')';
528 614 rs.type = "wd";
529 615 rs.subjectContent = "[]";
530 616 return rs;
... ... @@ -576,7 +662,7 @@
576 662 if (e.item._underlying_vm_.subjectType == 4) {
577 663 this.TestPaper.VoiceNumber -= 1;
578 664 }
579   -
  665 +
580 666 this.TestPaper.TotalScore -= e.item._underlying_vm_.fraction;
581 667 this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id);
582 668 },
... ... @@ -603,7 +689,7 @@
603 689 getQuestionList({
604 690 QuestionClassId: d.id,
605 691 PageIndex: 1,
606   - PageSize: this.TestPaper.FLevelCount || 1000,
  692 + PageSize: this.TestPaper.FLevelCount || 1000,
607 693 }).then((res) => {
608 694 var data = res.data.data.rows || [];
609 695 data = data.filter(o => !this.arr2.find(d => d.id == o.id));
... ...
src/views/TestPaper/TestPaperList.vue
... ... @@ -103,11 +103,11 @@
103 103 <el-dialog title="试卷基本信息" :visible.sync="dialogAddTestPaperVIsible" @close="closeClassDialog" width="600px"
104 104 :close-on-click-modal="false">
105 105 <div class="grid-content bg-purple">
106   - <el-form ref="form" class="testPaper-manager" :model="TestPaper" label-width="100px">
107   - <el-form-item label="试卷名称:" class="el-form-item-custom">
  106 + <el-form ref="form" class="testPaper-manager" :rules="rules" :model="TestPaper" label-width="100px">
  107 + <el-form-item label="试卷名称:" class="el-form-item-custom" prop="TestPaperTitle">
108 108 <el-input v-model="TestPaper.TestPaperTitle" placeholder="请输入试卷标题"></el-input>
109 109 </el-form-item>
110   - <el-form-item label="分类" class="el-form-item-custom">
  110 + <el-form-item label="分类" class="el-form-item-custom" prop="TestPaperClassId">
111 111 <el-cascader class="testpaper-input" v-model="TestPaper.TestPaperClassId" style="width:400px;"
112 112 :props="{emitPath:false}" :clearable=true :options="QuestionClass">
113 113 </el-cascader>
... ... @@ -119,22 +119,22 @@
119 119 </el-form-item> -->
120 120  
121 121  
122   - <el-form-item label="工种" class="el-form-item-custom">
  122 + <el-form-item label="工种" class="el-form-item-custom" prop="UserTypeOfWork" >
123 123 <el-select v-model="TestPaper.UserTypeOfWork" placeholder="请选择工种">
124 124 <el-option v-for="item in usertypelist" :label="item.name" :value="item.id"></el-option>
125 125 </el-select>
126 126 </el-form-item>
127 127  
128 128  
129   - <el-form-item label="有效时间" required>
130   - <el-form-item prop="date1">
  129 + <el-form-item label="有效时间" >
  130 + <el-form-item prop="date" required>
131 131 <el-date-picker v-model="TestPaper.date" @change="changetimestartend" type="datetimerange"
132 132 format="yyyy-MM-dd hh:mm:ss" range-separator="至" start-placeholder="开始时间" style="width:100%"
133 133 end-placeholder="结束时间">
134 134 </el-date-picker>
135 135 </el-form-item>
136 136 </el-form-item>
137   - <el-form-item label="总时长控制" :prop="AnswerTime">
  137 + <el-form-item label="总时长控制" :prop="AnswerTime" required>
138 138 <el-input class="testpaper-input" type="number" placeholder="总时长控制(分钟)" v-model="TestPaper.AnswerTime">
139 139 </el-input>
140 140 </el-form-item>
... ... @@ -160,7 +160,7 @@
160 160 <el-input class="testpaper-input" :rows="10" type="textarea" v-model="TestPaper.Describe">
161 161 </el-input>
162 162 </el-form-item>
163   - <el-button type="primary" style="float: right;" @click="SubmitTestPaper">保存
  163 + <el-button type="primary" style="float: right;" @click="SubmitTestPaper">保存1
164 164 </el-button>
165 165 <div style="clear: both;"></div>
166 166 </el-form>
... ... @@ -225,6 +225,56 @@
225 225 label: "全部"
226 226 }],
227 227 value: '',
  228 + rules: {
  229 + OriginalPrice: [
  230 + {
  231 + required: true,
  232 + message: "不能为空",
  233 + },
  234 + ],
  235 + PresentPrice: [
  236 + {
  237 + required: true,
  238 + message: "不能为空",
  239 + },
  240 + ],
  241 + UserTypeOfWork: [
  242 + {
  243 + required: true,
  244 + message: "请选择工种",
  245 + },
  246 + ], QuestionClassId: [
  247 + {
  248 + required: true,
  249 + message: "请选择分类",
  250 + },
  251 + ],date: [
  252 + {
  253 + required: true,
  254 + message: "请选择时间段",
  255 + },
  256 + ],
  257 + TestPaperTitle: [
  258 + {
  259 + required: true,
  260 + message: "请填写试卷名称",
  261 + }
  262 + ],
  263 + TestPaperClassId: [
  264 + {
  265 + required: true,
  266 + message: "分类必须选择",
  267 + },
  268 +
  269 + ],
  270 + AnswerTime: [
  271 + {
  272 + required: true,
  273 + message: "请填写试总时长控制",
  274 + },
  275 +
  276 + ]
  277 + }
228 278 }
229 279 },
230 280 computed: {
... ... @@ -293,7 +343,17 @@
293 343 }
294 344 },
295 345 //添加试卷基本信息
296   - SubmitTestPaper() {
  346 + async SubmitTestPaper() {
  347 + if(!this.TestPaper.TestPaperTitle){
  348 + this.$message.warning('试卷名称不能为空!');
  349 + return;
  350 + }
  351 + if(!this.TestPaper.AnswerTime){
  352 + this.$message.warning('请填写总时长!');
  353 + return;
  354 + }
  355 +
  356 +
297 357 if (this.value == '') {
298 358 EditTestPaper(this.TestPaper).then(res => {
299 359 if (res.data.code == 200) {
... ...
src/views/dashboard/index.vue
... ... @@ -4,10 +4,11 @@
4 4 style="background-color: #334056;border-radius: 5px;color: #FFF;font-size: 16px;padding: 5px 5px 5px 15px;">
5 5 <div style="font-size: 20px;">欢迎使用面试考试系统后台</div>
6 6 </div>
7   - <el-row :gutter="20">
  7 + <el-row :gutter="20" v-if="isAdmin">
8 8 <el-col :span="6">
9 9 <div class="grid-content bg-purple">
10   - <label class="grid-content-number">{{total.PriceNumber/100}}<span style="font-size: 16px;">元</span></label>
  10 + <label class="grid-content-number">{{total.PriceNumber/100}}<span
  11 + style="font-size: 16px;">元</span></label>
11 12 <div>总收益</div>
12 13 </div>
13 14 </el-col>
... ... @@ -30,6 +31,10 @@
30 31 </div>
31 32 </el-col>
32 33 </el-row>
  34 +
  35 + <div style="width:100%">
  36 + <el-image :src="imageUrl" style="width:100%"></el-image>
  37 + </div>
33 38 </div>
34 39 </template>
35 40  
... ... @@ -38,31 +43,41 @@
38 43 GetQuestionTotal,
39 44 GetTestPaperTotal
40 45 } from '@/api/index'
41   - import {
42   - OrderGetPriceNumber
43   - } from '@/api/order.js'
  46 + import {
  47 + OrderGetPriceNumber
  48 + } from '@/api/order.js'
44 49 import {
45 50 mapGetters
46 51 } from 'vuex'
47   -import {
48   - GetUserList
49   - } from '@/api/user'
  52 + import {
  53 + GetUserList
  54 + } from '@/api/user'
  55 +
  56 +
  57 + import {
  58 + GetInfo
  59 + } from '@/api/setting'
  60 +
  61 +
  62 +
50 63 export default {
51 64 name: '安第斯考试系统',
52 65 data() {
53 66 return {
  67 + isAdmin: false,
  68 + imageUrl: '',
54 69 total: {
55 70 questiontotal: 0,
56   - testpapertotal:0,
57   - PriceNumber:0,
58   - Count:0,
  71 + testpapertotal: 0,
  72 + PriceNumber: 0,
  73 + Count: 0,
59 74 },
60   - query: {
61   - UserTypeEnum: 1, //0:管理员,1普通用户
62   - PageIndex: 1,
63   - PageSize: 10,
64   -
65   - }
  75 + query: {
  76 + UserTypeEnum: 1, //0:管理员,1普通用户
  77 + PageIndex: 1,
  78 + PageSize: 10,
  79 +
  80 + }
66 81 }
67 82 },
68 83 computed: {
... ... @@ -74,22 +89,37 @@ import {
74 89  
75 90 },
76 91 mounted() {
  92 + try {
  93 + if (this.$store.state.user.userInfo.UserType == 0) this.isAdmin = true;
  94 + } catch { }
  95 + this.init();
77 96 this.GetTotalHeadler();
78 97 },
79 98 methods: {
  99 + init() {
  100 + var _this = this;
  101 + GetInfo(1).then(res => {
  102 + var d = res.data;
  103 + if (d && d.data) {
  104 + if (d.data.home_images) {
  105 + _this.imageUrl = _this.BASE_URL + d.data.home_images;
  106 + }
  107 + }
  108 + });
  109 + },
80 110 GetTotalHeadler() {
81 111 GetQuestionTotal().then(res => {
82 112 this.total.questiontotal = res.data.data;
83 113 });
84   - GetTestPaperTotal().then(res=>{
  114 + GetTestPaperTotal().then(res => {
85 115 this.total.testpapertotal = res.data.data;
86 116 });
87   - OrderGetPriceNumber().then(res=>{
88   - this.total.PriceNumber = res.data.data;
89   - })
90   - GetUserList(this.query).then(res => {
91   - this.total.Count = res.data.data.total
92   - })
  117 + OrderGetPriceNumber().then(res => {
  118 + this.total.PriceNumber = res.data.data;
  119 + })
  120 + GetUserList(this.query).then(res => {
  121 + this.total.Count = res.data.data.total
  122 + })
93 123 }
94 124 }
95 125 }
... ... @@ -100,48 +130,59 @@ import {
100 130 &-container {
101 131 margin: 30px;
102 132 }
  133 +
103 134 &-text {
104 135 font-size: 30px;
105 136 line-height: 46px;
106 137 }
107 138 }
  139 +
108 140 .el-row {
109 141 margin-bottom: 20px;
110 142 margin-top: 20px;
  143 +
111 144 &:last-child {
112 145 margin-bottom: 0;
113 146 }
114 147 }
  148 +
115 149 .el-col {
116 150 border-radius: 5px;
117 151 }
  152 +
118 153 .bg-purple-dark {
119 154 background: #99a9bf;
120 155 }
  156 +
121 157 .bg-purple {
122 158 background: #d3dce6;
123 159 box-shadow: 0 0 10px #cdcdcd;
124 160 }
  161 +
125 162 .bg-purple-light {
126 163 background: #e5e9f2;
127 164 }
  165 +
128 166 .grid-content {
129 167 border-radius: 5px;
130 168 min-height: 36px;
131 169 text-align: center;
132 170 padding-top: 20px;
133 171 padding-bottom: 20px;
  172 +
134 173 .grid-content-number {
135 174 font-size: 40px;
136 175 color: red;
137 176 }
  177 +
138 178 div {
139 179 font-size: 20px;
140 180 margin-top: 10px;
141 181 }
142 182 }
  183 +
143 184 .row-bg {
144 185 padding: 10px 0;
145 186 background-color: #f9fafc;
146 187 }
147 188 -</style>
  189 +</style>
148 190 \ No newline at end of file
... ...
src/views/login/index.vue
... ... @@ -44,7 +44,7 @@
44 44 import {
45 45 validUsername
46 46 } from '@/utils/validate'
47   -
  47 + // import axios from 'axios'
48 48 export default {
49 49 name: 'Login',
50 50 data() {
... ... @@ -86,14 +86,16 @@
86 86 },
87 87 watch: {
88 88 $route: {
89   - handler: function(route) {
  89 + handler: function (route) {
90 90 this.redirect = route.query && route.query.redirect
91   - if(this.redirect.indexOf('404') !=-1)
92   - this.redirect = this.redirect.replace('404','dashboard')
  91 + // if (this.redirect.indexOf('404') != -1)
  92 + // this.redirect = this.redirect.replace('404', 'dashboard')
93 93 },
94 94 immediate: true
95 95 }
96 96 },
  97 + created() {
  98 + },
97 99 methods: {
98 100 showPwd() {
99 101 if (this.passwordType === 'password') {
... ... @@ -107,12 +109,11 @@
107 109 },
108 110 handleLogin() {
109 111 this.$refs.loginForm.validate(valid => {
110   -
111 112 if (valid) {
112 113 this.loading = true
113 114 this.$store.dispatch('user/login', this.loginForm).then(() => {
114 115 this.$router.push({
115   - path: '/'
  116 + path: this.redirect || '/'
116 117 })
117 118 this.loading = false
118 119 }).catch((ret) => {
... ... @@ -132,20 +133,23 @@
132 133 <style lang="scss">
133 134 /* 修复input 背景不协调 和光标变色 */
134 135 /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
135   - $bg:#283443;
136   - $light_gray:#fff;
  136 + $bg: #283443;
  137 + $light_gray: #fff;
137 138 $cursor: #fff;
  139 +
138 140 @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
139 141 .login-container .el-input input {
140 142 color: $cursor;
141 143 }
142 144 }
  145 +
143 146 /* reset element-ui css */
144 147 .login-container {
145 148 .el-input {
146 149 display: inline-block;
147 150 height: 47px;
148 151 width: 85%;
  152 +
149 153 input {
150 154 background: transparent;
151 155 border: 0px;
... ... @@ -155,12 +159,14 @@
155 159 color: $light_gray;
156 160 height: 47px;
157 161 caret-color: $cursor;
  162 +
158 163 &:-webkit-autofill {
159 164 box-shadow: 0 0 0px 1000px $bg inset !important;
160   - -webkit-text-fill-color: $cursor !important;
  165 + -webkit-text-fill-color: $cursor !important;
161 166 }
162 167 }
163 168 }
  169 +
164 170 .el-form-item {
165 171 border: 1px solid rgba(255, 255, 255, 0.1);
166 172 background: rgba(0, 0, 0, 0.1);
... ... @@ -171,14 +177,16 @@
171 177 </style>
172 178  
173 179 <style lang="scss" scoped>
174   - $bg:#2d3a4b;
175   - $dark_gray:#889aa4;
176   - $light_gray:#eee;
  180 + $bg: #2d3a4b;
  181 + $dark_gray: #889aa4;
  182 + $light_gray: #eee;
  183 +
177 184 .login-container {
178 185 min-height: 100%;
179 186 width: 100%;
180 187 background-color: $bg;
181 188 overflow: hidden;
  189 +
182 190 .login-form {
183 191 position: relative;
184 192 width: 520px;
... ... @@ -187,16 +195,19 @@
187 195 margin: 0 auto;
188 196 overflow: hidden;
189 197 }
  198 +
190 199 .tips {
191 200 font-size: 14px;
192 201 color: #fff;
193 202 margin-bottom: 10px;
  203 +
194 204 span {
195 205 &:first-of-type {
196 206 margin-right: 16px;
197 207 }
198 208 }
199 209 }
  210 +
200 211 .svg-container {
201 212 padding: 6px 5px 6px 15px;
202 213 color: $dark_gray;
... ... @@ -204,8 +215,10 @@
204 215 width: 30px;
205 216 display: inline-block;
206 217 }
  218 +
207 219 .title-container {
208 220 position: relative;
  221 +
209 222 .title {
210 223 font-size: 26px;
211 224 color: $light_gray;
... ... @@ -214,6 +227,7 @@
214 227 font-weight: bold;
215 228 }
216 229 }
  230 +
217 231 .show-pwd {
218 232 position: absolute;
219 233 right: 10px;
... ... @@ -224,4 +238,4 @@
224 238 user-select: none;
225 239 }
226 240 }
227 241 -</style>
  242 +</style>
228 243 \ No newline at end of file
... ...
src/views/settings/index.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-form ref="form" :model="form" label-width="180px" style="width:50%">
  4 + <el-form-item label="系统名称">
  5 + <el-input v-model="form.name"></el-input>
  6 + </el-form-item>
  7 +
  8 +
  9 + <el-form-item label="首页广告图">
  10 + <el-upload :headers="{Authorization:token}"
  11 + class="avatar-uploader"
  12 + :action="BASE_URL + '/api/upload/single'"
  13 + :show-file-list="false"
  14 + :on-success="handleAvatarSuccess"
  15 + >
  16 + <img v-if="imageUrl" :src="imageUrl" class="avatar">
  17 + <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  18 + </el-upload>
  19 +
  20 + </el-form-item>
  21 +
  22 +
  23 +
  24 + <!-- <el-form-item label="活动区域">
  25 + <el-select v-model="form.region" placeholder="请选择活动区域">
  26 + <el-option label="区域一" value="shanghai"></el-option>
  27 + <el-option label="区域二" value="beijing"></el-option>
  28 + </el-select>
  29 + </el-form-item>
  30 + <el-form-item label="活动时间">
  31 + <el-col :span="11">
  32 + <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
  33 + </el-col>
  34 + <el-col class="line" :span="2">-</el-col>
  35 + <el-col :span="11">
  36 + <el-time-picker placeholder="选择时间" v-model="form.date2" style="width: 100%;"></el-time-picker>
  37 + </el-col>
  38 + </el-form-item>
  39 + <el-form-item label="即时配送">
  40 + <el-switch v-model="form.delivery"></el-switch>
  41 + </el-form-item>
  42 + <el-form-item label="活动性质">
  43 + <el-checkbox-group v-model="form.type">
  44 + <el-checkbox label="美食/餐厅线上活动" name="type"></el-checkbox>
  45 + <el-checkbox label="地推活动" name="type"></el-checkbox>
  46 + <el-checkbox label="线下主题活动" name="type"></el-checkbox>
  47 + <el-checkbox label="单纯品牌曝光" name="type"></el-checkbox>
  48 + </el-checkbox-group>
  49 + </el-form-item>
  50 + <el-form-item label="特殊资源">
  51 + <el-radio-group v-model="form.resource">
  52 + <el-radio label="线上品牌商赞助"></el-radio>
  53 + <el-radio label="线下场地免费"></el-radio>
  54 + </el-radio-group>
  55 + </el-form-item>
  56 + <el-form-item label="活动形式">
  57 + <el-input type="textarea" v-model="form.desc"></el-input>
  58 + </el-form-item> -->
  59 + <el-form-item>
  60 + <el-button type="primary" @click="submitForm">保存</el-button>
  61 +
  62 + </el-form-item>
  63 + </el-form>
  64 + </div>
  65 +</template>
  66 +
  67 +<script>
  68 +
  69 +
  70 +import {
  71 + getToken
  72 + } from '@/utils/auth'
  73 +
  74 +
  75 +
  76 + import {
  77 + GetInfo,
  78 + Update
  79 + } from '@/api/setting'
  80 + export default {
  81 + data() {
  82 +
  83 + return {
  84 + token:getToken(),
  85 + imageUrl:'',
  86 + form: {
  87 + pass: '',
  88 + checkPass: '',
  89 + },
  90 + rules: {
  91 + }
  92 + };
  93 + },
  94 + created(){
  95 + var _this = this;
  96 + GetInfo(1).then(res=>{
  97 + _this.form = res.data.data;
  98 + if(_this.form.home_images){
  99 + _this.imageUrl = _this.BASE_URL+_this.form.home_images;
  100 + }
  101 + });
  102 + },
  103 +
  104 + methods: {
  105 + handleAvatarSuccess(res, file) {
  106 + this.imageUrl = URL.createObjectURL(file.raw);
  107 + this.form.home_images = res.data.data.src || '';
  108 + },
  109 +
  110 + submitForm(formName) {
  111 + Update(this.form).then(res=>{
  112 + if (res.data.code==200) {
  113 + this.$notify({
  114 + title: '提示',
  115 + message: '保存成功',
  116 + type: 'success',
  117 + duration: 1000
  118 + })
  119 +
  120 + }
  121 + })
  122 + },
  123 + resetForm(formName) {
  124 + this.$refs[formName].resetFields();
  125 + }
  126 + }
  127 + }
  128 +</script>
  129 +
  130 +<style>
  131 +</style>
  132 +<style scoped>
  133 + .avatar-uploader .el-upload {
  134 + border: 1px dashed #d9d9d9;
  135 + border-radius: 6px;
  136 + cursor: pointer;
  137 + position: relative;
  138 + overflow: hidden;
  139 + }
  140 + .avatar-uploader .el-upload:hover {
  141 + border-color: #409EFF;
  142 + }
  143 + .avatar-uploader-icon {
  144 + font-size: 28px;
  145 + color: #8c939d;
  146 + width: 178px;
  147 + height: 178px;
  148 + line-height: 178px;
  149 + text-align: center;
  150 + }
  151 + .avatar {
  152 + width: 178px;
  153 + height: 178px;
  154 + display: block;
  155 + }
  156 +</style>
0 157 \ No newline at end of file
... ...
src/views/user/loglist.vue 0 → 100644
  1 +<template>
  2 + <div style="padding: 10px">
  3 + <div class="seetingsDiv" style="">
  4 + <div class="flex" style="margin-top: 10px">
  5 + <el-form :inline="true" class="demo-form-inline">
  6 + <el-form-item label="关键字">
  7 + <el-input placeholder="输入关键字搜索" v-model="queryModel.keyword"></el-input>
  8 + </el-form-item>
  9 + <el-form-item label="用户">
  10 + <el-input placeholder="用户" v-model="queryModel.username"></el-input>
  11 + </el-form-item>
  12 + <el-form-item label="日志类型">
  13 + <el-select v-model="queryModel.type" placeholder="日志类型">
  14 + <el-option label="全部" value=""></el-option>
  15 + <el-option label="用户操作" value="1"></el-option>
  16 + <el-option label="系统操作" value="2"></el-option>
  17 + <el-option label="系统信息" value="3"></el-option>
  18 + <el-option label="底层信息" value="4"></el-option>
  19 + </el-select>
  20 + </el-form-item>
  21 +
  22 + </el-form>
  23 + <el-button type="success" @click="search">搜索</el-button>
  24 + </div>
  25 + <div class="flex align-center" style="margin-top: 10px">
  26 +
  27 +
  28 + </div>
  29 + </div>
  30 + <div class="main-box">
  31 + <el-table ref="mytable" :data="table_data" style="width: 100%;height:calc(100vh - 260px)" border
  32 + @selection-change="handleSelectionChange">
  33 + <el-table-column v-if="radio" type="index" width="50"></el-table-column>
  34 + <el-table-column v-if="selection" type="selection" width="55"></el-table-column>
  35 +
  36 +
  37 + <el-table-column align="center" width="120" label="类型">
  38 + <template slot-scope="scope">
  39 +
  40 + <div>
  41 + <span v-if="scope.row.TypeEnum == 1">用户操作</span>
  42 + <span v-else-if="scope.row.TypeEnum == 2">系统操作</span>
  43 + <span v-else-if="scope.row.TypeEnum == 3">系统信息</span>
  44 + <span v-else-if="scope.row.TypeEnum == 4">底层信息</span>
  45 + <span v-else >系统</span>
  46 + </div>
  47 + </template>
  48 + </el-table-column>
  49 + <el-table-column align="center" v-for="(item, index, key) in table_columns" :width="item.width"
  50 + :item="item" :key="key" :index="index" :label="item.label">
  51 + <template slot-scope="scope">
  52 + <el-input v-if="scope.row.edit" size="small" v-model="scope.row[item.prop]"
  53 + :placeholder="'请输入' + item.label">
  54 + </el-input>
  55 + <span v-if="!scope.row.edit">{{ scope.row[item.prop] }}</span>
  56 + </template>
  57 + </el-table-column>
  58 +
  59 + </el-table>
  60 +
  61 + </div>
  62 +
  63 + <div class="page-box">
  64 + <el-pagination background layout="prev, pager, next" :total="queryResult.totalCount"
  65 + @current-change="currentchange">
  66 + </el-pagination>
  67 + </div>
  68 + </div>
  69 +</template>
  70 +
  71 +<script>
  72 + import {
  73 + GetList,
  74 + } from "@/api/log";
  75 + import { formatTime } from '@/utils/util'
  76 + export default {
  77 + data() {
  78 + return {
  79 + currentFilePath: "",
  80 + queryResult: {},
  81 + queryModel: {
  82 + pageIndex: 1,
  83 + pageSize: 20,
  84 + },
  85 + query: {},
  86 + new_date_json: {}, //数据结构
  87 + multipleSelection: [], //复选框,数据
  88 + is_edit: true, //是否可编辑
  89 + is_delete: true, //是否可删除
  90 + selection: true, //是否需要复选框
  91 + radio: false, //单选变色
  92 + space_color: true, //隔行变色
  93 + //表头信息
  94 + table_columns: [{
  95 + prop: "OperationTitle",
  96 + label: "内容",
  97 + width: "350",
  98 + },
  99 + {
  100 + prop: "OperationIp",
  101 + label: "操作IP地址",
  102 + width: "180",
  103 + },
  104 + {
  105 + prop: "OperationTime",
  106 + label: "操作时间",
  107 + width: "180",
  108 + },
  109 + {
  110 + prop: "UserName",
  111 + label: "操作用户",
  112 + width: "120",
  113 + },
  114 + {
  115 + prop: "Describe",
  116 + label: "详细内容",
  117 + },
  118 + ],
  119 + //表格数据
  120 + table_data: [],
  121 + dialogVisible: false,
  122 + form: {},
  123 + };
  124 + },
  125 + methods: {
  126 +
  127 + search() {
  128 + this.queryModel.pageIndex = 1;
  129 + this.getList();
  130 + },
  131 + getList() {
  132 + GetList(this.queryModel).then((res) => {
  133 + this.queryResult = res.data;
  134 +
  135 + this.table_data = res.data.data.map(t => {
  136 + t.OperationTime = formatTime(t.OperationTime, 'yyyy-MM-dd');
  137 + return t;
  138 + });
  139 + });
  140 + },
  141 + //隔行变色
  142 + tableRowClassName() {
  143 + //选取DOM节点
  144 + var trs = this.$refs.mytable.$el
  145 + .getElementsByTagName("tbody")[0]
  146 + .getElementsByTagName("tr");
  147 + for (var i in trs) {
  148 + if (i % 2 == 0) {
  149 + //当隔行变色未true时改变颜色
  150 + if (this.space_color) {
  151 + trs[i].style.backgroundColor = "#f0f9eb";
  152 + } else {
  153 + trs[i].style.backgroundColor = "";
  154 + }
  155 + }
  156 + }
  157 + },
  158 +
  159 + //多选框
  160 + handleSelectionChange(val) {
  161 + this.multipleSelection = val;
  162 + console.log("selection:", this.multipleSelection);
  163 + },
  164 +
  165 +
  166 + //删除
  167 + handleDelete(index, row) {
  168 + console.log(index, row);
  169 +
  170 + this.table_data.splice(index, 1);
  171 + UserInfo_Delete(row.id);
  172 + this.$message({
  173 + message: "删除成功!",
  174 + type: "success",
  175 + });
  176 + },
  177 +
  178 + currentchange(page) {
  179 + this.queryModel.pageIndex = page;
  180 + this.getList();
  181 + },
  182 + },
  183 + created() {
  184 + this.getList();
  185 + },
  186 + mounted: function () {
  187 + //确保方法在页面渲染后调用
  188 + this.$nextTick(function () {
  189 + /////方法
  190 + this.tableRowClassName();
  191 + });
  192 + },
  193 + watch: {
  194 + space_color: function () {
  195 + //监听数据变化
  196 + this.$nextTick(function () {
  197 + /////方法
  198 + this.tableRowClassName();
  199 + });
  200 + },
  201 + table_data: function () {
  202 + //监听数据变化f
  203 + this.$nextTick(function () {
  204 + /////方法
  205 + this.tableRowClassName();
  206 + });
  207 + },
  208 + },
  209 + };
  210 +</script>
  211 +<style scoped>
  212 + /deep/.el-table__body-wrapper {
  213 + height: 92% !important;
  214 + }
  215 +</style>
  216 +<style lang="scss" scoped>
  217 + .main-box {
  218 + display: flex;
  219 + }
  220 +
  221 + .doc-view {
  222 + margin-left: 10px;
  223 + width: 100%;
  224 + flex: 1;
  225 + overflow: hidden;
  226 + }
  227 +
  228 + .el-table__expanded-cell {
  229 + padding: 10px;
  230 + }
  231 +
  232 + .demo-table-expand {
  233 + display: flex;
  234 + justify-content: space-between;
  235 + flex-wrap: wrap;
  236 + box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  237 + padding: 20px;
  238 + border-radius: 10px;
  239 + }
  240 +
  241 + .demo-table-expand .el-form-item {
  242 + margin-bottom: 10px !important;
  243 + min-width: 20%;
  244 + max-width: 50%;
  245 + }
  246 +
  247 + .demo-form-inline {
  248 + display: flex;
  249 + align-items: center;
  250 + }
  251 +
  252 + .el-form--inline .el-form-item {
  253 + display: flex;
  254 + align-items: center;
  255 + margin-bottom: 0;
  256 + }
  257 +
  258 + .aligin-center {
  259 + align-items: center;
  260 + }
  261 +
  262 + .seetingsDiv {
  263 + display: flex;
  264 + align-items: center;
  265 + width: 100%;
  266 + height: auto;
  267 + padding: 30px;
  268 + background: #efefef;
  269 + /* line-height: 60px; */
  270 + border-radius: 5px;
  271 + box-shadow: 0 0 5px #cdcdcd;
  272 + justify-content: space-between;
  273 + flex-wrap: wrap;
  274 + margin-bottom: 20px;
  275 + }
  276 +
  277 + .seetingsDiv button {
  278 + height: 40px;
  279 + background-color: #304156;
  280 + border: 0px;
  281 + margin-left: 10px;
  282 + box-shadow: 0 0 5px #cdcdcd;
  283 + float: none;
  284 + margin-right: 10px;
  285 + margin-top: 0;
  286 + }
  287 +</style>
0 288 \ No newline at end of file
... ...
src/views/user/picuserimport.vue
... ... @@ -84,16 +84,16 @@
84 84 <el-dialog
85 85 title="编辑信息"
86 86 :visible.sync="dialogVisible"
87   - width="60%"
  87 + width="80%"
88 88 :before-close="handleClose"
89 89 :close-on-click-modal="false">
90   - <div style="height: 800px;">
91   - <div class="el-col-14" v-if="currentFilePath">
92   - <iframe style="width: 100%; height:800px"
  90 + <div style="height:fit-content;overflow-y:auto;">
  91 + <div class="el-col-14" v-if="currentFilePath" >
  92 + <iframe style="width: 100%; height:auto;min-height:800px;"
93 93 v-if="currentFilePath && currentFilePath.indexOf('.pdf') !=-1" :src="
94 94 BASE_ROOT_DOMAIN + '/pdf/web/viewer.html?file=' + BASE_ROOT_DOMAIN +currentFilePath
95 95 " frameborder="0"></iframe>
96   - <el-image v-else :src=" BASE_ROOT_DOMAIN +currentFilePath">
  96 + <el-image v-else :src=" BASE_ROOT_DOMAIN +currentFilePath" :fit="'cover '">
97 97  
98 98 </el-image>
99 99 </div>
... ...
src/views/user/rolelist.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <div class="seetingsDiv" style="">
  4 + <el-button type="primary" @click="dialogClassIVIsible=true">添加
  5 + </el-button>
  6 + </div>
  7 + <el-table :data="userList" id="QuestionTable" border
  8 + style="width: 100%;border-radius: 5px;box-shadow: 0 0 10px #efefef;margin-top: 10px;" :stripe='true'>
  9 + <el-table-column type="index" prop="date" width="50" align="center"></el-table-column>
  10 + <el-table-column prop="date" label="角色名称">
  11 + <template slot-scope="scope">
  12 + <span>{{ scope.row.name }}</span>
  13 + </template>
  14 + </el-table-column>
  15 +
  16 +
  17 +
  18 + <el-table-column fixed="right" label="操作" width="150">
  19 + <template slot-scope="scope">
  20 + <el-dropdown @command="(e)=>{handleCommand(e,scope.row)}">
  21 + <span class="el-dropdown-link">
  22 + 操作<i class="el-icon-arrow-down el-icon--right"></i>
  23 + </span>
  24 + <template #dropdown>
  25 + <el-dropdown-menu>
  26 + <el-dropdown-item command="update">编辑</el-dropdown-item>
  27 + <el-dropdown-item command="del" v-if="scope.row.username!='admin'">删除</el-dropdown-item>
  28 + </el-dropdown-menu>
  29 + </template>
  30 + </el-dropdown>
  31 + </template>
  32 + </el-table-column>
  33 + </el-table>
  34 + <el-pagination background @current-change="currentchange"
  35 + style="position:static;bottom: 3px;text-align: center;margin-top: 5px;" :page-size="this.query.PageSize"
  36 + layout="total,prev, pager, next" :total="Count">
  37 + </el-pagination>
  38 + <el-dialog :title="title" :visible.sync="dialogClassIVIsible" @close="closeClassDialog" width="450"
  39 + :close-on-click-modal="false">
  40 + <el-form ref="adminUserInfo" :rules="rules" :model="adminUserInfo" label-width="90px" style="margin-left: 40px;">
  41 + <el-form-item label="名称" prop="name">
  42 + <el-input v-model="adminUserInfo.name " placeholder="名称" style="width: 40%;"></el-input>
  43 + </el-form-item>
  44 + <el-form-item label="角色人员">
  45 + <el-transfer v-model="value" filterable :titles="['待选人员', '已选人员']" :data="data"></el-transfer>
  46 + </el-form-item>
  47 + <el-form-item label="权限" style="margin-top: 40px;">
  48 + <el-tree ref="tree" :check-strictly="true" :data="data1" show-checkbox node-key="id" default-expand-all :props="defaultProps">
  49 + </el-tree>
  50 + </el-form-item>
  51 +
  52 + <el-form-item style="text-align: right;">
  53 + <el-button @click="dialogClassIVIsible=false">取消</el-button>
  54 + <el-button type="primary" @click="submitForm('adminUserInfo')">{{buttonText}}</el-button>
  55 + </el-form-item>
  56 + </el-form>
  57 +
  58 + <div style="clear: both;"></div>
  59 + </el-dialog>
  60 +
  61 +
  62 + <el-dialog title="修改密码" :visible.sync="dialogClassIVIsibleT" @close="closeClassDialogT" width="450"
  63 + :close-on-click-modal="false">
  64 + <el-form :model="ruleForm" status-icon :rules="rulesT" ref="ruleForm" label-width="100px" class="demo-ruleForm"
  65 + style="width: 320px;">
  66 + <el-form-item label="密码" prop="Password">
  67 + <el-input type="password" v-model="ruleForm.Password" autocomplete="off"></el-input>
  68 + </el-form-item>
  69 + <el-form-item label="确认密码" prop="checkPass">
  70 + <el-input type="password" v-model="ruleForm.checkPass" autocomplete="off"></el-input>
  71 + </el-form-item>
  72 +
  73 + <el-form-item>
  74 + <el-button type="primary" @click="submitFormT('ruleForm')">提交</el-button>
  75 + <el-button @click="resetForm('ruleForm')">重置</el-button>
  76 + </el-form-item>
  77 + </el-form>
  78 +
  79 + <div style="clear: both;"></div>
  80 + </el-dialog>
  81 +
  82 + </div>
  83 +</template>
  84 +
  85 +<script>
  86 + import {
  87 + GetInfo,
  88 + GetUserList,
  89 + UsersCreate,
  90 + UsersUpdate,
  91 + UsersDelete,
  92 + GetMenue
  93 + } from '@/api/role'
  94 + import { GetUserListByAdminSimple } from '@/api/user'
  95 +
  96 + import {
  97 + formatTime
  98 + } from '@/utils/util.js'
  99 + export default {
  100 + data() {
  101 + var checkPhone = (rule, value, callback) => {
  102 + const phoneReg = /^1[3|4|5|7|8][0-9]{9}$/
  103 + if (!value) {
  104 + return callback(new Error('电话号码不能为空'))
  105 + }
  106 + setTimeout(() => {
  107 + if (!Number.isInteger(+value)) {
  108 + callback(new Error('请输入数字值'))
  109 + } else {
  110 + if (phoneReg.test(value)) {
  111 + callback()
  112 + } else {
  113 + callback(new Error('电话号码格式不正确'))
  114 + }
  115 + }
  116 + }, 100)
  117 + }
  118 +
  119 +
  120 + var validatePass = (rule, value, callback) => {
  121 + if (value === '') {
  122 + callback(new Error('请输入密码'));
  123 + } else {
  124 + if (this.ruleForm.checkPass !== '') {
  125 + this.$refs.ruleForm.validateField('checkPass');
  126 + }
  127 + callback();
  128 + }
  129 + };
  130 + var validatePass2 = (rule, value, callback) => {
  131 + if (value === '') {
  132 + callback(new Error('请再次输入密码'));
  133 + } else if (value !== this.ruleForm.Password) {
  134 + callback(new Error('两次输入密码不一致!'));
  135 + } else {
  136 + callback();
  137 + }
  138 + };
  139 +
  140 +
  141 + return {
  142 + data1: [],
  143 + data: [],
  144 + value: [],
  145 +
  146 + defaultProps: {
  147 + children: 'children',
  148 + label: 'label'
  149 + },
  150 +
  151 + title: '添加',
  152 + buttonText: '立即创建',
  153 + userList: [],
  154 + dialogClassIVIsible: false,
  155 + dialogClassIVIsibleT: false,
  156 + adminUserInfo: {
  157 + username: "",
  158 + password: "",
  159 + // type: 4,
  160 + fullName: "",
  161 + // remark: "",
  162 + phone: "",
  163 + // sex: "",
  164 + // card: "",
  165 + // address: "",
  166 + // birthday: "",
  167 + status: 1,
  168 + },
  169 +
  170 + ruleForm: {
  171 + UserId: 0,
  172 + Password: '',
  173 + checkPass: '',
  174 + },
  175 + rulesT: {
  176 + Password: [
  177 + { validator: validatePass, trigger: 'blur' }
  178 + ],
  179 + checkPass: [
  180 + { validator: validatePass2, trigger: 'blur' }
  181 + ],
  182 + },
  183 + Count: 0,
  184 + query: {
  185 + UserTypeEnum: 5, //0:管理员,1普通用户
  186 + PageIndex: 1,
  187 + PageSize: 10,
  188 +
  189 + },
  190 + rules: {
  191 + name: [{
  192 + required: true,
  193 + message: '请输入管理员名称',
  194 + trigger: 'blur'
  195 + }],
  196 + phone: [{
  197 + required: true,
  198 + message: '请输入联系方式',
  199 + trigger: 'blur'
  200 + }],
  201 + username: [{
  202 + required: true,
  203 + message: '请输入登录账号',
  204 + trigger: 'blur'
  205 + }],
  206 + phone: [{
  207 + required: true,
  208 + trigger: 'blur',
  209 + validator: checkPhone
  210 + }],
  211 + password: [{
  212 + required: true,
  213 + message: '请输入密码',
  214 + trigger: 'blur'
  215 + }],
  216 + type: [{
  217 + required: true,
  218 + message: '请输选择用户类型',
  219 + trigger: 'blur'
  220 + }]
  221 + }
  222 + }
  223 + },
  224 + created() {
  225 + this.GetUser()
  226 + this.getadmin()
  227 + this.getmenue()
  228 + },
  229 + methods: {
  230 + getmenue() {
  231 + GetMenue().then(res => {
  232 + this.data1 = res.data || [];
  233 + });
  234 + },
  235 + getadmin() {
  236 + GetUserListByAdminSimple({ PageSize: 9999999, PageIndex: 1, Sort: [{ Field: 'id', Type: 0 }] }).then(res => {
  237 + var data = res.data || [];
  238 + data = data.map(o => {
  239 + return {
  240 + key: o.id,
  241 + label: o.fullName
  242 + }
  243 + });
  244 + this.data = data;
  245 + });
  246 +
  247 + },
  248 + closeClassDialog() {
  249 + this.title = '添加'
  250 + this.buttonText = '立即创建'
  251 + this.GetUser();
  252 + },
  253 + submitForm(formName) {
  254 + var _this = this;
  255 + this.$refs[formName].validate((valid) => {
  256 + if (valid) {
  257 + _this.adminUserInfo.users = _this.value || [];
  258 + _this.adminUserInfo.menues = _this.$refs.tree.getCheckedKeys() || [];
  259 + if (_this.title == '添加') {
  260 + _this.adminUserInfo.addTime = formatTime(new Date(), 'yyyy-MM-dd HH:mm:ss')
  261 + UsersCreate(this.adminUserInfo).then(res => {
  262 + this.$notify({
  263 + title: '成功',
  264 + message: res.data.message,
  265 + type: 'success'
  266 + });
  267 + // this.$confirm(res.data.message, '消息')
  268 + _this.dialogClassIVIsible = false
  269 + })
  270 + } else {
  271 + _this.adminUserInfo.updateTime = formatTime(new Date(), 'yyyy-MM-dd HH:mm:ss')
  272 + _this.adminUserInfo.status = 1
  273 + UsersUpdate(this.adminUserInfo).then(res => {
  274 + _this.$notify({
  275 + title: '成功',
  276 + message: res.data.message,
  277 + type: 'success'
  278 + });
  279 + // this.$confirm(res.data.message, '消息')
  280 + _this.dialogClassIVIsible = false
  281 + })
  282 + }
  283 +
  284 + } else {
  285 + return false;
  286 + }
  287 + });
  288 + },
  289 +
  290 + GetUser() {
  291 + GetUserList(this.query).then(res => {
  292 + this.userList = res.data.data
  293 + this.Count = res.data.total
  294 + })
  295 + },
  296 + currentchange(page) {
  297 + this.query.PageIndex = page;
  298 + this.GetUser();
  299 + },
  300 + closeClassDialogT() {
  301 + this.dialogClassIVIsibleT = false
  302 + },
  303 +
  304 +
  305 + submitFormT(formName) {
  306 + this.$refs[formName].validate((valid) => {
  307 + if (valid) {
  308 + var postdata = Object.assign({}, this.ruleForm);
  309 + if (this.ruleForm.id) {
  310 + UsersUpdate(postdata).then(res => {
  311 + if (res.data.code == 200) {
  312 + this.$notify({
  313 + title: 'Success',
  314 + message: res.data.message,
  315 + type: 'success',
  316 + duration: 1000
  317 + })
  318 + this.dialogClassIVIsibleT = false
  319 +
  320 + }
  321 + })
  322 + }
  323 + else {
  324 + UsersCreate(postdata).then(res => {
  325 + if (res.data.code == 200) {
  326 + this.$notify({
  327 + title: 'Success',
  328 + message: res.data.message,
  329 + type: 'success',
  330 + duration: 1000
  331 + })
  332 + this.dialogClassIVIsibleT = false
  333 +
  334 + }
  335 + })
  336 + }
  337 +
  338 + } else {
  339 + console.log('error submit!!');
  340 + return false;
  341 + }
  342 + });
  343 + },
  344 + resetForm(formName) {
  345 + this.$refs[formName].resetFields();
  346 + },
  347 + handleCommand(value, val) {
  348 + let that = this;
  349 + if (value == "update") {
  350 + GetInfo(val.id).then(res => {
  351 + that.dialogClassIVIsible = true;
  352 + that.$nextTick(function () {
  353 +
  354 + that.adminUserInfo = res.data.data
  355 + if (res.data.data.users) {
  356 + that.value = res.data.data.users;
  357 + }
  358 + if (res.data.data.menues) {
  359 + that.$refs.tree.setCheckedKeys(res.data.data.menues);
  360 + }
  361 + that.title = '编辑信息'
  362 + that.buttonText = '保存'
  363 +
  364 + });
  365 +
  366 + });
  367 + }
  368 + if (value == 'updatePassword') {
  369 + that.ruleForm.UserId = val.id
  370 + ththatis.dialogClassIVIsibleT = true
  371 + }
  372 + if (value == "del") {
  373 + that.$confirm('确定删除该管理员?', '消息', {
  374 + confirmButtonText: '确认',
  375 + cancelButtonText: '取消',
  376 + callback: (action) => {
  377 + if (action == "confirm") {
  378 + UsersDelete({
  379 + ids: val.id
  380 + }).then(res => {
  381 + if (res.data.code == 200) {
  382 + that.$notify({
  383 + title: '成功',
  384 + message: res.data.message,
  385 + type: 'success'
  386 + });
  387 + that.GetUser();
  388 + }
  389 + });
  390 + }
  391 + },
  392 + })
  393 +
  394 + }
  395 + },
  396 + }
  397 + }
  398 +</script>
  399 +
  400 +<style scoped>
  401 + .seetingsDiv {
  402 + width: 100%;
  403 + height: 60px;
  404 + background: #efefef;
  405 + border-radius: 5px;
  406 + box-shadow: 0 0 5px #cdcdcd;
  407 + }
  408 +
  409 + .seetingsDiv button {
  410 + background-color: #304156;
  411 + border: 0px;
  412 + margin-left: 10px;
  413 + box-shadow: 0 0 5px #cdcdcd;
  414 + float: left;
  415 + margin-top: 12px;
  416 + margin-right: 10px;
  417 + }
  418 +</style>
0 419 \ No newline at end of file
... ...
src/views/user/userlist.vue
... ... @@ -38,8 +38,9 @@
38 38  
39 39 <el-form-item>
40 40 <el-button type="success" @click="search">搜索</el-button>
41   - <el-button type="success" @click="handleEdit({})">添加</el-button>
42   - <el-button type="success" @click="resetSearch">重置</el-button>
  41 + <el-button type="success" @click="handleEdit(-1)">添加</el-button>
  42 + <el-button type="danger" @click="handleChangeCat">批量修改分类</el-button>
  43 + <el-button type="success" @click="resetSearch">重置</el-button>
43 44 <el-button type="primary" @click="handleInviteInterview()">邀请面试(线上)</el-button>
44 45  
45 46 <el-button type="primary" @click="handleCompanyInterview()">邀请面试(现场)</el-button>
... ... @@ -49,9 +50,11 @@
49 50  
50 51 <div class="flex aligin-center">
51 52 <el-link :href="BASE_URL + '/temp/用户导入模板.xlsx'" target="_blank" type="primary">下载模板</el-link>
52   - <el-upload class="upload-demo" action="/api/Account/importUsers?UserClassId=0" multiple :limit="1"
  53 + <el-upload class="upload-demo"
  54 + :action="'/api/Account/importUsers?UserClassId='+ (query.userClassId || 0)" multiple :limit="1"
53 55 :show-file-list="false" :on-exceed="handleExceed" :on-success="handleSuccess" :file-list="fileList">
54 56 <el-button size="small" type="primary">导入用户</el-button>
  57 +
55 58 </el-upload>
56 59 </div>
57 60 </div>
... ... @@ -206,8 +209,8 @@
206 209 <el-select v-model="form.TestPaperId" placeholder="请选择试卷" style="width: 80%">
207 210 <el-option :value="item.id" :label="'['+item.id+']'+item.TestPaperTitle"
208 211 v-for="item in testpaperlist">{{
209   - "[" + item.id + "] " + (item.TestPaperTitle || "未命名")
210   - }}</el-option>
  212 + "[" + item.id + "] " + (item.TestPaperTitle || "未命名")
  213 + }}</el-option>
211 214 </el-select>
212 215 </el-form-item>
213 216 <el-form-item label="允许测评次数">
... ... @@ -335,7 +338,8 @@
335 338 <el-input v-model="adminUserInfo.Weight" placeholder="请输入体重" style="width: 70%"></el-input>
336 339 </el-form-item>
337 340 <el-form-item label="毕业专业" class="el-form-itemByWang" prop="GraduationMajor">
338   - <el-input v-model="adminUserInfo.GraduationMajor" placeholder="请输入毕业专业" style="width: 70%"></el-input>
  341 + <el-input v-model="adminUserInfo.GraduationMajor" placeholder="请输入毕业专业" style="width: 70%">
  342 + </el-input>
339 343 </el-form-item>
340 344 <el-form-item label="毕业院校" class="el-form-itemByWang" prop="GraduationSchool">
341 345 <el-input v-model="adminUserInfo.GraduationSchool" placeholder="请输入毕业院校" style="width: 70%">
... ... @@ -349,10 +353,12 @@
349 353 </el-input>
350 354 </el-form-item>
351 355 <el-form-item label="毕业时间" class="el-form-itemByWang" prop="GraduationTime">
352   - <el-input v-model="adminUserInfo.GraduationTime" placeholder="请输入毕业时间" style="width: 70%"></el-input>
  356 + <el-input v-model="adminUserInfo.GraduationTime" placeholder="请输入毕业时间" style="width: 70%">
  357 + </el-input>
353 358 </el-form-item>
354 359 <el-form-item label="计算机等级" class="el-form-itemByWang" prop="ComputerGrade">
355   - <el-input v-model="adminUserInfo.ComputerGrade" placeholder="请输入计算机等级" style="width: 70%"></el-input>
  360 + <el-input v-model="adminUserInfo.ComputerGrade" placeholder="请输入计算机等级" style="width: 70%">
  361 + </el-input>
356 362 </el-form-item>
357 363 <el-form-item label="血型" class="el-form-itemByWang" prop="BloodType">
358 364 <el-input v-model="adminUserInfo.BloodType" placeholder="请输入血型" style="width: 70%"></el-input>
... ... @@ -361,7 +367,8 @@
361 367 <el-input v-model="adminUserInfo.Qualification" placeholder="请输入资格证书" style="width: 70%"></el-input>
362 368 </el-form-item>
363 369 <el-form-item label="就业意向城市" class="el-form-itemByWang" prop="IntendedCity">
364   - <el-input v-model="adminUserInfo.IntendedCity" placeholder="请输入就业意向城市" style="width: 70%"></el-input>
  370 + <el-input v-model="adminUserInfo.IntendedCity" placeholder="请输入就业意向城市" style="width: 70%">
  371 + </el-input>
365 372 </el-form-item>
366 373 <el-form-item label="户籍所在地" class="el-form-itemByWang" prop="RegisteredResidence">
367 374 <el-input v-model="adminUserInfo.RegisteredResidence" placeholder="请输入户籍所在地" style="width: 70%">
... ... @@ -375,15 +382,14 @@
375 382 <el-button @click="dialogClassIVIsible = false">取消</el-button>
376 383 <el-button type="primary" @click="submitForm('adminUserInfo')">提交</el-button>
377 384 </div>
378   -
379 385 </el-form>
380 386  
381 387 <div style="clear: both"></div>
382 388 </el-dialog>
383 389  
384 390  
385   - <el-dialog title="邀请公司面试" :visible.sync="dialogCompany">
386   - <el-form ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
  391 + <el-dialog title="邀请线下面试" :visible.sync="dialogCompany">
  392 + <el-form ref="dynamicValidateForm" :rules="rules" label-width="100px" class="demo-dynamic">
387 393 <div v-for="(user, index) in sendUserList">
388 394  
389 395 <el-descriptions class="margin-top" :title="(index+1)" :column="2" border>
... ... @@ -437,16 +443,12 @@
437 443 </el-descriptions-item>
438 444 <el-descriptions-item>
439 445 <template slot="label">
440   -
441   - 面试时间范围
  446 + <label style="color:#F56C6C">*</label> 面试时间范围
442 447 </template>
443   - <!-- <el-date-picker v-model="user.date" type="datetimerange" range-separator="至" start-placeholder="开始日期"
444   - end-placeholder="最后日期">
445   - </el-date-picker> -->
446   -
447 448 <el-date-picker v-model="user.startTime" type="datetime" placeholder="选择日期时间"
448 449 :picker-options="pickerOptions">
449 450 </el-date-picker>
  451 +
450 452 </el-descriptions-item>
451 453 <el-descriptions-item>
452 454 <template slot="label">
... ... @@ -490,6 +492,24 @@
490 492 </div>
491 493 </el-dialog>
492 494  
  495 + <el-dialog title="批量设置分类" :visible.sync="dialogsubjectlVisibleSetCat" @close="closeDialogCat" width="800px"
  496 + :close-on-click-modal="false">
  497 + <el-form ref="Dataform" :model="Dataform" label-width="60px">
  498 +
  499 + <el-form-item label="分类" style="padding-top: 5px">
  500 + <el-select v-model="QuestionClassId" placeholder="请选择">
  501 + <el-option :key="0" :value="0" label="请选择"></el-option>
  502 + <el-option v-for="item in data" :key="item.id" :label="item.ClassTitle" :value="item.id"
  503 + v-if="item.id !=0">
  504 + </el-option>
  505 + </el-select>
  506 + </el-form-item>
  507 +
  508 + </el-form>
  509 + <el-button @click="handleSetClass" style="margin: 10px 0 0 0; float: right" type="primary">确定
  510 + </el-button>
  511 + <div style="clear: both"></div>
  512 + </el-dialog>
493 513  
494 514 </div>
495 515 </template>
... ... @@ -499,11 +519,13 @@
499 519 ImportUserByExcel,
500 520 GetUserList,
501 521 UsersUpdate,
  522 + UsersCreate,
502 523 AddInvitationAnswerMultiple,
503 524 AddInvitationCompanyMultiple,
504 525 UsersDelete,
505 526 ChangeTags,
506   - SelectPhoneBool
  527 + SelectPhoneBool,
  528 + ChangeClass
507 529 } from "@/api/user";
508 530 import {
509 531 GetUserClassList,
... ... @@ -529,6 +551,8 @@
529 551 return time.getTime() < Date.now() - 8.64e7;
530 552 }
531 553 },
  554 + QuestionClassId: 0,
  555 + dialogsubjectlVisibleSetCat: false,
532 556 loading: false,
533 557 dialogFormVisible: false,
534 558 dialogTableVisible: false,
... ... @@ -550,6 +574,13 @@
550 574 temp: {
551 575 ParentId: 0,
552 576 },
  577 + rules: {
  578 + startTime: [
  579 + { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
  580 + ],
  581 +
  582 + }
  583 + ,
553 584 mzlist: [
554 585 "汉族",
555 586 "蒙古族 ",
... ... @@ -606,37 +637,37 @@
606 637 "基诺族",
607 638 ],
608 639 processlist: [{
609   - label: '入库',
610   - value: 0
611   - },
612   - {
613   - label: '面试邀请',
614   - value: 1
615   - },
616   - {
617   - label: '正在面试',
618   - value: 2
619   - },
620   - {
621   - label: '面试完成',
622   - value: 3
623   - },
624   - {
625   - label: '公司面试',
626   - value: 4
627   - },
628   - {
629   - label: '已录用',
630   - value: 5
631   - },
632   - {
633   - label: '未录用',
634   - value: 9
635   - },
636   - {
637   - label: '禁用',
638   - value: 11
639   - },
  640 + label: '入库',
  641 + value: 0
  642 + },
  643 + {
  644 + label: '面试邀请',
  645 + value: 1
  646 + },
  647 + {
  648 + label: '正在面试',
  649 + value: 2
  650 + },
  651 + {
  652 + label: '面试完成',
  653 + value: 3
  654 + },
  655 + {
  656 + label: '线下面试',
  657 + value: 4
  658 + },
  659 + {
  660 + label: '已录用',
  661 + value: 5
  662 + },
  663 + {
  664 + label: '未录用',
  665 + value: 9
  666 + },
  667 + {
  668 + label: '禁用',
  669 + value: 11
  670 + },
640 671 ],
641 672 type: "1",
642 673 dialogClassIVIsible: false,
... ... @@ -669,14 +700,43 @@
669 700 this.loadTree();
670 701 },
671 702 methods: {
  703 + handleChangeCat() {
  704 + var rows = this.$refs.userList.selection;
  705 + if (!rows || rows.length < 1) {
  706 + this.$message.warning('至少选择一项进行操作!');
  707 + return;
  708 + }
  709 + this.dialogsubjectlVisibleSetCat = true;
  710 + },
  711 +
  712 + closeDialogCat() {
  713 + this.QuestionClassId = 0;
  714 + this.dialogsubjectlVisibleSetCat = false;
  715 + },
  716 + handleSetClass() {
  717 + var rows = this.$refs.userList.selection;
  718 + if (!this.QuestionClassId || this.QuestionClassId < 1) {
  719 + this.$message.warning('至少选择一个分类进行操作!');
  720 + return;
  721 + }
  722 + this.$confirm("确认批量修改分类吗?", "提示", {
  723 + confirmButtonText: "确定",
  724 + cancelButtonText: "取消",
  725 + type: "warning",
  726 + }).then(() => {
  727 + ChangeClass(rows.map(o => o.id).join(','), this.QuestionClassId).then((o) => {
  728 + this.$message.success("修改成功");
  729 + this.GetUser();
  730 + this.dialogsubjectlVisibleSetCat = false;
  731 + });
  732 + });
  733 + },
672 734 handleToResume(item) {
673 735 window.open(
674   - `http://interview-admin.7-stars.com.cn/Appraise/${item.sex == 1?'malestaff':'femalestaff'}/${item.id}.html`,
  736 + `http://interview-admin.7-stars.com.cn/Appraise/${item.sex == 1 ? 'malestaff' : 'femalestaff'}/${item.id}.html`,
675 737 '_blank');
676 738 },
677 739 handleClose(tag, row) {
678   -
679   -
680 740 this.$confirm('确定删除该标签吗?', '消息', {
681 741 confirmButtonText: '确认',
682 742 cancelButtonText: '取消',
... ... @@ -727,7 +787,7 @@
727 787 },
728 788 //点击进度
729 789 processEvent(row) {
730   - // if(row.procesName == '公司面试')
  790 + // if(row.procesName == '线下面试')
731 791 // {
732 792 // this.
733 793 // }
... ... @@ -737,6 +797,7 @@
737 797 this.$message.success("没有邀请对象!");
738 798 return;
739 799 }
  800 + var isrequire = true;
740 801 var senddata = [];
741 802 this.sendUserList.forEach(o => {
742 803 // var item = Object.assign({},o);
... ... @@ -749,6 +810,7 @@
749 810 // start = o.date[0];
750 811 // end = o.date[1];
751 812 // }
  813 + if (!o.startTime) isrequire = false;
752 814 senddata.push({
753 815 userId: o.id,
754 816 startTime: formatTime(o.startTime),
... ... @@ -758,6 +820,11 @@
758 820 msgBody: o.msgBody || ''
759 821 });
760 822 });
  823 + if (!isrequire) {
  824 + this.$message.warning("请选择面试时间范围!");
  825 + return;
  826 + }
  827 +
761 828 AddInvitationCompanyMultiple(senddata).then(res => {
762 829 if (res.data.code == 200) {
763 830 this.$message.success("邀请成功");
... ... @@ -779,10 +846,20 @@
779 846  
780 847  
781 848 handleDelete(item, index) {
782   - this.userList.splice(index, 1);
783   - UsersDelete({
784   - ids: item.id
  849 + this.$confirm("确认删除该人才信息吗?", "提示", {
  850 + confirmButtonText: "确定",
  851 + cancelButtonText: "取消",
  852 + type: "warning",
  853 + }).then(() => {
  854 +
  855 + this.userList.splice(index, 1);
  856 + UsersDelete({
  857 + ids: item.id
  858 + });
785 859 });
  860 +
  861 +
  862 +
786 863 },
787 864 handleWatchLive(item) {
788 865 console.log("handleWatchLive", item);
... ... @@ -804,17 +881,35 @@
804 881 } else {
805 882 UsersUpdate(formData).then((res) => {
806 883 this.GetUser();
  884 +
  885 + this.dialogClassIVIsible = false;
807 886 console.log(res);
808 887 });
809 888 }
810 889 });
811 890 }
812   - this.dialogClassIVIsible = false;
  891 + else {
  892 + UsersCreate(formData).then(res => {
  893 + if (res.data.success) {
  894 + this.GetUser();
  895 + this.$message.success("添加成功");
  896 +
  897 + this.dialogClassIVIsible = false;
  898 + }
  899 + else
  900 + this.$message.error(res.data.message || "添加失败!");
  901 +
  902 + });
  903 + }
813 904 },
814 905 handleEdit(data) {
815 906 this.dialogClassIVIsible = true;
816 907 console.log(" -_- ", data);
817   - this.adminUserInfo = data;
  908 + if (data == -1) {
  909 + this.adminUserInfo = { userClassId: (this.query.userClassId || 0) };
  910 + }
  911 + else
  912 + this.adminUserInfo = data;
818 913 },
819 914 handleTestHitory(row) {
820 915 GetHistoryList({
... ... @@ -848,23 +943,23 @@
848 943 this.$confirm(
849 944 "确认向选择的" + ids.length + "个用户发送试卷连接进行测试吗?",
850 945 "提示消息", {
851   - confirmButtonText: "确认",
852   - cancelButtonText: "取消",
853   - callback: (action) => {
854   - if (action == "confirm") {
855   - AddInvitationAnswerMultiple(postData).then((res) => {
856   - if (res.data.code == 200) {
857   - this.$message.success("发送成功");
858   - this.form = {};
859   - this.dialogFormVisible = false;
860   - this.GetUser();
861   - } else {
862   - this.$message.error("发送失败");
863   - }
864   - });
865   - }
866   - },
867   - }
  946 + confirmButtonText: "确认",
  947 + cancelButtonText: "取消",
  948 + callback: (action) => {
  949 + if (action == "confirm") {
  950 + AddInvitationAnswerMultiple(postData).then((res) => {
  951 + if (res.data.code == 200) {
  952 + this.$message.success("发送成功");
  953 + this.form = {};
  954 + this.dialogFormVisible = false;
  955 + this.GetUser();
  956 + } else {
  957 + this.$message.error("发送失败");
  958 + }
  959 + });
  960 + }
  961 + },
  962 + }
868 963 );
869 964 },
870 965 forceTestPaper() {
... ... @@ -913,8 +1008,8 @@
913 1008 console.log(val);
914 1009 this.selectedList = val;
915 1010 },
916   - handleExceed() {},
917   - ImportUser() {},
  1011 + handleExceed() { },
  1012 + ImportUser() { },
918 1013  
919 1014 showcontent(c, row) {
920 1015 this.showbody = c;
... ... @@ -964,7 +1059,11 @@
964 1059 GetUserClassList({
965 1060 ParentId: 0
966 1061 }).then((res) => {
967   - this.data = res.data.data;
  1062 + var list = [{ id: 0, ClassTitle: '全部' }];
  1063 +
  1064 + list.push(...res.data.data || []);
  1065 +
  1066 + this.data = list;
968 1067 });
969 1068 },
970 1069 filterNode(value, data) {
... ... @@ -1014,6 +1113,7 @@
1014 1113 },
1015 1114 handleNodeClick(data, checked, indeterminate) {
1016 1115 this.query.userClassId = data.id;
  1116 +
1017 1117 this.temp = data;
1018 1118 this.GetUser();
1019 1119 },
... ... @@ -1060,6 +1160,7 @@
1060 1160 box-shadow: 0 0 5px #cdcdcd;
1061 1161 justify-content: space-between;
1062 1162 }
  1163 +
1063 1164 .seetingsDiv button {
1064 1165 height: 40px;
1065 1166 background-color: #304156;
... ... @@ -1069,9 +1170,11 @@
1069 1170 float: none;
1070 1171 margin-right: 10px;
1071 1172 }
  1173 +
1072 1174 .el-tag+.el-tag {
1073 1175 margin-left: 10px;
1074 1176 }
  1177 +
1075 1178 .button-new-tag {
1076 1179 margin-left: 10px;
1077 1180 height: 32px;
... ... @@ -1079,13 +1182,15 @@
1079 1182 padding-top: 0;
1080 1183 padding-bottom: 0;
1081 1184 }
  1185 +
1082 1186 .input-new-tag {
1083 1187 width: 90px;
1084 1188 margin-left: 10px;
1085 1189 vertical-align: bottom;
1086 1190 }
  1191 +
1087 1192 .el-form-itemByWang {
1088 1193 width: 33% !important;
1089 1194 float: left !important;
1090 1195 }
1091 1196 -</style>
  1197 +</style>
1092 1198 \ No newline at end of file
... ...