@tongfun/tf-widget 0.1.26 → 0.1.27
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/README.md +15 -2
- package/lib/tf-widget.common.js +90 -71
- package/lib/tf-widget.css +1 -1
- package/lib/tf-widget.umd.js +90 -71
- package/lib/tf-widget.umd.min.js +4 -4
- package/package/t-data-list/main.vue +1 -1
- package/package/t-input/children/basic.vue +14 -8
- package/package.json +2 -2
- package/src/mixins/t-data-query-mixin.js +12 -9
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
28
|
<!-- 搜索输入框 -->
|
|
29
|
-
<TListSearch ref="tListSearchRef" class="common-table-buttons-search" @search="handleSuggestMultiCondition($event)" />
|
|
29
|
+
<TListSearch ref="tListSearchRef" class="common-table-buttons-search" @search="handleSuggestMultiCondition($event,false)" />
|
|
30
30
|
</div>
|
|
31
31
|
<!--过滤方案-->
|
|
32
32
|
<Tplan ref="TplanRef" :fields-option="tableLayout" @change="handlePlanConditionChange" />
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
</div>
|
|
49
49
|
<template v-slot:title>
|
|
50
50
|
<div class="common-title">
|
|
51
|
-
<TListSearch class="common-table-buttons-search" @search="handleSuggestMultiCondition($event,
|
|
51
|
+
<TListSearch class="common-table-buttons-search" @search="handleSuggestMultiCondition($event,false)" />
|
|
52
52
|
</div>
|
|
53
53
|
</template>
|
|
54
54
|
<span slot="footer" class="dialog-footer basic-selector-footer">
|
|
@@ -136,6 +136,7 @@ export default {
|
|
|
136
136
|
await this.getTableLayout()
|
|
137
137
|
}
|
|
138
138
|
loading.close()
|
|
139
|
+
this.searchSuggestCondition = []
|
|
139
140
|
this.getTableData()
|
|
140
141
|
this.dialogVisible = true
|
|
141
142
|
},
|
|
@@ -176,15 +177,20 @@ export default {
|
|
|
176
177
|
this.$emit('delete')
|
|
177
178
|
}
|
|
178
179
|
},
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
/**
|
|
181
|
+
* 基础资料空间搜索建议
|
|
182
|
+
* 在没有打开基础资料弹窗之前,根据用户的输入提供选项
|
|
183
|
+
* @param queryString
|
|
184
|
+
* @param callback
|
|
185
|
+
* @returns {Promise<void>}
|
|
186
|
+
*/
|
|
181
187
|
async getAdvice (queryString, callback) {
|
|
182
|
-
this.tableLayout.length
|
|
188
|
+
!this.tableLayout.length && (await this.getTableLayout())
|
|
183
189
|
let record = []
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
190
|
+
this.handleSuggestMultiCondition(queryString, true)
|
|
191
|
+
record = /^\s*$/g.test(queryString)
|
|
192
|
+
? []
|
|
193
|
+
: await this.getTableData(true, false)
|
|
188
194
|
callback(record)
|
|
189
195
|
},
|
|
190
196
|
// 搜索建议的显示格式
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tongfun/tf-widget",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "tf-widget",
|
|
5
5
|
"main": "lib/tf-widget.umd.js",
|
|
6
6
|
"private": false,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"lint": "vue-cli-service lint",
|
|
13
13
|
"lib": "vue-cli-service build --target lib --name tf-widget --dest lib src/index.js",
|
|
14
14
|
"postinstall": "node -e \"try{require('./postinstall')}catch(e){}\"",
|
|
15
|
-
"watch": "nodemon --ignore dist/ --ignore node_modules/ --watch package
|
|
15
|
+
"watch": "nodemon --ignore dist/ --ignore node_modules/ --watch package -e js,vue,less --debug -x \"npm run lib && yalc push\" "
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"axios": "^0.21.1",
|
|
@@ -225,22 +225,25 @@ export default {
|
|
|
225
225
|
},
|
|
226
226
|
/**
|
|
227
227
|
* 处理条件变更和重新获取数据的逻辑
|
|
228
|
-
*
|
|
229
|
-
* @param {
|
|
228
|
+
* 基础资料搜索建议和列表页面右上角的搜索输入框的条件处理
|
|
229
|
+
* @param {string} queryString 用户输入的内容
|
|
230
|
+
* @param {boolean} inputMode 输入框模式:true,否则是列表模式,输入框模式不进行数据查询
|
|
230
231
|
*/
|
|
231
|
-
|
|
232
|
-
handleSuggestMultiCondition (queryString, isList = true) {
|
|
232
|
+
handleSuggestMultiCondition (queryString, inputMode = true) {
|
|
233
233
|
const conditionMultiList = []
|
|
234
234
|
for (const item of this.suggestFieldList) {
|
|
235
235
|
conditionMultiList.push(this.createMultiCondition(item, queryString, false, false))
|
|
236
236
|
}
|
|
237
237
|
this.searchSuggestCondition = conditionMultiList
|
|
238
238
|
// todo: 列表和弹窗 还有一个子分类,弹窗不进行合计调用
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
239
|
+
if (inputMode) {
|
|
240
|
+
return
|
|
241
|
+
}
|
|
242
|
+
// 处于列表中,还是处于基础资料的弹窗中,不同的地方在于,列表会进行合计,弹窗则会仅仅筛选已经审核的数据
|
|
243
|
+
// 以上逻辑在后端,前端仅仅需要传querytype的参数
|
|
244
|
+
this.queryType === 'LIST'
|
|
245
|
+
? this.getTableData(false, true)
|
|
246
|
+
: this.getTableData(false, false)
|
|
244
247
|
},
|
|
245
248
|
/**
|
|
246
249
|
* 创建一个高级过滤条件
|