lishanzheng1 4 年之前
父節點
當前提交
6476aabceb

+ 71 - 0
mock/data/orderlist.json

@@ -0,0 +1,71 @@
+{
+    "code": 0,
+    "message": "登录成功",
+    "data": {
+        "tableData":[ 
+              {
+                "id": "1",
+                "date": "2016-05-02",
+                "name": "战术大师",
+                "address": "上海市普陀区金沙江路 1518ssds 弄"
+              },
+              {
+                "id": "2",
+                "date": "2016-05-04",
+                "name": "利欧韵",
+                "address": "上海市普陀区金沙江路 1517 弄"
+              },
+              {
+                "id": "3",
+                "date": "2016-05-01",
+                "name": "萨达十大是",
+                "address": "上海市普陀区金沙江路 1519 弄"
+              },
+              {
+                "id": "4",
+                "date": "2016-05-03",
+                "name": "王小虎",
+                "address": "上海市普陀区金沙江路 1516 弄"
+              },
+              {
+                "id": "3",
+                "date": "2016-05-01",
+                "name": "萨达十大是",
+                "address": "上海市普陀区金沙江路 1519 弄"
+              },
+              {
+                "id": "3",
+                "date": "2016-05-01",
+                "name": "萨达十大是",
+                "address": "上海市普陀区金沙江路 1519 弄"
+              },
+              {
+                "id": "3",
+                "date": "2016-05-01",
+                "name": "萨达十大是",
+                "address": "上海市普陀区金沙江路 1519 弄"
+              },
+              {
+                "id": "3",
+                "date": "2016-05-01",
+                "name": "萨达十大是",
+                "address": "上海市普陀区金沙江路 1519 弄"
+              },
+              {
+                "id": "3",
+                "date": "2016-05-01",
+                "name": "萨达十大是",
+                "address": "上海市普陀区金沙江路 1519 弄"
+              },
+
+              {
+                
+                "id": "3",
+                "date": "2016-05-01",
+                "name": "萨达十大是",
+                "address": "上海市普陀区金沙江路 1519 弄"
+              }
+            
+            ]
+    }
+}

+ 26 - 0
mock/data/user.json

@@ -0,0 +1,26 @@
+{
+  "code": 0,
+  "message": "登录成功",
+  "data": {
+    "tableData": [
+      {
+        "id": "1",
+        "name": "admin",
+        "phone": "1504444444",
+        "address": "上海市普陀区金沙江路 1518ssds 弄"
+      },
+      {
+        "id": "2",
+        "name": "svip",
+        "phone": "1554545",
+        "address": "上海市普陀区金沙江路 455455445 弄"
+      },
+      {
+        "id": "3",
+        "name": "vip",
+        "phone": "58484848",
+        "address": "上海市普陀区金沙江路 1517 弄"
+      }
+    ]
+  }
+}

+ 15 - 1
mock/index.js

@@ -4,7 +4,8 @@ const vipLogin = require("./data/vip_login.json");
 const adminLogin = require("./data/admin_login.json");
 const adminPermission = require("./data/admin_permission.json");
 const vipPermission = require("./data/vip_permission.json");
-
+const orderlist = require("./data/orderlist.json");
+const user = require("./data/user.json");
 var bodyParser = require('body-parser')
 
 app.use(bodyParser.urlencoded({ extended: false }))
@@ -29,6 +30,19 @@ app.get("/permission", (req, res) => {
     }
 })
 
+app.get("/orderlist", (req, res) => {
+    let params = req.query;
+    console.log(params);
+    res.send(orderlist)
+})
+
+app.get("/userlist", (req, res) => {
+    let params = req.query;
+    console.log(params);
+    res.send(user)
+})
+
+
 
 app.listen(5000, () => {
     console.log('服务器运行在5000');

+ 66 - 0
package-lock.json

@@ -4673,6 +4673,12 @@
       "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
       "dev": true
     },
+    "fast-diff": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npm.taobao.org/fast-diff/download/fast-diff-1.1.2.tgz",
+      "integrity": "sha1-S2LEK44D3j+EhGC2OQeZIGldAVQ=",
+      "dev": true
+    },
     "fast-glob": {
       "version": "2.2.7",
       "resolved": "https://registry.npm.taobao.org/fast-glob/download/fast-glob-2.2.7.tgz?cache=0&sync_timestamp=1575197599350&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-glob%2Fdownload%2Ffast-glob-2.2.7.tgz",
@@ -7687,6 +7693,11 @@
         "set-blocking": "~2.0.0"
       }
     },
+    "nprogress": {
+      "version": "0.2.0",
+      "resolved": "https://registry.nlark.com/nprogress/download/nprogress-0.2.0.tgz",
+      "integrity": "sha1-y480xTIT2JVyP8urkH6UIq28r7E="
+    },
     "nth-check": {
       "version": "1.0.2",
       "resolved": "http://registry.npm.taobao.org/nth-check/download/nth-check-1.0.2.tgz",
@@ -8043,6 +8054,12 @@
         "no-case": "^2.2.0"
       }
     },
+    "parchment": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npm.taobao.org/parchment/download/parchment-1.1.4.tgz",
+      "integrity": "sha1-rt7Xq5OP6SHUw0vDOc4RaLwv/eU=",
+      "dev": true
+    },
     "parse-asn1": {
       "version": "5.1.5",
       "resolved": "https://registry.npm.taobao.org/parse-asn1/download/parse-asn1-5.1.5.tgz",
@@ -8902,6 +8919,45 @@
       "integrity": "sha1-YOWl/WSn+L+k0qsu1v30yFutFU4=",
       "dev": true
     },
