n20-common-lib 1.3.29 → 1.3.30

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": "n20-common-lib",
3
- "version": "1.3.29",
3
+ "version": "1.3.30",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,10 +1,7 @@
1
1
  .el-button--primary,
2
2
  .el-button--default,
3
3
  .el-button--default.is-plain,
4
- .el-button--warning.is-plain,
5
- .el-button--mini,
6
- .el-button--mini.is-plain,
7
- .el-button--danger.is-plain {
4
+ .el-button--warning.is-plain {
8
5
  min-width: 72px;
9
6
  }
10
7
 
@@ -86,12 +86,3 @@
86
86
  .el-table .descending .sort-caret.descending {
87
87
  color: $--color-primary;
88
88
  }
89
-
90
- .el-table {
91
- .cell {
92
- .el-dropdown-link.n20-icon-moren {
93
- color: $--color-primary;
94
- }
95
- }
96
-
97
- }
@@ -1,36 +1,32 @@
1
1
  <template>
2
- <div class="n20-subticket-interval">
3
- <div class="input-child-range" :class="{ 'is-disabled': disabled }">
4
- <div class="flex">
5
- <div class="from">
6
- <el-input
7
- ref="input_left"
8
- v-model="value1"
9
- :disabled="disabled"
10
- placeholder="子票区间起"
11
- @blur="handleBlurleft"
12
- @focus="handleFocusLeft"
13
- @input="handleInputleft"
14
- @change="handleInputChangeLeft"
15
- />
16
- </div>
17
- <div class="center">
18
- <span> - </span>
19
- </div>
20
- <div class="to">
21
- <el-input
22
- ref="input_right"
23
- v-model="value2"
24
- :disabled="disabled"
25
- placeholder="子票区间止"
26
- @blur="handleBlurRight"
27
- @focus="handleFocusRight"
28
- @input="handleInputRight"
29
- @change="handleInputChangeRight"
30
- />
31
- </div>
32
- </div>
33
- </div>
2
+ <div
3
+ class="n20-subticket-interval flex-box"
4
+ :class="{ 'is-disabled': disabled, 'is-focus': focus }"
5
+ :disabled="disabled"
6
+ >
7
+ <el-input
8
+ ref="input_left"
9
+ v-model="value1"
10
+ class="from flex-item"
11
+ :disabled="disabled"
12
+ placeholder="子票区间起"
13
+ @blur="handleBlurleft"
14
+ @focus="handleFocusLeft"
15
+ @input="handleInputleft"
16
+ @change="handleInputChangeLeft"
17
+ />
18
+ <div class="center">-</div>
19
+ <el-input
20
+ ref="input_right"
21
+ v-model="value2"
22
+ class="to flex-item"
23
+ :disabled="disabled"
24
+ placeholder="子票区间止"
25
+ @blur="handleBlurRight"
26
+ @focus="handleFocusRight"
27
+ @input="handleInputRight"
28
+ @change="handleInputChangeRight"
29
+ />
34
30
  </div>
35
31
  </template>
36
32
 
@@ -39,14 +35,16 @@ export default {
39
35
  name: 'ChildRange',
40
36
  props: {
41
37
  // 初始化范围
42
- value: { required: true },
43
-
38
+ value: {
39
+ required: true,
40
+ type: Array,
41
+ default: () => []
42
+ },
44
43
  // 是否禁用
45
44
  disabled: {
46
45
  type: Boolean,
47
46
  default: false
48
47
  },
49
-
50
48
  // 精度参数
51
49
  precision: {
52
50
  type: Number,
@@ -59,7 +57,8 @@ export default {
59
57
  data() {
60
58
  return {
61
59
  value1: null,
62
- value2: null
60
+ value2: null,
61
+ focus: false
63
62
  }
64
63
  },
65
64
  watch: {
@@ -84,18 +83,22 @@ export default {
84
83
  },
85
84
 
86
85
  handleBlurleft(event) {
86
+ this.focus = false
87
87
  this.$emit('blurleft', event)
88
88
  },
89
89
 
90
90
  handleFocusLeft(event) {
91
+ this.focus = true
91
92
  this.$emit('focusleft', event)
92
93
  },
93
94
 
94
95
  handleBlurRight(event) {
96
+ this.focus = false
95
97
  this.$emit('blurright', event)
96
98
  },
97
99
 
98
100
  handleFocusRight(event) {
101
+ this.focus = true
99
102
  this.$emit('focusright', event)
100
103
  },
101
104
 
@@ -163,4 +166,4 @@ export default {
163
166
  }
164
167
  }
165
168
  }
166
- </script>
169
+ </script>
@@ -1,34 +1,34 @@
1
1
  .n20-subticket-interval {
2
- .input-child-range {
3
- background-color: #fff;
4
- border: 1px solid #dcdfe6;
5
- border-radius: 4px;
6
- // 取消element原有的input框样式
7
- ::v-deep .el-input--small .el-input__inner {
8
- border: 0px;
9
- margin: 0;
10
- padding: 0 5px;
11
- background-color: transparent;
12
- }
13
- ::v-deep .el-input__inner:focus {
14
- box-shadow: none;
15
- }
2
+ background-color: $--color-white;
3
+ border: 1px solid $--border-color-base;
4
+ border-radius: $--border-radius-base;
5
+ // 取消element原有的input框样式
6
+ .el-input {
7
+ margin: -1px;
16
8
  }
17
- .flex {
18
- display: flex;
19
- flex-direction: row;
20
- width: 100%;
21
- justify-content: center;
22
- align-items: center;
23
- .center {
24
- color: #cccccc;
25
- margin: 0 1px;
26
- }
9
+ .el-input__inner,
10
+ .el-input__inner:hover {
11
+ border-color: transparent !important;
12
+ background-color: transparent !important;
13
+ box-shadow: none;
27
14
  }
28
- .is-disabled {
29
- background-color: #eef0f6;
30
- border-color: #e4e7ed;
31
- color: #c0c4cc;
15
+ &:not([disabled]):hover {
16
+ border-color: $--color-primary;
17
+ }
18
+
19
+ &:focus,
20
+ &.is-focus {
21
+ border-color: $--color-primary;
22
+ box-shadow: 0 0 2px $--color-primary;
23
+ }
24
+ .center {
25
+ margin: -1px 2px;
26
+ color: $--color-text-placeholder;
27
+ }
28
+ &.is-disabled {
29
+ background-color: $--background-color-base;
30
+ border-color: $--border-color-light;
31
+ color: $--color-info-light;
32
32
  cursor: not-allowed;
33
33
  }
34
34
  }
@@ -0,0 +1,133 @@
1
+ <template>
2
+ <el-input
3
+ v-if="item.type === 'text' || item.type === undefined"
4
+ v-model="form[item.value]"
5
+ :clearable="item | clearableF"
6
+ style="width: 100%"
7
+ v-bind="item.props"
8
+ v-on="item.on"
9
+ />
10
+ <el-select
11
+ v-else-if="item.type === 'select'"
12
+ v-model="form[item.value]"
13
+ :clearable="item | clearableF"
14
+ :multiple="item.multiple"
15
+ style="width: 100%"
16
+ v-bind="item.props"
17
+ v-on="item.on"
18
+ >
19
+ <template v-if="item.props && item.props.labelKey && item.props.valueKey">
20
+ <el-option
21
+ v-for="(c, i) in item.options"
22
+ :key="i"
23
+ :label="c[item.props.labelKey]"
24
+ :value="c[item.props.valueKey]"
25
+ :disabled="c.disabled"
26
+ />
27
+ </template>
28
+ <template v-else>
29
+ <el-option
30
+ v-for="c in item.options"
31
+ :key="c.value + '_' + c.label"
32
+ :label="c.label"
33
+ :value="c.value"
34
+ :disabled="c.disabled"
35
+ />
36
+ </template>
37
+ </el-select>
38
+ <inputNumber
39
+ v-else-if="item.type === 'number'"
40
+ v-model="form[item.value]"
41
+ style="width: 100%"
42
+ v-bind="item.props"
43
+ v-on="item.on"
44
+ />
45
+ <inputNumberRange
46
+ v-else-if="item.type === 'numberrange'"
47
+ :start-value.sync="form[item.startValue]"
48
+ :end-value.sync="form[item.endValue]"
49
+ style="width: 100%"
50
+ v-bind="item.props"
51
+ v-on="item.on"
52
+ />
53
+ <datePickerPor
54
+ v-else-if="item.type === 'date'"
55
+ v-model="form[item.value]"
56
+ type="date"
57
+ :clearable="item | clearableF"
58
+ style="width: 100%"
59
+ v-bind="item.props"
60
+ v-on="item.on"
61
+ />
62
+ <datePickerPor
63
+ v-else-if="item.type === 'daterange'"
64
+ type="daterange"
65
+ :start-date.sync="form[item.startDate]"
66
+ :end-date.sync="form[item.endDate]"
67
+ :clearable="item | clearableF"
68
+ style="width: 100%"
69
+ v-bind="item.props"
70
+ v-on="item.on"
71
+ />
72
+ <el-checkbox-group
73
+ v-else-if="item.type === 'checkbox'"
74
+ v-model="form[item.value]"
75
+ v-bind="item.props"
76
+ v-on="item.on"
77
+ >
78
+ <el-checkbox
79
+ v-for="c in item.options"
80
+ :key="c.value"
81
+ :label="c.value"
82
+ :disabled="c.disabled"
83
+ >{{ c.label }}</el-checkbox
84
+ >
85
+ </el-checkbox-group>
86
+ <el-radio-group
87
+ v-else-if="item.type === 'radio'"
88
+ v-model="form[item.value]"
89
+ v-bind="item.props"
90
+ v-on="item.on"
91
+ >
92
+ <el-radio
93
+ v-for="c in item.options"
94
+ :key="c.value"
95
+ :label="c.value"
96
+ :disabled="c.disabled"
97
+ >{{ c.label }}</el-radio
98
+ >
99
+ </el-radio-group>
100
+ </template>
101
+
102
+ <script>
103
+ import inputNumber from '../InputNumber/index.vue'
104
+ import inputNumberRange from '../InputNumber/numberRange.vue'
105
+ import datePickerPor from '../DatePicker/por.vue'
106
+ export default {
107
+ components: {
108
+ inputNumber,
109
+ inputNumberRange,
110
+ datePickerPor
111
+ },
112
+ filters: {
113
+ clearableF(item) {
114
+ if (item.props && item.props.clearable === false) {
115
+ return false
116
+ } else {
117
+ return true
118
+ }
119
+ }
120
+ },
121
+ props: {
122
+ form: {
123
+ type: Object,
124
+ default: undefined
125
+ },
126
+ item: {
127
+ type: Object,
128
+ default: undefined
129
+ }
130
+ }
131
+ }
132
+ </script>
133
+