Browse Source

fix(设置):增加门店字段

geek 4 years ago
parent
commit
ed81f65a4e
100 changed files with 834 additions and 815 deletions
  1. 1 1
      .env.production
  2. BIN
      dist/favicon.ico
  3. 1 1
      dist/index.html
  4. 1 0
      dist/static/css/chunk-2622be51.c8e540b4.css
  5. 0 1
      dist/static/css/chunk-26600eb3.5cd9884a.css
  6. 1 1
      dist/static/css/chunk-6cc9821b.46364fdd.css
  7. 0 1
      dist/static/css/chunk-2b669f0a.bfce1fed.css
  8. 1 0
      dist/static/css/chunk-2bd842f4.c8e540b4.css
  9. 1 1
      dist/static/css/chunk-22b493f6.21f61c12.css
  10. 0 1
      dist/static/css/chunk-374c957c.875c1030.css
  11. 1 0
      dist/static/css/chunk-385dafce.434d8a35.css
  12. 1 0
      dist/static/css/chunk-4c8e6d68.71289059.css
  13. 1 0
      dist/static/css/chunk-5cf99116.7ca98b52.css
  14. 1 0
      dist/static/css/chunk-5f8a05a8.8de2dc3a.css
  15. 0 0
      dist/static/css/chunk-60fb7dae.d8d8a6aa.css
  16. 1 0
      dist/static/css/chunk-61cc1918.1380fc2f.css
  17. 1 0
      dist/static/css/chunk-627b9c6f.7ca98b52.css
  18. 1 1
      dist/static/css/chunk-13d2c1ba.246b6544.css
  19. 1 0
      dist/static/css/chunk-666a158e.04db0f47.css
  20. 1 0
      dist/static/css/chunk-77cbb950.dbb19dde.css
  21. 0 1
      dist/static/css/chunk-7af221bf.bfce1fed.css
  22. 1 0
      dist/static/css/chunk-89482012.aff504ef.css
  23. 0 1
      dist/static/css/chunk-a4ce3264.03762f92.css
  24. 0 1
      dist/static/css/chunk-d7522c4a.7767dd41.css
  25. 0 1
      dist/static/css/chunk-d9a7b4ae.7767dd41.css
  26. 0 1
      dist/static/css/chunk-e76e1b18.26f51e23.css
  27. 1 0
      dist/static/css/chunk-efbda64a.04db0f47.css
  28. 1 0
      dist/static/css/chunk-fac97f44.aff504ef.css
  29. 1 0
      dist/static/js/app.79c89094.js
  30. 0 1
      dist/static/js/app.828179a4.js
  31. 0 1
      dist/static/js/chunk-13d2c1ba.2f1a88bb.js
  32. 0 1
      dist/static/js/chunk-22b493f6.bfa9c6ec.js
  33. 0 1
      dist/static/js/chunk-238c903c.c69e66c8.js
  34. 1 0
      dist/static/js/chunk-238c903c.e950554e.js
  35. 0 1
      dist/static/js/chunk-2574bc12.0431c03b.js
  36. 1 0
      dist/static/js/chunk-2622be51.9819f5aa.js
  37. 0 1
      dist/static/js/chunk-26600eb3.88dd36e0.js
  38. 1 0
      dist/static/js/chunk-2a701cba.87cdcae9.js
  39. 0 1
      dist/static/js/chunk-2b669f0a.af371ef0.js
  40. 1 0
      dist/static/js/chunk-2bd842f4.71bb1b5d.js
  41. 1 0
      dist/static/js/chunk-2e573cc5.fa028313.js
  42. 0 1
      dist/static/js/chunk-374c957c.deee8ddc.js
  43. 1 0
      dist/static/js/chunk-385dafce.56b33ba2.js
  44. 1 0
      dist/static/js/chunk-4c8e6d68.1189f5b0.js
  45. 1 0
      dist/static/js/chunk-5cf99116.402bdd5a.js
  46. 1 0
      dist/static/js/chunk-5f8a05a8.3947f1c1.js
  47. 1 0
      dist/static/js/chunk-60fb7dae.692e94cc.js
  48. 1 0
      dist/static/js/chunk-61cc1918.3449ad0e.js
  49. 1 0
      dist/static/js/chunk-627b9c6f.5a7b8606.js
  50. 1 0
      dist/static/js/chunk-651f0194.fbb75e64.js
  51. 1 0
      dist/static/js/chunk-666a158e.0f1cf45c.js
  52. 0 1
      dist/static/js/chunk-6cc9821b.d0da5fd8.js
  53. 1 0
      dist/static/js/chunk-77cbb950.d6a671a5.js
  54. 0 1
      dist/static/js/chunk-7af221bf.08a1b8a9.js
  55. 1 0
      dist/static/js/chunk-89482012.f365c027.js
  56. 0 1
      dist/static/js/chunk-a4ce3264.0a7cf05d.js
  57. 0 1
      dist/static/js/chunk-d7522c4a.4ca32873.js
  58. 0 1
      dist/static/js/chunk-d9a7b4ae.935c6a1a.js
  59. 0 1
      dist/static/js/chunk-e76e1b18.8b7291cb.js
  60. 1 0
      dist/static/js/chunk-efbda64a.b50c2744.js
  61. 1 0
      dist/static/js/chunk-fac97f44.1f328c2d.js
  62. 2 2
      dist/static/js/chunk-libs.76b739af.js
  63. BIN
      public/favicon.ico
  64. 4 4
      src/api/question.js
  65. 4 4
      src/api/city.js
  66. 7 7
      src/api/home.js
  67. 3 3
      src/api/qiniu.js
  68. 9 1
      src/api/user.js
  69. 5 5
      src/api/video.js
  70. 17 13
      src/components/Upload/SingleImage3.vue
  71. 29 23
      src/components/Upload/SingleVideo.vue
  72. 0 3
      src/permission.js
  73. 100 61
      src/router/index.js
  74. 1 1
      src/settings.js
  75. 53 55
      src/views/question/components/ArticleDetail.vue
  76. 0 0
      src/views/activity/components/Dropdown/Comment.vue
  77. 0 0
      src/views/activity/components/Dropdown/Platform.vue
  78. 0 0
      src/views/activity/components/Dropdown/SourceUrl.vue
  79. 0 0
      src/views/activity/components/Dropdown/index.js
  80. 0 0
      src/views/activity/components/Warning.vue
  81. 0 0
      src/views/activity/create.vue
  82. 0 0
      src/views/activity/edit.vue
  83. 21 23
      src/views/question/list.vue
  84. 0 210
      src/views/branchJoin/components/ArticleDetail.vue
  85. 0 224
      src/views/branchJoin/list.vue
  86. 314 0
      src/views/dashboard/components/ArticleDetail.vue
  87. 0 0
      src/views/dashboard/components/Dropdown/Comment.vue
  88. 0 0
      src/views/dashboard/components/Dropdown/Platform.vue
  89. 0 0
      src/views/dashboard/components/Dropdown/SourceUrl.vue
  90. 0 0
      src/views/dashboard/components/Dropdown/index.js
  91. 0 0
      src/views/dashboard/components/Warning.vue
  92. 0 0
      src/views/dashboard/create.vue
  93. 0 0
      src/views/dashboard/edit.vue
  94. 163 0
      src/views/dashboard/list.vue
  95. 0 85
      src/views/form/index.vue
  96. 37 14
      src/views/home/components/ArticleDetail.vue
  97. 27 17
      src/views/home/list.vue
  98. 1 26
      src/views/login/index.vue
  99. 0 7
      src/views/nested/menu1/index.vue
  100. 0 0
      src/views/nested/menu1/menu1-1/index.vue

+ 1 - 1
.env.production

@@ -2,5 +2,5 @@
 ENV = 'production'
 
 # base api
-VUE_APP_BASE_API = '/website-api'
+VUE_APP_BASE_API = '/api'
 

BIN
dist/favicon.ico


File diff suppressed because it is too large
+ 1 - 1
dist/index.html


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-2622be51.c8e540b4.css


+ 0 - 1
dist/static/css/chunk-26600eb3.5cd9884a.css

@@ -1 +0,0 @@
-.line[data-v-32c0383a]{text-align:center}

File diff suppressed because it is too large
+ 1 - 1
dist/static/css/chunk-6cc9821b.46364fdd.css


File diff suppressed because it is too large
+ 0 - 1
dist/static/css/chunk-2b669f0a.bfce1fed.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-2bd842f4.c8e540b4.css


File diff suppressed because it is too large
+ 1 - 1
dist/static/css/chunk-22b493f6.21f61c12.css


+ 0 - 1
dist/static/css/chunk-374c957c.875c1030.css

@@ -1 +0,0 @@
-.dashboard-container[data-v-3186edba]{margin:30px}.dashboard-text[data-v-3186edba]{font-size:30px;line-height:46px}

File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-385dafce.434d8a35.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-4c8e6d68.71289059.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-5cf99116.7ca98b52.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-5f8a05a8.8de2dc3a.css


dist/static/css/chunk-2574bc12.81786bfb.css → dist/static/css/chunk-60fb7dae.d8d8a6aa.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-61cc1918.1380fc2f.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-627b9c6f.7ca98b52.css


File diff suppressed because it is too large
+ 1 - 1
dist/static/css/chunk-13d2c1ba.246b6544.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-666a158e.04db0f47.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-77cbb950.dbb19dde.css


File diff suppressed because it is too large
+ 0 - 1
dist/static/css/chunk-7af221bf.bfce1fed.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-89482012.aff504ef.css


