Browse Source

事件增删查,搜索完成

zhuhao 1 year ago
parent
commit
bd17ceabdc

+ 1 - 1
src/api/common.js

@@ -5,7 +5,7 @@ export default {
    * 获取通用数据
    */
   getCommonData(params) {
-    return axios.get('/v2/common/data', { params, loading: false });
+    return axios.get('/xiaoshi/common/data', { params, loading: false });
   },
   /**
    * @author 沈永艺

+ 36 - 0
src/api/event.js

@@ -0,0 +1,36 @@
+import axios from '@/utils/axios'
+// 新系统事件新接口
+export default {
+  /**
+    * 新增问题(事件)
+    */
+  eventAddEvent(data) {
+   return axios.post('/xiaoshi/event/addEvent', data)
+  },
+
+  /**
+  * 获取table栏位及分组字段
+  */
+  getParamsCommon(data) {
+    return axios.post('/xiaoshi/common/getParams', data);
+  },
+  /**
+  * 查询事件
+  */
+  queryEvent(data) {
+   return axios.post('/xiaoshi/event/queryEvent', data)
+  },
+  /**
+  * 修改事件
+  */
+  // eventUpdate(data) {
+  //  return axios.post('/v2/event/update', data)
+  // },
+  /**
+  * 删除事件
+  */
+  deleteEvent(data) {
+   return axios.post('/xiaoshi/event/deleteEvent', data)
+  },
+
+}

+ 7 - 1
src/api/index.js

@@ -23,6 +23,10 @@ import importPatent from './importPatent'
 
 import InvalidResponse from "./InvalidResponse";
 
