|
@@ -1,6 +1,6 @@
|
|
|
import _ from 'lodash'
|
|
|
-import {lookupScope, lookupFn} from "../lib/lib";
|
|
|
-import {serverInvokeUrlTransform, apiConvert} from "../lib/config";
|
|
|
+import {lookupFn, lookupScope} from "../lib/lib";
|
|
|
+import {apiConvert, serverInvokeUrlTransform} from "../lib/config";
|
|
|
import {calcObjectFlat} from '../lib/systemLib'
|
|
|
|
|
|
/**
|
|
@@ -11,8 +11,22 @@ export function gridInvokeBuild(scope, grid, config, dataSource, reloadParams =
|
|
|
const params = calcObjectFlat(scope.viewModel.data, dataSource.params)
|
|
|
let storeOption = {}
|
|
|
if (dataSource.method === 'invoke') {
|
|
|
+
|
|
|
+ const fields = []
|
|
|
+ _.forEach(grid.columns, col => {
|
|
|
+ const c = {}
|
|
|
+ if (col.dataIndex) {
|
|
|
+ c.name = col.dataIndex
|
|
|
+ fields.push(c)
|
|
|
+ }
|
|
|
+ if (col.dataType) {
|
|
|
+ c.type = col.dataType
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
// 默认支持 gridInvoke
|
|
|
storeOption = {
|
|
|
+ fields,
|
|
|
remoteSort: config.remoteSort,
|
|
|
remoteFilter: config.remoteFilter,
|
|
|
autoLoad: true,
|