Browse Source

主页和专题库

zhuliu 1 year ago
parent
commit
2d86f45335

+ 16 - 0
src/api/newApi/project.js

@@ -17,4 +17,20 @@ export default {
     queryPatentProject(data) {
         return axios.post("/xiaoshi/patentProject/queryPatentProject", data);
     },
+    /**
+     * 更新专利数据库
+     * @param {*} data 
+     * @returns 
+     */
+    updatePatentProject(data) {
+        return axios.post("/xiaoshi/patentProject/updatePatentProject", data);
+    },
+    /**
+     * 删除专利数据库
+     * @param {*} data 
+     * @returns 
+     */
+    deletePatentProject(data) {
+        return axios.post("/xiaoshi/patentProject/deletePatentProject", data);
+    },
 };

+ 10 - 5
src/views/components/dialog/fields.vue

@@ -23,8 +23,8 @@
                 <div>
                   <div>{{ field.name }}</div>
                   <div>
-                    <i class="el-icon-sort-down down" :disabled="index == filedList.length-1" @click.stop.prevent="down(index,field)"></i>
-                    <i class="el-icon-sort-up up" :disabled="index == 0" @click.stop.prevent="up(index,field)"></i>
+                    <el-button type="text" :disabled="index == filedList.length-1" class="down"> <i class="el-icon-sort-down"  @click.stop.prevent="down(index,field)"></i></el-button>
+                    <el-button type="text" :disabled="index == 0" class="up"><i class="el-icon-sort-up" @click.stop.prevent="up(index,field)"></i></el-button>
                   </div>
                 </div>
               </el-checkbox>
@@ -124,15 +124,16 @@ export default {
     },
     //全选
     handleCheckAllChange(val) {
-      this.checked = val ? this.filedList : [];
+      this.checked = val ? this.filedList.map(item=>{
+        return item.value
+      }) : [];
       this.isIndeterminate = false;
     },
     //勾选
     handleCheckedChange(value) {
       let checkedCount = value.length;
       this.checkAll = checkedCount === this.filedList.length;
-      this.isIndeterminate =
-        checkedCount > 0 && checkedCount < this.filedList.length;
+      this.isIndeterminate = checkedCount > 0 && checkedCount < this.filedList.length;
     },
   },
 };
@@ -147,6 +148,10 @@ export default {
         display: flex;
         justify-content: space-between;
         align-items: center;
+        .down,.up{
+          padding: 0;
+          margin: 0;
+        }
         i{
           color: #999;
         }

+ 12 - 3
src/views/home/components/carousel.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="height_100">
-    <el-carousel :interval="4000" height="450px">
+    <el-carousel :interval="4000" :height="height+'px'">
       <el-carousel-item v-for="item in srcList" :key="item.src" >
         <el-image :src="require('@/assets/' + item.src)" class="medium"></el-image>
       </el-carousel-item>
@@ -19,13 +19,22 @@ export default {
         { src: 'lun2.jpg' },
         { src: 'lun3.jpg' },
       ],
+      height:0
     };
   },
   watch: {},
   computed: {},
   created() {},
-  mounted() {},
-  methods: {},
+  mounted() {
+    this.getHeight()
+    window.addEventListener('resize',this.getHeight)
+  },
+  methods: {
+    getHeight(){
+      var offsetWidth = document.body.clientWidth
+      this.height = (5 / 16) * offsetWidth
+    }
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 95 - 0
src/views/home/components/echarts/components/event.vue

@@ -0,0 +1,95 @@
+<template>
+  <div class="event_echarts height_100" ref="eventEcharts"></div>
+</template>
+  
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {};
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.initChart();
+  },
+  methods: {
+    initChart() {
+      const chartDom = this.$refs.eventEcharts;
+      this.$echarts.init(chartDom).setOption(
+        {
+          tooltip: {
+            trigger: "item",
+          },
+          legend: {
+            // type:'scroll',
+            top: "10%",
+            align: "left",
+            // right: "5%",
+            left:'45%',
+            orient: "vertical",
+            itemGap: 20,
+          },
+          title: {
+            text: "处理事件",
+            bottom: "center",
+            left: "20%",
+            textStyle: {
+              fontSize: 16,
+              fontWeight: 999,
+              fontFamily: "思源黑体CN",
+            },
+          },
+          series: [
+            {
+              name: "",
+              label: {
+                show: false,
+                formatter: function (data) {
+                  return `${data.name} ${data.value}(${data.percent.toFixed(
+                    1
+                  )}%)`;
+                },
+              },
+              labelLine: {
+                show: true,
+              },
+              type: "pie",
+              avoidLabelOverlap: false,
+              radius: ["50%", "80%"],
+              center: ["0", "50%"],
+              left:'25%',
+              data: [
+                { value: 1048, name: "专利培育布局" },
+                { value: 735, name: "产品上市/出口风险控制" },
+                { value: 580, name: "侵权纠纷" },
+                { value: 484, name: "专利盘点与运维" },
+                { value: 300, name: "专利维权" },
+                { value: 300, name: "科技与重大立项专利导航" },
+                { value: 300, name: "IPO上市" },
+                { value: 300, name: "竞争对手威胁应对" },
+              ],
+            },
+          ],
+          emphasis: {
+            itemStyle: {
+              shadowBlur: 10,
+              shadowOffsetX: 0,
+              shadowColor: "rgba(0, 0, 0, 0.5)",
+            },
+            label: {
+              show: true,
+              fontSize: 40,
+              fontWeight: "bold",
+            },
+          },
+        }
+      );
+    },
+  },
+};
+</script>
+  <style lang="scss" scoped>
+</style>

