|
@@ -0,0 +1,193 @@
|
|
|
+<template>
|
|
|
+ <el-dialog :title="title" :visible.sync="dialogFormVisible" width="800px" @close="close">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
|
|
+<!--
|
|
|
+ <el-table-column show-overflow-tooltip label="编号" prop="id" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="编码" prop="nemCode" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="名称" prop="name" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="实时库名称" prop="aname" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="型号" prop="model" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="单位" prop="valueUnit" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="英文名称" prop="englishName" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="类型编号" prop="typeId" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="所属型号" prop="modelId" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="最大值" prop="maxval" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="最小值" prop="minval" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="合理最大值" prop="reasonableMaxval" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="合理最小值" prop="reasonableMinval" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="统一编码" prop="uniformCode" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="短id" prop="shortId" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="长id" prop="longId" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="场站编号" prop="windpowerstationId" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="实时配置编号" prop="realtimeId" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="集团测点编号" prop="groupPointId" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="具体名称" prop="specificName" align="center" sortable></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="系数" prop="coefficient" align="center" sortable></el-table-column>
|
|
|
+ -->
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12"><el-form-item label="编号" prop="id"><el-input class="inputs" v-model="form.id" autocomplete="off" :disabled="!idAdd?true:false"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="编码" prop="nemCode"><el-input class="inputs" v-model="form.nemCode" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="名称" prop="name"><el-input class="inputs" v-model="form.name" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="实时库名称" prop="aname"><el-input class="inputs" v-model="form.aname" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="型号" prop="model"><el-input class="inputs" v-model="form.model" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="单位" prop="valueUnit"><el-input class="inputs" v-model="form.valueUnit" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="英文名称" prop="englishName"><el-input class="inputs" v-model="form.englishName" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="类型编号" prop="typeId"><el-input class="inputs" v-model="form.typeId" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="所属型号" prop="modelId"><el-input class="inputs" v-model="form.modelId" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="最大值" prop="maxval"><el-input class="inputs" v-model="form.maxval" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="最小值" prop="minval"><el-input class="inputs" v-model="form.minval" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="合理最大值" prop="reasonableMaxval"><el-input class="inputs" v-model="form.reasonableMaxval" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="合理最小值" prop="reasonableMinval"><el-input class="inputs" v-model="form.reasonableMinval" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <!-- <el-col :span="12"><el-form-item label="风机编号" prop="windturbineId"><el-input class="inputs" v-model="form.windturbineId" autocomplete="off"></el-input></el-form-item></el-col> -->
|
|
|
+ <el-col :span="12"><el-form-item label="统一编码" prop="uniformCode"><el-input class="inputs" v-model="form.uniformCode" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="短id" prop="shortId"><el-input class="inputs" v-model="form.shortId" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="长id" prop="longId"><el-input class="inputs" v-model="form.longId" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="场站编号" prop="windpowerstationId"><el-input class="inputs" v-model="form.windpowerstationId" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="实时配置编号" prop="realtimeId"><el-input class="inputs" v-model="form.realtimeId" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <!-- <el-col :span="12"><el-form-item label="部件编号" prop="logicalUnitId"><el-input class="inputs" v-model="form.logicalUnitId" autocomplete="off"></el-input></el-form-item></el-col> -->
|
|
|
+ <el-col :span="12"><el-form-item label="集团测点编号" prop="groupPointId"><el-input class="inputs" v-model="form.groupPointId" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="具体名称" prop="specificName"><el-input class="inputs" v-model="form.specificName" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ <el-col :span="12"><el-form-item label="系数" prop="coefficient"><el-input class="inputs" v-model="form.coefficient" autocomplete="off"></el-input></el-form-item></el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="close">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="save">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import api from '@/api/realtimeDatabaseConfiguration'
|
|
|
+import dayjs from "dayjs";
|
|
|
+export default {
|
|
|
+ name: 'TableEdit',
|
|
|
+ props: {
|
|
|
+ options: {
|
|
|
+ type: Array,
|
|
|
+ default: []
|
|
|
+ },
|
|
|
+ stationList: {
|
|
|
+ type: Array,
|
|
|
+ default: []
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {
|
|
|
+ id: "",
|
|
|
+ nemCode: "",
|
|
|
+ name: "",
|
|
|
+ aname: "",
|
|
|
+ model: "",
|
|
|
+ valueUnit: "",
|
|
|
+ englishName: "",
|
|
|
+ typeId: "",
|
|
|
+ modelId: "",
|
|
|
+ maxval: "",
|
|
|
+ minval: "",
|
|
|
+ reasonableMaxval: "",
|
|
|
+ reasonableMinval: "",
|
|
|
+ // windturbineId: "",
|
|
|
+ uniformCode: "",
|
|
|
+ shortId: "",
|
|
|
+ longId: "",
|
|
|
+ windpowerstationId: "",
|
|
|
+ realtimeId: "",
|
|
|
+ // logicalUnitId: "",
|
|
|
+ groupPointId: "",
|
|
|
+ specificName: "",
|
|
|
+ coefficient: "",
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ id: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ nemCode: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ name: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ aname: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ model: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ valueUnit: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ englishName: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ typeId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ modelId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ maxval: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ minval: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ reasonableMaxval: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ reasonableMinval: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ // windturbineId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ uniformCode: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ shortId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ longId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ windpowerstationId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ realtimeId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ // logicalUnitId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ groupPointId: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ specificName: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ coefficient: [{ required: true, trigger: 'blur', message: '请输入' }],
|
|
|
+ },
|
|
|
+ title: '',
|
|
|
+ dialogFormVisible: false,
|
|
|
+ idAdd: true,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() { },
|
|
|
+ methods: {
|
|
|
+ changeDate() {
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ showEdit(row) {
|
|
|
+ if (!row) {
|
|
|
+ this.title = '添加'
|
|
|
+ this.idAdd = true
|
|
|
+ } else {
|
|
|
+ this.title = '编辑'
|
|
|
+ this.idAdd = false
|
|
|
+ this.form = Object.assign({}, row)
|
|
|
+ }
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ },
|
|
|
+ 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) {
|
|
|
+ api.addWppoint(this.form).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '添加成功!'
|
|
|
+ });
|
|
|
+ this.$emit('save-success');
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleChange() {
|
|
|
+ },
|
|
|
+ onBlur(val, param) {
|
|
|
+ if (typeof (this.form[param]) !== 'number') {
|
|
|
+ this.form[param] = val.replace(/[^0-9]/ig, "")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+.inputs {
|
|
|
+ width: 200px;
|
|
|
+}
|
|
|
+
|
|
|
+.lists {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+</style>
|