setting.vue 1.91 KB
Newer Older
何虹's avatar
何虹 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
<template>
 <el-dialog
 @opened="dialogOpen"
 title="系统布局配置"
 :visible.sync="dialogVisible"
 @closed="dialogClose" width="95%"
 :append-to-body='true'
 :close-on-click-modal='false'>
  <div class="drawer-container">
    <div>
      <div class="drawer-item">
        <span class="itemColor">系统主题颜色:</span>
        <theme-picker @changeColor="themeChange" />
      </div>
    </div>
  </div>
 </el-dialog>
</template>

<script>
import ThemePicker from '../themePicker'
export default {
  components: { ThemePicker },
  props: {
    value: Boolean
  },
  watch: {
    value(val) {
      this.dialogVisible = val
    },
    dialogVisible(val) {
      this.$emit('input', val)
    }
  },
  data() {
    return {
      dialogVisible: false
    }
  },
  methods: {
    themeChange(val) {
      // this.$store.dispatch('setting/changeSetting', {
      //   key: 'theme',
      //   value: val
      // })
      const data = {
        background: val
      }
      this.savePageConfig(data).then(() => {
        sessionStorage['queryBiTheme'] = JSON.stringify(data)
      })
    },
    // 保存queryBIView页面的配置信息
    savePageConfig(data) {
      const parms = {
        sControl: 'systemSetting',
        sConfig: {},
        sData: data
      }
      return this.$API.runSave(parms)
    },
    dialogOpen() {
      this.$store.commit('change_viewStatus', true)
    },
    dialogClose() {
      this.$store.commit('change_viewStatus', false)
      this.dialogVisible = false
    }
  }
}
</script>

<style  scoped>
.drawer-container {
  padding: 24px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;

}
.drawer-title {
    margin-bottom: 12px;
    color: rgba(0, 0, 0, .85);
    font-size: 14px;
    line-height: 22px;
  }
.drawer-item {
    display: flex;
    justify-content: start;
    color: rgba(0, 0, 0, .65);
    font-size: 14px;
    padding: 12px 0;
  }
  .itemColor{
    margin-right: 10px;
  }
</style>