54 lines
1.3 KiB
Vue
54 lines
1.3 KiB
Vue
<template>
|
|
<div class="dialog" v-if="dialogForm">
|
|
<div class="head_box">
|
|
<span class="title">{{ title }}模型 </span>
|
|
<div>
|
|
<el-button type="primary" size="small" :loading="loading" @click="submit" v-show="title!='详情'">保存</el-button>
|
|
<el-button size="small" @click="close">关闭</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="form_cnt">
|
|
<FormMessage :formList="formData" v-model="listQuery" ref="elform" :rules="rules">
|
|
</FormMessage>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { reactive, ref } from 'vue'
|
|
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
|
const dialogForm = ref(false)
|
|
const title=ref("新增")
|
|
const init = (type,row) => {
|
|
dialogForm.value = true
|
|
if (type=='edit') {
|
|
title.value="编辑"
|
|
} else if (type=='add') {
|
|
title.value="新增"
|
|
} else {
|
|
title.value="详情"
|
|
}
|
|
}
|
|
// 表单内容
|
|
const formData = reactive([
|
|
{ label: "模型名称", prop: "mxmc", type: "input", width: "40%" },
|
|
{ label: "模型类型", prop: "mxlx", type: "input", width: "40%"},
|
|
])
|
|
const loading=ref(false)
|
|
// 新增
|
|
const submit = () => {
|
|
loading.value = true
|
|
}
|
|
|
|
// 关闭
|
|
const close = () => {
|
|
dialogForm.value = false
|
|
}
|
|
defineExpose({
|
|
init
|
|
})
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
</style>
|