+    "quill": {
+      "version": "1.3.7",
+      "resolved": "https://registry.npm.taobao.org/quill/download/quill-1.3.7.tgz",
+      "integrity": "sha1-2lsvOixHDpMjQM2/NmjJ8h+Shug=",
+      "dev": true,
+      "requires": {
+        "clone": "^2.1.1",
+        "deep-equal": "^1.0.1",
+        "eventemitter3": "^2.0.3",
+        "extend": "^3.0.2",
+        "parchment": "^1.1.4",
+        "quill-delta": "^3.6.2"
+      },
+      "dependencies": {
+        "clone": {
+          "version": "2.1.2",
+          "resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz",
+          "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
+          "dev": true
+        },
+        "eventemitter3": {
+          "version": "2.0.3",
+          "resolved": "https://registry.npm.taobao.org/eventemitter3/download/eventemitter3-2.0.3.tgz",
+          "integrity": "sha1-teEHm1n7XhuidxwKmTvgYKWMmbo=",
+          "dev": true
+        }
+      }
+    },
+    "quill-delta": {
+      "version": "3.6.3",
+      "resolved": "https://registry.npm.taobao.org/quill-delta/download/quill-delta-3.6.3.tgz",
+      "integrity": "sha1-sZ/SuJQSMBxg4f8hPY2GDqwPEDI=",
+      "dev": true,
+      "requires": {
+        "deep-equal": "^1.0.1",
+        "extend": "^3.0.2",
+        "fast-diff": "1.1.2"
+      }
+    },
     "randombytes": {
       "version": "2.1.0",
       "resolved": "http://registry.npm.taobao.org/randombytes/download/randombytes-2.1.0.tgz",
@@ -11197,6 +11253,16 @@
         "vue-style-loader": "^4.1.0"
       }
     },
+    "vue-quill-editor": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npm.taobao.org/vue-quill-editor/download/vue-quill-editor-3.0.6.tgz",
+      "integrity": "sha1-H4VkYhHWijGoCnLLf0W7LxGbyPs=",
+      "dev": true,
+      "requires": {
+        "object-assign": "^4.1.1",
+        "quill": "^1.3.4"
+      }
+    },
     "vue-router": {
       "version": "3.1.3",
       "resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.1.3.tgz",

+ 2 - 0
package.json

@@ -14,6 +14,7 @@
     "caniuse-lite": "^1.0.30001208",
     "core-js": "^3.4.3",
     "element-ui": "^2.4.5",
+    "nprogress": "^0.2.0",
     "register-service-worker": "^1.6.2",
     "vue": "^2.6.10",
     "vue-fragment": "^1.5.2",
@@ -30,6 +31,7 @@
     "sass": "^1.23.7",
     "sass-loader": "^8.0.0",
     "vue-cli-plugin-element": "^1.0.1",
+    "vue-quill-editor": "^3.0.6",
     "vue-template-compiler": "^2.6.10"
   }
 }

+ 7 - 4
src/apirequest/http.js

@@ -36,7 +36,7 @@ axios.interceptors.request.use(
 
 axios.interceptors.response.use(
     response => {
-
+    
         if (response.status === 200) {
             return Promise.resolve(response);
         } else {
@@ -44,6 +44,7 @@ axios.interceptors.response.use(
         }
     },
     error => {
+        console.log(error);
         if (error.response.status) {
             switch (error.response.status) {
                 case 401:
@@ -63,9 +64,10 @@ axios.interceptors.response.use(
 
                 default:
                     Message({
-                        message: error.response.data.message,
+                        message: "连接服务器失败",
                         duration: 1500,
-                        forbidClick: true
+                        forbidClick: true,
+                        type: 'error'
                     });
             }
             return Promise.reject(error.response);
@@ -101,5 +103,6 @@ export default {
                     reject(err.data)
                 })
         });
-    }
+    },
+   
 }

+ 4 - 4
src/apirequest/index.js

@@ -1,8 +1,8 @@
 import article from '@/apirequest/article';
 import basic from '@/apirequest/basic';
