diff --git a/client/item/routes.json b/client/item/routes.json index 61197e499..e703ed1de 100644 --- a/client/item/routes.json +++ b/client/item/routes.json @@ -26,10 +26,24 @@ "url" : "/data", "state": "item.card.data", "component": "vn-item-data", + "params": { + "item": "$ctrl.item" + }, "menu": { "description": "Basic data", "icon": "folder" } + }, { + "url" : "/image", + "state": "item.card.image", + "component": "vn-item-image", + "params": { + "item": "$ctrl.item" + }, + "menu": { + "description": "Images", + "icon": "image" + } } ] } \ No newline at end of file diff --git a/client/item/src/card/item-card.html b/client/item/src/card/item-card.html index dc96049a8..179272d51 100644 --- a/client/item/src/card/item-card.html +++ b/client/item/src/card/item-card.html @@ -1,20 +1,16 @@ - - - - + + {{$ctrl.item.name}} + - + diff --git a/client/item/src/card/item-card.js b/client/item/src/card/item-card.js index 0783bb6bd..063910369 100644 --- a/client/item/src/card/item-card.js +++ b/client/item/src/card/item-card.js @@ -1,10 +1,30 @@ import ngModule from '../module'; class ItemCard { - constructor() { + constructor($http, $state) { + this.$http = $http; + this.$state = $state; this.item = {}; } + + $onInit() { + let filter = { + include: [ + {relation: "itemType"}, + {relation: "origin"}, + {relation: "ink"}, + {relation: "producer"}, + {relation: "intrastat"} + ] + }; + this.$http.get(`/item/api/Items/${this.$state.params.id}?filter=${JSON.stringify(filter)}`).then( + res => { + this.item = res.data; + } + ); + } } +ItemCard.$inject = ['$http', '$state']; ngModule.component('vnItemCard', { template: require('./item-card.html'), diff --git a/client/item/src/create/item-create.html b/client/item/src/create/item-create.html index bd3e3cce3..9e8b35e35 100644 --- a/client/item/src/create/item-create.html +++ b/client/item/src/create/item-create.html @@ -56,6 +56,7 @@ field="$ctrl.item.producerFk" > + diff --git a/client/item/src/data/item-data.html b/client/item/src/data/item-data.html index e69de29bb..17c64e329 100644 --- a/client/item/src/data/item-data.html +++ b/client/item/src/data/item-data.html @@ -0,0 +1,84 @@ + + + + + +
+ + + Basic data + + + + + + + + + + {{$parent.$parent.item.description}} + + + + + + + + + + + + + + + + + + + +
+ diff --git a/client/item/src/data/item-data.js b/client/item/src/data/item-data.js index e69de29bb..6046e8dbc 100644 --- a/client/item/src/data/item-data.js +++ b/client/item/src/data/item-data.js @@ -0,0 +1,8 @@ +import ngModule from '../module'; + +ngModule.component('vnItemData', { + template: require('./item-data.html'), + bindings: { + item: '<' + } +}); diff --git a/client/item/src/item.js b/client/item/src/item.js index 6eed86e86..9bdb719a3 100644 --- a/client/item/src/item.js +++ b/client/item/src/item.js @@ -4,3 +4,4 @@ import './list/list'; import './filter-panel/filter-panel'; import './create/item-create'; import './card/item-card'; +import './data/item-data'; diff --git a/client/item/src/list/item-product.html b/client/item/src/list/item-product.html index 9e8fc1417..f4fd431d1 100644 --- a/client/item/src/list/item-product.html +++ b/client/item/src/list/item-product.html @@ -5,7 +5,7 @@
Id: {{$ctrl.item.id}}
-
Category: {{$ctrl.item.category}}
+
Name: {{$ctrl.item.name}}
Description: {{$ctrl.item.description}}
Size: {{$ctrl.item.size}}
Type: {{$ctrl.item.itemType.name}}
diff --git a/client/salix/src/styles/misc.scss b/client/salix/src/styles/misc.scss index 6ee45820d..8d4fd271f 100644 --- a/client/salix/src/styles/misc.scss +++ b/client/salix/src/styles/misc.scss @@ -107,6 +107,7 @@ vn-main-block { margin: 0 auto; .left-block { + max-width: 20em; min-width: 18em; padding-left: 1em; padding-bottom: 1em;