Преглед изворни кода

Merge branch 'feature-private' into 'PrivateRelease'

新增应用类型页面

See merge request crowd-2019/crowd-test-service-front!174
郭超 пре 4 година
родитељ
комит
d2f34f35b6

+ 1 - 1
src/js/generalService.js

@@ -51,7 +51,7 @@ export const getAllFields = () => {
 }
 
 //获取所有应用类型
-export const getAllPlatformTypes = () => {
+export const getAllApplicationTypes = () => {
   // return ['Android APP', 'IOS APP', 'Web应用', 'C/S应用软件', '嵌入式软件', '工业控制软件', '信息技术产品', '其他']
   return Http.get(Apis.GENERAL.GET_ALL_ApplicationType)
 }

+ 2 - 0
src/js/index.js

@@ -62,6 +62,7 @@ import {
   getAllFields,
   getAllReportTypes,
   getAllServiceTypes,
+  getAllApplicationTypes,
   getFormalTimeFromDate,
   getGreenChannelAddProjectExcelTemplateFile,
   getIndexStatisticsInfo,
@@ -214,6 +215,7 @@ export {
   getAllReportTypes,
   //TODO 目前使用本地数据 需要修改 获取所有测试类型(与获取所有测评能力相同)
   getAllServiceTypes,
+  getAllApplicationTypes,
   //获取绿色通道创建项目时的模板文件
   getGreenChannelAddProjectExcelTemplateFile,
   //通过省和市名称获取省市代码

+ 40 - 0
src/pages/DetailPage/ApplicationTypeDetail.vue

@@ -0,0 +1,40 @@
+<template>
+  <div class="home-wrapper">
+    <div class="container" style="margin: 20px auto;">
+      <div class="create-body" v-for="item in applications">
+        <div class="title h2">{{ item.name }}</div>
+        <div class="h3">{{ item.introduction }}</div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {getAllApplicationTypes} from '@/js/index.js'
+
+export default {
+  name: "ApplicationTypeDetail",
+  data() {
+    return {
+      isLogin: false,
+      applications: [],
+    }
+  },
+  methods: {
+    setFields() {
+      getAllApplicationTypes().then((res) => {
+        this.applications = res
+      })
+    },
+  },
+  mounted() {
+    this.setFields();
+  }
+}
+</script>
+
+<style scoped>
+.item-template {
+  height: 80px;
+}
+</style>

+ 3 - 7
src/pages/Homepage/Homepage.vue

@@ -53,13 +53,10 @@
         </el-col>
 
         <el-col :span="19" class="test-type-wrapper">
-          <TestMenu :testTypeList="homeData.testTypeList" v-if="HOME_DISPLAY.test_menu"></TestMenu>
-          <TestCard :applicationTypeList="homeData.applicationTypeList" v-if="HOME_DISPLAY.test_card"></TestCard>
+          <TestMenu :testTypeList="homeData.testTypeList" v-if="HOME_DISPLAY.test_menu && homeData.testTypeList"></TestMenu>
+          <TestCard :applicationTypeList="homeData.applicationTypeList" v-if="HOME_DISPLAY.test_card && homeData.applicationTypeList"></TestCard>
           <el-row style="margin-top: 10px" v-if="HOME_DISPLAY.resource_and_tool">
-            <ResourceAndTool :resourceList="homeDataNoCache.toolList"></ResourceAndTool>
-          </el-row>
-          <el-row v-if="HOME_DISPLAY.brand_card">
-            <BrandCard :residentAgencyList=homeData.residentAgencyList></BrandCard>
+            <ResourceAndTool :resourceList="homeDataNoCache.toolList && homeDataNoCache.toolList"></ResourceAndTool>
           </el-row>
         </el-col>
       </el-row>
@@ -118,7 +115,6 @@ export default {
       logo_transparent:CONFIG.logo_transparent,
       user: {},
       isLogin: false,
-      loading: false,
       searchType: CONFIG.home_searchType,
       searchTypeArr: CONFIG.home_searchTypeArr,
       searchVal: '',

+ 22 - 7
src/pages/Homepage/TestCard.vue

@@ -1,11 +1,12 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="8" v-for="item in applicationTypeList" :key="item.name" style="height: 160px;margin-bottom: 10px">
+    <el-col :span="8" v-for="item in applications" :key="item.name" style="height: 160px;margin-bottom: 10px">
       <el-card class="test-card">
         <div slot="header" class="clearfix test-card-header">
           <span>{{ item && item.name }}</span>
+          <el-button style="float: right;line-height: 25px" type="text"  @click="getMore()">more>></el-button>
         </div>
-        <div>
+        <div class="test-card-description">
           <span>{{ item && item.introduction }}</span>
         </div>
       </el-card>
@@ -21,13 +22,18 @@ export default {
   name: "TestCard",
   props: ['applicationTypeList'],
   data() {
-    return {}
+    return {
+      applications:(this.applicationTypeList && this.applicationTypeList.length && this.applicationTypeList.length > 6) ?
+        this.applicationTypeList.slice(0,6) : this.applicationTypeList
+    }
   },
-  components: {
-    // Waterfall,
-    // WaterfallSlot
+  methods: {
+    getMore(){
+      this.$router.push({
+        path: '/application/detail',
+      });
+    },
   },
-  methods: {},
   mounted() {
   }
 }
@@ -49,6 +55,15 @@ export default {
     border-left: 5px solid $__color-primary;
     padding-left: 5px;
   }
+
+  .test-card-description {
+    height: 76px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    -webkit-line-clamp: 3;
+    -webkit-box-orient: vertical;
+  }
 }
 
 </style>

+ 9 - 0
src/router/index.js

@@ -400,6 +400,15 @@ export default new Router({
       }
     },
     {
+      path: '/application/detail',
+      name: 'ApplicationTypeDetail',
+      component: resolve => require(['@/pages/DetailPage/ApplicationTypeDetail.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      }
+    },
+    {
       path: '/test/type/detail',
       name: 'TestTypeDetail',
       component: resolve => require(['@/pages/DetailPage/TestTypeDetail.vue'], resolve),