<template>
  <div style="height:100%;background-color:#FAFAFA;">
    <div style="width:100%;height:45px;background-color:rgb(55, 150, 223);font-size:13px;">
      <div style="height:1px;"></div>
      <p @click="openMain" style="margin:13px 0px 0px 10px;color:#fff;"><Icon type="ios-arrow-back" />返回</p>
    </div>
    <div v-for="i of systemURL" :key="i.userID" style="margin:5px 0px 10px 0px;">
        <p style="font-size:12px;font-weight:bold;color:#000;">{{i.userName}}</p>
        <Input v-model="i.userCode" placeholder="" clearable style="width:100%;" />
    </div>

    <Button @click="IsSystem" long type="primary" disabled style="height:40px;">修改</Button>
    
  </div>
</template>

<script>
export default {
  data() {
    return {
      model1:1,
      user:JSON.parse(sessionStorage.getItem('usercode')),
      data:null,
      systemURL:[],
    }
  },
  created() {
    if(this.user==null){
      this.$router.push('/');
    }
    this.$store.dispatch('GetSystemURLList').then(r=>{
      this.systemURL = r;
    })
  },
  methods: {
      openMain(){
          this.$router.push('/main')
      },
      IsSystem(){
        this.$store.dispatch('UpdateSystemURL',this.systemURL).then(r=>{
          if(r===''){
            this.$Message.success('修改失败');
          }
          else{
            this.$Message.success('已修改');
            this.systemURL = r;
          }
        })
      }
  },
}
</script>

<style>
.headone{
  width:33.3%;display: inline-block;text-align:center;height:40px;
}
.headtwo:hover{
  cursor: pointer;
}
.headtwo{
  margin:10px 0px 10px 0px;font-weight:bold;
}

.sub_com{
  width:100%;
  position: fixed; 
  margin-top: -100px;
}
</style>
