xjc 4 年之前
父節點
當前提交
3b8a148b37

+ 9 - 0
src/api.js

@@ -293,6 +293,15 @@ export default {
 	getJournal: params => {
 		return axios.get(`${baseURL}/api/admin/journal`, { params: params });
 	},
+	addJournal: params => {
+		return axios.post(`${baseURL}/api/admin/journal`, params);
+	},
+	updateJournal: params => {
+		return axios.put(`${baseURL}/api/admin/journal`, params);
+	},
+	delJournal: params => {
+		return axios.delete(`${baseURL}/api/admin/journal`, { params: params });
+	},
 	searchSubjectList: params => {
 		return axios.get(`${baseURL}/api/admin/subject/search`, { params: params });
 	},

+ 2 - 2
src/views/Home.vue

@@ -10,8 +10,8 @@
 	<el-container>
 		<el-header>
 			<div class="header">
-				<img class="logo" src="../assets/logo.png" alt="">
-				<div class="siteTitle">中科院期刊微信公众号集中管理平台</div>
+				<!-- <img class="logo" src="../assets/logo.png" alt=""> -->
+				<!-- <div class="siteTitle">中科院期刊微信公众号集中管理平台</div> -->
 			</div>	
 			<div class="nav">
 				<!-- <router-link :class="act?'active':''" to="/index/index" @click.native='active(1)'>首页</router-link>

+ 3 - 3
src/views/journalQun/AddJournal.vue

@@ -374,7 +374,7 @@ export default {
         if (valid) {
           if (id) {
             parm.id = id;
-            this.$api.updateArticle(parm).then((res) => {
+            this.$api.updateJournal(parm).then((res) => {
               if (res.data.code == 0) {
                 this.$message({
                   type: "success",
@@ -385,7 +385,7 @@ export default {
               }
             });
           } else {
-            this.$api.addArticle(parm).then((res) => {
+            this.$api.addJournal(parm).then((res) => {
               if (res.data.code == 0) {
                 this.$message({
                   type: "success",
@@ -405,7 +405,7 @@ export default {
       this.$confirm("确定删除吗", "提示", {
         type: "warning",
       }).then(() => {
-        this.$api.deleteEnterprise({ id: id }).then((res) => {
+        this.$api.delJournal({ id: id }).then((res) => {
           this.$message({
             message: "删除成功",
             type: "success",

+ 17 - 0
src/views/message/InnerSurvey.vue

@@ -143,6 +143,13 @@ a {
     border-radius: 60px;
   }
 }
+.message_desc{
+  width: 80%;
+  margin:auto;
+  text-indent: 25px;
+  color: #1c388c;
+  font-size: 14px;
+}
 </style>
 <template>
   <section>
@@ -291,6 +298,13 @@ a {
             show-word-limit
           ></el-input>
         </el-form-item>
+        <el-form-item label="问卷描述">
+          <el-input
+            type="textarea"
+            v-model="form1.desc"
+            placeholder="请输入问卷描述"
+          ></el-input>
+        </el-form-item>
         <el-form-item label="接收人" prop="receiver_id">
           <el-cascader
             v-model="form1.receiver_id"
@@ -342,6 +356,7 @@ a {
       <div class="item-main">
         <img src="../../assets/survey_logo.png" alt="" class="survey_logo" />
         <h5 align="center" class="tpl_title">{{ title }}</h5>
+        <div class="message_desc">{{messageData.desc}}</div>
         <el-form
           ref="form2"
           :model="form2"
@@ -547,6 +562,7 @@ export default {
   data() {
     return {
       //   checked: [],
+      messageData:{},
       rules1: {
         rules: {},
       },
@@ -740,6 +756,7 @@ export default {
       this.form2.status = row.status;
       this.$api.getMessageInfo({ id: row.id }).then((res) => {
         if (res.data.code == 0) {
+          this.messageData = res.data.data;
           this.widgetList = res.data.data.widget;
           let rules1 = {};
           this.widgetList.forEach((i) => {

+ 17 - 0
src/views/message/OutSurvey.vue

@@ -142,6 +142,13 @@ a {
     border-radius: 60px;
   }
 }
+.message_desc{
+  width: 80%;
+  margin:auto;
+  text-indent: 25px;
+  color: #1c388c;
+  font-size: 14px;
+}
 </style>
 <template>
   <section>
@@ -274,6 +281,13 @@ a {
             show-word-limit
           ></el-input>
         </el-form-item>
+        <el-form-item label="问卷描述">
+          <el-input
+            type="textarea"
+            v-model="form1.desc"
+            placeholder="请输入问卷描述"
+          ></el-input>
+        </el-form-item>
         <el-form-item label="问卷模板" prop="template_id">
           <el-select
             placeholder="请选择问卷模板"
@@ -310,6 +324,7 @@ a {
       <div class="item-main">
         <img src="../../assets/survey_logo.png" alt="" class="survey_logo" />
         <h5 align="center" class="tpl_title">{{ title }}</h5>
+        <div class="message_desc">{{messageData.desc}}</div>
         <el-form ref="form2" :model="form2" class="tpl_form over_y" :rules="rules1.rules">
           <el-form-item
             v-for="(item, index) in widgetList"
@@ -511,6 +526,7 @@ export default {
   data() {
     return {
       //   checked: [],
+      messageData:{},
       rules1: {
         rules:{}
       },
@@ -703,6 +719,7 @@ export default {
       this.form2 = {};
       this.$api.getMessageInfo({ id: row.id }).then((res) => {
         if (res.data.code == 0) {
+          this.messageData = res.data.data;
           this.widgetList = res.data.data.widget;
           let rules1 = {};
           this.widgetList.forEach((i) => {

+ 2 - 2
src/views/message/modelForm.vue

@@ -608,8 +608,8 @@ export default {
       }
     },
     plusOption(options, index) {
-      if (options.length >= 10) {
-        this.$message.error("选项不能超过10个!");
+      if (options.length >= 100) {
+        this.$message.error("选项不能超过100个!");
       } else {
         options.splice(index + 1, 0, {
           label: "选项" + (index + 1),

+ 11 - 0
src/views/message/survey/answer.html

@@ -72,6 +72,14 @@
   .el-checkbox:not(:last-child){
     margin-bottom: 10px!important;
   }
+  .message_desc{
+  /* width: 80%; */
+  margin:auto;
+  text-indent: 25px;
+  color: #1c388c;
+  font-size: 14px;
+  padding-bottom:10px;
+}
 </style>
 
 <body>
@@ -79,6 +87,7 @@
     <div class="item-main">
       <img src="static/survey_logo.png" alt="" class="survey_logo" />
       <h5 align="center" class="tpl_title">{{ title }}</h5>
+      <div class="message_desc">{{messageData.desc}}</div>
       <el-form ref="form2" :model="form2" class="tpl_form over_y" :rules="rules1.rules" v-if="this.form2.status==1">
         <el-form-item v-for="(item, index) in widgetList" :key="index" :label="(index+1)+'、'+(item.label)+item.cntype"
           :prop="item.label">
@@ -126,6 +135,7 @@
     el: '#app',
     data: function () {
       return {
+        messageData:{},
         rules1: {
           rules: {},
         },
@@ -153,6 +163,7 @@
             document.getElementById('app').style.display = 'block'
             this.form2.status = res.data.status
             let widgetList = res.data.widget;
+            this.messageData = res.data;
             let rules1 = {};
             for (let i = 0; i < widgetList.length; i++) {
               if (widgetList[i].type == 'checkbox') {

+ 119 - 81
src/views/message/survey/login.html

@@ -1,71 +1,97 @@
 <!DOCTYPE html>
 <html>
+
 <head>
   <meta charset="UTF-8">
   <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,
     width=device-width,initial-scale=1.0">
-    <title>调查</title>
+  <title>调查</title>
   <!-- import CSS -->
   <link rel="stylesheet" href="static/index.css">
 </head>
 <style>
-    body{
-        margin:0;
-        padding:40px 0 0;
-        height:calc(100vh - 40px);
-        background: linear-gradient(0deg, #CEF0FF, #FFFFFF);
-    }
-  #app{
+  body {
+    margin: 0;
+    padding: 40px 0 0;
+    height: calc(100vh - 40px);
+    background: linear-gradient(0deg, #CEF0FF, #FFFFFF);
+  }
+
+  #app {
     display: none;
   }
-  .logo-img{
-    width:150px;
-    margin:0 auto;
+
+  .logo-img {
+    width: 150px;
+    margin: 0 auto;
   }
-  .el-form{
-      padding:35px;
+
+  .el-form {
+    padding: 35px;
   }
-  .el-input__inner{
-      height:48px;
-      padding-left:42px;
-      border: 1px solid #EFF0F2;
-      border-radius: 5px;
+
+  .el-input__inner {
+    height: 48px;
+    padding-left: 42px;
+    border: 1px solid #EFF0F2;
+    border-radius: 5px;
   }
-  .el-form-item img{
+
+  .el-form-item img {
     position: absolute;
     top: 8px;
     left: 6px;
   }
+
   .el-button--primary {
     margin-top: 29px;
     height: 48px;
     font-size: 18px;
-    width:100%;
+    width: 100%;
     background-color: #3780CD;
-    }
+  }
+
   .tpl_title {
     font-size: 18px;
     margin-bottom: 20px;
   }
-  .el-form-item__label{
-        float:none;   
-    }
+
+  .el-form-item__label {
+    float: none;
+  }
+  .imgcode .el-input{
+    width: 62%;
+    /* background: #b4bccc; */
+  }
+  .imgcode .el-input__inner{
+    padding-left: 6px!important;
+  }
+  .imgcode img{
+    position: absolute;
+    right: 10px!important;
+    left: auto;
+  }
 </style>
+
 <body>
-  <div id="app" >
+  <div id="app">
     <div class='logo-img'><img src="static/logo.png" alt=""></div>
     <el-form>
-        <el-form-item>
-            <el-input v-model='form.username' clearable placeholder="请输入账号"></el-input>
-            <img src="static/username.png" alt="">
-        </el-form-item>
-        <el-form-item>
-            <el-input v-model='form.password' type='password' clearable placeholder="请输入密码"></el-input>
-            <img src="static/pwd.png" alt="">
-        </el-form-item>
-        <el-form-item>
-            <el-button type='primary' @click='login'>登录</el-button>
-        </el-form-item>
+      <el-form-item>
+        <el-input v-model='form.username' clearable placeholder="请输入账号"></el-input>
+        <img src="static/username.png" alt="">
+      </el-form-item>
+      <el-form-item>
+        <el-input v-model='form.password' type='password' clearable placeholder="请输入密码"></el-input>
+        <img src="static/pwd.png" alt="">
+      </el-form-item>
+      <el-form-item class="imgcode">
+        <img @click="getCode" :src="code" alt="">
+        <el-input type="text" v-model="form.imgcode" placeholder="请输入验证码"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type='primary' @click='login'>登录</el-button>
+      </el-form-item>
     </el-form>
   </div>
 </body>
@@ -75,49 +101,61 @@
 <!-- import JavaScript -->
 <script src="static/index.js"></script>
 <script>
-    new Vue({
-        el: '#app',
-        data: function() {
-            return { 
-                form:{
-                    
-                },
-                
-            }
+  new Vue({
+    el: '#app',
+    data: function () {
+      return {
+        form: {
+
         },
-        methods:{
-           login(){
-                $.ajax({
-                    url:'/api/account/login',
-                    method:'post',
-                    data:this.form,
-                    success:res=>{
-                        if(res.code == '1000'){
-                            this.$message.error(res.message);
-                        }else{
-                            var search=window.location.search.split('?')[1].split('&');
-                            let id=search[0].split('=')[1]
-                            if(window.location.search.split('?')[1].indexOf("type")!=-1){
-                              let type=search[1].split('=')[1]
-                              // 跳转到问卷页面
-                              window.location.href = "/survey/answer.html?id="+id+"&type="+type
-                            }else{
-                              window.location.href = "/survey/message.html?id="+id
-                            }
-                            
-                        }
-                    }
-                })
-           }
-        },
-        created(){
-        //    var search=window.location.search.split('?')[1].split('&');
-        //    this.id=search[0].split('=')[1]
-        //    this.getData()
-        },
-        mounted(){
-            document.getElementById('app').style.display='block'
-        }
-    })
-  </script>
-</html>
+        code: ""
+
+      }
+    },
+    methods: {
+      login() {
+        $.ajax({
+          url: '/api/account/login',
+          method: 'post',
+          data: this.form,
+          success: res => {
+            if (res.code == '1000') {
+              this.$message.error(res.message);
+            } else {
+              var search = window.location.search.split('?')[1].split('&');
+              let id = search[0].split('=')[1]
+              if (window.location.search.split('?')[1].indexOf("type") != -1) {
+                let type = search[1].split('=')[1]
+                // 跳转到问卷页面
+                window.location.href = "/survey/answer.html?id=" + id + "&type=" + type
+              } else {
+                window.location.href = "/survey/message.html?id=" + id
+              }
+
+            }
+          }
+        })
+      },
+      getCode() {
+        $.ajax({
+          url: "/api/account/imgcode",
+          method: "get",
+          data: {},
+          success: res => {
+            this.code = res.data.imgcode
+            this.form.imgcode_id = res.data.imgcode_id
+          }
+        })
+      },
+    },
+
+    created() {
+      this.getCode()
+    },
+    mounted() {
+      document.getElementById('app').style.display = 'block'
+    }
+  })
+</script>
+
+</html>

+ 2 - 2
vue.config.js

@@ -3,8 +3,8 @@ module.exports={
         proxy:{
             '/api':{
                 // target:'http://39.107.246.59:81',
-                // target:'https://test.scxjc.club',
-                target:'http://caos.tederen.com',
+                target:'https://test.scxjc.club',
+                // target:'http://caos.tederen.com',
                 changeOrigin: true,
             }
         }