feat: 项目初始化
This commit is contained in:
176
src/api/device.ts
Normal file
176
src/api/device.ts
Normal file
@@ -0,0 +1,176 @@
|
||||
import httpService from '@/utils/request'
|
||||
import {useRootUserStore} from '@/store/index';
|
||||
/** 设备相关接口---------------------------------------- */
|
||||
const store:any = useRootUserStore();
|
||||
// 设备列表
|
||||
export function allDeviceList(params) {
|
||||
if(params){
|
||||
params.rootuserid = store.getRootUserId
|
||||
}
|
||||
return httpService.get(`/api/device/list_all_device`,{params})
|
||||
}
|
||||
// 设备详情
|
||||
export function deviceInfo(data){
|
||||
return httpService.post(`/api/device/one_device_info?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 解除绑定
|
||||
export function deviceUnbind(data){
|
||||
return httpService.post(`/api/device/break_pond?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 将设备及开关绑定到塘口
|
||||
export function bandDeviceToPond(data){
|
||||
return httpService.put(`/api/pond/select_device_switch?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 设备图表数据
|
||||
export function deviceHistory(data){
|
||||
return httpService.post(`/api/device/data_history?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 修改设备名称
|
||||
export function deviceUpdateName(data){
|
||||
return httpService.put(`/api/device/update_name?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 修改设备关联塘口
|
||||
export function deviceUpdatePond(data){
|
||||
return httpService.put(`/api/device/update_pond?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 修改设备接电方式
|
||||
export function deviceUpdateV(data){
|
||||
return httpService.put(`/api/device/update_voltage_type?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 删除设备
|
||||
export function deviceDel(data){
|
||||
return httpService.delete(`/api/device/delete?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 扫描设备编码
|
||||
export function deviceScan(params){
|
||||
if(params){
|
||||
params.rootuserid = store.getRootUserId
|
||||
}
|
||||
return httpService.get(`/api/device/check_device_qrcode`,{params})
|
||||
}
|
||||
// 检测设备是否在线
|
||||
export function checkDeviceStatus(params){
|
||||
if(params){
|
||||
params.rootuserid = store.getRootUserId
|
||||
}
|
||||
return httpService.get(`/api/device/check_device_status`,{params})
|
||||
}
|
||||
// 盐度设置
|
||||
export function setSal(data){
|
||||
return httpService.post(`/api/device/detector_salinitycompensation?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 设备校准
|
||||
export function deviceCalibration(data){
|
||||
return httpService.post(`/api/device/detector_calibrate?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
/** 水质检测仪------------------------------------------------ */
|
||||
// 添加-水质检测仪
|
||||
export function addDeviceDetector(data) {
|
||||
return httpService.post(`/api/device/add_device_detector?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 设置溶解氧/水温告警
|
||||
export function setWarnCall(data){
|
||||
return httpService.post(`/api/device/set_oxy_warn_call?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 设置溶解氧上下限
|
||||
export function setOxyWarn(data){
|
||||
return httpService.put(`/api/device/set_oxy_warn_value?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 设置温度上下限
|
||||
export function setTempWarn(data){
|
||||
return httpService.put(`/api/device/set_temp_warn_value?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 溶解氧饱和度
|
||||
export function getSaturability(data){
|
||||
return httpService.post(`/api/device/get_saturability?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
/** 控制一体机------------------------------------------------ */
|
||||
// 添加-控制一体机
|
||||
export function addDeviceController(data) {
|
||||
return httpService.post(`/api/device/add_device_controller?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 启停溶解氧
|
||||
export function setOxyOpen(data){
|
||||
return httpService.put(`/api/device/set_controller_oxy_open?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
/** 联动控制------------------------------------- */
|
||||
// 设备控制器列表
|
||||
export function linkerCtrlList(data){
|
||||
return httpService.post(`/api/linked-ctrl/fetch?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 添加联动控制
|
||||
export function addLinkerCtrl(data){
|
||||
return httpService.post(`/api/linked-ctrl/add?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 修改联动控制
|
||||
export function updateLinkerCtrl(data){
|
||||
return httpService.put(`/api/linked-ctrl/update?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 删除联动控制
|
||||
export function delLinkerCtrl(data){
|
||||
return httpService.delete(`/api/linked-ctrl/delete?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 设置联动控制上下限开关
|
||||
export function setLinkOpen(data){
|
||||
return httpService.put(`/api/linked-ctrl/set_open?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
/** 开关------------------------------------------------ */
|
||||
// 开关列表
|
||||
export function pondSwitchList(data){
|
||||
return httpService.post(`/api/device-switch/get_pond_switch?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 开关详情
|
||||
export function switchInfo(data){
|
||||
return httpService.post(`/api/device-switch/one_switch_info?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 修改开关名称
|
||||
export function updateSwitchName(data){
|
||||
return httpService.put(`/api/device-switch/update_name?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 修改关联塘口
|
||||
export function updateSwitchPond(data){
|
||||
return httpService.put(`/api/device-switch/update_pond?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 修改接线方式
|
||||
export function updateSwitchType(data){
|
||||
return httpService.put(`/api/device-switch/update_voltage_type?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 单个开关 启停
|
||||
export function turnSwitch(data){
|
||||
return httpService.put(`/api/device-switch/turn_switch?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 所有开关 启停
|
||||
export function turnPondSwitch(data){
|
||||
return httpService.put(`/api/device-switch/turn_pond_switch?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
|
||||
// 电压告警开关 开启或关闭
|
||||
export function voltageCheckOpen(data){
|
||||
return httpService.put(`/api/device/voltage_check_open?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 电流告警开关 开启或关闭
|
||||
export function electricCheckOpen(data){
|
||||
return httpService.put(`/api/device-switch/electric_check_open?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 电流告警开关 开启或关闭
|
||||
export function electricSet(data){
|
||||
return httpService.put(`/api/device-switch/electric_set?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
|
||||
// 定时开关列表
|
||||
export function timeCtrlList(data){
|
||||
return httpService.put(`/api/device-switch-time-ctrl/list?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
export function addTimeCtrl(data){
|
||||
return httpService.post(`/api/device-switch-time-ctrl/add?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
export function delTimeCtrl(data){
|
||||
return httpService.delete(`/api/device-switch-time-ctrl/delete?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
export function setTimeCtrlOpen(data){
|
||||
return httpService.post(`/api/device-switch-time-ctrl/update?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 夜间防误触
|
||||
export function setNightProtect(data){
|
||||
return httpService.put(`/api/pond/keep_night_open?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
23
src/api/home.ts
Normal file
23
src/api/home.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import httpService from '@/utils/request'
|
||||
import {useRootUserStore} from '@/store/index';
|
||||
const store:any = useRootUserStore();
|
||||
// 塘口模式1
|
||||
export function getPond1() {
|
||||
return httpService.get(`/api/pond/list_mode1?rootuserid=${store.getRootUserId}`)
|
||||
}
|
||||
// 塘口模式2
|
||||
export function getPond2(){
|
||||
return httpService.get(`/api/pond/list_mode2?rootuserid=${store.getRootUserId}`)
|
||||
}
|
||||
// 公告列表
|
||||
export function noticeList(){
|
||||
return httpService.get(`/api/sys-notice/notice_list?rootuserid=${store.getRootUserId}`)
|
||||
}
|
||||
// 即将到期设备列表
|
||||
export function deviceDead(){
|
||||
return httpService.get(`/api/device/list_device_dead?rootuserid=${store.getRootUserId}`)
|
||||
}
|
||||
// 获取设备票据
|
||||
export function getDeviceTicket(){
|
||||
return httpService.get(`/api/user-center/getsnticket`)
|
||||
}
|
||||
23
src/api/login.ts
Normal file
23
src/api/login.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import httpService from '@/utils/request'
|
||||
// 短信登录
|
||||
export function loginSms(phonenumber, code) {
|
||||
const data = {
|
||||
mobilePhone:phonenumber,
|
||||
smsCode:code,
|
||||
}
|
||||
return httpService.post(`/api/login/use_sms_code`, {
|
||||
data
|
||||
})
|
||||
}
|
||||
// 获取短信验证码
|
||||
export function smsCode(phonenumber) {
|
||||
return httpService.get(`/sms_code/request?mobilePhone=` + phonenumber)
|
||||
}
|
||||
// 微信手机号登录
|
||||
export function loginWxToPhone(data) {
|
||||
return httpService.post(`/api/login/use_wechat` , {data})
|
||||
}
|
||||
// 登出
|
||||
export function logoutFun() {
|
||||
return httpService.get(`/api/user-center/logout`)
|
||||
}
|
||||
23
src/api/msg.ts
Normal file
23
src/api/msg.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import httpService from '@/utils/request'
|
||||
import {useRootUserStore} from '@/store/index';
|
||||
const store:any = useRootUserStore();
|
||||
// 查询充值记录
|
||||
export function msgPay(data) {
|
||||
return httpService.post(`/api/message/page_pay?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 查询报警记录
|
||||
export function msgWarn(data) {
|
||||
return httpService.post(`/api/message/page_warn?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 查询开关记录
|
||||
export function msgSwitch(data) {
|
||||
return httpService.post(`/api/message/page_op_record?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 已读一条消息
|
||||
export function msgRead(data) {
|
||||
return httpService.put(`/api/message/read_one_warn?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 已读全部
|
||||
export function msgReadAll(data) {
|
||||
return httpService.put(`/api/message/read_all_warn?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
33
src/api/my.ts
Normal file
33
src/api/my.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import httpService from '@/utils/request'
|
||||
// 报警电话列表
|
||||
export function warnPhoneList() {
|
||||
return httpService.get(`/api/user-center/list_warn_phone`)
|
||||
}
|
||||
// 修改报警电话
|
||||
export function updateWarnPhone(data) {
|
||||
return httpService.put(`/api/user-center/update_warn_phone`,{data})
|
||||
}
|
||||
// 修改手机号码
|
||||
export function updatePhone(data) {
|
||||
return httpService.put(`/api/user-center/update_mobile_phone`,{data})
|
||||
}
|
||||
// 验证验证码
|
||||
export function verifyCode(params) {
|
||||
return httpService.post(`/sms_code/verify`,{params})
|
||||
}
|
||||
// 修改昵称
|
||||
export function updateNickName(data) {
|
||||
return httpService.put(`/api/user-center/update_user_name`,{data})
|
||||
}
|
||||
// 支付选项页面
|
||||
export function payOption() {
|
||||
return httpService.post(`/api/tenpay/get_pay_item`)
|
||||
}
|
||||
// 创建支付订单
|
||||
export function createOrder(data) {
|
||||
return httpService.post(`/api/tenpay/create_order`,{data})
|
||||
}
|
||||
// 微信支付
|
||||
export function wxPayOrder(data) {
|
||||
return httpService.post(`https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi`,{data})
|
||||
}
|
||||
27
src/api/pond.ts
Normal file
27
src/api/pond.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import httpService from '@/utils/request'
|
||||
import {useRootUserStore} from '@/store/index';
|
||||
const store:any = useRootUserStore();
|
||||
// 新增塘口
|
||||
export function PondAdd(data) {
|
||||
return httpService.post(`/api/pond/add?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 修改塘口
|
||||
export function PondUpdate(data){
|
||||
return httpService.put(`/api/pond/update?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 删除塘口
|
||||
export function PondDel(data){
|
||||
return httpService.delete(`/api/pond/delete?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 鱼类列表
|
||||
export function fishList(){
|
||||
return httpService.post(`/api/fish/get`)
|
||||
}
|
||||
// 塘口基本数据
|
||||
export function pondBaseInfo(data){
|
||||
return httpService.post(`/api/pond/base_info?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
// 塘口下设备信息
|
||||
export function pondDeviceInfo(data){
|
||||
return httpService.post(`/api/pond/pond_device_info?rootuserid=${store.getRootUserId}`,{data})
|
||||
}
|
||||
17
src/api/sub.ts
Normal file
17
src/api/sub.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import httpService from '@/utils/request'
|
||||
// 获取子账号列表
|
||||
export function list_user_child() {
|
||||
return httpService.get(`/api/user-center/list_user_child`)
|
||||
}
|
||||
// 添加
|
||||
export function add_user_child(data) {
|
||||
return httpService.post(`/api/user-center/add_user_child?mobilePhone=${data}`)
|
||||
}
|
||||
// 删除
|
||||
export function delete_user_child(data) {
|
||||
return httpService.delete(`/api/user-center/delete_user_child`,{data})
|
||||
}
|
||||
// 获取父级账号
|
||||
export function list_user_parent() {
|
||||
return httpService.get(`/api/user-center/list_user_parent`)
|
||||
}
|
||||
Reference in New Issue
Block a user