Browse Source

Signed-off-by: ljx <809268652@qq.com>

ljx 1 year ago
parent
commit
924efefe5e

+ 1 - 1
.env.development

@@ -1,4 +1,4 @@
 NODE_ENV=development
 
-VUE_APP_HOME_API_URL=http://127.0.0.1:8080/base-in-back-end
+VUE_APP_HOME_API_URL=http://114.116.114.108:19090/base-in-back-end
 VUE_APP_QUESTION_BANK_API_URL=http://112.74.105.17:20003/question-bank

+ 1 - 1
.env.production

@@ -1,4 +1,4 @@
 NODE_ENV=production
 
-VUE_APP_HOME_API_URL=http://127.0.0.1:8080/base-in-back-end
+VUE_APP_HOME_API_URL=http://114.116.114.108:19090/base-in-back-end
 VUE_QUESTION_BANK_API_URL=http://112.74.105.17:20003/question-bank

File diff suppressed because it is too large
+ 78 - 0
base-in-back-end.sql


+ 198 - 110
public/index.html

@@ -1,112 +1,200 @@
 <!DOCTYPE html>
 <html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title>基础前端</title>
-
-    <style>
-      html, body, h1, h2, h3, h4, h5, h6, div, dl, dt, dd, ul, ol, li, p, blockquote, pre, hr, figure, table, caption, th, td, form, fieldset, legend, input, button, textarea, menu {
-        margin: 0;
-        padding: 0;
-      }
-
-      header, footer, section, article, aside, nav, hgroup, address, figure, figcaption, menu, details {
-        display: block;
-      }
-
-      table {
-        border-collapse: collapse;
-        border-spacing: 0;
-      }
-
-      caption, th {
-        text-align: left;
-        font-weight: normal;
-      }
-
-      html, body, fieldset, img, iframe, abbr {
-        border: 0;
-      }
-
-      i, cite, em, var, address, dfn {
-        font-style: normal;
-      }
-
-      [hidefocus], summary {
-        outline: 0;
-      }
-
-      li {
-        list-style: none;
-      }
-
-      h1, h2, h3, h4, h5, h6, small {
-        font-size: 100%;
-      }
-
-      sup, sub {
-        font-size: 83%;
-      }
-
-      pre, code, kbd, samp {
-        font-family: inherit;
-      }
-
-      q:before, q:after {
-        content: none;
-      }
-
-      textarea {
-        overflow: auto;
-        resize: none;
-      }
-
-      label, summary {
-        cursor: default;
-      }
-
-      a, button {
-        cursor: pointer;
-      }
-
-      h1, h2, h3, h4, h5, h6, em, strong, b {
-        font-weight: normal;
-      }
-
-      del, ins, u, s, a, a:hover {
-        text-decoration: none;
-      }
-
-      body, textarea, input, button, select, keygen, legend {
-        font: 14px/1em 'microsoft yahei', arial;
-        color: #333;
-        outline: 0;
-      }
-
-      body {
-        background: #fff;
-      }
-
-      a {
-        line-height: 24px;
-      }
-
-      a {
-        color: #333;
-      }
-
-      a:hover {
-      }
-    </style>
-  </head>
-  <body>
-    <noscript>
-      <strong>We're sorry but hello doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
-</html>
+
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width,initial-scale=1.0">
+  <link rel="icon" href="<%= BASE_URL %>moon.jpg">
+  <title>原动力大数据管理系统</title>
+
+  <style>
+    html,
+    body,
+    h1,
+    h2,
+    h3,
+    h4,
+    h5,
+    h6,
+    div,
+    dl,
+    dt,
+    dd,
+    ul,
+    ol,
+    li,
+    p,
+    blockquote,
+    pre,
+    hr,
+    figure,
+    table,
+    caption,
+    th,
+    td,
+    form,
+    fieldset,
+    legend,
+    input,
+    button,
+    textarea,
+    menu {
+      margin: 0;
+      padding: 0;
+    }
+
+    header,
+    footer,
+    section,
+    article,
+    aside,
+    nav,
+    hgroup,
+    address,
+    figure,
+    figcaption,
+    menu,
+    details {
+      display: block;
+    }
+
+    table {
+      border-collapse: collapse;
+      border-spacing: 0;
+    }
+
+    caption,
+    th {
+      text-align: left;
+      font-weight: normal;
+    }
+
+    html,
+    body,
+    fieldset,
+    img,
+    iframe,
+    abbr {
+      border: 0;
+    }
+
+    i,
+    cite,
+    em,
+    var,
+    address,
+    dfn {
+      font-style: normal;
+    }
+
+    [hidefocus],
+    summary {
+      outline: 0;
+    }
+
+    li {
+      list-style: none;
+    }
+
+    h1,
+    h2,
+    h3,
+    h4,
+    h5,
+    h6,
+    small {
+      font-size: 100%;
+    }
+
+    sup,
+    sub {
+      font-size: 83%;
+    }
+
+    pre,
+    code,
+    kbd,
+    samp {
+      font-family: inherit;
+    }
+
+    q:before,
+    q:after {
+      content: none;
+    }
+
+    textarea {
+      overflow: auto;
+      resize: none;
+    }
+
+    label,
+    summary {
+      cursor: default;
+    }
+
+    a,
+    button {
+      cursor: pointer;
+    }
+
+    h1,
+    h2,
+    h3,
+    h4,
+    h5,
+    h6,
+    em,
+    strong,
+    b {
+      font-weight: normal;
+    }
+
+    del,
+    ins,
+    u,
+    s,
+    a,
+    a:hover {
+      text-decoration: none;
+    }
+
+    body,
+    textarea,
+    input,
+    button,
+    select,
+    keygen,
+    legend {
+      font: 14px/1em 'microsoft yahei', arial;
+      color: #333;
+      outline: 0;
+    }
+
+    body {
+      background: #fff;
+    }
+
+    a {
+      line-height: 24px;
+    }
+
+    a {
+      color: #333;
+    }
+
+    a:hover {}
+  </style>
+</head>
+
+<body>
+  <noscript>
+    <strong>We're sorry but hello doesn't work properly without JavaScript enabled. Please enable it to
+      continue.</strong>
+  </noscript>
+  <div id="app"></div>
+  <!-- built files will be auto injected -->
+</body>
+
+</html>

