shijiplus-web-plugin 0.1.20 → 0.1.22

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": "shijiplus-web-plugin",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "files": [
5
5
  "src"
6
6
  ],
@@ -1,4 +1,4 @@
1
- const compFiles = ['plus-icon', 'plus-city-cascader', 'plus-count-down', 'plus-city-cascader', 'plus-common-header', 'plus-poptip', 'plus-qr-code', 'plus-drawer', 'plus-tabs', 'plus-remote-selector', 'plus-select', 'plus-form', 'plus-scrollview', 'plus-table', 'plus-modal', 'plus-card', 'permission-component']
1
+ const compFiles = ['plus-tag', 'plus-icon', 'plus-city-cascader', 'plus-count-down', 'plus-city-cascader', 'plus-common-header', 'plus-poptip', 'plus-qr-code', 'plus-drawer', 'plus-tabs', 'plus-remote-selector', 'plus-select', 'plus-form', 'plus-scrollview', 'plus-table', 'plus-modal', 'plus-card', 'permission-component']
2
2
 
3
3
  const install = (vue, opts = {}) => {
4
4
  console.log('--------install---plus-comp----------')
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <PlusModal
3
+ :props="modelProps"
4
+ closable
5
+ @on-close="handlerCancel"
6
+ width="width: 430px;"
7
+ >
8
+ <div class="content-wrap">
9
+ <div class="confirm-title f-s-16 f-w-600 f-lh-24 f-c-17233D">
10
+ {{ modelProps.title }}
11
+ </div>
12
+ <div class="confirm-content f-s-14 f-lh-20">
13
+ <render-template v-if="render" :render="render"></render-template>
14
+ <div v-else-if="html" v-html="html"></div>
15
+ <div v-else>{{ content }}</div>
16
+ </div>
17
+ </div>
18
+ <div slot="footer" class="f-row justify-center footer-wrap">
19
+ <Button v-if="!hideCancel" @click="handlerCancel">{{
20
+ cancelText || '取消'
21
+ }}</Button>
22
+ <Button
23
+ @click="handlerConfirm"
24
+ type="primary"
25
+ >{{ confirmText || '确认' }}</Button
26
+ >
27
+ </div>
28
+ </PlusModal>
29
+ </template>
30
+ <script>
31
+ import RenderTemplate from '@/components/common/render-template.vue'
32
+ export default {
33
+ components: {
34
+ RenderTemplate
35
+ },
36
+ data() {
37
+ return {
38
+ modelProps: {
39
+ show: false,
40
+ title: ''
41
+ },
42
+ render: null,
43
+ content: '',
44
+ cancelText: '取消',
45
+ confirmText: '确认',
46
+ hideCancel: false,
47
+ html: ''
48
+ }
49
+ },
50
+ methods: {
51
+ handlerCancel() {
52
+ if (this.mReject) {
53
+ this.mReject()
54
+ }
55
+ this.handlerColose()
56
+ },
57
+ handlerConfirm() {
58
+ if (this.mResolve) {
59
+ this.mResolve()
60
+ }
61
+ this.handlerColose()
62
+ },
63
+ handlerColose() {
64
+ this.modelProps.show = false
65
+ this.$emit('on-closed')
66
+ },
67
+ show(config) {
68
+ this.modelProps.show = true
69
+ this.modelProps.title = config.title
70
+ this.render = config.render
71
+ this.content = config.content
72
+ this.hideCancel = config.hideCancel
73
+ this.confirmText = config.confirmText
74
+ this.cancelText = config.cancelText
75
+ this.html = config.html
76
+ return new Promise((resolve, reject) => {
77
+ this.mResolve = resolve
78
+ this.mReject = reject
79
+ })
80
+ }
81
+ }
82
+ }
83
+ </script>
84
+ <style lang="less" scoped>
85
+ .content-wrap {
86
+ box-sizing: border-box;
87
+ height: 230px;
88
+ }
89
+ .confirm-title {
90
+ margin-top: 87px;
91
+ text-align: center;
92
+ }
93
+ .confirm-content {
94
+ margin-top: 24px;
95
+ width: 354px;
96
+ text-align: center;
97
+ }
98
+ .footer-wrap {
99
+ .ivu-btn + .ivu-btn {
100
+ margin-left: 40px;
101
+ }
102
+ }
103
+ </style>
@@ -13,7 +13,7 @@
13
13
  <slot></slot>
14
14
  </div>
15
15
 
16
- <div class="drawer-footer i-flex-wrap justify-center align-center">
16
+ <div class="drawer-footer i-flex-wrap justify-end align-center">
17
17
  <slot name="footer">
18
18
  <Button type="primary" @click="onClose"> 关闭 </Button>
19
19
  </slot>
@@ -143,6 +143,9 @@ export default {
143
143
  &.ivu-form-inline {
144
144
  display: inline-flex;
145
145
  flex-wrap: wrap;
146
+ .ivu-form-item {
147
+ display: inline-flex;
148
+ }
146
149
  }
147
150
  }
148
151
  }
