Browse Source

修复框架header部分的一些bug

Joe 3 years ago
parent
commit
d9ca8d3a30

+ 3 - 0
package.json

@@ -39,18 +39,21 @@
     "@riophae/vue-treeselect": "^0.4.0",
     "af-table-column": "^1.0.3",
     "axios": "^0.21.1",
+    "bootstrap": "^4.6.0",
     "clipboard": "2.0.4",
     "core-js": "3.6.5",
     "echarts": "4.2.1",
     "element-ui": "2.13.2",
     "file-saver": "2.0.1",
     "fuse.js": "3.4.4",
+    "jquery": "^3.5.1",
     "js-beautify": "1.10.2",
     "js-cookie": "2.2.0",
     "jsencrypt": "3.0.0-rc.1",
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",
+    "popper.js": "^1.16.1",
     "quill": "1.3.7",
     "screenfull": "4.2.0",
     "sortablejs": "1.8.4",

+ 5 - 1
src/components/Breadcrumb/index.vue

@@ -25,10 +25,14 @@ export default {
         return
       }
       this.getBreadcrumb()
+      setTimeout(() => {
+        console.log(this.levelList);
+      })
     }
   },
   created() {
     this.getBreadcrumb()
+
   },
   methods: {
     getBreadcrumb() {
@@ -37,7 +41,7 @@ export default {
       const first = matched[0]
 
       if (!this.isDashboard(first)) {
-        matched = [{ path: '/dataSource/saleReport', meta: { title: '首页' }}].concat(matched)
+        matched = [{ path: '/', meta: { title: '首页' }}].concat(matched)
       }
 
       this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)

+ 1 - 1
src/components/HeaderSearch/index.vue

@@ -8,7 +8,7 @@
       filterable
       default-first-option
       remote
-      placeholder="Search"
+      placeholder="输入想要查找的菜单"
       class="header-search-select"
       @change="change"
     >

+ 29 - 26
src/components/SizeSelect/index.vue

@@ -4,9 +4,13 @@
       <svg-icon class-name="size-icon" icon-class="size" />
     </div>
     <el-dropdown-menu slot="dropdown">
-      <el-dropdown-item v-for="item of sizeOptions" :key="item.value" :disabled="size===item.value" :command="item.value">
-        {{
-          item.label }}
+      <el-dropdown-item
+        v-for="item of sizeOptions"
+        :key="item.value"
+        :disabled="size === item.value"
+        :command="item.value"
+      >
+        {{ item.label }}
       </el-dropdown-item>
     </el-dropdown-menu>
   </el-dropdown>
@@ -17,41 +21,40 @@ export default {
   data() {
     return {
       sizeOptions: [
-        { label: 'Default', value: 'default' },
-        { label: 'Medium', value: 'medium' },
-        { label: 'Small', value: 'small' },
-        { label: 'Mini', value: 'mini' }
-      ]
-    }
+        { label: "Default", value: "default" },
+        { label: "Medium", value: "medium" },
+        { label: "Small", value: "small" },
+        { label: "Mini", value: "mini" },
+      ],
+    };
   },
   computed: {
     size() {
-      return this.$store.getters.size
-    }
+      return this.$store.getters.size;
+    },
   },
   methods: {
     handleSetSize(size) {
-      this.$ELEMENT.size = size
-      this.$store.dispatch('app/setSize', size)
-      this.refreshView()
+      this.$ELEMENT.size = size;
+      this.$store.dispatch("app/setSize", size);
+      this.refreshView();
       this.$message({
-        message: 'Switch Size Success',
-        type: 'success'
-      })
+        message: "Switch Size Success",
+        type: "success",
+      });
     },
     refreshView() {
       // In order to make the cached page re-rendered
-      this.$store.dispatch('tagsView/delAllCachedViews', this.$route)
+      this.$store.dispatch("tagsView/delAllCachedViews", this.$route);
 
-      const { fullPath } = this.$route
+      const { fullPath } = this.$route;
 
       this.$nextTick(() => {
         this.$router.replace({
-          path: '/redirect' + fullPath
-        })
-      })
-    }
-  }
-
-}
+          path: "/redirect" + fullPath,
+        });
+      });
+    },
+  },
+};
 </script>

+ 2 - 0
src/layout/components/Navbar.vue

@@ -9,9 +9,11 @@
         <select-dept id="select-dept" class="right-menu-item"/>
         <search id="header-search" class="right-menu-item" />
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
+        <!--
         <el-tooltip content="布局大小" effect="dark" placement="bottom">
           <size-select id="size-select" class="right-menu-item hover-effect" />
         </el-tooltip>
+        -->
       </template>
 
       <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">

+ 2 - 0
src/main.js

@@ -15,6 +15,8 @@ import App from './App'
 import store from './store'
 import router from './router'
 import permission from './directive/permission'
+// import 'bootstrap/dist/css/bootstrap.min.css'
+import 'bootstrap/dist/js/bootstrap.min'
 
 import './assets/icons' // icon
 import './permission' // permission control

+ 66 - 42
src/views/label/Label_AddUser.vue

@@ -1,6 +1,29 @@
 <template>
   <div>
