<commit_before><template>
<div>
  <foxgis-layout>
  <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer">
    <div class="mdl-layout__drawer">
      <!-- <span class="mdl-layout-title">制图工作室</span> -->
      <nav class="mdl-navigation">
        <a class="mdl-navigation__link" style="display: none;" v-link="{ path: '/studio/maps' }"><i class="material-icons">map</i>制图工程</a>
        <a class="mdl-navigation__link" style="display: none;" v-link="{ path: '/studio/data' }"><i class="material-icons">layers</i>数据</a>
        <a class="mdl-navigation__link" style="display: none;" v-link="{ path: '/studio/fonts' }"><i class="material-icons">text_format</i>字体</a>
        <a class="mdl-navigation__link" style="display: none;" v-link="{ path: '/studio/icons' }"><i class="material-icons">place</i>符号</a>
        <a class="mdl-navigation__link" v-link="{ path: '/studio/uploads' }"><i class="material-icons">image</i><span  v-mdl-badge.number="upload_nums" >决策用图</span></a>
      </nav>
      <div class="mdl-layout-spacer"></div>
      <nav class="mdl-navigation">
        <a class="mdl-navigation__link" v-link="{ path: '/login' }"><i class="material-icons">account_circle</i>{{username}}</a>
        <a class="mdl-navigation__link" v-on:click.prevent="signout"><i class="material-icons">exit_to_app</i>退出</a>
      </nav>
    </div>
    <main class="mdl-layout__content">
      <router-view></router-view>
    </main>
  </div>
  </foxgis-layout>
</div>
</template>


<script>
import docCookie from './cookie.js'

export default {
  methods: {
    signout: function(){
      docCookie.removeItem('username')
      docCookie.removeItem('access_token')
      docCookie.removeItem('name')
      docCookie.removeItem('phone')
      docCookie.removeItem('email')
      docCookie.removeItem('location')
      docCookie.removeItem('organization')
      
      window.location.href = '/'
    }
  },
  ready() {
    /*global componentHandler */
    componentHandler.upgradeElement(this.$el.firstElementChild)

  },
  attached: function() {
     //判断是否登陆
    let username = docCookie.getItem('username')
    if(username === null){
      window.location.href = "#!/login"
    }else{
      this.username = username
    }

    console.log(this.$children[0].$children[0].uploads)
  },
  data: function(){
    return {
      username: '用户',
      upload_nums:0
    }
  },
  events: {
    "upload_nums":function(msg) {
      this.upload_nums = parseInt(msg)
    }
  }
}

</script>


<style scoped>
.mdl-layout {
  /*height: calc(100% - 100px);*/
}

/*.mdl-layout__content {
  height: calc(100% - 100px);
}*/

.mdl-layout--fixed-drawer>.mdl-layout__content {
  background-color: #e4e4e4;
  /*background-image: radial-gradient(50% 50%,circle cover,#ddd,#e1eab1 60%);*/
}

.mdl-navigation {
  border-top: 1px solid rgba(0,0,0,.1);
}

.mdl-navigation a {
  cursor: pointer;
}

.material-icons {
  padding-right: 10px;
}

.v-link-active {
  background-color: #e0e0e0;
}

</style>
<commit_msg>fix: style badge position<commit_after><template>
<div>
  <foxgis-layout>
  <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer">
    <div class="mdl-layout__drawer">
      <!-- <span class="mdl-layout-title">制图工作室</span> -->
      <nav class="mdl-navigation">
        <a class="mdl-navigation__link" style="display: none;" v-link="{ path: '/studio/maps' }"><i class="material-icons">map</i>制图工程</a>
        <a class="mdl-navigation__link" style="display: none;" v-link="{ path: '/studio/data' }"><i class="material-icons">layers</i>数据</a>
        <a class="mdl-navigation__link" style="display: none;" v-link="{ path: '/studio/fonts' }"><i class="material-icons">text_format</i>字体</a>
        <a class="mdl-navigation__link" style="display: none;" v-link="{ path: '/studio/icons' }"><i class="material-icons">place</i>符号</a>
        <a class="mdl-navigation__link" v-link="{ path: '/studio/uploads' }"><i class="material-icons">image</i>决策用图<span  v-mdl-badge.number="upload_nums" ></span></a>
      </nav>
      <div class="mdl-layout-spacer"></div>
      <nav class="mdl-navigation">
        <a class="mdl-navigation__link" v-link="{ path: '/login' }"><i class="material-icons">account_circle</i>{{username}}</a>
        <a class="mdl-navigation__link" v-on:click.prevent="signout"><i class="material-icons">exit_to_app</i>退出</a>
      </nav>
    </div>
    <main class="mdl-layout__content">
      <router-view></router-view>
    </main>
  </div>
  </foxgis-layout>
</div>
</template>


<script>
import docCookie from './cookie.js'

export default {
  methods: {
    signout: function(){
      docCookie.removeItem('username')
      docCookie.removeItem('access_token')
      docCookie.removeItem('name')
      docCookie.removeItem('phone')
      docCookie.removeItem('email')
      docCookie.removeItem('location')
      docCookie.removeItem('organization')
      
      window.location.href = '/'
    }
  },
  ready() {
    /*global componentHandler */
    componentHandler.upgradeElement(this.$el.firstElementChild)

  },
  attached: function() {
     //判断是否登陆
    let username = docCookie.getItem('username')
    if(username === null){
      window.location.href = "#!/login"
    }else{
      this.username = username
    }

    console.log(this.$children[0].$children[0].uploads)
  },
  data: function(){
    return {
      username: '用户',
      upload_nums:0
    }
  },
  events: {
    "upload_nums":function(msg) {
      this.upload_nums = parseInt(msg)
    }
  }
}

</script>


<style scoped>
.mdl-layout {
  /*height: calc(100% - 100px);*/
}

/*.mdl-layout__content {
  height: calc(100% - 100px);
}*/

.mdl-layout--fixed-drawer>.mdl-layout__content {
  background-color: #e4e4e4;
  /*background-image: radial-gradient(50% 50%,circle cover,#ddd,#e1eab1 60%);*/
}

.mdl-navigation {
  border-top: 1px solid rgba(0,0,0,.1);
}

.mdl-navigation a {
  cursor: pointer;
}

.material-icons {
  padding-right: 10px;
}

.v-link-active {
  background-color: #e0e0e0;
}

.mdl-badge:after {
  top: -3px!important;  
  right: -70px!important;
}

</style>

{'fraction_non_alphanumeric': 0.19619520264681556, 'fraction_numerical': 0.01240694789081886, 'mean_word_length': 3.400291120815138, 'pattern_counts': {'":': 2, '<': 117, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '326343', 'n_tokens_mistral': 2264, 'n_tokens_neox': 2203, 'n_words': 338}