46 lines
983 B
Vue
46 lines
983 B
Vue
|
<script lang="ts">
|
||
|
import db from './service/db';
|
||
|
export default {
|
||
|
onLaunch() {
|
||
|
console.log('App Launch');
|
||
|
db.open().then(() => {
|
||
|
db.createTable(
|
||
|
`records (
|
||
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||
|
temperature REAL,
|
||
|
velocity REAL,
|
||
|
acceleration REAL,
|
||
|
displacement REAL,
|
||
|
create_time TEXT,
|
||
|
operate_time TEXT,
|
||
|
check_point TEXT,
|
||
|
device_name TEXT,
|
||
|
wave TEXT
|
||
|
)`
|
||
|
).then((info) => {
|
||
|
console.log(`records 表已创建:${JSON.stringify(info)}`);
|
||
|
},
|
||
|
(e) => {
|
||
|
console.error(`records 创建失败:${JSON.stringify(e)}`);
|
||
|
}
|
||
|
);
|
||
|
});
|
||
|
},
|
||
|
onShow() {
|
||
|
console.log('App Show')
|
||
|
},
|
||
|
onHide() {
|
||
|
console.log('App Hide')
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style lang='scss'>
|
||
|
@import '@/uni_modules/uni-scss/index.scss';
|
||
|
</style>
|
||
|
|
||
|
<style>
|
||
|
@import "@/static/iconfont.css";
|
||
|
/*每个页面公共css */
|
||
|
</style>
|