+ 110 - 0
src/views/home/components/echarts/components/report.vue

@@ -0,0 +1,110 @@
+<template>
+  <div class="report_echarts height_100" ref="reportEcharts"></div>
+</template>
+
+<script>
+import * as echarts from 'echarts'
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {};
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.initChart();
+  },
+  methods: {
+    initChart() {
+      const chartDom = this.$refs.reportEcharts;
+      this.$echarts.init(chartDom).setOption({
+        tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+                type: 'shadow'
+            }
+        },
+        title: {
+          text: "我的报告",
+          left:'center',
+          bottom:'30'
+        },
+        xAxis: {
+          data: ['无效分析', '稳定行分析', '第三方意见', '侵权分析','FTO调查','回避设计','无效应对'],
+          axisLabel: {
+            show: false,
+            // inside: true,
+            // color: "#fff",
+          },
+          axisTick: {
+            show: false,
+          },
+          axisLine: {
+            show: false,
+          },
+          z: 10,
+        },
+        yAxis: {
+          axisLine: {
+            show: false,
+          },
+          axisTick: {
+            show: false,
+          },
+          axisLabel: {
+            color: "#999",
+          },
+        },
+        dataZoom: [
+          {
+            type: "inside",
+          },
+        ],
+        series: [
+          {
+            type: "bar",
+            showBackground: true,
+            itemStyle: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                { offset: 0, color: "#4fa6ff" },
+                { offset: 1, color: "#316192" },
+              ]),
+            },
+            emphasis: {
+              itemStyle: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                  { offset: 0, color: "#2378f7" },
+                  { offset: 0.7, color: "#2378f7" },
+                  { offset: 1, color: "#83bff6" },
+                ]),
+              },
+            },
+            label:{
+                show: true,
+                rotate: 0,
+                // align: 'center',
+                // verticalAlign: 'middle',
+                position: 'insideBottom',
+                overflow:'breakAll',
+                formatter: '{b}',
+                distance: 15,
+                width:'10',
+                color:'#ffffff',
+                textBorderColor:'#000000',
+                textBorderWidth:0.85,
+                fontFamily:'思源黑体CN',
+                fontWeight:'bold',
+                fontsize:18
+            },
+            data: [220, 182, 191, 234,220,250,666],
+          },
+        ],
+      });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 88 - 0
src/views/home/components/echarts/components/task.vue

@@ -0,0 +1,88 @@
+<template>
+    <div class="task_echarts height_100" ref="taskEcharts"></div>
+</template>
+  
+<script>
+  export default {
+    components: {},
+    props: {},
+    data() {
+      return {};
+    },
+    watch: {},
+    computed: {},
+    created() {},
+    mounted() {
+      this.initChart();
+    },
+    methods: {
+      initChart() {
+        const chartDom = this.$refs.taskEcharts;
+        this.$echarts.init(chartDom).setOption(
+            {
+            tooltip: {
+                trigger: 'item'
+            },
+            title: {
+                text: '我的任务',
+                bottom: 'center',
+                left: "20%",
+                textStyle: {
+                  fontSize: 16,
+                  fontWeight: 999,
+                  fontFamily: "思源黑体CN",
+                },
+            },
+            legend: {
+                top:'center',
+                align: 'left',
+                right:'center',
+                left:'45%',
+                orient:'vertical',
+                itemGap :20
+            },
+            series: [
+            {
+              name: "",
+              label: {
+                show: false,
+                formatter: function (data) {
+                  return `${data.name} ${data.value}(${data.percent.toFixed(
+                    1
+                  )}%)`;
+                },
+              },
+              labelLine: {
+                show: true,
+              },
+              type: "pie",
+              avoidLabelOverlap: false,
+              radius: ["50%", "80%"],
+              center: ["0", "50%"],
+              left:'25%',
+              data: [
+                { value: 1048, name: "未完成" },
+                { value: 735, name: "已完成" },
+              ],
+            },
+          ],
+          emphasis: {
+            itemStyle: {
+              shadowBlur: 10,
+              shadowOffsetX: 0,
+              shadowColor: "rgba(0, 0, 0, 0.5)",
+            },
+            label: {
+              show: true,
+              fontSize: 40,
+              fontWeight: "bold",
+            },
+          },
+            }
+        );
+      },
+    },
+  };
+  </script>
+  <style lang="scss" scoped>
+  </style>

