Browse Source

员工管理模块的开发

xiaoming_global 5 years ago
parent
commit
fd2c13111e

+ 20 - 2
src/App.vue View File

@@ -1,11 +1,29 @@
1 1
 <template>
2 2
   <div id="app">
3
-    <router-view></router-view>
3
+    <router-view v-if="isRouterAlive"></router-view>
4 4
   </div>
5 5
 </template>
6 6
 
7 7
 <script>
8 8
   export default{
9
-    name: 'App'
9
+    name: 'App',
10
+    provide () {
11
+      return {
12
+        reload:this.reload
13
+      }
14
+    },
15
+    data(){
16
+      return{
17
+        isRouterAlive:true
18
+      }
19
+    },
20
+    methods: {
21
+       reload(){
22
+         this.isRouterAlive = false;
23
+         this.$$nextTick(function(){
24
+           this.isRouterAlive = true;
25
+         })
26
+       }
27
+    }
10 28
   }
11 29
 </script>

+ 24 - 0
src/api/act/staffmanager.js View File

@@ -0,0 +1,24 @@
1
+import request from '@/utils/request'
2
+
3
+export function addStaffInfo (data){
4
+    console.log("文章列表",data)
5
+    return request({
6
+        url: '/api/staff/addStaffInfo',
7
+        method: 'Post',
8
+        data: data
9
+    })
10
+}
11
+
12
+export function getAllStaffInfo (param,keyword) {
13
+    console.log("param",param,"keyword",keyword)
14
+    const params = {
15
+        param: param,
16
+        keyword:keyword,
17
+    }
18
+
19
+    return request({
20
+        url:'/api/staff/getAllStaffInfo',
21
+        method:'Get',
22
+        params:params
23
+    })
24
+}

+ 104 - 3
src/api/act/submitinfo.js View File

@@ -18,11 +18,18 @@ export function getArticleType(params){
18 18
      })
19 19
 }
20 20
 
21
-export function GetAllArticles(params){
21
+export function GetAllArticles(param,status,keyword,id){
22
+    const params = {
23
+        param:param,
24
+        status:status,
25
+        keyword:keyword,
26
+        id:id,
27
+    }
28
+    console.log("params是什么?",params)
22 29
      return request({
23 30
          url:'/api/acticle/getAllArticles',
24 31
          method:'Get',
25
-         params:params
32
+         params:params,
26 33
      })
27 34
 }
28 35
 
@@ -75,4 +82,98 @@ export function Savedraft(data){
75 82
         method:"post",
76 83
         data:data,
77 84
     })
78
-}
85
+}
86
+
87
+export function previewArticle(data){
88
+    return request({
89
+        url:"/api/acticle/prviewArticle",
90
+        method:"post",
91
+        data:data
92
+    })
93
+}
94
+
95
+export function getarticlePreview(params){
96
+   return request({
97
+       url:"/api/acticle/getarticlePreview",
98
+       method:'Get',
99
+       params:params
100
+   })
101
+}
102
+
103
+export function save(data){
104
+   return request({
105
+       url:"/api/acticle/save",
106
+       method:"Post",
107
+       data:data
108
+   })
109
+}
110
+
111
+export function openDelete(data){
112
+    return request({
113
+        url:"/api/article/Delete",
114
+        method:"delete",
115
+        data:data
116
+    })
117
+}
118
+
119
+
120
+export function getEditArticle(id,param){
121
+    console.log("params是啥?",param)
122
+    return request({
123
+        url:"/api/acticle/getEditArticle?id="+id,
124
+        method:"Get",
125
+        param:param,
126
+    })
127
+}
128
+
129
+export function getMenus(params){
130
+    console.log("params是什么",params)
131
+    return request({
132
+        url:"/api/acticle/getMenus",
133
+        method:'Get',
134
+        params:params
135
+    })
136
+}
137
+
138
+export function UpdataArticleInfo(id,data){
139
+   console.log("修改文章内容",data)
140
+   return request({
141
+       url:"/api/acticle/updateArticlesInfo?id="+id,
142
+       method:'Post',
143
+       data:data
144
+   })
145
+}
146
+
147
+export function previewEditArticle(id,data){
148
+   return request({
149
+       url:"/api/acticle/previewEditArticle?id="+id,
150
+       method:'Post',
151
+       data:data
152
+   })
153
+}
154
+
155
+export function getPreviewInfo(params){
156
+    return request({
157
+        url:"/api/acticle/getPreviewInfo",
158
+        method:'Post',
159
+        params:params,
160
+    })
161
+}
162
+
163
+export function getAllComment(params){
164
+    console.log("评论",params)
165
+    return request({
166
+        url:"/api/acticle/getAllComment",
167
+        method:'Get',
168
+        params:params,
169
+    })
170
+}
171
+
172
+export function getArticleCommentDetail(params,id){
173
+    console.log("文章评论详情",id)
174
+    return request({
175
+        url:"/api/acticle/getArticleCommentDetail?id="+id,
176
+        method:'Get',
177
+        params:params,
178
+    })
179
+}

+ 2 - 0
src/lang/zh.js View File

@@ -51,8 +51,10 @@ export default {
51 51
     articleCategory: '文章分类',
52 52
     commentList: '评论列表',
53 53
     articleComment: '文章评论',
54
+    articleCommentDetail:'文章评论详情',
54 55
     editArticle: '编辑文章',
55 56
     articleList: '文章列表',
57
+    articlePreview:'文章预览',
56 58
     errorPages: '错误页面',
57 59
     page401: '401',
58 60
     page404: '404',

+ 29 - 1
src/router/modules/article.js View File

@@ -40,6 +40,34 @@ export default {
40 40
       component: () => import('@/scrm_pages/article/articleComment'),
41 41
       name: 'articleComment',
42 42
       meta: { title: 'articleComment', noCache: true }
43
-    }
43
+    },
44
+    {
45
+      path: '/articles/articlePreview',
46
+      component: () => import('@/scrm_pages/article/articlePreview'),
47
+      name: 'articlePreview',
48
+      hidden:true,
49
+      meta: { title: 'articlePreview', noCache: true }
50
+    },
51
+    {
52
+      path: '/articles/editArticle/:id',
53
+      component: () => import('@/scrm_pages/article/editArticle'),
54
+      name: 'editArticle',
55
+      hidden:true,
56
+      meta: { title: 'editArticle', noCache: true }
57
+    },
58
+    {
59
+      path: '/articles/articleEditPreview',
60
+      component: () => import('@/scrm_pages/article/articleEditPreview'),
61
+      name: 'articleEditPreview',
62
+      hidden:true,
63
+      meta: { title: 'articleEditPreview', noCache: true }
64
+    },
65
+    {
66
+      path: '/articles/articleCommentDetail/:id',
67
+      component: () => import('@/scrm_pages/article/articleCommentDetail'),
68
+      name: 'articleCommentDetail',
69
+      hidden:true,
70
+      meta: { title: 'articleCommentDetail', noCache: true }
71
+    },
44 72
   ]
45 73
 }

+ 2 - 2
src/scrm_pages/article/acticleCategory.vue View File

@@ -179,7 +179,7 @@
179 179
                 var res = response.data;
180 180
                 if(res.state === 1){
181 181
                     this.articsData.splice(index,1);
182
-                    this.$message.success("删除会员成功");
182
+                    this.$message.success("删除成功");
183 183
                 }else{
184 184
                    this.$message.error(res.msg);
185 185
                 }
@@ -193,7 +193,7 @@
193 193
         },
