瀏覽代碼

产品架构

zhuliu 1 年之前
父節點
當前提交
c4f5bf9199

+ 9 - 10
src/views/product/components/details/components/index.vue

@@ -12,7 +12,7 @@
             
         </el-header>
         <el-main>
-            <component :is='activeName' :type="type" :id="id" :name="name" :licenseRate="licenseRate"></component>
+            <component :is='activeName' :type="type" :id="id" :name="name" :licenseRate="licenseRate" :categoryId="categoryId"></component>
         </el-main>
       </el-container>
     </div>
@@ -23,17 +23,13 @@ import basicMessage from './basicMessage.vue';
 // import market from '../../market/index.vue'
 import chart from '../../echarts/components/echarts.vue'
 import marketAndTrend from './marketAndTrend.vue';
+import framework from '../../framework/viewIndex.vue'
   export default {
     components: {
         basicMessage,
-        // market,
         chart,
-        marketAndTrend
-    //   ProductMessage:() => import('./productMessage.vue'),
-    //   RelatedPatents:()=> import("../relatedPatents/components/relatedPatents.vue"),
-    //   // MarketingData:()=> import('../marketingData.vue'),
-    //   charts:()=> import('./charts.vue'),
-    //   Framework:()=> import('../framework/framework.vue')
+        marketAndTrend,
+        framework
     },
     props: {
         type:{
@@ -47,6 +43,9 @@ import marketAndTrend from './marketAndTrend.vue';
         },
         licenseRate:{
 
+        },
+        categoryId:{
+
         }
     },
     data() {
@@ -78,7 +77,7 @@ import marketAndTrend from './marketAndTrend.vue';
                     {
                         label:'分类架构',
                         value:'3',
-                        path:'Framework'
+                        path:'framework'
                     },
                     {
                         label:'专利布局可视化',
@@ -107,7 +106,7 @@ import marketAndTrend from './marketAndTrend.vue';
                     {
                         label:'产品架构',
                         value:'4',
-                        path:'Framework'
+                        path:'framework'
                     },
                     {
                         label:'专利布局可视化',

+ 4 - 1
src/views/product/components/details/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <product-Details :type="type" :id="id" :name="name" :licenseRate="licenseRate"></product-Details>
+    <product-Details :type="type" :id="id" :name="name" :licenseRate="licenseRate" :categoryId="categoryId"></product-Details>
   </div>
 </template>
 
@@ -32,6 +32,9 @@ export default {
     //产品或者产品类别许可费率
     licenseRate(){
         return this.$route.query.licenseRate
+    },
+    categoryId(){
+      return this.$route.query.categoryId
     }
   },
   created() {},

+ 4 - 4
src/views/product/components/dialog/classifyNode.vue

@@ -4,7 +4,7 @@
     <el-dialog :title="title" :visible.sync="dialogVisible" :before-close="handleClose" width="600px"
       :close-on-click-modal="false">
       <el-form :model="form" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
-        <el-form-item :label="row.typesOf==1?'所属类别名称':'所属产品名称'" prop="productName">
+        <el-form-item :label="row.type==1?'所属类别名称':'所属产品名称'" prop="productName">
           <el-input v-model="form.productName" disabled placeholder="请输入所属产品名称"></el-input>
         </el-form-item>
         <el-form-item label="所属架构">
@@ -81,10 +81,10 @@ export default {
       if (data) {
           this.options=this.treeDataPath
           this.form = JSON.parse(JSON.stringify(data))
-          this.title = row.typesOf==1?'编辑类别架构': '编辑产品架构'
+          this.title = row.type==1?'编辑类别架构': '编辑产品架构'
           this.$set(this.form, 'parent_id', this.form.parentId)
       } else {
-        this.title = row.typesOf==1?'新增类别架构':'新增产品架构'
+        this.title = row.type==1?'新增类别架构':'新增产品架构'
         if (newData && newData.pathName) {
           this.$set(this.form, 'parent_id', newData.id)
           this.options=this.treeDataPath
@@ -94,7 +94,7 @@ export default {
         }
       }
       
-      this.form.type=row.typesOf//类型:1产品类别,2产品,3技术分类,4自定义树
+      this.form.type=row.type//类型:1产品类别,2产品,3技术分类,4自定义树
       this.form.productName = row.name
       this.form.typeId=row.id
       this.dialogVisible = true

+ 2 - 4
src/views/product/components/framework/index.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 架构 -->
   <div>
-    <viewIndex style="height: 100%;" :row="row" :typesOf="typesOf"></viewIndex>
+    <viewIndex style="height: 100%;" :name="row.name" :id="row.id" :categoryId="row.categoryId" :type="row.type"></viewIndex>
   </div>
 </template>
 
@@ -17,12 +17,10 @@ export default {
     }
   },
   computed: {
+    //type判断是分类架构1还是产品架构2
     row() {
       return JSON.parse(this.$route.query.row)
     },
-    typesOf() {//判断是分类架构1还是产品架构2
-      return this.$route.query.typesOf
-    },
   },
   mounted() {
     

+ 27 - 14
src/views/product/components/framework/viewIndex.vue

@@ -1,11 +1,11 @@
 <template>
   <!-- 架构主页面 -->
-  <div class="framework">
+  <div class="framework height_100">
     <el-container>
       <el-header>
         <div style="display: flex;justify-content: space-between;align-items:center;width:100%;padding:0 10px;">
           <div>
-            <p>{{ typesOf==1?'产品类别名称:':'产品名称:' }}{{ row.name }}</p>
+            <p>{{ row.type==1?'产品类别名称:':'产品名称:' }}{{ row.name }}</p>
           </div>
           <div>
             <el-button type="primary" size="small" @click="handleImport">导 入</el-button>
@@ -17,7 +17,7 @@
           <div style="display:flex;margin-bottom:10px;">
             <el-input v-model="productName" size="small" placeholder="请输入名称" style="margin-right:10px;"></el-input>
             <el-button type="primary" size="small" @click="handleQuery">查询</el-button>
-            <el-button v-if="typesOf=='1'" type="primary" size="small" @click="handleAppend">新增分类节点</el-button>
+            <el-button v-if="row.type=='1'" type="primary" size="small" @click="handleAppend">新增分类节点</el-button>
             <el-dropdown v-else split-button type="primary" size="small" @click="handleAppend">
               <span>新增分类节点</span>
               <el-dropdown-menu slot="dropdown">
@@ -69,7 +69,7 @@
               @on-sort="handleSort">
             </component>
           </el-main>
-          <el-footer>
+          <el-footer class="pagination">
             <el-pagination background layout="total, prev, pager, next, jumper" :current-page.sync="queryParams.current"
               :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="total">
             </el-pagination>
@@ -80,7 +80,7 @@
 
     <classifyNode ref="classifyNode" :treeDataPath="treeDataPath" @isSuccess="handleSuccess"></classifyNode>
     <myImageViewer v-if="showImg" :on-close="closeViewer" :src="imgSrc"></myImageViewer>
-    <myNodeCopy v-if="typesOf=='2'" ref="nodeCopy" :treeData="categoryTreeData" source="1" :checkStrictly="true" @checkId="handleChecked"></myNodeCopy>
+    <myNodeCopy v-if="row.type=='2'" ref="nodeCopy" :treeData="categoryTreeData" source="1" :checkStrictly="true" @checkId="handleChecked"></myNodeCopy>
     
   </div>
 </template> 
@@ -90,8 +90,12 @@ import frameworkTable from './view/table.vue'
 import classifyNode from '../dialog/classifyNode.vue';
 export default {
   props: {
-    row: Object,//name:产品名称或者是产品类别名称;id:产品id或者是产品类别id;typesof:类型
-    typesOf: String,//1是产品类别分类架构,2是产品架构
+    name:{
+      type:String
+    },//产品名称或者是产品类别名称
+    id:{},//产品id或者是产品类别id
+    categoryId:{},//产品类别Id
+    type:{}//类型1是产品类别,2是产品
   },
   components: {
     frameworkTable,
@@ -141,8 +145,17 @@ export default {
       nodeId:null,
     }
   },
+  computed:{
+    row(){
+      return {
+        name:this.name,
+        categoryId:this.categoryId,
+        id:this.id,
+        type:this.type
+      }
+    }
+  },
   mounted() {
-    this.row.typesOf = this.typesOf
     // 请求数据(左侧tree)
     this.getList()
     // 请求列表的数据(右侧table)
@@ -150,7 +163,7 @@ export default {
     // 请求架构路径
     this.getPath()
     // 请求类别的分类架构,用于复制类别架构至产品
-    if (this.typesOf == '2') {
+    if (this.row.type == '2') {
       this.getCategory()
     }
     
@@ -304,7 +317,7 @@ export default {
         fromType: 1,//类型:1产品类别,2产品,3技术分类,4自定义树
         fromTypeId:this.row.categoryId,//类别id
         toType: 2,//类型:1产品类别,2产品,3技术分类,4自定义树
-        toTypeId: this.row.id,//产品或类别id
+        toTypeId: this.row.id,//产品id
         toNodeId: this.nodeId,//放到哪一个节点下面
         ifCopyChild:val.check,//是否有子节点  
       }
@@ -336,7 +349,7 @@ export default {
     async getList() {
       let params = {
         name: this.productName,//事件名称
-        type: this.typesOf,//类型:1产品类别,2产品,3技术分类,4自定义树
+        type: this.row.type,//类型:1产品类别,2产品,3技术分类,4自定义树
         typeId: this.row.id,//产品或类别id
       }
       await this.$api.queryTreeNodeTree(params).then(res => {
@@ -356,7 +369,7 @@ export default {
         if (item == 'name') {//产品名称
           label = this.productName
         } else if (item == 'type') {
-          label = this.typesOf
+          label = this.row.type
         } else if (item == 'typeId') {
           label = this.row.id
         } else {
@@ -399,7 +412,7 @@ export default {
         ...this.searchOption,//检索条件
         orderDTOList: this.sort,//排序
         // name: this.productName,//事件名称
-        // type: this.typesOf,//类型:1产品类别,2产品,3技术分类,4自定义树
+        // type: this.row.type,//类型:1产品类别,2产品,3技术分类,4自定义树
         // typeId: this.row.id,//产品或类别id
       }
       this.$api.queryTable(params).then(res => {
@@ -416,7 +429,7 @@ export default {
     // 请求架构路径
     getPath() {
       let params = {
-        type: this.typesOf,//区分产品架构、自定义树等
+        type: this.row.type,//区分产品架构、自定义树等
         typeId: this.row.id,//产品或类别id
       }
       this.$api.queryTreePath(params).then(res => {

+ 7 - 2
src/views/product/components/index.vue

@@ -267,11 +267,16 @@ export default {
 
      // 进入产品类别分类架构(与产品架构一致)
     toFramework(row,val) {
+      var form = {
+        name:row.name,
+        id:row.id,
+        categoryId:row.categoryId,
+        type:val,
+      }
       let router = this.$router.resolve({
         path: '/frameworkIndex',
         query: {
-          row: JSON.stringify(row),
-          typesOf:val,
+          row: JSON.stringify(form),
         }
       })
       window.open(router.href, '_blank')

+ 2 - 1
src/views/product/components/mixins/index.js

@@ -22,7 +22,8 @@ export default {
                     type:type,
                     id:row.id,
                     name:row.name,
-                    licenseRate:row.licenseRate
+                    licenseRate:row.licenseRate,
+                    categoryId:row.categoryId
                   }
                 }
             )