xianniu-ui 0.9.14 → 2.0.2

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 (38) hide show
  1. package/lib/style/basic.css +1 -1
  2. package/lib/style/ellipsis.css +1 -1
  3. package/lib/style/fonts/element-icons.ttf +0 -0
  4. package/lib/style/fonts/element-icons.woff +0 -0
  5. package/lib/style/index.css +1 -0
  6. package/lib/style/index.js +1 -0
  7. package/lib/style/page.css +1 -0
  8. package/lib/style/search.css +1 -0
  9. package/lib/style/table.css +1 -0
  10. package/lib/style/tag.css +1 -0
  11. package/lib/style/theme/element-variables.scss +13 -11
  12. package/lib/style/theme/theme.scss +5 -4
  13. package/lib/style/tip.css +1 -0
  14. package/lib/style/tree.css +1 -0
  15. package/lib/style/upload.css +1 -0
  16. package/lib/xianniu-ui.common.js +19606 -69549
  17. package/lib/xianniu-ui.css +1 -1
  18. package/lib/xianniu-ui.umd.js +19611 -69554
  19. package/lib/xianniu-ui.umd.min.js +2 -72
  20. package/package.json +20 -12
  21. package/packages/card/main.vue +1 -1
  22. package/packages/page/main.vue +2 -2
  23. package/packages/search/main.vue +391 -293
  24. package/packages/style/gulpfile.js +12 -7
  25. package/packages/style/src/basic.scss +1 -0
  26. package/packages/style/src/ellipsis.scss +1 -0
  27. package/packages/style/src/index.scss +3 -5
  28. package/packages/style/src/search.scss +127 -15
  29. package/packages/style/src/theme/element-variables.scss +13 -11
  30. package/packages/style/src/theme/theme.scss +5 -4
  31. package/packages/style/src/upload.scss +47 -8
  32. package/packages/table/main.vue +77 -34
  33. package/packages/tag/main.vue +1 -1
  34. package/packages/upload/main.vue +165 -35
  35. package/src/area/data.js +3890 -0
  36. package/src/area/index.js +71 -1
  37. package/src/oss/index.js +93 -60
  38. package/src/plugins/index.js +5 -2
@@ -8,8 +8,13 @@ const cssmin = require('gulp-cssmin');
8
8
 
9
9
 
