<template>
  <el-dialog
    :title="title"
    :center="true"
    align="left"
    top="5vh"
    width="700px"
    @close="closeModel"
    :close-on-click-modal="false"
    :visible.sync="showModelThis"
    v-loading="loading"
    element-loading-text="拼命加载中"
    element-loading-spinner="el-icon-loading"
    element-loading-background="rgba(0, 0, 0, 0.8)"
  >
    <el-card>
      <el-row :gutter="10">
        <el-col :span="24">

        </el-col>
        <el-col :span="24" style="text-align: right">
          <el-button @click="showModelThis = false">关 闭</el-button>
        </el-col>
      </el-row>
    </el-card>
  </el-dialog>
</template>
   <script>
import asyncRequest from "@/apis/service/system/parameter";
import resToken from "@/mixins/resToken";
export default {
  name: "specs",
  props: ["showModel", "id"],
  mixins:[resToken],
  data() {
    return {
      loading: false,
      title: "业务参数详情",
      showModelThis: this.showModel,
      dataInfo: {},
    };
  },
  methods: {
    closeModel() {
      console.log("closeModel!!");
    },
    
    async initForm() {
          await this.initData();
    },
    async initData() {
      this.loading = true;
      let res = await asyncRequest.detail({ id: this.id });
      this.loading = false;
      if (res&&res.code === 0) {
        let data = res.data;
        this.dataInfo = data;
      }else if (res && res.code >= 100 && res.code <= 104) {
        await this.logout();
      }else{
        this.$message.warning(res.message);
      }
    },
  },
  watch: {
    showModel: function (val) {
      this.showModelThis = val;
      if (val) {
        this.initForm();
      }
    },
    showModelThis(val) {
      if (!val) {
        this.$emit("cancel");
      }
    },
  },
};
</script>

   <style lang="scss" scoped>
.specs {
  .cexForm-ruleForm {
    .cexForm-div {
      margin-bottom: 22px;
      .cexForm-label {
        padding-right: 12px;
        color: #606266;
        line-height: 40px;
        font-size: 14px;
      }
      .cexForm-main {
        line-height: 40px;
        color: rgb(151, 168, 190);
        line-height: 40px;
        font-size: 14px;
      }
    }
  }
}
</style>
   