123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <template>
- <div class="setting-form">
- <div class="setting-form__wrapper">
- <FormTitle icon="pump" title="基础参数" />
- <BasicForm :model="model" :schemas="paramsFormSchema" @register="regEUForm" @submit="submitHandler">
- <template #input="{ model: m, field, schema }">
- <ListItem class="w-100%" v-model:value="m[field]" type="input" bordered :label-width="180" :value-width="80">
- <template #label>
- {{ schema.label }}
- <Tooltip v-if="schema.helpMessage" :title="schema.helpMessage">
- <InfoCircleOutlined />
- </Tooltip>
- </template>
- </ListItem>
- </template>
- <template #select="{ model: m, field, schema }">
- <ListItem class="w-100%" v-model:value="m[field]" type="input" bordered :label-width="180" :value-width="80">
- <template #label>
- {{ schema.label }}
- <Tooltip v-if="schema.helpMessage" :title="schema.helpMessage">
- <InfoCircleOutlined />
- </Tooltip>
- </template>
- <template #value>
- <ApiSelect v-bind="schema.componentProps" v-model:value="m[field]" />
- </template>
- </ListItem>
- </template>
- </BasicForm>
- </div>
- <!-- <div class="setting-form__wrapper">
- <FormTitle icon="gas-pump" title="工作面参数" />
- <BasicForm :model="model" :schemas="workSurfaceFormSchema" @register="regWSForm" @submit="submitHandler">
- <template #input="{ model: m, field, schema }">
- <ListItem class="w-100%" v-model:value="m[field]" type="input" bordered :label-width="200">
- <template #label>
- {{ schema.label }}
- <Tooltip v-if="schema.helpMessage" :title="schema.helpMessage">
- <InfoCircleOutlined />
- </Tooltip>
- </template>
- </ListItem>
- </template>
- </BasicForm>
- </div>
- <div class="setting-form__wrapper">
- <FormTitle icon="pump" title="抽采单元参数" />
- <BasicForm :model="model" :schemas="extractionUnitFormSchema" @register="regEUForm" @submit="submitHandler">
- <template #input="{ model: m, field, schema }">
- <ListItem class="w-100%" v-model:value="m[field]" type="input" bordered :label-width="200">
- <template #label>
- {{ schema.label }}
- <Tooltip v-if="schema.helpMessage" :title="schema.helpMessage">
- <InfoCircleOutlined />
- </Tooltip>
- </template>
- </ListItem>
- </template>
- </BasicForm>
- </div> -->
- <div class="setting-form__wrapper">
- <FormTitle icon="water-pump" title="计算参数" />
- <BasicForm :model="model" :schemas="calculationFormSchema" @register="regCCForm" @submit="submitHandler">
- <!-- <template #radio="{ model: m, field, schema }">
- <ListItem class="w-100%">
- <template #label>
- <Switch v-model:checked="m[field]" size="small" />
- <span class="ml-10px">{{ schema.label }}</span>
- </template>
- </ListItem>
- </template> -->
- <template #input="{ model: m, field, schema }">
- <ListItem class="w-100%" v-model:value="m[field]" type="input" bordered :label-width="180" :value-width="80">
- <template #label>
- {{ schema.label }}
- <Tooltip v-if="schema.helpMessage" :title="schema.helpMessage">
- <InfoCircleOutlined />
- </Tooltip>
- </template>
- </ListItem>
- </template>
- </BasicForm>
- </div>
- <div class="text-right">
- <!-- <Button class="mr-10px setting-form__button" type="primary" ghost @click="cancel">取消</Button> -->
- <Button class="mr-10px setting-form__button" type="primary" ghost @click="calculate">计算</Button>
- <Button class="mr-10px setting-form__button" type="primary" ghost @click="submit">提交</Button>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { Button, Tooltip } from 'ant-design-vue';
- import ListItem from '@/views/vent/gas/components/list/listItem.vue';
- import FormTitle from '@/views/vent/gas/components/form/formTitle.vue';
- import { useForm, BasicForm, ApiSelect } from '/@/components/Form';
- import { /** workSurfaceFormSchema, extractionUnitFormSchema, */ calculationFormSchema, paramsFormSchema } from '../gasPumpSetting.data';
- import { ref } from 'vue';
- import { InfoCircleOutlined } from '@ant-design/icons-vue';
- const props = defineProps<{ model: Record<string, any> }>();
- const emit = defineEmits(['submit', 'calculate', 'cancel']);
- const defaultFormProp = {
- //注册表单列
- showActionButtonGroup: false,
- labelCol: { span: 0 },
- wrapperCol: { span: 24 },
- baseColProps: {
- flex: '16.6667%',
- },
- };
- const formData = ref<Record<string, any>>({});
- // const [regWSForm, { submit: submitWSForm }] = useForm(defaultFormProp);
- const [regEUForm, { submit: submitEUForm }] = useForm(defaultFormProp);
- const [regCCForm, { submit: submitCCForm }] = useForm(defaultFormProp);
- function submitHandler(v) {
- formData.value = {
- ...formData.value,
- ...v,
- };
- }
- // function cancel() {
- // emit('cancel');
- // }
- function calculate() {
- Promise.all([/** submitWSForm(), */ submitEUForm()]).then(() => {
- emit('calculate', { ...props.model, ...formData.value });
- });
- }
- function submit() {
- Promise.all([/** submitWSForm(), */ submitEUForm(), submitCCForm()]).then(() => {
- emit('submit', { ...props.model, ...formData.value });
- });
- }
- </script>
- <style lang="less" scoped>
- @import '/@/design/theme.less';
- @import '/@/design/theme.less';
- .setting-form {
- padding: 0 20px;
- }
- .setting-form__wrapper {
- color: #fff;
- border-top: 3px solid @vent-gas-primary-text;
- background-color: @vent-gas-primary-trasparent-bg;
- padding: 10px 10px 0 10px;
- margin-bottom: 10px;
- }
- .setting-form__button {
- color: @vent-gas-primary-text;
- border-color: @vent-gas-primary-text;
- background-color: transparent !important;
- }
- // 生产环境下,该项与开发环境有样式出入
- :deep(.zxm-form-item-label) {
- display: none;
- }
- </style>
|