@panpanzhao/component-ui 0.0.25 → 0.0.26
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/component-ui.common.js +176 -40
- package/lib/components/form-input.js +155 -28
- package/lib/components/form-item.js +21 -12
- package/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -317,31 +317,31 @@ module.exports = require("element-ui/lib/cascader");
|
|
|
317
317
|
/* 38 */
|
|
318
318
|
/***/ (function(module, exports) {
|
|
319
319
|
|
|
320
|
-
module.exports = require("element-ui/lib/
|
|
320
|
+
module.exports = require("element-ui/lib/date-picker");
|
|
321
321
|
|
|
322
322
|
/***/ }),
|
|
323
323
|
/* 39 */
|
|
324
324
|
/***/ (function(module, exports) {
|
|
325
325
|
|
|
326
|
-
module.exports = require("element-ui/lib/
|
|
326
|
+
module.exports = require("element-ui/lib/switch");
|
|
327
327
|
|
|
328
328
|
/***/ }),
|
|
329
329
|
/* 40 */
|
|
330
330
|
/***/ (function(module, exports) {
|
|
331
331
|
|
|
332
|
-
module.exports = require("element-ui/lib/
|
|
332
|
+
module.exports = require("element-ui/lib/slider");
|
|
333
333
|
|
|
334
334
|
/***/ }),
|
|
335
335
|
/* 41 */
|
|
336
336
|
/***/ (function(module, exports) {
|
|
337
337
|
|
|
338
|
-
module.exports = require("element-ui/lib/
|
|
338
|
+
module.exports = require("element-ui/lib/transfer");
|
|
339
339
|
|
|
340
340
|
/***/ }),
|
|
341
341
|
/* 42 */
|
|
342
342
|
/***/ (function(module, exports) {
|
|
343
343
|
|
|
344
|
-
module.exports = require("element-ui/lib/
|
|
344
|
+
module.exports = require("element-ui/lib/time-picker");
|
|
345
345
|
|
|
346
346
|
/***/ }),
|
|
347
347
|
/* 43 */
|
|
@@ -1467,6 +1467,9 @@ var SelectTree_component = normalizeComponent(
|
|
|
1467
1467
|
return {};
|
|
1468
1468
|
}
|
|
1469
1469
|
},
|
|
1470
|
+
valueIsString: Boolean,
|
|
1471
|
+
optionBack: Boolean,
|
|
1472
|
+
//事件改变是否返回选中的值
|
|
1470
1473
|
apiOpen: {
|
|
1471
1474
|
type: Boolean,
|
|
1472
1475
|
default: function _default() {
|
|
@@ -1487,10 +1490,17 @@ var SelectTree_component = normalizeComponent(
|
|
|
1487
1490
|
},
|
|
1488
1491
|
computed: {
|
|
1489
1492
|
attrs: function attrs() {
|
|
1493
|
+
//值处理
|
|
1494
|
+
var _value = this.$attrs.value ? this.$attrs.value : this.$attrs.multiple ? [] : null;
|
|
1495
|
+
if (this.$attrs.multiple && this.valueIsString && this.$attrs.value) {
|
|
1496
|
+
_value = typeof this.$attrs.value === "string" ? this.$attrs.value.split(",") : this.$attrs.value;
|
|
1497
|
+
}
|
|
1490
1498
|
return Object.assign({
|
|
1491
1499
|
clearable: true,
|
|
1492
1500
|
placeholder: "请选择"
|
|
1493
|
-
}, this.$attrs
|
|
1501
|
+
}, this.$attrs, {
|
|
1502
|
+
value: _value
|
|
1503
|
+
});
|
|
1494
1504
|
},
|
|
1495
1505
|
dictOption: function dictOption() {
|
|
1496
1506
|
if (this.dictCode && this.$COMPONENT.dataSource && this.$COMPONENT.dataSource.dict) {
|
|
@@ -1548,7 +1558,7 @@ var SelectTree_component = normalizeComponent(
|
|
|
1548
1558
|
},
|
|
1549
1559
|
initApi: function initApi() {
|
|
1550
1560
|
var _this = this;
|
|
1551
|
-
if (!(this.api.url && this.request)) {
|
|
1561
|
+
if (!(this.api && this.api.url && this.request)) {
|
|
1552
1562
|
return false;
|
|
1553
1563
|
}
|
|
1554
1564
|
var reqData = Object(external_lodash_["merge"])({}, this.api.data);
|
|
@@ -1634,9 +1644,6 @@ var SelectTree_component = normalizeComponent(
|
|
|
1634
1644
|
if (this.selectMode === "tree") {
|
|
1635
1645
|
return this.renderTree(h);
|
|
1636
1646
|
}
|
|
1637
|
-
if (this.attrs.multiple && !Array.isArray(this.attrs.value)) {
|
|
1638
|
-
this.attrs.value = [];
|
|
1639
|
-
}
|
|
1640
1647
|
var param = {
|
|
1641
1648
|
props: this.attrs,
|
|
1642
1649
|
slots: this.$slots,
|
|
@@ -1645,7 +1652,27 @@ var SelectTree_component = normalizeComponent(
|
|
|
1645
1652
|
return _this4.renderOptions(h, scoped);
|
|
1646
1653
|
}
|
|
1647
1654
|
},
|
|
1648
|
-
on: this.$listeners
|
|
1655
|
+
on: Object.assign({}, this.$listeners, {
|
|
1656
|
+
change: function change(value) {
|
|
1657
|
+
var _value = value;
|
|
1658
|
+
if (_this4.$attrs.multiple && _this4.valueIsString) {
|
|
1659
|
+
_value = value.toString();
|
|
1660
|
+
}
|
|
1661
|
+
var selectOption = [];
|
|
1662
|
+
if (_this4.optionBack) {
|
|
1663
|
+
if (_this4.$attrs.multiple) {
|
|
1664
|
+
selectOption = value && value.length > 0 ? _this4.optionData.filter(function (item) {
|
|
1665
|
+
return value.indexOf(item[_this4._optionProps.value]) > -1;
|
|
1666
|
+
}) : [];
|
|
1667
|
+
} else {
|
|
1668
|
+
selectOption = value ? _this4.optionData.filter(function (item) {
|
|
1669
|
+
return item[_this4._optionProps.value] === value;
|
|
1670
|
+
}) : [];
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
_this4.$emit("change", _value, selectOption);
|
|
1674
|
+
}
|
|
1675
|
+
})
|
|
1649
1676
|
};
|
|
1650
1677
|
return h("el-select", babel_helper_vue_jsx_merge_props_default()([{}, param]));
|
|
1651
1678
|
}
|
|
@@ -1789,7 +1816,7 @@ var radio_button_default = /*#__PURE__*/__webpack_require__.n(radio_button_);
|
|
|
1789
1816
|
methods: {
|
|
1790
1817
|
initApi: function initApi() {
|
|
1791
1818
|
var _this = this;
|
|
1792
|
-
if (!(this.api && this.request)) {
|
|
1819
|
+
if (!(this.api && this.api.url && this.request)) {
|
|
1793
1820
|
return false;
|
|
1794
1821
|
}
|
|
1795
1822
|
this.request({
|
|
@@ -1910,6 +1937,7 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1910
1937
|
}
|
|
1911
1938
|
},
|
|
1912
1939
|
selectMode: String,
|
|
1940
|
+
valueIsString: Boolean,
|
|
1913
1941
|
options: {
|
|
1914
1942
|
type: Array,
|
|
1915
1943
|
default: function _default() {
|
|
@@ -1942,9 +1970,15 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1942
1970
|
},
|
|
1943
1971
|
computed: {
|
|
1944
1972
|
attrs: function attrs() {
|
|
1973
|
+
//值处理
|
|
1974
|
+
var _value = this.$attrs.value ? this.$attrs.value : [];
|
|
1975
|
+
if (this.valueIsString && this.$attrs.value) {
|
|
1976
|
+
_value = typeof this.$attrs.value === "string" ? this.$attrs.value.split(",") : this.$attrs.value;
|
|
1977
|
+
}
|
|
1945
1978
|
return Object.assign({}, this.$attrs, {
|
|
1946
1979
|
size: this.size,
|
|
1947
|
-
border: this.border
|
|
1980
|
+
border: this.border,
|
|
1981
|
+
value: _value
|
|
1948
1982
|
});
|
|
1949
1983
|
},
|
|
1950
1984
|
dictOption: function dictOption() {
|
|
@@ -1994,7 +2028,7 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1994
2028
|
methods: {
|
|
1995
2029
|
initApi: function initApi() {
|
|
1996
2030
|
var _this = this;
|
|
1997
|
-
if (!(this.api && this.request)) {
|
|
2031
|
+
if (!(this.api && this.api.url && this.request)) {
|
|
1998
2032
|
return false;
|
|
1999
2033
|
}
|
|
2000
2034
|
this.request({
|
|
@@ -2044,9 +2078,6 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
2044
2078
|
},
|
|
2045
2079
|
render: function render(h) {
|
|
2046
2080
|
var _this4 = this;
|
|
2047
|
-
if (!Array.isArray(this.attrs.value)) {
|
|
2048
|
-
this.attrs.value = [];
|
|
2049
|
-
}
|
|
2050
2081
|
var param = {
|
|
2051
2082
|
props: this.attrs,
|
|
2052
2083
|
slots: this.$slots,
|
|
@@ -2055,7 +2086,16 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
2055
2086
|
return _this4.renderOptions(h, scoped);
|
|
2056
2087
|
}
|
|
2057
2088
|
},
|
|
2058
|
-
on: this.$listeners
|
|
2089
|
+
on: Object.assign({}, this.$listeners, {
|
|
2090
|
+
change: function change(value) {
|
|
2091
|
+
debugger;
|
|
2092
|
+
var _value = value;
|
|
2093
|
+
if (_this4.valueIsString) {
|
|
2094
|
+
_value = value.toString();
|
|
2095
|
+
}
|
|
2096
|
+
_this4.$emit("change", _value);
|
|
2097
|
+
}
|
|
2098
|
+
})
|
|
2059
2099
|
};
|
|
2060
2100
|
return h("el-checkbox-group", babel_helper_vue_jsx_merge_props_default()([{}, param]));
|
|
2061
2101
|
}
|
|
@@ -2205,26 +2245,114 @@ var Cascader_component = normalizeComponent(
|
|
|
2205
2245
|
)
|
|
2206
2246
|
|
|
2207
2247
|
/* harmony default export */ var Cascader = (Cascader_component.exports);
|
|
2248
|
+
// EXTERNAL MODULE: external "element-ui/lib/date-picker"
|
|
2249
|
+
var date_picker_ = __webpack_require__(38);
|
|
2250
|
+
var date_picker_default = /*#__PURE__*/__webpack_require__.n(date_picker_);
|
|
2251
|
+
|
|
2252
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/DatePicker.vue?vue&type=script&lang=js&
|
|
2253
|
+
|
|
2254
|
+
|
|
2255
|
+
/* harmony default export */ var DatePickervue_type_script_lang_js_ = ({
|
|
2256
|
+
name: "DatePicker",
|
|
2257
|
+
components: {
|
|
2258
|
+
elDatePicker: date_picker_default.a
|
|
2259
|
+
},
|
|
2260
|
+
props: {
|
|
2261
|
+
startProp: String,
|
|
2262
|
+
endProp: String
|
|
2263
|
+
},
|
|
2264
|
+
computed: {
|
|
2265
|
+
attrs: function attrs() {
|
|
2266
|
+
//值处理
|
|
2267
|
+
var _value = this.$attrs.value;
|
|
2268
|
+
if (["monthrange", "daterange", "datetimerange"].indexOf(this.$attrs.type) > -1 && this.startProp && this.endProp && this._form && !_value) {
|
|
2269
|
+
var startPropValue = this._form.formModel[this.startProp];
|
|
2270
|
+
var endPropValue = this._form.formModel[this.endProp];
|
|
2271
|
+
if (startPropValue && endPropValue) {
|
|
2272
|
+
_value = [startPropValue, endPropValue];
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
var res = Object.assign({
|
|
2276
|
+
clearable: true,
|
|
2277
|
+
placeholder: "请选择",
|
|
2278
|
+
valueFormat: "timestamp"
|
|
2279
|
+
}, this.$attrs, {
|
|
2280
|
+
value: _value
|
|
2281
|
+
});
|
|
2282
|
+
return res;
|
|
2283
|
+
},
|
|
2284
|
+
_form: function _form() {
|
|
2285
|
+
var parent = this.$parent;
|
|
2286
|
+
while (parent) {
|
|
2287
|
+
if (parent.$options.componentName !== 'Form' && parent.$options.componentName !== 'FormQuery') {
|
|
2288
|
+
parent = parent.$parent;
|
|
2289
|
+
} else {
|
|
2290
|
+
return parent;
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
return false;
|
|
2294
|
+
}
|
|
2295
|
+
},
|
|
2296
|
+
render: function render(h) {
|
|
2297
|
+
var _this = this;
|
|
2298
|
+
var param = {
|
|
2299
|
+
props: this.attrs,
|
|
2300
|
+
slots: this.$slots,
|
|
2301
|
+
scopedSlots: this.$scopedSlots,
|
|
2302
|
+
on: Object.assign({}, this.$listeners, {
|
|
2303
|
+
change: function change(value) {
|
|
2304
|
+
if (["monthrange", "daterange", "datetimerange"].indexOf(_this.$attrs.type) > -1 && _this.startProp && _this.endProp && _this._form) {
|
|
2305
|
+
var formModel = _this._form.formModel;
|
|
2306
|
+
if (formModel) {
|
|
2307
|
+
_this.$set(formModel, _this.startProp, value && value[0]);
|
|
2308
|
+
_this.$set(formModel, _this.endProp, value && value[1]);
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
_this.$emit("change", value);
|
|
2312
|
+
}
|
|
2313
|
+
})
|
|
2314
|
+
};
|
|
2315
|
+
return h("el-date-picker", babel_helper_vue_jsx_merge_props_default()([{}, param]));
|
|
2316
|
+
}
|
|
2317
|
+
});
|
|
2318
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/DatePicker.vue?vue&type=script&lang=js&
|
|
2319
|
+
/* harmony default export */ var item_DatePickervue_type_script_lang_js_ = (DatePickervue_type_script_lang_js_);
|
|
2320
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/DatePicker.vue
|
|
2321
|
+
var DatePicker_render, DatePicker_staticRenderFns
|
|
2322
|
+
|
|
2323
|
+
|
|
2324
|
+
|
|
2325
|
+
|
|
2326
|
+
/* normalize component */
|
|
2327
|
+
|
|
2328
|
+
var DatePicker_component = normalizeComponent(
|
|
2329
|
+
item_DatePickervue_type_script_lang_js_,
|
|
2330
|
+
DatePicker_render,
|
|
2331
|
+
DatePicker_staticRenderFns,
|
|
2332
|
+
false,
|
|
2333
|
+
null,
|
|
2334
|
+
null,
|
|
2335
|
+
null
|
|
2336
|
+
|
|
2337
|
+
)
|
|
2338
|
+
|
|
2339
|
+
/* harmony default export */ var DatePicker = (DatePicker_component.exports);
|
|
2208
2340
|
// EXTERNAL MODULE: external "element-ui/lib/switch"
|
|
2209
|
-
var switch_ = __webpack_require__(
|
|
2341
|
+
var switch_ = __webpack_require__(39);
|
|
2210
2342
|
var switch_default = /*#__PURE__*/__webpack_require__.n(switch_);
|
|
2211
2343
|
|
|
2212
2344
|
// EXTERNAL MODULE: external "element-ui/lib/slider"
|
|
2213
|
-
var slider_ = __webpack_require__(
|
|
2345
|
+
var slider_ = __webpack_require__(40);
|
|
2214
2346
|
var slider_default = /*#__PURE__*/__webpack_require__.n(slider_);
|
|
2215
2347
|
|
|
2216
2348
|
// EXTERNAL MODULE: external "element-ui/lib/transfer"
|
|
2217
|
-
var transfer_ = __webpack_require__(
|
|
2349
|
+
var transfer_ = __webpack_require__(41);
|
|
2218
2350
|
var transfer_default = /*#__PURE__*/__webpack_require__.n(transfer_);
|
|
2219
2351
|
|
|
2220
2352
|
// EXTERNAL MODULE: external "element-ui/lib/time-picker"
|
|
2221
|
-
var time_picker_ = __webpack_require__(
|
|
2353
|
+
var time_picker_ = __webpack_require__(42);
|
|
2222
2354
|
var time_picker_default = /*#__PURE__*/__webpack_require__.n(time_picker_);
|
|
2223
2355
|
|
|
2224
|
-
// EXTERNAL MODULE: external "element-ui/lib/date-picker"
|
|
2225
|
-
var date_picker_ = __webpack_require__(42);
|
|
2226
|
-
var date_picker_default = /*#__PURE__*/__webpack_require__.n(date_picker_);
|
|
2227
|
-
|
|
2228
2356
|
// EXTERNAL MODULE: external "element-ui/lib/upload"
|
|
2229
2357
|
var upload_ = __webpack_require__(43);
|
|
2230
2358
|
var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
@@ -2240,7 +2368,6 @@ var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
|
2240
2368
|
|
|
2241
2369
|
|
|
2242
2370
|
|
|
2243
|
-
// import elCascader from "element-ui/packages/cascader";
|
|
2244
2371
|
|
|
2245
2372
|
|
|
2246
2373
|
|
|
@@ -2256,7 +2383,7 @@ var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
|
2256
2383
|
Switchs: switch_default.a,
|
|
2257
2384
|
Upload: upload_default.a,
|
|
2258
2385
|
TimePicker: time_picker_default.a,
|
|
2259
|
-
DatePicker:
|
|
2386
|
+
DatePicker: DatePicker,
|
|
2260
2387
|
Input: Input,
|
|
2261
2388
|
InputNumber: InputNumber,
|
|
2262
2389
|
Select: Select,
|
|
@@ -2348,18 +2475,7 @@ var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
|
2348
2475
|
watch: {
|
|
2349
2476
|
value: function value(val) {
|
|
2350
2477
|
//监听form的formModel变化,处理config的value变化
|
|
2351
|
-
|
|
2352
|
-
return false;
|
|
2353
|
-
}
|
|
2354
|
-
this.setValue(val);
|
|
2355
|
-
this.execEvent("input", val);
|
|
2356
|
-
if (this.form && this.form.formModel) {
|
|
2357
|
-
this.$emit("formItemChange", {
|
|
2358
|
-
itemConfig: this.config,
|
|
2359
|
-
itemProp: this.prop,
|
|
2360
|
-
itemVal: val
|
|
2361
|
-
});
|
|
2362
|
-
}
|
|
2478
|
+
this.initValue(val);
|
|
2363
2479
|
}
|
|
2364
2480
|
},
|
|
2365
2481
|
computed: {
|
|
@@ -2420,7 +2536,27 @@ var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
|
2420
2536
|
});
|
|
2421
2537
|
}
|
|
2422
2538
|
},
|
|
2539
|
+
created: function created() {
|
|
2540
|
+
var formModel = this.form.formModel;
|
|
2541
|
+
if (formModel) {
|
|
2542
|
+
this.initValue(formModel[this.prop]);
|
|
2543
|
+
}
|
|
2544
|
+
},
|
|
2423
2545
|
methods: {
|
|
2546
|
+
initValue: function initValue(val) {
|
|
2547
|
+
if (this.config.value === val) {
|
|
2548
|
+
return false;
|
|
2549
|
+
}
|
|
2550
|
+
this.setValue(val);
|
|
2551
|
+
this.execEvent("input", val);
|
|
2552
|
+
if (this.form && this.form.formModel) {
|
|
2553
|
+
this.$emit("formItemChange", {
|
|
2554
|
+
itemConfig: this.config,
|
|
2555
|
+
itemProp: this.prop,
|
|
2556
|
+
itemVal: val
|
|
2557
|
+
});
|
|
2558
|
+
}
|
|
2559
|
+
},
|
|
2424
2560
|
execEvent: function execEvent(eventName) {
|
|
2425
2561
|
var _this2 = this,
|
|
2426
2562
|
_itemEvent$exec;
|
|
@@ -314,31 +314,31 @@ module.exports = require("element-ui/lib/cascader");
|
|
|
314
314
|
/* 47 */
|
|
315
315
|
/***/ (function(module, exports) {
|
|
316
316
|
|
|
317
|
-
module.exports = require("element-ui/lib/
|
|
317
|
+
module.exports = require("element-ui/lib/date-picker");
|
|
318
318
|
|
|
319
319
|
/***/ }),
|
|
320
320
|
/* 48 */
|
|
321
321
|
/***/ (function(module, exports) {
|
|
322
322
|
|
|
323
|
-
module.exports = require("element-ui/lib/
|
|
323
|
+
module.exports = require("element-ui/lib/switch");
|
|
324
324
|
|
|
325
325
|
/***/ }),
|
|
326
326
|
/* 49 */
|
|
327
327
|
/***/ (function(module, exports) {
|
|
328
328
|
|
|
329
|
-
module.exports = require("element-ui/lib/
|
|
329
|
+
module.exports = require("element-ui/lib/slider");
|
|
330
330
|
|
|
331
331
|
/***/ }),
|
|
332
332
|
/* 50 */
|
|
333
333
|
/***/ (function(module, exports) {
|
|
334
334
|
|
|
335
|
-
module.exports = require("element-ui/lib/
|
|
335
|
+
module.exports = require("element-ui/lib/transfer");
|
|
336
336
|
|
|
337
337
|
/***/ }),
|
|
338
338
|
/* 51 */
|
|
339
339
|
/***/ (function(module, exports) {
|
|
340
340
|
|
|
341
|
-
module.exports = require("element-ui/lib/
|
|
341
|
+
module.exports = require("element-ui/lib/time-picker");
|
|
342
342
|
|
|
343
343
|
/***/ }),
|
|
344
344
|
/* 52 */
|
|
@@ -971,6 +971,9 @@ var formula_ = __webpack_require__(3);
|
|
|
971
971
|
return {};
|
|
972
972
|
}
|
|
973
973
|
},
|
|
974
|
+
valueIsString: Boolean,
|
|
975
|
+
optionBack: Boolean,
|
|
976
|
+
//事件改变是否返回选中的值
|
|
974
977
|
apiOpen: {
|
|
975
978
|
type: Boolean,
|
|
976
979
|
default: function _default() {
|
|
@@ -991,10 +994,17 @@ var formula_ = __webpack_require__(3);
|
|
|
991
994
|
},
|
|
992
995
|
computed: {
|
|
993
996
|
attrs: function attrs() {
|
|
997
|
+
//值处理
|
|
998
|
+
var _value = this.$attrs.value ? this.$attrs.value : this.$attrs.multiple ? [] : null;
|
|
999
|
+
if (this.$attrs.multiple && this.valueIsString && this.$attrs.value) {
|
|
1000
|
+
_value = typeof this.$attrs.value === "string" ? this.$attrs.value.split(",") : this.$attrs.value;
|
|
1001
|
+
}
|
|
994
1002
|
return Object.assign({
|
|
995
1003
|
clearable: true,
|
|
996
1004
|
placeholder: "请选择"
|
|
997
|
-
}, this.$attrs
|
|
1005
|
+
}, this.$attrs, {
|
|
1006
|
+
value: _value
|
|
1007
|
+
});
|
|
998
1008
|
},
|
|
999
1009
|
dictOption: function dictOption() {
|
|
1000
1010
|
if (this.dictCode && this.$COMPONENT.dataSource && this.$COMPONENT.dataSource.dict) {
|
|
@@ -1052,7 +1062,7 @@ var formula_ = __webpack_require__(3);
|
|
|
1052
1062
|
},
|
|
1053
1063
|
initApi: function initApi() {
|
|
1054
1064
|
var _this = this;
|
|
1055
|
-
if (!(this.api.url && this.request)) {
|
|
1065
|
+
if (!(this.api && this.api.url && this.request)) {
|
|
1056
1066
|
return false;
|
|
1057
1067
|
}
|
|
1058
1068
|
var reqData = Object(external_lodash_["merge"])({}, this.api.data);
|
|
@@ -1138,9 +1148,6 @@ var formula_ = __webpack_require__(3);
|
|
|
1138
1148
|
if (this.selectMode === "tree") {
|
|
1139
1149
|
return this.renderTree(h);
|
|
1140
1150
|
}
|
|
1141
|
-
if (this.attrs.multiple && !Array.isArray(this.attrs.value)) {
|
|
1142
|
-
this.attrs.value = [];
|
|
1143
|
-
}
|
|
1144
1151
|
var param = {
|
|
1145
1152
|
props: this.attrs,
|
|
1146
1153
|
slots: this.$slots,
|
|
@@ -1149,7 +1156,27 @@ var formula_ = __webpack_require__(3);
|
|
|
1149
1156
|
return _this4.renderOptions(h, scoped);
|
|
1150
1157
|
}
|
|
1151
1158
|
},
|
|
1152
|
-
on: this.$listeners
|
|
1159
|
+
on: Object.assign({}, this.$listeners, {
|
|
1160
|
+
change: function change(value) {
|
|
1161
|
+
var _value = value;
|
|
1162
|
+
if (_this4.$attrs.multiple && _this4.valueIsString) {
|
|
1163
|
+
_value = value.toString();
|
|
1164
|
+
}
|
|
1165
|
+
var selectOption = [];
|
|
1166
|
+
if (_this4.optionBack) {
|
|
1167
|
+
if (_this4.$attrs.multiple) {
|
|
1168
|
+
selectOption = value && value.length > 0 ? _this4.optionData.filter(function (item) {
|
|
1169
|
+
return value.indexOf(item[_this4._optionProps.value]) > -1;
|
|
1170
|
+
}) : [];
|
|
1171
|
+
} else {
|
|
1172
|
+
selectOption = value ? _this4.optionData.filter(function (item) {
|
|
1173
|
+
return item[_this4._optionProps.value] === value;
|
|
1174
|
+
}) : [];
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
_this4.$emit("change", _value, selectOption);
|
|
1178
|
+
}
|
|
1179
|
+
})
|
|
1153
1180
|
};
|
|
1154
1181
|
return h("el-select", babel_helper_vue_jsx_merge_props_default()([{}, param]));
|
|
1155
1182
|
}
|
|
@@ -1293,7 +1320,7 @@ var radio_button_default = /*#__PURE__*/__webpack_require__.n(radio_button_);
|
|
|
1293
1320
|
methods: {
|
|
1294
1321
|
initApi: function initApi() {
|
|
1295
1322
|
var _this = this;
|
|
1296
|
-
if (!(this.api && this.request)) {
|
|
1323
|
+
if (!(this.api && this.api.url && this.request)) {
|
|
1297
1324
|
return false;
|
|
1298
1325
|
}
|
|
1299
1326
|
this.request({
|
|
@@ -1414,6 +1441,7 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1414
1441
|
}
|
|
1415
1442
|
},
|
|
1416
1443
|
selectMode: String,
|
|
1444
|
+
valueIsString: Boolean,
|
|
1417
1445
|
options: {
|
|
1418
1446
|
type: Array,
|
|
1419
1447
|
default: function _default() {
|
|
@@ -1446,9 +1474,15 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1446
1474
|
},
|
|
1447
1475
|
computed: {
|
|
1448
1476
|
attrs: function attrs() {
|
|
1477
|
+
//值处理
|
|
1478
|
+
var _value = this.$attrs.value ? this.$attrs.value : [];
|
|
1479
|
+
if (this.valueIsString && this.$attrs.value) {
|
|
1480
|
+
_value = typeof this.$attrs.value === "string" ? this.$attrs.value.split(",") : this.$attrs.value;
|
|
1481
|
+
}
|
|
1449
1482
|
return Object.assign({}, this.$attrs, {
|
|
1450
1483
|
size: this.size,
|
|
1451
|
-
border: this.border
|
|
1484
|
+
border: this.border,
|
|
1485
|
+
value: _value
|
|
1452
1486
|
});
|
|
1453
1487
|
},
|
|
1454
1488
|
dictOption: function dictOption() {
|
|
@@ -1498,7 +1532,7 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1498
1532
|
methods: {
|
|
1499
1533
|
initApi: function initApi() {
|
|
1500
1534
|
var _this = this;
|
|
1501
|
-
if (!(this.api && this.request)) {
|
|
1535
|
+
if (!(this.api && this.api.url && this.request)) {
|
|
1502
1536
|
return false;
|
|
1503
1537
|
}
|
|
1504
1538
|
this.request({
|
|
@@ -1548,9 +1582,6 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1548
1582
|
},
|
|
1549
1583
|
render: function render(h) {
|
|
1550
1584
|
var _this4 = this;
|
|
1551
|
-
if (!Array.isArray(this.attrs.value)) {
|
|
1552
|
-
this.attrs.value = [];
|
|
1553
|
-
}
|
|
1554
1585
|
var param = {
|
|
1555
1586
|
props: this.attrs,
|
|
1556
1587
|
slots: this.$slots,
|
|
@@ -1559,7 +1590,16 @@ var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button
|
|
|
1559
1590
|
return _this4.renderOptions(h, scoped);
|
|
1560
1591
|
}
|
|
1561
1592
|
},
|
|
1562
|
-
on: this.$listeners
|
|
1593
|
+
on: Object.assign({}, this.$listeners, {
|
|
1594
|
+
change: function change(value) {
|
|
1595
|
+
debugger;
|
|
1596
|
+
var _value = value;
|
|
1597
|
+
if (_this4.valueIsString) {
|
|
1598
|
+
_value = value.toString();
|
|
1599
|
+
}
|
|
1600
|
+
_this4.$emit("change", _value);
|
|
1601
|
+
}
|
|
1602
|
+
})
|
|
1563
1603
|
};
|
|
1564
1604
|
return h("el-checkbox-group", babel_helper_vue_jsx_merge_props_default()([{}, param]));
|
|
1565
1605
|
}
|
|
@@ -1709,26 +1749,114 @@ var Cascader_component = Object(componentNormalizer["a" /* default */])(
|
|
|
1709
1749
|
)
|
|
1710
1750
|
|
|
1711
1751
|
/* harmony default export */ var Cascader = (Cascader_component.exports);
|
|
1752
|
+
// EXTERNAL MODULE: external "element-ui/lib/date-picker"
|
|
1753
|
+
var date_picker_ = __webpack_require__(47);
|
|
1754
|
+
var date_picker_default = /*#__PURE__*/__webpack_require__.n(date_picker_);
|
|
1755
|
+
|
|
1756
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/DatePicker.vue?vue&type=script&lang=js&
|
|
1757
|
+
|
|
1758
|
+
|
|
1759
|
+
/* harmony default export */ var DatePickervue_type_script_lang_js_ = ({
|
|
1760
|
+
name: "DatePicker",
|
|
1761
|
+
components: {
|
|
1762
|
+
elDatePicker: date_picker_default.a
|
|
1763
|
+
},
|
|
1764
|
+
props: {
|
|
1765
|
+
startProp: String,
|
|
1766
|
+
endProp: String
|
|
1767
|
+
},
|
|
1768
|
+
computed: {
|
|
1769
|
+
attrs: function attrs() {
|
|
1770
|
+
//值处理
|
|
1771
|
+
var _value = this.$attrs.value;
|
|
1772
|
+
if (["monthrange", "daterange", "datetimerange"].indexOf(this.$attrs.type) > -1 && this.startProp && this.endProp && this._form && !_value) {
|
|
1773
|
+
var startPropValue = this._form.formModel[this.startProp];
|
|
1774
|
+
var endPropValue = this._form.formModel[this.endProp];
|
|
1775
|
+
if (startPropValue && endPropValue) {
|
|
1776
|
+
_value = [startPropValue, endPropValue];
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
var res = Object.assign({
|
|
1780
|
+
clearable: true,
|
|
1781
|
+
placeholder: "请选择",
|
|
1782
|
+
valueFormat: "timestamp"
|
|
1783
|
+
}, this.$attrs, {
|
|
1784
|
+
value: _value
|
|
1785
|
+
});
|
|
1786
|
+
return res;
|
|
1787
|
+
},
|
|
1788
|
+
_form: function _form() {
|
|
1789
|
+
var parent = this.$parent;
|
|
1790
|
+
while (parent) {
|
|
1791
|
+
if (parent.$options.componentName !== 'Form' && parent.$options.componentName !== 'FormQuery') {
|
|
1792
|
+
parent = parent.$parent;
|
|
1793
|
+
} else {
|
|
1794
|
+
return parent;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
return false;
|
|
1798
|
+
}
|
|
1799
|
+
},
|
|
1800
|
+
render: function render(h) {
|
|
1801
|
+
var _this = this;
|
|
1802
|
+
var param = {
|
|
1803
|
+
props: this.attrs,
|
|
1804
|
+
slots: this.$slots,
|
|
1805
|
+
scopedSlots: this.$scopedSlots,
|
|
1806
|
+
on: Object.assign({}, this.$listeners, {
|
|
1807
|
+
change: function change(value) {
|
|
1808
|
+
if (["monthrange", "daterange", "datetimerange"].indexOf(_this.$attrs.type) > -1 && _this.startProp && _this.endProp && _this._form) {
|
|
1809
|
+
var formModel = _this._form.formModel;
|
|
1810
|
+
if (formModel) {
|
|
1811
|
+
_this.$set(formModel, _this.startProp, value && value[0]);
|
|
1812
|
+
_this.$set(formModel, _this.endProp, value && value[1]);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
_this.$emit("change", value);
|
|
1816
|
+
}
|
|
1817
|
+
})
|
|
1818
|
+
};
|
|
1819
|
+
return h("el-date-picker", babel_helper_vue_jsx_merge_props_default()([{}, param]));
|
|
1820
|
+
}
|
|
1821
|
+
});
|
|
1822
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/DatePicker.vue?vue&type=script&lang=js&
|
|
1823
|
+
/* harmony default export */ var item_DatePickervue_type_script_lang_js_ = (DatePickervue_type_script_lang_js_);
|
|
1824
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/DatePicker.vue
|
|
1825
|
+
var DatePicker_render, DatePicker_staticRenderFns
|
|
1826
|
+
|
|
1827
|
+
|
|
1828
|
+
|
|
1829
|
+
|
|
1830
|
+
/* normalize component */
|
|
1831
|
+
|
|
1832
|
+
var DatePicker_component = Object(componentNormalizer["a" /* default */])(
|
|
1833
|
+
item_DatePickervue_type_script_lang_js_,
|
|
1834
|
+
DatePicker_render,
|
|
1835
|
+
DatePicker_staticRenderFns,
|
|
1836
|
+
false,
|
|
1837
|
+
null,
|
|
1838
|
+
null,
|
|
1839
|
+
null
|
|
1840
|
+
|
|
1841
|
+
)
|
|
1842
|
+
|
|
1843
|
+
/* harmony default export */ var DatePicker = (DatePicker_component.exports);
|
|
1712
1844
|
// EXTERNAL MODULE: external "element-ui/lib/switch"
|
|
1713
|
-
var switch_ = __webpack_require__(
|
|
1845
|
+
var switch_ = __webpack_require__(48);
|
|
1714
1846
|
var switch_default = /*#__PURE__*/__webpack_require__.n(switch_);
|
|
1715
1847
|
|
|
1716
1848
|
// EXTERNAL MODULE: external "element-ui/lib/slider"
|
|
1717
|
-
var slider_ = __webpack_require__(
|
|
1849
|
+
var slider_ = __webpack_require__(49);
|
|
1718
1850
|
var slider_default = /*#__PURE__*/__webpack_require__.n(slider_);
|
|
1719
1851
|
|
|
1720
1852
|
// EXTERNAL MODULE: external "element-ui/lib/transfer"
|
|
1721
|
-
var transfer_ = __webpack_require__(
|
|
1853
|
+
var transfer_ = __webpack_require__(50);
|
|
1722
1854
|
var transfer_default = /*#__PURE__*/__webpack_require__.n(transfer_);
|
|
1723
1855
|
|
|
1724
1856
|
// EXTERNAL MODULE: external "element-ui/lib/time-picker"
|
|
1725
|
-
var time_picker_ = __webpack_require__(
|
|
1857
|
+
var time_picker_ = __webpack_require__(51);
|
|
1726
1858
|
var time_picker_default = /*#__PURE__*/__webpack_require__.n(time_picker_);
|
|
1727
1859
|
|
|
1728
|
-
// EXTERNAL MODULE: external "element-ui/lib/date-picker"
|
|
1729
|
-
var date_picker_ = __webpack_require__(51);
|
|
1730
|
-
var date_picker_default = /*#__PURE__*/__webpack_require__.n(date_picker_);
|
|
1731
|
-
|
|
1732
1860
|
// EXTERNAL MODULE: external "element-ui/lib/upload"
|
|
1733
1861
|
var upload_ = __webpack_require__(52);
|
|
1734
1862
|
var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
@@ -1744,7 +1872,6 @@ var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
|
1744
1872
|
|
|
1745
1873
|
|
|
1746
1874
|
|
|
1747
|
-
// import elCascader from "element-ui/packages/cascader";
|
|
1748
1875
|
|
|
1749
1876
|
|
|
1750
1877
|
|
|
@@ -1760,7 +1887,7 @@ var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
|
1760
1887
|
Switchs: switch_default.a,
|
|
1761
1888
|
Upload: upload_default.a,
|
|
1762
1889
|
TimePicker: time_picker_default.a,
|
|
1763
|
-
DatePicker:
|
|
1890
|
+
DatePicker: DatePicker,
|
|
1764
1891
|
Input: Input,
|
|
1765
1892
|
InputNumber: InputNumber,
|
|
1766
1893
|
Select: Select,
|