cy-element-ui 1.0.39 → 1.0.41

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.
Files changed (119) hide show
  1. package/README.md +8 -7
  2. package/lib/alert.js +13 -31
  3. package/lib/aside.js +77 -84
  4. package/lib/autocomplete.js +3969 -268
  5. package/lib/avatar.js +108 -108
  6. package/lib/backtop.js +118 -136
  7. package/lib/badge.js +112 -133
  8. package/lib/breadcrumb-item.js +8 -21
  9. package/lib/breadcrumb.js +8 -14
  10. package/lib/button-group.js +8 -14
  11. package/lib/button.js +8 -33
  12. package/lib/calendar.js +1549 -109
  13. package/lib/card.js +96 -104
  14. package/lib/carousel-item.js +456 -135
  15. package/lib/carousel.js +191 -179
  16. package/lib/cascader-panel.js +2275 -209
  17. package/lib/cascader.js +6410 -349
  18. package/lib/checkbox-button.js +52 -62
  19. package/lib/checkbox-group.js +51 -20
  20. package/lib/checkbox.js +51 -75
  21. package/lib/col.js +2 -2
  22. package/lib/collapse-item.js +829 -170
  23. package/lib/collapse.js +112 -118
  24. package/lib/color-picker.js +3917 -258
  25. package/lib/container.js +88 -95
  26. package/lib/date-picker.js +8736 -4669
  27. package/lib/descriptions-item.js +2 -2
  28. package/lib/descriptions.js +63 -8
  29. package/lib/dialog.js +1213 -75
  30. package/lib/divider.js +104 -120
  31. package/lib/drawer.js +897 -173
  32. package/lib/dropdown-item.js +47 -31
  33. package/lib/dropdown-menu.js +2275 -81
  34. package/lib/dropdown.js +1072 -136
  35. package/lib/element-ui.common.js +910 -4903
  36. package/lib/empty.js +625 -169
  37. package/lib/fileUpload.js +3593 -520
  38. package/lib/footer.js +77 -84
  39. package/lib/form-item.js +450 -99
  40. package/lib/form.js +33 -28
  41. package/lib/header.js +77 -84
  42. package/lib/icon.js +67 -72
  43. package/lib/image.js +1400 -152
  44. package/lib/index.js +1 -1
  45. package/lib/infinite-scroll.js +311 -21
  46. package/lib/input-number.js +1438 -100
  47. package/lib/input.js +511 -151
  48. package/lib/link.js +9 -33
  49. package/lib/loading.js +808 -90
  50. package/lib/main.js +64 -71
  51. package/lib/menu-item-group.js +8 -20
  52. package/lib/menu-item.js +2912 -59
  53. package/lib/menu.js +745 -54
  54. package/lib/message-box.js +2556 -184
  55. package/lib/message.js +1117 -64
  56. package/lib/notification.js +1114 -67
  57. package/lib/option-group.js +47 -27
  58. package/lib/option.js +404 -43
  59. package/lib/page-header.js +683 -94
  60. package/lib/pagination.js +6078 -170
  61. package/lib/popconfirm.js +3514 -263
  62. package/lib/popover.js +2594 -93
  63. package/lib/progress.js +9 -62
  64. package/lib/radio-button.js +48 -55
  65. package/lib/radio-group.js +47 -26
  66. package/lib/radio.js +52 -67
  67. package/lib/rate.js +760 -152
  68. package/lib/result.js +39 -89
  69. package/lib/row.js +2 -2
  70. package/lib/scrollbar.js +735 -50
  71. package/lib/select.js +4294 -326
  72. package/lib/skeleton-item.js +13 -33
  73. package/lib/skeleton.js +116 -143
  74. package/lib/slider.js +4285 -254
  75. package/lib/spinner.js +100 -108
  76. package/lib/statistic.js +9627 -161
  77. package/lib/step.js +140 -186
  78. package/lib/steps.js +514 -111
  79. package/lib/subTitle.js +91 -100
  80. package/lib/submenu.js +2444 -123
  81. package/lib/switch.js +483 -67
  82. package/lib/tab-pane.js +10 -24
  83. package/lib/tabDialog.js +1548 -71
  84. package/lib/table-column.js +880 -32
  85. package/lib/table.js +4530 -744
  86. package/lib/tabs.js +432 -23
  87. package/lib/tag.js +4 -4
  88. package/lib/theme-chalk/gulpfile.js +27 -0
  89. package/lib/time-picker.js +5016 -566
  90. package/lib/time-select.js +4976 -313
  91. package/lib/timeline-item.js +114 -156
  92. package/lib/timeline.js +82 -82
  93. package/lib/tooltip.js +2566 -41
  94. package/lib/transfer.js +2143 -247
  95. package/lib/tree.js +1387 -180
  96. package/lib/treeSelect.js +3426 -153
  97. package/lib/upload.js +1154 -207
  98. package/package.json +10 -11
  99. package/packages/input-number/src/input-number.vue +7 -4
  100. package/packages/selectDisplayInput/index.js +8 -0
  101. package/packages/selectDisplayInput/src/main.vue +75 -0
  102. package/packages/theme-chalk/gulpfile.js +27 -0
  103. package/packages/theme-cy/gulpfile.js +27 -0
  104. package/packages/theme-cy/src/base.scss +3 -0
  105. package/packages/theme-cy/src/index.scss +1 -0
  106. package/packages/theme-cy/src/selectDisplayInput.scss +76 -0
  107. package/packages/theme-cy/src/treeSelect.scss +9 -4
  108. package/packages/treeSelect/src/main.vue +79 -0
  109. package/src/index.js +7 -4
  110. package/types/element-ui.d.ts +5 -1
  111. package/types/selectDisplayInput.d.ts +5 -0
  112. package/CHANGELOG.md +0 -280
  113. /package/{packages/theme-cy/lib → lib/theme-chalk}/base.css +0 -0
  114. /package/{packages/theme-cy/lib → lib/theme-chalk}/element.css +0 -0
  115. /package/{packages/theme-cy/lib → lib/theme-chalk}/fileUpload.css +0 -0
  116. /package/{packages/theme-cy/lib → lib/theme-chalk}/index.css +0 -0
  117. /package/{packages/theme-cy/lib → lib/theme-chalk}/subTitle.css +0 -0
  118. /package/{packages/theme-cy/lib → lib/theme-chalk}/tabDialog.css +0 -0
  119. /package/{packages/theme-cy/lib → lib/theme-chalk}/treeSelect.css +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cy-element-ui",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "基于ElementUI开发的组件",
