在配置templateCell时,设置filter,如下代码:
- columns.forEach((columnName, i) => {
- let obj = {
- type: "List",
- binding: `student[${columnName}]`,
- }
- if (i == 0) {
- obj['filter'] = {
- "condition": {
- "column": "classId",
- "operator": "Equal",
- "dataColumn": {
- "tableName": "class",
- "columnName": "id"
- }
- }
- }
- }
- templateSheet.setValue(0, i, columnName);
- templateSheet.setTemplateCell(1, i, obj)
- })
复制代码
|