<template>
|
<div class="comp-container">
|
<el-form :model="lsForm" label-width="180px" :rules="lsFormRules" ref="lsRef">
|
<div class="homeCard">
|
<el-row>
|
<el-col :span="8">
|
<el-form-item label="申请部门" prop="lsDepartment">
|
<el-select v-model="lsForm.lsDepartment" placeholder="请选择部门">
|
<el-option label="机修班" value="机修班" />
|
<el-option label="火工班" value="火工班" />
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="申请人" prop="lsApplyName">
|
<el-input
|
v-model="lsForm.lsApplyName"
|
placeholder="请输入"
|
class="input-with-select"
|
>
|
<template #append>
|
<el-button :icon="Search" />
|
</template>
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="受限空间名称" prop="lsUnitName">
|
<el-input
|
v-model="lsForm.lsUnitName"
|
placeholder="请输入"
|
class="input-with-select"
|
>
|
<template #append>
|
<el-button :icon="Search" />
|
</template>
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="受限空间所属单位" prop="lsUnit">
|
<el-select v-model="lsForm.lsUnit" placeholder="请选择">
|
<el-option label="一" value="一" />
|
<el-option label="二" value="二" />
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="受限空间内原有介质名称" prop="lsUnitName">
|
<el-input
|
v-model="lsForm.lsUnitMatterName"
|
placeholder="请输入"
|
class="input-with-select"
|
>
|
<template #append>
|
<el-button :icon="Search" />
|
</template>
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
</el-form>
|
</div>
|
</template>
|
|
<script lang="ts">
|
import { toRefs, reactive, defineComponent, ref } from 'vue';
|
import { storeToRefs } from 'pinia';
|
import { initBackEndControlRoutes } from '/@/router/backEnd';
|
import {useUserInfo} from "/@/stores/userInfo";
|
import { Session } from '/@/utils/storage';
|
import { Search } from '@element-plus/icons-vue'
|
import type { FormInstance, FormRules } from 'element-plus'
|
let global: any = {
|
homeChartOne: null,
|
homeChartTwo: null,
|
homeCharThree: null,
|
dispose: [null, '', undefined],
|
};
|
|
interface stateType {
|
homeOne: Array <type>
|
}
|
interface type {
|
|
}
|
export default defineComponent({
|
name: 'limitedSpaceForm',
|
props: {
|
lsForm: Object
|
},
|
setup(props) {
|
const userInfo = useUserInfo()
|
const { userInfos } = storeToRefs(userInfo);
|
const state = reactive<stateType>({});
|
const lsForm1 = reactive(props.lsForm)
|
const lsRef = ref<FormInstance>()
|
const lsFormRules = reactive<FormRules>({
|
lsDepartment:[{required: true,message: '此处不可为空',trigger: 'blur'}],
|
lsApplyName:[{required: true,message: '此处不可为空',trigger: 'blur'}],
|
lsUnitName: [{required: true,message: '此处不可为空',trigger: 'blur'}],
|
lsUnit: [{required: true,message: '此处不可为空',trigger: 'blur'}],
|
lsUnitMatterName: [{required: true,message: '此处不可为空',trigger: 'blur'}]
|
})
|
const validateForm = async () => {
|
let flag = null
|
await lsRef.value.validate(valid=>{
|
if(valid){
|
flag = true
|
}else{
|
flag = false
|
}
|
})
|
return flag
|
}
|
// 折线图
|
const renderMenu = async (value: string) => {
|
Session.set('projectId',value)
|
userInfos.value.projectId = value
|
await initBackEndControlRoutes();
|
};
|
return {
|
renderMenu,
|
lsForm1,
|
lsFormRules,
|
lsRef,
|
validateForm,
|
...toRefs(state),
|
};
|
},
|
});
|
</script>
|
|
<style scoped lang="scss">
|
.home-container {
|
height: 100%;
|
overflow: hidden;
|
.homeCard{
|
width: 100%;
|
padding: 20px;
|
background: #fff;
|
border-radius: 4px;
|
margin-bottom: 20px;
|
}
|
.el-row{
|
margin-bottom: 20px;
|
}
|
.el-row:last-child {
|
margin-bottom: 0;
|
}
|
.el-input{
|
width: 100% !important;
|
}
|
.el-date-editor::v-deep{
|
width: 100%;
|
}
|
.el-select{
|
width: 100%;
|
}
|
.el-cascader{
|
width: 100% !important;
|
}
|
.submitBtn{
|
display: flex;
|
justify-content: center;
|
}
|
}
|
</style>
|