Šī revīzija ir iekļauta:
lb 2023-04-27 15:29:15 +08:00
vecāks a6d006786d
revīzija 9d918b529a
2 mainīti faili ar 48 papildinājumiem un 7 dzēšanām

Parādīt failu

@ -16,7 +16,7 @@ const http = axios.create({
*/
http.interceptors.request.use(config => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
config.headers['token'] = Cookies.get('token') || ''
config.headers['token'] = 'token' in config.headers ? config.headers.token : (Cookies.get('token') || '')
// console.log('[request interceptor] token is:', config.headers['token'])
// 默认参数
var defaults = {}

Parādīt failu

@ -1,6 +1,11 @@
<template>
<InputsArea class="opc-view" title="OPC UA">
opc view
<InputsArea class="opc-view" title="OPC UA" style="padding: 20px 0">
<el-form ref="form" :model="dataForm" label-width="100px">
<el-form-item v-for="(conf, key) in dataForm" :key="conf.key" :label="key">
<el-input v-model="dataForm[key]" clearable></el-input>
</el-form-item>
</el-form>
<el-button type="primary" class="" style="float: right" @click="handleConnectOpc" :loading="btnLoading">连接</el-button>
</InputsArea>
</template>
@ -12,11 +17,47 @@ export default {
components: { InputsArea },
props: {},
data() {
return {};
return {
dataForm: {
ip: "10.196.10.131",
messageMode: 1,
plcName: "Siemens OPC UA Server for OpenPCS 7",
policyConfig: "None",
urlConfig: "opc.tcp://CQNSDCSOPC1:4863",
userConfigs: "",
},
btnLoading: false
};
},
watch: {
btnLoading(val) {
if (val) {
document.body.style.cursor = 'progress'
} else {
document.body.style.cursor = 'unset'
}
}
},
methods: {
handleConnectOpc() {
this.btnLoading = true
const url = "/opcua/addThisPlc";
this.$http.post(url, { ...this.dataForm }, {
headers: {
token: ''
}
}).then(({ data: res }) => {
this.btnLoading = false
if (res.code !== 0) {
this.$message({
message: res.msg,
type: 'error',
duration: 1500
})
}
});
},
},
created() {},
mounted() {},
methods: {},
};
</script>