<!--
 * @Author: 半生瓜 1515706227@qq.com
 * @Date: 2024-05-08 15:04:53
 * @LastEditors: 半生瓜 1515706227@qq.com
 * @LastEditTime: 2024-06-05 16:38:48
 * @FilePath: \vue-element-plus-admin-mini\src\components\VersionsBut\src\Screenfull.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import { ElButton } from 'element-plus'
import { ref } from 'vue'
import { Dialog } from '@/components/Dialog'
import { getSystem } from '@/api/System'

const dialogVisible = ref(false)

const v1 = ref('')
const v2 = ref('')
const v3 = ref('')

const btnClick = async () => {
  console.log('点击版本====')
  const res = await getSystem()
  if (res.code == 200) {
    console.log('kankanjjjjkkkk', res)
    res.data.map((item) => {
      if (item.configKey == 'jarVersion') {
        v1.value = JSON.parse(item.configValue).app
        v2.value = JSON.parse(item.configValue).manger
        v3.value = JSON.parse(item.configValue).java
      }
    })
  }
  dialogVisible.value = true
}
</script>

<template>
  <ElButton type="primary" @click="btnClick">版本</ElButton>
  <Dialog v-model="dialogVisible" maxHeight="80px" width="35rem" title="版本信息">
    <div> 客户端版本：{{ v1 }}</div>
    <div style="margin-top: 10px"> Web后台管理系统版本：{{ v2 }}</div>
    <div style="margin-top: 10px"> 后端服务版本：{{ v3 }}</div>
  </Dialog>
</template>
