Compare commits
3 Commits
76be37f361
...
41b5d50cd4
| Author | SHA1 | Date | |
|---|---|---|---|
| 41b5d50cd4 | |||
| ced281252b | |||
| 878101ceb3 |
@ -176,7 +176,9 @@ const install = (Vue, vm) => {
|
||||
getStationListByStatus: (params = {}) =>
|
||||
vm.$u.post(config.adminPath + "/business/station/findListByStationStatus ", params),
|
||||
getStationPostionData: (params = {}) =>
|
||||
vm.$u.post(config.adminPath + "/business/dynamicConfig/pointListData", params)
|
||||
vm.$u.post(config.adminPath + "/business/dynamicConfig/pointListData", params),
|
||||
getStationPostionSn: (params = {}) =>
|
||||
vm.$u.post(config.adminPath + "/business/point/getSN", params)
|
||||
},
|
||||
|
||||
//设备
|
||||
|
||||
@ -271,6 +271,7 @@ export default {
|
||||
cancel: 'الغاء',
|
||||
messageDetail: 'تفاصيل الرسالة',
|
||||
operateSuccess: 'نجح العملية',
|
||||
operateFail: 'فشل العملية',
|
||||
messageReaded: 'تمت قراءة هذه الرسالة، لا داعي لتكرار الإجراء'
|
||||
},
|
||||
device: {
|
||||
@ -469,56 +470,57 @@ export default {
|
||||
second: 'ثانية'
|
||||
},
|
||||
policy: {
|
||||
planCurve: 'منحنى الجدول الزمني',
|
||||
planCurveTem: 'قالب منحنى الجدول الزمني',
|
||||
IssueDevice: 'جهاز إصدار الأوامر',
|
||||
operateOrNot: 'سواء في التشغيل',
|
||||
socUplimit: 'الحد الأعلى لـ SOC',
|
||||
socDownlimit: 'الحد الأدنى لـ SOC',
|
||||
effectiveTime: 'وقت السريان',
|
||||
selectEffectiveTime: 'يرجى تحديد وقت السريان',
|
||||
distributeResult: 'نتيجة الإصدار',
|
||||
notDelivered: 'لم يتم الإصدار',
|
||||
commandDistribution: 'إصدار الأوامر',
|
||||
controlDistribution: 'إصدار التحكم',
|
||||
genSetting: 'الإعدادات العامة',
|
||||
save: 'حفظ',
|
||||
pleaseInputValue: 'يرجى إدخال القيمة',
|
||||
pleaseInputPassword: 'يرجى إدخال كلمة المرور',
|
||||
password: 'كلمة المرور',
|
||||
policyTypeList: [
|
||||
{
|
||||
name: 'إصدار الأوامر'
|
||||
},
|
||||
{
|
||||
name: 'الإعدادات العامة'
|
||||
}
|
||||
],
|
||||
radioList: [
|
||||
{
|
||||
name: 'تشغيل',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: 'عدم تشغيل',
|
||||
disabled: false
|
||||
}
|
||||
],
|
||||
selectIssueDevice: 'يرجى تحديد جهاز إصدار الأوامر',
|
||||
deliverErrorNewTip: 'خطأ في تكوين التعيين أو لم يتم التكوين، يرجى التحقق وإعادة المحاولة!',
|
||||
passwordSuccess: 'كلمة المرور صحيحة',
|
||||
passwordError: 'كلمة المرور غير صحيحة',
|
||||
isOpen: 'سواء تمكين',
|
||||
isClose: 'سواء تعطيل',
|
||||
distributeSuccess: 'نجح الإصدار',
|
||||
distributeFail: 'فشل الإصدار',
|
||||
isNum: 'يرجى التحقق من أن قيمة الإدخال رقمية',
|
||||
saveSuccess: 'نجح الحفظ',
|
||||
saveError: 'فشل الحفظ',
|
||||
delivered: 'اكتمل الإصدار',
|
||||
selectPlanCurveTem: 'يرجى تحديد قالب منحنى الجدول الزمني',
|
||||
deliverErrorTip: 'تجاوز طاقة الشحن والتفريغ الطاقة المقدرة، يرجى التحقق من إعدادات منحنى الجدول الزمني!',
|
||||
deliverTip: 'سواء تأكيد إصدار الأمر?'
|
||||
planCurve: 'منحنى الجدول الزمني',
|
||||
planCurveTem: 'قالب منحنى الجدول الزمني',
|
||||
IssueDevice: 'جهاز إصدار الأوامر',
|
||||
operateOrNot: 'سواء في التشغيل',
|
||||
socUplimit: 'الحد الأعلى لـ SOC',
|
||||
socDownlimit: 'الحد الأدنى لـ SOC',
|
||||
effectiveTime: 'وقت السريان',
|
||||
selectEffectiveTime: 'يرجى تحديد وقت السريان',
|
||||
distributeResult: 'نتيجة الإصدار',
|
||||
notDelivered: 'لم يتم الإصدار',
|
||||
commandDistribution: 'إصدار الأوامر',
|
||||
controlDistribution: 'إصدار التحكم',
|
||||
genSetting: 'الإعدادات العامة',
|
||||
save: 'حفظ',
|
||||
pleaseInputValue: 'يرجى إدخال القيمة',
|
||||
pleaseInputPassword: 'يرجى إدخال كلمة المرور',
|
||||
password: 'كلمة المرور',
|
||||
policyTypeList: [
|
||||
{
|
||||
name: 'إصدار الأوامر'
|
||||
},
|
||||
{
|
||||
name: 'الإعدادات العامة'
|
||||
}
|
||||
],
|
||||
radioList: [
|
||||
{
|
||||
name: 'تشغيل',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: 'عدم تشغيل',
|
||||
disabled: false
|
||||
}
|
||||
],
|
||||
selectIssueDevice: 'يرجى تحديد جهاز إصدار الأوامر',
|
||||
deliverErrorNewTip: 'خطأ في تكوين التعيين أو لم يتم التكوين، يرجى التحقق وإعادة المحاولة!',
|
||||
passwordSuccess: 'كلمة المرور صحيحة',
|
||||
passwordError: 'كلمة المرور غير صحيحة',
|
||||
isOpen: 'سواء تمكين',
|
||||
isClose: 'سواء تعطيل',
|
||||
distributeSuccess: 'نجح الإصدار',
|
||||
distributeFail: 'فشل الإصدار',
|
||||
isNum: 'يرجى التحقق من أن قيمة الإدخال رقمية',
|
||||
saveSuccess: 'نجح الحفظ',
|
||||
saveError: 'فشل الحفظ',
|
||||
delivered: 'اكتمل الإصدار',
|
||||
selectPlanCurveTem: 'يرجى تحديد قالب منحنى الجدول الزمني',
|
||||
deliverErrorTip: 'تجاوز طاقة الشحن والتفريغ الطاقة المقدرة، يرجى التحقق من إعدادات منحنى الجدول الزمني!',
|
||||
deliverTip: 'سواء تأكيد إصدار الأمر?',
|
||||
policyTitle: 'إصدار الاستراتيجية'
|
||||
}
|
||||
|
||||
}
|
||||
@ -272,6 +272,7 @@ export default {
|
||||
cancel: 'Abbrechen',
|
||||
messageDetail: 'Nachrichtendetails',
|
||||
operateSuccess: 'Aktion erfolgreich',
|
||||
operateFail: 'Aktion fehlgeschlagen',
|
||||
messageReaded: 'Diese Nachricht wurde bereits gelesen, keine Wiederholung der Aktion erforderlich'
|
||||
},
|
||||
device: {
|
||||
@ -506,55 +507,56 @@ export default {
|
||||
confirmTime: 'Bestätigungszeit'
|
||||
},
|
||||
policy: {
|
||||
planCurve: 'Plan-Kurve',
|
||||
planCurveTem: 'Plan-Kurvenvorlage',
|
||||
IssueDevice: 'Befehlszielgerät',
|
||||
operateOrNot: 'In Betrieb',
|
||||
socUplimit: 'SOC-Obergrenze',
|
||||
socDownlimit: 'SOC-Untergrenze',
|
||||
effectiveTime: 'Gültigkeitszeit',
|
||||
selectEffectiveTime: 'Bitte wählen Sie die Gültigkeitszeit',
|
||||
distributeResult: 'Übertragungsergebnis',
|
||||
notDelivered: 'Nicht übertragen',
|
||||
commandDistribution: 'Befehlssendung',
|
||||
controlDistribution: 'Steuerungssendung',
|
||||
genSetting: 'Allgemeine Einstellungen',
|
||||
save: 'Speichern',
|
||||
pleaseInputValue: 'Bitte Wert eingeben',
|
||||
pleaseInputPassword: 'Bitte geben Sie Ihr Passwort ein',
|
||||
password: 'Passwort',
|
||||
policyTypeList: [
|
||||
{
|
||||
name: 'Befehlssendung'
|
||||
},
|
||||
{
|
||||
name: 'Allgemeine Einstellungen'
|
||||
}
|
||||
],
|
||||
radioList: [
|
||||
{
|
||||
name: 'In Betrieb',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: 'Außer Betrieb',
|
||||
disabled: false
|
||||
}
|
||||
],
|
||||
selectIssueDevice: 'Bitte wählen Sie das Befehlssendegerät',
|
||||
deliverErrorNewTip: 'Zuordnungskonfiguration fehlerhaft oder nicht konfiguriert, bitte überprüfen und erneut versuchen!',
|
||||
passwordSuccess: 'Passwort korrekt',
|
||||
passwordError: 'Passwort falsch',
|
||||
isOpen: 'Aktivieren',
|
||||
isClose: 'Deaktivieren',
|
||||
distributeSuccess: 'Sendung erfolgreich',
|
||||
distributeFail: 'Sendung fehlgeschlagen',
|
||||
isNum: 'Bitte überprüfen Sie, ob der eingegebene Wert eine Zahl ist',
|
||||
saveSuccess: 'Speichern erfolgreich',
|
||||
saveError: 'Speichern fehlgeschlagen',
|
||||
delivered: 'Bereits gesendet',
|
||||
selectPlanCurveTem: 'Bitte wählen Sie eine Plan-Kurvenvorlage',
|
||||
deliverErrorTip: 'Lade-/Entladeleistung größer als Nennleistung, bitte überprüfen Sie die Plan-Kurven-Einstellungen!',
|
||||
deliverTip: 'Befehlssendung wirklich bestätigen?'
|
||||
planCurve: 'Plan-Kurve',
|
||||
planCurveTem: 'Plan-Kurvenvorlage',
|
||||
IssueDevice: 'Befehlszielgerät',
|
||||
operateOrNot: 'In Betrieb',
|
||||
socUplimit: 'SOC-Obergrenze',
|
||||
socDownlimit: 'SOC-Untergrenze',
|
||||
effectiveTime: 'Gültigkeitszeit',
|
||||
selectEffectiveTime: 'Bitte wählen Sie die Gültigkeitszeit',
|
||||
distributeResult: 'Übertragungsergebnis',
|
||||
notDelivered: 'Nicht übertragen',
|
||||
commandDistribution: 'Befehlssendung',
|
||||
controlDistribution: 'Steuerungssendung',
|
||||
genSetting: 'Allgemeine Einstellungen',
|
||||
save: 'Speichern',
|
||||
pleaseInputValue: 'Bitte Wert eingeben',
|
||||
pleaseInputPassword: 'Bitte geben Sie Ihr Passwort ein',
|
||||
password: 'Passwort',
|
||||
policyTypeList: [
|
||||
{
|
||||
name: 'Befehlssendung'
|
||||
},
|
||||
{
|
||||
name: 'Allgemeine Einstellungen'
|
||||
}
|
||||
],
|
||||
radioList: [
|
||||
{
|
||||
name: 'In Betrieb',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: 'Außer Betrieb',
|
||||
disabled: false
|
||||
}
|
||||
],
|
||||
selectIssueDevice: 'Bitte wählen Sie das Befehlssendegerät',
|
||||
deliverErrorNewTip: 'Zuordnungskonfiguration fehlerhaft oder nicht konfiguriert, bitte überprüfen und erneut versuchen!',
|
||||
passwordSuccess: 'Passwort korrekt',
|
||||
passwordError: 'Passwort falsch',
|
||||
isOpen: 'Aktivieren',
|
||||
isClose: 'Deaktivieren',
|
||||
distributeSuccess: 'Sendung erfolgreich',
|
||||
distributeFail: 'Sendung fehlgeschlagen',
|
||||
isNum: 'Bitte überprüfen Sie, ob der eingegebene Wert eine Zahl ist',
|
||||
saveSuccess: 'Speichern erfolgreich',
|
||||
saveError: 'Speichern fehlgeschlagen',
|
||||
delivered: 'Bereits gesendet',
|
||||
selectPlanCurveTem: 'Bitte wählen Sie eine Plan-Kurvenvorlage',
|
||||
deliverErrorTip: 'Lade-/Entladeleistung größer als Nennleistung, bitte überprüfen Sie die Plan-Kurven-Einstellungen!',
|
||||
deliverTip: 'Befehlssendung wirklich bestätigen?',
|
||||
policyTitle: 'Strategieübertragung'
|
||||
}
|
||||
};
|
||||
@ -257,6 +257,7 @@ export default {
|
||||
sureRead: 'Confirm as read',
|
||||
cancel: 'Cancel',
|
||||
operateSuccess: 'Operation successful',
|
||||
operateFail: 'Operation failed',
|
||||
messageReaded: 'This message has been read. No need to repeat the'
|
||||
},
|
||||
device: {
|
||||
@ -479,49 +480,50 @@ export default {
|
||||
confirmTime: 'Confirmation time'
|
||||
},
|
||||
policy: {
|
||||
planCurve: 'Planned curve',
|
||||
planCurveTem: 'Planned curve template',
|
||||
IssueDevice: 'Command issuance equipment',
|
||||
operateOrNot: 'Commission or not',
|
||||
socUplimit: 'SOC upper limit',
|
||||
socDownlimit: 'SOC lower limit',
|
||||
effectiveTime: 'Effective time',
|
||||
selectEffectiveTime: 'Please select effective time',
|
||||
distributeResult: 'Issuance result',
|
||||
notDelivered: 'Not issued',
|
||||
commandDistribution: 'Command issuance',
|
||||
controlDistribution: 'Control issuance',
|
||||
genSetting: 'General settings',
|
||||
save: 'Save',
|
||||
pleaseInputValue: 'Please enter value',
|
||||
pleaseInputPassword: 'Please enter password',
|
||||
password: 'Password',
|
||||
policyTypeList: [{
|
||||
name: 'Command Issuance'
|
||||
}, {
|
||||
name: 'General Settings'
|
||||
}],
|
||||
radioList: [{
|
||||
name: "In Operation",
|
||||
disabled: false
|
||||
}, {
|
||||
name: "Not In Operation",
|
||||
disabled: false
|
||||
}],
|
||||
selectIssueDevice: 'Please select command issuance equipment',
|
||||
deliverErrorNewTip: 'Mapping configuration error or not configured. Please confirm and try again!',
|
||||
passwordSuccess: 'Password correct',
|
||||
passwordError: 'Password incorrect',
|
||||
isOpen: 'Enable or not',
|
||||
isClose: 'Disable or not',
|
||||
distributeSuccess: 'Issuance successful',
|
||||
distributeFail: 'Issuance failed',
|
||||
isNum: 'Please check if the input value is a number',
|
||||
saveSuccess: 'Save successful',
|
||||
saveError: 'Save failed',
|
||||
delivered: 'Issued',
|
||||
selectPlanCurveTem: 'Please select planned curve template',
|
||||
deliverErrorTip: 'Charging/discharging power exceeds rated power. Please confirm the planned curve.',
|
||||
deliverTip: 'Confirm command issuance?'
|
||||
planCurve: 'Planned curve',
|
||||
planCurveTem: 'Planned curve template',
|
||||
IssueDevice: 'Command issuance equipment',
|
||||
operateOrNot: 'Commission or not',
|
||||
socUplimit: 'SOC upper limit',
|
||||
socDownlimit: 'SOC lower limit',
|
||||
effectiveTime: 'Effective time',
|
||||
selectEffectiveTime: 'Please select effective time',
|
||||
distributeResult: 'Issuance result',
|
||||
notDelivered: 'Not issued',
|
||||
commandDistribution: 'Command issuance',
|
||||
controlDistribution: 'Control issuance',
|
||||
genSetting: 'General settings',
|
||||
save: 'Save',
|
||||
pleaseInputValue: 'Please enter value',
|
||||
pleaseInputPassword: 'Please enter password',
|
||||
password: 'Password',
|
||||
policyTypeList: [{
|
||||
name: 'Command Issuance'
|
||||
}, {
|
||||
name: 'General Settings'
|
||||
}],
|
||||
radioList: [{
|
||||
name: "In Operation",
|
||||
disabled: false
|
||||
}, {
|
||||
name: "Not In Operation",
|
||||
disabled: false
|
||||
}],
|
||||
selectIssueDevice: 'Please select command issuance equipment',
|
||||
deliverErrorNewTip: 'Mapping configuration error or not configured. Please confirm and try again!',
|
||||
passwordSuccess: 'Password correct',
|
||||
passwordError: 'Password incorrect',
|
||||
isOpen: 'Enable or not',
|
||||
isClose: 'Disable or not',
|
||||
distributeSuccess: 'Issuance successful',
|
||||
distributeFail: 'Issuance failed',
|
||||
isNum: 'Please check if the input value is a number',
|
||||
saveSuccess: 'Save successful',
|
||||
saveError: 'Save failed',
|
||||
delivered: 'Issued',
|
||||
selectPlanCurveTem: 'Please select planned curve template',
|
||||
deliverErrorTip: 'Charging/discharging power exceeds rated power. Please confirm the planned curve.',
|
||||
deliverTip: 'Confirm command issuance?',
|
||||
policyTitle: 'Strategy Issuance'
|
||||
}
|
||||
}
|
||||
@ -257,6 +257,7 @@ export default {
|
||||
sureRead: 'Confirmar como leído',
|
||||
cancel: 'Cancelar',
|
||||
operateSuccess: 'Operación realizada con éxito',
|
||||
operateFail: 'Operación fallida',
|
||||
messageReaded: 'Este mensaje ya fue leído; no es necesario repetir la operación'
|
||||
},
|
||||
device: {
|
||||
@ -479,6 +480,7 @@ export default {
|
||||
confirmTime: 'Hora de confirmación'
|
||||
},
|
||||
policy: {
|
||||
policyTitle: 'Estrategia de envío',
|
||||
planCurve: 'Curva planificada',
|
||||
planCurveTem: 'Plantilla de curva planificada',
|
||||
IssueDevice: 'Equipo para emitir el comando',
|
||||
|
||||
@ -257,6 +257,7 @@ export default {
|
||||
sureRead: 'Confirmer la lecture',
|
||||
cancel: 'Annuler',
|
||||
operateSuccess: 'Opération réussie',
|
||||
operateFail: 'Opération échouée',
|
||||
messageReaded: "La lecture du message a été effectuée. Aucune répétition n'est nécessaire !"
|
||||
},
|
||||
device: {
|
||||
@ -479,6 +480,7 @@ export default {
|
||||
confirmTime: 'Heure de confirmation'
|
||||
},
|
||||
policy: {
|
||||
policyTitle: 'Stratégie de distribution',
|
||||
planCurve: 'Courbe programmée',
|
||||
planCurveTem: 'Modèle de courbe programmée',
|
||||
IssueDevice: "Équipement cable d'envoi d'ordre",
|
||||
|
||||
@ -271,6 +271,7 @@ export default {
|
||||
cancel: 'Anuluj',
|
||||
messageDetail: 'Szczegóły wiadomości',
|
||||
operateSuccess: 'Operacja zakończona sukcesem',
|
||||
operateFail: 'Operacja nie powiodła się',
|
||||
messageReaded: 'Wiadomość została odczytana, nie ma potrzeby powtarzania akcji.'
|
||||
},
|
||||
device: {
|
||||
@ -505,6 +506,7 @@ export default {
|
||||
confirmTime: 'Czas potwierdzenia'
|
||||
},
|
||||
policy: {
|
||||
policyTitle: 'Strategia dystrybucji',
|
||||
planCurve: 'Krzywa planowania',
|
||||
planCurveTem: 'Szablon krzywej planowania',
|
||||
IssueDevice: 'Polecenie wydane urządzeniu',
|
||||
|
||||
@ -264,8 +264,9 @@ export default {
|
||||
sureRead: '确认已读',
|
||||
cancel: '取消',
|
||||
messageDetail: '消息详情',
|
||||
operateSuccess: '操作成功',
|
||||
messageReaded: '该消息已读,无需重复操作'
|
||||
operateSuccess: '操作成功',
|
||||
operateFail: '操作失败',
|
||||
messageReaded: '该消息已读,无需重复操作'
|
||||
},
|
||||
device: {
|
||||
inputNameQuery: '输入名称搜索',
|
||||
@ -549,5 +550,6 @@ export default {
|
||||
selectPlanCurveTem: '请选择计划曲线模板',
|
||||
deliverErrorTip: '充放电功率大于额定功率,请确认计划曲线设置!',
|
||||
deliverTip: '是否确定下发命令?',
|
||||
policyTitle: '策略下发',
|
||||
}
|
||||
};
|
||||
4
main.js
4
main.js
@ -6,7 +6,7 @@ Vue.config.productionTip = false
|
||||
|
||||
App.mpType = 'app'
|
||||
// 引入全局 uView 框架
|
||||
import uView from 'uview-ui'
|
||||
import uView from './uview-ui'
|
||||
Vue.use(uView)
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ let vuexStore = require('@/store/$u.mixin.js')
|
||||
Vue.mixin(vuexStore)
|
||||
|
||||
// 引入 uView 对小程序分享的 mixin 封装
|
||||
let mpShare = require('uview-ui/libs/mixin/mpShare.js')
|
||||
let mpShare = require('./uview-ui/libs/mixin/mpShare.js')
|
||||
Vue.mixin(mpShare)
|
||||
|
||||
// Vue i18n 国际化
|
||||
|
||||
@ -97,6 +97,7 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
@ -1,36 +1,40 @@
|
||||
<template>
|
||||
<view style="height: 100vh">
|
||||
<view class="">
|
||||
<u-navbar title="策略下发" :is-back="true" :background="background" :border-bottom="false"
|
||||
:custom-back="toback">
|
||||
<u-navbar :title="$t('homePage.policy.policyTitle')" :is-back="true" title-color="#FFF"
|
||||
:background="background" :border-bottom="false" :custom-back="toback">
|
||||
</u-navbar>
|
||||
</view>
|
||||
<view class="policeForm">
|
||||
<view class="" v-for="(item, index) in smallArr" :key="index">
|
||||
<view class="" v-if="item.type == 'Input'">
|
||||
<u-form-item :label="item[`label_${lang}`]" :prop="item.prop">
|
||||
<u-input :min="item.min" :max="item.max" v-model.number="item.value" type="number"
|
||||
:placeholder="item[`place_${lang}`]" @input="handleInput(item, $event)" />
|
||||
</u-form-item>
|
||||
<u-form ref="form" labelPosition="top">
|
||||
<view class="" v-for="(item, index) in smallArr" :key="index">
|
||||
<view class="" v-if="item.type == 'Input'">
|
||||
<u-form-item :label="item[`label_${lang}`]" :prop="item.prop">
|
||||
<u-input :key="'input_' + item.prop + '_' + item.inputKey" :min="item.min" :max="item.max"
|
||||
:value="item.value" type="number" :placeholder="item[`place_${lang}`]"
|
||||
@input="handleInput(item, $event)" />
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="" v-if="item.type == 'Switch'">
|
||||
<u-form-item :label="item[`label_${lang}`]" :prop="item.prop">
|
||||
<u-switch :size="40" v-model="item.value"></u-switch>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="" v-if="item.type == 'Select'" @click="selectShow(item, index)">
|
||||
<u-form-item :label="item[`label_${lang}`]" :prop="item.prop">
|
||||
<view class="" v-show="false">
|
||||
<u-input v-model="item.value" disabled @click="selectShow(item, index)" />
|
||||
</view>
|
||||
<view class="">
|
||||
{{ item.selectLabel || $t("homePage.alarm.placeSelect") }}
|
||||
</view>
|
||||
<u-select :key="item.prop" @confirm="confirm($event, item)" v-model="item.isShow"
|
||||
:list="getSelectList(item)"></u-select>
|
||||
</u-form-item>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="item.type == 'Switch'">
|
||||
<u-form-item :label="item[`label_${lang}`]" :prop="item.prop">
|
||||
<u-switch :size="40" v-model="item.value"></u-switch>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="" v-if="item.type == 'Select'" @click="selectShow(item, index)">
|
||||
<u-form-item :label="item[`label_${lang}`]" :prop="item.prop">
|
||||
<view class="" v-show="false">
|
||||
<u-input v-model="item.value" disabled @click="selectShow(item, index)" />
|
||||
</view>
|
||||
<view class="">
|
||||
{{ item.selectLabel || $t("homePage.alarm.placeSelect") }}
|
||||
</view>
|
||||
<u-select :key="item.prop" @confirm="confirm($event, item)" v-model="item.isShow"
|
||||
:list="getSelectList(item)"></u-select>
|
||||
</u-form-item>
|
||||
</view>
|
||||
</view>
|
||||
</u-form>
|
||||
|
||||
|
||||
<button @click="submitDevice" type="success" size="mini" style="
|
||||
background-color: #009458;
|
||||
@ -42,6 +46,7 @@
|
||||
{{ $t("homePage.mine.submit") }}
|
||||
</button>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -53,6 +58,7 @@
|
||||
Langlist
|
||||
} from "@/common/lang";
|
||||
import mqtt from "@/uni_modules/leliven-mqtt/index.js";
|
||||
import pako from "pako";
|
||||
export default {
|
||||
|
||||
data() {
|
||||
@ -61,7 +67,7 @@
|
||||
background: {
|
||||
backgroundColor: "#0EA17E",
|
||||
},
|
||||
lang: 'en',
|
||||
|
||||
mqttClient: null,
|
||||
backData: {},
|
||||
smallArr: [],
|
||||
@ -69,15 +75,17 @@
|
||||
username: 'admin', // 设置用户名
|
||||
password: 'zzkj@688737' // 设置密码
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getSn()
|
||||
},
|
||||
computed: {
|
||||
language() {
|
||||
return this.$store.state.vuex_language
|
||||
lang() {
|
||||
return Langlist.find(v => v.value == this.$store.state.vuex_language).prop || 'en'
|
||||
},
|
||||
currentStation() {
|
||||
console.log(this.vuex_currentStation)
|
||||
return this.vuex_currentStation;
|
||||
},
|
||||
},
|
||||
@ -87,31 +95,40 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
getSn(){
|
||||
this.$u.api.station.getStationPostionSn({
|
||||
stationId: this.currentStation.id
|
||||
}).then(res => {
|
||||
this.sn = res.data[0]?.sn
|
||||
})
|
||||
},
|
||||
initmqttClient() {
|
||||
console.log(this.lang)
|
||||
console.log(this.currentStation)
|
||||
// 初始化客户端连接地址
|
||||
// #ifdef H5
|
||||
let mqttClient = mqtt.connect('ws://13.39.200.14:8083/mqtt', {
|
||||
let mqttClient = mqtt.connect('ws://1.95.170.86:8083/mqtt', {
|
||||
...this.user
|
||||
})
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN||APP-PLUS
|
||||
let mqttClient = mqtt.connect('wx://13.39.200.14:8083/mqtt', {
|
||||
let mqttClient = mqtt.connect('wx://1.95.170.86:8083/mqtt', {
|
||||
...this.user
|
||||
})
|
||||
// #endif
|
||||
console.log(mqttClient,'888')
|
||||
this.mqttClient = mqttClient
|
||||
// 连接MQ服务
|
||||
mqttClient.on('connect', function(res) {
|
||||
console.log('连接成功')
|
||||
console.log(res)
|
||||
|
||||
|
||||
// 订阅主题
|
||||
mqttClient.subscribe('presence', function(err) {
|
||||
mqttClient.subscribe(`1/ems/${this.sn}/control/response`, (err) => {
|
||||
if (!err) {
|
||||
// 订阅成功
|
||||
mqttClient.publish('presence', 'hello mqtt')
|
||||
mqttClient.publish(`1/app/${this.sn}/control/request`, JSON.stringify({
|
||||
fun: 'GET',
|
||||
type: 'WJ_Get_NewControlSystem',
|
||||
content: 0
|
||||
}))
|
||||
}
|
||||
})
|
||||
}).on('reconnect', function() {
|
||||
@ -120,15 +137,28 @@
|
||||
console.log('连接失败')
|
||||
}).on('end', function() {
|
||||
console.log('连接End')
|
||||
}).on('message', function(topic, message) {
|
||||
// 收到MQ消息
|
||||
console.log(message.toString())
|
||||
}).on('message', (topic, message) => {
|
||||
console.log(this.decodeGzipBase64(message.toString()))
|
||||
let data = this.decodeGzipBase64(message.toString())
|
||||
if (data.content && data.content.params) {
|
||||
this.control(data.content)
|
||||
} else
|
||||
if (data.content == 1) {
|
||||
this.$refs.uToast.show({
|
||||
title: this.$t('homePage.mine.operateSuccess'),
|
||||
type: 'success',
|
||||
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$t('homePage.mine.operateFail'),
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
decodeGzipBase64(base64Str) {
|
||||
// 1. base64 → Uint8Array
|
||||
const binaryStr = atob(base64Str);
|
||||
@ -156,12 +186,16 @@
|
||||
return []
|
||||
},
|
||||
control(NewControlSystemShow_data) {
|
||||
console.log(NewControlSystemShow_data)
|
||||
this.formList.forEach(item => {
|
||||
if (item.type == "Switch") {
|
||||
item.value = NewControlSystemShow_data?.params[item.prop] ? true : false
|
||||
} else {
|
||||
}
|
||||
if (item.type == "Input") {
|
||||
|
||||
item.value = NewControlSystemShow_data?.params[item.prop] || item.default
|
||||
}
|
||||
|
||||
if (item.type == 'Select') {
|
||||
item.selectLabel = item.selectArr.find(v => v.value == item.value)?.[`label_${this.lang}`]
|
||||
}
|
||||
@ -177,10 +211,10 @@
|
||||
}
|
||||
item.isShow = false
|
||||
},
|
||||
handleInput(item, event) {
|
||||
handleInput(item, value) {
|
||||
try {
|
||||
let inputValue = event.detail.value;
|
||||
let iptval = String(inputValue).replace(/[^0-9.]/g, '');
|
||||
// u-input 组件 @input 事件直接传递 value 值,不是 event 对象
|
||||
let iptval = String(value || '').replace(/[^0-9.]/g, '');
|
||||
const parts = iptval.split('.');
|
||||
if (parts.length > 2) {
|
||||
iptval = parts[0] + '.' + parts.slice(1).join('');
|
||||
@ -190,14 +224,25 @@
|
||||
return;
|
||||
}
|
||||
let numVal = Number(iptval);
|
||||
if (item.min !== undefined && item.min !== null) {
|
||||
numVal = Math.max(numVal, item.min);
|
||||
}
|
||||
if (item.max !== undefined && item.max !== null) {
|
||||
numVal = Math.min(numVal, item.max);
|
||||
}
|
||||
numVal = isNaN(numVal) ? 0 : numVal;
|
||||
|
||||
// 检查是否需要强制更新(值被限制)
|
||||
let needForceUpdate = false;
|
||||
if (item.min !== undefined && item.min !== null && numVal < item.min) {
|
||||
numVal = item.min;
|
||||
needForceUpdate = true;
|
||||
}
|
||||
if (item.max !== undefined && item.max !== null && numVal > item.max) {
|
||||
numVal = item.max;
|
||||
needForceUpdate = true;
|
||||
}
|
||||
|
||||
item.value = numVal;
|
||||
|
||||
// 如果值被限制,强制重新渲染输入框
|
||||
if (needForceUpdate) {
|
||||
this.$set(item, 'inputKey', (item.inputKey || 0) + 1);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('handleInput方法错误:', error);
|
||||
}
|
||||
@ -215,8 +260,8 @@
|
||||
pre[cur.prop] = Number(pre[cur.prop])
|
||||
return pre
|
||||
}, {})
|
||||
console.log(this.mqttClient)
|
||||
this.mqttClient.publish('presence', JSON.stringify({
|
||||
|
||||
this.mqttClient.publish(`1/app/${this.sn}/control/request`, JSON.stringify({
|
||||
fun: 'SET',
|
||||
type: 'WJ_Set_NewControlSystem',
|
||||
content: {
|
||||
|
||||
@ -84,6 +84,8 @@
|
||||
|
||||
{{ $t('homePage.home.emsControl') }}
|
||||
</button>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -165,6 +167,7 @@
|
||||
return this.vuex_language
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
currentStation: {
|
||||
handler(val) {
|
||||
@ -282,12 +285,18 @@
|
||||
this.userId = this.vuex_user.userId
|
||||
},
|
||||
methods: {
|
||||
|
||||
toDeviceControl() {
|
||||
console.log(123)
|
||||
|
||||
uni.navigateTo({
|
||||
url:'/pages/home-page/policy-Config/index'
|
||||
})
|
||||
},
|
||||
toStrategy(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/home-page/strategy/index'
|
||||
})
|
||||
},
|
||||
confirmTime(val) {
|
||||
this.formInfo.effectiveTime = val.hour + ':' + val.minute
|
||||
this.formInfo.planRefreshH = val.hour
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import config from '@/common/config.js';
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
@ -6,20 +5,22 @@ Vue.use(Vuex)
|
||||
|
||||
let lifeData = {};
|
||||
|
||||
try{
|
||||
try {
|
||||
// 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
|
||||
lifeData = uni.getStorageSync('lifeData');
|
||||
}catch(e){
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
|
||||
let saveStateKeys = ['vuex_user', 'vuex_token', 'vuex_remember', 'vuex_locale','vuex_isAgent','vuex_language','vuex_stationValue'];
|
||||
let saveStateKeys = ['vuex_user', 'vuex_token', 'vuex_remember', 'vuex_locale', 'vuex_isAgent', 'vuex_language',
|
||||
'vuex_stationValue'
|
||||
];
|
||||
|
||||
// 保存变量到本地存储中
|
||||
const saveLifeData = function(key, value){
|
||||
const saveLifeData = function(key, value) {
|
||||
// 判断变量名是否在需要存储的数组中
|
||||
if(saveStateKeys.indexOf(key) != -1) {
|
||||
if (saveStateKeys.indexOf(key) != -1) {
|
||||
// 获取本地存储的lifeData对象,将变量添加到对象中
|
||||
let tmp = uni.getStorageSync('lifeData');
|
||||
// 第一次打开APP,不存在lifeData变量,故放一个{}空对象
|
||||
@ -49,47 +50,46 @@ const store = new Vuex.Store({
|
||||
vuex_isAgent: lifeData.vuex_isAgent ? lifeData.vuex_isAgent : '',
|
||||
vuex_iv: lifeData.vuex_iv ? lifeData.vuex_iv : '',
|
||||
vuex_psdkey: lifeData.vuex_psdkey ? lifeData.vuex_psdkey : '',
|
||||
vuex_StationShow:lifeData.vuex_StationShow ? lifeData.vuex_StationShow : [0,0,0],
|
||||
vuex_StationShow: lifeData.vuex_StationShow ? lifeData.vuex_StationShow : [0, 0, 0],
|
||||
tabbar_current: 0,
|
||||
vuex_stationValue:lifeData.vuex_stationValue ? lifeData.vuex_stationValue : '',
|
||||
vuex_inverterFlag:lifeData.vuex_inverterFlag ? lifeData.vuex_inverterFlag : 0,
|
||||
tabbarList: [
|
||||
{
|
||||
"icon": "warning",
|
||||
"text": "告警",
|
||||
'name': 'Alarm'
|
||||
},
|
||||
// {
|
||||
// "icon": "order",
|
||||
// "text": "设备",
|
||||
// 'name': 'Device'
|
||||
vuex_stationValue: lifeData.vuex_stationValue ? lifeData.vuex_stationValue : '',
|
||||
vuex_inverterFlag: lifeData.vuex_inverterFlag ? lifeData.vuex_inverterFlag : 0,
|
||||
tabbarList: [{
|
||||
"icon": "warning",
|
||||
"text": "告警",
|
||||
'name': 'Alarm'
|
||||
},
|
||||
// {
|
||||
// "icon": "order",
|
||||
// "text": "设备",
|
||||
// 'name': 'Device'
|
||||
|
||||
// },
|
||||
{
|
||||
"icon": "moments",
|
||||
"text": "数据",
|
||||
'name': 'Data'
|
||||
},
|
||||
{
|
||||
"icon": "attach",
|
||||
"text": "收益",
|
||||
'name': 'Earnings'
|
||||
},
|
||||
{
|
||||
"icon": "attach",
|
||||
"text": "策略",
|
||||
'name': 'Policy'
|
||||
},
|
||||
{
|
||||
"icon": "account",
|
||||
"text": "我的",
|
||||
'name': 'My'
|
||||
},
|
||||
// },
|
||||
{
|
||||
"icon": "moments",
|
||||
"text": "数据",
|
||||
'name': 'Data'
|
||||
},
|
||||
{
|
||||
"icon": "attach",
|
||||
"text": "收益",
|
||||
'name': 'Earnings'
|
||||
},
|
||||
{
|
||||
"icon": "attach",
|
||||
"text": "策略",
|
||||
'name': 'Policy'
|
||||
},
|
||||
{
|
||||
"icon": "account",
|
||||
"text": "我的",
|
||||
'name': 'My'
|
||||
},
|
||||
],
|
||||
vuex_language:"en_US",
|
||||
vuex_language: "en_US",
|
||||
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
|
||||
vuex_config: config,
|
||||
vuex_currentComponent:'Data'
|
||||
vuex_currentComponent: 'Data'
|
||||
},
|
||||
mutations: {
|
||||
$uStore(state, payload) {
|
||||
@ -97,9 +97,9 @@ const store = new Vuex.Store({
|
||||
let nameArr = payload.name.split('.');
|
||||
let saveKey = '';
|
||||
let len = nameArr.length;
|
||||
if(len >= 2) {
|
||||
if (len >= 2) {
|
||||
let obj = state[nameArr[0]];
|
||||
for(let i = 1; i < len - 1; i ++) {
|
||||
for (let i = 1; i < len - 1; i++) {
|
||||
obj = obj[nameArr[i]];
|
||||
}
|
||||
obj[nameArr[len - 1]] = payload.value;
|
||||
@ -115,4 +115,4 @@ const store = new Vuex.Store({
|
||||
}
|
||||
})
|
||||
|
||||
export default store
|
||||
export default store
|
||||
Reference in New Issue
Block a user