فهرست منبع

全局配置以及产品类别

zhuliu 1 سال پیش
والد
کامیت
e69a8a93e0

+ 3 - 1
src/api/index.js

@@ -14,7 +14,7 @@ import patent from "./patent";
 import admin from "./admin";
 import permission from "./permission";
 import reportManage from "./reportManage";
-import product from "./product";
+// import product from "./product";
 import quartz from './quartz';
 import highlight from './highlight';
 
@@ -26,6 +26,7 @@ import InvalidResponse from "./InvalidResponse";
 
 // 新系统新接口文件
 import event from "./newApi/event";
+import product from "./newApi/product";
 
 export default {
   ...report,
@@ -52,4 +53,5 @@ export default {
   ...InvalidResponse,
 
   ...event,
+  ...product,
 }

+ 22 - 0
src/api/newApi/product.js

@@ -0,0 +1,22 @@
+import axios from "@/utils/axios";
+export default {
+  /**
+   * 新增产品类别
+   */
+  addProductCategory(data) {
+    return axios.post("/xiaoshi/productCategory/addProductCategory", data);
+  },
+  /**
+   * 修改产品类别
+   */
+  updateProductCategory(data) {
+    return axios.post("/xiaoshi/productCategory/updateProductCategory", data);
+  },
+  /**
+   * 查询产品类别
+   */
+  queryProductCategory(data) {
+    return axios.post("/xiaoshi/productCategory/queryProductCategory", data);
+  },
+  
+};

+ 6 - 3
src/api/user.js

@@ -7,9 +7,12 @@ export default {
   getUserList(params) {
     return axios.get('/v2/user/list', { params })
   },
-  getPersonList(params) {
-    return axios.get('/v2/user/personnelList', { params })
-  },
+  // getPersonList(params) {
+  //   return axios.get('/v2/user/personnelList', { params })
+  // },
+  getPersonList(data) {
+    return axios.post('/permission/api/personnel/queryPageList', data)
+},
   /**
    * 编辑用户/修改自己的信息
    */

+ 8 - 8
src/assets/css/main.scss

@@ -56,15 +56,15 @@
   //表格
   .el-table{
     // border: 1px solid rgba(124,124,124) !important;
-    height: 100%;
-    width: 100%;
+    // height: 100%;
+    // width: 100%;
     padding-bottom:10px;
-    overflow-x: auto !important;
-    .el-table__body-wrapper{
-      max-height: calc(100% - 75px);
-      overflow: auto;
-      padding-bottom: 10px;
-    }
+    // overflow-x: auto !important;
+    // .el-table__body-wrapper{
+    //   max-height: calc(100% - 75px);
+    //   overflow: auto;
+    //   padding-bottom: 10px;
+    // }
   }
   .el-table th{
     background: var(--bg) !important;

+ 3 - 0
src/utils/common.js

@@ -1,4 +1,6 @@
+
 export default {
+  //object转字符串
   objectToString(val) {
     var data = []
     if (val.constructor == Object) {
@@ -45,4 +47,5 @@ export default {
     })
     return str
   },
+
 }

+ 20 - 0
src/utils/constants.js

@@ -202,4 +202,24 @@ PT:[//专利类型
   },
 ],
 
+//可见类型
+showType:[
+  {
+    label:'公开',
+    value:0
+  },
+  {
+    label:'仅本人可见',
+    value:1
+  },
+  {
+    label:'部分人可见',
+    value:2
+  },
+  {
+    label:'不给谁看',
+    value:3
+  },
+]
+
 }

+ 10 - 201
src/utils/direct/index.js

@@ -12,205 +12,7 @@ const draggable = (el, binding) => {
     startDrag(el.querySelector('.el-dialog__header'), el.querySelector('.el-dialog'), binding.value);
 };
 
-const dragControllerDiv=(el, binding)=>{
-  var resize = el.children[1];
-  var left =el.children[0];
-  var mid = el.children[2];
-  var box = el;
-  // if(!resize){
-  //   return false
-  // }
-  resize.onmousedown = function (e) {
-    //颜色改变提醒
-    resize.style.background = '#818181';
-    var startX = e.clientX;
-    resize.left = resize.offsetLeft;
-    // 鼠标拖动事件
-    document.onmousemove = function (e) {
-        var endX = e.clientX;
-        var moveLen = resize.left + (endX - startX); // (endx-startx)=移动的距离。resize[i].left+移动的距离=左边区域最后的宽度
-        var maxT = box.clientWidth - resize.offsetWidth; // 容器宽度 - 左边区域的宽度 = 右边区域的宽度
 
-        if (moveLen < 32) moveLen = 32; // 左边区域的最小宽度为32px
-        if (moveLen > maxT - 150) moveLen = maxT - 150; //右边区域最小宽度为150px
-
-        resize.style.left = moveLen; // 设置左侧区域的宽度
-
-            left.style.width = moveLen + 'px';
-           if(mid){
-            mid.style.width = (box.clientWidth - moveLen - 10) + 'px';
-           }
-        
-    };
-    // 鼠标松开事件
-    document.onmouseup = function (evt) {
-        //颜色恢复
-        resize.style.background = '#d6d6d6';
-        document.onmousemove = null;
-        document.onmouseup = null;
-        resize.releaseCapture && resize.releaseCapture(); //当你不在需要继续获得鼠标消息就要应该调用ReleaseCapture()释放掉
-    };
-    resize.setCapture && resize.setCapture(); //该函数在属于当前线程的指定窗口里设置鼠标捕获
-    return false;
-};
- 
-};
-const dragControllerDiv1=(el,binding)=>{
-  var resize1 = el.children[2];
-  var resize2 = el.children[1];
-  var left = el.children[0];
-  var mid = el.children[3];
-  var box = el;
-  if(resize2){
-    dragControllerDiv2(el,binding)
-    // return false
-  }
-      // 鼠标按下事件
-      resize1.onmousedown = function (e) {
-        var flex = box.style.flexDirection
-        switch (flex) {
-          case 'row-reverse':
-            resize1.left = mid.offsetWidth;
-              break;
-          case 'row':
-            resize1.left = left.offsetWidth;
-              break;
-          case 'column-reverse':
-              break;
-          case 'column':
-              break;
-          default:
-              break;
-      }
-          //颜色改变提醒
-          resize1.style.background = '#818181';
-          var startX = e.clientX;
-          // resize1.left = resize1.offsetLeft-50;
-          // 鼠标拖动事件
-          document.onmousemove = function (e) {
-             
-              var endX = e.clientX;
-              var moveLen = resize1.left + (endX - startX); // (endx-startx)=移动的距离。resize[i].left+移动的距离=左边区域最后的宽度
-              var maxT = box.clientWidth - resize1.offsetWidth; // 容器宽度 - 左边区域的宽度 = 右边区域的宽度
-
-              if (moveLen < 32) moveLen = 32; // 左边区域的最小宽度为32px
-              if (moveLen > maxT - 150) moveLen = maxT - 150; //右边区域最小宽度为150px
-
-              // resize1.style.left = moveLen; // 设置左侧区域的宽度
-
-                  switch (flex) {
-                      case 'row-reverse':
-                          mid.style.width = moveLen + 'px';
-                          if(left){
-                           left.style.width = (box.clientWidth - moveLen - 10) + 'px';
-                          }
-                          break;
-                      case 'row':
-                          left.style.width = moveLen + 'px';
-                          if(mid){
-                              mid.style.width = (box.clientWidth - moveLen - 10) + 'px';
-                          }
-                          break;
-                      case 'column-reverse':
-                          
-                          break;
-                      case 'column':
-                          
-                          break;
-                      default:
-                          break;
-                  }
-             
-              
-          };
-          // 鼠标松开事件
-          document.onmouseup = function (evt) {
-              //颜色恢复
-              resize1.style.background = '#d6d6d6';
-              document.onmousemove = null;
-              document.onmouseup = null;
-              resize1.releaseCapture && resize1.releaseCapture(); //当你不在需要继续获得鼠标消息就要应该调用ReleaseCapture()释放掉
-          };
-          resize1.setCapture && resize1.setCapture(); //该函数在属于当前线程的指定窗口里设置鼠标捕获
-          return false;
-        }
-};
-const dragControllerDiv2=(el,binding)=> {
-  var resize1 = el.children[1];
-  // var resize2 = el.children[1];
-  var left = el.children[0];
-  var mid = el.children[3];
-  var box = el
-  mid.style.width = '100%'
-  left.style.width = '100%'
-      // 鼠标按下事件
-      resize1.onmousedown = function (e) {
-          var flex = box.style.flexDirection
-          switch (flex) {
-              case 'row-reverse':
-                 
-                  break;
-              case 'row':
-                  
-                  break;
-              case 'column-reverse':
-                  resize1.top = mid.offsetHeight;
-                  break;
-              case 'column':
-                  resize1.top = left.offsetHeight;
-                  break;
-              default:
-                  break;
-          }
-          //颜色改变提醒
-          resize1.style.background = '#818181';
-          var startX = e.clientY;
-          // resize1[i].top = resize1[i].offsetTop;
-          // 鼠标拖动事件
-          document.onmousemove = function (e) {
-              var endX = e.clientY;
-              var moveLen = resize1.top + (endX - startX); // (endx-startx)=移动的距离。resize[i].left+移动的距离=左边区域最后的宽度
-              var maxT = box.clientHeight - resize1.offsetHeight; // 容器宽度 - 左边区域的宽度 = 右边区域的宽度
-              if (moveLen < 150) moveLen = 150; // 左边区域的最小宽度为32px
-              if (moveLen > maxT - 150) moveLen = maxT - 150; //右边区域最小宽度为150px
-
-              resize1.style.top = moveLen; // 设置左侧区域的宽度
-                  switch (flex) {
-                      case 'row-reverse':
-                         
-                          break;
-                      case 'row':
-                          
-                          break;
-                      case 'column-reverse':
-                          mid.style.height = moveLen + 10 + 'px';
-                          if(left){
-                              left.style.height = (box.clientHeight - moveLen ) + 'px';
-                          }
-                          break;
-                      case 'column':
-                          left.style.height = moveLen + 10 + 'px';
-                          if(mid){
-                              mid.style.height = (box.clientHeight - moveLen ) + 'px';
-                          }
-                          break;
-                      default:
-                          break;
-                  }
-             
-          };
-          // 鼠标松开事件
-          document.onmouseup = function (evt) {
-              //颜色恢复
-              resize1.style.background = '#d6d6d6';
-              document.onmousemove = null;
-              document.onmouseup = null;
-              resize1.releaseCapture && resize1.releaseCapture(); //当你不在需要继续获得鼠标消息就要应该调用ReleaseCapture()释放掉
-          };
-          resize1.setCapture && resize1.setCapture(); //该函数在属于当前线程的指定窗口里设置鼠标捕获
-          return false;
-        }
-};
 //下拉框懒加载
 const SelectLazyLoading=(el,binding)=>{
    
@@ -248,12 +50,19 @@ const disabled = (el,binding)=>{
         el.style.color=''
     }
 }
+
+//获取高度
+const DivHeight={
+    inserted(el,binding){
+        binding.value(el.offsetHeight)
+    }
+}
+
 const directives = {
     draggable,
-    dragControllerDiv,
-    dragControllerDiv1,
     SelectLazyLoading,
-    disabled
+    disabled,
+    DivHeight
 };
 // 这种写法可以批量注册指令
 export default {

+ 1 - 1
src/utils/index.js

@@ -199,4 +199,4 @@ export const renderSize = (value) => {
 
 export const getPatentCountry = (patentNo) => {
   return patentNo.substr(0, 2)
-}
+}

+ 163 - 0
src/views/components/dialog/ClientTable.vue

@@ -0,0 +1,163 @@
+<template>
+  <div class="admin-department">
+
+
+    <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="submit">保存</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table
+      :data="tableData"
+      v-loading="loading"
+      style="width: 100%"
+	  v-if="showTable"
+    >
+      <el-table-column width="55" align="center">
+		<template slot-scope="scope">
+			<div>
+				<el-checkbox :checked="personIds.indexOf(scope.row.id)!=-1" @change="getCheck(scope.row)" v-if="showCheck"></el-checkbox>
+			</div>
+		</template>
+		
+	  </el-table-column>
+      <el-table-column
+        prop="name"
+        label="人员名称"
+        align="center"
+        show-overflow-tooltip
+      ></el-table-column>
+      <el-table-column
+        label="Email"
+        prop="email"
+        align="center"
+        show-overflow-tooltip
+      >
+      </el-table-column>
+      <el-table-column
+        prop="mobile"
+        label="手机号码"
+        align="center"
+        show-overflow-tooltip
+      ></el-table-column>
+      <el-table-column
+        prop="personnelDescription"
+        label="描述"
+        align="center"
+        show-overflow-tooltip
+      ></el-table-column>
+    </el-table>
+    <div class="pagination">
+      <el-pagination
+        :current-page.sync="queryParams.current"
+        :page-size="queryParams.size"
+        :total="total"
+        @current-change="handleCurrentChange"
+        layout="total, prev, pager, next, jumper"
+        background
+      ></el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+	props:{
+		personIds:{
+			default:[]
+		},
+		persons:{
+			default:[]
+		},
+	},
+  data() {
+    name: "ClientTable";
+    return {
+      visible: false,
+      loading: false,
+      total: 0,
+      tableData: [],
+      queryParams: {
+        tenantId: this.tenantId,
+        tenantName: "",
+        size: 10,
+        current: 1,
+        projectId: this.projectId,
+      },
+	  
+	  showTable:true,
+	  showCheck:true
+
+    };
+  },
+  mounted() {
+    this.getList();
+
+  },
+watch:{
+	personIds(val){
+		this.showCheck = false
+		this.$nextTick(()=>{
+			this.showCheck = true
+		})
+	}
+},
+  computed: {
+  },
+
+  methods: {
+    getList() {
+      this.loading = true;
+      this.$api
+        .getPersonList(this.queryParams)
+        .then((response) => {
+          this.tableData = response.data;
+          this.total = response.data.total;
+          this.loading = false;
+        })
+        .catch((error) => {
+          this.loading = false;
+        });
+    },
+    close() {
+      this.visible = false;
+    },
+    handleCurrentChange(val) {
+      this.queryParams.current = val;
+      this.getList();
+    },
+	//保存
+	submit(){
+		this.$emit('getPersonIds',{personIds:this.personIds,persons:this.persons})
+
+	},
+	//选择
+	getCheck(row){
+		var index = this.personIds.indexOf(row.id)
+		if(index==-1){
+			this.personIds.push(row.id)
+			this.persons.push(row)
+		}else{
+			this.personIds.splice(index,1)
+			this.persons.splice(index,1)
+		}
+	}
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.admin-department {
+  border: 1px solid #eee;
+  padding: 20px;
+  // border-radius: 8px;
+}
+</style>

+ 56 - 0
src/views/components/dialog/person.vue

@@ -0,0 +1,56 @@
+<template>
+  <div>
+    <el-dialog
+        title="选择人员"
+        :visible.sync="dialogVisible"
+        width="700px"
+        :before-close="handleClose"
+        :append-to-body="true">
+        <div>
+            <client-table :personIds="personIds" :persons="persons" @getPersonIds="getPersonIds"></client-table>
+        </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import ClientTable from './ClientTable.vue';
+export default {
+  components: {
+    ClientTable
+  },
+  props: {},
+  data() {
+    return {
+        dialogVisible:false,
+        personIds:[],
+        persons:[]
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {
+    //关闭弹窗
+    handleClose(){
+        this.dialogVisible = false
+        this.$emit('getPersonIds',{personIds:this.personIds,persons:this.persons})
+    },
+    //打开弹窗
+    open(personIds,persons){
+        this.personIds = personIds || []
+        this.persons = persons || []
+        this.dialogVisible = true
+    },
+    getPersonIds({personIds,persons}){
+        this.personIds = personIds
+        this.persons = persons
+        this.handleClose()
+    }
+  },
+    
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 17 - 0
src/views/components/mixins/index.js

@@ -0,0 +1,17 @@
+export const getTableHeight={
+    data() {
+        return {
+            tableHeight:100,
+            showTable:true
+        }
+    },
+    methods: {
+        getDivHeight(val){
+            this.tableHeight = val
+            this.showTable = false
+            this.$nextTick(()=>{
+                this.showTable = true
+            })
+        }
+    },
+}

+ 1 - 1
src/views/event/components/view/table.vue

@@ -21,7 +21,7 @@
         </template>
       </el-table-column>
 
-        <el-table-column v-if="['1'].indexOf(isOperate) == -1" label="操作" align="center" width="150px" >
+        <el-table-column v-if="[1].indexOf(isOperate) == -1" label="操作" align="center" width="150px" >
           <template slot-scope="scope">
             <el-dropdown split-button type="primary" size="small" @click="handleClick(scope.row)"
               @command="handleCommand($event,scope.row)">

+ 124 - 11
src/views/product/components/dialog/addEditCategory.vue

@@ -1,30 +1,42 @@
 <template>
   <!-- 新增编辑产品类别 -->
   <div class="addEditCategory">
-    <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="100px" class="demo-ruleForm">
+    <el-dialog :title="title" :visible.sync="dialogVisible" :before-close="handleClose" width="700px" :close-on-click-modal="false">
+      <el-form :model="form" :rules="rules" ref="ruleForm" label-width="110px" class="demo-ruleForm">
         <el-form-item label="类别名称" prop="name" >
           <el-input v-model="form.name" placeholder="请输入类别名称"></el-input>
         </el-form-item>
         <el-form-item label="参考许可费率" prop="rate">
-          <el-input v-model="form.rate" placeholder="请输入参考许可费率(介于 0 ~ 1 之间)"></el-input>
+          <el-input v-model="form.licenseRate" placeholder="请输入参考许可费率(介于 0 ~ 1 之间)"></el-input>
+        </el-form-item>
+        <el-form-item label="谁可以看" prop="rate">
+            <div  v-for="item in $constants.showType" :key="item.value" >
+              <div>
+                <el-radio :checked="item.value == form.showType" :label="item.value" v-model="form.showType" @input="changeShowType(item.value)">{{item.label}}</el-radio>
+              </div>
+              <div v-if="form.showType && item.value == form.showType && [0,1].indexOf(item.value)==-1" class="person" @click="showDialog">
+                <p>选择朋友</p>
+                <p v-html="getNames(form.persons)">
+                </p>
+              </div>
+            </div>
         </el-form-item>
         <el-form-item label="图片" prop="">
           <el-upload ref="upload"  action="#" :auto-upload="false"  :on-change="handleChange"  list-type="picture" :show-file-list="false">
-            <span v-if="form.pictures&&form.pictures.length>0" class="avatar">
+            <span v-if="form.systemFileList&&form.systemFileList.length>0" class="avatar">
               <span class="deleteImg">
                 <span> 
                   <i class="el-icon-zoom-in" @click.stop="handlePictureCardPreview"></i>
                   <i class="el-icon-delete" @click.stop="handleRemove"></i>
                 </span>
               </span>
-                <el-image ref="image" style="width:100%;height: 100%;" :src="form.pictures[0].id?$p2 + form.pictures[0].url:form.pictures[0].url" :preview-src-list="form.pictures?form.pictures.map(item=>{return item.id? $p2 + item.url:item.url}):[]"></el-image>
+                <el-image ref="image" style="width:100%;height: 100%;" :src="form.systemFileList[0].id?$p2 + form.systemFileList[0].url:form.systemFileList[0].url" :preview-src-list="form.systemFileList?form.systemFileList.map(item=>{return item.id? $p2 + item.url:item.url}):[]"></el-image>
             </span>
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
         </el-form-item>
-        <el-form-item label="类别备注" prop="">
-          <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入类别备注"></el-input>
+        <el-form-item label="描述" prop="">
+          <el-input v-model="form.description" type="textarea" :rows="2" placeholder="请输入描述"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -32,11 +44,17 @@
         <el-button type="primary" @click="submit" >确定</el-button>
       </div>
     </el-dialog>
+
+    <choose-person ref="choosePerson" @getPersonIds="getPersonIds"></choose-person>
   </div>
 </template>
 
 <script>
+import choosePerson from '@/views/components/dialog/person.vue'
 export default {
+  components:{
+    choosePerson
+  },
   data() {
     return {
       // 弹窗的title
@@ -49,18 +67,29 @@ export default {
       rules: {
         name: [ { required: true, message: '请输入类别名称', trigger: 'blur' },],
       },
+      //待上传的文件
+      file:[]
     };
   },
   mounted() { },
   methods: {
     // 上传的change
-    handleChange(file,fileList){},
+    handleChange(file,fileList){
+      this.$set(this.form,'systemFileList', [{url:file.url}])
+      this.file = [file.raw]
+    },
     // 点击已上传的文件
-    handlePictureCardPreview(file) { },
+    handlePictureCardPreview(file) {
+      this.$refs.image.showViewer = true
+     },
     // 文件列表移除文件
-    handleRemove(file) { },
+    handleRemove(file) {
+      this.file = []
+      this.form.systemFileList = []//直接清空适用于单张图片
+     },
     // 打开弹窗
     open(row) {
+      this.form = JSON.parse(JSON.stringify(row))
       if (row.id) {
         this.title = '编辑产品类别'
       } else {
@@ -72,7 +101,31 @@ export default {
     submit() {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          this.handleClose()
+          var formData = new FormData()
+          formData.append('productCategory',JSON.stringify(this.form))
+          if(this.file.length>0){
+            this.file.forEach(item=>{
+              formData.append("files", item);
+            })
+          }
+          if(this.form.id){
+            this.$api.updateProductCategory(formData).then(response=>{
+              this.$message.success('更新成功')
+              this.$emit('getMessage','更新成功')
+              this.handleClose()
+            }).catch(error=>{
+
+            })
+          }else{
+            this.$api.addProductCategory(formData).then(response=>{
+              this.$message.success('添加成功')
+              this.$emit('getMessage','添加成功')
+              this.handleClose()
+            }).catch(error=>{
+
+            })
+          }
+          
         } else {
           
         }
@@ -83,11 +136,71 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.dialogVisible = false;
     },
+    //切换谁可以看类型
+    changeShowType(val){
+      this.form.showType1 = this.form.showType
+      this.$set(this.form,'showType',val)
+      this.$set(this.form,'persons',[])
+      this.$set(this.form,'showPersonId',[])
+      if(this.form.showType == 2 || this.form.showType == 3){
+        this.showDialog()
+      }
+      
+    },
+    showDialog(){
+      this.$refs.choosePerson.open(this.form.showPersonId,this.form.persons)
+    },
+    getPersonIds({personIds,persons}){
+      if(personIds.length>0){
+        this.$set(this.form,'persons',persons)
+        this.$set(this.form,'showPersonId',personIds)
+      }else{
+        if(this.form.showType == this.form.showType1){
+          this.$set(this.form,'showType',0)
+        }else{
+          this.$set(this.form,'showType',this.form.showType1)
+        }
+        
+        this.$set(this.form,'persons',[])
+        this.$set(this.form,'showPersonId',[])
+      }
+    },
+
+    getNames(row){
+      if(!row){
+        return ''
+      }
+      var arr = row.map(item=>{
+        return item.name
+      })
+      return arr.join('、')
+    }
   },
 };
 </script>
 
 <style lang="scss" scoped>
+.person{
+  height:50px;
+  padding-left:30px;
+  cursor: pointer;
+  p{
+    margin:0;
+    height: 30px;
+    line-height: 30px;
+  }
+  p:first-child{
+    color: green;
+  }
+  p:last-child{
+    font-size: 12px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow:ellipsis;
+  }
+}
+
+
 .avatar-uploader-icon {
     background-color: #fbfdff;
     border: 1px dashed #c0ccda;

+ 68 - 32
src/views/product/components/index.vue

@@ -45,7 +45,7 @@
       </el-footer>
     </el-container>
 
-    <addEditCategory ref="addEditCategory"></addEditCategory>
+    <addEditCategory ref="addEditCategory" @getMessage="getMessage"></addEditCategory>
     <addEditProduct ref="addEditProduct"></addEditProduct>
   </div>
 </template>
@@ -108,7 +108,8 @@ export default {
       // 产品类别总数
       total: 0,
       // 产品类别数据
-      tableData:[{
+      tableData:[
+        {
           id: '12987122',
           name: '好滋好味鸡蛋仔',
           category: '江浙小吃、小吃零食',
@@ -116,38 +117,52 @@ export default {
           address: '上海市普陀区真北路',
           shop: '王小虎夫妻店',
           shopId: '10333'
-        }, {
-          id: '12987123',
-          name: '好滋好味鸡蛋仔',
-          category: '江浙小吃、小吃零食',
-          desc: '荷兰优质淡奶,奶香浓而不腻',
-          address: '上海市普陀区真北路',
-          shop: '王小虎夫妻店',
-          shopId: '10333'
-        }, {
-          id: '12987125',
-          name: '好滋好味鸡蛋仔',
-          category: '江浙小吃、小吃零食',
-          desc: '荷兰优质淡奶,奶香浓而不腻',
-          address: '上海市普陀区真北路',
-          shop: '王小虎夫妻店',
-          shopId: '10333'
-        }, {
-          id: '12987126',
-          name: '好滋好味鸡蛋仔',
-          category: '江浙小吃、小吃零食',
-          desc: '荷兰优质淡奶,奶香浓而不腻',
-          address: '上海市普陀区真北路',
-          shop: '王小虎夫妻店',
-          shopId: '10333'
-        }],
+        }
+      ],
     }
   },
   mounted() {
-
+    //获取产品类别数据
+    this.getList()
+    //获取检索字段以及分组字段
+    this.getFieldList()
+    
   },
   methods: {
-
+    //获取检索字段以及分组字段
+    async getColumn() {
+      let params = ['event']
+      await this.$api.getParamsCommon(params).then(res => {
+        if (res.code == 200) {
+          // 显示栏位
+          this.columnList = res.data[0].conditionDTOList.filter(item => {
+            return item.name != 'Id' && item.ifShow == true
+          })
+          // 分组字段
+          let conditionDTOList= JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
+          this.groupingOption = conditionDTOList.filter(item => {
+            return item.ifGroup == true
+          })
+          // 搜索字段
+          this.searchFiled = res.data[0].conditionDTOList.filter(item => {
+            item.label = item.name
+            if (['createTime','eventDate'].includes(item.value)) {
+              item.type=2
+            }else if (['scenarioId'].includes(item.value)) {
+              item.type = 3
+              item.options=this.scene
+            } else {
+              item.type=1
+            }
+            return item.ifSearch == true
+          })
+        }
+      })
+      this.showView = false
+      this.$nextTick(() => {
+        this.showView = true
+      })
+    },
     // 子组件编辑等事件
     handleOption({ val, row }) {
       switch (val) {
@@ -169,10 +184,31 @@ export default {
         this.$refs.addEditProduct.open({isTheCompany:'2'})
       }
     },
-    // 获取数据
-    getList(){},
+    //获取子组件信息
+    getMessage(val){
+      this.getList()
+    },
+    // 获取产品类别数据
+    getList(){
+      console.log(23)
+      var str = this.$commonJS.objectToString(this.searchOption)
+      let params = {
+        ...this.queryParams,//分页信息
+        searchQuery:str,//检索条件
+        orderDTOList: null,//排序
+      }
+      this.$api.queryProductCategory(params).then(response=>{
+        if(response.code == 200){
+
+          this.tableData = response.data.data
+        }
+      })
+    },
     // 分页
-    handleCurrentChange(val){},
+    handleCurrentChange(val){
+      this.queryParams.current = val
+      this.getList()
+    },
     // 分组查询change
     changeGrouping(val) { },
     //获取检索条件检索

+ 7 - 170
src/views/product/components/view/categoryTable.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 产品类别表格 -->
-  <div class="categoryTable">
-    <el-table :data="tableData" style="width: 100%" header-row-class-name="custom-table-header" row-key="id" @expand-change="handleExpand">
+  <div class="categoryTable height_100" v-DivHeight="getDivHeight">
+    <el-table :data="tableData" style="width: 100%" header-row-class-name="custom-table-header" row-key="id" v-if="showTable" :maxHeight="tableHeight" @expand-change="handleExpand">
       <el-table-column type="expand">
         <!-- 产品 -->
         <template slot-scope="scope">
@@ -20,7 +20,7 @@
       <el-table-column label="产品类别描述" prop="desc">
         <template slot-scope="scope">
           <div>
-            {{ scope.row.desc?scope.row.desc:'--' }}
+            {{ scope.row.description?scope.row.description:'--' }}
           </div>
         </template>
       </el-table-column>
@@ -41,16 +41,18 @@
       </el-table-column>
     </el-table>
 
-    <addEditProduct ref="addEditProduct"></addEditProduct>
+    <addEditProduct ref="addEditProduct" ></addEditProduct>
     <marketing ref="marketing"></marketing>
   </div>
 </template>
 
 <script>
+import { getTableHeight } from '@/views/components/mixins'
 import productTable from './productTable.vue'
 import addEditProduct from '../dialog/addEditProduct.vue'
 import marketing from '../dialog/marketing.vue'
 export default {
+  mixins:[getTableHeight],
   components: {
     productTable,
     addEditProduct,
@@ -77,7 +79,6 @@ export default {
     }
   },
   mounted() {
-
   },
   methods: {
     // 子组件的编辑等事件
@@ -139,171 +140,7 @@ export default {
       this.$emit('options', { val, row })
     },
     
-    // 请求产品数据
-    getList(row) { 
-      console.log(2)
-      console.log(row)
-      if(!row.productData){
-        row.productData = []
-      }
-      row.queryParams.total = 10
-      row.productData.push(
-        {
-          "id": 43,
-          "productName": "测试人员产品",
-          "marketTime": "2023-04-19 00:00:00",
-          "companyName": "测试",
-          "tenantId": 7,
-          "productExplain": "测试不同租户下的产品",
-          "productCategoryId": 27,
-          "licenseRate": 0.5,
-          "createPersonName": "测试",
-          "pictures": [],
-          "productPatentNum": 0,
-          "patentNum": 0,
-          "productCategory": {
-            "id": 27,
-            "productCategoryName": "测试人员类别",
-            "remark": "测试不同租户下类别",
-            "licenseRate": 0.5,
-            "createPersonName": "测试",
-            "pictures": [
-              {
-                  "id": 43,
-                  "productCategoryId": 27,
-                  "name": "1+",
-                  "suffix": "jpg",
-                  "url": "/20230509/112080e1e7ee4899b9a765248cf92254.jpg"
-              }
-            ]
-          }
-        },
-        {
-          "id": 43,
-          "productName": "测试人员产品",
-          "marketTime": "2023-04-19 00:00:00",
-          "companyName": "测试",
-          "tenantId": 7,
-          "productExplain": "测试不同租户下的产品",
-          "productCategoryId": 27,
-          "licenseRate": 0.5,
-          "createPersonName": "测试",
-          "pictures": [],
-          "productPatentNum": 0,
-          "patentNum": 0,
-          "productCategory": {
-            "id": 27,
-            "productCategoryName": "测试人员类别",
-            "remark": "测试不同租户下类别",
-            "licenseRate": 0.5,
-            "createPersonName": "测试",
-            "pictures": [
-              {
-                  "id": 43,
-                  "productCategoryId": 27,
-                  "name": "1+",
-                  "suffix": "jpg",
-                  "url": "/20230509/112080e1e7ee4899b9a765248cf92254.jpg"
-              }
-            ]
-          }
-        },
-        {
-          "id": 43,
-          "productName": "测试人员产品",
-          "marketTime": "2023-04-19 00:00:00",
-          "companyName": "测试",
-          "tenantId": 7,
-          "productExplain": "测试不同租户下的产品",
-          "productCategoryId": 27,
-          "licenseRate": 0.5,
-          "createPersonName": "测试",
-          "pictures": [],
-          "productPatentNum": 0,
-          "patentNum": 0,
-          "productCategory": {
-            "id": 27,
-            "productCategoryName": "测试人员类别",
-            "remark": "测试不同租户下类别",
-            "licenseRate": 0.5,
-            "createPersonName": "测试",
-            "pictures": [
-              {
-                  "id": 43,
-                  "productCategoryId": 27,
-                  "name": "1+",
-                  "suffix": "jpg",
-                  "url": "/20230509/112080e1e7ee4899b9a765248cf92254.jpg"
-              }
-            ]
-          }
-        },
-        {
-          "id": 43,
-          "productName": "测试人员产品",
-          "marketTime": "2023-04-19 00:00:00",
-          "companyName": "测试",
-          "tenantId": 7,
-          "productExplain": "测试不同租户下的产品",
-          "productCategoryId": 27,
-          "licenseRate": 0.5,
-          "createPersonName": "测试",
-          "pictures": [],
-          "productPatentNum": 0,
-          "patentNum": 0,
-          "productCategory": {
-            "id": 27,
-            "productCategoryName": "测试人员类别",
-            "remark": "测试不同租户下类别",
-            "licenseRate": 0.5,
-            "createPersonName": "测试",
-            "pictures": [
-              {
-                  "id": 43,
-                  "productCategoryId": 27,
-                  "name": "1+",
-                  "suffix": "jpg",
-                  "url": "/20230509/112080e1e7ee4899b9a765248cf92254.jpg"
-              }
-            ]
-          }
-        },
-        {
-          "id": 43,
-          "productName": "测试人员产品",
-          "marketTime": "2023-04-19 00:00:00",
-          "companyName": "测试",
-          "tenantId": 7,
-          "productExplain": "测试不同租户下的产品",
-          "productCategoryId": 27,
-          "licenseRate": 0.5,
-          "createPersonName": "测试",
-          "pictures": [],
-          "productPatentNum": 0,
-          "patentNum": 0,
-          "productCategory": {
-            "id": 27,
-            "productCategoryName": "测试人员类别",
-            "remark": "测试不同租户下类别",
-            "licenseRate": 0.5,
-            "createPersonName": "测试",
-            "pictures": [
-              {
-                  "id": 43,
-                  "productCategoryId": 27,
-                  "name": "1+",
-                  "suffix": "jpg",
-                  "url": "/20230509/112080e1e7ee4899b9a765248cf92254.jpg"
-              }
-            ]
-          }
-        }
-      )
-      if(row.queryParams.current*row.queryParams.size>=row.queryParams.total){
-        row.disabled = true
-        return
-      } 
-    },
+
   },
 }
 </script>

+ 2 - 2
vue.config.js

@@ -109,7 +109,7 @@ module.exports = {
     },
     proxy: {
       '/api/xiaoshi': {
-        target: 'http://192.168.1.16:8877',
+        target: 'http://192.168.1.14:8877',
         ws: true,
         changeOrigin: true
       },
@@ -120,7 +120,7 @@ module.exports = {
       // },
       '/permission': {
         // target: 'http://192.168.0.56:8880',
-        target: 'http://192.168.1.16:8871',
+        target: 'http://192.168.1.24:8871',
         // target: 'http://139.224.24.90:8871',
         ws: true,
         changeOrigin: true,