| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002 |
- <template>
- <div class="view-container" v-loading="pageLoading">
- <el-form
- ref="addForm"
- :rules="rules"
- :model="siteForm"
- label-position="right"
- label-width="120px"
- style="width: 100%;">
- <div class="flexr">
- <div class="flexl flex1">
- <div class="view-content flex1">
- <div class="section-title" id="idSiteInfo">Site Information</div>
- <el-form-item
- label="Site Name:"
- prop="siteName">
- <el-input
- :disabled="isMCSTUser"
- v-model="siteForm.siteName"
- class="input-text" />
- </el-form-item>
- <el-form-item
- prop="locationLatitude"
- label="Latitude:">
- <el-input
- :disabled="isMCSTUser"
- v-model="siteForm.locationLatitude"
- class="input-text" />
- </el-form-item>
- <el-form-item
- prop="locationLongitude"
- label="Longitude:">
- <el-input
- :disabled="isMCSTUser"
- v-model="siteForm.locationLongitude"
- class="input-text"/>
- </el-form-item>
- <el-form-item
- prop="address.countryCode"
- label="Country:">
- <el-select
- v-model="siteForm.address.countryCode"
- class="input-text"
- :disabled="isMCSTUser">
- <el-option
- v-for="item in countryOptions"
- :key="item.name"
- :label="item.name"
- :value="item.value" />
- </el-select>
- </el-form-item>
- <el-form-item
- prop="address.city"
- label="City:">
- <el-input
- v-model="siteForm.address.city"
- class="input-text"
- :disabled="isMCSTUser"/>
- </el-form-item>
- <el-form-item
- prop="address.street"
- label="Street:">
- <el-input
- v-model="siteForm.address.street"
- class="input-text"
- :disabled="isMCSTUser"/>
- </el-form-item>
- <el-form-item
- prop="address.zipCode"
- label="Postal Code:">
- <el-input
- v-model="siteForm.address.zipCode"
- class="input-text"
- :disabled="isMCSTUser"/>
- </el-form-item>
- </div>
- <div class="view-content">
- <div class="section-title">Additional Information</div>
- <el-form-item
- label-width="130px"
- label="Operating Hours:"
- class="flex-item">
- <div class="flexc">
- <el-input
- v-model="siteForm.operatingHours"
- :disabled="isMCSTUser || !!siteForm.endlessService"
- class="input-text" />
- <el-switch
- :disabled="isMCSTUser"
- @change="changeEndless"
- style="margin-left: 10px"
- inactive-text="24/7"
- v-model="siteForm.endlessService">
- </el-switch>
- </div>
- </el-form-item>
- <el-form-item
- label-width="130px"
- label="Parking Fee:"
- class="flex-item">
- <div class="flexc">
- <el-input
- :disabled="isMCSTUser || !!siteForm.free"
- v-model="siteForm.parkingFee"
- class="input-text" />
- <el-switch
- :disabled="isMCSTUser"
- @change="changeParkingFree"
- style="margin-left: 10px"
- inactive-text="Free"
- v-model="siteForm.free">
- </el-switch>
- </div>
- </el-form-item>
- <el-form-item
- label-width="130px"
- label="Additional Notes:">
- <el-input
- :disabled="isMCSTUser"
- v-model="siteForm.additionalNotes"
- type="textarea"
- :autosize="autosize"
- class="input-text" />
- </el-form-item>
- <el-form-item
- label-width="130px"
- label="Carpark Code:">
- <el-input
- v-model="siteForm.carParkCode"
- class="input-text" />
- </el-form-item>
- </div>
- </div>
- <div class="flexl flex1">
- <div class="view-content" style="padding: 15px;">
- <dashboard
- v2
- :enable="isEdit"
- :info="summaryInfo"
- :siteId="siteForm.sitePk"/>
- </div>
-
- <div class="view-content flex1">
- <div class="section-title flexcr">
- Site Summary
- <div class="section-sub-title">(Currency Used: {{currencyData[siteForm.address.countryCode]}})</div>
- </div>
- <Summary
- :info="summaryInfo"
- :currency="currencyData[siteForm.address.countryCode]"/>
- </div>
-
- <div class="view-content" id="idSiteTypes">
- <div class="section-title">Site EMAIL Configuration</div>
- <email-recipient v-model="siteForm.emails"/>
- </div>
- </div>
- </div>
-
- <div class="view-content">
- <div class="section-title">TIME CONFIGURATION</div>
- <div class="site-type-layout">
- <site-type-with-time
- :siteTypes="siteForm.siteTypes"
- :sitePk="siteForm.sitePk"
- @change="changeSiteTypes"/>
- </div>
- </div>
-
- <div class="view-content">
- <div class="section-title">OCPP SETTINGS</div>
- <div class="flexr">
- <div class="flex2">
- <el-form-item
- label-width="150px"
- label="Heartbeat Interval:"
- prop="heartbeat"
- class="flex1">
- <div class="flexc">
- <el-input
- class="value-text"
- v-model="siteForm.ocppSetting.heartbeatIntervalMinutes"
- placeholder="Add text"
- maxlength="5"/>
- <span class="value-unit">Minutes</span>
- </div>
- </el-form-item>
- <div class="tips">The time interval in <i>minutes</i> for how often a charge point should request the current time from the CSMS.</div>
- </div>
- <div class="flex1">
- <p></p>
- </div>
- <div class="flex2">
- <el-form-item
- label="Expiration:"
- prop="expiration"
- label-width="95px"
- class="flex1">
- <div class="flexc">
- <el-input
- class="value-text"
- v-model="siteForm.ocppSetting.expireHours"
- placeholder="Add text"
- maxlength="5"/>
- <span class="value-unit">Hours</span>
- </div>
- </el-form-item>
- <div class="tips" style="padding-left: 95px;">The amount of time in <i>hours</i> for how long a charge point should cache the authorization info of an idTag in its local white list, if an expiry date is not explicitly set.
- The value 0 disables this functionality
- (i.e.no expiry date will be set).</div>
- </div>
- </div>
- </div>
-
- <div class="view-content" id="idChargeRates">
- <!--div class="section-title flexcr">
- CHARGE SITE RATE
- <div class="section-sub-title">(Currency Used: {{currencyData[siteForm.address.countryCode]}})</div>
- </div>
- <charge-rate
- v-model="ratesForm.chargeRates"/>
- <div class="sparator"></div>
- <div class="section-title flexcr">
- SPECIAL CHARGE RATE
- <div class="section-sub-title">(Currency Used: {{currencyData[siteForm.address.countryCode]}})</div>
- </div>
- <charge-rate
- isSpecial
- v-model="ratesForm.specialChargeRates"/>
- <div class="sparator"></div>-->
- <div class="section-title">Reservations</div>
- <reservation
- :enabled.sync="siteForm.enableReservation"
- :limit.sync="siteForm.timeLimit"
- />
- <div class="sparator" v-if="isEdit"></div>
- <div class="section-title" v-if="isEdit">LOAD BALANCING</div>
- <!-- <Balancing v-model="balancingForm"/> -->
- <div class="new-load-balance" v-if="isEdit" style="padding-bottom: 20px;">
- <span class="new-text">NEW!</span>
- <span class="link-type" @click="configLoadBalance">Configure load balancing in a new window</span>
- </div>
- <template v-if="enableWhitelistFleet">
- <div class="sparator"></div>
- <div class="section-title">WHITELIST GROUP</div>
- <white-list-fleet v-model="siteForm.groupWhitelist"/>
- </template>
-
- <template v-if="enableWhitelistUser">
- <div class="sparator"></div>
- <div class="section-title">WHITELIST USERS</div>
- <white-list-user v-model="siteForm.whitelistUser"/>
- </template>
- <div class="sparator"></div>
- <div class="section-title flexcwr">
- Idle Fee SETTINGS
- <div class="idle-switch">
- <el-switch
- inactive-text="Enable Idle Fee"
- v-model="siteForm.enableIdleFee"/>
- </div>
- </div>
- <el-row :gutter="20" v-if="siteForm.enableIdleFee">
- <el-col :xs="24" :md="12" :lg="8">
- <el-form-item
- label="Effective From:"
- label-width="140px"
- prop="effectiveFrom">
- <el-time-picker
- v-model="siteForm.effectiveFrom"
- class="input-text"
- format="HH:mm"
- value-format="HH:mm"/>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :md="12" :lg="8">
- <el-form-item
- label="Effective To:"
- label-width="140px"
- prop="effectiveTo">
- <el-time-picker
- v-model="siteForm.effectiveTo"
- class="input-text"
- format="HH:mm"
- value-format="HH:mm"/>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :md="12" :lg="8">
- <el-form-item
- label="Idle Fee:"
- label-width="140px"
- prop="idleFee">
- <el-input
- v-model="siteForm.idleFee"
- class="input-text"
- oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"
- maxlength="6"/>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :md="12" :lg="8">
- <el-form-item
- label="Idle Fee Interval"
- label-width="140px"
- prop="everyMinute"
- style="position: relative;">
- <template slot="label">
- <span>Idle Fee Interval:</span>
- <span class="label-unit">(minute)</span>
- </template>
- <el-input
- maxlength="4"
- v-model.number="siteForm.everyMinute"
- class="input-text"/>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :md="12" :lg="8">
- <el-form-item
- label="Effective Date:"
- label-width="140px"
- prop="effectiveDate">
- <el-date-picker
- v-model="siteForm.effectiveDate"
- class="input-text"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"/>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
-
- <div class="view-content flexcr">
- <div class="buttons">
- <el-button
- class="cancel-button"
- type="primary"
- @click="handleClickCancleButton">
- Cancel
- </el-button>
- <el-button
- class="confirm-button"
- type="primary"
- @click="handleClickSaveButton">
- Save
- </el-button>
- </div>
- <div
- class="update-by"
- v-if="isEdit">
- <span
- class="add-text"
- :title='"CREATED BY " + siteForm.createdBy + " ON " + siteForm.createdOn'>
- LAST UPDATED BY {{siteForm.updatedBy}} TIMESTAMP: {{siteForm.updatedOn}}
- </span>
- </div>
- </div>
- </el-form>
- </div>
- </template>
- <script>
- import settings from '../../settings.js'
- import Summary from '../site/components/Summary'
- import Dashboard from '../site/components/Dashboard'
- import ChargeRate from '../site/components/ChargeRate'
- import Balancing from '../site/components/Balancing'
- import EmailRecipient from '../site/components/EmailRecipient'
- import Reservation from '../site/components/Reservations'
- import WhiteListFleet from '../site/components/WhiteListFleet'
- import WhiteListUser from '../site/components/WhiteListUser'
- import SiteTypeWithTime from './components/SiteTypeWithTime'
- import waves from '@/directive/waves' // waves directive
- import site from '../../http/api/site'
- import { getRoleName } from '@/utils/auth'
- export default {
- directives: { waves },
- components: {
- Balancing,
- ChargeRate,
- Dashboard,
- EmailRecipient,
- Reservation,
- WhiteListUser,
- WhiteListFleet,
- SiteTypeWithTime,
- Summary
- },
- data() {
- return {
- pageLoading: false,
- isMCSTUser: false,
- countryOptions: [],
- siteForm: {
- sitePk: "",
- siteName: "",
- siteTypes: [],
- emails: [],
- carParkCode: "",
- address: {
- city: "",
- countryCode: settings.defaultCountry,
- street: "",
- zipCode: ""
- },
- ocppSetting: {
- expireHours: '',
- ocppSettingId: '',
- heartbeatIntervalMinutes: ''
- },
- free: false,
- endlessService: false,//24/7
- additionalNotes: "",
- //罚款部分
- enableIdleFee: false,//idle Fee
- idleFee: "",//idle Fee
- everyMinute: "",//idle Fee
- effectiveDate: "",//idle Fee
- effectiveFrom: "",//idle Fee
- effectiveTo: "",//idle Fee
- //预订部分
- enableReservation: false,//预订
- timeLimit: null,//预订
-
- parkingFee: "",
- whitelistUser: [],
- groupWhitelist: [],
- operatingHours: "",
- locationLatitude: "",
- locationLongitude: "",
- chargeRates: [],
- specialChargeRates: [],
- loadBalancing: "",//负载均衡
- staticMaxAmpere: "",//负载均衡
- siteChargingProfiles: null,//负载均衡
- },
- ratesForm: {
- chargeRates: [{
- rate: '',
- rateType: '',
- chargeTypePk: ''
- }],
- specialChargeRates: [{
- rate: '',
- rateType: '',
- chargeTypePk: '',
- groupPk: ''
- }]
- },
- balancingForm: {
- loadBalancing: 'dynamic',
- staticMaxAmpere: 0,
- siteChargingProfiles: [{
- boxInUse: '',
- chargingProfilePk: ''
- }],
- },
- currencyData: {
- SG: "S$"
- },
- autosize: {
- minRows: 3,
- maxRows: 6,
- },
- summaryInfo: {},
- rules: {
- siteName: {
- required: true,
- trigger: 'blur',
- message: 'Site Name is required',
- },
- locationLatitude: [{
- required: true,
- trigger: 'blur',
- message: 'Latitude is required',
- }, {
- pattern: /^[\-\+]?((0|([1-8]\d?))(\.\d{1,8})?|90(\.0{1,8})?)$/,
- trigger: 'blur',
- message: 'Please type a correct latitude',
- }],
- locationLongitude: [{
- required: true,
- trigger: 'blur',
- message: 'Longitude is required',
- }, {
- pattern: /^[\-\+]?(0(\.\d{1,8})?|([1-9](\d)?)(\.\d{1,8})?|1[0-7]\d{1}(\.\d{1,8})?|180\.0{1,8})$/,
- trigger: 'blur',
- message: 'Please type a correct longitude',
- }],
- address: {
- street: {
- required: true,
- trigger: 'blur',
- message: 'Address is required',
- },
- zipCode: {
- required: true,
- trigger: 'blur',
- message: 'Postal Code is required',
- },
- city: {
- required: true,
- trigger: 'blur',
- message: 'City is required',
- },
- countryCode: {
- required: true,
- trigger: 'blur',
- message: 'Country is required',
- }
- },
- idleFee: {
- required: true,
- trigger: 'blur',
- message: 'Idle fee is required'
- },
- effectiveDate: {
- required: true,
- trigger: 'change',
- message: 'Effective Date is required'
- },
- effectiveFrom: {
- required: true,
- trigger: 'change',
- message: 'Effective From is required'
- },
- effectiveTo: {
- required: true,
- trigger: 'change',
- message: 'Effective To is required'
- },
- everyMinute: [{
- required: true,
- trigger: 'blur',
- message: 'Every is required'
- }, {
- type: 'number',
- message: 'Every is a number'
- }]
- },
- enablePublic: false,
- enableWhitelistUser: false,
- enableWhitelistFleet: false,
- isEdit: false
- }
- },
- created() {
- this.pageLoading = true;
- this.isMCSTUser = getRoleName() === "MCST";
- this.getCountryOptions()
- if (this.$route.params.id) {
- this.isEdit = true;
- this.getSiteInfo()
- } else {
- setTimeout(() => {
- this.pageLoading = false;
- }, 500);
- }
- },
- methods: {
- getCountryOptions() {
- site.getCountryList().then(res => {
- if (res.data) {
- this.countryOptions = res.data
- const sign = {}
- res.data.forEach(item => {
- sign[item.value] = item.currencySymbol
- })
- this.currencyData = sign;
- }
- })
- },
- getSiteInfo() {
- site.getSiteInfo({
- sitePk: this.$route.params.id,
- }).then(res => {
- if (res.data) {
- this.siteForm = res.data;
- this.applySiteInfo();
- } else {
- this.pageLoading = false;
- }
- }).catch(() => {
- this.$message({
- message: err,
- type: 'error',
- duration: 3000,
- })
- this.pageLoading = false;
- })
- },
- applySiteInfo() {
- setTimeout(() => {
- this.pageLoading = false;
- }, 500);
- if (this.siteForm.chargeRates && this.siteForm.chargeRates.length) {
- const rate = [], srate = []
- this.siteForm.chargeRates.forEach(item => {
- if (item.groupPk) {
- srate.push(item)
- } else {
- rate.push(item)
- }
- })
- if (rate.length > 0) {
- this.ratesForm.chargeRates = rate;
- }
- if (srate.length > 0) {
- this.ratesForm.specialChargeRates = srate;
- }
- }
- if (this.siteForm.siteTypes && this.siteForm.siteTypes.length) {
- for (let type of this.siteForm.siteTypes) {
- if (type.siteType == "PRI_USR_WHI") {
- this.enableWhitelistUser = (type.allDay || (type.startTime && type.endTime))
- } else if (type.siteType == "PRI_FLE_WHI") {
- this.enableWhitelistFleet = (type.allDay || (type.startTime && type.endTime))
- } else if (type.siteType == "PUB") {
- this.enablePublic = (type.allDay || (type.startTime && type.endTime))
- } else {
- continue;
- }
- }
- }
- if (this.siteForm.siteSummary) {
- this.summaryInfo = Object.assign(this.siteForm.siteSummary, {});
- delete this.siteForm.siteSummary;
- }
- this.balancingForm = {
- loadBalancing: this.siteForm.loadBalancing || 'dynamic',
- staticMaxAmpere: this.siteForm.staticMaxAmpere || 0,
- siteChargingProfiles: this.siteForm.siteChargingProfiles || [{
- boxInUse: '',
- chargingProfilePk: ''
- }]
- }
- },
- changeEndless(value) {
- if (value) {
- this.siteForm.operatingHours = ""
- }
- },
- changeParkingFree(value) {
- if (value) {
- this.siteForm.parkingFee = ""
- }
- },
- changeSiteTypes(data) {
- if (this.isEdit && this.pageLoading) {
- console.log("changeSiteTypes", data);
- return;
- }
- this.siteForm.siteTypes = data;
- /*for (let type of data) {
- if (type.siteType == "PRI_USR_WHI") {
- this.enableWhitelistUser = (type.allDay || (type.startTime && type.endTime))
- } else if (type.siteType == "PRI_FLE_WHI") {
- this.enableWhitelistFleet = (type.allDay || (type.startTime && type.endTime))
- } else if (type.siteType == "PUB") {
- this.enablePublic = (type.allDay || (type.startTime && type.endTime))
- } else {
- continue;
- }
- }*/
- },
- handleClickCancleButton() {
- this.$router.push({
- path: "/site-management-v2/site-configuration"
- });
- },
- handleClickSaveButton() {
- this.$refs['addForm'].validate(result => {
- if (result) {
- const rates = [];
- /* 启用动态费率配置
- this.ratesForm.chargeRates.forEach(item => {
- if (item.rate) {
- rates.push(item);
- }
- })
- this.ratesForm.specialChargeRates.forEach(item => {
- if (item.rate) {
- rates.push(item);
- }
- })
- if (rates.length == 0) {
- this.$message({
- message: "Please add at least one rate",
- type: 'error',
- duration: 3000,
- })
- this.scrollToView("idChargeRates", true);
- return;
- }*/
- if (!this.siteForm.enableReservation) {
- this.siteForm.timeLimit = "";
- }
- /*const chargeProfiles = []
- this.balancingForm.siteChargingProfiles.forEach(item => {
- if (item.boxInUse && item.chargingProfilePk)
- chargeProfiles.push(item)
- })
- this.siteForm.siteChargingProfiles = chargeProfiles
- if (this.balancingForm.loadBalancing == 'dynamic') {
- this.siteForm.staticMaxAmpere = ""
- } else {
- this.siteForm.staticMaxAmpere = this.balancingForm.staticMaxAmpere
- }
- this.siteForm.loadBalancing = this.balancingForm.loadBalancing*/
- /*if (!this.enablePublic && !this.enableWhitelistFleet && !this.enableWhitelistUser) {
- this.$message({
- message: "Please set time configuration",
- type: 'error',
- duration: 3000,
- })
- this.scrollToView("idSiteTypes");
- return;
- }*/
- if (this.enableWhitelistUser) {
- let _list = []
- this.siteForm.whitelistUser.forEach(item => {
- if (item.mobileNumber && item.licenceNumber) {
- _list.push(item);
- }
- })
- if (_list.length == 0) {
- this.$message({
- message: "Please add at least one whitelist user",
- type: 'error',
- duration: 3000,
- })
- return;
- } else {
- this.siteForm.whitelistUser = _list;
- }
- } else {
- this.siteForm.whitelistUser = [];
- }
- if (this.enableWhitelistFleet) {
- let _list = []
- this.siteForm.groupWhitelist.forEach(item => {
- if (item.groupPk) {
- _list.push(item);
- }
- })
- if (_list.length == 0) {
- this.$message({
- message: "Please add at least one whitelist group",
- type: 'error',
- duration: 3000,
- })
- return;
- } else {
- this.siteForm.groupWhitelist = _list;
- }
- } else {
- this.siteForm.groupWhitelist = []
- }
- this.pageLoading = true;
- const params = {
- ...this.siteForm,
- chargeRates: rates
- }
- console.log("form", params);
- if (this.isEdit) {
- this.updateSite(params);
- } else {
- this.addSite(params)
- }
- //this.editSiteWithForm();
- } else {
- this.scrollToView("idSiteInfo", true);
- }
- })
- },
- scrollToView(id, alignToTop) {
- //console.log("scrollToView", !alignToTop);
- window.requestAnimationFrame(() => {
- document.getElementById(id).scrollIntoView(!alignToTop, {
- block: "start",
- behavior: "smooth"
- })
- });
- },
- isSiteTypeEnable(index, isSwitch) {
- for (let i = 0; i < this.siteForm.siteTypes.length; i++) {
- let type = this.siteForm.siteTypes[i];
- if (type.allDay) {
- if (index == i && isSwitch) {
- return false;
- } else {
- return true;
- }
- } else {
- continue;
- }
- }
- return false;
- },
- addSite(params) {
- site.addSite(params).then(res => {
- this.$message({
- message: "Add site success",
- type: 'success',
- duration: 3000,
- })
- this.handleClickCancleButton();
- }).catch((error) => {
- this.$message({
- message: error,
- type: "error",
- duration: 5000,
- })
- }).finally(() => {
- this.pageLoading = false;
- })
- },
- updateSite(params) {
- site.updateSite(params).then(res => {
- this.$message({
- message: "Update site success",
- type: 'success',
- duration: 3000,
- })
- this.handleClickCancleButton();
- }).catch((error) => {
- this.$message({
- message: error,
- type: "error",
- duration: 5000,
- })
- }).finally(() => {
- this.pageLoading = false;
- })
- },
- configLoadBalance() {
- this.$openRoute("/smart-energy-management/site-load-balancing/" + this.siteForm.sitePk);
- }
- }
- }
- </script>
- <style scoped lang='scss'>
- @import '../../styles/element-ui.scss';
- @import '../../styles/variables.scss';
-
- .view-container {
- width: 100%;
- padding: 20px 60px;
- min-height: $mainAppMinHeight;
- background-color: #F0F5FC;
- }
-
- .view-content {
- margin: 0 8px 16px;
- padding: 15px 50px;
- border-radius: 6px;
- background-color: white;
- }
-
- @media screen and (max-width: 800px) {
- .view-container {
- padding: 10px 20px;
- }
- .view-content {
- padding: 15px 40px;
- }
- }
-
- @media screen and (max-width: 500px) {
- .view-container {
- padding: 0px;
- }
- .view-content {
- padding: 15px 30px;
- }
- }
-
- .sparator {
- margin: 10px -30px;
- height: 2px;
- background-color: #F0F5FC;
- }
-
- .section-title {
- color: #333333;
- margin-top: 20px;
- margin-bottom: 30px;
- font-size: 15px;
- line-height: 24px;
- font-weight: 700;
- font-family: sans-serif;
- text-transform: uppercase;
- }
-
- .section-sub-title {
- font-size: 14px;
- padding-left: 5px;
- font-weight: normal;
- }
-
- .site-type-layout {
- overflow-x: auto;
- }
-
- .site-type-layout::-webkit-scrollbar-track-piece {
- background-color:#f8f8f8;
- }
-
- .site-type-layout::-webkit-scrollbar {
- width: 7px;
- height: 10px;
- }
- .site-type-layout::-webkit-scrollbar-thumb {
- transition: all .4s;
- border-radius: 30px;
- background-color: rgba($--color-primary, 0.3);
- background-clip: padding-box;
- }
- .site-type-layout::-webkit-scrollbar-thumb:hover {
- background-color: rgba($--color-primary, 0.6);
- }
-
- .input-text {
- width: 100% !important;
- max-width: 300px;
- }
-
- .add-text {
- width: 100%;
- font-size: 14px;
- max-width: 300px;
- }
-
- .add-text ::v-deep .el-textarea__inner,
- .input-text ::v-deep .el-textarea__inner {
- font-family: sans-serif;
- }
-
- .value-text {
- width: 100%;
- min-width: 100px;
- max-width: 200px;
- }
-
- .value-unit {
- padding-left: 10px;
- }
-
- .label-unit {
- left: 20px;
- bottom: -13px;
- font-size: 12px;
- position: absolute;
- }
-
- .cancel-button {
- width: 94px;
- height: 40px;
- }
-
- .confirm-button {
- width: 94px;
- height: 40px;
- margin-left: 20px;
- background: $--color-primary;
- border: 1px solid $--color-primary;
- box-sizing: border-box;
- border-radius: 4px;
- }
-
- ::v-deep .el-switch__label.el-switch__label--left span {
- font-size: 14px;
- color: black;
- }
- .idle-switch {
- font-size: 13px;
- text-transform: none;
- }
- .tips {
- color: #999;
- font-size: 12px;
- padding-left: 150px;
- padding-bottom: 20px;
- }
- .tips i {
- color: #333;
- font-weight: 500;
- font-style: normal;
- }
- .new-load-balance {
- position: relative;
- padding-left: 15px;
- padding-bottom: 20px;
- }
- .new-text {
- top: -10px;
- left: 0px;
- color: #FF1122;
- font-size: 12px;
- position: absolute;
- transform: scale(0.8);
- }
- </style>
|