194 194
         openDeleteCategorys(){
195 195
             if (this.selectedMembers.length==0) {
196
-            this.$message.error("请选择要删除的会员");
196
+            this.$message.error("请选择要删除的信息");
197 197
             return false;
198 198
           }   
199 199
 

+ 47 - 14
src/scrm_pages/article/articleComment.vue View File

@@ -6,28 +6,30 @@
6 6
     <div class="app-container">
7 7
       <el-row :gutter="12" style="margin-top: 10px">
8 8
         <el-table
9
-          :data="cancelStockDate"
10
-          :class="signAndWeighBoxPatients"
11
-          border
12
-          highlight-current-row
13
-          ref="multipleTable"
9
+         :data="articsData"
10
+          border fit highlight-current-row
14 11
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
15
-        >
12
+        >   
13
+           <el-table-column
14
+                align="center" 
15
+                type="selection"
16
+                width="55">
17
+          </el-table-column> 
16 18
           <el-table-column label="标题" align="center">
17 19
             <template slot-scope="scope">
18
-            123
20
+            {{scope.row.title}}
19 21
           </template>
20 22
           </el-table-column>
21 23
 
22 24
           <el-table-column label="评论状态" align="center">
23
-            <template slot-scope="scope">
24
-              456
25
+            <template>
26
+              <span>正常</span>
25 27
             </template>
26 28
           </el-table-column>
27 29
 
28 30
           <el-table-column label="总评论数" align="center">
29 31
             <template slot-scope="scope">
30
-              789
32
+             {{scope.row.comment_num}}
31 33
             </template>
32 34
           </el-table-column>
33 35
 
@@ -39,7 +41,7 @@
39 41
                   size="mini"
40 42
                   type="primary"
41 43
                   icon="el-icon-edit-outline"
42
-                  @click="handleEdit(scope.$index, scope.row)">
44
+                  @click="$router.push('/articles/articleCommentDetail/'+scope.row.id)">
43 45
                 </el-button>
44 46
               </el-tooltip>
45 47
             </template>
@@ -50,8 +52,8 @@
50 52
         <el-pagination
51 53
           @size-change="handleSizeChange"
52 54
           @current-change="handleCurrentChange"
53
-          :page-sizes="[7]"
54
-          :page-size="7"
55
+          :page-sizes="[10,20,50,100]"
56
+          :page-size="10"
55 57
           background
56 58
           style="margin-top:20px;float: right"
57 59
           layout="total, sizes, prev, pager, next, jumper"
@@ -65,6 +67,7 @@
65 67
 
66 68
 <script>
67 69
   import BreadCrumb from '../components/bread-crumb'
70
+   import { getAllComment } from '@/api/act/submitinfo'
68 71
   export default {
69 72
     name: 'articleComment',
70 73
     components:{
@@ -74,9 +77,39 @@
74 77
       return{
75 78
         crumbs: [
76 79
           { path: false, name: '文章管理' },
77
-          { path: '/articles/articleComment', name: '评论列表' }
80
+          { path: '/articles/articleComment', name: '文章评论' }
78 81
         ],
82
+        listQuery:{
83
+           page:1,
84
+           limit:10,
85
+           title:'',
86
+           commentNnum:'',
87
+        },
88
+         articsData:[],
89
+         handleSizeChange(limit) {
90
+            this.listQuery.limit = limit;
91
+            this.GetAllAritcles();
92
+        },
93
+         handleCurrentChange(page) {
94
+            this.listQuery.page = page;
95
+            this.GetAllAritcles();
96
+        },
97
+        total:0,
79 98
       }
99
+    },
100
+    methods:{
101
+         getAllComment(){
102
+           getAllComment(this.listQuery).then(response=>{
103
+                if(response.data.state == 1){
104
+                   this.articsData = response.data.data.articles; 
105
+                   console.log("文章内容",this.articsData)                 
106
+                   this.total =  response.data.data.total                 
107
+                }
108
+           });
109
+         }
110
+    },
111
+    created(){
112
+      this.getAllComment();
80 113
     }
81 114
   }
82 115
 </script>

+ 70 - 0
src/scrm_pages/article/articleCommentDetail.vue View File

@@ -0,0 +1,70 @@
1
+<template>
2
+     <div class="main-contain">
3
+        <div class="position">
4
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+             <el-button  style="float:right;" type="primary" size="small"  @click="$router.push('/articles/articleComment')">返回全部文章</el-button>
6
+        </div>
7
+        <div class="app-container">
8
+             <div class="title">{{listQuerty.title}}</div>
9
+             <div>{{listQuerty.publicTime}}</div>
10
+             <div class="sort">已按最新热度排序</div>
11
+            <div class="border"></div>          
12
+        </div>
13
+     </div>
14
+</template>
15
+
16
+<script>
17
+   import BreadCrumb from '../components/bread-crumb'
18
+   import { getArticleCommentDetail } from '@/api/act/submitinfo'
19
+    export default {
20
+        name: "articleCommentDetail",
21
+        components:{
22
+            BreadCrumb
23
+         },
24
+         data(){
25
+             return{
26
+                 crumbs: [
27
+                   { path: false, name: '文章管理' },
28
+                   { path: '/articles/articleComment', name: '文章评论详情' }
29
+                ],
30
+                listQuerty:{
31
+                   title:'',
32
+                   publicTime:'',
33
+                }
34
+             }
35
+         },
36
+         created(){
37
+            this.getArticleCommentDetail(); 
38
+         },
39
+         methods:{
40
+             getArticleCommentDetail(){
41
+                 const id = this.$route.params && this.$route.params.id
42
+                 console.log("id",id)
43
+                 getArticleCommentDetail(this.listQuerty,id).then(response=>{
44
+                        if(response.data.state == 1){
45
+                            var articles = response.data.data.articles
46
+                            this.listQuerty.title = articles.title
47
+                            this.listQuerty.publicTime =  articles.publicTime
48
+                            console.log("内容是设么",articles)
49
+                        }
50
+                 })
51
+             }
52
+         }
53
+    }
54
+
55
+</script>
56
+
57
+<style scoped>
58
+   .border{
59
+       border: 1px #dcdfe6 solid;
60
+       margin-top: 30px;
61
+   }
62
+   .title{
63
+       font-size: 25px;
64
+       margin-bottom: 20px;
65
+   }
66
+   .sort{
67
+      float: right;
68
+      font-size: 18px;
69
+   }
70
+</style>

+ 89 - 0
src/scrm_pages/article/articleEditPreview.vue View File

@@ -0,0 +1,89 @@
1
+<template>
2
+     <div class="main-contain">
3
+         <div class="position">
4
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+         </div>
6
+         <div class="app-container">
7
+            <el-form label-width="90px" class="clearfix" :model="form" ref="acticleform">
8
+                 <el-row :span=20>
9
+                    <el-form-item>
10
+                        <div class="title">
11
+                           {{form.title}}
12
+                        </div>
13
+                    </el-form-item>
14
+                 </el-row>
15
+                 <el-row :span=20>
16
+                     <el-form-item>
17
+                         <div  class="cont">
18
+                           <li v-html="form.content"></li>
19
+                         </div>
20
+                     </el-form-item>
21
+                 </el-row>
22
+                 <el-row :span=20>
23
+                 <el-form-item>
24
+                    <div class="but">
25
+                      <el-button type="primary" @click="clossPreview()">关闭预览</el-button>
26
+                    </div>    
27
+                 </el-form-item>
28
+          </el-row>        
29
+            </el-form>
30
+       </div>
31
+     </div>
32
+</template>
33
+
34
+<script>
35
+    import BreadCrumb from '../components/bread-crumb'
36
+      import { getPreviewInfo } from '@/api/act/submitinfo'
37
+    export default {
38
+        name: "articleEditPreview",
39
+         components:{
40
+            BreadCrumb
41
+        },
42
+        data(){
43
+            return{
44
+                 crumbs: [
45
+                     { path: false, name: '文章管理' },
46
+                     { path: '/articles/articleEditPreview', name: '文章编辑预览' }
47
+                ],
48
+                form:{
49
+                    title:'',
50
+                    content:'',
51
+                }
52
+            }
53
+        },
54
+        methods:{
55
+            articleEditPreview(){
56
+                getPreviewInfo(this.form).then(response=>{
57
+                      if(response.data.state == 1){
58
+                         this.form =  response.data.data.articles;
59
+                         var articles =  response.data.data.articles
60
+                         console.log("articles",articles)        
61
+                      }
62
+                })   
63
+            },
64
+            clossPreview(){
65
+              this.$router.push({path:'/articles/articleList'})
66
+            }
67
+        },
68
+        created(){
69
+            this.articleEditPreview();
70
+        }
71
+    }
72
+</script>
73
+      
74
+<style scoped>
75
+    .title{
76
+       font-size: 20px;
77
+       position: relative;
78
+       left: 750px;
79
+    }
80
+
81
+    .cont{
82
+      position: relative;
83
+      left: 200px;
84
+    }
85
+    .but{
86
+      position: relative;
87
+      left: 750px;
88
+    }
89
+</style>

+ 133 - 42
src/scrm_pages/article/articleList.vue View File

@@ -2,14 +2,14 @@
2 2
   <div class="main-contain">
3 3
     <div class="position">
4 4
       <bread-crumb :crumbs='crumbs'></bread-crumb>
5
-      <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline">添加文章</el-button>
5
+      <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="AddArticle()">添加文章</el-button>
6 6
     </div>
7 7
     <div class="app-container">
8 8
           <div style="margin-bottom: 10px">
9 9
             <el-row :gutter="24">
10 10
               <el-col :span="8">
11
-                  <el-input style="width: 300px" v-model="listQuery.search"  placeholder="请输入您需要搜索的内容"></el-input>
12
-                  <el-button type="primary"  icon="el-icon-search" @click="changeKey">搜索</el-button>
11
+                  <el-input style="width: 300px" v-model="keyword"  placeholder="请输入您需要搜索的内容"></el-input>
12
+                  <el-button type="primary"  icon="el-icon-search" @click="changeKey()">搜索</el-button>
13 13
               </el-col>
14 14
             </el-row>
15 15
           </div>
@@ -17,8 +17,8 @@
17 17
             <label class="title"><span class="name">标签</span>:</label>
18 18
              <div class="time">
19 19
                 <ul class="">
20
-                  <li :class="0==schedulType?'active':''" @click="selectsign(0)">全部</li>
21
-                  <li :class="item.MenuId==schedulType?'active':''"  v-for="item in schedulArr" :key="item.MenuId" @click="selectsign(item.MenuId)">{{item.Name}}</li>
20
+                  <li :class="0==tagType?'active':''" @click="selectsign(0)">全部</li>
21
+                  <li :class="item.id==tagType?'active':''"  v-for="item in tagOptions" :key="item.id" @click="selectsign(item.id)">{{item.name}}</li>
22 22
                 </ul>
23 23
              </div>
24 24
           </div>
@@ -26,16 +26,18 @@
26 26
             <label class="title"><span class="name">状态:</span></label>
27 27
             <div class="time">
28 28
               <ul class="">
29
-                <!-- <li :class="0==systemType?'active':''" @click="selectStatus(0)">全部</li> -->
30
-                <li :class="item.value==systemType?'active':''" v-for="item in systemArr" :key="item.value">{{item.label}}</li>
29
+                 <li :class="{ active: selecting_status == 0 }" @click="changeSelectingStatus(0)">全部</li>
30
+                 <li :class="{ active: selecting_status == 1 }" @click="changeSelectingStatus(1)">已发布</li>
31
+                 <li :class="{ active: selecting_status == 2 }" @click="changeSelectingStatus(2)">草稿箱</li>
32
+                 <li :class="{ active: selecting_status == 3 }" @click="changeSelectingStatus(3)">未通过</li>
31 33
               </ul>
32 34
             </div>
33 35
           </div>
34 36
           <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
35
-            <el-checkbox style="width: 30px">全选</el-checkbox>
36
-            <el-button size="small" icon="el-icon-delete">删除</el-button>
37
+            <el-checkbox style="width: 30px" @change="changeCheck" v-model="checkAllStatus">全选</el-checkbox>
38
+            <el-button size="small" icon="el-icon-delete" @click="openDeletearticles">批量删除</el-button>
37 39
           </div>
38
-          <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="ArticleData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
40
+          <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="articsData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;"  @selection-change="handleSelectionChange">
39 41
               <el-table-column
40 42
                 align="center" 
41 43
                 type="selection"
@@ -43,7 +45,13 @@
43 45
               </el-table-column> 
44 46
              <el-table-column label="文章图片" align="center">
45 47
                <template slot-scope="scope">
46
-                  <img :src="memberAvatar(scope.row)" alt="" srcset="" style="width:100px;height:100px;" >
48
+                  <div class="parent">
49
+                 <span class="text">已发布</span>  
50
+                 <div class="triangle-topleft">
51
+                       
52
+                 </div>
53
+                <img :src="memberAvatar(scope.row)" style="width:100%;height:100%">
54
+          </div>     
47 55
                </template>
48 56
              </el-table-column>
49 57
             <el-table-column label="文章标题" align="center">
@@ -63,7 +71,7 @@
63 71
             </el-table-column>
64 72
             <el-table-column label="点赞数" align="center">
65 73
               <template slot-scope="scope">
66
-                  {{scope.row.num}}
74
+                  {{scope.row.star_num}}
67 75
               </template>
68 76
             </el-table-column>
69 77
             <el-table-column label="操作" align="center">
@@ -73,11 +81,11 @@
73 81
                     size="mini"
74 82
                     type="primary"
75 83
                     icon="el-icon-edit-outline"
76
-                    @click="handleEdit(scope.$index, scope.row)">
84
+                    @click="$router.push('/articles/editArticle/'+scope.row.id)">
77 85
                   </el-button>
78 86
                 </el-tooltip>
79 87
                  <el-tooltip class="item" effect="dark" content="删除" placement="top">
80
-                  <el-button size="mini" type="danger" icon="el-icon-delete" @click="openDelete(scope.row, scope.$index)" ></el-button>
88
+                  <el-button size="mini" type="danger" icon="el-icon-delete"  @click="openDelete(scope.row,scope.$index)" ></el-button>
81 89
                 </el-tooltip>
82 90
               </template>
83 91
             </el-table-column>
@@ -98,12 +106,13 @@
98 106
 
99 107
 <script>
100 108
   import BreadCrumb from '../components/bread-crumb'
101
-  import { GetAllArticles } from '@/api/act/submitinfo'
109
+  import { GetAllArticles,openDelete} from '@/api/act/submitinfo'
102 110
   export default {
103 111
     name: 'commentList',
104 112
     components:{
105 113
       BreadCrumb
106 114
     },
115
+    inject:['reload'],
107 116
     data(){
108 117
       return{
109 118
         crumbs: [
@@ -112,49 +121,42 @@
112 121
         ],
113 122
         time: '',
114 123
         active: true,
115
-        schedulType: 0,
116
-        schedulArr:[],
117
-        systemType: 0,
118
-        systemArr: [
119
-          { value: 0, label: "全部" },
120
-          { value: 1, label: "已发布" },
121
-          { value: 2, label: "草稿箱" },
122
-          { value: 2, label: "未通过" }
123
-        ],
124
+        tagType: 0,
125
+        tagOptions:[],
124 126
         listQuery:{
125 127
             page:1,
126 128
             limit:10,
127
-            search:'',
128 129
             classid:'',
130
+            name:'',
129 131
         },
130
-        ArticleData:[],
132
+        articsData:[],
131 133
         total:0,
134
+        selecting_status:'',
135
+        keyword:'',
136
+        dialogVisible: false,
137
+         checkAllStatus:false,
132 138
       }
133 139
     },
134 140
     methods:{
135 141
          GetAllArticles(){
136
-              GetAllArticles(this.listQuery).then(response=>{
142
+              GetAllArticles(this.listQuery,this.selecting_status,this.keyword,this.listQuery.classid).then(response=>{
137 143
                      if(response.data.state === 1){
138
-                        this.ArticleData = response.data.data.articles  
144
+                        this.articsData = response.data.data.articles  
139 145
                         this.total = response.data.data.total
140
-                        console.log("文章列表",this.ArticleData)
146
+                        console.log("文章列表",this.articsData)
141 147
                         console.log("total",this.total)                                                   
142 148
                      }
143 149
                      if(typeof(response.data.data.category != 'undefined')){
144
-                       this.schedulArr = response.data.data.category
145
-                        console.log("分类列表",response.data.data.category)
146
-                       
150
+                       this.tagOptions = response.data.data.category
151
+                        console.log("分类列表",this.tagOptions)                      
147 152
                      }
148 153
               })
149 154
          },
150
-         selectsign(MenuId){
151
-            this.listQuery.classid = MenuId;
152
-            this.schedulArr = MenuId;
153
-            this.GetAllArticles();
154
-         },
155
-         selectStatus(id){
156
-            this.listQuery.status = id;
157
-            this.systemType = id;
155
+         selectsign(id){
156
+           console.log("id",id)
157
+            this.listQuery.classid = id;
158
+            this.listQuery.name = name;
159
+            this.tagType = id;
158 160
             this.GetAllArticles();
159 161
          },
160 162
           handleSizeChange(limit) {
@@ -170,7 +172,75 @@
170 172
         },
171 173
         memberAvatar(row){
172 174
              return row.imgs
173
-        }
175
+        },
176
+        AddArticle(){
177
+           this.$router.push({path:'/articles/createArticle'})
178
+        },
179
+        changeSelectingStatus(status){
180
+          this.selecting_status = status;
181
+          this.GetAllArticles();
182
+        },
183
+        openDelete(row,index){
184
+             var  id = row.id;
185
+            this.$confirm('确认要删除该信息吗?删除后将无法恢复!',{
186
+              dangerouslyUseHTMLString:true,
187
+             confirmButtonText: '确定',
188
+             cancelButtonText: '取消',
189
+             type: 'warning' 
190
+            }).then(()=>{
191
+                var ids = [];
192
+                ids.push(row.id);
193
+                openDelete({ids:ids}).then(response=>{
194
+                    this.articsData.splice(index,1);
195
+                    this.$message.success("删除成功");
196
+                }).catch(e=>{});       
197
+          }).catch(e=>{});
198
+        },
199
+         
200
+          handleSelectionChange(val){
201
+             this.selectedArticles = val;
202
+         },
203
+         changeCheck(){
204
+          this.$refs.multipleTable.clearSelection();
205
+           if (this.checkAllStatus) {
206
+            this.$refs.multipleTable.toggleAllSelection();
207
+            }
208
+          },
209
+
210
+          openDeletearticles(){
211
+            if (this.selectedArticles.length==0) {
212
+              this.$message.error("请选择要删除的信息");
213
+            return false;
214
+           } 
215
+           this.$confirm('确定要删除吗?删除后信息将无法恢复!','删除提示',{
216
+               dangerouslyUseHTMLString:true,
217
+               confirmButtonText: '确定',
218
+               cancelButtonText: '取消',
219
+               type: 'warning'
220
+           }).then(()=>{
221
+                var ids = [];
222
+                var idMap = {};
223
+                for (const index in this.selectedArticles) {
224
+                ids.push(this.selectedArticles[index].id);
225
+                idMap[this.selectedArticles[index].id] = this.selectedArticles[index].id;
226
+            }
227
+               openDelete({ids:ids}).then(response=>{
228
+                   if(response.data.state == 1){
229
+                         var articsDatalength = this.articsData.length;
230
+                     for (let index = articsDatalength-1; index >= 0; index--) {
231
+                    if(this.articsData[index].id in idMap) {
232
+                    this.articsData.splice(index, 1);
233
+                   }                  
234
+                 }
235
+                  this.$message.success("删除成功");   
236
+                }else{
237
+                   this.$message.success("删除失败");   
238
+                 }
239
+               }).catch(e=>{});
240
+           }).catch(() => {
241
+              return false        
242
+           }); 
243
+          }
174 244
     },
175 245
     created(){
176 246
       this.GetAllArticles()
@@ -179,5 +249,26 @@
179 249
 </script>
180 250
 
181 251
 <style scoped>
182
-     
252
+      .parent{
253
+        position: relative;
254
+        width: 160px;
255
+        height: 120px;
256
+        left: 20px;
257
+    }
258
+    .parent .text{
259
+        display: inline-block;
260
+        transform: rotate(-45deg);
261
+        padding: 20px;
262
+        color:red;
263
+        position: relative;
264
+        left: -60px;
265
+    }
266
+   .triangle-topleft{
267
+        width: 0;
268
+        height: 0;
269
+        border-top: 70px solid yellow;
270
+        border-right: 70px solid transparent;
271
+        position: relative;
272
+        margin-top: -140px;       
273
+    }
183 274
 </style>

+ 90 - 0
src/scrm_pages/article/articlePreview.vue View File

@@ -0,0 +1,90 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+    <div class="app-container">
7
+          <el-form label-width="90px" class="clearfix" :model="form" ref="acticleform">
8
+           <el-row :span=20>
9
+            <el-form-item>
10
+                <div class="title">
11
+                 {{form.title}}
12
+                </div>    
13
+            </el-form-item>
14
+          </el-row> 
15
+           <el-row :span=20>
16
+            <el-form-item>
17
+                <div class="cont">
18
+                   <!-- {{form.content}} -->
19
+                   <li v-html="form.content"></li>
20
+                </div>    
21
+            </el-form-item>
22
+          </el-row>
23
+           <el-row :span=20>
24
+            <el-form-item>
25
+                <div class="but">
26
+                   <el-button type="primary" @click="clossPreview()">关闭预览</el-button>
27
+                </div>    
28
+            </el-form-item>
29
+          </el-row>         
30
+        </el-form>
31
+    </div>
32
+  </div>
33
+</template>
34
+
35
+<script>
36
+  import BreadCrumb from '../components/bread-crumb'
37
+  import { getarticlePreview } from '@/api/act/submitinfo'
38
+  export default {
39
+    name: 'articlePreview',
40
+    components:{
41
+      BreadCrumb
42
+    },
43
+    data(){
44
+      return{
45
+        crumbs: [
46
+          { path: false, name: '文章管理' },
47
+          { path: '/articles/articlePreview', name: '文章预览' }
48
+        ],
49
+        form:{
50
+            title:'',
51
+            content:'',
52
+        },
53
+      }
54
+    },
55
+    methods:{
56
+          getarticlePreview(){
57
+              getarticlePreview(this.form).then(response=>{
58
+                    if(response.data.state == 1){
59
+                       this.form =  response.data.data.articles;
60
+                       console.log("预览数据",this.form);
61
+                    }  
62
+              });
63
+          },
64
+          clossPreview(){
65
+            this.$router.push({path:'/articles/articleList'})
66
+          }
67
+    },
68
+    created(){
69
+        this.getarticlePreview();
70
+    },
71
+  }
72
+</script>
73
+
74
+<style scoped>
75
+    .title{
76
+        font-size: 20px;
77
+        position: relative;
78
+        left: 750px;
79
+    }
80
+
81
+    .cont{
82
+      position: relative;
83
+      left: 200px;
84
+    }
85
+    .but{
86
+      position: relative;
87
+      left: 750px;
88
+    }
89
+
90
+</style>

+ 40 - 91
src/scrm_pages/article/commentList.vue View File

@@ -4,23 +4,16 @@
4 4
           <bread-crumb :crumbs='crumbs'></bread-crumb>
5 5
         </div>
6 6
         <div class="app-container">
7
-           评论列表
8
-           <el-form-item ref="videocontentvideo" style="display:none;">
9
-              <img :src="imgurl">
10
-              <video width="320" height="240" controls id="upvideo">
11
-              </video>
12
-              <img :src="modlevidel" />
13
-            </el-form-item>
14
-
15
-            <el-form-item class="upload-demo-content" v-show="formLabelAlign.type==2">
16
-            <el-upload class="upload-demo" :limit="1" :on-exceed="exceedhandle" drag :file-list="filsListArray" :action="configuploadurl" :on-success="successuploadhandle" accept="video" name="fileList" :before-upload="beforeUploadVideo">
17
-              <i class="el-icon-upload"></i>
18
-              <div class="el-upload__text">将视频文件拖到此处,或
19
-                <em>点击上传</em>
20
-              </div>
21
-              <div class="el-upload__tip" slot="tip"></div>
22
-            </el-upload>
23
-          </el-form-item>
7
+          <div class="parent">
8
+                 <span class="text"></span>  
9
+                 <div class="triangle-topleft">
10
+                   
11
+                 </div>
12
+                <div class="title">
13
+                  已使用
14
+                </div>
15
+                 <img src="/static/images/a.jpg" style="width:100%;height:100%">
16
+          </div>           
24 17
         </div>
25 18
     </div>
26 19
 </template>
@@ -38,86 +31,42 @@
38 31
           { path: false, name: '文章管理' },
39 32
           { path: '/articles/commentList', name: '评论列表' }
40 33
         ],
41
-        imgurl:'',
42
-        modlevidel:'',
43
-        formLabelAlign:'',
44
-        modlevidel:'',
45
-        filsListArray:[],
46
-        elForm:'',
47
-        configuploadurl:'',
48 34
       }
49 35
     },
50 36
     methods:{
51
-      successuploadhandle(response, file, fileList) {
52
-      this.formLabelAlign.video = this.modlevidel =
53
-        response.data.fileList[0].url;
54
-        this.filsListArray = [];
55
-        this.filsListArray.push({
56
-        name: this.formLabelAlign.video,
57
-        url: this.formLabelAlign.video
58
-       });
59
-        this.findvideocover();
60
-    },
61
-      exceedhandle(files, fileList) {
62
-      this.$message.error("只能上传一个视频额");
63
-      },
64
-      beforeUploadVideo(file) {
65
-      if (
66
-        [
67
-          "video/mp4",
68
-          "video/ogg",
69
-          "video/flv",
70
-          "video/avi",
71
-          "video/wmv",
72
-          "video/rmvb"
73
-        ].indexOf(file.type) == -1
74
-      ) {
75
-        this.$message.error("请上传正确的视频格式");
76
-        return false;
77
-      }
78
-     },
79
-
80
-     findvideocover() {
81
-      let _this = this;
82
-      this.$nextTick(() => {
83
-        let video = document.getElementById("upvideo");
84
-        let source = document.createElement("source");
85
-        // source.src = require("../../assets/5b086751dbb7af1ea8fa8d05e66fe5c3.mp4");this.formLabelAlign.video
86
-        source.src = this.formLabelAlign.video;
87
-        source.type = "video/mp4";
88
-        video.appendChild(source);
89
-        video.addEventListener("loadeddata", function() {
90
-          var canvas = document.createElement("canvas");
91
-          canvas.width = "320";
92
-          canvas.height = "320";
93
-          canvas
94
-            .getContext("2d")
95
-            .drawImage(video, 0, 0, canvas.width, canvas.width);
96
-          var img = document.createElement("img");
97
-          let imgsrc = canvas.toDataURL("image/png");
98
-          _this.Videoframehandle(imgsrc.split(",")[1]);
99
-        });
100
-      });
101
-      },
102
-
103
-      showvideohandle() {
104
-       this.$alert(
105
-        `<video width="320" height="240" controls>
106
-                      <source src="${
107
-                        this.filsListArray[0].url
108
-                      }"  type="video/mp4">
109
-                      您的浏览器不支持 HTML5 video 标签。
110
-                    </video>`,
111
-        "视频预览",
112
-        {
113
-          dangerouslyUseHTMLString: true
114
-        }
115
-      );
116
-    },
117 37
     }
118 38
   }
119 39
 </script>
120 40
 
121 41
 <style scoped>
122
-
42
+    .parent{
43
+        position: relative;
44
+        width: 200px;
45
+        height: 200px;
46
+        background: yellow;
47
+        font-size: 6px;
48
+    }
49
+    .parent .text{
50
+        display: inline-block;
51
+        transform: rotate(-45deg);
52
+        padding: 20px;
53
+        color: #fff;
54
+        position: relative;
55
+    }
56
+   .triangle-topleft{
57
+        width: 0;
58
+        height: 0;
59
+        border-top: 100px solid red;
60
+        border-right: 100px solid transparent;
61
+        position: relative;
62
+        margin-top: -42px;
63
+        top: 0px;
64
+        z-index: 0;   
65
+    }
66
+    .title{
67
+       transform: rotate(-45deg);
68
+       position: relative;
69
+       margin-top: -115px;
70
+       margin-left: -8px;
71
+    }
123 72
 </style>

+ 3 - 3
src/scrm_pages/article/components/CreateArticleForm.vue View File

@@ -93,9 +93,9 @@
93 93
                             });
94 94
                        }   
95 95
                    });         
96
-          },  
97
-       }
98
-    }
96
+              },  
97
+          }
98
+      }  
99 99
 </script>
100 100
 
101 101
 <style scoped>

+ 1 - 3
src/scrm_pages/article/components/EditArticleForm.vue View File

@@ -89,12 +89,10 @@ export default {
89 89
                            console.log("返回响应",res.state)
90 90
                            if(res.state ===1 ){
91 91
                               var categorys = res.data.category; 
92
-                              console.log("categorys是什么",categorys)
92
+                              console.log("categorys是什么",categorys.name)
93 93
                               this.articsData[this.artilceIndex].name = categorys.name;
94 94
                               this.articsData[this.artilceIndex].summary = categorys.summary;
95 95
                               this.articsData[this.artilceIndex].order = categorys.order;
96
-                              //this.articsData.unshift(categorys);
97
-                              // this.resetForm("acticleform");
98 96
                               this.centerDialogVisible = false;
99 97
                               this.$message.success("编辑文章分类成功");
100 98
                            }

+ 33 - 9
src/scrm_pages/article/createArticle.vue View File

@@ -7,7 +7,7 @@
7 7
     <div class="app-container">
8 8
     <el-tabs type="border-card">
9 9
       <el-tab-pane label="文章">
10
-        <el-form label-width="100px" class="clearfix" :model="form" ref="arctileform"  :element-loading-text="loadingText" :rules="artilcrules">
10
+        <el-form label-width="100px" class="clearfix" :model="form" ref="arctileform"  :element-loading-text="loadingText" :rules="staffrules">
11 11
           <el-row>
12 12
             <el-col :span="23">
13 13
                 <el-form-item label="文章标题:" required prop="act_name">
@@ -96,8 +96,8 @@
96 96
                 <el-form-item>
97 97
                       <el-button size="small" type="primary" style="width: 100px"  @click="submitForm('arctileform');centerDialogVisible=false">发布</el-button>
98 98
                       <el-button size="small" style="width: 100px" @click="preview('arctileform')">预览</el-button>
99
-                      <el-button size="small" style="width: 100px">保存草稿</el-button>
100
-                  <el-button size="small" style="width: 100px">取消</el-button>
99
+                      <el-button size="small" style="width: 100px" @click="save('arctileform');centerdraftVisible = false">保存草稿</el-button>
100
+                  <el-button size="small" style="width: 100px" @click="centercancelVisible = true">取消</el-button>
101 101
                 </el-form-item>
102 102
             </el-col>
103 103
           </el-row>
@@ -204,7 +204,7 @@
204 204
        center>
205 205
        <span style="center">是否确定取消编辑此文章/视频</span>
206 206
        <span slot="footer" class="dialog-footer">
207
-       <el-button type="primary" @click="centercancelVisible = false" >确认</el-button>
207
+       <el-button type="primary" @click="confirm()" >确认</el-button>
208 208
        <el-button @click="centercancelVisible = false">取消</el-button>   
209 209
         </span>   
210 210
       </el-dialog>
@@ -218,7 +218,7 @@
218 218
   import 'quill/dist/quill.snow.css'
219 219
   import 'quill/dist/quill.bubble.css'
220 220
   import Neditor from '@/components/Neditor'
221
-  import {submitForm,getArticleType,addVido,Savedraft} from '@/api/act/submitinfo'
221
+  import {submitForm,getArticleType,addVido,Savedraft,previewArticle,save} from '@/api/act/submitinfo'
222 222
   import { getToken } from '@/api/qiniu'
223 223
   import { getFileExtension} from '@/utils/tools'
224 224
   export default {
@@ -233,7 +233,7 @@
233 233
           { path: false, name: '文章管理' },
234 234
           { path: '/articles/createArticle', name: '发布文章' }
235 235
         ],
236
-         radio:'1',
236
+        radio:'1',
237 237
         options: [],
238 238
         value: '',
239 239
         show:false,
@@ -285,7 +285,6 @@
285 285
             act_type: [{required: true,message:"所属分类不能为空"}]
286 286
         },
287 287
         vidoform:[],
288
-        ue:'',
289 288
       }
290 289
     },
291 290
     created(){
@@ -390,6 +389,7 @@
390 389
             return false
391 390
       },
392 391
       beforeAvatarlastUpload(file) {
392
+        console.log("冷醒是",file.type)
393 393
         const isJPG = file.type === 'image/jpeg';
394 394
         const isLt2M = file.size / 1024 / 1024 < 2;
395 395
 
@@ -569,11 +569,35 @@
569 569
          console.log("文章内容",this.$refs.neditor.content)
570 570
          this.$refs[formName].validate((valid)=>{
571 571
             if(valid){
572
-               preview(this.form).then(response=>{
573
-                    this.$router.go(0);
572
+              //  console.log("内容是什么?",this.form)
573
+              //  this.$router.push({path:'/articles/articlePreview'})
574
+               previewArticle(this.form).then(response=>{
575
+                    if(response.data.state ==1){
576
+                        var art = response.data.data.art
577
+                        console.log("act的数据是",art);
578
+                        this.$router.push({path:'/articles/articlePreview'})
579
+                    }
574 580
                });
575 581
             }
576 582
          });
583
+      },
584
+      save(formName){
585
+         this.form.act_content = this.$refs.neditor.content;
586
+         console.log("文章内容",this.$refs.neditor.content);
587
+         this.$refs[formName].validate((valid)=>{
588
+             if(valid){
589
+                 save(this.form).then(response=>{
590
+                   if(response.data.state ==1){
591
+                     this.centerdraftVisible = true;
592
+                     var articles = response.data.data.articles;
593
+                     console.log("返回的数据是",articles)                   
594
+                   }
595
+                 });
596
+             }
597
+         });
598
+      },
599
+      confirm(){
600
+         this.$router.push({path:"/articles/articleList"})
577 601
       }
578 602
     },
579 603
   }

