diff --git a/client/item/routes.json b/client/item/routes.json index 803a8cce8..014dc318d 100644 --- a/client/item/routes.json +++ b/client/item/routes.json @@ -1,7 +1,7 @@ { "module": "item", "name": "Items", - "icon": "/static/images/icon_item.svg", + "icon": "/static/images/icon_item.png", "routes": [ { "url": "/item", @@ -17,6 +17,10 @@ "url": "/create", "state": "item.create", "component": "vn-item-create" + }, { + "url": "/data", + "state": "item.data", + "component": "vn-item-data" } ] } \ No newline at end of file diff --git a/client/item/src/list/item-product.html b/client/item/src/list/item-product.html new file mode 100644 index 000000000..6368f1f95 --- /dev/null +++ b/client/item/src/list/item-product.html @@ -0,0 +1,14 @@ + + + + + + +
{{$ctrl.item.name}}
+
Id: {{$ctrl.item.id}}
+
Category: {{$ctrl.item.category}}
+
Description: {{$ctrl.item.description}}
+
Size: {{$ctrl.item.size}}
+
+
+
diff --git a/client/item/src/list/item-product.js b/client/item/src/list/item-product.js new file mode 100644 index 000000000..4f7c7b4e7 --- /dev/null +++ b/client/item/src/list/item-product.js @@ -0,0 +1,8 @@ +import ngModule from '../module'; + +ngModule.component('vnItemProduct', { + template: require('./item-product.html'), + bindings: { + item: '<' + } +}); diff --git a/client/item/src/list/list.js b/client/item/src/list/list.js index ce4d773fa..db48692d8 100644 --- a/client/item/src/list/list.js +++ b/client/item/src/list/list.js @@ -1,4 +1,6 @@ import ngModule from '../module'; +import './item-product'; +import './style.css'; class ItemList { constructor() { diff --git a/client/item/src/list/style.css b/client/item/src/list/style.css new file mode 100644 index 000000000..f6afaff66 --- /dev/null +++ b/client/item/src/list/style.css @@ -0,0 +1,16 @@ +vn-item-product { + display: block; +} +vn-item-product a { + display: block; + text-decoration: none; + color: inherit; +} +vn-item-product a:hover { + color: white; + background-color: #424242; +} + +.vn-item-product-name { + font-family: vn-font-bold; +} diff --git a/services/item/common/methods/item/filter.js b/services/item/common/methods/item/filter.js index 59be28565..c60c2222b 100644 --- a/services/item/common/methods/item/filter.js +++ b/services/item/common/methods/item/filter.js @@ -6,7 +6,7 @@ module.exports = Self => { where: {}, skip: (params.page - 1) * params.size, limit: params.size, - order: params.order || 'name ASC'/* , + order: params.order || 'relevancy DESC'/* , include: { relation: "greugeType", scope: { diff --git a/services/item/common/models/item.json b/services/item/common/models/item.json index 8479e2217..0ccbb2e4c 100644 --- a/services/item/common/models/item.json +++ b/services/item/common/models/item.json @@ -30,6 +30,15 @@ }, "isBargain": { "type": "Boolean" + }, + "comment": { + "type": "String" + }, + "relevancy": { + "type": "Number" + }, + "image": { + "type": "String" } } } \ No newline at end of file diff --git a/services/nginx/static/images/icon_item.png b/services/nginx/static/images/icon_item.png new file mode 100644 index 000000000..ff660fb23 Binary files /dev/null and b/services/nginx/static/images/icon_item.png differ diff --git a/services/nginx/static/images/icon_item.svg b/services/nginx/static/images/icon_item.svg deleted file mode 100644 index 2cebc333f..000000000 --- a/services/nginx/static/images/icon_item.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -