代码提交

This commit is contained in:
pengqiao1993
2026-03-09 15:02:49 +08:00
parent 4c3039ade7
commit 2c826c767d
15 changed files with 3019 additions and 824 deletions

1843
common/form.js Normal file

File diff suppressed because it is too large Load Diff

47
common/lang.js Normal file
View File

@ -0,0 +1,47 @@
export const Langlist = [{
label: '中文',
value: 'zh',
disabled: false,
prop: 'zh_CN'
},
{
label: 'English',
value: 'en',
disabled: false,
prop: 'en_US'
},
{
label: 'German',
value: 'gr',
disabled: false,
prop: 'de_DE'
},
{
label: 'French',
value: 'fr',
disabled: false,
prop: 'fr_FR'
},
{
label: 'Arabic',
value: 'al',
disabled: false,
prop: 'ar_EG'
},
{
label: 'Spanish',
value: 'es',
disabled: false,
prop: 'es_ES'
},
{
label: 'Polish',
value: 'bl',
disabled: false,
prop: 'pl_PL'
}
]

View File

@ -29,6 +29,7 @@ export default {
quit: 'غير موافق', quit: 'غير موافق',
guestLogin: 'تسجيل دخول الضيف', guestLogin: 'تسجيل دخول الضيف',
checkFirst: 'يرجى أولاً وضع علامة للموافقة على اتفاقية المستخدم وسياسة الخصوصية', checkFirst: 'يرجى أولاً وضع علامة للموافقة على اتفاقية المستخدم وسياسة الخصوصية',
emsControl: 'تحكم EMS',
stationType: [ stationType: [
{ {
name: 'موقع الصين' name: 'موقع الصين'

View File

@ -9,6 +9,7 @@ export default {
loadAmmeter: 'Lastzähler', loadAmmeter: 'Lastzähler',
dieselGeneratorMeter: 'Dieselerzeugungszähler', dieselGeneratorMeter: 'Dieselerzeugungszähler',
energyStorageMeter: 'Energiespeicherzähler', energyStorageMeter: 'Energiespeicherzähler',
emsControl: 'EMS-Kontrolle',
alarmTypeList: [ alarmTypeList: [
{ {
name: 'Echtzeit-Alarm' name: 'Echtzeit-Alarm'

View File

@ -9,6 +9,7 @@ export default {
loadAmmeter: 'Load electric meter', loadAmmeter: 'Load electric meter',
dieselGeneratorMeter: 'Diesel generator electric meter', dieselGeneratorMeter: 'Diesel generator electric meter',
energyStorageMeter: 'Energy storage electric meter', energyStorageMeter: 'Energy storage electric meter',
emsControl: 'EMS Control',
alarmTypeList: [{ alarmTypeList: [{
name: 'Real-time alarms' name: 'Real-time alarms'
}, { }, {

View File

@ -9,6 +9,7 @@ export default {
loadAmmeter: 'Medidor de carga', loadAmmeter: 'Medidor de carga',
dieselGeneratorMeter: 'Medidor de generador diésel', dieselGeneratorMeter: 'Medidor de generador diésel',
energyStorageMeter: 'Medidor de almacenamiento de energía', energyStorageMeter: 'Medidor de almacenamiento de energía',
emsControl: 'Control Ems',
alarmTypeList: [{ alarmTypeList: [{
name: 'Alertas en tiempo real' name: 'Alertas en tiempo real'
}, { }, {

View File

@ -9,6 +9,7 @@ export default {
loadAmmeter: 'Compteur de charge', loadAmmeter: 'Compteur de charge',
dieselGeneratorMeter: 'Compteur de générateur diesel', dieselGeneratorMeter: 'Compteur de générateur diesel',
energyStorageMeter: "Compteur de stockage d'énergie", energyStorageMeter: "Compteur de stockage d'énergie",
emsControl: 'Contrôle EMS',
alarmTypeList: [{ alarmTypeList: [{
name: 'Alarmes en temps réel' name: 'Alarmes en temps réel'
}, { }, {

View File

@ -9,6 +9,7 @@ export default {
loadAmmeter: 'Miernik obciążenia', loadAmmeter: 'Miernik obciążenia',
dieselGeneratorMeter: 'Miernik energii z paliwa', dieselGeneratorMeter: 'Miernik energii z paliwa',
energyStorageMeter: 'Miernik energii akumulatora', energyStorageMeter: 'Miernik energii akumulatora',
emsControl: "Kontrola EMS",
alarmTypeList: [ alarmTypeList: [
{ {
name: 'Alarmy w czasie rzeczywistym' name: 'Alarmy w czasie rzeczywistym'

View File

@ -9,6 +9,7 @@ export default {
loadAmmeter: '负载电表', loadAmmeter: '负载电表',
dieselGeneratorMeter: '柴发电表', dieselGeneratorMeter: '柴发电表',
energyStorageMeter: '储能电表', energyStorageMeter: '储能电表',
emsControl: 'EMS控制',
alarmTypeList: [{ alarmTypeList: [{
name: '实时告警' name: '实时告警'
}, { }, {

40
package-lock.json generated
View File

@ -12,7 +12,8 @@
"@dcloudio/uni-helper-json": "^1.0.13", "@dcloudio/uni-helper-json": "^1.0.13",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"image-tools": "^1.4.0", "image-tools": "^1.4.0",
"jsencrypt": "^3.3.2" "jsencrypt": "^3.3.2",
"pako": "^2.1.0"
}, },
"devDependencies": { "devDependencies": {
"compression-webpack-plugin": "^6.1.1", "compression-webpack-plugin": "^6.1.1",
@ -615,6 +616,16 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/bindings": {
"version": "1.5.0",
"resolved": "https://registry.npmmirror.com/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
"dev": true,
"optional": true,
"dependencies": {
"file-uri-to-path": "1.0.0"
}
},
"node_modules/bluebird": { "node_modules/bluebird": {
"version": "3.7.2", "version": "3.7.2",
"resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz", "resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz",
@ -763,6 +774,12 @@
"pako": "~1.0.5" "pako": "~1.0.5"
} }
}, },
"node_modules/browserify-zlib/node_modules/pako": {
"version": "1.0.11",
"resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz",
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
"dev": true
},
"node_modules/buffer": { "node_modules/buffer": {
"version": "4.9.2", "version": "4.9.2",
"resolved": "https://registry.npmmirror.com/buffer/-/buffer-4.9.2.tgz", "resolved": "https://registry.npmmirror.com/buffer/-/buffer-4.9.2.tgz",
@ -1835,6 +1852,13 @@
"deprecated": "This module is no longer supported.", "deprecated": "This module is no longer supported.",
"dev": true "dev": true
}, },
"node_modules/file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
"dev": true,
"optional": true
},
"node_modules/fill-range": { "node_modules/fill-range": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-4.0.0.tgz", "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-4.0.0.tgz",
@ -2832,6 +2856,13 @@
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"dev": true "dev": true
}, },
"node_modules/nan": {
"version": "2.25.0",
"resolved": "https://registry.npmmirror.com/nan/-/nan-2.25.0.tgz",
"integrity": "sha512-0M90Ag7Xn5KMLLZ7zliPWP3rT90P6PN+IzVFS0VqmnPktBk3700xUVv8Ikm9EUaUE5SDWdp/BIxdENzVznpm1g==",
"dev": true,
"optional": true
},
"node_modules/nanomatch": { "node_modules/nanomatch": {
"version": "1.2.13", "version": "1.2.13",
"resolved": "https://registry.npmmirror.com/nanomatch/-/nanomatch-1.2.13.tgz", "resolved": "https://registry.npmmirror.com/nanomatch/-/nanomatch-1.2.13.tgz",
@ -3072,10 +3103,9 @@
} }
}, },
"node_modules/pako": { "node_modules/pako": {
"version": "1.0.11", "version": "2.1.0",
"resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz", "resolved": "https://registry.npmmirror.com/pako/-/pako-2.1.0.tgz",
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug=="
"dev": true
}, },
"node_modules/parallel-transform": { "node_modules/parallel-transform": {
"version": "1.2.0", "version": "1.2.0",

View File

@ -18,7 +18,8 @@
"@dcloudio/uni-helper-json": "^1.0.13", "@dcloudio/uni-helper-json": "^1.0.13",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"image-tools": "^1.4.0", "image-tools": "^1.4.0",
"jsencrypt": "^3.3.2" "jsencrypt": "^3.3.2",
"pako": "^2.1.0"
}, },
"devDependencies": { "devDependencies": {
"compression-webpack-plugin": "^6.1.1", "compression-webpack-plugin": "^6.1.1",

View File

@ -88,6 +88,14 @@
{ {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path" : "policy-Config/index",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
} }
] ]
}, },

View File

@ -0,0 +1,268 @@
<template>
<view style="height: 100vh">
<view class="">
<u-navbar
title="策略下发"
:is-back="true"
: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>
</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)"
/>
<div></div>
</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>
<button
@click="submitDevice"
type="success"
size="mini"
style="
background-color: #009458;
padding: 10rpx 0;
color: #fff;
margin-top: 40rpx;
width: 100%;
"
>
{{ $t("homePage.mine.submit") }}
</button>
</view>
</view>
</template>
<script>
import {
formList
} from '@/common/form.js'
import {
Langlist
} from '@/common/lang'
import pako from 'pako'
export default {
data() {
return {
formList: formList,
background: {
backgroundColor: "#0EA17E",
},
lang: 'en',
socketTask: null,
backData: {},
smallArr: [],
}
},
computed: {
language() {
return this.vuex_language
}
},
watch: {
language: {
handler(val) {
console.log(val)
this.lang = Langlist.find(v => v.prop == val).value
console.log(this.lang)
},
immediate: true,
deep: true,
},
},
onShow() {
if (!this.socketTask) {
this.init()
}
this.send({
fun: 'GET',
type: 'WJ_Get_NewControlSystem',
content: 0
})
this.socketTask.onMessage(res => {
let dataZip = this.decodeGzipBase64(res.data)
if (dataZip.type == 'WJ_Get_NewControlSystem') {
this.control(dataZip.content)
}
})
},
beforeDestroy() {
this.socketTask = null
},
methods: {
decodeGzipBase64(base64Str) {
// 1. base64 → Uint8Array
const binaryStr = atob(base64Str);
const len = binaryStr.length;
const bytes = new Uint8Array(len);
for (let i = 0; i < len; i++) {
bytes[i] = binaryStr.charCodeAt(i);
}
// 2. gunzip 解压
const decompressed = pako.ungzip(bytes, {
to: "string"
});
// 3. 转 JSON如果是 JSON
return JSON.parse(decompressed);
},
getSelectList(item) {
if (item.selectArr && item.selectArr.length > 0) {
return item.selectArr.map(option => ({
value: option.value.toString(),
label: option[`label_${this.lang}`] || option.label
}))
}
return []
},
control(NewControlSystemShow_data) {
this.formList.forEach(item => {
if (item.type == "Switch") {
item.value = NewControlSystemShow_data?.params[item.prop] ? true : false
} else {
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}`]
}
item.isShow = false
})
this.backData = NewControlSystemShow_data
this.smallArr = this.formList.filter(v => NewControlSystemShow_data?.smallScreen.includes(v.prop))
},
confirm(val, item) {
if (val && val.length > 0) {
item.value = val[0].value
item.selectLabel = val[0].label
}
item.isShow = false
},
handleInput(item, event) {
try {
let inputValue = event.detail.value;
let iptval = String(inputValue).replace(/[^0-9.]/g, '');
const parts = iptval.split('.');
if (parts.length > 2) {
iptval = parts[0] + '.' + parts.slice(1).join('');
}
if (!iptval || iptval === '.') {
item.value = 0;
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;
item.value = numVal;
} catch (error) {
console.log('handleInput方法错误:', error);
}
},
init() {
this.socketTask = uni.connectSocket({
url: "ws://192.168.1.136:9002", //仅为示例,并非真实接口地址。
// url: 'wss://remotec.zzkj-cloud.com/ws/',
complete: (res) => {
},
});
},
send(msg) {
if (this.socketTask) {
this.socketTask.send({
data: JSON.stringify(msg || {}),
complete: (res) => {
console.log('消息发送成功:', res)
}
})
} else {
console.log('socketTask未初始化')
this.init()
setTimeout(() => {
this.send(msg)
}, 500)
}
},
toback() {
uni.navigateBack()
},
selectShow(val, index) {
val.isShow = true
},
submitDevice() {
let smallParam = this.smallArr.reduce((pre, cur) => {
pre[cur.prop] = cur.type == "Switch" ? cur.value ? 1 : 0 : cur.value
pre[cur.prop] = Number(pre[cur.prop])
return pre
}, {})
this.send({
fun: 'SET',
type: 'WJ_Set_NewControlSystem',
content: {
...this.backData,
params: {
...this.backData.params,
...smallParam
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.policeForm {
margin: 22rpx;
padding: 22rpx;
background-color: #fff;
box-shadow: 0px 4rpx 16rpx rgba(0, 0, 0, 0.1);
border-radius: 8rpx;
}
</style>

View File

@ -23,26 +23,31 @@
<view v-if="!loading" class="detail-box"> <view v-if="!loading" class="detail-box">
<u-form :model="formInfo" ref="uForm" :label-width="200"> <u-form :model="formInfo" ref="uForm" :label-width="200">
<u-form-item :label="$t('homePage.policy.planCurveTem')"><u-input :placeholder="$t('homePage.policy.selectPlanCurveTem')" v-model="formInfo.temName" type="select" <u-form-item :label="$t('homePage.policy.planCurveTem')"><u-input
@click="openSelectTemplate" input-align="right" /></u-form-item> :placeholder="$t('homePage.policy.selectPlanCurveTem')" v-model="formInfo.temName"
<u-form-item :label="$t('homePage.policy.IssueDevice')"><u-input :placeholder="$t('homePage.policy.selectIssueDevice')" v-model="formInfo.srcName" type="select" type="select" @click="openSelectTemplate" input-align="right" /></u-form-item>
@click="openSelectDevice" input-align="right" /></u-form-item> <u-form-item :label="$t('homePage.policy.IssueDevice')"><u-input
:placeholder="$t('homePage.policy.selectIssueDevice')" v-model="formInfo.srcName"
type="select" @click="openSelectDevice" input-align="right" /></u-form-item>
<u-form-item :label="$t('homePage.policy.operateOrNot')"><u-radio-group active-color="#009458" <u-form-item :label="$t('homePage.policy.operateOrNot')"><u-radio-group active-color="#009458"
v-model="formInfo.operationName" class="group"> v-model="formInfo.operationName" class="group">
<u-radio v-for="(item, index) in radioList" :key="index" :name="item.name" :disabled="item.disabled"> <u-radio v-for="(item, index) in radioList" :key="index" :name="item.name"
:disabled="item.disabled">
{{ item.name }} {{ item.name }}
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item :label="$t('homePage.policy.socUplimit')"><u-input :placeholder="$t('homePage.policy.pleaseInputValue')" v-model="formInfo.socUpper" disabled <u-form-item :label="$t('homePage.policy.socUplimit')"><u-input
:placeholder="$t('homePage.policy.pleaseInputValue')" v-model="formInfo.socUpper" disabled
type="text" input-align="right" /></u-form-item> type="text" input-align="right" /></u-form-item>
<u-form-item :label="$t('homePage.policy.socDownlimit')"><u-input :placeholder="$t('homePage.policy.pleaseInputValue')" v-model="formInfo.socLower" disabled <u-form-item :label="$t('homePage.policy.socDownlimit')"><u-input
:placeholder="$t('homePage.policy.pleaseInputValue')" v-model="formInfo.socLower" disabled
type="text" input-align="right" /></u-form-item> type="text" input-align="right" /></u-form-item>
<u-form-item :label="$t('homePage.policy.effectiveTime')"> <u-form-item :label="$t('homePage.policy.effectiveTime')">
<u-input v-model="formInfo.effectiveTime" type="select" @click="timeShow = true" input-align="right" <u-input v-model="formInfo.effectiveTime" type="select" @click="timeShow = true"
:placeholder="$t('homePage.policy.selectEffectiveTime')" /> input-align="right" :placeholder="$t('homePage.policy.selectEffectiveTime')" />
<u-picker mode="time" v-model="timeShow" input-align="right" @confirm="confirmTime" <u-picker mode="time" v-model="timeShow" input-align="right" @confirm="confirmTime"
:params="timeParams"></u-picker> :params="timeParams"></u-picker>
</u-form-item> </u-form-item>
@ -55,21 +60,29 @@
</u-form> </u-form>
<view style="display: flex;flex-wrap:wrap;justify-content: space-between;"> <view style="display: flex;flex-wrap:wrap;justify-content: space-between;">
<button type="success" size="mini" @click="handleIssue" style="background-color: #009458;color: #fff;width: 40%;" <button type="success" size="mini" @click="handleIssue"
:loading="isMoreLoading" :disabled="deliveryLoading" style="background-color: #009458;color: #fff;width: 40%;" :loading="isMoreLoading"
:disabled="deliveryLoading"
v-show="vuex_permissions.includes('strategy:planCurveDis:commandIssuance')"> v-show="vuex_permissions.includes('strategy:planCurveDis:commandIssuance')">
{{ $t('homePage.policy.commandDistribution') }} {{ $t('homePage.policy.commandDistribution') }}
</button> </button>
<button type="success" size="mini" @click="handleControlDelivery" <button type="success" size="mini" @click="handleControlDelivery"
style="background-color: #009458; color: #fff;width: 40%;" :loading="deliveryLoading" :disabled="isMoreLoading" style="background-color: #009458; color: #fff;width: 40%;" :loading="deliveryLoading"
:disabled="isMoreLoading"
v-show="vuex_permissions.includes('strategy:planCurveDis:commandIssuanceData')"> v-show="vuex_permissions.includes('strategy:planCurveDis:commandIssuanceData')">
{{ $t('homePage.policy.controlDistribution') }} {{ $t('homePage.policy.controlDistribution') }}
</button> </button>
<button type="success" size="mini" <button type="success" size="mini"
style="background-color: #009458; color: #fff;margin-top: 10px;width: 90%;" :disabled="isMoreLoading" style="background-color: #009458; color: #fff;margin-top: 10px;width: 40%;"
:disabled="isMoreLoading"
v-show="vuex_permissions.includes('strategy:planCurveDis:commandIssuanceData')"> v-show="vuex_permissions.includes('strategy:planCurveDis:commandIssuanceData')">
{{ $t('homePage.home.pvSwitch') }} {{ $t('homePage.home.pvSwitch') }}
</button> </button>
<button @click="toDeviceControl" type="success" size="mini"
style="background-color: #009458; color: #fff;margin-top: 10px;width: 40%;"
>
{{ $t('homePage.home.emsControl') }}
</button>
</view> </view>
</view> </view>
@ -134,26 +147,26 @@
</template> </template>
<script> <script>
import charts from "@/components/charts/index.vue"; import charts from "@/components/charts/index.vue";
import stationDropdow from "@/components/station-dropdow/index.vue"; import stationDropdow from "@/components/station-dropdow/index.vue";
import Section from "@/components/section/index.vue"; import Section from "@/components/section/index.vue";
export default { export default {
components: { components: {
stationDropdow, stationDropdow,
charts, charts,
Section, Section,
}, },
computed: { computed: {
currentStation () { currentStation() {
return this.vuex_currentStation; return this.vuex_currentStation;
}, },
language () { language() {
return this.vuex_language return this.vuex_language
} }
}, },
watch: { watch: {
currentStation: { currentStation: {
handler (val) { handler(val) {
this.loading = true; this.loading = true;
this.formInfo = { this.formInfo = {
temId: undefined, temId: undefined,
@ -176,29 +189,31 @@ export default {
deep: true, deep: true,
}, },
language: { language: {
handler (val) { handler(val) {
if(val === 'zh_CN'){ if (val === 'zh_CN') {
this.policyTypeList = [{ this.policyTypeList = [{
name: '命令下发' name: '命令下发'
}, },
{ {
name: '通用设置' name: '通用设置'
}]
} }
if(val === 'en_US'){ ]
}
if (val === 'en_US') {
this.policyTypeList = [{ this.policyTypeList = [{
name: 'Command Distribution' name: 'Command Distribution'
}, },
{ {
name: 'General settings' name: 'General settings'
}] }
]
} }
}, },
immediate: true, immediate: true,
deep: true, deep: true,
}, },
}, },
data () { data() {
return { return {
stationId: null, stationId: null,
formInfo: { formInfo: {
@ -256,22 +271,27 @@ export default {
deliveryLoading: false deliveryLoading: false
}; };
}, },
beforeDestroy () { beforeDestroy() {
if (this.moreInterval) { if (this.moreInterval) {
clearInterval(this.moreInterval); clearInterval(this.moreInterval);
} }
}, },
mounted () { mounted() {
this.defaultCheck = this.checked; this.defaultCheck = this.checked;
this.userId = this.vuex_user.userId this.userId = this.vuex_user.userId
}, },
methods: { methods: {
confirmTime (val) { toDeviceControl() {
uni.navigateTo({
url:'/pages/home-page/policy-Config/index'
})
},
confirmTime(val) {
this.formInfo.effectiveTime = val.hour + ':' + val.minute this.formInfo.effectiveTime = val.hour + ':' + val.minute
this.formInfo.planRefreshH = val.hour this.formInfo.planRefreshH = val.hour
this.formInfo.planRefreshM = val.minute this.formInfo.planRefreshM = val.minute
}, },
async handleControlDelivery () { async handleControlDelivery() {
if (!this.formInfo.srcId) { if (!this.formInfo.srcId) {
this.$refs.uToast.show({ this.$refs.uToast.show({
@ -309,43 +329,43 @@ export default {
}, },
inputValue (val, index) { inputValue(val, index) {
// let temp = val.replace(/(^[\-0-9][0-9]*(\.[0-9]+)?)$/g, '') // let temp = val.replace(/(^[\-0-9][0-9]*(\.[0-9]+)?)$/g, '')
// this.$nextTick(() => { // this.$nextTick(() => {
// this.inputDataBox[index].newValue = temp // this.inputDataBox[index].newValue = temp
// }) // })
}, },
sectionChange (val) { sectionChange(val) {
this.currentType = val this.currentType = val
if (val === 1) { if (val === 1) {
// this.getValueLiist() // this.getValueLiist()
} }
}, },
async getValueLiist () { async getValueLiist() {
const res = await this.$u.api.policy.GetSubstitutionValueList({ const res = await this.$u.api.policy.GetSubstitutionValueList({
stationId: this.stationId stationId: this.stationId
}) })
this.inputDataBox = res.data this.inputDataBox = res.data
}, },
toback () { toback() {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
}, },
closePassword () { closePassword() {
this.password = null; this.password = null;
this.checked = this.defaultCheck; this.checked = this.defaultCheck;
this.switchLoading = false; this.switchLoading = false;
}, },
sureOpen () { sureOpen() {
this.passwordShow = true; this.passwordShow = true;
}, },
closeOpen () { closeOpen() {
this.switchLoading = false; this.switchLoading = false;
this.checked = this.defaultCheck; this.checked = this.defaultCheck;
}, },
surePassword () { surePassword() {
if (+this.password === +this.defaultPassword) { if (+this.password === +this.defaultPassword) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: this.$t('homePage.policy.passwordSuccess'), title: this.$t('homePage.policy.passwordSuccess'),
@ -362,7 +382,7 @@ export default {
this.password = null; this.password = null;
this.switchLoading = false; this.switchLoading = false;
}, },
changeOpen (val) { changeOpen(val) {
this.switchLoading = true; this.switchLoading = true;
if (val) { if (val) {
this.openContent = this.$t('homePage.policy.isOpen'); this.openContent = this.$t('homePage.policy.isOpen');
@ -372,30 +392,30 @@ export default {
this.openShow = true; this.openShow = true;
} }
}, },
confirmTem (val) { confirmTem(val) {
this.formInfo.temName = val[0].label; this.formInfo.temName = val[0].label;
this.formInfo.temId = val[0].value; this.formInfo.temId = val[0].value;
this.getTemplateDetail(); this.getTemplateDetail();
}, },
confirmDev (val) { confirmDev(val) {
this.formInfo.srcName = val[0].label; this.formInfo.srcName = val[0].label;
this.formInfo.srcId = val[0].value; this.formInfo.srcId = val[0].value;
}, },
openSelectTemplate () { openSelectTemplate() {
this.templateSelectShow = true; this.templateSelectShow = true;
}, },
openSelectDevice () { openSelectDevice() {
this.deviceSelectShow = true; this.deviceSelectShow = true;
}, },
closeIssue () { closeIssue() {
this.warningShow = false; this.warningShow = false;
}, },
sureIssue () { sureIssue() {
this.getIssueDatas(); this.getIssueDatas();
}, },
// 下发 // 下发
async getIssueDatas () { async getIssueDatas() {
const params = { const params = {
stationId: this.stationId, stationId: this.stationId,
temId: this.formInfo.temId, temId: this.formInfo.temId,
@ -405,7 +425,7 @@ export default {
this.issueList = res.data; this.issueList = res.data;
this.handleMoreOrder(); this.handleMoreOrder();
}, },
async handleMoreOrder () { async handleMoreOrder() {
const self = this; const self = this;
this.isMoreLoading = true; this.isMoreLoading = true;
const params = { const params = {
@ -440,7 +460,7 @@ export default {
}, },
// 批量下发进度 // 批量下发进度
async getMoreOrderProgressBar () { async getMoreOrderProgressBar() {
const self = this; const self = this;
const params = { const params = {
stationId: this.stationId, stationId: this.stationId,
@ -468,7 +488,7 @@ export default {
self.getIssueStatus(); self.getIssueStatus();
} }
}, },
async insertIssueStatus () { async insertIssueStatus() {
const params = { const params = {
stationId: this.stationId, // 电站id stationId: this.stationId, // 电站id
planTemId: this.formInfo.temId, // 计划曲线模板id planTemId: this.formInfo.temId, // 计划曲线模板id
@ -480,7 +500,7 @@ export default {
}, },
// 获取下发设备 // 获取下发设备
async getIssueDevices () { async getIssueDevices() {
const res = await this.$u.api.policy.getIssueDevices({ const res = await this.$u.api.policy.getIssueDevices({
stationId: this.stationId, stationId: this.stationId,
}); });
@ -488,13 +508,13 @@ export default {
}, },
// 获取模板 // 获取模板
async getTemplate () { async getTemplate() {
const res = await this.$u.api.policy.getTemplate({ const res = await this.$u.api.policy.getTemplate({
stationId: this.stationId, stationId: this.stationId,
}); });
this.templateList = res.data; this.templateList = res.data;
}, },
async save () { async save() {
const self = this const self = this
let flag = false let flag = false
this.inputDataBox.forEach((item) => { this.inputDataBox.forEach((item) => {
@ -528,7 +548,7 @@ export default {
}, },
// 获取下发状态 // 获取下发状态
async getIssueStatus () { async getIssueStatus() {
this.formInfo.temName = undefined; this.formInfo.temName = undefined;
this.formInfo.srcName = undefined; this.formInfo.srcName = undefined;
this.formInfo.status = undefined; this.formInfo.status = undefined;
@ -564,12 +584,12 @@ export default {
this.formInfo.status = ""; this.formInfo.status = "";
} }
// this.$forceUpdate() // this.$forceUpdate()
} catch (error) { } finally { } catch (error) {} finally {
this.loading = false; this.loading = false;
} }
}, },
// 获取模板详情 // 获取模板详情
async getTemplateDetail () { async getTemplateDetail() {
const params = { const params = {
temId: this.formInfo.temId, temId: this.formInfo.temId,
}; };
@ -587,7 +607,7 @@ export default {
this.chartDatas = data.planningCurves; this.chartDatas = data.planningCurves;
this.initChart(chartData.planningCurves); this.initChart(chartData.planningCurves);
}, },
initChart (val) { initChart(val) {
let dateArr = []; let dateArr = [];
let valueArr = []; let valueArr = [];
if (val && val.length > 0) { if (val && val.length > 0) {
@ -617,7 +637,7 @@ export default {
}, },
axisPointer: {}, axisPointer: {},
confine: true, confine: true,
position: function (point, params, dom, rect, size) { position: function(point, params, dom, rect, size) {
// 鼠标坐标和提示框位置的参考坐标系是以外层div的左上角那一点为原点x轴向右y轴向下 // 鼠标坐标和提示框位置的参考坐标系是以外层div的左上角那一点为原点x轴向右y轴向下
// 提示框位置 // 提示框位置
var x = 0; // x坐标位置 var x = 0; // x坐标位置
@ -710,12 +730,12 @@ export default {
color: "#00CA9A", color: "#00CA9A",
}, },
}, },
},], }, ],
}; };
}, },
// 下发 // 下发
handleIssue () { handleIssue() {
if (!this.formInfo.temId) { if (!this.formInfo.temId) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: this.$t('homePage.policy.planCurveTem'), title: this.$t('homePage.policy.planCurveTem'),
@ -749,11 +769,11 @@ export default {
this.warningShow = true; this.warningShow = true;
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.policy-management { .policy-management {
height: 100% !important; height: 100% !important;
background-color: #f8f8f8; background-color: #f8f8f8;
padding: 20rpx; padding: 20rpx;
@ -810,9 +830,9 @@ export default {
} }
} }
.open-box { .open-box {
padding-left: 27rpx; padding-left: 27rpx;
padding-right: 27rpx; padding-right: 27rpx;
background-color: #ffffff; background-color: #ffffff;
@ -820,15 +840,15 @@ export default {
box-shadow: 0px 4rpx 16rpx rgba(0, 0, 0, 0.1); box-shadow: 0px 4rpx 16rpx rgba(0, 0, 0, 0.1);
border-radius: 8rpx; border-radius: 8rpx;
position: relative; position: relative;
} }
.group { .group {
display: flex; display: flex;
position: absolute; position: absolute;
right: 27rpx; right: 27rpx;
} }
.subTab { .subTab {
width: 100%; width: 100%;
text-align: right; text-align: right;
padding-right: 10rpx; padding-right: 10rpx;
@ -836,15 +856,15 @@ export default {
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
::v-deep .u-form-right { ::v-deep .u-form-right {
display: flex !important; display: flex !important;
justify-content: flex-end !important; justify-content: flex-end !important;
text-align: right; text-align: right;
} }
::v-deep .uni-input-input { ::v-deep .uni-input-input {
// text-align: right !important; // text-align: right !important;
} }
</style> </style>

View File

@ -94,41 +94,12 @@ import {
} from "@/common/common.js" } from "@/common/common.js"
import messageModel from './components/dialog.vue' import messageModel from './components/dialog.vue'
import config from '@/common/config.js' import config from '@/common/config.js'
import { Langlist } from '@/common/lang.js'
export default { export default {
components: { messageModel }, components: { messageModel },
data () { data () {
return { return {
Langlist: [{ Langlist:Langlist,
value: 'zh_CN',
label: '中文'
},
{
value: 'en_US',
label: 'English'
},
{
value: 'fr_FR',
label: 'French'
}
,
{
value: 'es_ES',
label: 'Spanish'
},
{
value: 'ar_EG',
label: 'Arabic'
},
{
value: 'de_DE',
label: 'German'
}
,
{
value: 'pl_PL',
label: 'Polish'
}
],
phoneNo: "", phoneNo: "",
username: "", username: "",
password: "", password: "",
@ -300,8 +271,8 @@ export default {
this.checked = false this.checked = false
}, },
changeLanguage (val) { changeLanguage (val) {
this.$u.vuex("vuex_language", val[0].value); this.$u.vuex("vuex_language", val[0].prop);
this.$i18n.locale = val[0].value this.$i18n.locale = val[0].prop
}, },
uploadFile () { uploadFile () {
this.isShowProgress = true; this.isShowProgress = true;