@panpanzhao/component-ui 0.0.24 → 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.
@@ -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/switch");
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/slider");
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/transfer");
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/time-picker");
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/date-picker");
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__(38);
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__(39);
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__(40);
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__(41);
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: date_picker_default.a,
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
- if (this.config.value === val) {
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;
@@ -6915,8 +7051,8 @@ table_operate_src.install = function (Vue) {
6915
7051
  Vue.component(table_operate_src.name, table_operate_src);
6916
7052
  };
6917
7053
  /* harmony default export */ var table_operate = (table_operate_src);
6918
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=2155e5c4&
6919
- var srcvue_type_template_id_2155e5c4_render = function render() {
7054
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=9238b84c&
7055
+ var srcvue_type_template_id_9238b84c_render = function render() {
6920
7056
  var _vm = this,
6921
7057
  _c = _vm._self._c
6922
7058
  return _c("div", [
@@ -6982,11 +7118,11 @@ var srcvue_type_template_id_2155e5c4_render = function render() {
6982
7118
  ),
6983
7119
  ])
6984
7120
  }
6985
- var srcvue_type_template_id_2155e5c4_staticRenderFns = []
6986
- srcvue_type_template_id_2155e5c4_render._withStripped = true
7121
+ var srcvue_type_template_id_9238b84c_staticRenderFns = []
7122
+ srcvue_type_template_id_9238b84c_render._withStripped = true
6987
7123
 
6988
7124
 
6989
- // CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=2155e5c4&
7125
+ // CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=9238b84c&
6990
7126
 
6991
7127
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=script&lang=js&
6992
7128
 
@@ -7012,25 +7148,31 @@ srcvue_type_template_id_2155e5c4_render._withStripped = true
7012
7148
  };
7013
7149
  },
7014
7150
  createProps: function createProps() {
7015
- return Object.assign({
7016
- dialog: {
7017
- title: "添加"
7018
- }
7151
+ var deep = Object.assign({
7152
+ dialog: {}
7019
7153
  }, this.create);
7154
+ if (!deep.dialog.title) {
7155
+ deep.dialog.title = "添加";
7156
+ }
7157
+ return deep;
7020
7158
  },
7021
7159
  updateProps: function updateProps() {
7022
- return Object.assign({
7023
- dialog: {
7024
- title: "修改"
7025
- }
7026
- }, this.update);
7160
+ var deep = Object.assign({
7161
+ dialog: {}
7162
+ }, this.create);
7163
+ if (!deep.dialog.title) {
7164
+ deep.dialog.title = "修改";
7165
+ }
7166
+ return deep;
7027
7167
  },
7028
7168
  viewProps: function viewProps() {
7029
- return Object.assign({
7030
- dialog: {
7031
- title: "查看"
7032
- }
7033
- }, this.view);
7169
+ var deep = Object.assign({
7170
+ dialog: {}
7171
+ }, this.create);
7172
+ if (!deep.dialog.title) {
7173
+ deep.dialog.title = "查看";
7174
+ }
7175
+ return deep;
7034
7176
  }
7035
7177
  },
7036
7178
  props: {
@@ -7302,8 +7444,8 @@ srcvue_type_template_id_2155e5c4_render._withStripped = true
7302
7444
 
7303
7445
  var crud_src_component = normalizeComponent(
7304
7446
  components_crud_srcvue_type_script_lang_js_,
7305
- srcvue_type_template_id_2155e5c4_render,
7306
- srcvue_type_template_id_2155e5c4_staticRenderFns,
7447
+ srcvue_type_template_id_9238b84c_render,
7448
+ srcvue_type_template_id_9238b84c_staticRenderFns,
7307
7449
  false,
7308
7450
  null,
7309
7451
  null,
@@ -2042,7 +2042,7 @@ module.exports = require("element-ui/lib/message-box");
2042
2042
  // ESM COMPAT FLAG
2043
2043
  __webpack_require__.r(__webpack_exports__);
2044
2044
 
2045
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=2155e5c4&
2045
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=9238b84c&
2046
2046
  var render = function render() {
2047
2047
  var _vm = this,
2048
2048
  _c = _vm._self._c
@@ -2113,7 +2113,7 @@ var staticRenderFns = []
2113
2113
  render._withStripped = true
2114
2114
 
2115
2115
 
2116
- // CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=2155e5c4&
2116
+ // CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=9238b84c&
2117
2117
 
2118
2118
  // EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/table-search"
2119
2119
  var table_search_ = __webpack_require__(28);
@@ -2159,25 +2159,31 @@ var external_lodash_ = __webpack_require__(2);
2159
2159
  };
2160
2160
  },
2161
2161
  createProps: function createProps() {
2162
- return Object.assign({
2163
- dialog: {
2164
- title: "添加"
2165
- }
2162
+ var deep = Object.assign({
2163
+ dialog: {}
2166
2164
  }, this.create);
2165
+ if (!deep.dialog.title) {
2166
+ deep.dialog.title = "添加";
2167
+ }
2168
+ return deep;
2167
2169
  },
2168
2170
  updateProps: function updateProps() {
2169
- return Object.assign({
2170
- dialog: {
2171
- title: "修改"
2172
- }
2173
- }, this.update);
2171
+ var deep = Object.assign({
2172
+ dialog: {}
2173
+ }, this.create);
2174
+ if (!deep.dialog.title) {
2175
+ deep.dialog.title = "修改";
2176
+ }
2177
+ return deep;
2174
2178
  },
2175
2179
  viewProps: function viewProps() {
2176
- return Object.assign({
2177
- dialog: {
2178
- title: "查看"
2179
- }
2180
- }, this.view);
2180
+ var deep = Object.assign({
2181
+ dialog: {}
2182
+ }, this.create);
2183
+ if (!deep.dialog.title) {
2184
+ deep.dialog.title = "查看";
2185
+ }
2186
+ return deep;
2181
2187
  }
2182
2188
  },
2183
2189
  props: {