---
title: "Store 与 XWL 文件"
description: "Store 数据源、serverScript 和 dataprovider SQL 的配置说明。"
---

> Documentation Index
> Fetch the complete documentation index at: https://ag.879818327.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Store 与 XWL 文件

## store 数据源

``` javascript
//store 的加载
app.gridFee.store.load({
  params:{
ID:records[0].data.ID
  },//方法1
  out: app.panel//方法2
});
//store beforeLoad
operation.params = {
billId: app.fileBillId.getValue()
};
```

### store不使用xwl

``` javascript
//设置fieds
['label1','label2','label3']
//或
[{
  name: 'BILL_NO',
  type: 'string'
}, {
  name: 'INV_NO',
  type: 'string'
}, {
  name: 'PLAN_MNY',
  type: 'string'
}, {
  name: 'COIN',
  type: 'string'
},
{
  name: 'NOTES',
  type: 'string'
}]
```

## xwl文件

### serverScript

``` javascript
var sql, data = app.get();//获取页面传过来的参数
sql = " ";//拼接sql字符串
if (!Wb.isEmpty(data.lineId)){
  sql += "  and  LINE_ID like '%'||{?lineId?}||'%'";
}
request.setAttribute("whereSql",sql);
```

### dataprovider的sql

``` javascript
select ID, LINE_ID, SIZE_CODE, TYPE_CODE, YARD_CODE, 
   NOTE, CREATED_BY, CREATED_ON,UPDATED_BY, UPDATED_ON
from C_EIRPLAN_TEMPLATE WHERE 1=1 {#whereSql#}	
```

> **Note**
>
> 简单使用引入值

``` javascript
select ID, LINE_ID, SIZE_CODE, TYPE_CODE, YARD_CODE, 
   NOTE, CREATED_BY, CREATED_ON,UPDATED_BY, UPDATED_ON
from C_EIRPLAN_TEMPLATE WHERE 1=1 {?lineId?}	
```

Source: https://ag.879818327.xyz/webbuilder/search/index.mdx
