Browse Source

Merge branch 'test' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into test

shibei_master
dai 4 years ago
parent
commit
ed42791662
  1. 8
      src/views/modules/base/community/buildForm.vue
  2. 2
      src/views/modules/base/community/buildTable.vue
  3. 69
      src/views/modules/base/community/communityTable.vue

8
src/views/modules/base/community/buildForm.vue

@ -61,14 +61,14 @@
:min="0"
label="层数"></el-input-number>
</el-form-item>
<el-form-item label="户数"
<el-form-item label="户数"
style="display: block"
prop="totalHouseNum"
label-width="150px">
<el-input-number class="item_width_1"
v-model="dataForm.totalHouseNum"
:min="0"
label="户数"></el-input-number>
label="户数"></el-input-number>
</el-form-item>
<el-form-item label="位置坐标"
@ -143,7 +143,7 @@ export default {
// sort: 0,//
totalUnitNum: 1,//
totalFloorNum: 0,//
totalHouseNum: 0,//
totalHouseNum: 0,//
type: '',//
location: '', //
longitude: '', //
@ -324,7 +324,7 @@ export default {
// sort: 0,//
totalUnitNum: 1,//
totalFloorNum: 0,//
totalHouseNum: 0,//
totalHouseNum: 0,//
type: '',//
location: '', //
longitude: '', //

2
src/views/modules/base/community/buildTable.vue

@ -84,7 +84,7 @@
label="层数">
</el-table-column>
<el-table-column prop="totalHouseNum"
label="户数">
label="户数">
</el-table-column>
<el-table-column label="操作"

69
src/views/modules/base/community/communityTable.vue

@ -31,23 +31,42 @@
@click="handleSearch">查询</el-button>
</div>
<div class="div_btn">
<el-button style="float:left"
<el-button style=""
type="yellow"
size="small"
@click="handleExport">导出</el-button>
<el-button style="float:left"
<el-button style=""
type="green"
size="small"
@click="handleAdd">新增小区</el-button>
<el-button style="float:left"
<el-button style=""
type="blue"
size="small"
@click="handleExportModule">下载小区模板</el-button>
<el-upload ref="upload"
style=""
:multiple='false'
:show-file-list='false'
:before-upload="beforeUpload"
:before-upload="((file)=>{beforeUpload(file, 'community')})"
action=""
accept=".xls,.xlsx"
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
type="red">导入小区数据</el-button>
</el-upload>
<el-button style=";margin-left:10px"
type="blue"
size="small"
@click="handleExportModule">下载楼宇模板</el-button>
<el-upload style=""
ref="upload"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'building')})"
action=""
accept=".xls,.xlsx"
:limit="1"
@ -55,7 +74,26 @@
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
type="red">导入小区数据</el-button>
type="red">导入楼宇数据</el-button>
</el-upload>
<el-button style=";margin-left:10px"
type="blue"
size="small"
@click="handleExportModule">下载房屋模板</el-button>
<el-upload style=""
ref="upload"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'room')})"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
type="red">导入房屋数据</el-button>
</el-upload>
</div>
@ -338,7 +376,7 @@ export default {
},
//
download (data, fileName) {
download (data, downFileName) {
if (!data) {
return
}
@ -346,7 +384,7 @@ export default {
var csvData = new Blob([data])
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
window.navigator.msSaveOrOpenBlob(csvData, downFileName);
}
// for Non-IE (chrome, firefox etc.)
else {
@ -355,7 +393,7 @@ export default {
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.download = downFileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
@ -384,7 +422,7 @@ export default {
},
//
beforeUpload (file) {
beforeUpload (file, type) {
this.files = file;
const isText = file.type === 'application/vnd.ms-excel'
@ -392,6 +430,8 @@ export default {
if (!isText && !isTextComputer) {
this.$message.error('请选择正确格式的文件')
this.files = null
this.fileName = ''
return false
} else {
this.fileName = file.name;
@ -401,16 +441,17 @@ export default {
},
//
handleExceed (files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`)
},
async uploadFile () {
this.loading = true
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件!')
return false
}
this.loading = true
//
this.$refs['upload'].clearFiles()
@ -420,6 +461,7 @@ export default {
fileFormData.append('file', this.files);//filenamefiletest.zip
const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) {
this.$message({
type: "success",
@ -428,10 +470,10 @@ export default {
this.$emit('refreshTree')
this.loadTable()
} else {
this.$message.error(msg)
// debugger
// this.$message.error(msg)
}
},
handleSizeChange (val) {
@ -516,6 +558,7 @@ export default {
}
.div_btn {
display: flex;
margin-top: 20px;
}

Loading…
Cancel
Save