Jelajahi Sumber

修改提交

asd123a20 2 tahun lalu
induk
melakukan
45d92957a2

+ 1 - 1
config/index.js

@@ -12,7 +12,7 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
       '/api': {
-        target: 'http://localhost:8080/',//本地开发环境只需要修改这个配置,修改为后端服务地址即可
+        target: 'http://dw.cc-lotus.info/',//本地开发环境只需要修改这个配置,修改为后端服务地址即可
         changeOrigin: true,//如果需要跨域
         pathRewrite: {
                     '^/api': '/api'

+ 1 - 0
package.json

@@ -18,6 +18,7 @@
     "clipboard": "^2.0.8",
     "echarts": "^5.2.2",
     "element-ui": "^2.15.6",
+    "js-cookie": "^3.0.1",
     "normalize.css": "^8.0.1",
     "vue": "^2.5.2",
     "vue-awesome": "^4.3.1",

+ 6 - 43
src/App.vue

@@ -6,57 +6,20 @@
 
 <script>
 
-import DwHeader from '@/components/layouts/DwHeader.vue'
-import DwHeaderLogin from '@/components/layouts/DwHeaderLogin.vue'
-import DwNavMenu from '@/components/layouts/DwNavMenu.vue'
-import DwFooter from '@/components/layouts/DwFooter.vue'
-
 export default {
   name: 'App',
-  components: {
-    'dw-nav-menu': DwNavMenu,
-    'dw-header': DwHeader,
-    'dw-header-login': DwHeaderLogin,
-    'dw-footer': DwFooter
-  },
+  components: { },
   data () {
-    return {
-      currentHeader: 'dw-header'
-    }
+    return {}
   },
-  mounted () {
-    this.loginStatus()
-  },
-  methods: {
-    loginStatus: function () {
-      const fullPath = this.$route.fullPath
-      if (fullPath.indexOf('login') >= 0) {
-        this.currentHeader = 'dw-header-login'
-      } else {
-        this.currentHeader = 'dw-header'
-      }
-    }
-  }
+  mounted () {},
+  methods: {}
 }
 </script>
 <style>
 body{
-  background-color: #F1F1F1;
+  margin-top: 20px;
+  background-color: #fff;
   /*#ffb25c*/
 }
-#app {
-  font-family: 'Avenir', Helvetica, Arial, sans-serif;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-.el-header{
-  background-color: #25292E;
-}
-.el-footer {
-  /*background-color: #B3C0D1;*/
-  line-height: 60px;
-  color: #7c7c7c;
-}
-.el-aside {
-}
 </style>

+ 13 - 4
src/components/common/DwSurveyDcsWrapper.vue

@@ -7,8 +7,14 @@
             <el-row type="flex" justify="space-between" align="middle">
               <el-col>
                 <div class="dw-dcs-main-survey-title-content">
-                  <div v-if="survey.surveyNameText != null" v-text="survey.surveyNameText"></div>
-                  <div v-else v-html="survey.surveyName"></div>
+                  <div v-if="survey.surveyNameText != null">
+                    <router-link class="dw-link dw-link-1" to="/"><i class="el-icon-arrow-left"></i></router-link>
+                    {{ survey.surveyNameText }}
+                  </div>
+                  <div v-else>
+                    <router-link class="dw-link dw-link-1" to="/"><i class="el-icon-arrow-left"></i></router-link>
+                    {{ survey.surveyName }}
+                  </div>
                 </div>
               </el-col>
               <el-col :span="4">
@@ -49,9 +55,9 @@
                 <el-col :span="3">
                   <router-link :to="`${prevPath}/survey/c/comp/${survey.id}`" :class="{ 'dw-link-primary' : isSiteComp}" class="dw-link" ><i class="el-icon-discount"></i>网站组件</router-link>
                 </el-col>
-                <el-col :span="3">
+                <!-- <el-col :span="3">
                   <router-link :to="`${prevPath}/survey/c/weixin/${survey.id}`" :class="{ 'dw-link-primary' : isAnswerWx}" class="dw-link" ><i class="el-icon-chat-dot-round"></i>微信收集</router-link>
-                </el-col>
+                </el-col> -->
               </el-row>
               <el-row v-show="isSurveyChart || isAnswerData">
                 <el-col :span="3">
@@ -208,4 +214,7 @@ export default {
   font-size: 14px;
   padding: 10px;
 }
+.el-icon-arrow-left {
+  font-size: 20px;
+}
 </style>

+ 2 - 43
src/components/layouts/Layout.vue

@@ -1,62 +1,21 @@
 <template>
-  <!--    <img src="./assets/logo.png">-->
-  <!--    <router-view/>-->
   <div id="dw-layout" >
-    <el-container style="padding: 0px;">
-      <el-header height="80" style="padding: 0px;" >
-        <dw-header></dw-header>
-      </el-header>
-      <el-container style="z-index: 1;">
-        <el-container>
-          <el-main style="padding: 20px 0px;" >
-            <router-view></router-view>
-          </el-main>
-          <el-footer><dw-footer></dw-footer></el-footer>
-        </el-container>
-      </el-container>
-    </el-container>
+    <router-view></router-view>
   </div>
 </template>
 
 <script>
 
-import DwHeader from '@/components/layouts/DwHeader.vue'
-import DwHeaderLogin from '@/components/layouts/DwHeaderLogin.vue'
-import DwNavMenu from '@/components/layouts/DwNavMenu.vue'
-import DwFooter from '@/components/layouts/DwFooter.vue'
-
 export default {
   name: 'Layout',
-  components: {
-    'dw-nav-menu': DwNavMenu,
-    'dw-header': DwHeader,
-    'dw-header-login': DwHeaderLogin,
-    'dw-footer': DwFooter
-  },
+  components: {},
   data () {
     return {
-      currentHeader: 'dw-header'
     }
   },
   mounted () {
-    this.loginStatus()
   },
   methods: {
-    loginStatus: function () {
-      const fullPath = this.$route.fullPath
-      if (fullPath.indexOf('login') >= 0) {
-        this.currentHeader = 'dw-header-login'
-      } else {
-        this.currentHeader = 'dw-header'
-      }
-    }
   }
 }
 </script>
-<style scoped>
-body{
-  background-color: #F1F1F1;
-  /*#ffb25c*/
-  background-image: none;
-}
-</style>

+ 1 - 0
src/router/index.js

@@ -21,6 +21,7 @@ import Login from '@/views/Login'
 Vue.use(Router)
 
 export default new Router({
+  mode: 'history',
   routes: [
     {
       path: '/',

+ 8 - 1
src/utils/request.js

@@ -1,6 +1,10 @@
 import axios from 'axios'
 import {msgBoxNoLogin, msgBoxNoRole, msgError} from './dw-msg'
-
+import Cookies from 'js-cookie'
+const TokenKey = 'Admin-Token'
+const getToken = () => {
+  return Cookies.get(TokenKey)
+}
 // 全局的 axios 默认值
 axios.defaults.baseURL = process.env.DW_API_URL
 // 请求超时时间
@@ -18,6 +22,9 @@ const service = axios.create({
 // 请求拦截器
 service.interceptors.request.use(
   config => {
+    if (getToken()) {
+      config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
+    }
     return config
   },
   error => {

+ 17 - 14
src/views/dw-survey/DwSurveyList.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
     <el-row>
-      <el-col :span="20" :offset="2">
-        <div class="dw-table-form" style="padding-left: 60px;">
+      <el-col :span="24">
+        <div class="dw-table-form">
           <el-form :inline="true" :model="formInline" class="dw-form-inline" size="medium" >
             <el-form-item label="问卷标题">
               <el-input v-model="formInline.surveyName" placeholder="请输入查询的问卷标题" clearable></el-input>
@@ -22,12 +22,7 @@
         </div>
         <div class="dw-table">
           <div class="dw-table-title">
-            <el-row :span="24" type="flex" justify="space-between" align="middle">
-              <el-col :span="4"><h3>我的问卷</h3></el-col>
-              <el-col :span="20" style="text-align: right;">
-                <el-button type="primary" size="medium" @click="form.id=null;form.name=null;dialogTitle = '创建问卷';dialogFormVisible = true" >新建问卷</el-button>
-              </el-col>
-            </el-row>
+            <el-button type="primary" size="medium" @click="form.id=null;form.name=null;dialogTitle = '创建问卷';dialogFormVisible = true" >新建问卷</el-button>
           </div>
           <el-table
             :data="tableData"
@@ -45,12 +40,12 @@
                 </el-popover>
               </template>
             </el-table-column>
-            <el-table-column label="答卷数" width="80" >
+            <el-table-column label="答卷数">
               <template slot-scope="scope">
                 <span style="margin-left: 10px">{{ scope.row.answerNum!=null ? scope.row.answerNum:0 }}&nbsp;份</span>
               </template>
             </el-table-column>
-            <el-table-column label="状态" width="80" >
+            <el-table-column label="状态">
               <template slot-scope="scope">
                 <el-tag v-if="scope.row.surveyState === 0" >设计中</el-tag>
                 <el-tag v-else-if="scope.row.surveyState === 1" type="success" >收集中</el-tag>
@@ -58,9 +53,8 @@
                 <el-tag v-else disable-transitions style="margin-left: 10px" >未知</el-tag>
               </template>
             </el-table-column>
-            <el-table-column label="创建时间" width="180" >
+            <el-table-column label="创建时间" >
               <template slot-scope="scope">
-                <i class="el-icon-time"></i>
                 <span style="margin-left: 10px">{{ scope.row.createDate }}</span>
               </template>
             </el-table-column>
@@ -246,8 +240,8 @@ export default {
 <style scoped>
 .dw-table-form{
   background-color: white;
-  padding: 20px;
-  margin-bottom: 20px;
+  padding: 5px 20px;
+  /* margin-bottom: 20px; */
 }
 .dw-table{
   background: white;
@@ -269,3 +263,12 @@ export default {
   text-align: right;
 }
 </style>
+<style>
+.el-table .el-table__header-wrapper th, .el-table .el-table__fixed-header-wrapper th {
+  word-break: break-word;
+  background-color: #f8f8f9;
+  color: #515a6e;
+  height: 40px;
+  font-size: 13px;
+}
+</style>

+ 2 - 2
static/diaowen/answer-m.html

@@ -81,9 +81,9 @@
     </div>
     </div>
   </form>
-  <div class="dw-footer" >
+  <!-- <div class="dw-footer" >
     <div><a href="http://diaowen.net/index-m.jsp" style="text-decoration: none;" rel="external" title="开源的调查问卷系统" >调问网&nbsp;DWSurvey&nbsp;</a>提供技术支持</div>
-  </div>
+  </div> -->
 </div>
 <div id="fixedMsg" style="position: fixed;top: 0px;width: 100%;padding: 10px;text-align: center;font-size: 18px;letter-spacing: 4px;line-height: 56px;background-color: #111;background-color: rgba(17,17,17,0.5);color: #fff;color: rgba(255,255,255,0.5);z-index: 200;display: none;"></div>
 <div style="display: none;">

+ 4 - 4
static/diaowen/answer-p.html

@@ -540,9 +540,9 @@
 
 </div>
 
-<div class="footer-copyright" style="color: gray;padding-bottom: 5px;">
+<!-- <div class="footer-copyright" style="color: gray;padding-bottom: 5px;">
   Powered by <a href="http://www.diaowen.net" style="text-decoration: none;color: gray;">DWSurvey</a>
-</div>
+</div> -->
 
 <div id="fixedMsg" style="position: fixed;top: 0px;width: 100%;padding: 10px;text-align: center;font-size: 18px;letter-spacing: 4px;line-height: 56px;background-color: #111;background-color: rgba(17,17,17,0.5);color: #fff;color: rgba(255,255,255,0.5);z-index: 200;display: none;"></div>
 <script type="text/javascript">
@@ -551,10 +551,10 @@
 </script>
 
 <!-- Diaowen.net Button BEGIN -->
-<div id="webSiteFixedRight" class="websiteFixed" style="position: fixed;right: 0px;top: 50px;z-index: 9999;">
+<!-- <div id="webSiteFixedRight" class="websiteFixed" style="position: fixed;right: 0px;top: 50px;z-index: 9999;">
   <a id="mobileTdId" href="#" style="background: #1C658B;width: 15px;background: #8CBCD1;display: block;padding: 5px;padding-top: 10px;padding-bottom:10px;font-weight: bold;color: white;cursor: pointer;float: right;vertical-align: middle;text-decoration: none;font-size: 12px;">手机地址</a>
   <img class="mobileAnswerQR" alt="" src="" height="130" style="padding: 10px;background: white;display: none;" />
-</div>
+</div> -->
 <!-- Diaowen.net Button END -->
 
 </body>

+ 2 - 8
static/diaowen/css/answer-p.css

@@ -5,18 +5,12 @@
   border: none! important;
 }
 #resultProgressRoot{
-  right: -80px;
-  bottom: 100px;
+  /* right: -80px; */
+  bottom: 0px;
   width: 200px;
   z-index: 200;
   position: fixed;
-  /*transform: rotate(90deg);
-	-moz-transform:rotate(90deg);
-	-webkit-transform:rotate(90deg);
-	transform:rotate(90deg);
-	filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);*/
   right: 10px;
-  bottom: 50px;
 }
 .progress-label {
   font-size:14px;

+ 16 - 5
static/diaowen/css/design-survey.css

@@ -5,7 +5,7 @@
 	padding: 0px;
 }
 body{
-	background: #E8E9EB;
+	background: #fff;
 }
 .notification {
 		position: fixed;
@@ -55,14 +55,11 @@ textarea{
 	margin: 0px auto;
 }
 #header{
-	background: #122E57;
 	padding-top: 5px;
 	padding-bottom: 4px;
 	overflow: auto;
 	zoom: 1;
 	width: 100%;
-	background: #24292c;
-  background: rgb(52, 73, 94);
 }
 .header_Item{
 	color: #F7F7F7;
@@ -458,6 +455,20 @@ textarea{
 	height:39px;
 	background-position: -0px -145px;
 }
+#signOut .btn{
+	width:70px;
+	height:39px;
+	text-align: center;
+	background-color: #f0f1f4;
+	border: 1px solid #d9dde6;
+	font-size: 1.3em;
+	font-family: '宋体';
+	line-height: 1.8em;
+	cursor: pointer;
+}
+#signOut .btn:hover{
+	background-color: #e0e2ee;
+}
 #publishBtn:hover .dwToolbar_icon,#publishBtn.hover .dwToolbar_icon{
 	width:70px;
 	height:39px;
@@ -565,7 +576,7 @@ textarea{
 	float: right;
 }
 #dw_body{
-	margin-top: 135px;
+	padding-top: 135px;
 	/* padding-bottom: 50px; */
 	padding-bottom: 40px;
 }

+ 1 - 1
static/diaowen/css/preview-dev.css

@@ -75,7 +75,7 @@
 	background-position: 0px -273px;
 }
 body{
-	background: #E8E9EB;
+	background: #fff;
 	/* background: url("../images/5629514927375932817.jpg") fixed 0px 0px;
 	background-size: cover; */
 }

+ 5 - 27
static/diaowen/design.html

@@ -31,27 +31,11 @@
   <input type="hidden" id="ctx" value="/api/dwsurvey/app">
   <input type="hidden" id="surveyModel_hidden" value="${survey.surveyModel }">
 
-  <div id="header" >
-    <div id="header_left">
-      <!-- <div id="header_title">DIAOWEN-在线问卷编辑器</div> -->
-      <div class="header_Item header_logo">
-        <a href="/#/dw/survey"><img alt="调问网" src="images/logo/LOGO.png" ></a>
-        &nbsp;&nbsp;<span style="font-family: '微软雅黑';font-size: 16px;line-height: 46px;" id="pageHeaderSpan">在线问卷编辑器</span>
-      </div>
-    </div>
-    <div id="header_right">
-      <div style="line-height: 22px;">
-        <a href="/#/dw/survey">问卷</a>&nbsp;&nbsp;<a href="#">账号</a>
-      </div>
-    </div>
-  </div>
+  <!-- <div id="header" >
+  </div> -->
 
   <div id="tools_wrap">
     <div id="tools">
-      <div class="tools_tabs">
-        <div class="tools_tabs_left"><ul><li class="current" id="tools_tab1_li">基本</li></ul></div>
-        <div class="tools_tabs_right"><ul><li style="padding: 0px;font-size: 12px;line-height: 28px;"><a href="http://www.diaowen.net" target="_black" style="text-decoration: none;color: gray;">升级到企业版</a></li></ul></div>
-      </div>
       <div class="tools_contents">
         <div id="tools_tab1" class="tools_tab_div" style="display: inline;">
           <div id="toolsBashQu" class="tools_item">
@@ -1376,6 +1360,9 @@
         <div id="toolsPubBtn" >
           <div class="toolbars" style="padding:10px  15px 10px 0px;">
             <ul>
+              <li id="signOut" >
+                <div class="btn">返回</div>
+              </li>
               <li id="publishBtn" >
                 <div class="dwToolbar_icon"></div>
               </li>
@@ -1727,15 +1714,6 @@
   });
 
 </script>
-<div style="text-align: center;">
-  <div class="dw_foot" style="padding-bottom: 30px;">
-    <div class="footer-copyright" style="color: gray;padding-top: 0px;font-size: 16px;">
-      Powered by <a href="http://www.diaowen.net" target="_blank" style="text-decoration: none;color: gray;"> DWSurvey OSS V5.0 </a>&nbsp;&nbsp;&nbsp;
-      Copyright © 2012-2021
-      <a href="http://www.diaowen.net" target="_blank" style="text-decoration: none;color: rgb(53, 117, 136);">调问网</a>
-    </div>
-  </div>
-</div>
 
 </body>
 </html>

+ 9 - 6
static/diaowen/js/dw/dwsurvey-design.js

@@ -69,7 +69,7 @@ $(document).ready(function(){
 	$(window).scroll( function() {
 		var scrollTop=$(window).scrollTop();
 		var quDesignDialog=$("#tools_wrap");
-		var headerHeight=55;
+		var headerHeight=0;
 		var quDesignHeight=125;
 		if(scrollTop>=headerHeight){
 			quDesignDialog.css({ top: "0px"});
@@ -86,11 +86,11 @@ $(document).ready(function(){
 			dwBodyRight.css({ top: (headerHeight+quDesignHeight+10-scrollTop)+"px"});
 		}
 
-		if(scrollTop>=headerHeight && scrollTop<=100){
-			$("#dw_body").css({"margin-top":(135+((100-headerHeight)-(100-scrollTop)))+"px"});
-		}else{
-			$("#dw_body").css({"margin-top":"135px"});
-		}
+		// if(scrollTop>=headerHeight && scrollTop<=100){
+		// 	$("#dw_body").css({"margin-top":(135+((100-headerHeight)-(100-scrollTop)))+"px"});
+		// }else{
+			// $("#dw_body").css({"margin-top":"100px"});
+		// }
 		if(curEditObj!=null){
 			var editOffset=$(curEditObj).offset();
 			$("#dwCommonEditRoot").show();
@@ -798,6 +798,9 @@ $(document).ready(function(){
 			window.location.href="/static/diaowen/preview.html?surveyId="+questionBelongId;
 		});
 	});
+	$("#signOut").click(function(){
+		window.location.href="/dw/survey/";
+	});
 	function saveSurvey(callback){
 		isSaveProgress=true;
 		var svyNmSaveTag=$("input[name='svyNmSaveTag']").val();

+ 1 - 1
static/diaowen/preview.html

@@ -50,7 +50,7 @@
   </div>
 
   <div id="dwPc" class="dwPreviewBody" style="margin-top: 40px;">
-    <iframe name="PcSurvey" frameborder="0" src="" class="uploadfile" id="PcSurvey" style="width: 100%;height: 900px;margin: 0px;"></iframe>
+    <iframe name="PcSurvey" frameborder="0" src="" class="uploadfile" id="PcSurvey" style="width: 100%;height: 700px;margin: 0px;"></iframe>
   </div>
 
   <div id="dwPhone" class="dwPreviewBody" style="margin-top: 40px;">