
-
新增模型
+
{{ props.title }}
@@ -14,62 +14,73 @@
-
-
+
+
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -80,6 +91,8 @@
取消
+
+
@@ -89,98 +102,34 @@ import type { FormInstance } from "element-plus";
import { ElMessage, UploadProps } from "element-plus";
import { gltfModelAdd, gltfModelDetails, gltfModelEdit } from "@/api/modules/mapCommon";
import testMap from "@/components/testMap/index.vue";
-import { GlobalStore } from "@/stores";
const props = defineProps({
operateVisible: Boolean,
relativeId: String,
title: String
});
const emits = defineEmits(["update:operateVisible", "confirm"]);
-const baseUrl = import.meta.env.VITE_API_URL;
-const fileList = ref([]);
-const store = GlobalStore();
-const headers = ref({ Authorization: "Bearer " + store.token });
const positions = ref([{ lng: "", lat: "", alt: "" }]);
const minLength = ref(1); // 最小点位长度
-const effectTypeList = ref([
- { label: "圆扩散", value: "ScanLine" },
- { label: "波纹扩散", value: "CircleWave" },
- { label: "雷达线", value: "RadarLine" },
- { label: "波纹雷达扫描", value: "RadarWave" },
- { label: "自定义图形扩散", value: "CircleScan" }
-]);
const testMapVisible = ref(false);
const rules = ref({
- type: [
- {
- required: true,
- message: "请选择",
- trigger: "change"
- }
- ],
- radius: [
+ name: [
{
required: true,
message: "请输入",
- trigger: "blur"
+ trigger: "input"
}
],
- speed: [
+ url: [
{
required: true,
message: "请输入",
- trigger: "blur"
- }
- ],
- diffHeight: [
- {
- required: true,
- message: "请输入",
- trigger: "blur"
- }
- ],
- image: [
- {
- required: true,
- message: "请上传",
- trigger: "change"
+ trigger: "input"
}
]
});
const formRef = ref
();
const formData = ref({});
const visible1 = ref(false);
-// 图片上传成功后的钩子
-const handleAvatarSuccess: UploadProps["onSuccess"] = (response, uploadFile, index) => {
- console.log(response.result.url);
- console.log(response, uploadFile, index);
- formData.value.image = response.result.url;
-};
-
-const beforeAvatarUpload: UploadProps["beforeUpload"] = rawFile => {
- if (rawFile.type !== "image/png" && rawFile.type !== "image/jpg" && rawFile.type !== "image/jpeg") {
- console.log(rawFile.type);
-
- ElMessage.error("请上传jpg或者png格式的图片");
- return false;
- }
- // 限制文件大小
- // else if (rawFile.size / 1024 / 1024 > 2) {
- // ElMessage.error('Avatar picture size can not exceed 2MB!')
- // return false
- // }
- return true;
-};
-// 类型切换
-const typeChange = (e: any) => {
- console.log(e);
- if (!e) return;
- if (e == "多边形扩散") {
- minLength.value = 3;
- } else {
- minLength.value = 1;
- }
-};
// 追加行数据
const appendRow = () => {
positions.value.push({ lng: "", lat: "", alt: "" });
@@ -233,12 +182,12 @@ const confirmSubmit = () => {
return;
}
requestData = { ...requestData, ...positions.value[0] };
- if (props.title == "新增点坐标效果") {
+ if (props.title == "新增模型") {
const res: any = await gltfModelAdd(requestData);
if (res.code == 200) {
ElMessage.success("操作成功");
}
- } else if (props.title == "编辑点坐标效果") {
+ } else if (props.title == "编辑模型") {
const res: any = await gltfModelEdit(requestData);
if (res.code == 200) {
ElMessage.success("操作成功");
@@ -260,10 +209,10 @@ watch(
() => props.operateVisible,
n => {
if (n) {
- if (props.title == "新增点坐标效果") {
+ if (props.title == "新增模型") {
formData.value = {};
positions.value = [{ lng: "", lat: "", alt: "" }];
- } else if (props.title == "编辑点坐标效果") {
+ } else if (props.title == "编辑模型") {
getInfo();
}
visible1.value = n;
diff --git a/src/views/jxjview/modelManagement/index.vue b/src/views/jxjview/modelManagement/index.vue
index 4573378..a6bf325 100644
--- a/src/views/jxjview/modelManagement/index.vue
+++ b/src/views/jxjview/modelManagement/index.vue
@@ -33,7 +33,12 @@
-
+
@@ -67,13 +72,13 @@ const columns: ColumnProps[] = [
label: "ID"
},
// 多级 prop
- { prop: "createTime", label: "名称", search: { el: "input" } },
- { prop: "createTime", label: "是否显示" },
- { prop: "createTime", label: "lon经度" },
- { prop: "createTime", label: "lat纬度" },
- { prop: "governmentTel", label: "高度" },
- { prop: "state", label: "创建时间" },
- { prop: "diffDay", label: "更新时间" },
+ { prop: "name", label: "名称", search: { el: "input" } },
+ { prop: "show", label: "是否显示" },
+ { prop: "lng", label: "lon经度" },
+ { prop: "lat", label: "lat纬度" },
+ { prop: "alt", label: "高度" },
+ { prop: "createTime", label: "创建时间" },
+ { prop: "updateTime", label: "更新时间" },
{ prop: "operation", label: "操作", fixed: "right", width: 160 }
];
// const AuthIdData = ref([]);