| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /**
- * Created by zhouy on 2018/10/18.
- */
- Ext.define('saas.view.document.currencys.DataListModel', {
- extend: 'Ext.app.ViewModel',
- alias: 'viewmodel.document-currencys-datalist',
- stores: {
- currencys: {
- fields:[
- {name: 'id', type: 'int'},
- {name: 'cr_rate', type: 'float'},
- {name: 'cr_name', type: 'string'},
- {name: 'cr_standard', type: 'int'},
- ],
- proxy: {
- type: 'ajax',
- url: '/api/document/currency/list',
- actionMethods: {
- read: 'GET'
- },
- reader: {
- type: 'json',
- rootProperty: 'data.list'
- },
- listeners: {
- exception: function(proxy, response, operation, eOpts) {
- if(operation.success) {
- if(response.timedout) {
- saas.util.BaseUtil.showErrorToast('请求超时');
- }
- }else {
- console.error('exception: ', response);
- saas.util.BaseUtil.showErrorToast('查询失败:' + (response.responseJson?response.responseJson.message:'请求超时'));
- }
- }
- }
- },
- pageSize: null,
- autoLoad: false,
- listeners: {
- beforeload: function (store, op) {
- Ext.apply(store.proxy.extraParams, {
- number: 1,
- size: 1000
- });
- }
- }
- }
- }
- });
|