dpzvc-ui 1.2.2 → 1.2.3
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/build-style.js +11 -22
- package/dist/dpzvc.esm.js +208 -287
- package/dist/dpzvc.esm.js.map +1 -1
- package/dist/dpzvc.esm.min.js +1 -1
- package/dist/dpzvc.esm.min.js.map +1 -1
- package/dist/dpzvc.js +199 -277
- package/dist/dpzvc.js.map +1 -1
- package/dist/dpzvc.min.js +1 -1
- package/dist/dpzvc.min.js.map +1 -1
- package/package.json +3 -2
- package/src/components/Indicator/index.js +58 -123
- package/src/components/modal/confirm.js +106 -153
- package/src/components/prompt/confirm.js +70 -169
package/build-style.js
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
|
-
// const gulp = require('gulp');
|
|
2
|
-
// const less = require('gulp-less');
|
|
3
|
-
// const cleanCSS = require('gulp-clean-css');
|
|
4
|
-
// const rename = require('gulp-rename');
|
|
5
|
-
// const postcss = require('gulp-postcss');
|
|
6
|
-
// const autoprefixer = require('autoprefixer');
|
|
7
|
-
|
|
8
|
-
// function css() {
|
|
9
|
-
// return gulp.src('./src/styles/index.less')
|
|
10
|
-
// .pipe(less()) // 编译 less
|
|
11
|
-
// .pipe(postcss([autoprefixer()])) // 添加前缀
|
|
12
|
-
// .pipe(cleanCSS({ compatibility: 'ie8' })) // 压缩
|
|
13
|
-
// .pipe(rename('dpzvc.css'))
|
|
14
|
-
// .pipe(gulp.dest('./dist/styles'));
|
|
15
|
-
// }
|
|
16
|
-
|
|
17
|
-
// // 默认任务
|
|
18
|
-
// exports.default = css;
|
|
19
|
-
|
|
20
|
-
|
|
21
1
|
const gulp = require('gulp');
|
|
22
2
|
const less = require('gulp-less');
|
|
23
3
|
const cleanCSS = require('gulp-clean-css');
|
|
24
4
|
const rename = require('gulp-rename');
|
|
25
5
|
const postcss = require('gulp-postcss');
|
|
26
6
|
const autoprefixer = require('autoprefixer');
|
|
7
|
+
const { deleteAsync } = require('del'); // 新增
|
|
8
|
+
|
|
9
|
+
// 清空 dist 目录
|
|
10
|
+
function clean() {
|
|
11
|
+
return deleteAsync(['./dist/**', '!./dist']); // 删除 dist 下所有文件和子目录,但保留 dist 目录本身
|
|
12
|
+
}
|
|
27
13
|
|
|
28
14
|
// 打包组件 CSS
|
|
29
15
|
function componentsCSS() {
|
|
@@ -65,5 +51,8 @@ function globalCSS() {
|
|
|
65
51
|
.pipe(gulp.dest('./dist/styles'));
|
|
66
52
|
}
|
|
67
53
|
|
|
68
|
-
//
|
|
69
|
-
exports.default = gulp.
|
|
54
|
+
// 默认任务:先清空 dist,再并行打包所有 CSS
|
|
55
|
+
exports.default = gulp.series(
|
|
56
|
+
clean,
|
|
57
|
+
gulp.parallel(globalCSS, componentsCSS, baseCSS, utilsCSS)
|
|
58
|
+
);
|
package/dist/dpzvc.esm.js
CHANGED
|
@@ -1141,122 +1141,87 @@ _radiobox_vue__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.group = _radiobox
|
|
|
1141
1141
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1142
1142
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
1143
1143
|
/* harmony export */ });
|
|
1144
|
-
/* harmony import */ var
|
|
1145
|
-
/* harmony import */ var
|
|
1146
|
-
/* harmony import */ var
|
|
1144
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4467);
|
|
1145
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5286);
|
|
1146
|
+
/* harmony import */ var _Indicator_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7913);
|
|
1147
|
+
|
|
1148
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1149
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1147
1150
|
/**
|
|
1148
|
-
*
|
|
1151
|
+
* Indicator - Vue 2.7 CLI 适配版
|
|
1149
1152
|
*/
|
|
1150
1153
|
|
|
1151
1154
|
|
|
1152
1155
|
|
|
1153
|
-
var instance;
|
|
1154
|
-
|
|
1155
|
-
var
|
|
1156
|
-
var
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
});
|
|
1160
|
-
var div = document.createElement('div');
|
|
1161
|
-
document.body.appendChild(div);
|
|
1162
|
-
var indicator = new vue__WEBPACK_IMPORTED_MODULE_2__["default"]({
|
|
1163
|
-
el: div,
|
|
1164
|
-
template: "<Indicator ".concat(props, " v-model=\"visible\" ></Indicator>"),
|
|
1165
|
-
components: {
|
|
1166
|
-
Indicator: _Indicator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A
|
|
1167
|
-
},
|
|
1168
|
-
data: Object.assign(_props, {
|
|
1169
|
-
visible: false,
|
|
1156
|
+
var instance = null;
|
|
1157
|
+
function createInstance() {
|
|
1158
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1159
|
+
var IndicatorConstructor = vue__WEBPACK_IMPORTED_MODULE_1__["default"].extend(_Indicator_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A);
|
|
1160
|
+
var vm = new IndicatorConstructor({
|
|
1161
|
+
propsData: _objectSpread({
|
|
1170
1162
|
size: 45,
|
|
1171
1163
|
type: 'snake',
|
|
1172
1164
|
color: '#ffffff',
|
|
1173
|
-
text: '加载中...'
|
|
1174
|
-
|
|
1175
|
-
}),
|
|
1176
|
-
methods: {
|
|
1177
|
-
remove: function remove() {
|
|
1178
|
-
var _this = this;
|
|
1179
|
-
this.$children[0].visible = false;
|
|
1180
|
-
setTimeout(function () {
|
|
1181
|
-
_this.destroy();
|
|
1182
|
-
}, 300);
|
|
1183
|
-
},
|
|
1184
|
-
destroy: function destroy() {
|
|
1185
|
-
this.$destroy();
|
|
1186
|
-
|
|
1187
|
-
// if (!this.$el) return;
|
|
1188
|
-
document.body.removeChild(this.$el);
|
|
1189
|
-
this.onRemove();
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
}).$children[0];
|
|
1193
|
-
return {
|
|
1194
|
-
open: function open(options) {
|
|
1195
|
-
indicator.$parent.visible = true;
|
|
1196
|
-
indicator.$parent.onRemove = options.onRemove;
|
|
1197
|
-
if ('size' in options) {
|
|
1198
|
-
indicator.$parent.size = options.size;
|
|
1199
|
-
}
|
|
1200
|
-
if ('type' in options) {
|
|
1201
|
-
indicator.$parent.type = options.type;
|
|
1202
|
-
}
|
|
1203
|
-
if ('color' in options) {
|
|
1204
|
-
indicator.$parent.color = options.color;
|
|
1205
|
-
}
|
|
1206
|
-
if ('text' in options) {
|
|
1207
|
-
indicator.$parent.text = options.text;
|
|
1208
|
-
}
|
|
1209
|
-
},
|
|
1210
|
-
remove: function remove() {
|
|
1211
|
-
indicator.visible = false;
|
|
1212
|
-
indicator.$parent.remove();
|
|
1213
|
-
},
|
|
1214
|
-
component: indicator
|
|
1215
|
-
};
|
|
1216
|
-
};
|
|
1217
|
-
function confirm(options) {
|
|
1218
|
-
instance = instance || _Indicator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.newInstance({
|
|
1219
|
-
size: 45,
|
|
1220
|
-
color: '#ffffff',
|
|
1221
|
-
text: '正在加载...',
|
|
1222
|
-
type: 'snake'
|
|
1165
|
+
text: '加载中...'
|
|
1166
|
+
}, props)
|
|
1223
1167
|
});
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1168
|
+
vm.$mount();
|
|
1169
|
+
document.body.appendChild(vm.$el);
|
|
1170
|
+
vm.visible = false;
|
|
1171
|
+
vm.$on('remove', function () {
|
|
1172
|
+
destroyInstance();
|
|
1173
|
+
});
|
|
1174
|
+
return vm;
|
|
1228
1175
|
}
|
|
1229
|
-
|
|
1176
|
+
function destroyInstance() {
|
|
1177
|
+
if (!instance) return;
|
|
1178
|
+
instance.$destroy();
|
|
1179
|
+
if (instance.$el && instance.$el.parentNode) {
|
|
1180
|
+
instance.$el.parentNode.removeChild(instance.$el);
|
|
1181
|
+
}
|
|
1182
|
+
instance = null;
|
|
1183
|
+
}
|
|
1184
|
+
function open() {
|
|
1185
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1186
|
+
if (!instance) {
|
|
1187
|
+
instance = createInstance(options);
|
|
1188
|
+
}
|
|
1189
|
+
Object.keys(options).forEach(function (key) {
|
|
1190
|
+
instance.$props[key] = options[key];
|
|
1191
|
+
});
|
|
1192
|
+
instance.visible = true;
|
|
1193
|
+
}
|
|
1194
|
+
function close() {
|
|
1195
|
+
if (!instance) return;
|
|
1196
|
+
instance.visible = false;
|
|
1197
|
+
destroyInstance();
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
/* ================== 对外 API ================== */
|
|
1201
|
+
|
|
1202
|
+
_Indicator_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.open = open;
|
|
1203
|
+
_Indicator_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.remove = close;
|
|
1204
|
+
_Indicator_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.snake = function () {
|
|
1230
1205
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1231
|
-
props.type = '
|
|
1232
|
-
|
|
1206
|
+
props.type = 'snake';
|
|
1207
|
+
open(props);
|
|
1233
1208
|
};
|
|
1234
|
-
|
|
1209
|
+
_Indicator_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.blade = function () {
|
|
1235
1210
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1236
|
-
props.type = '
|
|
1237
|
-
|
|
1211
|
+
props.type = 'blade';
|
|
1212
|
+
open(props);
|
|
1238
1213
|
};
|
|
1239
|
-
|
|
1214
|
+
_Indicator_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.circle = function () {
|
|
1240
1215
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1241
1216
|
props.type = 'fading-circle';
|
|
1242
|
-
|
|
1217
|
+
open(props);
|
|
1243
1218
|
};
|
|
1244
|
-
|
|
1219
|
+
_Indicator_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.bounce = function () {
|
|
1245
1220
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1246
1221
|
props.type = 'double-bounce';
|
|
1247
|
-
|
|
1248
|
-
};
|
|
1249
|
-
_Indicator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.remove = function () {
|
|
1250
|
-
if (!instance) return false;
|
|
1251
|
-
instance = instance || _Indicator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.newInstance({
|
|
1252
|
-
size: 45,
|
|
1253
|
-
color: '#ffffff',
|
|
1254
|
-
text: '正在加载...',
|
|
1255
|
-
type: 'snake'
|
|
1256
|
-
});
|
|
1257
|
-
instance.remove();
|
|
1222
|
+
open(props);
|
|
1258
1223
|
};
|
|
1259
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
1224
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Indicator_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A);
|
|
1260
1225
|
|
|
1261
1226
|
/***/ },
|
|
1262
1227
|
|
|
@@ -2730,13 +2695,12 @@ var staticRenderFns = [];
|
|
|
2730
2695
|
|
|
2731
2696
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2732
2697
|
/* harmony export */ $U: () => (/* binding */ JPEG),
|
|
2733
|
-
/* harmony export */ Ad: () => (/* binding */ camelcaseToHyphen),
|
|
2734
2698
|
/* harmony export */ F1: () => (/* binding */ scrollTop),
|
|
2735
2699
|
/* harmony export */ oE: () => (/* binding */ findComponentUpward),
|
|
2736
2700
|
/* harmony export */ ox: () => (/* binding */ findComponentsDownward),
|
|
2737
2701
|
/* harmony export */ qN: () => (/* binding */ random_str)
|
|
2738
2702
|
/* harmony export */ });
|
|
2739
|
-
/* unused harmony exports findComponentDownward, cookieStorage */
|
|
2703
|
+
/* unused harmony exports camelcaseToHyphen, findComponentDownward, cookieStorage */
|
|
2740
2704
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6608);
|
|
2741
2705
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
2742
2706
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -11431,59 +11395,98 @@ var staticRenderFns = [];
|
|
|
11431
11395
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11432
11396
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
11433
11397
|
/* harmony export */ });
|
|
11434
|
-
/* harmony import */ var
|
|
11435
|
-
/* harmony import */ var
|
|
11436
|
-
/* harmony import */ var
|
|
11398
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5286);
|
|
11399
|
+
/* harmony import */ var _modal_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6869);
|
|
11400
|
+
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3471);
|
|
11437
11401
|
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1819);
|
|
11438
11402
|
/**
|
|
11439
|
-
*
|
|
11403
|
+
* confirm.js - 适配 Vue 2.7 runtime-only
|
|
11440
11404
|
*/
|
|
11441
11405
|
|
|
11442
11406
|
|
|
11443
11407
|
|
|
11444
11408
|
|
|
11445
11409
|
var prefixCls = 'dpzvc-modal';
|
|
11446
|
-
|
|
11447
|
-
var
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
props += ' :' + (0,_utils_util__WEBPACK_IMPORTED_MODULE_3__/* .camelcaseToHyphen */ .Ad)(prop) + '=' + prop;
|
|
11451
|
-
});
|
|
11452
|
-
var div = document.createElement('div');
|
|
11453
|
-
document.body.appendChild(div);
|
|
11454
|
-
var modal = new vue__WEBPACK_IMPORTED_MODULE_2__["default"]({
|
|
11455
|
-
el: div,
|
|
11456
|
-
template: "<Modal ".concat(props, " v-model=\"visible\" :width=\"width\" >\n <div class=\"").concat(prefixCls, "-header-inner ellipse-fir\" v-html=\"title\" slot=\"header\"></div>\n <div class=\"").concat(prefixCls, "-body-inner\" v-html=\"body\" slot=\"body\"></div>\n <template slot=\"footer\">\n <v-button type=\"primary\" :radius=\"false\" @click=\"cancle\" v-if=\"showCancle\">{{cancleText}}</v-button>\n <v-button type=\"normal\" :radius=\"false\" @click=\"ok\" :loading=\"buttonLoading\">{{okText}}</v-button>\n </template>\n </Modal>"),
|
|
11410
|
+
_modal_vue__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.newInstance = function () {
|
|
11411
|
+
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11412
|
+
// 创建一个新的 Vue 构造函数
|
|
11413
|
+
var ModalConstructor = vue__WEBPACK_IMPORTED_MODULE_0__["default"].extend({
|
|
11457
11414
|
components: {
|
|
11458
|
-
Modal:
|
|
11459
|
-
VButton:
|
|
11415
|
+
Modal: _modal_vue__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A,
|
|
11416
|
+
VButton: _button__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A
|
|
11417
|
+
},
|
|
11418
|
+
data: function data() {
|
|
11419
|
+
return Object.assign({
|
|
11420
|
+
visible: false,
|
|
11421
|
+
width: '70%',
|
|
11422
|
+
body: '',
|
|
11423
|
+
title: '',
|
|
11424
|
+
okText: '确定',
|
|
11425
|
+
cancleText: '取消',
|
|
11426
|
+
loading: false,
|
|
11427
|
+
buttonLoading: false,
|
|
11428
|
+
showCancle: true,
|
|
11429
|
+
showHead: true,
|
|
11430
|
+
onOk: function onOk() {},
|
|
11431
|
+
onCancle: function onCancle() {},
|
|
11432
|
+
onRemove: function onRemove() {}
|
|
11433
|
+
}, properties);
|
|
11434
|
+
},
|
|
11435
|
+
render: function render(h) {
|
|
11436
|
+
var footer = [this.showCancle ? h('v-button', {
|
|
11437
|
+
props: {
|
|
11438
|
+
type: 'primary',
|
|
11439
|
+
radius: false
|
|
11440
|
+
},
|
|
11441
|
+
on: {
|
|
11442
|
+
click: this.cancle
|
|
11443
|
+
}
|
|
11444
|
+
}, this.cancleText) : null, h('v-button', {
|
|
11445
|
+
props: {
|
|
11446
|
+
type: 'normal',
|
|
11447
|
+
radius: false,
|
|
11448
|
+
loading: this.buttonLoading
|
|
11449
|
+
},
|
|
11450
|
+
on: {
|
|
11451
|
+
click: this.ok
|
|
11452
|
+
}
|
|
11453
|
+
}, this.okText)];
|
|
11454
|
+
return h(_modal_vue__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, {
|
|
11455
|
+
props: {
|
|
11456
|
+
value: this.visible,
|
|
11457
|
+
width: this.width,
|
|
11458
|
+
showHead: this.showHead,
|
|
11459
|
+
footerHide: false
|
|
11460
|
+
},
|
|
11461
|
+
on: {
|
|
11462
|
+
'on-ok': this.ok,
|
|
11463
|
+
'on-cancle': this.cancle
|
|
11464
|
+
}
|
|
11465
|
+
}, [h('div', {
|
|
11466
|
+
slot: 'header',
|
|
11467
|
+
domProps: {
|
|
11468
|
+
innerHTML: this.title
|
|
11469
|
+
},
|
|
11470
|
+
"class": "".concat(prefixCls, "-header-inner ellipse-fir")
|
|
11471
|
+
}), h('div', {
|
|
11472
|
+
slot: 'body',
|
|
11473
|
+
domProps: {
|
|
11474
|
+
innerHTML: this.body
|
|
11475
|
+
},
|
|
11476
|
+
"class": "".concat(prefixCls, "-body-inner")
|
|
11477
|
+
}), h('template', {
|
|
11478
|
+
slot: 'footer'
|
|
11479
|
+
}, footer)]);
|
|
11460
11480
|
},
|
|
11461
|
-
data: Object.assign(_props, {
|
|
11462
|
-
visible: false,
|
|
11463
|
-
width: '70%',
|
|
11464
|
-
body: '',
|
|
11465
|
-
title: '',
|
|
11466
|
-
okText: '确定',
|
|
11467
|
-
cancleText: '取消',
|
|
11468
|
-
loading: false,
|
|
11469
|
-
buttonLoading: false,
|
|
11470
|
-
showCancle: true,
|
|
11471
|
-
showHead: true,
|
|
11472
|
-
onOk: function onOk() {},
|
|
11473
|
-
onCancle: function onCancle() {},
|
|
11474
|
-
onRemove: function onRemove() {}
|
|
11475
|
-
}),
|
|
11476
11481
|
methods: {
|
|
11477
11482
|
cancle: function cancle() {
|
|
11478
|
-
this
|
|
11483
|
+
this.visible = false;
|
|
11479
11484
|
this.onCancle();
|
|
11480
11485
|
this.remove();
|
|
11481
11486
|
},
|
|
11482
11487
|
ok: function ok() {
|
|
11483
|
-
console.log('asd');
|
|
11484
11488
|
if (this.loading) {
|
|
11485
11489
|
this.buttonLoading = true;
|
|
11486
|
-
this.$children[0].buttonLoading = true;
|
|
11487
11490
|
} else {
|
|
11488
11491
|
this.visible = false;
|
|
11489
11492
|
this.remove();
|
|
@@ -11492,73 +11495,42 @@ _modal_vue__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.newInstance = functi
|
|
|
11492
11495
|
},
|
|
11493
11496
|
remove: function remove() {
|
|
11494
11497
|
var _this = this;
|
|
11495
|
-
this
|
|
11498
|
+
this.visible = false;
|
|
11496
11499
|
setTimeout(function () {
|
|
11497
|
-
_this.destroy();
|
|
11500
|
+
return _this.destroy();
|
|
11498
11501
|
}, 300);
|
|
11499
11502
|
},
|
|
11500
11503
|
destroy: function destroy() {
|
|
11501
11504
|
this.$destroy();
|
|
11502
|
-
|
|
11505
|
+
if (this.$el && this.$el.parentNode) {
|
|
11506
|
+
this.$el.parentNode.removeChild(this.$el);
|
|
11507
|
+
}
|
|
11503
11508
|
this.onRemove();
|
|
11504
11509
|
}
|
|
11505
11510
|
}
|
|
11506
|
-
})
|
|
11511
|
+
});
|
|
11512
|
+
|
|
11513
|
+
// 实例化并挂载到 DOM
|
|
11514
|
+
var div = document.createElement('div');
|
|
11515
|
+
document.body.appendChild(div);
|
|
11516
|
+
var instance = new ModalConstructor().$mount(div);
|
|
11507
11517
|
return {
|
|
11508
|
-
show: function show(
|
|
11509
|
-
|
|
11510
|
-
|
|
11511
|
-
|
|
11512
|
-
|
|
11513
|
-
|
|
11514
|
-
// modal.$parent.title = props.title
|
|
11515
|
-
// }
|
|
11516
|
-
//
|
|
11517
|
-
// if ('showHead' in props) {
|
|
11518
|
-
// modal.$parent.showHead = props.showHead
|
|
11519
|
-
// }
|
|
11520
|
-
//
|
|
11521
|
-
// if ('okText' in props) {
|
|
11522
|
-
// modal.$parent.okText = props.okText
|
|
11523
|
-
// }
|
|
11524
|
-
//
|
|
11525
|
-
// if ('cancleText' in props) {
|
|
11526
|
-
// modal.$parent.cancleText = props.cancleText
|
|
11527
|
-
// }
|
|
11528
|
-
//
|
|
11529
|
-
//
|
|
11530
|
-
// if ('onCancle' in props) {
|
|
11531
|
-
// modal.$parent.onCancle = props.onCancle
|
|
11532
|
-
// }
|
|
11533
|
-
//
|
|
11534
|
-
// if ('onOk' in props) {
|
|
11535
|
-
// modal.$parent.onOk = props.onOk
|
|
11536
|
-
// }
|
|
11537
|
-
//
|
|
11538
|
-
// if ('loading' in props) {
|
|
11539
|
-
// modal.$parent.loading = props.loading
|
|
11540
|
-
// }
|
|
11541
|
-
//
|
|
11542
|
-
// if ('body' in props) {
|
|
11543
|
-
// modal.$parent.body = props.body
|
|
11544
|
-
// }
|
|
11545
|
-
|
|
11546
|
-
Object.keys(props).forEach(function (item) {
|
|
11547
|
-
modal.$parent[item] = props[item];
|
|
11518
|
+
show: function show() {
|
|
11519
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11520
|
+
Object.keys(props).forEach(function (key) {
|
|
11521
|
+
if (key in instance) {
|
|
11522
|
+
instance[key] = props[key];
|
|
11523
|
+
}
|
|
11548
11524
|
});
|
|
11549
|
-
|
|
11550
|
-
modal.$parent.onRemove = props.onRemove;
|
|
11551
|
-
modal.visible = true;
|
|
11525
|
+
instance.visible = true;
|
|
11552
11526
|
},
|
|
11553
11527
|
remove: function remove() {
|
|
11554
|
-
|
|
11555
|
-
modal.$parent.buttonLoading = false;
|
|
11556
|
-
modal.$parent.remove();
|
|
11528
|
+
instance.remove();
|
|
11557
11529
|
},
|
|
11558
|
-
component:
|
|
11530
|
+
component: instance
|
|
11559
11531
|
};
|
|
11560
11532
|
};
|
|
11561
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
11533
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_modal_vue__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A);
|
|
11562
11534
|
|
|
11563
11535
|
/***/ },
|
|
11564
11536
|
|
|
@@ -14904,34 +14876,31 @@ var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__
|
|
|
14904
14876
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14905
14877
|
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
14906
14878
|
/* harmony export */ });
|
|
14907
|
-
/* harmony import */ var
|
|
14879
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4467);
|
|
14908
14880
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5286);
|
|
14909
|
-
/* harmony import */ var
|
|
14881
|
+
/* harmony import */ var _prompt_prompt_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5455);
|
|
14882
|
+
|
|
14883
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14884
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14910
14885
|
/**
|
|
14911
|
-
* Created by admin on
|
|
14886
|
+
* Created by admin on 2025/12/10
|
|
14887
|
+
* Rewritten for Vue 2.7 + Vue CLI (runtime-only)
|
|
14912
14888
|
*/
|
|
14913
14889
|
|
|
14914
14890
|
|
|
14915
14891
|
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
|
|
14919
|
-
var
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14923
|
-
|
|
14924
|
-
|
|
14925
|
-
|
|
14926
|
-
el: div,
|
|
14927
|
-
template: "<Prompt ".concat(props, " v-model=\"visible\" \n :width=\"width\" \n :text=\"text\" \n :title=\"title\" \n :ok-text=\"okText\" \n :cancle-text=\"cancleText\" \n :loading=\"loading\" \n :spec=\"spec\" \n :message=\"message\" \n :validator=\"validator\"\n :on-ok=\"onOk\" \n :on-cancle=\"onCancle\"> </Prompt>"),
|
|
14928
|
-
components: {
|
|
14929
|
-
Prompt: _prompt_prompt_vue__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A
|
|
14930
|
-
},
|
|
14931
|
-
data: Object.assign(_props, {
|
|
14892
|
+
_prompt_prompt_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.newInstance = function () {
|
|
14893
|
+
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14894
|
+
// 1. 创建构造器
|
|
14895
|
+
var PromptConstructor = vue__WEBPACK_IMPORTED_MODULE_1__["default"].extend(_prompt_prompt_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A);
|
|
14896
|
+
|
|
14897
|
+
// 2. 初始化 props(等价你之前 data + v-model)
|
|
14898
|
+
var instance = new PromptConstructor({
|
|
14899
|
+
propsData: _objectSpread(_objectSpread({}, properties), {}, {
|
|
14900
|
+
// 默认值(保持你原来的语义)
|
|
14901
|
+
visible: false,
|
|
14932
14902
|
text: '',
|
|
14933
14903
|
placeholderText: '请输入',
|
|
14934
|
-
visible: false,
|
|
14935
14904
|
width: '70%',
|
|
14936
14905
|
title: '',
|
|
14937
14906
|
okText: '确定',
|
|
@@ -14942,94 +14911,46 @@ _prompt_prompt_vue__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.newInstance
|
|
|
14942
14911
|
message: '',
|
|
14943
14912
|
validator: null,
|
|
14944
14913
|
onOk: function onOk() {},
|
|
14945
|
-
onCancle: function onCancle(
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
14957
|
-
|
|
14958
|
-
|
|
14959
|
-
|
|
14960
|
-
|
|
14961
|
-
|
|
14962
|
-
},
|
|
14963
|
-
remove: function remove() {
|
|
14964
|
-
var _this = this;
|
|
14965
|
-
this.$children[0].visible = false;
|
|
14966
|
-
setTimeout(function () {
|
|
14967
|
-
_this.destroy();
|
|
14968
|
-
}, 300);
|
|
14969
|
-
},
|
|
14970
|
-
destroy: function destroy() {
|
|
14971
|
-
this.$destroy();
|
|
14972
|
-
document.body.removeChild(this.$el);
|
|
14973
|
-
this.onRemove();
|
|
14974
|
-
},
|
|
14975
|
-
mounted: function mounted() {}
|
|
14976
|
-
}
|
|
14977
|
-
}).$children[0];
|
|
14914
|
+
onCancle: function onCancle() {}
|
|
14915
|
+
})
|
|
14916
|
+
});
|
|
14917
|
+
|
|
14918
|
+
// 3. 挂载到 DOM
|
|
14919
|
+
instance.$mount();
|
|
14920
|
+
document.body.appendChild(instance.$el);
|
|
14921
|
+
|
|
14922
|
+
// 4. 移除逻辑(统一)
|
|
14923
|
+
var destroy = function destroy() {
|
|
14924
|
+
instance.visible = false;
|
|
14925
|
+
setTimeout(function () {
|
|
14926
|
+
instance.$destroy();
|
|
14927
|
+
instance.$el && document.body.removeChild(instance.$el);
|
|
14928
|
+
instance.onRemove && instance.onRemove();
|
|
14929
|
+
}, 300);
|
|
14930
|
+
};
|
|
14978
14931
|
return {
|
|
14979
|
-
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
|
|
14983
|
-
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14987
|
-
|
|
14988
|
-
}
|
|
14989
|
-
if ('spec' in props) {
|
|
14990
|
-
propmt.$parent.spec = props.spec;
|
|
14991
|
-
}
|
|
14992
|
-
if ('title' in props) {
|
|
14993
|
-
propmt.$parent.title = props.title;
|
|
14994
|
-
}
|
|
14995
|
-
if ('placeholderText' in props) {
|
|
14996
|
-
propmt.$parent.placeholderText = props.placeholderText;
|
|
14997
|
-
}
|
|
14998
|
-
if ('content' in props) {
|
|
14999
|
-
propmt.$parent.body = props.body;
|
|
15000
|
-
}
|
|
15001
|
-
if ('okText' in props) {
|
|
15002
|
-
propmt.$parent.okText = props.okText;
|
|
15003
|
-
}
|
|
15004
|
-
if ('cancleText' in props) {
|
|
15005
|
-
propmt.$parent.cancleText = props.cancleText;
|
|
15006
|
-
}
|
|
15007
|
-
if ('onCancle' in props) {
|
|
15008
|
-
propmt.$parent.onCancle = props.onCancle;
|
|
15009
|
-
}
|
|
15010
|
-
if ('onOk' in props) {
|
|
15011
|
-
propmt.$parent.onOk = props.onOk;
|
|
15012
|
-
}
|
|
15013
|
-
if ('loading' in props) {
|
|
15014
|
-
propmt.$parent.loading = props.loading;
|
|
15015
|
-
}
|
|
15016
|
-
if ('message' in props) {
|
|
15017
|
-
propmt.$parent.message = props.message;
|
|
15018
|
-
}
|
|
15019
|
-
if ('validator' in props) {
|
|
15020
|
-
propmt.$parent.validator = props.validator;
|
|
15021
|
-
}
|
|
15022
|
-
console.log(propmt.$parent);
|
|
14932
|
+
/**
|
|
14933
|
+
* 显示 Prompt
|
|
14934
|
+
*/
|
|
14935
|
+
show: function show() {
|
|
14936
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14937
|
+
Object.keys(props).forEach(function (key) {
|
|
14938
|
+
instance[key] = props[key];
|
|
14939
|
+
});
|
|
14940
|
+
instance.visible = true;
|
|
15023
14941
|
},
|
|
14942
|
+
/**
|
|
14943
|
+
* 关闭 Prompt
|
|
14944
|
+
*/
|
|
15024
14945
|
remove: function remove() {
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
14946
|
+
instance.visible = false;
|
|
14947
|
+
instance.buttonLoading = false;
|
|
14948
|
+
destroy();
|
|
15028
14949
|
},
|
|
15029
|
-
component:
|
|
14950
|
+
component: instance
|
|
15030
14951
|
};
|
|
15031
14952
|
};
|
|
15032
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (
|
|
14953
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_prompt_prompt_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A);
|
|
15033
14954
|
|
|
15034
14955
|
/***/ },
|
|
15035
14956
|
|