aaa
This commit is contained in:
@ -65,7 +65,7 @@ app.listen(1000, function () {
|
||||
|
||||
const schedule = require('node-schedule');
|
||||
const taskforupdate=require('./comman/frpclinet')
|
||||
|
||||
const getliuliang=require('./comman/getliuliang')
|
||||
|
||||
|
||||
const scheduleCronstyle = ()=>{
|
||||
@ -73,7 +73,9 @@ const scheduleCronstyle = ()=>{
|
||||
schedule.scheduleJob('* 30 * * * *',()=>{
|
||||
console.log('scheduleCronstyle:' + new Date());
|
||||
taskforupdate.getfrpserver();
|
||||
getliuliang.updatasimdb();
|
||||
});
|
||||
}
|
||||
taskforupdate.getfrpserver();
|
||||
getliuliang.updatasimdb();;
|
||||
scheduleCronstyle();
|
@ -123,7 +123,7 @@ async function getfrpserver()
|
||||
|
||||
if(aaa[i].name.endsWith('_data'))
|
||||
{
|
||||
console.log(aaa[i])
|
||||
// console.log(aaa[i])
|
||||
var data=aaa[i]
|
||||
//console.log(aaa[i].name)
|
||||
//去除后缀
|
||||
@ -139,7 +139,7 @@ async function getfrpserver()
|
||||
if (data.name=="TowerIS2_2006_data")
|
||||
{
|
||||
//将data.nameup 从devlistname中删除
|
||||
console.log("delete TowerIS2_2006_data")
|
||||
//console.log("delete TowerIS2_2006_data")
|
||||
|
||||
}
|
||||
|
||||
@ -149,8 +149,8 @@ async function getfrpserver()
|
||||
//将data.nameup 从devlistname中删除
|
||||
let index=devlistname.indexOf(data.nameup)
|
||||
devlistname.splice(index,1)
|
||||
console.log("delete "+data.nameup)
|
||||
console.log(devlistname);
|
||||
// console.log("delete "+data.nameup)
|
||||
// console.log(devlistname);
|
||||
|
||||
|
||||
}
|
||||
|
54
server/comman/getliuliang.js
Normal file
54
server/comman/getliuliang.js
Normal file
@ -0,0 +1,54 @@
|
||||
const axios = require('axios');
|
||||
const herader = {
|
||||
'Content-Type': 'application/json',
|
||||
'Uuid':"5e74228e138c4da891f9d49e198ed5b6"
|
||||
}
|
||||
const db=require("../comman/db")
|
||||
let query = {"msisdn":"1441026718896","pageSize":10,"currentPage":1}
|
||||
// testgetliuliang();
|
||||
|
||||
async function testgetliuliang(){
|
||||
let resulat=await getliuliang(query);
|
||||
console.log(resulat);
|
||||
|
||||
}
|
||||
|
||||
async function getsiminfobymsisdn(msisdn){
|
||||
let query = {"msisdn":msisdn,"pageSize":10,"currentPage":1}
|
||||
let resulat=await getliuliang(query);
|
||||
return resulat;
|
||||
|
||||
}
|
||||
exports.updatasimdb=updatasimdb;
|
||||
const initdb=require("../comman/initdb")
|
||||
async function updatasimdb(){
|
||||
|
||||
initdb.initdb();
|
||||
let sql="select * from devuser where 1"
|
||||
let result=await db.queryacy(sql);
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
let siminfo=await getsiminfobymsisdn(result[i].simnumber);
|
||||
// console.log(siminfo);
|
||||
if(siminfo.length>0){
|
||||
simtotal=siminfo[0].periodCanUsage
|
||||
simused=siminfo[0].hasUseRate
|
||||
simdateline=siminfo[0].exitTime
|
||||
//更新simtotal和 simused simdateline
|
||||
sql="update devuser set simtotal='"+simtotal+"',simused='"+simused+"',simdateline='"+simdateline+"' where autoid="+result[i].autoid;
|
||||
|
||||
await db.queryacy(sql);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async function getliuliang(query){
|
||||
let result=await axios.post('https://api.wl1688.net/client/card/findMyPage', query, { headers: herader });
|
||||
// console.log(result.data.data.list);
|
||||
return result.data.data.list;
|
||||
|
||||
}
|
||||
|
27
server/comman/initdb.js
Normal file
27
server/comman/initdb.js
Normal file
@ -0,0 +1,27 @@
|
||||
const db=require("../comman/db")
|
||||
|
||||
let sql="CREATE TABLE IF NOT EXISTS `remotemqtt`.`devuser` (\
|
||||
`autoid` INT NOT NULL AUTO_INCREMENT,\
|
||||
`devid` INT NOT NULL,\
|
||||
`devname` VARCHAR(255) NOT NULL,\
|
||||
`simnumber` VARCHAR(20) NOT NULL,\
|
||||
`simtotal` INT NULL,\
|
||||
`simused` INT NULL,\
|
||||
`simdateline` DATE NULL,\
|
||||
`devusername` TEXT NULL,\
|
||||
`beizhu` TEXT NULL,\
|
||||
PRIMARY KEY (`autoid`)\
|
||||
) ENGINE = InnoDB;\
|
||||
"
|
||||
|
||||
async function initdb(){
|
||||
db.query(sql,(err)=>{
|
||||
if(err){
|
||||
console.log(err);
|
||||
}
|
||||
else{
|
||||
console.log("create devuser success");
|
||||
}
|
||||
})
|
||||
}
|
||||
exports.initdb=initdb;
|
@ -38,7 +38,10 @@ async function sendMessageAndWaitForResponse(addres, message) {
|
||||
}
|
||||
async function runinws( message,addres){
|
||||
let aa=await sendMessageAndWaitForResponse(addres,message)
|
||||
|
||||
if(typeof aa[0]!="array"||aa.length==0)
|
||||
{
|
||||
aa=[Buffer.from("error")]
|
||||
}
|
||||
return aa
|
||||
|
||||
// console.log(aa[1].toString())
|
||||
|
@ -3,4 +3,6 @@ var router = express.Router();
|
||||
const devinfoHandler = require('../router_handler/devinof_handle')
|
||||
|
||||
router.get('/getfilelistinfo', devinfoHandler.getfilelistinfo)
|
||||
router.post('/getdevuserinfo', devinfoHandler.getDevUserinfo)
|
||||
router.post('/setdevuserinfo', devinfoHandler.setDevUserinfo)
|
||||
module.exports = router;
|
@ -1,9 +1,89 @@
|
||||
const db=require("../comman/db")
|
||||
const { updateLocale } = require("moment");
|
||||
const db = require("../comman/db")
|
||||
|
||||
exports.getfilelistinfo=(req, res) => {
|
||||
sql='SELECT d.*, i.last_online FROM filebrowerinfo d JOIN frpinfo i ON d.name = i.id;'
|
||||
db.query(sql,(err,result)=>{
|
||||
exports.getfilelistinfo = (req, res) => {
|
||||
sql = 'SELECT d.*, i.last_online FROM filebrowerinfo d JOIN frpinfo i ON d.name = i.id;'
|
||||
db.query(sql, (err, result) => {
|
||||
res.send(result);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
exports.getDevUserinfo = (req, res) => {
|
||||
let devid = req.body.devid;
|
||||
sql = 'SELECT * FROM devuser where devid=' + devid + ';'
|
||||
|
||||
db.query(sql, (err, result) => {
|
||||
if (err || result.length == 0) {
|
||||
// console.log(err);
|
||||
let message = { "devid": devid };
|
||||
//去filebrowerinfo查询name
|
||||
let sql = 'SELECT name FROM filebrowerinfo where autoid=' + devid + ';'
|
||||
db.query(sql, (err, result) => {
|
||||
if (err || result.length == 0) {
|
||||
console.log(err);
|
||||
message.devname = "未知";
|
||||
res.send(message);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
message.devname = result[0].name;
|
||||
res.send([message]);
|
||||
})
|
||||
|
||||
|
||||
|
||||
}else
|
||||
{
|
||||
res.send(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
exports.setDevUserinfo = (req, res) => {
|
||||
let data=req.body
|
||||
let devid = data.devid;
|
||||
//先查询是否存在
|
||||
let sql = 'SELECT * FROM devuser where devid=' + devid + ';'
|
||||
db.query(sql, (err, result) => {
|
||||
if (err || result.length == 0) {
|
||||
//不存在则插入
|
||||
insertDevUser(data, res);
|
||||
} else {
|
||||
//存在则更新
|
||||
updateDevUser(data, res);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
function insertDevUser(data,res)
|
||||
{
|
||||
let sql = 'INSERT INTO devuser SET ?'
|
||||
db.query(sql, data, (err, result) => {
|
||||
if (err) {
|
||||
// console.log(err);
|
||||
res.send({ "status": "error" });
|
||||
} else {
|
||||
res.send({ "status": "success" });
|
||||
}
|
||||
})
|
||||
}
|
||||
function updateDevUser(data,res)
|
||||
{
|
||||
let sql = 'UPDATE devuser SET ? WHERE devid = ?'
|
||||
db.query(sql, [data, data.devid], (err, result) => {
|
||||
if (err) {
|
||||
// console.log(err);
|
||||
res.send({ "status": "error" });
|
||||
} else {
|
||||
res.send({ "status": "success" });
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -8,6 +8,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
6
ui2/package-lock.json
generated
6
ui2/package-lock.json
generated
@ -9,6 +9,7 @@
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"axios": "^1.7.2",
|
||||
"mitt": "^3.0.1",
|
||||
"vue": "^3.4.31"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -1081,6 +1082,11 @@
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/mitt": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz",
|
||||
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="
|
||||
},
|
||||
"node_modules/muggle-string": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/muggle-string/-/muggle-string-0.4.1.tgz",
|
||||
|
@ -10,6 +10,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.7.2",
|
||||
"mitt": "^3.0.1",
|
||||
"vue": "^3.4.31"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -1,6 +1,54 @@
|
||||
<script setup >
|
||||
import devinfoshow from './components/devinfoshow.vue'
|
||||
|
||||
<script>
|
||||
import devinfoMain from './components/devinfoMain.vue';
|
||||
import EventBus from "./eventBus.js";
|
||||
import SetUserinfo from "./components/modar/setUserinfo.vue";
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
|
||||
devinfoMain,
|
||||
SetUserinfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
componentsconfig: {
|
||||
Title: "Title",
|
||||
modalcomponent: null,
|
||||
data: null
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showModal(data) {
|
||||
this.visible = true;
|
||||
this.componentsconfig.Title = data.title;
|
||||
this.componentsconfig.data = data.data;
|
||||
this.componentsconfig.modalcomponent = SetUserinfo;
|
||||
this.$refs.componentconfig.onloaddata(data.data.devid);
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
closeModal() {
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk() {
|
||||
this.visible = false;
|
||||
},
|
||||
handleCancel() {
|
||||
this.visible = false;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
EventBus.on('showbox', this.showModal);
|
||||
EventBus.on('closebox', this.closeModal);
|
||||
// EventBus.emit('showbox',{title:"用户信息",data:{name:"admin"}});
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -8,6 +56,13 @@ import devinfoMain from './components/devinfoMain.vue';
|
||||
<!-- <devinfoshow name="devinfoshow" /> -->
|
||||
<devinfo-main></devinfo-main>
|
||||
|
||||
<a-modal v-model:visible="visible" @ok="handleOk" @cancel="handleCancel" draggable>
|
||||
<template #title>
|
||||
{{componentsconfig.Title}}
|
||||
</template>
|
||||
<component :is="componentsconfig.modalcomponent" :config="componentsconfig.data" ref="componentconfig" ></component>
|
||||
</a-modal>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
@ -9,7 +9,7 @@
|
||||
arrow-class="color:red !important;"
|
||||
>
|
||||
<a-carousel-item v-for="(item,index) in datalist" :key="index">
|
||||
<devinfoshow :devinfo="item"></devinfoshow>
|
||||
<devinofgrid :devinfo="item"></devinofgrid>
|
||||
</a-carousel-item>
|
||||
</a-carousel>
|
||||
|
||||
@ -17,12 +17,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import devinfoshow from './devinfoshow.vue'
|
||||
import devinofgrid from "./devinofgrid.vue";
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
name: 'DevinfoMain',
|
||||
components: {
|
||||
devinfoshow
|
||||
devinofgrid
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -56,6 +56,12 @@ export default {
|
||||
let lasttime=new Date(datestr);
|
||||
let nowtime=new Date();
|
||||
datalist[i].from_last_online_time=(nowtime-lasttime)/60000;
|
||||
let data=await axios.post('devinfo/getdevuserinfo',{devid:datalist[i].autoid});
|
||||
if (typeof data.data[0].simnumber!="undefined") {
|
||||
datalist[i].userinfo=data.data[0];
|
||||
}else{
|
||||
datalist[i].userinfo=null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
|
||||
import EventBus from '../eventBus.js';
|
||||
export default {
|
||||
name: 'devinfoshow',
|
||||
data() {
|
||||
@ -12,9 +12,9 @@ export default {
|
||||
props: {
|
||||
devinfo: {
|
||||
|
||||
type: Array,
|
||||
type: Object,
|
||||
required: true,
|
||||
default:()=>[{
|
||||
default:()=>{ return {
|
||||
name: "设备序列号",
|
||||
status: "在线",
|
||||
lasttime: "2021-10-10 10:10:10",
|
||||
@ -22,7 +22,8 @@ export default {
|
||||
sptotal:100,
|
||||
mountedon:"No SD card",
|
||||
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
// Your component's props go here
|
||||
},
|
||||
@ -34,6 +35,11 @@ export default {
|
||||
return "black"
|
||||
}
|
||||
},
|
||||
showsetuserinfo(){
|
||||
console.log("showsetuserinfo");
|
||||
|
||||
EventBus.emit('showbox',{title:"用户信息",data:{devid:this.devinfo.autoid}});
|
||||
},
|
||||
paduanshijian(dev){
|
||||
let datestr=dev.lasttime;
|
||||
//如果上次时间距离现在超过1天则显示红色
|
||||
@ -54,52 +60,55 @@ export default {
|
||||
</script>
|
||||
<template>
|
||||
|
||||
<a-card :bordered="false" :style="{ width: '100vw',margin:'auto' }" :hoverable="true">
|
||||
<a-card-grid
|
||||
v-for="(dev, index) in devinfo"
|
||||
:key="index"
|
||||
:hoverable="index % 2 === 0"
|
||||
|
||||
:style="{ width: '32%',height: '31vh',margin: '10px', background: paduanshijian(dev)==='red'?'#FFCCCC':'#CCFFCC'}"
|
||||
|
||||
>
|
||||
<a-card
|
||||
class="card-demo"
|
||||
:title="dev.name"
|
||||
:title="devinfo.name"
|
||||
:bordered="false"
|
||||
|
||||
|
||||
>
|
||||
<template #extra>
|
||||
<a-link :href="dev.remote_port" target="_blank">查看数据</a-link>
|
||||
<a-button type="primary" @click="showsetuserinfo">用户信息</a-button>
|
||||
<a-link :href="devinfo.remote_port" target="_blank">查看数据</a-link>
|
||||
</template>
|
||||
<p :style="{ margin: 0,color:dev.from_last_online_time>30?'red':'green'}">
|
||||
设备状态:{{ dev.from_last_online_time>30?'离线'+dev.from_last_online_time+'分钟':'在线' }}
|
||||
<p :style="{ margin: 0,color:devinfo.from_last_online_time>30?'red':'green'}">
|
||||
设备状态:{{ devinfo.from_last_online_time>120?'离线'+devinfo.from_last_online_time+'分钟':'在线' }}
|
||||
</p>
|
||||
<p :style="{ margin: 0 ,color:paduanshijian(dev)}">
|
||||
最新文件时间:{{ dev.lasttime }}
|
||||
<p :style="{ margin: 0 ,color:paduanshijian(devinfo)}">
|
||||
最新文件时间:{{ devinfo.lasttime }}
|
||||
</p>
|
||||
<div v-if="devinfo.userinfo!=null">
|
||||
|
||||
<p>用户名:{{ devinfo.userinfo.devusername }}</p>
|
||||
<p>sim卡号:{{ devinfo.userinfo.simnumber }}</p>
|
||||
<p>sim总流量:{{ devinfo.userinfo.simtotal }}</p>
|
||||
<p>sim已用流量:{{ devinfo.userinfo.simused }}</p>
|
||||
<p>备注信息:{{ devinfo.userinfo.beizhu }}</p>
|
||||
<p></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<template #actions>
|
||||
|
||||
</template>
|
||||
</a-card>
|
||||
<p style="bottom: 0px; position: absolute; width: 100%; border-top: 1px solid #e8e8e8;margin-bottom: 0px;min-height: 10% "
|
||||
:style="{background:panduansd(dev)==='red'?'#FFCCCC':'#CCFFCC'}">
|
||||
:style="{background:panduansd(devinfo)==='red'?'#FFCCCC':'#CCFFCC'}">
|
||||
|
||||
|
||||
<a-row class="grid-demo" :gutter="24" >
|
||||
<a-col :span="14">
|
||||
<div> SD: {{ dev.sptotal }}GB <a-progress :style="{ width: '60%' }" :percent="dev.sppercent/100" color="green" :status="dev.sppercent>90?'danger':'normal'"/></div>
|
||||
<div> SD: {{ devinfo.sptotal }}GB <a-progress :style="{ width: '60%' }" :percent="devinfo.sppercent/100" color="green" :status="devinfo.sppercent>90?'danger':'normal'"/></div>
|
||||
</a-col>
|
||||
<a-col :span="10">
|
||||
<div :style="{color:panduansd(dev)}">挂载路径:{{dev.mountedon }}</div>
|
||||
<div :style="{color:panduansd(devinfo)}">挂载路径:{{devinfo.mountedon }}</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
</p>
|
||||
</a-card-grid>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
|
||||
|
@ -1,11 +1,86 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import devinfoshow from "./devinfoshow.vue";
|
||||
export default {
|
||||
name: 'devinofgrid',
|
||||
components: {
|
||||
devinfoshow
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
props: {
|
||||
devinfo: {
|
||||
|
||||
type: Array,
|
||||
required: true,
|
||||
default:()=>[{
|
||||
name: "设备序列号",
|
||||
status: "在线",
|
||||
lasttime: "2021-10-10 10:10:10",
|
||||
sppercent:10,
|
||||
sptotal:100,
|
||||
mountedon:"No SD card",
|
||||
|
||||
}]
|
||||
}
|
||||
// Your component's props go here
|
||||
},
|
||||
methods: {
|
||||
panduansd(dev){
|
||||
if(dev.mountedon=="/"||dev.mountedon=="No SD card"){
|
||||
return "red"
|
||||
}else{
|
||||
return "black"
|
||||
}
|
||||
},
|
||||
paduanshijian(dev){
|
||||
let datestr=dev.lasttime;
|
||||
//如果上次时间距离现在超过1天则显示红色
|
||||
let lasttime=new Date(datestr);
|
||||
let nowtime=new Date();
|
||||
if((nowtime-lasttime)>1000*60*60*24){
|
||||
return "red"
|
||||
}else{
|
||||
return "black"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Your component's methods go here
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
$END$
|
||||
|
||||
<a-card :bordered="false" :style="{ width: '100vw',margin:'auto' }" :hoverable="true">
|
||||
<a-card-grid
|
||||
v-for="(dev, index) in devinfo"
|
||||
:key="index"
|
||||
:hoverable="index % 2 === 0"
|
||||
|
||||
:style="{ width: '32%',height: '31vh',margin: '10px', background: paduanshijian(dev)==='red'?'#FFCCCC':'#CCFFCC'}"
|
||||
|
||||
>
|
||||
<devinfoshow :devinfo="dev" ></devinfoshow>
|
||||
</a-card-grid>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
|
||||
<style scoped>
|
||||
/* Your component's CSS styles go here */
|
||||
h1 {
|
||||
color: blue;
|
||||
}
|
||||
.card-demo {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,9 +1,102 @@
|
||||
<script setup lang="ts">
|
||||
<script >
|
||||
import axios from "axios";
|
||||
import EventBus from "../../eventBus.js";
|
||||
export default {
|
||||
name: "SetUserinfo",
|
||||
props:{
|
||||
config:{
|
||||
type:Object,
|
||||
default(){
|
||||
return {
|
||||
devid:0,
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
data:{
|
||||
devname:"设备名称",
|
||||
devid:0,
|
||||
simnumber:"sim卡号",
|
||||
simused:0,
|
||||
devusername:"设备用户名",
|
||||
beizhu:"备注"
|
||||
}
|
||||
// Your component's data goes here
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.config);
|
||||
this.onloaddata(this.config.devid);
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
async subumit(){
|
||||
if (typeof this.data.devid == "undefined"
|
||||
|| typeof this.data.simnumber == "undefined"
|
||||
|| typeof this.data.devusername == "undefined"
|
||||
|| typeof this.data.devname == "undefined"
|
||||
) {
|
||||
alert("未定义");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
let data=await axios.post('devinfo/setdevuserinfo',this.data);
|
||||
let sat=data.data;
|
||||
if(sat.status=="success") {
|
||||
alert("设置成功");
|
||||
EventBus.emit('closebox');
|
||||
}
|
||||
|
||||
},
|
||||
async onloaddata(devid) {
|
||||
let data=await axios.post('devinfo/getdevuserinfo',{devid:devid});
|
||||
let datalist=data.data;
|
||||
this.data=datalist[0];
|
||||
console.log(datalist);
|
||||
}
|
||||
// Your component's methods go here
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<form>
|
||||
<a-row>
|
||||
<a-col span="8">设备名称:</a-col>
|
||||
<a-col span="16">{{data.devname}}</a-col>
|
||||
<input name="devname" v-model="data.devname" hidden="hidden">
|
||||
<input name="devid" v-model="data.devid" hidden="hidden">
|
||||
<input name="simused" v-model="data.simused" hidden="hidden">
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col span="8">sim卡号:</a-col>
|
||||
<a-col span="16">
|
||||
<input name="simnumber" type="number" v-model="data.simnumber" >
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col span="8">设备用户名:</a-col>
|
||||
<a-col span="16">
|
||||
<input name="devusername" v-model="data.devusername" >
|
||||
</a-col>
|
||||
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col span="8">备注:</a-col>
|
||||
<a-col span="16"> <textarea name="text" v-model="data.beizhu" /></a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-button type="primary" @click="subumit" >提交</a-button>
|
||||
</a-row>
|
||||
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
@ -0,0 +1,5 @@
|
||||
import mitt from 'mitt';
|
||||
|
||||
const EventBus = mitt();
|
||||
|
||||
export default EventBus;
|
||||
|
@ -6,10 +6,10 @@ import axios from 'axios'
|
||||
import ArcoVue from '@arco-design/web-vue';
|
||||
|
||||
import '@arco-design/web-vue/dist/arco.css';
|
||||
|
||||
import EventBus from "./eventBus.js";
|
||||
console.log(window.location.hostname);
|
||||
axios.defaults.baseURL = "http://"+window.location.hostname+":1000";
|
||||
|
||||
// axios.defaults.baseURL = "http://172.16.0.251:1000";
|
||||
const app=createApp(App);
|
||||
app.use(ArcoVue);
|
||||
app.mount('#app');
|
||||
|
@ -1,15 +0,0 @@
|
||||
import { createApp } from 'vue'
|
||||
import './style.css'
|
||||
import App from './App.vue'
|
||||
import axios from 'axios'
|
||||
|
||||
import ArcoVue from '@arco-design/web-vue';
|
||||
|
||||
import '@arco-design/web-vue/dist/arco.css';
|
||||
|
||||
console.log(window.location.hostname);
|
||||
axios.defaults.baseURL = "http://"+window.location.hostname+":1000";
|
||||
|
||||
const app=createApp(App);
|
||||
app.use(ArcoVue);
|
||||
app.mount('#app');
|
@ -23,5 +23,5 @@
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/main.js"]
|
||||
}
|
||||
|
@ -7,4 +7,5 @@ export default defineConfig({
|
||||
server:{
|
||||
host:'0.0.0.0'
|
||||
},
|
||||
base: './'
|
||||
})
|
||||
|
Reference in New Issue
Block a user