@zscreate/form-component 1.1.669 → 1.1.670
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/dist/form-component.css +21 -7
- package/dist/form-component.umd.js +380 -52
- package/package.json +1 -1
package/dist/form-component.css
CHANGED
|
@@ -5067,11 +5067,25 @@ div {
|
|
|
5067
5067
|
background-size: 100%;
|
|
5068
5068
|
}
|
|
5069
5069
|
|
|
5070
|
-
.
|
|
5070
|
+
.auto-scroll-container[data-v-5a08f966] {
|
|
5071
|
+
overflow: hidden;
|
|
5072
|
+
white-space: nowrap;
|
|
5073
|
+
position: relative;
|
|
5074
|
+
}
|
|
5075
|
+
.auto-scroll-container .scroll-text[data-v-5a08f966] {
|
|
5076
|
+
display: inline-block;
|
|
5077
|
+
white-space: nowrap;
|
|
5078
|
+
transform: translateX(0);
|
|
5079
|
+
}
|
|
5080
|
+
.auto-scroll-container .scroll-text.scrolling[data-v-5a08f966] {
|
|
5081
|
+
transition: transform linear;
|
|
5082
|
+
}
|
|
5083
|
+
|
|
5084
|
+
.sub-table-col[data-v-9b717926] {
|
|
5071
5085
|
display: flex;
|
|
5072
5086
|
box-sizing: border-box;
|
|
5073
5087
|
}
|
|
5074
|
-
.sub-table-col > span[data-v-
|
|
5088
|
+
.sub-table-col > span[data-v-9b717926] {
|
|
5075
5089
|
flex: 2;
|
|
5076
5090
|
border-bottom: 1px solid #000;
|
|
5077
5091
|
border-right: 1px solid #000;
|
|
@@ -5079,22 +5093,22 @@ div {
|
|
|
5079
5093
|
line-height: 40px;
|
|
5080
5094
|
text-align: center;
|
|
5081
5095
|
}
|
|
5082
|
-
.sub-table-col > .last-one[data-v-
|
|
5096
|
+
.sub-table-col > .last-one[data-v-9b717926] {
|
|
5083
5097
|
width: 87px;
|
|
5084
5098
|
flex: 0 0 87px;
|
|
5085
5099
|
border-right: 1px solid #333;
|
|
5086
5100
|
border-bottom: 1px solid #333;
|
|
5087
5101
|
}
|
|
5088
|
-
.sub-table-col-no-border > span[data-v-
|
|
5102
|
+
.sub-table-col-no-border > span[data-v-9b717926] {
|
|
5089
5103
|
border: none;
|
|
5090
5104
|
height: auto;
|
|
5091
5105
|
width: 0;
|
|
5092
5106
|
}
|
|
5093
|
-
.sub-table-col-no-border > .sub-table-title[data-v-
|
|
5094
|
-
.sub-table-col-no-border > .sub-table-item[data-v-
|
|
5107
|
+
.sub-table-col-no-border > .sub-table-title[data-v-9b717926]:last-child,
|
|
5108
|
+
.sub-table-col-no-border > .sub-table-item[data-v-9b717926]:last-child {
|
|
5095
5109
|
border-right: none !important;
|
|
5096
5110
|
}
|
|
5097
|
-
.sub-table-col-no-border > .last-one[data-v-
|
|
5111
|
+
.sub-table-col-no-border > .last-one[data-v-9b717926] {
|
|
5098
5112
|
width: 87px;
|
|
5099
5113
|
flex: 0 0 87px;
|
|
5100
5114
|
display: flex;
|
|
@@ -6820,7 +6820,7 @@ if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIO
|
|
|
6820
6820
|
/***/ ((module) => {
|
|
6821
6821
|
|
|
6822
6822
|
"use strict";
|
|
6823
|
-
module.exports = {"rE":"1.1.
|
|
6823
|
+
module.exports = {"rE":"1.1.670"};
|
|
6824
6824
|
|
|
6825
6825
|
/***/ }),
|
|
6826
6826
|
|
|
@@ -24918,6 +24918,15 @@ module.exports = freeGlobal;
|
|
|
24918
24918
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
24919
24919
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
24920
24920
|
/* harmony export */ });
|
|
24921
|
+
/* harmony import */ var _AutoScrollText_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93135);
|
|
24922
|
+
//
|
|
24923
|
+
//
|
|
24924
|
+
//
|
|
24925
|
+
//
|
|
24926
|
+
//
|
|
24927
|
+
//
|
|
24928
|
+
//
|
|
24929
|
+
//
|
|
24921
24930
|
//
|
|
24922
24931
|
//
|
|
24923
24932
|
//
|
|
@@ -24966,6 +24975,7 @@ module.exports = freeGlobal;
|
|
|
24966
24975
|
//
|
|
24967
24976
|
//
|
|
24968
24977
|
|
|
24978
|
+
|
|
24969
24979
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
24970
24980
|
props: {
|
|
24971
24981
|
widget: {
|
|
@@ -25012,6 +25022,9 @@ module.exports = freeGlobal;
|
|
|
25012
25022
|
default: ""
|
|
25013
25023
|
}
|
|
25014
25024
|
},
|
|
25025
|
+
components: {
|
|
25026
|
+
AutoScrollText: _AutoScrollText_vue__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A
|
|
25027
|
+
},
|
|
25015
25028
|
inject: {
|
|
25016
25029
|
config: {
|
|
25017
25030
|
form: 'config'
|
|
@@ -25037,6 +25050,16 @@ module.exports = freeGlobal;
|
|
|
25037
25050
|
created() {
|
|
25038
25051
|
this.editArr.length = this.source.columns.length;
|
|
25039
25052
|
},
|
|
25053
|
+
mounted() {
|
|
25054
|
+
// 替换分页的三个点,保证在小米手机样式没问题
|
|
25055
|
+
this.$nextTick(() => {
|
|
25056
|
+
if (this.$isMobile) {
|
|
25057
|
+
debugger;
|
|
25058
|
+
document.querySelector(".ant-pagination-item-ellipsis").innerText = "...";
|
|
25059
|
+
document.querySelector(".ant-pagination-item-ellipsis").style.fontSize = "20px";
|
|
25060
|
+
}
|
|
25061
|
+
});
|
|
25062
|
+
},
|
|
25040
25063
|
methods: {
|
|
25041
25064
|
handleSubTableStyle(widget, col) {
|
|
25042
25065
|
if (widget.options.customSubWidth) {
|
|
@@ -112829,7 +112852,7 @@ $({ target: 'Set', proto: true, real: true, forced: FORCED }, {
|
|
|
112829
112852
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(9274);
|
|
112830
112853
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_19__);
|
|
112831
112854
|
/* harmony import */ var _form_components_MessageBox_confirmBox_vue__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(97381);
|
|
112832
|
-
/* harmony import */ var _form_form_modules_common_tableItem_vue__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(
|
|
112855
|
+
/* harmony import */ var _form_form_modules_common_tableItem_vue__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(86890);
|
|
112833
112856
|
/* harmony import */ var _form_api_manage__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(5335);
|
|
112834
112857
|
/* harmony import */ var _form_form_util__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(36113);
|
|
112835
112858
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(50522);
|
|
@@ -145746,56 +145769,6 @@ var root = freeGlobal || freeSelf || Function('return this')();
|
|
|
145746
145769
|
module.exports = root;
|
|
145747
145770
|
|
|
145748
145771
|
|
|
145749
|
-
/***/ }),
|
|
145750
|
-
|
|
145751
|
-
/***/ 80553:
|
|
145752
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
145753
|
-
|
|
145754
|
-
"use strict";
|
|
145755
|
-
|
|
145756
|
-
// EXPORTS
|
|
145757
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
145758
|
-
A: () => (/* binding */ tableItem)
|
|
145759
|
-
});
|
|
145760
|
-
|
|
145761
|
-
;// ./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.11.1@vue-loader/lib/index.js??vue-loader-options!./src/form/modules/common/tableItem.vue?vue&type=template&id=d6fab0dc&scoped=true
|
|
145762
|
-
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"sub-table-col sub-table-col-no-border"},[_vm._l((_vm.widget.columns),function(tableItem,col_index){return _c('span',{directives:[{name:"show",rawName:"v-show",value:(tableItem.type !== 'hidden' && tableItem.options.canView),expression:"tableItem.type !== 'hidden' && tableItem.options.canView"}],key:_vm.index + '_' + col_index,staticClass:"sub-table-item",style:(Object.assign({}, _vm.handleSubTableStyle(_vm.widget, tableItem)))},[(['input', 'textarea'].includes(tableItem.type) && !_vm.editArr[col_index] && !tableItem.tableColCanEdit && (!_vm.widget.options.disbaledDoubleClickEdit))?_c('div',{style:(("color: #000; border-right: 1px solid " + (_vm.config.borderColor) + "; border-bottom: 1px solid " + (_vm.config.borderColor) + "; line-height: normal; padding: 0 15px; line-break: anywhere; overflow: hidden; display: flex; align-items: center; height: " + (tableItem.options.height ? tableItem.options.height+'px':'initial'))),attrs:{"title":_vm.showValue(_vm.models[_vm.source.model][_vm.index][tableItem.model], tableItem, _vm.index)},on:{"dblclick":function($event){return _vm.tableColumnsDBClick(col_index, tableItem, _vm.source.model + '_' + _vm.index + '_' + tableItem.model)}}},[_c('span',[_vm._v(_vm._s(_vm.showValue(_vm.models[_vm.source.model][_vm.index][tableItem.model], tableItem, _vm.index)))])]):_c('layout-item',{directives:[{name:"show",rawName:"v-show",value:(tableItem.options.canView),expression:"tableItem.options.canView"}],key:_vm.source.hashKey,attrs:{"tableKey":_vm.source.model,"rules":_vm.rules,"tableIndex":_vm.index,"hashKey":_vm.source.hashKey,"widget":tableItem,"models":_vm.models,"showLabel":false,"applyId":_vm.applyId},on:{"update:rules":function($event){_vm.rules=$event}}})],1)}),(!_vm.widget.options.disabled && !_vm.widget.options.hiddenOperateBtn)?_c('span',{staticClass:"last-one",style:({ borderColor: _vm.data.config.borderColor })},[_c('a-button',{attrs:{"size":"small","type":"primary"},on:{"click":function($event){return _vm.handleDeleteRow(_vm.index, _vm.widget.model, _vm.source.hashKey)}}},[_vm._v("删除行")])],1):_vm._e()],2)}
|
|
145763
|
-
var staticRenderFns = []
|
|
145764
|
-
|
|
145765
|
-
|
|
145766
|
-
// EXTERNAL MODULE: ./node_modules/_thread-loader@3.0.4@thread-loader/dist/cjs.js!./node_modules/_babel-loader@8.4.1@babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/_vue-loader@15.11.1@vue-loader/lib/index.js??vue-loader-options!./src/form/modules/common/tableItem.vue?vue&type=script&lang=js
|
|
145767
|
-
var tableItemvue_type_script_lang_js = __webpack_require__(19361);
|
|
145768
|
-
;// ./src/form/modules/common/tableItem.vue?vue&type=script&lang=js
|
|
145769
|
-
/* harmony default export */ const common_tableItemvue_type_script_lang_js = (tableItemvue_type_script_lang_js/* default */.A);
|
|
145770
|
-
;// ./node_modules/_mini-css-extract-plugin@2.9.4@mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/_css-loader@6.11.0@css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/stylePostLoader.js!./node_modules/_postcss-loader@6.2.1@postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/_less-loader@5.0.0@less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/_vue-loader@15.11.1@vue-loader/lib/index.js??vue-loader-options!./src/form/modules/common/tableItem.vue?vue&type=style&index=0&id=d6fab0dc&prod&scoped=true&lang=less
|
|
145771
|
-
// extracted by mini-css-extract-plugin
|
|
145772
|
-
|
|
145773
|
-
;// ./src/form/modules/common/tableItem.vue?vue&type=style&index=0&id=d6fab0dc&prod&scoped=true&lang=less
|
|
145774
|
-
|
|
145775
|
-
// EXTERNAL MODULE: ./node_modules/_vue-loader@15.11.1@vue-loader/lib/runtime/componentNormalizer.js
|
|
145776
|
-
var componentNormalizer = __webpack_require__(64008);
|
|
145777
|
-
;// ./src/form/modules/common/tableItem.vue
|
|
145778
|
-
|
|
145779
|
-
|
|
145780
|
-
|
|
145781
|
-
;
|
|
145782
|
-
|
|
145783
|
-
|
|
145784
|
-
/* normalize component */
|
|
145785
|
-
|
|
145786
|
-
var component = (0,componentNormalizer/* default */.A)(
|
|
145787
|
-
common_tableItemvue_type_script_lang_js,
|
|
145788
|
-
render,
|
|
145789
|
-
staticRenderFns,
|
|
145790
|
-
false,
|
|
145791
|
-
null,
|
|
145792
|
-
"d6fab0dc",
|
|
145793
|
-
null
|
|
145794
|
-
|
|
145795
|
-
)
|
|
145796
|
-
|
|
145797
|
-
/* harmony default export */ const tableItem = (component.exports);
|
|
145798
|
-
|
|
145799
145772
|
/***/ }),
|
|
145800
145773
|
|
|
145801
145774
|
/***/ 80583:
|
|
@@ -154168,6 +154141,56 @@ module.exports = function (it) {
|
|
|
154168
154141
|
};
|
|
154169
154142
|
|
|
154170
154143
|
|
|
154144
|
+
/***/ }),
|
|
154145
|
+
|
|
154146
|
+
/***/ 86890:
|
|
154147
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
154148
|
+
|
|
154149
|
+
"use strict";
|
|
154150
|
+
|
|
154151
|
+
// EXPORTS
|
|
154152
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
154153
|
+
A: () => (/* binding */ tableItem)
|
|
154154
|
+
});
|
|
154155
|
+
|
|
154156
|
+
;// ./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.11.1@vue-loader/lib/index.js??vue-loader-options!./src/form/modules/common/tableItem.vue?vue&type=template&id=9b717926&scoped=true
|
|
154157
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"sub-table-col sub-table-col-no-border"},[_vm._l((_vm.widget.columns),function(tableItem,col_index){return _c('span',{directives:[{name:"show",rawName:"v-show",value:(tableItem.type !== 'hidden' && tableItem.options.canView),expression:"tableItem.type !== 'hidden' && tableItem.options.canView"}],key:_vm.index + '_' + col_index,staticClass:"sub-table-item",style:(Object.assign({}, _vm.handleSubTableStyle(_vm.widget, tableItem)))},[(['input', 'textarea'].includes(tableItem.type) && !_vm.editArr[col_index] && !tableItem.tableColCanEdit && (!_vm.widget.options.disbaledDoubleClickEdit))?_c('div',{style:(("color: #000; border-right: 1px solid " + (_vm.config.borderColor) + "; border-bottom: 1px solid " + (_vm.config.borderColor) + "; line-height: normal; padding: 0 15px; line-break: anywhere; overflow: hidden; display: flex; align-items: center; height: " + (tableItem.options.height ? tableItem.options.height+'px':'initial'))),attrs:{"title":_vm.showValue(_vm.models[_vm.source.model][_vm.index][tableItem.model], tableItem, _vm.index)},on:{"dblclick":function($event){return _vm.tableColumnsDBClick(col_index, tableItem, _vm.source.model + '_' + _vm.index + '_' + tableItem.model)}}},[(!_vm.$isMobile)?_c('span',[_vm._v(_vm._s(_vm.showValue(_vm.models[_vm.source.model][_vm.index][tableItem.model], tableItem, _vm.index)))]):_c('AutoScrollText',{attrs:{"text":_vm.showValue(_vm.models[_vm.source.model][_vm.index][tableItem.model], tableItem, _vm.index) || '',"maxWidth":280 / _vm.widget.columns.length,"duration":18 / _vm.widget.columns.length,"delay":1.5,"pauseOnHover":true}})],1):_c('layout-item',{directives:[{name:"show",rawName:"v-show",value:(tableItem.options.canView),expression:"tableItem.options.canView"}],key:_vm.source.hashKey,attrs:{"tableKey":_vm.source.model,"rules":_vm.rules,"tableIndex":_vm.index,"hashKey":_vm.source.hashKey,"widget":tableItem,"models":_vm.models,"showLabel":false,"applyId":_vm.applyId},on:{"update:rules":function($event){_vm.rules=$event}}})],1)}),(!_vm.widget.options.disabled && !_vm.widget.options.hiddenOperateBtn)?_c('span',{staticClass:"last-one",style:({ borderColor: _vm.data.config.borderColor })},[_c('a-button',{attrs:{"size":"small","type":"primary"},on:{"click":function($event){return _vm.handleDeleteRow(_vm.index, _vm.widget.model, _vm.source.hashKey)}}},[_vm._v("删除行")])],1):_vm._e()],2)}
|
|
154158
|
+
var staticRenderFns = []
|
|
154159
|
+
|
|
154160
|
+
|
|
154161
|
+
// EXTERNAL MODULE: ./node_modules/_thread-loader@3.0.4@thread-loader/dist/cjs.js!./node_modules/_babel-loader@8.4.1@babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/_vue-loader@15.11.1@vue-loader/lib/index.js??vue-loader-options!./src/form/modules/common/tableItem.vue?vue&type=script&lang=js
|
|
154162
|
+
var tableItemvue_type_script_lang_js = __webpack_require__(19361);
|
|
154163
|
+
;// ./src/form/modules/common/tableItem.vue?vue&type=script&lang=js
|
|
154164
|
+
/* harmony default export */ const common_tableItemvue_type_script_lang_js = (tableItemvue_type_script_lang_js/* default */.A);
|
|
154165
|
+
;// ./node_modules/_mini-css-extract-plugin@2.9.4@mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/_css-loader@6.11.0@css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/stylePostLoader.js!./node_modules/_postcss-loader@6.2.1@postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/_less-loader@5.0.0@less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/_vue-loader@15.11.1@vue-loader/lib/index.js??vue-loader-options!./src/form/modules/common/tableItem.vue?vue&type=style&index=0&id=9b717926&prod&scoped=true&lang=less
|
|
154166
|
+
// extracted by mini-css-extract-plugin
|
|
154167
|
+
|
|
154168
|
+
;// ./src/form/modules/common/tableItem.vue?vue&type=style&index=0&id=9b717926&prod&scoped=true&lang=less
|
|
154169
|
+
|
|
154170
|
+
// EXTERNAL MODULE: ./node_modules/_vue-loader@15.11.1@vue-loader/lib/runtime/componentNormalizer.js
|
|
154171
|
+
var componentNormalizer = __webpack_require__(64008);
|
|
154172
|
+
;// ./src/form/modules/common/tableItem.vue
|
|
154173
|
+
|
|
154174
|
+
|
|
154175
|
+
|
|
154176
|
+
;
|
|
154177
|
+
|
|
154178
|
+
|
|
154179
|
+
/* normalize component */
|
|
154180
|
+
|
|
154181
|
+
var component = (0,componentNormalizer/* default */.A)(
|
|
154182
|
+
common_tableItemvue_type_script_lang_js,
|
|
154183
|
+
render,
|
|
154184
|
+
staticRenderFns,
|
|
154185
|
+
false,
|
|
154186
|
+
null,
|
|
154187
|
+
"9b717926",
|
|
154188
|
+
null
|
|
154189
|
+
|
|
154190
|
+
)
|
|
154191
|
+
|
|
154192
|
+
/* harmony default export */ const tableItem = (component.exports);
|
|
154193
|
+
|
|
154171
154194
|
/***/ }),
|
|
154172
154195
|
|
|
154173
154196
|
/***/ 87366:
|
|
@@ -158756,6 +158779,308 @@ module.exports = {
|
|
|
158756
158779
|
};
|
|
158757
158780
|
|
|
158758
158781
|
|
|
158782
|
+
/***/ }),
|
|
158783
|
+
|
|
158784
|
+
/***/ 93135:
|
|
158785
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
158786
|
+
|
|
158787
|
+
"use strict";
|
|
158788
|
+
|
|
158789
|
+
// EXPORTS
|
|
158790
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
158791
|
+
A: () => (/* binding */ AutoScrollText)
|
|
158792
|
+
});
|
|
158793
|
+
|
|
158794
|
+
;// ./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.11.1@vue-loader/lib/index.js??vue-loader-options!./src/form/modules/common/AutoScrollText.vue?vue&type=template&id=5a08f966&scoped=true
|
|
158795
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"auto-scroll-container",style:({ width: _vm.containerWidth }),on:{"mouseenter":_vm.handleMouseEnter,"mouseleave":_vm.handleMouseLeave}},[_c('div',{ref:"textContent",staticClass:"scroll-text",class:{ scrolling: _vm.isScrolling },style:(_vm.scrollStyle)},[_vm._v(" "+_vm._s(_vm.text)+" ")])])}
|
|
158796
|
+
var staticRenderFns = []
|
|
158797
|
+
|
|
158798
|
+
|
|
158799
|
+
;// ./node_modules/_thread-loader@3.0.4@thread-loader/dist/cjs.js!./node_modules/_babel-loader@8.4.1@babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/_vue-loader@15.11.1@vue-loader/lib/index.js??vue-loader-options!./src/form/modules/common/AutoScrollText.vue?vue&type=script&lang=js
|
|
158800
|
+
//
|
|
158801
|
+
//
|
|
158802
|
+
//
|
|
158803
|
+
//
|
|
158804
|
+
//
|
|
158805
|
+
//
|
|
158806
|
+
//
|
|
158807
|
+
//
|
|
158808
|
+
//
|
|
158809
|
+
//
|
|
158810
|
+
//
|
|
158811
|
+
//
|
|
158812
|
+
//
|
|
158813
|
+
//
|
|
158814
|
+
//
|
|
158815
|
+
//
|
|
158816
|
+
//
|
|
158817
|
+
//
|
|
158818
|
+
|
|
158819
|
+
/* harmony default export */ const AutoScrollTextvue_type_script_lang_js = ({
|
|
158820
|
+
name: "AutoScrollText",
|
|
158821
|
+
props: {
|
|
158822
|
+
// 要显示的文字
|
|
158823
|
+
text: {
|
|
158824
|
+
type: String,
|
|
158825
|
+
default: "",
|
|
158826
|
+
required: true
|
|
158827
|
+
},
|
|
158828
|
+
// 最大宽度
|
|
158829
|
+
maxWidth: {
|
|
158830
|
+
type: [String, Number],
|
|
158831
|
+
default: "120px"
|
|
158832
|
+
},
|
|
158833
|
+
// 滚动持续时间(秒)
|
|
158834
|
+
duration: {
|
|
158835
|
+
type: Number,
|
|
158836
|
+
default: 3
|
|
158837
|
+
},
|
|
158838
|
+
// 滚动到最后位置的停留时间(秒),停留后重新开始滚动
|
|
158839
|
+
delay: {
|
|
158840
|
+
type: Number,
|
|
158841
|
+
default: 1
|
|
158842
|
+
},
|
|
158843
|
+
// 是否在鼠标悬停时暂停滚动
|
|
158844
|
+
pauseOnHover: {
|
|
158845
|
+
type: Boolean,
|
|
158846
|
+
default: true
|
|
158847
|
+
}
|
|
158848
|
+
},
|
|
158849
|
+
data() {
|
|
158850
|
+
return {
|
|
158851
|
+
isScrolling: false,
|
|
158852
|
+
needScroll: false,
|
|
158853
|
+
textWidth: 0,
|
|
158854
|
+
containerWidthValue: 0,
|
|
158855
|
+
scrollTimer: null,
|
|
158856
|
+
isPaused: false,
|
|
158857
|
+
currentX: 0,
|
|
158858
|
+
pauseRemainTime: 0
|
|
158859
|
+
};
|
|
158860
|
+
},
|
|
158861
|
+
computed: {
|
|
158862
|
+
maxWidthValue() {
|
|
158863
|
+
return typeof this.maxWidth === "number" ? this.maxWidth : parseInt(this.maxWidth);
|
|
158864
|
+
},
|
|
158865
|
+
containerWidth() {
|
|
158866
|
+
if (this.needScroll) {
|
|
158867
|
+
// 需要滚动时使用最大宽度
|
|
158868
|
+
return typeof this.maxWidth === "number" ? `${this.maxWidth}px` : this.maxWidth;
|
|
158869
|
+
} else {
|
|
158870
|
+
// 不需要滚动时使用文字实际宽度,但不超过最大宽度
|
|
158871
|
+
const actualWidth = Math.min(this.textWidth, this.maxWidthValue);
|
|
158872
|
+
return `${actualWidth}px`;
|
|
158873
|
+
}
|
|
158874
|
+
},
|
|
158875
|
+
scrollStyle() {
|
|
158876
|
+
if (!this.isScrolling || !this.needScroll) {
|
|
158877
|
+
return {};
|
|
158878
|
+
}
|
|
158879
|
+
const distance = this.textWidth - this.maxWidthValue;
|
|
158880
|
+
return {
|
|
158881
|
+
transform: `translateX(-${distance}px)`,
|
|
158882
|
+
transition: `transform ${this.duration}s linear`
|
|
158883
|
+
};
|
|
158884
|
+
}
|
|
158885
|
+
},
|
|
158886
|
+
mounted() {
|
|
158887
|
+
// 使用多重延迟确保DOM完全渲染
|
|
158888
|
+
this.$nextTick(() => {
|
|
158889
|
+
setTimeout(() => {
|
|
158890
|
+
this.initScroll();
|
|
158891
|
+
}, 100); // 给DOM渲染留出时间
|
|
158892
|
+
});
|
|
158893
|
+
|
|
158894
|
+
// 监听窗口大小变化
|
|
158895
|
+
window.addEventListener("resize", this.handleResize);
|
|
158896
|
+
},
|
|
158897
|
+
beforeDestroy() {
|
|
158898
|
+
this.clearScrollTimer();
|
|
158899
|
+
window.removeEventListener("resize", this.handleResize);
|
|
158900
|
+
},
|
|
158901
|
+
watch: {
|
|
158902
|
+
text() {
|
|
158903
|
+
this.clearScrollTimer();
|
|
158904
|
+
this.isScrolling = false;
|
|
158905
|
+
this.$nextTick(() => {
|
|
158906
|
+
setTimeout(() => {
|
|
158907
|
+
this.initScroll();
|
|
158908
|
+
}, 50);
|
|
158909
|
+
});
|
|
158910
|
+
}
|
|
158911
|
+
},
|
|
158912
|
+
methods: {
|
|
158913
|
+
// 初始化滚动
|
|
158914
|
+
initScroll() {
|
|
158915
|
+
this.checkIfNeedScroll();
|
|
158916
|
+
setTimeout(() => {
|
|
158917
|
+
if (this.needScroll) {
|
|
158918
|
+
this.startScrolling();
|
|
158919
|
+
}
|
|
158920
|
+
}, 200); // 稍微延迟确保尺寸计算完成
|
|
158921
|
+
},
|
|
158922
|
+
// 检查是否需要滚动
|
|
158923
|
+
checkIfNeedScroll() {
|
|
158924
|
+
if (!this.$refs.textContent || !this.$el) return;
|
|
158925
|
+
|
|
158926
|
+
// 重置样式以获取真实宽度
|
|
158927
|
+
this.isScrolling = false;
|
|
158928
|
+
this.$refs.textContent.style.transform = "";
|
|
158929
|
+
this.$refs.textContent.style.transition = "";
|
|
158930
|
+
this.$nextTick(() => {
|
|
158931
|
+
// 多次尝试获取正确的尺寸
|
|
158932
|
+
const attemptMeasure = () => {
|
|
158933
|
+
const textRect = this.$refs.textContent.getBoundingClientRect();
|
|
158934
|
+
|
|
158935
|
+
// 确保获取到了有效的尺寸
|
|
158936
|
+
if (textRect.width > 0) {
|
|
158937
|
+
this.textWidth = textRect.width;
|
|
158938
|
+
this.containerWidthValue = this.maxWidthValue;
|
|
158939
|
+
this.needScroll = this.textWidth > this.maxWidthValue;
|
|
158940
|
+
|
|
158941
|
+
// console.log('最大宽度:', this.maxWidthValue, '文本宽度:', this.textWidth, '需要滚动:', this.needScroll);
|
|
158942
|
+
return true;
|
|
158943
|
+
}
|
|
158944
|
+
return false;
|
|
158945
|
+
};
|
|
158946
|
+
|
|
158947
|
+
// 立即尝试一次
|
|
158948
|
+
if (!attemptMeasure()) {
|
|
158949
|
+
// 如果第一次失败,延迟再试
|
|
158950
|
+
setTimeout(() => {
|
|
158951
|
+
if (!attemptMeasure()) {
|
|
158952
|
+
// 如果还是失败,再延迟一次
|
|
158953
|
+
setTimeout(attemptMeasure, 200);
|
|
158954
|
+
}
|
|
158955
|
+
}, 50);
|
|
158956
|
+
}
|
|
158957
|
+
});
|
|
158958
|
+
},
|
|
158959
|
+
// 开始滚动
|
|
158960
|
+
startScrolling() {
|
|
158961
|
+
if (!this.needScroll || this.isPaused) return;
|
|
158962
|
+
this.clearScrollTimer();
|
|
158963
|
+
|
|
158964
|
+
// 立即开始滚动
|
|
158965
|
+
if (!this.needScroll || this.isPaused) return; // 再次检查状态
|
|
158966
|
+
|
|
158967
|
+
this.isScrolling = true;
|
|
158968
|
+
|
|
158969
|
+
// 滚动完成后,在最后位置停留 delay 时间
|
|
158970
|
+
this.scrollTimer = setTimeout(() => {
|
|
158971
|
+
// 停留时间结束后重置并开始下一轮
|
|
158972
|
+
this.resetScroll();
|
|
158973
|
+
// 循环滚动
|
|
158974
|
+
setTimeout(() => {
|
|
158975
|
+
this.startScrolling();
|
|
158976
|
+
}, 100); // 重置后稍作停顿再开始下一轮
|
|
158977
|
+
}, this.duration * 1000 + this.delay * 1000);
|
|
158978
|
+
},
|
|
158979
|
+
// 重置滚动状态
|
|
158980
|
+
resetScroll() {
|
|
158981
|
+
this.isScrolling = false;
|
|
158982
|
+
this.$nextTick(() => {
|
|
158983
|
+
if (this.$refs.textContent) {
|
|
158984
|
+
this.$refs.textContent.style.transition = "none";
|
|
158985
|
+
this.$refs.textContent.style.transform = "translateX(0)";
|
|
158986
|
+
}
|
|
158987
|
+
});
|
|
158988
|
+
},
|
|
158989
|
+
// 停止滚动
|
|
158990
|
+
stopScrolling() {
|
|
158991
|
+
this.clearScrollTimer();
|
|
158992
|
+
this.resetScroll();
|
|
158993
|
+
},
|
|
158994
|
+
// 清除定时器
|
|
158995
|
+
clearScrollTimer() {
|
|
158996
|
+
if (this.scrollTimer) {
|
|
158997
|
+
clearTimeout(this.scrollTimer);
|
|
158998
|
+
this.scrollTimer = null;
|
|
158999
|
+
}
|
|
159000
|
+
},
|
|
159001
|
+
// 鼠标进入
|
|
159002
|
+
handleMouseEnter() {
|
|
159003
|
+
if (this.pauseOnHover) {
|
|
159004
|
+
this.isPaused = true;
|
|
159005
|
+
this.clearScrollTimer();
|
|
159006
|
+
// 立即暂停动画并记录当前位置和剩余时间
|
|
159007
|
+
if (this.$refs.textContent && this.isScrolling) {
|
|
159008
|
+
const style = window.getComputedStyle(this.$refs.textContent);
|
|
159009
|
+
const matrix = new WebKitCSSMatrix(style.transform);
|
|
159010
|
+
this.currentX = matrix.m41;
|
|
159011
|
+
// 计算剩余距离和剩余时间
|
|
159012
|
+
const totalDistance = this.textWidth - this.maxWidthValue;
|
|
159013
|
+
const percent = Math.abs(this.currentX) / totalDistance;
|
|
159014
|
+
this.pauseRemainTime = (1 - percent) * this.duration;
|
|
159015
|
+
this.$refs.textContent.style.transition = "none";
|
|
159016
|
+
this.$refs.textContent.style.transform = `translateX(${this.currentX}px)`;
|
|
159017
|
+
}
|
|
159018
|
+
}
|
|
159019
|
+
},
|
|
159020
|
+
// 鼠标离开
|
|
159021
|
+
handleMouseLeave() {
|
|
159022
|
+
if (this.pauseOnHover) {
|
|
159023
|
+
this.isPaused = false;
|
|
159024
|
+
if (this.needScroll && this.currentX !== 0) {
|
|
159025
|
+
// 继续滚动剩余距离
|
|
159026
|
+
this.$refs.textContent.style.transition = `transform ${this.pauseRemainTime}s linear`;
|
|
159027
|
+
this.$refs.textContent.style.transform = `translateX(-${this.textWidth - this.maxWidthValue}px)`;
|
|
159028
|
+
this.isScrolling = true;
|
|
159029
|
+
this.scrollTimer = setTimeout(() => {
|
|
159030
|
+
this.resetScroll();
|
|
159031
|
+
setTimeout(() => {
|
|
159032
|
+
this.startScrolling();
|
|
159033
|
+
}, 100);
|
|
159034
|
+
}, this.pauseRemainTime * 1000 + this.delay * 1000);
|
|
159035
|
+
this.currentX = 0;
|
|
159036
|
+
this.pauseRemainTime = 0;
|
|
159037
|
+
} else if (this.needScroll) {
|
|
159038
|
+
this.startScrolling();
|
|
159039
|
+
}
|
|
159040
|
+
}
|
|
159041
|
+
},
|
|
159042
|
+
// 窗口大小变化处理
|
|
159043
|
+
handleResize() {
|
|
159044
|
+
this.checkIfNeedScroll();
|
|
159045
|
+
if (this.needScroll) {
|
|
159046
|
+
this.startScrolling();
|
|
159047
|
+
} else {
|
|
159048
|
+
this.stopScrolling();
|
|
159049
|
+
}
|
|
159050
|
+
}
|
|
159051
|
+
}
|
|
159052
|
+
});
|
|
159053
|
+
;// ./src/form/modules/common/AutoScrollText.vue?vue&type=script&lang=js
|
|
159054
|
+
/* harmony default export */ const common_AutoScrollTextvue_type_script_lang_js = (AutoScrollTextvue_type_script_lang_js);
|
|
159055
|
+
;// ./node_modules/_mini-css-extract-plugin@2.9.4@mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/_css-loader@6.11.0@css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/_vue-loader@15.11.1@vue-loader/lib/loaders/stylePostLoader.js!./node_modules/_postcss-loader@6.2.1@postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/_less-loader@5.0.0@less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/_vue-loader@15.11.1@vue-loader/lib/index.js??vue-loader-options!./src/form/modules/common/AutoScrollText.vue?vue&type=style&index=0&id=5a08f966&prod&lang=less&scoped=true
|
|
159056
|
+
// extracted by mini-css-extract-plugin
|
|
159057
|
+
|
|
159058
|
+
;// ./src/form/modules/common/AutoScrollText.vue?vue&type=style&index=0&id=5a08f966&prod&lang=less&scoped=true
|
|
159059
|
+
|
|
159060
|
+
// EXTERNAL MODULE: ./node_modules/_vue-loader@15.11.1@vue-loader/lib/runtime/componentNormalizer.js
|
|
159061
|
+
var componentNormalizer = __webpack_require__(64008);
|
|
159062
|
+
;// ./src/form/modules/common/AutoScrollText.vue
|
|
159063
|
+
|
|
159064
|
+
|
|
159065
|
+
|
|
159066
|
+
;
|
|
159067
|
+
|
|
159068
|
+
|
|
159069
|
+
/* normalize component */
|
|
159070
|
+
|
|
159071
|
+
var component = (0,componentNormalizer/* default */.A)(
|
|
159072
|
+
common_AutoScrollTextvue_type_script_lang_js,
|
|
159073
|
+
render,
|
|
159074
|
+
staticRenderFns,
|
|
159075
|
+
false,
|
|
159076
|
+
null,
|
|
159077
|
+
"5a08f966",
|
|
159078
|
+
null
|
|
159079
|
+
|
|
159080
|
+
)
|
|
159081
|
+
|
|
159082
|
+
/* harmony default export */ const AutoScrollText = (component.exports);
|
|
159083
|
+
|
|
158759
159084
|
/***/ }),
|
|
158760
159085
|
|
|
158761
159086
|
/***/ 93206:
|
|
@@ -188900,6 +189225,9 @@ const main_install = function (Vue, opts = {}, router = undefined) {
|
|
|
188900
189225
|
});
|
|
188901
189226
|
Vue.use(utils_watermark);
|
|
188902
189227
|
Vue.component('virtual-list', components_VirtualList);
|
|
189228
|
+
// 判断是移动端
|
|
189229
|
+
const isMobileDevice = /Android|webOS|iPhone|iPod|BlackBerry|iPad|Windows Phone/i.test(navigator.userAgent) || window.innerWidth < 768;
|
|
189230
|
+
Vue.prototype.$isMobile = isMobileDevice;
|
|
188903
189231
|
if (router) {
|
|
188904
189232
|
router.addRoutes([{
|
|
188905
189233
|
path: '/downloadPage',
|