|
@@ -73,7 +73,7 @@ const deepFind = (array, itemOrId, stack) => {
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
|
-provide('findResource', id => {
|
|
|
+const findResource = id => {
|
|
|
const entries = Object.entries(resources.value)
|
|
|
for(let i=0, len = entries.length; i< len; i++){
|
|
|
const nodes = []
|
|
@@ -88,7 +88,8 @@ provide('findResource', id => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-})
|
|
|
+}
|
|
|
+provide('findResource', findResource)
|
|
|
const leftNavbars = [
|
|
|
{ type: 'api', title: $i('api.name'), icon: 'api'},
|
|
|
{ type: 'function', title: $i('fn.name'), icon: 'function'}
|
|
@@ -205,6 +206,12 @@ const resourceOnLoad = () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+bus.$on(Message.REFRESH_RESOURCE, id => {
|
|
|
+ const resource = findResource(id)
|
|
|
+ resource && request.sendGet(`/resource/file/${id}`).success(data => {
|
|
|
+ Object.keys(data).forEach(key => resource.item[key] = data[key])
|
|
|
+ })
|
|
|
+})
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
.magic-main{
|