+ 0 - 0
src/assets/moon.png → public/moon.jpg


+ 1 - 1
src/api/guanLianApi.js

@@ -2,7 +2,7 @@ import HttpKit from '@/utils/http-kit'
 
 export default {
   /**
-   * 功能描述:查询关卡
+   * 功能描述:关联、取消关联
    * @param form
    */
   page (form) {

+ 15 - 1
src/api/levelApi.js

@@ -9,6 +9,20 @@ export default {
     return HttpKit.post(`/admin/level/page`,form).then(
       res => res.data
     )
-
+  },
+  getGqInfo(id){
+    return HttpKit.get(`/admin/level/`+id).then(
+      res => res.data
+    )
+  },
+  add(form){
+    return HttpKit.post(`/admin/level`,form).then(
+      res => res.data
+    )
+  },
+  update(form){
+    return HttpKit.put(`/admin/level`,form).then(
+      res => res.data
+    )
   }
 }

+ 48 - 0
src/api/levelTimuApi.js

@@ -0,0 +1,48 @@
+import HttpKit from '@/utils/http-kit'
+import { add } from 'lodash'
+
+export default {
+  /**
+   * 功能描述:关联
+   * @param form
+   */
+  page (form) {
+    return HttpKit.post('/admin/levelTimu',form).then(
+      res => res.data
+    )
+  },
+  /**
+   * 功能描述:获取全部关联到关卡的题库
+   * @param 
+   */
+  getAllRelation(levelId){
+    return HttpKit.get('/admin/levelTimu/'+levelId+'/link').then(
+      res => res.data
+    )
+  },
+  /**
+   * 功能描述:取消关联
+   * @param 
+   */
+  getCancelConnection(form){
+    return HttpKit.post('/admin/levelTimu/association/delete',form).then(
+      res => res.data
+    )
+  },
+
+  add(from){
+    return HttpKit.post('/admin/levelTimu/add',from)
+  },
+
+  update(from){
+    return HttpKit.put('/admin/levelTimu',from)
+  },
+
+  removeTm(id){
+    return HttpKit.delete('/admin/levelTimu/'+id)
+  },
+
+  getTmInfo(id){
+    return HttpKit.get('/admin/levelTimu/'+id)
+  }
+}

+ 0 - 13
src/api/paperApi.js

@@ -1,13 +0,0 @@
-import HttpKit from '@/utils/http-kit'
-
-export default {
-  /**
-   * 功能描述:查询试卷
-   * @param form
-   */
-  page (form) {
-    return HttpKit.post(`/admin/paper/page`,form).then(
-      res => res.data
-    )
-  }
-}

+ 25 - 0
src/api/studentApi.js

@@ -0,0 +1,25 @@
+import HttpKit from '@/utils/http-kit'
+
+export default {
+  /**
+   * 后台登录
+   * @param form
+   */
+  login(form) {
+    return HttpKit.post(`/admin/student/login`, form).then(
+      res => res.data
+    )
+
+  },
+   /**
+   * 后台查询所有用户
+   * @param form
+   */
+  page(form) {
+    return HttpKit.post(`/admin/student/select`, form).then(
+      res => res.data
+    )
+
+  }
+
+}

BIN
src/assets/moon.jpg


BIN
src/assets/timg.jpg


+ 10 - 8
src/components/layout/aside-menu.vue

@@ -85,19 +85,21 @@ export default {
        * todo 后面增加属性支持页面嵌套打开
        */
       menuList: [
-        {
-          icon: "el-icon-user-solid",
-          menuName: "账号管理",
-          routerName: "AccountIndex"
-        },
+
         {
           icon: "el-icon-s-cooperation",
           menuName: "系统管理",
           groupList: [
              {
-              icon: "el-icon-collection",
-              menuName: "关卡管理",
-              routerName: "level"
+               icon: "el-icon-user-solid",
+               menuName: "账号管理",
+               routerName: "AccountIndex"
+             },
+             {
+             icon: "el-icon-collection",
+             menuName: "关卡管理",
+             routerName: "level"
+
              }
           ]
         }

+ 12 - 8
src/router/index.js

@@ -18,7 +18,7 @@ const router = new VueRouter({
     meta: {title: '退出登录'}
   }, {
     path: '/',
-    redirect: '/data-market/main'
+    redirect: '/login'
   }, {
     path: '/data-market/main',
     component: () => import('@/views/main'),
@@ -27,7 +27,10 @@ const router = new VueRouter({
       name: 'DataMarketIndex',
       meta: {title: '数据大盘'}
     }]
-  }, {
+  },
+
+
+  {
     path: '/system',
     component: () => import('@/views/main'),
     children: [{
@@ -37,11 +40,12 @@ const router = new VueRouter({
       meta: {title: '系统管理 - 数据字典'}
     },
     {
-            path: '/system/paper',
-            name: 'paper',
-            component: () => import('@/views/system/paper/list'),
-            meta: {title: '系统管理 - 试卷管理'}
-    },
+        path:'/system/account',
+        name:'AccountIndex',
+        component: () => import('@/views/system/account/list'),
+        meta: {title: '账号管理'}
+      },
+
     {
              path: '/system/level',
              name: 'level',
@@ -52,7 +56,7 @@ const router = new VueRouter({
                   path: '/system/level/detail',
                   name: 'levelDetail',
                   component: () => import('@/views/system/level/detail'),
-                  meta: {title: '我就瞎打'}
+                  meta: {title: '系统管理 - 题库管理'}
           }]
   }]
 })

+ 1 - 0
src/utils/http-kit.js

@@ -107,6 +107,7 @@ export default {
     })
   },
   post (url, data = {}, config = {}) {
+    console.log(data)
     return new Promise((resolve, reject) => {
       axios.post(url, data, config).then(response => {
         resolve(response)

+ 64 - 54
src/views/login.vue

@@ -1,23 +1,36 @@
 <template>
   <div class="login-container">
     <el-form ref="form" :model="form" :rules="ruleForm" class="login-page">
-      <h3 style="line-height: 75px;font-size: 26px;font-weight: 800;">系统登录</h3>
-      <el-form-item prop="username">
-        <el-input v-model="form.username" type="text" placeholder="用户名">
+      <h3 style="line-height: 75px;font-size: 26px;font-weight: 800;">
+        后台管理登录
+      </h3>
+      <el-form-item prop="name">
+        <el-input v-model="form.name" type="text" placeholder="用户名">
           <template slot="prepend">
             <i class="el-icon-user-solid" />
           </template>
         </el-input>
       </el-form-item>
       <el-form-item prop="password">
-        <el-input v-model="form.password" type="password" placeholder="密码" @keyup.enter.native="handleSubmit">
+        <el-input
+          v-model="form.password"
+          type="password"
+          placeholder="密码"
+          @keyup.enter.native="handleLogin"
+        >
           <template slot="prepend">
             <i class="el-icon-s-goods" />
           </template>
         </el-input>
       </el-form-item>
       <el-form-item style="width:100%;">
-        <el-button type="primary" style="width:100%;" :loading="logining" @click="handleSubmit">登录</el-button>
+        <el-button
+          type="primary"
+          style="width:100%;"
+          :loading="logining"
+          @click="handleLogin"
+          >登录</el-button
+        >
       </el-form-item>
     </el-form>
   </div>
@@ -25,70 +38,67 @@
 
 <script>
 // import accountApi from '@/api/accountApi'
+import studentApi from "@/api/studentApi";
 
 export default {
-  name: 'Login',
-  data () {
+  name: "Login",
+  data() {
     return {
       logining: false,
       form: {
-        username: '',
-        password: ''
+        name: "",
+        password: ""
       },
       ruleForm: {
-        username: [{ required: true, message: '请输入账号', trigger: 'blur' }],
-        password: [{ required: true, message: '请输入密码', trigger: 'blur' }]
+        name: [{ required: true, message: "请输入账号", trigger: "blur" }],
+        password: [{ required: true, message: "请输入密码", trigger: "blur" }]
       }
-    }
+    };
   },
-  mounted () {
+  mounted() {
     /* 访问该页面重置token值 */
-    this.$cookie.remove('token')
+    this.$cookie.remove("token");
   },
   methods: {
-    handleSubmit () {
-      this.$refs.form.validate((valid) => {
-        if (!valid) {
-          return false
-        }
-
-        this.logining = true
-        // accountApi.login(this.form).then(data => {
-        //   this.logining = false
-        //
-        //   if (data) {
-        //     this.$cookie.set('token', data, {expires: 7, path: '/'})
-        //
-        //     if (this.$route.query.redirect) {
-        //       this.$router.push({path: `${this.$route.query.redirect}`})
-        //       return
-        //     }
-        //
-        //     this.$router.push({path: '/'})
-        //   }
-        // }).catch(() => {
-        //   this.logining = false
-        // })
-      })
+    // result() {
+    //   console.log('---------------');
+    //   console.log(data);
+    //   this.$router.push('/system/level')
+    // },
+    handleLogin() {
+      studentApi
+        .login(this.form)
+        .then(res => {
+          this.$router.push({ name: "level" });
+        })
+        .catch(err => {
+          alert("用户或密码错误");
+        });
     }
-  }
-}
+  },
+
+  created() {}
+};
 </script>
 
 <style scoped>
-  .login-container {
-    width: 100%;
-    height: 100%;
-  }
+.login-container {
+  background-image: url("../assets/timg.jpg");
+  background-size: 10%;
+  -webkit-background-size: cover;
+  -o-background-size: cover;
+  background-repeat: no-repeat;
+  padding: 105px;
+}
 
-  .login-page {
-    -webkit-border-radius: 5px;
-    border-radius: 5px;
-    margin: 125px auto;
-    width: 350px;
-    padding: 15px 25px;
-    background: #fff;
-    border: 1px solid #eaeaea;
-    box-shadow: 0 0 25px #cac6c6;
-  }
+.login-page {
+  -webkit-border-radius: 5px;
+  border-radius: 50px;
+  margin: 125px auto;
+  width: 350px;
+  padding: 35px 45px;
+  background: #fff;
+  border: 1px solid #eaeaea;
+  box-shadow: 0 0 25px #cac6c6;
+}
 </style>

+ 66 - 57
src/views/main.vue

@@ -7,14 +7,20 @@
     <el-container>
       <el-header>
         <el-row>
-          <el-col :span="4" style="text-align: left;padding-left: 10px;">
-             <i class="el-icon-star-on"></i>
+          <el-col
+            :span="4"
+            style="text-align: left;padding-left: 10px;text-shadow: 0 0 10px white,0 0 20px white,0 0 30px white,0 0 30px white;"
+          >
+            <i class="el-icon-star-on"></i>
             &nbsp;
-            <label style="font-size: 16px;">真不错</label>
+            <label style="font-size: 26px;text-shadow: 0 0 5px white,0 0 10px white,0 0 30px white,0 0 30px white;">原动力</label>
           </el-col>
           <el-col :span="2" :offset="18">
             <el-dropdown style="cursor: pointer;">
-              <el-avatar icon="el-icon-user-solid" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);"/>
+              <el-avatar
+                icon="el-icon-user-solid"
+                style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);"
+              />
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item>
                   <router-link :to="{name: 'Logout'}">退出登录</router-link>
@@ -24,7 +30,9 @@
           </el-col>
         </el-row>
       </el-header>
-      <el-main :style="{height: (screenHeight - 60) + 'px', padding: 0 + 'px ' + 10 + 'px', paddingTop: 10 + 'px'}">
+      <el-main
+        :style="{height: (screenHeight - 60) + 'px', padding: 0 + 'px ' + 10 + 'px', paddingTop: 10 + 'px'}"
+      >
         <transition name="el-fade-in-linear">
           <router-view />
         </transition>
@@ -34,87 +42,88 @@
 </template>
 
 <script>
-import AsideMenu from '@/components/layout/aside-menu'
+import AsideMenu from "@/components/layout/aside-menu";
 
 export default {
-  name: 'Main',
+  name: "Main",
   components: {
     AsideMenu
   },
-  data () {
+  data() {
     return {
       screenHeight: document.documentElement.clientHeight, // 获取可视屏幕高度
       isCollapseMenu: false
-    }
+    };
   },
   watch: {
-    screenHeight (val) {
+    screenHeight(val) {
       // 为了避免频繁触发resize函数导致页面卡顿,使用定时器
       if (!this.timer) {
         // 一旦监听到的screenWidth值改变,就将其重新赋给data里的screenWidth
-        this.screenHeight = val
-        this.timer = true
-        const that = this
-        setTimeout(function () {
-          that.timer = false
-        }, 400)
+        this.screenHeight = val;
+        this.timer = true;
+        const that = this;
+        setTimeout(function() {
+          that.timer = false;
+        }, 400);
       }
     }
   },
-  mounted () {
-    const that = this
+  mounted() {
+    const that = this;
     window.onresize = () => {
       return (() => {
-        window.screenHeight = document.documentElement.clientHeight
-        that.screenHeight = window.screenHeight
-      })()
-    }
+        window.screenHeight = document.documentElement.clientHeight;
+        that.screenHeight = window.screenHeight;
+      })();
+    };
   },
   methods: {
-    collapseMenu () {
+    collapseMenu() {
       /* el-aside有一个默认值为300,暂时没有很好的方式来处理伸缩菜单栏来处理样式问题... */
-      this.isCollapseMenu = !!this.isCollapseMenu
+      this.isCollapseMenu = !!this.isCollapseMenu;
     }
   }
-}
+};
 </script>
 
 <style>
-  .el-header, .el-footer {
-    background-color: #fff;
-    color: #333;
-    text-align: center;
-    line-height: 60px;
-    padding-left: 0px;
-    padding-right: 0px;
-  }
+.el-header,
+.el-footer {
+  background-color: #000099;
+  color: #333;
+  text-align: center;
+  line-height: 60px;
+  padding-left: 0px;
+  padding-right: 0px;
+}
 
-  .el-footer {
-    height: 40px !important;
-    line-height: 40px !important;
-  }
+.el-footer {
+  height: 40px !important;
+  line-height: 40px !important;
+}
 
-  .el-main {
-    background-color: #eee;
-    color: #333;
-    text-align: center;
-    padding: 0px;
-  }
+.el-main {
+  background-color: #eee;
+  color: #333;
+  text-align: center;
+  padding: 0px;
+}
 
-  body > .el-container {
-    margin-bottom: 40px;
-  }
+body > .el-container {
+  margin-bottom: 40px;
+}
 
-  .el-container:nth-child(5) .el-aside,
-  .el-container:nth-child(6) .el-aside {
-    line-height: 260px;
-  }
+.el-container:nth-child(5) .el-aside,
+.el-container:nth-child(6) .el-aside {
+  line-height: 260px;
+}
 
-  .el-container:nth-child(7) .el-aside {
-    line-height: 320px;
-  }
-  .el-icon-star-on{
-  color:yellow;
-  font-size:50px;
-  }
+.el-container:nth-child(7) .el-aside {
+  line-height: 320px;
+}
+.el-icon-star-on {
+  color: yellow;
+  font-size: 50px;
+}
 </style>

+ 136 - 0
src/views/system/account/list.vue

@@ -0,0 +1,136 @@
+<template>
+  <el-row>
+    <el-row>
+      <white-board>
+        <el-breadcrumb separator="/">
+          <el-breadcrumb-item :to="{ path: '/system/level' }"
+            >首页</el-breadcrumb-item
+          >
+          <el-breadcrumb-item :to="{ path: '/system/level' }"
+            >系统管理</el-breadcrumb-item
+          >
+          <el-breadcrumb-item>账号管理</el-breadcrumb-item>
+        </el-breadcrumb>
+      </white-board>
+    </el-row>
+
+    <el-row>
+      <white-board>
+        <el-row style="line-height: 40px; text-align: right;">
+          <el-col :span="6" :offset="18" style="text-align: right;"> </el-col>
+        </el-row>
+
+        <el-row style="padding: 10px 0px;">
+          <el-table
+            :data="tableData"
+            row-key="id"
+            lazy
+            ref="ttable"
+            @row-click="rowClick"
+            style="width: 100%;"
+            highlight-current-row
+            stripe
+          >
+            <el-table-column
+              prop="id"
+              label="用户id"
+              width="180"
+            ></el-table-column>
+            <el-table-column
+              prop="name"
+              label="用户名称"
+              width="150"
+            ></el-table-column>
+            <el-table-column
+              prop="password"
+              label="用户密码"
+              width="150"
+            ></el-table-column>
+          </el-table>
+        </el-row>
+      </white-board>
+    </el-row>
+
+    
+  </el-row>
+</template>
+
+<script>
+import studentApi from "@/api/studentApi";
+
+export default {
+  name: "account",
+  components: {},
+  data() {
+    return {
+      defaultProps: {
+        label: "name",
+        children: "child"
+      },
+      searchForm: {
+        id: "",
+        name: "",
+        password: "",
+        start: 1,
+        limit: 10
+      },
+      total: 0,
+      tableData: [],
+      uploadData: {
+        tree: null,
+        treeNode: null,
+        resolve: null
+      },
+
+      dialogdelVisible: false,
+      currentSelectRow: {}, // 当前选中行
+      form: {
+        id: "",
+        password: "",
+        name: ""
+      }
+    };
+  },
+  mounted() {
+    this.list();
+  },
+  methods: {
+    filterNode(value, data) {
+      if (!value) {
+        return true;
+      }
+
+      return data.name.indexOf(value) !== -1;
+    },
+    list() {
+      this.currentSelectRow = {};
+      this.tableData = [];
+
+      let _data = {
+        data: {
+          id: this.searchForm.id,
+          name: this.searchForm.name,
+          password: this.searchForm.password
+        },
+        limit: this.searchForm.limit,
+        start: this.searchForm.start
+      };
+
+      studentApi.page(_data).then(data => {
+        this.tableData = data;
+      });
+    },
+    rowClick(row, event, column) {
+      this.$router.push({
+        name: "levelDetail",
+        params: { id: row.id }
+      }); /* 关卡跳转,接参数 */
+      this.currentSelectRow = row;
+    },
+
+  }
+};
+</script>
+
+<style scoped>
+</style>

+ 224 - 81
src/views/system/level/detail.vue

@@ -3,117 +3,260 @@
     <el-row>
       <white-board>
         <el-breadcrumb separator="/">
-          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
-          <el-breadcrumb-item>系统管理</el-breadcrumb-item>
-          <el-breadcrumb-item>关卡管理</el-breadcrumb-item>
-          <el-breadcrumb-item>关卡详情管理</el-breadcrumb-item>
+          <el-breadcrumb-item :to="{ path: '/system/level' }">首页</el-breadcrumb-item>
+          <el-breadcrumb-item :to="{ path: '/system/level' }">系统管理</el-breadcrumb-item>
+          <el-breadcrumb-item :to="{path:'/system/level'}">关卡管理</el-breadcrumb-item>
+          <el-breadcrumb-item :to="{path:'/system/level/detail'}">关卡详情管理</el-breadcrumb-item>
         </el-breadcrumb>
       </white-board>
     </el-row>
--{{levelId}}-
-    <el-row>
-      <el-form ref="searchForm" :model="searchForm">
-        <search-white-board :show-more="true" @search="list">
-          <div slot="base">
-            <el-row style="line-height: 40px; text-align: right;">
-              <el-col :span="3"><label class="search-label">题干内容</label></el-col>
-              <el-col :span="5">
-                <el-input v-model.trim="searchForm.name" placeholder="输入题干内容" clearable></el-input>
-              </el-col>
-            </el-row>
-          </div>
-        </search-white-board>
-      </el-form>
+      <el-row :gutter="10" class="mb8">
+       <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-refresh-left"
+          size="mini"
+          @click="getStemIdList(levelId)"
+        >刷新</el-button>
+      </el-col>
     </el-row>
-
     <el-row>
       <white-board>
         <el-row style="padding: 10px 0px;">
-          <el-table :data="tableData" row-key="id" lazy ref="ttable" style="width: 100%;" highlight-current-row stripe>
-            <el-table-column prop="id" label="标识" width="180"></el-table-column>
-            <el-table-column prop="name" label="题干内容" width="150"></el-table-column>
-             <el-table-column prop="optionList" label="答案" width="150">
-             <template slot-scope="scope">
-             <div v-for="item of scope.row.optionList">
-                 <span v-if="item.isRight === true">{{item.content}}</span>
-             </div>
-             </template>
-             </el-table-column>
-             <el-table-column prop="analysis" label="答案解析" width="150"></el-table-column>
-            <el-table-column label="操作" width="250">
+          <el-table
+            :data="linkIdList"
+            row-key="id"
+            lazy
+            ref="ttable"
+            style="width: 100%;"
+            highlight-current-row
+            stripe
+            @selection-change="handleSelectionChange"
+          >
+          <el-table-column type="selection" width="55" align="center" />
+            <!-- <el-table-column prop="timuId" label="标识" width="180" ></el-table-column> -->
+            <el-table-column prop="content" label="题干内容" width="150"></el-table-column>
+            <el-table-column prop="answer" label="答案" width="150"></el-table-column>
+            <el-table-column prop="analysis" label="答案解析" width="150"></el-table-column>
+            <!-- <el-table-column label="操作" width="250">
               <template slot-scope="scope">
-                <el-button v-if="isLink(scope.row.id)" type="danger" plain>取消关联</el-button>
-                <el-button v-if="!isLink(scope.row.id)" @click="guanqia(scope.row.id)" type="primary" plain>关联</el-button>
+                <el-button v-if="isLink(scope.row.id)" type="danger" @click="cancelConnection(scope.row.id)">取关</el-button>
+                <el-button
+                  v-if="!isLink(scope.row.id)"
+                  @click="guanqia(scope.row.id)"
+                  type="primary"
+                >关联</el-button>
+              </template>
+            </el-table-column> -->
+            <el-table-column label="操作" width="500" align="center">
+              <template slot-scope="scope">
+                <el-button type="mini" plain @click="handleUpdate(scope.row)">编辑</el-button>
+                <el-button type="mini" plain @click="handleDelete(scope.row)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
         </el-row>
       </white-board>
     </el-row>
+    <!-- 添加或修改对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="题干内容" prop="content">
+          <el-input v-model="form.content"  placeholder="请输入内容"/>
+        </el-form-item>
+        <el-form-item label="答案" prop="answer">
+          <el-input v-model="form.answer" placeholder="请输入答案"/>
+        </el-form-item>
+        <el-form-item label="答案分析" prop="analysis">
+          <el-input v-model="form.analysis" placeholder="请输入答案分析"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </el-row>
 </template>
 
 <script>
-  import levelApi from "@/api/levelApi"
-  import searchApi from "@/api/searchApi"
+import levelTimuApi from "@/api/levelTimuApi";
+import searchApi from "@/api/searchApi";
+import levelApi from "@/api/levelApi";
+import { fromStringWithSourceMap } from "source-list-map";
 
-  export default {
-    name: 'level',
-    components: {
+export default {
+  name: "level",
+  components: {},
+  data() {
+    return {
+       // 遮罩层
+      loading: true,
+       // 是否显示弹出层
+      open: false,
+            // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      rules:{},
+      // 表单参数
+      form: {},
+      levelId: "",
+      title:"",
+      searchForm: {
+        name: "",
+        page: 0,
+        size: 30
+      },
+      total: 0,
+      tableData: [],
+      linkIdList: [] // 已关联的id集合
+    };
+  },
+  mounted() {
+    this.levelId = this.$route.params.id;
+    this.getStemIdList(this.levelId);
+    //this.list();
+
+  },
+  methods: {
+    getStemIdList(levelId) {
+      //根据关卡Id查找关联的题目id集合
+      levelTimuApi.getAllRelation(levelId).then(res => {
+        // 赋值到页面中的linkIdList
+         this.linkIdList = res
+         console.log("@@@"+this.linkIdList)
+      });
     },
-    data () {
-      return {
-        levelId: '',
-        searchForm: {
-         name: '',
-         page: 0,
-         size: 30,
-        },
-        total:0,
-        tableData: [],
-        linkIdList: [753214996644626432,753214991095562240,753214994362925056] // 已关联的id集合
-      }
+    reset(){
+        this.form = {
+          timuId:null,
+          levelId:this.$route.params.id,
+          content:null,
+          answer:null,
+          analysis:null
+        };
+      },
+        // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
     },
-    mounted () {
-      this.levelId = this.$route.params.id
-      this.getStemIdList()
-      this.list()
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.studentId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
     },
-    methods: {
-    getStemIdList() {
-
+    handleUpdate(row){
+      this.reset();
+        const timuId = row.timuId
+        levelTimuApi.getTmInfo(timuId).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改题目";
+      });
     },
-      guanqia(id) {
-      console.log(id)
-      },
-      filterNode (value, data) {
-        if (!value) {
-          return true
+    
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.timuId != null) {
+            levelTimuApi.update(this.form).then(response => {
+              this.open = false;
+              this.getStemIdList(this.levelId);
+            });
+          } else {
+            levelTimuApi.add(this.form).then(response => {
+              this.open = false;
+              console.log(response)
+              this.getStemIdList(this.levelId);
+            });
+          }
         }
-
-        return data.name.indexOf(value) !== -1
-      },
-      list () {
-        this.tableData = []
-        let _data = {
-          tenantId: '752950178499002368',
-          page: this.searchForm.page,
-          size: this.searchForm.size,
-        }
-        searchApi.page(_data).then(data => {
-          this.total = data.total
-          this.tableData = data.data
+      });
+    },
+    //删除
+    handleDelete(row){
+      const timuId = row.timuId;
+      const _this = this;
+      this.$confirm('确认要删除该题目吗?','提示',{type: 'warning'}).then(function(){
+        levelTimuApi.removeTm(timuId).then(() => {
+          _this.getStemIdList(_this.levelId);
+          _this.$notify({title:"删除成功",type:'success'})
         })
-        // 查询当前关卡所关联的题目id
+      })
+    },
+    //关联
+    guanqia(id) {
+      //赋值
+      this.form.data.levelId = this.levelId;
+      this.form.data.timuId = id;
+      levelTimuApi
+        .page(this.form)
+        .then(res => {})
+        .catch(err => {});
+      this.getStemIdList(this.levelId)//重新刷新数据
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加题目";
+    },
+    //取消关联
+   cancelConnection(id){
+     //赋值
+    this.form.data.levelId = this.levelId;
+    this.form.data.timuId = id;
+    levelTimuApi
+        .getCancelConnection(this.form)
+        .then(res => {})
+        .catch(err => {});
+    this.getStemIdList(this.levelId)//重新刷新数据
 
+   },
 
-      },
-      isLink (stemId) {
-        // 判断stemId是否在已关联的集合中
-        return this.linkIdList.indexOf(stemId) >= 0
+    filterNode(value, data) {
+      if (!value) {
+        return true;
       }
+
+      return data.name.indexOf(value) !== -1;
+    },
+    list() {
+      this.tableData = [];
+      let _data = {
+        tenantId: "752950178499002368",
+        page: this.searchForm.page,
+        size: this.searchForm.size
+      };
+      searchApi.page(_data).then(data => {
+        this.total = data.total;
+        this.tableData = data.data;
+      });
+      // 查询当前关卡所关联的题目id
+    },
+    isLink(stemId) {
+      // 判断stemId是否在已关联的集合中
+      // console.log(this.linkIdList.indexOf(stemId) >= 0)
+      return this.linkIdList.indexOf(stemId) >= 0;
     }
   }
+};
 </script>
 
 <style scoped>

+ 71 - 84
src/views/system/level/list.vue

@@ -3,41 +3,36 @@
     <el-row>
       <white-board>
         <el-breadcrumb separator="/">
-          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
-          <el-breadcrumb-item>系统管理</el-breadcrumb-item>
+          <el-breadcrumb-item :to="{ path: '/system/level' }">首页</el-breadcrumb-item>
+          <el-breadcrumb-item :to="{path:'/system/level'}">系统管理</el-breadcrumb-item>
           <el-breadcrumb-item>关卡管理</el-breadcrumb-item>
         </el-breadcrumb>
       </white-board>
     </el-row>
-
-    <el-row>
-      <el-form ref="searchForm" :model="searchForm">
-        <search-white-board :show-more="true" @search="list">
-          <div slot="base">
-            <el-row style="line-height: 40px; text-align: right;">
-              <el-col :span="3"><label class="search-label">关卡名称</label></el-col>
-              <el-col :span="5">
-                <el-input v-model.trim="searchForm.name" placeholder="输入关卡名称" clearable></el-input>
-              </el-col>
-            </el-row>
-          </div>
-        </search-white-board>
-      </el-form>
+      <el-row :gutter="10" class="mb8">
+       <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+        >新增</el-button>
+      </el-col>
     </el-row>
 
     <el-row>
       <white-board>
           <el-row style="line-height: 40px; text-align: right;">
           <el-col :span="6" :offset="18" style="text-align: right;">
-          <el-button icon="el-icon-plus" type="success" plain @click="handleAdd">新增</el-button>
           </el-col>
         </el-row>
 
         <el-row style="padding: 10px 0px;">
-          <el-table :data="tableData" row-key="id" lazy :load="load" ref="ttable" @row-click="rowClick" style="width: 100%;" highlight-current-row stripe>
+          <el-table  :data="tableData" row-key="id" lazy :load="load" ref="ttable"  style="width: 100%;" highlight-current-row stripe>
             <el-table-column prop="id" label="标识" width="180"></el-table-column>
-            <el-table-column prop="name" label="关卡名称" width="150"></el-table-column>
-            <el-table-column label="创建" width="135">
+            <el-table-column prop="gqname" label="关卡名称" width="200"></el-table-column>
+            <!-- <el-table-column label="创建" width="135">
               <template slot-scope="scope">
                 <div>{{scope.row.createdBy}}</div>
                 <div>{{scope.row.createDate}}</div>
@@ -48,11 +43,11 @@
                 <div>{{scope.row.lastModifiedBy}}</div>
                 <div>{{scope.row.lastModifiedDate}}</div>
               </template>
-            </el-table-column>
-            <el-table-column label="操作" width="150">
+            </el-table-column> -->
+            <el-table-column label="操作" width="500" align="center">
               <template slot-scope="scope">
-                <el-button type="primary" plain @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
-                <el-button type="danger" plain @click="handleDel(scope.$index, scope.row)">删除</el-button>
+                <el-button type="mini" plain @click="rowClick(scope.row)">查看</el-button>
+                <el-button type="mini" plain @click="handleEdit(scope.row)">编辑</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -60,16 +55,16 @@
       </white-board>
     </el-row>
 
-    <el-dialog :visible.sync="dialogVisible" ref="form">
-      <el-divider></el-divider>
-      <label slot="title" style="float: left;">{{dialogTitle}}</label>
-
-
-
+        <!-- 添加或修改对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="关卡名称" prop="gqname">
+          <el-input v-model="form.gqname"  placeholder="请输入关卡名称"/>
+        </el-form-item>
+      </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-divider></el-divider>
-        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
-        <el-button type="primary" @click="handleSave" size="mini">确 定</el-button>
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
   </el-row>
@@ -101,20 +96,14 @@
           treeNode: null,
           resolve: null
         },
-
+        title:"",
+        open:false,
         dialogTitle: '',
         dialogVisible: false,
         dialogdelVisible: false,
+        rules:{},
         currentSelectRow: {}, // 当前选中行
         form: {
-          id: '',
-          parentId: '',
-          dictKey: '',
-          code: '',
-          value: '',
-          attr: '',
-          remarks: '',
-          sort: ''
         },
       }
     },
@@ -126,9 +115,14 @@
         if (!value) {
           return true
         }
-
         return data.name.indexOf(value) !== -1
       },
+      reset(){
+        this.form = {
+          id:null,
+          gqname:null,
+        };
+      },
       list () {
         this.currentSelectRow = {}
         this.tableData = []
@@ -145,54 +139,47 @@
           this.tableData = data.data
         })
 