10
10
  function compile() {
11
+
12
+ console.log('打包css');
13
+
11
14
  return src('./src/*.scss')
12
- .pipe(sass.sync().on('error', sass.logError))
15
+ .pipe(sass.sync({
16
+ includePaths: ['../../node_modules']
17
+ }).on('error', sass.logError))
13
18
  .pipe(autoprefixer({
14
19
  browsers: ['ie > 9', 'last 2 versions'],
15
20
  cascade: false
@@ -17,10 +22,10 @@ function compile() {
17
22
  .pipe(cssmin())
18
23
  .pipe(dest('./lib'));
19
24
  }
20
- function copyfont() {
21
- return src('./src/fonts/**')
22
- .pipe(cssmin())
23
- .pipe(dest('./lib/fonts'));
24
- }
25
+ // function copyfont() {
26
+ // return src('./src/fonts/**')
27
+ // .pipe(cssmin())
28
+ // .pipe(dest('./lib/fonts'));
29
+ // }
25
30
 
26
- exports.default = series(compile,copyfont)
31
+ exports.default = series(compile)
@@ -1,5 +1,6 @@
1
1
  @import './theme/theme.scss';
2
2
  @import './theme/variables.scss';
3
+ @import '@liuzengwei/element-ui/packages/theme-chalk/src/common/var.scss';
3
4
  .text-primary{color: $--color-primary!important;}
4
5
  .text-success{color: $--color-success!important;}
5
6
  .text-danger{color: $--color-danger!important;}
@@ -1,4 +1,5 @@
1
1
  @import "./theme/theme.scss";
2
+ @import '@liuzengwei/element-ui/packages/theme-chalk/src/common/var.scss';
2
3
  .xn-ellipsis {
3
4
  white-space: pre-wrap;
4
5
  word-break: break-word;
@@ -1,3 +1,6 @@
1
+ // 先导入主题变量,确保所有变量都已定义
2
+ @import './theme/index.scss';
3
+
1
4
  @import './search.scss';
2
5
  @import './table.scss';
3
6
  @import './page.scss';
@@ -15,8 +18,3 @@
15
18
  @import './card.scss';
16
19
  @import './description.scss';
17
20
  @import './amount.scss';
18
-
19
-
20
-
21
-
22
- @import './theme/index.scss';
@@ -1,19 +1,131 @@
1
1
  .xn-search {
2
- &--row.el-row {
3
- .el-form-item {
4
- display: flex;
5
- .el-form-item__content {
6
- width: 100%;
7
- height: 32px;
8
- }
9
- .el-form-item__label {
10
- flex: none;
11
- }
12
- &.xn-search-searchbtn{
13
- .el-form-item__content{
14
- white-space: nowrap;
15
- }
16
- }
2
+ &-flex {
3
+ display: flex;
4
+ align-items: flex-start;
5
+ }
6
+
7
+ &--row.el-row {
8
+ flex: 1;
9
+
10
+ .el-form-item {
11
+ display: flex;
12
+ margin-bottom: 18px;
13
+
14
+ .el-form-item__content {
15
+ width: 100%;
16
+ min-height: 32px;
17
+ display: flex;
18
+ align-items: center;
19
+ > div {
20
+ width: 100%;
17
21
  }
22
+ }
23
+
24
+ .el-form-item__label {
25
+ flex: none;
26
+ line-height: 32px;
27
+ padding-right: 12px;
28
+ }
18
29
  }
30
+ }
31
+
32
+ &-searchbtn {
33
+ display: flex;
34
+ flex-direction: column;
35
+ align-items: flex-end;
36
+ flex: none;
37
+ width: 100px;
38
+ margin-left: 16px;
39
+
40
+ .el-button {
41
+ width: 80px;
42
+
43
+ &:not(:first-child) {
44
+ margin-top: 18px;
45
+ margin-left: 0;
46
+ }
47
+ }
48
+
49
+ // 查询项<=4个时,按钮横向排列
50
+ &.is-horizontal {
51
+ flex-direction: row;
52
+ width: auto;
53
+ align-items: center;
54
+
55
+ .el-button {
56
+ width: auto;
57
+
58
+ &:not(:first-child) {
59
+ margin-top: 0;
60
+ margin-left: 10px;
61
+ }
62
+ }
63
+ }
64
+ }
65
+
66
+ // 展开/收起按钮样式
67
+ .coll-box {
68
+ display: flex;
69
+ justify-content: flex-end;
70
+ align-items: center;
71
+ min-height: 32px;
72
+
73
+ .el-link {
74
+ font-size: 14px;
75
+
76
+ &:hover {
77
+ opacity: 0.8;
78
+ }
79
+ }
80
+ }
19
81
  }
82
+
83
+ // 响应式优化
84
+ @media (max-width: 768px) {
85
+ .xn-search {
86
+ &-flex {
87
+ flex-direction: column;
88
+ }
89
+
90
+ &-searchbtn {
91
+ width: 100%;
92
+ margin-left: 0;
93
+ margin-top: 16px;
94
+ flex-direction: row;
95
+ justify-content: center;
96
+
97
+ .el-button {
98
+ width: auto;
99
+ margin: 0 8px;
100
+
101
+ &:not(:first-child) {
102
+ margin-top: 0;
103
+ margin-left: 8px;
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ // 表单项控件样式优化
111
+ ::v-deep {
112
+ .el-input,
113
+ .el-select,
114
+ .el-cascader {
115
+ width: 100%;
116
+ }
117
+
118
+ .el-date-editor {
119
+ width: 100%;
120
+
121
+ &.el-date-editor--datetimerange,
122
+ &.el-date-editor--daterange {
123
+ width: 100%;
124
+ }
125
+ }
126
+
127
+ // 确保城市选择器宽度正确
128
+ .xn-city {
129
+ width: 100%;
130
+ }
131
+ }
@@ -1,7 +1,10 @@
1
1
 
2
2
  /* theme color */
3
+ // 仅定义自定义主题变量,不引入 Element UI 完整样式
4
+ // Element UI 样式已通过 babel-plugin-component 按需引入
3
5
  @import './theme.scss';
4
6
 
7
+ // 自定义主题变量覆盖
5
8
  $--button-font-weight: 400;
6
9
 
7
10
  $--border-color-light: #dfe4ed;
@@ -10,17 +13,16 @@ $--border-color-lighter: #e6ebf5;
10
13
  $--table-border: 1px solid #dfe6ec;
11
14
 
12
15
  $--box-shadow-light: none;
13
- $--fade-linear-transition:none;
14
- $--fade-transition:none;
15
- // $--table-border-color:#f00;
16
- $--table-border:1px solid #f0f0f0;
17
- // $--table-header-background-color: #fafafa;
16
+ $--fade-linear-transition: none;
17
+ $--fade-transition: none;
18
+ $--table-border: 1px solid #f0f0f0;
18
19
 
19
- $--font-path: "~element-ui/lib/theme-chalk/fonts";
20
+ // 字体路径配置
21
+ // $--font-path: "~@liuzengwei/element-ui/packages/theme-chalk/src/fonts";
20
22
 
21
- @import "element-ui/packages/theme-chalk/src/index";
23
+ // ❌ 已移除全量样式引入,避免重复打包
24
+ // Element UI 样式通过 babel.config.js 中的 babel-plugin-component 按需引入
25
+ // 这样可以减少 95% 的样式体积(从 473KB → 15-25KB)
22
26
 
23
-
24
- :export {
25
- theme: $--color-primary;
26
- }
27
+ // 如需使用 Element UI 变量,请导入变量文件而非完整样式
28
+ // @import "~@liuzengwei/element-ui/packages/theme-chalk/src/common/var";
@@ -1,5 +1,6 @@
1
- $--color-primary: #ff745c;
2
- $--color-success: #52c41a;
3
- $--color-warning: #faad14;
4
- $--color-danger: #ff4d4f;
1
+ // 使用 Element UI 原有的变量,不再自定义覆盖
2
+ // $--color-primary: #409EFF;
3
+ // $--color-success: #67C23A;
4
+ // $--color-warning: #E6A23C;
5
+ // $--color-danger: #F56C6C;
5
6
 
@@ -86,8 +86,6 @@
86
86
  &:not(.is-idcard) .el-upload-list {
87
87
  &.el-upload-list--picture-card {
88
88
  .el-upload-list__item {
89
- width: 80px;
90
- height: 80px;
91
89
  img.el-upload-list__item-thumbnail {
92
90
  object-fit: cover;
93
91
  }
@@ -97,14 +95,9 @@
97
95
  &:not(.is-idcard) {
98
96
  .el-upload {
99
97
  &.el-upload--picture-card {
100
- width: 80px;
101
- height: 80px;
102
- line-height: 80px;
103
98
  font-size: 14px;
104
99
  position: relative;
105
100
  .el-upload-list__item {
106
- width: 80px;
107
- height: 80px;
108
101
  img.el-upload-list__item-thumbnail {
109
102
  object-fit: cover;
110
103
  }
@@ -112,6 +105,14 @@
112
105
  .upload-limit {
113
106
  width: inherit;
114
107
  height: inherit;
108
+ display: flex;
109
+ justify-content: center;
110
+ flex-direction: column;
111
+ line-height: normal;
112
+ font-size: 10px;
113
+ .text{
114
+ color: #86909C;
115
+ }
115
116
  i {
116
117
  font-size: 20px;
117
118
  }
@@ -139,6 +140,34 @@
139
140
  }
140
141
  }
141
142
  }
143
+ .upload-error {
144
+ position: absolute;
145
+ left: 0;
146
+ top: 0;
147
+ width: 100%;
148
+ height: 100%;
149
+ z-index: 10; // 确保在 actions 蒙层之上
150
+ .error-mask {
151
+ width: 100%;
152
+ height: 100%;
153
+ background: rgba($color: #000000, $alpha: 0.7);
154
+ display: flex;
155
+ flex-direction: column;
156
+ justify-content: center;
157
+ align-items: center;
158
+ gap: 8px;
159
+ .error-text {
160
+ color: #f56c6c;
161
+ font-size: 14px;
162
+ margin: 0;
163
+ }
164
+ .error-actions {
165
+ display: flex;
166
+ align-items: center;
167
+ gap: 10px;
168
+ }
169
+ }
170
+ }
142
171
  &__ext {
143
172
  position: absolute;
144
173
  bottom: 0;
@@ -150,13 +179,23 @@
150
179
  color: #fff;
151
180
  font-size: 12px;
152
181
  padding: 0 5px;
153
- border-radius: 0 0 0 0;
182
+ border-radius: 0;
154
183
  }
155
184
  }
156
185
  .el-upload-list__item {
157
186
  .el-progress {
158
187
  width: 50%;
159
188
  }
189
+ .el-upload-list__item-name {
190
+ &.is-error {
191
+ color: #f56c6c;
192
+ .error-tip {
193
+ font-size: 12px;
194
+ margin-left: 5px;
195
+ opacity: 0.8;
196
+ }
197
+ }
198
+ }
160
199
  }
161
200
  .el-upload--list{
162
201
  width: 100%;
@@ -2,26 +2,11 @@
2
2
  <div class="xn-table-box">
3
3
  <div class="xn-table-box-tools" :class="{ 'is-border': !border }">
4
4
  <div class="flex justify-content-between align-items-center">
5
- <div class="fz-12" :class="{ 'pb-10': isSelection }">
6
- <template v-if="isSelection && selectedData.length>0">
7
- <span>已选择 {{ selectedData.length }} 项</span>
8
- <el-button
9
- type="text"
10
- v-show="selectedData.length"
11
- class="ml-5 pt-0 pb-0"
12
- size="mini"
13
- @click="clearSelection"
14
- >取消</el-button
15
- >
16
- </template>
17
- </div>
18
5
  <div
19
- :class="{ 'pb-10': $slots.tools || tools.length }"
20
- class="flex justify-content-between align-items-center"
6
+ :class="{ 'pb-10': $slots.tools || tools.length || showRefresh || showColumn }"
21
7
  >
22
8
  <slot name="tools">
23
- <!-- <el-button-group> -->
24
- <div>
9
+ <div v-if="tools.length">
25
10
  <el-tooltip
26
11
  v-for="(item, idx) in tools"
27
12
  :key="idx"
@@ -40,16 +25,20 @@
40
25
  </el-button>
41
26
  </el-tooltip>
42
27
  </div>
43
- <!-- </el-button-group> -->
44
28
  </slot>
29
+ </div>
30
+ <div
31
+ :class="{ 'pb-10': $slots.tools || tools.length || showRefresh || showColumn }"
32
+ class="flex align-items-center"
33
+ >
45
34
  <el-tooltip
35
+ v-if="showRefresh"
46
36
  class="ml-10"
47
37
  content="刷新"
48
38
  placement="bottom"
49
39
  effect="dark"
50
40
  >
51
41
  <el-button
52
- v-if="showRefresh"
53
42
  size="mini"
54
43
  type="primary"
55
44
  @click="$emit('on-refresh')"
@@ -57,6 +46,36 @@
57
46
  plain
58
47
  ></el-button>
59
48
  </el-tooltip>
49
+ <el-popover
50
+ v-if="showColumn"
51
+ placement="bottom"
52
+ width="150"
53
+ trigger="click"
54
+ >
55
+ <div class="xn-table-box-tools__coll">
56
+ <el-checkbox
57
+ v-for="(item, idx) in columns"
58
+ :key="idx"
59
+ v-model="item.checked"
60
+ style="display: block; margin-right: 0"
61
+ >{{ item.label }}</el-checkbox
62
+ >
63
+ </div>
64
+ <el-tooltip
65
+ class="ml-10"
66
+ content="列设置"
67
+ placement="bottom"
68
+ effect="dark"
69
+ slot="reference"
70
+ >
71
+ <el-button
72
+ size="mini"
73
+ type="primary"
74
+ icon="el-icon-setting"
75
+ plain
76
+ ></el-button>
77
+ </el-tooltip>
78
+ </el-popover>
60
79
  </div>
61
80
  </div>
62
81
  </div>
@@ -68,7 +87,7 @@
68
87
  :border="border"
69
88
  :stripe="stripe"
70
89
  :header-row-class-name="headerRowClassName"
71
- @row-click="singleElection"
90
+ @row-click="singleSelection"
72
91
  @selection-change="selectionChange"
73
92
  :row-class-name="tableRowClassName"
74
93
  :class="{ 'disabled-all-selection': isRadio }"
@@ -102,9 +121,8 @@
102
121
  ></el-table-column>
103
122
  <slot>
104
123
  <column
105
- v-for="(item, idx) in columns"
124
+ v-for="(item, idx) in visibleColumns"
106
125
  :key="idx"
107
- v-show="item.checked === true"
108
126
  v-bind="item"
109
127
  ></column>
110
128
  </slot>
@@ -120,7 +138,6 @@
120
138
  :pageSize.sync="page.pageSize"
121
139
  @pagination="getList"
122
140
  v-bind="$attrs"
123
- layout="total, prev, pager, next, jumper"
124
141
  ></xn-page>
125
142
  </template>
126
143
  </div>
@@ -175,20 +192,20 @@ export default {
175
192
  },
176
193
  disabledList: {
177
194
  type: Array,
178
- require: false,
195
+ required: false,
179
196
  default: () => {
180
197
  return [];
181
198
  },
182
199
  },
183
200
  disabledKey: {
184
201
  type: String,
185
- require: false,
202
+ required: false,
186
203
  default: "",
187
204
  },
188
205
  /* 筛选条件,正则 */
189
206
  filterQuery: {
190
207
  type: Object,
191
- require: false,
208
+ required: false,
192
209
  default: () => {
193
210
  return {};
194
211
  },
@@ -210,15 +227,41 @@ export default {
210
227
  currentTable() {
211
228
  return this.$refs.table;
212
229
  },
230
+ visibleColumns() {
231
+ return this.columns.filter(item => item.checked !== false);
232
+ },
213
233
  },
214
- created() {},
215
- updated() {
216
- !this.$slots.default &&
217
- this.columns.length &&
218
- this.columns.forEach((item) => {
219
- if (item.checked !== true) this.$set(item, "checked", true);
220
- });
234
+ watch: {
235
+ columns: {
236
+ handler(val, oldVal) {
237
+ if (val && val.length) {
238
+ let needLayout = false;
239
+ val.forEach((item) => {
240
+ if (item.checked === undefined) {
241
+ this.$set(item, "checked", true);
242
+ }
243
+ });
244
+
245
+ // 检测是否有列的 checked 状态发生变化
246
+ if (oldVal && oldVal.length) {
247
+ needLayout = val.some((item, index) => {
248
+ return oldVal[index] && item.checked !== oldVal[index].checked;
249
+ });
250
+ }
251
+
252
+ // 如果列状态变化,下一帧重新计算布局
253
+ if (needLayout) {
254
+ this.$nextTick(() => {
255
+ this.doLayout();
256
+ });
257
+ }
258
+ }
259
+ },
260
+ immediate: true,
261
+ deep: true,
262
+ },
221
263
  },
264
+ created() {},
222
265
  methods: {
223
266
  indexMethod(index) {
224
267
  if (this.page && this.page.pageNum && this.page.pageSize) {
@@ -229,7 +272,7 @@ export default {
229
272
  getList(val) {
230
273
  this.$emit("on-page", val);
231
274
  },
232
- singleElection(val, column) {
275
+ singleSelection(val, column) {
233
276
  if (!this.isRadio) return;
234
277
  const { idKey } = this;
235
278
  this.radioSelected = val[idKey];
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { Tag } from "element-ui";
2
+ import { Tag } from "@liuzengwei/element-ui";
3
3
  export default {
4
4
  name: "XnTag",
5
5
  extends: Tag,