fix(smart-table): monitor only ticketFilter use url and add ?q in routes
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
f8f44aaae7
commit
9891f7060d
|
@ -290,7 +290,7 @@ export default class Searchbar extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
let where = null;
|
let where = null;
|
||||||
let params = null;
|
let params = {};
|
||||||
|
|
||||||
if (this.exprBuilder) {
|
if (this.exprBuilder) {
|
||||||
where = buildFilter(filter,
|
where = buildFilter(filter,
|
||||||
|
|
|
@ -19,9 +19,11 @@ export default class SmartTable extends Component {
|
||||||
this.transclude();
|
this.transclude();
|
||||||
}
|
}
|
||||||
|
|
||||||
$onInit() {
|
$onChanges() {
|
||||||
if (this.model)
|
if (this.model) {
|
||||||
this.defaultFilter();
|
this.defaultFilter();
|
||||||
|
this.defaultOrder();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$onDestroy() {
|
$onDestroy() {
|
||||||
|
@ -53,11 +55,8 @@ export default class SmartTable extends Component {
|
||||||
|
|
||||||
set model(value) {
|
set model(value) {
|
||||||
this._model = value;
|
this._model = value;
|
||||||
if (value) {
|
if (value)
|
||||||
this.$.model = value;
|
this.$.model = value;
|
||||||
this.defaultFilter();
|
|
||||||
this.defaultOrder();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getDefaultViewConfig() {
|
getDefaultViewConfig() {
|
||||||
|
@ -168,7 +167,8 @@ export default class SmartTable extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultFilter() {
|
defaultFilter() {
|
||||||
if (!this.$params.q) return;
|
if (this.disabledTableFilter || !this.$params.q) return;
|
||||||
|
|
||||||
const stateFilter = JSON.parse(this.$params.q).tableQ;
|
const stateFilter = JSON.parse(this.$params.q).tableQ;
|
||||||
if (!stateFilter || !this.exprBuilder) return;
|
if (!stateFilter || !this.exprBuilder) return;
|
||||||
|
|
||||||
|
@ -188,6 +188,8 @@ export default class SmartTable extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultOrder() {
|
defaultOrder() {
|
||||||
|
if (this.disabledTableOrder) return;
|
||||||
|
|
||||||
let stateOrder;
|
let stateOrder;
|
||||||
if (this.$params.q)
|
if (this.$params.q)
|
||||||
stateOrder = JSON.parse(this.$params.q).tableOrder;
|
stateOrder = JSON.parse(this.$params.q).tableOrder;
|
||||||
|
@ -607,6 +609,8 @@ ngModule.vnComponent('smartTable', {
|
||||||
autoSave: '<?',
|
autoSave: '<?',
|
||||||
exprBuilder: '&?',
|
exprBuilder: '&?',
|
||||||
defaultNewData: '&?',
|
defaultNewData: '&?',
|
||||||
options: '<?'
|
options: '<?',
|
||||||
|
disabledTableFilter: '<?',
|
||||||
|
disabledTableOrder: '<?',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
"acl": ["claimManager"]
|
"acl": ["claimManager"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "/action",
|
"url": "/action?q",
|
||||||
"state": "claim.card.action",
|
"state": "claim.card.action",
|
||||||
"component": "vn-claim-action",
|
"component": "vn-claim-action",
|
||||||
"description": "Action",
|
"description": "Action",
|
||||||
|
|
|
@ -406,13 +406,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "/defaulter",
|
"url": "/defaulter?q",
|
||||||
"state": "client.defaulter",
|
"state": "client.defaulter",
|
||||||
"component": "vn-client-defaulter",
|
"component": "vn-client-defaulter",
|
||||||
"description": "Defaulter"
|
"description": "Defaulter"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url" : "/notification",
|
"url" : "/notification?q",
|
||||||
"state": "client.notification",
|
"state": "client.notification",
|
||||||
"component": "vn-client-notification",
|
"component": "vn-client-notification",
|
||||||
"description": "Notifications"
|
"description": "Notifications"
|
||||||
|
@ -424,7 +424,7 @@
|
||||||
"description": "Unpaid"
|
"description": "Unpaid"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "/extended-list",
|
"url": "/extended-list?q",
|
||||||
"state": "client.extendedList",
|
"state": "client.extendedList",
|
||||||
"component": "vn-client-extended-list",
|
"component": "vn-client-extended-list",
|
||||||
"description": "Extended list"
|
"description": "Extended list"
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<th field="itemFk">
|
<th field="itemFk">
|
||||||
<span translate>Item ID</span>
|
<span translate>Item ID</span>
|
||||||
</th>
|
</th>
|
||||||
<th field="itemName">
|
<th field="name">
|
||||||
<span translate>Description</span>
|
<span translate>Description</span>
|
||||||
</th>
|
</th>
|
||||||
<th field="warehouseFk">
|
<th field="warehouseFk">
|
||||||
|
|
|
@ -12,14 +12,6 @@ export default class Controller extends Section {
|
||||||
},
|
},
|
||||||
defaultSearch: true,
|
defaultSearch: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
|
||||||
field: 'itemName',
|
|
||||||
autocomplete: {
|
|
||||||
url: 'Items',
|
|
||||||
showField: 'name',
|
|
||||||
valueField: 'id'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'warehouseFk',
|
field: 'warehouseFk',
|
||||||
autocomplete: {
|
autocomplete: {
|
||||||
|
@ -105,8 +97,8 @@ export default class Controller extends Section {
|
||||||
|
|
||||||
exprBuilder(param, value) {
|
exprBuilder(param, value) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'itemName':
|
case 'name':
|
||||||
return {'i.id': value};
|
return {'i.name': {like: `%${value}%`}};
|
||||||
case 'itemFk':
|
case 'itemFk':
|
||||||
case 'warehouseFk':
|
case 'warehouseFk':
|
||||||
case 'rate2':
|
case 'rate2':
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
model="model"
|
model="model"
|
||||||
options="$ctrl.smartTableOptions"
|
options="$ctrl.smartTableOptions"
|
||||||
expr-builder="$ctrl.exprBuilder(param, value)"
|
expr-builder="$ctrl.exprBuilder(param, value)"
|
||||||
|
disabled-table-filter="true"
|
||||||
|
disabled-table-order="true"
|
||||||
class="scrollable sm">
|
class="scrollable sm">
|
||||||
<slot-actions>
|
<slot-actions>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
"abstract": true,
|
"abstract": true,
|
||||||
"component": "vn-route-card"
|
"component": "vn-route-card"
|
||||||
}, {
|
}, {
|
||||||
"url": "/agency-term",
|
"url": "/agency-term?q",
|
||||||
"abstract": true,
|
"abstract": true,
|
||||||
"state": "route.agencyTerm",
|
"state": "route.agencyTerm",
|
||||||
"component": "ui-view"
|
"component": "ui-view"
|
||||||
|
|
Loading…
Reference in New Issue