2024-09-26 14:04:18 +08:00
|
|
|
<template>
|
|
|
|
<el-dialog
|
|
|
|
v-model="dialogFormVisible"
|
|
|
|
:title="title"
|
|
|
|
width="500px"
|
|
|
|
@close="close"
|
|
|
|
>
|
|
|
|
<div class="manage-container">
|
|
|
|
<el-form
|
|
|
|
ref="form"
|
|
|
|
:model="form"
|
|
|
|
label-width="80px"
|
|
|
|
label-position="left"
|
|
|
|
>
|
2024-10-10 08:18:58 +08:00
|
|
|
<el-form-item :label="$t('dataEnquiry.zdmc')">
|
2024-09-26 14:04:18 +08:00
|
|
|
<el-input v-model="form.name"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="站点序列号">
|
|
|
|
<el-input v-model="form.code"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
<vab-query-form>
|
|
|
|
<el-button type="primary" @click="save">提交</el-button>
|
|
|
|
</vab-query-form>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { copy } from '@/api/device';
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
form: {
|
|
|
|
name: '',
|
|
|
|
code: '',
|
|
|
|
deviceId: '',
|
|
|
|
},
|
|
|
|
dialogFormVisible: false,
|
|
|
|
title: '',
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
showCopy(row) {
|
|
|
|
this.form.deviceId = row.id;
|
|
|
|
this.dialogFormVisible = true;
|
|
|
|
this.title = '复制站点';
|
|
|
|
},
|
|
|
|
close() {
|
|
|
|
this.$refs['form'].resetFields();
|
|
|
|
this.form = this.$options.data().form;
|
|
|
|
this.dialogFormVisible = false;
|
|
|
|
this.$emit('fetch-data');
|
|
|
|
},
|
|
|
|
save() {
|
|
|
|
this.$refs['form'].validate(async valid => {
|
|
|
|
if (valid) {
|
|
|
|
const { msg } = await copy(this.form);
|
|
|
|
this.$notify({
|
|
|
|
title: msg,
|
|
|
|
type: 'success',
|
|
|
|
});
|
|
|
|
this.$refs['form'].resetFields();
|
|
|
|
this.dialogFormVisible = false;
|
|
|
|
this.$parent.fetchData();
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|