Kaynağa Gözat

功能权限配置

zhuliu 1 yıl önce
ebeveyn
işleme
2535585a82

+ 12 - 4
src/router/index.js

@@ -1,6 +1,7 @@
 import Vue from 'vue'
 import VueRouter from 'vue-router'
 import Cookies from 'js-cookie'
+import Permission from '@/utils/permissions'
 
 Vue.use(VueRouter)
 
@@ -60,7 +61,8 @@ const routes = [
             meta: {
               title: '专利数据库',
               sign: 'project',
-              belong: 'project'
+              belong: 'project',
+              permission:'xiaoshi/project'
             },
             component: () => import('@/views/project/index.vue'),
           },
@@ -169,7 +171,8 @@ const routes = [
             meta: {
               title: '产品',
               sign: 'product',
-              belong: 'Product'
+              belong: 'Product',
+              permission:'xiaoshi/product'
             },
             component: () => import('@/views/product/index.vue'),
           },
@@ -265,7 +268,8 @@ const routes = [
             meta: {
               title: '报告',
               sign: 'report',
-              belong: 'AllReport'
+              belong: 'AllReport',
+              permission:'xiaoshi/report'
             },
             component: () => import('@/views/report/index.vue'),
           },
@@ -473,7 +477,8 @@ const routes = [
         meta: {
           title: '专利检索',
           sign: 'conditionImport',
-          belong: 'conditionImport'
+          belong: 'conditionImport',
+          permission:'xiaoshi/patentSearch'
         },
         component: () => import('@/views/components/import/conditionImport'),
       },
@@ -557,6 +562,9 @@ router.beforeEach((to, from, next) => {
     }
     next()
   }