@@ -11,6 +11,10 @@ export default {
11
11
  type: String,
12
12
  default: ''
13
13
  },
14
+ staticSrc: {
15
+ type: Boolean,
16
+ default: false
17
+ },
14
18
  src: {
15
19
  type: String,
16
20
  default: ''
@@ -65,6 +69,9 @@ export default {
65
69
  },
66
70
  methods: {
67
71
  handleSrc(src) {
72
+ if (this.staticSrc) {
73
+ return src
74
+ }
68
75
  const ss = src.replace('@/assets', '')
69
76
  return require(`@/assets` + ss)
70
77
  }
@@ -88,4 +95,13 @@ export default {
88
95
  filter: drop-shadow(var(--size) 0px var(--filterColor));
89
96
  }
90
97
  }
98
+
99
+ .click-span {
100
+ &:hover {
101
+ .plus-icon {
102
+ --vector: -1;
103
+ --filterColor: var(--primary-color);
104
+ }
105
+ }
106
+ }
91
107
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :id="scrollId" class="scroll-wrap">
2
+ <div :id="scrollId" class="plus-scroll-wrap">
3
3
  <slot>
4
4
  <div class="empty-wrap">暂无数据</div>
5
5
  </slot>
@@ -40,7 +40,7 @@ export default {
40
40
  }
41
41
  </script>
42
42
  <style lang="less" scoped>
43
- .scroll-wrap {
43
+ .plus-scroll-wrap {
44
44
  overflow: auto;
45
45
  .empty-wrap {
46
46
  display: flex;
@@ -4,6 +4,7 @@
4
4
  ref="select"
5
5
  v-model="mValue"
6
6
  label-in-value
7
+ :transfer="transfer"
7
8
  :disabled="disabled"
8
9
  :placeholder="placeholder"
9
10
  @on-change="valueChange"
@@ -31,6 +32,10 @@ export default {
31
32
  modelValue: {
32
33
  type: [Number, String, Array]
33
34
  },
35
+ transfer: {
36
+ type: Boolean,
37
+ default: false
38
+ },
34
39
  disabled: {
35
40
  type: Boolean,
36
41
  default: false
@@ -46,6 +51,10 @@ export default {
46
51
  type: [String, Array],
47
52
  default: 'label'
48
53
  },
54
+ labelGenFun: {
55
+ type: Function,
56
+ default: null
57
+ },
49
58
  placeholder: {
50
59
  type: String,
51
60
  default: '请选择'
@@ -80,7 +89,9 @@ export default {
80
89
  return this.options.map((item) => {
81
90
  let label = ''
82
91
  let value = item[this.valueKey]
83
- if (this.labelKeys) {
92
+ if (this.labelGenFun) {
93
+ label = this.labelGenFun(item)
94
+ } else if (this.labelKeys) {
84
95
  let tempKeys = this.labelKeys
85
96
  if (typeof tempKeys == 'string') {
86
97
  tempKeys = this.labelKeys.split(',')
@@ -459,6 +459,8 @@ export default {
459
459
  .plus-table-wrap {
460
460
  --sibling-nodes-height: 0px;
461
461
  --table-th-bg-color: #f8f8f9;
462
+ --table-header-height: 54px;
463
+ --cell-top-bottom-padding: 16px;
462
464
  background-color: #ffffff;
463
465
  padding: 0px;
464
466
  box-sizing: border-box;
@@ -467,15 +469,15 @@ export default {
467
469
  }
468
470
  .p-search-area {
469
471
  position: relative;
470
- padding-bottom: 16px;
471
472
  /deep/.plus-form-wrap {
472
473
  .ivu-form-item {
473
- margin-bottom: 0px;
474
+ margin-bottom: 16px;
474
475
  }
475
476
  }
476
477
  }
477
478
  .btn-area {
478
479
  margin-top: auto;
480
+ margin-bottom: 16px;
479
481
  button {
480
482
  margin-left: 8px;
481
483
  &:first-child {
@@ -501,6 +503,7 @@ export default {
501
503
  background-color: transparent;
502
504
  }
503
505
  th {
506
+ height: var(--table-header-height);
504
507
  height: 54px;
505
508
  border-bottom: none;
506
509
  background-color: var(--table-th-bg-color);
@@ -516,15 +519,15 @@ export default {
516
519
  // height: 64px;
517
520
  // }
518
521
  .ivu-table-tip {
519
- height: ~'calc(100% - 54px)'; // 54 header的高
522
+ height: ~'calc(100% - var(--table-header-height))'; // 54 header的高
520
523
  table {
521
524
  height: 100%;
522
525
  }
523
526
  }
524
527
  .ivu-table-tbody {
525
528
  .ivu-table-cell {
526
- padding-top: 16px;
527
- padding-bottom: 16px;
529
+ padding-top: var(--cell-top-bottom-padding);
530
+ padding-bottom: var(--cell-top-bottom-padding);
528
531
  line-height: 1.4;
529
532
  }
530
533
  }
@@ -552,6 +555,25 @@ export default {
552
555
  }
553
556
  }
554
557
  }
558
+
559
+ td {
560
+ &:last-child {
561
+ .ivu-table-cell {
562
+ .click-span {
563
+ margin-right: 9px;
564
+ margin-bottom: 2px;
565
+ margin-top: 2px;
566
+ &:last-child {
567
+ margin-right: 0;
568
+ &:first-child {
569
+ margin-bottom: 0;
570
+ margin-top: 0px;
571
+ }
572
+ }
573
+ }
574
+ }
575
+ }
576
+ }
555
577
  }
556
578
  }
557
579
  /deep/.ivu-page {
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <Tag
3
+ ref="plusTagRef"
4
+ :style="`--alpha-color:${alphaColor}`"
5
+ class="plus-new-tag"
6
+ :type="type"
7
+ :color="color"
8
+ >
9
+ <slot></slot>
10
+ </Tag>
11
+ </template>
12
+ <script>
13
+ export default {
14
+ props: {
15
+ type: {
16
+ type: String,
17
+ default: ''
18
+ },
19
+ color: {
20
+ type: String,
21
+ default: 'default'
22
+ }
23
+ },
24
+ watch: {
25
+ color: {
26
+ handler(nVal) {
27
+ this.$nextTick(() => {
28
+ const textTag =
29
+ this.$refs.plusTagRef.$el.getElementsByClassName('ivu-tag-text')[0]
30
+ const rgbColor = this.rgbaColor(
31
+ window.getComputedStyle(textTag).color
32
+ )
33
+ this.$refs.plusTagRef.$el.style.setProperty(
34
+ '--alpha-color',
35
+ `rgba(${rgbColor.r},${rgbColor.g},${rgbColor.b},${rgbColor.a})`
36
+ )
37
+ })
38
+ },
39
+ immediate: true
40
+ }
41
+ },
42
+ data() {
43
+ return {
44
+ alphaColor: '#FFFFFF'
45
+ }
46
+ },
47
+ methods: {
48
+ rgbaColor(rgb) {
49
+ var rgbValues = rgb.match(/\d+/g)
50
+ if (!rgbValues) {
51
+ return {
52
+ r: 255,
53
+ g: 255,
54
+ b: 255,
55
+ a: 0
56
+ }
57
+ }
58
+ return {
59
+ r: rgbValues[0],
60
+ g: rgbValues[1],
61
+ b: rgbValues[2],
62
+ a: 0.05
63
+ }
64
+ }
65
+ }
66
+ }
67
+ </script>
68
+ <style lang="less" scoped>
69
+ .plus-new-tag {
70
+ --alpha-color: '#FFFFFF';
71
+ &.ivu-tag-border {
72
+ background-color: var(--alpha-color) !important;
73
+ }
74
+ }
75
+ </style>
package/src/index.less CHANGED
@@ -135,6 +135,14 @@
135
135
  cursor: default !important;
136
136
  }
137
137
 
138
+ &.under-line {
139
+ text-decoration: underline;
140
+
141
+ &:hover {
142
+ text-decoration-color: @link-color;
143
+ }
144
+ }
145
+
138
146
  &:hover {
139
147
  opacity: 0.8;
140
148
  }
@@ -528,4 +536,12 @@
528
536
  background-image: url('~@/assets/union-pay/line-bg.png');
529
537
  background-size : cover;
530
538
  padding : 0 12px;
539
+ }
540
+
541
+ .transparent-input {
542
+ background: transparent;
543
+
544
+ /deep/ input {
545
+ background: transparent;
546
+ }
531
547
  }
package/src/libs/util.js CHANGED
@@ -213,6 +213,22 @@ export const debounce = (fn, scheduleMs, immediate = false) => {
213
213
  })
214
214
  }
215
215
 
216
+ export const calcMaxCharByView = (str, options = { width: 0, fontSize: 1, lines: 0 }) => {
217
+ const { width, fontSize, lines } = options
218
+ const maxCount = Math.floor(width / fontSize) * lines
219
+ return maxCount
220
+ }
221
+
222
+ export const replaceMaxCharacters = (str, replaceStr, replaceIndex) => {
223
+ let result = str
224
+ if (result.length > replaceIndex) {
225
+ const rLength = replaceStr.length
226
+ result = result
227
+ .substr(0, replaceIndex)
228
+ .substr(0, replaceIndex - rLength) + replaceStr
229
+ }
230
+ return result
231
+ }
216
232
  export const trailingCharacters = (str, replaceStr, options = { width: 0, fontSize: 1, lines: 0 }) => {
217
233
  const { width, fontSize, lines } = options
218
234
  const maxCharacters = Math.floor(width / fontSize) * lines