فهرست منبع

优化`TODO`样式,优化`TODO`加载顺序

mxd 3 سال پیش
والد
کامیت
6f2223e3b8

+ 1 - 1
magic-editor/src/console/src/assets/index.css

@@ -106,7 +106,7 @@
     --debug-line-background: #2154A6;
     --breakpoint-line-background: #FAEAE6;
 
-
+    --todo-color: #008DDE;
     --history-select-background: #1A7DC4;
     --history-select-color: #fff;
     scrollbar-color: var(--scollbar-color) var(--scollbar-color);

+ 11 - 6
magic-editor/src/console/src/components/layout/magic-todo.vue

@@ -18,8 +18,8 @@
               <span>({{ item.cache.path }})</span>
             </div>
             <div>
-              <label>&nbsp;{{ item.line }}:</label>
-              <label>{{ item.text }}</label>
+              <label style="padding-left: 5px">{{ item.line }}:</label>
+              <label class="todo-item" >{{ item.text }}</label>
             </div>
           </div>
         </div>
@@ -37,7 +37,7 @@
 
 <script>
 import request from '@/api/request.js'
-
+import bus from '@/scripts/bus.js'
 export default {
   name: 'MagicTodo',
   data() {
@@ -47,6 +47,9 @@ export default {
       showLoading: false
     }
   },
+  mounted() {
+    bus.$on('login', ()=> this.getTodoList())
+  },
   methods: {
     getTodoList() {
       this.showLoading = true
@@ -103,11 +106,13 @@ export default {
 .ma-todo .ma-layout .ma-content .content-bg:nth-child(even) {
   background: var(--table-even-background);
 }
-
+.ma-todo .ma-layout .ma-content .content-bg .todo-item{
+  font-style: italic;
+  color:var(--todo-color)
+}
 .ma-todo .ma-layout .ma-content .content-bg:hover {
-  background: var(--table-hover-background);
+  background: var(--toolbox-list-hover-background);
 }
-
 .ma-layout .ma-sider {
   border: none;
   border-right: 1px solid var(--tab-bar-border-color);

+ 7 - 4
magic-editor/src/console/src/components/magic-editor.vue

@@ -88,10 +88,13 @@ export default {
       websocket: null,
       onLogin: () => {
         this.showLogin = false
-        this.$refs.apiList.initData()
-        this.$refs.functionList.initData()
-        this.$refs.datasourceList.initData()
-        bus.$emit('login');
+        Promise.all([
+          this.$refs.apiList.initData(),
+          this.$refs.functionList.initData(),
+          this.$refs.datasourceList.initData()
+        ]).then(()=>{
+          bus.$emit('login')
+        })
       }
     }
   },

+ 10 - 7
magic-editor/src/console/src/components/resources/magic-api-list.vue

@@ -163,13 +163,16 @@ export default {
     initData() {
       this.showLoading = true
       this.tree = []
-      request.send('group/list?type=1').success(data => {
-        this.listGroupData = data
-        request.send('list').success(data => {
-          this.listChildrenData = data
-          this.initTreeData()
-          this.openItemById()
-          this.showLoading = false
+      return new Promise((resolve) => {
+        request.send('group/list?type=1').success(data => {
+          this.listGroupData = data
+          request.send('list').success(data => {
+            this.listChildrenData = data
+            this.initTreeData()
+            this.openItemById()
+            this.showLoading = false
+            resolve()
+          })
         })
       })
     },

+ 15 - 12
magic-editor/src/console/src/components/resources/magic-datasource-list.vue

@@ -118,18 +118,21 @@ export default {
     initData() {
       this.showLoading = true
       this.datasources = []
-      request.send('datasource/list').success(data => {
-        this.datasources = data;
-        JavaClass.setExtensionAttribute('org.ssssssss.magicapi.modules.SQLModule',this.datasources.filter(it => it.key).map(it => {
-          return {
-            name : it.key,
-            type: 'org.ssssssss.magicapi.modules.SQLModule',
-            comment: it.name
-          }
-        }))
-        setTimeout(() => {
-          this.showLoading = false
-        }, 500)
+      return new Promise((resolve) => {
+        request.send('datasource/list').success(data => {
+          this.datasources = data;
+          JavaClass.setExtensionAttribute('org.ssssssss.magicapi.modules.SQLModule', this.datasources.filter(it => it.key).map(it => {
+            return {
+              name: it.key,
+              type: 'org.ssssssss.magicapi.modules.SQLModule',
+              comment: it.name
+            }
+          }))
+          setTimeout(() => {
+            this.showLoading = false
+          }, 500)
+          resolve()
+        })
       })
     },
     showDetail(id){

+ 10 - 7
magic-editor/src/console/src/components/resources/magic-function-list.vue

@@ -166,13 +166,16 @@ export default {
     initData() {
       this.showLoading = true
       this.tree = []
-      request.send('group/list?type=2').success(data => {
-        this.listGroupData = data;
-        request.send('function/list').success(data => {
-          this.listChildrenData = data
-          this.initTreeData()
-          this.openItemById()
-          this.showLoading = false
+      return new Promise((resolve) => {
+        request.send('group/list?type=2').success(data => {
+          this.listGroupData = data;
+          request.send('function/list').success(data => {
+            this.listChildrenData = data
+            this.initTreeData()
+            this.openItemById()
+            this.showLoading = false
+            resolve()
+          })
         })
       })
     },

+ 1 - 0
magic-editor/src/console/src/scripts/editor/dark-theme.js

@@ -88,5 +88,6 @@ export default {
         'checkbox-text-color': '#bbb',
         'checkbox-selected-background': '#43494A',
         'checkbox-selected-border': '#6B6B6B',
+        'todo-color': '#A8C023'
     }
 };