guhongwei 4 years ago
parent
commit
1d4653a48e

+ 10 - 10
.eslintrc.js

@@ -5,22 +5,22 @@ module.exports = {
   env: {
     node: true,
   },
-  extends: ['plugin:vue/essential', '@vue/prettier'],
-  plugins: ['vue'],
+  extends: ["plugin:vue/essential", "@vue/prettier"],
+  plugins: ["vue"],
   rules: {
-    'max-len': [
-      'warn',
+    "max-len": [
+      "warn",
       {
         code: 10000,
       },
     ],
-    'no-unused-vars': 'off',
-    'no-console': 'off',
-    'prettier/prettier': [
-      'warn',
+    "no-unused-vars": "off",
+    "no-console": "off",
+    "prettier/prettier": [
+      "warn",
       {
         singleQuote: true,
-        trailingComma: 'es5',
+        trailingComma: "es5",
         bracketSpacing: true,
         jsxBracketSameLine: true,
         printWidth: 160,
@@ -28,6 +28,6 @@ module.exports = {
     ],
   },
   parserOptions: {
-    parser: 'babel-eslint',
+    parser: "babel-eslint",
   },
 };

BIN
public/favicon.ico


+ 1 - 1
public/index.html

@@ -5,7 +5,7 @@
     <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><%= htmlWebpackPlugin.options.title %></title>
+    <title>加载中...</title>
   </head>
   <body>
     <noscript>

+ 3 - 3
src/plugins/methods.js

@@ -11,14 +11,14 @@ const Plugin = {
       },
     });
     // 4. 添加实例方法
-    Vue.prototype.$toUndefined = object => {
+    Vue.prototype.$toUndefined = (object) => {
       let keys = Object.keys(object);
-      keys.map(item => {
+      keys.map((item) => {
         object[item] = object[item] === '' ? (object[item] = undefined) : object[item];
       });
       return object;
     };
-    Vue.prototype.$turnTo = item => {
+    Vue.prototype.$turnTo = (item) => {
       if (item.info_type == 1) {
         window.open(item.url);
       } else {

+ 7 - 7
src/plugins/stomp.js

@@ -11,7 +11,7 @@ const Plugin = {
   install(Vue, options) {
     assert(_.isObject(options));
     if (options.debug && !_.isFunction(options.debug)) {
-      options.debug = str => {
+      options.debug = (str) => {
         console.log(str);
       };
     }
@@ -22,7 +22,7 @@ const Plugin = {
 
     // 3. 注入组件
     Vue.mixin({
-      beforeDestroy: function() {
+      beforeDestroy: function () {
         if (this.$stompClient) {
           this.$stompClient.deactivate();
           delete this.$stompClient;
@@ -31,21 +31,21 @@ const Plugin = {
     });
 
     // 4. 添加实例方法
-    Vue.prototype.$stomp = function(subscribes = {}) {
+    Vue.prototype.$stomp = function (subscribes = {}) {
       // connect to mq
       const client = new Client(options);
-      client.onConnect = frame => {
+      client.onConnect = (frame) => {
         // Do something, all subscribes must be done is this callback
         // This is needed because this will be executed after a (re)connect
         console.log('[stomp] connected');
         Object.keys(subscribes)
-          .filter(p => _.isFunction(subscribes[p]))
-          .forEach(key => {
+          .filter((p) => _.isFunction(subscribes[p]))
+          .forEach((key) => {
             client.subscribe(key, subscribes[key]);
           });
       };
 
-      client.onStompError = frame => {
+      client.onStompError = (frame) => {
         // Will be invoked in case of error encountered at Broker
         // Bad login/passcode typically will cause an error
         // Complaint brokers will set `message` header with a brief message. Body may contain details.

+ 37 - 0
src/router/index.js

@@ -13,6 +13,43 @@ const web = [
     meta: { title: '网站首页' },
     component: () => import('../views/index.vue'),
   },
+  {
+    path: '/website',
+    name: 'website',
+    component: () => import('../views/website.vue'),
+    children: [
+      {
+        path: '/news/index',
+        name: 'news_index',
+        meta: { title: '新闻咨询' },
+        component: () => import('../views/news/index.vue'),
+      },
+      {
+        path: '/service/index',
+        name: 'service_index',
+        meta: { title: '科技服务' },
+        component: () => import('../views/service/index.vue'),
+      },
+      {
+        path: '/market/index',
+        name: 'market_index',
+        meta: { title: '技术超市' },
+        component: () => import('../views/market/index.vue'),
+      },
+      {
+        path: '/train/index',
+        name: 'train_index',
+        meta: { title: '宣传培训' },
+        component: () => import('../views/train/index.vue'),
+      },
+      {
+        path: '/dynamic/index',
+        name: 'dynamic_index',
+        meta: { title: '数据动态' },
+        component: () => import('../views/dynamic/index.vue'),
+      },
+    ],
+  },
 ];
 const routes = [...web];
 const router = new VueRouter({

+ 2 - 2
src/store/index.js

@@ -1,5 +1,5 @@
-import Vue from "vue";
-import Vuex from "vuex";
+import Vue from 'vue';
+import Vuex from 'vuex';
 
 Vue.use(Vuex);
 

+ 36 - 0
src/views/dynamic/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main"> 数据动态 </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 10 - 1
src/views/index.vue

@@ -1,7 +1,16 @@
 <template>
   <div id="index">
     <el-row>
-      <el-col :span="24" class="main"> test </el-col>
+      <el-col :span="24" class="main">
+        <el-col :span="24"> 首页 </el-col>
+        <el-col :span="24">
+          <el-button type="primary" size="mini" @click="$router.push({ path: '/news/index' })">新闻咨讯</el-button>
+          <el-button type="primary" size="mini" @click="$router.push({ path: '/service/index' })">科技服务</el-button>
+          <el-button type="primary" size="mini" @click="$router.push({ path: '/market/index' })">技术超市</el-button>
+          <el-button type="primary" size="mini" @click="$router.push({ path: '/train/index' })">宣传培训</el-button>
+          <el-button type="primary" size="mini" @click="$router.push({ path: '/dynamic/index' })">数据动态</el-button>
+        </el-col>
+      </el-col>
     </el-row>
   </div>
 </template>

+ 36 - 0
src/views/market/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main"> 科技超市 </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 36 - 0
src/views/news/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main"> 新闻资讯 </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 36 - 0
src/views/service/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main"> 科技服务 </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 36 - 0
src/views/train/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main"> 宣传培训 </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 32 - 0
src/views/website.vue

@@ -0,0 +1,32 @@
+<template>
+  <div id="website">
+    <frame></frame>
+  </div>
+</template>
+
+<script>
+import frame from '@common/src/components/common/frame.vue';
+export default {
+  name: 'website',
+  props: {},
+  components: { frame },
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {},
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>