systeminfo.vue 2.25 KB
<template>
  <div class="systembox">
    <el-row class="manage-content">
      <el-col :span="24">
        <el-table
          :data="tableData"
          :max-height="tableHeight"
          style="width: 100%;"
          v-loading="loading"
        >
          <el-table-column prop="servName" align="center" :label="$t('table.serviceName')" ></el-table-column>
          <el-table-column :label="$t('table.version')" align="center" prop="version"></el-table-column>
          <el-table-column :label="$t('table.publishdate')"  align="center" prop="publish"></el-table-column>
          <el-table-column :label="$t('table.operate')"  align="center">
            <template slot-scope="scope">
              <div>
                <!-- <el-button type="primary" @click="showVersionInfo(scope.row)" size="mini">{{$t('button.look')}}</el-button> -->
                <el-button @click="showVersionInfo(scope.row)" type="text" size="small" class="tab-btn">{{$t('button.look')}}</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%"
      >
      <span v-html="serviceinfo"></span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false" size="small">取 消</el-button>
    <el-button type="primary" @click="dialogVisible = false" size="small">确 定</el-button>
  </span>
</el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      tableData:[],
      loading:false,
      dialogVisible:false,
      serviceinfo:''
    }
  },
  methods: {
    getSystemInfo() {
       this.$api.base
        .getSystemInfo().then(res => {
          this.tableData = res.data.data;
        })
      },
    showVersionInfo(data){
      this.$api.base
        .getSystemServiceInfo(data.servName).then(res => {
          this.dialogVisible =true;
          console.log(res)
          this.serviceinfo = res.data.msg
        })
    }
  },
  computed: {
    tableHeight() {
      const windowInnerHeight = window.innerHeight;
      return windowInnerHeight - 200;
    }
  },
  created(){
    this.getSystemInfo();
  }
}
</script>
<style scoped>
.systembox{
  margin: 20px 0;
}
</style>