|
@@ -6,13 +6,13 @@
|
|
|
<el-button @click="discern(2)">批量识别设备参数关键字</el-button>
|
|
|
<el-button @click="examine">检查&微调</el-button>
|
|
|
<el-button>刷新</el-button>
|
|
|
- <el-button>保存</el-button>
|
|
|
+ <el-button @click="saveData">保存</el-button>
|
|
|
</div>
|
|
|
<div id="handsontableSteps1">
|
|
|
<handsontable-component ref="handsontable"></handsontable-component>
|
|
|
</div>
|
|
|
<own-dialog :width="'60%'" :title="title" :dialogVisible="isDialogShow" @cancel="close">
|
|
|
- <find-keyword ref="findKeyword" :type="type"></find-keyword>
|
|
|
+ <find-keyword ref="findKeyword" :type="type" @change="changeHand"></find-keyword>
|
|
|
</own-dialog>
|
|
|
<own-dialog :width="'1000px'" :index="true" title="关键内容设别——检查&微调" :dialogVisible="examineDialog" @cancel="close">
|
|
|
<!-- <find-keyword ref="findKeyword" :type="type"></find-keyword> -->
|
|
@@ -34,7 +34,8 @@
|
|
|
mapActions
|
|
|
} from "vuex";
|
|
|
import {
|
|
|
- queryPoint
|
|
|
+ queryPoint,
|
|
|
+ updatePoint
|
|
|
} from "fetch/point_http"
|
|
|
import findKeyword from "components/config_point/find_keyword"
|
|
|
export default {
|
|
@@ -47,7 +48,8 @@
|
|
|
hot: null,
|
|
|
title: "",
|
|
|
type: "",
|
|
|
- examineDialog: false
|
|
|
+ examineDialog: false,
|
|
|
+ changeFlag: true,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -80,6 +82,7 @@
|
|
|
this.title = "关键内同识别——批量识别设备参数关键字"
|
|
|
this.type = "arguments"
|
|
|
}
|
|
|
+ this.isChangeData()
|
|
|
this.isDialogShow = true
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.findKeyword.changeType()
|
|
@@ -88,12 +91,64 @@
|
|
|
close() {
|
|
|
this.isDialogShow = false
|
|
|
this.examineDialog = false
|
|
|
+ this.isChangeData()
|
|
|
+ },
|
|
|
+
|
|
|
+ //判断是否修改,修改调用修改接口,否则调用获取最新数据
|
|
|
+ isChangeData(){
|
|
|
+ if (!this.changeFlag) {
|
|
|
+ this.saveData(false)
|
|
|
+ } else {
|
|
|
+ this.getData()
|
|
|
+ }
|
|
|
},
|
|
|
//点击检查按钮
|
|
|
- examine(){
|
|
|
+ examine() {
|
|
|
+ this.isChangeData()
|
|
|
this.examineDialog = true
|
|
|
},
|
|
|
-
|
|
|
+ //保存
|
|
|
+ saveData(falg) {
|
|
|
+ if (!!this.hot) {
|
|
|
+ console.log(this.hot.getSourceData())
|
|
|
+ let data = this.hot.getSourceData(),
|
|
|
+ changeData;
|
|
|
+ changeData = data.map(item => {
|
|
|
+ return {
|
|
|
+ Id: item.Id,
|
|
|
+ DatasourceId: item.DatasourceId,
|
|
|
+ ProjectId: item.ProjectId,
|
|
|
+ Description: item.Description || null,
|
|
|
+ KeyEquipmentParameter: item.KeyEquipmentParameter || null,
|
|
|
+ Remarks: item.Remarks || null,
|
|
|
+ LocationFlag: item.LocationFlag || null,
|
|
|
+ KeyEquipmentType: item.KeyEquipmentType || null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(changeData)
|
|
|
+ updatePoint({
|
|
|
+ data: {
|
|
|
+ Content: changeData
|
|
|
+ },
|
|
|
+ type: this.protocolType
|
|
|
+ }, res => {
|
|
|
+ console.log(res)
|
|
|
+ if (!falg) {
|
|
|
+ this.$message.success("保存成功")
|
|
|
+ }
|
|
|
+ this.getData()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error("请确保存在数据")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //发生更改
|
|
|
+ changeHand(changeData, source) {
|
|
|
+ if (!!changeData) {
|
|
|
+ this.changeFlag = false
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
//获取初始数据
|
|
|
getData() {
|
|
|
let width, param, settings
|
|
@@ -122,8 +177,8 @@
|
|
|
console.log(this.hot)
|
|
|
})
|
|
|
},
|
|
|
- noSaveData(){
|
|
|
- return true
|
|
|
+ noSaveData() {
|
|
|
+ return this.changeFlag
|
|
|
}
|
|
|
},
|
|
|
components: {
|