| | |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="数采配置" :visible.sync="dialogVisible3" width="400px"> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>IP:</div> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="configForm.ip"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>采集地址:</div> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="configForm.collectUrl"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>储存地址:</div> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="configForm.storageUrl"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>参照:</div> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="configForm.refer"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>X:</div> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="configForm.x"></el-input> |
| | | </div> |
| | | <div class="search_thing" style="margin-bottom: 14px;"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>Y:</div> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="configForm.y"></el-input> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>公式:</div> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="configForm.formula"></el-input> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-row> |
| | | <el-button @click="dialogVisible3=false">取 消</el-button> |
| | | <el-button type="primary" @click="submitForm3" :loading="upLoad3">确 定</el-button> |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | largeCategory: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'desc' |
| | | order: 'asc' |
| | | } |
| | | }, |
| | | isIndex: true, |
| | |
| | | font: '档案修订', |
| | | type: 'text', |
| | | method: 'isUpdate' |
| | | }, { |
| | | id: 'handleConfig', |
| | | font: '数采配置', |
| | | type: 'text', |
| | | method: 'handleConfig' |
| | | }], |
| | | headNoShow:['enDeviceName'], |
| | | tagField: { |
| | | deviceStatus: { |
| | | select: [] |
| | |
| | | subordinateDepartmentsList: [], |
| | | upLoad: false, |
| | | upLoad2: false, |
| | | dialogVisible3:false, |
| | | upLoad3:false, |
| | | configForm:{} |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | let up = false |
| | | let del = false |
| | | let add = false |
| | | let config = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'upDeviceParameter') { |
| | | up = true |
| | |
| | | if (power[i].menuMethod == 'addDeviceParameter') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'numberCollect') { |
| | | config = true |
| | | } |
| | | } |
| | | if (!config) { |
| | | this.componentData.do.splice(2, 1) |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(1, 1) |
| | |
| | | this.formData.imageName = response.data.name; |
| | | } |
| | | }, |
| | | handleSuccessUpImg2(response, ) { |
| | | handleSuccessUpImg2(response) { |
| | | if (response.code == 200) { |
| | | this.$nextTick(() => { |
| | | this.formData.imageUpload = response.data.url; |
| | | this.formData.imageName = response.data.name; |
| | | this.formData2.imageUpload = response.data.url; |
| | | this.formData2.imageName = response.data.name; |
| | | }) |
| | |
| | | delete this.formData.updateTime |
| | | delete this.formData.createUser |
| | | delete this.formData.updateUser |
| | | this.formData.insProductIds = this.formData.insProductIds.join() |
| | | this.formData.insProductIds = this.formData.insProductIds?this.formData.insProductIds.join():'' |
| | | this.upLoad = true; |
| | | this.$axios.post(this.$api.deviceScope.upDeviceParameter, this.formData, { |
| | | headers: { |
| | |
| | | this.dialogVisible2 = false |
| | | this.upLoad2 = false |
| | | }) |
| | | } |
| | | }, |
| | | handleConfig(row){ |
| | | this.configForm = {} |
| | | this.dialogVisible3 = true |
| | | this.$axios.post(this.$api.deviceScope.getNumberCollect+'?id='+row.id).then(res => { |
| | | this.configForm = res.data |
| | | }) |
| | | }, |
| | | submitForm3(){ |
| | | if(!this.configForm.ip){ |
| | | this.$message.error('请填写IP'); |
| | | return |
| | | } |
| | | if(!this.configForm.collectUrl){ |
| | | this.$message.error('请填写采集地址'); |
| | | return |
| | | } |
| | | if(!this.configForm.storageUrl){ |
| | | this.$message.error('请填写储存地址'); |
| | | return |
| | | } |
| | | if(!this.configForm.refer){ |
| | | this.$message.error('请填写参照'); |
| | | return |
| | | } |
| | | if(!this.configForm.x){ |
| | | this.$message.error('请填写X'); |
| | | return |
| | | } |
| | | if(!this.configForm.y){ |
| | | this.$message.error('请填写Y'); |
| | | return |
| | | } |
| | | if(!this.configForm.formula){ |
| | | this.$message.error('请填写公式'); |
| | | return |
| | | } |
| | | |
| | | this.upLoad3 = true |
| | | this.$axios.post(this.$api.deviceScope.numberCollect, this.configForm, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | this.upLoad3 = false |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.$message.success('操作成功') |
| | | this.refreshTable() |
| | | this.dialogVisible3 = false |
| | | }).catch(e => { |
| | | this.$message.error('操作失败') |
| | | this.dialogVisible3 = false |
| | | this.upLoad3 = false |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |