潘志宝
2025-02-28 4a859a6d69984c77fa8166255c65f5a94eb0bd71
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<template>
  <el-dialog
    title="指标当前值"
    :close-on-click-modal="false"
    width="30%"
    v-model="visible"
  >
    <el-form
      :inline="true"
      :model="dataForm"
    >
      <el-form-item>
        <el-button @click="getData()">查询</el-button>
      </el-form-item>
      <el-form-item>
        <el-input v-model="dataForm.itemCurrentData" type="textarea" :rows="15" style="width: 550px" disabled/>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>
 
<script lang="ts" setup>
import {ref} from 'vue';
import * as ItemApi from '@/api/data/ind/item/item'
 
const message = useMessage() // 消息弹窗
const visible = ref(false);
const dataForm = ref({
  itemNo: "",
  itemCurrentData: "",
});
 
/** 打开弹窗 */
const open = async (itemNo: string) => {
  visible.value = true
  dataForm.value.itemNo = itemNo
  dataForm.value.itemCurrentData = JSON.stringify(await ItemApi.getItemCurrentData(itemNo));
}
 
defineExpose({open}) // 提供 open 方法,用于打开弹窗
 
const getData = async() =>{
  dataForm.value.itemCurrentData = JSON.stringify(await ItemApi.getItemCurrentData(dataForm.value.itemNo));
}
</script>