Newer
Older
KaiFengH5 / src / views / home / home_demo.vue
@zhangdeliang zhangdeliang on 24 May 1 KB 项目初始化
<template>
  <div id="home">
    字典获取:
    <!-- <p v-for="item in case_level" :key="item">{{ item.label }}</p> -->
    <van-divider />
    <van-button type="warning" @click="popupMap = true"
      >高德地图选择位置获取经纬度</van-button
    >
    <van-popup v-model:show="popupMap" position="bottom" :style="{ height: '100%' }">
      <GaodeMap v-if="popupMap" @close="close"></GaodeMap>
    </van-popup>
    <br /><br />
    {{ mapParams.address }}--{{ mapParams.lon }}--{{ mapParams.lat }}
    <van-divider />
    公共图片上传:
    <FileUpload :saveFileArr="fileArrs" @update:saveFileArr="getFileArr"></FileUpload>
    <van-divider />
  </div>
</template>

<script setup name="home">
// import { useDict } from "@/utils/dict";
import { useRouter } from "vue-router";
import FileUpload from "@/views/components/uploadFile.vue";
import GaodeMap from "@/views/components/GaodeMap.vue";

// const { case_level } = useDict("case_level");
const router = useRouter();
const { proxy } = getCurrentInstance();
const popupMap = ref(false);
const mapParams = ref({});

const fileArrs = ref([
  {
    url:
      "http://42.193.7.161:9000/newfiber-standard/2023/07/12/200X200_20230712152340A182.png",
    name: "200X200_20230712152340A182.png",
    originalName: "200X200.png",
    id: "222",
  },
]);
//获取上传的图片
function getFileArr(val) {
  fileArrs.value = val;
  console.log("fileArrs---", val);
}
// 关闭选择位置弹窗,接收从子组件传过来的值
function close(data) {
  console.log("地图选点参数--", data);
  mapParams.value = data;
  popupMap.value = false;
}
onMounted(() => {});
</script>

<style lang="less" scoped>
#home {
  width: 100%;
  height: 100%;
}
</style>