-
       },
       rowClick (row, event, column) {
         this.$router.push({name: 'levelDetail', params:{id: row.id}})  /* 关卡跳转,接参数 */
         this.currentSelectRow = row
       },
-      handleAdd () {
-        /* 重置表单 */
-        this.form['id'] = ''
-        this.form['parentId'] = this.currentSelectRow['id']
-        this.form['dictKey'] = ''
-        this.form['code'] = ''
-        this.form['value'] = ''
-        this.form['attr'] = ''
-        this.form['remarks'] = ''
-        this.form['sort'] = ''
-        this.dialogTitle = '新增'
-        this.dialogVisible = true
-      },
-      handleEdit (index,row) {
-        this.form['id'] = row.id
-        this.form['parentId'] = row.parentId
-        this.form['dictKey'] = row.dictKey
-        this.form['code'] = row.code
-        this.form['value'] = row.value
-        this.form['attr'] = row.attr
-        this.form['remarks'] =row.remark
-        this.form['sort'] = row.sort
-        this.dialogTitle = '编辑'
-        this.dialogVisible = true
-      },
-      handleDel (index,row) {
-        this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          dataDictionaryApi.deleteDataDictPoint(row.id).then(data => {
-            this.$message({
-              type: 'success',
-              message: '删除成功'
-            })
 
-            this.list()
-            this.load(this.uploadData.tree, this.uploadData.treeNode, this.uploadData.resolve)
-          })
-        })
+      handleEdit (row) {
+        this.reset();
+        const gqid = row.id
+        levelApi.getGqInfo(gqid).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改关卡";
+      });
       },