-    
+    <div class="alert alert-primary" role="alert">
+      A simple primary alert—check it out!
+    </div>
+    <div class="alert alert-secondary" role="alert">
+      A simple secondary alert—check it out!
+    </div>
+    <div class="alert alert-success" role="alert">
+      A simple success alert—check it out!
+    </div>
+    <div class="alert alert-danger" role="alert">
+      A simple danger alert—check it out!
+    </div>
+    <div class="alert alert-warning" role="alert">
+      A simple warning alert—check it out!
+    </div>
+    <div class="alert alert-info" role="alert">
+      A simple info alert—check it out!
+    </div>
+    <div class="alert alert-light" role="alert">
+      A simple light alert—check it out!
+    </div>
+    <div class="alert alert-dark" role="alert">
+      A simple dark alert—check it out!
+    </div>
   </div>
 </template>
 
@@ -27,21 +50,21 @@ export default {
       timer: null,
       leftData: [],
       rightData: [],
-      leftTotal:100,
-      rightTotal:100,
+      leftTotal: 100,
+      rightTotal: 100,
       leftQuery: {
         pageNum: 1,
         pageSize: 10,
-        labelId:null,
+        labelId: null,
         customerName: null,
-        phone:null
+        phone: null,
       },
       rightQuery: {
         pageNum: 1,
         pageSize: 10,
-        labelId:null,
+        labelId: null,
         customerName: null,
-        phone:null
+        phone: null,
       },
     };
   },
@@ -49,13 +72,13 @@ export default {
     this.init();
   },
   methods: {
-    getLeftData(){
+    getLeftData() {
       // this.leftData = [];
       selectNotCustomerLabelInfo(this.leftQuery)
         .then((res) => {
           if (res.code == 200) {
             this.leftData = res.rows;
-            this.leftTotal = res.total
+            this.leftTotal = res.total;
           } else {
             throw new Error("");
           }
@@ -65,9 +88,8 @@ export default {
           this.leftTotal = 0;
           this.msgError("拉取左边标签用户失败,请刷新~");
         });
-      
     },
-    getRightData(){
+    getRightData() {
       // this.rightData = [];
       selectPhoneList(this.rightQuery)
         .then((res) => {
@@ -83,17 +105,20 @@ export default {
           this.rightTotal = 0;
           this.msgError("拉取右边标签用户失败,请刷新~");
         });
-
     },
-    handleMoveLabel(direction = 'right', type = 1, row, labelIdArr){  // type 1 传row  type 2 idArr    direction right 向右转移 left 向左转移
-       const changeArr = []
-       if(type == 1){
-          changeArr.push(row.phone)
-       }else if(type == 2){
-         changeArr = labelIdArr
-       }
+    handleMoveLabel(direction = "right", type = 1, row, labelIdArr) {
+      // type 1 传row  type 2 idArr    direction right 向右转移 left 向左转移
+      const changeArr = [];
+      if (type == 1) {
+        changeArr.push(row.phone);
+      } else if (type == 2) {
+        changeArr = labelIdArr;
+      }
       const query = {
-        labelId: direction == 'right' ? this.leftQuery.labelId : this.rightQuery.labelId,
+        labelId:
+          direction == "right"
+            ? this.leftQuery.labelId
+            : this.rightQuery.labelId,
         flag: "1",
         phoneList: changeArr,
       };
@@ -102,36 +127,35 @@ export default {
       } else if (direction == "left") {
         query.flag = "1";
       }
-      addAndDelCustomerLabel(query).then((res) => {
-        if (res.code == 200) {
-          this.getLeftData();
-          this.getRightData();
-        } else {
-          throw new Error("");
-        }
-      }).catch((err)=>{
-        
-      });
-
+      addAndDelCustomerLabel(query)
+        .then((res) => {
+          if (res.code == 200) {
+            this.getLeftData();
+            this.getRightData();
+          } else {
+            throw new Error("");
+          }
+        })
+        .catch((err) => {});
     },
-    clearLeftQuery(labelId = this.leftQuery.labelId){
-      this.leftQuery =  {
+    clearLeftQuery(labelId = this.leftQuery.labelId) {
+      this.leftQuery = {
         pageNum: 1,
         pageSize: 10,
         labelId,
         customerName: null,
-        phone:null
-      }
+        phone: null,
+      };
     },
-    clearRightQuery(labelId = this.rightQuery.labelId){
+    clearRightQuery(labelId = this.rightQuery.labelId) {
       console.log(this.rightQuery);
-      this.rightQuery =  {
+      this.rightQuery = {
         pageNum: 1,
         pageSize: 10,
         labelId,
         customerName: null,
-        phone:null
-      }
+        phone: null,
+      };
     },
     handleSelectionChange(val) {
       let changeArr = [];
@@ -173,8 +197,8 @@ export default {
     //       this.msgError("拉取标签下用户信息失败");
     //     });
     // },
-    toggleLabel(){
-      console.log('hahaha');
+    toggleLabel() {
+      console.log("hahaha");
     },
 
     getLabelList() {
@@ -188,7 +212,7 @@ export default {
     },
 
     // transfer(originlArr, direction, changeArr) {
-      
+
     //   const query = {
     //     labelId: this.activeNames,
     //     flag: "1",

+ 7 - 0
vue.config.js

@@ -54,6 +54,13 @@ module.exports = {
       }
     }
   },
+  plugins: [
+    new webpack.ProvidePlugin({
+      $: "jquery",
+      jQuery: "jquery",
+      "windows.jQuery": "jquery"
+    })
+  ],
   chainWebpack(config) {
     config.plugins.delete('preload') // TODO: need test
     config.plugins.delete('prefetch') // TODO: need test