Kaynağa Gözat

新增专题库

zhuliu 1 yıl önce
ebeveyn
işleme
64ec24279a

+ 1 - 1
src/api/newApi/file.js

@@ -1,5 +1,5 @@
 import axios from "@/utils/axios";
-// 新系统件新接口
+// 新系统件新接口
 export default {
   uploadFile(data){
     return axios.post('/fileManager/uploadNormalFile', data)

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

@@ -0,0 +1,7 @@
+import axios from "@/utils/axios";
+// 新系统专题库新接口
+export default {
+  addPatentProject(data) {
+    return axios.post("/xiaoshi/patentProject/addPatentProject", data);
+  },
+};

+ 35 - 17
src/utils/direct/index.js

@@ -14,25 +14,43 @@ const draggable = (el, binding) => {
 
 
 //下拉框懒加载
-const SelectLazyLoading=(el,binding)=>{
-   
-    let SELECT_DOM = el.querySelector(".el-select-dropdown .el-select-dropdown__wrap") || el.querySelector('.el-autocomplete-suggestion__wrap') ;
-
-    if(!SELECT_DOM){
-        return false
+// const SelectLazyLoading=(el,binding)=>{
+//    console.log(el)
+//     let SELECT_DOM = el.querySelector(".el-select-dropdown .el-select-dropdown__wrap") || el.querySelector('.el-autocomplete-suggestion__wrap') ;
+//     console.log(SELECT_DOM)
+//     if(!SELECT_DOM){
+//         return false
+//     }
+//     SELECT_DOM.addEventListener("scroll", function () {
+//         // scrollHeight:当前所有选项的高度
+//       // scrollTop:滚动的距离
+//       // clientHeight:下拉框的高度
+//       console.log(SELECT_DOM,this.scrollHeight , this.scrollTop , this.clientHeight,this.scrollHeight - this.scrollTop - 1 <= this.clientHeight)
+//       let condition = this.scrollHeight - this.scrollTop - 1 <= this.clientHeight;
+//       if (condition) {
+//         binding.value();
+//       }
+//     });
+// }
+const SelectLazyLoading={
+    inserted(el,binding){
+        let SELECT_DOM = el.querySelector(".el-select-dropdown .el-select-dropdown__wrap") || el.querySelector('.el-autocomplete-suggestion__wrap') ;
+            console.log(SELECT_DOM)
+            if(!SELECT_DOM){
+                return false
+            }
+            SELECT_DOM.addEventListener("scroll", function () {
+                // scrollHeight:当前所有选项的高度
+              // scrollTop:滚动的距离
+              // clientHeight:下拉框的高度
+            //   console.log(SELECT_DOM,this.scrollHeight , this.scrollTop , this.clientHeight,this.scrollHeight - this.scrollTop - 1 <= this.clientHeight)
+              let condition = this.scrollHeight - this.scrollTop - 1 <= this.clientHeight;
+              if (condition) {
+                binding.value();
+              }
+            });
     }
-    SELECT_DOM.addEventListener("scroll", function () {
-        // scrollHeight:当前所有选项的高度
-      // scrollTop:滚动的距离
-      // clientHeight:下拉框的高度
-      console.log(this.scrollHeight , this.scrollTop, this.clientHeight)
-      let condition = this.scrollHeight - this.scrollTop - 1 <= this.clientHeight;
-      if (condition) {
-        binding.value();
-      }
-    });
 }
-
 //块禁止样式
 const disabled = (el,binding)=>{
     if(binding.value){

+ 1 - 1
src/utils/model/index.js

@@ -8,7 +8,7 @@ import myMenu from './menu/index.vue';
 import myView from './myView/index.vue';
 import mySelectButton from './selectButton/index.vue';
 import myFormSearch from './search/searchIndex.vue';
-import myTimeChoose from './time/timeIndex.vue';
+import myTimeChoose from './time/timeChoose.vue';
 
 import myContextMenu from './contextMenu/index.vue';
 import mySelectTree from './selectTree/index'

+ 10 - 10
src/utils/model/time/mixins.js

@@ -14,7 +14,7 @@ export const cron = {
               m = date.getMinutes()< 10 ? ("0" + date.getMinutes()) : date.getMinutes();
               s = date.getSeconds()< 10 ? ("0" + date.getSeconds()) : date.getSeconds();
           }
-          this.$set(this,'value',h+':'+m+':'+s)
+          this.$set(this,'value1',h+':'+m+':'+s)
             cron = s + " " + m + " " + h + " * * ? *";
         }else if (type == "week") { //星期
           let m = "";
@@ -63,7 +63,7 @@ export const cron = {
             s = date.getSeconds()< 10 ? ("0" + date.getSeconds()) : date.getSeconds();
           }
           this.$set(this, 'time', (h < 10 ? ("0" + h) : h )+ ':' + (m < 10 ? ("0" + m) : m) + ':' + (s < 10 ? ("0" + s) : s))
-          this.$set(this, 'value', this.day + " " + this.time)
+          this.$set(this, 'value1', this.day + " " + this.time)
           cron = s + " " + m + " " + h + " ? * " + value1 + " *";
           //周cron表达式
         } else if (type == "month") {//每月的几号
@@ -80,7 +80,7 @@ export const cron = {
           }
           this.$set(this,'day',mo+'日')
           this.$set(this, 'time', (h < 10 ? ("0" + h) : h )+ ':' + (m < 10 ? ("0" + m) : m) + ':' + (s < 10 ? ("0" + s) : s))
-          this.$set(this,'value',this.day+" "+this.time)
+          this.$set(this,'value1',this.day+" "+this.time)
           cron = s + " " + m + " " + h + " " + mo + " * ? *"
         } else if (type == "year") {//指定年月日
           let m = "";
@@ -100,7 +100,7 @@ export const cron = {
             month = (date.getMonth() + 1 )< 10 ? ("0" + (date.getMonth() + 1 )) : (date.getMonth() + 1 )
             day = date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate()
           }
-          this.$set(this,'value',date)
+          this.$set(this,'value1',date)
           cron =
             s +
             " " +
@@ -123,7 +123,7 @@ export const cron = {
                 let m = "";
                 let s = "";
                 let h = "";
-                let date = this.value;
+                let date = this.value1;
                 date= date.split(':')
                 if (date) {
                   h = date[0];
@@ -190,7 +190,7 @@ export const cron = {
                 let month = "";
                 let day = "";
                 //指定时间
-                var date = this.value;
+                var date = this.value1;
                 date = new Date(date);
                 if (date) {
                   h = date.getHours()< 10 ? ("0" + date.getHours()) : date.getHours();
@@ -296,7 +296,7 @@ export const cron = {
              var s = date[2];
             this.$set(this, 'time', (h < 10 ? ("0" + h) : h )+ ':' + (m < 10 ? ("0" + m) : m) + ':' + (s < 10 ? ("0" + s) : s))
             this.$set(this, 'day', toDate.loopValue)
-            this.$set(this,'value',this.day+" "+this.time)
+            this.$set(this,'value1',this.day+" "+this.time)
           } else if (toDate.loopType == "月循环") {
             date = date.split(' ')[1].split(":")
               var h = date[0];
@@ -307,10 +307,10 @@ export const cron = {
             // this.day = toDate.loopValue + '日';
             // this.$set(this,'time',date)
             this.$set(this, 'day', toDate.loopValue + '日')
-            this.$set(this,'value',this.day+" "+this.time)
+            this.$set(this,'value1',this.day+" "+this.time)
           } else {
-            // this.value = date;
-            this.$set(this,'value',date)
+            // this.value1 = date;
+            this.$set(this,'value1',date)
           }
         }
         return toDate;

+ 13 - 11
src/utils/model/time/timeChoose.vue

@@ -20,12 +20,12 @@
             <div style="display:flex;flex-wrap:wrap;width:100% " >
                 <p style="min-width:50px;width:calc(100% / 7);text-align:center;cursor:pointer" v-for="(item,index) in list[type]" :key="index" @click="check(item)">{{ item }}</p>
             </div>
-            <el-input slot="reference" v-model="value" placeholder="选择时间"  style="width:100%"></el-input>
+            <el-input slot="reference" v-model="value1" placeholder="选择时间"  style="width:100%"></el-input>
             </el-popover>
             <el-time-picker
                 v-if="showTime"
                 @change="changeTime"
-                v-model="value"
+                v-model="value1"
                 style="width:100%"
                 value-format="HH:mm:ss"
                 placeholder="选择时间">
@@ -35,7 +35,7 @@
                 format="MM-dd HH:mm:ss"
                 v-if="showDate"
                 @change="changeTime"
-                v-model="value"
+                v-model="value1"
                 type="datetime"
                 placeholder="选择日期时间">
             </el-date-picker>
@@ -48,15 +48,18 @@ import { cron } from "./mixins";
 export default {
   mixins:[cron],
     props:{
-        type:{
-            default:'day'
+      type:{
+          default:'day'
       },
-        cron:{}
+      cron:{},
+      value:{
+        default:''
+      }
         
     },
     data() {
         return {
-            value:'',
+            value1:'',
             day:'',
             time:'',
             list:{
@@ -78,12 +81,11 @@ export default {
     },
   methods: {
     init() {
-      this.value = ''
+      this.value1 = ''
       this.day = ''
       this.time = ''
       this.showTime =this.type=='day'? true:false
       this.showDate = this.type == 'year' ? true : false
-      
       switch (this.type) {
             case 'day':
                 break;
@@ -114,9 +116,9 @@ export default {
         },
         changeTime(){
             if(!this.showDate && !this.showTime){
-                this.$set(this,'value',this.day+" "+this.time)
+                this.$set(this,'value1',this.day+" "+this.time)
             }
-          // console.log(this.value)
+          // console.log(this.value1)
             let cron=this.getCron()
           this.$emit('value', cron)
         }

+ 0 - 1
src/utils/model/upload/index.vue

@@ -256,7 +256,6 @@ export default {
           file.raw.guid = response.data
           this.$emit("on-change", file)
         }
-        
       })
     },
     //打开提示弹窗

+ 11 - 3
src/views/client/index.vue

@@ -2,13 +2,22 @@
   <div class="height_100">
     <el-container>
       <el-header>
-        <div>
+        <!-- <div>
           <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
           </mySearch>
         </div>
         <div v-if="!choseClient">
           <el-button type="primary" size="small" @click="handleAdd()"> 新增 </el-button>
-        </div>
+        </div> -->
+        <el-form :inline="true">
+          <el-form-item label="用户名">
+            <el-input v-model="queryParams.name" size="small" placeholder="请输入用户名"></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="" size="small" @click="getList">查询</el-button>
+            <el-button type="primary" size="small" @click="handleAdd()" v-if="!choseClient">新增</el-button>
+          </el-form-item>
+        </el-form>
       </el-header>
       <el-main>
         <div class="height_100">
@@ -207,7 +216,6 @@ export default {
     },
     //获取客户信息
     getList() {
-      console.log(this.queryParams);
       this.loading = true
       this.$api.getAdminClientList(this.queryParams).then(response => {
         this.tableData = response.data.records

+ 99 - 36
src/views/project/components/drawer/form.vue

@@ -4,24 +4,24 @@
       direction="rtl" :before-close="close" destroy-on-close>
       <el-container>
         <el-main>
-          <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" label-position="left"
+          <el-form :model="ruleForm" :rules="rules" ref="ruleForm1" label-width="130px" label-position="left"
             class="demo-ruleForm">
             <el-form-item label="专题库名称" prop="name">
               <el-input v-model="ruleForm.name" placeholder="请输入专题库名称"></el-input>
             </el-form-item>
             <template>
               <div>
-                <el-form-item label="委托方" prop="name" v-if="userinfo.tenantType == 1">
+                <el-form-item label="委托方" prop="entrustName" v-if="userinfo.tenantType == 1">
 
                   <mySelectButton size='large' style="width:100%" @click="handleSelect">
                     <div slot="select" style="width:100%">
-                      <el-autocomplete style="width:100%" v-model="ruleForm.clientName" :fetch-suggestions="querySearch"
+                      <el-autocomplete style="width:100%" v-model="ruleForm.entrustName" ref="client" :fetch-suggestions="querySearch" v-SelectLazyLoading="loadClient"
                         @input="input" placeholder="请输入内容" :trigger-on-focus="false" @select="handleChange">
                       </el-autocomplete>
                     </div>
                   </mySelectButton>
                 </el-form-item>
-                <el-form-item label="委托部门" prop="name" v-else>
+                <el-form-item label="委托部门" prop="departmentId" v-else>
                   <mySelectTree style="width:100%" v-model="ruleForm.departmentId" :options="departmentList">
                   </mySelectTree>
                 </el-form-item>
@@ -32,8 +32,8 @@
             </el-form-item>
             <el-form-item label="负责人" prop="person">
               <el-select style="width:100%" v-model="ruleForm.headId" filterable remote clearable placeholder="请选择"
-                :loading="loading" v-SelectLazyLoading="lazyLoading" :remote-method="remoteMethod">
-                <el-option v-for="item in personnelList" :key="item.id" :label="item.name" :value="item.id">
+                :loading="loading" v-SelectLazyLoading="loadHead" :remote-method="remoteMethod">
+                <el-option v-for="item in personnelList.data" :key="item.id" :label="item.name" :value="item.id">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -62,8 +62,8 @@
                   :label="parseInt(item.value)">{{ item.label }}</el-checkbox>
               </el-checkbox-group>
             </el-form-item>
-            <el-form-item label="调查类型" prop="typeList" v-if="show == true">
-              <el-checkbox-group v-model="ruleForm.typeList">
+            <el-form-item label="调查类型" prop="matterIds" v-if="show == true">
+              <el-checkbox-group v-model="ruleForm.matterIds">
                 <template v-for="(item, index) in dictAssociateData">
                   <el-checkbox :label="parseInt(item.dictChildValue)">
                     {{ item.dictChildLabel }}
@@ -85,12 +85,6 @@
               <div>
                 <el-form-item label="产品类别/产品" prop="productId" v-if="$permission('/workspace/product')">
                   <div>
-                    <!-- <mySelectButton size='large' style="width:100%">
-                      <div slot="select" style="width:100%">
-                        <mySelectTree style="width:100%" v-model="ruleForm.departmentId" :options="departmentList">
-                        </mySelectTree>
-                      </div>
-                    </mySelectButton> -->
                     <div v-if="ruleForm.products">
                       {{ ruleForm.products.name }}
                       <span style="color:blue">
@@ -134,6 +128,33 @@
                 </el-form-item>
               </el-col>
             </el-row>
+            <el-row :gutter="24">
+              <el-col :span="12">
+                <el-form-item label="是否更新" prop="ifUpdate">
+                  <el-select v-model="ruleForm.ifUpdate" placeholder="请选择是否更新" class="width_100">
+                    <el-option :value="false" label="否"></el-option>
+                    <el-option :value="true" label="是"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12" v-if="ruleForm.ifUpdate">
+                <el-form-item label="更新周期" required>
+                  <el-select v-model="ruleForm.updateTime" @change="getDateType" placeholder="请选择更新周期" class="width_100">
+                    <el-option value="day" label="每天"></el-option>
+                    <el-option value="week" label="每周"></el-option>
+                    <el-option value="month" label="每月"></el-option>
+                    <el-option value="year" label="每年"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row :gutter="24">
+              <el-col :span="24">
+                <el-form-item label="更新具体时间" v-if="ruleForm.ifUpdate && ruleForm.updateTime" >
+                  <my-Time-Choose :type="ruleForm.updateTime" @value="getValue" :cron="ruleForm.crons" style="width:300px"></my-Time-Choose>
+                </el-form-item>
+              </el-col>
+            </el-row>
             <el-form-item label="备注" prop="description">
               <el-input v-model="ruleForm.description" placeholder="请输入备注" type="textarea"></el-input>
             </el-form-item>
@@ -188,7 +209,13 @@ export default {
       //部门列表
       departmentList: [],
       //人员列表
-      personnelList: [],
+      personnelList: {
+        queryParams:{
+          current:1,
+          size:10
+        },
+        data:[]
+      },
       //负责人下拉加载
       loading: false,
       //显示调查类型
@@ -227,6 +254,14 @@ export default {
       showEvent:true,
       //选择产品或产品类别
       productVisible:false,
+      //委托方
+      clientList:{
+        queryParams:{
+          current:1,
+          size:10
+        },
+        data:[]
+      }
 
     };
   },
@@ -238,6 +273,17 @@ export default {
   mounted() {
   },
   methods: {
+    //切换更新周期
+    getDateType(val){
+      this.ruleForm.crons = ''
+    },
+    getValue(val){
+      if (this.ruleForm.dateType=='') {
+        this.$message.error('请先选择更新周期')
+        return false
+      }
+      this.ruleForm.crons=val
+    },
     //获取架构id
     getStructureId(val){
 
@@ -261,7 +307,6 @@ export default {
     //打开选择产品或产品类别弹窗
     choseProduct(){
       this.productVisible = true
-
     },
     //关闭弹窗
     closeProduct(){
@@ -320,10 +365,18 @@ export default {
         this.departmentList = response.data;
       });
     },
-    //获取人员列表
+    //获取人员列表(懒加载)
+    loadHead(){
+      if(this.personnelList.queryParams.current * this.personnelList.queryParams.size>=this.personnelList.queryParams.total){
+        return false
+      }
+      this.personnelList.queryParams.current += 1
+      this.getPersonnelList()
+    },
     getPersonnelList() {
-      this.$api.getPermissionPersonnelList().then((response) => {
-        this.personnelList = response.data
+      this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
+        this.personnelList.data.push(...response.data)
+        this.personnelList.queryParams.total=response.pageColumn.total
       })
     },
     //关闭抽屉
@@ -331,22 +384,32 @@ export default {
       this.drawer = false
     },
     //远程搜索(建议调取接口获取)
-    querySearch(queryString, cb) {
-      // var clientList = this.clientList;
-      // var results = (queryString ? clientList.filter(this.createFilter(queryString)) : clientList).map(item=>{
-      //   return {
-      //     value:item.name,
-      //     name:item.name,
-      //     id:item.id
-      //   }
-      // });
+   async querySearch(queryString, cb) {
+      this.clientList.queryParams.current = 1
+      this.clientList.queryParams.name = queryString
+      this.clientList.data = []
+      await this.getClientList()
       // // 调用 callback 返回建议列表的数据
-      // cb(results);
+      cb(this.clientList.data);
+    },
+    loadClient(){
+      this.clientList.queryParams.current += 1
+      this.getClientList('load')
     },
-    createFilter(queryString) {
-      return (clientList) => {
-        return (clientList.name && clientList.name.toLowerCase().indexOf(queryString.toLowerCase()) != -1);
-      };
+    //获取委托方
+    async getClientList(type){
+      await this.$api.getAdminClientList(this.clientList.queryParams).then(res => {
+        if (res.code == 200) {
+          res.data.records.forEach(item => {
+            item.value = item.name
+          });
+          if(type){
+            this.$refs['client'].$data.suggestions.push(...res.data.records)
+          }else{
+            this.clientList.data.push(...res.data.records)
+          }
+        }
+      })
     },
     //输入框输入事件(委托方)
     input() {
@@ -355,7 +418,7 @@ export default {
     //切换选择委托方
     handleChange(row) {
       this.$set(this.ruleForm, 'entrustId', row.id)
-      this.$set(this.ruleForm, 'clientName', row.name)
+      this.$set(this.ruleForm, 'entrustName', row.name)
       this.close2()
     },
     //打开选择委托方弹窗
@@ -365,7 +428,7 @@ export default {
     //获取委托方信息
     getClient(row) {
       this.$set(this.ruleForm, 'entrustId', row.id)
-      this.$set(this.ruleForm, 'clientName', row.name)
+      this.$set(this.ruleForm, 'entrustName', row.name)
       this.close2()
     },
     //关闭委托方弹窗
@@ -428,7 +491,7 @@ export default {
               this.loading = false
             })
           } else {
-            this.$api.addProject(this.ruleForm).then(response => {
+            this.$api.addPatentProject(this.ruleForm).then(response => {
               this.loading = false
               let permissions = this.permissions
               permissions[response.data] = 0

+ 3 - 2
src/views/project/index.vue

@@ -311,8 +311,9 @@ export default {
     //新增专题库
     handleAdd() {
       this.$refs.projectFormDrawer.open({
-        update: 0,
-        updateTime: '一天',
+        ifUpdate: false,
+        updateTime: 'day',
+        crons:'',
         status: '0',
         sort: 1,
         typeList: [],