北京经济技术开发区经开区虚拟城市项目-【前端】-Web
lixuliang
2024-04-12 dbb352c9d988dfac83da979023fe81a0a02f88e9
src/components/left/layerTree/Layer.vue
@@ -492,18 +492,45 @@
        });
    },
    // 清除本地所有标绘信息
    deleteAllPlot() {
      this.$confirm("该操作将清除所有标绘信息,是否继续?", "清除", {
   deleteAllPlot() {
      this.$confirm("该操作将删除所有标绘历史记录,是否继续?", "清除", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$message({
            message: "标绘数据已清除",
            type: "success",
          axios({
            method: "GET",
            url: "http://10.10.4.121:8070/PM20221203225_OpenAPI3_Service-0.0.1-SNAPSHOT/biaoHui/list",
          }).then((response) => {
            let hisIDArr = [];
            response.data.result.forEach((item) => {
              hisIDArr.push({
                id: item.id,
              });
            });
            axios
              .post(
                "http://10.10.4.121:8070/PM20221203225_OpenAPI3_Service-0.0.1-SNAPSHOT/biaoHui/del",
                hisIDArr,
                {
                  headers: {
                    "Content-Type": "application/json",
                  },
                }
              )
              .then((res) => {
                if (res.data.code == 200) {
                  this.$message({
                    message: "删除成功",
                    type: "success",
                  });
                  this.initData({});
                } else {
                  this.$message.error("删除失败!");
                }
              });
          });
          this.initData({});
        })
        .catch(() => {
          this.$message({