xt-element-ui 1.2.7 → 1.3.0
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/lib/index.common.js +135 -66
- package/lib/index.css +1 -1
- package/lib/index.umd.js +135 -66
- package/lib/index.umd.min.js +1 -1
- package/package.json +1 -1
- package/src/components/xt-button/index.vue +53 -10
- package/src/components/xt-button/style/index.scss +147 -43
- package/src/components/xt-input/index.vue +66 -37
- package/src/components/xt-input/style/index.scss +70 -13
- package/src/components/xt-step-price/index.vue +13 -11
- package/src/components/xt-step-price/style/index.scss +32 -24
- package/src/components/xt-step-price-item/index.vue +26 -15
package/lib/index.umd.js
CHANGED
|
@@ -128931,21 +128931,26 @@ const onConfigChange = function(listener) {
|
|
|
128931
128931
|
onConfigChange
|
|
128932
128932
|
});
|
|
128933
128933
|
|
|
128934
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"60253456-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-button/index.vue?vue&type=template&id=
|
|
128934
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"60253456-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-button/index.vue?vue&type=template&id=daf19d9c
|
|
128935
128935
|
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('button',{staticClass:"xt-button",class:[
|
|
128936
|
-
_vm.type ?'xt-button--' + _vm.type: '',
|
|
128936
|
+
_vm.type ? 'xt-button--' + _vm.type : '',
|
|
128937
128937
|
_vm.size ? 'xt-button--' + _vm.size : '',
|
|
128938
128938
|
{
|
|
128939
|
-
'is-plain': _vm.plain,
|
|
128939
|
+
'is-plain': _vm.plain,
|
|
128940
128940
|
'is-disabled': _vm.disabled,
|
|
128941
|
-
'is-round': _vm.round
|
|
128941
|
+
'is-round': _vm.round,
|
|
128942
|
+
'is-circle': _vm.circle,
|
|
128943
|
+
'is-dashed': _vm.dashed,
|
|
128944
|
+
'is-text': _vm.text,
|
|
128945
|
+
'is-link': _vm.link,
|
|
128946
|
+
'is-loading': _vm.loading
|
|
128942
128947
|
}
|
|
128943
|
-
],attrs:{"disabled":_vm.disabled},on:{"click":_vm.handleClick}},[_vm._t("default")],2)
|
|
128948
|
+
],attrs:{"disabled":_vm.disabled || _vm.loading},on:{"click":_vm.handleClick}},[(_vm.loading)?_c('i',{staticClass:"el-icon-loading"}):(_vm.icon)?_c('i',{class:_vm.iconClass}):_vm._e(),(_vm.$slots.default)?_c('span',{staticClass:"xt-button__inner"},[_vm._t("default")],2):_vm._e()])
|
|
128944
128949
|
}
|
|
128945
128950
|
var staticRenderFns = []
|
|
128946
128951
|
|
|
128947
128952
|
|
|
128948
|
-
// CONCATENATED MODULE: ./src/components/xt-button/index.vue?vue&type=template&id=
|
|
128953
|
+
// CONCATENATED MODULE: ./src/components/xt-button/index.vue?vue&type=template&id=daf19d9c
|
|
128949
128954
|
|
|
128950
128955
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-button/index.vue?vue&type=script&lang=js
|
|
128951
128956
|
|
|
@@ -128955,7 +128960,7 @@ var staticRenderFns = []
|
|
|
128955
128960
|
type: {
|
|
128956
128961
|
type: String,
|
|
128957
128962
|
default: '',
|
|
128958
|
-
validator: (val) => ['', 'primary', 'success', 'warning', 'danger'].includes(val)
|
|
128963
|
+
validator: (val) => ['', 'primary', 'success', 'warning', 'danger', 'info'].includes(val)
|
|
128959
128964
|
},
|
|
128960
128965
|
size: {
|
|
128961
128966
|
type: String,
|
|
@@ -128973,11 +128978,44 @@ var staticRenderFns = []
|
|
|
128973
128978
|
round: {
|
|
128974
128979
|
type: Boolean,
|
|
128975
128980
|
default: false
|
|
128981
|
+
},
|
|
128982
|
+
circle: {
|
|
128983
|
+
type: Boolean,
|
|
128984
|
+
default: false
|
|
128985
|
+
},
|
|
128986
|
+
dashed: {
|
|
128987
|
+
type: Boolean,
|
|
128988
|
+
default: false
|
|
128989
|
+
},
|
|
128990
|
+
text: {
|
|
128991
|
+
type: Boolean,
|
|
128992
|
+
default: false
|
|
128993
|
+
},
|
|
128994
|
+
link: {
|
|
128995
|
+
type: Boolean,
|
|
128996
|
+
default: false
|
|
128997
|
+
},
|
|
128998
|
+
icon: {
|
|
128999
|
+
type: String,
|
|
129000
|
+
default: ''
|
|
129001
|
+
},
|
|
129002
|
+
loading: {
|
|
129003
|
+
type: Boolean,
|
|
129004
|
+
default: false
|
|
129005
|
+
}
|
|
129006
|
+
},
|
|
129007
|
+
computed: {
|
|
129008
|
+
iconClass() {
|
|
129009
|
+
if (!this.icon) return ''
|
|
129010
|
+
if (this.icon.indexOf('el-icon') === 0) {
|
|
129011
|
+
return this.icon
|
|
129012
|
+
}
|
|
129013
|
+
return 'el-icon-' + this.icon
|
|
128976
129014
|
}
|
|
128977
129015
|
},
|
|
128978
129016
|
methods: {
|
|
128979
129017
|
handleClick() {
|
|
128980
|
-
if (!this.disabled) {
|
|
129018
|
+
if (!this.disabled && !this.loading) {
|
|
128981
129019
|
this.$emit('click')
|
|
128982
129020
|
}
|
|
128983
129021
|
}
|
|
@@ -129107,40 +129145,59 @@ var component = normalizeComponent(
|
|
|
129107
129145
|
// CONCATENATED MODULE: ./src/components/xt-button/index.js
|
|
129108
129146
|
|
|
129109
129147
|
/* harmony default export */ var components_xt_button = (xt_button);
|
|
129110
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"60253456-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-input/index.vue?vue&type=template&id=
|
|
129111
|
-
var
|
|
129148
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"60253456-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-input/index.vue?vue&type=template&id=69bd5491
|
|
129149
|
+
var xt_inputvue_type_template_id_69bd5491_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-input",class:[
|
|
129150
|
+
_vm.size ? 'xt-input--' + _vm.size : '',
|
|
129151
|
+
{ 'is-disabled': _vm.disabled }
|
|
129152
|
+
]},[_c('el-input',{style:(_vm.inputStyle),attrs:{"value":_vm.value,"placeholder":_vm.placeholder,"type":_vm.type,"size":_vm.size,"disabled":_vm.disabled,"readonly":_vm.readonly},on:{"input":function($event){return _vm.$emit('input', $event)},"change":function($event){return _vm.$emit('change', $event)},"focus":function($event){return _vm.$emit('focus', $event)},"blur":function($event){return _vm.$emit('blur', $event)}}})],1)
|
|
129112
129153
|
}
|
|
129113
|
-
var
|
|
129154
|
+
var xt_inputvue_type_template_id_69bd5491_staticRenderFns = []
|
|
129114
129155
|
|
|
129115
129156
|
|
|
129116
|
-
// CONCATENATED MODULE: ./src/components/xt-input/index.vue?vue&type=template&id=
|
|
129157
|
+
// CONCATENATED MODULE: ./src/components/xt-input/index.vue?vue&type=template&id=69bd5491
|
|
129117
129158
|
|
|
129118
129159
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-input/index.vue?vue&type=script&lang=js
|
|
129119
|
-
|
|
129120
|
-
/* harmony default export */ var xt_inputvue_type_script_lang_js = ({
|
|
129121
|
-
name: 'XtInput',
|
|
129122
|
-
props: {
|
|
129123
|
-
value: [String, Number],
|
|
129124
|
-
placeholder: {
|
|
129125
|
-
type: String,
|
|
129126
|
-
default: '请输入内容'
|
|
129127
|
-
},
|
|
129128
|
-
|
|
129129
|
-
type: String,
|
|
129130
|
-
default: ''
|
|
129131
|
-
}
|
|
129132
|
-
|
|
129133
|
-
|
|
129134
|
-
|
|
129135
|
-
|
|
129136
|
-
|
|
129137
|
-
|
|
129138
|
-
|
|
129139
|
-
|
|
129140
|
-
|
|
129141
|
-
|
|
129142
|
-
|
|
129143
|
-
}
|
|
129160
|
+
|
|
129161
|
+
/* harmony default export */ var xt_inputvue_type_script_lang_js = ({
|
|
129162
|
+
name: 'XtInput',
|
|
129163
|
+
props: {
|
|
129164
|
+
value: [String, Number],
|
|
129165
|
+
placeholder: {
|
|
129166
|
+
type: String,
|
|
129167
|
+
default: '请输入内容'
|
|
129168
|
+
},
|
|
129169
|
+
type: {
|
|
129170
|
+
type: String,
|
|
129171
|
+
default: 'text'
|
|
129172
|
+
},
|
|
129173
|
+
size: {
|
|
129174
|
+
type: String,
|
|
129175
|
+
default: ''
|
|
129176
|
+
},
|
|
129177
|
+
disabled: {
|
|
129178
|
+
type: Boolean,
|
|
129179
|
+
default: false
|
|
129180
|
+
},
|
|
129181
|
+
readonly: {
|
|
129182
|
+
type: Boolean,
|
|
129183
|
+
default: false
|
|
129184
|
+
},
|
|
129185
|
+
color: {
|
|
129186
|
+
type: String,
|
|
129187
|
+
default: ''
|
|
129188
|
+
}
|
|
129189
|
+
},
|
|
129190
|
+
computed: {
|
|
129191
|
+
inputStyle() {
|
|
129192
|
+
if (this.color) {
|
|
129193
|
+
return {
|
|
129194
|
+
'--xt-input-focus-color': this.color
|
|
129195
|
+
}
|
|
129196
|
+
}
|
|
129197
|
+
return {}
|
|
129198
|
+
}
|
|
129199
|
+
}
|
|
129200
|
+
});
|
|
129144
129201
|
|
|
129145
129202
|
// CONCATENATED MODULE: ./src/components/xt-input/index.vue?vue&type=script&lang=js
|
|
129146
129203
|
/* harmony default export */ var components_xt_inputvue_type_script_lang_js = (xt_inputvue_type_script_lang_js);
|
|
@@ -129154,8 +129211,8 @@ var xt_inputvue_type_template_id_f11783a2_staticRenderFns = []
|
|
|
129154
129211
|
|
|
129155
129212
|
var xt_input_component = normalizeComponent(
|
|
129156
129213
|
components_xt_inputvue_type_script_lang_js,
|
|
129157
|
-
|
|
129158
|
-
|
|
129214
|
+
xt_inputvue_type_template_id_69bd5491_render,
|
|
129215
|
+
xt_inputvue_type_template_id_69bd5491_staticRenderFns,
|
|
129159
129216
|
false,
|
|
129160
129217
|
null,
|
|
129161
129218
|
null,
|
|
@@ -130201,21 +130258,21 @@ var xt_time_component = normalizeComponent(
|
|
|
130201
130258
|
|
|
130202
130259
|
/* harmony default export */ var components_xt_time = (xt_time);
|
|
130203
130260
|
|
|
130204
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"60253456-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-step-price/index.vue?vue&type=template&id=
|
|
130205
|
-
var
|
|
130261
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"60253456-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-step-price/index.vue?vue&type=template&id=1fb68540
|
|
130262
|
+
var xt_step_pricevue_type_template_id_1fb68540_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-step-price",class:{ 'is-disabled': _vm.disabled }},[(_vm.title || _vm.$slots.header)?_c('div',{staticClass:"xt-step-price__header"},[(_vm.title)?_c('xt-text',{attrs:{"bold":"","size":"medium"}},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_vm._t("header"),(!_vm.disabled && !_vm.isLimitReached)?_c('xt-button',{attrs:{"type":"primary","size":"small","icon":"el-icon-plus","plain":""},on:{"click":_vm.onAdd}},[_vm._v("新增档位")]):_vm._e(),(_vm.isLimitReached)?_c('xt-text',{attrs:{"size":"small","type-color":"info"}},[_vm._v("已达上限("+_vm._s(_vm.localItems.length)+"/"+_vm._s(_vm.limit)+")")]):_vm._e()],2):_vm._e(),_c('div',{staticClass:"xt-step-price__list"},_vm._l((_vm.localItems),function(item,idx){return _c('XtStepPriceItem',{key:idx,attrs:{"value":item,"index":idx,"is-first":idx === 0,"is-last":idx === _vm.localItems.length - 1,"items-length":_vm.localItems.length,"removable":idx !== 0,"min-locked":idx !== 0 ? true : false,"unit":_vm.unit,"precision":_vm.precision,"step":_vm.step,"left-bracket":_vm.leftBracket,"right-bracket":_vm.rightBracket,"field-keys":_vm.fieldKeys,"disabled":_vm.disabled},on:{"input":(val) => _vm.onItemInput(val, idx),"max-change":_vm.onMaxChange,"min-change":_vm.onMinChange,"delete":_vm.onDelete}})}),1),(_vm.localItems.length === 0)?_c('div',{staticClass:"xt-step-price__empty"},[_c('span',[_vm._v("暂无数据,点击右上角「新增档位」开始配置")])]):_vm._e(),(_vm.tip || _vm.$slots.tip)?_c('div',{staticClass:"xt-step-price__tip"},[_vm._t("tip",function(){return [_c('xt-text',{attrs:{"size":"small","type-color":"warning"}},[_vm._v(_vm._s(_vm.tip))])]})],2):_vm._e()])
|
|
130206
130263
|
}
|
|
130207
|
-
var
|
|
130264
|
+
var xt_step_pricevue_type_template_id_1fb68540_staticRenderFns = []
|
|
130208
130265
|
|
|
130209
130266
|
|
|
130210
|
-
// CONCATENATED MODULE: ./src/components/xt-step-price/index.vue?vue&type=template&id=
|
|
130267
|
+
// CONCATENATED MODULE: ./src/components/xt-step-price/index.vue?vue&type=template&id=1fb68540
|
|
130211
130268
|
|
|
130212
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"60253456-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-step-price-item/index.vue?vue&type=template&id=
|
|
130213
|
-
var
|
|
130269
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"60253456-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-step-price-item/index.vue?vue&type=template&id=ad5d83ae
|
|
130270
|
+
var xt_step_price_itemvue_type_template_id_ad5d83ae_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-step-price-item"},[_c('div',{staticClass:"xt-step-price-item__range"},[_c('span',{staticClass:"xt-step-price-item__bracket"},[_vm._v(_vm._s(_vm.finalLeftBracket))]),(_vm.itemsLength > 1)?_c('span',{staticClass:"xt-step-price-item__name"},[_vm._v("第"+_vm._s(_vm.index + 1)+"档")]):_vm._e(),_c('span',{staticClass:"xt-step-price-item__bracket"},[_vm._v(_vm._s(_vm.finalRightBracket))]),_c('xt-input',{staticClass:"xt-step-price-item__input",attrs:{"disabled":_vm.disabled || _vm.minLocked,"size":"small"},on:{"blur":_vm.onMinBlur},model:{value:(_vm.minInput),callback:function ($$v) {_vm.minInput=_vm._n($$v)},expression:"minInput"}}),_c('span',{staticClass:"xt-step-price-item__comma"},[_vm._v("-")]),(!_vm.isLast)?_c('xt-input',{staticClass:"xt-step-price-item__input",attrs:{"disabled":_vm.disabled,"size":"small"},on:{"blur":_vm.onMaxBlur},model:{value:(_vm.maxInput),callback:function ($$v) {_vm.maxInput=_vm._n($$v)},expression:"maxInput"}}):_c('span',{staticClass:"xt-step-price-item__infinity"},[_vm._v("+∞")])],1),_c('div',{staticClass:"xt-step-price-item__price"},[_c('xt-input',{staticClass:"xt-step-price-item__input xt-step-price-item__input--price",attrs:{"disabled":_vm.disabled,"size":"small","placeholder":"价格"},on:{"blur":_vm.onPriceBlur},model:{value:(_vm.priceInput),callback:function ($$v) {_vm.priceInput=_vm._n($$v)},expression:"priceInput"}}),_c('span',{staticClass:"xt-step-price-item__unit"},[_vm._v(_vm._s(_vm.unit))])],1),(!_vm.disabled && _vm.removable && _vm.itemsLength > 1)?_c('xt-button',{staticClass:"xt-step-price-item__delete",attrs:{"text":"","icon":"el-icon-delete"},on:{"click":_vm.onDelete}}):_vm._e()],1)
|
|
130214
130271
|
}
|
|
130215
|
-
var
|
|
130272
|
+
var xt_step_price_itemvue_type_template_id_ad5d83ae_staticRenderFns = []
|
|
130216
130273
|
|
|
130217
130274
|
|
|
130218
|
-
// CONCATENATED MODULE: ./src/components/xt-step-price-item/index.vue?vue&type=template&id=
|
|
130275
|
+
// CONCATENATED MODULE: ./src/components/xt-step-price-item/index.vue?vue&type=template&id=ad5d83ae
|
|
130219
130276
|
|
|
130220
130277
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-step-price-item/index.vue?vue&type=script&lang=js
|
|
130221
130278
|
|
|
@@ -130237,6 +130294,8 @@ var xt_step_price_itemvue_type_template_id_2417b1fa_staticRenderFns = []
|
|
|
130237
130294
|
minLocked: { type: Boolean, default: false },
|
|
130238
130295
|
unit: { type: String, default: '元' },
|
|
130239
130296
|
precision: { type: Number, default: 2 },
|
|
130297
|
+
// 阶梯增量:控制新增/校正时的区间跨度,默认 1
|
|
130298
|
+
step: { type: Number, default: 1 },
|
|
130240
130299
|
// 左括号:默认 '[',传空则不显示
|
|
130241
130300
|
leftBracket: { type: String, default: '[' },
|
|
130242
130301
|
// 右括号:默认 null,走内置规则(只有1条为 ']',多条为 ')');传值则强制使用
|
|
@@ -130262,10 +130321,7 @@ var xt_step_price_itemvue_type_template_id_2417b1fa_staticRenderFns = []
|
|
|
130262
130321
|
},
|
|
130263
130322
|
|
|
130264
130323
|
data() {
|
|
130265
|
-
const
|
|
130266
|
-
const minVal = this.safeNumber(v && v[this.keyMin], 0)
|
|
130267
|
-
const maxVal = this.isLast ? null : this.safeNumber(v && v[this.keyMax], minVal + 1)
|
|
130268
|
-
const priceVal = this.safeNumber(v && v[this.keyPrice], 0)
|
|
130324
|
+
const { minVal, maxVal, priceVal } = this.getPriceItem(this.value)
|
|
130269
130325
|
return {
|
|
130270
130326
|
minInput: minVal,
|
|
130271
130327
|
maxInput: maxVal,
|
|
@@ -130276,11 +130332,12 @@ var xt_step_price_itemvue_type_template_id_2417b1fa_staticRenderFns = []
|
|
|
130276
130332
|
watch: {
|
|
130277
130333
|
value: {
|
|
130278
130334
|
deep: true,
|
|
130335
|
+
immediate: true,
|
|
130279
130336
|
handler(val) {
|
|
130280
|
-
const minVal = this.
|
|
130337
|
+
const { minVal, maxVal, priceVal } = this.getPriceItem(val)
|
|
130281
130338
|
this.minInput = minVal
|
|
130282
|
-
this.maxInput =
|
|
130283
|
-
this.priceInput =
|
|
130339
|
+
this.maxInput = maxVal
|
|
130340
|
+
this.priceInput = priceVal
|
|
130284
130341
|
}
|
|
130285
130342
|
},
|
|
130286
130343
|
isLast(val) {
|
|
@@ -130295,6 +130352,17 @@ var xt_step_price_itemvue_type_template_id_2417b1fa_staticRenderFns = []
|
|
|
130295
130352
|
},
|
|
130296
130353
|
|
|
130297
130354
|
methods: {
|
|
130355
|
+
getPriceItem(value) {
|
|
130356
|
+
const v = value
|
|
130357
|
+
const minVal = this.safeNumber(v && v[this.keyMin], 0)
|
|
130358
|
+
const maxVal = this.isLast ? null : this.safeNumber(v && v[this.keyMax], minVal + 1)
|
|
130359
|
+
const priceVal = this.safeNumber(v && v[this.keyPrice], 0)
|
|
130360
|
+
return {
|
|
130361
|
+
minVal,
|
|
130362
|
+
maxVal,
|
|
130363
|
+
priceVal
|
|
130364
|
+
}
|
|
130365
|
+
},
|
|
130298
130366
|
// 统一兜底:非数字输入一律转为 fallback(默认 0)
|
|
130299
130367
|
safeNumber(v, fallback = 0) {
|
|
130300
130368
|
if (v === null || v === undefined || v === '' || v === Infinity || v === -Infinity) return fallback
|
|
@@ -130356,8 +130424,8 @@ var xt_step_price_itemvue_type_template_id_2417b1fa_staticRenderFns = []
|
|
|
130356
130424
|
|
|
130357
130425
|
var xt_step_price_item_component = normalizeComponent(
|
|
130358
130426
|
components_xt_step_price_itemvue_type_script_lang_js,
|
|
130359
|
-
|
|
130360
|
-
|
|
130427
|
+
xt_step_price_itemvue_type_template_id_ad5d83ae_render,
|
|
130428
|
+
xt_step_price_itemvue_type_template_id_ad5d83ae_staticRenderFns,
|
|
130361
130429
|
false,
|
|
130362
130430
|
null,
|
|
130363
130431
|
null,
|
|
@@ -130404,6 +130472,8 @@ var xt_step_price_item_component = normalizeComponent(
|
|
|
130404
130472
|
},
|
|
130405
130473
|
// 阶梯数量上限;<= 0 表示不限制
|
|
130406
130474
|
limit: { type: Number, default: 0 },
|
|
130475
|
+
// 阶梯增量:新增/校正时,下一条阶梯的 min = 当前 max = 当前 min + step(默认 1)
|
|
130476
|
+
step: { type: Number, default: 10 },
|
|
130407
130477
|
disabled: { type: Boolean, default: false },
|
|
130408
130478
|
tip: {
|
|
130409
130479
|
type: String,
|
|
@@ -130422,6 +130492,7 @@ var xt_step_price_item_component = normalizeComponent(
|
|
|
130422
130492
|
watch: {
|
|
130423
130493
|
value: {
|
|
130424
130494
|
deep: true,
|
|
130495
|
+
immediate: true,
|
|
130425
130496
|
handler(val) {
|
|
130426
130497
|
this.localItems = this.normalize(val)
|
|
130427
130498
|
}
|
|
@@ -130458,14 +130529,15 @@ var xt_step_price_item_component = normalizeComponent(
|
|
|
130458
130529
|
ensureContinuity(list) {
|
|
130459
130530
|
if (!Array.isArray(list) || list.length === 0) return
|
|
130460
130531
|
list[0][this.keyMin] = 0
|
|
130532
|
+
const stepVal = this.safeNumber(this.step, 1)
|
|
130461
130533
|
|
|
130462
130534
|
for (let i = 0; i < list.length; i++) {
|
|
130463
130535
|
const cur = list[i]
|
|
130464
130536
|
const next = list[i + 1]
|
|
130465
130537
|
const curMin = this.safeNumber(cur[this.keyMin], 0)
|
|
130466
130538
|
if (next) {
|
|
130467
|
-
let curMax = this.safeNumber(cur[this.keyMax], curMin +
|
|
130468
|
-
if (curMax <= curMin) curMax = curMin +
|
|
130539
|
+
let curMax = this.safeNumber(cur[this.keyMax], curMin + stepVal)
|
|
130540
|
+
if (curMax <= curMin) curMax = curMin + stepVal
|
|
130469
130541
|
cur[this.keyMax] = curMax
|
|
130470
130542
|
next[this.keyMin] = curMax
|
|
130471
130543
|
} else {
|
|
@@ -130513,10 +130585,10 @@ var xt_step_price_item_component = normalizeComponent(
|
|
|
130513
130585
|
},
|
|
130514
130586
|
|
|
130515
130587
|
onAdd() {
|
|
130516
|
-
debugger
|
|
130517
130588
|
const list = this.localItems
|
|
130518
130589
|
const lim = Number(this.limit)
|
|
130519
130590
|
if (lim > 0 && list.length >= lim) return
|
|
130591
|
+
const stepVal = this.safeNumber(this.step, 1)
|
|
130520
130592
|
|
|
130521
130593
|
// 场景 1:空数组 —— 直接 push 一条 [0, +∞)
|
|
130522
130594
|
if (list.length === 0) {
|
|
@@ -130529,10 +130601,10 @@ var xt_step_price_item_component = normalizeComponent(
|
|
|
130529
130601
|
return
|
|
130530
130602
|
}
|
|
130531
130603
|
|
|
130532
|
-
// 场景 2:已有数据 ——
|
|
130604
|
+
// 场景 2:已有数据 —— 在末条前插入新条,新条的 max = 末条 min + step
|
|
130533
130605
|
const last = list[list.length - 1]
|
|
130534
130606
|
const newMin = this.safeNumber(last[this.keyMin], 0)
|
|
130535
|
-
const newMax = newMin +
|
|
130607
|
+
const newMax = newMin + stepVal
|
|
130536
130608
|
|
|
130537
130609
|
// 新条 price:优先继承「倒数第二条」的 price,其次用末条 price(>0 时),否则默认 10
|
|
130538
130610
|
const prev = list[list.length - 2]
|
|
@@ -130544,9 +130616,6 @@ var xt_step_price_item_component = normalizeComponent(
|
|
|
130544
130616
|
newPrice = lastPrice > 0 ? lastPrice : 10
|
|
130545
130617
|
}
|
|
130546
130618
|
|
|
130547
|
-
// 关键修复:构造全新数组,避免 splice 导致 Vue 组件复用 & 响应式不同步
|
|
130548
|
-
// 新条 = { newMin, newMax, newPrice }
|
|
130549
|
-
// 新末条 = { min: newMax, max: null, price: newPrice }
|
|
130550
130619
|
const newArr = [
|
|
130551
130620
|
...list.slice(0, -1),
|
|
130552
130621
|
{
|
|
@@ -130597,8 +130666,8 @@ var xt_step_price_item_component = normalizeComponent(
|
|
|
130597
130666
|
|
|
130598
130667
|
var xt_step_price_component = normalizeComponent(
|
|
130599
130668
|
components_xt_step_pricevue_type_script_lang_js,
|
|
130600
|
-
|
|
130601
|
-
|
|
130669
|
+
xt_step_pricevue_type_template_id_1fb68540_render,
|
|
130670
|
+
xt_step_pricevue_type_template_id_1fb68540_staticRenderFns,
|
|
130602
130671
|
false,
|
|
130603
130672
|
null,
|
|
130604
130673
|
null,
|