+ 428 - 0
src/scrm_pages/article/editArticle.vue View File

@@ -0,0 +1,428 @@
1
+
2
+
3
+<template>
4
+    <div class="main-contain">
5
+        <div class="position">
6
+            <bread-crumb :crumbs='crumbs'></bread-crumb>
7
+        </div>
8
+        <div class="app-container">
9
+             <el-form label-width="100px" class="clearfix" :model="form" ref="arctileform"  :element-loading-text="loadingText" :rules="artilcrules">
10
+          <el-row>
11
+            <el-col :span="23">
12
+                <el-form-item label="文章标题:" required prop="title">
13
+                    <el-input v-model="form.title"></el-input>
14
+                </el-form-item>
15
+              <el-form-item label="文章内容:" required prop="content">
16
+                <keep-alive>
17
+                  <neditor ref="neditor"
18
+                           id="editor"
19
+                           v-bind:r_content="form.content">
20
+                  </neditor>
21
+                </keep-alive>
22
+              </el-form-item>
23
+              <el-form-item label="封面图片:">
24
+                  <el-radio v-model="radio" label="1" @click.native.prevent="select()" >单图</el-radio>
25
+                  <el-radio v-model="radio" label="2" @click.native.prevent="clickitem()" >三图</el-radio>
26
+              </el-form-item>
27
+              <el-form-item>
28
+                <el-col :span="3">
29
+                  <div>
30
+                    <el-upload
31
+                      v-loading="uploading"
32
+                      :element-loading-text="loadingText"
33
+                      class="avatar-uploader"
34
+                      :data="uploadData"
35
+                      action="https://upload.qiniup.com"
36
+                      :show-file-list="false"
37
+                      :on-error="handleAvatarError"
38
+                      :on-success="handleAvatarSuccess"
39
+                      :before-upload="beforeAvatarUpload">
40
+                      <img v-if="form.imgs" :src="form.imgs" class="avatar">
41
+                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
42
+                    </el-upload>
43
+                  </div>
44
+                </el-col>
45
+                <el-col :span="3">
46
+                  <div v-if="show">
47
+                    <el-upload
48
+                      v-loading="uploading"
49
+                      :element-loading-text="loadingText"
50
+                      class="avatar-uploader"
51
+                      :data="uploadData"
52
+                      action="https://upload.qiniup.com"
53
+                      :show-file-list="false"
54
+                      :on-error="handleAvatartwoError"
55
+                      :on-success="handleAvatartwoSuccess"
56
+                      :before-upload="beforeAvatartwoUpload">
57
+                      <img v-if="imageUrlSecond" :src="imageUrlSecond" class="avatar">
58
+                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
59
+                    </el-upload>
60
+                  </div>
61
+                </el-col>
62
+                <el-col :span="3">
63
+                  <div v-if="show">
64
+                    <el-upload
65
+                      v-loading="uploading"
66
+                      :element-loading-text="loadingText"
67
+                      class="avatar-uploader"
68
+                      :data="uploadData"
69
+                      action="https://upload.qiniup.com"
70
+                      :show-file-list="false"
71
+                      :on-error="handleAvatarlastError"
72
+                      :on-success="handleAvatarlastSuccess"
73
+                      :before-upload="beforeAvatarlastUpload">
74
+                      <img v-if="imageUrlLast" :src="imageUrlLast" class="avatar">
75
+                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
76
+                    </el-upload>
77
+                  </div>
78
+                </el-col>
79
+              </el-form-item>
80
+               <el-form-item label="所属分类:" prop="class_id">
81
+                 <el-select v-model="form.class_id" placeholder="请先选择文章所属分类"  @change="changeActtype()">
82
+                   <el-option
83
+                     v-for="item in options"
84
+                     :key="item.id"
85
+                     :label="item.name"
86
+                     :value="item.id">
87
+                   </el-option>
88
+                 </el-select>
89
+               </el-form-item>
90
+            </el-col>
91
+          </el-row>
92
+
93
+          <el-row :span="24">
94
+            <el-col :span="24">
95
+                <el-form-item>
96
+                      <el-button size="small" type="primary" style="width: 100px"  @click="UpdataArticleInfo('arctileform');">发布</el-button>
97
+                      <el-button size="small" style="width: 100px" @click="preview('arctileform')">预览</el-button>
98
+                      <el-button size="small" style="width: 100px" @click="save('arctileform');centerdraftVisible = false">保存草稿</el-button>
99
+                  <el-button size="small" style="width: 100px" @click="centercancelVisible = true">取消</el-button>
100
+                </el-form-item>
101
+            </el-col>
102
+          </el-row>
103
+        </el-form>
104
+
105
+        <el-dialog
106
+           title="发表成功"
107
+           :visible.sync="dialogVisible"
108
+            width="30%"
109
+            center>
110
+           <span>这是一段信息</span>
111
+           <span slot="footer" class="dialog-footer">
112
+           <el-button @click="gobackList()">返回文章列表</el-button>
113
+           </span>
114
+         </el-dialog>
115
+
116
+        <el-dialog
117
+           title="发表成功"
118
+           :visible.sync="dialogVisible"
119
+            width="30%"
120
+            center>
121
+           <span>这是一段信息</span>
122
+           <span slot="footer" class="dialog-footer">
123
+           <el-button @click="gobackList()">返回文章列表</el-button>
124
+           </span>
125
+         </el-dialog>
126
+         
127
+       <el-dialog
128
+         title="提示"
129
+         :visible.sync = "centercancelVisible"
130
+         width="30%"
131
+         center>
132
+         <span style="center">是否确定取消编辑此文章/视频</span>
133
+         <span slot="footer" class="dialog-footer">
134
+         <el-button type="primary" @click="centercancelVisible = false" >确认</el-button>
135
+         <el-button @click="centercancelVisible = false">取消</el-button>   
136
+        </span>   
137
+       </el-dialog>
138
+        </div>
139
+    </div>
140
+</template>
141
+
142
+<script>
143
+    import BreadCrumb from '../components/bread-crumb'
144
+    import { quillEditor } from 'vue-quill-editor'
145
+    import 'quill/dist/quill.core.css'
146
+    import 'quill/dist/quill.snow.css'
147
+    import 'quill/dist/quill.bubble.css'
148
+    import Neditor from '@/components/Neditor'
149
+    import { getToken } from '@/api/qiniu'
150
+    import { getFileExtension} from '@/utils/tools'
151
+    import {getEditArticle,getMenus,UpdataArticleInfo,previewEditArticle} from '@/api/act/submitinfo'
152
+    export default {
153
+        name: "editArticle",
154
+         components:{
155
+            BreadCrumb,
156
+            Neditor,
157
+         },
158
+         data(){
159
+            return {
160
+             crumbs: [
161
+              { path: false, name: '文章管理' },
162
+              { path: '/articles/editArticle/:id', name: '编辑文章' }
163
+              ],
164
+               radio:'1',
165
+        options: [],
166
+        value: '',
167
+        show:false,
168
+        content: '',
169
+        editorOption: {},
170
+        company:"",
171
+        fileList: [],
172
+        form:{
173
+          class_id:'', 
174
+          content:'',                        
175
+          imgs:'',                
176
+          title:'',                 
177
+          file:'',
178
+        },
179
+         acttypes:[],
180
+         imageUrl:'',
181
+         imageUrlSecond:'',
182
+         imageUrlLast:'',
183
+         formloading:false,
184
+         formsubmit:false,
185
+         qiniuDomain: 'https://images.shengws.com/',
186
+         uploading:false,
187
+         loadingText:'',
188
+         uploadData: { token: '', key: '' },
189
+         uploadFileData:{token:'',key:''},
190
+         uploadvidoData:{token:'',key:''},
191
+         centerDialogVisible: false,
192
+         centerdraftVisible:false,
193
+         centercancelVisible:false,
194
+         formLabelAlign:true,
195
+         modlevidel:'',
196
+         filsListArray:[],
197
+         show:true,
198
+         shows:false,
199
+         rules: {
200
+            vid_name: [{required: true, message: "视频标题不能为空"},],
201
+            vio_upload: [{required: true,message:"请上传视频"}],
202
+            vid_type: [{required: true,message:"所属分类不能为空"}]
203
+          },
204
+        artilcrules:{
205
+            title: [{required: true, message: "文章标题不能为空"},],
206
+            content: [{required: true,message:"文章内容不能为空"}],
207
+            class_id: [{required: true,message:"所属分类不能为空"}]
208
+        },
209
+        vidoform:[],
210
+        dialogVisible:false,
211
+        }
212
+    },
213
+         methods:{
214
+             //第一个图片
215
+      handleAvatarSuccess(res, file) {
216
+       this.form.org_logo = this.qiniuDomain + res.url;
217
+        this.uploading = false
218
+      },
219
+       handleAvatarError(err, file, fileList) {
220
+            this.$message.error(err);
221
+            this.uploading = false;
222
+            return false
223
+      },
224
+      beforeAvatarUpload(file) {
225
+        const isJPG = file.type === 'image/jpeg';
226
+        const isLt2M = file.size / 1024 / 1024 < 2;
227
+
228
+        if (!isJPG) {
229
+          this.$message.error('上传头像图片只能是 JPG 格式!');
230
+        }
231
+        if (!isLt2M) {
232
+          this.$message.error('上传头像图片大小不能超过 2MB!');
233
+        }
234
+
235
+            var date = new Date()
236
+            var ext = getFileExtension(file.name)
237
+            var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
238
+            this.uploading = true;
239
+            this.loadingText = '封面图片上传中'
240
+
241
+            const _self = this
242
+            return new Promise((resolve, reject) => {
243
+                getToken().then(response => {
244
+                    const token = response.data.data.uptoken
245
+                    console.log("token是什么?",token)
246
+                    _self._data.uploadData.token = token
247
+                    _self._data.uploadData.key = key
248
+                    resolve(true)
249
+                }).catch(err => {
250
+                    reject(false)
251
+                    this.uploading = false;
252
+                })
253
+            })
254
+      },
255
+      //第二个图片
256
+      handleAvatartwoSuccess(res, file) {
257
+        this.imageUrlSecond = URL.createObjectURL(file.raw);
258
+        this.form.org_logo = this.qiniuDomain + res.url;
259
+        this.uploading = false
260
+      },
261
+       handleAvatartwoError(err, file, fileList) {
262
+            this.$message.error(err);
263
+            this.uploading = false;
264
+            return false
265
+      },
266
+      beforeAvatartwoUpload(file) {
267
+        const isJPG = file.type === 'image/jpeg';
268
+        const isLt2M = file.size / 1024 / 1024 < 2;
269
+
270
+        if (!isJPG) {
271
+          this.$message.error('上传头像图片只能是 JPG 格式!');
272
+        }
273
+        if (!isLt2M) {
274
+          this.$message.error('上传头像图片大小不能超过 2MB!');
275
+        }
276
+
277
+            var date = new Date()
278
+            var ext = getFileExtension(file.name)
279
+            var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
280
+            this.uploading = true;
281
+            this.loadingText = '封面图片上传中'
282
+
283
+            const _self = this
284
+            return new Promise((resolve, reject) => {
285
+                getToken().then(response => {
286
+                    const token = response.data.data.uptoken
287
+                    console.log("token是什么?",token)
288
+                    _self._data.uploadData.token = token
289
+                    _self._data.uploadData.key = key
290
+                    resolve(true)
291
+                }).catch(err => {
292
+                    reject(false)
293
+                    this.uploading = false;
294
+                })
295
+            })
296
+      },
297
+
298
+      //第三张图片
299
+      handleAvatarlastSuccess(res, file) {
300
+        this.imageUrlLast = URL.createObjectURL(file.raw);
301
+        this.form.org_logo = this.qiniuDomain + res.url;
302
+        this.uploading = false
303
+      },
304
+       handleAvatarlastError(err, file, fileList) {
305
+            this.$message.error(err);
306
+            this.uploading = false;
307
+            return false
308
+      },
309
+      beforeAvatarlastUpload(file) {
310
+        const isJPG = file.type === 'image/jpeg';
311
+        const isLt2M = file.size / 1024 / 1024 < 2;
312
+
313
+        if (!isJPG) {
314
+          this.$message.error('上传头像图片只能是 JPG 格式!');
315
+        }
316
+        if (!isLt2M) {
317
+          this.$message.error('上传头像图片大小不能超过 2MB!');
318
+        }
319
+
320
+            var date = new Date()
321
+            var ext = getFileExtension(file.name)
322
+            var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
323
+            this.loadingText = '封面图片上传中'
324
+
325
+            const _self = this
326
+            return new Promise((resolve, reject) => {
327
+                getToken().then(response => {
328
+                    const token = response.data.data.uptoken
329
+                    console.log("token是什么?",token)
330
+                    _self._data.uploadData.token = token
331
+                    _self._data.uploadData.key = key
332
+                    resolve(true)
333
+                }).catch(err => {
334
+                    reject(false)
335
+                })
336
+            }) 
337
+        },
338
+        getEditArticle(id){
339
+           getEditArticle(id,this.form).then(response=>{
340
+                 if(response.data.state == 1){
341
+                     var articles = response.data.data.articles;
342
+                     this.form.title = articles.title;
343
+                     this.form.content = articles.content;
344
+                     this.form.imgs = articles.imgs;
345
+                     this.form.class_id = articles.class_id;
346
+                     console.log(articles.title)
347
+                     console.log("文章内容",articles)
348
+                 }
349
+           });
350
+        }, 
351
+        getMenus(){
352
+            getMenus().then(response =>{
353
+                if(response.data.state == 1){
354
+                   var categorys = response.data.data.categorys;
355
+                   this.options = categorys;
356
+                   console.log("分类号",categorys)
357
+                   
358
+                }
359
+            })
360
+        },
361
+        
362
+        UpdataArticleInfo(forName){
363
+              this.form.act_content = this.$refs.neditor.content;
364
+              const id = this.$route.params && this.$route.params.id;
365
+             console.log("文章内容",this.$refs.neditor.content);
366
+             console.log("id是多少?",id)
367
+             this.$refs[forName].validate((valid)=>{
368
+                 if(valid){
369
+                    UpdataArticleInfo(id,this.form).then(response=>{
370
+                         if(response.data.state == 1){
371
+                             this.dialogVisible = true;      
372
+                         }
373
+                    }); 
374
+                 }
375
+             })
376
+        },
377
+        gobackList(){
378
+           this.$router.push({path:'/articles/articleList'})
379
+        },
380
+        preview(forName){
381
+            this.form.act_content = this.$refs.neditor.content;
382
+            const id = this.$route.params && this.$route.params.id; 
383
+            this.$refs[forName].validate((valid)=>{
384
+              if(valid){
385
+                 previewEditArticle(id,this.form).then(response=>{
386
+                   if(response.data.state == 1){
387
+                       this.$router.push("/articles/articleEditPreview")
388
+                   }
389
+                 })
390
+              }
391
+            })
392
+        }
393
+      },
394
+      created(){
395
+         const id = this.$route.params && this.$route.params.id;
396
+         console.log("id是什么?",id)
397
+          this.getEditArticle(id)
398
+          this.getMenus()
399
+      },
400
+    }
401
+</script>
402
+
403
+<style scoped>
404
+     .avatar-uploader{
405
+    border: 1px solid #d9d9d9;
406
+    border-radius: 6px;
407
+    cursor: pointer;
408
+    overflow: hidden;
409
+    width: 140px;
410
+    height: 140px;
411
+  }
412
+  .avatar-uploader{
413
+    border-color: #f0f2f5;
414
+  }
415
+  .avatar-uploader-icon {
416
+    font-size: 25px;
417
+    color: #8c939d;
418
+    width: 140px;
419
+    height: 140px;
420
+    line-height: 140px;
421
+    text-align: center;
422
+  }
423
+  .avatar {
424
+    width: 178px;
425
+    height: 178px;
426
+    display: block;
427
+  }
428
+</style>

