lsc 3 년 전
부모
커밋
fdd4694208

+ 41 - 0
build/build.js

@@ -0,0 +1,41 @@
+'use strict'
+require('./check-versions')()
+
+process.env.NODE_ENV = 'production'
+
+const ora = require('ora')
+const rm = require('rimraf')
+const path = require('path')
+const chalk = require('chalk')
+const webpack = require('webpack')
+const config = require('../config')
+const webpackConfig = require('./webpack.prod.conf')
+
+const spinner = ora('building for production...')
+spinner.start()
+
+rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
+  if (err) throw err
+  webpack(webpackConfig, (err, stats) => {
+    spinner.stop()
+    if (err) throw err
+    process.stdout.write(stats.toString({
+      colors: true,
+      modules: false,
+      children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
+      chunks: false,
+      chunkModules: false
+    }) + '\n\n')
+
+    if (stats.hasErrors()) {
+      console.log(chalk.red('  Build failed with errors.\n'))
+      process.exit(1)
+    }
+
+    console.log(chalk.cyan('  Build complete.\n'))
+    console.log(chalk.yellow(
+      '  Tip: built files are meant to be served over an HTTP server.\n' +
+      '  Opening index.html over file:// won\'t work.\n'
+    ))
+  })
+})

+ 54 - 0
build/check-versions.js

@@ -0,0 +1,54 @@
+'use strict'
+const chalk = require('chalk')
+const semver = require('semver')
+const packageConfig = require('../package.json')
+const shell = require('shelljs')
+
+function exec (cmd) {
+  return require('child_process').execSync(cmd).toString().trim()
+}
+
+const versionRequirements = [
+  {
+    name: 'node',
+    currentVersion: semver.clean(process.version),
+    versionRequirement: packageConfig.engines.node
+  }
+]
+
+if (shell.which('npm')) {
+  versionRequirements.push({
+    name: 'npm',
+    currentVersion: exec('npm --version'),
+    versionRequirement: packageConfig.engines.npm
+  })
+}
+
+module.exports = function () {
+  const warnings = []
+
+  for (let i = 0; i < versionRequirements.length; i++) {
+    const mod = versionRequirements[i]
+
+    if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
+      warnings.push(mod.name + ': ' +
+        chalk.red(mod.currentVersion) + ' should be ' +
+        chalk.green(mod.versionRequirement)
+      )
+    }
+  }
+
+  if (warnings.length) {
+    console.log('')
+    console.log(chalk.yellow('To use this template, you must update following to modules:'))
+    console.log()
+
+    for (let i = 0; i < warnings.length; i++) {
+      const warning = warnings[i]
+      console.log('  ' + warning)
+    }
+
+    console.log()
+    process.exit(1)
+  }
+}

BIN
build/logo.png


+ 102 - 0
build/utils.js

@@ -0,0 +1,102 @@
+'use strict'
+const path = require('path')
+const config = require('../config')
+const ExtractTextPlugin = require('extract-text-webpack-plugin')
+const packageConfig = require('../package.json')
+
+exports.assetsPath = function (_path) {
+  const assetsSubDirectory = process.env.NODE_ENV === 'production'
+    ? config.build.assetsSubDirectory
+    : config.dev.assetsSubDirectory
+
+  return path.posix.join(assetsSubDirectory, _path)
+}
+
+exports.cssLoaders = function (options) {
+  options = options || {}
+
+  const cssLoader = {
+    loader: 'css-loader',
+    options: {
+      sourceMap: options.sourceMap
+    }
+  }
+
+  const postcssLoader = {
+    loader: 'postcss-loader',
+    options: {
+      sourceMap: options.sourceMap
+    }
+  }
+
+  // generate loader string to be used with extract text plugin
+  function generateLoaders (loader, loaderOptions) {
+    const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
+
+    if (loader) {
+      loaders.push({
+        loader: loader + '-loader',
+        options: Object.assign({}, loaderOptions, {
+          sourceMap: options.sourceMap
+        })
+      })
+    }
+
+    // Extract CSS when that option is specified
+    // (which is the case during production build)
+    if (options.extract) {
+      return ExtractTextPlugin.extract({
+        use: loaders,
+        fallback: 'vue-style-loader',
+        publicPath: '../../'  //在此处添加这行代码
+      })
+    } else {
+      return ['vue-style-loader'].concat(loaders)
+    }
+  }
+
+  // https://vue-loader.vuejs.org/en/configurations/extract-css.html
+  return {
+    css: generateLoaders(),
+    postcss: generateLoaders(),
+    less: generateLoaders('less'),
+    sass: generateLoaders('sass', { indentedSyntax: true }),
+    scss: generateLoaders('sass'),
+    stylus: generateLoaders('stylus'),
+    styl: generateLoaders('stylus')
+  }
+}
+
+// Generate loaders for standalone style files (outside of .vue)
+exports.styleLoaders = function (options) {
+  const output = []
+  const loaders = exports.cssLoaders(options)
+
+  for (const extension in loaders) {
+    const loader = loaders[extension]
+    output.push({
+      test: new RegExp('\\.' + extension + '$'),
+      use: loader
+    })
+  }
+
+  return output
+}
+
+exports.createNotifierCallback = () => {
+  const notifier = require('node-notifier')
+
+  return (severity, errors) => {
+    if (severity !== 'error') return
+
+    const error = errors[0]
+    const filename = error.file && error.file.split('!').pop()
+
+    notifier.notify({
+      title: packageConfig.name,
+      message: severity + ': ' + error.name,
+      subtitle: filename || '',
+      icon: path.join(__dirname, 'logo.png')
+    })
+  }
+}

+ 22 - 0
build/vue-loader.conf.js

@@ -0,0 +1,22 @@
+'use strict'
+const utils = require('./utils')
+const config = require('../config')
+const isProduction = process.env.NODE_ENV === 'production'
+const sourceMapEnabled = isProduction
+  ? config.build.productionSourceMap
+  : config.dev.cssSourceMap
+
+module.exports = {
+  loaders: utils.cssLoaders({
+    sourceMap: sourceMapEnabled,
+    extract: isProduction
+  }),
+  cssSourceMap: sourceMapEnabled,
+  cacheBusting: config.dev.cacheBusting,
+  transformToRequire: {
+    video: ['src', 'poster'],
+    source: 'src',
+    img: 'src',
+    image: 'xlink:href'
+  }
+}

+ 82 - 0
build/webpack.base.conf.js

@@ -0,0 +1,82 @@
+'use strict'
+const path = require('path')
+const utils = require('./utils')
+const config = require('../config')
+const vueLoaderConfig = require('./vue-loader.conf')
+
+function resolve (dir) {
+  return path.join(__dirname, '..', dir)
+}
+
+
+
+module.exports = {
+  context: path.resolve(__dirname, '../'),
+  entry: {
+    app: './src/main.js'
+  },
+  output: {
+    path: config.build.assetsRoot,
+    filename: '[name].js',
+    publicPath: process.env.NODE_ENV === 'production'
+      ? config.build.assetsPublicPath
+      : config.dev.assetsPublicPath
+  },
+  resolve: {
+    extensions: ['.js', '.vue', '.json'],
+    alias: {
+      'vue$': 'vue/dist/vue.esm.js',
+      '@': resolve('src'),
+    }
+  },
+  module: {
+    rules: [
+      {
+        test: /\.vue$/,
+        loader: 'vue-loader',
+        options: vueLoaderConfig
+      },
+      {
+        test: /\.js$/,
+        loader: 'babel-loader',
+        include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
+      },
+      {
+        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
+        loader: 'url-loader',
+        options: {
+          limit: 10000,
+          name: utils.assetsPath('img/[name].[hash:7].[ext]')
+        }
+      },
+      {
+        test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
+        loader: 'url-loader',
+        options: {
+          limit: 10000,
+          name: utils.assetsPath('media/[name].[hash:7].[ext]')
+        }
+      },
+      {
+        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
+        loader: 'url-loader',
+        options: {
+          limit: 10000,
+          name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
+        }
+      }
+    ]
+  },
+  node: {
+    // prevent webpack from injecting useless setImmediate polyfill because Vue
+    // source contains it (although only uses it if it's native).
+    setImmediate: false,
+    // prevent webpack from injecting mocks to Node native modules
+    // that does not make sense for the client
+    dgram: 'empty',
+    fs: 'empty',
+    net: 'empty',
+    tls: 'empty',
+    child_process: 'empty'
+  }
+}

+ 95 - 0
build/webpack.dev.conf.js

