Переглянути джерело

Merge branch 'master' of http://git.cc-lotus.info/Free-cysci/cysci-website

lrf402788946 4 роки тому
батько
коміт
fa89a9ea0e

+ 15 - 3
src/views/dynamic/index.vue

@@ -7,11 +7,17 @@
             <el-col :span="12" class="left">
               <one></one>
             </el-col>
-            <el-col :span="12" class="left"> 右侧 </el-col>
+            <el-col :span="12" class="left">
+              <two></two>
+            </el-col>
           </el-col>
           <el-col :span="24" class="common two">
-            <el-col :span="12" class="left"> 左侧 </el-col>
-            <el-col :span="12" class="left"> 右侧 </el-col>
+            <el-col :span="12" class="left">
+              <thr></thr>
+            </el-col>
+            <el-col :span="12" class="left">
+              <four></four>
+            </el-col>
           </el-col>
         </div>
       </el-col>
@@ -21,12 +27,18 @@
 
 <script>
 import one from './parts/one.vue';
+import two from './parts/two.vue';
+import thr from './parts/thr.vue';
+import four from './parts/four.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'index',
   props: {},
   components: {
     one,
+    two,
+    thr,
+    four,
   },
   data: function () {
     return {};

+ 96 - 0
src/views/dynamic/parts/four.vue

@@ -0,0 +1,96 @@
+<template>
+  <div id="four">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="title"> 技术成果 </el-col>
+        <el-col :span="24" class="canvas">
+          <div id="fourChart" style="height: 420px"></div>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import * as echarts from 'echarts';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'four',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  mounted() {
+    this.init();
+  },
+  methods: {
+    init() {
+      var chartDom = document.getElementById('fourChart');
+      var myChart = echarts.init(chartDom);
+      var option;
+      option = {
+        // title: {
+        //   text: '某站点用户访问来源',
+        //   left: 'center',
+        // },
+        tooltip: {
+          trigger: 'item',
+        },
+        legend: {
+          orient: 'vertical',
+          left: 'left',
+        },
+        series: [
+          {
+            name: '访问来源',
+            type: 'pie',
+            radius: '50%',
+            data: [
+              { value: 1048, name: '搜索引擎' },
+              { value: 735, name: '直接访问' },
+              { value: 580, name: '邮件营销' },
+              { value: 484, name: '联盟广告' },
+              { value: 300, name: '视频广告' },
+            ],
+            emphasis: {
+              itemStyle: {
+                shadowBlur: 10,
+                shadowOffsetX: 0,
+                shadowColor: 'rgba(0, 0, 0, 0.5)',
+              },
+            },
+          },
+        ],
+      };
+
+      option && myChart.setOption(option);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .title {
+    text-align: center;
+    font-size: 16px;
+    font-weight: bold;
+    padding: 15px 0;
+  }
+}
+</style>

+ 16 - 4
src/views/dynamic/parts/one.vue

@@ -2,7 +2,10 @@
   <div id="one">
     <el-row>
       <el-col :span="24" class="main">
-        <div id="chartPie" style="height: 450px"></div>
+        <el-col :span="24" class="title"> 技术成果 </el-col>
+        <el-col :span="24" class="canvas">
+          <div id="oneChart" style="height: 420px"></div>
+        </el-col>
       </el-col>
     </el-row>
   </div>
@@ -24,7 +27,7 @@ export default {
   },
   methods: {
     init() {
-      var chartDom = document.getElementById('chartPie');
+      var chartDom = document.getElementById('oneChart');
       var myChart = echarts.init(chartDom);
       var option;
       option = {
@@ -44,7 +47,7 @@ export default {
           {
             name: '饼状图',
             type: 'pie',
-            radius: '70%',
+            radius: '60%',
             center: ['50%', '50%'],
             roseType: 'area',
             itemStyle: {
@@ -83,4 +86,13 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.main {
+  .title {
+    text-align: center;
+    font-size: 16px;
+    font-weight: bold;
+    padding: 15px 0;
+  }
+}
+</style>

+ 105 - 0
src/views/dynamic/parts/thr.vue

@@ -0,0 +1,105 @@
+<template>
+  <div id="thr">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="title"> 用户 </el-col>
+        <el-col :span="24" class="canvas">
+          <div id="thrChart" style="height: 420px"></div>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import * as echarts from 'echarts';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'thr',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  mounted() {
+    this.init();
+  },
+  methods: {
+    init() {
+      var chartDom = document.getElementById('thrChart');
+      var myChart = echarts.init(chartDom);
+      var option;
+      option = {
+        tooltip: {
+          trigger: 'item',
+        },
+        legend: {
+          top: '5%',
+          left: 'center',
+        },
+        series: [
+          {
+            name: '访问来源',
+            type: 'pie',
+            radius: ['40%', '70%'],
+            avoidLabelOverlap: false,
+            itemStyle: {
+              borderRadius: 10,
+              borderColor: '#fff',
+              borderWidth: 2,
+            },
+            label: {
+              show: false,
+              position: 'center',
+            },
+            emphasis: {
+              label: {
+                show: true,
+                fontSize: '40',
+                fontWeight: 'bold',
+              },
+            },
+            labelLine: {
+              show: false,
+            },
+            data: [
+              { value: 1048, name: '搜索引擎' },
+              { value: 735, name: '直接访问' },
+              { value: 580, name: '邮件营销' },
+              { value: 484, name: '联盟广告' },
+              { value: 300, name: '视频广告' },
+            ],
+          },
+        ],
+      };
+
+      option && myChart.setOption(option);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .title {
+    text-align: center;
+    font-size: 16px;
+    font-weight: bold;
+    padding: 15px 0;
+  }
+}
+</style>

+ 80 - 0
src/views/dynamic/parts/two.vue

@@ -0,0 +1,80 @@
+<template>
+  <div id="two">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="title"> e专利 </el-col>
+        <el-col :span="24" class="canvas">
+          <div id="twoChart" style="height: 420px"></div>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import * as echarts from 'echarts';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'one',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  mounted() {
+    this.init();
+  },
+  methods: {
+    init() {
+      var chartDom = document.getElementById('twoChart');
+      var myChart = echarts.init(chartDom);
+      var option;
+      option = {
+        xAxis: {
+          type: 'category',
+          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+        },
+        yAxis: {
+          type: 'value',
+        },
+        series: [
+          {
+            data: [120, 200, 150, 80, 70, 110, 130],
+            type: 'bar',
+            showBackground: true,
+            backgroundStyle: {
+              color: 'rgba(180, 180, 180, 0.2)',
+            },
+          },
+        ],
+      };
+      option && myChart.setOption(option);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .title {
+    text-align: center;
+    font-size: 16px;
+    font-weight: bold;
+    padding: 15px 0;
+  }
+}
+</style>

+ 72 - 13
src/views/service/index.vue

@@ -12,15 +12,20 @@
             </el-col>
           </el-col>
           <el-col :span="24" class="common two">
-            <el-col :span="12" class="left"
-              ><top topText="高企政策服务"></top>
+            <el-col :span="12" class="left">
+              <top topText="高企政策服务" :userMore="false"></top>
               <list type="1" :list="oneList"></list>
             </el-col>
-            <el-col :span="12" class="left"><top topText="创新劵服务"></top>创新劵服务</el-col>
+            <el-col :span="12" class="left"
+              ><top topText="创新劵服务" :userMore="false"></top>
+              <list type="2" :list="twoList"></list>
+            </el-col>
           </el-col>
           <el-col :span="24" class="common thr">
-            <el-col :span="12" class="left"><top topText="科技成果服务"></top>科技成果服务</el-col>
-            <el-col :span="12" class="left"><top topText="科技成果服务"></top>科技成果服务</el-col>
+            <el-col :span="24" class="left"
+              ><top topText="科技成果服务" :userMore="false"></top>
+              <list type="3" :list="thrList"></list>
+            </el-col>
           </el-col>
         </div>
       </el-col>
@@ -47,6 +52,8 @@ import list from './parts/list.vue';
 import { btnList } from './btnList.js';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: organization } = createNamespacedHelpers('organization');
+const { mapActions: policy } = createNamespacedHelpers('policy');
+const { mapActions: ticket } = createNamespacedHelpers('ticket');
 export default {
   name: 'index',
   props: {},
@@ -61,23 +68,51 @@ export default {
         phone: [{ required: true, message: '请输入用户账号', trigger: 'blur' }],
         password: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
       },
+      dialogTitle: '高企政策服务',
+      dialogType: undefined,
       // 高企政策服务-列表
-      oneList: [
+      oneList: [],
+      // 创新券服务-列表
+      twoList: [
         {
-          company: '11111',
+          company: '22',
+        },
+        {
+          company: '十条数据',
+        },
+      ],
+      // 科技成果评价服务-列表
+      thrList: [
+        {
+          basic: {
+            achieve_name: '成果名称',
+            achieve_date: '2021-01-01 01:00:00',
+            achieve_type: '城固了捏',
+            achieve_form: '成果形式',
+          },
+        },
+        {
+          basic: {
+            achieve_name: '10条数据',
+            achieve_date: '2021-01-01 01:00:00',
+            achieve_type: '城固了捏',
+            achieve_form: '成果形式',
+          },
         },
       ],
-      dialogTitle: '高企政策服务',
-      dialogType: undefined,
     };
   },
-  created() {},
+  async created() {
+    await this.search();
+  },
   methods: {
-    ...organization(['login']),
+    ...policy({ policyQuery: 'query' }),
+    ...ticket({ ticketQuery: 'query' }),
+    ...organization(['login', 'fetch']),
     link(data) {
       const { type, name } = data;
       if (type == '1') {
-        console.log('1');
+        window.open('http://www.jlkjxm.com');
       } else if (type == '2') {
         this.dialog2 = true;
         this.dialogTitle = name;
@@ -87,7 +122,7 @@ export default {
         this.dialogTitle = name;
         this.dialogType = type;
       } else if (type == '4') {
-        window.location.href = 'http://broadcast.waityou24.cn/liveAchieve';
+        window.open('http://broadcast.waityou24.cn/liveAchieve');
       } else if (type == '5') {
         this.$router.push({ path: '/service/register', query: { type: type } });
       } else if (type == '6') {
@@ -116,6 +151,24 @@ export default {
         }
       });
     },
+    // 查询列表信息
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      // 高企政策服务
+      let res = await this.policyQuery({ skip, limit: 7, status: 1, ...info });
+      if (this.$checkRes(res)) this.$set(this, `oneList`, res.data);
+      res = await this.ticketQuery({ skip, limit: 7, status: 1, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `twoList`, res.data);
+      }
+    },
+    // 查询企业详细信息
+    async searchCompany(data) {
+      let res = await this.fetch(data.user_id);
+      if (this.$checkRes(res)) {
+        data.company = res.data.name;
+        return data;
+      }
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -185,6 +238,12 @@ export default {
       margin: 0 0 10px 0;
     }
   }
+  .thr {
+    width: 100%;
+    .left {
+      width: 100%;
+    }
+  }
 }
 .dialog2 {
   .btn {

+ 164 - 4
src/views/service/parts/list.vue

@@ -3,8 +3,52 @@
     <el-row>
       <el-col :span="24" class="main">
         <el-col :span="24" class="one" v-if="type == '1'">
-          <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
-            {{ item.company }}
+          <el-col :span="24" class="oneList" v-for="(item, index) in list" :key="index">
+            <el-col :span="24" class="top">
+              <el-col :span="20" class="company textOver">
+                {{ item.company }}
+              </el-col>
+              <el-col :span="4" class="date">
+                {{ getDate(item.meta) }}
+              </el-col>
+            </el-col>
+            <el-col :span="24" class="other">
+              <el-col :span="12" class="text">
+                申请类型:<span>{{ item.type }}</span>
+              </el-col>
+            </el-col>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="two" v-else-if="type == '2'">
+          <el-col :span="24" class="twoList" v-for="(item, index) in list" :key="index">
+            <el-col :span="24" class="top">
+              <el-col :span="20" class="company textOver">
+                {{ item.name }}
+              </el-col>
+              <el-col :span="4" class="date">
+                {{ getDate(item.meta) }}
+              </el-col>
+            </el-col>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="thr" v-else-if="type == '3'">
+          <el-col :span="12" class="thrList" v-for="(item, index) in list" :key="index">
+            <el-col :span="24" class="name textOver">
+              {{ item.basic.achieve_name }}
+            </el-col>
+            <el-col :span="24" class="other">
+              <el-col :span="24" class="text textOver">
+                成果取得时间:<span>{{ item.basic.achieve_date }}</span>
+              </el-col>
+            </el-col>
+            <el-col :span="24" class="other">
+              <el-col :span="12" class="text textOver">
+                成果类别:<span>{{ item.basic.achieve_type }}</span>
+              </el-col>
+              <el-col :span="12" class="text textOver">
+                成果形式:<span>{{ item.basic.achieve_form }}</span>
+              </el-col>
+            </el-col>
           </el-col>
         </el-col>
       </el-col>
@@ -13,6 +57,7 @@
 </template>
 
 <script>
+const moment = require('moment');
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'list',
@@ -29,7 +74,12 @@ export default {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    getDate(date) {
+      let newDate = moment(date.createdAt).format('YYYY-MM-DD');
+      if (newDate) return newDate;
+    },
+  },
   computed: {
     ...mapState(['user']),
   },
@@ -46,4 +96,114 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.main {
+  padding: 5px;
+  .one {
+    height: 430px;
+    overflow: hidden;
+    .oneList {
+      padding: 8px 0;
+      border-bottom: 1px dashed #ccc;
+      .top {
+        margin: 0 0 5px 0;
+        .company {
+          font-size: 16px;
+        }
+        .date {
+          font-size: 16px;
+        }
+      }
+      .other {
+        .text {
+          font-size: 14px;
+          color: #666;
+          span {
+            color: #000;
+          }
+        }
+      }
+    }
+    .oneList:last-child {
+      border-bottom: none;
+    }
+    .oneList:hover {
+      cursor: pointer;
+      .top {
+        .company {
+          font-weight: bold;
+          color: #409eff;
+        }
+      }
+    }
+  }
+  .two {
+    height: 430px;
+    overflow: hidden;
+    .twoList {
+      padding: 8px 0;
+      border-bottom: 1px dashed #ccc;
+      .top {
+        margin: 0 0 5px 0;
+        .company {
+          font-size: 16px;
+        }
+        .date {
+          font-size: 16px;
+        }
+      }
+    }
+    .twoList:last-child {
+      border-bottom: none;
+    }
+    .twoList:hover {
+      cursor: pointer;
+      .top {
+        .company {
+          font-weight: bold;
+          color: #409eff;
+        }
+      }
+    }
+  }
+  .thr {
+    height: 430px;
+    overflow: hidden;
+    .thrList {
+      padding: 5px 10px;
+      border-bottom: 1px dashed #ccc;
+      border-right: 1px dashed #ccc;
+      .name {
+        font-size: 16px;
+        margin: 0 0 5px 0;
+      }
+      .other {
+        margin: 0 0 5px 0;
+        .text {
+          font-size: 14px;
+          color: #666;
+          span {
+            color: #000;
+          }
+        }
+      }
+    }
+    .thrList:nth-child(2n) {
+      border-right: none;
+    }
+    .thrList:nth-child(9) {
+      border-bottom: none;
+    }
+    .thrList:nth-child(10) {
+      border-bottom: none;
+    }
+    .thrList:hover {
+      cursor: pointer;
+      .name {
+        font-weight: bold;
+        color: #409eff;
+      }
+    }
+  }
+}
+</style>

+ 2 - 1
src/views/service/parts/top.vue

@@ -6,7 +6,7 @@
           <el-col :span="20" class="left">
             {{ topText }}
           </el-col>
-          <el-col :span="4" class="right">
+          <el-col :span="4" class="right" v-if="userMore">
             <el-link :underline="false" @click="more">MORE</el-link>
           </el-col>
         </el-col>
@@ -21,6 +21,7 @@ export default {
   name: 'top',
   props: {
     topText: { type: String },
+    userMore: { type: Boolean, default: true },
   },
   components: {},
   data: function () {