askbot-dragon 1.0.18 → 1.0.19

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": "askbot-dragon",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -4,11 +4,19 @@
4
4
  <span class="cacel" @click="cancelBtn">取消</span>
5
5
  <span class="primary" @click="saveData">确认</span>
6
6
  </div>
7
+ <div class="tree-input" v-if="setCascadeOption && setCascadeOption.length > 0">
8
+ <el-input
9
+ placeholder="请搜索"
10
+ v-model="filterText"
11
+ >
12
+ </el-input>
13
+ </div>
7
14
  <div class="tree-container">
8
15
  <el-tree :data="setCascadeOption"
9
16
  :props="defaultProps"
10
17
  ref="dataTree"
11
18
  node-key="value"
19
+ :filter-node-method="filterNode"
12
20
  >
13
21
  <span class="custom-tree-node" slot-scope="{ node,data}">
14
22
  <span class="tree-label">{{ node.label }}</span>
@@ -39,7 +47,8 @@ export default {
39
47
  checked:'',
40
48
  // dataTree:[],
41
49
  checkList:[],
42
- checkDatas:[]
50
+ checkDatas:[],
51
+ filterText:""
43
52
  }
44
53
  },
45
54
  props:["dataOptions","fieldValue"],
@@ -89,6 +98,10 @@ export default {
89
98
  }
90
99
  return list
91
100
  },
101
+ filterNode(value, data) {
102
+ if (!value) return true;
103
+ return data.label.indexOf(value) !== -1;
104
+ }
92
105
  },
93
106
  computed: {
94
107
  dataTree() {
@@ -167,6 +180,11 @@ export default {
167
180
  return arr
168
181
  },
169
182
  },
183
+ watch:{
184
+ filterText(val) {
185
+ this.$refs.dataTree.filter(val);
186
+ }
187
+ }
170
188
  // mounted() {
171
189
  // if (this.dataOptions.extInfo.cascadeDown.options){
172
190
  // debugger
@@ -199,7 +217,7 @@ export default {
199
217
  margin: 0 20px;
200
218
  width: calc(100% - 40px);
201
219
  /*font-size: 14px;*/
202
- padding-bottom: 30px;
220
+ padding-bottom: 20px;
203
221
  .primary{
204
222
  color: #366aff;
205
223
  cursor: pointer;
@@ -209,6 +227,10 @@ export default {
209
227
  cursor: pointer;
210
228
  }
211
229
  }
230
+ .tree-input{
231
+ width: calc(100% - 20px);
232
+ margin: 0 10px 10px 10px;
233
+ }
212
234
  .tree-container{
213
235
  height:260px;
214
236
  overflow-y: scroll;