<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>
|