@@ -0,0 +1,95 @@
+'use strict'
+const utils = require('./utils')
+const webpack = require('webpack')
+const config = require('../config')
+const merge = require('webpack-merge')
+const path = require('path')
+const baseWebpackConfig = require('./webpack.base.conf')
+const CopyWebpackPlugin = require('copy-webpack-plugin')
+const HtmlWebpackPlugin = require('html-webpack-plugin')
+const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
+const portfinder = require('portfinder')
+
+const HOST = process.env.HOST
+const PORT = process.env.PORT && Number(process.env.PORT)
+
+const devWebpackConfig = merge(baseWebpackConfig, {
+  module: {
+    rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
+  },
+  // cheap-module-eval-source-map is faster for development
+  devtool: config.dev.devtool,
+
+  // these devServer options should be customized in /config/index.js
+  devServer: {
+    clientLogLevel: 'warning',
+    historyApiFallback: {
+      rewrites: [
+        { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
+      ],
+    },
+    hot: true,
+    contentBase: false, // since we use CopyWebpackPlugin.
+    compress: true,
+    host: HOST || config.dev.host,
+    port: PORT || config.dev.port,
+    open: config.dev.autoOpenBrowser,
+    overlay: config.dev.errorOverlay
+      ? { warnings: false, errors: true }
+      : false,
+    publicPath: config.dev.assetsPublicPath,
+    proxy: config.dev.proxyTable,
+    quiet: true, // necessary for FriendlyErrorsPlugin
+    watchOptions: {
+      poll: config.dev.poll,
+    }
+  },
+  plugins: [
+    new webpack.DefinePlugin({
+      'process.env': require('../config/dev.env')
+    }),
+    new webpack.HotModuleReplacementPlugin(),
+    new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
+    new webpack.NoEmitOnErrorsPlugin(),
+    // https://github.com/ampedandwired/html-webpack-plugin
+    new HtmlWebpackPlugin({
+      filename: 'index.html',
+      template: 'index.html',
+      inject: true
+    }),
+    // copy custom static assets
+    new CopyWebpackPlugin([
+      {
+        from: path.resolve(__dirname, '../static'),
+        to: config.dev.assetsSubDirectory,
+        ignore: ['.*']
+      }
+    ])
+  ]
+})
+
+module.exports = new Promise((resolve, reject) => {
+  portfinder.basePort = process.env.PORT || config.dev.port
+  portfinder.getPort((err, port) => {
+    if (err) {
+      reject(err)
+    } else {
+      // publish the new Port, necessary for e2e tests
+      process.env.PORT = port
+      // add port to devServer config
+      devWebpackConfig.devServer.port = port
+
+      // Add FriendlyErrorsPlugin
+      devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
+        compilationSuccessInfo: {
+          messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
+        },
+        onErrors: config.dev.notifyOnErrors
+        ? utils.createNotifierCallback()
+        : undefined
+      }))
+
+      resolve(devWebpackConfig)
+    }
+  })
+})

+ 145 - 0
build/webpack.prod.conf.js

@@ -0,0 +1,145 @@
+'use strict'
+const path = require('path')
+const utils = require('./utils')
+const webpack = require('webpack')
+const config = require('../config')
+const merge = require('webpack-merge')
+const baseWebpackConfig = require('./webpack.base.conf')
+const CopyWebpackPlugin = require('copy-webpack-plugin')
+const HtmlWebpackPlugin = require('html-webpack-plugin')
+const ExtractTextPlugin = require('extract-text-webpack-plugin')
+const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
+const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
+
+const env = require('../config/prod.env')
+
+const webpackConfig = merge(baseWebpackConfig, {
+  module: {
+    rules: utils.styleLoaders({
+      sourceMap: config.build.productionSourceMap,
+      extract: true,
+      usePostCSS: true
+    })
+  },
+  devtool: config.build.productionSourceMap ? config.build.devtool : false,
+  output: {
+    path: config.build.assetsRoot,
+    filename: utils.assetsPath('js/[name].[chunkhash].js'),
+    chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
+  },
+  plugins: [
+    // http://vuejs.github.io/vue-loader/en/workflow/production.html
+    new webpack.DefinePlugin({
+      'process.env': env
+    }),
+    new UglifyJsPlugin({
+      uglifyOptions: {
+        compress: {
+          warnings: false
+        }
+      },
+      sourceMap: config.build.productionSourceMap,
+      parallel: true
+    }),
+    // extract css into its own file
+    new ExtractTextPlugin({
+      filename: utils.assetsPath('css/[name].[contenthash].css'),
+      // Setting the following option to `false` will not extract CSS from codesplit chunks.
+      // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
+      // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 
+      // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
+      allChunks: true,
+    }),
+    // Compress extracted CSS. We are using this plugin so that possible
+    // duplicated CSS from different components can be deduped.
+    new OptimizeCSSPlugin({
+      cssProcessorOptions: config.build.productionSourceMap
+        ? { safe: true, map: { inline: false } }
+        : { safe: true }
+    }),
+    // generate dist index.html with correct asset hash for caching.
+    // you can customize output by editing /index.html
+    // see https://github.com/ampedandwired/html-webpack-plugin
+    new HtmlWebpackPlugin({
+      filename: config.build.index,
+      template: 'index.html',
+      inject: true,
+      minify: {
+        removeComments: true,
+        collapseWhitespace: true,
+        removeAttributeQuotes: true
+        // more options:
+        // https://github.com/kangax/html-minifier#options-quick-reference
+      },
+      // necessary to consistently work with multiple chunks via CommonsChunkPlugin
+      chunksSortMode: 'dependency'
+    }),
+    // keep module.id stable when vendor modules does not change
+    new webpack.HashedModuleIdsPlugin(),
+    // enable scope hoisting
+    new webpack.optimize.ModuleConcatenationPlugin(),
+    // split vendor js into its own file
+    new webpack.optimize.CommonsChunkPlugin({
+      name: 'vendor',
+      minChunks (module) {
+        // any required modules inside node_modules are extracted to vendor
+        return (
+          module.resource &&
+          /\.js$/.test(module.resource) &&
+          module.resource.indexOf(
+            path.join(__dirname, '../node_modules')
+          ) === 0
+        )
+      }
+    }),
+    // extract webpack runtime and module manifest to its own file in order to
+    // prevent vendor hash from being updated whenever app bundle is updated
+    new webpack.optimize.CommonsChunkPlugin({
+      name: 'manifest',
+      minChunks: Infinity
+    }),
+    // This instance extracts shared chunks from code splitted chunks and bundles them
+    // in a separate chunk, similar to the vendor chunk
+    // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
+    new webpack.optimize.CommonsChunkPlugin({
+      name: 'app',
+      async: 'vendor-async',
+      children: true,
+      minChunks: 3
+    }),
+
+    // copy custom static assets
+    new CopyWebpackPlugin([
+      {
+        from: path.resolve(__dirname, '../static'),
+        to: config.build.assetsSubDirectory,
+        ignore: ['.*']
+      }
+    ])
+  ]
+})
+
+if (config.build.productionGzip) {
+  const CompressionWebpackPlugin = require('compression-webpack-plugin')
+
+  webpackConfig.plugins.push(
+    new CompressionWebpackPlugin({
+      asset: '[path].gz[query]',
+      algorithm: 'gzip',
+      test: new RegExp(
+        '\\.(' +
+        config.build.productionGzipExtensions.join('|') +
+        ')$'
+      ),
+      threshold: 10240,
+      minRatio: 0.8
+    })
+  )
+}
+
+if (config.build.bundleAnalyzerReport) {
+  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
+  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
+}
+
+module.exports = webpackConfig

+ 2 - 2
index.html

@@ -4,8 +4,8 @@
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1.0">
-  <title>尚美乐劳动</title>
-    <link rel="shortcut icon" type="image/x-icon" href="static/logo.ico">
+  <title>pbl</title>
+    <!-- <link rel="shortcut icon" type="image/x-icon" href="static/logo.ico"> -->
   <style>
     @charset "utf-8";
 

+ 21 - 7
src/App.vue

@@ -1,11 +1,18 @@
 <template>
   <div id="app">
-    <div class="app_head" :class="{userWidth:$route.path == '/userManage'}">
+    <div class="app_head" :class="{ userWidth: $route.path == '/userManage' }">
       <div class="logo"></div>
       <span style="margin-left: 10px; color: #fff; font-weight: 600"
-        >劳动教育平台-总后台管理</span
+        >PBL教育平台-总后台管理</span
       >