+ 76 - 0
src/views/home/components/echarts/index.vue

@@ -0,0 +1,76 @@
+<template> 
+  <div class="home_echarts" v-if="show">
+    <div class="left">
+      <report-echart></report-echart>
+    </div>
+    <div class="right">
+        <div class="top">
+          <task-echart></task-echart>
+        </div>
+        <div class="bottom">
+          <event-echart></event-echart>
+        </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import reportEchart from './components/report.vue'
+import eventEchart from './components/event.vue'
+import taskEchart from './components/task.vue'
+export default {
+  components: {
+    reportEchart,
+    eventEchart,
+    taskEchart
+  },
+  props: {},
+  data() {
+    return {
+      show:true
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    window.addEventListener('resize',()=>{
+      this.show = false
+      this.$nextTick(()=>{
+        this.show = true
+      })
+    })
+  },
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+.home_echarts{
+    width: 100%;
+    height: 350px;
+    display: flex;
+    flex: 1;
+    align-items: center;
+    border: 2px solid var(--bg);
+    .left{
+        width: 100%;
+        height: 100%;
+        min-width:324px;
+        border-right: 2px solid var(--bg);
+    }
+    .right{
+        width: 100%;
+        height: 100%;
+        min-width:700px;
+        .top{
+            height: 50%;
+            width:calc(100% - 3px);
+            border-bottom: 2px solid var(--bg);
+        }
+        .bottom{
+            width:calc(100% - 3px);
+            height: 50%;
+        }
+    }
+}
+</style>

+ 10 - 6
src/views/home/index.vue

@@ -17,8 +17,8 @@
           </el-input>
         </div>
       </div>
-      <div>
-        <myTabs></myTabs>
+      <div class="echart">
+        <myEcharts></myEcharts>
       </div>
     </div>
     <div class="footer">
@@ -64,11 +64,11 @@
 
 <script>
 import carousel from './components/carousel.vue'
-import myTabs from './components/tabs.vue';
+import myEcharts from './components/echarts';
 export default {
   components: {
     carousel,
-    myTabs
+    myEcharts
   },
   data() {
     return {
@@ -165,14 +165,18 @@ export default {
   --minHeight:150px;
   --marginTop:50px;
   .main {
-    width: 85%;
+    // width: 85%;
     margin: 0 auto;
     position: relative;
     min-height: calc(100% - var(--minHeight) - var(--marginTop));
     .carousel{
       // padding-top: 10px;
     }
-
+    .echart{
+      width:80%;
+      min-width: 1024px;
+      margin: 0 auto;
+    }
     .title {
       text-align: center;
       color: var(--bg);

+ 48 - 40
src/views/product/components/dialog/addEditProduct.vue

@@ -15,7 +15,7 @@
             :loading="loading"
             style="width:100%">
             <el-option
-              v-for="item in productCategoryList"
+              v-for="item in productCategoryList.data"
               :key="item.id"
               :label="item.name"
               :value="item.id">
@@ -124,14 +124,13 @@ export default {
         licenseRate:[{ required: false, validator:licenseRateRule, trigger: 'blur' },],
       },
       //产品类别集合
-      productCategoryList:[],
-      //产品类别分页信息
-      queryParams:{
-        size:10,
-        current:1
+      productCategoryList:{
+        data:[],
+        queryParams:{//产品类别分页信息
+          size:10,
+          current:1
+        },
       },
-      //是否懒加载
-      isLazy:true,
       loading:false,
       //待上传的文件
       file:[],
@@ -163,7 +162,7 @@ export default {
       this.form.systemFileList = []//直接清空适用于单张图片
      },
     // 打开弹窗
-    open(row) {
+    async open(row) {
       this.form = JSON.parse(JSON.stringify(row))
       if(!this.form.showType && this.form.showType!=0){
         this.form.showType=0
@@ -180,8 +179,16 @@ export default {
           this.title = '新增外公司产品'
         }
       }
-      this.productCategoryList=[]
-      this.getProductCategory();
+      this.productCategoryList.data=[]
+      this.productCategoryList.queryParams.current = 1
+      if(this.form.categoryId){
+        var params ={
+          ...this.productCategoryList.queryParams,
+          searchQuery:`category_id=${this.form.categoryId}`
+        }
+       await this.getProductCategory(params,1)
+      }
+      this.getProductCategory(this.productCategoryList.queryParams);
       this.dialogVisible = true;
     },
     // 弹窗确定
@@ -232,55 +239,56 @@ export default {
     },
     // 下拉框懒加载
     lazyLoading() {
-      if(!this.isLazy){
+      if(this.productCategoryList.queryParams.current * this.productCategoryList.queryParams.size >= this.productCategoryList.queryParams.total){
         return false
       }
-      this.queryParams.current++;
-      this.getProductCategory();
+      this.productCategoryList.queryParams.current++;
+      var params ={
+          ...this.productCategoryList.queryParams,
+          searchQuery:`category_name=${this.productCategoryList.name}`
+        }
+      this.getProductCategory(params);
     },
     //远程搜索产品类别
     remoteMethod(query) {
-      this.isLazy = true
         if (query !== '') {
           this.loading = true;
-          this.queryParams = {
-            current:1,
-            size:10,
-            searchQuery:`name=${query}`
+          this.productCategoryList.name=query
+          var params = {
+            ...this.productCategoryList.queryParams,
+            searchQuery:`category_name=${query}`
           }
-          this.$api.queryProductCategory(this.queryParams).then(response=>{
+          this.$api.queryProductCategory(params).then(response=>{
             if(response.code == 200){
               this.loading = false;
-              this.productCategoryList = response.data.data
+              this.productCategoryList.data = response.data.data
             }
           }).catch(error=>{
             this.loading = false;
           })
         } else {
-          this.queryParams.name = null
-          this.productCategoryList = [];
-          this.getProductCategory()
+          this.productCategoryList.name = null
+          this.productCategoryList.data = [];
+          this.getProductCategory(this.productCategoryList.queryParams)
         }
     },
     //获取产品类别列表
-    getProductCategory(){
-      if(!this.isLazy){
-        return false
-      }
-      this.$api.queryProductCategory(this.queryParams).then(response=>{
+    async getProductCategory(params,type){
+     await this.$api.queryProductCategory(params).then(response=>{
         if(response.code == 200){
-          if(response.data.data && response.data.data.length == 0){
-            this.isLazy = false
+          if(!type){
+            if(this.form.categoryId){
+              var index = response.data.data.findIndex(item=>{
+                return item.id == this.form.categoryId
+              })
+              if(index!=-1){
+                response.data.data.splice(index,1)
+              }
+            }
+            this.productCategoryList.queryParams.total = response.data.total
           }
-          // if(this.form.categoryId){
-          //   var index = response.data.data.findIndex(item=>{
-          //     return item.id == this.form.categoryId
-          //   })
-          //   if(index!=-1){
-          //     response.data.data.splice(index,1)
-          //   }
-          // }
-          this.productCategoryList = [...this.productCategoryList, ...response.data.data];
+          
+          this.productCategoryList.data.push(...response.data.data);
         }
       }).catch(error=>{
       })

+ 21 - 6
src/views/project/components/drawer/form.vue

@@ -343,12 +343,19 @@ export default {
     },
 
     //打开弹窗
-    open(form, title) {
+    async open(form, title) {
+      this.ruleForm = JSON.parse(JSON.stringify(form))
       //获取部门列表
       this.getDepartment()
+      if(this.ruleForm.headId){
+        this.personnelList.queryParams.id = this.ruleForm.headId
+        await this.getPersonnelList(1)
+        this.personnelList.queryParams.id = null
+      }
       //获取人员列表
       this.getPersonnelList()
-      this.ruleForm = JSON.parse(JSON.stringify(form))
+     
+      
       this.title = title
       this.drawer = true
     },
@@ -375,13 +382,21 @@ export default {
       this.personnelList.queryParams.current += 1
       this.getPersonnelList()
     },
-    getPersonnelList() {
+    async getPersonnelList(type) {
       this.personnelList.loading = true;
-      this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
+      await this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
         if(response.code == 200){
           this.personnelList.loading = false;
+          if(!type){
+            var index = response.data.findIndex(item=>{
+                return item.id == this.form.headId
+              })
+              if(index!=-1){
+                response.data.splice(index,1)
+              }
+              this.personnelList.queryParams.total=response.pageColumn.total
+          }
           this.personnelList.data.push(...response.data)
-          this.personnelList.queryParams.total=response.pageColumn.total
         }
       })
     },
@@ -470,7 +485,7 @@ export default {
             this.ruleForm.trees.push(this.ruleForm.products)
           }
           if (this.ruleForm.id) {
-            this.$api.editProject(this.ruleForm).then(response => {
+            this.$api.updatePatentProject(this.ruleForm).then(response => {
               this.loading = false
               this.$message.success('编辑成功')
               this.$emit('submit', 0)

+ 18 - 1
src/views/project/components/mixins/index.js

@@ -4,7 +4,7 @@ export const workspaceOptions = {
     tableData: {//数据
       type: Array,
       default: () => {
-        return [{ name: '123', eventNumber: 2, projectNumber: 3, projectNumber1: [{ name: '场景一' }, { name: '场景二' }] },]
+        return []
       }
     },
     queryParams: {//分页信息
@@ -31,6 +31,23 @@ export const workspaceOptions = {
     },
     //操作列
     handleCommand(event, row) {
+      var isLast = false
+      if(option == 10){
+        this.action={
+          type:'1',
+          id:row.id
+        } 
+        if(this.tableData.length == 1){
+          isLast = true
+        }
+      }
+      if(option == 'e'){
+        this.action={
+          type:'2',
+          id:row.id
+        } 
+      }
+
       this.$emit('option', { option: event, row })
     },
   },

+ 16 - 21
src/views/project/components/view/MergeTable.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="workspace-merge-table">
-    <el-table :data="tableData" header-row-class-name="custom-table-header" @expand-change="expandChange" @sort-change="sortChange">
+  <div class="workspace-merge-table height_100" v-DivHeight="getDivHeight">
+    <el-table :data="tableData" style="width: 100%" border header-row-class-name="custom-table-header" row-key="id" v-if="showTable" :maxHeight="tableHeight" :expand-row-keys="expends" @expand-change="expandChange" @sort-change="sortChange">
       <el-table-column type="expand">
         <template slot-scope="props">
-          <Table :data="showData[props.row.index]" :params="params" :field="field" @option="handleOption" />
+          <Table :row="scope.row" v-on="$attrs"/>
         </template>
       </el-table-column>
       <el-table-column v-for="column in columnList" :label="column.label" :prop="column.prop" sortable="custom"
@@ -15,31 +15,28 @@
 
 <script>
 import { workspaceOptions } from "../mixins";
-import { formatDate, formatTableDate } from "@/utils";
+import { getTableHeight } from '@/views/components/mixins'
 import Table from "./table";
 
 export default {
   props: {
-    commonData: Object,
-    params: Object,
-    field: []
+    queryParams: Object,
   },
-  mixins: [workspaceOptions],
+  mixins: [workspaceOptions,getTableHeight],
   components: {
     Table
   },
   data() {
     return {
       columnList: [],
-      tableData: [],
-      showData: []
+      //展开行数组
+      expends:[]
     }
   },
   watch: {
 
   },
   mounted() {
-    this.initData()
   },
   methods: {
     // 排序
@@ -47,20 +44,18 @@ export default {
       let str = '1'
       this.$emit('on-sort', { column, prop, order, str })
     },
-    //操作列
-    handleOption(data) {
-      this.$emit('option', data)
-    },
     //展开行
     expandChange(row, expandedRows) {
-
-    },
-    initData() {
-
-
+      var index = this.expends.findIndex(item=>{
+        return item == row.id
+      })
+      if(index==-1){
+        this.expends.push(row.id)
+      }else{
+        this.expends.splice(index,1)
+      }
     },
 
-
   }
 }
 </script>

+ 15 - 16
src/views/project/components/view/card.vue

@@ -18,26 +18,25 @@
                     <el-dropdown @command="handleCommand($event, item)" placement="right-start">
                       <span class="el-dropdown-link"> 专利导入 </span>
                       <el-dropdown-menu  class="children_item">
-                          <el-dropdown-item command="7"> Excel导入 </el-dropdown-item>
-                          <el-dropdown-item command="8">专利号导入 </el-dropdown-item>
-                          <el-dropdown-item command="11" v-if="$permission('/workspace/common/retrieval')"> 检索条件导入 </el-dropdown-item>
+                          <el-dropdown-item command="0"> Excel导入 </el-dropdown-item>
+                          <el-dropdown-item command="1">专利号导入 </el-dropdown-item>
+                          <el-dropdown-item command="2" v-if="$permission('/workspace/common/retrieval')"> 检索条件导入 </el-dropdown-item>
                       </el-dropdown-menu>
                     </el-dropdown>
                   </el-dropdown-item>
-                  <el-dropdown-item command="12">任务清单</el-dropdown-item>
-                <el-dropdown-item command="1">分配参与者</el-dropdown-item>
-                <el-dropdown-item command="2" :disabled="!$permission('/workspace/project/report_manage')">报告管理</el-dropdown-item>
+                  <el-dropdown-item command="3">任务清单</el-dropdown-item>
+                <el-dropdown-item command="5" :disabled="!$permission('/workspace/project/report_manage')">报告管理</el-dropdown-item>
                 <el-dropdown-item command="6" v-if="item.isCategory == 1&& $permission('/workspace/product')">产品架构</el-dropdown-item>
-                <el-dropdown-item command="10" v-if="$permission('/workspace/event')">事 件</el-dropdown-item>
-                <el-dropdown-item command="5" :disabled="!$permission('/workspace/project/other_accessories')">其它附件</el-dropdown-item>
-                <el-dropdown-item command="3" :disabled="!($permission('/workspace/project/project_share')&&$r(item.id,[2]))">项目分享</el-dropdown-item>
-                <el-dropdown-item command="4" divided class="color-red" :disabled="!($permission('/workspace/project/modify') && ($r(item.id,[2])||userinfo.id == item.createBy))">删除</el-dropdown-item>
+                <el-dropdown-item command="7" v-if="$permission('/workspace/event')">事 件</el-dropdown-item>
+                <el-dropdown-item command="8" :disabled="!$permission('/workspace/project/other_accessories')">其它附件</el-dropdown-item>
+                <el-dropdown-item command="9" :disabled="!($permission('/workspace/project/project_share')&&$r(item.id,[2]))">项目分享</el-dropdown-item>
+                <el-dropdown-item command="10" divided class="color-red" :disabled="!($permission('/workspace/project/modify') && ($r(item.id,[2])||userinfo.id == item.createBy))">删除</el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
             </div>
-            <el-form class="i">
+            <el-form>
               <el-form-item label="名称">
-                <div class="a">
+                <div>
                   <el-link :disabled="!$permission('/workspace/folder')" :class="$permission('/workspace/folder')?'':'jinzhi'" type="primary" @click.native="handleClick(item)" :title="item.name">
                     <span v-if="item.innerFile">{{ item.innerFile }} - </span>
                     <span>{{ item.name }}</span>
@@ -45,20 +44,20 @@
                 </div>
               </el-form-item>
               <el-form-item label="委托方">
-                <div class="a" :title="item.clientName">{{ item.clientName }}</div>
+                <div :title="item.clientName">{{ item.clientName }}</div>
               </el-form-item>
               <el-form-item label="应用场景">
-                <div class="a" :title="item.scenarioName">
+                <div :title="item.scenarioName">
                   <span v-for="name in item.scenarioName">{{ name }} <br> </span>
                 </div>
               </el-form-item>
               <el-form-item label="调查类型">
-                <div class="a" :title="item.typeName">
+                <div :title="item.typeName">
                   <span v-for="name in item.typeName">{{ name }} <br> </span>
                 </div>
               </el-form-item>
               <el-form-item label="技术主题" style="border-bottom: 0">
-                <div class="a" :title="item.technicalTheme">{{ item.technicalTheme }}</div>
+                <div  :title="item.technicalTheme">{{ item.technicalTheme }}</div>
               </el-form-item>
             </el-form>
             <div slot="foot">

+ 159 - 13
src/views/project/components/view/table.vue

@@ -1,8 +1,8 @@
 <template>
-  <div class="height_100">
-    <div>
+  <div class="height_100"  v-DivHeight="getDivHeight">
       <el-table :data="tableData" border style="width: 100%" header-row-class-name="custom-table-header"
-        @sort-change="sortChange">
+        @sort-change="sortChange"  v-if="showTable" :maxHeight="tableHeight" v-el-table-infinite-scroll="getList" :infinite-scroll-distance="10" 
+        :infinite-scroll-disabled="disabled">
         <el-table-column label="#" width="60" type="index" align="center">
           <template slot-scope="scope">
             <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
@@ -35,7 +35,6 @@
                   </el-dropdown>
                 </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">事件</el-dropdown-item>
@@ -47,14 +46,16 @@
           </template>
         </el-table-column>
       </el-table>
-    </div>
+      <el-alert v-if="isFlag" title="正在努力加载中..." type="success" center :closable="false" show-icon></el-alert>
+    <el-alert v-if="isMore" title="没有更多啦!" type="warning" center show-icon></el-alert>
   </div>
 </template>
 
 <script>
+import { getTableHeight } from '@/views/components/mixins'
 import { workspaceOptions } from "../mixins";
 export default {
-  mixins: [workspaceOptions],
+  mixins: [workspaceOptions,getTableHeight],
   props: {
     isOperate: {//控制显示
       type: [String, Number],
@@ -123,26 +124,171 @@ export default {
           },
         ]
       }
-    }
+    },
+    row: null,
+    //操作信息
+    handleMessage:''
   },
   data() {
     return {
-
+      //正在努力加载中
+      isFlag: false,
+      //没有更多啦!
+      isMore: false,
+      //禁用懒加载
+      disabled: true,
+      params: {
+        size: 5,
+        current: 0
+      },
+      // 排序数组
+      sort: [
+        {
+          "orderBy": "createTime",
+          "orderType": 1
+        }
+      ],
+      //事件类型及所选
+      action:{
+        type:'',//1表示删除,2表示其他,3表示新增
+        id:''
+      }
     };
   },
   watch: {
-
+    handleMessage(val){
+      if(val){
+        this.updateData()
+      }
+    }
   },
   mounted() {
-
+    if (!this.row) {
+      this.disabled = true
+    } else {
+      this.disabled = false
+    }
   },
   methods: {
+
+    //更新数据
+    updateData(){
+      if(this.action.type == 1){
+        if(this.tableData.length == 1){
+          return false
+        }
+        var startIndex = this.tableData.findIndex(item=>{
+              return item.id == this.action.id
+          })
+          this.tableData.splice(startIndex,1)
+        let params = {
+          ...this.params,
+          ...this.row.searchOption,//检索条件
+          orderDTOList: this.sort,//排序
+          groupField: this.row.groupBy,
+          groupFieldValue: this.row.row.value,
+        }
+        this.getList2(params,1)
+      }else if(this.action.type == 2){
+        let params = {
+          ...this.params,
+          searchQuery:`id=${this.action.id}`,//检索条件
+          groupField: this.row.groupBy,
+          groupFieldValue: this.row.row.value,
+        }
+        this.getList2(params,2)
+      }
+    },
+
+    getList2(params,type){
+      
+      this.$api.queryPatentProject(params).then(res => {
+        if (res.code == 200) {
+          if(type == 1){
+            var startIndex = (params.current-1)*size
+            var endIndex = this.tableData.length
+            var len = endIndex - startIndex
+            this.tableData.splice(startIndex,len,...res.data.data)
+            this.params.total = res.data.total
+          }else if(type == 2){
+            var startIndex = this.tableData.findIndex(item=>{
+              return item.id == this.action.id
+            })
+            this.tableData.splice(startIndex,1,...res.data.data)
+          }
+          
+        }
+      }).catch(err => {
+      })
+    },
+
+
+    getList() {
+      if (!this.row) return;
+      if (this.params.current * this.params.size >= this.params.total) {
+        this.isMore = true
+        this.disabled = true
+        setTimeout(() => {
+          this.isMore = false;
+          this.isFlag = false
+        }, 1000)
+      }
+      if (this.disabled) return;
+      this.params.current += 1
+      let params = {
+        ...this.params,
+        ...this.row.searchOption,//检索条件
+        orderDTOList: this.sort,//排序
+        groupField: this.row.groupBy,
+        groupFieldValue: this.row.row.value,
+      }
+      this.isMore = false;
+      this.isFlag = true;
+      this.$api.queryPatentProject(params).then(res => {
+        if (res.code == 200) {
+          this.tableData.push(...res.data.data)
+          this.params.total = res.data.total
+        }
+      }).catch(err => {
+      })
+      setTimeout(() => {
+        this.isMore = false;
+        this.isFlag = false
+      }, 1000)
+    },
+
     // 排序
     sortChange({ column, prop, order }) {
-      // this.handleSort({ column, prop, order })
-      // if (!this.row) {
+      this.handleSort({ column, prop, order })
+      if (!this.row) {
         this.$emit('on-sort', { column, prop, order })
-      // }
+      }
+    },
+    // 排序方法
+    handleSort({ column, prop, order }) {
+      this.sort=[]//如需要多个字段排序,则不需要清空
+      if (order == 'null') {
+        return;
+      }
+      var orderType = {
+        ascending: 0,
+        descending: 1
+      }
+      var params = this.sort.find(item => {
+        return item.orderBy == prop
+      })
+      if (params) {
+        params.orderType = orderType[order]
+      } else {
+        params = {}
+        params.orderBy = prop
+        params.orderType = orderType[order]
+        this.sort.push(params)
+      }
+      this.params.current = 0
+      this.disabled = false
+      this.tableData.splice(0)
+      this.getList()
     },
     // 点击名称等事件
     handleItem(row, key) {

+ 52 - 41
src/views/project/index.vue

@@ -50,8 +50,7 @@
           </el-header>
           <el-main class="workspace-main">
             <div v-loading="loading">
-              <component :is="viewType" v-bind="$attrs" v-on="$listeners" :isOperate="isOperate" :tableData="dataList"
-                :common-data="commonData" :group="group" :params="queryParams" :column="fieldList" @option="handleOption"
+              <component :is="viewType" v-bind="$attrs" v-on="$listeners" :isOperate="isOperate" :tableData="dataList" :group="group" :queryParams="queryParams" :column="fieldList" @option="handleOption"
                 @on-sort="handleSort"></component>
             </div>
             <div class="pagination" v-if="[2].indexOf(isOperate) == -1">
@@ -165,7 +164,17 @@ export default {
   computed: {
     ...mapGetters(['userinfo']),
     commonData(){
-      return this.$store.state.dictMessage.scenario
+      var a = this.$store.state.dictMessage.scenario.map(item=>{
+        return {
+          label:item.name,
+          value:item.id
+        }
+      })
+      var obj = this.searchFiled.find(item=>{return item.label == '应用场景'})
+      if(obj){
+        obj.options = a
+      }
+      return this.$store.state.dictMessage.scenario || []
     }
   },
   created() { },
@@ -203,12 +212,15 @@ export default {
             value: 'value',
             type:'type',
           })
-          // 为3是下拉框选择
-          // this.searchFiled.forEach(item => {
-          //   if (item.type == '3') {
-          //     item.options=this.scene
-          //   }
-          // })
+          var obj = this.searchFiled.find(item=>{return item.label == '应用场景'})
+          if(obj){
+            obj.options = this.commonData.map(item=>{
+              return {
+                label:item.name,
+                value:item.id
+              }
+            })
+          }
         }
       })
       this.showView = false
@@ -235,8 +247,7 @@ export default {
           params[item.value] = item.searchValue.label
         }
       })
-      // 返回字符串
-      this.searchOption.searchQuery = this.$commonJS.objectToString(params)
+      this.searchOption = params
       // 调用查询接口
       this.queryParams.current = 1
       this.isGrouping()
@@ -247,7 +258,7 @@ export default {
       var params = this.queryParams
       params = {
         ...this.queryParams,//分页信息
-        ...this.searchOption,//检索条件
+        searchQuery:this.$commonJS.objectToString(this.searchOption),//检索条件
         orderDTOList:this.sort,//排序
       }
       this.loading = true
@@ -275,7 +286,7 @@ export default {
         this.total = response.data.total
         this.loading = false
       }).catch(error => {
-        this.dataList = [{}, {}]
+        this.dataList = []
         this.total = 0
         this.loading = false
       })
@@ -388,52 +399,52 @@ export default {
     },
     //操作列
     handleOption({ option, row }) {
-      this.$store.commit('SET_PROJECT_ID', row.id)
       switch (option) {
-        case '0':
-          this.handleImportPatent(row)
+        case '0'://Excel导入
+          this.handleExcelImport(row)
           break
-        case '1'://分配参与者
-          this.handleUser(row)
+        case '1'://专利号导入
           break
-        case '2'://报告管理
+        case '2'://检索条件导入
           this.handleFile(row, 1)
           break
-        case '5'://其它附件
+        case '3'://任务清单
           this.handleFile(row, 0)
           break
-        case '3'://项目分享
-          this.handleShare(row)
-          break
-        case '4'://删除
-          this.handleDelete(row)
+        case '5'://报告管理
           break
-        case '6'://产品分类
-          this.frameworkIndex(row)
+        case '6'://产品架构
           break
-        case '7'://Excel导入
-          this.handleImportPatent(row)
-          break;
-        case '8'://手动导入
-          this.download(row, 8)
-          break;
-        case '9'://网站导入
-          this.download(row, 9)
+        case '7'://事件
           break
-        case '11'://条件导入即接口导入
-          this.importPatent(row)
+        case '8'://其他附件
           break;
-        case '12'://跳转到任务清单
-          this.toTaskList(row)
+        case '9'://项目分享
           break;
-        case '10'://问题(事件)
-          this.questionEvent(row)
+        case '10'://删除
+          this.deletes(row)
           break
         case 'e'://编辑
           this.handleEdit(row)
           break
       }
     },
+    //获取删除的id
+    deletes(row){
+      this.deletePatentProject([row.id])
+    },
+    //删除专题库
+    deletePatentProject(ids){
+      this.$api.deletePatentProject(ids).then(response=>{
+        if(response.code == 200){
+          this.handleMessage = '删除成功'
+          if(!this.group){
+            this.getList()
+          }
+          this.clearMessage()
+        }
+      })
+    },
     //编辑专题库
     handleEdit(row) {
       this.$refs.projectFormDrawer.open(JSON.parse(JSON.stringify(row)), '编辑专题库')