|
|
@@ -14,7 +14,7 @@
|
|
|
@click="(addtraptf = true), (addtitle = '新增监测点')"
|
|
|
>添加监测点</el-button
|
|
|
>
|
|
|
- <el-button type="info" size="mini" @click="addtraptf = true"
|
|
|
+ <el-button type="info" size="mini" @click="downloadtf = true"
|
|
|
>导入监测点</el-button
|
|
|
>
|
|
|
</div>
|
|
|
@@ -76,7 +76,7 @@
|
|
|
label-width="100px"
|
|
|
class="demo-ruleForm"
|
|
|
>
|
|
|
- <el-form-item label="诱捕器名称" prop="point_name">
|
|
|
+ <el-form-item label="监测点名称" prop="point_name">
|
|
|
<el-input v-model="ruleForm.point_name"></el-input>
|
|
|
</el-form-item>
|
|
|
<div class="addtrapbox">
|
|
|
@@ -106,7 +106,8 @@
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="resetForm('ruleForm')" size="mini">取 消</el-button>
|
|
|
<el-button type="primary" @click="submitForm('ruleForm')" size="mini"
|
|
|
- >确 定</el-button
|
|
|
+ :disabled="releaseTF"
|
|
|
+ >{{ releaseTF ? "发布中..." : "确 定" }}</el-button
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
@@ -153,6 +154,39 @@
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="导入监测点" :visible.sync="downloadtf" width="25%">
|
|
|
+ <div class="downloadbox">
|
|
|
+ <div class="downloadbox_item">
|
|
|
+ <p class="title">导入监测点</p>
|
|
|
+ <!-- <el-input placeholder="请输入内容" v-model="input1">
|
|
|
+ <template slot="prepend">Http://</template>
|
|
|
+ </el-input> -->
|
|
|
+ <el-upload
|
|
|
+ action=""
|
|
|
+ :auto-upload="false"
|
|
|
+ accept=".xlsx, .xls"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-change="handle"
|
|
|
+ >
|
|
|
+ <el-button type="success" size="mini">点击上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ <el-input
|
|
|
+ v-model="downloadinput"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ :disabled="true"
|
|
|
+ size="mini"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <p class="tishi">
|
|
|
+ <span>注:请先下模板,在模板中填入数据上传</span
|
|
|
+ ><span @click="download">下载模板</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <!-- <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="downloadtf = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="downloadtf = false">确 定</el-button>
|
|
|
+ </span> -->
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -211,6 +245,9 @@ export default {
|
|
|
addr: "", //搜索栏地址
|
|
|
address: "", //地图上标签地址
|
|
|
center: [114.05, 22.55],
|
|
|
+ releaseTF:false,
|
|
|
+ downloadinput:"",
|
|
|
+ downloadtf:false
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
@@ -253,6 +290,7 @@ export default {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.addtitle == "新增监测点") {
|
|
|
+ this.releaseTF = true
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=monitor_manage.maintain.checkpoint_add",
|
|
|
@@ -279,8 +317,10 @@ export default {
|
|
|
type: "warning",
|
|
|
});
|
|
|
}
|
|
|
+ this.releaseTF = false
|
|
|
});
|
|
|
} else if (this.addtitle == "修改监测点") {
|
|
|
+ this.releaseTF = true
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=monitor_manage.maintain.checkpoint_modify",
|
|
|
@@ -308,6 +348,7 @@ export default {
|
|
|
type: "warning",
|
|
|
});
|
|
|
}
|
|
|
+ this.releaseTF = false
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
@@ -553,6 +594,38 @@ export default {
|
|
|
return digital.toFixed(6);
|
|
|
}
|
|
|
},
|
|
|
+ handle(ev) {
|
|
|
+ this.downloadinput = ev.name;
|
|
|
+ var datas = new FormData();
|
|
|
+ datas.append("username", localStorage.getItem("usernme"));
|
|
|
+ datas.append("file", ev.raw);
|
|
|
+ this.$axios({
|
|
|
+ method: "POST",
|
|
|
+ url: "/api/monitor_point_export",
|
|
|
+ data: datas,
|
|
|
+ responseType: "blob",
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ this.downloadFile(res, "allot_result.xls");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ download() {
|
|
|
+ //下载模板
|
|
|
+ console.log(22222)
|
|
|
+ window.location.href =
|
|
|
+ // this.$deriveData +
|
|
|
+ "http://192.168.1.17:12345/api/monitor_point_export";
|
|
|
+ },
|
|
|
+ downloadFile(res, name) {
|
|
|
+ let link = document.createElement("a");
|
|
|
+ link.href = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
+ link.target = "_blank";
|
|
|
+ //文件名和格式
|
|
|
+ link.download = name;
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ document.body.removeChild(link);
|
|
|
+ },
|
|
|
},
|
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
@@ -588,4 +661,27 @@ export default {
|
|
|
background-color: #409eff;
|
|
|
border-color: #409eff;
|
|
|
}
|
|
|
+.downloadbox {
|
|
|
+ .downloadbox_item {
|
|
|
+ display: flex;
|
|
|
+ .title {
|
|
|
+ width: 100px;
|
|
|
+ line-height: 28px;
|
|
|
+ }
|
|
|
+ .el-input {
|
|
|
+ width: 250px;
|
|
|
+ margin-left: 15px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tishi {
|
|
|
+ padding-left: 100px;
|
|
|
+ margin-top: 15px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ color: #409eff;
|
|
|
+ span:last-child {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|