lct
Your Name
2022-08-08 fe4005fe29aafa104485ffa2392598bd8dccd347
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<template>
    <el-dialog v-model="dialogVisible" :fullscreen="full" :before-close="resetForm" :title="titles" width="50%" draggable>
        <el-button @click="toggleFullscreen" size="small"  class="pot" :icon="FullScreen"></el-button>
        <el-form :model="form" label-width="120px" :disabled="disabled">
            <el-row>
                <el-col :span="11">
                    <el-form-item label="序号" size="default">
                        <el-input v-model="form.indexNum" placeholder="请填写序号" />
                    </el-form-item>
                </el-col>
                <el-col :span="11" :offset="2" size="default">
                    <el-form-item label="检查内容">
                        <el-input v-model="form.checkContent" placeholder="请填写检查内容" />
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="11">
                    <el-form-item label="检查指标" size="default">
                        <el-input v-model="form.checkTarget" placeholder="请填写检查指标" />
                    </el-form-item>
                </el-col>
                <el-col :span="11" :offset="2">
                    <el-form-item label="单位" size="default">
                        <el-input v-model="form.unit" placeholder="请填写单位" />
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="11">
                    <el-form-item label="巡检部位" size="default">
                        <el-input v-model="form.checkPart" placeholder="请填写巡检部位" />
                    </el-form-item>
                </el-col>
                <el-col :span="11" :offset="2">
                    <el-form-item label="频次" size="default">
                        <el-input v-model="form.rate" placeholder="请填写频次" />
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <template #footer>
            <span class="dialog-footer">
                <!-- <el-button type="primary" @click="dialogVisible = false" size="default">继续添加</el-button> -->
                <el-button @click="resetForm" size="default">关闭</el-button>
                <el-button type="primary" @click="submitForm" size="default">确定</el-button>
            </span>
        </template>
    </el-dialog>
    <!-- <DailogSearchUser ref="Show"></DailogSearchUser> -->
</template>
<script lang="ts">
import { defineComponent, ref, reactive } from 'vue';
import { Search, FullScreen } from '@element-plus/icons-vue';
import DailogSearchUser from '/@/components/DailogSearchUser/index.vue';
export default defineComponent({
    components: { DailogSearchUser },
    setup(props, { emit }) {
        const form = ref({
            indexNum: '',
            checkContent: '',
            checkTarget: '',
            unit: '',
            checkPart: "",
            rate: '',
        });
        // 开启弹窗
        const titles = ref();
        const disabled = ref(false);
        const dialogVisible = ref(false);
        const openDailog = (title: string, data: any) => {
            dialogVisible.value = true;
            titles.value = `${title}检查标准设置`;
            if (title == '查看') {
                disabled.value = true;
                form.value = data;
            } else if(title=='修改'){
                disabled.value = false;
                form.value = data;
            }
        };
        // 开启用户弹窗
        const Show = ref();
        const openUser = () => {
            Show.value.openDailog();
        };
        // 提交
        const submitForm = () => {
            dialogVisible.value = false;
            emit('onStand', form.value);
            form.value = {
                indexNum: '',
                checkContent: '',
                checkTarget: '',
                unit: '',
                checkPart: "",
                rate: '',
            };
        };
        //   取消
        const resetForm = () => {
            dialogVisible.value = false;
            form.value = {
                indexNum: '',
                checkContent: '',
                checkTarget: '',
                unit: '',
                checkPart: "",
                rate: '',
            };
        };
        //全屏
        const full = ref(false);
        const toggleFullscreen = () => {
            if (full.value == false) {
                full.value = true;
            } else {
                full.value = false;
            }
        };
        return {
            form,
            titles,
            disabled,
            dialogVisible,
            openDailog,
            submitForm,
            resetForm,
            Show,
            openUser,
            Search,
            full,
            toggleFullscreen,
            FullScreen,
        };
    },
});
</script>
<style scoped>
.el-row {
    padding: 0 0 20px 0;
}
</style>