|
@@ -6,22 +6,29 @@
|
|
|
<el-button style="float:right;margin-top:4px;" type="primary" @click="downData">下载数据</el-button>
|
|
|
<el-button style="float:right;margin-top:4px;" type="primary" @click="updateExcel = true">导入Excel</el-button>
|
|
|
<el-button style="float:right;margin-top:4px;" type="primary" @click="downloadExcel = true">导出Excel模板</el-button>
|
|
|
- <el-checkbox style="float:right;line-height:40px;" v-model="checked">只显示使用的原始点位</el-checkbox>
|
|
|
+ <el-checkbox style="float:right;line-height:40px;" @change="getData" v-model="checked">只显示使用的原始点位</el-checkbox>
|
|
|
<el-button type="primary">获取原始点位当前值</el-button>
|
|
|
</div>
|
|
|
<div id="handsontableSteps1" v-loading="isLoading">
|
|
|
<handsontable-component v-if="!!allData.length" ref="handsontable" @mouseDown="clickTable" @change="changeHand"></handsontable-component>
|
|
|
<div v-else class="center">暂无数据</div>
|
|
|
</div>
|
|
|
- <own-dialog :width="'580px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="close">
|
|
|
+ <own-dialog :width="'500px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="close">
|
|
|
<localtion-falg :renderData="renderData"></localtion-falg>
|
|
|
</own-dialog>
|
|
|
- <own-dialog :width="'580px'" :index="true" title="导出excel模板" :dialogVisible="downloadExcel" @cancel="close">
|
|
|
+ <own-dialog :width="'300px'" :index="true" title="导出excel模板" :dialogVisible="downloadExcel" @cancel="close">
|
|
|
<div class="center">
|
|
|
<el-button type="text" @click="download">下载模板</el-button>
|
|
|
</div>
|
|
|
</own-dialog>
|
|
|
- <own-dialog :width="'580px'" :index="true" title="导出excel模板" :dialogVisible="updateExcel" @cancel="close">
|
|
|
+ <own-dialog :width="'500px'" :index="true" :footer="footer" title="导出excel模板" :dialogVisible="updateExcel" @confirm="sureOfUpload" @cancel="close">
|
|
|
+ <div class="center" style="height:100px;">
|
|
|
+ <upload-file accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" @change="changeFile"></upload-file>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-radio class="radio-left" v-model="radio" label="1">默认使用导入的全部原始点位</el-radio>
|
|
|
+ <el-radio class="radio-left" v-model="radio" label="2">默认不使用导入的全部原始点位</el-radio>
|
|
|
+ </div>
|
|
|
</own-dialog>
|
|
|
<div class="center">
|
|
|
<pagination :page="pages" @change="changePage"></pagination>
|
|
@@ -46,8 +53,10 @@
|
|
|
queryPoint,
|
|
|
updatePoint,
|
|
|
createPoint,
|
|
|
- downloadTemplete
|
|
|
+ downloadTemplete,
|
|
|
+ uploadPointFile
|
|
|
} from "@/fetch/point_http"
|
|
|
+ import uploadFile from "@/components/common/uploadFile"
|
|
|
import axios from 'axios'
|
|
|
export default {
|
|
|
data() {
|
|
@@ -72,6 +81,12 @@
|
|
|
downloadExcel: false,
|
|
|
isLoading: false,
|
|
|
updateExcel: false,
|
|
|
+ radio: '1',
|
|
|
+ file: "", //上传的文件
|
|
|
+ footer: {
|
|
|
+ cancel: '取消',
|
|
|
+ confirm: '确定'
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -99,13 +114,19 @@
|
|
|
this.updateExcel = false
|
|
|
},
|
|
|
downData() {
|
|
|
- axios({
|
|
|
+ let param = {
|
|
|
method: 'post',
|
|
|
url: `/pointconfig/point/${this.protocolType}/pointlist-export`,
|
|
|
- data: {DataSourceId: this.datasourceId},
|
|
|
+ data: {
|
|
|
+ DataSourceId: this.datasourceId
|
|
|
+ },
|
|
|
responseType: 'blob',
|
|
|
- headers:{ProjectId: this.projectId}
|
|
|
- }).then(function(res) {
|
|
|
+ headers: {
|
|
|
+ ProjectId: this.projectId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(param, 'param')
|
|
|
+ axios(param).then(function(res) {
|
|
|
var blob = new Blob([res.data], {
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
});
|
|
@@ -128,12 +149,18 @@
|
|
|
console.dirxml(err);
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
//下载excel模板
|
|
|
download() {
|
|
|
axios({
|
|
|
method: 'post',
|
|
|
url: `/pointconfig/point/${this.protocolType}/template-export`,
|
|
|
- data: {},
|
|
|
+ data: {
|
|
|
+ DataSourceId: this.datasourceId
|
|
|
+ },
|
|
|
+ headers: {
|
|
|
+ ProjectId: this.projectId
|
|
|
+ },
|
|
|
responseType: 'blob'
|
|
|
}).then(function(res) {
|
|
|
var blob = new Blob([res.data], {
|
|
@@ -189,7 +216,7 @@
|
|
|
clickTable(info, row) {
|
|
|
let activeCell = this.hot.getActiveEditor()
|
|
|
this.renderData = info
|
|
|
- console.log(activeCell,'activeCell')
|
|
|
+ console.log(activeCell, 'activeCell')
|
|
|
if (activeCell.prop == "LocationFlag") {
|
|
|
this.localtionDialog = true
|
|
|
}
|
|
@@ -239,6 +266,9 @@
|
|
|
"PageSize": this.pages.size,
|
|
|
}
|
|
|
}
|
|
|
+ if(this.checked){
|
|
|
+ param.data.Filters.Used = true
|
|
|
+ }
|
|
|
this.oldPage = {
|
|
|
size: this.pages.size,
|
|
|
currentPage: this.pages.currentPage
|
|
@@ -362,21 +392,52 @@
|
|
|
//没有保存的时候弹窗
|
|
|
noSaveData() {
|
|
|
return this.changeFlag
|
|
|
+ },
|
|
|
+ //上传文件
|
|
|
+ changeFile(file) {
|
|
|
+ this.file = file[0] || ''
|
|
|
+ console.log(file, 'file')
|
|
|
+ },
|
|
|
+ //确定上传
|
|
|
+ sureOfUpload() {
|
|
|
+ if (!!this.file) {
|
|
|
+ //有文件进行上传
|
|
|
+ let param = {
|
|
|
+ data: new FormData(),
|
|
|
+ type: this.protocolType
|
|
|
+ };
|
|
|
+ param.data.set('DataSourceId',this.datasourceId)
|
|
|
+ param.data.set('Used',this.radio == 1 ? true : false)
|
|
|
+ param.data.set('multipartFile',this.file.raw)
|
|
|
+ uploadPointFile(param, res => {
|
|
|
+ this.$message.success("上传成功")
|
|
|
+ this.getData()
|
|
|
+ this.updateExcel = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.info("请选择文件")
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
handsontableComponent,
|
|
|
ownDialog,
|
|
|
localtionFalg,
|
|
|
- pagination
|
|
|
+ pagination,
|
|
|
+ uploadFile
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+ .radio-left {
|
|
|
+ display: block;
|
|
|
+ line-height: 30px;
|
|
|
+ margin-left: 100px;
|
|
|
+ }
|
|
|
#handsonStep1 {
|
|
|
flex: 1;
|
|
|
display: flex;
|
|
|
- flex-flow:column;
|
|
|
+ flex-flow: column;
|
|
|
.btns-view {
|
|
|
height: 40px;
|
|
|
line-height: 40px;
|