-
-export default {    
+import order from '@/apirequest/order';
+export default {
     article,
-    basic
-
+    basic,
+    order
 }

+ 11 - 0
src/apirequest/order/index.js

@@ -0,0 +1,11 @@
+import axios from '@/apirequest/http';
+
+const order = {
+
+    //查询卸扣
+    orderList( params) {
+        return axios.get(`/orderlist`, params);
+    },
+}
+
+export default order;

二進制
src/assets/loading.png


+ 294 - 0
src/components/components-pub/PubAll.vue

@@ -0,0 +1,294 @@
+<template>
+  <div>
+    <my-form
+      v-if="formList.length > 0"
+      :formValue="formValue"
+      :formList="formList"
+      :inline="true"
+    >
+      <template slot-scope="scope" slot="handle">
+        <el-button type="primary" @click="search(scope.formData)"
+          >搜索</el-button
+        >
+        <el-button type="primary" @click="add()">添加</el-button>
+        <el-button v-if="exportFlag" type="primary" @click="excl()"
+          >导出</el-button
+        >
+      </template>
+    </my-form>
+    <my-table
+      v-loading="isLoading"
+      element-loading-text="拼命加载中"
+      element-loading-spinner="el-icon-loading"
+      :api="api"
+      :tableData="tableData"
+      :tableConfigArr="tableConfigArr"
+      :hasIndex="hasIndex"
+      @handlerSelectChange="handlerSelectChange"
+      @handlerSelect="handlerSelect"
+      @handlerSelectAll="handlerSelectAll"
+    >
+      <!-- <template
+        v-for="items in tableConfigArr"
+        v-if="items.slot"
+        slot-scope="scope"
+      >
+        <div v-if="items.slot == 'operate'" slot="operate">
+          <slot name="operate" :row="scope.row"></slot>
+        </div>
+      </template> -->
+
+      <template slot-scope="scope" slot="operate">
+        <!-- <el-button type="primary" size="small" @click="edit(scope.row)"
+          >修改</el-button
+        >
+        <el-button type="primary" size="small" @click="deleteUser(scope.row)"
+          >删除</el-button
+        > -->
+        <slot name="operate" :row="scope.row"></slot>
+      </template>
+      <template slot-scope="scope" slot="usrname">
+        <el-tag size="medium">{{ scope.row.name }}</el-tag>
+      </template>
+    </my-table>
+    <slot></slot>
+    <div class="end">
+      <el-pagination
+        background
+        :pager-count="5"
+        layout="total,sizes,prev,pager,next,jumper"
+        :total="50"
+        :currentPage="currentPage"
+        :page-sizes="[5, 10, 20, 50]"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      >
+      </el-pagination>
+    </div>
+
+    <my-pop
+      class="pop_box"
+      :title="title"
+      :dialogFormVisible="dialogFormVisible"
+      @handleClose="handleClose"
+    >
+      <my-form :formValue="formValue1" :formList="formList1" class="form_box">
+      </my-form>
+      <div class="dialog-footer">
+        <slot name="footer">
+          <el-button @click="dialogFormVisible = false">取 消</el-button>
+          <el-button @click="confirm(formValue1)" type="primary"
+            >确定</el-button
+          >
+        </slot>
+      </div>
+    </my-pop>
+  </div>
+</template>
+
+<script>
+import apiSend from "../../apirequest/http.js";
+export default {
+  name: "order-list",
+  props: {
+    // 搜索的字段
+    formValue: {
+      type: Object,
+      default: function () {
+        return {};
+      },
+    },
+    // 搜索的配置
+    formList: {
+      type: Array,
+      default: function () {
+        return [];
+      },
+    },
+    // 搜索的配置
+    exportFlag: {
+      type: Boolean,
+      default: function () {
+        return false;
+      },
+    },
+    // 配置table
+    tableConfigArr: {
+      type: Array,
+      default: function () {
+        return [];
+      },
+    },
+    // 控制table序号
+    hasIndex: {
+      type: Boolean,
+      default: function () {
+        return false;
+      },
+    },
+    api: {
+      type: String,
+      default: function () {
+        return "";
+      },
+    },
+  },
+
+  data() {
+    return {
+      tableData: [],
+      isLoading: false,
+      dialogFormVisible: false,
+      title: "编辑",
+      currentPage: 1,
+      // 修改用
+      formValue1: {
+        name: "",
+        address: "",
+        date: "",
+      },
+      formList1: [
+        {
+          type: "input",
+          prop: "name",
+          label: "姓名:",
+        },
+        {
+          type: "input",
+          prop: "address",
+          label: "地址:",
+        },
+        {
+          type: "input",
+          prop: "date",
+          label: "时间:",
+        },
+        {
+          type: "richText",
+          prop: "richText",
+          label: "正文:",
+        },
+      ],
+      formInline: {
+        user: "",
+        region: "",
+      },
+    };
+  },
+
+  methods: {
+    handlerSelectChange(data) {
+      console.log(data, "handlerSelectChange");
+    },
+
+    handlerSelect(data) {
+      console.log(data, "handlerSelect");
+    },
+    handlerSelectAll(data) {
+      this.allSelect = data;
+    },
+
+    search(data) {
+      console.log(data, "搜索的数据");
+    },
+    edit(data) {
+      console.log(data, "改");
+      this.title = "编辑";
+      this.formValue1 = { ...this.formValue1, ...data };
+      this.dialogFormVisible = !this.dialogFormVisible;
+    },
+    add() {
+      this.title = "添加";
+      this.formValue1 = {
+        name: "",
+        address: "",
+        date: "",
+      };
+      this.dialogFormVisible = !this.dialogFormVisible;
+    },
+    deleteUser(data) {
+      let index = this.tableData.findIndex((item) => {
+        return item.id == data.id;
+      });
+      this.tableData.splice(index, 1);
+    },
+    confirm(data) {
+      console.log(data, "11111");
+      this.dialogFormVisible = !this.dialogFormVisible;
+      if (data.id) {
+        let index = this.tableData.findIndex((item) => {
+          return item.id == data.id;
+        });
+        console.log(index);
+        this.tableData.forEach((item) => {
+          this.$set(this.tableData, index, this.formValue1);
+        });
+
+        console.log(this.tableData, "变化了么");
+      } else {
+        let datas = {
+          ...data,
+          ...{ id: (this.tableData.length + 1).toString },
+        };
+        this.tableData.push(datas);
+      }
+    },
+
+    handleClose() {
+      this.dialogFormVisible = false;
+    },
+
+    handleSizeChange() {},
+    handleCurrentChange() {},
+    excl() {
+      this.list();
+    },
+    async list() {
+      this.isLoading = true;
+
+      let result = await apiSend.get(this.api);
+      if (result && result.code == 0) {
+        this.tableData = result.data.tableData;
+        this.isLoading = false;
+      }
+    },
+  },
+
+  created() {
+    this.list();
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog-footer {
+  display: flex;
+  justify-content: flex-end;
+}
+
+::v-deep .pop_box .el-form-item__content {
+  display: flex;
+}
+
+.end {
+  display: flex;
+  justify-content: flex-end;
+  margin-top: 1%;
+}
+
+::v-deep .el-loading-spinner .el-loading-text {
+  color: #e9021d;
+  margin: 3px 0;
+  font-size: 14px;
+}
+::v-deep .el-icon-loading {
+  background: url(../../assets/loading.png) center no-repeat;
+  background-size: cover;
+  width: 25px;
+  height: 25px;
+}
+::v-deep .el-icon-loading:before {
+  content: "替";
+  visibility: hidden;
+}
+</style>

+ 28 - 4
src/components/dynamic-menu.vue

@@ -1,24 +1,30 @@
 <template>
   <fragment>
     <template v-for="v in menuList">
+      <!--  :index="v.path" -->
       <el-submenu
-        :index="v.path"
+        :index="parent ? parent + '/' + v.path : v.path"
         v-if="v.children && v.children.length > 0"
         :key="v.name"
+        class="child-item"
       >
         <template slot="title">
           <i :class="v.meta.icon"></i>
           <span>{{ v.meta.name }}</span>
         </template>
         <el-menu-item-group>
-          <my-nav :menuList="v.children"></my-nav>
+          <my-nav
+            :menuList="v.children"
+            :parent="parent ? parent + '/' + v.path : v.path"
+          ></my-nav>
         </el-menu-item-group>
       </el-submenu>
+      <!--  :index="v.path" -->
       <el-menu-item
+        v-else
         :key="v.name"
-        :index="v.path"
+        :index="parent ? parent + '/' + v.path : v.path"
         @click="gotoRoute(v.name, v.path)"
-        v-else
       >
         <i :class="v.meta.icon"></i>
         <span slot="title">{{ v.meta.name }}</span>
@@ -39,6 +45,10 @@ export default {
         return [];
       },
     },
+    parent: {
+      type: String,
+      default: "",
+    },
   },
   methods: {
     gotoRoute(name, path) {
@@ -50,4 +60,18 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.child-item {
+  .el-menu-item {
+    background-color: #1f2d3d !important;
+  }
+  .el-menu-item:hover {
+    background-color: #001528 !important;
+  }
+  .el-submenu__title {
+    background-color: #1f2d3d !important;
+  }
+  .el-submenu__title:hover {
+    background-color: #001528 !important;
+  }
+}
 </style>

+ 2 - 1
src/components/index.js

@@ -9,4 +9,5 @@ Vue.component('MyForm', () => import('@c/myform/MyForm.vue'))
 Vue.component('DynamicMenu', () => import('@c/dynamicmenu/DynamicMenu.vue'))
 Vue.component('MyTable', () => import('@c/mytable/MyTable.vue'))
 Vue.component('MyPop', () => import('@c/mypop/MyPop.vue'))
-Vue.component('MyBread', () => import('@c/mybread/MyBread.vue'))
+Vue.component('MyBread', () => import('@c/mybread/MyBread.vue'))
+Vue.component('PubAll', () => import('@c/components-pub/PubAll.vue'))

+ 14 - 21
src/components/myform/MyForm.vue

@@ -9,12 +9,9 @@
       :inline="inline"
     >
       <template v-for="item in formList">
-        <el-form-item
-          v-if="item.type === 'input'"
-          :label="item.label"
-          :prop="item.prop"
-        >
+        <el-form-item :label="item.label" :prop="item.prop">
           <el-input
+            v-if="item.type === 'input'"
             v-model.trim="formValue[item.prop]"
             :style="{ width: `${item.width}` }"
             :placeholder="item.placeholder"
@@ -22,14 +19,8 @@
             :show-password="item.style == 'password' ? true : false"
             clearable
           ></el-input>
-        </el-form-item>
-
-        <el-form-item
-          v-if="item.type === 'select'"
-          :label="item.label"
-          :prop="item.prop"
-        >
           <el-select
+            v-if="item.type === 'select'"
             v-model="formValue[item.prop]"
             :placeholder="item.placeholder"
           >
@@ -40,15 +31,13 @@
               :value="item1.value"
             ></el-option>
           </el-select>
-        </el-form-item>
-
-        <el-form-item
-          v-if="item.type === 'text'"
-          :label="item.label"
-          :prop="item.prop"
-        >
-          <span>{{ item.value }}</span>
-          <span>{{ item.value }}</span>
+          <span v-if="item.type === 'text'">{{ item.value }}</span>
+          <quill-editor
+            v-if="item.type === 'richText'"
+            id="quill-editor"
+            v-model="formValue[item.prop]"
+          >
+          </quill-editor>
         </el-form-item>
       </template>
       <slot name="handle" :formData="formValue">
@@ -131,4 +120,8 @@ export default {
 // .form-box {
 //   margin-top: 30px;
 // }
+
+.form-box ::v-deep .ql-container {
+  height: auto;
+}
 </style>

+ 1 - 3
src/components/mypop/MyPop.vue

@@ -16,9 +16,7 @@ export default {
   props: {
     title: {
       type: String,
-      default: function () {
-        return "aa";
-      },
+      default: "aaaa",
     },
 
     dialogFormVisible: {

+ 2 - 2
src/components/mytable/MyTable.vue

@@ -3,9 +3,9 @@
     <el-table
       :data="tableData"
       border
+    
       style="width: 100%"
       highlight-current-row
-      element-loading-text="数据加载中..."
       @selection-change="handlerSelectChange"
       @select="handlerSelect"
       @select-all="handlerSelectAll"
@@ -87,7 +87,6 @@ export default {
     return {
       title: "变少",
       dialogFormVisible: false,
-      
     };
   },
   computed: {
@@ -136,4 +135,5 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+
 </style>

+ 11 - 1
src/main.js

@@ -7,7 +7,17 @@ import './plugins/element.js'
 import "./router/permission"
 import "./assets/css/index.scss"
 import './components/index.js'
-
+//公共混入
+import '@/mixins'
+// 导入富文本编辑器
+import VueQuillEditor from 'vue-quill-editor'
+// 导入富文本编辑器样式
+import 'quill/dist/quill.core.css'
+import 'quill/dist/quill.snow.css'
+import 'quill/dist/quill.bubble.css'
+import Quill from 'quill'
+// 将富文本编辑器,注册为全局可用组件
+Vue.use(VueQuillEditor)
 import api from '@/apirequest/index.js'
 Vue.prototype.$api = api;
 

+ 60 - 0
src/mixins/basic/index.js

@@ -0,0 +1,60 @@
+export default {
+    data() {
+        return {
+            minixName: 'minixObj',
+            flag: false,
+            obj: {
+                class: 'classtest',
+                id: 'idtest'
+            },
+            // tableData: [],
+        }
+    },
+    mounted() {
+        
+    },
+    created() {
+       
+        // this.tableData = [
+        //     {
+        //         id: "1",
+        //         date: "2016-05-02",
+        //         name: "王小虎",
+        //         address: "上海市普陀区金沙江路 1518ssds 弄",
+        //     },
+        //     {
+        //         id: "2",
+        //         date: "2016-05-04",
+        //         name: "利欧韵",
+        //         address: "上海市普陀区金沙江路 1517 弄",
+        //     },
+        //     {
+        //         id: "3",
+        //         date: "2016-05-01",
+        //         name: "王小虎",
+        //         address: "上海市普陀区金沙江路 1519 弄",
+        //     },
+        //     {
+        //         id: "4",
+        //         date: "2016-05-03",
+        //         name: "王小虎",
+        //         address: "上海市普陀区金沙江路 1516 弄",
+        //     },
+        //     {
+        //         id: "5",
+        //         date: "2020-12-12",
+        //         name: "萨达十大",
+        //         address: "上海市普陀区金沙江路 1516 弄",
+        //     },
+        // ];
+    },
+
+    methods: {
+        speak() {
+            console.log('this is minix');
+        },
+        getData() {
+            return '100';
+        }
+    }
+}

+ 5 - 61
src/mixins/index.js

@@ -1,61 +1,5 @@
-export default {
-    data() {
-        return {
-            name: 'minix',
-            minixName: 'minixObj',
-            flag: false,
-            obj: {
-                class: 'classtest',
-                id: 'idtest'
-            },
-            tableData: [],
-        }
-    },
-    mounted() {
-        console.log('minixMounted');
-    },
-    created() {
-        console.log('minixcreated');
-        this.tableData = [
-            {
-                id: "1",
-                date: "2016-05-02",
-                name: "王小虎",
-                address: "上海市普陀区金沙江路 1518ssds 弄",
-            },
-            {
-                id: "2",
-                date: "2016-05-04",
-                name: "利欧韵",
-                address: "上海市普陀区金沙江路 1517 弄",
-            },
-            {
-                id: "3",
-                date: "2016-05-01",
-                name: "王小虎",
-                address: "上海市普陀区金沙江路 1519 弄",
-            },
-            {
-                id: "4",
-                date: "2016-05-03",
-                name: "王小虎",
-                address: "上海市普陀区金沙江路 1516 弄",
-            },
-            {
-                id: "5",
-                date: "2020-12-12",
-                name: "萨达十大",
-                address: "上海市普陀区金沙江路 1516 弄",
-            },
-        ];
-    },
-
-    methods: {
-        speak() {
-            console.log('this is minix');
-        },
-        getData() {
-            return '100';
-        }
-    }
-}
+import basic from './basic'
+import list from './list'
+import Vue from 'vue'
+Vue.mixin(basic)
+Vue.mixin(list)

+ 24 - 0
src/mixins/list/index.js

@@ -0,0 +1,24 @@
+import apiSend from "../../apirequest/http.js";
+export default {
+    data() {
+        return {
+
+        }
+    },
+
+    created() {
+
+    },
+
+    methods: {
+        async getTableList() {
+            console.log("我嗲偶偶");
+            this.isLoading = true;
+            let result = await apiSend.get("/orderlist");
+            if (result && result.code == 0) {
+                this.tableData = result.data.tableData;
+                this.isLoading = false;
+            }
+        },
+    }
+}

+ 7 - 7
src/pages/finance-manage/component/return-goods/index.vue

@@ -1,13 +1,13 @@
 <template>
-    <div>
-       退货管理
-    </div>
+  <div>
+    <pub-all></pub-all>
+  </div>
 </template>
 
 <script>
 export default {
-    data() {
-        return {}
-    }
-}
+  data() {
+    return {};
+  },
+};
 </script>

+ 7 - 9
src/pages/layout/component/main-content/top-aside.vue

@@ -59,7 +59,7 @@
 import { mapState, mapMutations } from "vuex";
 
 export default {
-  name:'top-aside',
+  name: "top-aside",
   data() {
     return {};
   },
@@ -89,14 +89,12 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.box {
-  margin-bottom: 2%;
-  .shu {
-    display: inline-block;
-    margin: 0 5%;
-    border-left: 1px solid black;
-    height: 20px;
-  }
+.shu {
+  display: inline-block;
+  margin: 0 5%;
+  border-left: 1px solid black;
+  height: 20px;
+  
 }
 
 .aside__top {

+ 19 - 14
src/pages/layout/component/sidebar-nav.vue

@@ -1,17 +1,19 @@
 <template>
-  <el-menu
-    :collapse="isSidebarNavCollapse"
-    background-color="#304156"
-    text-color="#eee"
-    active-text-color="#4dbcff"
-    :default-active="$route.path"
-    router
-    mode="vertical"
-    class="el-menu-vertical-demo"
-    :show-timeout="400"
-  >
-    <DynamicMenu :menuList="sidebarMenu"></DynamicMenu>
-  </el-menu>
+  <el-scrollbar style="height: 100%">
+    <el-menu
+      :collapse="isSidebarNavCollapse"
+      background-color="#304156"
+      text-color="#eee"
+      active-text-color="#4dbcff"
+      :default-active="$route.path"
+      router
+      mode="vertical"
+      class="el-menu-vertical-demo"
+      :show-timeout="400"
+    >
+      <DynamicMenu :menuList="sidebarMenu"></DynamicMenu>
+    </el-menu>
+  </el-scrollbar>
 </template>
 
 <script>
@@ -19,7 +21,7 @@ import DynamicMenu from "@/components/dynamic-menu";
 import { mapState } from "vuex";
 
 export default {
-  name:'sidebar-nav',
+  name: "sidebar-nav",
   data() {
     return {
       showMenu: true,
@@ -37,6 +39,9 @@ export default {
   components: {
     DynamicMenu,
   },
+  mounted() {
+    console.log(this.sidebarMenu);
+  },
 };
 </script>
 

+ 44 - 29
src/pages/order-manage/order-list/index.vue

@@ -1,6 +1,11 @@
 <template>
   <div>
-    <my-form :formValue="formValue" :formList="formList" :inline="true">
+    <my-form
+      v-if="formValue"
+      :formValue="formValue"
+      :formList="formList"
+      :inline="true"
+    >
       <template slot-scope="scope" slot="handle">
         <el-button type="primary" @click="search(scope.formData)"
           >搜索</el-button
@@ -8,8 +13,10 @@
         <el-button type="primary" @click="add()">添加</el-button>
       </template>
     </my-form>
+    <!--   v-loading="isLoading" -->
     <!--   :hasIndex="hasIndex" -->
     <my-table
+      v-loading="isLoading"
       :tableData="tableData"
       :tableConfigArr="tableConfigArr"
       :hasIndex="hasIndex"
@@ -29,6 +36,19 @@
         <el-tag size="medium">{{ scope.row.name }}</el-tag>
       </template>
     </my-table>
+    <div class="end">
+      <el-pagination
+        background
+        :pager-count="5"
+        layout="total,sizes,prev,pager,next,jumper"
+        :total="50"
+        :currentPage="currentPage"
+        :page-sizes="[5, 10, 20, 50]"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      >
+      </el-pagination>
+    </div>
 
     <my-pop
       class="pop_box"
@@ -47,42 +67,16 @@
         </slot>
       </div>
     </my-pop>
-
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
-    <div>ssss</div>
   </div>
 </template>
 
 <script>
-import mymixins from "@/mixins";
 export default {
   name: "order-list",
-  mixins: [mymixins],
   data() {
     return {
+      tableData: [],
+      isLoading: false,
       dialogFormVisible: false,
       hasIndex: true,
       title: "编辑",
@@ -105,6 +99,8 @@ export default {
         },
       ],
 
+      currentPage: 1,
+
       // 修改用
       formValue1: {
         name: "",
@@ -127,6 +123,11 @@ export default {
           prop: "date",
           label: "时间:",
         },
+        {
+          type: "richText",
+          prop: "richText",
+          label: "正文:",
+        },
       ],
       tableData: [],
       tableConfigArr: [
@@ -178,16 +179,19 @@ export default {
       console.log(data, "搜索的数据");
     },
     edit(data) {
+      this.title = "编辑";
       console.log(data, "改");
       this.formValue1 = { ...this.formValue1, ...data };
       this.dialogFormVisible = !this.dialogFormVisible;
     },
     add() {
+      this.title = "添加";
       this.formValue1 = {
         name: "",
         address: "",
         date: "",
       };
+
       this.dialogFormVisible = !this.dialogFormVisible;
     },
     deleteUser(data) {
@@ -197,6 +201,7 @@ export default {
       this.tableData.splice(index, 1);
     },
     confirm(data) {
+      console.log(data, "11111");
       this.dialogFormVisible = !this.dialogFormVisible;
       if (data.id) {
         let index = this.tableData.findIndex((item) => {
@@ -220,9 +225,13 @@ export default {
     handleClose() {
       this.dialogFormVisible = false;
     },
+
+    handleSizeChange() {},
+    handleCurrentChange() {},
   },
 
   created() {
+    this.getTableList();
     // this.tableData = [
     //   {
     //     id: "1",
@@ -262,4 +271,10 @@ export default {
 ::v-deep .pop_box .el-form-item__content {
   display: flex;
 }
+
+.end {
+  display: flex;
+  justify-content: flex-end;
+  margin-top: 1%;
+}
 </style>

+ 252 - 2
src/pages/order-manage/return-goods/index.vue

@@ -1,12 +1,262 @@
 <template>
-  <div>退货管理</div>
+  <div>
+    <pub-all
+      :formValue="formValue"
+      :formList="formList"
+      :exportFlag="true"
+      :tableConfigArr="tableConfigArr"
+      :hasIndex="true"
+      api="/userlist"
+      ref="puball"
+    >
+      <template slot-scope="scope" slot="operate">
+        <el-button type="primary" size="small" @click="edit(scope.row)"
+          >编辑</el-button
+        >
+        <el-button type="success" size="small" @click="roleMange(scope.row)"
+          >角色管理</el-button
+        >
+        <el-button type="danger" size="small" @click="deleteUser(scope.row)"
+          >删除</el-button
+        >
+      </template>
+
+      <my-pop
+        class="pop_box"
+        :dialogFormVisible="dialogFormVisible"
+        @handleClose="handleClose"
+        :title="title"
+      >
+        <div class="dig_box" v-cloak>
+          <el-tree
+            ref="tree"
+            :data="editjurisdiction"
+            :default-checked-keys="defaultKyes"
+            show-checkbox
+            default-expand-all
+            node-key="id"
+            highlight-current
+            :props="defaultProps"
+            @check="slesCheck"
+          >
+          </el-tree>
+        </div>
+
+        <div class="dialog-footer">
+          <slot name="footer">
+            <el-button @click="dialogFormVisible = false">取 消</el-button>
+            <el-button @click="confirm" type="primary">确定</el-button>
+          </slot>
+        </div>
+      </my-pop>
+    </pub-all>
+  </div>
 </template>
 
 <script>
 export default {
   name: "return-goods",
   data() {
-    return {};
+    return {
+      formValue: {
+        name: "",
+        address: "",
+      },
+      title: "角色管理",
+      user: "",
+      formList: [
+        {
+          type: "input",
+          prop: "name",
+          label: "人数:",
+        },
+        {
+          type: "input",
+          prop: "address",
+          label: "地址:",
+        },
+      ],
+
+      tableConfigArr: [
+        {
+          prop: "name",
+          label: "姓名",
+        },
+        {
+          fixed: false,
+          prop: "phone",
+          label: "电话",
+        },
+        {
+          fixed: false,
+          prop: "address",
+          label: "地址",
+          width: "300",
+        },
+        {
+          slot: "operate",
+          label: "操作",
+        },
+      ],
+      dialogFormVisible: false,
+      //数据
+      editjurisdiction: [
+        {
+          id: 1,
+          fid: 0,
+          name: "首页",
+          path: "/home",
+          auth_value: null,
+          sort: 0,
+        },
+        {
+          id: 30,
+          fid: 0,
+          name: "产品管理",
+          path: "/11",
+          auth_value: null,
+          sort: 0,
+          child: [
+            {
+              id: 41,
+              fid: 30,
+              name: "订单列表",
+              path: "/orderlist",
+              auth_value: null,
+              sort: 0,
+              level: 2,
+            },
+            {
+              id: 42,
+              fid: 30,
+              name: "产品分类",
+              menu_route: "/classify",
+              auth_value: null,
+              sort: 0,
+              level: 2,
+              child: [
+                {
+                  id: 50,
+                  fid: 42,
+                  name: "生产列表",
+                  path: "/productlist",
+                  auth_value: null,
+                  sort: 0,
+                  level: 3,
+                },
+                {
+                  id: 51,
+                  fid: 42,
+                  name: "审核管理",
+                  menu_route: "/review",
+                  auth_value: null,
+                  sort: 0,
+                  level: 3,
+                },
+              ],
+            },
+            {
+              id: 43,
+              fid: 30,
+              name: "退货管理",
+              menu_route: "/returnGoods",
+              auth_value: null,
+              sort: 0,
+              level: 2,
+            },
+          ],
+        },
+
+        {
+          id: 10,
+          fid: 0,
+          name: "产品管理",
+          path: "/11",
+          auth_value: null,
+          sort: 0,
+          child: [
+            {
+              id: 41,
+              fid: 10,
+              name: "产品列表",
+              path: "/goodslist",
+              auth_value: null,
+              sort: 0,
+              level: 2,
+            },
+            {
+              id: 42,
+              fid: 10,
+              name: "产品分类",
+              menu_route: "/classify",
+              auth_value: null,
+              sort: 0,
+              level: 2,
+            },
+          ],
+        },
+        {
+          id: 20,
+          fid: 0,
+          name: "系统管理",
+          path: "/system",
+          auth_value: null,
+          sort: 0,
+        },
+      ],
+      // 默认选中
+      moduleids: [], //这里当点击编辑按钮时带id去请求然后赋值
+      // 规定数组参数  跟后台事先确定好
+      defaultProps: {
+        children: "child",
+        label: "name",
+      },
+      defaultKyes: [],
+    };
+  },
+  methods: {
+    edit(data) {
+      this.$refs.puball.edit(data);
+    },
+    handleClose() {
+      this.dialogFormVisible = !this.dialogFormVisible;
+    },
+    roleMange(data) {
+      //先清空,再查权限
+      // this.$nextTick(() => {
+      //   this.$refs.tree.setCheckedKeys([]);
+      // });
+
+      setTimeout(() => {
+        this.$refs.tree.setCheckedKeys([]);
+      }, 100);
+      this.user = data;
+      this.dialogFormVisible = !this.dialogFormVisible;
+    },
+    slesCheck(data, checked) {
+      //checked.checkedKeys  选中的节点id数组z
+      //checked.halfCheckedKeys 半选中节点id数组
+      this.moduleids = checked.halfCheckedKeys.concat(checked.checkedKeys); //选中节点和半选中节点所有的id
+    },
+    confirm() {
+      if (this.moduleids.length <= 0) {
+        this.$message({
+          showClose: true,
+          message: "请选择权限分配给指定角色!",
+          type: "error",
+        });
+        return;
+      }
+      this.dialogFormVisible = !this.dialogFormVisible;
+      console.log(this.moduleids, "我是选择后的tree");
+      console.log(this.user, "人的信心");
+    },
   },
 };
 </script>
+
+<style lang="scss" scoped>
+.dig_box {
+  margin-bottom: 2%;
+}
+</style>

+ 2 - 12
src/pages/system/index.vue

@@ -5,23 +5,13 @@
 </template>
 
 <script>
-import mymixins from "@/mixins";
 export default {
   name: "system",
-  mixins: [mymixins],
+
   data() {
     return {};
   },
-  methods: {
-    backToHome() {
-      this.$router.push("/");
-    },
-  },
-  computed: {
-    message() {
-      return "sorry,您没有权限";
-    },
-  },
+  methods: {},
 };
 </script>
 <style  lang="scss" scoped>

+ 8 - 8
src/router/dynamic-router.js

@@ -26,7 +26,7 @@ const dynamicRoutes = [
         },
         children: [
             {
-                path: '/orderlist',
+                path: 'orderlist',
                 name: 'order-list',
                 component: OrderList,
                 meta: {
@@ -35,7 +35,7 @@ const dynamicRoutes = [
                 }
             },
             {
-                path: '/product',
+                path: 'product',
                 name: 'product-manage',
                 component: ProductManage,
                 meta: {
@@ -44,7 +44,7 @@ const dynamicRoutes = [
                 },
                 children: [
                     {
-                        path: '/productlist',
+                        path: 'productlist',
                         name: 'product-list',
                         component: ProductionList,
                         meta: {
@@ -53,7 +53,7 @@ const dynamicRoutes = [
                         }
                     },
                     {
-                        path: '/review',
+                        path: 'review',
                         name: 'review-manage',
                         component: ReviewManage,
                         meta: {
@@ -64,7 +64,7 @@ const dynamicRoutes = [
                 ]
             },
             {
-                path: '/returnGoods',
+                path: 'returnGoods',
                 name: 'return-goods',
                 component: ReturnGoods,
                 meta: {
@@ -84,7 +84,7 @@ const dynamicRoutes = [
         },
         children: [
             {
-                path: '/goodslist',
+                path: 'goodslist',
                 name: 'goods-list',
                 component: GoodsList,
                 meta: {
@@ -93,7 +93,7 @@ const dynamicRoutes = [
                 }
             },
             {
-                path: '/classify',
+                path: 'classify',
                 name: 'goods-classify',
                 component: GoodsClassify,
                 meta: {
@@ -109,7 +109,7 @@ const dynamicRoutes = [
         name: 'system',
         meta: {
             name: '系统管理',
-            icon: 'el-icon-location'
+            icon: 'el-icon-setting'
         },
     }
 

+ 1 - 1
src/router/index.js

@@ -47,7 +47,7 @@ export const DynamicRoutes = [
                 meta: {
                     // 匹配规则
                     name: "首页",
-                    icon: "el-icon-location"
+                    icon: "el-icon-s-home"
                 }
             }
         ]

+ 18 - 0
src/router/permission.js

@@ -1,7 +1,20 @@
 import router from "./index"
 import store from "../store/index"
 
+import NProgress from 'nprogress'
+import 'nprogress/nprogress.css'
+NProgress.configure({
+    easing: 'ease',  // 动画方式    
+    speed: 500,  // 递增进度条的速度    
+    showSpinner: false, // 是否显示加载ico    
+    trickleSpeed: 200, // 自动递增间隔    
+    minimum: 0.3 // 初始化时的最小百分比
+})
+
+
 router.beforeEach((to, from, next) => {
+    NProgress.start();
+    NProgress.inc();
     if (!store.state.user.token) {
 
         //未登录  页面是否需要登录
@@ -30,4 +43,9 @@ router.beforeEach((to, from, next) => {
             }
         }
     }
+})
+
+router.afterEach(() => {
+    // 在即将进入新的页面组件前,关闭掉进度条
+    NProgress.done()
 })

+ 12 - 10
src/utils/recursion-router.js

@@ -10,13 +10,13 @@
  * @return {Array} realRoutes 过滤之后的符合条件的路由
  */
 
-export function recursionRouter(userRouter = [],allRouter = []){
+export function recursionRouter(userRouter = [], allRouter = []) {
     var realRoutes = [];
-    allRouter.forEach((v,i) =>{
-        userRouter.forEach((item,index) =>{
-            if(item.name === v.meta.name){
-                if(item.children && item.children.length > 0){
-                    v.children = recursionRouter(item.children,v.children);
+    allRouter.forEach((v, i) => {
+        userRouter.forEach((item, index) => {
+            if (item.name === v.meta.name) {
+                if (item.children && item.children.length > 0) {
+                    v.children = recursionRouter(item.children, v.children);
                 }
                 realRoutes.push(v)
             }
@@ -26,10 +26,12 @@ export function recursionRouter(userRouter = [],allRouter = []){
 }
 
 
-export function setDefaultRoute(routes){
-    routes.forEach((v,i) =>{
-        if(v.children && v.children.length > 0){
-            v.redirect = { name : v.children[0].name}
+export function setDefaultRoute(routes) {
+    routes.forEach((v, i) => {
+        if (v.children && v.children.length > 0) {
+            console.log(v);
+            // v.redirect = { name : v.children[0].name}
+            v.redirect = v.children[0].path
             setDefaultRoute(v.children);
         }
     })