lishanzheng1 3 rokov pred
rodič
commit
3116c8cc97

+ 4 - 0
mock/data/loginOut.json

@@ -0,0 +1,4 @@
+{
+  "code": 0,
+  "message": "退出登录"
+}

+ 5 - 0
mock/index.js

@@ -7,6 +7,8 @@ const vipPermission = require("./data/vip_permission.json");
 const orderlist = require("./data/orderlist.json");
 const orderlist = require("./data/orderlist.json");
 const user = require("./data/user.json");
 const user = require("./data/user.json");
 const sys = require("./data/sys.json");
 const sys = require("./data/sys.json");
+
+const loginOut = require("./data/loginOut.json");
 var bodyParser = require('body-parser')
 var bodyParser = require('body-parser')
 
 
 app.use(bodyParser.urlencoded({ extended: false }))
 app.use(bodyParser.urlencoded({ extended: false }))
@@ -22,6 +24,9 @@ app.post("/login", (req, res) => {
     }
     }
 })
 })
 
 
+app.post("/loginout", (req, res) => {
+    res.send(loginOut)
+})
 app.get("/permission", (req, res) => {
 app.get("/permission", (req, res) => {
     const user = url.parse(req.url, true).query.user;
     const user = url.parse(req.url, true).query.user;
     if (user === 'admin') {
     if (user === 'admin') {

+ 31 - 0
package-lock.json

@@ -4189,6 +4189,22 @@
         "safer-buffer": "^2.1.0"
         "safer-buffer": "^2.1.0"
       }
       }
     },
     },
+    "echarts": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npm.taobao.org/echarts/download/echarts-5.1.0.tgz",
+      "integrity": "sha1-dozFhaoJJWD0jwGy1S3kk67s0rA=",
+      "requires": {
+        "tslib": "2.0.3",
+        "zrender": "5.1.0"
+      },
+      "dependencies": {
+        "tslib": {
+          "version": "2.0.3",
+          "resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.3.tgz",
+          "integrity": "sha1-jgdBrEX8DCJuWKF7/D5kubxsphw="
+        }
+      }
+    },
     "ee-first": {
     "ee-first": {
       "version": "1.1.1",
       "version": "1.1.1",
       "resolved": "http://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz",
       "resolved": "http://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz",
@@ -12040,6 +12056,21 @@
         "camelcase": "^5.0.0",
         "camelcase": "^5.0.0",
         "decamelize": "^1.2.0"
         "decamelize": "^1.2.0"
       }
       }
+    },
+    "zrender": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npm.taobao.org/zrender/download/zrender-5.1.0.tgz",
+      "integrity": "sha1-tqhMOqfMxmQu4FGZAcpMCDXE2F4=",
+      "requires": {
+        "tslib": "2.0.3"
+      },
+      "dependencies": {
+        "tslib": {
+          "version": "2.0.3",
+          "resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.3.tgz",
+          "integrity": "sha1-jgdBrEX8DCJuWKF7/D5kubxsphw="
+        }
+      }
     }
     }
   }
   }
 }
 }

+ 1 - 0
package.json

@@ -13,6 +13,7 @@
     "browserslist": "^4.16.4",
     "browserslist": "^4.16.4",
     "caniuse-lite": "^1.0.30001208",
     "caniuse-lite": "^1.0.30001208",
     "core-js": "^3.4.3",
     "core-js": "^3.4.3",
+    "echarts": "^5.1.0",
     "element-ui": "^2.4.5",
     "element-ui": "^2.4.5",
     "nprogress": "^0.2.0",
     "nprogress": "^0.2.0",
     "register-service-worker": "^1.6.2",
     "register-service-worker": "^1.6.2",

+ 1 - 1
src/apirequest/http.js

@@ -36,7 +36,7 @@ axios.interceptors.request.use(
 
 
 axios.interceptors.response.use(
 axios.interceptors.response.use(
     response => {
     response => {
-    
+        console.log(response);
         if (response.status === 200) {
         if (response.status === 200) {
             return Promise.resolve(response);
             return Promise.resolve(response);
         } else {
         } else {

+ 6 - 3
src/components/components-pub/PubAll.vue

@@ -206,6 +206,7 @@ export default {
     },
     },
     handlerSelectAll(data) {
     handlerSelectAll(data) {
       this.allSelect = data;
       this.allSelect = data;
+      
     },
     },
 
 
     search(data) {
     search(data) {
@@ -240,9 +241,11 @@ export default {
           return item.id == data.id;
           return item.id == data.id;
         });
         });
         console.log(index);
         console.log(index);
-        this.tableData.forEach((item) => {
-          this.$set(this.tableData, index, this.formValue1);
-        });
+        // this.tableData.forEach((item) => {
+          
+        // });
+
+        this.$set(this.tableData, index, this.formValue1);
 
 
         console.log(this.tableData, "变化了么");
         console.log(this.tableData, "变化了么");
       } else {
       } else {

+ 2 - 0
src/components/myform/MyForm.vue

@@ -167,5 +167,7 @@ export default {
 
 
 .form-box ::v-deep .ql-container {
 .form-box ::v-deep .ql-container {
   height: auto;
   height: auto;
+ 
 }
 }
+
 </style>
 </style>

+ 3 - 0
src/main.js

@@ -16,6 +16,9 @@ import 'quill/dist/quill.core.css'
 import 'quill/dist/quill.snow.css'
 import 'quill/dist/quill.snow.css'
 import 'quill/dist/quill.bubble.css'
 import 'quill/dist/quill.bubble.css'
 import Quill from 'quill'
 import Quill from 'quill'
+//引入echarts
+import * as echarts from 'echarts';
+Vue.prototype.$echarts = echarts
 // 将富文本编辑器,注册为全局可用组件
 // 将富文本编辑器,注册为全局可用组件
 Vue.use(VueQuillEditor)
 Vue.use(VueQuillEditor)
 import api from '@/apirequest/index.js'
 import api from '@/apirequest/index.js'

+ 10 - 38
src/pages/goods-manage/goods-list/index.vue

@@ -10,6 +10,7 @@
       :rules="rules"
       :rules="rules"
       labelPosition="left"
       labelPosition="left"
       labelWidth="100px"
       labelWidth="100px"
+      class="my_form"
     >
     >
     </my-form>
     </my-form>
   </div>
   </div>
@@ -26,6 +27,7 @@ export default {
         grade: "",
         grade: "",
         status: "",
         status: "",
         status2: [],
         status2: [],
+        rich: "",
       },
       },
       formList: [
       formList: [
         {
         {
@@ -65,6 +67,10 @@ export default {
             { label: "菠萝", value: 3 },
             { label: "菠萝", value: 3 },
           ],
           ],
         },
         },
+        {
+          type: "richText",
+          prop: "rich",
+        },
       ],
       ],
       rules: {
       rules: {
         name: [
         name: [
@@ -85,6 +91,7 @@ export default {
         if (valid) {
         if (valid) {
           console.log("77777");
           console.log("77777");
           console.log(this.formValue);
           console.log(this.formValue);
+          let arr = [];
           // this.$emit("submitForm", this.formValue);
           // this.$emit("submitForm", this.formValue);
         } else {
         } else {
           return false;
           return false;
@@ -98,7 +105,7 @@ export default {
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .box {
 .box {
-  height: 100vh;
+  // height: 100vh;
   width: 100%;
   width: 100%;
   .top_box {
   .top_box {
     width: 100%;
     width: 100%;
@@ -110,42 +117,7 @@ export default {
     margin-bottom: 2%;
     margin-bottom: 2%;
   }
   }
 }
 }
-
-::v-deep.dialogClass .el-dialog .el-dialog__body {
-  padding: 0;
-  .el-button--primary {
-    width: 100%;
-  }
-  .el-form {
-    margin: 0 3%;
-  }
-
-  .avatar-uploader .el-upload {
-    // border: 1px dashed #d9d9d9;
-    border-radius: 6px;
-    cursor: pointer;
-    position: relative;
-    overflow: hidden;
-  }
-  .avatar-uploader .el-upload:hover {
-    border-color: #409eff;
-  }
-  .avatar-uploader {
-    text-align: center;
-  }
-
-  .avatar-uploader-icon {
-    font-size: 28px;
-    color: #8c939d;
-    width: 178px;
-    height: 178px;
-    line-height: 178px;
-    text-align: center;
-  }
-  .avatar {
-    width: 178px;
-    height: 178px;
-    display: block;
-  }
+::v-deep .my_form .ql-container {
+  height: 20vh;
 }
 }
 </style>
 </style>

+ 32 - 9
src/pages/login/index.vue

@@ -2,7 +2,14 @@
   <div class="clearfix" id="login_wrap">
   <div class="clearfix" id="login_wrap">
     <div class="login">
     <div class="login">
       <h2 class="title">管理服务登录平台</h2>
       <h2 class="title">管理服务登录平台</h2>
-      <my-form class="content" :formList="formList" :formValue="formValue">
+      <my-form
+        labelWidth="80px"
+        class="content"
+        :formList="formList"
+        :formValue="formValue"
+        :rules="rules"
+        ref="myForm"
+      >
         <template slot="handle" slot-scope="scope">
         <template slot="handle" slot-scope="scope">
           <el-button type="primary" @click="login(scope.formData)"
           <el-button type="primary" @click="login(scope.formData)"
             >登录</el-button
             >登录</el-button
@@ -14,33 +21,49 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { login } from "../../api";
 export default {
 export default {
   data() {
   data() {
     return {
     return {
       formList: [
       formList: [
-        { type: "input", prop: "account", label: "姓名", width: "280px" },
+        {
+          type: "input",
+          prop: "account",
+          label: "姓名",
+          width: "280px",
+          placeholder: "请输入账号",
+        },
         {
         {
           type: "input",
           type: "input",
           prop: "password",
           prop: "password",
           label: "密码",
           label: "密码",
           width: "280px",
           width: "280px",
           style: "password",
           style: "password",
+          placeholder: "请输入密码",
         },
         },
       ],
       ],
       formValue: {
       formValue: {
         account: "",
         account: "",
         password: "",
         password: "",
       },
       },
+
+      rules: {
+        account: [{ required: true, message: "请填写账号", trigger: "change" }],
+        password: [
+          { required: true, message: "请填写密码", trigger: "change" },
+        ],
+      },
     };
     };
   },
   },
   methods: {
   methods: {
-    async login() {
-      let result = await this.$api.basic.login(this.formValue);
-      let { token, name } = result.data;
-      this.$store.commit("LOGIN_IN", token);
-      this.$store.commit("UERINFO", name);
-      this.$router.replace("/");
+    login() {
+      this.$refs.myForm.$refs.formData.validate(async (valid) => {
+        if (!valid) return;
+        let result = await this.$api.basic.login(this.formValue);
+        let { token, name } = result.data;
+        this.$store.commit("LOGIN_IN", token);
+        this.$store.commit("UERINFO", name);
+        this.$router.replace("/");
+      });
     },
     },
   },
   },
   mounted() {},
   mounted() {},

+ 1 - 0
src/pages/order-manage/return-goods/index.vue

@@ -14,6 +14,7 @@
         <el-button type="primary" size="small" @click="edit(scope.row)"
         <el-button type="primary" size="small" @click="edit(scope.row)"
           >编辑</el-button
           >编辑</el-button
         >
         >
+
         <el-button type="success" size="small" @click="roleMange(scope.row)"
         <el-button type="success" size="small" @click="roleMange(scope.row)"
           >角色管理</el-button
           >角色管理</el-button
         >
         >

+ 43 - 0
src/pages/test/index.vue

@@ -0,0 +1,43 @@
+<template>
+  <div>
+    
+    <div id="myChart" :style="{ width: '400px', height: '300px' }"></div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "test",
+  data() {
+    return {};
+  },
+  methods: {
+    initEcharts() {
+      // 基于准备好的dom,初始化echarts实例
+      let myChart = this.$echarts.init(document.getElementById("myChart"));
+      // 绘制图表
+      myChart.setOption({
+        title: { text: "在Vue中使用echarts" },
+        tooltip: {},
+        xAxis: {
+          data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
+        },
+        yAxis: {},
+        series: [
+          {
+            name: "销量",
+            type: "bar",
+            data: [5, 20, 36, 10, 10, 20],
+          },
+        ],
+      });
+    },
+  },
+  mounted() {
+    this.initEcharts();
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 13 - 0
src/router/dynamic-router.js

@@ -14,6 +14,10 @@ const GoodsClassify = () => import('../pages/goods-manage/goods-classify')
 /* 系统管理 */
 /* 系统管理 */
 const System = () => import('../pages/system')
 const System = () => import('../pages/system')
 
 
+
+/* 测试管理 */
+const Test = () => import('../pages/test')
+
 /* 需要权限判断的路由 */
 /* 需要权限判断的路由 */
 const dynamicRoutes = [
 const dynamicRoutes = [
     {
     {
@@ -111,6 +115,15 @@ const dynamicRoutes = [
             name: '系统管理',
             name: '系统管理',
             icon: 'el-icon-setting'
             icon: 'el-icon-setting'
         },
         },
+    },
+    {
+        path: '/test',
+        component: Test,
+        name: 'test',
+        meta: {
+            name: '测试管理',
+            icon: 'el-icon-s-help'
+        },
     }
     }
 
 
 ]
 ]