5
5
  "main": "lib/element-ui.common.js",
6
6
  "files": [
@@ -22,11 +22,11 @@
22
22
  "build:utils": "cross-env BABEL_ENV=utils babel src --out-dir lib --ignore src/index.js",
23
23
  "build:umd": "node build/bin/build-locale.js",
24
24
  "clean": "rimraf lib && rimraf packages/*/lib && rimraf test/**/coverage",
25
- "deploy:build": "npm run build:file && cross-env NODE_ENV=production webpack --config build/webpack.demo.js && echo element.eleme.io>>examples/element-ui/CNAME",
25
+ "deploy:build": "npm run build:file && cross-env NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider webpack --config build/webpack.demo.js && echo element.eleme.io>>examples/element-ui/CNAME",
26
26
  "deploy:extension": "cross-env NODE_ENV=production webpack --config build/webpack.extension.js",
27
27
  "dev": "npm run bootstrap && npm run build:file && cross-env NODE_ENV=development webpack-dev-server --config build/webpack.demo.js",
28
28
  "dev:play": "npm run build:file && cross-env NODE_ENV=development PLAY_ENV=true webpack-dev-server --config build/webpack.demo.js",
29
- "dist": "npm run clean && npm run build:file && npm run lint && webpack --config build/webpack.conf.js && webpack --config build/webpack.common.js && webpack --config build/webpack.component.js && npm run build:utils && npm run build:umd && npm run build:theme",
29
+ "dist": "npm run clean && npm run build:file && npm run lint && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config build/webpack.conf.js && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config build/webpack.common.js && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config build/webpack.component.js && npm run build:utils && npm run build:umd && npm run build:theme",
30
30
  "lint": "eslint src/**/* test/**/* packages/**/* build/**/* --quiet",
31
31
  "pub": "npm run bootstrap && sh build/git-release.sh && sh build/release.sh && node build/bin/gen-indices.js",
32
32
  "test": "npm run lint && npm run build:theme && cross-env CI_ENV=/dev/ BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
@@ -48,9 +48,9 @@
48
48
  ],