+
+// 新系统新接口文件
+import event from "./event";
+
 export default {
   ...report,
   ...template,
@@ -45,5 +49,7 @@ export default {
   ...importPatent,
   ...highlight,
   ...matters,
-  ...InvalidResponse
+  ...InvalidResponse,
+
+  ...event,
 }

+ 1 - 24
src/api/project.js

@@ -376,30 +376,7 @@ export default {
   importProjectExcel(data) {
     return axios.post('/v2/project/importExcel', data)
   },
-  /**
-   * 新增问题(事件)
-   */
-  eventAddNew(data) {
-    return axios.post('/v2/event/addNewEvent', data)
-  },
-  /**
-   * 查询事件
-   */
-  eventQuery(data) {
-    return axios.post('/v2/event/query', data)
-  },
-  /**
-   * 修改事件
-   */
-  eventUpdate(data) {
-    return axios.post('/v2/event/update', data)
-  },
-  /**
-   * 删除事件
-   */
-  eventDelete(params) {
-    return axios.get('/v2/event/delete', {params})
-  },
+ 
 
   //查询九大场景对应的事件数量
   queryApplicationScenarioEventNumber(params){

+ 1 - 3
src/utils/direct/index.js

@@ -214,9 +214,7 @@ const dragControllerDiv2=(el,binding)=> {
 //下拉框懒加载
 const SelectLazyLoading=(el,binding)=>{
    
-    let SELECT_DOM = el.querySelector(
-      ".el-select-dropdown .el-select-dropdown__wrap"
-    );
+    let SELECT_DOM = el.querySelector(".el-select-dropdown .el-select-dropdown__wrap") || el.querySelector('.el-autocomplete-suggestion__wrap') ;
     if(!SELECT_DOM){
         return false
     }

+ 193 - 200
src/views/client/index.vue

@@ -3,19 +3,20 @@
     <el-container>
       <el-header>
         <div>
-          <mySearch style="width: 500px" :SearchFields="searchFiled"  @search="search" :searchValue="searchOption"></mySearch>
+          <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>
+          <el-button type="primary" size="small" @click="handleAdd()"> 新增 </el-button>
         </div>
       </el-header>
       <el-main>
-        <div  class="height_100">
-           <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header">
+        <div class="height_100">
+          <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header">
             <el-table-column type="index" label="#" width="55" align="center">
-                <template slot-scope="scope">
-                  <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
-                </template>
+              <template slot-scope="scope">
+                <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
+              </template>
             </el-table-column>
             <el-table-column prop="name" label="客户名称" align="center" show-overflow-tooltip>
               <template slot-scope="scope">
@@ -24,33 +25,36 @@
                   <div v-else>
                     <el-link type="primary" @click.native="getClient(scope.row)">{{ scope.row.name }}</el-link>
                   </div>
-                  
+
                 </div>
               </template>
             </el-table-column>
             <template v-if="!choseClient">
               <div>
-                <el-table-column prop="personnelName" label="客户对接人" align="center" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="personnelName" label="客户对接人" align="center"
+                  show-overflow-tooltip></el-table-column>
                 <el-table-column prop="remark" label="备注" align="center" show-overflow-tooltip></el-table-column>
                 <el-table-column label="操作" align="center" width="150">
-                    <template slot-scope="scope">
+                  <template slot-scope="scope">
                     <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
-                    <p>编辑</p> 
-                        <el-dropdown-menu slot="dropdown" class="text-align_center">
-                        <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
-                        </el-dropdown-menu>
+                      <p>编辑</p>
+                      <el-dropdown-menu slot="dropdown" class="text-align_center">
+                        <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)"
+                          divided>删除</el-dropdown-item>
+                      </el-dropdown-menu>
                     </el-dropdown>
-                    </template>
+                  </template>
                 </el-table-column>
               </div>
             </template>
-        </el-table> 
+          </el-table>
         </div>
-        
+
       </el-main>
       <el-footer>
         <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>
+          <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>
       </el-footer>
     </el-container>
@@ -58,27 +62,16 @@
     <el-dialog :title="title" :visible.sync="visible" width="500px" :before-close="close" append-to-body>
       <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
         <el-form-item label="客户名称" prop="name">
-          <el-autocomplete
-              style="width:100%"
-                v-model="ruleForm.name"
-                :fetch-suggestions="querySearch"
-                @input="input"
-                placeholder="请输入客户名称"
-                :trigger-on-focus="false"
-                @select="handleChange"
-              >
-              </el-autocomplete>
+          <el-autocomplete style="width:100%" v-model="ruleForm.name" :fetch-suggestions="querySearch" @input="input"
+            placeholder="请输入客户名称" :trigger-on-focus="false" @select="handleChange">
+          </el-autocomplete>
         </el-form-item>
         <el-form-item label="对接人" prop="person">
-              <el-select style="width:100%" v-model="ruleForm.personnelId" filterable placeholder="请选择">
-                <el-option
-                  v-for="item in personnelList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id">
-                </el-option>
-              </el-select>
-            </el-form-item>
+          <el-select style="width:100%" v-model="ruleForm.personnelId" filterable placeholder="请选择">
+            <el-option v-for="item in personnelList" :key="item.id" :label="item.name" :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="ruleForm.remark" placeholder="请输入备注" type="textarea"></el-input>
         </el-form-item>
@@ -95,56 +88,56 @@
 export default {
   components: {},
   props: {
-    name:'',
-    choseClient:false
+    name: '',
+    choseClient: false
   },
   data() {
     return {
-        //弹窗显示标识
-        visible: false,
-        //加载
-        loading: false,
-        //按钮加载
-        btnLoading: false,
-        //人员列表
-        personnelList:[],
-        //总客户数
-        total: 0,
-        //客户列表数据
-        tableData: [],
-        //弹窗标题
-        title: '',
-        //分页信息
-        queryParams: {
-            size: 10,
-            current: 1,
-        },
-        //表单信息
-        ruleForm: {},
-        //表单规则
-        rules: {
-            name: [{ required: true, message: '请输入客户名称', trigger: 'blur' },],
-        },
-        //租户列表
-        tenantList:[],
-        //检索字段
-        searchFiled:[
-            {
-                label:'客户名称名称',
-                value:'name',
-                type:1,
-                placeholder:'请输入客户名称'
-            }
-        ],
-        //检索条件
-        searchOption:{
-            name:this.name
-        },
+      //弹窗显示标识
+      visible: false,
+      //加载
+      loading: false,
+      //按钮加载
+      btnLoading: false,
+      //人员列表
+      personnelList: [],
+      //总客户数
+      total: 0,
+      //客户列表数据
+      tableData: [],
+      //弹窗标题
+      title: '',
+      //分页信息
+      queryParams: {
+        size: 10,
+        current: 1,
+      },
+      //表单信息
+      ruleForm: {},
+      //表单规则
+      rules: {
+        name: [{ required: true, message: '请输入客户名称', trigger: 'blur' },],
+      },
+      //租户列表
+      tenantList: [],
+      //检索字段
+      searchFiled: [
+        {
+          label: '客户名称名称',
+          value: 'name',
+          type: 1,
+          placeholder: '请输入客户名称'
+        }
+      ],
+      //检索条件
+      searchOption: {
+        name: this.name
+      },
     };
   },
   watch: {},
   computed: {},
-  created() {},
+  created() { },
   mounted() {
     this.getList()
     //获取客户信息(建议改成远程搜索,或者懒加载)
@@ -154,133 +147,133 @@ export default {
   },
   methods: {
     //检索
-    search(){
+    search() {
 
     },
     //改为通过接口获取数据
     querySearch(queryString, cb) {
-        var tenantList = this.tenantList;
-        var results = (queryString ? tenantList.filter(this.createFilter(queryString)) : tenantList).map(item=>{
-          return {
-            value:item.name,
-            name:item.name,
-            id:item.id
-          }
-        });
-        // 调用 callback 返回建议列表的数据
-        cb(results);
-      },
-      createFilter(queryString) {
-        return (tenantList) => {
-          return (tenantList.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
-        };
-      },
-      //获取所有租户信息
-      getAllTenantList(){
-        this.$api.getAllTenantList().then(response=>{
-          this.tenantList = response.data
-        })
-      },
-        //输入事件
-        input() {
-            this.$set(this.ruleForm, 'tenantId', null)
-        },
-        //切换选择客户名称
-        handleChange(row) {
-            this.$set(this.ruleForm, 'tenantId', row.id)
-            this.$set(this.ruleForm, 'name', row.name)
-        },
-      //打开新增客户弹窗
-        handleAdd() {
-            this.title = '新增客户'
-            this.visible = true
-            this.ruleForm = {}
-        },
-        //打开编辑客户弹窗
-        handleEdit(row) {
-            this.title = '编辑客户'
-            this.visible = true
-            this.ruleForm = { ...row }
-        },
-        //关闭弹窗
-        close() {
-            this.visible = false
-        },
-        //获取所有人员信息(最好使用远程搜索)
-        getPersonnelList(){
-            this.$api.getPermissionPersonnelList().then((response)=>{
-                this.personnelList=response.data
-            })
-        },
-        //获取客户信息
-        getList() {
-            this.loading = true
-            this.$api.getAdminClientList(this.queryParams).then(response => {
-                this.tableData = response.data.records
-                this.total = response.data.total
-                this.loading = false
+      var tenantList = this.tenantList;
+      var results = (queryString ? tenantList.filter(this.createFilter(queryString)) : tenantList).map(item => {
+        return {
+          value: item.name,
+          name: item.name,
+          id: item.id
+        }
+      });
+      // 调用 callback 返回建议列表的数据
+      cb(results);
+    },
+    createFilter(queryString) {
+      return (tenantList) => {
+        return (tenantList.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
+      };
+    },
+    //获取所有租户信息
+    getAllTenantList() {
+      this.$api.getAllTenantList().then(response => {
+        this.tenantList = response.data
+      })
+    },
+    //输入事件
+    input() {
+      this.$set(this.ruleForm, 'tenantId', null)
+    },
+    //切换选择客户名称
+    handleChange(row) {
+      this.$set(this.ruleForm, 'tenantId', row.id)
+      this.$set(this.ruleForm, 'name', row.name)
+    },
+    //打开新增客户弹窗
+    handleAdd() {
+      this.title = '新增客户'
+      this.visible = true
+      this.ruleForm = {}
+    },
+    //打开编辑客户弹窗
+    handleEdit(row) {
+      this.title = '编辑客户'
+      this.visible = true
+      this.ruleForm = { ...row }
+    },
+    //关闭弹窗
+    close() {
+      this.$refs.ruleForm.resetFields()
+      this.visible = false
+    },
+    //获取所有人员信息(最好使用远程搜索)
+    getPersonnelList() {
+      this.$api.getPermissionPersonnelList().then((response) => {
+        this.personnelList = response.data
+      })
+    },
+    //获取客户信息
+    getList() {
+      this.loading = true
+      this.$api.getAdminClientList(this.queryParams).then(response => {
+        this.tableData = response.data.records
+        this.total = response.data.total
+        this.loading = false
+      }).catch(error => {
+        this.loading = false
+      })
+    },
+    //分页
+    handleCurrentChange(val) {
+      this.queryParams.current = val;
+      this.getList();
+    },
+    //提交信息
+    submit() {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          this.btnLoading = true
+          if (this.ruleForm.id) {
+            this.$api.editAdminClient(this.ruleForm).then(response => {
+              this.$message.success('编辑成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
             }).catch(error => {
-                this.loading = false
+              this.btnLoading = false
             })
-        },
-        //分页
-        handleCurrentChange(val) {
-            this.queryParams.current = val;
-            this.getList();
-        },
-        //提交信息
-        submit() {
-            this.$refs.ruleForm.validate((valid) => {
-                if (valid) {
-                this.btnLoading = true
-                if (this.ruleForm.id) {
-                    this.$api.editAdminClient(this.ruleForm).then(response => {
-                    this.$message.success('编辑成功')
-                    this.btnLoading = false
-                    this.getList()
-                    this.close()
-                    }).catch(error => {
-                    this.btnLoading = false
-                    })
-                } else {
-                    this.$api.addAdminClient(this.ruleForm).then(response => {
-                    this.$message.success('新增成功')
-                    this.btnLoading = false
-                    this.getList()
-                    this.close()
-                    }).catch(error => {
-                    this.btnLoading = false
-                    })
-                }
-                } else {
-                // console.log('error submit!!');
-                return false;
-                }
-            });
-        },
-        //删除客户
-        handleDelete(row) {
-            this.$confirm('确认删除本条数据吗?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                this.loading = true
-                this.$api.deleteAdminClient({ id: row.id }).then(response => {
-                this.$message.success('删除成功')
-                this.loading = false
-                this.getList()
-                }).catch(error => {
-                this.loading = false
-                })
+          } else {
+            this.$api.addAdminClient(this.ruleForm).then(response => {
+              this.$message.success('新增成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
+            }).catch(error => {
+              this.btnLoading = false
             })
-        },
-        //选择客户
-        getClient(row){
-          this.$emit('getClient',row)
-        },
+          }
+        } else {
+          // console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    //删除客户
+    handleDelete(row) {
+      this.$confirm('确认删除本条数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.deleteAdminClient({ id: row.id }).then(response => {
+          this.$message.success('删除成功')
+          this.loading = false
+          this.getList()
+        }).catch(error => {
+          this.loading = false
+        })
+      })
+    },
+    //选择客户
+    getClient(row) {
+      this.$emit('getClient', row)
+    },
   }
 };
 </script>
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 93 - 68
src/views/event/components/dialog/addEvent.vue

@@ -4,8 +4,8 @@
       <!-- 单个新增(事件) -->
       <div v-if="type == 1">
         <el-form :model="formData[0]" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
-          <el-form-item label="事件名称" prop="questionName">
-            <el-autocomplete class="inline-input" v-model="formData[0].questionName"
+          <el-form-item label="事件名称" prop="name">
+            <el-autocomplete class="inline-input" v-model="formData[0].name" v-SelectLazyLoading="load"
               :fetch-suggestions="querySearchQuestion"
               placeholder="请输入或选择事件" :trigger-on-focus="false"
               @select="handleSelectQuestion" @change="change1($event, { $index: 0 })" @focus="focus($event, { $index: 0 })"
@@ -16,17 +16,18 @@
             </el-autocomplete>
           </el-form-item>
           <el-form-item label="事件日期" prop="eventDate">
-            <el-date-picker style="width: 100%" v-model="formData[0].eventDate"
-               type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
-              placeholder="选择事件日期时间">
+            <el-date-picker
+              style="width: 100%" v-model="formData[0].eventDate"
+              type="date" value-format="yyyy-MM-dd" placeholder="请选择事件日期"
+              >
             </el-date-picker>
           </el-form-item>
           <el-form-item label="事件描述" prop="description">
             <el-input type="textarea" :rows="1" v-model="formData[0].description" autocomplete="off" placeholder="请输入事件描述"
               ></el-input>
           </el-form-item>
-          <el-form-item label="事件场景" prop="assistPerson">
-            <el-select v-model="formData[0].applicationScenarios[0]" :disabled="(formData[0].id && !this.row) ? true : false"
+          <el-form-item label="事件场景" prop="scenarioId">
+            <el-select v-model="formData[0].scenarioId"
               style="width: 100%;" placeholder="请选择事件场景">
               <el-option
                 v-for="item in commonData.ENTERPRISE_APPLICATION_SCENARIO ? commonData.ENTERPRISE_APPLICATION_SCENARIO : []"
@@ -39,7 +40,7 @@
       <!-- 批量新增(事件) -->
       <div v-else-if="type == 2">
         <el-table :data="formData" style="width: 100%" class="twj-table">
-          <el-table-column prop="questionName" label="事件名称" align="center">
+          <el-table-column prop="name" label="事件名称" align="center">
             <template slot="header">
               <div>
                 <el-tooltip class="item" effect="dark" content="事件:商业目标/解决问题/对应项目" placement="top">
@@ -49,7 +50,7 @@
             </template>
             <template slot-scope="scope">
               <div>
-                <el-autocomplete class="inline-input" v-model="scope.row.questionName"
+                <el-autocomplete class="inline-input" v-model="scope.row.name"
                   :fetch-suggestions="querySearchQuestion" placeholder="请输入或选择事件" :trigger-on-focus="false"
                   @select="handleSelectQuestion" @focus="focus($event, scope)" style="width: 100%;">
                 </el-autocomplete>
@@ -59,8 +60,8 @@
           <el-table-column prop="eventDate" label="事件时间" align="center">
             <template slot-scope="scope">
               <div>
-                <el-date-picker style="width: 100%" v-model="scope.row.eventDate" :disabled="scope.row.id ? true : false"
-                  type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择事件日期时间">
+                <el-date-picker style="width: 100%" v-model="scope.row.eventDate"
+                  type="datetime" value-format="yyyy-MM-dd" placeholder="选择事件日期时间">
                 </el-date-picker>
               </div>
             </template>
@@ -69,15 +70,15 @@
             <template slot-scope="scope">
               <div>
                 <el-input type="textarea" :rows="1" v-model="scope.row.description" autocomplete="off"
-                  placeholder="请输入事件描述" :disabled="scope.row.id ? true : false"></el-input>
+                  placeholder="请输入事件描述"></el-input>
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="applicationScenarios" label="事件场景" align="center">
+          <el-table-column prop="scenarioId" label="事件场景" align="center">
             <template slot-scope="scope">
               <div>
                 <!-- multiple -->
-                <el-select v-model="scope.row.applicationScenarios[0]" :disabled="scope.row.id ? true : false"
+                <el-select v-model="scope.row.scenarioId"
                   style="width: 100%;" placeholder="请选择事件场景">
                   <el-option
                     v-for="item in commonData.ENTERPRISE_APPLICATION_SCENARIO ? commonData.ENTERPRISE_APPLICATION_SCENARIO : []"
@@ -125,28 +126,32 @@ export default {
       //表格数据
       formData: [
         {
-          questionName: '',
+          name: '',
           eventDate: '',
           description: '',
-          applicationScenarios: [],
+          scenarioId: '',
         }
       ],
       //检验规则
       rules: {
-        questionName: [ { required: true, message: '请输入事件名称', trigger: 'blur' },],
+        name: [ { required: true, message: '请输入事件名称', trigger: 'blur' },],
+        scenarioId: [ { required: true, message: '请选择事件场景', trigger: 'change' },],
       },
       //应用场景数据
       commonData: {},
       //弹窗类型
       type: 1,
+      queryParams: {
+        current: 1,
+        size:2,
+      },
+      eventInput:'',
     }
   },
   watch: {},
   async mounted() {
     // 应用场景(是通过字典还是接口待定)
     await this.getCommonData()
-    // 查询所有事件
-    // await this.questionEventList()
   },
   methods: {
     //打开弹窗,判断是编辑还是添加,同时判断是批量添加还是添加单个事件(type==1是单个,type==2是批量)
@@ -154,8 +159,9 @@ export default {
       this.type = type
       if (data) {
         this.title = '编辑事件'
-        this.formData[0] = JSON.parse(JSON.stringify(data))
-        console.log(this.formData);
+        let form = JSON.parse(JSON.stringify(data))
+        this.$set(this.formData, 0, form)
+        // console.log(this.formData);
       } else {
         if (this.type == 1) {
           this.title='新增事件'
@@ -164,10 +170,10 @@ export default {
         }
         this.formData = [
           {
-            questionName: '',
+            name: '',
             eventDate: '',
             description: '',
-            applicationScenarios: [],
+            scenarioId: '',
           }
         ]
       }
@@ -196,18 +202,18 @@ export default {
           this.formData.forEach(item => {
             var a = false
             for (let key in item) {
-              if (key != 'applicationScenarios') {
+              // if (key != 'scenarioId') {
                 if (item[key] != '' && item[key] != null) {
                   a = true
                 }
-              }else {
-                if (item[key].length > 0) {
-                  a = true
-                }
-              }
+              // }else {
+              //   if (item[key].length > 0) {
+              //     a = true
+              //   }
+              // }
             }
             if (a == true) {
-              if (item.questionName != '') {
+              if (item.name != '') {
                 list.push(item)
               } else {
                 throw new Error('事件名称不能为空')
@@ -215,7 +221,7 @@ export default {
             }
           })
         }
-        var arr = [...new Set(list.map(item => { return item.questionName }))]
+        var arr = [...new Set(list.map(item => { return item.name }))]
         if (arr.length < list.length) {
           this.$message.error(`存在重复的事件名称,请重定义事件名称`)
           return false
@@ -233,31 +239,43 @@ export default {
     // 提交保存事件
     addFormData(val) {
       let lists = JSON.parse(JSON.stringify(val.list))
-      let forms = {
-        projectId: this.projectId,
-        eventAddNewDTOs:lists
-      }
+     
       if (this.type=='1') {//单个事件新增
         this.$refs.ruleForm.validate(valid => {
           if (valid) {
-            this.addInterface(forms)
+            this.addInterface(lists)
           } 
         })
       } else {//多个事件新增
-        this.addInterface(forms)
+        this.addInterface(lists)
       }
     },
-    //提交保存事件接口
+    //提交保存、编辑事件接口
     addInterface(forms) {
-      this.$api.eventAddNew(forms).then(res => {
-        if (res.code == 200) {
-          this.$emit('isSuccess','新增成功')
-          this.$message.success('事件新增成功')
-          this.handleClose()
-        }
-      }).catch(error => {
-        this.$message.error(error.message)
-      })
+      let formData = new FormData()
+      // formData.append('file')//文件数据
+      formData.append('event', JSON.stringify(forms[0]))
+      if (forms[0].id) {//编辑
+        this.$api.eventEditEvent(formData).then(res => {
+          if (res.code == 200) {
+            this.$emit('isSuccess','编辑成功')
+            this.$message.success('事件编辑成功')
+            this.handleClose()
+          }
+        }).catch(error => {
+          this.$message.error(error.message)
+        })
+      } else {//新增
+        this.$api.eventAddEvent(formData).then(res => {
+          if (res.code == 200) {
+            this.$emit('isSuccess','新增成功')
+            this.$message.success('事件新增成功')
+            this.handleClose()
+          }
+        }).catch(error => {
+          this.$message.error(error.message)
+        })
+      }
     },
     //重置全部事件
     resetForm() {
@@ -271,10 +289,10 @@ export default {
         }
         this.formData = [
           {
-            questionName: '',
+            name: '',
             eventDate: '',
             description: '',
-            applicationScenarios: [],
+            scenarioId: '',
           }
         ]
         // this.$emit('formData', {list:this.formData,option:1})
@@ -287,10 +305,10 @@ export default {
     addRow() {
       this.formData.push(
         {
-          questionName: '',
+          name: '',
           eventDate: '',
           description: '',
-          applicationScenarios: [],
+          scenarioId: '',
         }
       )
     },
@@ -298,30 +316,36 @@ export default {
     deleteRow(row) {
       this.formData.splice(row.$index, 1)
     },
-    // 查询所有事件
+    // 懒加载方法
+    load() {
+      this.queryParams.size += 2
+      this.questionEventList()
+    },
+    // 查询事件
     async questionEventList() {
-      await this.$api.eventQuery({}).then(res => {
+      let searchValue={name:this.eventInput}
+      let params = {
+        ...this.queryParams,//分页信息
+        searchQuery:this.$commonJS.objectToString(searchValue)//输入的建议
+      }
+      await this.$api.queryEvent(params).then(res => {
         if (res.code == 200) {
-          this.questionNameArr = res.data.list
+          this.questionNameArr = res.data.data
         }
       })
     },
     //获取下拉建议数据
-    querySearchQuestion(queryString, cb) {
-      var restaurants = this.questionNameArr.map(item => {
-        item.value = item.questionName;
-        return item;
-      });
-      var results = queryString ? restaurants.filter(this.createFilterQuestion(queryString)) : restaurants;
+    async querySearchQuestion(queryString, cb) {
+      this.eventInput=queryString
+      await this.questionEventList()
+      console.log(this.questionNameArr, cb);
+      var records=[]
+      this.questionNameArr.forEach(item => {
+        item.value = item.name
+        records.push(item)
+      })
       // 调用 callback 返回建议列表的数据
-      cb(results);
-    },
-    // 对下拉建议列表的数据进行处理
-    createFilterQuestion(queryString) {
-      return (restaurant) => {
-        console.log(restaurant);
-          return (restaurant.value.indexOf(queryString) != -1);
-      };
+      cb(records);
     },
     // input框切换选择
     handleSelectQuestion(val) {
@@ -348,6 +372,7 @@ export default {
     change1(val) {
       // console.log(val);
     },
+
   },
 }
 </script>

+ 129 - 161
src/views/event/components/index.vue

@@ -9,8 +9,8 @@
         <div style="display: flex">
           <div v-if="['可视化'].indexOf(isOperate) == -1">
             <span>分组查询:</span>
-            <el-select v-model="groupingValue" size="small" @change="changeGrouping" style="width: 120px">
-              <el-option v-for="item in groupingOption" :key="item.value" :label="item.label" :value="item.value">
+            <el-select v-model="groupingValue" size="small" @change="changeGrouping" clearable style="width: 120px">
+              <el-option v-for="item in groupingOption" :key="item.value" :label="item.name" :value="item.value">
               </el-option>
             </el-select>
           </div>
@@ -19,13 +19,14 @@
             <el-button :type="viewSelected === 'Table' ? 'primary' : ''" @click="onChange2('Table')" size="small">列表</el-button>
             <el-button :type="viewSelected === 'Card' ? 'primary' : ''" @click="onChange2('Card')" size="small">卡片</el-button>
           </el-button-group>
-          <el-dropdown trigger="click" split-button type="primary" size="small" @command="handleCommand($event)">
+          <el-button type="primary" size="small" style="margin: 0 10px;" @click="handleCommand('1')">添加事件</el-button>
+          <!-- <el-dropdown trigger="click" split-button type="primary" size="small" @command="handleCommand($event)">
             <P @click="handleCommand('1')">添加事件</P>
             <el-dropdown-menu slot="dropdown" class="text-align_center">
               <el-dropdown-item command="1">添加事件</el-dropdown-item>
               <el-dropdown-item command="2">批量添加事件</el-dropdown-item>
             </el-dropdown-menu>
-          </el-dropdown>
+          </el-dropdown> -->
         </div>
       </el-header>
       <el-main id="patent-list-container" class="main" v-loading="loading">
@@ -43,7 +44,6 @@
             :commonData="commonData"
             @on-sort="handleSort"
             @option="handleOption"
-            @sort="sortChange"
           ></component>
         </div>
       </el-main>
@@ -85,60 +85,22 @@ export default {
   data() {
     return {
       //检索字段
-      searchFiled: [
-        {
-          label: '事件名称',
-          value: 'questionName',
-          type: 1,
-          placeholder: '请输入事件名称'
-        },
-        {
-          label: '相关报告',
-          value: 'report',
-          type: 1,
-          placeholder: '请输入相关报告'
-        },
-        {
-          label: '相关专题库',
-          value: 'project',
-          type: 1,
-          placeholder: '请输入相关专题库'
-        },
-      ],
+      searchFiled: [],
       //检索条件
       searchOption: {
-        questionName: this.eventName,
-        applicationScenario: this.applicationScenario
+        // name: this.eventName,
+        // applicationScenario: this.applicationScenario
       },
       //分组的值
-      groupingValue: 'noGrouping',
+      groupingValue: '',
       //分组
-      groupingOption: [
-        {
-          label: '不分组',
-          value: 'noGrouping',
-        },
-        {
-          label: '应用场景',
-          value: 'scenarioName',
-        },
-        {
-          label: '创建人',
-          value: 'createName',
-        },
-        {
-          label: '创建时间',
-          value: 'createTime',
-        },
-      ],
+      groupingOption: [],
       //选择的视图
       viewSelected: 'Table',
       //加载中
       loading: false,
       //事件的数据集合
-      tableData: [
-        { questionName: '事件名称', eventNumber: 2, projectNumber: 3, applicationScenarios: [1],eventDate:'2023-10-25',description:'事件描述'},
-      ],
+      tableData: [],
       //分页信息
       queryParams: {
         current: 1,
@@ -147,108 +109,78 @@ export default {
       //总条数
       total: 0,
       //排序
-      sort: {},
+      sort: [],
       //显示栏位
-      columnList: [],
+      columnList: null,
       //分组数据
       commonData: [],
       //显示视图
-      showView: false
+      showView: false,
+      //场景
+      scene:[],
     };
   },
   watch: {},
   computed: {},
   created() { },
-  mounted() {
+  async mounted() {
+    await this.getCommonData()
+    this.getList()
+    //获取table栏位及分组字段v
     this.getColumn()
   },
   methods: {
-    // 子组件table排序
-    sortChange({ column, prop, order }) {//des,acs
-      this.sort.data=prop
-      if (order == 'ascending') {
-        this.sort.orderAsc = 'asc'
-      } else {
-        this.sort.orderDes='des'
-      }
+    // 请求应用场景(是通过字典还是接口待定)
+    async getCommonData() {
+      await this.$api.getCommonData({ keys: 'QUERY_GROUP,ENTERPRISE_APPLICATION_SCENARIO,INVESTIGATION_TYPE' }).then(response => {
+        this.scene = response.data.ENTERPRISE_APPLICATION_SCENARIO  
+      })
     },
     // 子组件新增事件成功
     handleSuccess(val) {
       // console.log(val);
       this.queryParams.current = 1
-      if (this.groupingValue == 'noGrouping') {//不分组
-        this.getList()
-      } else {//分组
-        this.getGrouping()
-      }
+      this.searchOption.searchQuery=''
+      this.getList()
+      // this.isGrouping()
     },
-    //显示视图
+    //显示视图?
     showViews() {
       this.showView = false
       this.$nextTick(() => {
         this.showView = true
       })
     },
-    //获取栏位
+    //获取table栏位及分组字段、检索字段
     getColumn() {
-      this.columnList = [
-        {
-          "key": "questionName",
-          "name": "事件名称",
-          "type": "list",
-          "order": 0,
-          "hidden": true
-        },
-        {
-          "key": "eventNumber",
-          "name": "相关报告数量",
-          "type": "list",
-          "order": 0,
-          "hidden": true
-        },
-        {
-          "key": "projectNumber",
-          "name": "相关专题库数量",
-          "type": "list",
-          "order": 0,
-          "hidden": true
-        },
-        {
-          "key": "applicationScenarios",
-          "name": "事件场景",
-          "type": "list",
-          "order": 0,
-          "hidden": true
-        },
-        {
-          "key": "eventDate",
-          "name": "事件时间",
-          "type": "list",
-          "order": 0,
-          "hidden": true
-        },
-        {
-          "key": "description",
-          "name": "描述",
-          "type": "list",
-          "order": 0,
-          "hidden": true
-        },
-        {
-          "key": "createPerson",
-          "name": "创建人",
-          "type": "list",
-          "order": 0,
-          "hidden": true
-        },
-        {
-          "key": "time",
-          "name": "创建时间",
-          "type": "list",
-          "order": 0,
-          "hidden": true
-        },
-      ]
+      let params = ['event']
+      this.$api.getParamsCommon(params).then(res => {
+        if (res.code == 200) {
+          this.columnList = res.data[0].conditionDTOList
+          this.groupingOption=res.data[0].conditionDTOList.filter(item => {
+            return item.ifGroup == true
+          })
+        //   {
+        //   label: '事件名称',
+        //   value: 'name',
+        //   type: 3,
+        //   placeholder: '请输入事件名称',
+        //   options: [{value: 1,label:2}],
+        // },
+          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
@@ -256,50 +188,64 @@ export default {
     },
     //获取检索条件检索
     search(val) {
-      let params={}
+      let params = {}
       val.forEach(item => {
-        params[item.value]=item.searchValue.label
+        if (item.type == 3) {
+          params[item.value]=item.searchValue.map(itemValue => {
+            return itemValue.value
+          })
+        } else {
+          params[item.value]=item.searchValue.label
+        }
       })
       // 返回字符串
-      // let str=this.$commonJS.objectToString(params)
+      this.searchOption.searchQuery=this.$commonJS.objectToString(params)
       // 调用查询接口
-      // this.$api.query(params).then(res => {
-      //   if (res.code == 200) {
-      //     this.queryParams.current=1
-      //     this.getList()
-      //   }
-      // })
+      this.queryParams.current=1
+      this.isGrouping()
     },
    
 
     // 分页
     handleCurrentChange(val) {
       this.queryParams.current = val;
-      this.getList();
+      this.isGrouping()
     },
 
     //查询事件数据
     getList() {
       let params = {
         ...this.queryParams,//分页信息
-        ...this.sort,//排序
         ...this.searchOption,//检索条件
+        orderDTOList:this.sort,//排序
       }
-      // this.$api.query(params).then(res => {
-      //   if (res.code == 200) {
-      //    this.tableData = rea.data
-      //   }
-      // })
+      this.$api.queryEvent(params).then(res => {
+        if (res.code == 200) {
+          this.tableData = res.data.data
+          this.total=res.data.total
+        }
+      })
     },
 
     //切换分组值
     changeGrouping(val) {
-
-      this.getGrouping()
+      if (val!='') {
+        this.viewSelected='mergeTable'
+      } else {
+        this.viewSelected='Table'
+      }
+      this.queryParams.current = 1
+      this.groupingValue=val
+      this.isGrouping()
     },
     // 调用分组查询的方法
     getGrouping() {
-      this.queryParams.current = 1
+      let params = {
+        ...this.queryParams,//分页信息
+        ...this.searchOption,//检索信息
+        orderDTOList:this.sort,//排序
+        grouping:this.groupingValue,//分组信息
+      }
       // this.$api.query(params).then(res => {
       //   if (res.code == 200) {
       //    this.tableData = rea.data
@@ -310,7 +256,7 @@ export default {
     //切换视图
     onChange2(type) {
       this.viewSelected = type
-      this.getList()
+      // this.getList()
     },
 
     //新增事件的选项(1是添加单个事件,2是批量添加)
@@ -318,11 +264,32 @@ export default {
       this.$refs.addEvent.open(null, e)
     },
 
-    //获取排序字段
-    handleSort(val) {
-
+    //获取排序字段// 子组件table排序
+    handleSort({ column, prop, order ,str}) {
+      let params = {
+        orderBy:prop,
+      }
+      if (order == 'ascending') {
+        params.orderType = 0
+      } else {
+        params.orderType=1
+      }
+      this.sort.push(params)
+      if (str == '展开行排序') {
+        this.getGrouping()
+      } else {//table排序
+        this.getList()
+      }
+      // this.queryParams.current = 1
+    },
+    // 区分是否为分组
+    isGrouping() {
+      if (this.groupingValue != '') {//分组
+        this.getGrouping()
+      } else {//不分组
+        this.getList()
+      }
     },
-
     //表格操作列(option为操作类型,row为当前行数据,type为报告类型,单件事件弹窗为1)
     handleOption({ option, row, type }) {
       switch (option) {
@@ -331,7 +298,7 @@ export default {
         case 'addReport'://新增报告
           break;
         case '10'://删除
-          this.eventDelete()
+          this.eventDelete(row)
           break;
         case 'cancel'://取消关联
           break;
@@ -341,23 +308,24 @@ export default {
       }
     },
     // 删除事件
-    eventDelete() {
+    eventDelete(row) {
       this.$confirm('此操作将删除该事件, 是否继续?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
         // 调用接口
-        this.$message({
-          type: 'success',
-          message: '删除成功!'
-        });
-        this.getList()
+        let params = [
+          row.id
+        ]
+        this.$api.deleteEvent(params).then(res => {
+          if (res.code == 200) {
+            this.getList()
+            this.$message.success('删除成功!');
+          }
+        })
       }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消删除'
-        });
+        this.$message.info('已取消删除');
       });
     },
   },

+ 12 - 0
src/views/event/components/mixins/index.js

@@ -55,6 +55,18 @@ export default {
     },
   },
   methods: {
+    // 点击名称等事件
+    handleItem(row, key) {
+      // console.log(row,key);
+      let path = {}
+      let router=this.$router.resolve({
+        path: '',
+        query: {
+          row:JSON.stringify(row)
+        },
+      })
+      window.open(router.href,'_blank')
+    },
     // 取消与专题库的关联
     handleDelete(row) {
       this.$emit('option', { option: 'cancel', row })

+ 2 - 2
src/views/event/components/view/card.vue

@@ -34,9 +34,9 @@
 
           <p>
             <span style="font-weight:bolder">事件名称:</span>
-            <el-tooltip class="item" effect="light" placement="top" :content="item.questionName">
+            <el-tooltip class="item" effect="light" placement="top" :content="item.name">
               <el-link type="primary"
-                @click="checkVisual(item.scenarioNames, item.id, item.questionName)">{{ item.questionName }}</el-link>
+                @click="checkVisual(item.scenarioNames, item.id, item.name)">{{ item.name }}</el-link>
             </el-tooltip>
           </p>
           <p><span style="font-weight:bolder">相关报告数量:</span> <span>{{ item.reportNum || 0 }}</span> </p>

+ 69 - 53
src/views/event/components/view/mergeTable.vue

@@ -1,12 +1,14 @@
 <template>
   <div>
-    <el-table :data="commonData" header-row-class-name="custom-table-header" @expand-change="expandChange">
+    <el-table :data="commonData" header-row-class-name="custom-table-header" @expand-change="expandChange"  @sort-change="sortChange">
       <el-table-column type="expand">
         <template slot-scope="props">
-          <Table :data="showData[props.row.index]" :column="column" @option="handleOption" />
+          <div style="padding: 10px;">
+            <Table :data="showData[props.row.index]" :column="column" @option="handleOption" />
+          </div>
         </template>
       </el-table-column>
-      <el-table-column v-for="column in columnList" :label="column.label" :prop="column.prop"
+      <el-table-column v-for="column in column" :key="column.value" :label="column.name" :prop="column.value" sortable="custom"
         show-overflow-tooltip></el-table-column>
     </el-table>
   </div>
@@ -17,67 +19,53 @@ import Table from "./table";
 
 export default {
   props: {
-    commonData: Object,
+    commonData: Array,
     column: {//显示栏位管理数组
       type: Array,
       default: () => {
         return [
           {
-            "key": "name",
-            "name": "事件名称",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            ifGroup: false,
+            ifSearch: true,
+            name: "事件名称",
+            type: "String",
+            value: "name",
           },
           {
-            "key": "eventNumber",
-            "name": "相关报告数量",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            name: "创建人",
+            type: "String",
+            value: "createName",
+            ifSearch: true,
+            ifGroup: false
           },
           {
-            "key": "projectNumber",
-            "name": "相关专题库数量",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            name: "创建时间",
+            type: "DateTime",
+            value: "createTime",
+            ifSearch: true,
+            ifGroup: true
           },
           {
-            "key": "projectNumber1",
-            "name": "事件场景",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            name: "发生时间",
+            type: "DateTime",
+            value: "eventDate",
+            ifSearch: true,
+            ifGroup: true
           },
           {
-            "key": "projectNumber2",
-            "name": "事件时间",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            name: "描述",
+            type: "String",
+            value: "description",
+            ifSearch: true,
+            ifGroup: false
           },
           {
-            "key": "projectNumber3",
-            "name": "描述",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "projectNumber4",
-            "name": "创建人",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "time",
-            "name": "创建时间",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
+            name: "应用场景",
+            type: "Integer",
+            value: "scenarioId",
+            ifSearch: true,
+            ifGroup: true
+          }
         ]
       }
     }
@@ -88,23 +76,51 @@ export default {
   },
   data() {
     return {
-      columnList: [],
+      // columnList: [],
       tableData: [],
-      showData: []
+      showData: [],
+      expandList:[],
     }
   },
   watch: {
   },
   mounted() {
+    
   },
   methods: {
+    // 排序
+    sortChange({ column, prop, order }) {
+      let str='展开行排序'
+      this.$emit('on-sort',{ column, prop, order ,str})
+    },
     //操作列事件
     handleOption(data) {
       this.$emit('option', data)
     },
     //打开展开行获取数据并保存起来
-    expandChange() {
-      
+    expandChange({ row, rowList }) {
+      this.$emit()
+      let a=this.expandList.findIndex(item => {
+        return item == row.id
+      })
+      if (a != -1) {
+        if (row.isSave && row.isSave.length>0) {//若有从这里拿出来给到子组件的tableDate
+          
+        } else {
+          // 请求接口,并将返回的数据保存在row.isSave中
+
+        }
+      } else {
+        this.expandList.push(row.id)
+        // 请求查询接口,将数据给到tableData以及row中的isSave中
+        // this.$api.query(params).then(res => {
+        //   if (res.code == 200) {
+        //     row.isSave = res.data
+        //     this.tableData=res.data
+        // 
+        //   }
+        // })
+      }
     }
   }
 }

+ 47 - 64
src/views/event/components/view/table.vue

@@ -7,13 +7,13 @@
         </template>
       </el-table-column>
 
-      <el-table-column v-for="item in column" :key="item.key" :prop="item.key" :label="item.name" align="center" sortable="custom">
+      <el-table-column v-for="item in column" :key="item.value" :prop="item.value" :label="item.name" align="center" sortable="custom">
         <template slot-scope="scope">
-          <div v-if="['questionName', 'eventNumber', 'projectNumber'].includes(item.key)">
-            <el-link @click="handleItem(scope.row, item.key)">{{ scope.row[item.key] }}</el-link>
+          <div v-if="['name', 'reportProjectNum', 'patentProjectNum'].includes(item.value)">
+            <el-link @click="handleItem(scope.row, item.value)">{{ scope.row[item.value] }}</el-link>
           </div>
-          <div v-else-if="['applicationScenarios'].includes(item.key)" v-html="getColumnData(scope.row, item.key)"></div>
-          <div v-else>{{ scope.row[item.key] }}</div>
+          <div v-else-if="['scenarioId'].includes(item.value)" v-html="getColumnData(scope.row, item.value)"></div>
+          <div v-else>{{ scope.row[item.value]?scope.row[item.value]:'--' }}</div>
         </template>
       </el-table-column>
 
@@ -55,61 +55,47 @@ export default {
       default: () => {
         return [
           {
-            "key": "questionName",
-            "name": "事件名称",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            ifGroup: false,
+            ifSearch: true,
+            name: "事件名称",
+            type: "String",
+            value: "name",
           },
           {
-            "key": "eventNumber",
-            "name": "相关报告数量",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            name: "创建人",
+            type: "String",
+            value: "createName",
+            ifSearch: true,
+            ifGroup: false
           },
           {
-            "key": "projectNumber",
-            "name": "相关专题库数量",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            name: "创建时间",
+            type: "DateTime",
+            value: "createTime",
+            ifSearch: true,
+            ifGroup: true
           },
           {
-            "key": "applicationScenarios",
-            "name": "事件场景",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            name: "发生时间",
+            type: "DateTime",
+            value: "eventDate",
+            ifSearch: true,
+            ifGroup: true
           },
           {
-            "key": "eventDate",
-            "name": "事件时间",
-            "type": "list",
-            "order": 0,
-            "hidden": true
+            name: "描述",
+            type: "String",
+            value: "description",
+            ifSearch: true,
+            ifGroup: false
           },
           {
-            "key": "description",
-            "name": "描述",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "createPerson",
-            "name": "创建人",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
-          {
-            "key": "time",
-            "name": "创建时间",
-            "type": "list",
-            "order": 0,
-            "hidden": true
-          },
+            name: "应用场景",
+            type: "Integer",
+            value: "scenarioId",
+            ifSearch: true,
+            ifGroup: true
+          }
         ]
       }
     }
@@ -123,28 +109,25 @@ export default {
 
   },
   mounted() {
-
+  
   },
   methods: {
     // 排序
     sortChange({ column, prop, order }) {
-      this.$emit('sort',{ column, prop, order })
-    },
-    // 点击名称等事件
-    handleItem(row, key) {
-      // console.log(row,key);
+      this.$emit('on-sort',{ column, prop, order })
     },
+   
     // 
     getColumnData(row, key) {
-      if (key == 'applicationScenarios') {
-        if (row[key]) {
-          var a = ''
-          row[key].forEach(item => {
-            a += item.name + '</br>'
-          });
-          return a
+      if (key == 'scenarioId') {
+        if (row.scenarioName) {
+          // var a = ''
+          // row.scenarioName.forEach(item => {
+          //   a += item.name + '</br>'
+          // });
+          return row.scenarioName
         } else {
-          return ''
+          return '--'
         }
       }
     },

+ 1 - 0
src/views/product/components/view/categoryTable.vue

@@ -178,6 +178,7 @@ export default {
     },
     // 展开行打开或者关闭事件
     handleExpand(row, rowList) {
+      console.log(row, rowList);
       this.$emit('expand', { row, rowList })
     },
     // 编辑下拉菜单

+ 14 - 22
vue.config.js

@@ -108,27 +108,19 @@ module.exports = {
       errors: false
     },
     proxy: {
-      // '/pdfjs': {
-      //   target: 'http://192.168.0.57:8879',
-      //   ws: true,
-      //   changeOrigin: true
-      // },
-      // '/file': {
-      //   target: 'http://192.168.0.57:8879',
-      //   ws: true,
-      //   changeOrigin: true
-      // },
-      '/api/v2': {
-        // target: 'http://192.168.0.57:8879',
-        target: 'http://192.168.1.24:8877',
-        // target: 'http://139.224.24.90:8877',
-
+      '/api/xiaoshi': {
+        target: 'http://192.168.1.16:8877',
         ws: true,
         changeOrigin: true
       },
+      // '/api/v2': {
+      //   target: 'http://192.168.1.24:8877',
+      //   ws: true,
+      //   changeOrigin: true
+      // },
       '/permission': {
         // target: 'http://192.168.0.56:8880',
-        target: 'http://192.168.1.24:8871',
+        target: 'http://192.168.1.16:8871',
         // target: 'http://139.224.24.90:8871',
         ws: true,
         changeOrigin: true,
@@ -136,12 +128,12 @@ module.exports = {
           '/api':''
       }
       },
-      '/report':{
-        target:'http://192.168.1.24:8872',
-        // target:'http://139.224.24.90:8872',
-        ws:true,
-        changeOrigin:true
-      },
+      // '/report':{
+      //   target:'http://192.168.1.24:8872',
+      //   // target:'http://139.224.24.90:8872',
+      //   ws:true,
+      //   changeOrigin:true
+      // },
     }
   }
 }