07/28 #265

Merged
xiaomeng merged 1 commits from pc-master into portal 2025-07-28 03:18:57 +00:00
3 changed files with 80 additions and 8 deletions
Showing only changes of commit cf4e9c9920 - Show all commits

View File

@ -4,7 +4,7 @@
<label for="upInput">
<div class="export-btn">{{ $t('systemSet.importSettings') }}</div>
</label>
<div class="export-btn" @click="downLoadData">{{ $t('systemSet.exportSettings') }}</div>
<div class="export-btn" @click="downLoad">{{ $t('systemSet.exportSettings') }}</div>
<input ref="fileInput" style="display: none" multiple id="upInput" type="file" accept=".txt" @change="changeTxt" />
</div>
<div class="table-title">
@ -101,6 +101,22 @@
class="system-tips system-textarea" maxlength="1200">
</textarea>
</div>
<el-dialog title="" class="vrcode-model confirm-psw" top="30vh" :close-on-click-modal="false" :append-to-body="true" :visible.sync="warnModel"
width="700px">
<div class="vrcode-model-title vrcode-model-title-282">{{ $t('placeholder.fileName') }}</div>
<div class="warning-model" style="padding: 0 30px;">
<div class="flex-view border-none">
<div class="input-main">
<div>{{ $t('placeholder.fileName') }}</div>
<input type="text" v-model="fileName">
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="warnModel=false">{{$t('index.cancel1')}}</el-button>
<el-button type="success" @click="downLoadData">{{$t('index.confirm1')}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -114,9 +130,13 @@ export default {
inputData: [],
loading:null,
ICCID:'',
memoDetail: {
memo: ''
},
warnModel:false,
fileName:'',
}
},
watch: {
@ -135,6 +155,12 @@ this.dataInit();
}
},
methods: {
downLoad(){
var store = this.$store.state
var index = store.equipmentIndex;
this.fileName=store.equipmentList[index - 1].deviceTypeName
this.warnModel=true
},
//
downLoadData() {
this.loading = this.$loading({
@ -149,16 +175,14 @@ this.dataInit();
this.api.controlReadValuedownload(devicecode).then(res => {
// blob
this.loading.close()
console.log(res,111);
const blob = new Blob([res.data], { type: 'text/txt' });
console.log(blob,111);
// a
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
//
link.setAttribute('download', `${this.$t('deviceManagement.deviceTypes.controller')}-${devicecode}.txt`);
link.setAttribute('download', `${this.fileName}.txt`);
//
document.body.appendChild(link);

View File

@ -4,7 +4,7 @@
<label for="upInput">
<div class="export-btn">{{ $t('systemSet.importSettings') }}</div>
</label>
<div class="export-btn" @click="downLoadData">{{ $t('systemSet.exportSettings') }}</div>
<div class="export-btn" @click="downLoad">{{ $t('systemSet.exportSettings') }}</div>
<input ref="fileInput" style="display: none" multiple id="upInput" type="file" accept=".txt" @change="changeTxt" />
</div>
<div class="table-title">
@ -82,6 +82,22 @@
class="system-tips system-textarea" maxlength="1200">
</textarea>
</div>
<el-dialog title="" class="vrcode-model confirm-psw" top="30vh" :close-on-click-modal="false" :append-to-body="true" :visible.sync="warnModel"
width="700px">
<div class="vrcode-model-title vrcode-model-title-282">{{ $t('placeholder.fileName') }}</div>
<div class="warning-model" style="padding: 0 30px;">
<div class="flex-view border-none">
<div class="input-main">
<div>{{ $t('placeholder.fileName') }}</div>
<input type="text" v-model="fileName">
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="warnModel=false">{{$t('index.cancel1')}}</el-button>
<el-button type="success" @click="downLoadData">{{$t('index.confirm1')}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -95,6 +111,8 @@ export default {
memoDetail: {
memo: ''
},
warnModel:false,
fileName:'',
}
},
@ -113,6 +131,12 @@ export default {
}
},
methods: {
downLoad(){
var store = this.$store.state
var index = store.equipmentIndex;
this.fileName=store.equipmentList[index - 1].deviceTypeName
this.warnModel=true
},
//
downLoadData() {
this.loading = this.$loading({
@ -134,7 +158,7 @@ export default {
link.href = url;
//
link.setAttribute('download', `${this.$t('deviceManagement.deviceTypes.smartController')}-${devicecode}.txt`);
link.setAttribute('download', `${this.fileName}.txt`);
//
document.body.appendChild(link);

View File

@ -6,7 +6,7 @@
<label for="upInput">
<div class="export-btn">{{ $t('systemSet.importSettings') }}</div>
</label>
<div class="export-btn" @click="downLoadData">{{ $t('systemSet.exportSettings') }}</div>
<div class="export-btn" @click="downLoad">{{ $t('systemSet.exportSettings') }}</div>
<input ref="fileInput" style="display: none" multiple id="upInput" type="file" accept=".txt"
@change="changeTxt" />
</div>
@ -103,6 +103,22 @@
</textarea>
</div>
</div>
<el-dialog title="" class="vrcode-model confirm-psw" top="30vh" :close-on-click-modal="false" :append-to-body="true" :visible.sync="warnModel"
width="700px">
<div class="vrcode-model-title vrcode-model-title-282">{{ $t('placeholder.fileName') }}</div>
<div class="warning-model" style="padding: 0 30px;">
<div class="flex-view border-none">
<div class="input-main">
<div>{{ $t('placeholder.fileName') }}</div>
<input type="text" v-model="fileName">
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="warnModel=false">{{$t('index.cancel1')}}</el-button>
<el-button type="success" @click="downLoadData">{{$t('index.confirm1')}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -120,6 +136,8 @@ export default {
memoDetail: {
memo: ''
},
warnModel:false,
fileName:'',
}
},
@ -138,6 +156,12 @@ export default {
}
},
methods: {
downLoad(){
var store = this.$store.state
var index = store.equipmentIndex;
this.fileName=store.equipmentList[index - 1].deviceTypeName
this.warnModel=true
},
//
downLoadData() {
this.loading = this.$loading({
@ -161,7 +185,7 @@ export default {
link.href = url;
//
link.setAttribute('download', `${this.$t('deviceManagement.deviceTypes.fertilizer')}-${devicecode}.txt`);
link.setAttribute('download', `${this.fileName}.txt`);
//
document.body.appendChild(link);