49
49
  "repository": {
50
50
  "type": "git",
51
- "url": "git@github.com:ElemeFE/element.git"
51
+ "url": "git+https://github.com/youxiang_1224/cy-element-ui.git"
52
52
  },
53
- "homepage": "http://element.eleme.io",
53
+ "homepage": "https://github.com/youxiang_1224/cy-element-ui#readme",
54
54
  "keywords": [
55
55
  "element",
56
56
  "vue2",
@@ -91,7 +91,6 @@
91
91
  "babel-plugin-transform-vue-jsx": "^3.7.0",
92
92
  "babel-preset-env": "^1.7.0",
93
93
  "babel-preset-stage-2": "^6.24.1",
94
- "babel-regenerator-runtime": "^6.5.0",
95
94
  "chai": "^4.2.0",
96
95
  "chokidar": "^1.7.0",
97
96
  "copy-webpack-plugin": "^5.0.0",
@@ -100,7 +99,7 @@
100
99
  "cross-env": "^3.1.3",
101
100
  "css-loader": "^2.1.0",
102
101
  "es6-promise": "^4.0.5",
103
- "eslint": "4.19.1",
102
+ "eslint": "5.16.0",
104
103
  "eslint-config-elemefe": "0.1.1",
105
104
  "eslint-loader": "^2.0.0",
106
105
  "eslint-plugin-html": "^4.0.1",
@@ -111,7 +110,7 @@
111
110
  "gulp": "^4.0.0",
112
111
  "gulp-autoprefixer": "^6.0.0",
113
112
  "gulp-cssmin": "^0.2.0",
114
- "gulp-sass": "^4.0.2",
113
+ "gulp-sass": "^5.1.0",
115
114
  "highlight.js": "^9.3.0",
116
115
  "html-webpack-plugin": "^3.2.0",
117
116
  "js-base64": "^3.7.7",
@@ -125,7 +124,7 @@
125
124
  "karma-sinon-chai": "^2.0.2",
126
125
  "karma-sourcemap-loader": "^0.3.7",
127
126
  "karma-spec-reporter": "^0.0.32",
128
- "karma-webpack": "^3.0.5",
127
+ "karma-webpack": "^4.0.2",
129
128
  "launch-editor-middleware": "^2.3.0",
130
129
  "markdown-it": "^8.4.1",
131
130
  "markdown-it-anchor": "^5.0.2",
@@ -133,12 +132,12 @@
133
132
  "markdown-it-container": "^2.0.0",
134
133
  "mini-css-extract-plugin": "^0.4.1",
135
134
  "mocha": "^6.0.2",
136
- "node-sass": "^4.11.0",
137
135
  "optimize-css-assets-webpack-plugin": "^5.0.1",
138
136
  "postcss": "^7.0.14",
139
137
  "progress-bar-webpack-plugin": "^1.11.0",
140
138
  "rimraf": "^2.5.4",
141
- "sass-loader": "^7.1.0",
139
+ "sass": "^1.32.0",
140
+ "sass-loader": "^8.0.0",
142
141
  "select-version-cli": "^0.0.2",
143
142
  "shelljs": "^0.10.0",
144
143
  "sinon": "^7.2.7",
@@ -5,13 +5,13 @@
5
5
  'el-input-number',
6
6
  inputNumberSize ? 'el-input-number--' + inputNumberSize : '',
7
7
  { 'is-disabled': inputNumberDisabled },
8
- { 'is-without-controls': !controls },
8
+ { 'is-without-controls': !showControls },
9
9
  { 'is-controls-right': controlsAtRight }
10
10
  ]">
11
11
  <span
12
12
  class="el-input-number__decrease"
13
13
  role="button"
14
- v-if="controls"
14
+ v-if="showControls"
15
15
  v-repeat-click="decrease"
16
16
  :class="{'is-disabled': minDisabled}"