+ 1 - 1
src/scrm_pages/marketing_tool/activity_list.vue View File

@@ -86,7 +86,7 @@ export default {
86 86
 
87 87
     getActivities() {
88 88
       this.loading_activities = true
89
-      fetchActivities(this.current_page, this.keyword, this.selecting_status).then(rs => {
89
+      fetchActivities(this.current_page, this.keyword,this.selecting_status).then(rs => {
90 90
         this.loading_activities = false
91 91
         var resp = rs.data
92 92
         if (resp.state == 1) {

+ 1 - 0
src/scrm_pages/members/members.vue View File

@@ -222,6 +222,7 @@
222 222
                     this.total = res.data.total;
223 223
                     if(typeof(res.data.cards) != 'undefined') {
224 224
                         this.levelCards = res.data.cards;
225
+                        console.log("levelCard是什么",levelCards)
225 226
                     }
226 227
                     if(typeof(res.data.tags) != 'undefined') {
227 228
                         this.tagOptions = res.data.tags;

+ 292 - 0
src/scrm_pages/systemsetting/components/CreateStaffForm.vue View File

@@ -0,0 +1,292 @@
1
+<template>
2
+        <div id="create-staff-form-box">
3
+        <el-dialog
4
+              title="添加会员"
5
+              :visible.sync="centerDialogVisible"
6
+              width="50%"
7
+              center>
8
+              <el-form label-width="100px" class="clearfix" :model="form" ref="staffform" :rules="staffrules">
9
+                 <el-row>
10
+                   <el-col :span="12">
11
+                      <el-form-item label="姓名:"  required prop="name">
12
+                           <el-input placeholder="请输入姓名" v-model="form.name">
13
+
14
+                           </el-input>
15
+                      </el-form-item>
16
+                   </el-col>
17
+                   <el-col :span="12">
18
+                     <el-form-item label="手机号:" required prop="phone">
19
+                       <el-input placeholder="请输入手机号" v-model="form.phone">
20
+
21
+                       </el-input>
22
+                     </el-form-item>
23
+                   </el-col>
24
+                 </el-row>
25
+                <el-row>
26
+                   <el-col :span="12">
27
+                       <el-form-item label="性别:" required prop="gender">
28
+                           <el-radio-group v-model="form.gender" @change="selectGender">
29
+                                <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in genderOptions" :key="index">{{gender.name}}</el-radio>
30
+                            </el-radio-group>
31
+                       </el-form-item>
32
+                   </el-col>
33
+                  <el-col :span="12">
34
+                    <el-form-item label="生日:" required prop="birthday">
35
+                          <el-date-picker v-model="form.birthday"  prefix-icon="el-icon-date" :editable="false" style="width: 100%;" type="date" placeholder="请选择日期" align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd" ></el-date-picker>
36
+                    </el-form-item>
37
+                  </el-col>
38
+                </el-row>
39
+                <el-row>
40
+                    <el-col :span="8">
41
+                        <el-form-item label="员工职称:" required prop="user_type">
42
+                          <template>
43
+                            <el-select v-model="form.user_type" placeholder="请选择">
44
+                             <el-option
45
+                                v-for="item in user_types"
46
+                                :key="item.index"
47
+                                :label="item.name"
48
+                                :value="item.index">
49
+                             </el-option>
50
+                            </el-select>
51
+                          </template>
52
+                        </el-form-item>
53
+                    </el-col>
54
+
55
+                  <el-col :span="6">
56
+                      <template>
57
+                        <el-select v-model="form.user_title"  placeholder="请选择">
58
+                          <el-option
59
+                            v-for="item in user_titles"
60
+                            :key="item.index"
61
+                            :label="item.name"
62
+                            :value="item.index">
63
+                          </el-option>
64
+                        </el-select>
65
+                      </template>
66
+                  </el-col>
67
+                  <el-col :span="4">
68
+                      <el-form-item label="医生头像:" required prop="dochead">
69
+                        <el-upload
70
+                          class="avatar-uploader"
71
+                          action="https://upload.qiniup.com"
72
+                          :show-file-list="false"
73
+                          :on-success="handleAvatarSuccess"
74
+                          :before-upload="beforeAvatarUpload"
75
+                          :on-error="handleAvatarError"
76
+                          :data="uploadData">
77
+                          <img v-if="form.dochead" :src="form.dochead" class="avatar">
78
+                          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
79
+                        </el-upload>
80
+                      </el-form-item>
81
+                    </el-col>
82
+                </el-row>
83
+                 <el-row>
84
+                     <el-col :span="24">
85
+                         <el-form-item label="医生简介:" required prop="content">
86
+                           <keep-alive>
87
+                             <neditor ref="neditor"
88
+                                      id="editor"
89
+                                      v-bind:r_content="form.content">
90
+                             </neditor>
91
+                           </keep-alive>
92
+                         </el-form-item>
93
+                     </el-col>
94
+                 </el-row>
95
+              </el-form>
96
+              <span slot="footer" class="dialog-footer">
97
+              <el-button @click="centerDialogVisible = false">取 消</el-button>
98
+              <el-button type="primary" @click="addStaffInfo('staffform');">保存</el-button>
99
+               </span>
100
+          </el-dialog>
101
+         </div>
102
+</template>
103
+
104
+<script>
105
+      import Neditor from '@/components/Neditor'
106
+      import {addStaffInfo} from '@/api/act/staffmanager'
107
+      import {getToken} from '@/api/qiniu'
108
+      import {getFileExtension,checkMobile,uParseTime} from '@/utils/tools'
109
+    export default {
110
+        name: "CreateStaffForm",
111
+         components:{
112
+           Neditor,
113
+       },
114
+      props:{
115
+        staffsData:{
116
+         type: Array,
117
+         default: function () {
118
+          return [];
119
+        }
120
+        }
121
+     },
122
+       data(){
123
+          var checkMobileRule = (rule, value, callback) => {
124
+            if (!checkMobile(value)) {
125
+            callback(new Error('请填写正确的手机号'));
126
+              }else {
127
+               callback();
128
+             }
129
+          };
130
+   
131
+           return {
132
+                crumbs: [
133
+          { path: false, name: '系统设置' },
134
+          { path: '/Systemsetting/staffmanagement', name: '员工管理' }
135
+        ],
136
+         centerDialogVisible: false,
137
+          radio: '1',
138
+          value: '',
139
+          qiniuDomain: 'https://images.shengws.com/',
140
+          uploadData: { token: '', key: '' },
141
+         user_types: [
142
+            { index: 2, name: '医生' },
143
+            { index: 3, name: '护士' },
144
+            { index: 4, name: '运营' },
145
+            ],
146
+        user_titles: [
147
+            { index: 1, name: '医士' },
148
+            { index: 2, name: '医师' },
149
+            { index: 3, name: '住院医师' },
150
+            { index: 4, name: '主治医师' },
151
+            { index: 5, name: '副主任医师' },
152
+            { index: 6, name: '主任医师' },
153
+            { index: 7, name: '护士' },
154
+            { index: 8, name: '护师' },
155
+            { index: 9, name: '主管护师' },
156
+            { index: 10, name: '副主任护师' },
157
+            { index: 11, name: '主任护师' },
158
+            { index: 12, name: '运营专员' },
159
+            { index: 13, name: '运营主管' },
160
+            ],
161
+        imageUrl: '',
162
+
163
+        form:{
164
+          name:'',
165
+          phone:'',
166
+          birthday:'',
167
+          gender:'',
168
+          user_type:'',
169
+          user_title:'',
170
+          dochead:'',
171
+          page:1,
172
+          limit:10,
173
+          content:'',
174
+        },
175
+         keyword:'',
176
+        staffform:[],
177
+         staffrules:{
178
+            name: [{required: true, message: "姓名不能为空"},],
179
+            phone: [{required: true,message:"手机号码不能为空"},{validator:checkMobileRule}],
180
+            birthday: [{required: true,message:"生日不能为空"}],
181
+            gender: [{required: true,message:"性别不能为空"}],
182
+            user_type: [{required: true,message:"职称类别不能为空"}],
183
+            user_title: [{required: true,message:"职称不能为空"}],
184
+            content: [{required: true,message:"医生简介不能为空"}],
185
+            dochead: [{required: true,message:"头像不能为空"}],
186
+        },
187
+         genderOptions:[
188
+          {id:1, name:'男'},
189
+          {id:2, name:'女'},
190
+         ],
191
+         staffData:[],
192
+          }
193
+           },
194
+          methods:{
195
+            open:function(){
196
+            this.centerDialogVisible = true;
197
+            },
198
+            resetForm(formName) {
199
+               if (typeof(this.$refs[formName]) !='undefined') {
200
+                this.$refs[formName].resetFields();
201
+                }
202
+              },
203
+            handleAvatarSuccess(res, file) {
204
+              this.form.dochead =  this.qiniuDomain + res.url;
205
+              },
206
+             beforeAvatarUpload(file) {
207
+              const isJPG = file.type === 'image/jpeg';
208
+              console.log("是什么呢",isJPG)
209
+              const isLt2M = file.size / 1024 / 1024 < 2;
210
+             if (!isJPG) {
211
+              this.$message.error('上传头像图片只能是JPG或者png格式!');
212
+            }
213
+            if (!isLt2M) {
214
+              this.$message.error('上传头像图片大小不能超过 2MB!');
215
+            }
216
+
217
+             var date = new Date()
218
+             var ext = getFileExtension(file.name)
219
+             var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours()  + date.getMinutes()  + date.getSeconds()  +'_o_' + file.uid + '.' + ext;
220
+             this.uploading = true;
221
+             this.loadingText = '封面图片上传中'
222
+             const _self = this
223
+            return new Promise((resolve, reject) => {
224
+            getToken().then(response => {
225
+            const token = response.data.data.uptoken
226
+            console.log("token是什么?",token)
227
+            _self._data.uploadData.token = token
228
+             _self._data.uploadData.key = key
229
+               resolve(true)
230
+              }).catch(err => {
231
+                reject(false)
232
+                })
233
+               })
234
+              },
235
+          selectGender:function(gender) {
236
+            if(gender == 2) {
237
+             this.form.avatar = 'https://images.shengws.com/201809182128222.png';
238
+            }else {
239
+              this.form.avatar = 'https://images.shengws.com/201809182128111.png';
240
+            }
241
+          },
242
+             handleAvatarError(err, file, fileList) {
243
+               this.$message.error(err);
244
+               return false
245
+              },
246
+
247
+                addStaffInfo(forName){
248
+                this.form.content = this.$refs.neditor.content;
249
+                console.log("文章内容",this.$refs.neditor.content)
250
+                this.$refs[forName].validate((valid)=>{
251
+                 if(valid){
252
+                addStaffInfo(this.form).then(response=>{
253
+                 if(response.data.state ==1){
254
+                    var staffInfo = response.data.data.staffInfo
255
+                    this.centerDialogVisible=false;
256
+                    this.staffsData.unshift(staffInfo);
257
+                    this.resetForm("staffform");
258
+                    this.$message.success("保存成功");     
259
+                 }
260
+               })
261
+              }
262
+             })
263
+            },
264
+          }
265
+       }
266
+</script>
267
+
268
+<style scoped>
269
+     .avatar-uploader{
270
+      border: 1px dashed  #d9d9d9;
271
+      border-radius: 1px;
272
+      cursor: pointer;
273
+      position: relative;
274
+      overflow: hidden;
275
+    }
276
+    .avatar-uploader{
277
+      border-color: #d9d9d9;
278
+    }
279
+    .avatar-uploader-icon {
280
+      font-size: 20px;
281
+      color: #8c939d;
282
+      width: 44px;
283
+      height: 50px;
284
+      line-height: 50px;
285
+      text-align: center;
286
+    }
287
+    .avatar {
288
+      width: 68px;
289
+      height: 50px;
290
+      display: block;
291
+    }
292
+</style>

+ 122 - 171
src/scrm_pages/systemsetting/staffmanagement.vue View File

@@ -2,49 +2,58 @@
2 2
   <div class="main-contain">
3 3
     <div class="position">
4 4
       <bread-crumb :crumbs='crumbs'></bread-crumb>
5
-       <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="centerDialogVisible = true" >添加员工</el-button>
5
+       <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="openCreate()" >添加员工</el-button>
6 6
     </div>
7 7
     <div class="app-container">
8 8
          <div>
9 9
              <el-row :gutter="24">
10 10
                 <el-col :span="8">
11
-                  <el-input style="width: 300px"  placeholder="请输入您需要搜索的内容"></el-input>
12
-                  <el-button type="primary"  icon="el-icon-search" @click="changeKey">搜索</el-button>
11
+                  <el-input style="width: 300px" v-model="keyword"  placeholder="请输入您需要搜索的内容"></el-input>
12
+                  <el-button type="primary"  icon="el-icon-search" @click="changeKey()">搜索</el-button>
13 13
                 </el-col>
14 14
              </el-row>
15 15
          </div>
16 16
          <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
17
-            <el-checkbox style="width: 30px" v-model="checked" @change="changeAllSelected">全选</el-checkbox>
18
-            <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
17
+            <el-checkbox style="width: 30px">全选</el-checkbox>
18
+            <el-button size="small" icon="el-icon-delete" @click="">删除</el-button>
19 19
           </div>
20
-              <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="tableData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
20
+              <el-table ref="multipleTable" 
21
+              :header-cell-style="{ backgroundColor: 
22
+              'rgb(245, 247, 250)'}" 
23
+              :data="staffData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
21 24
               <el-table-column
22 25
                 type="selection"
23 26
                 width="55">
24 27
               </el-table-column>
25 28
               <el-table-column label="员工" align="center">
26 29
                <template slot-scope="scope">
27
-
30
+                  <div style="display:flex;align-items: center;">
31
+                   <img :src="staffAvatar(scope.row)" alt="" srcset="" style="width:50px;height:50px; border-radius:50%;margin-right:5px;" >
32
+                    <div>
33
+                     <span>{{scope.row.name}}</span>
34
+                    </div>
35
+                 </div>
36
+                  <!-- {{scope.row.name}} -->
28 37
                </template>
29 38
              </el-table-column>
30
-            <el-table-column label="职称" align="center">
39
+            <el-table-column label="职称" align="center" >
31 40
               <template slot-scope="scope">
32
-
41
+                   {{staffTitle(scope.row.user_title)}}
33 42
               </template>
34 43
             </el-table-column>
35 44
             <el-table-column label="介绍" align="center">
36 45
               <template slot-scope="scope">
37
-
46
+                 <li v-html="scope.row.content"></li>
38 47
               </template>
39 48
             </el-table-column>
40 49
             <el-table-column label="手机号" align="center">
41 50
               <template slot-scope="scope">
42
-
51
+                 {{scope.row.phone}}
43 52
               </template>
44 53
             </el-table-column>
45 54
             <el-table-column label="创建时间" align="center">
46 55
               <template slot-scope="scope">
47
-
56
+                {{staffCreateTime(scope.row.ctime)}}
48 57
               </template>
49 58
             </el-table-column>
50 59
             <el-table-column label="操作" align="center">
@@ -70,107 +79,8 @@
70 79
             layout="total, sizes, prev, pager, next, jumper"
71 80
             :total="total">
72 81
           </el-pagination>
73
-
74
-          <el-dialog
75
-              title="添加会员"
76
-              :visible.sync="centerDialogVisible"
77
-              width="50%"
78
-              center>
79
-              <el-form label-width="80px" class="clearfix" :model="form" ref="form">
80
-                 <el-row>
81
-                   <el-col :span="12">
82
-                      <el-form-item label="姓名:">
83
-                           <el-input placeholder="请输入姓名">
84
-
85
-                           </el-input>
86
-                      </el-form-item>
87
-                   </el-col>
88
-                   <el-col :span="12">
89
-                     <el-form-item label="手机号:">
90
-                       <el-input placeholder="请输入手机号">
91
-
92
-                       </el-input>
93
-                     </el-form-item>
94
-                   </el-col>
95
-                 </el-row>
96
-                <el-row>
97
-                   <el-col :span="12">
98
-                       <el-form-item label="性别:">
99
-                         <el-radio v-model="radio" label="1">男</el-radio>
100
-                         <el-radio v-model="radio" label="2">女</el-radio>
101
-                       </el-form-item>
102
-                   </el-col>
103
-                  <el-col :span="12">
104
-                    <el-form-item label="生日:">
105
-                          <el-time-select
106
-                            v-model="value"
107
-                            :picker-options="{
108
-                              start: '08:30',
109
-                              step: '00:15',
110
-                              end: '18:30'}"
111
-                            placeholder="选择时间">
112
-                        </el-time-select>
113
-                    </el-form-item>
114
-                  </el-col>
115
-                </el-row>
116
-                <el-row>
117
-                    <el-col :span="8">
118
-                        <el-form-item label="员工职称:">
119
-                          <template>
120
-                            <el-select v-model="value1" multiple placeholder="请选择">
121
-                              <el-option
122
-                                v-for="item in options"
123
-                                :key="item.value"
124
-                                :label="item.label"
125
-                                :value="item.value">
126
-                              </el-option>
127
-                            </el-select>
128
-                          </template>
129
-                        </el-form-item>
130
-                    </el-col>
131
-                  <el-col :span="6">
132
-                      <template>
133
-                        <el-select v-model="value2" multiple placeholder="请选择">
134
-                          <el-option
135
-                            v-for="item in options"
136
-                            :key="item.value"
137
-                            :label="item.label"
138
-                            :value="item.value">
139
-                          </el-option>
140
-                        </el-select>
141
-                      </template>
142
-                  </el-col>
143
-                  <el-col :span="4">
144
-                      <el-form-item label="医生头像:">
145
-                        <el-upload
146
-                          class="avatar-uploader"
147
-                          action="https://jsonplaceholder.typicode.com/posts/"
148
-                          :show-file-list="false"
149
-                          :on-success="handleAvatarSuccess"
150
-                          :before-upload="beforeAvatarUpload">
151
-                          <img v-if="imageUrl" :src="imageUrl" class="avatar">
152
-                          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
153
-                        </el-upload>
154
-                      </el-form-item>
155
-                    </el-col>
156
-                </el-row>
157
-                 <el-row>
158
-                     <el-col :span="24">
159
-                         <el-form-item label="医生简介:">
160
-                           <keep-alive>
161
-                             <neditor ref="neditor"
162
-                                      id="editor">
163
-                             </neditor>
164
-                           </keep-alive>
165
-                         </el-form-item>
166
-                     </el-col>
167
-                 </el-row>
168
-              </el-form>
169
-              <span slot="footer" class="dialog-footer">
170
-              <el-button @click="centerDialogVisible = false">取 消</el-button>
171
-              <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
172
-               </span>
173
-          </el-dialog>
82
+            <!-- 添加员工 -->
83
+          <create-staff-form ref="createStaffForm" :staffsData="staffsData"></create-staff-form>
174 84
 
175 85
     </div>
176 86
   </div>
@@ -178,12 +88,15 @@
178 88
 
179 89
 <script>
180 90
   import BreadCrumb from '../components/bread-crumb'
181
-  import Neditor from '@/components/Neditor'
91
+  import {getAllStaffInfo} from '@/api/act/staffmanager'
92
+  import {getToken} from '@/api/qiniu'
93
+  import {getFileExtension,uParseTime} from '@/utils/tools'
94
+  import CreateStaffForm from "./components/CreateStaffForm";
182 95
   export default {
183 96
     name: 'articleComment',
184 97
     components:{
185 98
       BreadCrumb,
186
-      Neditor,
99
+      CreateStaffForm,
187 100
     },
188 101
     data(){
189 102
       return{
@@ -194,69 +107,107 @@
194 107
          centerDialogVisible: false,
195 108
           radio: '1',
196 109
           value: '',
197
-          options: [{
198
-          value: '选项1',
199
-          label: '黄金糕'
200
-        }, {
201
-          value: '选项2',
202
-          label: '双皮奶'
203
-        }, {
204
-          value: '选项3',
205
-          label: '蚵仔煎'
206
-        }, {
207
-          value: '选项4',
208
-          label: '龙须面'
209
-        }, {
210
-          value: '选项5',
211
-          label: '北京烤鸭'
212
-        }],
213
-        value1: [],
214
-        value2: [],
215
-        imageUrl: ''
110
+          qiniuDomain: 'https://images.shengws.com/',
111
+          uploadData: { token: '', key: '' },
112
+         user_types: [
113
+            { index: 2, name: '医生' },
114
+            { index: 3, name: '护士' },
115
+            { index: 4, name: '运营' },
116
+            ],
117
+        user_titles: [
118
+            { index: 1, name: '医士' },
119
+            { index: 2, name: '医师' },
120
+            { index: 3, name: '住院医师' },
121
+            { index: 4, name: '主治医师' },
122
+            { index: 5, name: '副主任医师' },
123
+            { index: 6, name: '主任医师' },
124
+            { index: 7, name: '护士' },
125
+            { index: 8, name: '护师' },
126
+            { index: 9, name: '主管护师' },
127
+            { index: 10, name: '副主任护师' },
128
+            { index: 11, name: '主任护师' },
129
+            { index: 12, name: '运营专员' },
130
+            { index: 13, name: '运营主管' },
131
+            ],
132
+        imageUrl: '',
133
+        staffsData:[],
134
+        form:{
135
+          name:'',
136
+          phone:'',
137
+          birthday:'',
138
+          gender:'',
139
+          user_type:'',
140
+          user_title:'',
141
+          dochead:'',
142
+          page:1,
143
+          limit:10,
144
+          content:'',
145
+        },
146
+         total:0,
147
+         keyword:'',
148
+        staffform:[],
149
+         staffData:[],
216 150
       }
217 151
     },
218 152
     methods: {
219
-      handleAvatarSuccess(res, file) {
220
-        this.imageUrl = URL.createObjectURL(file.raw);
153
+      openCreate(){
154
+           this.$refs.createStaffForm.open();
155
+        },
156
+        staffAvatar(row) {
157
+          if(typeof(row.avatar) == "undefined" || !row.avatar || row.avatar.length==0) {
158
+              if(row.gender == 2) {
159
+             return 'https://images.shengws.com/201809182128222.png';
160
+              }else {
161
+                return 'https://images.shengws.com/201809182128111.png';
162
+              }
163
+           }else {
164
+             return row.avatar
165
+          }
166
+        },
167
+        handleSelectionChange(val){
168
+           this.selectedArticles = val;
169
+        },
170
+        handleSizeChange(limit) {
171
+            this.from.limit = limit;
172
+            this.getAllStaffInfo();
173
+          },
174
+        handleCurrentChange(page) {
175
+         this.form.page = page;
176
+          this.getAllStaffInfo();
177
+        },
178
+        getAllStaffInfo(){
179
+          getAllStaffInfo(this.form,this.keyword).then(response=>{
180
+            if(response.data.state ==1){
181
+              this.staffData = response.data.data.userStaffInfo;
182
+              console.log("数据",this.staffData)
183
+              this.total = response.data.data.total;
184
+              console.log("总页数",this.total)
185
+           }
186
+         })
221 187
       },
222
-      beforeAvatarUpload(file) {
223
-        const isJPG = file.type === 'image/jpeg';
224
-        const isLt2M = file.size / 1024 / 1024 < 2;
188
+        staffCreateTime(time) {
189
+          return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
190
+        },
191
+        staffTitle(title){
192
+            if(title == 1){
193
+              return "医士";
194
+            }else if(title == 2){
195
+                return "医师";
196
+            }else if(title == 3){
197
+                return "住院医师";
198
+            }
225 199
 
226
-        if (!isJPG) {
227
-          this.$message.error('上传头像图片只能是 JPG 格式!');
228
-        }
229
-        if (!isLt2M) {
230
-          this.$message.error('上传头像图片大小不能超过 2MB!');
231
-        }
232
-        return isJPG && isLt2M;
233
-      }
234
-    }
200
+        },     
201
+          changeKey(){
202
+          this.getAllStaffInfo()
203
+         },
204
+    },
205
+    created(){
206
+      this.getAllStaffInfo();
207
+     }
235 208
   }
236 209
 </script>
237 210
 
238 211
 <style scoped>
239
-    .avatar-uploader{
240
-      border: 1px solid #d9d9d9;
241
-      border-radius: 1px;
242
-      cursor: pointer;
243
-      position: relative;
244
-      overflow: hidden;
245
-    }
246
-    .avatar-uploader{
247
-      border-color: #d9d9d9;
248
-    }
249
-    .avatar-uploader-icon {
250
-      font-size: 20px;
251
-      color: #8c939d;
252
-      width: 65px;
253
-      height: 50px;
254
-      line-height: 50px;
255
-      text-align: center;
256
-    }
257
-    .avatar {
258
-      width: 50px;
259
-      height: 50px;
260
-      display: block;
261
-    }
212
+
262 213
 </style>

BIN
static/images/a.jpg View File