@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Eslint config file
|
||||||
|
* Documentation: https://eslint.org/docs/user-guide/configuring/
|
||||||
|
* Install the Eslint extension before using this feature.
|
||||||
|
*/
|
||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
es6: true,
|
||||||
|
browser: true,
|
||||||
|
node: true,
|
||||||
|
},
|
||||||
|
ecmaFeatures: {
|
||||||
|
modules: true,
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 2018,
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
globals: {
|
||||||
|
wx: true,
|
||||||
|
App: true,
|
||||||
|
Page: true,
|
||||||
|
getCurrentPages: true,
|
||||||
|
getApp: true,
|
||||||
|
Component: true,
|
||||||
|
requirePlugin: true,
|
||||||
|
requireMiniProgram: true,
|
||||||
|
},
|
||||||
|
// extends: 'eslint:recommended',
|
||||||
|
rules: {},
|
||||||
|
}
|
@ -1,33 +0,0 @@
|
|||||||
HELP.md
|
|
||||||
target/
|
|
||||||
!.mvn/wrapper/maven-wrapper.jar
|
|
||||||
!**/src/main/**/target/
|
|
||||||
!**/src/test/**/target/
|
|
||||||
|
|
||||||
### STS ###
|
|
||||||
.apt_generated
|
|
||||||
.classpath
|
|
||||||
.factorypath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.springBeans
|
|
||||||
.sts4-cache
|
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
|
||||||
.idea
|
|
||||||
*.iws
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
|
|
||||||
### NetBeans ###
|
|
||||||
/nbproject/private/
|
|
||||||
/nbbuild/
|
|
||||||
/dist/
|
|
||||||
/nbdist/
|
|
||||||
/.nb-gradle/
|
|
||||||
build/
|
|
||||||
!**/src/main/**/build/
|
|
||||||
!**/src/test/**/build/
|
|
||||||
|
|
||||||
### VS Code ###
|
|
||||||
.vscode/
|
|
@ -0,0 +1,509 @@
|
|||||||
|
// pages/Airtraffic/Airtraffic.js
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
name:'Airtraffic',
|
||||||
|
selectedTime: '--时--分',
|
||||||
|
selectedDate: '--年--月--日',
|
||||||
|
selectedIndex1: 0,
|
||||||
|
selectedIndex2: 0,
|
||||||
|
selectedIndex4: 0,
|
||||||
|
selectedIndex5: 0,
|
||||||
|
selectedIndex7: 0,
|
||||||
|
selectedIndex8: 0,
|
||||||
|
selectedIndex9: 0,
|
||||||
|
selectedIndex10: 0,
|
||||||
|
selectedIndex11: 0,
|
||||||
|
selectedIndex12: 0,
|
||||||
|
selectedIndex13: 0,
|
||||||
|
selectedIndex14: 0,
|
||||||
|
selectedIndex15: 0,
|
||||||
|
selectedIndex16: 0,
|
||||||
|
selectedIndex100: 0,
|
||||||
|
selectedIndex101: 0,
|
||||||
|
selectedIndex102: 0,
|
||||||
|
selectedIndex103: 0,
|
||||||
|
selectedIndex104: 0,
|
||||||
|
selectedIndex105: 0,
|
||||||
|
selectedIndex106: 0,
|
||||||
|
selectedIndex107: 0,
|
||||||
|
inputValue1: '',
|
||||||
|
inputValue2: '',
|
||||||
|
inputValue3: '',
|
||||||
|
inputValue6: '',
|
||||||
|
inputValue7: '',
|
||||||
|
inputValue8: '',
|
||||||
|
inputValue15: '',
|
||||||
|
inputValue16: '',
|
||||||
|
inputValue20: '',
|
||||||
|
inputValue21: '',
|
||||||
|
inputValue22: '',
|
||||||
|
inputValue23: '',
|
||||||
|
inputValue100: '',
|
||||||
|
inputValue101: '',
|
||||||
|
inputValue102: '',
|
||||||
|
timezones: ['请选择','UTC-12:00', 'UTC-11:00', 'UTC-10:00', 'UTC-9:00', 'UTC-8:00', 'UTC-7:00', 'UTC-6:00', 'UTC-5:00', 'UTC-4:00', 'UTC-3:00', 'UTC-2:00', 'UTC-1:00', 'UTC+0:00', 'UTC+1:00', 'UTC+2:00', 'UTC+3:00', 'UTC+4:00', 'UTC+5:00', 'UTC+6:00', 'UTC+7:00', 'UTC+8:00', 'UTC+9:00', 'UTC+10:00', 'UTC+11:00', 'UTC+12:00'],
|
||||||
|
workposition:['请选择','区域','进近','塔台','管掉','总调','报告室','其他'],
|
||||||
|
License:['请选择','私用驾驶员执照','商用驾驶员执照','航线运输驾驶员执照','临时执照','无','其它'],
|
||||||
|
ACFT:['请选择','飞机','直升机','滑翔机','其它'],
|
||||||
|
controlledairspace:['请选择','A类空域','B类空域','C类空域','D类空域'],
|
||||||
|
task:['请选择','客运','货运','训练','检查','调机','通用飞行','其它'],
|
||||||
|
plan:['请选择','目视飞行计划','仪表飞行计划','其它'],
|
||||||
|
phase:['请选择','地面/滑行','起飞','爬升','巡航/作业','下降','进近','复飞','着陆','其它'],
|
||||||
|
weather:['请选择','IMC','VMC','雷暴','风切变','紊流','结冰','雨','雪','雾','多云','其它'],
|
||||||
|
lv:['请选择','黎明','昼间','黄昏/曙暮光','夜间/月光','夜间/黑暗','未知'],
|
||||||
|
ATS:['请选择','塔台管制席','地面管制席','主任管制席','助理管制席','程序管制席','雷达管制席','通报协调席','放行许可席','其它'],
|
||||||
|
ATC:['请选择','雷达管制','程序管制','雷达监视下的程序管制','其它'],
|
||||||
|
TCAS:['请选择','是','否'],
|
||||||
|
Advise:['请选择','是','否'],
|
||||||
|
},
|
||||||
|
//时间选择
|
||||||
|
onTimeChange: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedTime: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onTimezoneChange: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex1: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onDateChange: function(e) {
|
||||||
|
this.setData({
|
||||||
|
selectedDate: e.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//工作时间选择
|
||||||
|
onInput1: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue1: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput2: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue2: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput3: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue3: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//岗位选择
|
||||||
|
onworkposition: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex2: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//工作经历
|
||||||
|
onInput15: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue15: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput16: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue16: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//执照选择
|
||||||
|
onLicense: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex4: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//管制席位
|
||||||
|
onATS: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex12: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//管制类型
|
||||||
|
onATC: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex13: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//管制空域
|
||||||
|
onControlledairspace: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex16: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//航空器一
|
||||||
|
//航空器种类
|
||||||
|
onACFT: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex5: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//任务
|
||||||
|
ontask: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex7: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//计划
|
||||||
|
onplan: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex8: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行阶段
|
||||||
|
onphase: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex9: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行高度
|
||||||
|
onInput6: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue6: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//天气
|
||||||
|
onweather: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex10: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//光线条件和能见度
|
||||||
|
onlv: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex11: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput7: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue7: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput8: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue8: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//TCAS
|
||||||
|
onTCAS: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex14: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//Advise
|
||||||
|
onAdvise: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex15: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//航空器二
|
||||||
|
//航空器种类
|
||||||
|
onACFT0: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex100: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//任务
|
||||||
|
ontask0: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex101: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//计划
|
||||||
|
onplan0: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex102: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行阶段
|
||||||
|
onphase0: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex103: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行高度
|
||||||
|
onInput100: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue100: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//天气
|
||||||
|
onweather0: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex104: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//光线条件和能见度
|
||||||
|
onlv0: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex105: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput101: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue101: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput102: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue102: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//TCAS
|
||||||
|
onTCAS0: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex106: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//Advise
|
||||||
|
onAdvise0: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex107: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//个人信息//姓名电话邮箱
|
||||||
|
onInput21: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue21: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput22: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue22: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput23: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue23: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//事件经过
|
||||||
|
onInput20: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue20: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//提交与重写
|
||||||
|
onReset() {
|
||||||
|
this.setData({
|
||||||
|
selectedTime: '--时--分',
|
||||||
|
selectedDate: '--年--月--日',
|
||||||
|
selectedIndex1: 0,
|
||||||
|
selectedIndex2: 0,
|
||||||
|
selectedIndex4: 0,
|
||||||
|
selectedIndex5: 0,
|
||||||
|
selectedIndex7: 0,
|
||||||
|
selectedIndex8: 0,
|
||||||
|
selectedIndex9: 0,
|
||||||
|
selectedIndex10: 0,
|
||||||
|
selectedIndex11: 0,
|
||||||
|
selectedIndex12: 0,
|
||||||
|
selectedIndex13: 0,
|
||||||
|
selectedIndex14: 0,
|
||||||
|
selectedIndex15: 0,
|
||||||
|
selectedIndex16: 0,
|
||||||
|
selectedIndex100: 0,
|
||||||
|
selectedIndex101: 0,
|
||||||
|
selectedIndex102: 0,
|
||||||
|
selectedIndex103: 0,
|
||||||
|
selectedIndex104: 0,
|
||||||
|
selectedIndex105: 0,
|
||||||
|
selectedIndex106: 0,
|
||||||
|
selectedIndex107: 0,
|
||||||
|
inputValue1: '',
|
||||||
|
inputValue2: '',
|
||||||
|
inputValue3: '',
|
||||||
|
inputValue6: '',
|
||||||
|
inputValue7: '',
|
||||||
|
inputValue8: '',
|
||||||
|
inputValue15: '',
|
||||||
|
inputValue16: '',
|
||||||
|
inputValue20: '',
|
||||||
|
inputValue21: '',
|
||||||
|
inputValue22: '',
|
||||||
|
inputValue23: '',
|
||||||
|
inputValue100: '',
|
||||||
|
inputValue101: '',
|
||||||
|
inputValue102: '',
|
||||||
|
},() => {
|
||||||
|
console.log('Form has been reset');
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提交数据
|
||||||
|
onSubmit: function () {
|
||||||
|
// 获取存储中的 token
|
||||||
|
const token = wx.getStorageSync('token');
|
||||||
|
|
||||||
|
if (!token) {
|
||||||
|
console.log('Token 不存在,请先登录');
|
||||||
|
wx.showToast({
|
||||||
|
title: '请先登录',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return; // 终止提交
|
||||||
|
}
|
||||||
|
const data = this.data;
|
||||||
|
|
||||||
|
// 获取各选择项的实际文本值
|
||||||
|
const timezoneText = data.timezones[data.selectedIndex1]; // 获取时区的实际文本
|
||||||
|
const workPositionText = data.workposition[data.selectedIndex2]; // 获取岗位的实际文本
|
||||||
|
const licenseText = data.License[data.selectedIndex4]; // 获取执照类型的实际文本
|
||||||
|
const acftText = data.ACFT[data.selectedIndex5]; // 获取航空器类型的实际文本
|
||||||
|
const taskText = data.task[data.selectedIndex7]; // 获取任务的实际文本
|
||||||
|
const planText = data.plan[data.selectedIndex8]; // 获取计划的实际文本
|
||||||
|
const phaseText = data.phase[data.selectedIndex9]; // 获取飞行阶段的实际文本
|
||||||
|
const weatherText = data.weather[data.selectedIndex10]; // 获取天气的实际文本
|
||||||
|
const lightText = data.lv[data.selectedIndex11]; // 获取光线条件的实际文本
|
||||||
|
const atsText = data.ATS[data.selectedIndex12]; // 获取管制席位的实际文本
|
||||||
|
const atcText = data.ATC[data.selectedIndex13]; // 获取管制类型的实际文本
|
||||||
|
const tcasText = data.TCAS[data.selectedIndex14]; // 获取TCAS的实际文本
|
||||||
|
const adviseText = data.Advise[data.selectedIndex15]; // 获取建议的实际文本
|
||||||
|
const acft0Text = data.ACFT[data.selectedIndex100]; // 获取航空器二的类型
|
||||||
|
const task0Text = data.task[data.selectedIndex101]; // 获取航空器二的任务
|
||||||
|
const plan0Text = data.plan[data.selectedIndex102]; // 获取航空器二的计划
|
||||||
|
const phase0Text = data.phase[data.selectedIndex103]; // 获取航空器二的阶段
|
||||||
|
const weather0Text = data.weather[data.selectedIndex104]; // 获取航空器二的天气
|
||||||
|
const light0Text = data.lv[data.selectedIndex105]; // 获取航空器二的光线条件
|
||||||
|
const tcas0Text = data.TCAS[data.selectedIndex106]; // 获取航空器二的TCAS
|
||||||
|
const advise0Text = data.Advise[data.selectedIndex107]; // 获取航空器二的建议
|
||||||
|
|
||||||
|
// 提交数据到后端
|
||||||
|
wx.request({
|
||||||
|
url: 'http://192.168.137.1:8080/report/add',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'Authorization': `${token}`,
|
||||||
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
selectedTime: data.selectedTime,
|
||||||
|
selectedDate: data.selectedDate,
|
||||||
|
timezone: timezoneText, // 提交时区的实际文本
|
||||||
|
workPosition: workPositionText,// 提交岗位的实际文本
|
||||||
|
license: licenseText, // 提交执照类型的实际文本
|
||||||
|
acftType: acftText, // 提交航空器类型的实际文本
|
||||||
|
task: taskText, // 提交任务的实际文本
|
||||||
|
plan: planText, // 提交计划的实际文本
|
||||||
|
phase: phaseText, // 提交飞行阶段的实际文本
|
||||||
|
weather: weatherText, // 提交天气的实际文本
|
||||||
|
lightCondition: lightText, // 提交光线条件的实际文本
|
||||||
|
ats: atsText, // 提交管制席位的实际文本
|
||||||
|
atc: atcText, // 提交管制类型的实际文本
|
||||||
|
tcas: tcasText, // 提交TCAS的实际文本
|
||||||
|
advise: adviseText, // 提交建议的实际文本
|
||||||
|
|
||||||
|
acft0Type: acft0Text, // 提交航空器类型的实际文本
|
||||||
|
task0: task0Text, // 提交任务的实际文本
|
||||||
|
plan0: plan0Text, // 提交计划的实际文本
|
||||||
|
phase0: phase0Text, // 提交飞行阶段的实际文本
|
||||||
|
weather0: weather0Text, // 提交天气的实际文本
|
||||||
|
lightCondition0: light0Text, // 提交光线条件的实际文本
|
||||||
|
ats0: ats0Text, // 提交管制席位的实际文本
|
||||||
|
atc0: atcT0ext, // 提交管制类型的实际文本
|
||||||
|
tcas0: tcas0Text, // 提交TCAS的实际文本
|
||||||
|
advise0: advise0Text, // 提交建议的实际文本
|
||||||
|
inputValue1: data.inputValue1,
|
||||||
|
inputValue2: data.inputValue2,
|
||||||
|
inputValue3: data.inputValue3,
|
||||||
|
inputValue6: data.inputValue6,
|
||||||
|
inputValue7: data.inputValue7,
|
||||||
|
inputValue8: data.inputValue8,
|
||||||
|
inputValue15: data.inputValue15,
|
||||||
|
inputValue16: data.inputValue16,
|
||||||
|
inputValue20: data.inputValue20,
|
||||||
|
inputValue21: data.inputValue21,
|
||||||
|
inputValue22: data.inputValue22,
|
||||||
|
inputValue23: data.inputValue23,
|
||||||
|
inputValue100: data.inputValue100,
|
||||||
|
inputValue101: data.inputValue101,
|
||||||
|
inputValue102: data.inputValue102,
|
||||||
|
name: data.name
|
||||||
|
},
|
||||||
|
success: function(res) {
|
||||||
|
console.log('Data submitted successfully:', res);
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.error('Error submitting data:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 使用腾讯混元智能体的 API 调用
|
||||||
|
wx.request({
|
||||||
|
url: 'https://yuanqi.tencent.com/openapi/v1/agent/chat/completions',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'X-Source': 'openapi',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'Bearer jSNTZONSnnzJ2uuQT7IEgXlPzfE4lX5f' // 替换为你的实际 Bearer Token
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
assistant_id: 'ty1W9unZM9IY', // 替换为实际的 assistant_id
|
||||||
|
user_id: '123456', // 替换为实际的用户ID
|
||||||
|
stream: false,
|
||||||
|
messages: [
|
||||||
|
{
|
||||||
|
role: 'user',
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
type: 'text',
|
||||||
|
text: JSON.stringify(data) // 将用户填写的数据转换为字符串
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
console.log('API 调用成功: ', res); // 打印完整的 API 响应
|
||||||
|
console.log('API 返回的 choices:', res.data.choices); // 检查数据结构
|
||||||
|
|
||||||
|
// 检查选择项并从中提取智能体回复
|
||||||
|
if (res.data && res.data.choices && res.data.choices.length > 0) {
|
||||||
|
// 确保 message 字段的内容可以被访问
|
||||||
|
const messageContent = res.data.choices[0].message?.content;
|
||||||
|
let agentReply;
|
||||||
|
|
||||||
|
// 如果 messageContent 存在并且是一个数组,则提取内容
|
||||||
|
if (Array.isArray(messageContent) && messageContent.length > 0) {
|
||||||
|
agentReply = messageContent[0].text; // 假设内容在数组的第一个元素中
|
||||||
|
} else {
|
||||||
|
agentReply = messageContent || '无法获取智能体的回复';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转到详情页面并传递数据和智能体的回复
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/FlightCrewDetails/FlightCrewDetails',
|
||||||
|
success: function (navRes) {
|
||||||
|
navRes.eventChannel.emit('sendData', {
|
||||||
|
details: data, // 用户输入的数据
|
||||||
|
agentReply: agentReply // 智能体的回复
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('API 响应中没有 choices');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.log('智能体调用失败', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onShareAppMessage() {
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,138 @@
|
|||||||
|
/* pages/Airtraffic/Airtraffic.wxss */
|
||||||
|
.container {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
border-bottom:0px ;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.one{
|
||||||
|
margin-top:0px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 21px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.two {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 18px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
.three{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.four{
|
||||||
|
align-items: center;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.five1{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
display: block;
|
||||||
|
font-size: 15px;
|
||||||
|
margin-right: 0px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
.five{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
margin-right: 120px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
font-size: 15px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.container1{
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.choose1{
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
.choose{
|
||||||
|
position: absolute;
|
||||||
|
right:0;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.picker {
|
||||||
|
text-align: center;
|
||||||
|
width: 100px;
|
||||||
|
height: auto;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 3px;
|
||||||
|
margin: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.input-box {
|
||||||
|
width: 25%;
|
||||||
|
padding: 0px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
margin: 3px;
|
||||||
|
}
|
||||||
|
.input-box2 {
|
||||||
|
width: 250px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.container3 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 98%;
|
||||||
|
margin: 2px;
|
||||||
|
padding: 3px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
.scroll-input {
|
||||||
|
width: 100%;
|
||||||
|
height: 150px;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid black;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
resize: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.container4 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.container5{
|
||||||
|
border: white;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom:10px;
|
||||||
|
}
|
||||||
|
.input-box1 {
|
||||||
|
width: 109px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.input-box3 {
|
||||||
|
width: 68px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,325 @@
|
|||||||
|
// pages/Aviation/Aviation.js
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
name:'Aviation',
|
||||||
|
selectedTime: '--时--分',
|
||||||
|
selectedDate: '--年--月--日',
|
||||||
|
selectedIndex1: 0,
|
||||||
|
selectedIndex2: 0,
|
||||||
|
selectedIndex4: 0,
|
||||||
|
selectedIndex9: 0,
|
||||||
|
selectedIndex22: 0,
|
||||||
|
inputValue1: '',
|
||||||
|
inputValue2: '',
|
||||||
|
inputValue3: '',
|
||||||
|
inputValue9: '',
|
||||||
|
inputValue10: '',
|
||||||
|
inputValue11: '',
|
||||||
|
inputValue12: '',
|
||||||
|
inputValue13: '',
|
||||||
|
inputValue14: '',
|
||||||
|
inputValue15: '',
|
||||||
|
inputValue16: '',
|
||||||
|
inputValue20: '',
|
||||||
|
inputValue21: '',
|
||||||
|
inputValue22: '',
|
||||||
|
inputValue23: '',
|
||||||
|
timezones: ['请选择','UTC-12:00', 'UTC-11:00', 'UTC-10:00', 'UTC-9:00', 'UTC-8:00', 'UTC-7:00', 'UTC-6:00', 'UTC-5:00', 'UTC-4:00', 'UTC-3:00', 'UTC-2:00', 'UTC-1:00', 'UTC+0:00', 'UTC+1:00', 'UTC+2:00', 'UTC+3:00', 'UTC+4:00', 'UTC+5:00', 'UTC+6:00', 'UTC+7:00', 'UTC+8:00', 'UTC+9:00', 'UTC+10:00', 'UTC+11:00', 'UTC+12:00'],
|
||||||
|
position:['请选择','安检员','乘务员','飞行员','机务人员','保安员','管制员','机场地面服务人员','其他'],
|
||||||
|
phase:['请选择','值机','安检','候机','登机','滑行','停靠','起飞','航路','着陆','其它'],
|
||||||
|
License:['请选择','私用驾驶员执照','商用驾驶员执照','航线运输驾驶员执照','临时执照','无','其它'],
|
||||||
|
involve:['请选择','是','否']
|
||||||
|
},
|
||||||
|
//时间选择
|
||||||
|
onTimeChange: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedTime: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onTimezoneChange: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex1: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onDateChange: function(e) {
|
||||||
|
this.setData({
|
||||||
|
selectedDate: e.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//工作时间选择
|
||||||
|
onInput1: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue1: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput2: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue2: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput3: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue3: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//岗位选择
|
||||||
|
onposition: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex2: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//执照选择
|
||||||
|
onLicense: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex4: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//工作经验
|
||||||
|
onInput15: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue15: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput16: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue16: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行区间
|
||||||
|
onInput9: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue9: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput10: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue10: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//人员情况
|
||||||
|
onInput11: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue11: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput12: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue12: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput13: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue13: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput14: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue14: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行阶段
|
||||||
|
onphase: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex9: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//是否设计航空器
|
||||||
|
oninvolve: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex22: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//事件经过
|
||||||
|
onInput20: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue20: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//个人信息//姓名电话邮箱
|
||||||
|
onInput21: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue21: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput22: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue22: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput23: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue23: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//提交与重写
|
||||||
|
onReset() {
|
||||||
|
this.setData({
|
||||||
|
selectedTime: '--时--分',
|
||||||
|
selectedDate: '--年--月--日',
|
||||||
|
selectedIndex1: 0,
|
||||||
|
selectedIndex2: 0,
|
||||||
|
selectedIndex4: 0,
|
||||||
|
selectedIndex9: 0,
|
||||||
|
selectedIndex22: 0,
|
||||||
|
inputValue1: '',
|
||||||
|
inputValue2: '',
|
||||||
|
inputValue3: '',
|
||||||
|
inputValue9: '',
|
||||||
|
inputValue10: '',
|
||||||
|
inputValue11: '',
|
||||||
|
inputValue12: '',
|
||||||
|
inputValue13: '',
|
||||||
|
inputValue14: '',
|
||||||
|
inputValue15: '',
|
||||||
|
inputValue16: '',
|
||||||
|
inputValue20: '',
|
||||||
|
inputValue21: '',
|
||||||
|
inputValue22: '',
|
||||||
|
inputValue23: '',
|
||||||
|
},() => {
|
||||||
|
console.log('Form has been reset');
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提交数据
|
||||||
|
onSubmit: function () {
|
||||||
|
// 获取存储中的 token
|
||||||
|
const token = wx.getStorageSync('token');
|
||||||
|
|
||||||
|
if (!token) {
|
||||||
|
console.log('Token 不存在,请先登录');
|
||||||
|
wx.showToast({
|
||||||
|
title: '请先登录',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return; // 终止提交
|
||||||
|
}
|
||||||
|
const data = this.data;
|
||||||
|
|
||||||
|
// 获取各选择项的实际文本值
|
||||||
|
const timezoneText = data.timezones[data.selectedIndex1]; // 获取时区的实际文本
|
||||||
|
const workPositionText = data.position[data.selectedIndex2]; // 获取岗位的实际文本
|
||||||
|
const licenseText = data.License[data.selectedIndex4]; // 获取执照类型的实际文本
|
||||||
|
const phaseText = data.phase[data.selectedIndex9]; // 获取飞行阶段的实际文本
|
||||||
|
const involveText = data.involve[data.selectedIndex22]; // 获取是否设计航空器的实际文本
|
||||||
|
|
||||||
|
// 提交数据到后端
|
||||||
|
wx.request({
|
||||||
|
url: 'http://192.168.137.1:8080/report/add',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'Authorization': `${token}`,
|
||||||
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
selectedTime: data.selectedTime,
|
||||||
|
selectedDate: data.selectedDate,
|
||||||
|
timezone: timezoneText, // 提交时区的实际文本
|
||||||
|
workPosition: workPositionText, // 提交岗位的实际文本
|
||||||
|
license: licenseText, // 提交执照类型的实际文本
|
||||||
|
phase: phaseText, // 提交飞行阶段的实际文本
|
||||||
|
involve: involveText, // 提交是否设计航空器的实际文本
|
||||||
|
inputValue1: data.inputValue1,
|
||||||
|
inputValue2: data.inputValue2,
|
||||||
|
inputValue3: data.inputValue3,
|
||||||
|
inputValue9: data.inputValue9,
|
||||||
|
inputValue10: data.inputValue10,
|
||||||
|
inputValue11: data.inputValue11,
|
||||||
|
inputValue12: data.inputValue12,
|
||||||
|
inputValue13: data.inputValue13,
|
||||||
|
inputValue14: data.inputValue14,
|
||||||
|
inputValue15: data.inputValue15,
|
||||||
|
inputValue16: data.inputValue16,
|
||||||
|
inputValue20: data.inputValue20,
|
||||||
|
inputValue21: data.inputValue21,
|
||||||
|
inputValue22: data.inputValue22,
|
||||||
|
inputValue23: data.inputValue23,
|
||||||
|
name: data.name,
|
||||||
|
},
|
||||||
|
success: function(res) {
|
||||||
|
console.log('Data submitted successfully:', res);
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.error('Error submitting data:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 使用腾讯混元智能体的 API 调用
|
||||||
|
wx.request({
|
||||||
|
url: 'https://yuanqi.tencent.com/openapi/v1/agent/chat/completions',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'X-Source': 'openapi',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'Bearer jSNTZONSnnzJ2uuQT7IEgXlPzfE4lX5f' // 替换为你的实际 Bearer Token
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
assistant_id: 'ty1W9unZM9IY', // 替换为实际的 assistant_id
|
||||||
|
user_id: '123456', // 替换为实际的用户ID
|
||||||
|
stream: false,
|
||||||
|
messages: [
|
||||||
|
{
|
||||||
|
role: 'user',
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
type: 'text',
|
||||||
|
text: JSON.stringify(data) // 将用户填写的数据转换为字符串
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
console.log('API 调用成功: ', res); // 打印完整的 API 响应
|
||||||
|
console.log('API 返回的 choices:', res.data.choices); // 检查数据结构
|
||||||
|
|
||||||
|
// 检查选择项并从中提取智能体回复
|
||||||
|
if (res.data && res.data.choices && res.data.choices.length > 0) {
|
||||||
|
// 确保 message 字段的内容可以被访问
|
||||||
|
const messageContent = res.data.choices[0].message?.content;
|
||||||
|
let agentReply;
|
||||||
|
|
||||||
|
// 如果 messageContent 存在并且是一个数组,则提取内容
|
||||||
|
if (Array.isArray(messageContent) && messageContent.length > 0) {
|
||||||
|
agentReply = messageContent[0].text; // 假设内容在数组的第一个元素中
|
||||||
|
} else {
|
||||||
|
agentReply = messageContent || '无法获取智能体的回复';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转到详情页面并传递数据和智能体的回复
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/FlightCrewDetails/FlightCrewDetails',
|
||||||
|
success: function (navRes) {
|
||||||
|
navRes.eventChannel.emit('sendData', {
|
||||||
|
details: data, // 用户输入的数据
|
||||||
|
agentReply: agentReply // 智能体的回复
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('API 响应中没有 choices');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.log('智能体调用失败', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onShareAppMessage() {
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,139 @@
|
|||||||
|
/* pages/Aviation/Aviation.wxss */
|
||||||
|
/* pages/Airtraffic/Airtraffic.wxss */
|
||||||
|
.container {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
border-bottom:0px ;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.one{
|
||||||
|
margin-top:0px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 21px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.two {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 18px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
.three{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.four{
|
||||||
|
align-items: center;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.five1{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
display: block;
|
||||||
|
font-size: 15px;
|
||||||
|
margin-right: 0px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
.five{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
margin-right: 120px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
font-size: 15px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.container1{
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.choose1{
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
.choose{
|
||||||
|
position: absolute;
|
||||||
|
right:0;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.picker {
|
||||||
|
text-align: center;
|
||||||
|
width: 100px;
|
||||||
|
height: auto;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 3px;
|
||||||
|
margin: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.input-box {
|
||||||
|
width: 25%;
|
||||||
|
padding: 0px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
margin: 3px;
|
||||||
|
}
|
||||||
|
.input-box2 {
|
||||||
|
width: 250px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.container3 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 98%;
|
||||||
|
margin: 2px;
|
||||||
|
padding: 3px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
.scroll-input {
|
||||||
|
width: 100%;
|
||||||
|
height: 150px;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid black;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
resize: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.container4 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.container5{
|
||||||
|
border: white;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom:10px;
|
||||||
|
}
|
||||||
|
.input-box1 {
|
||||||
|
width: 100px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.input-box3 {
|
||||||
|
width: 68px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,313 @@
|
|||||||
|
// pages/Crew/Crew.js
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
name:'Crew',
|
||||||
|
selectedTime: '--时--分',
|
||||||
|
selectedDate: '--年--月--日',
|
||||||
|
selectedIndex1: 0,
|
||||||
|
selectedIndex2: 0,
|
||||||
|
selectedIndex5: 0,
|
||||||
|
selectedIndex9: 0,
|
||||||
|
inputValue1: '',
|
||||||
|
inputValue2: '',
|
||||||
|
inputValue3: '',
|
||||||
|
inputValue4: '',
|
||||||
|
inputValue5: '',
|
||||||
|
inputValue9: '',
|
||||||
|
inputValue10: '',
|
||||||
|
inputValue11: '',
|
||||||
|
inputValue12: '',
|
||||||
|
inputValue13: '',
|
||||||
|
inputValue14: '',
|
||||||
|
inputValue20: '',
|
||||||
|
inputValue21: '',
|
||||||
|
inputValue22: '',
|
||||||
|
inputValue23: '',
|
||||||
|
timezones: ['请选择','UTC-12:00', 'UTC-11:00', 'UTC-10:00', 'UTC-9:00', 'UTC-8:00', 'UTC-7:00', 'UTC-6:00', 'UTC-5:00', 'UTC-4:00', 'UTC-3:00', 'UTC-2:00', 'UTC-1:00', 'UTC+0:00', 'UTC+1:00', 'UTC+2:00', 'UTC+3:00', 'UTC+4:00', 'UTC+5:00', 'UTC+6:00', 'UTC+7:00', 'UTC+8:00', 'UTC+9:00', 'UTC+10:00', 'UTC+11:00', 'UTC+12:00'],
|
||||||
|
position:['请选择','乘务员','主任乘务长','乘务教员','乘务检查员','保安员','其他'],
|
||||||
|
ACFT:['请选择','飞机','直升机','滑翔机','其它'],
|
||||||
|
phase:['请选择','地面/滑行','起飞','爬升','巡航/作业','下降','进近','复飞','着陆','其它'],
|
||||||
|
},
|
||||||
|
//时间选择
|
||||||
|
onTimeChange: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedTime: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onTimezoneChange: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex1: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onDateChange: function(e) {
|
||||||
|
this.setData({
|
||||||
|
selectedDate: e.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//工作时间选择
|
||||||
|
onInput1: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue1: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput2: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue2: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput3: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue3: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//岗位选择
|
||||||
|
onposition: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex2: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行经历
|
||||||
|
onInput4: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue4: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput5: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue5: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行区间
|
||||||
|
onInput9: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue9: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput10: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue10: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//航空器种类
|
||||||
|
onACFT: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex5: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//人员情况
|
||||||
|
onInput11: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue11: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput12: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue12: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput13: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue13: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput14: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue14: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行阶段
|
||||||
|
onphase: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex9: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//事件经过
|
||||||
|
onInput20: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue20: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//个人信息//姓名电话邮箱
|
||||||
|
onInput21: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue21: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput22: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue22: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput23: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue23: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//提交与重写
|
||||||
|
onReset() {
|
||||||
|
this.setData({
|
||||||
|
selectedTime: '--时--分',
|
||||||
|
selectedDate: '--年--月--日',
|
||||||
|
selectedIndex1: 0,
|
||||||
|
selectedIndex2: 0,
|
||||||
|
selectedIndex5: 0,
|
||||||
|
selectedIndex9: 0,
|
||||||
|
inputValue1: '',
|
||||||
|
inputValue2: '',
|
||||||
|
inputValue3: '',
|
||||||
|
inputValue4: '',
|
||||||
|
inputValue5: '',
|
||||||
|
inputValue9: '',
|
||||||
|
inputValue10: '',
|
||||||
|
inputValue11: '',
|
||||||
|
inputValue12: '',
|
||||||
|
inputValue13: '',
|
||||||
|
inputValue14: '',
|
||||||
|
inputValue20: '',
|
||||||
|
inputValue21: '',
|
||||||
|
inputValue22: '',
|
||||||
|
inputValue23: '',
|
||||||
|
},() => {
|
||||||
|
console.log('Form has been reset');
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提交数据
|
||||||
|
onSubmit: function () {
|
||||||
|
// 获取存储中的 token
|
||||||
|
const token = wx.getStorageSync('token');
|
||||||
|
|
||||||
|
if (!token) {
|
||||||
|
console.log('Token 不存在,请先登录');
|
||||||
|
wx.showToast({
|
||||||
|
title: '请先登录',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return; // 终止提交
|
||||||
|
}
|
||||||
|
const data = this.data;
|
||||||
|
// 获取各选择项的实际文本值
|
||||||
|
const timezoneText = data.timezones[data.selectedIndex1]; // 获取时区的实际文本
|
||||||
|
const workPositionText = data.position[data.selectedIndex2]; // 获取岗位的实际文本
|
||||||
|
const acftText = data.ACFT[data.selectedIndex5]; // 获取航空器类型的实际文本
|
||||||
|
const phaseText = data.phase[data.selectedIndex9]; // 获取飞行阶段的实际文本
|
||||||
|
|
||||||
|
// 提交数据到后端
|
||||||
|
wx.request({
|
||||||
|
url: 'http://192.168.137.1:8080/report/add',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'Authorization': `${token}`,
|
||||||
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
selectedTime: data.selectedTime,
|
||||||
|
selectedDate: data.selectedDate,
|
||||||
|
timezone: timezoneText, // 提交时区的实际文本
|
||||||
|
workPosition: workPositionText,// 提交岗位的实际文本
|
||||||
|
acftType: acftText, // 提交航空器类型的实际文本
|
||||||
|
phase: phaseText, // 提交飞行阶段的实际文本
|
||||||
|
inputValue1: data.inputValue1,
|
||||||
|
inputValue2: data.inputValue2,
|
||||||
|
inputValue3: data.inputValue3,
|
||||||
|
inputValue4: data.inputValue4,
|
||||||
|
inputValue5: data.inputValue5,
|
||||||
|
inputValue9: data.inputValue9,
|
||||||
|
inputValue10: data.inputValue10,
|
||||||
|
inputValue11: data.inputValue11,
|
||||||
|
inputValue12: data.inputValue12,
|
||||||
|
inputValue13: data.inputValue13,
|
||||||
|
inputValue14: data.inputValue14,
|
||||||
|
inputValue20: data.inputValue20,
|
||||||
|
inputValue21: data.inputValue21,
|
||||||
|
inputValue22: data.inputValue22,
|
||||||
|
inputValue23: data.inputValue23,
|
||||||
|
name: data.name,
|
||||||
|
},
|
||||||
|
success: function(res) {
|
||||||
|
console.log('Data submitted successfully:', res);
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.error('Error submitting data:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 使用腾讯混元智能体的 API 调用
|
||||||
|
wx.request({
|
||||||
|
url: 'https://yuanqi.tencent.com/openapi/v1/agent/chat/completions',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'X-Source': 'openapi',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'Bearer jSNTZONSnnzJ2uuQT7IEgXlPzfE4lX5f' // 替换为你的实际 Bearer Token
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
assistant_id: 'ty1W9unZM9IY', // 替换为实际的 assistant_id
|
||||||
|
user_id: '123456', // 替换为实际的用户ID
|
||||||
|
stream: false,
|
||||||
|
messages: [
|
||||||
|
{
|
||||||
|
role: 'user',
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
type: 'text',
|
||||||
|
text: JSON.stringify(data) // 将用户填写的数据转换为字符串
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
console.log('API 调用成功: ', res); // 打印完整的 API 响应
|
||||||
|
console.log('API 返回的 choices:', res.data.choices); // 检查数据结构
|
||||||
|
|
||||||
|
// 检查选择项并从中提取智能体回复
|
||||||
|
if (res.data && res.data.choices && res.data.choices.length > 0) {
|
||||||
|
// 确保 message 字段的内容可以被访问
|
||||||
|
const messageContent = res.data.choices[0].message?.content;
|
||||||
|
let agentReply;
|
||||||
|
|
||||||
|
// 如果 messageContent 存在并且是一个数组,则提取内容
|
||||||
|
if (Array.isArray(messageContent) && messageContent.length > 0) {
|
||||||
|
agentReply = messageContent[0].text; // 假设内容在数组的第一个元素中
|
||||||
|
} else {
|
||||||
|
agentReply = messageContent || '无法获取智能体的回复';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转到详情页面并传递数据和智能体的回复
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/FlightCrewDetails/FlightCrewDetails',
|
||||||
|
success: function (navRes) {
|
||||||
|
navRes.eventChannel.emit('sendData', {
|
||||||
|
details: data, // 用户输入的数据
|
||||||
|
agentReply: agentReply // 智能体的回复
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('API 响应中没有 choices');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.log('智能体调用失败', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onShareAppMessage() {
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,138 @@
|
|||||||
|
/* pages/Airtraffic/Airtraffic.wxss */
|
||||||
|
.container {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
border-bottom:0px ;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.one{
|
||||||
|
margin-top:0px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 21px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.two {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 18px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
.three{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.four{
|
||||||
|
align-items: center;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.five1{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
display: block;
|
||||||
|
font-size: 15px;
|
||||||
|
margin-right: 0px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
.five{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
margin-right: 120px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
font-size: 15px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.container1{
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.choose1{
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
.choose{
|
||||||
|
position: absolute;
|
||||||
|
right:0;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.picker {
|
||||||
|
text-align: center;
|
||||||
|
width: 100px;
|
||||||
|
height: auto;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 3px;
|
||||||
|
margin: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.input-box {
|
||||||
|
width: 25%;
|
||||||
|
padding: 0px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
margin: 3px;
|
||||||
|
}
|
||||||
|
.input-box2 {
|
||||||
|
width: 250px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.container3 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 98%;
|
||||||
|
margin: 2px;
|
||||||
|
padding: 3px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
.scroll-input {
|
||||||
|
width: 100%;
|
||||||
|
height: 150px;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid black;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
resize: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.container4 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.container5{
|
||||||
|
border: white;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom:10px;
|
||||||
|
}
|
||||||
|
.input-box1 {
|
||||||
|
width: 100px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.input-box3 {
|
||||||
|
width: 68px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,144 @@
|
|||||||
|
/* pages/Airtraffic/Airtraffic.wxss */
|
||||||
|
.container {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
border-bottom:0px ;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.one{
|
||||||
|
margin-top:0px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 21px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.two {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 18px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
.three{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.four{
|
||||||
|
align-items: center;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.five1{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
display: block;
|
||||||
|
font-size: 15px;
|
||||||
|
margin-right: 0px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
.five{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
margin-right: 120px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
font-size: 15px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.container1{
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.choose1{
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
.choose{
|
||||||
|
position: absolute;
|
||||||
|
right:0;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.picker {
|
||||||
|
text-align: center;
|
||||||
|
width: 100px;
|
||||||
|
height: auto;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 3px;
|
||||||
|
margin: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.input-box {
|
||||||
|
width: 25%;
|
||||||
|
padding: 0px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
margin: 3px;
|
||||||
|
}
|
||||||
|
.input-box2 {
|
||||||
|
width: 250px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.container3 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 98%;
|
||||||
|
margin: 2px;
|
||||||
|
padding: 3px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
.scroll-input {
|
||||||
|
width: 100%;
|
||||||
|
height: 150px;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid black;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
resize: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.container4 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.container5{
|
||||||
|
border: white;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom:10px;
|
||||||
|
}
|
||||||
|
.input-box1 {
|
||||||
|
width: 109px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.input-box3 {
|
||||||
|
width: 68px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ec-canvas {
|
||||||
|
width: 100%;
|
||||||
|
height: 400px;
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
details: {}, // 用户填写的数据
|
||||||
|
agentReply: '' // 智能体的回复
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
const eventChannel = this.getOpenerEventChannel();
|
||||||
|
|
||||||
|
// 监听并接收来自 FlightCrew.js 传递的数据
|
||||||
|
eventChannel.on('sendData', (data) => {
|
||||||
|
console.log('接收到的数据: ', data); // 打印接收到的数据,便于调试
|
||||||
|
this.setData({
|
||||||
|
details: data.details, // 用户的详细数据
|
||||||
|
agentReply: data.agentReply // 智能体的回复
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 回到首页的函数
|
||||||
|
goToHome() {
|
||||||
|
wx.switchTab({
|
||||||
|
url: '/pages/home/home', // 'home' Tab 页的路径
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
<text>智能分析: {{agentReply}}</text>
|
||||||
|
<button bindtap="goToHome" class="home-button">回到首页</button>
|
@ -0,0 +1,9 @@
|
|||||||
|
.home-button {
|
||||||
|
margin-top: 20px;
|
||||||
|
background-color: #007aff;
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 10px 15px;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
@ -0,0 +1,221 @@
|
|||||||
|
// pages/Students/students.js
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
name:'Students',
|
||||||
|
selectedTime: '--时--分',
|
||||||
|
selectedDate: '--年--月--日',
|
||||||
|
selectedIndex1: 0,
|
||||||
|
selectedIndex9: 0,
|
||||||
|
selectedIndex22: 0,
|
||||||
|
selectedIndex23: 0,
|
||||||
|
inputValue20: '',
|
||||||
|
inputValue21: '',
|
||||||
|
inputValue22: '',
|
||||||
|
inputValue23: '',
|
||||||
|
timezones: ['请选择','UTC-12:00', 'UTC-11:00', 'UTC-10:00', 'UTC-9:00', 'UTC-8:00', 'UTC-7:00', 'UTC-6:00', 'UTC-5:00', 'UTC-4:00', 'UTC-3:00', 'UTC-2:00', 'UTC-1:00', 'UTC+0:00', 'UTC+1:00', 'UTC+2:00', 'UTC+3:00', 'UTC+4:00', 'UTC+5:00', 'UTC+6:00', 'UTC+7:00', 'UTC+8:00', 'UTC+9:00', 'UTC+10:00', 'UTC+11:00', 'UTC+12:00'],
|
||||||
|
phase:['请选择','场外维护','加油','装载食品/货物','登机','推飞机','发动机开车/试车','滑行','其它'],
|
||||||
|
involve:['请选择','是','否'],
|
||||||
|
student:['请选择','飞行学生','地面学生','其它']
|
||||||
|
},
|
||||||
|
//时间选择
|
||||||
|
onTimeChange: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedTime: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onTimezoneChange: function (event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex1: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onDateChange: function(e) {
|
||||||
|
this.setData({
|
||||||
|
selectedDate: e.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//学生类型
|
||||||
|
onstudent: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex23: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//飞行阶段
|
||||||
|
onphase: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex9: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//是否涉及航空器
|
||||||
|
oninvolve: function(event) {
|
||||||
|
this.setData({
|
||||||
|
selectedIndex22: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//事件经过
|
||||||
|
onInput20: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue20: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//个人信息//姓名电话邮箱
|
||||||
|
onInput21: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue21: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput22: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue22: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onInput23: function(event) {
|
||||||
|
this.setData({
|
||||||
|
inputValue23: event.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//提交与重写
|
||||||
|
onReset() {
|
||||||
|
this.setData({
|
||||||
|
selectedTime: '--时--分',
|
||||||
|
selectedDate: '--年--月--日',
|
||||||
|
selectedIndex1: 0,
|
||||||
|
selectedIndex22: 0,
|
||||||
|
selectedIndex23: 0,
|
||||||
|
selectedIndex9: 0,
|
||||||
|
inputValue20: '',
|
||||||
|
inputValue21: '',
|
||||||
|
inputValue22: '',
|
||||||
|
inputValue23: '',
|
||||||
|
},() => {
|
||||||
|
console.log('Form has been reset');
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提交数据
|
||||||
|
onSubmit: function () {
|
||||||
|
// 获取存储中的 token
|
||||||
|
const token = wx.getStorageSync('token');
|
||||||
|
|
||||||
|
if (!token) {
|
||||||
|
console.log('Token 不存在,请先登录');
|
||||||
|
wx.showToast({
|
||||||
|
title: '请先登录',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return; // 终止提交
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.data;
|
||||||
|
// 获取用户选择的实际文本值
|
||||||
|
const timezoneText = this.data.timezones[data.selectedIndex1]; // 获取时区文本
|
||||||
|
const phaseText = this.data.phase[data.selectedIndex9]; // 获取飞行阶段文本
|
||||||
|
const involveText = this.data.involve[data.selectedIndex22]; // 获取是否涉及航空器的文本
|
||||||
|
const studentText = this.data.student[data.selectedIndex23]; // 获取学生类型的文本
|
||||||
|
// 提交的数据中只包含实际选择的文本内容
|
||||||
|
wx.request({
|
||||||
|
url: 'http://192.168.137.1:8080/report/add',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'Authorization': `${token}`,
|
||||||
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
selectedTime: data.selectedTime,
|
||||||
|
selectedDate: data.selectedDate,
|
||||||
|
timezone: timezoneText, // 时区对应的文本
|
||||||
|
phase: phaseText, // 飞行阶段对应的文本
|
||||||
|
involve: involveText, // 是否涉及航空器对应的文本
|
||||||
|
studentType: studentText, // 学生类型对应的文本
|
||||||
|
inputValue20: data.inputValue20,
|
||||||
|
inputValue21: data.inputValue21,
|
||||||
|
inputValue22: data.inputValue22,
|
||||||
|
inputValue23: data.inputValue23,
|
||||||
|
name: data.name
|
||||||
|
},
|
||||||
|
success: function(res) {
|
||||||
|
console.log('Data submitted successfully:', res);
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.error('Error submitting data:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 使用腾讯混元智能体的 API 调用
|
||||||
|
wx.request({
|
||||||
|
url: 'https://yuanqi.tencent.com/openapi/v1/agent/chat/completions',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'X-Source': 'openapi',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'Bearer jSNTZONSnnzJ2uuQT7IEgXlPzfE4lX5f' // 替换为你的实际 Bearer Token
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
assistant_id: 'ty1W9unZM9IY', // 替换为实际的 assistant_id
|
||||||
|
user_id: '123456', // 替换为实际的用户ID
|
||||||
|
stream: false,
|
||||||
|
messages: [
|
||||||
|
{
|
||||||
|
role: 'user',
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
type: 'text',
|
||||||
|
text: JSON.stringify(data) // 将用户填写的数据转换为字符串
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
success: function (res) {
|
||||||
|
console.log('API 调用成功: ', res); // 打印完整的 API 响应
|
||||||
|
console.log('API 返回的 choices:', res.data.choices); // 检查数据结构
|
||||||
|
|
||||||
|
// 检查选择项并从中提取智能体回复
|
||||||
|
if (res.data && res.data.choices && res.data.choices.length > 0) {
|
||||||
|
// 确保 message 字段的内容可以被访问
|
||||||
|
const messageContent = res.data.choices[0].message?.content;
|
||||||
|
let agentReply;
|
||||||
|
|
||||||
|
// 如果 messageContent 存在并且是一个数组,则提取内容
|
||||||
|
if (Array.isArray(messageContent) && messageContent.length > 0) {
|
||||||
|
agentReply = messageContent[0].text; // 假设内容在数组的第一个元素中
|
||||||
|
} else {
|
||||||
|
agentReply = messageContent || '无法获取智能体的回复';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转到详情页面并传递数据和智能体的回复
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/FlightCrewDetails/FlightCrewDetails',
|
||||||
|
success: function (navRes) {
|
||||||
|
navRes.eventChannel.emit('sendData', {
|
||||||
|
details: data, // 用户输入的数据
|
||||||
|
agentReply: agentReply // 智能体的回复
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('API 响应中没有 choices');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.log('智能体调用失败', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onShareAppMessage() {
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,140 @@
|
|||||||
|
/* pages/Students/students.wxss */
|
||||||
|
/* pages/Aviation/Aviation.wxss */
|
||||||
|
/* pages/Airtraffic/Airtraffic.wxss */
|
||||||
|
.container {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
border-bottom:0px ;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.one{
|
||||||
|
margin-top:0px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 21px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.two {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 18px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
.three{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.four{
|
||||||
|
align-items: center;
|
||||||
|
font-size: 15px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.five1{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
display: block;
|
||||||
|
font-size: 15px;
|
||||||
|
margin-right: 0px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
.five{
|
||||||
|
margin: 5px;
|
||||||
|
margin-left: 2px;
|
||||||
|
margin-right: 120px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
|
font-size: 15px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.container1{
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.choose1{
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
.choose{
|
||||||
|
position: absolute;
|
||||||
|
right:0;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.picker {
|
||||||
|
text-align: center;
|
||||||
|
width: 100px;
|
||||||
|
height: auto;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 3px;
|
||||||
|
margin: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.input-box {
|
||||||
|
width: 25%;
|
||||||
|
padding: 0px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
margin: 3px;
|
||||||
|
}
|
||||||
|
.input-box2 {
|
||||||
|
width: 250px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.container3 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 98%;
|
||||||
|
margin: 2px;
|
||||||
|
padding: 3px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
.scroll-input {
|
||||||
|
width: 100%;
|
||||||
|
height: 150px;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 15px;
|
||||||
|
border: 1px solid black;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
resize: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.container4 {
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 90%;
|
||||||
|
border: 1px solid gray;
|
||||||
|
padding: 5px;
|
||||||
|
margin: auto;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.container5{
|
||||||
|
border: white;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom:10px;
|
||||||
|
}
|
||||||
|
.input-box1 {
|
||||||
|
width: 100px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.input-box3 {
|
||||||
|
width: 68px;
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
Page({
|
||||||
|
// 跳转到查看上报页面
|
||||||
|
goToViewReports() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/viewReports/viewReports', // 这里是查看上报的页面路径
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 跳转到智能统计分析页面
|
||||||
|
goToDataAnalysis() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/dataAnalysis/dataAnalysis', // 这里是智能统计分析的页面路径
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 跳转到智能统计分析页面
|
||||||
|
goTologin() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/login/login', // 这里是智能统计分析的页面路径
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
<!--pages/admin/admin.wxml-->
|
||||||
|
<view class="container">
|
||||||
|
<view class="header">
|
||||||
|
<text class="title">管理员界面</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="buttons">
|
||||||
|
<!-- 查看上报按钮 -->
|
||||||
|
<button bindtap="goToViewReports" class="action-btn">查看上报</button>
|
||||||
|
<!-- 智能统计分析按钮 -->
|
||||||
|
<button bindtap="goToDataAnalysis" class="action-btn">智能统计分析</button>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<!-- 返回登录界面按钮 -->
|
||||||
|
<button bindtap="goTologin" class="action-btn">返回登录界面</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
@ -0,0 +1,35 @@
|
|||||||
|
/* pages/admin/admin.wxss */
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
margin-bottom: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 70rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
width: 400rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
margin: 35rpx 0;
|
||||||
|
background-color: #007aff;
|
||||||
|
color: white;
|
||||||
|
font-size: 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"pages": [
|
||||||
|
"pages/register/register",
|
||||||
|
"pages/login/login",
|
||||||
|
"pages/admin/admin",
|
||||||
|
"pages/home/home",
|
||||||
|
"pages/message/message",
|
||||||
|
"pages/profile/profile",
|
||||||
|
"pages/FlightCrew/FlightCrew",
|
||||||
|
"pages/Crew/Crew",
|
||||||
|
"pages/Aviation/Aviation",
|
||||||
|
"pages/AirportGround/AirportGround",
|
||||||
|
"pages/Airtraffic/Airtraffic",
|
||||||
|
"pages/Students/students",
|
||||||
|
"pages/Fast/Fast",
|
||||||
|
"pages/AircraftMaintenance/AircraftMaintenance",
|
||||||
|
"pages/FlightCrewDetails/FlightCrewDetails",
|
||||||
|
"pages/viewReports/viewReports",
|
||||||
|
"pages/userview/usereview",
|
||||||
|
"pages/dataAnalysis/dataAnalysis",
|
||||||
|
"pages/z1/z1",
|
||||||
|
"pages/z2/z2",
|
||||||
|
"pages/z3/z3"
|
||||||
|
],
|
||||||
|
"window": {
|
||||||
|
"navigationBarTextStyle": "black",
|
||||||
|
"navigationBarTitleText": "民航不安全事件上报",
|
||||||
|
"navigationBarBackgroundColor": "#fff"
|
||||||
|
},
|
||||||
|
"tabBar": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"pagePath": "pages/home/home",
|
||||||
|
"iconPath": "image/首页.png",
|
||||||
|
"selectedIconPath": "image/首页 (2).png",
|
||||||
|
"text": "首页"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/message/message",
|
||||||
|
"iconPath": "image/人工智能大脑.png",
|
||||||
|
"selectedIconPath": "image/人工智能大脑 (1).png",
|
||||||
|
"text": "AI对话"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/profile/profile",
|
||||||
|
"iconPath": "image/我的.png",
|
||||||
|
"selectedIconPath": "image/我的-copy.png",
|
||||||
|
"text": "个人中心"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"componentFramework": "glass-easel",
|
||||||
|
"sitemapLocation": "sitemap.json",
|
||||||
|
"lazyCodeLoading": "requiredComponents"
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
/**app.wxss**/
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 200rpx 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
predictResult: {
|
||||||
|
pre_data: [
|
||||||
|
{ dt: '2024-9', idx: 130 },
|
||||||
|
{ dt: '2024-8', idx: 140 },
|
||||||
|
{ dt: '2024-7', idx: 145 },
|
||||||
|
{ dt: '2024-6', idx: 150 },
|
||||||
|
{ dt: '2024-5', idx: 400 },
|
||||||
|
{ dt: '2024-4', idx:200 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad: function () {
|
||||||
|
// 模拟获取数据(可以替换成网络请求)
|
||||||
|
const preData = [
|
||||||
|
{ dt: '2024-9', idx: 500 },
|
||||||
|
{ dt: '2024-8', idx: 670 },
|
||||||
|
{ dt: '2024-7', idx: 345 },
|
||||||
|
{ dt: '2024-6', idx: 150 },
|
||||||
|
{ dt: '2024-5', idx: 400 },
|
||||||
|
{ dt: '2024-4', idx:100 }
|
||||||
|
];
|
||||||
|
|
||||||
|
// 将数据设置到页面的 data 中
|
||||||
|
this.setData({
|
||||||
|
'predictResult.pre_data': preData
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"ec-canvas": "../../echarts-for-weixin/ec-canvas/ec-canvas"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
.indexGraph {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 800rpx;
|
||||||
|
background-color: #eee;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
box-shadow: 2px 2px 5px 1px rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
.left {
|
||||||
|
width: 120rpx;
|
||||||
|
}
|
||||||
|
.leftTop {
|
||||||
|
width: 100%;
|
||||||
|
height: 150rpx;
|
||||||
|
/* background-color: pink; */
|
||||||
|
}
|
||||||
|
.date {
|
||||||
|
position: absolute;
|
||||||
|
top: 18%;
|
||||||
|
left: 1%;
|
||||||
|
}
|
||||||
|
.slice {
|
||||||
|
margin-top: -100rpx;
|
||||||
|
width: 200rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 5%;
|
||||||
|
rotate: 45deg;
|
||||||
|
border-bottom: 3px solid rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
.idx {
|
||||||
|
position: absolute;
|
||||||
|
top: 13%;
|
||||||
|
left: 6%;
|
||||||
|
}
|
||||||
|
.yAxis {
|
||||||
|
display: flex;
|
||||||
|
/* background-color: pink; */
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
height: 650rpx;
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.graph {
|
||||||
|
position: absolute;
|
||||||
|
width: 592.5rpx;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
height: 650rpx;
|
||||||
|
background-color: skyblue;
|
||||||
|
border-radius: 0 0 15rpx 0;
|
||||||
|
border-left: 2px solid rgb(0, 0, 0, 0.8);
|
||||||
|
border-top: 2px solid rgb(0, 0, 0, 0.8);
|
||||||
|
}
|
||||||
|
.colarea {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-around;
|
||||||
|
height: 650rpx;
|
||||||
|
/* background-color: skyblue; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.col {
|
||||||
|
padding-right: 10rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
background-color: rgb(139, 0, 139);
|
||||||
|
text-align: right;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.xAxis {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
height: 120rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.deg {
|
||||||
|
width: 98.75rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.deg:nth-child(-n+6) {
|
||||||
|
line-height: 48px;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deg:nth-child(n+7) {
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.module {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center; /* 图片和文字居中 */
|
||||||
|
border-bottom: 2px solid #ccc; /* 分界线 */
|
||||||
|
padding: 4px 0; /* 上下内边距 */
|
||||||
|
width: 100%; /* 确保模块宽度一致 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.caption {
|
||||||
|
text-align: center; /* 文字居中 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
|||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
},
|
||||||
|
swiperItemTap: function(event) {
|
||||||
|
const pagePath = event.currentTarget.dataset.url;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: pagePath
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
},
|
||||||
|
onShareAppMessage() {
|
||||||
|
},
|
||||||
|
})
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
<!-- 轮播图 -->
|
||||||
|
<swiper
|
||||||
|
class="swiper1"
|
||||||
|
autoplay="true"
|
||||||
|
interval="3000"
|
||||||
|
circular="true"
|
||||||
|
indicator-dots="true"
|
||||||
|
indicator-color="white"
|
||||||
|
indicator-active-color="brown"
|
||||||
|
>
|
||||||
|
<swiper-item>
|
||||||
|
<image src="/image/轮播图1.jpg" class="slide-image" bindtap="swiperItemTap" data-url="/pages/z1/z1"/>
|
||||||
|
</swiper-item>
|
||||||
|
<swiper-item>
|
||||||
|
<image src="/image/轮播图2.jpg" class="slide-image" bindtap="swiperItemTap" data-url="/pages/z2/z2"/>
|
||||||
|
</swiper-item>
|
||||||
|
<swiper-item>
|
||||||
|
<image src="/image/轮播图3.jpg" class="slide-image" bindtap="swiperItemTap" data-url="/pages/z3/z3"/>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
|
||||||
|
<!-- 页面跳转链接 -->
|
||||||
|
<view class="three">
|
||||||
|
<text class="four">上报中心</text>
|
||||||
|
<view>
|
||||||
|
<scroll-view class="container1" scroll-x="true" enable-flex="true">
|
||||||
|
<view class="grid-container">
|
||||||
|
<navigator class="grid-item" url="/pages/FlightCrew/FlightCrew">
|
||||||
|
<image src="/image/飞行人员.png"></image>
|
||||||
|
<text>飞行事件</text>
|
||||||
|
</navigator>
|
||||||
|
<navigator class="grid-item" url="/pages/Crew/Crew">
|
||||||
|
<image src="/image/乘务人员.png"></image>
|
||||||
|
<text>乘务事件</text>
|
||||||
|
</navigator>
|
||||||
|
<navigator class="grid-item" url="/pages/Airtraffic/Airtraffic">
|
||||||
|
<image src="/image/空管人员.png"></image>
|
||||||
|
<text>空管事件</text>
|
||||||
|
</navigator>
|
||||||
|
<navigator class="grid-item" url="/pages/AircraftMaintenance/AircraftMaintenance">
|
||||||
|
<image src="/image/机务人员.jpg"></image>
|
||||||
|
<text>机务事件</text>
|
||||||
|
</navigator>
|
||||||
|
<navigator class="grid-item" url="/pages/AirportGround/AirportGround">
|
||||||
|
<image src="/image/地勤人员.png"></image>
|
||||||
|
<text>地勤事件</text>
|
||||||
|
</navigator>
|
||||||
|
<navigator class="grid-item" url="/pages/Aviation/Aviation">
|
||||||
|
<image src="/image/空防事件.png"></image>
|
||||||
|
<text>空防事件</text>
|
||||||
|
</navigator>
|
||||||
|
<navigator class="grid-item" url="/pages/Students/students">
|
||||||
|
<image src="/image/学生学员.png"></image>
|
||||||
|
<text>学生事件</text>
|
||||||
|
</navigator>
|
||||||
|
<navigator class="grid-item" url="/pages/Fast/Fast">
|
||||||
|
<image src="/image/快速上报.png"></image>
|
||||||
|
<text>快速上报</text>
|
||||||
|
</navigator>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</view>
|
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
<!-- pages/login/login.wxml -->
|
||||||
|
<view class="container">
|
||||||
|
<view class="title">登录</view>
|
||||||
|
|
||||||
|
<!-- 输入账号ID -->
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="请输入账号ID"
|
||||||
|
bindinput="onIDInput"
|
||||||
|
value="{{ID}}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 输入密码 -->
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
placeholder="请输入密码"
|
||||||
|
bindinput="onPasswordInput"
|
||||||
|
value="{{password}}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 显示错误信息 -->
|
||||||
|
<view class="error">{{errorMessage}}</view>
|
||||||
|
|
||||||
|
<!-- 登录按钮 -->
|
||||||
|
<button bindtap="submitUserInfo">登录</button>
|
||||||
|
|
||||||
|
<!-- 跳转到注册页面 -->
|
||||||
|
<view class="message">
|
||||||
|
还没有账号?<text class="link" bindtap="goToRegister">点击注册</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
@ -0,0 +1,80 @@
|
|||||||
|
/* pages/login/login.wxss */
|
||||||
|
page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 90%;
|
||||||
|
max-width: 400px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 20px;
|
||||||
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
padding: 0 10px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:focus {
|
||||||
|
border-color: #007aff;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
width: 100%;
|
||||||
|
height: 45px;
|
||||||
|
background-color: #007aff;
|
||||||
|
color: #fff;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 45px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:active {
|
||||||
|
background-color: #005bb5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-section {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error {
|
||||||
|
color: red;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
margin-top: 10px;
|
||||||
|
text-align: center;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link {
|
||||||
|
color: #007aff;
|
||||||
|
text-decoration: underline;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
<!-- 标题 -->
|
||||||
|
<view class="header">
|
||||||
|
<text class="title">AI助手</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="container">
|
||||||
|
<!-- 消息显示区域 -->
|
||||||
|
<scroll-view class="chat-area" scroll-y>
|
||||||
|
<block wx:for="{{messages}}" wx:key="id">
|
||||||
|
<view class="message" wx:if="{{item.role === 'user'}}">
|
||||||
|
<view class="user-message">{{item.content}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="message" wx:if="{{item.role === 'assistant'}}">
|
||||||
|
<view class="assistant-message">{{item.content}}</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 输入框与发送按钮 -->
|
||||||
|
<view class="input-area">
|
||||||
|
<input class="input-box" placeholder="请输入问题..." bindinput="bindKeyInput" value="{{inputVal}}" />
|
||||||
|
<button class="send-btn" bindtap="sendMessage">发送</button>
|
||||||
|
</view>
|
@ -0,0 +1,107 @@
|
|||||||
|
/* 全局容器样式 */
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 106vh;
|
||||||
|
background-color: #ffffff; /* 背景为纯白色 */
|
||||||
|
color: #333333; /* 深色文本,和白色背景形成对比 */
|
||||||
|
margin-top: -100px;
|
||||||
|
margin-bottom: -60px;
|
||||||
|
}
|
||||||
|
/* 标题区域 */
|
||||||
|
.header {
|
||||||
|
padding: 10px; /* 调整内边距 */
|
||||||
|
text-align: center; /* 标题左对齐 */
|
||||||
|
border-bottom: 1px solid #e0e0e0; /* 边框为浅灰色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
color: black; /* 深灰色标题 */
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-transform: uppercase; /* 大写标题 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 聊天区域 */
|
||||||
|
.chat-area {
|
||||||
|
flex: 1;
|
||||||
|
background-color: #ffffff; /* 白色背景 */
|
||||||
|
overflow-y: auto; /* 允许滚动 */
|
||||||
|
border-top: 1px solid #e0e0e0; /* 边框线 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 消息气泡 */
|
||||||
|
.message {
|
||||||
|
margin: 10px 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row; /* 水平排列 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-message, .assistant-message {
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 15px;
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
color: #333333;
|
||||||
|
word-wrap: break-word; /* 自动换行 */
|
||||||
|
word-break: break-all; /* 长单词自动拆分换行 */
|
||||||
|
white-space: pre-wrap; /* 保留空白符并换行 */
|
||||||
|
max-width: 80%; /* 最大宽度为70% */
|
||||||
|
font-family: 'Arial', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-message {
|
||||||
|
margin-left: auto;
|
||||||
|
background-color: #f0f0f0; /* 用户消息为浅灰色背景 */
|
||||||
|
border-radius: 15px 15px 0 15px; /* 圆角气泡 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.assistant-message {
|
||||||
|
margin-right: auto;
|
||||||
|
background-color: #e8e8e8; /* AI消息背景色为稍深灰色 */
|
||||||
|
border-radius: 15px 15px 15px 0; /* 圆角气泡 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 输入区域 */
|
||||||
|
.input-area {
|
||||||
|
display: flex;
|
||||||
|
padding: 10px 15px;
|
||||||
|
background-color: white; /* 输入区为浅灰色背景 */
|
||||||
|
border-top: 1px solid #dddddd; /* 上方的分隔线 */
|
||||||
|
position: sticky; /* 固定输入框在底部 */
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-box {
|
||||||
|
flex: 1;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #cccccc; /* 边框为浅灰色 */
|
||||||
|
border-radius: 5px; /* 圆角输入框 */
|
||||||
|
background-color: #ffffff; /* 输入框为白色 */
|
||||||
|
color: #333333;
|
||||||
|
margin-right: 10px;
|
||||||
|
font-family: 'Arial', sans-serif;
|
||||||
|
word-wrap: break-word; /* 输入框内长内容自动换行 */
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 发送按钮样式 */
|
||||||
|
.send-btn {
|
||||||
|
padding: 6px 12px; /* 调整为更小的内边距 */
|
||||||
|
background-color: #4a90e2; /* 亮蓝色 */
|
||||||
|
color: #ffffff;
|
||||||
|
border-radius: 5px; /* 保持圆角 */
|
||||||
|
border: none;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 14px; /* 缩小字体大小 */
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.send-btn:hover {
|
||||||
|
background-color: #357ABD; /* 悬停时颜色加深 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 图标颜色和输入框样式 */
|
||||||
|
input::placeholder {
|
||||||
|
color: #aaaaaa; /* 输入框提示符为浅灰色 */
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
"name": "unsafe-pro",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "unsafe-pro",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@vant/weapp": "^1.11.6",
|
||||||
|
"echarts-for-weixin": "^1.0.2",
|
||||||
|
"miniprogram-api-typings": "^3.12.2",
|
||||||
|
"var": "^0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@vant/weapp": {
|
||||||
|
"version": "1.11.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.6.tgz",
|
||||||
|
"integrity": "sha512-a3heReWYT2gNdsyj6x1hBwsM8V8NrjcPAmle86NH2CD2V/i/h0le75piW6KntSfOPCwekVWMBKhysNrBpJeKdw=="
|
||||||
|
},
|
||||||
|
"node_modules/echarts": {
|
||||||
|
"version": "5.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.5.1.tgz",
|
||||||
|
"integrity": "sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "2.3.0",
|
||||||
|
"zrender": "5.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/echarts-for-weixin": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/echarts-for-weixin/-/echarts-for-weixin-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-cEk4yFMCJDQpvAgVRKbGvMjXvuW965iEUootJffRFHwJwCq0/GIeoRTTAEuj50PKMMtLTW4DmBPmvPja3sH2jQ==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"echarts": "^5.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/lodash": {
|
||||||
|
"version": "4.17.21",
|
||||||
|
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
|
||||||
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
|
},
|
||||||
|
"node_modules/miniprogram-api-typings": {
|
||||||
|
"version": "3.12.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/miniprogram-api-typings/-/miniprogram-api-typings-3.12.2.tgz",
|
||||||
|
"integrity": "sha512-OJB2uVAfhycX4teG/zEVpoThushQqLOx946XACDpVc6OQydiJWjn7djVzvNCbv0VOA7sbHGPQp/RkXD9vMCDEw=="
|
||||||
|
},
|
||||||
|
"node_modules/tslib": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
|
"node_modules/var": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/var/-/var-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-olxlLAssnt9UPL5UAErYTaCJhpwaDfkuSxOEB5eUclEJbl4xi7EhOIaOh6Y8KTQHIKUnyd2DygRLSnTaXtXuGg==",
|
||||||
|
"dependencies": {
|
||||||
|
"lodash": "^4.17.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/zrender": {
|
||||||
|
"version": "5.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/zrender/-/zrender-5.6.0.tgz",
|
||||||
|
"integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "unsafe-pro",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": ".eslintrc.js",
|
||||||
|
"dependencies": {
|
||||||
|
"@vant/weapp": "^1.11.6",
|
||||||
|
"echarts-for-weixin": "^1.0.2",
|
||||||
|
"miniprogram-api-typings": "^3.12.2",
|
||||||
|
"var": "^0.4.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"description": ""
|
||||||
|
}
|
@ -1,71 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
|
||||||
<version>3.2.3</version>
|
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
|
||||||
</parent>
|
|
||||||
<groupId>com.sa</groupId>
|
|
||||||
<artifactId>bigevent</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
<name>bigevent</name>
|
|
||||||
<description>bigevent</description>
|
|
||||||
<properties>
|
|
||||||
<java.version>17</java.version>
|
|
||||||
</properties>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
|
||||||
<version>3.0.3</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
|
||||||
<scope>runtime</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
|
||||||
<artifactId>mybatis-spring-boot-starter-test</artifactId>
|
|
||||||
<version>3.0.3</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<scope>annotationProcessor</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.auth0</groupId>
|
|
||||||
<artifactId>java-jwt</artifactId>
|
|
||||||
<version>4.4.0</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
|
@ -0,0 +1,24 @@
|
|||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
avatarUrl: '/image/化工专家.png', // 默认头像
|
||||||
|
},
|
||||||
|
viewLogs: function() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/userview/usereview',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
logout: function() {
|
||||||
|
wx.showModal({
|
||||||
|
title: '退出登录',
|
||||||
|
content: '你确定要退出登录吗?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.clearStorage(); // 清除本地存储的用户数据
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '/pages/login/login' // 跳转到登录页面
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
<view class="profile-page">
|
||||||
|
<!-- 个人信息展示部分,仅显示头像 -->
|
||||||
|
<view class="profile-header">
|
||||||
|
<view class="avatar-container">
|
||||||
|
<image class="avatar" src="{{avatarUrl}}" mode="aspectFill" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 功能按钮,仅保留查看上报和退出登录功能 -->
|
||||||
|
<view class="actions">
|
||||||
|
<button class="action-btn" bindtap="viewLogs">查看上报</button>
|
||||||
|
<button class="action-btn logout-btn" bindtap="logout">退出登录</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
@ -0,0 +1,53 @@
|
|||||||
|
.profile-page {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: white; /* 整体背景色 */
|
||||||
|
margin-top: 100px;
|
||||||
|
}
|
||||||
|
.profile-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center; /* 水平居中 */
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-container {
|
||||||
|
width: 125px;
|
||||||
|
height: 125px;
|
||||||
|
margin-right: 15px;
|
||||||
|
border-radius: 50%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover; /* 确保图片不变形 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 40px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
height: 50px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 5px;
|
||||||
|
background-color: #007aff;
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logout-btn {
|
||||||
|
background-color: #ff3b30; /* 红色背景,用于突出退出按钮 */
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"appid": "wxdb7149e7addd81c6",
|
||||||
|
"compileType": "miniprogram",
|
||||||
|
"libVersion": "3.4.6",
|
||||||
|
"packOptions": {
|
||||||
|
"ignore": [],
|
||||||
|
"include": []
|
||||||
|
},
|
||||||
|
"setting": {
|
||||||
|
"coverView": true,
|
||||||
|
"es6": true,
|
||||||
|
"postcss": true,
|
||||||
|
"minified": true,
|
||||||
|
"enhance": true,
|
||||||
|
"showShadowRootInWxmlPanel": true,
|
||||||
|
"packNpmRelationList": [],
|
||||||
|
"babelSetting": {
|
||||||
|
"ignore": [],
|
||||||
|
"disablePlugins": [],
|
||||||
|
"outputPath": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"condition": {},
|
||||||
|
"editorSetting": {
|
||||||
|
"tabIndent": "insertSpaces",
|
||||||
|
"tabSize": 2
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
// pages/register/register.js
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
ID: '',
|
||||||
|
password: '',
|
||||||
|
errorMessage: ''
|
||||||
|
},
|
||||||
|
|
||||||
|
// 处理ID输入
|
||||||
|
onIDInput(e) {
|
||||||
|
this.setData({
|
||||||
|
ID: e.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 处理密码输入
|
||||||
|
onPasswordInput(e) {
|
||||||
|
this.setData({
|
||||||
|
password: e.detail.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 处理注册逻辑
|
||||||
|
submitUserInfo() {
|
||||||
|
const { ID, password } = this.data;
|
||||||
|
|
||||||
|
// 验证 ID 和密码是否为空
|
||||||
|
if (!ID || !password) {
|
||||||
|
this.setData({
|
||||||
|
errorMessage: '账号ID和密码不能为空'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发起注册请求,使用 x-www-form-urlencoded
|
||||||
|
wx.request({
|
||||||
|
header: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded' // 设置请求头
|
||||||
|
},
|
||||||
|
url: 'http://192.168.144.1:8080/user/register', // 替换为你的后端API地址
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
'username': ID,
|
||||||
|
'password': password
|
||||||
|
},
|
||||||
|
success(res) {
|
||||||
|
console.log('注册成功', res);
|
||||||
|
wx.showToast({
|
||||||
|
title: '注册成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
// 注册成功后跳转到登录页面
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 跳转到登录页面
|
||||||
|
goToLogin() {
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '/pages/login/login' // 登录页面的路径
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
<!-- pages/register/register.wxml -->
|
||||||
|
<view class="container">
|
||||||
|
<!-- 注册标题 -->
|
||||||
|
<view class="title">注册</view>
|
||||||
|
|
||||||
|
<!-- 输入账号ID号 -->
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="请输入账号ID"
|
||||||
|
bindinput="onIDInput"
|
||||||
|
value="{{phone}}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 输入密码 -->
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
placeholder="请输入密码"
|
||||||
|
bindinput="onPasswordInput"
|
||||||
|
value="{{password}}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 显示错误信息 -->
|
||||||
|
<view class="error">{{errorMessage}}</view>
|
||||||
|
|
||||||
|
<!-- 注册按钮 -->
|
||||||
|
<button bindtap="submitUserInfo">注册</button>
|
||||||
|
|
||||||
|
<!-- 提示跳转到登录页面 -->
|
||||||
|
<view class="message">
|
||||||
|
已有账号?<text class="link" bindtap="goToLogin">点击登录</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
@ -0,0 +1,76 @@
|
|||||||
|
/* pages/register/register.wxss */
|
||||||
|
page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 90%;
|
||||||
|
max-width: 400px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 20px;
|
||||||
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
padding: 0 10px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:focus {
|
||||||
|
border-color: #007aff;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
width: 100%;
|
||||||
|
height: 45px;
|
||||||
|
background-color: #007aff;
|
||||||
|
color: #fff;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 45px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:active {
|
||||||
|
background-color: #005bb5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error {
|
||||||
|
color: red;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
margin-top: 10px;
|
||||||
|
text-align: center;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link {
|
||||||
|
color: #007aff;
|
||||||
|
text-decoration: underline;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
|
||||||
|
"rules": [{
|
||||||
|
"action": "allow",
|
||||||
|
"page": "*"
|
||||||
|
}]
|
||||||
|
}
|
@ -1,61 +0,0 @@
|
|||||||
CREATE TABLE reports (
|
|
||||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
name TEXT,
|
|
||||||
selectedTime TEXT,
|
|
||||||
selectedDate TEXT,
|
|
||||||
license TEXT,
|
|
||||||
acftType TEXT,
|
|
||||||
fixstage TEXT,
|
|
||||||
fixcheck TEXT,
|
|
||||||
aarcstatus TEXT,
|
|
||||||
phase TEXT,
|
|
||||||
wether TEXT,
|
|
||||||
lightCondition TEXT,
|
|
||||||
carone TEXT,
|
|
||||||
cartwo TEXT,
|
|
||||||
workPosition TEXT,
|
|
||||||
task TEXT,
|
|
||||||
plan TEXT,
|
|
||||||
ats TEXT,
|
|
||||||
atc TEXT,
|
|
||||||
tcas TEXT,
|
|
||||||
advise TEXT,
|
|
||||||
involve TEXT,
|
|
||||||
tudentType TEXT,
|
|
||||||
acft0Type TEXT,
|
|
||||||
task0 TEXT,
|
|
||||||
plan0 TEXT,
|
|
||||||
phase0 TEXT,
|
|
||||||
wether0 TEXT,
|
|
||||||
lightCondition0 TEXT,
|
|
||||||
ats0 TEXT,
|
|
||||||
atc0 TEXT,
|
|
||||||
tcas0 TEXT,
|
|
||||||
advise0 TEXT,
|
|
||||||
inputValue1 TEXT,
|
|
||||||
inputValue2 TEXT,
|
|
||||||
inputValue3 TEXT,
|
|
||||||
inputValue4 TEXT,
|
|
||||||
inputValue5 TEXT,
|
|
||||||
inputValue6 TEXT,
|
|
||||||
inputValue7 TEXT,
|
|
||||||
inputValue8 TEXT,
|
|
||||||
inputValue9 TEXT,
|
|
||||||
inputValue10 TEXT,
|
|
||||||
inputValue11 TEXT,
|
|
||||||
inputValue12 TEXT,
|
|
||||||
inputValue13 TEXT,
|
|
||||||
inputValue14 TEXT,
|
|
||||||
inputValue15 TEXT,
|
|
||||||
inputValue16 TEXT,
|
|
||||||
inputValue17 TEXT,
|
|
||||||
inputValue18 TEXT,
|
|
||||||
inputValue19 TEXT,
|
|
||||||
inputValue20 TEXT,
|
|
||||||
inputValue21 TEXT,
|
|
||||||
inputValue22 TEXT,
|
|
||||||
inputValue23 TEXT,
|
|
||||||
inputValue100 TEXT,
|
|
||||||
inputValue101 TEXT,
|
|
||||||
inputValue102 TEXT
|
|
||||||
);
|
|
@ -1,15 +0,0 @@
|
|||||||
package com.sa.unsafeincidents;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
|
||||||
public class UnsafeincidentsApplication {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
SpringApplication.run(UnsafeincidentsApplication.class, args);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.config;
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.interceptors.LoginInterceptor;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class webconfig implements WebMvcConfigurer {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private LoginInterceptor loginInterceptor;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addInterceptors(InterceptorRegistry registry) {
|
|
||||||
registry.addInterceptor(loginInterceptor).excludePathPatterns("/user/login", "/user/register");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.controller;
|
|
||||||
import com.sa.unsafeincidents.pojo.Report;
|
|
||||||
import com.sa.unsafeincidents.pojo.Result;
|
|
||||||
import com.sa.unsafeincidents.pojo.User;
|
|
||||||
import com.sa.unsafeincidents.service.ReportService;
|
|
||||||
import com.sa.unsafeincidents.service.UserService;
|
|
||||||
import com.sa.unsafeincidents.utils.ThreadLocalUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/report")
|
|
||||||
public class ReportController {
|
|
||||||
@Autowired
|
|
||||||
ReportService reportService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
UserService userService;
|
|
||||||
|
|
||||||
@PostMapping("/add")
|
|
||||||
public Result add(@RequestBody Report form) {
|
|
||||||
reportService.add(form);
|
|
||||||
System.out.println("test");
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
public Result<Report> get(Integer id) {
|
|
||||||
return Result.success(reportService.findByID(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/reply")
|
|
||||||
public Result reply(Integer id, String reply) {
|
|
||||||
reportService.reply(id, reply);
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/list")
|
|
||||||
public Result<List<Report>> list() {
|
|
||||||
Map<String,Object> claims = ThreadLocalUtil.get();
|
|
||||||
String username = (String) claims.get("username");
|
|
||||||
User user = userService.findByUsername(username);
|
|
||||||
if (user.getPermissions() == 1) {
|
|
||||||
return Result.success(reportService.list());
|
|
||||||
} else {
|
|
||||||
List<Report> reports = reportService.list(username);
|
|
||||||
return Result.success(reports);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.pojo.Result;
|
|
||||||
import com.sa.unsafeincidents.pojo.User;
|
|
||||||
import com.sa.unsafeincidents.service.UserService;
|
|
||||||
import com.sa.unsafeincidents.utils.JwtUtil;
|
|
||||||
import com.sa.unsafeincidents.utils.Md5Util;
|
|
||||||
import com.sa.unsafeincidents.utils.ThreadLocalUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/user")
|
|
||||||
public class UserController {
|
|
||||||
@Autowired
|
|
||||||
UserService userService;
|
|
||||||
|
|
||||||
@PostMapping("/register")
|
|
||||||
public Result register(String username, String password) {
|
|
||||||
User user = userService.findByUsername(username);
|
|
||||||
|
|
||||||
if (user == null) {
|
|
||||||
userService.register(username, password);
|
|
||||||
return Result.success();
|
|
||||||
} else {
|
|
||||||
return Result.error("用户已存在");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/is_admin")
|
|
||||||
public Result is_admin() {
|
|
||||||
Map<String,Object> claims = ThreadLocalUtil.get();
|
|
||||||
String username = (String) claims.get("username");
|
|
||||||
// System.out.println(username);
|
|
||||||
User user = userService.findByUsername(username);
|
|
||||||
if (user.getPermissions() == 1) return Result.success(true);
|
|
||||||
return Result.success(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/login")
|
|
||||||
public Result login(String username,String password) {
|
|
||||||
User loginuser = userService.findByUsername(username);
|
|
||||||
|
|
||||||
// System.out.println(username + ' ' + password);
|
|
||||||
|
|
||||||
if (loginuser == null || !loginuser.getPassword().equals(Md5Util.getMD5String(password))) {
|
|
||||||
return Result.error("用户名或密码错误");
|
|
||||||
} else {
|
|
||||||
Map<String,Object> claims = new HashMap<>();
|
|
||||||
claims.put("id",loginuser.getId());
|
|
||||||
claims.put("username",loginuser.getUsername());
|
|
||||||
String token = JwtUtil.genToken(claims);
|
|
||||||
return Result.success(token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.exception;
|
|
||||||
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.pojo.Result;
|
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
||||||
|
|
||||||
@RestControllerAdvice
|
|
||||||
public class GlobalExceptionHandle {
|
|
||||||
|
|
||||||
|
|
||||||
@ExceptionHandler(Exception.class)
|
|
||||||
public Result HandleException(Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Result.error(StringUtils.hasLength(e.getMessage())? e.getMessage():"操作失败");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.interceptors;
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.utils.JwtUtil;
|
|
||||||
import com.sa.unsafeincidents.utils.ThreadLocalUtil;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.servlet.HandlerInterceptor;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class LoginInterceptor implements HandlerInterceptor {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
|
||||||
String token = request.getHeader("Authorization");
|
|
||||||
try {
|
|
||||||
ThreadLocalUtil.set(JwtUtil.parseToken(token));
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
response.setStatus(401);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
|
|
||||||
ThreadLocalUtil.remove();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,104 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.mapper;
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.pojo.Report;
|
|
||||||
import org.apache.ibatis.annotations.*;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface ReportMapper {
|
|
||||||
|
|
||||||
@Insert("INSERT INTO reports (username, name, selectedTime, selectedDate, license, acftType, fixstage, " +
|
|
||||||
"fixcheck, aarcstatus, phase, wether, lightCondition, carone, cartwo, workPosition, task, plan, ats, atc, tcas, " +
|
|
||||||
"advise, involve, tudentType, acft0Type, task0, plan0, phase0, wether0, lightCondition0, ats0, atc0, tcas0, " +
|
|
||||||
"advise0, inputValue1, inputValue2, inputValue3, inputValue4, inputValue5, inputValue6, inputValue7, " +
|
|
||||||
"inputValue8, inputValue9, inputValue10, inputValue11, inputValue12, inputValue13, inputValue14, inputValue15, " +
|
|
||||||
"inputValue16, inputValue17, inputValue18, inputValue19, inputValue20, inputValue21, inputValue22, " +
|
|
||||||
"inputValue23, inputValue100, inputValue101, inputValue102, reply) " +
|
|
||||||
"VALUES (#{username}, #{name}, #{selectedTime}, #{selectedDate}, #{license}, #{acftType}, #{fixstage}, " +
|
|
||||||
"#{fixcheck}, #{aarcstatus}, #{phase}, #{wether}, #{lightCondition}, #{carone}, #{cartwo}, #{workPosition}, " +
|
|
||||||
"#{task}, #{plan}, #{ats}, #{atc}, #{tcas}, #{advise}, #{involve}, #{tudentType}, #{acft0Type}, #{task0}, " +
|
|
||||||
"#{plan0}, #{phase0}, #{wether0}, #{lightCondition0}, #{ats0}, #{atc0}, #{tcas0}, #{advise0}, " +
|
|
||||||
"#{inputValue1}, #{inputValue2}, #{inputValue3}, #{inputValue4}, #{inputValue5}, #{inputValue6}, " +
|
|
||||||
"#{inputValue7}, #{inputValue8}, #{inputValue9}, #{inputValue10}, #{inputValue11}, #{inputValue12}, " +
|
|
||||||
"#{inputValue13}, #{inputValue14}, #{inputValue15}, #{inputValue16}, #{inputValue17}, #{inputValue18}, " +
|
|
||||||
"#{inputValue19}, #{inputValue20}, #{inputValue21}, #{inputValue22}, #{inputValue23}, #{inputValue100}, " +
|
|
||||||
"#{inputValue101}, #{inputValue102}, #{reply})")
|
|
||||||
void add(Report report);
|
|
||||||
|
|
||||||
@Delete("DELETE FROM reports WHERE id = #{id}")
|
|
||||||
void deleteById(Long id);
|
|
||||||
|
|
||||||
@Select("select * from reports where name=#{name}")
|
|
||||||
ArrayList<Report> findByName(String name);
|
|
||||||
|
|
||||||
@Select("select * from reports")
|
|
||||||
ArrayList<Report> list();
|
|
||||||
|
|
||||||
@Select("select * from reports where id=#{id}")
|
|
||||||
Report findByID(Integer id);
|
|
||||||
|
|
||||||
@Update("UPDATE reports SET " +
|
|
||||||
"name = #{name}, " +
|
|
||||||
"selectedTime = #{selectedTime}, " +
|
|
||||||
"selectedDate = #{selectedDate}, " +
|
|
||||||
"license = #{license}, " +
|
|
||||||
"acftType = #{acftType}, " +
|
|
||||||
"fixstage = #{fixstage}, " +
|
|
||||||
"fixcheck = #{fixcheck}, " +
|
|
||||||
"aarcstatus = #{aarcstatus}, " +
|
|
||||||
"phase = #{phase}, " +
|
|
||||||
"wether = #{wether}, " +
|
|
||||||
"lightCondition = #{lightCondition}, " +
|
|
||||||
"carone = #{carone}, " +
|
|
||||||
"cartwo = #{cartwo}, " +
|
|
||||||
"workPosition = #{workPosition}, " +
|
|
||||||
"task = #{task}, " +
|
|
||||||
"plan = #{plan}, " +
|
|
||||||
"ats = #{ats}, " +
|
|
||||||
"atc = #{atc}, " +
|
|
||||||
"tcas = #{tcas}, " +
|
|
||||||
"advise = #{advise}, " +
|
|
||||||
"involve = #{involve}, " +
|
|
||||||
"tudentType = #{tudentType}, " +
|
|
||||||
"acft0Type = #{acft0Type}, " +
|
|
||||||
"task0 = #{task0}, " +
|
|
||||||
"plan0 = #{plan0}, " +
|
|
||||||
"phase0 = #{phase0}, " +
|
|
||||||
"wether0 = #{wether0}, " +
|
|
||||||
"lightCondition0 = #{lightCondition0}, " +
|
|
||||||
"ats0 = #{ats0}, " +
|
|
||||||
"atc0 = #{atc0}, " +
|
|
||||||
"tcas0 = #{tcas0}, " +
|
|
||||||
"advise0 = #{advise0}, " +
|
|
||||||
"inputValue1 = #{inputValue1}, " +
|
|
||||||
"inputValue2 = #{inputValue2}, " +
|
|
||||||
"inputValue3 = #{inputValue3}, " +
|
|
||||||
"inputValue4 = #{inputValue4}, " +
|
|
||||||
"inputValue5 = #{inputValue5}, " +
|
|
||||||
"inputValue6 = #{inputValue6}, " +
|
|
||||||
"inputValue7 = #{inputValue7}, " +
|
|
||||||
"inputValue8 = #{inputValue8}, " +
|
|
||||||
"inputValue9 = #{inputValue9}, " +
|
|
||||||
"inputValue10 = #{inputValue10}, " +
|
|
||||||
"inputValue11 = #{inputValue11}, " +
|
|
||||||
"inputValue12 = #{inputValue12}, " +
|
|
||||||
"inputValue13 = #{inputValue13}, " +
|
|
||||||
"inputValue14 = #{inputValue14}, " +
|
|
||||||
"inputValue15 = #{inputValue15}, " +
|
|
||||||
"inputValue16 = #{inputValue16}, " +
|
|
||||||
"inputValue17 = #{inputValue17}, " +
|
|
||||||
"inputValue18 = #{inputValue18}, " +
|
|
||||||
"inputValue19 = #{inputValue19}, " +
|
|
||||||
"inputValue20 = #{inputValue20}, " +
|
|
||||||
"inputValue21 = #{inputValue21}, " +
|
|
||||||
"inputValue22 = #{inputValue22}, " +
|
|
||||||
"inputValue23 = #{inputValue23}, " +
|
|
||||||
"inputValue100 = #{inputValue100}, " +
|
|
||||||
"inputValue101 = #{inputValue101}, " +
|
|
||||||
"inputValue102 = #{inputValue102}, " +
|
|
||||||
"reply = #{reply} " +
|
|
||||||
"WHERE id = #{id}")
|
|
||||||
void update(Integer id,Report report);
|
|
||||||
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.mapper;
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.pojo.User;
|
|
||||||
import org.apache.ibatis.annotations.Insert;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface UserMapper {
|
|
||||||
|
|
||||||
@Select("select * from users where username = #{username}")
|
|
||||||
User findByUsername(String username);
|
|
||||||
|
|
||||||
|
|
||||||
@Insert("INSERT INTO users (username, password, create_time, update_time) " +
|
|
||||||
"VALUES (#{username}, #{md5Password}, NOW(), NOW())")
|
|
||||||
void register(String username, String md5Password);
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.pojo;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class Image {
|
|
||||||
private Integer id; //图片id
|
|
||||||
private String image; //图片url
|
|
||||||
private String link; //图片跳转链接
|
|
||||||
private String content; //图片文本
|
|
||||||
@JsonIgnore
|
|
||||||
private String category; //图片类别,图片用在什么地方
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.pojo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class Report {
|
|
||||||
private Integer id;
|
|
||||||
private String username;
|
|
||||||
private String name;
|
|
||||||
private String selectedTime;
|
|
||||||
private String selectedDate;
|
|
||||||
private String license;
|
|
||||||
private String acftType;
|
|
||||||
private String fixstage;
|
|
||||||
private String fixcheck;
|
|
||||||
private String aarcstatus;
|
|
||||||
private String phase;
|
|
||||||
private String wether;
|
|
||||||
private String lightCondition;
|
|
||||||
private String carone;
|
|
||||||
private String cartwo;
|
|
||||||
private String workPosition;
|
|
||||||
private String task;
|
|
||||||
private String plan;
|
|
||||||
private String ats;
|
|
||||||
private String atc;
|
|
||||||
private String tcas;
|
|
||||||
private String advise;
|
|
||||||
private String involve;
|
|
||||||
private String tudentType;
|
|
||||||
private String acft0Type;
|
|
||||||
private String task0;
|
|
||||||
private String plan0;
|
|
||||||
private String phase0;
|
|
||||||
private String wether0;
|
|
||||||
private String lightCondition0;
|
|
||||||
private String ats0;
|
|
||||||
private String atc0;
|
|
||||||
private String tcas0;
|
|
||||||
private String advise0;
|
|
||||||
private String inputValue1;
|
|
||||||
private String inputValue2;
|
|
||||||
private String inputValue3;
|
|
||||||
private String inputValue4;
|
|
||||||
private String inputValue5;
|
|
||||||
private String inputValue6;
|
|
||||||
private String inputValue7;
|
|
||||||
private String inputValue8;
|
|
||||||
private String inputValue9;
|
|
||||||
private String inputValue10;
|
|
||||||
private String inputValue11;
|
|
||||||
private String inputValue12;
|
|
||||||
private String inputValue13;
|
|
||||||
private String inputValue14;
|
|
||||||
private String inputValue15;
|
|
||||||
private String inputValue16;
|
|
||||||
private String inputValue17;
|
|
||||||
private String inputValue18;
|
|
||||||
private String inputValue19;
|
|
||||||
private String inputValue20;
|
|
||||||
private String inputValue21;
|
|
||||||
private String inputValue22;
|
|
||||||
private String inputValue23;
|
|
||||||
private String inputValue100;
|
|
||||||
private String inputValue101;
|
|
||||||
private String inputValue102;
|
|
||||||
private String reply;
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.pojo;
|
|
||||||
|
|
||||||
|
|
||||||
//统一响应结果
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Data
|
|
||||||
public class Result<T> {
|
|
||||||
private Integer code;//业务状态码 0-成功 1-失败
|
|
||||||
private String message;//提示信息
|
|
||||||
private T data;//响应数据
|
|
||||||
|
|
||||||
//快速返回操作成功响应结果(带响应数据)
|
|
||||||
public static <E> Result<E> success(E data) {
|
|
||||||
return new Result<>(0, "操作成功", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//快速返回操作成功响应结果
|
|
||||||
public static Result success() {
|
|
||||||
return new Result(0, "操作成功", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Result error(String message) {
|
|
||||||
return new Result(1, message, null);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.pojo;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class User {
|
|
||||||
private Integer id;//主键ID
|
|
||||||
private String username;//用户名
|
|
||||||
@JsonIgnore
|
|
||||||
private String password;//密码
|
|
||||||
private Integer permissions;
|
|
||||||
private LocalDateTime createTime;//创建时间
|
|
||||||
private LocalDateTime updateTime;//更新时间
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.service;
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.pojo.Report;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public interface ReportService {
|
|
||||||
|
|
||||||
void add(Report form);
|
|
||||||
|
|
||||||
ArrayList<Report> list(String name);
|
|
||||||
ArrayList<Report> list();
|
|
||||||
|
|
||||||
Report findByID(Integer id);
|
|
||||||
|
|
||||||
void reply(Integer id, String reply);
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.service;
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.pojo.User;
|
|
||||||
|
|
||||||
public interface UserService {
|
|
||||||
|
|
||||||
User findByUsername(String username);
|
|
||||||
|
|
||||||
void register(String username, String password);
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
package com.sa.unsafeincidents.service.impl;
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.mapper.ReportMapper;
|
|
||||||
|
|
||||||
import com.sa.unsafeincidents.pojo.Report;
|
|
||||||
import com.sa.unsafeincidents.service.ReportService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ReportServiceImpl implements ReportService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
ReportMapper reportMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void add(Report form) {
|
|
||||||
reportMapper.add(form);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ArrayList<Report> list(String name){
|
|
||||||
return reportMapper.findByName(name);
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ArrayList<Report> list(){
|
|
||||||
return reportMapper.list();
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Report findByID(Integer id) {
|
|
||||||
return reportMapper.findByID(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void reply(Integer id,String reply) {
|
|
||||||
Report report = reportMapper.findByID(id);
|
|
||||||
report.setReply(reply);
|
|
||||||
reportMapper.update(id, report);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|