17
17
  @keydown.enter="decrease">
@@ -20,7 +20,7 @@
20
20
  <span
21
21
  class="el-input-number__increase"
22
22
  role="button"
23
- v-if="controls"
23
+ v-if="showControls"
24
24
  v-repeat-click="increase"
25
25
  :class="{'is-disabled': maxDisabled}"
26
26
  @keydown.enter="increase">
@@ -159,7 +159,10 @@
159
159
  }
160
160
  },
161
161
  controlsAtRight() {
162
- return this.controls && this.controlsPosition === 'right';
162
+ return this.showControls && this.controlsPosition === 'right';
163
+ },
164
+ showControls() {
165
+ return this.controls && !this.$attrs['data-unit'];
163
166
  },
164
167
  _elFormItemSize() {
165
168
  return (this.elFormItem || {}).elFormItemSize;
@@ -0,0 +1,8 @@
1
+ import SelectDisplayInput from './src/main';
2
+
3
+ /* istanbul ignore next */
4
+ SelectDisplayInput.install = function(Vue) {
5
+ Vue.component(SelectDisplayInput.name, SelectDisplayInput);
6
+ };
7
+
8
+ export default SelectDisplayInput;
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <div class="cy-select-display-input">
3
+ <div class="select_display_input_box" :class="{ text_active: cursor, cursor: cursor && value }" @click="handleInfo">
4
+ <div class="text"><span>{{ value }}</span></div>
5
+ <span v-if="!value" class="placeholder">{{ placeholder }}</span>
6
+ <i v-if="showDelete" class="el-icon-circle-close delete" @click.stop="handleDelete"></i>
7
+ </div>
8
+ <el-button v-if="showBtn" type="primary" @click="handleClick">{{ btnText }}</el-button>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: 'CySelectDisplayInput',
15
+ props: {
16
+ // 文本框 需要显示的内容
17
+ value: {
18
+ type: [Number, String],
19
+ default: ''
20
+ },
21
+
22
+ // 文本框 的提示文本
23
+ placeholder: {
24
+ type: String,
25
+ default: ''
26
+ },
27
+
28
+ // 选择按钮 的文字
29
+ btnText: {
30
+ type: String,
31
+ default: '选择'
32
+ },
33
+
34
+ // 选择按钮 的显示条件
35
+ showBtn: {
36
+ type: Boolean,
37
+ default: true
38
+ },
39
+
40
+ // 是否显示 删除按钮
41
+ showDelete: {
42
+ type: Boolean,
43
+ default: false
44
+ }
45
+ },
46
+ data() {
47
+ return {}
48
+ },
49
+ computed: {
50
+ // 文本框 是否需要点击,如果为true,输入框中的字体会变蓝并将鼠标变为小手
51
+ cursor() {
52
+ // 判断父组件是否坚挺了info事件
53
+ return this.$listeners.info;
54
+ }
55
+ },
56
+ created() {
57
+
58
+ },
59
+ methods: {
60
+ handleInfo() {
61
+ if (this.value) {
62
+ this.$emit('info');
63
+ }
64
+ },
65
+
66
+ handleClick() {
67
+ this.$emit('click');
68
+ },
69
+
70
+ handleDelete() {
71
+ this.$emit('delete');
72
+ }
73
+ }
74
+ }
75
+ </script>
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ const { series, src, dest } = require('gulp');
4
+ const sass = require('gulp-sass')(require('sass'));
5
+ const autoprefixer = require('gulp-autoprefixer');
6
+ const cssmin = require('gulp-cssmin');
7
+
8
+ function compile() {
9
+ return src('./src/*.scss')
10
+ .pipe(sass.sync({
11
+ silenceDeprecations: ['import', 'legacy-js-api', 'slash-div', 'global-builtin', 'function-units', 'color-functions']
12
+ }))
13
+ .pipe(autoprefixer({
14
+ overrideBrowserslist: ['ie > 9', 'last 2 versions'],
15
+ cascade: false
16
+ }))
17
+ .pipe(cssmin())
18
+ .pipe(dest('./lib'));
19
+ }
20
+
21
+ function copyfont() {
22
+ return src('./src/fonts/**')
23
+ .pipe(cssmin())
24
+ .pipe(dest('./lib/fonts'));
25
+ }
26
+
27
+ exports.build = series(compile, copyfont);
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ const { series, src, dest } = require('gulp');
4
+ const sass = require('gulp-sass')(require('sass'));
5
+ const autoprefixer = require('gulp-autoprefixer');
6
+ const cssmin = require('gulp-cssmin');
7
+
8
+ function compile() {
9
+ return src('./src/*.scss')
10
+ .pipe(sass.sync({
11
+ silenceDeprecations: ['import', 'legacy-js-api', 'slash-div', 'global-builtin', 'function-units', 'color-functions']
12
+ }))
13
+ .pipe(autoprefixer({
14
+ overrideBrowserslist: ['ie > 9', 'last 2 versions'],
15
+ cascade: false
16
+ }))
17
+ .pipe(cssmin())
18
+ .pipe(dest('./lib'));
19
+ }
20
+
21
+ function copyfont() {
22
+ return src('./src/fonts/**')
23
+ .pipe(cssmin())
24
+ .pipe(dest('./lib/fonts'));
25
+ }
26
+
27
+ exports.build = series(compile, copyfont);
@@ -0,0 +1,3 @@
1
+ *, *::before, *::after {
2
+ box-sizing: border-box;
3
+ }
@@ -4,3 +4,4 @@
4
4
  @import "./subTitle.scss";
