<template>
  <el-container>
    <el-main>
      <el-card header="安卓APP" shadow="hover">
            <el-form >
              <el-form-item label="版本号">
                <el-input v-model="form.apk_version" placeholder="版本号"></el-input>
              </el-form-item>
              <el-form-item label="文件">
                <sc-upload-file
									v-model="form.apk_file"
									:multiple="false"
									:limit="1"
								>
									<el-button type="primary" icon="el-icon-upload">上传</el-button>
								</sc-upload-file>
              </el-form-item>
              <el-form-item label="备注">
                <el-input v-model="form.apk_remark" placeholder="备注"></el-input>
              </el-form-item>
              <el-form-item style="float:right">
                <el-button type="primary" :loading="saveLoading" @click="submitForm">保存</el-button>
              </el-form-item>
            </el-form>
          </el-card>
    </el-main>
  </el-container>
</template>
<script>
export default {
  data() {
    return {
      saveLoading:false,
      form: {
        apk_version:'',
        apk_file:'',
        apk_remark:'',
      },
    };
  },
  mounted(){
    this.getSysConfig();
  },
  methods:{
    getSysConfig() {
      this.$API.system.config.getInfo.req().then(res=>{
        this.form = res.apk
      })
    },
    submitForm(){
      this.saveLoading = true;
      let obj = {}
      obj.apk = this.form;
      this.$API.system.config.updateInfo.req(obj).then((res) => {
        this.saveLoading = false;
      }).catch(res=>{
        this.saveLoading = false;
      })
    },
    
  }
};
</script>
