增加网关采集卡别名和参数别名
This commit is contained in:
parent
4d805279c9
commit
118ad97a8d
@ -135,6 +135,9 @@ public class DataQueryService implements IDataQueryService{
|
||||
String tableName = "gateway_fanuc_data";
|
||||
String columnName = "power_time,process_num,total_process,work_time";
|
||||
Map<String, Object> resultMap = getAllData2ChartData(equipId,tableName,columnName, startTime, endTime);
|
||||
if(resultMap == null){
|
||||
return null;
|
||||
}
|
||||
List<Double> workTimeList = (List<Double>) resultMap.get("work_time");
|
||||
List<Double> powerTimeList = (List<Double>) resultMap.get("power_time");
|
||||
resultMap.put("work_time", workTimeList.stream().map(w -> w / 60.0).collect(Collectors.toList()));
|
||||
|
@ -23,6 +23,9 @@ public class GatewayCardInfoPageReqVO extends PageParam {
|
||||
@Schema(description = "采集卡名称")
|
||||
private String cardName;
|
||||
|
||||
@Schema(description = "采集卡别名")
|
||||
private String cardAlias;
|
||||
|
||||
@Schema(description = "采集卡与influxdb映射表名")
|
||||
private String cardTableMapping;
|
||||
|
||||
|
@ -24,6 +24,9 @@ public class GatewayCardInfoSaveReqVO {
|
||||
@Schema(description = "采集卡名称")
|
||||
private String cardName;
|
||||
|
||||
@Schema(description = "采集卡别名")
|
||||
private String cardAlias;
|
||||
|
||||
@Schema(description = "采集卡与influxdb映射表名")
|
||||
private String cardTableMapping;
|
||||
|
||||
|
@ -30,6 +30,10 @@ public class GatewayCardParamsRespVO {
|
||||
@ExcelProperty("通道名称")
|
||||
private String channelName;
|
||||
|
||||
@Schema(description = "通道别名")
|
||||
@ExcelProperty("通道别名")
|
||||
private String channelAlias;
|
||||
|
||||
@Schema(description = "参数映射名称")
|
||||
@ExcelProperty("参数映射名称")
|
||||
private String paramMappingName;
|
||||
|
@ -24,6 +24,9 @@ public class GatewayCardParamsSaveReqVO {
|
||||
@Schema(description = "通道名称")
|
||||
private String channelName;
|
||||
|
||||
@Schema(description = "通道别名")
|
||||
private String channelAlias;
|
||||
|
||||
@Schema(description = "参数映射名称")
|
||||
private String paramMappingName;
|
||||
|
||||
|
@ -41,6 +41,12 @@ public class GatewayCardInfoDO extends BaseDO {
|
||||
* 采集卡名称
|
||||
*/
|
||||
private String cardName;
|
||||
|
||||
/**
|
||||
* 采集卡别名
|
||||
*/
|
||||
private String cardAlias;
|
||||
|
||||
/**
|
||||
* 采集卡与influxdb映射表名
|
||||
*/
|
||||
|
@ -41,6 +41,12 @@ public class GatewayCardParamsDO extends BaseDO {
|
||||
* 通道名称
|
||||
*/
|
||||
private String channelName;
|
||||
|
||||
/**
|
||||
* 通道别名
|
||||
*/
|
||||
private String channelAlias;
|
||||
|
||||
/**
|
||||
* 参数映射名称
|
||||
*/
|
||||
|
@ -1,68 +1,163 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="150px">
|
||||
<el-dialog
|
||||
:title="dialogTitle"
|
||||
:visible.sync="dialogVisible"
|
||||
width="45%"
|
||||
v-dialogDrag
|
||||
append-to-body
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
v-loading="formLoading"
|
||||
label-width="150px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床型号" prop="modelId">
|
||||
<el-select v-model="formData.modelId" placeholder="请选择机床型号" style="width: 100%">
|
||||
<el-option v-for="item in modelSelection"
|
||||
:key="item.modelId" :label="item.modelName" :value="item.modelId"/>
|
||||
<el-form-item
|
||||
label="机床型号"
|
||||
prop="modelId"
|
||||
>
|
||||
<el-select
|
||||
v-model="formData.modelId"
|
||||
placeholder="请选择机床型号"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in modelSelection"
|
||||
:key="item.modelId"
|
||||
:label="item.modelName"
|
||||
:value="item.modelId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户信息" prop="customerId">
|
||||
<el-select v-model="formData.customerId" placeholder="请选择客户信息" style="width: 100%">
|
||||
<el-option v-for="item in customerSelection"
|
||||
:key="item.customerId" :label="item.customerName" :value="item.customerId"/>
|
||||
<el-form-item
|
||||
label="客户信息"
|
||||
prop="customerId"
|
||||
>
|
||||
<el-select
|
||||
v-model="formData.customerId"
|
||||
placeholder="请选择客户信息"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in customerSelection"
|
||||
:key="item.customerId"
|
||||
:label="item.customerName"
|
||||
:value="item.customerId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机床设备编号" prop="equipNo">
|
||||
<el-input v-model="formData.equipNo" placeholder="请输入机床设备编号"/>
|
||||
<el-form-item
|
||||
label="机床设备名称"
|
||||
prop="equipName"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.equipName"
|
||||
placeholder="请输入机床设备名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生产日期" prop="productDate">
|
||||
<el-date-picker clearable v-model="formData.productDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择生产日期" style="width: 100%"/>
|
||||
<el-form-item
|
||||
label="机床设备编号"
|
||||
prop="equipNo"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.equipNo"
|
||||
placeholder="请输入机床设备编号"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出厂日期/购买日期" prop="purchaseDate">
|
||||
<el-date-picker clearable v-model="formData.purchaseDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择出厂日期/购买日期" style="width: 100%"/>
|
||||
<el-form-item
|
||||
label="生产日期"
|
||||
prop="productDate"
|
||||
>
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="formData.productDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择生产日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保修到期日期" prop="expireDate">
|
||||
<el-date-picker clearable v-model="formData.expireDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择保修到期日期" style="width: 100%"/>
|
||||
<el-form-item
|
||||
label="出厂日期/购买日期"
|
||||
prop="purchaseDate"
|
||||
>
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="formData.purchaseDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择出厂日期/购买日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-form-item label="机床状态" prop="status">-->
|
||||
<!-- <el-select v-model="formData.status" placeholder="请选择机床状态" style="width: 100%">-->
|
||||
<!-- <el-option v-for="dict in this.getDictDatas(DICT_TYPE.EQUIP_STATUS)"-->
|
||||
<!-- :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" :rows="4" placeholder="请输入备注"/>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="保修到期日期"
|
||||
prop="expireDate"
|
||||
>
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="formData.expireDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择保修到期日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-form-item label="机床状态" prop="status">-->
|
||||
<!-- <el-select v-model="formData.status" placeholder="请选择机床状态" style="width: 100%">-->
|
||||
<!-- <el-option v-for="dict in this.getDictDatas(DICT_TYPE.EQUIP_STATUS)"-->
|
||||
<!-- :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item
|
||||
label="备注"
|
||||
prop="remark"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="二维码图片">
|
||||
<ImageUpload v-model="formData.qrcodePicPath"/>
|
||||
<ImageUpload v-model="formData.qrcodePicPath" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitForm"
|
||||
:disabled="formLoading"
|
||||
>确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -70,10 +165,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as EquipInfoApi from '@/api/system/equip/equipInfo';
|
||||
import ImageUpload from '@/components/ImageUpload';
|
||||
import {getCustomerSelection} from '@/api/system/baseData/customerInfo';
|
||||
import {getModelSelection} from '@/api/system/baseData/modelinfo';
|
||||
import * as EquipInfoApi from "@/api/system/equip/equipInfo";
|
||||
import ImageUpload from "@/components/ImageUpload";
|
||||
import { getCustomerSelection } from "@/api/system/baseData/customerInfo";
|
||||
import { getModelSelection } from "@/api/system/baseData/modelinfo";
|
||||
|
||||
export default {
|
||||
name: "EquipInfoForm",
|
||||
@ -82,8 +177,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
customerSelection:[],
|
||||
modelSelection:[],
|
||||
customerSelection: [],
|
||||
modelSelection: [],
|
||||
// 弹出层标题
|
||||
dialogTitle: "",
|
||||
// 是否显示弹出层
|
||||
@ -96,6 +191,7 @@ export default {
|
||||
modelId: undefined,
|
||||
customerId: undefined,
|
||||
equipNo: undefined,
|
||||
equipName: undefined,
|
||||
productDate: undefined,
|
||||
purchaseDate: undefined,
|
||||
expireDate: undefined,
|
||||
@ -105,20 +201,36 @@ export default {
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
modelId: [{required: true, message: '机床型号不能为空', trigger: 'change'}],
|
||||
customerId: [{required: true, message: '客户信息不能为空', trigger: 'change'}],
|
||||
equipNo: [{required: true, message: '机床设备编号不能为空', trigger: 'blur'}],
|
||||
status: [{ required: true, message: '机床状态不能为空', trigger: 'change' }],
|
||||
modelId: [
|
||||
{ required: true, message: "机床型号不能为空", trigger: "change" },
|
||||
],
|
||||
customerId: [
|
||||
{ required: true, message: "客户信息不能为空", trigger: "change" },
|
||||
],
|
||||
equipNo: [
|
||||
{ required: true, message: "机床设备编号不能为空", trigger: "blur" },
|
||||
],
|
||||
equipName: [
|
||||
{ required: true, message: "机床设备名称不能为空", trigger: "blur" },
|
||||
{
|
||||
max: 50,
|
||||
message: "机床设备名称长度在50个字符以内",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "机床状态不能为空", trigger: "change" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
getCustomerSelection().then(res=>{
|
||||
getCustomerSelection().then((res) => {
|
||||
this.customerSelection = res;
|
||||
})
|
||||
getModelSelection().then(res=>{
|
||||
});
|
||||
getModelSelection().then((res) => {
|
||||
this.modelSelection = res;
|
||||
})
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
@ -150,14 +262,14 @@ export default {
|
||||
await EquipInfoApi.updateEquipInfo(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
this.$emit("success");
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
await EquipInfoApi.createEquipInfo(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
this.$emit("success");
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
@ -177,7 +289,7 @@ export default {
|
||||
remark: undefined,
|
||||
};
|
||||
this.resetForm("formRef");
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user