瀏覽代碼

fix:管理后台50%

magic v 4 年之前
父節點
當前提交
3277518404

+ 2 - 2
config/index.js

@@ -22,8 +22,8 @@ module.exports = {
     },
 
     // Various Dev Server settings
-    // host: 'localhost', // can be overwritten by process.env.HOST
-    host: '10.0.3.116', // can be overwritten by process.env.HOST
+    host: 'localhost', // can be overwritten by process.env.HOST
+    // host: '10.0.3.116', // can be overwritten by process.env.HOST
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

+ 17 - 1
src/assets/css/ui.scss

@@ -246,11 +246,16 @@ input, textarea {
 .list-leave-to
 
 /* .list-leave-active for below version 2.1.8 */
-  {
+{
   opacity: 0;
   transform: translateY(60px);
 }
 
+// 排序过渡
+.flip-list-move {
+  transition: all 0.3s;
+}
+
 // 转场动画
 .slide-right-enter-active,
 .slide-right-leave-active,
@@ -281,3 +286,14 @@ input, textarea {
 .slide-left-leave-to {
   transform: translate3d(100%, 0, 0);
 }
+
+// 折叠面板动画
+.collapse-enter-active,
+.collapse-leave-active {
+  transition: all 0.3s ease;
+  pointer-events: none;
+}
+
+.collapse-enter, .collapse-leave-to {
+  transform: translate3d(0, -100%, 0);
+}

+ 1 - 0
src/common/scss/base.scss

@@ -15,6 +15,7 @@ $color-3: #999;
 $color-4: #ddd;
 $color-5: #eee;
 $color-6: #f5f5f5;
+$color-7: #f9f9f9;
 
 // 边距
 $sp-xs: 8px / 2;

+ 12 - 27
src/pages/FormVolume/Layout1/index.vue

@@ -3,9 +3,9 @@
   <div class="body scroll-view">
     <div class="head">
       <h1 v-if="data.topic.is_name && data.topic.name">{{ data.topic.name }}</h1>
-        <div class="des" v-if="data.topic.is_memo && data.topic.memo" v-html="data.topic.memo"></div>
+        <div class="des" v-if="data.topic.is_memo && data.topic.memo" v-html="data.topic.memo.replace(/\n/g, '<br />')"></div>
     </div>
-    <transition-group name="list" class="volume-content" tag="ul">
+    <transition-group name="flip-list" class="volume-content" tag="ul">
       <li
         v-for="(item, index) in data.result"
         :key="index + 1"
@@ -15,9 +15,9 @@
           <label v-if="item.required">*</label>
           <span>{{index + 1}}. </span>
           <span>{{ item.title }}</span>
-          <span v-if="item.type_name">【{{ item.type_name }}】</span>
+          <span v-if="configType[item.type]">【{{ configType[item.type] }}】</span>
         </p>
-        <div :class="{'align-right': item.layout_align === 'right'}">
+        <div :class="{'align-right': (item.layout_align || data.topic.layout_align) === 'right'}">
 
           <div class="slider-layout" v-if="item.type === 'slider'">
             <div class="val" v-if="item.val">{{ item.val }}</div>
@@ -45,26 +45,26 @@
 
           <van-radio-group 
             v-model="item.val" 
-            :direction="item.layout_inline === 2 ? 'vertical' : 'horizontal'"
+            :direction="(item.layout_inline || data.topic.layout_inline) === 2 ? 'vertical' : 'horizontal'"
             v-if="item.type === 'radio'">
             <van-radio
-              :class="{ vertical: item.layout_inline === 2, horizontal: item.layout_inline === 1 }"
+              :class="(item.layout_inline || data.topic.layout_inline) === 2 ? 'vertical' : 'horizontal'"
               :name="it.title" 
               v-for="(it, itIndex) in item.content" 
-              :key="itIndex">{{ it.title }}</van-radio>
+              :key="itIndex">{{ it.title }}{{ it.memo && `(${it.memo})` }}</van-radio>
           </van-radio-group>
 
           <van-checkbox-group 
             v-model="item.val" 
-            :direction="item.layout_inline === 2 ? 'vertical' : 'horizontal'"
+            :direction="(item.layout_inline || data.topic.layout_inline) === 2 ? 'vertical' : 'horizontal'"
             :max="item.max" 
             v-if="item.type === 'checkbox'">
             <van-checkbox 
-              :class="{ vertical: item.layout_inline === 2, horizontal: item.layout_inline === 1 }"
+              :class="(item.layout_inline || data.topic.layout_inline) === 2 ? 'vertical' : 'horizontal'"
               :name="it.title" 
               v-for="(it, itIndex) in item.content" 
               :key="itIndex" 
-              shape="square">{{ it.title }}</van-checkbox>
+              shape="square">{{ it.title }}{{ it.memo && `(${it.memo})` }}</van-checkbox>
           </van-checkbox-group>
 
           <textarea 
@@ -93,24 +93,9 @@
 </template>
 
 <script>
+import mixinLayout from '../mixins/layout'
 export default {
-  props: {
-    data: {
-      required: true,
-      type: Object
-    },
-    loading: {
-      required: true,
-      type: Object
-    },
-    isSubmit: {
-      type: Boolean,
-      default: true
-    },
-    edataItem: {
-      type: Object
-    }
-  }
+  mixins: [mixinLayout]
 }
 </script>
 

+ 12 - 34
src/pages/FormVolume/Layout2/index.vue

@@ -8,10 +8,10 @@
           <img :src="ImgLogo" />
         </div>
         <h1 v-if="data.topic.is_name && data.topic.name">{{ data.topic.name }}</h1>
-        <div class="des" v-if="data.topic.is_memo && data.topic.memo" v-html="data.topic.memo"></div>
+        <div class="des" v-if="data.topic.is_memo && data.topic.memo" v-html="data.topic.memo.replace(/\n/g, '<br />')"></div>
       </div>
     </div>
-    <transition-group name="list" class="volume-content" tag="ul">
+    <transition-group name="flip-list" class="volume-content" tag="ul">
       <li
         v-for="(item, index) in data.result"
         :key="index + 1"
@@ -22,10 +22,9 @@
           <label v-if="item.required">*</label>
           <span>{{index + 1}}. </span>
           <span>{{ item.title }}</span>
-          <span v-if="item.type_name">【{{ item.type_name }}】</span>
+          <span v-if="configType[item.type]">【{{ configType[item.type] }}】</span>
         </p>
-        <div :class="{'align-right': item.layout_align === 'right'}">
-
+        <div :class="{'align-right': (item.layout_align || data.topic.layout_align) === 'right'}">
           <div class="slider-layout" v-if="item.type === 'slider'">
             <div class="val" v-if="item.val">{{ item.val }}</div>
             <div class="warn" v-else>拨动滑块选择</div>
@@ -52,26 +51,26 @@
 
           <van-radio-group 
             v-model="item.val" 
-            :direction="item.layout_inline === 2 ? 'vertical' : 'horizontal'"
+            :direction="(item.layout_inline || data.topic.layout_inline) === 2 ? 'vertical' : 'horizontal'"
             v-if="item.type === 'radio'">
             <van-radio
-              :class="{ vertical: item.layout_inline === 2, horizontal: item.layout_inline === 1 }"
+              :class="(item.layout_inline || data.topic.layout_inline) === 2 ? 'vertical' : 'horizontal'"
               :name="it.title" 
               v-for="(it, itIndex) in item.content" 
-              :key="itIndex">{{ it.title }}</van-radio>
+              :key="itIndex">{{ it.title }}{{ it.memo && `(${it.memo})` }}</van-radio>
           </van-radio-group>
 
           <van-checkbox-group 
             v-model="item.val" 
-            :direction="item.layout_inline === 2 ? 'vertical' : 'horizontal'"
+            :direction="(item.layout_inline || data.topic.layout_inline) === 2 ? 'vertical' : 'horizontal'"
             :max="item.max" 
             v-if="item.type === 'checkbox'">
             <van-checkbox 
-              :class="{ vertical: item.layout_inline === 2, horizontal: item.layout_inline === 1 }"
+              :class="(item.layout_inline || data.topic.layout_inline) === 2 ? 'vertical' : 'horizontal'"
               :name="it.title" 
               v-for="(it, itIndex) in item.content" 
               :key="itIndex" 
-              shape="square">{{ it.title }}</van-checkbox>
+              shape="square">{{ it.title }}{{ it.memo && `(${it.memo})` }}</van-checkbox>
           </van-checkbox-group>
 
           <textarea 
@@ -100,30 +99,9 @@
 </template>
 
 <script>
-import ImgLogo from '~/img/logo.png'
+import mixinLayout from '../mixins/layout'
 export default {
-  props: {
-    data: {
-      required: true,
-      type: Object
-    },
-    loading: {
-      required: true,
-      type: Object
-    },
-    isSubmit: {
-      type: Boolean,
-      default: true
-    },
-    edataItem: {
-      type: Object
-    }
-  },
-  data () {
-    return {
-      ImgLogo
-    }
-  }
+  mixins: [mixinLayout]
 }
 </script>
 

+ 3 - 2
src/pages/FormVolume/index.vue

@@ -1,13 +1,14 @@
 <template>
   <components 
-    :is="layoutCurrent"
+    :is="putLayoutCurrent"
     :data="data"
     :edataItem="edataItem"
     :loading="loading"
+    :configType="configType"
     :isSubmit="!edata"
     @submit="btnSubmit"
     @selectItem="item => $emit('selectItem', item)"
-    v-if="layoutCurrent != 'van-empty' && !loading.empty">
+    v-if="putLayoutCurrent != 'van-empty' && !loading.empty">
     <div class="tel-message" slot="tel">
       <span>· 感谢您的支持与关注!任何问题,请您联系</span>
       <a href="tel:400-690-5366" class="tel">400-690-5366</a>

+ 19 - 33
src/pages/FormVolume/mixins/index.js

@@ -22,11 +22,14 @@ export default {
         result: [],
         topic: {}
       },
-      layoutCurrent: '',
       layoutType: {
         '1': 'Layout1',
         '2': 'Layout2'
       },
+      configType: {
+        'radio': '单选',
+        'checkbox': '多选'
+      },
       loading: {
         data: false,
         empty: false,
@@ -43,14 +46,16 @@ export default {
       }
     };
   },
+  computed: {
+    putLayoutCurrent () {
+      return this.layoutType[this.data.topic.layout_type] || 'van-empty'
+    }
+  },
   watch: {
-    $route(to, from) {
+    $route (to, from) {
       if (from.name === 'FormVolume') {
         clearInterval(this.codeMess.t)
       }
-    },
-    edata () {
-      this.inData()
     }
   },
   destroyed() {
@@ -58,6 +63,12 @@ export default {
   },
   created() {
     this.vueWatchRoute()
+    this.btnOpenSuccess(() => {
+      let { go, replace } = this.$route.query
+      replace
+        ? this.$router.replace({ name: replace })
+        : this.$router.go(go || -1)
+    })
   },
   methods: {
     vueWatchRoute () {
@@ -118,9 +129,7 @@ export default {
           data = res.data
         }
         
-        this.inTopicLayout(data)
-        this.inTopicAttr(data)
-        this.inTopicComponent(data)
+        this.inTopicComponent(data, Custom)
         
         this.$set(this, 'data', data)
       } catch (error) {
@@ -129,36 +138,13 @@ export default {
       }
       this.loading.data = false
     },
-    // 问卷属性初始化
-    inTopicAttr (data) {
-      data = data || this.data
-      if (data.topic.memo) {
-        data.topic.memo = data.topic.memo.replace(/\n/g, '<br />')
-      }
-    },
     // 问卷组件初始化
-    inTopicComponent (data) {
+    inTopicComponent (data, callback) {
       data = data || this.data
-      let configType = {
-        'radio': '单选',
-        'checkbox': '多选'
-      }
       data.result.forEach(item => {
-        item.layout_align = item.layout_align || data.topic.layout_align || 'left'
-        item.layout_inline = item.layout_inline || data.topic.layout_inline || 1
-        item.type_name = configType[item.type] || ''
-
-        // 自定义组件处理
-        Custom(item)
+        typeof callback === 'function' && callback(item)
       })
     },
-    // 问卷主题UI初始化
-    inTopicLayout (data) {
-      data = data || this.data
-      if (this.layoutType) {
-        this.layoutCurrent = this.layoutType[data.topic.layout_type] || 'van-empty'
-      }
-    },
     btnOpenSuccess(callback) {
       this.show.submit = true
       this.loopCode(this.codeMess.num, async () => {

+ 28 - 0
src/pages/FormVolume/mixins/layout.js

@@ -0,0 +1,28 @@
+import ImgLogo from '~/img/logo.png'
+export default {
+  props: {
+    data: {
+      required: true,
+      type: Object
+    },
+    loading: {
+      required: true,
+      type: Object
+    },
+    isSubmit: {
+      type: Boolean,
+      default: true
+    },
+    edataItem: {
+      type: Object
+    },
+    configType: {
+      type: Object
+    }
+  },
+  data() {
+    return {
+      ImgLogo
+    }
+  }
+}

+ 24 - 3
src/pages/Manager/common.scss

@@ -1,10 +1,16 @@
 @import '@/common/scss/base.scss';
 .card-doc {
   font-size: $size-sm;
-  background: $color-6;
+  overflow: hidden;
+  width: 100%;
+  flex: 1;
+  display: flex;
+  flex-direction: column;
   .card-header {
-    background: $color-f;
-    box-shadow: 0 2px 2px 0px $color-5;
+    width: 100%;
+    background: $color-7;
+    box-shadow: 0 2px 4px 0px $color-4;
+    border-bottom: 1px solid $color-5;
     display: flex;
     justify-content: space-between;
     align-items: center;
@@ -21,6 +27,21 @@
       font-size: $size-md;
     }
   }
+  .card-body {
+    width: 100%;
+    flex: 1;
+    position: relative;
+  }
+  .card-scroll {
+    position: absolute;
+    left: 0;
+    right: 0;
+    top: 0;
+    bottom: 0;
+
+    overflow: auto;
+    -webkit-overflow-scrolling: touch;
+  }
 }
 
 

+ 138 - 27
src/pages/Manager/index.vue

@@ -1,40 +1,150 @@
 <template>
   <div class="manager-container">
-    <div class="manager-components"></div>
+    <div class="manager-components">
+      {{ dataItem }}
+    </div>
     <div class="manager-template">
-      <LayoutVolume :edata="data" :edataItem="dataItem" @selectItem="item => dataItem = item" />
+      <LayoutVolume :edata="data" :edataItem="dataItem" @selectItem="selectItem" />
     </div>
     <div class="manager-attribute">
       <div class="card-attr">
         <div class="card-doc">
-          <div class="card-header">
+          <div class="card-header" @click="attrShow.attr = !attrShow.attr">
             <h3>表单属性</h3>
-            <van-icon name="arrow-down" class="icon" />
+            <van-icon :name="attrShow.attr ? 'arrow-up' : 'arrow-down'" class="icon" />
           </div>
-          <div class="card-body">
-            <van-cell-group>
-              <van-field name="radio" label="主题">
-                <template #input>
-                  <van-radio-group v-model="data.topic.layout_type" direction="horizontal">
-                    <van-radio :name="1">主题1</van-radio>
-                    <van-radio :name="2">主题2</van-radio>
-                  </van-radio-group>
-                </template>
-              </van-field>
-              <van-field v-model="value" label="表单标题" placeholder="请输入用户名" />
-              <van-field
-                v-model="value"
-                label="表单描述"
-                placeholder="请输入用户名"
-                type="textarea"
-                rows="3"
-                autosize
-              />
-            </van-cell-group>
-            
+          <transition name="collapse">
+            <div class="card-body" v-if="attrShow.attr">
+              <div class="card-scroll">
+                <van-cell-group>
+                  <van-field name="radio" label="主题">
+                    <template #input>
+                      <van-radio-group v-model="data.topic.layout_type" direction="horizontal">
+                        <van-radio :name="1">主题1</van-radio>
+                        <van-radio :name="2">主题2</van-radio>
+                      </van-radio-group>
+                    </template>
+                  </van-field>
+                  <van-field name="radio" label="显示标题">
+                    <template #input>
+                      <van-radio-group v-model="data.topic.is_name" direction="horizontal">
+                        <van-radio :name="1">是</van-radio>
+                        <van-radio :name="0">否</van-radio>
+                      </van-radio-group>
+                    </template>
+                  </van-field>
+                  <van-field v-model="data.topic.name" label="表单标题" placeholder="请输入" />
+                  <van-field name="radio" label="显示描述">
+                    <template #input>
+                      <van-radio-group v-model="data.topic.is_memo" direction="horizontal">
+                        <van-radio :name="1">是</van-radio>
+                        <van-radio :name="0">否</van-radio>
+                      </van-radio-group>
+                    </template>
+                  </van-field>
+                  <van-field
+                    v-model="data.topic.memo"
+                    label="表单描述"
+                    placeholder="请输入"
+                    type="textarea"
+                    rows="1"
+                    autosize 
+                  />
+                  <van-field
+                    v-model="data.topic.submessage"
+                    label="提交消息"
+                    placeholder="请输入"
+                    type="textarea"
+                    rows="1"
+                    autosize 
+                  />
+                  <van-field name="radio" label="对齐方式">
+                    <template #input>
+                      <van-radio-group v-model="data.topic.layout_align" direction="horizontal">
+                        <van-radio name="left">左对齐</van-radio>
+                        <van-radio name="right">右对齐</van-radio>
+                      </van-radio-group>
+                    </template>
+                  </van-field>
+                  <van-field name="radio" label="排列方式">
+                    <template #input>
+                      <van-radio-group v-model="data.topic.layout_inline" direction="horizontal">
+                        <van-radio :name="1">水平</van-radio>
+                        <van-radio :name="2">垂直</van-radio>
+                      </van-radio-group>
+                    </template>
+                  </van-field>
+                </van-cell-group>
+              </div>
+            </div>
+          </transition>
+        </div>
+        <div class="card-doc" v-if="!!dataItem">
+          <div class="card-header" @click="attrShow.compt = !attrShow.compt">
+            <h3>组件属性</h3>
+            <van-icon :name="attrShow.compt ? 'arrow-up' : 'arrow-down'" class="icon" />
           </div>
+          <transition name="collapse">
+            <div class="card-body" v-if="attrShow.compt">
+              <div class="card-scroll">
+                <van-cell-group>
+                  <van-field name="radio" label="组件类型">
+                    <template #input>
+                      <van-radio-group :value="dataItem.type" direction="horizontal">
+                        <van-radio name="radio" @click="onChangeCompType('radio')">radio</van-radio>
+                        <van-radio name="checkbox" @click="onChangeCompType('checkbox')">checkbox</van-radio>
+                        <van-radio name="input" @click="onChangeCompType('input')">input</van-radio>
+                        <van-radio name="textarea" @click="onChangeCompType('textarea')">textarea</van-radio>
+                        <van-radio name="slider" @click="onChangeCompType('slider')">slider</van-radio>
+                      </van-radio-group>
+                    </template>
+                  </van-field>
+                  <van-field 
+                    v-model="dataItem.title" 
+                    label="组件题目" 
+                    placeholder="请输入"
+                    type="textarea"
+                    rows="1"
+                    autosize />
+                  <van-field name="radio" label="是否必填">
+                    <template #input>
+                      <van-radio-group v-model="dataItem.required" direction="horizontal">
+                        <van-radio :name="1">是</van-radio>
+                        <van-radio :name="0">否</van-radio>
+                      </van-radio-group>
+                    </template>
+                  </van-field>
+                  <van-field 
+                    :value="dataItem.content.map(item => `${item.title}${item.memo ? ' | ' : ''}${item.memo||''}`).join('\n')"
+                    label="题目选项" 
+                    placeholder="选项一 | 描述,Enter 编辑下个选项"
+                    type="textarea"
+                    rows="5"
+                    autosize
+                    @change="onChangeContent" />
+                  <van-field name="radio" label="对齐方式">
+                    <template #input>
+                      <van-radio-group v-model="dataItem.layout_align" direction="horizontal">
+                        <van-radio name="">继承</van-radio>
+                        <van-radio name="left">靠左</van-radio>
+                        <van-radio name="right">靠右</van-radio>
+                      </van-radio-group>
+                    </template>
+                  </van-field>
+                  <van-field name="radio" label="排列方式">
+                    <template #input>
+                      <van-radio-group v-model="dataItem.layout_inline" direction="horizontal">
+                        <van-radio name="">继承</van-radio>
+                        <van-radio :name="1">水平</van-radio>
+                        <van-radio :name="2">垂直</van-radio>
+                      </van-radio-group>
+                    </template>
+                  </van-field>
+                </van-cell-group>
+              </div>
+            </div>
+          </transition>
         </div>
-        <div class="card-doc"></div>
       </div>
     </div>
   </div>
@@ -42,8 +152,9 @@
 
 <script>
 import mixins from "./mixins";
+import attribute from "./mixins/attribute";
 export default {
-  mixins: [mixins]
+  mixins: [mixins, attribute]
 };
 </script>
 <style lang="scss" scoped>

+ 1 - 5
src/pages/Manager/js/config.js

@@ -45,11 +45,7 @@ export default {
         "required": 1,
         "content": [
           { "title": "预约安排" },
-          { "title": "候诊时间" },
-          { "title": "医疗检查" },
-          { "title": "科普沟通" },
-          { "title": "就诊环境" },
-          { "title": "诊后提醒" }
+          { "title": "候诊时间" }
         ],
         "val": [],
         "layout_align": "left", "layout_inline": 2

+ 115 - 0
src/pages/Manager/mixins/attribute.js

@@ -0,0 +1,115 @@
+import Custom from '@/pages/FormVolume/js/custom'
+export default {
+  data() {
+    return {
+      attrShow: {
+        attr: true,
+        compt: false
+      }
+    }
+  },
+  computed: {
+    isPutContent () {
+      if (!this.dataItem) {
+        return false
+      }
+      return ['input', 'textarea'].indexOf(this.dataItem.type) === -1
+    }
+  },
+  methods: {
+    selectItem(item) {
+      this.onTipComptState()
+      this.dataItem = item
+      this.attrShow.compt = true
+    },
+    onChangeCompType (type) {
+      let { val } = this.dataItem
+      if (['checkbox'].indexOf(type) !== -1) {
+        this.dataItem.val = []
+      } else {
+        this.dataItem.val = ''
+      }
+      this.dataItem.type = type
+      Custom(this.dataItem)
+    },
+    moveItemIndex (n) {
+      let i = null
+      let result = this.data.result
+      result.some((item, index) => {
+        if (item && item === this.dataItem) {
+          i = index
+          return true
+        }
+      })
+      if (typeof i !== 'number') {
+        return
+      }
+      let targetIndex = i + (n < 0 ? n : n + 1)
+      if (targetIndex < 0) {
+        this.$toast.fail('已经第一个了')
+        return
+      }
+      if (targetIndex > result.length) {
+        this.$toast.fail('已经是最后一个了')
+        return
+      }
+      let temp = result[i]
+      result[i] = null
+      result.splice(targetIndex, 0, temp)
+      this.data.result = this.data.result.filter(item => item)
+    },
+    onKeyup (ev) {
+      let { keyCode, target } = ev
+      if (/(input|textarea)/i.test(target.nodeName) && target.value) {
+        return
+      }
+      if (keyCode === 38) {
+        this.moveItemIndex(-1)
+      }
+      if (keyCode === 40) {
+        this.moveItemIndex(1)
+      }
+    },
+    onTipComptState () {
+      let { mgTipComptDirectionState } = this.$store.state.manager
+      if (mgTipComptDirectionState) {
+        return
+      }
+      this.$dialog.confirm({
+        title: '提示',
+        message: '按 ↑ ↓ 可调整位置!',
+        confirmButtonText: '确定',
+        cancelButtonText: '不再提示',
+        confirmButtonColor: '#666',
+        cancelButtonColor: '#ee0a24'
+      }).then(() => {
+        
+      }).catch(() => {
+        this.$store.commit('setMgTipComptDirectionState', 1)
+      })
+    },
+    onChangeContent (ev) {
+      try {
+        let val = typeof ev === 'string' ? ev : ev.target.value
+        console.log(val)
+        let arr = val.split(/\n/g).map(it => {
+          let r = it.split(/\s*\|\s*/)
+          return {
+            title: r[0] || '',
+            memo: r[1] || ''
+          }
+        })
+        console.log(arr)
+        this.dataItem.content = arr
+      } catch (err) {
+        
+      }
+    }
+  },
+  created() {
+    document.documentElement.addEventListener('keyup', this.onKeyup)
+  },
+  destoryed () {
+    document.documentElement.removeEventListener('keyup', this.onKeyup)
+  }
+}

+ 0 - 2
src/pages/Manager/mixins/index.js

@@ -8,8 +8,6 @@ export default {
   data() {
     return {
       TITLE: '问卷调查',
-      value: '',
-      radio: '',
       data: config.localData,
       dataItem: null,
       loading: {

+ 6 - 1
src/pages/Manager/style.scss

@@ -6,7 +6,6 @@
   display: flex;
   justify-content: center;
 
-
   .manager-components,
   .manager-attribute {
     min-width: 350px;
@@ -25,6 +24,12 @@
     height: 100%;
     overflow: auto;
   }
+
+  .card-attr {
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+  }
 }
 
 

+ 3 - 1
src/store/index.js

@@ -2,13 +2,15 @@ import Vue from 'vue'
 import Vuex from 'vuex'
 import user from './modules/user'
 import header from './modules/header'
+import manager from './modules/manager'
 
 Vue.use(Vuex)
 
 const store = new Vuex.Store({
   modules: {
     user,
-    header
+    header,
+    manager
   }
 })
 

+ 27 - 0
src/store/modules/manager.js

@@ -0,0 +1,27 @@
+import Storage from '@/utils/storage'
+const lStorage = new Storage('localStorage')
+
+const user = {
+  state: {
+    mgTipComptDirectionState: lStorage.getItem('mgTipComptDirectionState'),
+  },
+
+  getters: {
+
+  },
+
+  mutations: {
+    // 设置 signInfo
+    setMgTipComptDirectionState(state, data) {
+      state.mgTipComptDirectionState = data
+      lStorage.setItem('mgTipComptDirectionState', data)
+    },
+    // 清除 signInfo
+    clearMgTipComptDirectionState(state) {
+      state.mgTipComptDirectionState = null
+      lStorage.removeItem('mgTipComptDirectionState')
+    }
+  }
+}
+
+export default user