Prechádzať zdrojové kódy

优化`DEBUG`时`null`值的显示

mxd 3 rokov pred
rodič
commit
90dd77095c

+ 1 - 0
magic-editor/src/console/src/components/common/magic-structure-array.vue

@@ -26,6 +26,7 @@
           <span v-else-if="typeof value === 'string'" class="string">"{{value.replace(/"/g, "\"")}}"</span>
           <span v-else-if="typeof value === 'number'" class="number">{{value}}</span>
           <span v-else-if="typeof value === 'boolean'" class="boolean">{{value}}</span>
+          <span v-else-if="value == null" class="boolean">null</span>
           <span v-else>{{value}}</span>
           <magic-structure-array v-if="value && Array.isArray(value) && expandKeys[key]" :data="value" :indent="indent + 1" :simple="false"/>
           <magic-structure-object v-else-if="value && typeof value === 'object' && expandKeys[key]" :data="value" :indent="indent + 1" :simple="false"/>

+ 2 - 0
magic-editor/src/console/src/components/common/magic-structure-object.vue

@@ -12,6 +12,7 @@
           <span v-else-if="typeof value === 'string'" class="string">"{{value.replace(/"/g, "\"")}}"</span>
           <span v-else-if="typeof value === 'number'" class="number">{{value}}</span>
           <span v-else-if="typeof value === 'boolean'" class="boolean">{{value}}</span>
+          <span v-else-if="value == null" class="boolean">null</span>
           <span v-else>{{value}}</span>
         </span>
       <span>}</span>
@@ -28,6 +29,7 @@
         <span v-else-if="typeof value === 'string'" class="string">"{{value.replace(/"/g, "\"")}}"</span>
         <span v-else-if="typeof value === 'number'" class="number">{{value}}</span>
         <span v-else-if="typeof value === 'boolean'" class="boolean">{{value}}</span>
+        <span v-else-if="value == null" class="boolean">null</span>
         <span v-else>{{value}}</span>
         <magic-structure-array v-if="value && Array.isArray(value) && expandKeys[key]" :data="value" :indent="indent + 1" :simple="false"/>
         <magic-structure-object v-else-if="value && typeof value === 'object' && expandKeys[key]" :data="value" :indent="indent + 1" :simple="false"/>

+ 1 - 0
magic-editor/src/console/src/components/common/magic-structure.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="ma-structure-container">
     <span :class="type.substring(10).toLowerCase()" v-if="displayText">{{ data }}</span>
+    <span class="boolean" v-else-if="!type">null</span>
     <magic-structure-array v-else-if="Array.isArray(jsonData)" :data="jsonData"/>
     <magic-structure-object v-else :data="jsonData"/>
   </div>

+ 0 - 21
magic-editor/src/console/src/components/layout/magic-debug.vue

@@ -50,27 +50,6 @@ export default {
     },
     variables() {
       return this.info && this.info.ext && this.info.ext.variables || []
-      /*return [{
-        name: "11",
-        type: "java.lang.String",
-        value: "abcd"
-      },{
-        name: "11",
-        type: "xx.xx.xx",
-        value: `[{
-          "ne" : {
-            "xx" :1
-          },
-          "name": "xx",
-          "b" : true,
-          "i" : 1,
-          "arr" : ${JSON.stringify(new Array(301).fill(1).map((it,index) => index))},
-          "arr1" : [{
-            "name": 123
-          },2,3,4,5,6,7,8,9,10],
-          "f" : 123.456
-        }]`
-      }]*/
     }
   }
 }