File diff suppressed because it is too large
+ 0 - 1
dist/static/css/chunk-a4ce3264.03762f92.css


File diff suppressed because it is too large
+ 0 - 1
dist/static/css/chunk-d7522c4a.7767dd41.css


File diff suppressed because it is too large
+ 0 - 1
dist/static/css/chunk-d9a7b4ae.7767dd41.css


File diff suppressed because it is too large
+ 0 - 1
dist/static/css/chunk-e76e1b18.26f51e23.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-efbda64a.04db0f47.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/chunk-fac97f44.aff504ef.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/app.79c89094.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/app.828179a4.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-13d2c1ba.2f1a88bb.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-22b493f6.bfa9c6ec.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-238c903c.c69e66c8.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-238c903c.e950554e.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-2574bc12.0431c03b.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-2622be51.9819f5aa.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-26600eb3.88dd36e0.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-2a701cba.87cdcae9.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-2b669f0a.af371ef0.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-2bd842f4.71bb1b5d.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-2e573cc5.fa028313.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-374c957c.deee8ddc.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-385dafce.56b33ba2.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-4c8e6d68.1189f5b0.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-5cf99116.402bdd5a.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-5f8a05a8.3947f1c1.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-60fb7dae.692e94cc.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-61cc1918.3449ad0e.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-627b9c6f.5a7b8606.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-651f0194.fbb75e64.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-666a158e.0f1cf45c.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-6cc9821b.d0da5fd8.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-77cbb950.d6a671a5.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-7af221bf.08a1b8a9.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-89482012.f365c027.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-a4ce3264.0a7cf05d.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-d7522c4a.4ca32873.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-d9a7b4ae.935c6a1a.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/chunk-e76e1b18.8b7291cb.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-efbda64a.b50c2744.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/chunk-fac97f44.1f328c2d.js


File diff suppressed because it is too large
+ 2 - 2
dist/static/js/chunk-libs.76b739af.js


BIN
public/favicon.ico


+ 4 - 4
src/api/question.js

@@ -2,21 +2,21 @@ import request from '@/utils/request'
 
 export function fetchList(query) {
   return request({
-    url: '/questionAnswer/index',
+    url: '/activity/index',
     method: 'get',
     params: query
   })
 }
 