5
5
  @import "./tabDialog.scss";
6
6
  @import "./treeSelect.scss";
7
+ @import "./selectDisplayInput.scss";
@@ -0,0 +1,76 @@
1
+ @import "./base.scss";
2
+
3
+ .cy-select-display-input {
4
+ display: flex;
5
+ position: relative;
6
+
7
+ & > .el-button {
8
+ flex-shrink: 0;
9
+ margin-left: 10px;
10
+ height: 36px;
11
+ padding: 9px 15px;
12
+ }
13
+ }
14
+
15
+ .select_display_input_box {
16
+ width: 100%;
17
+ height: 36px;
18
+ color: #888888;
19
+ background-color: #F5F7FA;
20
+ border: 1px solid #DCDFE6;
21
+ border-radius: 4px;
22
+ padding: 0 15px;
23
+ position: relative;
24
+ overflow: hidden;
25
+ display: flex;
26
+ align-items: center;
27
+
28
+ &.text_active {
29
+ color: #1890ff;
30
+ }
31
+
32
+ &.cursor {
33
+ cursor: pointer;
34
+ }
35
+
36
+ .text {
37
+ width: 100%;
38
+ line-height: 34px;
39
+ overflow: auto;
40
+
41
+ &::-webkit-scrollbar {
42
+ display: none;
43
+ }
44
+
45
+ span {
46
+ white-space: nowrap;
47
+ }
48
+ }
49
+
50
+ &.cursor .text:hover {
51
+ cursor: pointer;
52
+ }
53
+
54
+ .placeholder {
55
+ color: rgba(192, 196, 204, 0.5);
56
+ text-shadow: 0 0 1px #c0c4cc;
57
+ position: absolute;
58
+ top: 50%;
59
+ left: 15px;
60
+ transform: translateY(-50%);
61
+ }
62
+
63
+ .delete {
64
+ color: #ff4949;
65
+ position: absolute;
66
+ top: 50%;
67
+ right: 5px;
68
+ transform: translateY(-50%);
69
+ cursor: pointer;
70
+ z-index: 10;
71
+
72
+ &:hover {
73
+ color: rgba(255, 73, 73, 0.5);
74
+ }
75
+ }
76
+ }
@@ -9,7 +9,7 @@
9
9
  .cy-tree-select-select {
10
10
  width: 217px;
11
11
  height: 36px;
12
- line-height: 36px;
12
+ line-height: 34px;
13
13
  border: 1px solid #DCDFE6;
14
14
  border-radius: 4px;
15
15
  padding: 0 29px 0 15px;
@@ -33,7 +33,8 @@
33
33
  .cy-tree-select-select-v-icon {
34
34
  color: #C0C4CC;
35
35
  position: absolute;
36
- top: 0;
36
+ top: 50%;
37
+ transform: translateY(-50%);
37
38
  right: 9px;
38
39
 
39
40
  .cy-tree-select-select-v-arrow {
@@ -49,7 +50,7 @@
49
50
 
50
51
  .cy-tree-select-select.small {
51
52
  height: 32px;
52
- line-height: 32px;
53
+ line-height: 30px;
53
54
 
54
55
  .cy-tree-select-select-v {
55
56
  font-size: 13px;
@@ -58,7 +59,7 @@
58
59
 
59
60
  .cy-tree-select-select.mini {
60
61
  height: 28px;
61
- line-height: 28px;
62
+ line-height: 26px;
62
63
 
63
64
  .cy-tree-select-select-v {
64
65
  font-size: 12px;
@@ -69,6 +70,10 @@
69
70
  border-color: #C0C4CC;
70
71
  }
71
72
 
73
+ .cy-tree-select-select-con-s {
74
+ padding-bottom: 8px;
75
+ }
76
+
72
77
  .cy-tree-select-select-con-t {
73
78
  padding-bottom: 5px;
74
79
  margin-bottom: 5px;
@@ -2,6 +2,15 @@
2
2
  <div class="cy-tree-select">
3
3
  <el-popover v-model="popoverOpen" placement="bottom-start" width="300" trigger="click" :popper-class="popperClass" @show="popoverOpen = true" @hide="popoverOpen = false">
4
4
  <div class="cy-tree-select-select-con">
5
+ <div v-if="filterable" class="cy-tree-select-select-con-s">
6
+ <el-input
7
+ v-model="filterText"
8
+ placeholder="搜索"
9
+ prefix-icon="el-icon-search"
10
+ clearable
11
+ size="small"
12
+ ></el-input>
13
+ </div>
5
14
  <div v-if="showCheckStrictly" class="cy-tree-select-select-con-t">
6
15
  <el-checkbox v-model="isCheckStrictly">父子节点联动</el-checkbox>
7
16
  </div>
@@ -16,6 +25,7 @@
16
25
  :props="defaultOptions"
17
26
  :expand-on-click-node="false"
18
27
  :default-expand-all="defaultExpandAll"
28
+ :filter-node-method="filterNode"
19
29
  @check="treeCheck"
20
30
  @node-click="treeClick"
21
31
  ></el-tree>
@@ -72,6 +82,12 @@ export default {
72
82
  type: String,
73
83
  },
74
84
 
85
+ // 是否显示搜索框
86
+ filterable: {
87
+ type: Boolean,
88
+ default: false
89
+ },
90
+
75
91
  // 是否显示 父子节点是否联动 多选框
76
92
  showCheckStrictly: {
77
93
  type: Boolean,
@@ -134,6 +150,8 @@ export default {
134
150
 
135
151
  treeOptions: [], // 部门树列表
136
152
  treeArr: [], // 部门列表
153
+ filterText: '', // 搜索关键词
154
+ matchedNodeIds: [], // 匹配的节点ID集合
137
155
  }
138
156
  },
139
157
  computed: {
@@ -177,12 +195,73 @@ export default {
177
195
  this.treeOptions = this.options;
178
196
  this.treeArr = this.turnFormatTreeData([], this.treeOptions, 0);
179
197
  }
198
+ },
199
+
200
+ filterText(val) {
201
+ if (val) {
202
+ // 先找出所有匹配的节点及其子节点
203
+ this.matchedNodeIds = this.findMatchedNodes(val, this.treeOptions);
204
+ // 执行过滤
205
+ this.$refs.tree.filter(val);
206
+ // 展开所有匹配的节点
207
+ this.$nextTick(() => {
208
+ this.expandMatchedNodes();
209
+ });
210
+ } else {
211
+ this.matchedNodeIds = [];
212
+ this.$refs.tree.filter(val);
213
+ }
180
214
  }
181
215
  },
182
216
  created() {
183
217
 
184
218
  },
185
219
  methods: {
220
+ /**
221
+ * 树节点过滤
222
+ */
223
+ filterNode(value, data) {
224
+ if (!value) return true;
225
+ // 如果当前节点或其祖先节点匹配了,就显示
226
+ return this.matchedNodeIds.includes(data[this.defaultOptions.id]);
227
+ },
228
+
229
+ /**
230
+ * 查找所有匹配的节点及其子节点ID
231
+ */
232
+ findMatchedNodes(value, nodes, parentMatched = false) {
233
+ let matchedIds = [];
234
+
235
+ nodes.forEach(node => {
236
+ const currentNodeMatched = node[this.defaultOptions.label].indexOf(value) !== -1;
237
+ const shouldShow = currentNodeMatched || parentMatched;
238
+
239
+ if (shouldShow) {
240
+ matchedIds.push(node[this.defaultOptions.id]);
241
+ }
242
+
243
+ // 递归处理子节点,如果当前节点或其祖先匹配了,子节点也应该匹配
244
+ if (node[this.defaultOptions.children] && node[this.defaultOptions.children].length > 0) {
245
+ const childIds = this.findMatchedNodes(value, node[this.defaultOptions.children], shouldShow);
246
+ matchedIds = matchedIds.concat(childIds);
247
+ }
248
+ });
249
+
250
+ return matchedIds;
251
+ },
252
+
253
+ /**
254
+ * 展开所有匹配的节点
255
+ */
256
+ expandMatchedNodes() {
257
+ this.matchedNodeIds.forEach(nodeId => {
258
+ const treeNode = this.$refs.tree.store.nodesMap[nodeId];
259
+ if (treeNode) {
260
+ treeNode.expand();
261
+ }
262
+ });
263
+ },
264
+
186
265
  init() {
187
266
  // 初始化是根据value,设置已选中项
188
267
  let arr = [];
package/src/index.js CHANGED
@@ -92,7 +92,8 @@ import Result from '../packages/result/index.js';
92
92
  import TreeSelect from '../packages/treeSelect/index.js';
93
93
  import SubTitle from '../packages/subTitle/index.js';
94
94
  import TabDialog from '../packages/tabDialog/index.js';
95
- import FileUpload from '../packages/fileUpload/index.js';
95
+ import FileUpload from '../packages/fileUpload/index.js';
96
+ import SelectDisplayInput from '../packages/selectDisplayInput/index.js';
96
97
  import locale from 'element-ui/src/locale';
97
98
  import CollapseTransition from 'element-ui/src/transitions/collapse-transition';
98
99
 
@@ -182,7 +183,8 @@ const components = [
182
183
  DescriptionsItem,
183
184
  Result,
184
185
  SubTitle,
185
- FileUpload,
186
+ FileUpload,
187
+ SelectDisplayInput,
186
188
  CollapseTransition
187
189
  ];
188
190
 
@@ -219,7 +221,7 @@ if (typeof window !== 'undefined' && window.Vue) {
219
221
  }
220
222
 
221
223
  export default {
222
- version: '1.0.38',
224
+ version: '1.0.40',
223
225
  locale: locale.use,
224
226
  i18n: locale.i18n,
225
227
  install,
@@ -316,5 +318,6 @@ export default {
316
318
  TreeSelect,
317
319
  SubTitle,
318
320
  TabDialog,
319
- FileUpload
321
+ FileUpload,
322
+ SelectDisplayInput
320
323
  };
@@ -94,7 +94,8 @@ import { CyTreeSelect } from './treeSelect'
94
94
  import { CySubTitle } from './subTitle'
95
95
  import { CyTabDialog } from './tabDialog'
96
96
  import { CyFileUpload } from './fileUpload'
97
-
97
+
98
+
98
99
  export interface InstallationOptions {
99
100
  locale: any,
100
101
  i18n: any,
@@ -397,3 +398,6 @@ export class TabDialog extends CyTabDialog {}
397
398
 
398
399
  /** FileUpload Component */
399
400
  export class FileUpload extends CyFileUpload {}
401
+
402
+ /** SelectDisplayInput Component */
403
+ export class SelectDisplayInput extends CySelectDisplayInput {}
@@ -0,0 +1,5 @@
1
+ import { CyUIComponent } from './component'
2
+
3
+ /** SelectDisplayInput Component */
4
+ export declare class CySelectDisplayInput extends CyUIComponent {
5
+ }