-      <div class="user_head" v-if="this.$store.state.isLogin">
+      <div class="user_head">
+        <div>
+          <el-button type="text" style="color: white" @click="Login()"
+            >登录</el-button
+          >
+        </div>
+      </div>
+      <!-- <div class="user_head" v-if="this.$store.state.isLogin">
         <div class="noticeBox">
           <i class="noticeI" @click="goTo('/userManage?cclass=1')"></i>
           <span v-if="this.$store.state.nCount != 0">{{
@@ -19,7 +26,7 @@
             >退出</el-button
           >
         </div>
-      </div>
+      </div> -->
     </div>
     <div class="app">
       <!-- main 内容 -->
@@ -71,6 +78,7 @@ export default {
         "/userManage",
         "/works",
         "/class",
+        "/template",
       ], // 导航
       loading: "",
     };
@@ -79,6 +87,9 @@ export default {
     "footer-nav": leftBar,
   },
   created: function () {
+    // debugger
+    console.log(this.$store.state);
+    // this.$store.commit("update", ["isLogin", 123]);
     this.routerP();
     this.getnCount();
     setInterval(() => {
@@ -86,6 +97,9 @@ export default {
     }, 60000);
   },
   methods: {
+    Login() {
+      this.$router.push("/login");
+    },
     isLogin() {
       const loading = this.$loading.service({
         background: "rgba(255, 255, 255)",
@@ -116,7 +130,7 @@ export default {
       let router_path = this.$route.path;
       console.log(router_path);
       if (router_path != "/login") {
-        this.isLogin();
+        // this.isLogin();
       }
       var a = 0;
       for (var i = 0; i < navTabs.length; i++) {
@@ -308,7 +322,7 @@ body {
   top: -3px;
   right: -3px;
 }
-.userWidth{
-      min-width: 1420px;
+.userWidth {
+  min-width: 1420px;
 }
 </style>

BIN
src/assets/logo.png


+ 29 - 28
src/components/login.vue

@@ -69,34 +69,35 @@ export default {
       }
     },
     findPhone() {
-      if (this.phoneNum === "") {
-        this.$message.error("请输入账号");
-        return;
-      } else if (this.password === "") {
-        this.$message.error("请输入密码");
-        return;
-      }
-      let params = { phone: this.phoneNum };
-      this.ajax
-        .get(this.$store.state.api + "findPhone", params)
-        .then((res) => {
-          if (res.data[0].length > 0) {
-            if (res.data[0][0].type == 0) {
-              // this.sqlPassword = res.data[0][0].userpassword;
-            } else {
-              this.$message.error("您的账号不是管理员账号");
-              return;
-            }
-          } else {
-            this.$message.error("请使用管理员账号登录");
-            return;
-          }
-          this.login();
-          console.log(res.data[0][0]);
-        })
-        .catch((err) => {
-          console.error(err);
-        });
+      this.$router.push("/");
+      // if (this.phoneNum === "") {
+      //   this.$message.error("请输入账号");
+      //   return;
+      // } else if (this.password === "") {
+      //   this.$message.error("请输入密码");
+      //   return;
+      // }
+      // let params = { phone: this.phoneNum };
+      // this.ajax
+      //   .get(this.$store.state.api + "findPhone", params)
+      //   .then((res) => {
+      //     if (res.data[0].length > 0) {
+      //       if (res.data[0][0].type == 0) {
+      //         // this.sqlPassword = res.data[0][0].userpassword;
+      //       } else {
+      //         this.$message.error("您的账号不是管理员账号");
+      //         return;
+      //       }
+      //     } else {
+      //       this.$message.error("请使用管理员账号登录");
+      //       return;
+      //     }
+      //     this.login();
+      //     console.log(res.data[0][0]);
+      //   })
+      //   .catch((err) => {
+      //     console.error(err);
+      //   });
     },
     login() {
       if (this.time()) {

+ 126 - 93
src/components/pages/class.vue

@@ -37,14 +37,21 @@
           <el-table-column
             prop="school"
             label="学校名称"
-            min-width="40%"
+            min-width="25%"
             align="center"
           >
           </el-table-column>
           <el-table-column
             prop="name"
             label="班级名称"
-            min-width="40%"
+            min-width="25%"
+            align="center"
+          >
+          </el-table-column>
+                    <el-table-column
+            prop="pCount"
+            label="人数"
+            min-width="25%"
             align="center"
           >
           </el-table-column>
@@ -118,12 +125,37 @@ export default {
       className: "",
       formLabelWidth: "80px",
       dialogVisible: false,
-      tableData: [],
-      total: null,
-      page: null,
+      tableData: [
+        {
+          create_at: "2021-09-09T13:44:27.000Z",
+          createuserid: "0",
+          id: "77cccfe1-110f-11ec-80ad-005056b86db5",
+          name: "一年级七班",
+          num: 44,
+          oid: "1123",
+          order: 100,
+          pCount:"53",
+          parentid: "3",
+          school: "深圳市龙岗区麓城外国语小学",
+        },
+        {
+          create_at: "2021-09-09T13:44:27.000Z",
+          createuserid: "0",
+          id: "77cccfe1-110f-11ec-80ad-005056b86db4",
+          name: "初一一班",
+          num: 44,
+          oid: "1123",
+          order: 100,
+          pCount:"46",
+          parentid: "3",
+          school: "深圳市龙岗区麓城外国语小学",
+        },
+      ],
+      total: 0,
+      page: 1,
       oid: "",
       isListAjax: false,
-      schoolArray:[]
+      schoolArray: [],
     };
   },
   mounted() {
@@ -147,8 +179,8 @@ export default {
   },
   created() {
     this.page = 1;
-    this.getClass();
-    this.getOrg();
+    // this.getClass();
+    // this.getOrg();
   },
   methods: {
     tableRowClassName({ row, rowIndex }) {
@@ -185,9 +217,9 @@ export default {
     },
     //搜索班级
     searchClass() {
-      this.page = 1;
-      this.isListAjax = true;
-      this.getClass();
+      // this.page = 1;
+      // this.isListAjax = true;
+      // this.getClass();
     },
     //获取班级
     getClass() {
@@ -204,6 +236,7 @@ export default {
           this.isLoading = false;
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
           this.tableData = res.data[0];
+          console.log(this.tableData);
         })
         .catch((err) => {
           this.isLoading = false;
@@ -226,89 +259,89 @@ export default {
     },
     //添加班级
     insertClass() {
-      let _this = this
-      console.log(this.$store.state.userInfo);
-      if (this.oid === "") {
-        this.$message.error("请选择学校");
-        return;
-      }
-      if (this.className === "") {
-        this.$message.error("班级名字不能为空");
-        return;
-      }
-      let params = [{ oid: this.oid, n: this.className, cuid: "0" }];
-      let params2 = { pid: this.oid, n: this.className };
-      let a = 1
-      $.ajax({
-          url: this.$store.state.api + "getClassRepeat", //url路径
-          type: "GET", //GET
-          async: false, //或false,是否异步
-          data: params2,
-          timeout: 5000, //超时时间
-          dataType: "json", //返回的数据格式:
-          beforeSend: function (xhr) {},
-          success: function (res, textStatus, jqXHR) {
-            if (res[0][0].num > 0) {
-              _this.$message.error(
-                "此学校已存在此班级!"
-              );
-              a = 2;
-            }
-          },
-          error: function (xhr, textStatus) {
-            console.log(textStatus);
-          },
-          complete: function () {},
-        });
-      if (this.time() && a == 1) {
-        this.ajax
-          .post(this.$store.state.api + "insertClass", params)
-          .then((res) => {
-            this.$message({
-              message: "添加成功",
-              type: "success",
-            });
-            this.sClassName = "";
-            this.className = "";
-            this.page = 1;
-            this.getClass();
-            this.dialogVisible = false;
-          })
-          .catch((err) => {
-            this.$message.error("添加失败");
-            console.error(err);
-          });
-      }
+      // let _this = this
+      // console.log(this.$store.state.userInfo);
+      // if (this.oid === "") {
+      //   this.$message.error("请选择学校");
+      //   return;
+      // }
+      // if (this.className === "") {
+      //   this.$message.error("班级名字不能为空");
+      //   return;
+      // }
+      // let params = [{ oid: this.oid, n: this.className, cuid: "0" }];
+      // let params2 = { pid: this.oid, n: this.className };
+      // let a = 1
+      // $.ajax({
+      //     url: this.$store.state.api + "getClassRepeat", //url路径
+      //     type: "GET", //GET
+      //     async: false, //或false,是否异步
+      //     data: params2,
+      //     timeout: 5000, //超时时间
+      //     dataType: "json", //返回的数据格式:
+      //     beforeSend: function (xhr) {},
+      //     success: function (res, textStatus, jqXHR) {
+      //       if (res[0][0].num > 0) {
+      //         _this.$message.error(
+      //           "此学校已存在此班级!"
+      //         );
+      //         a = 2;
+      //       }
+      //     },
+      //     error: function (xhr, textStatus) {
+      //       console.log(textStatus);
+      //     },
+      //     complete: function () {},
+      //   });
+      // if (this.time() && a == 1) {
+      //   this.ajax
+      //     .post(this.$store.state.api + "insertClass", params)
+      //     .then((res) => {
+      //       this.$message({
+      //         message: "添加成功",
+      //         type: "success",
+      //       });
+      //       this.sClassName = "";
+      //       this.className = "";
+      //       this.page = 1;
+      //       this.getClass();
+      //       this.dialogVisible = false;
+      //     })
+      //     .catch((err) => {
+      //       this.$message.error("添加失败");
+      //       console.error(err);
+      //     });
+      // }
     },
     //删除班级
     deleteClass(row) {
-      let params = [{ id: row.id }];
-      this.$confirm("确定删除此班级吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.ajax
-            .post(this.$store.state.api + "deleteClass", params)
-            .then((res) => {
-              this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              this.className = "";
-              if (this.page != 1 && this.tableData.length == 1) {
-                this.page--;
-              }
-              this.getClass();
-              this.dialogVisible = false;
-            })
-            .catch((err) => {
-              this.$message.error("删除失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
+      // let params = [{ id: row.id }];
+      // this.$confirm("确定删除此班级吗?", "提示", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning",
+      // })
+      //   .then(() => {
+      //     this.ajax
+      //       .post(this.$store.state.api + "deleteClass", params)
+      //       .then((res) => {
+      //         this.$message({
+      //           message: "删除成功",
+      //           type: "success",
+      //         });
+      //         this.className = "";
+      //         if (this.page != 1 && this.tableData.length == 1) {
+      //           this.page--;
+      //         }
+      //         this.getClass();
+      //         this.dialogVisible = false;
+      //       })
+      //       .catch((err) => {
+      //         this.$message.error("删除失败");
+      //         console.error(err);
+      //       });
+      //   })
+      //   .catch(() => {});
     },
   },
 };
@@ -331,9 +364,9 @@ export default {
 .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
   color: #fff;
 }
-.student_head >>> .el-button--primary {
+/* .student_head >>> .el-button--primary {
   background-color: #2268bc;
-}
+} */
 .pb_content {
   box-sizing: border-box;
   padding: 20px;

+ 42 - 35
src/components/pages/curriculum.vue

@@ -39,12 +39,12 @@
                   @click="goTo('/course?index=1&id=' + scope.row.courseId)"
                   >查看</el-button
                 >
-                <el-button
+                <!-- <el-button
                   size="mini"
                   type="primary"
                   @click="updatePop(scope.row.courseId)"
                   >修改</el-button
-                >
+                > -->
                 <el-button
                   size="mini"
                   type="primary"
@@ -230,7 +230,14 @@ export default {
       tableHeight: 500,
       courseName: "",
       dialogVisible: false,
-      tableData: [],
+      tableData: [
+        {
+"cuser":"张子林",
+"title":"印象端午",
+"groupName":"文化之旅",
+"time":"2020-12-28 10:18",
+        }
+      ],
       page: 1,
       total: 0,
       isLoading: false,
@@ -259,7 +266,7 @@ export default {
   },
   methods: {
     goTo(path) {
-      this.$router.push(path);
+      // this.$router.push(path);
     },
     change(val) {
       console.log(val);
@@ -499,39 +506,39 @@ export default {
       }
     },
     search() {
-      this.page = 1;
-      this.isListAjax = true;
-      this.getCourse();
+      // this.page = 1;
+      // this.isListAjax = true;
+      // this.getCourse();
     },
     //删除课程
     deleteCourse(cid) {
-      let params = [{ cid: cid }];
-      if (this.time()) {
-        this.$confirm("确定删除此课程吗?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-          .then(() => {
-            this.ajax
-              .post(this.$store.state.api + "deleteCourse", params)
-              .then((res) => {
-                this.$message({
-                  message: "删除成功",
-                  type: "success",
-                });
-                if (this.page != 1 && this.tableData.length == 1) {
-                  this.page--;
-                }
-                this.getCourse();
-              })
-              .catch((err) => {
-                this.$message.error("修改失败");
-                console.error(err);
-              });
-          })
-          .catch(() => {});
-      }
+      // let params = [{ cid: cid }];
+      // if (this.time()) {
+      //   this.$confirm("确定删除此课程吗?", "提示", {
+      //     confirmButtonText: "确定",
+      //     cancelButtonText: "取消",
+      //     type: "warning",
+      //   })
+      //     .then(() => {
+      //       this.ajax
+      //         .post(this.$store.state.api + "deleteCourse", params)
+      //         .then((res) => {
+      //           this.$message({
+      //             message: "删除成功",
+      //             type: "success",
+      //           });
+      //           if (this.page != 1 && this.tableData.length == 1) {
+      //             this.page--;
+      //           }
+      //           this.getCourse();
+      //         })
+      //         .catch((err) => {
+      //           this.$message.error("修改失败");
+      //           console.error(err);
+      //         });
+      //     })
+      //     .catch(() => {});
+      // }
     },
     //uuid生成
     guid() {
@@ -705,7 +712,7 @@ export default {
   created() {
     this.$nextTick(function () {
       this.page = 1;
-      this.getCourse();
+      // this.getCourse();
       this.changeHeight();
       this.getGroup();
       // this.getJuri();

+ 71 - 57
src/components/pages/grouping.vue

@@ -27,19 +27,19 @@
           <el-table-column prop="date" label="操作" min-width="30">
             <template slot-scope="scope">
               <div class="pb_buttonBox">
-                <el-button
+                <!-- <el-button
                   size="mini"
                   type="primary"
                   @click="updatePop(scope.row.id, scope.$index)"
                   >修改</el-button
-                >
+                > -->
                 <el-button
                   size="mini"
                   type="primary"
                   @click="deleteGroup(scope.row.id)"
                   >删除</el-button
                 >
-                <el-button
+                <!-- <el-button
                   size="mini"
                   type="primary"
                   @click="addGPop(scope.row.id)"
@@ -50,7 +50,7 @@
                   type="primary"
                   @click="getGPop(scope.row.id)"
                   >查看年级</el-button
-                >
+                > -->
               </div>
             </template>
           </el-table-column>
@@ -135,14 +135,21 @@
           <el-table-column prop="date" label="操作" min-width="30">
             <template slot-scope="scope">
               <div class="pb_buttonBox">
-                <el-button size="mini" type="primary" @click="deleteGrade(scope.row.id)">删除</el-button>
+                <el-button
+                  size="mini"
+                  type="primary"
+                  @click="deleteGrade(scope.row.id)"
+                  >删除</el-button
+                >
               </div>
             </template>
           </el-table-column>
         </el-table>
       </div>
       <span slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="garadeDialog = false">关 闭</el-button>
+        <el-button type="primary" @click="garadeDialog = false"
+          >关 闭</el-button
+        >
       </span>
     </el-dialog>
     <el-dialog
@@ -174,7 +181,14 @@ export default {
   data() {
     return {
       dialogVisible1: false,
-      tableData: [],
+      tableData: [
+        {
+          name: "艺术之美",
+        },
+        {
+          name: "文化之旅",
+        },
+      ],
       page: 1,
       total: 0,
       isLoading: false,
@@ -246,53 +260,53 @@ export default {
       // this.$refs.table.$el.offsetTop:表格距离浏览器的高度 //200表示你想要调整的表格距离底部的高度(你可以自己随意调整),因为我们一般都有放分页组件的,所以需要给它留一个高度
     },
     addGroup() {
-      if (this.time()) {
-        let params = [{ n: this.groupName }];
-        this.ajax
-          .post(this.$store.state.api + "addGroup", params)
-          .then((res) => {
-            this.$message({
-              message: "添加成功",
-              type: "success",
-            });
-            this.dialogVisible1 = false;
-            this.groupName = "";
-            this.getGroup();
-          })
-          .catch((err) => {
-            this.$message.error("添加失败");
-            console.error(err);
-          });
-      }
+      // if (this.time()) {
+      //   let params = [{ n: this.groupName }];
+      //   this.ajax
+      //     .post(this.$store.state.api + "addGroup", params)
+      //     .then((res) => {
+      //       this.$message({
+      //         message: "添加成功",
+      //         type: "success",
+      //       });
+      //       this.dialogVisible1 = false;
+      //       this.groupName = "";
+      //       this.getGroup();
+      //     })
+      //     .catch((err) => {
+      //       this.$message.error("添加失败");
+      //       console.error(err);
+      //     });
+      // }
     },
     deleteGroup(id) {
-      let params = [{ id: id }];
-      var _this = this;
-      _this
-        .$confirm("确定删除此分组吗?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-        .then(() => {
-          _this.ajax
-            .post(_this.$store.state.api + "deleteClass", params)
-            .then((res) => {
-              _this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              if (_this.page != 1 && _this.tableData.length == 1) {
-                _this.page--;
-              }
-              _this.getGroup();
-            })
-            .catch((err) => {
-              _this.$message.error("删除失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
+      // let params = [{ id: id }];
+      // var _this = this;
+      // _this
+      //   .$confirm("确定删除此分组吗?", "提示", {
+      //     confirmButtonText: "确定",
+      //     cancelButtonText: "取消",
+      //     type: "warning",
+      //   })
+      //   .then(() => {
+      //     _this.ajax
+      //       .post(_this.$store.state.api + "deleteClass", params)
+      //       .then((res) => {
+      //         _this.$message({
+      //           message: "删除成功",
+      //           type: "success",
+      //         });
+      //         if (_this.page != 1 && _this.tableData.length == 1) {
+      //           _this.page--;
+      //         }
+      //         _this.getGroup();
+      //       })
+      //       .catch((err) => {
+      //         _this.$message.error("删除失败");
+      //         console.error(err);
+      //       });
+      //   })
+      //   .catch(() => {});
     },
     updatePop(id, index) {
       this.dialogVisible2 = true;
@@ -329,7 +343,7 @@ export default {
       this.updateId = id;
       this.garadeDialog = true;
       this.isLoading2 = true;
-    
+
       let params = { pid: id };
       this.ajax
         .get(this.$store.state.api + "getGroupGrade", params)
@@ -362,8 +376,8 @@ export default {
           });
       }
     },
-    deleteGrade(id){
-       let params = [{ id: id }];
+    deleteGrade(id) {
+      let params = [{ id: id }];
       var _this = this;
       _this
         .$confirm("确定删除此年级吗?", "提示", {
@@ -387,13 +401,13 @@ export default {
             });
         })
         .catch(() => {});
-    }
+    },
   },
   created() {
     this.$nextTick(function () {
       this.page = 1;
       this.changeHeight();
-      this.getGroup();
+      // this.getGroup();
     });
   },
 };

+ 238 - 185
src/components/pages/home.vue

@@ -6,9 +6,8 @@
         <div>
           <div class="home_titleHead">
             <div class="ban">Banner管理</div>
-            <el-button size="small" type="primary" @click="dialogVisible = true"
-              >添加图片</el-button
-            >
+            <el-button size="small" type="primary">添加图片</el-button>
+            <!-- @click="dialogVisible = true" -->
           </div>
           <el-table
             :data="tableData"
@@ -106,12 +105,12 @@
             </el-table-column>
             <el-table-column label="操作" min-width="25">
               <template slot-scope="scope">
-                <el-button
+                <!-- <el-button
                   size="mini"
                   type="primary"
                   @click="goTo('/course?index=2&id=' + scope.row.courseId)"
                   >查看</el-button
-                >
+                > -->
                 <el-button
                   size="mini"
                   style="删除"
@@ -331,9 +330,64 @@ export default {
       linkInput: "",
       checkList: [],
       courseList: [],
-      tableData: [],
-      zoneList: [],
-      zoneClass: {},
+      tableData: [
+        {
+          create_at: "2021-04-23T20:14:49.000Z",
+          id: "f9010b15-a40b-11eb-80ad-005056b86db5",
+          number: 0,
+          poster:
+            "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/组211619165665500.png",
+          title: "麓城外国语小学-我是种植小能手-406胡智航",
+          url: "5fbbdeb1-96a2-11eb-80ad-005056b86db5",
+          userid: "0",
+        },
+      ],
+      zoneList: [
+        {
+          create_at: "2021-04-06T19:37:56.000Z",
+          createuserid: "0",
+          id: "1",
+          name: "热门推荐",
+          oid: null,
+          order: 6,
+          parentid: "1",
+        },
+        {
+          create_at: "2021-04-06T19:37:56.000Z",
+          createuserid: "0",
+          id: "2",
+          name: "PBL热门项目",
+          oid: null,
+          order: 6,
+          parentid: "1",
+        },
+      ],
+      zoneClass: {
+        1: [
+          {
+            title: "印象中秋",
+            brief: "印象中秋",
+            vcount: "123",
+          },
+          {
+            title: "深圳发展40周年",
+            brief: "深圳发展40周年",
+            vcount: "456",
+          },
+        ],
+        2: [
+          {
+            title: "印象中秋",
+            brief: "印象中秋",
+            vcount: "123",
+          },
+          {
+            title: "深圳发展40周年",
+            brief: "深圳发展40周年",
+            vcount: "456",
+          },
+        ],
+      },
       page: {},
       total: {},
       pid: "",
@@ -502,77 +556,77 @@ export default {
     },
     //添加课程专区
     addZone() {
-      if (this.zoneName === "") {
-        this.$message.error("请填写添加课程专区名称");
-        return;
-      }
-      if (this.time()) {
-        let params = [{ n: this.zoneName, cuid: "0" }];
-        this.ajax
-          .post(this.$store.state.api + "addZone", params)
-          .then((res) => {
-            this.$message({
-              message: "添加成功",
-              type: "success",
-            });
-            this.zoneName = "";
-            this.dialogVisible4 = false;
-            this.init();
-            this.getZone();
-          })
-          .catch((err) => {
-            this.$message.error("添加失败");
-            console.error(err);
-          });
-      }
+      // if (this.zoneName === "") {
+      //   this.$message.error("请填写添加课程专区名称");
+      //   return;
+      // }
+      // if (this.time()) {
+      //   let params = [{ n: this.zoneName, cuid: "0" }];
+      //   this.ajax
+      //     .post(this.$store.state.api + "addZone", params)
+      //     .then((res) => {
+      //       this.$message({
+      //         message: "添加成功",
+      //         type: "success",
+      //       });
+      //       this.zoneName = "";
+      //       this.dialogVisible4 = false;
+      //       this.init();
+      //       this.getZone();
+      //     })
+      //     .catch((err) => {
+      //       this.$message.error("添加失败");
+      //       console.error(err);
+      //     });
+      // }
     },
     //获取专区下的课程数量
     getZoneNum(zid) {
-      let params = { bid: zid };
-      this.ajax
-        .get(this.$store.state.api + "getZoneClassNum", params)
-        .then((res) => {
-          if (res.data[0][0].num > 0) {
-            this.$message.error("请把专区底下的课程全部删除才可以删除专区");
-          } else {
-            this.deleteZone(zid);
-          }
-        })
-        .catch((err) => {
-          console.error(err);
-        });
+      // let params = { bid: zid };
+      // this.ajax
+      //   .get(this.$store.state.api + "getZoneClassNum", params)
+      //   .then((res) => {
+      //     if (res.data[0][0].num > 0) {
+      //       this.$message.error("请把专区底下的课程全部删除才可以删除专区");
+      //     } else {
+      //       this.deleteZone(zid);
+      //     }
+      //   })
+      //   .catch((err) => {
+      //     console.error(err);
+      //   });
     },
     //删除课程专区
     deleteZone(zid) {
-      let params = [{ id: zid }];
-      this.$confirm("确定删除此专区吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.ajax
-            .post(this.$store.state.api + "deleteZone", params)
-            .then((res) => {
-              this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              this.getZone();
-            })
-            .catch((err) => {
-              this.$message.error("删除失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
+      // let params = [{ id: zid }];
+      // this.$confirm("确定删除此专区吗?", "提示", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning",
+      // })
+      //   .then(() => {
+      //     this.ajax
+      //       .post(this.$store.state.api + "deleteZone", params)
+      //       .then((res) => {
+      //         this.$message({
+      //           message: "删除成功",
+      //           type: "success",
+      //         });
+      //         this.getZone();
+      //       })
+      //       .catch((err) => {
+      //         this.$message.error("删除失败");
+      //         console.error(err);
+      //       });
+      //   })
+      //   .catch(() => {});
     },
     //打开添加弹窗
     addPop(zid) {
-      this.init();
-      this.dialogVisible1 = true;
-      this.pid = zid;
-      this.Search();
+      // this.init();
+      // this.dialogVisible1 = true;
+      // this.pid = zid;
+      // this.Search();
     },
     //打开添加弹窗
     addBannerUrlPop() {
@@ -671,60 +725,59 @@ export default {
     },
     //删除课程专区
     deleteZoneCourse(id, zid) {
-      let params = [{ id: id }];
-      this.$confirm("确定把此课程从次专区删除吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.ajax
-            .post(this.$store.state.api + "deleteZoneCourse", params)
-            .then((res) => {
-              this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              this.getZoneClass(zid);
-            })
-            .catch((err) => {
-              this.$message.error("删除失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
+      // let params = [{ id: id }];
+      // this.$confirm("确定把此课程从次专区删除吗?", "提示", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning",
+      // })
+      //   .then(() => {
+      //     this.ajax
+      //       .post(this.$store.state.api + "deleteZoneCourse", params)
+      //       .then((res) => {
+      //         this.$message({
+      //           message: "删除成功",
+      //           type: "success",
+      //         });
+      //         this.getZoneClass(zid);
+      //       })
+      //       .catch((err) => {
+      //         this.$message.error("删除失败");
+      //         console.error(err);
+      //       });
+      //   })
+      //   .catch(() => {});
     },
     //把课程添加进专区
     addBanner() {
-      var list = this.fileList;
-
-      if (list.length == 0) {
-        this.$message.error("请上传需要添加的banner");
-        return;
-      } else if (this.bannerCourse === "") {
-        this.$message.error("请填写选择banner的链接");
-        return;
-      }
-      if (this.time()) {
-        let params = [
-          { p: list[0].url, url: this.bannerCourse.courseId, uid: "0", n: "0" },
-        ];
-        this.ajax
-          .post(this.$store.state.api + "addBanner", params)
-          .then((res) => {
-            this.$message({
-              message: "添加成功",
-              type: "success",
-            });
-            this.dialogVisible = false;
-            this.init();
-            this.getBanner();
-          })
-          .catch((err) => {
-            this.$message.error("添加失败");
-            console.error(err);
-          });
-      }
+      // var list = this.fileList;
+      // if (list.length == 0) {
+      //   this.$message.error("请上传需要添加的banner");
+      //   return;
+      // } else if (this.bannerCourse === "") {
+      //   this.$message.error("请填写选择banner的链接");
+      //   return;
+      // }
+      // if (this.time()) {
+      //   let params = [
+      //     { p: list[0].url, url: this.bannerCourse.courseId, uid: "0", n: "0" },
+      //   ];
+      //   this.ajax
+      //     .post(this.$store.state.api + "addBanner", params)
+      //     .then((res) => {
+      //       this.$message({
+      //         message: "添加成功",
+      //         type: "success",
+      //       });
+      //       this.dialogVisible = false;
+      //       this.init();
+      //       this.getBanner();
+      //     })
+      //     .catch((err) => {
+      //       this.$message.error("添加失败");
+      //       console.error(err);
+      //     });
+      // }
     },
     //获取banner
     getBanner() {
@@ -740,72 +793,72 @@ export default {
     },
     //删除banner
     deleteBanner(id) {
-      let params = [{ id: id }];
-      this.$confirm("确定删除此banner吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.ajax
-            .post(this.$store.state.api + "deleteBanner", params)
-            .then((res) => {
-              this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              this.getBanner();
-            })
-            .catch((err) => {
-              this.$message.error("删除失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
+      // let params = [{ id: id }];
+      // this.$confirm("确定删除此banner吗?", "提示", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning",
+      // })
+      //   .then(() => {
+      //     this.ajax
+      //       .post(this.$store.state.api + "deleteBanner", params)
+      //       .then((res) => {
+      //         this.$message({
+      //           message: "删除成功",
+      //           type: "success",
+      //         });
+      //         this.getBanner();
+      //       })
+      //       .catch((err) => {
+      //         this.$message.error("删除失败");
+      //         console.error(err);
+      //       });
+      //   })
+      //   .catch(() => {});
     },
     up(index) {
-      if (index == 0) {
-        this.$message.error("已经是最上面的一个,不可以再上移了");
-        return;
-      }
-      let params = [
-        { aid: this.zoneList[index].id, bid: this.zoneList[index - 1].id },
-      ];
-      this.ajax
-        .post(this.$store.state.api + "zoneRank", params)
-        .then((res) => {
-          this.$message({
-            message: "上移成功",
-            type: "success",
-          });
-          this.getZone();
-        })
-        .catch((err) => {
-          this.$message.error("上移失败");
-          console.error(err);
-        });
+      // if (index == 0) {
+      //   this.$message.error("已经是最上面的一个,不可以再上移了");
+      //   return;
+      // }
+      // let params = [
+      //   { aid: this.zoneList[index].id, bid: this.zoneList[index - 1].id },
+      // ];
+      // this.ajax
+      //   .post(this.$store.state.api + "zoneRank", params)
+      //   .then((res) => {
+      //     this.$message({
+      //       message: "上移成功",
+      //       type: "success",
+      //     });
+      //     this.getZone();
+      //   })
+      //   .catch((err) => {
+      //     this.$message.error("上移失败");
+      //     console.error(err);
+      //   });
     },
     down(index) {
-      if (index == this.zoneList.length - 1) {
-        this.$message.error("已经是最下面的一个,不可以再下移了");
-        return;
-      }
-      let params = [
-        { aid: this.zoneList[index].id, bid: this.zoneList[index + 1].id },
-      ];
-      this.ajax
-        .post(this.$store.state.api + "zoneRank", params)
-        .then((res) => {
-          this.$message({
-            message: "下移成功",
-            type: "success",
-          });
-          this.getZone();
-        })
-        .catch((err) => {
-          this.$message.error("下移失败");
-          console.error(err);
-        });
+      // if (index == this.zoneList.length - 1) {
+      //   this.$message.error("已经是最下面的一个,不可以再下移了");
+      //   return;
+      // }
+      // let params = [
+      //   { aid: this.zoneList[index].id, bid: this.zoneList[index + 1].id },
+      // ];
+      // this.ajax
+      //   .post(this.$store.state.api + "zoneRank", params)
+      //   .then((res) => {
+      //     this.$message({
+      //       message: "下移成功",
+      //       type: "success",
+      //     });
+      //     this.getZone();
+      //   })
+      //   .catch((err) => {
+      //     this.$message.error("下移失败");
+      //     console.error(err);
+      //   });
     },
     //设置banner链接
     setBannerUrl() {
@@ -818,8 +871,8 @@ export default {
     },
   },
   created() {
-    this.getBanner();
-    this.getZone();
+    // this.getBanner();
+    // this.getZone();
   },
 };
 </script>

+ 88 - 71
src/components/pages/notice.vue

@@ -46,7 +46,7 @@
                 <el-button
                   size="mini"
                   type="primary"
-                  @click="getNoticeDetail(scope.row.newsid)"
+                  @click="getNoticeDetail(scope.row)"
                   >查看详情</el-button
                 >
                 <el-button
@@ -138,7 +138,21 @@ export default {
       detail: "",
       dialogVisible1: false,
       dialogVisible2: false,
-      tableData: [],
+      tableData: [
+        {
+          created_at: "2021-04-09T18:25:40.000Z",
+          isRead: 2,
+          newscontent:
+            ' <span style="margin-left:1rem">\r\n            打造”规范+特色“模式。在保证学校劳动教育常\r\n            规课程开设的同时,鼓励各校结合自身优势与历史人\r\n            文资源,发展特色项目,形成全面普及、一校一特色\r\n            的良好局面。军埠口中心小学的”关爱母亲河“探究\r\n            体验、东夏庄小学的”萝卜种植“、望留中学的”剪\r\n            纸艺术“等主题特色鲜明,育人效果明显。</span\r\n          >\r\n          <span style="margin-left:1rem">\r\n            开发劳动教育课程。外国语学校和北门大街小学的\r\n            以“家乡的二十四节气”为主题的课程资源和活动指\r\n            导手册,向阳路小学的“强国+飞天”系列科技主题\r\n            劳动课程,潍城区实验小学的“板桥探究”体验探究\r\n            课程,利昌学校的“神奇的飞行器”科技制作课程,\r\n            潍坊三中的“印出中国心——3D打印设计”课程等一\r\n            系列富有时代感和地域特色的劳动教育课程,极大地\r\n            丰富了劳动教育课程资源。</span\r\n          >',
+          newsid: "1f2b5064-94e6-4025-931f-8c1b0a8d70dd",
+          newsidtype: null,
+          num: 1,
+          recipientid: "0",
+          senderid: "0",
+          time: "2021-04-09 14:25:40",
+          title: "实践出真知,劳动最光荣",
+        },
+      ],
       isLoading: false,
       total: 0,
       page: 1,
@@ -203,6 +217,7 @@ export default {
           this.isLoading = false;
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
           this.tableData = res.data[0];
+          console.log(this.tableData);
         })
         .catch((err) => {
           this.isLoading = false;
@@ -215,86 +230,88 @@ export default {
     },
     //添加通知
     addNotice() {
-      if (this.noticeTitle === "") {
-        this.$message.error("请输入文章标题");
-        return;
-      } else if (this.detail === "") {
-        this.$message.error("请输入文章内容");
-        return;
-      }
-      console.log(this.detail);
-      if (this.time()) {
-        let params = [
-          {
-            t: this.noticeTitle,
-            nc: this.detail.replace(/%/g, "%25"),
-            s:0,
-            r:0
-          },
-        ];
-        this.ajax
-          .post(this.$store.state.api + "addNotice", params)
-          .then((res) => {
-            this.$message({
-              message: "添加成功",
-              type: "success",
-            });
-            this.init();
-            this.getNotice();
-            this.dialogVisible1 = false;
-          })
-          .catch((err) => {
-            this.$message.error("添加失败");
-            console.error(err);
-          });
-      }
+      // if (this.noticeTitle === "") {
+      //   this.$message.error("请输入文章标题");
+      //   return;
+      // } else if (this.detail === "") {
+      //   this.$message.error("请输入文章内容");
+      //   return;
+      // }
+      // console.log(this.detail);
+      // if (this.time()) {
+      //   let params = [
+      //     {
+      //       t: this.noticeTitle,
+      //       nc: this.detail.replace(/%/g, "%25"),
+      //       s: 0,
+      //       r: 0,
+      //     },
+      //   ];
+      //   this.ajax
+      //     .post(this.$store.state.api + "addNotice", params)
+      //     .then((res) => {
+      //       this.$message({
+      //         message: "添加成功",
+      //         type: "success",
+      //       });
+      //       this.init();
+      //       this.getNotice();
+      //       this.dialogVisible1 = false;
+      //     })
+      //     .catch((err) => {
+      //       this.$message.error("添加失败");
+      //       console.error(err);
+      //     });
+      // }
     },
     //删除通知
     deleteNotice(id) {
-      let params = [{ nid: id }];
+      // let params = [{ nid: id }];
 
-      this.$confirm("确定删除此通知吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.ajax
-            .post(this.$store.state.api + "deleteNotice", params)
-            .then((res) => {
-              this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              if (this.page != 1 && this.tableData.length == 1) {
-                this.page--;
-              }
-              this.getNotice();
-            })
-            .catch((err) => {
-              this.$message.error("删除失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
+      // this.$confirm("确定删除此通知吗?", "提示", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning",
+      // })
+      //   .then(() => {
+      //     this.ajax
+      //       .post(this.$store.state.api + "deleteNotice", params)
+      //       .then((res) => {
+      //         this.$message({
+      //           message: "删除成功",
+      //           type: "success",
+      //         });
+      //         if (this.page != 1 && this.tableData.length == 1) {
+      //           this.page--;
+      //         }
+      //         this.getNotice();
+      //       })
+      //       .catch((err) => {
+      //         this.$message.error("删除失败");
+      //         console.error(err);
+      //       });
+      //   })
+      //   .catch(() => {});
     },
     getNoticeDetail(id) {
-      let params = { nid: id };
-      this.ajax
-        .get(this.$store.state.api + "getNoticeById", params)
-        .then((res) => {
-          this.dialogVisible2 = true;
-          this.NoticeDeatail = res.data[0][0];
-        })
-        .catch((err) => {
-          console.error(err);
-        });
+      this.dialogVisible2 = true;
+      this.NoticeDeatail = id;
+      // let params = { nid: id };
+      // this.ajax
+      //   .get(this.$store.state.api + "getNoticeById", params)
+      //   .then((res) => {
+      //     this.dialogVisible2 = true;
+      //     this.NoticeDeatail = res.data[0][0];
+      //   })
+      //   .catch((err) => {
+      //     console.error(err);
+      //   });
     },
   },
   created() {
     this.$nextTick(function () {
       this.page = 1;
-      this.getNotice();
+      // this.getNotice();
       this.changeHeight();
     });
   },

+ 81 - 55
src/components/pages/organization.vue

@@ -26,11 +26,14 @@
           <el-table-column prop="name" label="学校" min-width="80">
           </el-table-column>
           <el-table-column prop="do" label="操作" min-width="20">
-           <template slot-scope="scope">
-                <el-button size="mini" type="primary" @click="deleteOrg(scope.row.id)"
-              >删除</el-button
-            >
-           </template>
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="primary"
+                @click="deleteOrg(scope.row.id)"
+                >删除</el-button
+              >
+            </template>
           </el-table-column>
         </el-table>
       </div>
@@ -64,9 +67,7 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible1 = false">取 消</el-button>
-        <el-button type="primary" @click="addOrg"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="addOrg">确 定</el-button>
       </span>
     </el-dialog>
   </div>
@@ -78,7 +79,32 @@ export default {
     return {
       dialogVisible: false,
       dialogVisible1: false,
-      tableData: [],
+      tableData: [
+        {
+          create_at: "2021-03-25T14:29:04.000Z",
+          createuserid: "0",
+          describe: "深圳",
+          id: "1123",
+          logo: null,
+          name: "深圳市龙岗区麓城外国语小学",
+        },
+        {
+          create_at: null,
+          createuserid: "0",
+          describe: "深圳",
+          id: "1233",
+          logo: null,
+          name: "海口市灵山镇中心学校",
+        },
+        {
+          create_at: "2021-04-05T18:27:26.000Z",
+          createuserid: "0",
+          describe: "深圳",
+          id: "fd6a9fa8-95d7-11eb-80ad-005056b86db5",
+          logo: "",
+          name: "深圳市福田区荔园小学(荔园教育集团)",
+        },
+      ],
       orgName: "",
       page: 1,
       total: 0,
@@ -126,53 +152,53 @@ export default {
     },
 
     addOrg() {
-      if (this.time()) {
-        let params = [{ n: this.orgName }];
-        this.ajax
-          .post(this.$store.state.api + "addSchool", params)
-          .then((res) => {
-            this.$message({
-              message: "添加成功",
-              type: "success",
-            });
-            this.dialogVisible1 = false;
-            this.orgName = "";
-            this.getOrg();
-          })
-          .catch((err) => {
-            this.$message.error("添加失败");
-            console.error(err);
-          });
-      }
+      // if (this.time()) {
+      //   let params = [{ n: this.orgName }];
+      //   this.ajax
+      //     .post(this.$store.state.api + "addSchool", params)
+      //     .then((res) => {
+      //       this.$message({
+      //         message: "添加成功",
+      //         type: "success",
+      //       });
+      //       this.dialogVisible1 = false;
+      //       this.orgName = "";
+      //       this.getOrg();
+      //     })
+      //     .catch((err) => {
+      //       this.$message.error("添加失败");
+      //       console.error(err);
+      //     });
+      // }
     },
     deleteOrg(id) {
-      let params = [{ id: id }];
-      var _this = this;
-      _this
-        .$confirm("确定删除此学校吗?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-        .then(() => {
-          _this.ajax
-            .post(_this.$store.state.api + "deleteSchool", params)
-            .then((res) => {
-              _this.$message({
-                message: "删除成功",
-                type: "success",
-              });
-              if (_this.page != 1 && _this.tableData.length == 1) {
-                _this.page--;
-              }
-              _this.getOrg();
-            })
-            .catch((err) => {
-              _this.$message.error("删除失败");
-              console.error(err);
-            });
-        })
-        .catch(() => {});
+      // let params = [{ id: id }];
+      // var _this = this;
+      // _this
+      //   .$confirm("确定删除此学校吗?", "提示", {
+      //     confirmButtonText: "确定",
+      //     cancelButtonText: "取消",
+      //     type: "warning",
+      //   })
+      //   .then(() => {
+      //     _this.ajax
+      //       .post(_this.$store.state.api + "deleteSchool", params)
+      //       .then((res) => {
+      //         _this.$message({
+      //           message: "删除成功",
+      //           type: "success",
+      //         });
+      //         if (_this.page != 1 && _this.tableData.length == 1) {
+      //           _this.page--;
+      //         }
+      //         _this.getOrg();
+      //       })
+      //       .catch((err) => {
+      //         _this.$message.error("删除失败");
+      //         console.error(err);
+      //       });
+      //   })
+      //   .catch(() => {});
     },
     changeHeight() {
       this.tableHeight =
@@ -196,7 +222,7 @@ export default {
     this.$nextTick(function () {
       this.page = 1;
       this.changeHeight();
-      this.getOrg();
+      // this.getOrg();
     });
   },
 };

+ 181 - 0
src/components/pages/template.vue

@@ -0,0 +1,181 @@
+<template>
+  <div style="width: 100%">
+    <el-main>
+      <div class="tou">模板管理管理</div>
+      <div>
+        <div style="margin: 15px 0; display: flex; justify-content: flex-end">
+          <el-button type="primary">新建文档模板</el-button>
+        </div>
+        <el-table
+          ref="table"
+          :data="tableData"
+          stripe
+          border
+          :header-cell-style="{ background: '#f1f1f1', 'text-align': 'center' }"
+          :cell-style="{ 'text-align': 'center' }"
+          style="width: 100%"
+          :height="tableHeight"
+          v-loading="isLoading"
+        >
+          <el-table-column prop="title" label="模板标题" min-width="25">
+          </el-table-column>
+          <el-table-column prop="time" label="创建时间" min-width="10">
+          </el-table-column>
+          <el-table-column label="操作" min-width="10">
+            <template slot-scope="scope">
+              <div class="pb_buttonBox">
+                <el-button
+                  size="mini"
+                  type="primary"
+                  @click="goTo('/course?index=1&id=' + scope.row.courseId)"
+                  >查看</el-button
+                >
+                <el-button
+                  size="mini"
+                  type="primary"
+                  @click="deleteCourse(scope.row.courseId)"
+                  >删除</el-button
+                >
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div class="student_page">
+        <el-pagination
+          background
+          layout="prev, pager, next"
+          :page-size="10"
+          :total="total"
+          v-if="!isListAjax && page"
+          @current-change="handleCurrentChange"
+        >
+        </el-pagination>
+      </div>
+    </el-main>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      tableHeight: 500,
+      courseName: "",
+      dialogVisible: false,
+      tableData: [
+        {
+          title: "人工智能风车-项目概论",
+          time: "2022-12-28",
+        },
+        {
+          title: "智慧物流课程",
+          time: "2022-12-28",
+        },
+        {
+          title: "AI劳动实践通用课程",
+          time: "2022-12-28",
+        },
+        {
+          title: "AI造物(乐高版)",
+          time: "2022-12-28",
+        },
+      ],
+      page: 1,
+      total: 0,
+      isLoading: false,
+      itemCount: 1,
+      courseTitle: "",
+      courseText: "",
+      fileList: [],
+      fileList1: [],
+      homeworkList: [{ name: "" }],
+      group: "",
+      Juri: "",
+      className: "",
+      groupList: [],
+      // JuriList: [],
+      uploadLoading1: false,
+      uploadLoading: false,
+      updateId: "",
+      groupA: "",
+      isClear: true,
+      dialogVisible1: false,
+      dialogImageUrl: "",
+      classX: "",
+      classListX: [],
+      isListAjax: false,
+    };
+  },
+  methods: {
+    changeHeight() {
+      this.tableHeight =
+        window.innerHeight - this.$refs.table.$el.offsetTop - 200;
+      if (this.tableHeight <= 530) {
+        this.tableHeight = 530;
+      }
+      // 监听窗口大小变化
+      let self = this;
+      window.onresize = function () {
+        self.tableHeight =
+          window.innerHeight - self.$refs.table.$el.offsetTop - 200;
+        if (self.tableHeight <= 530) {
+          self.tableHeight = 530;
+        }
+      };
+      // this.$refs.table.$el.offsetTop:表格距离浏览器的高度 //200表示你想要调整的表格距离底部的高度(你可以自己随意调整),因为我们一般都有放分页组件的,所以需要给它留一个高度
+    },
+    time() {
+      if (!this.now) {
+        this.now = new Date().getTime();
+        return true;
+      } else {
+        let time = new Date().getTime();
+        if (time - this.now > 3000) {
+          this.now = time;
+          return true;
+        } else {
+          return false;
+        }
+      }
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.page = val;
+    },
+  },
+  created() {
+    this.$nextTick(function () {
+      this.page = 1;
+      this.changeHeight();
+    });
+  },
+};
+</script>
+
+<style scoped>
+.tou {
+  border-bottom: 1px solid #c9c9c9;
+  height: 50px;
+  font-size: 30px;
+}
+.dialog_diy >>> .el-dialog__header {
+  background: #3d67bc !important;
+  padding: 15px 20px;
+}
+.dialog_diy >>> .el-dialog__title {
+  color: #fff;
+}
+.dialog_diy >>> .el-dialog__headerbtn {
+  top: 19px;
+}
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+}
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+  color: #fff;
+}
+.student_page {
+  margin-top: 15px;
+}
+</style>

+ 9 - 40
src/components/tools/leftBar.vue

@@ -44,6 +44,15 @@
               </div>
               <span slot="title">课程管理</span>
             </el-menu-item>
+            <el-menu-item index="/template">
+              <div class="img" v-if="path == '/template'">
+                <img src="../../assets/icon/course-active.png" alt="" />
+              </div>
+              <div class="img" v-else>
+                <img src="../../assets/icon/course.png" alt="" />
+              </div>
+              <span slot="title">模板管理</span>
+            </el-menu-item>
             <el-menu-item index="/notice">
               <div class="img" v-if="path == '/notice'">
                 <img src="../../assets/icon/notice-active.png" alt="" />
@@ -53,15 +62,6 @@
               </div>
               <span slot="title">通知公告</span>
             </el-menu-item>
-            <el-menu-item index="/tutor">
-              <div class="img" v-if="path == '/tutor'">
-                <img src="../../assets/icon/school-active.png" alt="" />
-              </div>
-              <div class="img" v-else>
-                <img src="../../assets/icon/school.png" alt="" />
-              </div>
-              <span slot="title">家校区</span>
-            </el-menu-item>
             <el-menu-item index="/grouping">
               <div class="img" v-if="path == '/grouping'">
                 <img src="../../assets/icon/group-active.png" alt="" />
@@ -80,33 +80,6 @@
               </div>
               <span slot="title">组织管理</span>
             </el-menu-item>
-            <el-menu-item index="/find">
-              <div class="img" v-if="path == '/find'">
-                <img src="../../assets/icon/find-active.png" alt="" />
-              </div>
-              <div class="img" v-else>
-                <img src="../../assets/icon/find.png" alt="" />
-              </div>
-              <span slot="title">发现管理</span>
-            </el-menu-item>
-            <el-menu-item index="/userManage">
-              <div class="img" v-if="path == '/userManage'">
-                <img src="../../assets/icon/user-active.png" alt="" />
-              </div>
-              <div class="img" v-else>
-                <img src="../../assets/icon/user.png" alt="" />
-              </div>
-              <span slot="title">用户管理</span>
-            </el-menu-item>
-            <el-menu-item index="/works">
-              <div class="img" v-if="path == '/works'">
-                <img src="../../assets/icon/works-active.png" alt="" />
-              </div>
-              <div class="img" v-else>
-                <img src="../../assets/icon/works.png" alt="" />
-              </div>
-              <span slot="title">作业管理</span>
-            </el-menu-item>
             <el-menu-item index="/class">
               <div class="img" v-if="path == '/class'">
                 <img src="../../assets/icon/class-active.png" alt="" />
@@ -116,10 +89,6 @@
               </div>
               <span slot="title">班级管理</span>
             </el-menu-item>
-            <!-- <el-menu-item index="/jurisdiction">
-            <i class="el-icon-setting"></i>
-            <span slot="title">权限管理</span>
-          </el-menu-item> -->
           </el-menu>
         </el-col>
       </el-row>

+ 27 - 27
src/main.js

@@ -34,32 +34,32 @@ router.beforeEach((to, from, next) => {
   }
   const requireAuth = to.meta.requireAuth
   // 判断该路由是否需要登录权限
-  if (requireAuth) {
-    var isLogin = VueCookies.get("Alogin")
-    var info = VueCookies.get("AuserInfo")
-    if (isLogin == "1") {
-      store.commit("update", ["isLogin", true]);
-      // var info = JSON.parse(window.sessionStorage.getItem("userInfo"))
-      store.commit("update", ["userInfo", info]);
-      store.state.luyou = store.state.luyou + 1
-      store.commit("update", ["luyou", store.state.luyou]);
-      next()
-    } else {
-      const loading = Loading.service({
-        background: "rgba(255, 255, 255)",
-        target: document.querySelector("body"),
-      });
-      store.commit("update", ["isLogin", false]);
-      Message({
-        message: '未登录,请登录',
-        type: 'warning'
-      });
-      setTimeout(() => {
-        loading.close();
-        next('/login')
-      }, 2000);
-    }
-  } else {
+  // if (requireAuth) {
+  //   var isLogin = VueCookies.get("Alogin")
+  //   var info = VueCookies.get("AuserInfo")
+  //   if (isLogin == "1") {
+  //     store.commit("update", ["isLogin", true]);
+  //     // var info = JSON.parse(window.sessionStorage.getItem("userInfo"))
+  //     store.commit("update", ["userInfo", info]);
+  //     store.state.luyou = store.state.luyou + 1
+  //     store.commit("update", ["luyou", store.state.luyou]);
+  //     next()
+  //   } else {
+  //     const loading = Loading.service({
+  //       background: "rgba(255, 255, 255)",
+  //       target: document.querySelector("body"),
+  //     });
+  //     store.commit("update", ["isLogin", false]);
+  //     Message({
+  //       message: '未登录,请登录',
+  //       type: 'warning'
+  //     });
+  //     setTimeout(() => {
+  //       loading.close();
+  //       next('/login')
+  //     }, 2000);
+  //   }
+  // } else {
     next()  // 确保一定要有next()被调用
-  }
+  // }
 })

+ 9 - 0
src/router/index.js

@@ -14,6 +14,7 @@ import course from '@/components/pages/courseDetail'
 import userManage from '@/components/pages/userManage'
 import works from '@/components/pages/works'
 import classA from '@/components/pages/class'
+import template from '@/components/pages/template'
 
 Vue.use(Router).use(ElementUI)
 
@@ -35,6 +36,14 @@ export default new Router({
         requireAuth: true // 是否需要判断是否登录,这里是需要判断
       }
     },
+    {
+      path: '/template',
+      name: 'template',
+      component: template,
+      meta: {
+        requireAuth: true // 是否需要判断是否登录,这里是需要判断
+      }
+    },
     {
       path: '/course',
       name: 'course',