调命令

ds1.0
fanluyan 2 years ago
parent 6ded9f22d9
commit 67998fa25a

@ -825,3 +825,29 @@ export function getProtocolList(data) {
params: data,
});
}
//统一调用接口命令
export function setTermCamera(data) {
return request({
url: "/api/setTermCamera",
method: "post",
data,
// headers: {
// "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
// },
});
}
//统一返回数据
export function getTermCameraRequest(data) {
return request({
url: "/api/getTermCameraRequest",
method: "post",
data,
// headers: {
// "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
// },
});
}

@ -25,7 +25,7 @@
<el-input v-model="deviceTimeForm.newzztime"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary">查询</el-button>
<el-button type="primary" @click="setTermFn"></el-button>
<el-button type="primary">设置</el-button>
</el-form-item>
</el-form>
@ -263,7 +263,7 @@
></el-input>
</el-form-item>
<el-form-item class="runformbtn">
<el-button type="primary">查询</el-button>
<el-button type="primary" @click="setTermFn"></el-button>
</el-form-item>
</el-form>
</div>
@ -318,7 +318,12 @@
</el-dialog>
</template>
<script>
import { resetTerminalApi, getTermLastGPSPosition } from "@/utils/api/index";
import {
resetTerminalApi,
getTermLastGPSPosition,
setTermCamera,
getTermCameraRequest,
} from "@/utils/api/index";
import imageCapture from "./imageCapture.vue";
import videoCapture from "./videoCapture.vue";
@ -344,6 +349,9 @@ export default {
gpsForm: {}, //gps
tabsActive: "first",
rowData: {},
requestid: "",
timer: null,
i: 0,
};
},
mounted() {},
@ -365,6 +373,30 @@ export default {
this.$refs.videoCaptureref.getRatio();
}
},
setTermFn() {
console.log("点击了统一的接口", "runningstatus");
setTermCamera({
termId: this.rowData.id,
list: [{ name: "act", value: "gpsinfo" }],
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
this.getinfo();
// this.timer = window.setInterval(() => {
// this.getinfo();
// this.i++;
// }, 1000);
})
.catch((err) => {});
},
getinfo() {
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
console.log(res);
})
.catch();
},
//gps
gpsSearch() {
console.log(this.rowData);

@ -151,6 +151,7 @@ export default {
this.i = 0;
clearInterval(this.timer);
this.timer = null;
this.loading = false;
},
},
};

Loading…
Cancel
Save