+  else if(to.meta.permission && !Permission.FunPermissions(to.meta.permission)){
+    next({ path: '/401' })
+  }
   else if (to.meta.allowPath) {
     if (to.meta.title) {
       document.title = to.meta.title;

+ 2 - 4
src/store/modules/chart.js

@@ -70,10 +70,8 @@ export default {
     async getSourceDataList({ commit, state, getters, dispatch }, dimension) {
       let form = { ...state.form }
       state.selectedLoad[dimension] = true
-      if(!form.schema[dimension].field){
-        return
-      }
-      if (form.schema[dimension].ptype !== 0 && form.schema[dimension].ptype !== 4 &&  form.schema[dimension].ptype !== 3) {
+
+      if (form.schema[dimension].field && form.schema[dimension].ptype !== 0 && form.schema[dimension].ptype !== 4 &&  form.schema[dimension].ptype !== 3) {
         // let params = {
         //   uid: form.uid || '',
         //   patentKey: state.patentKey,

+ 1 - 1
src/utils/model/contextMenu/index.vue

@@ -63,7 +63,7 @@ export default {
     this.$nextTick(()=>{
         window.addEventListener('mousedown',(e)=>{
           var div = this.$refs.myContextMenu
-          if(div.style.display!='none'){
+          if(div && div.style && div.style.display!='none'){
             if (!div.contains(e.target)) {
               this.$store.commit("SET_CONTEXT_MENU", 
                 {

+ 3 - 1
src/views/analyse/custom/components/Tabs/Item.vue

@@ -19,7 +19,7 @@
                 </span>
               </div>
             </template>
-            <div v-for="item in menu.children" :key="item.uid" @click="handleSelect(item.uid)" class="tree-item" :class="{ 'is-active2' : item.uid === form.uid }">
+            <div v-for="item in menu.children" :key="item.uid" @click="handleSelect(item.id)" class="tree-item" :class="{ 'is-active2' : item.uid === form.uid }">
               <div class="custom-title">
                 <span class="label">{{ item.name }}</span>
                 <span class="do">
@@ -45,6 +45,8 @@ export default {
       activeItem2: this.activeItem,
     }
   },
+  watch:{
+  },
   mounted() {
   },
   methods: {

+ 2 - 2
src/views/analyse/custom/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="height_100 custom-analyse">
+  <div class="height_100 custom-analyse" v-if="showPage">
     <el-container>
       <el-aside width="350px">
         <TabItem :active-item="activeItem" :treeList="treeList" @edit="handleEdit" @delete="handleDelete" @select="handleSelect" @handleAdd3="handleAdd3"></TabItem>
@@ -82,6 +82,7 @@ export default {
   props: {},
   data() {
     return {
+      showPage:false,
         enable:[],
         activeItem:[],
         // treeList:[],
@@ -408,7 +409,6 @@ export default {
         var sign = false
         var count = []
         var dimensions = []
-        console.log(this.form)
         if(this.form.schema.x.field && this.form.schema.y.field){
             sign = true
             dimensions = ['x','y']

+ 16 - 15
src/views/home/components/echarts/components/event.vue

@@ -58,22 +58,23 @@ export default {
         }).catch(err => {
           data = []
         })
+      
+        this.scenario.forEach((item,index) => {
+          var obj = data.find(i=>{
+            return i.value == item.id
+          })
+          var event = {}
+          event.name = item.name
+          event.id = item.id
+          if(obj){
+            event.value = obj.count
+          }else{
+            event.value = 0
+          }
+          this.eventData.push(event)
+        });
+        this.initChart()
       }
-      this.scenario.forEach((item,index) => {
-        var obj = data.find(i=>{
-          return i.value == item.id
-        })
-        var event = {}
-        event.name = item.name
-        event.id = item.id
-        if(obj){
-          event.value = obj.count
-        }else{
-          event.value = 0
-        }
-        this.eventData.push(event)
-      });
-      this.initChart()
     },
     initChart() {
       const chartDom = this.$refs.eventEcharts;

+ 1 - 1
src/views/layout/mixins/index.js

@@ -68,7 +68,7 @@ export const commonData={
     },
     //获取权限
     getPermissionList(){
-      var code = "e424f3cc4f8138f0f68bef092b92212f,6a8d3f4d1d5f11eda41c00163e2f0200"
+      var code = "e424f3cc4f8138f0f68bef092b92212f;6a8d3f4d1d5f11eda41c00163e2f0200"
       this.$api.getPermissionList({code:code}).then(response=>{
         this.$store.commit('SET_PERMISSION', response.data)
       }).catch(error=>{

+ 4 - 0
src/views/product/components/framework/viewIndex.vue

@@ -229,6 +229,10 @@ export default {
     },
     // 预览图片
     commandPackage(row) {
+      if(!row.systemFileList || row.systemFileList.length == 0){
+        this.$message.error('暂无图片可预览')
+        return false
+      }
       this.imgSrc = this.$commonJS.checkViewer(row.systemFileList[0].guid)
       this.showImg = true
     },

+ 6 - 63
src/views/product/components/index.vue

@@ -59,6 +59,7 @@ import categoryTable from './view/categoryTable.vue'
 import addEditCategory from './dialog/addEditCategory.vue'
 import addEditProduct from './dialog/addEditProduct.vue'
 import marketing from './dialog/marketing.vue'
+import fun from './mixins/fun.js'
 export default {
   components: {
     categoryTable,
@@ -66,10 +67,8 @@ export default {
     addEditProduct,
     marketing
   },
+  mixins:[fun],
   props:{
-    patentNo:{
-
-    }
   },
   data() {
     return {
@@ -130,10 +129,7 @@ export default {
       tableData:[],
       //加载
       loading:false,
-      //展示图片
-      showImg:false,
-      //图片地址
-      imgSrc:'',
+      
       //接受子组件消息
       handleMessage:'',
     }
@@ -250,60 +246,11 @@ export default {
           break;
       }
     },
-    /**
-     * 营销数据趋势图
-     * @param {Object} row 
-     * @param {Number} val 
-     */
-     showTrend(row, val) {//val为数据类型,1为产品类别,2为产品
-      const router = this.$router.resolve({
-        path: '/chartIndex',
-        query: {
-          id: row.id,
-          type: val,
-          name: row.name
-        }
-      })
-      window.open(router.href, '_blank');
-    },
+    
 
-     // 进入商品化专利
-    toCommodity(row) {
-      let router = this.$router.resolve({
-        path: '/commodity',
-        query: {
-          productId:row.id,
-          productName:row.name,
-        }
-      })
-      window.open(router.href,'_blank')
-    },
+    
 
-     // 进入产品类别分类架构(与产品架构一致)
-    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(form),
-        }
-      })
-      window.open(router.href, '_blank')
-    },
-    //预览图片
-    checkImage(row){
-      this.imgSrc = this.$commonJS.checkViewer(row.systemFileList[0].guid)
-      this.showImg = true
-    },
-    //关闭预览图片
-    closeViewer(){
-      this.showImg = false
-    },
+   
     //获取删除的id
     deletes(row){
       this.deleteData([row.id])
@@ -359,10 +306,6 @@ export default {
     // 获取产品类别数据
     getList(){
       var str = this.$commonJS.objectToString(this.searchOption)
-      //todo
-      if(this.patentNo){
-
-      }
       let params = {
         ...this.queryParams,//分页信息
         searchQuery:str,//检索条件

+ 69 - 0
src/views/product/components/mixins/fun.js

@@ -0,0 +1,69 @@
+export default {
+    data() {
+        return {
+            //展示图片
+            showImg:false,
+            //图片地址
+            imgSrc:'',
+        }
+    },
+    methods: {
+        // 进入产品类别分类架构(与产品架构一致)
+        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(form),
+                }
+            })
+            window.open(router.href, '_blank')
+        },
+        /**
+         * 营销数据趋势图
+         * @param {Object} row 
+         * @param {Number} val 
+         */
+        showTrend(row, val) {//val为数据类型,1为产品类别,2为产品
+            const router = this.$router.resolve({
+                path: '/chartIndex',
+                query: {
+                    id: row.id,
+                    type: val,
+                    name: row.name
+                }
+            })
+            window.open(router.href, '_blank');
+        },
+         // 进入商品化专利
+        toCommodity(row) {
+            let router = this.$router.resolve({
+                path: '/commodity',
+                query: {
+                    productId:row.id,
+                    productName:row.name,
+                }
+            })
+            window.open(router.href,'_blank')
+        },
+        
+        //预览图片
+        checkImage(row){
+            if(!row.systemFileList || row.systemFileList.length == 0){
+                this.$message.error('暂无图片可预览')
+                return false
+            }
+            this.imgSrc = this.$commonJS.checkViewer(row.systemFileList[0].guid)
+            this.showImg = true
+        },
+        //关闭预览图片
+        closeViewer(){
+            this.showImg = false
+        },
+    },
+}

+ 4 - 0
src/views/project/patentCollection/index.vue

@@ -484,6 +484,10 @@ export default {
     },
     //创建FTO报告
     handleAnalysesFto() {
+      if(!this.$permission.FunPermissions('xiaoshi/report/FTO')){
+        this.$showPermissionDialog()
+        return false
+      }
       var form = {
         reportType: 3,
         signPatentNo: '',

+ 16 - 1
src/views/project/patentDetails/components/patentDetails.vue

@@ -127,6 +127,7 @@ import PatentInstruction from './patentMessage/PatentInstruction.vue'
 import PatentFamily from './patentMessage/PatentFamily.vue'
 import PatentStatus from './patentMessage/PatentStatus.vue'
 import PatentPDF from './patentMessage/PatentPDF.vue'
+import pageProduct from './patentMessage/pageProduct.vue'
 import { projectData, handleData } from '../../patentCollection/components/mixins/index'
 
 import PatentField from './PatentField.vue'
@@ -141,6 +142,9 @@ export default {
     PatentFamily,
     PatentStatus,
     PatentPDF,
+    pageProduct,
+
+
     PatentField,
     addAndEditReport,
     projectListDialog
@@ -248,7 +252,7 @@ export default {
           label: '许可历史'
         },
         {
-          value: 'ProductManage',
+          value: 'pageProduct',
           // show: this.$permission('/workspace/product') ? false : true,
           label: '商品化'
         },
@@ -394,6 +398,17 @@ export default {
     },
     // 创建报告:无效分析等点击事件
     handleAnalyse(id) {
+      var permission = {
+        1:'analysisAndOpinion',
+        2:'analysisAndOpinion',
+        4:'tort',
+        5:'avoidDesign',
+        7:'officiallyInvalid'
+      }
+      if(!this.$permission.FunPermissions('xiaoshi/report/'+permission[id])){
+        this.$showPermissionDialog()
+        return false
+      }
       var form = {
         reportType: id,
         signPatentNo: this.patent.patentNo,

+ 220 - 0
src/views/project/patentDetails/components/patentMessage/pageProduct.vue

@@ -0,0 +1,220 @@
+<template>
+  <div class="height_100">
+    <el-container>
+        <el-header>
+            <div id="step1">
+                <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch>
+            </div>
+        </el-header>
+        <el-main v-DivHeight="getDivHeight">
+            <el-table :data="data" header-row-class-name="custom-table-header"  v-if="showTable" :maxHeight="tableHeight" @sort-change="sortChange" border>
+                <el-table-column label="#" width="60" type="index" align="center">
+                    <template slot-scope="scope">
+                    <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
+                    </template>
+                </el-table-column>
+
+                <el-table-column v-for="item in column" :render-header="$commonJS.renderHeaderMethods" :key="item.value" :prop="item.value" :label="item.name" align="center" sortable="custom">
+                    <template slot-scope="scope">
+                    <div v-if="['name'].includes(item.value)">
+                        <el-link @click="handleItem(scope.row, '2')" type="primary">
+                        <span  v-html="$commonJS.getColumnData(scope.row, item)"></span>
+                        </el-link>
+                    </div>
+                    <div v-else v-html="$commonJS.getColumnData(scope.row, item)">
+                    </div>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" align="center" width="150px">
+                    <template slot-scope="scope">
+                    <el-dropdown split-button type="primary" size="small" @click="handleCommand('0', scope.row)"
+                        @command="handleCommand($event, scope.row)">
+                        <span>编 辑</span>
+                        <el-dropdown-menu slot="dropdown" style="text-align:center">
+                        <el-dropdown-item command="1">预览图片</el-dropdown-item>
+                        <el-dropdown-item command="2">产品架构</el-dropdown-item>
+                        <el-dropdown-item command="3">产品的营销数据</el-dropdown-item>
+                        <el-dropdown-item command="4">营销数据的趋势图</el-dropdown-item>
+                        <el-dropdown-item command="5">专利布局可视化</el-dropdown-item>
+                        <el-dropdown-item command="6">商品化专利</el-dropdown-item>
+                        <el-dropdown-item command="7" divided style="color:red">删 除</el-dropdown-item>
+                        </el-dropdown-menu>
+                    </el-dropdown>
+                    </template>
+                </el-table-column>
+                </el-table>
+        </el-main>
+        <el-footer class="pagination">
+            <el-pagination background layout="total,sizes, prev, pager, next, jumper" :current-page.sync="queryParams.current" :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="total">
+            </el-pagination>
+        </el-footer>
+    </el-container>
+    <marketing ref="marketing"></marketing>
+    <addEditProduct ref="addEditProduct" @getMessage="getList"></addEditProduct>
+    <myImageViewer v-if="showImg" :on-close="closeViewer" :src="imgSrc"></myImageViewer>
+  </div>
+</template>
+
+<script>
+import { getTableHeight } from '@/views/components/mixins'
+import mixins from '@/views/product/components/mixins/index'
+import fun from '@/views/product/components/mixins/fun'
+import product from '@/views/product/components/mixins/product'
+
+import marketing from '@/views/product/components/dialog/marketing.vue'
+import addEditProduct from '@/views/product/components/dialog/addEditProduct.vue'
+export default {
+  components: {
+    marketing,
+    addEditProduct
+  },
+  props: {
+    patentNo:{}
+  },
+  mixins:[getTableHeight,mixins,fun,product],
+  data() {
+    return {
+        showTable:true,
+        column:[
+          {
+            value:'name',
+            type:'String',
+            name:'类别名称'
+          },
+          {
+            value:'marketTime',
+            type:'DateTime',
+            name:'上市时间'
+          },
+          {
+            value:'companyName',
+            type:'String',
+            name:'所属公司'
+          },
+          {
+            value:'licenseRate',
+            type:'String',
+            name:'许可费率'
+          },
+          {
+            value:'description',
+            type:'String',
+            name:'产品说明'
+          },
+          {
+            value:'createName',
+            type:'String',
+            name:'创建人'
+          },
+          {
+            value:'createTime',
+            type:'DataTime',
+            name:'创建时间'
+          },
+        ],
+        searchFiled:[],
+        //检索条件
+        searchOption: {},
+        queryParams:{
+            size:10,
+            current:1
+        },
+        total:0,
+        tableData:[],
+        // 排序数组
+        sort: [
+            {
+            "orderBy": "createTime",
+            "orderType": 1
+            }
+        ],
+    };
+  },
+  watch: {
+    patentNo(){
+        this.getList()
+    }
+  },
+  computed: {},
+  created() {},
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    //获取检索条件检索
+    search(val) {
+        let params = {}
+        if(val.length>0){
+            val.forEach(item => {
+                if (item.type == 3) {
+                    params[item.value]=item.searchValue.map(itemValue => {
+                    return itemValue.value
+                    })
+                } else {
+                    params[item.value]=item.searchValue.label
+                }
+            })
+        }
+        this.searchOption = this.$commonJS.ArrayToArray(val)
+        this.queryParams.current = 1
+        this.getList()
+    },
+    getList(){
+
+    },
+    handleCurrentChange(val){
+        this.queryParams.current = val
+        this.getList()
+    },
+    async handleCommand( option, row ){
+        if(!(await this.$permission.producePermission(row.id,2))){
+            this.$showPermissionDialog()
+            return false
+        }
+        switch (option) {
+            case '0'://编辑
+                this.$refs.addEditProduct.open(row)
+            break;
+            case '1'://预览图片
+                this.checkImage(row)
+            break;
+            case '2'://产品架构
+                this.toFramework(row,2)
+            break;
+            case '3'://产品的营销数据
+                this.$refs.marketing.open(row)
+            break;
+            case '4'://产品的营销数据趋势图
+                this.showTrend(row,2)
+            break;
+            case '5'://专利布局可视化
+
+            break;
+            case '6'://商品化专利
+                this.toCommodity(row)
+            break;
+            case '7'://删除产品
+                this.deletes(row)
+            break;
+            
+            default:
+            break;
+        }
+    },
+    // 排序方法
+    sortChange({ column, prop, order }) {
+      //如需要多个字段排序,则不需要清空
+      var params = {
+        sort:this.sort,
+        column,
+        prop,
+        order,
+      }
+      this.sort = this.$commonJS.getSortData(params)
+      this.getList()
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 13 - 2
src/views/report/components/index.vue

@@ -43,8 +43,7 @@
       </el-main>
       <el-footer class="pagination" v-if="viewType != 'visual'">
         <el-pagination background layout="total,sizes, prev, pager, next, jumper" :current-page.sync="queryParams.current"
-          :page-sizes="pageSize" :page-size.sync="queryParams.size" @current-change="handleCurrentChange"
-          :handleMessage="handleMessage" @size-change="handleSizeChange" :total="total">
+          :page-sizes="pageSize" :page-size.sync="queryParams.size" @current-change="handleCurrentChange" @size-change="handleSizeChange" :total="total">
         </el-pagination>
       </el-footer>
     </el-container>
@@ -475,6 +474,18 @@ export default {
     },
     //打开创建报告弹窗
     handleAnalyse(id) {
+      var permission = {
+        1:'analysisAndOpinion',
+        2:'analysisAndOpinion',
+        3:'FTO',
+        4:'tort',
+        5:'avoidDesign',
+        7:'officiallyInvalid'
+      }
+      if(!this.$permission.FunPermissions('xiaoshi/report/'+permission[id])){
+        this.$showPermissionDialog()
+        return false
+      }
       var form = {
         reportType: id,
         eventId: this.eventId,

+ 12 - 0
src/views/report/components/productResult/productResult.vue

@@ -277,6 +277,18 @@ export default {
     },
     // 创建报告
     handleAnalyse(val) {
+      var permission = {
+        1:'analysisAndOpinion',
+        2:'analysisAndOpinion',
+        3:'FTO',
+        4:'tort',
+        5:'avoidDesign',
+        7:'officiallyInvalid'
+      }
+      if(!this.$permission.FunPermissions('xiaoshi/report/'+permission[val])){
+        this.$showPermissionDialog()
+        return false
+      }
       var form = {
         reportType: val,
         signPatentNo: this.patentNo,