|
|
|
@ -3,6 +3,7 @@ |
|
|
|
<el-form v-model="queryParams" :inline="true"> |
|
|
|
<el-form-item :label="$t('patrolpoint.PointCode')"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.patrolpointCode" |
|
|
|
:placeholder=" |
|
|
|
$t('share.PleaseEnter') + ' ' + $t('patrolpoint.PointCode') |
|
|
|
" |
|
|
|
@ -10,6 +11,7 @@ |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="$t('patrolpoint.PointName')"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.patrolpointName" |
|
|
|
:placeholder=" |
|
|
|
$t('share.PleaseEnter') + ' ' + $t('patrolpoint.PointName') |
|
|
|
" |
|
|
|
@ -40,16 +42,21 @@ |
|
|
|
>{{ $t("share.new") }}</el-button |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button type="success" icon="el-icon-edit" plain size="mini" @click="handleEdit()">{{ |
|
|
|
$t("share.edit") |
|
|
|
}}</el-button> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
icon="el-icon-edit" |
|
|
|
plain |
|
|
|
size="mini" |
|
|
|
@click="handleEdit()" |
|
|
|
>{{ $t("share.edit") }}</el-button |
|
|
|
> |
|
|
|
</el-col> --> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button type="danger" icon="el-icon-delete" plain size="mini">{{ |
|
|
|
$t("share.delete") |
|
|
|
}}</el-button> |
|
|
|
</el-col> |
|
|
|
</el-col> --> |
|
|
|
</el-row> |
|
|
|
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px"> |
|
|
|
<el-table-column |
|
|
|
@ -59,13 +66,13 @@ |
|
|
|
align="center" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
prop="date" |
|
|
|
prop="patrolpointCode" |
|
|
|
:label="$t('patrolpoint.PointCode')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="date" |
|
|
|
prop="patrolpointName" |
|
|
|
:label="$t('patrolpoint.PointName')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
@ -75,38 +82,40 @@ |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span @click="tableTyle()" class="intelligenceType">11111</span> |
|
|
|
<span @click="tableTyle()" class="intelligenceType"> |
|
|
|
{{ |
|
|
|
scope.row.algSubtypeName |
|
|
|
? scope.row.algSubtypeName |
|
|
|
: "无法设置阈值" |
|
|
|
}} |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="date" |
|
|
|
prop="patrolContent" |
|
|
|
:label="$t('patrolpoint.InspectionContent')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="date" |
|
|
|
prop="purpose" |
|
|
|
:label="$t('patrolpoint.purpose')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="address" |
|
|
|
:label="$t('share.operate')" |
|
|
|
width="180" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
|
|
|
|
<el-table-column :label="$t('share.operate')" width="180" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
@click="handleEdit(scope.$index, scope.row)" |
|
|
|
@click="handleEdit(scope.row.patrolpointId)" |
|
|
|
>{{ $t("share.edit") }}</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
@click="handleDelete(scope.$index, scope.row)" |
|
|
|
@click="handleDelete(scope.row.patrolpointId)" |
|
|
|
>{{ $t("share.delete") }}</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
@ -117,6 +126,7 @@ |
|
|
|
:total="total" |
|
|
|
:page.sync="queryParams.pageNum" |
|
|
|
:limit.sync="queryParams.pageSize" |
|
|
|
@pagination="init" |
|
|
|
/> |
|
|
|
|
|
|
|
<el-dialog |
|
|
|
@ -125,16 +135,21 @@ |
|
|
|
width="30%" |
|
|
|
:before-close="handleClose" |
|
|
|
> |
|
|
|
<el-form v-model="dialogForm" :rules="rules" ref="ruleForm"> |
|
|
|
<el-form :model="dialogForm" :rules="rules" ref="ruleForm"> |
|
|
|
<el-form-item :label="$t('patrolpoint.PointCode')"> |
|
|
|
<el-input |
|
|
|
v-model="dialogForm.patrolpointCode" |
|
|
|
:placeholder=" |
|
|
|
$t('share.PleaseEnter') + ' ' + $t('patrolpoint.PointCode') |
|
|
|
" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="$t('patrolpoint.PointName')" prop="PointName"> |
|
|
|
<el-form-item |
|
|
|
:label="$t('patrolpoint.PointName')" |
|
|
|
prop="patrolpointName" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
v-model="dialogForm.patrolpointName" |
|
|
|
:placeholder=" |
|
|
|
$t('share.PleaseEnter') + ' ' + $t('patrolpoint.PointName') |
|
|
|
" |
|
|
|
@ -142,6 +157,7 @@ |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="$t('patrolpoint.MainDeviceTypeID')"> |
|
|
|
<el-input |
|
|
|
v-model="dialogForm.devicetypeId" |
|
|
|
:placeholder=" |
|
|
|
$t('share.PleaseEnter') + ' ' + $t('patrolpoint.MainDeviceTypeID') |
|
|
|
" |
|
|
|
@ -149,37 +165,47 @@ |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="$t('patrolpoint.MainDeviceID')"> |
|
|
|
<el-input |
|
|
|
v-model="dialogForm.mainDeviceId" |
|
|
|
:placeholder=" |
|
|
|
$t('share.PleaseEnter') + ' ' + $t('patrolpoint.MainDeviceID') |
|
|
|
" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="$t('patrolpoint.deviceID')"> |
|
|
|
<el-input :placeholder="$t('patrolpoint.deviceIDMsg')"></el-input> |
|
|
|
<el-input |
|
|
|
v-model="dialogForm.deviceId" |
|
|
|
:placeholder="$t('patrolpoint.deviceIDMsg')" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
:label="$t('patrolpoint.InspectionContent')" |
|
|
|
> |
|
|
|
<Editor :height="200" style="margin-top: 30px;"/> |
|
|
|
<el-form-item :label="$t('patrolpoint.InspectionContent')"> |
|
|
|
<Editor |
|
|
|
v-model="dialogForm.patrolContent" |
|
|
|
:height="200" |
|
|
|
style="margin-top: 30px" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item :label="$t('patrolpoint.purpose')"> |
|
|
|
<el-input |
|
|
|
v-model="dialogForm.purpose" |
|
|
|
:placeholder=" |
|
|
|
$t('share.PleaseEnter') + ' ' + $t('patrolpoint.purpose') |
|
|
|
" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="$t('patrolpoint.DeleteFlag')" > |
|
|
|
<el-input :placeholder="$t('patrolpoint.DeleteFlagMsg')"></el-input> |
|
|
|
<el-form-item :label="$t('patrolpoint.DeleteFlag')"> |
|
|
|
<el-input |
|
|
|
v-model="dialogForm.deleteFlag" |
|
|
|
:placeholder="$t('patrolpoint.DeleteFlagMsg')" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogVisible = false">{{ $t('share.cancel') }}</el-button> |
|
|
|
<el-button type="primary" @click="dialogVisible = false" |
|
|
|
>{{ $t('share.confirm') }}</el-button |
|
|
|
> |
|
|
|
<el-button @click="handleClose">{{ $t("share.cancel") }}</el-button> |
|
|
|
<el-button type="primary" @click="submitForm('ruleForm')">{{ |
|
|
|
$t("share.confirm") |
|
|
|
}}</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
@ -196,7 +222,12 @@ |
|
|
|
height="500px" |
|
|
|
> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column type="index" :label="$t('patrolpoint.index')" width="55" align="center" /> |
|
|
|
<el-table-column |
|
|
|
type="index" |
|
|
|
:label="$t('patrolpoint.index')" |
|
|
|
width="55" |
|
|
|
align="center" |
|
|
|
/> |
|
|
|
<el-table-column :label="$t('patrolpoint.AlgorithmName')" prop="name" /> |
|
|
|
<el-table-column |
|
|
|
:label="$t('patrolpoint.ThresholdUpperLimit')" |
|
|
|
@ -225,26 +256,59 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
// import Editor from "@/components/Editor"; |
|
|
|
import { |
|
|
|
getList, |
|
|
|
getItem, |
|
|
|
postAdd, |
|
|
|
postRemove, |
|
|
|
edit, |
|
|
|
postUpdate, |
|
|
|
} from "@/api/basedata/patrolpointmnt/patrolpoint"; |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
queryParams: {}, |
|
|
|
queryParams: { |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
}, |
|
|
|
tableData: [], |
|
|
|
total: 10, |
|
|
|
dialogVisible: false, |
|
|
|
title: this.$t('patrolpoint.AddInspectionPoints'), |
|
|
|
typeTitle: this.$t('patrolpoint.SetIntelligentRecognitionType'), |
|
|
|
title: this.$t("patrolpoint.AddInspectionPoints"), |
|
|
|
typeTitle: this.$t("patrolpoint.SetIntelligentRecognitionType"), |
|
|
|
typedialogVisible: false, |
|
|
|
rules:{ |
|
|
|
PointName: [ |
|
|
|
{ required: true, message:this.$t('share.PleaseEnter')+' '+ this.$t('share.PointName'), trigger: 'blur' } |
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
|
dialogForm: {}, |
|
|
|
rules: { |
|
|
|
patrolpointName: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "请输入点位名称", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() {}, |
|
|
|
mounted() { |
|
|
|
this.init(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 初始化 |
|
|
|
init() { |
|
|
|
getList(this.queryParams).then((res) => { |
|
|
|
this.tableData = res.rows; |
|
|
|
this.total = res.data.total; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 查询 |
|
|
|
handleQuery() { |
|
|
|
this.init(); |
|
|
|
}, |
|
|
|
// 重置 |
|
|
|
resetQuery() { |
|
|
|
this.queryParams = {}; |
|
|
|
this.init(); |
|
|
|
}, |
|
|
|
// 给表头加必填符号* |
|
|
|
addRedStar(h, { column }) { |
|
|
|
return [ |
|
|
|
@ -253,16 +317,83 @@ export default { |
|
|
|
]; |
|
|
|
}, |
|
|
|
add() { |
|
|
|
this.dialogForm = {}; |
|
|
|
this.type = 0; |
|
|
|
this.dialogVisible = true; |
|
|
|
this.title=this.$t('patrolpoint.AddInspectionPoints') |
|
|
|
this.title = this.$t("patrolpoint.AddInspectionPoints"); |
|
|
|
}, |
|
|
|
handleEdit(){ |
|
|
|
handleEdit(id) { |
|
|
|
this.type = 1; |
|
|
|
this.dialogVisible = true; |
|
|
|
this.title=this.$t('patrolpoint.EditInspectionPoints') |
|
|
|
this.title = this.$t("patrolpoint.EditInspectionPoints"); |
|
|
|
getItem(id).then((res) => { |
|
|
|
if(res.code==200){ |
|
|
|
this.dialogForm = res.data; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
tableTyle() { |
|
|
|
this.typedialogVisible = true; |
|
|
|
}, |
|
|
|
// 新增修改弹框确认 |
|
|
|
submitForm(ruleForm) { |
|
|
|
this.$refs[ruleForm].validate((v) => { |
|
|
|
if (v) { |
|
|
|
if (this.type == 0) { |
|
|
|
postAdd(this.dialogForm).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: "添加成功!", |
|
|
|
}); |
|
|
|
this.dialogVisible = false; |
|
|
|
this.init(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
edit(this.dialogForm).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: "编辑成功!", |
|
|
|
}); |
|
|
|
this.dialogVisible = false; |
|
|
|
this.init(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleClose() { |
|
|
|
this.dialogVisible = false; |
|
|
|
}, |
|
|
|
// 删除 |
|
|
|
// 删除 |
|
|
|
handleDelete(id) { |
|
|
|
this.$confirm(`确定要删除Id为${id}的数据吗?`, "删除", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
postRemove(id).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: "删除成功!", |
|
|
|
}); |
|
|
|
this.init(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.$message({ |
|
|
|
type: "info", |
|
|
|
message: "已取消删除", |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|