xiezhenghui 4 anni fa
parent
commit
326d4274fe

+ 8
- 8
src/api/user.js Vedi File

@@ -1,19 +1,19 @@
1 1
 import axios from '@/libs/api.request'
2 2
 
3
-export const login = ({ userName, password }) => {
4
-  const data = {
5
-    userName,
6
-    password
3
+export const login = ({ loginname, loginpwd }) => {
4
+  const params = {
5
+    loginname, 
6
+    loginpwd
7 7
   }
8 8
   return axios.request({
9
-    url: 'login',
10
-    data,
11
-    method: 'post'
9
+    url: 'user/login',
10
+    params,
11
+    method: 'POST'
12 12
   })
13 13
 }
14 14
 
15 15
 export const getUserInfo = (token) => {
16
-  return axios.request({
16
+  return  axios.request({
17 17
     url: 'get_info',
18 18
     params: {
19 19
       token

+ 6
- 0
src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.less Vedi File

@@ -1,4 +1,10 @@
1 1
 .custom-bread-crumb{
2 2
   display: inline-block;
3 3
   vertical-align: top;
4
+  .custom-title{
5
+    color: #999;
6
+    & span{
7
+      margin: 0 9px;
8
+    }
9
+  }
4 10
 }

+ 1
- 0
src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.vue Vedi File

@@ -1,6 +1,7 @@
1 1
 <template>
2 2
   <div class="custom-bread-crumb">
3 3
     <Breadcrumb :style="{fontSize: `${fontSize}px`}" separator=">">
4
+      <span class="custom-title">青鸽管家<span>></span></span>
4 5
       <BreadcrumbItem v-for="item in list" :to="item.to" :key="`bread-crumb-${item.name}`">
5 6
         <common-icon style="margin-right: 4px;" :type="item.icon || ''"/>
6 7
         {{ showTitle(item) }}

+ 1
- 1
src/components/main/components/header-bar/header-bar.vue Vedi File

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="header-bar">
3
-    <sider-trigger :collapsed="collapsed" icon="md-menu" @on-change="handleCollpasedChange"></sider-trigger>
3
+    <!-- <sider-trigger :collapsed="collapsed" icon="md-menu" @on-change="handleCollpasedChange"></sider-trigger> -->
4 4
     <custom-bread-crumb show-icon style="margin-left: 30px;" :list="breadCrumbList"></custom-bread-crumb>
5 5
     <div class="custom-content-con">
6 6
       <slot></slot>

+ 3
- 0
src/components/main/components/side-menu/side-menu.less Vedi File

@@ -70,4 +70,7 @@ div /deep/ .ivu-menu-vertical.ivu-menu-light:after{
70 70
 }
71 71
 div /deep/ .ivu-layout{
72 72
   background-color: #EEF5FB;
73
+}
74
+div /deep/ .ivu-menu-submenu-title{
75
+  color: #3D8EFE;
73 76
 }

+ 1
- 1
src/components/paste-editor/plugins/placeholder.js Vedi File

@@ -2,7 +2,7 @@ export default (codemirror) => {
2 2
   (function (mod) {
3 3
     mod(codemirror)
4 4
   })(function (CodeMirror) {
5
-    CodeMirror.defineOption('placeholder', '', function (cm, val, old) {
5
+    CodeMirror.defineOption('placeholder', '请输入内容', function (cm, val, old) {
6 6
       var prev = old && old !== CodeMirror.Init
7 7
       if (val && !prev) {
8 8
         cm.on('blur', onBlur)

+ 1
- 1
src/config/index.js Vedi File

@@ -17,7 +17,7 @@ export default {
17 17
    * @description api请求基础路径
18 18
    */
19 19
   baseUrl: {
20
-    dev: 'https://www.easy-mock.com/mock/5add9213ce4d0e69998a6f51/iview-admin/',
20
+    dev: 'https://aicpapitest.xhkjedu.com/',
21 21
     pro: 'https://produce.com'
22 22
   },
23 23
   /**

+ 1
- 1
src/libs/axios.js Vedi File

@@ -21,7 +21,7 @@ class HttpRequest {
21 21
     const config = {
22 22
       baseURL: this.baseUrl,
23 23
       headers: {
24
-        //
24
+        // 
25 25
       }
26 26
     }
27 27
     return config

+ 1
- 1
src/main.js Vedi File

@@ -17,7 +17,7 @@ import VOrgTree from 'v-org-tree'
17 17
 import 'v-org-tree/dist/v-org-tree.css'
18 18
 // 实际打包时应该不引入mock
19 19
 /* eslint-disable */
20
-if (process.env.NODE_ENV !== 'production') require('@/mock')
20
+// if (process.env.NODE_ENV !== 'production') require('@/mock')
21 21
 
22 22
 Vue.use(iView, {
23 23
   i18n: (key, value) => i18n.t(key, value)

+ 1
- 1
src/mock/index.js Vedi File

@@ -5,7 +5,7 @@ import { getMessageInit, getContentByMsgId, hasRead, removeReaded, restoreTrash,
5 5
 
6 6
 // 配置Ajax请求延时,可用来测试网络延迟大时项目中一些效果
7 7
 Mock.setup({
8
-  timeout: 1000
8
+  timeout: 0
9 9
 })
10 10
 
11 11
 // 登录相关和获取用户信息

+ 4
- 4
src/router/routers.js Vedi File

@@ -50,7 +50,7 @@ export default [
50 50
     path: '/organ',
51 51
     name: 'organ',
52 52
     meta: {
53
-      icon: 'md-menu',
53
+      icon: 'ios-stats',
54 54
       title: '分机构统计'
55 55
     },
56 56
     component: Main,
@@ -59,7 +59,7 @@ export default [
59 59
         path: 'organ_admin',
60 60
         name: 'organ_admin',
61 61
         meta: {
62
-          icon: 'md-funnel',
62
+          icon: 'ios-paper',
63 63
           title: '分机构管理'
64 64
         },
65 65
         component: () => import('@/view/organ_admin/organ_admin.vue')
@@ -68,10 +68,10 @@ export default [
68 68
         path: 'organ_mon',
69 69
         name: 'organ_mon',
70 70
         meta: {
71
-          icon: 'md-funnel',
71
+          icon: 'ios-paper',
72 72
           title: '月报'
73 73
         },
74
-        component: () => import('@/view/multilevel/level-2-1.vue')
74
+        component: () => import('@/view/organ_admin/info/info.vue')
75 75
       }
76 76
     ]
77 77
   }, 

+ 86
- 83
src/store/module/user.js Vedi File

@@ -74,15 +74,18 @@ export default {
74 74
   },
75 75
   actions: {
76 76
     // 登录
77
-    handleLogin ({ commit }, { userName, password }) {
78
-      userName = userName.trim()
77
+    handleLogin ({ commit }, { loginname, loginpwd }) {
78
+      loginname = loginname.trim()
79 79
       return new Promise((resolve, reject) => {
80 80
         login({
81
-          userName,
82
-          password
81
+          loginname,
82
+          loginpwd
83 83
         }).then(res => {
84
-          const data = res.data
84
+          const data = res.data.obj
85
+          // console.log(data)
85 86
           commit('setToken', data.token)
87
+          commit('setUserName', data.username)
88
+          commit('setUserId', data.userid)
86 89
           resolve()
87 90
         }).catch(err => {
88 91
           reject(err)
@@ -133,85 +136,85 @@ export default {
133 136
       })
134 137
     },
135 138
     // 获取消息列表,其中包含未读、已读、回收站三个列表
136
-    getMessageList ({ state, commit }) {
137
-      return new Promise((resolve, reject) => {
138
-        getMessage().then(res => {
139
-          const { unread, readed, trash } = res.data
140
-          commit('setMessageUnreadList', unread.sort((a, b) => new Date(b.create_time) - new Date(a.create_time)))
141
-          commit('setMessageReadedList', readed.map(_ => {
142
-            _.loading = false
143
-            return _
144
-          }).sort((a, b) => new Date(b.create_time) - new Date(a.create_time)))
145
-          commit('setMessageTrashList', trash.map(_ => {
146
-            _.loading = false
147
-            return _
148
-          }).sort((a, b) => new Date(b.create_time) - new Date(a.create_time)))
149
-          resolve()
150
-        }).catch(error => {
151
-          reject(error)
152
-        })
153
-      })
154
-    },
139
+    // getMessageList ({ state, commit }) {
140
+    //   return new Promise((resolve, reject) => {
141
+    //     getMessage().then(res => {
142
+    //       const { unread, readed, trash } = res.data
143
+    //       commit('setMessageUnreadList', unread.sort((a, b) => new Date(b.create_time) - new Date(a.create_time)))
144
+    //       commit('setMessageReadedList', readed.map(_ => {
145
+    //         _.loading = false
146
+    //         return _
147
+    //       }).sort((a, b) => new Date(b.create_time) - new Date(a.create_time)))
148
+    //       commit('setMessageTrashList', trash.map(_ => {
149
+    //         _.loading = false
150
+    //         return _
151
+    //       }).sort((a, b) => new Date(b.create_time) - new Date(a.create_time)))
152
+    //       resolve()
153
+    //     }).catch(error => {
154
+    //       reject(error)
155
+    //     })
156
+    //   })
157
+    // },
155 158
     // 根据当前点击的消息的id获取内容
156
-    getContentByMsgId ({ state, commit }, { msg_id }) {
157
-      return new Promise((resolve, reject) => {
158
-        let contentItem = state.messageContentStore[msg_id]
159
-        if (contentItem) {
160
-          resolve(contentItem)
161
-        } else {
162
-          getContentByMsgId(msg_id).then(res => {
163
-            const content = res.data
164
-            commit('updateMessageContentStore', { msg_id, content })
165
-            resolve(content)
166
-          })
167
-        }
168
-      })
169
-    },
159
+    // getContentByMsgId ({ state, commit }, { msg_id }) {
160
+    //   return new Promise((resolve, reject) => {
161
+    //     let contentItem = state.messageContentStore[msg_id]
162
+    //     if (contentItem) {
163
+    //       resolve(contentItem)
164
+    //     } else {
165
+    //       getContentByMsgId(msg_id).then(res => {
166
+    //         const content = res.data
167
+    //         commit('updateMessageContentStore', { msg_id, content })
168
+    //         resolve(content)
169
+    //       })
170
+    //     }
171
+    //   })
172
+    // },
170 173
     // 把一个未读消息标记为已读
171
-    hasRead ({ state, commit }, { msg_id }) {
172
-      return new Promise((resolve, reject) => {
173
-        hasRead(msg_id).then(() => {
174
-          commit('moveMsg', {
175
-            from: 'messageUnreadList',
176
-            to: 'messageReadedList',
177
-            msg_id
178
-          })
179
-          commit('setMessageCount', state.unreadCount - 1)
180
-          resolve()
181
-        }).catch(error => {
182
-          reject(error)
183
-        })
184
-      })
185
-    },
186
-    // 删除一个已读消息到回收站
187
-    removeReaded ({ commit }, { msg_id }) {
188
-      return new Promise((resolve, reject) => {
189
-        removeReaded(msg_id).then(() => {
190
-          commit('moveMsg', {
191
-            from: 'messageReadedList',
192
-            to: 'messageTrashList',
193
-            msg_id
194
-          })
195
-          resolve()
196
-        }).catch(error => {
197
-          reject(error)
198
-        })
199
-      })
200
-    },
201
-    // 还原一个已删除消息到已读消息
202
-    restoreTrash ({ commit }, { msg_id }) {
203
-      return new Promise((resolve, reject) => {
204
-        restoreTrash(msg_id).then(() => {
205
-          commit('moveMsg', {
206
-            from: 'messageTrashList',
207
-            to: 'messageReadedList',
208
-            msg_id
209
-          })
210
-          resolve()
211
-        }).catch(error => {
212
-          reject(error)
213
-        })
214
-      })
215
-    }
174
+//     hasRead ({ state, commit }, { msg_id }) {
175
+//       return new Promise((resolve, reject) => {
176
+//         hasRead(msg_id).then(() => {
177
+//           commit('moveMsg', {
178
+//             from: 'messageUnreadList',
179
+//             to: 'messageReadedList',
180
+//             msg_id
181
+//           })
182
+//           commit('setMessageCount', state.unreadCount - 1)
183
+//           resolve()
184
+//         }).catch(error => {
185
+//           reject(error)
186
+//         })
187
+//       })
188
+//     },
189
+//     // 删除一个已读消息到回收站
190
+//     removeReaded ({ commit }, { msg_id }) {
191
+//       return new Promise((resolve, reject) => {
192
+//         removeReaded(msg_id).then(() => {
193
+//           commit('moveMsg', {
194
+//             from: 'messageReadedList',
195
+//             to: 'messageTrashList',
196
+//             msg_id
197
+//           })
198
+//           resolve()
199
+//         }).catch(error => {
200
+//           reject(error)
201
+//         })
202
+//       })
203
+//     },
204
+//     // 还原一个已删除消息到已读消息
205
+//     restoreTrash ({ commit }, { msg_id }) {
206
+//       return new Promise((resolve, reject) => {
207
+//         restoreTrash(msg_id).then(() => {
208
+//           commit('moveMsg', {
209
+//             from: 'messageTrashList',
210
+//             to: 'messageReadedList',
211
+//             msg_id
212
+//           })
213
+//           resolve()
214
+//         }).catch(error => {
215
+//           reject(error)
216
+//         })
217
+//       })
218
+//     }
216 219
   }
217 220
 }

+ 2
- 6
src/view/components/editor/editor.vue Vedi File

@@ -1,7 +1,6 @@
1 1
 <template>
2 2
   <div>
3 3
     <editor ref="editor" :value="content" @on-change="handleChange"/>
4
-    <Button @click="changeContent">修改编辑器内容</Button>
5 4
   </div>
6 5
 </template>
7 6
 
@@ -14,15 +13,12 @@ export default {
14 13
   },
15 14
   data () {
16 15
     return {
17
-      content: '12312323'
16
+      content: ''
18 17
     }
19 18
   },
20 19
   methods: {
21 20
     handleChange (html, text) {
22
-      console.log(html, text)
23
-    },
24
-    changeContent () {
25
-      this.$refs.editor.setHtml('<p>powered by wangeditor</p>')
21
+      console.log(html)
26 22
     }
27 23
   }
28 24
 }

+ 4
- 1
src/view/login/login.less Vedi File

@@ -9,10 +9,13 @@ input{
9 9
     background-image: url("../../assets/login-background.png");
10 10
     background-size: 100% 100%;
11 11
     background-repeat: no-repeat;
12
+    display: flex;
13
+    justify-content: center;
14
+    align-items: center;
12 15
 }
13 16
 .login-title{
14 17
     text-align: center;
15
-    margin-top: 149px;
18
+    // margin-top: 20px;
16 19
     font-weight: bold;
17 20
     font-size: 23px;
18 21
     color: #ffffff;

+ 24
- 21
src/view/login/login.vue Vedi File

@@ -1,21 +1,23 @@
1 1
 <template>
2 2
 <!-- 登陆页面背景图 -->
3 3
   <div class="login">
4
-    <div class="login-title">欢迎,登陆青鸽管家!</div>
5
-    <!-- 登陆板块 -->
6
-    <div class="login-text">
7
-      <input type="text" placeholder="用户名" class="login-input user-log" v-model="userName">
8
-      <input type="text" placeholder="密码" class="login-input key-log" v-model=" password">
9
-      <div class="radio" @click="remembers">
10
-        <div class="checkbox">
11
-          <div class="checkbox-active" v-show="active"></div>
4
+    <div>
5
+      <div class="login-title">欢迎,登陆青鸽管家!</div>
6
+      <!-- 登陆板块 -->
7
+      <div class="login-text">
8
+        <input type="text" placeholder="用户名" class="login-input user-log" v-model="userName">
9
+        <input type="text" placeholder="密码" class="login-input key-log" v-model=" password">
10
+        <div class="radio" @click="remembers">
11
+          <div class="checkbox">
12
+            <div class="checkbox-active" v-show="active"></div>
13
+          </div>
14
+          <div>记住密码</div>
15
+        </div>
16
+        <button class="login-btn" @click="handleSubmit">登陆</button>
17
+        <div class="login-register">
18
+          <div>注册</div>
19
+          <div>忘记密码</div>
12 20
         </div>
13
-        <div>记住密码</div>
14
-      </div>
15
-      <button class="login-btn" @click="handleSubmit">登陆</button>
16
-      <div class="login-register">
17
-        <div>注册</div>
18
-        <div>忘记密码</div>
19 21
       </div>
20 22
     </div>
21 23
   </div>
@@ -27,8 +29,8 @@ export default {
27 29
   name: 'login',
28 30
   data () {
29 31
     return {
30
-      userName: 'super_admin',
31
-      password: '',
32
+      userName: '15238687931',
33
+      password: '123456',
32 34
       active:false
33 35
     }
34 36
   },
@@ -38,15 +40,16 @@ export default {
38 40
       'getUserInfo'
39 41
     ]),
40 42
     handleSubmit () {
41
-      var userName=this.userName;
42
-      var password=this.password;
43
-      if(!userName){
43
+      var loginname=this.userName;
44
+      var loginpwd=this.password;
45
+      // loginname, loginpwd
46
+      if(!loginname){
44 47
         return;
45 48
       };
46
-      if(!password){
49
+      if(!loginpwd){
47 50
         return;
48 51
       }
49
-      this.handleLogin({ userName, password }).then(res => {
52
+      this.handleLogin({ loginname, loginpwd }).then(res => {
50 53
         this.getUserInfo().then(res => {
51 54
           this.$router.push({
52 55
             name: this.$config.homeName

+ 0
- 8
src/view/multilevel/level-2-1.vue Vedi File

@@ -1,8 +0,0 @@
1
-<template>
2
-  <div>多级菜单 -> 二级-1</div>
3
-</template>
4
-<script>
5
-export default {
6
-  name: 'level_2_1'
7
-}
8
-</script>

+ 33
- 0
src/view/organ_admin/info/info.less Vedi File

@@ -0,0 +1,33 @@
1
+.istop{
2
+    display: inline-block;
3
+    width: 200px;
4
+   margin-left: 20px;
5
+}
6
+div /deep/ .ivu-form-item{
7
+    margin-bottom: 10px;
8
+}
9
+.upLoad{
10
+    margin: 10px 0;
11
+    display: flex;
12
+    justify-content: flex-start;
13
+    .upLoad-div{
14
+        margin-right: 180px;
15
+        & span{
16
+            font-size: 14px;
17
+            .upLoad-size{
18
+                margin-left: 16px;
19
+                font-size: 12px;
20
+                color: rgb(51,153,255);
21
+            }
22
+        }
23
+        .upLoad-border{
24
+            margin-top: 10px;
25
+            display: flex;
26
+            justify-content: center;
27
+            align-items: center;
28
+            padding: 120px;
29
+            border: 1px dashed #E9E9E9;
30
+            border-radius: 6px;
31
+        }
32
+    }
33
+}

+ 98
- 0
src/view/organ_admin/info/info.vue Vedi File

@@ -0,0 +1,98 @@
1
+<template>
2
+  <div>
3
+    <Form label-position="left" :label-width="40">
4
+        <FormItem label="标题">
5
+            <Input></Input>
6
+        </FormItem>
7
+        <FormItem label="分类">
8
+          <Select v-model="select" style="width:180px">
9
+              <Option v-for="(item,index) in selectList" :value="item.id" :key="index">{{ item.title }}</Option>
10
+          </Select>
11
+          <div class="istop">
12
+            <FormItem label="是否置顶"  :label-width="60">
13
+              <RadioGroup v-model="radio">
14
+                  <Radio label="notop">不置顶</Radio>
15
+                  <Radio label="istop">置顶</Radio>
16
+              </RadioGroup>
17
+            </FormItem>
18
+          </div>
19
+          <div class="istop">
20
+            <FormItem label="是否广告位"  :label-width="80" inline>
21
+              <RadioGroup v-model="poster">
22
+                  <Radio label="noPoster">否</Radio>
23
+                  <Radio label="isPoster">是</Radio>
24
+              </RadioGroup>
25
+            </FormItem>
26
+          </div>
27
+        </FormItem>
28
+        <FormItem label="标签">
29
+            <Input  style="width:420px"></Input>
30
+        </FormItem>
31
+    </Form>
32
+    <div>
33
+      <div>
34
+        <div>咨讯内容</div>
35
+          <paste-editor></paste-editor>
36
+      </div>
37
+    </div>
38
+    <div class="upLoad">
39
+      <div class="upLoad-div">
40
+        <span>封面图<span class="upLoad-size">(建议图片尺寸:840 x 400)</span></span>
41
+        <Upload class="upLoad-border" :before-upload="handleUpload" action="//jsonplaceholder.typicode.com/posts/" >
42
+            <div>
43
+              <Icon type="md-add" size="52" style="color: #3399ff"></Icon>
44
+            </div>
45
+        </Upload>
46
+      </div>
47
+      <div class="upLoad-div">
48
+        <span>视频</span>
49
+        <Upload class="upLoad-border" action="//jsonplaceholder.typicode.com/posts/">
50
+            <div>
51
+              <Icon type="md-add" size="52" style="color: #3399ff"></Icon>
52
+            </div>
53
+        </Upload>
54
+      </div>
55
+    </div>
56
+    <Button size="large" type="primary">完成</Button>
57
+    <img :src="logoPreview" alt="">
58
+  </div>
59
+</template>
60
+<script>
61
+import pasteEditor from "../../components/editor/editor.vue"
62
+export default {
63
+  name: 'info',
64
+  components:{
65
+    pasteEditor
66
+  },
67
+  data(){
68
+    return {
69
+      selectList:[
70
+        {id:1,title:"时事"},
71
+        {id:2,title:"最新"},
72
+        {id:3,title:"国家"},
73
+        {id:4,title:"教育"}
74
+      ],
75
+      select:"",
76
+      radio:"notop",
77
+      poster:"noPoster",
78
+      logoPreview:''
79
+    }
80
+  },
81
+  methods:{
82
+    handleUpload(file){
83
+      this.file = file
84
+      const reader = new FileReader()
85
+      reader.readAsDataURL(file)
86
+        reader.onload = () => {
87
+          const _base64 = reader.result
88
+          this.logoPreview = _base64
89
+        }
90
+      return false;
91
+    }
92
+  }
93
+}
94
+</script>
95
+<style lang="less">
96
+  @import './info.less';
97
+</style>
98
+

+ 2
- 2
src/view/single-page/home/home.vue Vedi File

@@ -163,11 +163,11 @@ export default {
163 163
         border-bottom:1px solid #EFEFEF;
164 164
         margin-top: 34px;
165 165
         .index-text{
166
-            font-size: 26px;
166
+            font-size: 24px;
167 167
             padding: 8px 0;
168 168
         }
169 169
         .index-details{
170
-            font-size: 23px;
170
+            font-size: 20px;
171 171
             color: #3DA4FF;
172 172
         }
173 173
     }

Loading…
Annulla
Salva