Browse Source

feat(records): change

gemercheung 1 year ago
parent
commit
415bff8542
2 changed files with 30 additions and 11 deletions
  1. 24 10
      src/app/map/App.vue
  2. 6 1
      src/view/case/records/manifest.vue

+ 24 - 10
src/app/map/App.vue

@@ -1,6 +1,5 @@
 <template>
   <!-- <div>地图页面</div> -->
-
   <div class="tabbar">
     <div class="nav">
       <el-button-group class="ml-4">
@@ -10,18 +9,19 @@
 
     </div>
   </div>
-
   <div ref="mapEl" class="map-container" v-show="currentType(0)"></div>
-
   <div class="card-container" v-show="currentType(1)">
 
-
     <div class="card-list">
-      <template v-for="item of 100">
-        <el-card style="max-width: 380px">
-          <template #header>Yummy hamburger</template>
-          <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"
-            style="width: 100%" />
+      <template v-for="item of list">
+        <el-card style="width: 480px" shadow="hover" @click="handCardClick(item.caseId)">
+          <!-- {{ item }} -->
+          <div class="card">
+            <span> 项目: {{ item.projectName }}</span>
+            <span> 地址: {{ item.projectAddress }}</span>
+            <span> 类别: {{ item.projectSite }}</span>
+          </div>
+
         </el-card>
       </template>
     </div>
@@ -37,6 +37,7 @@ import { getFuseCodeLink } from "../../view/case/help";
 import comCompany from "@/components/company-select/index.vue";
 
 const current = ref(0);
+const list = ref<any>([])
 
 const currentType = computed(() => (type: number) => current.value === type)
 const handleSelect = (type: number) => {
@@ -110,6 +111,7 @@ const loadMap = async () => {
   const initMakers = async () => {
     const data = await getDataQuest() as any as any[];
     console.log('data', data)
+    list.value = data as any[]
     Array.from(data).forEach((item: any) => {
       // console.log(item)
       const latlng = item.latlng
@@ -147,6 +149,11 @@ const loadMap = async () => {
 };
 
 onMounted(loadMap);
+const handCardClick = (id: number) => {
+  const url = getQuery(id, true)
+  console.log('url', url)
+  window.open(url)
+}
 </script>
 <style>
 body {
@@ -183,7 +190,7 @@ body {
 .card-container {
   width: 100%;
   padding-top: 100px;
-  
+
 }
 
 .card-list {
@@ -195,4 +202,11 @@ body {
   flex-direction: row;
   flex-wrap: wrap;
 }
+
+.card {
+  display: flex;
+  flex-direction: column;
+  cursor: pointer;
+  gap: 10px;
+}
 </style>

+ 6 - 1
src/view/case/records/manifest.vue

@@ -3,7 +3,7 @@
   <div class="records">
     <div class="header">
       <el-button type="primary" @click="handleSave">保存</el-button>
-      <el-button @click="handleExport">导出</el-button>
+      <el-button :disabled="isDisableExport" @click="handleExport">导出</el-button>
     </div>
 
     <div class="content">
@@ -138,6 +138,8 @@ import { ElMessage } from 'element-plus';
 
 const props = defineProps({ caseId: Number })
 
+const isDisableExport = ref(false)
+
 console.log(props)
 
 const data = reactive({
@@ -254,6 +256,9 @@ onMounted(async () => {
 
   console.log('res', res)
   for (var k in data) {
+    if (!res.data) {
+      isDisableExport.value = true
+    }
     if (res.data && res.data.hasOwnProperty(k)) {
       // console.log("Key is " + k)
       data[k] = res.data[k]