morphone1995 4 年之前
父節點
當前提交
5a7d7a8d3d
共有 1 個文件被更改,包括 9 次插入5 次删除
  1. 9 5
      src/components/cdssManage/plan/Plan.vue

+ 9 - 5
src/components/cdssManage/plan/Plan.vue

@@ -167,6 +167,7 @@ export default {
     // 获取列表数据
     async getDataList(isTurnPage) {
       let params = await this.getFilterItems(isTurnPage);
+      // return;
       this.searched = true;
       const loading = this.$loading({
         lock: true,
@@ -193,19 +194,22 @@ export default {
       if (isTurnPage && !this.searched) {
         this.clearFilter();
       }
-      // let res = await api.getHospitalInfo();
-      // if (res.data.code === '0') {
-      //   this.hospitalId = res.data.data.id;
-      // }
+      let planName = this.filter.planName.trim();
+      // var patrn = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/im;
+      // console.log(this.escapeRegExp(planName));
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        planName: this.filter.planName.trim(),
+        planName: this.escapeRegExp(planName),
         hospitalId: this.filter.hospitalId
       };
       return param;
     },
 
+    escapeRegExp(text) {
+      return text.replace(/[-[\]{}()*+?._,\\^$|#\s]/g, '\\$&');
+    },
+
     filterDatas() {
       this.currentPage = 1;
       this.getDataList();