general-basic-form 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "general-basic-form",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  * @Author: 陈德立*******419287484@qq.com
3
3
  * @Date: 2021-08-20 17:14:53
4
- * @LastEditTime: 2021-10-14 19:06:22
4
+ * @LastEditTime: 2021-10-16 15:06:06
5
5
  * @LastEditors: 陈德立*******419287484@qq.com
6
6
  * @Github: https://github.com/Alan1034
7
7
  * @Description:
@@ -105,10 +105,12 @@ export default {
105
105
  default: false,
106
106
  },
107
107
  getList: {
108
+ // 查找数据调用的函数
108
109
  type: Function,
109
110
  default: () => {},
110
111
  },
111
112
  formItem: {
113
+ // 定义表单的数据
112
114
  type: Array,
113
115
  default: [],
114
116
  },
@@ -127,10 +129,17 @@ export default {
127
129
  type: Boolean,
128
130
  default: () => false,
129
131
  },
132
+ formData: {
133
+ // 外部传入的表单数据,用于回填
134
+ type: Object,
135
+ default: {},
136
+ },
130
137
  },
131
138
  data() {
132
139
  return {
133
- queryParams: { ...(this.noUrlParameters ? {} : this.$route?.query) }, // form表单数据
140
+ queryParams: {
141
+ ...(this.noUrlParameters ? {} : this.$route?.query),
142
+ }, // form表单数据
134
143
  selectSetting: {
135
144
  placeholder: "请选择",
136
145
  clearable: true,
@@ -163,6 +172,14 @@ export default {
163
172
  // queryParams,
164
173
  // };
165
174
  // },
175
+ watch: {
176
+ formData(val) {
177
+ this.queryParams = {
178
+ ...(this.noUrlParameters ? {} : this.queryParams),
179
+ ...val,
180
+ };
181
+ },
182
+ },
166
183
  methods: {
167
184
  /** 搜索按钮操作 */
168
185
  handleQuery() {