zt_yangl 4 лет назад
Родитель
Сommit
1901aaa8ed
4 измененных файлов с 135 добавлено и 107 удалено
  1. 5 3
      src/api.js
  2. 2 1
      src/views/Home.vue
  3. 108 96
      src/views/Index.vue
  4. 20 7
      src/views/message/modelForm.vue

+ 5 - 3
src/api.js

@@ -30,16 +30,18 @@ axios.interceptors.response.use(function (response) {
 	}
 	// 对响应数据做点什么
 	if (response.data.code == 401) {
-		window.location.hash = "/login";
+		// window.location.hash = "/login";
+		// window.location.hash = "/";
 	}
 	if (response.data.code == 305) {
-		window.location.hash = "/";
+		// window.location.hash = "/";
 	}
 	return response;
 }, function (error) {
 	// 对响应错误做点什么
 	if (error.request.status == 403) {
-		window.location.hash = "/login";
+		// window.location.hash = "/login";
+		// window.location.hash = "/";
 	}
 	// console.log(Object.getOwnPropertyNames(error))
 	// console.log(error.request,error.message)

+ 2 - 1
src/views/Home.vue

@@ -107,7 +107,8 @@ export default {
 		},
 		logout(){
 			this.$api.logout().then(res=>{
-				this.$router.push({path:'/login'})
+				// this.$router.push({path:'/login'})
+				this.$router.push({path:'/'})
 			})
 		},
 		permission(name){

+ 108 - 96
src/views/Index.vue

@@ -122,61 +122,67 @@ import echarts from 'echarts';
                 var myChart6 = this.$echarts.init(this.$refs.meet_time);
                 // 学科期刊
                 let option = {
-                    // backgroundColor: '#fff',
+                    backgroundColor: '#fff',
+
+                    // title: {
+                    //     text: 'Customized Pie',
+                    //     left: 'center',
+                    //     top: 20,
+                    //     textStyle: {
+                    //         color: '#ccc'
+                    //     }
+                    // },
+                    color:['#9379ff','#62A2FF', '#FFD053', '#FF9F41','#FF542C'],
                     tooltip: {
                         trigger: 'item',
                         formatter: '{a} <br/>{b} : {c} ({d}%)'
                     },
-                    color:['#9379ff','#62A2FF', '#FFD053', '#FF9F41','#FF542C'],
-                    visualMap: {
-                        show: false,
-                        min: 100,
-                        max: 400,
-                        inRange: {
-                            // colorLightness: [0, 1]
-                            color:['#9379ff','#62A2FF', '#FFD053', '#FF9F41','#FF542C'],
-                        }
-                    },
-                    series: [
-                        {
-                            name: '访问来源',
-                            type: 'pie',
-                            radius: '70%',
-                            center: ['50%', '50%'],
-                            data: [
-                                {value: 170, name: '学术'},
-                                {value: 310, name: '学术'},
-                                {value: 274, name: '学术'},
-                                {value: 235, name: '学术'},
-                                {value: 400, name: '学术'}
-                            ].sort(function (a, b) { return a.value - b.value; }),
-                            roseType: 'radius',
-                            label: {
-                                color: 'rgba(102, 102, 102,1)',
-                                fontSize:14
-                            },
-                            labelLine: {
-                                lineStyle: {
-                                    color: 'rgba(000, 000, 000, 0.1)'
-                                },
-                                smooth: 0.2,
-                                length: 8,
-                                length2: 5
+                            
+                    // visualMap: {
+                    //     show: false,
+                    //     min: 80,
+                    //     max: 600,
+                    //     inRange: {
+                    //         colorLightness: [0, 1]
+                    //     }
+                    // },
+                    series: [{
+                        name: '访问来源',
+                        type: 'pie',
+                        radius: '55%',
+                        center: ['50%', '50%'],
+                        data: [
+                            {value: 335, name: '直接访问'},
+                            {value: 310, name: '邮件营销'},
+                            {value: 274, name: '联盟广告'},
+                            {value: 235, name: '视频广告'},
+                            {value: 400, name: '搜索引擎'}
+                        ].sort(function (a, b) { return a.value - b.value; }),
+                        roseType: 'radius',
+                        label: {
+                            color: 'rgba(102, 102, 102,1)',
+                            fontSize:14
+                        },
+                        labelLine: {
+                            lineStyle: {
+                                color: 'rgba(000, 000, 000, 0.1)'
                             },
-                            // itemStyle: {
-                                
-                            //     // color: '#c23531',
-                            //     // shadowBlur: 200,
-                            //     // shadowColor: 'rgba(0, 0, 0, 0.5)'
-                            // },
+                            smooth: 0.2,
+                            length: 8,
+                            length2: 5
+                        },
+                        itemStyle: {
+                            // color: '#c23531',
+                            // shadowBlur: 200,
+                            // shadowColor: 'rgba(0, 0, 0, 0.5)'
+                        },
 
-                            animationType: 'scale',
-                            animationEasing: 'elasticOut',
-                            animationDelay: function (idx) {
-                                return Math.random() * 200;
-                            }
+                        animationType: 'scale',
+                        animationEasing: 'elasticOut',
+                        animationDelay: function (idx) {
+                            return Math.random() * 200;
                         }
-                    ]
+                    }]
                 };
                 // 单位期刊统计
                 let option1 = {
@@ -344,61 +350,67 @@ import echarts from 'echarts';
                 };
                 // 文章来源分布
                 let option3 = {
-                    // backgroundColor: '#fff',
+                    backgroundColor: '#fff',
+
+                    // title: {
+                    //     text: 'Customized Pie',
+                    //     left: 'center',
+                    //     top: 20,
+                    //     textStyle: {
+                    //         color: '#ccc'
+                    //     }
+                    // },
+                    color:['#FA9022','#DCDB01', '#8C70F8', '#34A6FE','#2A4AD1'],
                     tooltip: {
                         trigger: 'item',
                         formatter: '{a} <br/>{b} : {c} ({d}%)'
                     },
-                    // color:['#9379ff','#62A2FF', '#FFD053', '#FF9F41','#FF542C'],
-                    visualMap: {
-                        show: false,
-                        min: 100,
-                        max: 400,
-                        inRange: {
-                            // colorLightness: [0, 1]
-                            color:['#9379ff','#62A2FF', '#FFD053', '#FF9F41','#FF542C'],
-                        }
-                    },
-                    series: [
-                        {
-                            name: '访问来源',
-                            type: 'pie',
-                            radius: '70%',
-                            center: ['50%', '50%'],
-                            data: [
-                                {value: 180, name: '液晶与显示'},
-                                {value: 310, name: '化学进展'},
-                                {value: 274, name: '化学进展'},
-                                {value: 235, name: '化学进展'},
-                                {value: 400, name: '化学进展'}
-                            ].sort(function (a, b) { return a.value - b.value; }),
-                            roseType: 'radius',
-                            label: {
-                                color: 'rgba(102, 102, 102,1)',
-                                fontSize:14
-                            },
-                            labelLine: {
-                                lineStyle: {
-                                    color: 'rgba(000, 000, 000, 0.1)'
-                                },
-                                smooth: 0.2,
-                                length: 8,
-                                length2: 5
+                            
+                    // visualMap: {
+                    //     show: false,
+                    //     min: 80,
+                    //     max: 600,
+                    //     inRange: {
+                    //         colorLightness: [0, 1]
+                    //     }
+                    // },
+                    series: [{
+                        name: '访问来源',
+                        type: 'pie',
+                        radius: '55%',
+                        center: ['50%', '50%'],
+                        data: [
+                            {value: 335, name: '直接访问'},
+                            {value: 310, name: '邮件营销'},
+                            {value: 274, name: '联盟广告'},
+                            {value: 235, name: '视频广告'},
+                            {value: 400, name: '搜索引擎'}
+                        ].sort(function (a, b) { return a.value - b.value; }),
+                        roseType: 'radius',
+                        label: {
+                            color: 'rgba(102, 102, 102,1)',
+                            fontSize:14
+                        },
+                        labelLine: {
+                            lineStyle: {
+                                color: 'rgba(000, 000, 000, 0.1)'
                             },
-                            // itemStyle: {
-                                
-                            //     // color: '#c23531',
-                            //     // shadowBlur: 200,
-                            //     // shadowColor: 'rgba(0, 0, 0, 0.5)'
-                            // },
+                            smooth: 0.2,
+                            length: 8,
+                            length2: 5
+                        },
+                        itemStyle: {
+                            // color: '#c23531',
+                            // shadowBlur: 200,
+                            // shadowColor: 'rgba(0, 0, 0, 0.5)'
+                        },
 
-                            animationType: 'scale',
-                            animationEasing: 'elasticOut',
-                            animationDelay: function (idx) {
-                                return Math.random() * 200;
-                            }
+                        animationType: 'scale',
+                        animationEasing: 'elasticOut',
+                        animationDelay: function (idx) {
+                            return Math.random() * 200;
                         }
-                    ]
+                    }]
                 };
                 // 文章分布/时间统计
                 let option4 = {

+ 20 - 7
src/views/message/modelForm.vue

@@ -55,9 +55,11 @@
                 /deep/.el-form-item__content{
                     margin-right:160px;
                     position:relative;
-                    font{
+                    font,.drag{
                         position:absolute;
                         right:-145px;
+                    }
+                    font{
                         top:0px;
                         color:#3895FE;
                         font-size: 12px;
@@ -65,6 +67,10 @@
                             margin-left: 5px;
                         }
                     }
+                    .drag{
+                        right:-160px;
+                        bottom:-3px;
+                    }
                     div{
                         font-size:16px;
                         color:#333333;
@@ -191,7 +197,8 @@
                 <div class='item-title'>编辑模板-{{title}}</div>
 
                 <el-form size="small" label-width="" label-position="top" class='over_y'>
-                    <vuedraggable class="wrapper" v-model="widgetList">
+                    <!-- handle=".dargBtn"  触发拖拽事件的按钮类名 filter=".undraggable" 不可拖拽的元素的类名 -->
+                    <vuedraggable class="wrapper" v-model="widgetList" handle=".dargBtn">
                     <transition-group>
                     <el-form-item v-for="(item,index) in widgetList" :key="index">
                         <section v-if="item.type=='input'">
@@ -201,6 +208,7 @@
                                  <span @click="item.edit=!item.edit">{{item.edit?'编辑':'保存'}}</span> 
                                  <span @click="widgetList.splice(index,1)">删除</span>
                             </font>
+                            <el-button type='primary' class='dargBtn drag'>拖拽移动顺序</el-button>
                         </section>
                         <section v-if="item.type=='textarea'">
                             <el-input :readonly="item.edit" v-model="item.label" :class="item.edit?'edit_label':''"></el-input>
@@ -209,6 +217,7 @@
                                  <span @click="item.edit=!item.edit">{{item.edit?'编辑':'保存'}}</span> 
                                  <span @click="widgetList.splice(index,1)">删除</span>
                             </font>
+                            <el-button type='primary' class='dargBtn drag'>拖拽移动顺序</el-button>
                         </section>
                         <section v-if="item.type=='radio'">
                             <el-input :readonly="item.edit" v-model="item.label" :class="item.edit?'edit_label':''"></el-input>
@@ -224,6 +233,7 @@
                                  <span @click="item.edit=!item.edit">{{item.edit?'编辑':'保存'}}</span> 
                                  <span @click="widgetList.splice(index,1)">删除</span>
                             </font>
+                            <el-button type='primary' class='dargBtn drag'>拖拽移动顺序</el-button>
                         </section>
                         <section v-if="item.type=='checkbox'">
                             <el-input :readonly="item.edit" v-model="item.label" :class="item.edit?'edit_label':''"></el-input>
@@ -239,6 +249,7 @@
                                  <span @click="item.edit=!item.edit">{{item.edit?'编辑':'保存'}}</span> 
                                  <span @click="widgetList.splice(index,1)">删除</span>
                             </font>
+                            <el-button type='primary' class='dargBtn drag'>拖拽移动顺序</el-button>
                         </section>
                         <section v-if="item.type=='image'">
                             <el-input :readonly="item.edit" v-model="item.label" :class="item.edit?'edit_label':''"></el-input>
@@ -253,6 +264,7 @@
                                  <span @click="item.edit=!item.edit">{{item.edit?'编辑':'保存'}}</span> 
                                  <span @click="widgetList.splice(index,1)">删除</span>
                             </font>
+                            <el-button type='primary' class='dargBtn drag'>拖拽移动顺序</el-button>
                         </section>
                         <section v-if="item.type=='file'">
                             <el-input :readonly="item.edit" v-model="item.label" :class="item.edit?'edit_label':''"></el-input>
@@ -272,13 +284,14 @@
                                  <span @click="item.edit=!item.edit">{{item.edit?'编辑':'保存'}}</span> 
                                  <span @click="widgetList.splice(index,1)">删除</span>
                             </font>
+                            <el-button type='primary' class='dargBtn drag'>拖拽移动顺序</el-button>
                         </section>
                     </el-form-item>
                     </transition-group>
                     </vuedraggable>
-                    <el-form-item  v-if="this.widgetList.length">
+                    <div  v-if="this.widgetList.length">
                         <el-button size="medium" type="primary" @click="save">保存</el-button>
-                    </el-form-item>
+                    </div>
                 </el-form>
             </div>
             <div class="content-item right">
@@ -361,10 +374,10 @@ components: {vuedraggable},
            {type:"input",label:"请输入标题",placeholder:"请输入",edit:true},
            {type:"textarea",label:"请输入标题",placeholder:"请输入",edit:true},
            {type:"radio",label:"请输入标题",placeholder:"请输入",edit:true,
-                items:[{label:"选项",value:"选项值"},{label:"选项",value:"选项值"}]
+                items:[{label:"选项",value:"选项值"},{label:"选项1",value:"选项值"}]
             },
             {type:"checkbox",label:"请输入标题",placeholder:"请输入",edit:true,
-                items:[{label:"选项",value:"选项值"},{label:"选项",value:"选项值"}]
+                items:[{label:"选项",value:"选项值"},{label:"选项1",value:"选项值"}]
             },
             {type:"image",label:"请输入标题",placeholder:"请输入",edit:true},
             {type:"file",label:"请输入标题",placeholder:"请输入",edit:true}
@@ -423,7 +436,7 @@ components: {vuedraggable},
                 this.$message.error("选项不能超过10个!")
             }else{
 
-                options.splice(index,0,{label:"选项",value:"选项值"})
+                options.splice(index+1,0,{label:"选项"+(index+1),value:"选项值"})
             }
         },
         gopage(size){