+      handleAdd(){
+        this.reset();
+        this.open = true;
+        this.title = "添加关卡";
+      },
+          /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            levelApi.update(this.form).then(response => {
+              this.open = false;
+              this.list();
+            });
+          } else {
+            levelApi.add(this.form).then(response => {
+              this.open = false;
+              this.list();
+            });
+          }
+        }
+      });
+    },
+    cancel() {
+      this.open = false;
+    },
       load(tree, treeNode, resolve) {
         this.uploadData.tree = tree
         this.uploadData.treeNode = treeNode

+ 0 - 277
src/views/system/paper/list.vue

@@ -1,277 +0,0 @@
-<template>
-  <el-row>
-    <el-row>
-      <white-board>
-        <el-breadcrumb separator="/">
-          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
-          <el-breadcrumb-item>系统管理</el-breadcrumb-item>
-          <el-breadcrumb-item>试卷管理</el-breadcrumb-item>
-        </el-breadcrumb>
-      </white-board>
-    </el-row>
-
-    <el-row>
-      <el-form ref="searchForm" :model="searchForm">
-        <search-white-board :show-more="true" @search="list">
-          <div slot="base">
-            <el-row style="line-height: 40px; text-align: right;">
-              <el-col :span="3"><label class="search-label">试卷名称</label></el-col>
-              <el-col :span="5">
-                <el-input v-model.trim="searchForm.name" placeholder="输入试卷名称" clearable></el-input>
-              </el-col>
-              <el-col :span="2" :offset="1"><label class="search-label">年级</label></el-col>
-              <el-col :span="5">
-                <el-input v-model.trim="searchForm.gradeName" placeholder="请输入年级" clearable></el-input>
-              </el-col>
-              <el-col :span="2" :offset="1"><label class="search-label">学科</label></el-col>
-               <el-col :span="5">
-                <el-input v-model.trim="searchForm.subject" placeholder="请输入学科" clearable></el-input>
-               </el-col>
-            </el-row>
-          </div>
-        </search-white-board>
-      </el-form>
-    </el-row>
-
-    <el-row>
-      <white-board>
-        <el-row style="line-height: 40px; text-align: right;">
-          <el-col :span="6" :offset="18" style="text-align: right;">
-            <el-button icon="el-icon-plus" type="success" plain @click="handleAdd">新增</el-button>
-          </el-col>
-        </el-row>
-
-        <el-row style="padding: 10px 0px;">
-          <el-table :data="tableData" row-key="id" lazy :load="load" ref="ttable" @row-click="rowClick" style="width: 100%;" highlight-current-row stripe>
-            <el-table-column prop="id" label="标识" width="180"></el-table-column>
-            <el-table-column prop="name" label="试卷名称" width="150"></el-table-column>
-            <el-table-column prop="gradeName" label="年级" width="200"></el-table-column>
-            <el-table-column prop="subject" label="学科"  width="100"></el-table-column>
-            <el-table-column label="创建" width="135">
-              <template slot-scope="scope">
-                <div>{{scope.row.createdBy}}</div>
-                <div>{{scope.row.createDate}}</div>
-              </template>
-            </el-table-column>
-            <el-table-column label="更新" width="135">
-              <template slot-scope="scope">
-                <div>{{scope.row.lastModifiedBy}}</div>
-                <div>{{scope.row.lastModifiedDate}}</div>
-              </template>
-            </el-table-column>
-            <el-table-column label="操作" width="150">
-              <template slot-scope="scope">
-                <el-button type="primary" plain @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
-                <el-button type="danger" plain @click="handleDel(scope.$index, scope.row)">删除</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-row>
-      </white-board>
-    </el-row>
-
-    <el-dialog :visible.sync="dialogVisible" ref="form">
-      <el-divider></el-divider>
-      <label slot="title" style="float: left;">{{dialogTitle}}</label>
-
-      <el-row>
-        <el-col :span="18" :offset="3">
-          <el-form ref="form" :model="form" :rules="formRules" label-width="80px">
-            <el-form-item label="标识" prop="id" hidden="hidden">
-              <el-input v-model.trim="form.id" v-bind:disabled="form.id !== ''" hidden="hidden" clearable></el-input>
-            </el-form-item>
-            <el-form-item label="父级标识" prop="parentId" hidden="hidden">
-              <el-input v-model.trim="form.parentId" placeholder="请输入父级标识" clearable></el-input>
-            </el-form-item>
-            <el-form-item label="唯一标识" prop="dictKey">
-              <el-input v-model.trim="form.dictKey" placeholder="字典唯一标识" clearable></el-input>
-            </el-form-item>
-            <el-form-item label="字典编码" prop="code">
-              <el-input v-model.trim="form.code" placeholder="字典编码" clearable></el-input>
-            </el-form-item>
-            <el-form-item label="字典值" prop="value">
-              <el-input v-model.trim="form.value" placeholder="字典值" clearable></el-input>
-            </el-form-item>
-            <el-form-item label="拓展字段">
-              <el-input v-model.trim="form.attr" placeholder="拓展字段" clearable></el-input>
-            </el-form-item>
-            <el-form-item label="备注" prop="remarks">
-              <el-input v-model.trim="form.remarks" placeholder="备注" clearable></el-input>
-            </el-form-item>
-            <el-form-item label="排序" prop="sort" >
-              <el-input v-model.trim="form.sort" placeholder="排序" type="number" clearable></el-input>
-            </el-form-item>
-          </el-form>
-
-        </el-col>
-      </el-row>
-
-      <div slot="footer" class="dialog-footer">
-        <el-divider></el-divider>
-        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
-        <el-button type="primary" @click="handleSave" size="mini">确 定</el-button>
-      </div>
-    </el-dialog>
-  </el-row>
-</template>
-
-<script>
-  import dataDictionaryApi from "@/api/dataDictionaryApi"
-  import paperApi from "@/api/paperApi"
-
-  export default {
-    name: 'dataDict',
-    components: {
-    },
-    data () {
-      return {
-        defaultProps: {
-          label: 'name',
-          children: 'child',
-        },
-        searchForm: {
-         gradeName: '',
-         name: '',
-         subject: '',
-         start: 1,
-         limit: 10
-        },
-        total:0,
-        tableData: [],
-        uploadData: {
-          tree: null,
-          treeNode: null,
-          resolve: null
-        },
-
-        dialogTitle: '',
-        dialogVisible: false,
-        dialogdelVisible: false,
-        currentSelectRow: {}, // 当前选中行
-        form: {
-          id: '',
-          parentId: '',
-          dictKey: '',
-          code: '',
-          value: '',
-          attr: '',
-          remarks: '',
-          sort: ''
-        },
-        formRules: {
-          dictKey: [{required: true, message: '请输入字典唯一标识', trigger: 'blur'}],
-          code: [{required: true, message: '请输入字典编码', trigger: 'blur'}],
-          value: [{required: true, message: '请输入字典值', trigger: 'blur'}],
-        }
-      }
-    },
-    mounted () {
-      this.list()
-    },
-    methods: {
-      filterNode (value, data) {
-        if (!value) {
-          return true
-        }
-
-        return data.name.indexOf(value) !== -1
-      },
-      list () {
-        this.currentSelectRow = {}
-        this.tableData = []
-
-        let _data = {
-          data: {
-            gradeName: this.searchForm.gradeName,
-            name: this.searchForm.name,
-            subject: this.searchForm.subject
-          },
-          limit: this.searchForm.limit,
-          start: this.searchForm.start
-        }
-        paperApi.page(_data).then(data => {
-          this.total = data.total
-          this.tableData = data.data
-        })
-      },
-      rowClick (row, event, column) {
-        this.currentSelectRow = row
-      },
-      handleAdd () {
-        /* 重置表单 */
-        this.form['id'] = ''
-        this.form['parentId'] = this.currentSelectRow['id']
-        this.form['dictKey'] = ''
-        this.form['code'] = ''
-        this.form['value'] = ''
-        this.form['attr'] = ''
-        this.form['remarks'] = ''
-        this.form['sort'] = ''
-        this.dialogTitle = '新增'
-        this.dialogVisible = true
-      },
-      handleEdit (index,row) {
-        this.form['id'] = row.id
-        this.form['parentId'] = row.parentId
-        this.form['dictKey'] = row.dictKey
-        this.form['code'] = row.code
-        this.form['value'] = row.value
-        this.form['attr'] = row.attr
-        this.form['remarks'] =row.remark
-        this.form['sort'] = row.sort
-        this.dialogTitle = '编辑'
-        this.dialogVisible = true
-      },
-      handleDel (index,row) {
-        this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          dataDictionaryApi.deleteDataDictPoint(row.id).then(data => {
-            this.$message({
-              type: 'success',
-              message: '删除成功'
-            })
-
-            this.list()
-            this.load(this.uploadData.tree, this.uploadData.treeNode, this.uploadData.resolve)
-          })
-        })
-      },
-      load(tree, treeNode, resolve) {
-        this.uploadData.tree = tree
-        this.uploadData.treeNode = treeNode
-        this.uploadData.resolve = resolve
-        let value = tree.id
-
-        dataDictionaryApi.findDataDictById(value).then(data => {
-          data.forEach(item => {
-            //判断是否有子节点
-            if (item.size > 0) {
-              item.hasChildren = []
-            }
-          })
-
-          resolve(data)
-        })
-      },
-      handleSave () {
-        this.$refs['form'].validate((valid) => {
-          if (!valid) {
-            return
-          }
-
-          dataDictionaryApi.saveOrUpdate(this.form).then(data => {
-            this.dialogVisible = false
-            this.$refs['form'].resetFields()
-            this.list()
-          })
-        })
-      }
-    }
-  }
-</script>
-
-<style scoped>
-</style>

Some files were not shown because too many files changed in this diff