-export function fetchQuestion(id) {
+export function fetchActivity(id) {
   return request({
-    url: '/questionAnswer/read',
+    url: '/activity/read',
     method: 'get',
     params: { id }
   })
 }
 
-export function createQuestion(data) {
+export function createActivity(data) {
   return request({
     url: '/questionAnswer/save',
     method: 'post',

+ 4 - 4
src/api/city.js

@@ -8,11 +8,11 @@ export function fetchList(query) {
   })
 }
 
-export function fetchOpenArea(id) {
+export function fetchOpenArea(data) {
   return request({
-    url: '/OpenArea/read',
-    method: 'get',
-    params: { id }
+    url: '/common/city',
+    method: 'post',
+    data
   })
 }
 

+ 7 - 7
src/api/home.js

@@ -2,23 +2,23 @@ import request from '@/utils/request'
 
 export function fetchList(query) {
   return request({
-    url: '/home/index',
+    url: '/card/index',
     method: 'get',
     params: query
   })
 }
 
-export function fetchHome(id) {
+export function fetchHome(cardId) {
   return request({
-    url: '/home/read',
+    url: '/card/read',
     method: 'get',
-    params: { id }
+    params: { cardId }
   })
 }
 
 export function createHome(data) {
   return request({
-    url: '/home/save',
+    url: '/card/save',
     method: 'post',
     data
   })
@@ -26,7 +26,7 @@ export function createHome(data) {
 
 export function updateHome(data) {
   return request({
-    url: '/home/update?id=' + data.id,
+    url: '/card/update?id=' + data.id,
     method: 'post',
     data
   })
@@ -34,7 +34,7 @@ export function updateHome(data) {
 
 export function deleteHome(id) {
   return request({
-    url: '/home/delete?id=' + id,
+    url: '/card/delete?id=' + id,
     method: 'get'
   })
 }

+ 3 - 3
src/api/qiniu.js

@@ -7,9 +7,9 @@ export function getToken() {
   })
 }
 
-export function uploadImg(data, uploadWx = false) {
+export function uploadImg(data) {
   return request({
-    url: `/upload/upload?uploadWx=${uploadWx}`,
+    url: `/common/upload`,
     method: 'post',
     data
   })
@@ -17,7 +17,7 @@ export function uploadImg(data, uploadWx = false) {
 
 export function uploadVideo(data) {
   return request({
-    url: '/upload/uploadVideo',
+    url: '/common/upload',
     method: 'post',
     data
   })

+ 9 - 1
src/api/user.js

@@ -44,7 +44,7 @@ export function fetchUser(id) {
 
 export function updateUser(data) {
   return request({
-    url: '/User/update?id=' + data.id,
+    url: '/User/editUser',
     method: 'post',
     data
   })
@@ -57,6 +57,14 @@ export function deleteUser(id) {
   })
 }
 
+export function createUser(data) {
+  return request({
+    url: '/User/login',
+    method: 'post',
+    data
+  })
+}
+
 export function verify(data = {}, responseType = 'arraybuffer') {
   return request({
     url: '/admin/verify',

+ 5 - 5
src/api/video.js

@@ -2,7 +2,7 @@ import request from '@/utils/request'
 
 export function fetchList(query) {
   return request({
-    url: '/video/index',
+    url: '/Theatre/index',
     method: 'get',
     params: query
   })
@@ -10,7 +10,7 @@ export function fetchList(query) {
 
 export function fetchVideo(id) {
   return request({
-    url: '/video/read',
+    url: '/Theatre/read',
     method: 'get',
     params: { id }
   })
@@ -18,7 +18,7 @@ export function fetchVideo(id) {
 
 export function createVideo(data) {
   return request({
-    url: '/video/save',
+    url: '/Theatre/save',
     method: 'post',
     data
   })
@@ -26,7 +26,7 @@ export function createVideo(data) {
 
 export function updateVideo(data) {
   return request({
-    url: '/video/update?id=' + data.id,
+    url: '/Theatre/update?id=' + data.id,
     method: 'post',
     data
   })
@@ -34,7 +34,7 @@ export function updateVideo(data) {
 
 export function deleteVideo(id) {
   return request({
-    url: '/video/delete?id=' + id,
+    url: '/Theatre/delete?id=' + id,
     method: 'get'
   })
 }

+ 17 - 13
src/components/Upload/SingleImage3.vue

@@ -10,10 +10,18 @@
       action="#"
       :http-request="uploadImage"
     >
-      <i class="el-icon-upload" />
-      <div class="el-upload__text">
+      <i v-show="coverImg.length<1" class="el-icon-upload" />
+      <div v-show="coverImg.length<1" class="el-upload__text">
         将文件拖到此处,或<em>点击上传</em>
       </div>
+      <div v-show="coverImg.length>1" class="image-preview">
+        <div v-show="coverImg.length>1" class="image-preview-wrapper">
+          <img :src="coverImg">
+          <div class="image-preview-action">
+            <i class="el-icon-delete" @click.stop="rmImage" />
+          </div>
+        </div>
+      </div>
     </el-upload>
     <!-- <div class="image-preview image-app-preview">
       <div v-show="coverImg.length>1" class="image-preview-wrapper">
@@ -23,14 +31,14 @@
         </div>
       </div>
     </div>-->
-    <div class="image-preview">
+    <!--<div class="image-preview">
       <div v-show="coverImg.length>1" class="image-preview-wrapper">
         <img :src="coverImg">
         <div class="image-preview-action">
           <i class="el-icon-delete" @click="rmImage" />
         </div>
       </div>
-    </div>
+    </div>-->
   </div>
 </template>
 
@@ -85,13 +93,10 @@ export default {
       console.log(this.wxUpload)
       console.log(this.wxUpload.length)
       const formData = new FormData()
-      formData.append('image', param.file)
-      uploadImg(formData, this.wxUpload.length > 1).then(response => {
+      formData.append('file', param.file)
+      uploadImg(formData).then(response => {
         console.log('上传图片成功')
         this.imgUrl = response.data.url
-        if (this.wxUpload.length > 1) {
-          this.$emit('wxMedia', this.wxUpload + '%llz%' + response.data.mediaId)
-        }
         param.onSuccess()
         // 上传成功的图片会显示绿色的对勾
         // 但是我们上传成功了图片, fileList 里面的值却没有改变,还好有on-change指令可以使用
@@ -111,16 +116,15 @@ export default {
   position: relative;
   @include clearfix;
   .image-uploader {
-    width: 20%;
+    width: 217px;
     float: left;
   }
   .image-preview {
-    width: 200px;
+    width: 100%;
     height: 200px;
     position: relative;
     border: 1px dashed #d9d9d9;
     float: left;
-    margin-left: 50px;
     .image-preview-wrapper {
       position: relative;
       width: 100%;
@@ -162,7 +166,7 @@ export default {
     position: relative;
     border: 1px dashed #d9d9d9;
     float: left;
-    margin-left: 50px;
+    //margin-left: 50px;
     .app-fake-conver {
       height: 44px;
       position: absolute;

+ 29 - 23
src/components/Upload/SingleVideo.vue

@@ -10,17 +10,23 @@
       action="#"
       :http-request="uploadVideoHandle"
     >
-      <i class="el-icon-upload" />
-      <div class="el-upload__text">
+      <i v-show="imageUrl.length<1" class="el-icon-upload" />
+      <div v-show="imageUrl.length<1" class="el-upload__text">
         将文件拖到此处,或<em>点击上传</em>
       </div>
-    </el-upload>
-    <div class="image-preview">
-      <div v-show="imageUrl.length>1" class="image-preview-wrapper" style="line-height: 0;">
-        <video :src="imageUrl" style="width: 375px;" controls />
+      <div v-show="imageUrl.length>1" class="image-preview">
+        <div v-show="imageUrl.length>1" class="image-preview-wrapper" style="line-height: 0;">
+          <video :src="imageUrl" controls style="width: 300px;height: 200px;" />
+          <div class="image-preview-action">
+            <i class="el-icon-delete" @click.stop="rmImage" style="font-size: 20px;color: black;" />
+          </div>
+        </div>
+      </div>
+      <i v-show="imageUrl.length>1" class="el-icon-delete" style="font-size: 36px;margin: 0 10px;" @click="rmImage" />
+      <div v-show="imageUrl.length>1" class="image-preview-action">
+        <i class="el-icon-delete" @click.stop="rmImage" />
       </div>
-    </div>
-    <i v-show="imageUrl.length>1" class="el-icon-delete" style="font-size: 36px;margin: 0 10px;" @click="rmImage" />
+    </el-upload>
   </div>
 </template>
 
@@ -83,20 +89,20 @@ export default {
         position: relative;
         @include clearfix;
         .image-uploader {
-            width: 20%;
+            width: 300px;
             float: left;
         }
         .image-preview {
-            width: 375px;
-            min-height: 600px;
+            width: 300px;
+            height: 200px;
             position: relative;
             border: 1px dashed #d9d9d9;
             float: left;
-            margin-left: 50px;
+            //margin-left: 50px;
             .image-preview-wrapper {
                 position: relative;
                 width: 100%;
-                //height: 100%;
+                height: 100%;
                 img {
                     width: 100%;
                     height: 100%;
@@ -104,29 +110,29 @@ export default {
             }
             .image-preview-action {
                 position: absolute;
-                width: 50%;
+                //width: 50%;
                 height: 50%;
                 left: 0;
                 top: 0;
-                cursor: default;
+                cursor: pointer;
                 text-align: center;
                 color: #fff;
-                opacity: 0;
+                opacity: 1;
                 font-size: 20px;
-                background-color: rgba(0, 0, 0, .5);
+                //background-color: rgba(0, 0, 0, .5);
                 transition: opacity .3s;
                 cursor: pointer;
                 text-align: center;
-                line-height: 200px;
+                //line-height: 200px;
                 .el-icon-delete {
                     font-size: 36px;
                 }
             }
-            &:hover {
-                .image-preview-action {
-                    opacity: 1;
-                }
-            }
+            //&:hover {
+            //    .image-preview-action {
+            //        opacity: 1;
+            //    }
+            //}
         }
     }
 

+ 0 - 3
src/permission.js

@@ -38,12 +38,9 @@ router.beforeEach(async(to, from, next) => {
           // get user info
           // note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
           const data = await store.dispatch('user/getInfo')
-          console.log(data)
           const roles = data.role
-          console.log(roles)
           // generate accessible routes map based on roles
           const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
-          console.log(accessRoutes)
           // dynamically add accessible routes
           router.addRoutes(accessRoutes)
           // hack method to ensure that addRoutes is complete

+ 100 - 61
src/router/index.js

@@ -47,45 +47,38 @@ export const constantRoutes = [
     path: '/',
     component: Layout,
     redirect: '/dashboard',
-    children: [{
-      path: 'dashboard',
-      name: 'Dashboard',
-      component: () => import('@/views/dashboard/index'),
-      meta: { title: '首页', icon: 'dashboard' }
-    }]
-  },
-  {
-    path: '/live',
-    component: Layout,
     meta: {
-      roles: ['admin', 'editor']
+      title: '用户管理',
+      roles: ['admin'],
+      icon: 'el-icon-user'
     },
     children: [
       {
-        path: 'list',
-        name: 'live',
-        component: () => import('@/views/live/list'),
-        meta: { title: '日志列表', icon: 'el-icon-s-help' }
+        path: 'dashboard',
+        name: 'Dashboard',
+        component: () => import('@/views/dashboard/list'),
+        meta: { title: '用户列表' }
       },
       {
         path: 'edit/:id(\\d+)',
-        component: () => import('@/views/live/edit'),
-        name: 'EditBanner',
-        meta: { title: '查看日志参数', noCache: true, activeMenu: '/live/list' },
+        component: () => import('@/views/dashboard/edit'),
+        name: 'EditerUser',
+        meta: { title: '修改用户', noCache: true, activeMenu: '/dashboard/list' },
         hidden: true
+      },
+      {
+        path: 'create',
+        name: 'CreateUser',
+        component: () => import('@/views/dashboard/create'),
+        meta: { title: '创建用户', roles: ['admin'] }
       }
     ]
   },
-  // 404 page must be placed at the end !!!
-  { path: '*', redirect: '/404', hidden: true }
-]
-
-export const asyncRoutes = [
   {
     path: '/home',
     component: Layout,
     meta: {
-      title: '图片列表',
+      title: '帖子管理',
       icon: 'el-icon-setting',
       roles: ['admin']
     },
@@ -94,88 +87,130 @@ export const asyncRoutes = [
         path: 'list',
         name: 'home',
         component: () => import('@/views/home/list'),
-        meta: { title: '图片列表', icon: 'el-icon-s-help', roles: ['admin'] }
+        meta: { title: '帖子列表', icon: 'el-icon-s-help', roles: ['admin'] }
       },
       {
         path: 'edit/:id(\\d+)',
         name: 'edithome',
         component: () => import('@/views/home/edit'),
-        meta: { title: '查看图片', icon: 'el-icon-s-help', roles: ['admin'] },
+        meta: { title: '查看帖子', icon: 'el-icon-s-help', roles: ['admin'] },
         hidden: true
       },
       {
         path: 'create',
         name: 'createHome',
         component: () => import('@/views/home/create'),
-        meta: { title: '创建图片', icon: 'el-icon-s-help', roles: ['admin'] }
+        meta: { title: '创建帖子', icon: 'el-icon-s-help', roles: ['admin'] },
+        hidden: true
       }
     ]
   },
   {
-    path: '/setting',
+    path: '/video',
     component: Layout,
-    name: 'setting',
+    redirect: '/video/list',
+    name: 'video',
     meta: {
-      title: '基本设置',
-      icon: 'el-icon-setting',
+      title: '猫头鹰剧场',
+      icon: 'el-icon-s-help',
       roles: ['admin']
     },
     children: [
       {
-        path: 'edit',
-        component: () => import('@/views/setting/edit'),
-        name: 'CreateBanner',
-        meta: { title: '参数设置', icon: 'el-icon-edit' }
+        path: 'create',
+        component: () => import('@/views/video/create'),
+        name: 'CreateVideo',
+        meta: { title: '创建剧场' }
+      },
+      {
+        path: 'edit/:id(\\d+)',
+        component: () => import('@/views/video/edit'),
+        name: 'EditVideo',
+        meta: { title: '修改剧场', noCache: true, activeMenu: '/video/list' },
+        hidden: true
+      },
+      {
+        path: 'list',
+        component: () => import('@/views/video/list'),
+        name: 'VideoList',
+        meta: { title: '剧场列表' }
       }
     ]
   },
   {
-    path: '/brand',
+    path: '/activity',
     component: Layout,
-    name: 'brand',
+    redirect: '/activity/list',
+    name: 'activity',
+    meta: {
+      title: '猫头鹰活动 ',
+      icon: 'el-icon-s-help',
+      roles: ['admin']
+    },
+    children: [
+      {
+        path: 'create',
+        component: () => import('@/views/activity/create'),
+        name: 'CreateActivity',
+        meta: { title: '创建活动' }
+      },
+      {
+        path: 'edit/:id(\\d+)',
+        component: () => import('@/views/activity/edit'),
+        name: 'EditActivity',
+        meta: { title: '修改活动 ', noCache: true, activeMenu: '/activity/list' },
+        hidden: true
+      },
+      {
+        path: 'list',
+        component: () => import('@/views/activity/list'),
+        name: 'ActivityList',
+        meta: { title: '活动列表' }
+      }
+    ]
+  },
+  // 404 page must be placed at the end !!!
+  { path: '*', redirect: '/404', hidden: true }
+]
+
+export const asyncRoutes = [
+  {
+    path: '/setting',
+    component: Layout,
+    name: 'setting',
     meta: {
       title: '基本设置',
       icon: 'el-icon-setting',
       roles: ['admin']
     },
+    hidden: true,
     children: [
       {
         path: 'edit',
-        component: () => import('@/views/brand/edit'),
+        component: () => import('@/views/setting/edit'),
         name: 'CreateBanner',
-        meta: { title: '品牌介绍', icon: 'el-icon-edit' }
+        meta: { title: '参数设置', icon: 'el-icon-edit' },
+        hidden: true
       }
     ]
   },
   {
-    path: '/banner',
+    path: '/brand',
     component: Layout,
-    redirect: '/banner/list',
-    name: 'banner',
+    name: 'brand',
     meta: {
-      title: '轮播设置',
-      icon: 'el-icon-s-help',
+      title: '基本设置',
+      icon: 'el-icon-setting',
       roles: ['admin']
     },
+    hidden: true,
     children: [
       {
-        path: 'create',
-        component: () => import('@/views/banner/create'),
+        path: 'edit',
+        component: () => import('@/views/brand/edit'),
         name: 'CreateBanner',
-        meta: { title: '创建轮播图', icon: 'el-icon-edit' }
-      },
-      {
-        path: 'edit/:id(\\d+)',
-        component: () => import('@/views/banner/edit'),
-        name: 'EditBanner',
-        meta: { title: '修改轮播图', noCache: true, activeMenu: '/banner/list' },
+        meta: { title: '品牌介绍', icon: 'el-icon-edit' },
         hidden: true
-      },
-      {
-        path: 'list',
-        component: () => import('@/views/banner/list'),
-        name: 'BannerList',
-        meta: { title: '轮播图列表', icon: 'el-icon-s-order' }
       }
     ]
   },
@@ -185,12 +220,14 @@ export const asyncRoutes = [
     meta: {
       roles: ['admin']
     },
+    hidden: true,
     children: [
       {
         path: 'list',
         name: 'city',
         component: () => import('@/views/city/list'),
-        meta: { title: '开放区域列表', icon: 'el-icon-s-help' }
+        meta: { title: '开放区域列表', icon: 'el-icon-s-help' },
+        hidden: true
       }
     ]
   },
@@ -200,12 +237,14 @@ export const asyncRoutes = [
     meta: {
       roles: ['admin']
     },
+    hidden: true,
     children: [
       {
         path: 'list',
         name: 'join',
         component: () => import('@/views/join/list'),
-        meta: { title: '管理员列表', icon: 'el-icon-s-help' }
+        meta: { title: '管理员列表', icon: 'el-icon-s-help' },
+        hidden: true
       }
     ]
   }

+ 1 - 1
src/settings.js

@@ -1,6 +1,6 @@
 module.exports = {
 
-  title: '沪上阿姨网站后台',
+  title: '猫头鹰后台',
 
   /**
    * @type {boolean} true | false

+ 53 - 55
src/views/question/components/ArticleDetail.vue

@@ -2,14 +2,42 @@
   <div class="createPost-container">
     <el-form ref="postForm" :label-position="labelPosition" :model="postForm" :rules="rules" class="form-container">
       <div class="createPost-main-container">
-        <el-form-item prop="question" style="" label="问题">
-          <el-input v-model="postForm.question" placeholder="" style="width: 300px;" />
+        <el-form-item prop="title" style="" label="剧场标题">
+          <el-input v-model="postForm.title" type="textarea" style="width: 500px;" autosize />
         </el-form-item>
-        <el-form-item prop="content" style="" label="回答">
-          <Tinymce ref="editor" v-model="postForm.answer" :height="400" />
+        <el-form-item prop="content" style="" label="描述">
+          <el-input v-model="postForm.content" :rows="3" type="textarea" style="width: 500px;" autosize />
         </el-form-item>
-        <el-form-item prop="sort" style="" label="排序">
-          <el-input v-model="postForm.sort" placeholder="" style="width: 100px;" />
+        <el-form-item prop="imgUrl" style="" label="封面">
+          <Upload v-model="postForm.imgUrl" />
+        </el-form-item>
+<!--        <el-form-item prop="" style="" label="参与可获取的成就">-->
+<!--          <el-input v-model="" type="textarea" style="width: 500px;" autosize />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item v-if="postForm.videoList.length > 0" prop="videoList" style="" label="视频列表">-->
+<!--          <div v-for="(item1,index1) in postForm.videoList" :key="index1">-->
+<!--            <VideoUpload v-model="item1.videoUrl" style="width: 200px; height: 200px;" />-->
+<!--          </div>-->
+<!--        </el-form-item>-->
+<!--        <el-form-item prop="zanNum" style="" label="点赞数">-->
+<!--          <el-input v-model="postForm.zanNum" type="number" style="width: 150px;" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item prop="discussNum" style="" label="评论数">-->
+<!--          <el-input v-model="postForm.discussNum" type="number" style="width: 150px;" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item prop="collectNum" style="width: 150px;" label="收藏数">-->
+<!--          <el-input v-model="postForm.collectNum" type="number" style="width: 150px;" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item prop="views" style="" label="浏览次数">-->
+<!--          <el-input v-model="postForm.views" type="number" style="width: 150px;" />-->
+<!--        </el-form-item>-->
+        <el-form-item prop="status" style="" label="状态">
+          <template>
+            <el-radio-group v-model="postForm.status">
+              <el-radio :label="0">屏蔽</el-radio>
+              <el-radio :label="1">显示</el-radio>
+            </el-radio-group>
+          </template>
         </el-form-item>
         <el-row>
           <el-button v-if="!isEdit" v-loading="loading" type="success" @click="submitForm">
@@ -25,31 +53,23 @@
 </template>
 
 <script>
-import Tinymce from '@/components/Tinymce'
-
-// import Sticky from '@/components/Sticky' // 粘性header组件
+import Upload from '@/components/Upload/SingleImage3'
 // import { validURL } from '@/utils/validate'
-import { fetchQuestion, createQuestion, updateQuestion } from '@/api/question'
-import { searchUser } from '@/api/remote-search'
+import VideoUpload from '@/components/Upload/SingleVideo'
+import { fetchActivity, updateActivity, createHome } from '@/api/activity'
 // import { CommentDropdown, PlatformDropdown, SourceUrlDropdown } from './Dropdown'
 
 const defaultForm = {
-  status: 'draft',
-  title: '', // 文章题目
-  content: '', // 文章内容
-  content_short: '', // 文章摘要
-  video_url: '', // 文章外链
-  cover_img: '', // 文章图片
-  display_time: undefined, // 前台展示时间
-  id: undefined,
-  platforms: ['a-platform'],
-  comment_disabled: false,
-  importance: 0
+  status: 1,
+  img_url: '', // 文章题目
+  type: 1, // 文章内容
+  sort: 1, // 文章摘要
+  id: undefined
 }
 
 export default {
   name: 'ArticleDetail',
-  components: { Tinymce },
+  components: { Upload, VideoUpload },
   props: {
     isEdit: {
       type: Boolean,
@@ -57,25 +77,11 @@ export default {
     }
   },
   data() {
-    const validateRequire = (rule, value, callback) => {
-      if (value === '') {
-        this.$message({
-          message: rule.field + '为必传项',
-          type: 'error'
-        })
-        callback(new Error(rule.field + '为必传项'))
-      } else {
-        callback()
-      }
-    }
     return {
       postForm: Object.assign({}, defaultForm),
       loading: false,
       userListOptions: [],
       rules: {
-        sort: [{ message: '排序不为空', validator: validateRequire }],
-        question: [{ message: '问题不为空', validator: validateRequire }],
-        answer: [{ message: '回答不为空', validator: validateRequire }]
       },
       tempRoute: {},
       labelPosition: 'top'
@@ -110,7 +116,7 @@ export default {
   },
   methods: {
     fetchData(id) {
-      fetchQuestion(id).then(response => {
+      fetchActivity(id).then(response => {
         this.postForm = response.data.info
         // set tags view title
         // this.setTagsViewTitle()
@@ -127,19 +133,17 @@ export default {
     submitForm() {
       this.$refs.postForm.validate(valid => {
         if (valid) {
-          this.loading = true
-          console.log(this.postForm)
-          createQuestion(this.postForm).then(response => {
+          createHome(this.postForm).then(response => {
             this.$notify({
-              title: '成功',
-              message: '发布成功',
+              title: '新增',
+              message: '创建成功',
               type: 'success',
               duration: 2000
             })
-            this.postForm.status = 'published'
+            // this.postForm.status = 'published'
             this.loading = false
             this.listLoading = false
-            this.$router.push(`/question/list`)
+            this.$router.push(`/home/list`)
           })
         } else {
           console.log('error submit!!')
@@ -148,19 +152,19 @@ export default {
       })
     },
     updateArticle() {
-      console.log(this.postForm)
-      updateQuestion(this.postForm).then(response => {
+      updateActivity(this.postForm).then(response => {
         this.$notify({
           title: '修改',
           message: '修改成功',
           type: 'success',
           duration: 2000
         })
-        this.postForm.status = 'published'
+        // this.postForm.status = 'published'
         this.loading = false
         this.listLoading = false
-        this.$router.push(`/question/list`)
+        this.$router.push(`/home/list`)
       })
+      // this.$router.push(`/advice/list`)
     },
     draftForm() {
       if (this.postForm.content.length === 0 || this.postForm.title.length === 0) {
@@ -177,12 +181,6 @@ export default {
         duration: 1000
       })
       this.postForm.status = 'draft'
-    },
-    getRemoteUserList(query) {
-      searchUser(query).then(response => {
-        if (!response.data.items) return
-        this.userListOptions = response.data.items.map(v => v.name)
-      })
     }
   }
 }

src/views/branchJoin/components/Dropdown/Comment.vue → src/views/activity/components/Dropdown/Comment.vue


src/views/branchJoin/components/Dropdown/Platform.vue → src/views/activity/components/Dropdown/Platform.vue


src/views/branchJoin/components/Dropdown/SourceUrl.vue → src/views/activity/components/Dropdown/SourceUrl.vue


src/views/branchJoin/components/Dropdown/index.js → src/views/activity/components/Dropdown/index.js


src/views/branchJoin/components/Warning.vue → src/views/activity/components/Warning.vue


src/views/branchJoin/create.vue → src/views/activity/create.vue


src/views/branchJoin/edit.vue → src/views/activity/edit.vue


+ 21 - 23
src/views/question/list.vue

@@ -1,15 +1,21 @@
 <template>
   <div class="app-container">
     <div class="filter-container">
-      <el-input v-model="listQuery.question" placeholder="问题" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
+      <el-input v-model="listQuery.title" placeholder="剧场名" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
+      <!--<el-select v-model="listQuery.importance" placeholder="Imp" clearable style="width: 90px" class="filter-item">
+        <el-option v-for="item in importanceOptions" :key="item" :label="item" :value="item" />
+      </el-select>-->
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
-        Search
+        搜索
       </el-button>
-      <router-link :to="{ path: '/question/create' }">
+<!--      <router-link :to="{ path: '/video/create' }">
         <el-button v-waves class="filter-item" type="primary" icon="el-icon-edit">
-          新建
+          新建剧场
         </el-button>
-      </router-link>
+      </router-link>-->
+      <!--<el-checkbox v-model="showReviewer" class="filter-item" style="margin-left:15px;" @change="tableKey=tableKey+1">
+        reviewer
+      </el-checkbox>-->
     </div>
     <el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
       <el-table-column align="center" label="ID" width="80">
@@ -17,39 +23,31 @@
           <span>{{ scope.row.id }}</span>
         </template>
       </el-table-column>
-
-      <el-table-column width="180px" align="center" label="日期">
+      <el-table-column align="center" label="日期">
         <template slot-scope="scope">
-          <span>{{ scope.row.create_time }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column width="100px" align="center" label="排序">
-        <template slot-scope="scope">
-          <span>{{ scope.row.sort }}</span>
+          <span>{{ scope.row.createTime }}</span>
         </template>
       </el-table-column>
       <el-table-column class-name="status-col" label="状态" width="80ß">
         <template slot-scope="{row}">
           <el-tag :type="row.status | statusFilter">
-            {{ row.status == '1' ? "正常" : "删除" }}
+            {{ row.status == 1 ? "正常" : "屏蔽" }}
           </el-tag>
         </template>
       </el-table-column>
-      <el-table-column min-width="300px" label="问题">
+      <el-table-column label="专辑标题">
         <template slot-scope="{row}">
-          <router-link :to="'/question/edit/'+row.id" class="link-type">
-            <span>{{ row.question }}</span>
-          </router-link>
+          <span>{{ row.title }}</span>
         </template>
       </el-table-column>
       <el-table-column align="center" label="Actions" width="190" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <router-link :to="'/question/edit/'+scope.row.id">
-            <el-button type="primary" size="mini" icon="el-icon-edit">
+          <router-link :to="'/activity/edit/'+scope.row.id">
+            <el-button type="primary" size="mini">
               修改
             </el-button>
           </router-link>
-          <el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px;" @click="handleDelete(scope)">
+          <el-button type="danger" size="mini" style="margin-left: 10px;" @click="handleDelete(scope)">
             删除
           </el-button>
         </template>
@@ -61,7 +59,7 @@
 </template>
 
 <script>
-import { fetchList, deleteQuestion } from '@/api/question'
+import { fetchList, deleteActivity } from '@/api/activity'
 import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
 import waves from '@/directive/waves'
 
@@ -118,7 +116,7 @@ export default {
         type: 'warning'
       })
         .then(async() => {
-          await deleteQuestion(row.id)
+          await deleteVideo(row.id)
           this.list.splice($index, 1)
           this.$message({
             type: 'success',

+ 0 - 210
src/views/branchJoin/components/ArticleDetail.vue

@@ -1,210 +0,0 @@
-<template>
-  <div class="createPost-container">
-    <el-form ref="postForm" :label-position="labelPosition" :model="postForm" :rules="rules" class="form-container" label-width="200px">
-      <div class="createPost-main-container">
-        <el-form-item prop="old_partner" label="老店合同人姓名">
-          <el-input v-model="postForm.old_partner" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-form-item prop="mobile" label="手机号">
-          <el-input v-model="postForm.mobile" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-form-item prop="old_store_name" label="老店店名">
-          <el-input v-model="postForm.old_store_name" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-form-item prop="store_name" label="店号">
-          <el-input v-model="postForm.store_name" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-form-item prop="store_num" label="申请第几家店">
-          <el-input v-model="postForm.store_num" placeholder="" style="width: 600px;" />
-        </el-form-item>
-        <el-form-item prop="address" label="意向开店位置">
-          <el-input v-model="postForm.address" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-form-item prop="staff_num" label="分店有几位员工">
-          <el-input v-model="postForm.staff_num" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-form-item prop="manager" label="分店管理者">
-          <el-input v-model="postForm.manager" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-form-item prop="old_order_rate" label="老店小程序点单占比">
-          <el-input v-model="postForm.old_order_rate" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-form-item prop="old_profit" label="老店月净利润">
-          <el-input v-model="postForm.old_profit" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-form-item prop="old_take_out" label="老店外卖评分">
-          <el-input v-model="postForm.old_take_out" placeholder="" style="width: 300px;" />
-        </el-form-item>
-        <el-row>
-          <el-button v-if="!isEdit" v-loading="loading" type="success" @click="submitForm">
-            查看
-          </el-button>
-          <el-button v-if="isEdit" v-loading="loading" type="success" @click="updateArticle">
-            返回
-          </el-button>
-        </el-row>
-      </div>
-    </el-form>
-  </div>
-</template>
-
-<script>
-
-// import Upload from '@/components/Upload/SingleImage3'
-
-// import Sticky from '@/components/Sticky' // 粘性header组件
-// import { validURL } from '@/utils/validate'
-import { fetchBranchJoin } from '@/api/branchJoin'
-// import Warning from './Warning'
-// import { CommentDropdown, PlatformDropdown, SourceUrlDropdown } from './Dropdown'
-
-const defaultForm = {
-  // status: 'draft',
-  redirect: '', // 文章题目
-  status: true, // 文章内容
-  position: 1, // 文章摘要
-  url: '', // 文章外链
-  cover_img: '', // 文章图片
-  display_time: undefined, // 前台展示时间
-  id: undefined,
-  platforms: ['a-platform'],
-  comment_disabled: false,
-  importance: 0
-}
-
-export default {
-  name: 'ArticleDetail',
-  components: { },
-  props: {
-    isEdit: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      postForm: Object.assign({}, defaultForm),
-      loading: false,
-      userListOptions: [],
-      rules: {
-      },
-      tempRoute: {},
-      labelPosition: 'left'
-    }
-  },
-  computed: {
-  },
-  created() {
-    if (this.isEdit) {
-      const id = this.$route.params && this.$route.params.id
-      this.fetchData(id)
-    }
-    // Why need to make a copy of this.$route here?
-    // Because if you enter this page and quickly switch tag, may be in the execution of the setTagsViewTitle function, this.$route is no longer pointing to the current page
-    // https://github.com/PanJiaChen/vue-element-admin/issues/1221
-    this.tempRoute = Object.assign({}, this.$route)
-  },
-  methods: {
-    fetchData(id) {
-      fetchBranchJoin(id).then(response => {
-        this.postForm = response.data.info
-        // set tags view title
-        // this.setTagsViewTitle()
-        // set page title
-        // this.setPageTitle()
-      }).catch(err => {
-        console.log(err)
-      })
-    },
-    setPageTitle() {
-      const title = 'Edit Article'
-      document.title = `${title} - ${this.postForm.id}`
-    },
-    submitForm() {
-      this.$refs.postForm.validate(valid => {
-        if (valid) {
-          this.loading = true
-        } else {
-          console.log('error submit!!')
-          return false
-        }
-      })
-    },
-    updateArticle() {
-      console.log(this.postForm)
-      this.$router.push(`/branchJoin/list`)
-    },
-    draftForm() {
-      if (this.postForm.content.length === 0 || this.postForm.title.length === 0) {
-        this.$message({
-          message: '请填写必要的标题和内容',
-          type: 'warning'
-        })
-        return
-      }
-      this.$message({
-        message: '保存成功',
-        type: 'success',
-        showClose: true,
-        duration: 1000
-      })
-      this.postForm.status = 'draft'
-    },
-    formatCreatePosition(position) {
-      switch (position) {
-        case 1:
-          return 'HOME'
-        case 2:
-          return 'ACTIVITY'
-      }
-    },
-    editPosition(position) {
-      switch (position) {
-        case 'HOME':
-          return 1
-        case 'ACTIVITY':
-          return 2
-      }
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-@import "~@/styles/mixin.scss";
-
-.createPost-container {
-  position: relative;
-
-  .createPost-main-container {
-    padding: 40px 45px 20px 50px;
-
-    .postInfo-container {
-      position: relative;
-      @include clearfix;
-      margin-bottom: 10px;
-
-      .postInfo-container-item {
-        float: left;
-      }
-    }
-  }
-
-  .word-counter {
-    width: 40px;
-    position: absolute;
-    right: 10px;
-    top: 0px;
-  }
-}
-
-.article-textarea ::v-deep {
-  textarea {
-    padding-right: 40px;
-    resize: none;
-    border: none;
-    border-radius: 0px;
-    border-bottom: 1px solid #bfcbd9;
-  }
-}
-</style>

+ 0 - 224
src/views/branchJoin/list.vue

@@ -1,224 +0,0 @@
-<template>
-  <div class="app-container">
-    <div class="filter-container">
-      <el-input v-model="listQuery.mobile" placeholder="手机号" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
-      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
-        搜索
-      </el-button>
-    </div>
-    <el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
-      <el-table-column align="center" label="ID" width="80">
-        <template slot-scope="scope">
-          <span>{{ scope.row.id }}</span>
-        </template>
-      </el-table-column>
-
-      <el-table-column width="180px" align="center" label="申请日期">
-        <template slot-scope="scope">
-          <span>{{ scope.row.create_time }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column class-name="status-col" label="手机号" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.mobile }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column class-name="status-col" label="老店合同人姓名" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.old_partner }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column class-name="status-col" label="老店店名" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.old_store_name }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column class-name="status-col" label="店号">
-        <template slot-scope="scope">
-          <span>{{ scope.row.store_name }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column class-name="status-col" label="状态" width="80px">
-        <template slot-scope="{row}">
-          <el-tag :type="row.status | statusFilter">
-            {{ row.status | statusFilterTxt }}
-          </el-tag>
-        </template>
-      </el-table-column>
-      <el-table-column align="center" label="Actions" width="300" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-row>
-            <router-link :to="'/branchJoin/edit/'+scope.row.id">
-              <el-button type="primary" size="mini" icon="el-icon-edit" style="margin-right: 10px;">
-                查看
-              </el-button>
-            </router-link>
-            <el-button type="primary" size="mini" icon="el-icon-s-check" :disabled="(scope.row.status === 1 || scope.row.status === 3)" @click="handleUpdate(scope)">
-              {{ scope.row.status === 1 || scope.row.status === 3 ? '已处理' : '处理' }}
-            </el-button>
-            <!--<el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px;" @click="handleDelete(scope)">
-              删除
-            </el-button>-->
-          </el-row>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
-    <el-dialog title="处理" :visible.sync="dialogFormVisible">
-      <el-form ref="dataForm" :model="temp" label-position="left" label-width="70px" style="width: 400px; margin-left:50px;">
-        <el-form-item label="理由" prop="mark">
-          <el-input v-model="temp.mark" />
-        </el-form-item>
-        <el-form-item label="处理意见" prop="mark">
-          <template>
-            <el-radio-group v-model="temp.status">
-              <el-radio :label="1">同意</el-radio>
-              <el-radio :label="3">拒绝</el-radio>
-            </el-radio-group>
-          </template>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="dialogFormVisible = false">
-          取消
-        </el-button>
-        <el-button type="primary" @click="updateData()">
-          确定
-        </el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { fetchList, deleteBranchJoin, dealBranchJoin, fetchBranchJoin } from '@/api/branchJoin'
-import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
-import waves from '@/directive/waves'
-
-export default {
-  name: 'ArticleList',
-  components: { Pagination },
-  directives: { waves },
-  filters: {
-    statusFilter(status) {
-      const statusMap = {
-        1: 'success',
-        3: 'info',
-        0: 'danger'
-      }
-      return statusMap[status]
-    },
-    statusFilterTxt(status) {
-      const statusMap = {
-        1: '同意',
-        3: '拒绝',
-        0: '未处理',
-        2: '删除'
-      }
-      return statusMap[status]
-    },
-    positionFilter(status) {
-      const statusMap = {
-        'HOME': 'success',
-        draft: 'info',
-        2: 'danger'
-      }
-      return statusMap[status]
-    }
-  },
-  data() {
-    return {
-      list: null,
-      total: 0,
-      listLoading: true,
-      listQuery: {
-        page: 1,
-        pageSize: 10
-      },
-      temp: {
-        id: undefined,
-        mark: '',
-        status: ''
-      },
-      dialogFormVisible: false
-    }
-  },
-  created() {
-    this.getList()
-  },
-  methods: {
-    getList() {
-      this.listLoading = true
-      fetchList(this.listQuery).then(response => {
-        this.list = response.data.list
-        this.total = response.data.count
-        this.listLoading = false
-      })
-    },
-    handleFilter() {
-      this.listLoading = true
-      fetchList(this.listQuery).then(response => {
-        this.list = response.data.list
-        this.total = response.data.count
-        this.listLoading = false
-      })
-    },
-    handleDelete({ $index, row }) {
-      console.log(row.id)
-      this.$confirm('您确定要隐藏吗', '警告', {
-        confirmButtonText: '是的',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(async() => {
-          await deleteBranchJoin(row.id)
-          this.list.splice($index, 1)
-          this.$message({
-            type: 'success',
-            message: '隐藏成功'
-          })
-        })
-    },
-    async handleUpdate({ $index, row }) {
-      this.temp = Object.assign({}, row) // copy obj
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['dataForm'].clearValidate()
-      })
-    },
-    async updateData() {
-      const tempData = Object.assign({}, this.temp)
-      await dealBranchJoin(tempData)
-      const rs = await fetchBranchJoin(tempData.id)
-      const index = this.list.findIndex(v => v.id === this.temp.id)
-      this.list.splice(index, 1, rs.data.info)
-      this.dialogFormVisible = false
-      this.$notify({
-        title: '成功',
-        message: '更新成功',
-        type: 'success',
-        duration: 2000
-      })
-    }
-  }
-}
-</script>
-
-<style scoped>
-.edit-input {
-  padding-right: 100px;
-}
-.cancel-btn {
-  position: absolute;
-  right: 15px;
-  top: 10px;
-}
-.filter-container{
-  margin-bottom: 20px;
-}
-.filter-item {
-  margin-right: 10px;
-}
-
-</style>

+ 314 - 0
src/views/dashboard/components/ArticleDetail.vue

@@ -0,0 +1,314 @@
+<template>
+  <div class="createPost-container">
+    <el-form ref="postForm" :model="postForm" :rules="rules" class="form-container" :label-position="labelPosition" label-width="100px">
+      <div class="createPost-main-container">
+        <el-row>
+          <el-col :span="24">
+            <div class="postInfo-container">
+              <el-form-item prop="avatar" style="margin-bottom: 30px;" label="用户头像">
+                <Upload v-model="postForm.avatar" />
+              </el-form-item>
+            </div>
+          </el-col>
+        </el-row>
+        <el-form-item prop="name" label="名称">
+          <el-input v-model="postForm.name" placeholder="" style="width: 100px" />
+        </el-form-item>
+        <el-form-item prop="isInvent" label="虚拟用户">
+          <template>
+            <el-radio-group v-model="postForm.isInvent">
+              <el-radio :label="0">否</el-radio>
+              <el-radio :label="1">是</el-radio>
+            </el-radio-group>
+          </template>
+        </el-form-item>
+        <el-form-item prop="cityName" style="margin-bottom: 30px;" label="城市名">
+          <template>
+          <el-cascader v-model="postForm.cityId" :props="props" style="width: 300px;"></el-cascader>
+        </template>
+        </el-form-item>
+        <el-form-item prop="mobile" style="margin-bottom: 30px;" label="手机号">
+          <el-input v-model="postForm.mobile" placeholder="" style="width: 300px;" />
+        </el-form-item>
+        <el-form-item prop="sex" style="margin-bottom: 30px;" label="性别">
+          <template>
+            <el-radio-group v-model="postForm.sex">
+              <el-radio :label="1">男</el-radio>
+              <el-radio :label="2">女</el-radio>
+            </el-radio-group>
+          </template>
+        </el-form-item>
+        <el-form-item prop="birthday" style="margin-bottom: 30px;" label="生日">
+          <el-date-picker v-model="postForm.birthday" type="date" placeholder="选择日期" />
+        </el-form-item>
+        <el-form-item prop="personInfo" style="margin-bottom: 30px;" label="个人简介">
+          <el-input v-model="postForm.personInfo" :rows="2" type="textarea" />
+        </el-form-item>
+        <el-form-item prop="type" style="margin-bottom: 30px;" label="用户类别">
+          <template>
+            <el-radio-group v-model="postForm.type">
+              <el-radio :label="1">普通用户</el-radio>
+              <el-radio :label="2">认证医生</el-radio>
+              <el-radio :label="3">内部员工</el-radio>
+            </el-radio-group>
+          </template>
+        </el-form-item>
+        <el-form-item prop="status" style="margin-bottom: 30px;" label="状态">
+          <el-switch v-model="postForm.status" active-text="激活" inactive-text="隐藏" />
+        </el-form-item>
+        <el-row>
+          <el-button v-if="!isEdit" v-loading="loading" type="success" @click="submitForm">
+            提交
+          </el-button>
+          <el-button v-if="isEdit" v-loading="loading" type="success" @click="updateArticle">
+            修改
+          </el-button>
+        </el-row>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+
+import Upload from '@/components/Upload/SingleImage3'
+
+// import Sticky from '@/components/Sticky' // 粘性header组件
+// import { validURL } from '@/utils/validate'
+import { fetchUser, createUser, updateUser } from '@/api/user'
+import { fetchOpenArea } from '@/api/city'
+// import Warning from './Warning'
+// import { CommentDropdown, PlatformDropdown, SourceUrlDropdown } from './Dropdown'
+
+const defaultForm = {
+  // status: 'draft',
+  redirect: '', // 文章题目
+  status: true, // 文章内容
+  position: 1, // 文章摘要
+  url: '', // 文章外链
+  cover_img: '', // 文章图片
+  display_time: undefined, // 前台展示时间
+  id: undefined,
+  platforms: ['a-platform'],
+  comment_disabled: false,
+  importance: 0
+}
+
+export default {
+  name: 'ArticleDetail',
+  components: { Upload },
+  props: {
+    isEdit: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    const validateRequire = (rule, value, callback) => {
+      if (value === '') {
+        this.$message({
+          message: rule.field + '为必传项',
+          type: 'error'
+        })
+        callback(new Error(rule.field + '为必传项'))
+      } else {
+        callback()
+      }
+    }
+    return {
+      postForm: Object.assign({}, defaultForm),
+      loading: false,
+      userListOptions: [],
+      rules: {
+        url: [{ message: 'banner图不为空', validator: validateRequire }]
+      },
+      tempRoute: {},
+      labelPosition: 'left',
+      options: [],
+      selectLoading: false,
+      list: [],
+      props: {
+        lazy: true,
+        checkStrictly: false,
+        lazyLoad(node, resolve) {
+          const { level } = node
+          const query = {
+            page: 1,
+            pageSize: 100
+          }
+          query.pid = node.value ? node.value : 100000
+          fetchOpenArea(query).then(res => {
+            const nodes = []
+            res.data.cityList.forEach(v => {
+              nodes.push({
+                value: v.id,
+                label: v.name,
+                leaf: level >= 1
+              })
+            })
+            resolve(nodes)
+          })
+        }
+      }
+    }
+  },
+  computed: {
+  },
+  created() {
+    if (this.isEdit) {
+      const id = this.$route.params && this.$route.params.id
+      this.fetchData(id)
+    }
+    // Why need to make a copy of this.$route here?
+    // Because if you enter this page and quickly switch tag, may be in the execution of the setTagsViewTitle function, this.$route is no longer pointing to the current page
+    // https://github.com/PanJiaChen/vue-element-admin/issues/1221
+    this.tempRoute = Object.assign({}, this.$route)
+  },
+  methods: {
+    remoteMethod(query) {
+      if (query !== '') {
+        this.selectLoading = true
+        fetchOpenArea({ 'name': query }).then(rs => {
+          this.selectLoading = false
+          console.log(rs)
+          this.options = rs.data.cityList
+        })
+      } else {
+        this.options = []
+      }
+    },
+    fetchData(id) {
+      fetchUser(id).then(response => {
+        this.postForm = response.data.userInfo
+        // this.setTagsViewTitle()
+        // set page title
+        // this.setPageTitle()
+      }).catch(err => {
+        console.log(err)
+      })
+    },
+    setPageTitle() {
+      const title = 'Edit Article'
+      document.title = `${title} - ${this.postForm.id}`
+    },
+    submitForm() {
+      this.$refs.postForm.validate(valid => {
+        if (valid) {
+          this.loading = true
+          console.log(this.postForm)
+          if (this.postForm.status || this.postForm.status === '') {
+            this.postForm.status = 1
+          }
+          createUser(this.postForm).then(response => {
+            this.$notify({
+              title: '成功',
+              message: '创建成功',
+              type: 'success',
+              duration: 2000
+            })
+            this.loading = false
+            this.listLoading = false
+            this.$router.push(`/dashboard`)
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    updateArticle() {
+      updateUser(this.postForm).then(response => {
+        this.$notify({
+          title: '修改',
+          message: '修改成功',
+          type: 'success',
+          duration: 2000
+        })
+        this.postForm.status = 'published'
+        this.loading = false
+        this.listLoading = false
+        this.$router.push(`/dashboard`)
+      })
+    },
+    draftForm() {
+      if (this.postForm.content.length === 0 || this.postForm.title.length === 0) {
+        this.$message({
+          message: '请填写必要的标题和内容',
+          type: 'warning'
+        })
+        return
+      }
+      this.$message({
+        message: '保存成功',
+        type: 'success',
+        showClose: true,
+        duration: 1000
+      })
+      this.postForm.status = 'draft'
+    },
+    formatCreatePosition(position) {
+      switch (position) {
+        case 1:
+          return 'SHOP'
+        case 2:
+          return 'PRODUCT'
+        case 3:
+          return 'VIDEO'
+        case 4:
+          return 'GUIDE'
+      }
+    },
+    editPosition(position) {
+      switch (position) {
+        case 'SHOP':
+          return 1
+        case 'PRODUCT':
+          return 2
+        case 'VIDEO':
+          return 3
+        case 'GUIDE':
+          return 4
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import "~@/styles/mixin.scss";
+
+.createPost-container {
+  position: relative;
+
+  .createPost-main-container {
+    padding: 40px 45px 20px 50px;
+
+    .postInfo-container {
+      position: relative;
+      @include clearfix;
+      margin-bottom: 10px;
+
+      .postInfo-container-item {
+        float: left;
+      }
+    }
+  }
+
+  .word-counter {
+    width: 40px;
+    position: absolute;
+    right: 10px;
+    top: 0px;
+  }
+}
+
+.article-textarea ::v-deep {
+  textarea {
+    padding-right: 40px;
+    resize: none;
+    border: none;
+    border-radius: 0px;
+    border-bottom: 1px solid #bfcbd9;
+  }
+}
+</style>

src/views/question/components/Dropdown/Comment.vue → src/views/dashboard/components/Dropdown/Comment.vue


src/views/question/components/Dropdown/Platform.vue → src/views/dashboard/components/Dropdown/Platform.vue


src/views/question/components/Dropdown/SourceUrl.vue → src/views/dashboard/components/Dropdown/SourceUrl.vue


src/views/question/components/Dropdown/index.js → src/views/dashboard/components/Dropdown/index.js


src/views/question/components/Warning.vue → src/views/dashboard/components/Warning.vue


src/views/question/create.vue → src/views/dashboard/create.vue


src/views/question/edit.vue → src/views/dashboard/edit.vue


+ 163 - 0
src/views/dashboard/list.vue

@@ -0,0 +1,163 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <router-link :to="{ path: '/dashboard/create' }">
+        <el-button v-waves class="filter-item" type="primary" icon="el-icon-edit">
+          新建用户
+        </el-button>
+      </router-link>
+    </div>
+    <el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
+      <el-table-column align="center" label="ID">
+        <template slot-scope="scope">
+          <span>{{ scope.row.id }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="名称">
+        <template slot-scope="{row}">
+          <span>{{ row.name }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="用户等级">
+        <template slot-scope="{row}">
+          <span>{{ row.type | typeFilter }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="是否是虚拟用户">
+        <template slot-scope="{row}">
+          <span>{{ row.isInvent | inventFilter }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="日期">
+        <template slot-scope="scope">
+          <span>{{ scope.row.createTime }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column class-name="status-col" align="center" label="状态">
+        <template slot-scope="{row}">
+          <el-tag :type="row.status | statusFilter">
+            {{ row.status == '1' ? "正常" : "删除" }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="操作" width="190" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <router-link :to="'/edit/'+scope.row.id">
+            <el-button type="primary" size="mini">
+              修改
+            </el-button>
+          </router-link>
+          <el-button type="danger" size="mini" style="margin-left: 10px;" :disabled="scope.row.status != 1" @click="handleDelete(scope)">
+            删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
+  </div>
+</template>
+
+<script>
+import { fetchList, deleteUser, fetchUser } from '@/api/user'
+import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
+import waves from '@/directive/waves'
+
+export default {
+  name: 'UserList',
+  components: { Pagination },
+  directives: { waves },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        1: 'success',
+        draft: 'info',
+        2: 'danger'
+      }
+      return statusMap[status]
+    },
+    typeFilter(type) {
+      const typeMap = {
+        1: '普通用户',
+        2: '医生认证',
+        3: '内部员工'
+      }
+      return typeMap[type]
+    },
+    inventFilter(invent) {
+      const typeMap = {
+        0: '否',
+        1: '是'
+      }
+      return typeMap[invent]
+    }
+  },
+  data() {
+    return {
+      list: null,
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 10
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.listLoading = true
+      fetchList(this.listQuery).then(response => {
+        this.list = response.data.list
+        this.total = response.data.count
+        this.listLoading = false
+      })
+    },
+    handleFilter() {
+      this.listLoading = true
+      fetchList(this.listQuery).then(response => {
+        this.list = response.data.list
+        this.total = response.data.count
+        this.listLoading = false
+      })
+    },
+    handleDelete({ $index, row }) {
+      console.log(row.id)
+      this.$confirm('您确定要隐藏吗', '警告', {
+        confirmButtonText: '是的',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(async() => {
+          await deleteUser(row.id)
+          const rs = await fetchUser(row.id)
+          this.list.splice($index, 1, rs.data.info)
+          this.$message({
+            type: 'success',
+            message: '隐藏成功'
+          })
+        })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.edit-input {
+  padding-right: 100px;
+}
+.cancel-btn {
+  position: absolute;
+  right: 15px;
+  top: 10px;
+}
+.filter-container{
+  margin-bottom: 20px;
+}
+.filter-item {
+  margin-right: 10px;
+}
+
+</style>

+ 0 - 85
src/views/form/index.vue

@@ -1,85 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-form ref="form" :model="form" label-width="120px">
-      <el-form-item label="Activity name">
-        <el-input v-model="form.name" />
-      </el-form-item>
-      <el-form-item label="Activity zone">
-        <el-select v-model="form.region" placeholder="please select your zone">
-          <el-option label="Zone one" value="shanghai" />
-          <el-option label="Zone two" value="beijing" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="Activity time">
-        <el-col :span="11">
-          <el-date-picker v-model="form.date1" type="date" placeholder="Pick a date" style="width: 100%;" />
-        </el-col>
-        <el-col :span="2" class="line">-</el-col>
-        <el-col :span="11">
-          <el-time-picker v-model="form.date2" type="fixed-time" placeholder="Pick a time" style="width: 100%;" />
-        </el-col>
-      </el-form-item>
-      <el-form-item label="Instant delivery">
-        <el-switch v-model="form.delivery" />
-      </el-form-item>
-      <el-form-item label="Activity type">
-        <el-checkbox-group v-model="form.type">
-          <el-checkbox label="Online activities" name="type" />
-          <el-checkbox label="Promotion activities" name="type" />
-          <el-checkbox label="Offline activities" name="type" />
-          <el-checkbox label="Simple brand exposure" name="type" />
-        </el-checkbox-group>
-      </el-form-item>
-      <el-form-item label="Resources">
-        <el-radio-group v-model="form.resource">
-          <el-radio label="Sponsor" />
-          <el-radio label="Venue" />
-        </el-radio-group>
-      </el-form-item>
-      <el-form-item label="Activity form">
-        <el-input v-model="form.desc" type="textarea" />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" @click="onSubmit">Create</el-button>
-        <el-button @click="onCancel">Cancel</el-button>
-      </el-form-item>
-    </el-form>
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      form: {
-        name: '',
-        region: '',
-        date1: '',
-        date2: '',
-        delivery: false,
-        type: [],
-        resource: '',
-        desc: ''
-      }
-    }
-  },
-  methods: {
-    onSubmit() {
-      this.$message('submit!')
-    },
-    onCancel() {
-      this.$message({
-        message: 'cancel!',
-        type: 'warning'
-      })
-    }
-  }
-}
-</script>
-
-<style scoped>
-.line{
-  text-align: center;
-}
-</style>
-

+ 37 - 14
src/views/home/components/ArticleDetail.vue

@@ -2,27 +2,50 @@
   <div class="createPost-container">
     <el-form ref="postForm" :label-position="labelPosition" :model="postForm" :rules="rules" class="form-container">
       <div class="createPost-main-container">
-        <el-form-item prop="img_url" style="" label="图片">
-          <Upload v-model="postForm.img_url" />
+        <el-form-item v-if="postForm.imageUrl.length > 1" prop="imageUrl" style="" label="图片">
+          <div v-for="(item1,index1) in postForm.imageUrlArr" :key="index1">
+            <div v-for="(item2,index2) in postForm.imageUrlArr[index1]" :key="index2" style="display: inline-flex;width: 230px">
+              <Upload v-model="postForm.imageUrlArr[index1][index2]" style="display: inline-flex;" />
+            </div>
+          </div>
         </el-form-item>
-        <el-form-item prop="sort" style="" label="排序(倒序)">
-          <el-input v-model="postForm.sort" placeholder="" type="number" style="width: 160px;" />
+        <el-form-item v-if="postForm.videoUrl.length > 1" prop="videoUrl" label="视频">
+          <video :src="postForm.videoUrl" controls style="width: 350px;height: 700px;" />
         </el-form-item>
-        <el-form-item prop="status" style="" label="状态">
+        <el-form-item v-if="postForm.audioUrl.length > 1" prop="audioUrl" style="" label="音频">
+          <audio :src="postForm.audioUrl" controls />
+        </el-form-item>
+        <el-form-item prop="title" style="" label="标题">
+          <el-input v-model="postForm.title" type="textarea" style="width: 500px;" autosize />
+        </el-form-item>
+        <el-form-item prop="content" style="" label="描述">
+          <el-input v-model="postForm.content" :rows="3" type="textarea" style="width: 500px;" autosize />
+        </el-form-item>
+        <el-form-item prop="zanNum" style="" label="点赞数">
+          <el-input v-model="postForm.zanNum" type="number" style="width: 150px;" />
+        </el-form-item>
+        <el-form-item prop="discussNum" style="" label="评论数">
+          <el-input v-model="postForm.discussNum" type="number" style="width: 150px;" />
+        </el-form-item>
+        <el-form-item prop="collectNum" style="width: 150px;" label="收藏数">
+          <el-input v-model="postForm.collectNum" type="number" style="width: 150px;" />
+        </el-form-item>
+        <el-form-item prop="views" style="" label="浏览次数">
+          <el-input v-model="postForm.views" type="number" style="width: 150px;" />
+        </el-form-item>
+        <el-form-item prop="level" style="" label="等级">
           <template>
-            <el-radio-group v-model="postForm.status">
-              <el-radio :label="0">隐藏</el-radio>
-              <el-radio :label="1">显示</el-radio>
+            <el-radio-group v-model="postForm.level">
+              <el-radio :label="2">精品帖</el-radio>
+              <el-radio :label="1">普通帖</el-radio>
             </el-radio-group>
           </template>
         </el-form-item>
-        <el-form-item prop="type" style="" label="类型">
+        <el-form-item prop="status" style="" label="状态">
           <template>
-            <el-radio-group v-model="postForm.type">
-              <el-radio :label="1">首页图片</el-radio>
-              <el-radio :label="2">合作图片</el-radio>
-              <el-radio :label="3">问答图片</el-radio>
-              <el-radio :label="4">如何合作图片</el-radio>
+            <el-radio-group v-model="postForm.status">
+              <el-radio :label="0">屏蔽</el-radio>
+              <el-radio :label="1">显示</el-radio>
             </el-radio-group>
           </template>
         </el-form-item>

+ 27 - 17
src/views/home/list.vue

@@ -1,42 +1,52 @@
 <template>
   <div class="app-container">
+    <div class="filter-container">
+      <el-input v-model="listQuery.content" placeholder="标题或内容" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
+      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
+        搜索
+      </el-button>
+    </div>
     <el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
-      <el-table-column align="center" label="ID" width="80">
+      <el-table-column align="center" label="ID">
         <template slot-scope="scope">
           <span>{{ scope.row.id }}</span>
         </template>
       </el-table-column>
-
-      <el-table-column width="180px" align="center" label="日期">
-        <template slot-scope="scope">
-          <span>{{ scope.row.create_time }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column align="center" label="排序">
+      <el-table-column align="center" label="日期">
         <template slot-scope="scope">
-          <span>{{ scope.row.sort }}</span>
+          <span>{{ scope.row.createTime }}</span>
         </template>
       </el-table-column>
-      <el-table-column class-name="status-col" label="状态" width="80ß">
+      <el-table-column class-name="status-col" label="状态">
         <template slot-scope="{row}">
           <el-tag :type="row.status | statusFilter">
-            {{ row.status == '1' ? "正常 " : "隐藏" }}
+            {{ row.status == '1' ? "正常 " : "屏蔽" }}
           </el-tag>
         </template>
       </el-table-column>
-      <el-table-column min-width="300px" label="类型">
-        <template slot-scope="{row}">
-          {{ row.type | typeFilter }}
+      <el-table-column label="用户">
+        <template slot-scope="scope">
+          <span>{{ scope.row.name }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="标题">
+        <template slot-scope="scope">
+          <span>{{ scope.row.title }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="权重">
+        <template slot-scope="scope">
+          <span>{{ scope.row.order }}</span>
         </template>
       </el-table-column>
-      <el-table-column align="center" label="Actions" width="230" class-name="small-padding fixed-width">
+      <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <router-link :to="'/home/edit/'+scope.row.id">
-            <el-button type="primary" size="mini" icon="el-icon-edit">
+            <el-button type="primary" size="mini">
               修改
             </el-button>
           </router-link>
-          <el-button type="danger" size="mini" icon="el-icon-s-check" style="margin-left: 10px;" :disabled="scope.row.status == '1' ? false : true" @click="handleDelete(scope)">
+          <el-button type="danger" size="mini" style="margin-left: 10px;" :disabled="scope.row.status == '1' ? false : true" @click="handleDelete(scope)">
             {{ scope.row.status == '1' ? "隐藏 " : "已隐藏" }}
           </el-button>
         </template>

+ 1 - 26
src/views/login/index.vue

@@ -40,19 +40,6 @@
           <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
         </span>
       </el-form-item>
-      <el-form-item prop="verify">
-        <el-input
-          ref="verify"
-          v-model="loginForm.verify"
-          placeholder="验证码"
-          name="verify"
-          type="text"
-          tabindex="1"
-          auto-complete="on"
-          style="width: 200px;"
-        />
-      </el-form-item>
-      <el-image class="verify" :src="url" @click="changeVerify()" />
       <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">Login</el-button>
     </el-form>
   </div>
@@ -79,13 +66,6 @@ export default {
         callback()
       }
     }
-    const validateVerify = (rule, value, callback) => {
-      if (!value) {
-        callback(new Error('请输出验证码'))
-      } else {
-        callback()
-      }
-    }
     return {
       loginForm: {
         username: 'admin',
@@ -95,7 +75,6 @@ export default {
       loginRules: {
         username: [{ required: true, trigger: 'blur', validator: validateUsername }],
         password: [{ required: true, trigger: 'blur', validator: validatePassword }],
-        verify: [{ required: true, trigger: 'blur', validator: validateVerify }]
       },
       loading: false,
       passwordType: 'password',
@@ -112,9 +91,6 @@ export default {
     }
   },
   created() {
-    verify().then(res => {
-      this.url = 'data:image/png;base64,' + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ''))
-    })
   },
   methods: {
     changeVerify() {
@@ -136,12 +112,11 @@ export default {
       this.$refs.loginForm.validate(valid => {
         if (valid) {
           this.loading = true
-          console.log(this.loginForm)
           this.$store.dispatch('user/login', this.loginForm).then(() => {
             this.$router.push({ path: this.redirect || '/' })
             this.loading = false
           }).catch(() => {
-            this.changeVerify()
+            // this.changeVerify()
             this.loading = false
           })
         } else {

+ 0 - 7
src/views/nested/menu1/index.vue

@@ -1,7 +0,0 @@
-<template>
-  <div style="padding:30px;">
-    <el-alert :closable="false" title="menu 1">
-      <router-view />
-    </el-alert>
-  </div>
-</template>

+ 0 - 0
src/views/nested/menu1/menu1-1/index.vue


Some files were not shown because too many files changed in this diff