|
@@ -8,13 +8,21 @@
|
|
<el-button @click="saveData">保存</el-button>
|
|
<el-button @click="saveData">保存</el-button>
|
|
<el-checkbox v-model="checked">只显示使用的原始点位</el-checkbox>
|
|
<el-checkbox v-model="checked">只显示使用的原始点位</el-checkbox>
|
|
</div>
|
|
</div>
|
|
- <div id="handsontableSteps1">
|
|
|
|
|
|
+ <div id="handsontableSteps1" v-loading="isLoading">
|
|
<handsontable-component v-if="!!allData.length" ref="handsontable" @mouseDown="clickTable" @change="changeHand"></handsontable-component>
|
|
<handsontable-component v-if="!!allData.length" ref="handsontable" @mouseDown="clickTable" @change="changeHand"></handsontable-component>
|
|
<div v-else class="center">暂无数据</div>
|
|
<div v-else class="center">暂无数据</div>
|
|
</div>
|
|
</div>
|
|
<own-dialog :width="'580px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="close">
|
|
<own-dialog :width="'580px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="close">
|
|
<localtion-falg :renderData="renderData"></localtion-falg>
|
|
<localtion-falg :renderData="renderData"></localtion-falg>
|
|
</own-dialog>
|
|
</own-dialog>
|
|
|
|
+ <own-dialog :width="'580px'" :index="true" title="导出excel模板" :dialogVisible="downloadExcel" @cancel="close">
|
|
|
|
+ <div class="center">
|
|
|
|
+ <el-button type="text" @click="download">下载模板</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </own-dialog>
|
|
|
|
+ <div class="center">
|
|
|
|
+ <pagination :page="pages" @change="changePage"></pagination>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -22,6 +30,7 @@
|
|
import getHeaderSetting from "@/utils/point_edit/handson_header"
|
|
import getHeaderSetting from "@/utils/point_edit/handson_header"
|
|
import ownDialog from "@/components/el_pack/dialog"
|
|
import ownDialog from "@/components/el_pack/dialog"
|
|
import localtionFalg from "@/components/config_point/location_flag"
|
|
import localtionFalg from "@/components/config_point/location_flag"
|
|
|
|
+ import pagination from "@/components/common/myPagination"
|
|
import {
|
|
import {
|
|
mapGetters,
|
|
mapGetters,
|
|
mapActions
|
|
mapActions
|
|
@@ -33,7 +42,8 @@
|
|
import {
|
|
import {
|
|
queryPoint,
|
|
queryPoint,
|
|
updatePoint,
|
|
updatePoint,
|
|
- createPoint
|
|
|
|
|
|
+ createPoint,
|
|
|
|
+ downloadTemplete
|
|
} from "@/fetch/point_http"
|
|
} from "@/fetch/point_http"
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
@@ -44,7 +54,19 @@
|
|
changeFlag: true, //是否发生修改
|
|
changeFlag: true, //是否发生修改
|
|
localtionDialog: false,
|
|
localtionDialog: false,
|
|
renderData: {},
|
|
renderData: {},
|
|
- allData: []
|
|
|
|
|
|
+ allData: [],
|
|
|
|
+ pages:{
|
|
|
|
+ size: 10,
|
|
|
|
+ sizes: [10, 30, 50, 100],
|
|
|
|
+ total: 0,
|
|
|
|
+ currentPage: 0
|
|
|
|
+ },
|
|
|
|
+ oldPage: {
|
|
|
|
+ currentPage: 0,
|
|
|
|
+ size: 10
|
|
|
|
+ },
|
|
|
|
+ downloadExcel: true,
|
|
|
|
+ isLoading: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -68,6 +90,38 @@
|
|
//关闭弹窗
|
|
//关闭弹窗
|
|
close(){
|
|
close(){
|
|
this.localtionDialog = false
|
|
this.localtionDialog = false
|
|
|
|
+ this.downloadExcel = false
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //下载excel模板
|
|
|
|
+ download(){
|
|
|
|
+ downloadTemplete({
|
|
|
|
+ data: {
|
|
|
|
+ DataSourceId: this.datasourceId,
|
|
|
|
+ },
|
|
|
|
+ type: this.protocolType
|
|
|
|
+ },{
|
|
|
|
+ responseType: 'blob'
|
|
|
|
+ },res => {
|
|
|
|
+ var blob = new Blob([res.data], {
|
|
|
|
+ type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
|
+ });
|
|
|
|
+ var fileName = res.headers['content-disposition'];
|
|
|
|
+ if (fileName)
|
|
|
|
+ fileName = fileName.substring(fileName.indexOf('=') + 1);
|
|
|
|
+ if ('download' in document.createElement('a')) { // 非IE下载
|
|
|
|
+ const elink = document.createElement('a')
|
|
|
|
+ elink.download = fileName
|
|
|
|
+ elink.style.display = 'none'
|
|
|
|
+ elink.href = URL.createObjectURL(blob)
|
|
|
|
+ document.body.appendChild(elink)
|
|
|
|
+ elink.click()
|
|
|
|
+ URL.revokeObjectURL(elink.href) // 释放URL 对象
|
|
|
|
+ document.body.removeChild(elink)
|
|
|
|
+ } else { // IE10+下载
|
|
|
|
+ navigator.msSaveBlob(blob, fileName)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
//点击表格
|
|
//点击表格
|
|
clickTable(info,row){
|
|
clickTable(info,row){
|
|
@@ -91,21 +145,48 @@
|
|
this.createHot()
|
|
this.createHot()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //页面发生更改
|
|
|
|
+ changePage(){
|
|
|
|
+ if(!this.changeFlag){
|
|
|
|
+ //发生更改,提示是否保存
|
|
|
|
+ this.$confirm('存在数据未保存, 是否继续?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.getData()
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.pages.currentPage = this.oldPage.currentPage
|
|
|
|
+ this.pages.size = this.oldPage.size
|
|
|
|
+ return false
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ this.getData()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
getData() {
|
|
getData() {
|
|
// width = (document.getElementById("app").clientWidth - 50) / header.length
|
|
// width = (document.getElementById("app").clientWidth - 50) / header.length
|
|
|
|
+ this.isLoading = true
|
|
let param = {
|
|
let param = {
|
|
type: this.protocolType,
|
|
type: this.protocolType,
|
|
data: {
|
|
data: {
|
|
Filters: {
|
|
Filters: {
|
|
DatasourceId: this.datasourceId,
|
|
DatasourceId: this.datasourceId,
|
|
},
|
|
},
|
|
- "PageNumber": 1,
|
|
|
|
- "PageSize": 50,
|
|
|
|
|
|
+ "PageNumber": this.pages.currentPage || 1,
|
|
|
|
+ "PageSize": this.pages.size,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.oldPage = {
|
|
|
|
+ size: this.pages.size,
|
|
|
|
+ currentPage: this.pages.currentPage
|
|
|
|
+ }
|
|
queryPoint(param, res => {
|
|
queryPoint(param, res => {
|
|
console.log(res)
|
|
console.log(res)
|
|
|
|
+ this.isLoading = false
|
|
|
|
+ this.changeFlag = true
|
|
this.allData = res.Content || []
|
|
this.allData = res.Content || []
|
|
|
|
+ this.pages.total = res.Total
|
|
this.createHot()
|
|
this.createHot()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -223,7 +304,8 @@
|
|
components: {
|
|
components: {
|
|
handsontableComponent,
|
|
handsontableComponent,
|
|
ownDialog,
|
|
ownDialog,
|
|
- localtionFalg
|
|
|
|
|
|
+ localtionFalg,
|
|
|
|
+ pagination
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|