sunjh 6 lat temu
rodzic
commit
478136d94a
2 zmienionych plików z 10 dodań i 109 usunięć
  1. 7 106
      src/components/project/Project.vue
  2. 3 3
      src/mock/getProjectDetailMock.js

+ 7 - 106
src/components/project/Project.vue

@@ -48,9 +48,9 @@
           </el-checkbox-group>
           <span
             v-if="!isModifyMode"
-            v-bind:class="['badge',{ 'ios-platform': item.toLowerCase()=='ios','android-platform': item.toLowerCase()=='android','web-platform': item.toLowerCase()=='web'}]"
-            v-for="item in platformType"
-          >{{item}}</span>
+            class="badge"
+            v-for="item in project.platform"
+          >{{platformType[item]}}</span>
         </el-form-item>
         <el-form-item label="需求描述" prop="desc">
           <el-input v-if="isModifyMode" type="textarea" v-model="project.desc"></el-input>
@@ -307,110 +307,10 @@ export default {
       tabPosition: 'top',
       institutionArray: Enum.institution,
       isModifyMode: false,
-      platformType: [],
+      platformType: PlatformType,
       resourceType: ResourceType,
-      project: {
-        name: '项目名',
-        code: '27382hdsjkfdskfK',
-        contact: {
-          name: '小王',
-          phone: '12426177281'
-        },
-        type: ['安全漏洞扫描'],
-        platform: ['0', '1'],
-        desc: '需求描述文字',
-        doc: '',
-        file: 'http://a.apk',
-        resource: 1,
-        location: {provinceCode: '3200', cityCode: '3201'},
-        institution: '',
-        datetime: new Date('2018-11-11 23:11:11'),
-        price: '400',
-        useage: '练习',
-        budget: '100',
-        task: [
-          {
-            id: '1',
-            name: '任务1',
-            desc: '任务描述文字',
-            type: '安全漏洞扫描',
-            resource: 1,
-            location: {provinceCode: '3200', cityCode: '3201'},
-            institution: '',
-            datetime: '2018-11-12 11:11:01',
-            worker: ''
-          },
-          {
-            id: '2',
-            name: '任务2',
-            desc: '任务描述文字',
-            type: '接口测试',
-            resource: 1,
-            location: {provinceCode: '3200', cityCode: '3201'},
-            institution: '',
-            datetime: '2018-11-11 10:11:01',
-            worker: ''
-          },
-          {
-            id: '3',
-            name: '任务3',
-            desc: '任务描述文字',
-            type: '功能测试服务',
-            resource: 1,
-            location: {provinceCode: '3200', cityCode: '3201'},
-            institution: '',
-            datetime: '2018-11-11 11:11:01',
-            worker: ''
-          }
-        ],
-        reportList: [
-          {
-            id: 1,
-            type: '项目可行性报告',
-            file: []
-          },
-          {
-            id: 2,
-            type: '项目测试方案(汇总)',
-            file: [{name: 'report2', url: 'report2.excel'}]
-          },
-          {
-            id: 3,
-            type: '项目测试报告(汇总)',
-            file: [{name: 'report3', url: 'report3.excel'}]
-          },
-          {
-            id: 4,
-            type: '项目缺陷报告(汇总)',
-            file: [{name: 'report4', url: 'report4.excel'}]
-          },
-          {
-            id: 5,
-            type: '项目用例报告(汇总)',
-            file: [{name: 'report5', url: 'report5.excel'}]
-          }
-        ],
-      },
-      analyseDemandList: [
-        {
-          id: '1',
-          institution: '上软',
-          feasibilityReport: {
-            name: '可行性分析报告',
-            url: 'feasibilityReport.docx'
-          },
-          priceAuditReport: {name: '价格审核告', url: 'priceAuditReport.docx'}
-        },
-        {
-          id: '1',
-          institution: '上软',
-          feasibilityReport: {
-            name: '可行性分析报告',
-            url: 'feasibilityReport.docx'
-          },
-          priceAuditReport: {name: '价格审核告', url: 'priceAuditReport.docx'}
-        }
-      ],
+      project: {},
+      analyseDemandList: [],
       pickerOptions: {
         shortcuts: [
           {
@@ -515,6 +415,7 @@ export default {
     },
     init () {
       this.projectId = +this.$route.params.projectId
+      this.loadData()
       this.project.platform.map(item => {
         this.platformType.push(PlatformType[item])
       })

+ 3 - 3
src/mock/getProjectDetailMock.js

@@ -27,7 +27,7 @@ var data = Mock.mock({
     'location': {'provinceCode': '3200', 'cityCode': '3201'},
     //当项目发布类型为1或2时,institution字段无效;发布类型为0时,institution字段表示接收项目的区域
     'institution': '',
-    'datetime': 'Sun Nov 11 2018 23:11:11 GMT+0800 (中国标准时间) 2018-11-11 11:11:01', //new Date("2018-11-11 23:11:11"),
+    'datetime': new Date("2018-11-11 23:11:11"), //new Date("2018-11-11 23:11:11"),
     'price': '400',
     'useage': '练习',
     'budget': '100',
@@ -46,7 +46,7 @@ var data = Mock.mock({
         //当项目发布类型为1或2时,institution字段无效;发布类型为0时,institution字段表示接收项目的区域
         'institution': '',
         //任务截止时间
-        'datetime': '2018-11-12 11:11:01',
+        'datetime': new Date("2018-11-11 23:11:11"),
         // 如已分配,则为测评机构id,否则为空
         'worker': ''
       },
@@ -63,7 +63,7 @@ var data = Mock.mock({
         'location': {'provinceCode': '3200', 'cityCode': '3201'},
         //当项目发布类型为1或2时,institution字段无效;发布类型为0时,institution字段表示接收项目的区域
         'institution': '',
-        'datetime': '2018-11-12 11:11:01',
+        'datetime': new Date("2018-11-11 23:11:11"),
         'worker': ''
       }
     ],