Added smart-table to item index
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
fbf1c50f97
commit
eb36f86b9d
|
@ -1,56 +1,88 @@
|
||||||
<vn-auto-search
|
<vn-auto-search
|
||||||
model="model">
|
model="model">
|
||||||
</vn-auto-search>
|
</vn-auto-search>
|
||||||
<vn-data-viewer
|
|
||||||
model="model"
|
|
||||||
class="vn-w-xl vn-mb-xl">
|
|
||||||
<vn-card>
|
<vn-card>
|
||||||
<vn-table
|
<smart-table
|
||||||
model="model"
|
model="model"
|
||||||
show-fields="$ctrl.showFields"
|
view-config-id="itemsIndex"
|
||||||
vn-smart-table="itemIndex">
|
options="$ctrl.smartTableOptions"
|
||||||
<vn-thead>
|
expr-builder="$ctrl.exprBuilder(param, value)">
|
||||||
<vn-tr>
|
<slot-table>
|
||||||
<vn-th shrink></vn-th>
|
<table class="vn-table">
|
||||||
<vn-th field="id" shrink>Id</vn-th>
|
<thead>
|
||||||
<vn-th field="grouping" shrink>Grouping</vn-th>
|
<tr>
|
||||||
<vn-th field="packing" shrink>Packing</vn-th>
|
<th shrink></th>
|
||||||
<vn-th field="name">Description</vn-th>
|
<th field="id" shrink>
|
||||||
<vn-th field="stems" shrink>Stems</vn-th>
|
<span translate>Id</span>
|
||||||
<vn-th field="size" shrink>Size</vn-th>
|
</th>
|
||||||
<vn-th field="typeFk" shrink>Type</vn-th>
|
<th field="grouping" shrink>
|
||||||
<vn-th field="category" shrink>Category</vn-th>
|
<span translate>Grouping</span>
|
||||||
<vn-th field="intrastat" shrink>Intrastat</vn-th>
|
</th>
|
||||||
<vn-th field="origin" shrink>Origin</vn-th>
|
<th field="packing" shrink>
|
||||||
<vn-th field="salesperson" shrink>Buyer</vn-th>
|
<span translate>Packing</span>
|
||||||
<vn-th field="density" shrink>Density</vn-th>
|
</th>
|
||||||
<vn-th field="stemMultiplier" shrink>Multiplier</vn-th>
|
<th field="name">
|
||||||
<vn-th field="active" shrink>Active</vn-th>
|
<span translate>Description</span>
|
||||||
<vn-th field="landed" shrink-date>Landed</vn-th>
|
</th>
|
||||||
<vn-th></vn-th>
|
<th field="stems" shrink>
|
||||||
</vn-tr>
|
<span translate>Stems</span>
|
||||||
</vn-thead>
|
</th>
|
||||||
<vn-tbody>
|
<th field="size" shrink>
|
||||||
<a ng-repeat="item in model.data"
|
<span translate>Size</span>
|
||||||
class="clickable vn-tr search-result"
|
</th>
|
||||||
ui-sref="item.card.summary({id: item.id})">
|
<th field="typeFk" shrink>
|
||||||
<vn-td shrink>
|
<span translate>Type</span>
|
||||||
|
</th>
|
||||||
|
<th field="category" shrink>
|
||||||
|
<span translate>Category</span>
|
||||||
|
</th>
|
||||||
|
<th field="intrastat" shrink>
|
||||||
|
<span translate>Intrastat</span>
|
||||||
|
</th>
|
||||||
|
<th field="origin" shrink>
|
||||||
|
<span translate>Origin</span>
|
||||||
|
</th>
|
||||||
|
<th field="salesperson" shrink>
|
||||||
|
<span translate>Buyer</span>
|
||||||
|
</th>
|
||||||
|
<th field="density" shrink>
|
||||||
|
<span translate>Density</span>
|
||||||
|
</th>
|
||||||
|
<th field="stemMultiplier" shrink>
|
||||||
|
<span translate>Multiplier</span>
|
||||||
|
</th>
|
||||||
|
<th field="active" shrink>
|
||||||
|
<span translate>Active</span>
|
||||||
|
</th>
|
||||||
|
<th field="landed" shrink-date>
|
||||||
|
<span translate>Landed</span>
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="item in model.data"
|
||||||
|
vn-anchor="::{
|
||||||
|
state: 'item.card.summary',
|
||||||
|
params: {id: item.id}
|
||||||
|
}">
|
||||||
|
<td shrink>
|
||||||
<img
|
<img
|
||||||
ng-src="{{::$root.imagePath('catalog', '50x50', item.id)}}"
|
ng-src="{{::$root.imagePath('catalog', '50x50', item.id)}}"
|
||||||
zoom-image="{{::$root.imagePath('catalog', '1600x900', item.id)}}"
|
zoom-image="{{::$root.imagePath('catalog', '1600x900', item.id)}}"
|
||||||
vn-click-stop
|
vn-click-stop
|
||||||
on-error-src/>
|
on-error-src/>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td shrink>
|
<td shrink>
|
||||||
<span
|
<span
|
||||||
vn-click-stop="itemDescriptor.show($event, item.id)"
|
vn-click-stop="itemDescriptor.show($event, item.id)"
|
||||||
class="link">
|
class="link">
|
||||||
{{::item.id}}
|
{{::item.id}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td shrink>{{::item.grouping | dashIfEmpty}}</vn-td>
|
<td shrink>{{::item.grouping | dashIfEmpty}}</td>
|
||||||
<vn-td shrink>{{::item.packing | dashIfEmpty}}</vn-td>
|
<td shrink>{{::item.packing | dashIfEmpty}}</td>
|
||||||
<vn-td vn-fetched-tags>
|
<td vn-fetched-tags>
|
||||||
<div>
|
<div>
|
||||||
<vn-one title="{{::item.name}}">{{::item.name}}</vn-one>
|
<vn-one title="{{::item.name}}">{{::item.name}}</vn-one>
|
||||||
<vn-one ng-if="::item.subName">
|
<vn-one ng-if="::item.subName">
|
||||||
|
@ -62,36 +94,36 @@
|
||||||
item="item"
|
item="item"
|
||||||
tabindex="-1">
|
tabindex="-1">
|
||||||
</vn-fetched-tags>
|
</vn-fetched-tags>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td shrink>{{::item.stems}}</vn-td>
|
<td shrink>{{::item.stems}}</td>
|
||||||
<vn-td shrink>{{::item.size}}</vn-td>
|
<td shrink>{{::item.size}}</td>
|
||||||
<vn-td shrink title="{{::item.typeName}}">
|
<td shrink title="{{::item.typeName}}">
|
||||||
{{::item.typeName}}
|
{{::item.typeName}}
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td shrink title="{{::item.category}}">
|
<td shrink title="{{::item.category}}">
|
||||||
{{::item.category}}
|
{{::item.category}}
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td shrink title="{{::item.intrastat}}">
|
<td shrink title="{{::item.intrastat}}">
|
||||||
{{::item.intrastat}}
|
{{::item.intrastat}}
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td shrink>{{::item.origin}}</vn-td>
|
<td shrink>{{::item.origin}}</td>
|
||||||
<vn-td shrink title="{{::item.userName}}">
|
<td shrink title="{{::item.userName}}">
|
||||||
<span
|
<span
|
||||||
class="link"
|
class="link"
|
||||||
vn-click-stop="workerDescriptor.show($event, item.buyerFk)">
|
vn-click-stop="workerDescriptor.show($event, item.buyerFk)">
|
||||||
{{::item.userName}}
|
{{::item.userName}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td shrink>{{::item.density}}</vn-td>
|
<td shrink>{{::item.density}}</td>
|
||||||
<vn-td shrink >{{::item.stemMultiplier}}</vn-td>
|
<td shrink >{{::item.stemMultiplier}}</td>
|
||||||
<vn-td shrink>
|
<td shrink>
|
||||||
<vn-check
|
<vn-check
|
||||||
disabled="true"
|
disabled="true"
|
||||||
ng-model="::item.isActive">
|
ng-model="::item.isActive">
|
||||||
</vn-check>
|
</vn-check>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td shrink-date>{{::item.landed | date:'dd/MM/yyyy'}}</vn-td>
|
<td shrink-date>{{::item.landed | date:'dd/MM/yyyy'}}</td>
|
||||||
<vn-td shrink>
|
<td shrink>
|
||||||
<vn-horizontal class="buttons">
|
<vn-horizontal class="buttons">
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
vn-click-stop="clone.show(item.id)"
|
vn-click-stop="clone.show(item.id)"
|
||||||
|
@ -104,12 +136,13 @@
|
||||||
icon="preview">
|
icon="preview">
|
||||||
</vn-icon-button>
|
</vn-icon-button>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</vn-td>
|
</td>
|
||||||
</a>
|
</tr>
|
||||||
</vn-tbody>
|
</tbody>
|
||||||
</vn-table>
|
</table>
|
||||||
|
</slot-table>
|
||||||
|
</smart-table>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
</vn-data-viewer>
|
|
||||||
<a ui-sref="item.create" vn-tooltip="New item" vn-bind="+" fixed-bottom-right>
|
<a ui-sref="item.create" vn-tooltip="New item" vn-bind="+" fixed-bottom-right>
|
||||||
<vn-float-button icon="add"></vn-float-button>
|
<vn-float-button icon="add"></vn-float-button>
|
||||||
</a>
|
</a>
|
||||||
|
@ -133,7 +166,7 @@
|
||||||
</vn-popup>
|
</vn-popup>
|
||||||
<vn-contextmenu
|
<vn-contextmenu
|
||||||
vn-id="contextmenu"
|
vn-id="contextmenu"
|
||||||
targets="['vn-data-viewer']"
|
targets="['smart-table']"
|
||||||
model="model"
|
model="model"
|
||||||
expr-builder="$ctrl.exprBuilder(param, value)">
|
expr-builder="$ctrl.exprBuilder(param, value)">
|
||||||
<slot-menu>
|
<slot-menu>
|
||||||
|
|
|
@ -5,9 +5,30 @@ import './style.scss';
|
||||||
class Controller extends Section {
|
class Controller extends Section {
|
||||||
constructor($element, $) {
|
constructor($element, $) {
|
||||||
super($element, $);
|
super($element, $);
|
||||||
this.showFields = {
|
/* this.showFields = {
|
||||||
id: false,
|
id: false,
|
||||||
actions: false
|
actions: false
|
||||||
|
}; */
|
||||||
|
|
||||||
|
this.smartTableOptions = {
|
||||||
|
activeButtons: {
|
||||||
|
search: true,
|
||||||
|
shownColumns: true,
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
field: 'category',
|
||||||
|
autocomplete: {
|
||||||
|
url: 'ItemCategories',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'origin',
|
||||||
|
autocomplete: {
|
||||||
|
url: 'Origins',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ vn-item-product {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vn-table {
|
table {
|
||||||
img {
|
img {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
|
Loading…
Reference in New Issue