75 lines
2.1 KiB
Vue
75 lines
2.1 KiB
Vue
|
|
<template>
|
||
|
|
<el-dialog title="请确认检测脚本值类型" v-model='dialogVisible' @close="close" v-bind="dialogSmall">
|
||
|
|
<div>
|
||
|
|
<el-form :model="formContent" ref='dialogFormRef'>
|
||
|
|
<el-form-item label="检测脚本值类型" >
|
||
|
|
<el-select clearable placeholder="请选择类型检测脚本值类型" >
|
||
|
|
<el-option label="相对值" :value="0"></el-option>
|
||
|
|
<el-option label="绝对值" :value="1"></el-option>
|
||
|
|
</el-select>
|
||
|
|
</el-form-item>
|
||
|
|
</el-form>
|
||
|
|
</div>
|
||
|
|
<template #footer>
|
||
|
|
<div >
|
||
|
|
<el-button @click='close()'>取 消</el-button>
|
||
|
|
<el-button type="primary" @click='save()'>新增</el-button>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
</el-dialog>
|
||
|
|
|
||
|
|
</template>
|
||
|
|
<script setup lang='ts'>
|
||
|
|
import { dialogSmall } from '@/utils/elementBind'
|
||
|
|
import { ElMessage, type FormItemRule } from 'element-plus'
|
||
|
|
import { computed, reactive, type Ref, ref } from 'vue'
|
||
|
|
import { CirclePlus, Delete, EditPen } from '@element-plus/icons-vue'
|
||
|
|
|
||
|
|
|
||
|
|
// 定义弹出组件元信息
|
||
|
|
const dialogFormRef = ref()
|
||
|
|
|
||
|
|
function useMetaInfo() {
|
||
|
|
const dialogVisible = ref(false)
|
||
|
|
const formContent = ref()
|
||
|
|
return { dialogVisible, formContent }
|
||
|
|
}
|
||
|
|
|
||
|
|
const { dialogVisible, formContent } = useMetaInfo()
|
||
|
|
// 清空formContent
|
||
|
|
const resetFormContent = () => {
|
||
|
|
formContent.value = {
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// 关闭弹窗
|
||
|
|
const close = () => {
|
||
|
|
dialogVisible.value = false
|
||
|
|
// 清空dialogForm中的值
|
||
|
|
resetFormContent()
|
||
|
|
// 重置表单
|
||
|
|
dialogFormRef.value?.resetFields()
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// 保存数据
|
||
|
|
const save = () => {
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// 打开弹窗,可能是新增,也可能是编辑
|
||
|
|
const open = (currentMode: string) => {
|
||
|
|
// 重置表单
|
||
|
|
dialogFormRef.value?.resetFields()
|
||
|
|
dialogVisible.value = true
|
||
|
|
}
|
||
|
|
|
||
|
|
// 对外映射
|
||
|
|
defineExpose({ open })
|
||
|
|
const props = defineProps<{
|
||
|
|
refreshTable: (() => Promise<void>) | undefined;
|
||
|
|
}>()
|
||
|
|
|
||
|
|
</script>
|