Browse Source

feat(schemaselect): support condition refresh through mergeCondition

Casper Dai 3 years ago
parent
commit
e3440cb95b
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/components/form/Select/index.vue

+ 11 - 1
src/components/form/Select/index.vue

@@ -89,10 +89,19 @@ export default {
         )
       }
     },
+    mergeCondition (condition) {
+      const { options, remote } = this.schema
+      if (remote) {
+        this.schema.condition = { ...this.schema, ...condition }
+        this.optionData = options
+        this.loaded = false
+      }
+    },
     loadSelectOptions () {
-      const { pagination, remote } = this.schema
+      const { pagination, remote, condition } = this.schema
       return pagination
         ? remote({
+          ...condition,
           pageSize: 10,
           pageNum: 1
         }).then(({ data, totalCount }) => {
@@ -100,6 +109,7 @@ export default {
             return { data }
           }
           return remote({
+            ...condition,
             pageSize: totalCount,
             pageNum: 1
           })