haiwei-ui 1.1.9 → 1.2.1
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
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
<el-form-item v-if="exportEnabled" v-nm-has="exportBtnCode">
|
|
13
13
|
<nm-button type="primary" @click="onExport" icon="export" text="导出" />
|
|
14
14
|
</el-form-item>
|
|
15
|
-
<el-form-item v-if="importEnabled" v-nm-has="importBtnCode">
|
|
16
|
-
<nm-button type="primary" @click="onImport" icon="import" text="导入" />
|
|
17
|
-
</el-form-item>
|
|
18
15
|
<el-form-item v-if="advanced_.enabled">
|
|
19
16
|
<nm-button ref="showAdvnacedBtn" type="warning" @click="onAdvancedClick">
|
|
20
17
|
高级查询
|
|
@@ -93,11 +90,7 @@
|
|
|
93
90
|
/**显示导出按钮 */
|
|
94
91
|
exportEnabled: Boolean,
|
|
95
92
|
/**导出按钮权限编码 */
|
|
96
|
-
exportBtnCode: String
|
|
97
|
-
/**显示导入按钮 */
|
|
98
|
-
importEnabled: Boolean,
|
|
99
|
-
/**导入按钮权限编码 */
|
|
100
|
-
importBtnCode: String
|
|
93
|
+
exportBtnCode: String
|
|
101
94
|
},
|
|
102
95
|
computed: {
|
|
103
96
|
model_() {
|
|
@@ -194,8 +187,19 @@
|
|
|
194
187
|
onExport() {
|
|
195
188
|
this.$parent.triggerExport()
|
|
196
189
|
},
|
|
197
|
-
|
|
198
|
-
|
|
190
|
+
/** 设置输入框宽度 */
|
|
191
|
+
setInputWidths(formRef) {
|
|
192
|
+
if (!this.inputWidth || !formRef || !formRef.$el) return
|
|
193
|
+
|
|
194
|
+
let inputs = formRef.$el.querySelectorAll('.el-input__inner')
|
|
195
|
+
if (inputs) {
|
|
196
|
+
for (let i = 0; i < inputs.length; i++) {
|
|
197
|
+
const input = inputs[i]
|
|
198
|
+
// 检查是否有data-width属性,如果有则使用该值,否则使用inputWidth
|
|
199
|
+
const customWidth = input.getAttribute('data-width')
|
|
200
|
+
input.style.width = customWidth || this.inputWidth
|
|
201
|
+
}
|
|
202
|
+
}
|
|
199
203
|
}
|
|
200
204
|
},
|
|
201
205
|
mounted() {
|
|
@@ -205,12 +209,19 @@
|
|
|
205
209
|
this.query()
|
|
206
210
|
}
|
|
207
211
|
})
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
// 设置普通查询栏输入框宽度
|
|
213
|
+
this.setInputWidths(this.$refs.normalForm)
|
|
214
|
+
})
|
|
215
|
+
},
|
|
216
|
+
watch: {
|
|
217
|
+
showAdvanced(newVal) {
|
|
218
|
+
if (newVal && this.$refs.advancedForm) {
|
|
219
|
+
// 高级查询框显示时,设置其中的输入框宽度
|
|
220
|
+
this.$nextTick(() => {
|
|
221
|
+
this.setInputWidths(this.$refs.advancedForm)
|
|
222
|
+
})
|
|
215
223
|
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
216
227
|
</script>
|