CzRger vor 1 Jahr
Ursprung
Commit
62359ea95b

+ 5 - 2
src/views/gis/business/common/pie-simple-chart.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="chart-main" ref="ref_main">
     <div class="value">
-      <div class="percent">{{(num / total * 100).toFixed(1)}}%</div>
+      <div class="percent">{{num ? (num / total * 100).toFixed(1) : 0}}%</div>
       <div class="num">{{num}}家</div>
     </div>
     <div class="chart-ref" ref="ref_chart"/>
@@ -67,7 +67,10 @@ export default defineComponent({
             emphasis: {
               disabled: true
             },
-            data: [
+            data: props.num === 0 && props.total === 0 ? [
+              {value: 0, label: 'yes', itemStyle: {color: props.color}},
+              {value: 1, label: 'no', itemStyle: {color: '#C4DAF8'}},
+            ] : [
               {value: props.num, label: 'yes', itemStyle: {color: props.color}},
               {value: props.total - props.num, label: 'no', itemStyle: {color: '#C4DAF8'}},
             ]

+ 8 - 4
src/views/gis/layout/index.vue

@@ -38,7 +38,7 @@
       <div class="gt-tools __box-shadow">
         <template v-for="(item, index) in ToolsMapper">
           <div class="tools-line" v-if="index > 0"/>
-          <div class="tools-item __hover" :class="{active: toolsType === item.value}" @click="toolsHandleClick(item)">
+          <div class="tools-item __hover" :class="{active: toolsType === item.value, disabled: item.disabled}" @click="item.disabled ? undefined : toolsHandleClick(item)">
             {{item.label}}
           </div>
         </template>
@@ -244,9 +244,9 @@ export default defineComponent({
       showVideo: false
     })
     const ToolsMapper = [
-      {label: '图层', value: 'element', com: ElementCom},
-      {label: '框选', value: 'select', com: SelectCom},
-      {label: '周边分析', value: 'analysis', com: AnalysisCom},
+      {label: '图层', value: 'element', com: ElementCom, disabled: true},
+      {label: '框选', value: 'select', com: SelectCom, disabled: true},
+      {label: '周边分析', value: 'analysis', com: AnalysisCom, disabled: true},
       {label: '清空图层', value: 'clear', com: undefined},
       {label: '工具', value: 'tool', com: ToolCom},
       {label: '定位', value: 'position', com: PositionCom},
@@ -775,6 +775,10 @@ export default defineComponent({
           color: #1174DB;
           font-weight: bold;
         }
+        &.disabled {
+          opacity: 0.5;
+          cursor: not-allowed;
+        }
       }
       .tools-line {
         width: 1px;