hc-basic 1.5.1 → 1.5.4

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.
Files changed (39) hide show
  1. package/lib/hc-basic.common.js +85193 -55
  2. package/lib/hc-basic.umd.js +85204 -56
  3. package/lib/hc-basic.umd.min.js +41 -1
  4. package/package.json +10 -9
  5. package/lib/css/hc-basic.umd.596515ce.css +0 -1
  6. package/lib/css/hc-basic.umd.min.596515ce.css +0 -1
  7. package/lib/hc-basic.common.async-validator1680231905970.js +0 -984
  8. package/lib/hc-basic.common.axios1680231905971.js +0 -1644
  9. package/lib/hc-basic.common.babel-runtime1680231905970.js +0 -1242
  10. package/lib/hc-basic.common.crypto-js1680231905971.js +0 -6194
  11. package/lib/hc-basic.common.element-ui1680231905967.js +0 -43880
  12. package/lib/hc-basic.common.element-ui1680231905968.js +0 -5784
  13. package/lib/hc-basic.common.element-ui1680231905969.js +0 -14978
  14. package/lib/hc-basic.common.element-ui1680231905970.js +0 -3453
  15. package/lib/hc-basic.common.hc-basic.common.js +0 -3812
  16. package/lib/hc-basic.common.resize-observer-polyfill1680231905969.js +0 -941
  17. package/lib/hc-basic.common.vendors~hc-basic.common.js +0 -2203
  18. package/lib/hc-basic.umd.axios1680231905278.js +0 -1712
  19. package/lib/hc-basic.umd.babel-runtime1680231905277.js +0 -1411
  20. package/lib/hc-basic.umd.crypto-js1680231905278.js +0 -6194
  21. package/lib/hc-basic.umd.element-ui1680231905273.js +0 -43880
  22. package/lib/hc-basic.umd.element-ui1680231905274.js +0 -695
  23. package/lib/hc-basic.umd.element-ui1680231905275.js +0 -5158
  24. package/lib/hc-basic.umd.element-ui1680231905276.js +0 -14912
  25. package/lib/hc-basic.umd.element-ui1680231905278.js +0 -3453
  26. package/lib/hc-basic.umd.hc-basic.umd.js +0 -3822
  27. package/lib/hc-basic.umd.min.async-validator1680231905116.js +0 -1
  28. package/lib/hc-basic.umd.min.axios1680231905116.js +0 -1
  29. package/lib/hc-basic.umd.min.babel-runtime1680231905115.js +0 -1
  30. package/lib/hc-basic.umd.min.crypto-js1680231905116.js +0 -18
  31. package/lib/hc-basic.umd.min.element-ui1680231905113.js +0 -1
  32. package/lib/hc-basic.umd.min.element-ui1680231905114.js +0 -9
  33. package/lib/hc-basic.umd.min.element-ui1680231905116.js +0 -1
  34. package/lib/hc-basic.umd.min.hc-basic.umd.min.js +0 -1
  35. package/lib/hc-basic.umd.min.resize-observer-polyfill1680231905114.js +0 -1
  36. package/lib/hc-basic.umd.min.vendors~hc-basic.umd.min.js +0 -16
  37. package/lib/hc-basic.umd.resize-observer-polyfill1680231905275.js +0 -941
  38. package/lib/hc-basic.umd.vendors~hc-basic.umd.js +0 -2911
  39. /package/lib/{css/hc-basic.common.596515ce.css → hc-basic.css} +0 -0
@@ -1,3812 +0,0 @@
1
- module.exports =
2
- ((typeof self !== 'undefined' ? self : this)["webpackJsonphc_basic"] = (typeof self !== 'undefined' ? self : this)["webpackJsonphc_basic"] || []).push([[8],{
3
-
4
- /***/ 0:
5
- /***/ (function(module, exports) {
6
-
7
- /* (ignored) */
8
-
9
- /***/ }),
10
-
11
- /***/ "1ee1":
12
- /***/ (function(module, exports, __webpack_require__) {
13
-
14
- // extracted by mini-css-extract-plugin
15
-
16
- /***/ }),
17
-
18
- /***/ "3a0d":
19
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
20
-
21
- "use strict";
22
-
23
- // EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
24
- var cjs = __webpack_require__("3c4e");
25
- var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
26
-
27
- // CONCATENATED MODULE: ./packages/options.js
28
- /* harmony default export */ var packages_options = ({
29
- Components: {
30
- formItem: {
31
- labelFontSize: 14, // form项的label字体大小,用来设置label的宽度
32
- label: 'label', // 默认select、checkbox、radio的option的label字段
33
- value: 'value', // 默认select、checkbox、radio的option的value字段
34
- space: '20px' // 各子组件中间距的大小
35
- },
36
- pager: {
37
- currentPage: 'pageNo', // 当前页配置字段
38
- pageSize: 'pageSize', // pager组件page-size字段
39
- layout: 'total, prev, pager, next, sizes, jumper' // pager组件layout
40
- },
41
- table: {
42
- noData: 'https://frontendonline-erp.ocj.com.cn/img/nodata.png', // 没有数据展示图片,可通过require导入本地图片
43
- optionLabel: '操作' // table操作列名称
44
- },
45
- desc: {
46
- color: {
47
- label: 'regular', // 详情label字段颜色
48
- value: 'textPrimary' // 详情值颜色
49
- },
50
- emptyText: '------', // 详情单独对应字段为空的默认显示
51
- distance: '16' // 详情字段间距
52
- },
53
- drawer: {
54
- submit: '确定',
55
- back: '返回'
56
- }
57
- },
58
- tCode: {
59
- path: '/code', // 使用tcode组件时,tcode后台地址
60
- key: 'code', // 入参key字段
61
- type: 'post', // get post
62
- dataType: 'isNumber', // ''''
63
- isNumValue: 1, // 该字典类型的值,如果是1,那么就是数字类型。否则为字符串类型
64
- cache: true, // tocode 是否缓存不刷新数据
65
- func: res => res.data
66
- },
67
- Encrypt: {
68
- AES: {
69
- KEY: '', // aes加密-密钥
70
- IV: '' // aes加密-密钥偏移量
71
- }
72
- },
73
- directives: {
74
- copy: {},
75
- errImg: {
76
- avatarErr: 'https://ocj-erp-frontendonline.oss-cn-shanghai.aliyuncs.com/img/avator.png', // 头像错误图片
77
- showErr: 'https://ocj-erp-frontendonline.oss-cn-shanghai.aliyuncs.com/img/nofound.png', // 展示错误图片
78
- upErr: 'https://ocj-erp-frontendonline.oss-cn-shanghai.aliyuncs.com/img/upload-fail.png' // 上传错误图片
79
- },
80
- onlyInt: {},
81
- dialogDrag: {},
82
- onlyNumber: {},
83
- watermark: {
84
- width: 200, // 水印宽度
85
- height: 200, // 水印高度
86
- fillStyle: 'rgba(180, 180, 180, 0.3)', // 文字颜色
87
- font: '16px Microsoft JhengHei', // 文本字体大小字体类型
88
- title: '', // 水印标题
89
- subTitle: '' // 水印副标题
90
- },
91
- rightMenu: {
92
- menuStyle: 'width:150px;background:#fff;box-shadow: 0 1px 5px 0 rgb(45 47 51 / 10%);cursor: pointer', // 右键菜单样式
93
- childMenuStyle: 'color:#000;line-height:30px;font-size:15px;border-bottom: 1px solid #ddd' // 右键子菜单样式
94
- },
95
- preventShake: {
96
- time: 2000 // 间隔时间
97
- }
98
- }
99
- });
100
-
101
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/desc/index.vue?vue&type=template&id=a4062538&scoped=true&
102
- var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ul',{directives:[{name:"watermark",rawName:"v-watermark",value:({ title: _vm.$Config.directives.watermark.title, subTitle: _vm.$Config.directives.watermark.subTitle }),expression:"{ title: $Config.directives.watermark.title, subTitle: $Config.directives.watermark.subTitle }"}],staticClass:"text-14 flex-wrap w-100 hc-desc border-box"},_vm._l((_vm.config),function(item,index){return _c('li',{staticClass:"d-flex border-box",class:(item.span && 'col-' + _vm.colVal * item.span) || `col-${_vm.colVal}`},[_c('div',{staticClass:"white-space-nowrap hc-desc-label pr-16",class:[_vm.labelColor, `pb-${_vm.distancePb}`],staticStyle:{"text-align":"right"},style:({ width: _vm.sameLabel && _vm.setWidth(index) })},[_vm._v(" "+_vm._s(item.label)+" ")]),(item.isSlot)?_vm._t(item.prop,null,null,item):_c('div',{staticClass:"hc-desc-value border-box pr-20 w-100",class:[(item.click && 'a-label') || 'color-dark', _vm.valueColor, `pb-${_vm.distance}`],on:{"click":function($event){item.click && item.click(_vm.compatibleWith(_vm.data, item), item)}}},[_vm._v(" "+_vm._s(_vm.setValue(item, _vm.data) || _vm.$Config.Components.desc.emptyText)+" ")])],2)}),0)
103
- }
104
- var staticRenderFns = []
105
-
106
-
107
- // CONCATENATED MODULE: ./packages/components/desc/index.vue?vue&type=template&id=a4062538&scoped=true&
108
-
109
- // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
110
- var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
111
- var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
112
-
113
- // CONCATENATED MODULE: ./packages/tCode.js
114
-
115
- const tCode_state = external_commonjs_vue_commonjs2_vue_root_Vue_default.a.observable({
116
- tCodeData: {},
117
- textColor: {
118
- primary: 'color-primary',
119
- success: 'color-success',
120
- danger: 'color-danger',
121
- info: 'color-info',
122
- warning: 'color-warning',
123
- textPrimary: 'color-text-primary',
124
- regular: 'color-text-regular',
125
- secondary: 'color-text-secondary',
126
- placeholder: 'color-text-placeholder',
127
- white: 'color-text-white'
128
- }
129
- });
130
-
131
- const muta = {
132
- getListData(vm, value) {
133
- // 获取浏览器localStroge缓存数据tcodeListData
134
- const tCodeData = JSON.parse(window && window.localStorage.getItem('tCodeData')) || {};
135
- const tCode = vm.$Config.tCode;
136
- // 默认入参
137
- let params = { [tCode.key]: value };
138
- // 如果设置了缓存,那么判断state里面有没有该数据,如果没有那么进行数据请求
139
- if ((tCode.cache && !tCode_state.tCodeData[value]) || !tCode.cache) {
140
- // 设置get方式请求入参
141
- tCode.type === 'get' && (params = { params });
142
- vm.$hcHttp[tCode.type](vm.$Config.axios.ipUrl + tCode.path, params).then(res => {
143
- const result = vm.$Func.filterOptionArray(tCode.func(res) || [], 'id');
144
- // 后台返回字典值取数字或者字符串数据
145
- tCode_state.tCodeData[value] = result.map(e => {
146
- let value = e[vm.$Config.Components.formItem.value];
147
- if (tCode.dataType && e[tCode.dataType] === tCode.isNumValue) {
148
- value = Number(value || '0') || 0;
149
- }
150
- return { ...e, [vm.$Config.Components.formItem.value]: value };
151
- });
152
- tCode_state.tCodeData = JSON.parse(JSON.stringify({ ...tCodeData, ...tCode_state.tCodeData }));
153
- vm.$Func.addStorgeValue('tCodeData', JSON.stringify(tCode_state.tCodeData));
154
- });
155
- }
156
- }
157
- };
158
-
159
-
160
-
161
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/desc/index.vue?vue&type=script&lang=js&
162
-
163
-
164
-
165
- /* harmony default export */ var descvue_type_script_lang_js_ = ({
166
- name: 'HcDesc',
167
- props: {
168
- config: { type: Array, required: true, default: () => [] },
169
- data: { type: Object, required: true, default: () => {} },
170
- sameLabel: { type: Boolean, default: false },
171
- color: {
172
- type: Object,
173
- default: () => ({ label: '', value: 'textPrimary' }),
174
- validator: value => {
175
- return Object.keys(tCode_state.textColor).includes(value.label) && Object.keys(tCode_state.textColor).includes(value.value);
176
- }
177
- },
178
- column: { type: [Number, String], default: 4, validator: value => [1, 2, 3, 4, 6].indexOf(Number(value)) !== -1 },
179
- distance: {
180
- type: [Number, String],
181
- default: 0,
182
- validator: value => {
183
- return Number(value) % 4 === 0;
184
- }
185
- },
186
- width: { type: String, default: '100%' } // 每一项form-item项表单内容宽度
187
- },
188
- computed: {
189
- realColumn() {
190
- return Number(this.column) || 4;
191
- },
192
- // 整体列数对应的col
193
- colVal() {
194
- return 24 / this.realColumn;
195
- },
196
- labelColor() {
197
- return tCode_state.textColor[this.color.label || this.$Config.Components.desc.color.label];
198
- },
199
- valueColor() {
200
- return tCode_state.textColor[this.color.value || this.$Config.Components.desc.color.value];
201
- },
202
- distancePb() {
203
- return this.distance || this.$Config.Components.desc.distance;
204
- },
205
- labelWidth() {
206
- // rowList每一行的数据,初始化的时候给一个二维数组,并制定第一个参数为new Array()
207
- // columnList每一列的数据
208
- const rowList = [new Array(this.realColumn)],
209
- columnList = [];
210
- // count用来计算是否换行新增rowList的数组元素空数组,用来填补二维数组空位
211
- // index代表的是rowList的当前操作项的下标
212
- let count = 0,
213
- index = 0;
214
- this.config.forEach((e, i, arr) => {
215
- count += e.span || 1;
216
- rowList[index][count - (e.span || 1)] = { name: e.label, index: i };
217
- if (count + ((arr[i + 1] || {}).span || 1) > this.realColumn && arr[i + 1]) {
218
- rowList.push(new Array(this.realColumn));
219
- index++;
220
- count = 0;
221
- }
222
- });
223
- // 行数据转列数据
224
- rowList.forEach(e => {
225
- for (let i = 0; i < e.length; i++) {
226
- if (!columnList[i]) {
227
- columnList[i] = [];
228
- }
229
- columnList[i].push(e[i]);
230
- }
231
- });
232
- // 取出每一列最大值nameLength
233
- // 取出每一列的index下标
234
- return columnList.map(e => {
235
- const nameLength = Math.max.apply(
236
- null,
237
- e.map(el => (el && this.charCode(el.name).length / 4) || 0)
238
- );
239
- const indexList = e.map(el => el && el.index);
240
- return { nameLength, indexList };
241
- });
242
- }
243
- },
244
- watch: {
245
- config: {
246
- handler(val) {
247
- val.forEach(e => {
248
- e.code && muta.getListData(this, e.code);
249
- });
250
- },
251
- immediate: true
252
- }
253
- },
254
- methods: {
255
- // 通过labelWidth获取对应index里面的值
256
- setWidth(index) {
257
- if (!this.sameLabel) return this.labelWidth;
258
- // 增加rules为入参,判断当前项是否有必填校验,如果有那么width加上11px;
259
- let val = this.labelWidth.find(e => e.indexList.includes(index));
260
- const rulesWidth = val.hasRules ? 11 : 0;
261
- return val.nameLength * this.$Config.Components.formItem.labelFontSize + rulesWidth + 16 + 'px';
262
- },
263
- // 将字符串转为16进制值,汉子转4位,英文字母和数组转2位
264
- charCode: str => str.split('').reduce((total, e) => total + e.codePointAt(0).toString(16), ''),
265
- setValue(item, data) {
266
- const value = this.compatibleWith(data, item);
267
- if (item.code) {
268
- const result = (tCode_state.tCodeData[item.code] || []).find(e => value === e[this.$Config.Components.formItem.value]) || {};
269
- return result[this.$Config.Components.formItem.label] || value;
270
- }
271
- if (item.formatter) return item.formatter(data);
272
- return value;
273
- },
274
- compatibleWith(data, item) {
275
- const props = item.prop.split('.');
276
- return props[1] ? data[props[0]][props[1]] : data[props[0]];
277
- }
278
- }
279
- });
280
-
281
- // CONCATENATED MODULE: ./packages/components/desc/index.vue?vue&type=script&lang=js&
282
- /* harmony default export */ var components_descvue_type_script_lang_js_ = (descvue_type_script_lang_js_);
283
- // EXTERNAL MODULE: ./packages/components/desc/index.vue?vue&type=style&index=0&id=a4062538&prod&lang=scss&scoped=true&
284
- var descvue_type_style_index_0_id_a4062538_prod_lang_scss_scoped_true_ = __webpack_require__("e3b2");
285
-
286
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
287
- var componentNormalizer = __webpack_require__("2877");
288
-
289
- // CONCATENATED MODULE: ./packages/components/desc/index.vue
290
-
291
-
292
-
293
-
294
-
295
-
296
- /* normalize component */
297
-
298
- var component = Object(componentNormalizer["a" /* default */])(
299
- components_descvue_type_script_lang_js_,
300
- render,
301
- staticRenderFns,
302
- false,
303
- null,
304
- "a4062538",
305
- null
306
-
307
- )
308
-
309
- /* harmony default export */ var desc = (component.exports);
310
- // CONCATENATED MODULE: ./packages/components/desc/index.js
311
-
312
-
313
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/dialog/index.vue?vue&type=template&id=467343b6&
314
- var dialogvue_type_template_id_467343b6_render = function render(){var _vm=this,_c=_vm._self._c;return _c('span',{on:{"click":function($event){$event.stopPropagation();return _vm.open.apply(null, arguments)}}},[_vm._t("default"),(_vm.show)?_c('el-dialog',_vm._b({directives:[{name:"dialogDrag",rawName:"v-dialogDrag",value:(_vm.drag),expression:"drag"}],attrs:{"close-on-click-modal":_vm.closeOnClickModal,"visible":true,"append-to-body":""},on:{"close":_vm.onCancel}},'el-dialog',_vm.$attrs,false),[_vm._t("title"),_vm._t("contain")],2):_vm._e()],2)
315
- }
316
- var dialogvue_type_template_id_467343b6_staticRenderFns = []
317
-
318
-
319
- // CONCATENATED MODULE: ./packages/components/dialog/index.vue?vue&type=template&id=467343b6&
320
-
321
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/dialog/index.vue?vue&type=script&lang=js&
322
-
323
- /* harmony default export */ var dialogvue_type_script_lang_js_ = ({
324
- name: 'HcDialog',
325
- props: {
326
- outClose: { type: Boolean, required: true, default: true }, // 关闭弹窗
327
- // eslint-disable-next-line vue/require-default-prop
328
- beforeOpen: { type: Function }, // 是否延时开启弹窗
329
- closeOnClickModal: { type: Boolean, default: false }, // 是否可以通过点击 modal 关闭 Dialog
330
- single: { type: Boolean, default: false }, // dialog高度是否占据屏幕,超出部分内容区域滚动
331
- drag: { type: Boolean, default: false } // 是否开启弹窗拖拽功能d
332
- },
333
- data() {
334
- return {
335
- show: false
336
- };
337
- },
338
- watch: {
339
- outClose() {
340
- this.onCancel();
341
- }
342
- },
343
- methods: {
344
- onCancel() {
345
- this.show = false;
346
- this.$emit('cancel');
347
- },
348
- open() {
349
- if (typeof this.beforeOpen !== 'function') {
350
- this.show = true;
351
- return;
352
- }
353
- this.beforeOpen(() => {
354
- this.show = true;
355
- });
356
- }
357
- }
358
- });
359
-
360
- // CONCATENATED MODULE: ./packages/components/dialog/index.vue?vue&type=script&lang=js&
361
- /* harmony default export */ var components_dialogvue_type_script_lang_js_ = (dialogvue_type_script_lang_js_);
362
- // CONCATENATED MODULE: ./packages/components/dialog/index.vue
363
-
364
-
365
-
366
-
367
-
368
- /* normalize component */
369
-
370
- var dialog_component = Object(componentNormalizer["a" /* default */])(
371
- components_dialogvue_type_script_lang_js_,
372
- dialogvue_type_template_id_467343b6_render,
373
- dialogvue_type_template_id_467343b6_staticRenderFns,
374
- false,
375
- null,
376
- null,
377
- null
378
-
379
- )
380
-
381
- /* harmony default export */ var dialog = (dialog_component.exports);
382
- // CONCATENATED MODULE: ./packages/components/dialog/index.js
383
-
384
-
385
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/drawer/index.vue?vue&type=template&id=95646aca&
386
- var drawervue_type_template_id_95646aca_render = function render(){var _vm=this,_c=_vm._self._c;return _c('span',{on:{"click":function($event){$event.stopPropagation();return _vm.open.apply(null, arguments)}}},[_vm._t("default"),_c('el-drawer',_vm._b({attrs:{"close-on-click-modal":_vm.closeOnClickModal,"visible":_vm.visible,"append-to-body":""},on:{"close":_vm.onCancel}},'el-drawer',_vm.$attrs,false),[_vm._t("title",null,{"slot":"title"}),(_vm.show)?_c('div',{staticClass:"absolute-all"},[_c('div',{staticClass:"absolute-all px-20 pt-20 overflow-auto border-box"},[_vm._t("contain")],2)]):_vm._e()],2)],2)
387
- }
388
- var drawervue_type_template_id_95646aca_staticRenderFns = []
389
-
390
-
391
- // CONCATENATED MODULE: ./packages/components/drawer/index.vue?vue&type=template&id=95646aca&
392
-
393
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/drawer/index.vue?vue&type=script&lang=js&
394
-
395
- /* harmony default export */ var drawervue_type_script_lang_js_ = ({
396
- name: 'HcDialog',
397
- props: {
398
- outClose: { type: Boolean, required: true, default: true }, // 关闭弹窗
399
- showFooter: { type: Boolean, default: false }, // 是否展示底部按钮
400
- // eslint-disable-next-line vue/require-default-prop
401
- beforeOpen: { type: Function }, // 是否延时开启弹窗
402
- closeOnClickModal: { type: Boolean, default: false }, // 是否可以通过点击 modal 关闭 Dialog
403
- single: { type: Boolean, default: false } // dialog高度是否占据屏幕,超出部分内容区域滚动
404
- },
405
- data() {
406
- return {
407
- show: false,
408
- visible: false
409
- };
410
- },
411
- watch: {
412
- outClose() {
413
- this.onCancel();
414
- },
415
- show(val) {
416
- this.$nextTick(() => {
417
- this.visible !== val && (this.visible = val);
418
- });
419
- }
420
- },
421
- methods: {
422
- onCancel() {
423
- this.show = false;
424
- this.$emit('cancel');
425
- },
426
- open() {
427
- if (typeof this.beforeOpen !== 'function') {
428
- this.show = true;
429
- return;
430
- }
431
- this.beforeOpen(() => {
432
- this.show = true;
433
- });
434
- }
435
- }
436
- });
437
-
438
- // CONCATENATED MODULE: ./packages/components/drawer/index.vue?vue&type=script&lang=js&
439
- /* harmony default export */ var components_drawervue_type_script_lang_js_ = (drawervue_type_script_lang_js_);
440
- // CONCATENATED MODULE: ./packages/components/drawer/index.vue
441
-
442
-
443
-
444
-
445
-
446
- /* normalize component */
447
-
448
- var drawer_component = Object(componentNormalizer["a" /* default */])(
449
- components_drawervue_type_script_lang_js_,
450
- drawervue_type_template_id_95646aca_render,
451
- drawervue_type_template_id_95646aca_staticRenderFns,
452
- false,
453
- null,
454
- null,
455
- null
456
-
457
- )
458
-
459
- /* harmony default export */ var drawer = (drawer_component.exports);
460
- // CONCATENATED MODULE: ./packages/components/drawer/index.js
461
-
462
-
463
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/index.vue?vue&type=template&id=b87498ee&
464
- var form_itemvue_type_template_id_b87498ee_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{directives:[{name:"watermark",rawName:"v-watermark",value:({ title: _vm.$Config.directives.watermark.title, subTitle: _vm.$Config.directives.watermark.subTitle }),expression:"{ title: $Config.directives.watermark.title, subTitle: $Config.directives.watermark.subTitle }"}],staticClass:"flex-wrap hcFormItem"},[_vm._l((_vm.realConfig),function(item,index){return _c('el-form-item',{key:'form-item' + index,class:(item.span && 'col-' + _vm.colVal * item.span) || `col-${_vm.colVal}`,attrs:{"label":!_vm.noLabel ? item.label : '',"label-width":_vm.setWidth(item, index),"prop":item.prop}},[(!item.isSlot)?_c('item-' + item.itemType || false,_vm._b({tag:"components",style:({ width: _vm.itemWidth(item, index) }),attrs:{"form":_vm.form,"disabled":item.disabled || _vm.disabled,"clearable":item.clearable || _vm.clearable}},'components',{ ...item, noLabel: _vm.noLabel },false)):(item.components)?_c(item.components,_vm._b({tag:"components",model:{value:(_vm.form[item.prop]),callback:function ($$v) {_vm.$set(_vm.form, item.prop, $$v)},expression:"form[item.prop]"}},'components',item,false)):_vm._t(item.prop,null,null,item)],2)}),(_vm.$slots.default)?_c('el-form-item',{staticClass:"flex-auto slot",class:{ formButtonRight: _vm.rightSide },attrs:{"label-width":"0px"}},[_vm._t("default")],2):_vm._e()],2)
465
- }
466
- var form_itemvue_type_template_id_b87498ee_staticRenderFns = []
467
-
468
-
469
- // CONCATENATED MODULE: ./packages/components/form-item/index.vue?vue&type=template&id=b87498ee&
470
-
471
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/checkbox.vue?vue&type=template&id=7a36440b&
472
- var checkboxvue_type_template_id_7a36440b_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-checkbox-group',_vm._b({on:{"change":function($event){(_vm.$attrs.change && _vm.$attrs.change(_vm.form)) || ''}},model:{value:(_vm.values[_vm.keys]),callback:function ($$v) {_vm.$set(_vm.values, _vm.keys, $$v)},expression:"values[keys]"}},'el-checkbox-group',_vm.$attrs,false),_vm._l((_vm.list),function(item,index){return _c('el-checkbox',_vm._b({key:'checkbox' + index,attrs:{"label":item[_vm.$attrs.valueKey || _vm.$Config.Components.formItem.value]}},'el-checkbox',{ ...item },false),[_vm._v(" "+_vm._s(item[_vm.$attrs.labelKey || _vm.$Config.Components.formItem.label])+" ")])}),1)
473
- }
474
- var checkboxvue_type_template_id_7a36440b_staticRenderFns = []
475
-
476
-
477
- // CONCATENATED MODULE: ./packages/components/form-item/item/checkbox.vue?vue&type=template&id=7a36440b&
478
-
479
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/checkbox.vue?vue&type=script&lang=js&
480
-
481
-
482
- /* harmony default export */ var checkboxvue_type_script_lang_js_ = ({
483
- name: 'ItemCheckbox',
484
- inheritAttrs: false,
485
- props: {
486
- form: { type: Object, default: () => ({}) }
487
- },
488
- computed: {
489
- list() {
490
- return (this.$attrs.code && tCode_state.tCodeData[this.$attrs.code]) || this.$attrs.list;
491
- },
492
- values() {
493
- if (!this.$attrs.prop) {
494
- throw new Error(this.$attrs.label + ':prop未定义');
495
- }
496
- const props = this.$attrs.prop.split('.');
497
- return props[1] ? this.form[props[0]] : this.form;
498
- },
499
- keys() {
500
- const props = this.$attrs.prop.split('.');
501
- return props[1] || props[0];
502
- }
503
- }
504
- });
505
-
506
- // CONCATENATED MODULE: ./packages/components/form-item/item/checkbox.vue?vue&type=script&lang=js&
507
- /* harmony default export */ var item_checkboxvue_type_script_lang_js_ = (checkboxvue_type_script_lang_js_);
508
- // CONCATENATED MODULE: ./packages/components/form-item/item/checkbox.vue
509
-
510
-
511
-
512
-
513
-
514
- /* normalize component */
515
-
516
- var checkbox_component = Object(componentNormalizer["a" /* default */])(
517
- item_checkboxvue_type_script_lang_js_,
518
- checkboxvue_type_template_id_7a36440b_render,
519
- checkboxvue_type_template_id_7a36440b_staticRenderFns,
520
- false,
521
- null,
522
- null,
523
- null
524
-
525
- )
526
-
527
- /* harmony default export */ var item_checkbox = (checkbox_component.exports);
528
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/input.vue?vue&type=template&id=490e0e12&
529
- var inputvue_type_template_id_490e0e12_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-input',_vm._b({attrs:{"placeholder":_vm.placeholder},on:{"change":function($event){(_vm.$attrs.change && _vm.$attrs.change()) || ''},"blur":function($event){(_vm.$attrs.blur && _vm.$attrs.blur()) || ''}},model:{value:(_vm.values[_vm.keys]),callback:function ($$v) {_vm.$set(_vm.values, _vm.keys, (typeof $$v === 'string'? $$v.trim(): $$v))},expression:"values[keys]"}},'el-input',_vm.$attrs,false))
530
- }
531
- var inputvue_type_template_id_490e0e12_staticRenderFns = []
532
-
533
-
534
- // CONCATENATED MODULE: ./packages/components/form-item/item/input.vue?vue&type=template&id=490e0e12&
535
-
536
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/input.vue?vue&type=script&lang=js&
537
-
538
- /* harmony default export */ var inputvue_type_script_lang_js_ = ({
539
- name: 'ItemInput',
540
- inheritAttrs: false,
541
- props: {
542
- form: { type: Object, default: () => {} }
543
- },
544
- computed: {
545
- placeholder() {
546
- return this.$attrs.placeholder || (this.$attrs.noLabel && this.$attrs.label) || '请输入';
547
- },
548
- values() {
549
- if (!this.$attrs.prop) {
550
- throw new Error(this.$attrs.label + ':prop未定义');
551
- }
552
- const props = this.$attrs.prop.split('.');
553
- return props[1] ? this.form[props[0]] : this.form;
554
- },
555
- keys() {
556
- const props = this.$attrs.prop.split('.');
557
- return props[1] || props[0];
558
- }
559
- }
560
- });
561
-
562
- // CONCATENATED MODULE: ./packages/components/form-item/item/input.vue?vue&type=script&lang=js&
563
- /* harmony default export */ var item_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
564
- // CONCATENATED MODULE: ./packages/components/form-item/item/input.vue
565
-
566
-
567
-
568
-
569
-
570
- /* normalize component */
571
-
572
- var input_component = Object(componentNormalizer["a" /* default */])(
573
- item_inputvue_type_script_lang_js_,
574
- inputvue_type_template_id_490e0e12_render,
575
- inputvue_type_template_id_490e0e12_staticRenderFns,
576
- false,
577
- null,
578
- null,
579
- null
580
-
581
- )
582
-
583
- /* harmony default export */ var input = (input_component.exports);
584
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/datePicker.vue?vue&type=template&id=3f669385&
585
- var datePickervue_type_template_id_3f669385_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-date-picker',_vm._b({staticStyle:{"width":"100%"},attrs:{"type":_vm.$attrs.type || 'date',"placeholder":_vm.placeholder,"range-separato":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{"change":function($event){_vm.$attrs.change || ''}},model:{value:(_vm.values[_vm.keys]),callback:function ($$v) {_vm.$set(_vm.values, _vm.keys, $$v)},expression:"values[keys]"}},'el-date-picker',_vm.$attrs,false))
586
- }
587
- var datePickervue_type_template_id_3f669385_staticRenderFns = []
588
-
589
-
590
- // CONCATENATED MODULE: ./packages/components/form-item/item/datePicker.vue?vue&type=template&id=3f669385&
591
-
592
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/datePicker.vue?vue&type=script&lang=js&
593
-
594
- /* harmony default export */ var datePickervue_type_script_lang_js_ = ({
595
- name: 'ItemDatePicker',
596
- inheritAttrs: false,
597
- props: {
598
- form: {
599
- type: Object,
600
- default: () => {}
601
- }
602
- },
603
- computed: {
604
- placeholder() {
605
- return this.$attrs.placeholder || (this.$attrs.noLabel && this.$attrs.label) || '选择日期';
606
- },
607
- values() {
608
- if (!this.$attrs.prop) {
609
- throw new Error(this.$attrs.label + ':prop未定义');
610
- }
611
- const props = this.$attrs.prop.split('.');
612
- return props[1] ? this.form[props[0]] : this.form;
613
- },
614
- keys() {
615
- const props = this.$attrs.prop.split('.');
616
- return props[1] || props[0];
617
- }
618
- }
619
- });
620
-
621
- // CONCATENATED MODULE: ./packages/components/form-item/item/datePicker.vue?vue&type=script&lang=js&
622
- /* harmony default export */ var item_datePickervue_type_script_lang_js_ = (datePickervue_type_script_lang_js_);
623
- // CONCATENATED MODULE: ./packages/components/form-item/item/datePicker.vue
624
-
625
-
626
-
627
-
628
-
629
- /* normalize component */
630
-
631
- var datePicker_component = Object(componentNormalizer["a" /* default */])(
632
- item_datePickervue_type_script_lang_js_,
633
- datePickervue_type_template_id_3f669385_render,
634
- datePickervue_type_template_id_3f669385_staticRenderFns,
635
- false,
636
- null,
637
- null,
638
- null
639
-
640
- )
641
-
642
- /* harmony default export */ var datePicker = (datePicker_component.exports);
643
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/radio.vue?vue&type=template&id=7dc06fd6&
644
- var radiovue_type_template_id_7dc06fd6_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-radio-group',_vm._b({on:{"change":function($event){(_vm.$attrs.change && _vm.$attrs.change(_vm.form)) || ''}},model:{value:(_vm.values[_vm.keys]),callback:function ($$v) {_vm.$set(_vm.values, _vm.keys, $$v)},expression:"values[keys]"}},'el-radio-group',_vm.$attrs,false),_vm._l((_vm.list),function(item,index){return _c('el-radio',_vm._b({key:'radio' + index,attrs:{"label":item[_vm.$attrs.valueKey || _vm.$Config.Components.formItem.value]}},'el-radio',{ ...item },false),[_vm._v(" "+_vm._s(item[_vm.$attrs.labelKey || _vm.$Config.Components.formItem.label])+" ")])}),1)
645
- }
646
- var radiovue_type_template_id_7dc06fd6_staticRenderFns = []
647
-
648
-
649
- // CONCATENATED MODULE: ./packages/components/form-item/item/radio.vue?vue&type=template&id=7dc06fd6&
650
-
651
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/radio.vue?vue&type=script&lang=js&
652
-
653
-
654
-
655
- /* harmony default export */ var radiovue_type_script_lang_js_ = ({
656
- name: 'ItemRadio',
657
- inheritAttrs: false,
658
- props: {
659
- form: { type: Object, default: () => ({}) }
660
- },
661
- computed: {
662
- list() {
663
- return (this.$attrs.code && tCode_state.tCodeData[this.$attrs.code]) || this.$attrs.list;
664
- },
665
- values() {
666
- if (!this.$attrs.prop) {
667
- throw new Error(this.$attrs.label + ':prop未定义');
668
- }
669
- const props = this.$attrs.prop.split('.');
670
- return props[1] ? this.form[props[0]] : this.form;
671
- },
672
- keys() {
673
- const props = this.$attrs.prop.split('.');
674
- return props[1] || props[0];
675
- }
676
- }
677
- });
678
-
679
- // CONCATENATED MODULE: ./packages/components/form-item/item/radio.vue?vue&type=script&lang=js&
680
- /* harmony default export */ var item_radiovue_type_script_lang_js_ = (radiovue_type_script_lang_js_);
681
- // CONCATENATED MODULE: ./packages/components/form-item/item/radio.vue
682
-
683
-
684
-
685
-
686
-
687
- /* normalize component */
688
-
689
- var radio_component = Object(componentNormalizer["a" /* default */])(
690
- item_radiovue_type_script_lang_js_,
691
- radiovue_type_template_id_7dc06fd6_render,
692
- radiovue_type_template_id_7dc06fd6_staticRenderFns,
693
- false,
694
- null,
695
- null,
696
- null
697
-
698
- )
699
-
700
- /* harmony default export */ var item_radio = (radio_component.exports);
701
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/select.vue?vue&type=template&id=566ccf4f&
702
- var selectvue_type_template_id_566ccf4f_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-select',_vm._b({staticStyle:{"width":"100%"},attrs:{"placeholder":_vm.placeholder},on:{"change":function($event){(_vm.$attrs.change && _vm.$attrs.change(_vm.form)) || ''}},model:{value:(_vm.values[_vm.keys]),callback:function ($$v) {_vm.$set(_vm.values, _vm.keys, $$v)},expression:"values[keys]"}},'el-select',_vm.$attrs,false),_vm._l((_vm.list),function(item,index){return _c('el-option',{key:'select' + index,attrs:{"label":item[_vm.$attrs.labelKey || _vm.$Config.Components.formItem.label],"value":item[_vm.$attrs.valueKey || _vm.$Config.Components.formItem.value],"disabled":item.disabled}})}),1)
703
- }
704
- var selectvue_type_template_id_566ccf4f_staticRenderFns = []
705
-
706
-
707
- // CONCATENATED MODULE: ./packages/components/form-item/item/select.vue?vue&type=template&id=566ccf4f&
708
-
709
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/select.vue?vue&type=script&lang=js&
710
-
711
-
712
-
713
- /* harmony default export */ var selectvue_type_script_lang_js_ = ({
714
- name: 'ItemSelect',
715
- inheritAttrs: false,
716
- props: {
717
- form: { type: Object, default: () => ({}) }
718
- },
719
- computed: {
720
- list() {
721
- return (this.$attrs.code && tCode_state.tCodeData[this.$attrs.code]) || this.$attrs.list;
722
- },
723
- placeholder() {
724
- return this.$attrs.placeholder || (this.$attrs.noLabel && this.$attrs.label) || '请选择';
725
- },
726
- values() {
727
- if (!this.$attrs.prop) {
728
- throw new Error(this.$attrs.label + ':prop未定义');
729
- }
730
- const props = this.$attrs.prop.split('.');
731
- return props[1] ? this.form[props[0]] : this.form;
732
- },
733
- keys() {
734
- const props = this.$attrs.prop.split('.');
735
- return props[1] || props[0];
736
- }
737
- }
738
- });
739
-
740
- // CONCATENATED MODULE: ./packages/components/form-item/item/select.vue?vue&type=script&lang=js&
741
- /* harmony default export */ var item_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
742
- // CONCATENATED MODULE: ./packages/components/form-item/item/select.vue
743
-
744
-
745
-
746
-
747
-
748
- /* normalize component */
749
-
750
- var select_component = Object(componentNormalizer["a" /* default */])(
751
- item_selectvue_type_script_lang_js_,
752
- selectvue_type_template_id_566ccf4f_render,
753
- selectvue_type_template_id_566ccf4f_staticRenderFns,
754
- false,
755
- null,
756
- null,
757
- null
758
-
759
- )
760
-
761
- /* harmony default export */ var item_select = (select_component.exports);
762
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/switch.vue?vue&type=template&id=051ac3de&
763
- var switchvue_type_template_id_051ac3de_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-switch',_vm._b({on:{"change":function($event){(_vm.$attrs.change && _vm.$attrs.change(_vm.form)) || ''}},model:{value:(_vm.values[_vm.keys]),callback:function ($$v) {_vm.$set(_vm.values, _vm.keys, $$v)},expression:"values[keys]"}},'el-switch',_vm.$attrs,false))
764
- }
765
- var switchvue_type_template_id_051ac3de_staticRenderFns = []
766
-
767
-
768
- // CONCATENATED MODULE: ./packages/components/form-item/item/switch.vue?vue&type=template&id=051ac3de&
769
-
770
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/switch.vue?vue&type=script&lang=js&
771
-
772
- /* harmony default export */ var switchvue_type_script_lang_js_ = ({
773
- inheritAttrs: false,
774
- props: { form: { type: Object, default: () => ({}) } },
775
- computed: {
776
- values() {
777
- if (!this.$attrs.prop) {
778
- throw new Error(this.$attrs.label + ':prop未定义');
779
- }
780
- const props = this.$attrs.prop.split('.');
781
- return props[1] ? this.form[props[0]] : this.form;
782
- },
783
- keys() {
784
- const props = this.$attrs.prop.split('.');
785
- return props[1] || props[0];
786
- }
787
- }
788
- });
789
-
790
- // CONCATENATED MODULE: ./packages/components/form-item/item/switch.vue?vue&type=script&lang=js&
791
- /* harmony default export */ var item_switchvue_type_script_lang_js_ = (switchvue_type_script_lang_js_);
792
- // CONCATENATED MODULE: ./packages/components/form-item/item/switch.vue
793
-
794
-
795
-
796
-
797
-
798
- /* normalize component */
799
-
800
- var switch_component = Object(componentNormalizer["a" /* default */])(
801
- item_switchvue_type_script_lang_js_,
802
- switchvue_type_template_id_051ac3de_render,
803
- switchvue_type_template_id_051ac3de_staticRenderFns,
804
- false,
805
- null,
806
- null,
807
- null
808
-
809
- )
810
-
811
- /* harmony default export */ var item_switch = (switch_component.exports);
812
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/inputNumber.vue?vue&type=template&id=1074373a&scoped=true&
813
- var inputNumbervue_type_template_id_1074373a_scoped_true_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-input-number',_vm._b({attrs:{"placeholder":_vm.placeholder,"controls":false},on:{"change":function($event){(_vm.$attrs.change && _vm.$attrs.change()) || ''},"blur":function($event){(_vm.$attrs.blur && _vm.$attrs.blur()) || ''}},model:{value:(_vm.values[_vm.keys]),callback:function ($$v) {_vm.$set(_vm.values, _vm.keys, (typeof $$v === 'string'? $$v.trim(): $$v))},expression:"values[keys]"}},'el-input-number',_vm.$attrs,false))
814
- }
815
- var inputNumbervue_type_template_id_1074373a_scoped_true_staticRenderFns = []
816
-
817
-
818
- // CONCATENATED MODULE: ./packages/components/form-item/item/inputNumber.vue?vue&type=template&id=1074373a&scoped=true&
819
-
820
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/inputNumber.vue?vue&type=script&lang=js&
821
-
822
- /* harmony default export */ var inputNumbervue_type_script_lang_js_ = ({
823
- name: 'ItemInputNumber',
824
- inheritAttrs: false,
825
- props: {
826
- form: { type: Object, default: () => {} }
827
- },
828
- computed: {
829
- placeholder() {
830
- return this.$attrs.placeholder || (this.$attrs.noLabel && this.$attrs.label) || '请输入';
831
- },
832
- values() {
833
- if (!this.$attrs.prop) {
834
- throw new Error(this.$attrs.label + ':prop未定义');
835
- }
836
- const props = this.$attrs.prop.split('.');
837
- return props[1] ? this.form[props[0]] : this.form;
838
- },
839
- keys() {
840
- const props = this.$attrs.prop.split('.');
841
- return props[1] || props[0];
842
- }
843
- }
844
- });
845
-
846
- // CONCATENATED MODULE: ./packages/components/form-item/item/inputNumber.vue?vue&type=script&lang=js&
847
- /* harmony default export */ var item_inputNumbervue_type_script_lang_js_ = (inputNumbervue_type_script_lang_js_);
848
- // EXTERNAL MODULE: ./packages/components/form-item/item/inputNumber.vue?vue&type=style&index=0&id=1074373a&prod&scoped=true&lang=css&
849
- var inputNumbervue_type_style_index_0_id_1074373a_prod_scoped_true_lang_css_ = __webpack_require__("7110");
850
-
851
- // CONCATENATED MODULE: ./packages/components/form-item/item/inputNumber.vue
852
-
853
-
854
-
855
-
856
-
857
-
858
- /* normalize component */
859
-
860
- var inputNumber_component = Object(componentNormalizer["a" /* default */])(
861
- item_inputNumbervue_type_script_lang_js_,
862
- inputNumbervue_type_template_id_1074373a_scoped_true_render,
863
- inputNumbervue_type_template_id_1074373a_scoped_true_staticRenderFns,
864
- false,
865
- null,
866
- "1074373a",
867
- null
868
-
869
- )
870
-
871
- /* harmony default export */ var inputNumber = (inputNumber_component.exports);
872
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/text.vue?vue&type=template&id=6e4f9dfc&
873
- var textvue_type_template_id_6e4f9dfc_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('el-tooltip',{staticClass:"formItemToolTip",attrs:{"disabled":_vm.disabled,"content":String(_vm.content),"placement":"top"}},[_c('div',{ref:"text",staticClass:"text-overflow-ellipsis"},[_vm._v(" "+_vm._s(_vm.content)+" ")])])],1)
874
- }
875
- var textvue_type_template_id_6e4f9dfc_staticRenderFns = []
876
-
877
-
878
- // CONCATENATED MODULE: ./packages/components/form-item/item/text.vue?vue&type=template&id=6e4f9dfc&
879
-
880
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/item/text.vue?vue&type=script&lang=js&
881
-
882
- /* harmony default export */ var textvue_type_script_lang_js_ = ({
883
- inheritAttrs: false,
884
- props: {
885
- form: { type: Object, default: () => ({}) }
886
- },
887
- data() {
888
- return {
889
- disabled: true
890
- };
891
- },
892
- computed: {
893
- content() {
894
- return (this.$attrs.formatter && this.$attrs.formatter(this.form)) || this.form[this.$attrs.prop] || '------';
895
- }
896
- },
897
- watch: {
898
- content() {
899
- this.$nextTick(() => {
900
- this.disabled = !(this.$refs.text.offsetWidth < this.$refs.text.scrollWidth);
901
- });
902
- }
903
- }
904
- });
905
-
906
- // CONCATENATED MODULE: ./packages/components/form-item/item/text.vue?vue&type=script&lang=js&
907
- /* harmony default export */ var item_textvue_type_script_lang_js_ = (textvue_type_script_lang_js_);
908
- // CONCATENATED MODULE: ./packages/components/form-item/item/text.vue
909
-
910
-
911
-
912
-
913
-
914
- /* normalize component */
915
-
916
- var text_component = Object(componentNormalizer["a" /* default */])(
917
- item_textvue_type_script_lang_js_,
918
- textvue_type_template_id_6e4f9dfc_render,
919
- textvue_type_template_id_6e4f9dfc_staticRenderFns,
920
- false,
921
- null,
922
- null,
923
- null
924
-
925
- )
926
-
927
- /* harmony default export */ var item_text = (text_component.exports);
928
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/form-item/index.vue?vue&type=script&lang=js&
929
-
930
-
931
-
932
-
933
-
934
-
935
-
936
-
937
-
938
-
939
- // import itemUpload from './item/upload';
940
- // TODO: 加入Int组件、 增加dateRanger组件
941
- /* harmony default export */ var form_itemvue_type_script_lang_js_ = ({
942
- name: 'HcFormItem',
943
- // eslint-disable-next-line vue/no-unused-components
944
- components: { itemCheckbox: item_checkbox, itemInput: input, itemRadio: item_radio, itemSelect: item_select, itemSwitch: item_switch, itemDatePicker: datePicker, itemInputNumber: inputNumber, itemText: item_text },
945
- props: {
946
- config: { type: Array, required: true, default: () => [] }, // 配置文件
947
- form: { type: Object, required: true, default: () => {} }, // 传进来的共享的form表单值对象
948
- rules: { type: Object, default: () => ({}) }, // 传进来的共享的form验证规则
949
- column: { type: [Number, String], default: 4, validator: value => [1, 2, 3, 4, 6].indexOf(Number(value)) !== -1 }, // 总的col布局
950
- width: { type: String, default: '100%' }, // 每一项form-item项表单内容宽度
951
- disabled: { type: Boolean, default: false }, // 全局禁用
952
- clearable: { type: Boolean, default: false }, // 全组件带清除功能
953
- sameLabel: { type: Boolean, default: false }, // 每列lable宽度保持统一
954
- rightSide: { type: Boolean, default: false }, // 查询按钮是否放在右侧
955
- noLabel: { type: Boolean, default: false }, // 不显示label
956
- labelWidth: { type: String, default: '' } // label宽度
957
- },
958
- computed: {
959
- realColumn() {
960
- return Number(this.column) || 4;
961
- },
962
- // 整体列数对应的col
963
- colVal() {
964
- return 24 / this.realColumn;
965
- },
966
- realConfig() {
967
- return this.config.filter(e => !e.hidden);
968
- },
969
- rowList() {
970
- // rowList每一行的数据,初始化的时候给一个二维数组,并制定第一个参数为new Array()
971
- const rowList = [new Array(this.realColumn)];
972
- // count用来计算是否换行新增rowList的数组元素空数组,用来填补二维数组空位
973
- // index代表的是rowList的当前操作项的下标
974
- let count = 0,
975
- index = 0;
976
- this.realConfig.forEach((e, i, arr) => {
977
- count += e.span || 1;
978
- rowList[index][count - (e.span || 1)] = { name: e.label, prop: e.prop, index: i, span: e.span || 1 };
979
- if (count + ((arr[i + 1] || {}).span || 1) > this.realColumn && arr[i + 1]) {
980
- rowList.push(new Array(this.realColumn));
981
- index++;
982
- count = 0;
983
- }
984
- });
985
- return rowList;
986
- },
987
- columnLabelWidth() {
988
- // columnList每一列的数据
989
- const columnList = [];
990
- // 行数据转列数据
991
- this.rowList.forEach(e => {
992
- for (let i = 0; i < e.length; i++) {
993
- if (!columnList[i]) columnList[i] = [];
994
- columnList[i].push(e[i]);
995
- }
996
- });
997
- // 取出每一列最大值nameLength
998
- // 取出每一列的index下标
999
- return columnList.map(e => {
1000
- const nameLength = Math.max.apply(
1001
- null,
1002
- e.map(el => (el && this.charCode(el.name).length / 4) || 0)
1003
- );
1004
- let hasRules = false;
1005
- e.map(el => {
1006
- if (el && el.name && this.rules[el.prop] && this.rules[el.prop][0].required) {
1007
- hasRules = true;
1008
- }
1009
- });
1010
- const indexList = e.map(el => el && el.index);
1011
- return { nameLength, indexList, hasRules };
1012
- });
1013
- },
1014
- // 取得每行最后一个元素的下标值(如果占满取最后一个有值的值。否则返回最后一个值)
1015
- lastIndex() {
1016
- // 取出每一行数据中span的和并且和总列数相对比,返回值:"是否相等(Boolean)"
1017
- const columnSpaceFull = this.rowList.map(e => {
1018
- return e.reduce((total, el) => (total += (el && el.span) || 0), 0) === this.realColumn;
1019
- });
1020
- const lenArr = new Array(this.columnLabelWidth[0].indexList.length).fill('');
1021
- // 取出每一行的下标值,如果改行已经占满,那么返回该行最后一个的非undefined的值。否则返回该行最后一个值
1022
- return lenArr.map((e, i) => {
1023
- let newArr = this.columnLabelWidth.map(el => el.indexList[i]);
1024
- // eslint-disable-next-line no-undefined
1025
- newArr = columnSpaceFull[i] ? newArr.filter(newArrE => newArrE !== undefined) : newArr;
1026
- return newArr[newArr.length - 1];
1027
- });
1028
- },
1029
- itemWidth() {
1030
- return function (data, index) {
1031
- if (!this.lastIndex.includes(index)) {
1032
- return `calc(${data.width || this.width} - ${this.$Config.Components.formItem.space})`;
1033
- }
1034
- return data.width || this.width;
1035
- };
1036
- }
1037
- },
1038
- watch: {
1039
- config: {
1040
- handler(val) {
1041
- val.forEach(e => {
1042
- e.code && muta.getListData(this, e.code);
1043
- });
1044
- },
1045
- immediate: true
1046
- }
1047
- },
1048
- methods: {
1049
- // 通过columnLabelWidth获取对应index里面的值
1050
- setWidth(item, index) {
1051
- if (this.noLabel) return '0px';
1052
- if (!this.sameLabel) return this.labelWidth;
1053
- // 增加rules为入参,判断当前项是否有必填校验,如果有那么width加上11px;
1054
- let val = this.columnLabelWidth.find(e => e.indexList.includes(index));
1055
- const rulesWidth = val.hasRules ? 11 : 0;
1056
- return val.nameLength * this.$Config.Components.formItem.labelFontSize + rulesWidth + 16 + 'px';
1057
- },
1058
- // 将字符串转为16进制值,汉子转4位,英文字母和数组转2位
1059
- charCode: str => str.split('').reduce((total, e) => total + e.codePointAt(0).toString(16), '')
1060
- }
1061
- });
1062
-
1063
- // CONCATENATED MODULE: ./packages/components/form-item/index.vue?vue&type=script&lang=js&
1064
- /* harmony default export */ var components_form_itemvue_type_script_lang_js_ = (form_itemvue_type_script_lang_js_);
1065
- // CONCATENATED MODULE: ./packages/components/form-item/index.vue
1066
-
1067
-
1068
-
1069
-
1070
-
1071
- /* normalize component */
1072
-
1073
- var form_item_component = Object(componentNormalizer["a" /* default */])(
1074
- components_form_itemvue_type_script_lang_js_,
1075
- form_itemvue_type_template_id_b87498ee_render,
1076
- form_itemvue_type_template_id_b87498ee_staticRenderFns,
1077
- false,
1078
- null,
1079
- null,
1080
- null
1081
-
1082
- )
1083
-
1084
- /* harmony default export */ var form_item = (form_item_component.exports);
1085
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/identify/index.vue?vue&type=template&id=f49928c4&
1086
- var identifyvue_type_template_id_f49928c4_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"s-canvas cursor-pointer",on:{"click":_vm.refreshCode}},[_c('canvas',{ref:"s-canvas",attrs:{"width":_vm.width,"height":_vm.height}})])
1087
- }
1088
- var identifyvue_type_template_id_f49928c4_staticRenderFns = []
1089
-
1090
-
1091
- // CONCATENATED MODULE: ./packages/components/identify/index.vue?vue&type=template&id=f49928c4&
1092
-
1093
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/identify/index.vue?vue&type=script&lang=js&
1094
-
1095
- /* harmony default export */ var identifyvue_type_script_lang_js_ = ({
1096
- name: 'HcIdentify',
1097
- props: {
1098
- value: { type: String, default: '' },
1099
- codeLength: { type: [String, Number], default: '4' },
1100
- composition: { type: String, default: '1234567890ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' },
1101
- background: { type: String, default: '' },
1102
- dot: { type: Boolean, default: false },
1103
- width: { type: Number, default: 90 },
1104
- height: { type: Number, default: 38 }
1105
- },
1106
- data() {
1107
- return {
1108
- fontSizeMin: 22,
1109
- fontSizeMax: 26,
1110
- backgroundColorMin: 180,
1111
- backgroundColorMax: 240,
1112
- colorMin: 50,
1113
- colorMax: 160,
1114
- lineColorMin: 40,
1115
- lineColorMax: 180,
1116
- dotColorMin: 0,
1117
- dotColorMax: 255
1118
- };
1119
- },
1120
- mounted() {
1121
- this.refreshCode();
1122
- },
1123
- methods: {
1124
- refreshCode() {
1125
- let identifyCode = '';
1126
- for (let i = 0; i < this.codeLength; i++) {
1127
- identifyCode += this.composition[Math.floor(Math.random() * (this.composition.length - 0) + 0)];
1128
- }
1129
- this.drawPic(identifyCode);
1130
- },
1131
- // 生成一个随机数
1132
- randomNum(min, max) {
1133
- return Math.floor(Math.random() * (max - min) + min);
1134
- },
1135
- // 生成一个随机的颜色
1136
- randomColor(min, max) {
1137
- let r = this.randomNum(min, max);
1138
- let g = this.randomNum(min + 50, max);
1139
- let b = this.randomNum(min, max);
1140
- return `rgb(${r},${g},${b})`;
1141
- },
1142
- drawPic(identifyCode) {
1143
- let canvas = this.$refs['s-canvas'];
1144
- let ctx = canvas.getContext('2d');
1145
- ctx.textBaseline = 'bottom';
1146
- // 绘制背景
1147
- ctx.fillStyle = this.background || this.randomColor(this.backgroundColorMin, this.backgroundColorMax);
1148
- ctx.fillRect(0, 0, this.width, this.height);
1149
- // 绘制文字
1150
- for (let i = 0; i < identifyCode.length; i++) {
1151
- this.drawText(ctx, identifyCode[i], i, identifyCode);
1152
- }
1153
- this.dot && this.drawDot(ctx);
1154
- this.$emit('input', identifyCode);
1155
- },
1156
- drawText(ctx, txt, i, identifyCode) {
1157
- ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax);
1158
- ctx.font = this.randomNum(this.fontSizeMin, this.fontSizeMax) + 'px SimHei';
1159
- let x = (i + 1) * (this.width / (identifyCode.length + 1));
1160
- if (i > 1) {
1161
- x += Number(i);
1162
- }
1163
- let y = this.randomNum(this.fontSizeMax, this.height - 5);
1164
- var deg = this.randomNum(-45, 45);
1165
- // 修改坐标原点和旋转角度
1166
- ctx.translate(x, y);
1167
- ctx.rotate((deg * Math.PI) / 180);
1168
- ctx.fillText(txt, 0, 0);
1169
- // 恢复坐标原点和旋转角度
1170
- ctx.rotate((-deg * Math.PI) / 180);
1171
- ctx.translate(-x, -y);
1172
- },
1173
- drawDot(ctx) {
1174
- // 绘制干扰点
1175
- for (let i = 0; i < 100; i++) {
1176
- ctx.fillStyle = this.randomColor(0, 255);
1177
- ctx.beginPath();
1178
- ctx.arc(this.randomNum(0, this.width), this.randomNum(0, this.height), 1, 0, 2 * Math.PI);
1179
- ctx.fill();
1180
- }
1181
- }
1182
- }
1183
- });
1184
-
1185
- // CONCATENATED MODULE: ./packages/components/identify/index.vue?vue&type=script&lang=js&
1186
- /* harmony default export */ var components_identifyvue_type_script_lang_js_ = (identifyvue_type_script_lang_js_);
1187
- // CONCATENATED MODULE: ./packages/components/identify/index.vue
1188
-
1189
-
1190
-
1191
-
1192
-
1193
- /* normalize component */
1194
-
1195
- var identify_component = Object(componentNormalizer["a" /* default */])(
1196
- components_identifyvue_type_script_lang_js_,
1197
- identifyvue_type_template_id_f49928c4_render,
1198
- identifyvue_type_template_id_f49928c4_staticRenderFns,
1199
- false,
1200
- null,
1201
- null,
1202
- null
1203
-
1204
- )
1205
-
1206
- /* harmony default export */ var identify = (identify_component.exports);
1207
- // CONCATENATED MODULE: ./packages/components/identify/index.js
1208
-
1209
-
1210
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/pager/index.vue?vue&type=template&id=8ddb135c&
1211
- var pagervue_type_template_id_8ddb135c_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-pagination',_vm._g(_vm._b({attrs:{"current-page":_vm.pager[_vm.$Config.Components.pager.currentPage],"page-size":_vm.pager[_vm.$Config.Components.pager.pageSize],"layout":_vm.layout || _vm.$Config.Components.pager.layout},on:{"size-change":_vm.$onSizeChange,"current-change":_vm.$onCurrentChange}},'el-pagination',_vm.$attrs,false),_vm.$listeners))
1212
- }
1213
- var pagervue_type_template_id_8ddb135c_staticRenderFns = []
1214
-
1215
-
1216
- // CONCATENATED MODULE: ./packages/components/pager/index.vue?vue&type=template&id=8ddb135c&
1217
-
1218
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/pager/index.vue?vue&type=script&lang=js&
1219
-
1220
- /* harmony default export */ var pagervue_type_script_lang_js_ = ({
1221
- name: 'HcPager',
1222
- props: {
1223
- page: { type: Object, default: () => {}, required: true },
1224
- layout: { type: String, default: '' }
1225
- },
1226
- data() {
1227
- return {
1228
- pager: {}
1229
- };
1230
- },
1231
- watch: {
1232
- page: {
1233
- handler(val) {
1234
- this.pager = val;
1235
- },
1236
- immediate: true
1237
- }
1238
- },
1239
- methods: {
1240
- // 分页
1241
- $onSizeChange(val) {
1242
- this.pager[this.$Config.Components.pager.pageSize] = val;
1243
- this.pager[this.$Config.Components.pager.currentPage] = 1;
1244
- this.$emit('change', this.pager);
1245
- },
1246
- $onCurrentChange(val) {
1247
- this.pager[this.$Config.Components.pager.currentPage] = val;
1248
- this.$emit('change', this.pager);
1249
- }
1250
- }
1251
- });
1252
-
1253
- // CONCATENATED MODULE: ./packages/components/pager/index.vue?vue&type=script&lang=js&
1254
- /* harmony default export */ var components_pagervue_type_script_lang_js_ = (pagervue_type_script_lang_js_);
1255
- // CONCATENATED MODULE: ./packages/components/pager/index.vue
1256
-
1257
-
1258
-
1259
-
1260
-
1261
- /* normalize component */
1262
-
1263
- var pager_component = Object(componentNormalizer["a" /* default */])(
1264
- components_pagervue_type_script_lang_js_,
1265
- pagervue_type_template_id_8ddb135c_render,
1266
- pagervue_type_template_id_8ddb135c_staticRenderFns,
1267
- false,
1268
- null,
1269
- null,
1270
- null
1271
-
1272
- )
1273
-
1274
- /* harmony default export */ var pager = (pager_component.exports);
1275
- // CONCATENATED MODULE: ./packages/components/pager/index.js
1276
-
1277
-
1278
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/popover/index.vue?vue&type=template&id=02cfbb04&
1279
- var popovervue_type_template_id_02cfbb04_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-popover',_vm._g(_vm._b({attrs:{"placement":_vm.placement,"width":_vm.width},model:{value:(_vm.visible),callback:function ($$v) {_vm.visible=$$v},expression:"visible"}},'el-popover',_vm.$attrs,false),_vm.$listeners),[_c('div',{staticClass:"flex-y-center"},[_c('i',{staticClass:"mr-8",class:[_vm.icon, _vm.className]}),_vm._v(" "+_vm._s(_vm.title)+" ")]),_c('div',{staticClass:"flex-x-end mt-8"},[_c('el-button',{attrs:{"size":"mini","type":"text"},on:{"click":function($event){_vm.visible = false}}},[_vm._v(" 取消 ")]),_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":_vm.onsubmit}},[_vm._v(" 确定 ")])],1),_vm._t("default",function(){return [_vm._v(" 删除 ")]},{"slot":"reference"})],2)
1280
- }
1281
- var popovervue_type_template_id_02cfbb04_staticRenderFns = []
1282
-
1283
-
1284
- // CONCATENATED MODULE: ./packages/components/popover/index.vue?vue&type=template&id=02cfbb04&
1285
-
1286
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/popover/index.vue?vue&type=script&lang=js&
1287
-
1288
- /* harmony default export */ var popovervue_type_script_lang_js_ = ({
1289
- props: {
1290
- title: { type: String, default: '' },
1291
- width: { type: String, default: '200' },
1292
- placement: { type: String, default: 'top-end' },
1293
- icon: { type: String, default: 'el-icon-warning-outline' },
1294
- className: { type: String, default: 'color-warning text-20' }
1295
- },
1296
- data() {
1297
- return {
1298
- visible: false
1299
- };
1300
- },
1301
- methods: {
1302
- onsubmit() {
1303
- this.$emit('submit');
1304
- this.visible = false;
1305
- }
1306
- }
1307
- });
1308
-
1309
- // CONCATENATED MODULE: ./packages/components/popover/index.vue?vue&type=script&lang=js&
1310
- /* harmony default export */ var components_popovervue_type_script_lang_js_ = (popovervue_type_script_lang_js_);
1311
- // CONCATENATED MODULE: ./packages/components/popover/index.vue
1312
-
1313
-
1314
-
1315
-
1316
-
1317
- /* normalize component */
1318
-
1319
- var popover_component = Object(componentNormalizer["a" /* default */])(
1320
- components_popovervue_type_script_lang_js_,
1321
- popovervue_type_template_id_02cfbb04_render,
1322
- popovervue_type_template_id_02cfbb04_staticRenderFns,
1323
- false,
1324
- null,
1325
- null,
1326
- null
1327
-
1328
- )
1329
-
1330
- /* harmony default export */ var popover = (popover_component.exports);
1331
- // CONCATENATED MODULE: ./packages/components/popover/index.js
1332
-
1333
-
1334
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tab/index.vue?vue&type=template&id=09d8bad6&
1335
- var tabvue_type_template_id_09d8bad6_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"hcTab",style:({ height: _vm.outLayerHeight })},[_c('el-tabs',_vm._g(_vm._b({staticClass:"bg-default",model:{value:(_vm.activeVal),callback:function ($$v) {_vm.activeVal=$$v},expression:"activeVal"}},'el-tabs',_vm.$attrs,false),_vm.$listeners),_vm._l((_vm.tabsData),function(item,index){return _c('el-tab-pane',{key:'tabs' + index,attrs:{"label":item.name,"name":item.src}})}),1),_vm._l((_vm.tabsData),function(item,index){return _c('div',{directives:[{name:"show",rawName:"v-show",value:(item.src === _vm.activeVal),expression:"item.src === activeVal"}],key:'com' + index,staticClass:"overflow-auto width-100 tab-content",class:'hcTabPane' + index,style:({ height: _vm.maxHeight })},[(item.isNew)?_c(item.component,_vm._g(_vm._b({tag:"components"},'components',_vm.$attrs,false),_vm.$listeners)):_vm._e()],1)})],2)
1336
- }
1337
- var tabvue_type_template_id_09d8bad6_staticRenderFns = []
1338
-
1339
-
1340
- // CONCATENATED MODULE: ./packages/components/tab/index.vue?vue&type=template&id=09d8bad6&
1341
-
1342
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tab/index.vue?vue&type=script&lang=js&
1343
-
1344
- /* harmony default export */ var tabvue_type_script_lang_js_ = ({
1345
- name: 'HcTab',
1346
- inheritAttrs: false,
1347
- props: {
1348
- // demo: [{src: 'demo1', name: 'tabs1', isNew: true, component: demo1}]
1349
- tabsData: { type: Array, default: () => [] },
1350
- outHeight: { type: Number, default: 0 },
1351
- active: { type: String, default: '' }
1352
- },
1353
- data() {
1354
- return {
1355
- activeVal: this.active || this.tabsData[0].src
1356
- };
1357
- },
1358
- computed: {
1359
- outLayerHeight() {
1360
- return this.outHeight ? `calc(100% - ${this.outHeight}px)` : '';
1361
- },
1362
- maxHeight() {
1363
- return this.outHeight ? 'calc(100% - 39px)' : '';
1364
- }
1365
- },
1366
- watch: {
1367
- activeVal(val) {
1368
- for (let i = 0; i < this.tabsData.length; i++) {
1369
- if (val === this.tabsData[i].src) {
1370
- this.$emit('change', this.tabsData[i]);
1371
- this.tabsData[i].isNew = true;
1372
- return false;
1373
- }
1374
- }
1375
- }
1376
- }
1377
- });
1378
-
1379
- // CONCATENATED MODULE: ./packages/components/tab/index.vue?vue&type=script&lang=js&
1380
- /* harmony default export */ var components_tabvue_type_script_lang_js_ = (tabvue_type_script_lang_js_);
1381
- // CONCATENATED MODULE: ./packages/components/tab/index.vue
1382
-
1383
-
1384
-
1385
-
1386
-
1387
- /* normalize component */
1388
-
1389
- var tab_component = Object(componentNormalizer["a" /* default */])(
1390
- components_tabvue_type_script_lang_js_,
1391
- tabvue_type_template_id_09d8bad6_render,
1392
- tabvue_type_template_id_09d8bad6_staticRenderFns,
1393
- false,
1394
- null,
1395
- null,
1396
- null
1397
-
1398
- )
1399
-
1400
- /* harmony default export */ var tab = (tab_component.exports);
1401
- // CONCATENATED MODULE: ./packages/components/tab/index.js
1402
-
1403
-
1404
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/table/index.vue?vue&type=template&id=62191d95&
1405
- var tablevue_type_template_id_62191d95_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-table',_vm._g(_vm._b({directives:[{name:"watermark",rawName:"v-watermark",value:({ title: _vm.$Config.directives.watermark.title, subTitle: _vm.$Config.directives.watermark.subTitle }),expression:"{ title: $Config.directives.watermark.title, subTitle: $Config.directives.watermark.subTitle }"}],ref:"multipleTable",staticClass:"com",staticStyle:{"width":"100%"},attrs:{"data":_vm.tableData,"cell-class-name":_vm.cellConfigSet},on:{"select":_vm.$comSelect,"select-all":_vm.$comSelect},scopedSlots:_vm._u([{key:"empty",fn:function(){return [_c('img',{staticClass:"my-24",attrs:{"src":_vm.$Config.Components.table.noData,"alt":""}})]},proxy:true}])},'el-table',_vm.$attrs,false),_vm.$listeners),[(_vm.checkbox)?_c('el-table-column',{attrs:{"fixed":_vm.showFixed,"reserve-selection":_vm.reserveSelection,"type":"selection","width":"44"}}):_vm._e(),(_vm.expand)?_c('el-table-column',{attrs:{"fixed":_vm.showFixed,"type":"expand","width":"44"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_vm._t("expand",null,null,scope)]}}],null,true)}):_vm._e(),_vm._l((_vm.column),function(item,index){return _c('el-table-column',_vm._b({key:'otable' + index,class:item.code,attrs:{"formatter":item.code ? _vm.setFormatData(item) : item.formatter,"fixed":_vm.showFixed && item.fixed,"show-overflow-tooltip":!item['hidden-overflow-tooltip']},scopedSlots:_vm._u([(_vm.isShowHeader(item.prop))?{key:"header",fn:function(scope){return [_vm._t(item.prop + 'Header',null,null,scope)]}}:null,(_vm.isShowSlots(item.prop))?{key:"default",fn:function(scope){return [_vm._t(item.prop,null,null,scope)]}}:null],null,true)},'el-table-column',{ ...item },false),_vm._l((item.children),function(items,indexs){return (item.children)?_c('childTable',{key:'otables' + indexs,attrs:{"data":items,"show-slots":_vm.showSlots},scopedSlots:_vm._u([_vm._l((_vm.showSlots),function(slotName,slotIndex){return {key:slotName,fn:function(scope){return [_c('div',{key:slotIndex + 'slotName'},[_vm._t(slotName,null,null,scope)],2)]}}})],null,true)}):_vm._e()}),1)}),(_vm.operationWidth !== 'auto')?_c('el-table-column',{attrs:{"fixed":_vm.showFixed ? 'right' : false,"label":_vm.$Config.Components.table.optionLabel,"width":_vm.operationWidth},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_vm._t("default",null,null,scope)]}}],null,true)}):_vm._e()],2)
1406
- }
1407
- var tablevue_type_template_id_62191d95_staticRenderFns = []
1408
-
1409
-
1410
- // CONCATENATED MODULE: ./packages/components/table/index.vue?vue&type=template&id=62191d95&
1411
-
1412
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/table/childTable/index.vue?vue&type=template&id=0587b934&
1413
- var childTablevue_type_template_id_0587b934_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-table-column',_vm._b({attrs:{"show-overflow-tooltip":!_vm.data['hidden-overflow-tooltip']},scopedSlots:_vm._u([(_vm.showSlots.includes(_vm.data.prop))?{key:"default",fn:function(scope){return [_vm._t(_vm.data.prop,null,null,scope)]}}:null],null,true)},'el-table-column',{ ..._vm.data },false),_vm._l((_vm.data.children),function(item,index){return (_vm.data.children)?_c('childTable',{key:'otables' + index,attrs:{"data":item,"show-slots":_vm.showSlots},scopedSlots:_vm._u([_vm._l((_vm.showSlots),function(slotName,slotIndex){return {key:slotName,fn:function(scope){return [_c('div',{key:slotIndex + 'slotName'},[_vm._t(slotName,null,null,scope)],2)]}}})],null,true)}):_vm._e()}),1)
1414
- }
1415
- var childTablevue_type_template_id_0587b934_staticRenderFns = []
1416
-
1417
-
1418
- // CONCATENATED MODULE: ./packages/components/table/childTable/index.vue?vue&type=template&id=0587b934&
1419
-
1420
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/table/childTable/index.vue?vue&type=script&lang=js&
1421
-
1422
- /* harmony default export */ var childTablevue_type_script_lang_js_ = ({
1423
- name: 'ChildTable',
1424
- props: {
1425
- data: { type: Object, default: () => ({}) },
1426
- showSlots: { type: Array, default: () => [] }
1427
- }
1428
- });
1429
-
1430
- // CONCATENATED MODULE: ./packages/components/table/childTable/index.vue?vue&type=script&lang=js&
1431
- /* harmony default export */ var table_childTablevue_type_script_lang_js_ = (childTablevue_type_script_lang_js_);
1432
- // CONCATENATED MODULE: ./packages/components/table/childTable/index.vue
1433
-
1434
-
1435
-
1436
-
1437
-
1438
- /* normalize component */
1439
-
1440
- var childTable_component = Object(componentNormalizer["a" /* default */])(
1441
- table_childTablevue_type_script_lang_js_,
1442
- childTablevue_type_template_id_0587b934_render,
1443
- childTablevue_type_template_id_0587b934_staticRenderFns,
1444
- false,
1445
- null,
1446
- null,
1447
- null
1448
-
1449
- )
1450
-
1451
- /* harmony default export */ var childTable = (childTable_component.exports);
1452
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/table/index.vue?vue&type=script&lang=js&
1453
-
1454
-
1455
-
1456
- /* harmony default export */ var tablevue_type_script_lang_js_ = ({
1457
- name: 'HcTable',
1458
- components: { childTable: childTable },
1459
- props: {
1460
- // 表单数据
1461
- data: { type: Array, required: true, default: () => [] },
1462
- // 表单列内容
1463
- column: { type: Array, required: true, default: () => [] },
1464
- // 是否具备展开列
1465
- expand: { type: Boolean, default: false },
1466
- showFixed: { type: Boolean, default: false },
1467
- // 是否展示checkbox
1468
- checkbox: { type: Boolean, default: false },
1469
- // 数据更新之后保留之前选中的数据(需指定 row-key)
1470
- reserveSelection: { type: Boolean, default: false },
1471
- // check回显数据
1472
- checkData: { type: Array, default: () => [] },
1473
- // 样式设置回调函数,返回参数为cell数据
1474
- // 通过闭包的形式返回函数,用户传入cellConfig: {a: 'color-default'}
1475
- // eslint-disable-next-line vue/require-default-prop
1476
- cellConfig: { type: Object },
1477
- // eslint-disable-next-line vue/require-default-prop
1478
- cellClassName: { type: Function },
1479
- // 设置操作项宽度
1480
- operationWidth: { type: String, default: 'auto' },
1481
- showHeaders: { type: Array, default: () => [] }
1482
- },
1483
- data() {
1484
- return {};
1485
- },
1486
- computed: {
1487
- showSlots() {
1488
- const result = [];
1489
- this.getSlots(this.column, result);
1490
- return result;
1491
- },
1492
- tableData() {
1493
- return this.data;
1494
- }
1495
- },
1496
- watch: {
1497
- column: {
1498
- handler(val) {
1499
- val.forEach(e => {
1500
- // e.code && this.getListData(e.code);
1501
- e.code && muta.getListData(this, e.code);
1502
- this.codeMap(e);
1503
- });
1504
- },
1505
- immediate: true
1506
- },
1507
- tableData() {
1508
- this.$nextTick(this.setCheckboxData());
1509
- }
1510
- },
1511
- mounted() {
1512
- this.setCheckboxData();
1513
- },
1514
- methods: {
1515
- codeMap(data) {
1516
- if (data.children) {
1517
- data.children.forEach(e => {
1518
- e.code && muta.getListData(this, e.code);
1519
- this.codeMap(e);
1520
- });
1521
- }
1522
- },
1523
- // 将选中的状态值抛出去接收
1524
- $comSelect(selectData) {
1525
- if (!this.checkbox) return false;
1526
- this.$emit('on-select', selectData);
1527
- },
1528
- isShowSlots(val) {
1529
- return this.showSlots.includes(val);
1530
- },
1531
- isShowHeader(val) {
1532
- let bool = false;
1533
- this.showHeaders.map(e => {
1534
- if (e.includes(val)) {
1535
- bool = true;
1536
- return false;
1537
- }
1538
- });
1539
- return bool;
1540
- },
1541
- cellConfigSet(data) {
1542
- const config = this.cellConfig;
1543
- if (this.cellClassName) {
1544
- return this.cellClassName(data);
1545
- }
1546
- if (!config) return;
1547
- if (Object.keys(config).includes(data.column.property)) {
1548
- return config[data.column.property][data.row[data.column.property]];
1549
- }
1550
- },
1551
- setFormatData(data) {
1552
- const that = this;
1553
- return function (row) {
1554
- const result = (tCode_state.tCodeData[data.code] || []).find(e => row[data.prop] === e[that.$Config.Components.formItem.value]) || {};
1555
- return result[that.$Config.Components.formItem.label] || row[data.prop];
1556
- };
1557
- },
1558
- getSlots(data, result = []) {
1559
- data.forEach(e => {
1560
- e.isSlot && result.push(e.prop);
1561
- e.children && this.getSlots(e.children, result);
1562
- });
1563
- },
1564
- setCheckboxData() {
1565
- const that = this;
1566
- // 表格勾选数据回显
1567
- if (this.checkbox && this.checkData.length > 0) {
1568
- this.checkData.forEach(e => {
1569
- that.$refs.multipleTable.toggleRowSelection(e);
1570
- });
1571
- } else {
1572
- this.$refs.multipleTable.clearSelection();
1573
- }
1574
- }
1575
- }
1576
- });
1577
-
1578
- // CONCATENATED MODULE: ./packages/components/table/index.vue?vue&type=script&lang=js&
1579
- /* harmony default export */ var components_tablevue_type_script_lang_js_ = (tablevue_type_script_lang_js_);
1580
- // CONCATENATED MODULE: ./packages/components/table/index.vue
1581
-
1582
-
1583
-
1584
-
1585
-
1586
- /* normalize component */
1587
-
1588
- var table_component = Object(componentNormalizer["a" /* default */])(
1589
- components_tablevue_type_script_lang_js_,
1590
- tablevue_type_template_id_62191d95_render,
1591
- tablevue_type_template_id_62191d95_staticRenderFns,
1592
- false,
1593
- null,
1594
- null,
1595
- null
1596
-
1597
- )
1598
-
1599
- /* harmony default export */ var table = (table_component.exports);
1600
- // CONCATENATED MODULE: ./packages/components/table/index.js
1601
-
1602
-
1603
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/frame/index.vue?vue&type=template&id=1dcf1c1c&
1604
- var framevue_type_template_id_1dcf1c1c_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"absolute-all hc-frame d-flex"},[(_vm.menu)?_c('div',{staticClass:"animate-width h-100 hcMenu",style:({ width: _vm.menuWidth + 'px' })},[_c('div',{style:({ height: _vm.config.height.logo + 'px' })},[_vm._t("logo")],2),_c('com-menu',_vm._b({staticClass:"overflow-auto noScroll hcMenu",style:({ height: `calc(100% - ${_vm.config.height.logo + _vm.config.height.footer}px)` }),attrs:{"collapse":_vm.collapse}},'com-menu',_vm.$attrs,false)),_c('div',{style:({ height: _vm.config.height.footer + 'px' })},[_vm._t("footer")],2)],1):_vm._e(),_c('div',{staticClass:"relative overflow-hidden animate-width h-100 contentMaxs",style:({ width: `calc(100% - ${_vm.menu ? _vm.menuWidth : 0}px)` })},[(_vm.config.height.header)?_c('div',{style:({ height: _vm.config.height.header + 'px' })},[_vm._t("nav")],2):_vm._e(),(_vm.config.height.tabs)?_c('div',{style:({ height: _vm.config.height.tabs + 'px' })},[_c('com-tabs',_vm._g(_vm._b({ref:"hcMenuTabs",staticClass:"pl-24 hcTabs"},'com-tabs',_vm.$attrs,false),_vm.$listeners))],1):_vm._e(),_c('div',{staticClass:"overflow-auto relative pl-20",style:({ height: `calc(100% - ${_vm.config.height.header + _vm.config.height.tabs}px)` })},[_vm._t("default")],2)])])
1605
- }
1606
- var framevue_type_template_id_1dcf1c1c_staticRenderFns = []
1607
-
1608
-
1609
- // CONCATENATED MODULE: ./packages/components/frame/index.vue?vue&type=template&id=1dcf1c1c&
1610
-
1611
- // CONCATENATED MODULE: ./packages/utils/func/obj.js
1612
- const deepMerge = (first, second) => {
1613
- for (let key in second) {
1614
- // 如果target(也就是first[key])存在,且是对象的话再去调用deepMerge,否则就是first[key]里面没这个对象,需要与second[key]合并
1615
- first[key] = first[key] && first[key].toString() === '[object Object]' ? deepMerge(first[key], second[key]) : (first[key] = second[key]);
1616
- }
1617
- return first;
1618
- };
1619
- /* harmony default export */ var obj = ({
1620
- deepMerge
1621
- });
1622
-
1623
- // CONCATENATED MODULE: ./packages/utils/func/arr.js
1624
- // 深度克隆
1625
-
1626
-
1627
- const cloneDeep = target => JSON.parse(JSON.stringify(target));
1628
-
1629
- //排除数组某些项
1630
- const filterOptionArray = (arr, keys) => {
1631
- return arr.map(e => {
1632
- const newArrOne = {};
1633
- Object.keys(e).forEach(key => {
1634
- !keys.split(',').includes(key) && (newArrOne[key] = e[key]);
1635
- });
1636
- return newArrOne;
1637
- });
1638
- };
1639
-
1640
- // 数组扁平化,避免用flat;flat的IE11不兼容和谷歌版本52或以下不兼容
1641
- const flatten = arr => {
1642
- while (arr.some(item => Array.isArray(item))) {
1643
- arr = [].concat(...arr);
1644
- }
1645
- return arr;
1646
- };
1647
-
1648
- // 统计元素在数组中出现的次数
1649
- const getEleCount = (obj, ele) => {
1650
- const count = {};
1651
- if (isArray(ele)) {
1652
- ele.forEach(es => {
1653
- count[es] = obj.reduce((total, e) => (es === e ? total + 1 : total + 0), 0);
1654
- });
1655
- return count;
1656
- }
1657
- return obj.reduce((total, e) => (ele === e ? total + 1 : total + 0), 0);
1658
- };
1659
-
1660
- // 判断是否为数组
1661
- const isArray = arr => {
1662
- return Object.prototype.toString.call(arr) === '[object Array]';
1663
- };
1664
-
1665
- // 判断数组是否为[]
1666
- const isEmptyArray = arr => {
1667
- return Object.prototype.toString.call(arr) === '[object Array]' && arr.length === 0;
1668
- };
1669
-
1670
- // 判断数组是否相等
1671
- const isEqual = (arr1, arr2) => {
1672
- return arr1.length === arr2.length && !arr1.find((e, i) => JSON.stringify(e) !== JSON.stringify(arr2[i]));
1673
- };
1674
-
1675
- // 数组中对象元素去重,第一个参数为数组,第二个为去重对象的key
1676
- const repeatObjEle = (arr, key) => {
1677
- const [result, hash] = [[], {}];
1678
- for (let i = 0; i < arr.length; i++) {
1679
- const elem = arr[i][key];
1680
- if (!hash[elem]) {
1681
- result.push(arr[i]);
1682
- hash[elem] = true;
1683
- }
1684
- }
1685
- return result;
1686
- };
1687
-
1688
- // 去掉两个数组的相同项
1689
- const unSet = (arr1, arr2) => {
1690
- // eslint-disable-next-line no-undef
1691
- const [set1, set2, subset] = [new Set(arr1), new Set(arr2), []];
1692
- for (let item of set1) {
1693
- if (!set2.has(item)) {
1694
- subset.push(item);
1695
- } else {
1696
- set1.delete(item);
1697
- set2.delete(item);
1698
- }
1699
- }
1700
- for (let item of set2) {
1701
- if (!set1.has(item)) {
1702
- subset.push(item);
1703
- }
1704
- }
1705
- return subset;
1706
- };
1707
- const listToTree = (list, config = { id: 'id', parentId: 'parentId', children: 'children' }) => {
1708
- const configs = obj.deepMerge({ id: 'id', parentId: 'parentId', children: 'children' }, config);
1709
- const menuObj = {},
1710
- emptyEnum = ['', undefined, null];
1711
- const { id, parentId, children } = configs;
1712
- list.forEach(item => {
1713
- item[children] = [];
1714
- menuObj[item[id]] = item;
1715
- });
1716
- return list.filter(item => {
1717
- if (!emptyEnum.includes(item[parentId]) && menuObj[item[parentId]]) {
1718
- menuObj[item[parentId]][children].push(item);
1719
- return false;
1720
- }
1721
- return true;
1722
- });
1723
- };
1724
-
1725
- const treeToList = (list, config = { id: 'id', parentId: 'parentId', children: 'children' }) => {
1726
- const configs = obj.deepMerge({ id: 'id', parentId: 'parentId', children: 'children' }, config);
1727
- let result = []; // 用于存储递归结果(扁平数据)
1728
- // 递归函数
1729
- let fn = source => {
1730
- source.forEach(item => {
1731
- result.push(item);
1732
- item[configs.children] && item[configs.children].length > 0 ? fn(item[configs.children]) : ''; // 子级递归
1733
- });
1734
- };
1735
- fn(list);
1736
- return result;
1737
- };
1738
-
1739
- /* harmony default export */ var arr = ({
1740
- cloneDeep,
1741
- filterOptionArray,
1742
- flatten,
1743
- getEleCount,
1744
- isArray,
1745
- isEmptyArray,
1746
- isEqual,
1747
- repeatObjEle,
1748
- listToTree,
1749
- treeToList,
1750
- unSet
1751
- });
1752
-
1753
- // CONCATENATED MODULE: ./packages/utils/func/browserCache.js
1754
- // 删除 cookie
1755
- const delCookie = name => {
1756
- setCookie(name, '', '-1');
1757
- // 通过建立 cookie 的时间设置,将时间设置提前一天,从而强行让 cookie 失效,最后达到 删除cookie 的目的
1758
- };
1759
-
1760
- // 取cookie
1761
- const getCookie = name => {
1762
- let cookieArr = document.cookie.split(';');
1763
- for (let i = 0; i < cookieArr.length; i++) {
1764
- let arr = cookieArr[i].split('=');
1765
- if (name === arr[0]) {
1766
- return arr[1];
1767
- }
1768
- }
1769
- return false;
1770
- };
1771
-
1772
- // 存cookie
1773
- const setCookie = (name, value, times) => {
1774
- const date = new Date();
1775
- date.setDate(date.getDate() + times);
1776
- document.cookie = name + '=' + value + ';expires=' + date;
1777
- };
1778
- const addStorgeValue = (key, data, type = 'localStorage') => {
1779
- var newStorageEvent = document.createEvent('StorageEvent');
1780
- const storage = {
1781
- setItem: function (k, val) {
1782
- if (type === 'localStorage') {
1783
- window && window.localStorage.setItem(k, val);
1784
- } else {
1785
- window && window.sessionStorage.setItem(k, val);
1786
- }
1787
- newStorageEvent.initStorageEvent('setItem', false, false, k, null, val, null, null);
1788
- window && window.dispatchEvent(newStorageEvent);
1789
- }
1790
- };
1791
- return storage.setItem(key, data);
1792
- };
1793
- /* harmony default export */ var browserCache = ({
1794
- cookie: {
1795
- del: delCookie,
1796
- get: getCookie,
1797
- set: setCookie
1798
- },
1799
- addStorgeValue
1800
- });
1801
-
1802
- // CONCATENATED MODULE: ./packages/utils/func/date.js
1803
- /**
1804
- * getDate: 获取时间
1805
- * params:
1806
- * connect: 年份连接线 default value: '-'
1807
- * type: 日期类型
1808
- * 可选值: date: 返回所有日期内容
1809
- * day: 仅返回年月日*/
1810
- const getDate = (time, connect = '-', type = 'date') => {
1811
- let date = new Date(time);
1812
- const year = date.getFullYear();
1813
- const month = String(date.getMonth() + 1).padStart(2, 0);
1814
- const day = String(date.getDate()).padStart(2, 0);
1815
- const hours = String(date.getHours()).padStart(2, 0);
1816
- const minutes = String(date.getMinutes()).padStart(2, 0);
1817
- const seconds = String(date.getSeconds()).padStart(2, 0);
1818
- return type === 'date' ? `${year}${connect}${month}${connect}${day} ${hours}:${minutes}:${seconds}` : `${year}${connect}${month}${connect}${day}`;
1819
- };
1820
- /* harmony default export */ var date = ({ getDate });
1821
-
1822
- // CONCATENATED MODULE: ./packages/utils/func/theme.js
1823
- const setTheme = ({ functional = {}, text = {}, border = {}, other = {}, shadow }) => {
1824
- validParams(functional, 'functional');
1825
- validParams(text, 'text');
1826
- validParams(border, 'border');
1827
- const functionalValue = { ...{ primary: '#409eff', success: '#67c23a', info: '#909399', warning: '#e6a23c', danger: '#f56c6c' }, ...functional };
1828
- const textValue = { ...{ primary: '#303133', regular: '#606266', secondary: '#909399', placeholder: '#c0c4cc' }, ...text };
1829
- const borderValue = { ...{ base: '#dcdfe6', light: '#e4e7ed', lighter: '#ebeef5', extraLight: '#f2f6fc' }, ...border };
1830
- const otherValue = { ...other };
1831
- const shadowValue = shadow || '#000000';
1832
- const themeStyleResult = {};
1833
- setFunctional(functionalValue, themeStyleResult);
1834
- setColor(textValue, 'text', themeStyleResult);
1835
- setColor(borderValue, 'border', themeStyleResult);
1836
- setColor(otherValue, 'other', themeStyleResult);
1837
- setShadow(shadowValue, themeStyleResult);
1838
- addStyle(themeStyleResult);
1839
- };
1840
- const validParams = (data, type) => {
1841
- const validValue = {
1842
- functional: ['primary', 'success', 'info', 'warning', 'danger'],
1843
- text: ['primary', 'regular', 'secondary', 'placeholder', 'danger'],
1844
- border: ['base', 'light', 'lighter', 'extraLight']
1845
- };
1846
- for (let key in data) {
1847
- if (!validValue[type].includes(key)) {
1848
- throw `Function setTheme: 参数${type}错误,不在'${validValue[type].join('、')}'范围内`;
1849
- }
1850
- }
1851
- return true;
1852
- };
1853
- const addStyle = data => {
1854
- document.getElementById('hc-theme-style') && document.getElementById('hc-theme-style').remove();
1855
- const style = document.createElement('style');
1856
- style.type = 'text/css';
1857
- style.id = 'hc-theme-style';
1858
- let innerHTML = 'body{';
1859
- for (let key in data) {
1860
- innerHTML += `${key}:${data[key]};`;
1861
- }
1862
- style.innerHTML = innerHTML + '}';
1863
- window.document.head.insertBefore(style, window.document.head.childNodes[0]);
1864
- };
1865
- const setFunctional = (data, result) => {
1866
- for (let key in data) {
1867
- const transList = [100, 95, 90, 85, 80, 50, 40, 20, 10, 5];
1868
- transList.forEach(e => {
1869
- const name = `--color-${key}${e === 100 ? '' : '-' + e}`;
1870
- result[name] = mixs(data[key], e);
1871
- });
1872
- }
1873
- };
1874
- const setColor = (data, type = 'text', result) => {
1875
- for (let key in data) {
1876
- const name = `--color-${type}-${key}`;
1877
- result[name] = data[key];
1878
- }
1879
- };
1880
- const setShadow = (data, result) => {
1881
- const transList = [90, 80, 70, 60, 50, 40, 30, 20, 10, 5];
1882
- transList.forEach(e => {
1883
- const name = `--shadow-${e}`;
1884
- result[name] = mixs(data, e);
1885
- });
1886
- };
1887
- const mixs = (color1, weight = 100) => {
1888
- let color = 'rgb(';
1889
- for (let i = 1; i <= 5; i += 2) {
1890
- color += parseInt(color1.substr(i, 2), 16) + ',';
1891
- }
1892
- const rgbaVal = color + weight / 100 + ')';
1893
- return hexify(rgbaVal);
1894
- };
1895
- const hexify = color => {
1896
- let values = color
1897
- .replace(/rgba?\(/, '')
1898
- .replace(/\)/, '')
1899
- .replace(/[\s+]/g, '')
1900
- .split(',');
1901
- let a = parseFloat(values[3] || 1),
1902
- r = Math.floor(a * parseInt(values[0]) + (1 - a) * 255),
1903
- g = Math.floor(a * parseInt(values[1]) + (1 - a) * 255),
1904
- b = Math.floor(a * parseInt(values[2]) + (1 - a) * 255);
1905
- return '#' + ('0' + r.toString(16)).slice(-2) + ('0' + g.toString(16)).slice(-2) + ('0' + b.toString(16)).slice(-2);
1906
- };
1907
-
1908
- /* harmony default export */ var theme = ({
1909
- setTheme
1910
- });
1911
-
1912
- // CONCATENATED MODULE: ./packages/utils/func/index.js
1913
-
1914
-
1915
-
1916
-
1917
-
1918
- /* harmony default export */ var func = ({ ...arr, ...browserCache, ...date, ...obj, ...theme });
1919
-
1920
- // CONCATENATED MODULE: ./packages/components/frame/data.js
1921
-
1922
-
1923
- const store = external_commonjs_vue_commonjs2_vue_root_Vue_default.a.observable({
1924
- tabData: [],
1925
- menuData: [],
1926
- menuActive: '',
1927
- tabsActive: '',
1928
- menuConfig: { label: 'label', icon: 'icon', children: 'children', value: 'value', parent: 'parent', fullPath: 'fullPath' }
1929
- });
1930
-
1931
- const data_muta = {
1932
- setTabs(name, childName) {
1933
- const tabValueList = store.tabData.map(e => e[store.menuConfig.value]);
1934
- if (childName ? !tabValueList.includes(childName) : !tabValueList.includes(name)) {
1935
- const currentItem = store.menuData.find(e => {
1936
- return e[store.menuConfig.value] === (childName || name);
1937
- });
1938
- currentItem && store.tabData.push(currentItem);
1939
- } else {
1940
- const index = store.tabData.findIndex(e => e[store.menuConfig.value] === childName);
1941
- const currentItem = store.menuData.find(e => e[store.menuConfig.value] === (childName || name));
1942
- index >= 0 && (store.tabData[index][store.menuConfig.fullPath] = currentItem[store.menuConfig.fullPath]);
1943
- store.tabData = JSON.parse(JSON.stringify(store.tabData));
1944
- }
1945
- store.menuActive = name;
1946
- store.tabsActive = childName || name;
1947
- },
1948
- deleteTabs(val, state) {
1949
- if (store.tabData.length <= 1) return;
1950
- const index = store.tabData.findIndex(e => e[store.menuConfig.value] === val);
1951
- !state && this.setTabs(store.tabData[index ? index - 1 : index + 1][store.menuConfig.value]);
1952
- store.tabData.splice(index, 1);
1953
- return true;
1954
- }
1955
- };
1956
-
1957
-
1958
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/frame/blocks/menu.vue?vue&type=template&id=dbb722cc&
1959
- var menuvue_type_template_id_dbb722cc_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-menu',_vm._g(_vm._b({directives:[{name:"watermark",rawName:"v-watermark",value:({ title: _vm.$Config.directives.watermark.title, subTitle: _vm.$Config.directives.watermark.subTitle }),expression:"{ title: $Config.directives.watermark.title, subTitle: $Config.directives.watermark.subTitle }"}],attrs:{"default-active":_vm.menuActive},on:{"select":_vm.changeMenu}},'el-menu',_vm.$attrs,false),_vm.$listeners),[_vm._l((_vm.data),function(item,index){return [(!item[_vm.menuConfig.children])?_c('el-menu-item',{key:'menu' + item[_vm.menuConfig.label] + index,attrs:{"index":item[_vm.menuConfig.value]}},[_c('div',[_c('i',{class:[item[_vm.menuConfig.icon], _vm.$attrs.collapse ? 'text-18' : 'text-28']}),_c('span',{attrs:{"slot":"title"},slot:"title"},[_vm._v(" "+_vm._s(item[_vm.menuConfig.label])+" ")])])]):_c('el-submenu',{key:'submenu' + item[_vm.menuConfig.label] + index,attrs:{"index":item[_vm.menuConfig.value]}},[_c('template',{slot:"title"},[_c('div',[_c('i',{class:[item[_vm.menuConfig.icon], _vm.$attrs.collapse ? 'text-18' : 'text-28']}),_c('span',{attrs:{"slot":"title"},slot:"title"},[_vm._v(" "+_vm._s(item[_vm.menuConfig.label])+" ")])])]),_vm._l((item[_vm.menuConfig.children]),function(items,indexs){return _c('child-submenu',{key:'father' + indexs,attrs:{"menu":items}})})],2)]})],2)
1960
- }
1961
- var menuvue_type_template_id_dbb722cc_staticRenderFns = []
1962
-
1963
-
1964
- // CONCATENATED MODULE: ./packages/components/frame/blocks/menu.vue?vue&type=template&id=dbb722cc&
1965
-
1966
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/frame/blocks/child-submenu.vue?vue&type=template&id=ab7e9f84&
1967
- var child_submenuvue_type_template_id_ab7e9f84_render = function render(){var _vm=this,_c=_vm._self._c;return (!(_vm.menu[_vm.menuConfig.children] && _vm.menu[_vm.menuConfig.children].length))?_c('el-menu-item',{attrs:{"index":_vm.menu[_vm.menuConfig.value]}},[_c('div',[_c('i',{class:_vm.menu[_vm.menuConfig.icon]}),_vm._v(" "+_vm._s(_vm.menu[_vm.menuConfig.label])+" ")])]):(_vm.menu[_vm.menuConfig.children] && _vm.menu[_vm.menuConfig.children].length)?_c('el-submenu',{attrs:{"index":_vm.menu[_vm.menuConfig.value]}},[_c('template',{slot:"title"},[_c('div',[_vm._v(" "+_vm._s(_vm.menu[_vm.menuConfig.label])+" ")])]),_vm._l((_vm.menu[_vm.menuConfig.children]),function(item,index){return _c('submenu',{key:index,attrs:{"menu":item}})})],2):_vm._e()
1968
- }
1969
- var child_submenuvue_type_template_id_ab7e9f84_staticRenderFns = []
1970
-
1971
-
1972
- // CONCATENATED MODULE: ./packages/components/frame/blocks/child-submenu.vue?vue&type=template&id=ab7e9f84&
1973
-
1974
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/frame/blocks/child-submenu.vue?vue&type=script&lang=js&
1975
-
1976
-
1977
-
1978
- /* harmony default export */ var child_submenuvue_type_script_lang_js_ = ({
1979
- name: 'Submenu',
1980
- props: {
1981
- menu: { type: Object, default: () => ({}) }
1982
- },
1983
- computed: {
1984
- menuConfig: () => store.menuConfig
1985
- }
1986
- });
1987
-
1988
- // CONCATENATED MODULE: ./packages/components/frame/blocks/child-submenu.vue?vue&type=script&lang=js&
1989
- /* harmony default export */ var blocks_child_submenuvue_type_script_lang_js_ = (child_submenuvue_type_script_lang_js_);
1990
- // CONCATENATED MODULE: ./packages/components/frame/blocks/child-submenu.vue
1991
-
1992
-
1993
-
1994
-
1995
-
1996
- /* normalize component */
1997
-
1998
- var child_submenu_component = Object(componentNormalizer["a" /* default */])(
1999
- blocks_child_submenuvue_type_script_lang_js_,
2000
- child_submenuvue_type_template_id_ab7e9f84_render,
2001
- child_submenuvue_type_template_id_ab7e9f84_staticRenderFns,
2002
- false,
2003
- null,
2004
- null,
2005
- null
2006
-
2007
- )
2008
-
2009
- /* harmony default export */ var child_submenu = (child_submenu_component.exports);
2010
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/frame/blocks/menu.vue?vue&type=script&lang=js&
2011
-
2012
-
2013
-
2014
- /* harmony default export */ var menuvue_type_script_lang_js_ = ({
2015
- components: { childSubmenu: child_submenu },
2016
- props: {
2017
- data: { type: Array, required: true, default: () => [] }
2018
- },
2019
- data() {
2020
- return {
2021
- menuData: []
2022
- };
2023
- },
2024
- computed: {
2025
- menuActive: () => store.menuActive,
2026
- menuConfig: () => store.menuConfig
2027
- },
2028
- watch: {
2029
- // 监听路由设置菜单和tabs高亮
2030
- $route(val, oldVal) {
2031
- val.name !== oldVal.name && this.init(val.meta.parent || val.name, this.$route);
2032
- },
2033
- data(val) {
2034
- val && this.setMenuData(val);
2035
- }
2036
- },
2037
- created() {
2038
- this.data && this.setMenuData(this.data);
2039
- this.init(this.$route.meta.parent || this.$route.name, this.$route);
2040
- },
2041
- methods: {
2042
- init(menuActive, currentRoute) {
2043
- const config = {
2044
- [this.menuConfig.label]: currentRoute.meta.title,
2045
- [this.menuConfig.value]: currentRoute.name,
2046
- tabsParent: menuActive,
2047
- [this.menuConfig.fullPath]: currentRoute.fullPath
2048
- };
2049
- store.menuData = this.$Func.repeatObjEle([config, ...(JSON.parse(localStorage.getItem('tabData')) || []), ...this.menuData], this.menuConfig.value);
2050
- data_muta.setTabs(menuActive, currentRoute.name);
2051
- },
2052
- changeMenu(menuActive) {
2053
- data_muta.setTabs(menuActive);
2054
- },
2055
- setMenuData(data) {
2056
- data.forEach(e => {
2057
- this.menuData.push({ ...e, [this.menuConfig.children]: null });
2058
- e[this.menuConfig.children] && this.setMenuData(e[this.menuConfig.children]);
2059
- });
2060
- }
2061
- }
2062
- });
2063
-
2064
- // CONCATENATED MODULE: ./packages/components/frame/blocks/menu.vue?vue&type=script&lang=js&
2065
- /* harmony default export */ var blocks_menuvue_type_script_lang_js_ = (menuvue_type_script_lang_js_);
2066
- // CONCATENATED MODULE: ./packages/components/frame/blocks/menu.vue
2067
-
2068
-
2069
-
2070
-
2071
-
2072
- /* normalize component */
2073
-
2074
- var menu_component = Object(componentNormalizer["a" /* default */])(
2075
- blocks_menuvue_type_script_lang_js_,
2076
- menuvue_type_template_id_dbb722cc_render,
2077
- menuvue_type_template_id_dbb722cc_staticRenderFns,
2078
- false,
2079
- null,
2080
- null,
2081
- null
2082
-
2083
- )
2084
-
2085
- /* harmony default export */ var menu = (menu_component.exports);
2086
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/frame/blocks/tabs.vue?vue&type=template&id=e3e21762&
2087
- var tabsvue_type_template_id_e3e21762_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('el-tabs',{directives:[{name:"watermark",rawName:"v-watermark",value:({ title: _vm.$Config.directives.watermark.title, subTitle: _vm.$Config.directives.watermark.subTitle }),expression:"{ title: $Config.directives.watermark.title, subTitle: $Config.directives.watermark.subTitle }"}],staticClass:"tabClass",attrs:{"closable":_vm.tabData.length > 1},on:{"tab-click":_vm.handleClick,"tab-remove":_vm.tabRemove},model:{value:(_vm.activeName),callback:function ($$v) {_vm.activeName=$$v},expression:"activeName"}},_vm._l((_vm.tabData),function(item,index){return _c('el-tab-pane',{key:'tabs' + item[_vm.menuConfig.value] + index,attrs:{"label":item[_vm.menuConfig.label],"name":item[_vm.menuConfig.value]}})}),1)],1)
2088
- }
2089
- var tabsvue_type_template_id_e3e21762_staticRenderFns = []
2090
-
2091
-
2092
- // CONCATENATED MODULE: ./packages/components/frame/blocks/tabs.vue?vue&type=template&id=e3e21762&
2093
-
2094
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/frame/blocks/tabs.vue?vue&type=script&lang=js&
2095
-
2096
-
2097
- /* harmony default export */ var tabsvue_type_script_lang_js_ = ({
2098
- inheritAttrs: false,
2099
- data() {
2100
- return {
2101
- activeName: ''
2102
- };
2103
- },
2104
- computed: {
2105
- tabData: () => store.tabData,
2106
- menuData: () => store.menuData,
2107
- tabsActive: () => store.tabsActive,
2108
- menuConfig: () => store.menuConfig
2109
- },
2110
- watch: {
2111
- tabData(val) {
2112
- localStorage.setItem('tabData', JSON.stringify(val));
2113
- },
2114
- tabsActive: {
2115
- handler(val) {
2116
- this.activeName = val;
2117
- const data = this.menuData.find(e => e[this.menuConfig.value] === val);
2118
- data && this.$router.push(data[this.menuConfig.fullPath]);
2119
- },
2120
- immediate: true
2121
- }
2122
- },
2123
- methods: {
2124
- handleClick(val) {
2125
- const data = this.menuData.find(e => e[this.menuConfig.value] === val.name);
2126
- if (data && data.tabsParent) {
2127
- data_muta.setTabs(data.tabsParent, val.name);
2128
- } else {
2129
- data_muta.setTabs(val.name);
2130
- }
2131
- },
2132
- tabRemove(val) {
2133
- data_muta.deleteTabs(val);
2134
- }
2135
- }
2136
- });
2137
-
2138
- // CONCATENATED MODULE: ./packages/components/frame/blocks/tabs.vue?vue&type=script&lang=js&
2139
- /* harmony default export */ var blocks_tabsvue_type_script_lang_js_ = (tabsvue_type_script_lang_js_);
2140
- // CONCATENATED MODULE: ./packages/components/frame/blocks/tabs.vue
2141
-
2142
-
2143
-
2144
-
2145
-
2146
- /* normalize component */
2147
-
2148
- var tabs_component = Object(componentNormalizer["a" /* default */])(
2149
- blocks_tabsvue_type_script_lang_js_,
2150
- tabsvue_type_template_id_e3e21762_render,
2151
- tabsvue_type_template_id_e3e21762_staticRenderFns,
2152
- false,
2153
- null,
2154
- null,
2155
- null
2156
-
2157
- )
2158
-
2159
- /* harmony default export */ var tabs = (tabs_component.exports);
2160
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/frame/index.vue?vue&type=script&lang=js&
2161
-
2162
-
2163
-
2164
-
2165
- /* harmony default export */ var framevue_type_script_lang_js_ = ({
2166
- name: 'HcFrame',
2167
- components: { comMenu: menu, comTabs: tabs },
2168
- provide() {
2169
- return {
2170
- tabRemove: this.closeTabs
2171
- };
2172
- },
2173
- props: {
2174
- collapse: { type: Boolean, default: false },
2175
- menu: { type: Boolean, default: false },
2176
- menuConfig: { type: Object, default: () => ({ label: 'label', icon: 'icon', children: 'children', value: 'value ', parent: 'parent', fullPath: 'fullPath' }) },
2177
- config: {
2178
- type: Object,
2179
- default: () => ({
2180
- // 菜单展开宽度、菜单收起宽度
2181
- width: { openMenu: 240, closeMenu: 60 },
2182
- // 头部高度、菜单地图高度、页签高度
2183
- height: { header: 50, footer: 0, tabs: 50, logo: 50 }
2184
- })
2185
- }
2186
- },
2187
- data() {
2188
- return {};
2189
- },
2190
- computed: {
2191
- menuWidth() {
2192
- return this.config.width[!this.collapse ? 'openMenu' : 'closeMenu'];
2193
- }
2194
- },
2195
- created() {
2196
- store.menuConfig = this.menuConfig;
2197
- store.tabData = JSON.parse(localStorage.getItem('tabData')) || [];
2198
- },
2199
- methods: {
2200
- closeTabs(val, state = false) {
2201
- return data_muta.deleteTabs(val, state);
2202
- }
2203
- }
2204
- });
2205
-
2206
- // CONCATENATED MODULE: ./packages/components/frame/index.vue?vue&type=script&lang=js&
2207
- /* harmony default export */ var components_framevue_type_script_lang_js_ = (framevue_type_script_lang_js_);
2208
- // CONCATENATED MODULE: ./packages/components/frame/index.vue
2209
-
2210
-
2211
-
2212
-
2213
-
2214
- /* normalize component */
2215
-
2216
- var frame_component = Object(componentNormalizer["a" /* default */])(
2217
- components_framevue_type_script_lang_js_,
2218
- framevue_type_template_id_1dcf1c1c_render,
2219
- framevue_type_template_id_1dcf1c1c_staticRenderFns,
2220
- false,
2221
- null,
2222
- null,
2223
- null
2224
-
2225
- )
2226
-
2227
- /* harmony default export */ var components_frame = (frame_component.exports);
2228
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/upload/index.vue?vue&type=template&id=09093813&
2229
- var uploadvue_type_template_id_09093813_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"flex-wrap"},[(!_vm.noShow)?_c('div',[(_vm.ext === '.jpg,.jpeg,.png,.gif')?_c('div',_vm._l((_vm.fileList),function(item,index){return _c('div',{key:'upload' + index,staticClass:"imgUpload radius border relative mr-12",style:({ width: _vm.size, height: _vm.size })},[_c('img',{staticClass:"w-100 h-100",attrs:{"src":item[_vm.keys]}}),_c('div',{staticClass:"absolute-all flex-center cursor-pointer",on:{"click":function($event){return _vm.deleteImg(item)}}},[_c('i',{staticClass:"el-icon-delete color-white text-24"})])])}),0):_c('div',_vm._l((_vm.fileList),function(item,index){return _c('div',{key:'upload' + index,staticClass:"flex-y-center mb-8 cursor-pointer"},[_c('span',{on:{"click":function($event){return _vm.downFile(item)}}},[_vm._v(" "+_vm._s(item.name || '附件' + (index + 1))+" ")]),_c('i',{staticClass:"el-icon-close ml-80 text-20",on:{"click":function($event){return _vm.deleteImg(item)}}})])}),0)]):_vm._e(),(_vm.fileList.length < _vm.limit || _vm.noShow)?_c('el-upload',_vm._b({attrs:{"action":_vm.action,"data":_vm.uploadData,"headers":_vm.headersData,"file-list":_vm.fileList,"on-success":_vm.handleAvatarSuccess,"on-error":_vm.handleAvatarError,"show-file-list":false,"before-upload":_vm.onBeforeUpload,"multiple":""}},'el-upload',_vm.$attrs,false),[_vm._t("default")],2):_vm._e()],1)
2230
- }
2231
- var uploadvue_type_template_id_09093813_staticRenderFns = []
2232
-
2233
-
2234
- // CONCATENATED MODULE: ./packages/components/upload/index.vue?vue&type=template&id=09093813&
2235
-
2236
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/upload/index.vue?vue&type=script&lang=js&
2237
-
2238
- /* harmony default export */ var uploadvue_type_script_lang_js_ = ({
2239
- props: {
2240
- value: { type: String, default: '' },
2241
- size: { type: String, default: '120px' },
2242
- ext: { type: String, default: 'file' },
2243
- keys: { type: String, default: 'viewUrl' },
2244
- noShow: { type: Boolean, default: false },
2245
- maxSize: { type: Number, default: 10240 },
2246
- limit: { type: Number, default: 1 },
2247
- action: { type: String, default: '/api/server/upload' }
2248
- },
2249
- data() {
2250
- return { fileList: [] };
2251
- },
2252
- computed: {
2253
- uploadData() {
2254
- return {};
2255
- },
2256
- headersData() {
2257
- return { Authorization: this.$store.getters.token };
2258
- }
2259
- },
2260
- watch: {
2261
- value(val) {
2262
- if (!val) return;
2263
- const data = val.split(',').map(e => ({ [this.keys]: e }));
2264
- this.fileList = data.map(e => this.fileList.find(el => el[this.keys] === e[this.keys]) || e);
2265
- }
2266
- },
2267
- methods: {
2268
- handleAvatarSuccess(res, file) {
2269
- this.fileList.push({ name: file.name, viewUrl: file.name });
2270
- this.$emit('input', file.name);
2271
- this.$emit('set-val', { ...res, name: file.name });
2272
- },
2273
- onBeforeUpload(file) {
2274
- // const isOkExt = this.ext.indexOf(file.name.substring(file.name.lastIndexOf('.'))) >= 0;
2275
- // if (!isOkExt) {
2276
- // this.$message.error('只能上传' + this.ext + '格式的文件');
2277
- // return false;
2278
- // }
2279
- // if (!(file.size / 1024 < this.maxSize)) {
2280
- // this.$message.error('上传文件大小不能超过' + this.maxSize + 'KB!');
2281
- // return false;
2282
- // }
2283
- return true;
2284
- },
2285
- deleteImg(data) {
2286
- this.fileList = this.fileList.filter(e => data[this.keys] !== e[this.keys]);
2287
- this.$emit('input', this.fileList.map(e => e[this.keys]).join(','));
2288
- },
2289
- downFile(data) {
2290
- window.open(data[this.keys]);
2291
- },
2292
- handleAvatarError(err) {
2293
- this.$message.error('导入模版:' + JSON.parse(err.message).message);
2294
- }
2295
- }
2296
- });
2297
-
2298
- // CONCATENATED MODULE: ./packages/components/upload/index.vue?vue&type=script&lang=js&
2299
- /* harmony default export */ var components_uploadvue_type_script_lang_js_ = (uploadvue_type_script_lang_js_);
2300
- // CONCATENATED MODULE: ./packages/components/upload/index.vue
2301
-
2302
-
2303
-
2304
-
2305
-
2306
- /* normalize component */
2307
-
2308
- var upload_component = Object(componentNormalizer["a" /* default */])(
2309
- components_uploadvue_type_script_lang_js_,
2310
- uploadvue_type_template_id_09093813_render,
2311
- uploadvue_type_template_id_09093813_staticRenderFns,
2312
- false,
2313
- null,
2314
- null,
2315
- null
2316
-
2317
- )
2318
-
2319
- /* harmony default export */ var upload = (upload_component.exports);
2320
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/index.vue?vue&type=template&id=4a562e7a&
2321
- var treevue_type_template_id_4a562e7a_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(_vm.isSearch)?_c('el-input',{attrs:{"size":"small","placeholder":"输入关键字进行过滤"},model:{value:(_vm.searchFilter),callback:function ($$v) {_vm.searchFilter=$$v},expression:"searchFilter"}}):_vm._e(),_c('el-tree',_vm._g(_vm._b({ref:"hcTree",staticClass:"mt-16",attrs:{"data":_vm.treeData,"node-key":_vm.$attrs['node-key'] || 'id',"filter-node-method":_vm.filterNode},on:{"check-change":_vm.treeChange},scopedSlots:_vm._u([{key:"default",fn:function({ node, data }){return [_c('div',{staticClass:"w-100"},[_c('div',{staticClass:"flex-between-center pr-20 border-box"},[_c('div',{staticClass:"overflow-hidden"},[(_vm.isSlot)?_c('div',{staticClass:"overflow-hidden"},[_vm._t("default",null,null,{ node, data })],2):_c('div',[_vm._v(" "+_vm._s(data[_vm.labelKey])+" ")])]),(_vm.operation)?_c('com-operation',_vm._g(_vm._b({attrs:{"f-refs":_vm.$refs,"node":node,"data":data,"label-key":_vm.labelKey}},'com-operation',_vm.$attrs,false),_vm.$listeners)):_vm._e()],1)])]}}],null,true)},'el-tree',_vm.$attrs,false),_vm.$listeners))],1)
2322
- }
2323
- var treevue_type_template_id_4a562e7a_staticRenderFns = []
2324
-
2325
-
2326
- // CONCATENATED MODULE: ./packages/components/tree/index.vue?vue&type=template&id=4a562e7a&
2327
-
2328
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/operation/index.vue?vue&type=template&id=412cb2be&
2329
- var operationvue_type_template_id_412cb2be_render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(_vm.expand)?_c('div',{staticClass:"flex-between-center"},_vm._l((_vm.operationConfig),function(item,index){return _c('div',{key:index},[(item.show && typeof item.show === 'function' ? item.show(_vm.$attrs.data) : true)?_c('div',[_c('com-' + item.prop,_vm._g(_vm._b({tag:"components",staticClass:"ml-8"},'components',{ ..._vm.$attrs, ...item },false),_vm.$listeners))],1):_vm._e()])}),0):_c('el-popover',{attrs:{"placement":"left-start","width":"40","popper-class":"treeOperationPopper","trigger":"hover"}},[_c('div',_vm._l((_vm.operationConfig),function(item,index){return _c('div',{key:index,staticClass:"flex-center"},[(item.show && typeof item.show === 'function' ? item.show(_vm.$attrs.data) : true)?_c('div',[_c('com-' + item.prop,_vm._g(_vm._b({tag:"components",staticClass:"ml-8"},'components',{ ..._vm.$attrs, ...item },false),_vm.$listeners))],1):_vm._e()])}),0),_c('i',{staticClass:"el-icon-more color-primary",attrs:{"slot":"reference"},slot:"reference"})])],1)
2330
- }
2331
- var operationvue_type_template_id_412cb2be_staticRenderFns = []
2332
-
2333
-
2334
- // CONCATENATED MODULE: ./packages/components/tree/operation/index.vue?vue&type=template&id=412cb2be&
2335
-
2336
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/operation/add.vue?vue&type=template&id=c18e9502&
2337
- var addvue_type_template_id_c18e9502_render = function render(){var _vm=this,_c=_vm._self._c;return _c('hc-' + _vm.operationModel,{tag:"components",attrs:{"title":_vm.title,"width":_vm.$attrs.width || '640px',"size":_vm.$attrs.width || '640px',"out-close":_vm.outClose}},[_c('el-button',{attrs:{"type":"text"}},[(_vm.operationType === 'text')?_c('div',[_vm._v(" "+_vm._s(_vm.$attrs.label)+" ")]):_c('i',{class:_vm.$attrs.icon || 'el-icon-plus'})]),_c('div',{attrs:{"slot":"contain"},slot:"contain"},[_c('div',{class:_vm.operationModel === 'dialog' ? '' : 'hc-drawer-body'},[_c('el-form',{ref:"form",staticClass:"w-100",attrs:{"model":_vm.form,"rules":_vm.rules}},[_c('hc-form-item',_vm._b({attrs:{"form":_vm.form}},'hc-form-item',_vm.childConfig,false))],1),_c(_vm.$attrs.component,{tag:"components"})],1),_c('div',{class:_vm.operationModel === 'dialog' ? 'flex-x-end' : 'hc-drawer-footer'},[_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.onSubmit}},[_vm._v(" 确定 ")]),_c('el-button',{on:{"click":function($event){_vm.outClose = !_vm.outClose}}},[_vm._v(" 取消 ")])],1)])],1)
2338
- }
2339
- var addvue_type_template_id_c18e9502_staticRenderFns = []
2340
-
2341
-
2342
- // CONCATENATED MODULE: ./packages/components/tree/operation/add.vue?vue&type=template&id=c18e9502&
2343
-
2344
- // CONCATENATED MODULE: ./packages/components/tree/valid.js
2345
- const operationConfigValidator = params => {
2346
- const labelNo = params.findIndex(e => !e.label);
2347
- if (labelNo !== -1) {
2348
- console.log(`%chc-tree => operationConfig参数:第${labelNo + 1}个参数label字段不能为空`, 'color: #e88282');
2349
- return false;
2350
- }
2351
- const propNo = params.findIndex(e => !e.prop || !['add', 'edit', 'clean'].includes(e.prop));
2352
- if (propNo !== -1) {
2353
- console.log(`%chc-tree => operationConfig参数:第${propNo + 1}个参数prop字段不能为空且需要在'add'、'edit'、'clean'之中`, 'color: #e88282');
2354
- return false;
2355
- }
2356
- const httpUrlNo = params.findIndex(e => !e.httpUrl);
2357
- if (httpUrlNo !== -1) {
2358
- console.log(`%chc-tree => operationConfig参数:第${httpUrlNo + 1}个参数httpUrl字段不能为空`, 'color: #e88282');
2359
- return false;
2360
- }
2361
- return true;
2362
- };
2363
-
2364
- const addEditValidator = params => {
2365
- return true;
2366
- };
2367
- const operationModelValidator = params => {
2368
- return ['dialog', 'drawer'].includes(params);
2369
- };
2370
-
2371
-
2372
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/operation/add.vue?vue&type=script&lang=js&
2373
-
2374
-
2375
- /* harmony default export */ var addvue_type_script_lang_js_ = ({
2376
- name: 'OperationAdd',
2377
- inheritAttrs: false,
2378
- props: {
2379
- node: { type: Object, default: () => {} },
2380
- fRefs: { type: Object, default: () => {} },
2381
- data: { type: Object, default: () => {} },
2382
- labelKey: { type: String, default: '' },
2383
- operationModel: { type: String, default: 'dialog', validator: operationModelValidator }, // dialog drawer
2384
- operationType: { type: String, default: 'text' },
2385
- httpUrl: { type: String, default: '' },
2386
- childConfig: { type: Object, default: () => {}, required: true, validator: addEditValidator }
2387
- },
2388
- data() {
2389
- return { outClose: false, form: {} };
2390
- },
2391
- computed: {
2392
- rules() {
2393
- return this.childConfig.rules || {};
2394
- },
2395
- title() {
2396
- return (this.data.label || '') + this.$attrs.label + '子节点';
2397
- }
2398
- },
2399
- methods: {
2400
- async onSubmit() {
2401
- const valid = await this.$refs.form.validate();
2402
- if (valid) {
2403
- const params = this.childConfig.paramsDispose && typeof this.childConfig.paramsDispose === 'function' ? this.childConfig.paramsDispose(this.form, this.node) : this.form;
2404
- const response = await this.$hcHttp.post(this.$Config.axios.ipUrl + this.httpUrl, params);
2405
- if (response.data) {
2406
- this.outClose = !this.outClose;
2407
- const nodeData = typeof response.data === 'object' ? {...params, ...response.data} : params;
2408
- this.fRefs.hcTree.append(nodeData, this.node);
2409
- this.$message.success(this.childConfig.message || `子节点:${params[this.labelKey]} ${this.$attrs.label}成功`);
2410
- this.form = {};
2411
- this.$emit('change');
2412
- this.$emit('edit');
2413
- }
2414
- }
2415
- }
2416
- }
2417
- });
2418
-
2419
- // CONCATENATED MODULE: ./packages/components/tree/operation/add.vue?vue&type=script&lang=js&
2420
- /* harmony default export */ var operation_addvue_type_script_lang_js_ = (addvue_type_script_lang_js_);
2421
- // CONCATENATED MODULE: ./packages/components/tree/operation/add.vue
2422
-
2423
-
2424
-
2425
-
2426
-
2427
- /* normalize component */
2428
-
2429
- var add_component = Object(componentNormalizer["a" /* default */])(
2430
- operation_addvue_type_script_lang_js_,
2431
- addvue_type_template_id_c18e9502_render,
2432
- addvue_type_template_id_c18e9502_staticRenderFns,
2433
- false,
2434
- null,
2435
- null,
2436
- null
2437
-
2438
- )
2439
-
2440
- /* harmony default export */ var add = (add_component.exports);
2441
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/operation/edit.vue?vue&type=template&id=bea17c82&
2442
- var editvue_type_template_id_bea17c82_render = function render(){var _vm=this,_c=_vm._self._c;return _c('hc-' + _vm.operationModel,{tag:"components",attrs:{"title":_vm.title,"width":_vm.$attrs.width || '640px',"size":_vm.$attrs.width || '640px',"out-close":_vm.outClose}},[_c('el-button',{attrs:{"type":"text"}},[(_vm.operationType === 'text')?_c('div',[_vm._v(" "+_vm._s(_vm.$attrs.label)+" ")]):_c('i',{class:_vm.$attrs.icon || 'el-icon-edit'})]),_c('div',{attrs:{"slot":"contain"},slot:"contain"},[_c('div',{class:_vm.operationModel === 'dialog' ? '' : 'hc-drawer-body'},[_c('el-form',{ref:"form",staticClass:"w-100",attrs:{"rules":_vm.rules,"model":_vm.form}},[_c('hc-form-item',_vm._b({attrs:{"form":_vm.form}},'hc-form-item',_vm.childConfig,false))],1)],1),_c('div',{class:_vm.operationModel === 'dialog' ? 'flex-x-end' : 'hc-drawer-footer'},[_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.onSubmit}},[_vm._v(" 确定 ")]),_c('el-button',{on:{"click":function($event){_vm.outClose = !_vm.outClose}}},[_vm._v(" 取消 ")])],1)])],1)
2443
- }
2444
- var editvue_type_template_id_bea17c82_staticRenderFns = []
2445
-
2446
-
2447
- // CONCATENATED MODULE: ./packages/components/tree/operation/edit.vue?vue&type=template&id=bea17c82&
2448
-
2449
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/operation/edit.vue?vue&type=script&lang=js&
2450
-
2451
-
2452
- /* harmony default export */ var editvue_type_script_lang_js_ = ({
2453
- name: 'OperationAdd',
2454
- inheritAttrs: false,
2455
- props: {
2456
- node: { type: Object, default: () => {} },
2457
- fRefs: { type: Object, default: () => {} },
2458
- data: { type: Object, default: () => {} },
2459
- labelKey: { type: String, default: '' },
2460
- httpUrl: { type: String, default: '' },
2461
- operationModel: { type: String, default: 'dialog', validator: operationModelValidator }, // dialog drawer
2462
- operationType: { type: String, default: 'text' },
2463
- childConfig: { type: Object, default: () => {}, required: true, validator: addEditValidator }
2464
- },
2465
- data() {
2466
- return { outClose: false, form: {} };
2467
- },
2468
- computed: {
2469
- rules() {
2470
- return this.childConfig.rules || {};
2471
- },
2472
- title() {
2473
- return this.$attrs.label + (this.data.label || '');
2474
- }
2475
- },
2476
- created() {
2477
- this.form = JSON.parse(JSON.stringify(this.data));
2478
- },
2479
- methods: {
2480
- async onSubmit() {
2481
- const valid = await this.$refs.form.validate();
2482
- if (valid) {
2483
- const params = this.childConfig.paramsDispose && typeof this.childConfig.paramsDispose === 'function' ? this.childConfig.paramsDispose(this.form, this.node) : this.form;
2484
- const response = await this.$hcHttp.post(this.$Config.axios.ipUrl + this.httpUrl, params);
2485
- if (response.data) {
2486
- this.outClose = !this.outClose;
2487
- this.$message.success(this.childConfig.message || `${params[this.labelKey]} ${this.$attrs.label}成功`);
2488
- this.fRefs.hcTree.getNode(this.data).data[this.labelKey] = params[this.labelKey];
2489
- this.$emit('change');
2490
- this.$emit('edit');
2491
- }
2492
- }
2493
- }
2494
- }
2495
- });
2496
-
2497
- // CONCATENATED MODULE: ./packages/components/tree/operation/edit.vue?vue&type=script&lang=js&
2498
- /* harmony default export */ var operation_editvue_type_script_lang_js_ = (editvue_type_script_lang_js_);
2499
- // CONCATENATED MODULE: ./packages/components/tree/operation/edit.vue
2500
-
2501
-
2502
-
2503
-
2504
-
2505
- /* normalize component */
2506
-
2507
- var edit_component = Object(componentNormalizer["a" /* default */])(
2508
- operation_editvue_type_script_lang_js_,
2509
- editvue_type_template_id_bea17c82_render,
2510
- editvue_type_template_id_bea17c82_staticRenderFns,
2511
- false,
2512
- null,
2513
- null,
2514
- null
2515
-
2516
- )
2517
-
2518
- /* harmony default export */ var edit = (edit_component.exports);
2519
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/operation/clean.vue?vue&type=template&id=6ef718e8&
2520
- var cleanvue_type_template_id_6ef718e8_render = function render(){var _vm=this,_c=_vm._self._c;return _c('el-button',{directives:[{name:"prevent-shake",rawName:"v-prevent-shake"}],attrs:{"type":"text"},on:{"click":_vm.deleteData}},[(_vm.operationType === 'text')?_c('div',[_vm._v(" "+_vm._s(_vm.$attrs.label)+" ")]):_c('i',{class:_vm.$attrs.icon || 'el-icon-delete'})])
2521
- }
2522
- var cleanvue_type_template_id_6ef718e8_staticRenderFns = []
2523
-
2524
-
2525
- // CONCATENATED MODULE: ./packages/components/tree/operation/clean.vue?vue&type=template&id=6ef718e8&
2526
-
2527
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/operation/clean.vue?vue&type=script&lang=js&
2528
-
2529
-
2530
-
2531
- /* harmony default export */ var cleanvue_type_script_lang_js_ = ({
2532
- name: 'OperationDel',
2533
- inheritAttrs: false,
2534
- props: {
2535
- node: { type: Object, default: () => {} },
2536
- fRefs: { type: Object, default: () => {} },
2537
- data: { type: Object, default: () => {} },
2538
- httpUrl: { type: String, default: '' },
2539
- httpType: { type: String, default: 'post' },
2540
- operationType: { type: String, default: 'text' },
2541
- childConfig: { type: Object, default: () => {}, required: true, validator: addEditValidator }
2542
- },
2543
- data() {
2544
- return { outClose: false };
2545
- },
2546
- methods: {
2547
- deleteData() {
2548
- this.$confirm(`${this.childConfig.promptInfo || '此操作将删除当前节点以及当前节点下所有子节点, 是否继续?'}`, '提示', {
2549
- confirmButtonText: '确定',
2550
- cancelButtonText: '取消',
2551
- type: 'warning'
2552
- })
2553
- .then(async () => {
2554
- const params = this.childConfig.paramsDispose && typeof this.childConfig.paramsDispose === 'function' ? this.childConfig.paramsDispose(this.data, this.node) : this.data;
2555
- const response = await this.$hcHttp[this.httpType](this.$Config.axios.ipUrl + this.httpUrl, params);
2556
- if (response.data) {
2557
- this.fRefs.hcTree.remove(this.node);
2558
- this.outClose = !this.outClose;
2559
- this.$message.success(this.childConfig.message || `节点:${response.data.label} 删除成功`);
2560
- this.$emit('change');
2561
- this.$emit('clean');
2562
- }
2563
- })
2564
- .catch(() => {
2565
- this.$message({
2566
- type: 'info',
2567
- message: '已取消删除'
2568
- });
2569
- });
2570
- }
2571
- }
2572
- });
2573
-
2574
- // CONCATENATED MODULE: ./packages/components/tree/operation/clean.vue?vue&type=script&lang=js&
2575
- /* harmony default export */ var operation_cleanvue_type_script_lang_js_ = (cleanvue_type_script_lang_js_);
2576
- // CONCATENATED MODULE: ./packages/components/tree/operation/clean.vue
2577
-
2578
-
2579
-
2580
-
2581
-
2582
- /* normalize component */
2583
-
2584
- var clean_component = Object(componentNormalizer["a" /* default */])(
2585
- operation_cleanvue_type_script_lang_js_,
2586
- cleanvue_type_template_id_6ef718e8_render,
2587
- cleanvue_type_template_id_6ef718e8_staticRenderFns,
2588
- false,
2589
- null,
2590
- null,
2591
- null
2592
-
2593
- )
2594
-
2595
- /* harmony default export */ var clean = (clean_component.exports);
2596
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/operation/index.vue?vue&type=script&lang=js&
2597
-
2598
-
2599
-
2600
-
2601
-
2602
- /* harmony default export */ var operationvue_type_script_lang_js_ = ({
2603
- name: 'Operation',
2604
- components: { comAdd: add, comEdit: edit, comClean: clean },
2605
- inheritAttrs: false,
2606
- props: {
2607
- expand: { type: Boolean, default: false },
2608
- operationConfig: { type: Array, default: () => [], validator: operationConfigValidator }
2609
- },
2610
- data() {
2611
- return {};
2612
- }
2613
- });
2614
-
2615
- // CONCATENATED MODULE: ./packages/components/tree/operation/index.vue?vue&type=script&lang=js&
2616
- /* harmony default export */ var tree_operationvue_type_script_lang_js_ = (operationvue_type_script_lang_js_);
2617
- // CONCATENATED MODULE: ./packages/components/tree/operation/index.vue
2618
-
2619
-
2620
-
2621
-
2622
-
2623
- /* normalize component */
2624
-
2625
- var operation_component = Object(componentNormalizer["a" /* default */])(
2626
- tree_operationvue_type_script_lang_js_,
2627
- operationvue_type_template_id_412cb2be_render,
2628
- operationvue_type_template_id_412cb2be_staticRenderFns,
2629
- false,
2630
- null,
2631
- null,
2632
- null
2633
-
2634
- )
2635
-
2636
- /* harmony default export */ var operation = (operation_component.exports);
2637
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/tree/index.vue?vue&type=script&lang=js&
2638
-
2639
-
2640
-
2641
- /* harmony default export */ var treevue_type_script_lang_js_ = ({
2642
- components: { comOperation: operation },
2643
- props: {
2644
- value: { type: Array, default: () => [] },
2645
- data: { type: Array, default: () => [], required: true },
2646
- labelKey: { type: String, default: 'label' },
2647
- isList: { type: Boolean, default: false },
2648
- isSlot: { type: Boolean, default: false },
2649
- details: { type: Boolean, default: false },
2650
- operation: { type: Boolean, default: false },
2651
- isSearch: { type: Boolean, default: false },
2652
- listConfig: { type: Object, default: () => ({}) }
2653
- },
2654
- data() {
2655
- return {
2656
- searchFilter: ''
2657
- };
2658
- },
2659
- computed: {
2660
- treeData() {
2661
- let result = this.isList ? func.listToTree(this.data, this.listConfig) : this.data;
2662
- if (this.details) {
2663
- result = func.treeToList(result, this.listConfig).filter(item => this.value.includes(item[this.$attrs['node-key'] || 'id']));
2664
- result = func.listToTree(result, this.listConfig);
2665
- }
2666
- return result;
2667
- }
2668
- },
2669
- watch: {
2670
- searchFilter(val) {
2671
- this.$refs.hcTree.filter(val);
2672
- this.$emit('search', val);
2673
- },
2674
- value: {
2675
- handler(val) {
2676
- this.$nextTick(() => {
2677
- this.$refs.hcTree.setCheckedKeys(val);
2678
- });
2679
- },
2680
- immediate: true
2681
- }
2682
- },
2683
- methods: {
2684
- filterNode(value, data) {
2685
- if (!this.isSearch) return;
2686
- if (!value) return true;
2687
- return data[this.labelKey].indexOf(value) !== -1;
2688
- },
2689
- treeChange() {
2690
- const selectNodeKey = this.$refs.hcTree.getCheckedKeys();
2691
- this.$emit('input', selectNodeKey);
2692
- }
2693
- }
2694
- });
2695
-
2696
- // CONCATENATED MODULE: ./packages/components/tree/index.vue?vue&type=script&lang=js&
2697
- /* harmony default export */ var components_treevue_type_script_lang_js_ = (treevue_type_script_lang_js_);
2698
- // CONCATENATED MODULE: ./packages/components/tree/index.vue
2699
-
2700
-
2701
-
2702
-
2703
-
2704
- /* normalize component */
2705
-
2706
- var tree_component = Object(componentNormalizer["a" /* default */])(
2707
- components_treevue_type_script_lang_js_,
2708
- treevue_type_template_id_4a562e7a_render,
2709
- treevue_type_template_id_4a562e7a_staticRenderFns,
2710
- false,
2711
- null,
2712
- null,
2713
- null
2714
-
2715
- )
2716
-
2717
- /* harmony default export */ var tree = (tree_component.exports);
2718
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25392ca6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/icon/index.vue?vue&type=template&id=48ac2672&
2719
- var iconvue_type_template_id_48ac2672_render = function render(){var _vm=this,_c=_vm._self._c;return _c('svg',{staticClass:"hc-svg",class:_vm.color,style:({ fill: _vm.color || '' }),attrs:{"width":_vm.size,"height":_vm.size}},[_c('use',{attrs:{"xlink:href":'#icon-' + _vm.name}})])
2720
- }
2721
- var iconvue_type_template_id_48ac2672_staticRenderFns = []
2722
-
2723
-
2724
- // CONCATENATED MODULE: ./packages/components/icon/index.vue?vue&type=template&id=48ac2672&
2725
-
2726
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/icon/index.vue?vue&type=script&lang=js&
2727
-
2728
-
2729
-
2730
- /* harmony default export */ var iconvue_type_script_lang_js_ = ({
2731
- name: 'HcIcon',
2732
- props: {
2733
- size: { type: [Number, String], default: () => '100%' }, //图标名称
2734
- name: { type: String, default: '' }, //图标名称
2735
- type: { type: String, default: null }
2736
- },
2737
- computed: {
2738
- color() {
2739
- return (tCode_state.textColor[this.type] || 'color-text-primary') + '-icon';
2740
- }
2741
- }
2742
- });
2743
-
2744
- // CONCATENATED MODULE: ./packages/components/icon/index.vue?vue&type=script&lang=js&
2745
- /* harmony default export */ var components_iconvue_type_script_lang_js_ = (iconvue_type_script_lang_js_);
2746
- // CONCATENATED MODULE: ./packages/components/icon/index.vue
2747
-
2748
-
2749
-
2750
-
2751
-
2752
- /* normalize component */
2753
-
2754
- var icon_component = Object(componentNormalizer["a" /* default */])(
2755
- components_iconvue_type_script_lang_js_,
2756
- iconvue_type_template_id_48ac2672_render,
2757
- iconvue_type_template_id_48ac2672_staticRenderFns,
2758
- false,
2759
- null,
2760
- null,
2761
- null
2762
-
2763
- )
2764
-
2765
- /* harmony default export */ var icon = (icon_component.exports);
2766
- // CONCATENATED MODULE: ./packages/components/index.js
2767
-
2768
-
2769
-
2770
-
2771
-
2772
-
2773
-
2774
-
2775
-
2776
-
2777
-
2778
-
2779
-
2780
-
2781
- const components = {
2782
- desc: desc,
2783
- dialog: dialog,
2784
- 'form-item': form_item,
2785
- identify: identify,
2786
- frame: components_frame,
2787
- pager: pager,
2788
- popover: popover,
2789
- tab: tab,
2790
- table: table,
2791
- drawer: drawer,
2792
- tree: tree,
2793
- upload: upload,
2794
- icon: icon
2795
- };
2796
- // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
2797
- const install = function (Vue) {
2798
- // 判断是否安装
2799
- if (install.installed) return;
2800
- // 遍历注册全局组件
2801
- Object.keys(components).map(e => Vue.component('hc-' + e, components[e]));
2802
- };
2803
-
2804
- // 判断是否是直接引入文件
2805
- if (typeof window !== 'undefined' && window.Vue) {
2806
- install(window.Vue);
2807
- }
2808
-
2809
- /* harmony default export */ var packages_components = ({
2810
- // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
2811
- install
2812
- });
2813
-
2814
- // EXTERNAL MODULE: ./node_modules/element-ui/lib/element-ui.common.js
2815
- var element_ui_common = __webpack_require__("5c96");
2816
- var element_ui_common_default = /*#__PURE__*/__webpack_require__.n(element_ui_common);
2817
-
2818
- // CONCATENATED MODULE: ./packages/directives/copy.js
2819
-
2820
-
2821
- const copy = val => {
2822
- return {
2823
- // 名字爱取啥取啥
2824
- /*
2825
- bind 钩子函数,第一次绑定时调用,可以在这里做初始化设置
2826
- el: 作用的 dom 对象
2827
- value: 传给指令的值,也就是我们要 copy 的值
2828
- */
2829
- bind(el, { value }) {
2830
- el.$value = value; // 用一个全局属性来存传进来的值,因为这个值在别的钩子函数里还会用到
2831
- el.handler = () => {
2832
- if (!el.$value) {
2833
- // 值为空的时候,给出提示,我这里的提示是用的 ant-design-vue 的提示,你们随意
2834
- element_ui_common["Message"].warning('无复制内容');
2835
- return;
2836
- }
2837
- // 动态创建 textarea 标签
2838
- const textarea = document.createElement('textarea');
2839
- // 将该 textarea 设为 readonly 防止 iOS 下自动唤起键盘,同时将 textarea 移出可视区域
2840
- textarea.readOnly = 'readonly';
2841
- textarea.style.position = 'absolute';
2842
- textarea.style.left = '-9999px';
2843
- // 将要 copy 的值赋给 textarea 标签的 value 属性
2844
- textarea.value = el.$value;
2845
- // 将 textarea 插入到 body 中
2846
- document.body.appendChild(textarea);
2847
- // 选中值并复制
2848
- textarea.select();
2849
- textarea.setSelectionRange(0, textarea.value.length);
2850
- const result = document.execCommand('Copy');
2851
- if (result) {
2852
- element_ui_common["Message"].success('复制成功');
2853
- }
2854
- document.body.removeChild(textarea);
2855
- };
2856
- // 绑定点击事件,就是所谓的一键 copy 啦
2857
- el.addEventListener('click', el.handler);
2858
- },
2859
- // 当传进来的值更新的时候触发
2860
- componentUpdated(el, { value }) {
2861
- el.$value = value;
2862
- },
2863
- // 指令与元素解绑的时候,移除事件绑定
2864
- unbind(el) {
2865
- el.removeEventListener('click', el.handler);
2866
- }
2867
- };
2868
- };
2869
-
2870
- /* harmony default export */ var directives_copy = (copy);
2871
-
2872
- // CONCATENATED MODULE: ./packages/directives/dialogDrag.js
2873
- const dialogDrag = () => {
2874
- return {
2875
- bind(el, binding) {
2876
- if (!binding.value) return;
2877
- const dialogHeaderEl = el.querySelector('.el-dialog__header');
2878
- const dragDom = el.querySelector('.el-dialog');
2879
- dialogHeaderEl.style.cursor = 'move';
2880
-
2881
- // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
2882
- const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
2883
-
2884
- dialogHeaderEl.onmousedown = e => {
2885
- // 鼠标按下,计算当前元素距离可视区的距离
2886
- const disX = e.clientX - dialogHeaderEl.offsetLeft;
2887
- const disY = e.clientY - dialogHeaderEl.offsetTop;
2888
-
2889
- // 获取到的值带px 正则匹配替换
2890
- let styL, styT;
2891
-
2892
- // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
2893
- if (sty.left.includes('%')) {
2894
- // eslint-disable-next-line no-useless-escape
2895
- styL = Number(document.body.clientWidth) * (Number(sty.left.replace(/\%/g, '')) / 100);
2896
- // eslint-disable-next-line no-useless-escape
2897
- styT = Number(document.body.clientHeight) * (Number(sty.top.replace(/\%/g, '')) / 100);
2898
- } else {
2899
- styL = Number(sty.left.replace(/\px/g, ''));
2900
- styT = Number(sty.top.replace(/\px/g, ''));
2901
- }
2902
-
2903
- document.onmousemove = function (e) {
2904
- // 通过事件委托,计算移动的距离
2905
- const l = e.clientX - disX;
2906
- const t = e.clientY - disY;
2907
-
2908
- // 移动当前元素
2909
- dragDom.style.left = `${l + styL}px`;
2910
- dragDom.style.top = `${t + styT}px`;
2911
-
2912
- // 将此时的位置传出去
2913
- // binding.value({x:e.pageX,y:e.pageY})
2914
- };
2915
-
2916
- document.onmouseup = function (e) {
2917
- document.onmousemove = null;
2918
- document.onmouseup = null;
2919
- };
2920
- };
2921
- }
2922
- };
2923
- };
2924
- /* harmony default export */ var directives_dialogDrag = (dialogDrag);
2925
-
2926
- // CONCATENATED MODULE: ./packages/directives/enter.js
2927
- let findEle = (parent, type) => {
2928
- return parent.tagName.toLowerCase() === type ? parent : parent.querySelector(type);
2929
- };
2930
-
2931
- function filterNum(arg) {
2932
- return arg > 0 ? new RegExp(`^\\d+(?:\\.\\d{0,${arg}})?$`) : new RegExp(`^\\d+$`);
2933
- }
2934
-
2935
- function reducerObj(object) {
2936
- if (typeof object !== 'object') throw Error('param is expected object');
2937
- let data = object;
2938
-
2939
- function split(keyStr) {
2940
- return keyStr.split('.');
2941
- }
2942
-
2943
- function hasOwn(result, key) {
2944
- if (result.hasOwnProperty(key)) {
2945
- return result[key];
2946
- }
2947
- throw Error(key + ' is not exist');
2948
- }
2949
-
2950
- return {
2951
- value: data,
2952
- get(keyStr) {
2953
- let keys = split(keyStr);
2954
- return keys.reduce((result, key, idx, arr) => {
2955
- return hasOwn(result, key);
2956
- }, data);
2957
- },
2958
- set(keyStr, val) {
2959
- let keys = split(keyStr);
2960
- let d = null,
2961
- preKey;
2962
- let oldVal = keys.reduce((result, key, idx, arr) => {
2963
- d = result;
2964
- preKey = key;
2965
-
2966
- return hasOwn(result, key);
2967
- }, data);
2968
-
2969
- d[preKey] = val;
2970
-
2971
- return {
2972
- val: d[preKey],
2973
- oldVal
2974
- };
2975
- }
2976
- };
2977
- }
2978
-
2979
- const enter = () => {
2980
- return {
2981
- bind: function (el, options, vnode) {
2982
- let $inp = findEle(el, 'input');
2983
- // 默认
2984
- let filter = options.arg;
2985
-
2986
- let reg = filterNum(filterNum);
2987
-
2988
- //可以动态 设置 过滤位数
2989
- Object.defineProperty($inp, 'filterReg', {
2990
- get() {
2991
- return reg;
2992
- },
2993
- set(val) {
2994
- filter = val;
2995
- reg = filterNum(val);
2996
- },
2997
- enumerable: true,
2998
- configurable: true
2999
- });
3000
-
3001
- el.$inp = $inp;
3002
- // 读写生成器
3003
- let reducer = reducerObj(vnode.context);
3004
- $inp.handle = function () {
3005
- let numberOnly = this.getAttribute('enter');
3006
- if (numberOnly > 0 && filter !== numberOnly) this.filterReg = numberOnly;
3007
- if (this.value.length && !this.filterReg.test(this.value)) {
3008
- $inp.value = reducer.get(options.expression);
3009
- } else {
3010
- reducer.set(options.expression, this.value);
3011
- }
3012
- return false;
3013
- };
3014
-
3015
- $inp.addEventListener('input', $inp.handle);
3016
- },
3017
- // update(...ddd) {
3018
- // },
3019
- unbind: function (el) {
3020
- el.$inp.removeEventListener('input', el.$inp.handle);
3021
- }
3022
- };
3023
- };
3024
- /* harmony default export */ var directives_enter = (enter);
3025
-
3026
- // CONCATENATED MODULE: ./packages/directives/errImg.js
3027
- /**
3028
- * v-errimg="{type:'avatarErr'}"
3029
- * v-errimg
3030
- * 不传,默认取showErr项替代,其他情况根据实际情况传类型
3031
- * type---error图片类型,默认showErr
3032
- * empty---为空的时候是否需要展示err图片,默认true
3033
- */
3034
- const errImg = imgObj => {
3035
- const errImg = (el, binding) => {
3036
- let defaultImg = imgObj.showErr,
3037
- val = binding.value,
3038
- type = (val && val.type) || 'showErr',
3039
- empty = (val && val.empty) || true;
3040
-
3041
- if (!el.src && empty) {
3042
- el.src = defaultImg;
3043
- return;
3044
- }
3045
-
3046
- const errHandle = () => el.addEventListener('error', _ => (el.src = defaultImg));
3047
-
3048
- try {
3049
- defaultImg = imgObj[type];
3050
- errHandle();
3051
- } catch (e) {
3052
- errHandle();
3053
- }
3054
- };
3055
- return {
3056
- bind: (el, binding) => errImg(el, binding),
3057
- update: (el, binding) => errImg(el, binding)
3058
- };
3059
- };
3060
- /* harmony default export */ var directives_errImg = (errImg);
3061
-
3062
- // CONCATENATED MODULE: ./packages/directives/onlyInt.js
3063
- const onlyInt = () => {
3064
- return {
3065
- inserted: function (el) {
3066
- el.addEventListener('keypress', function (e) {
3067
- e = e || window.event;
3068
- let charcode = typeof e.charCode === 'number' ? e.charCode : e.keyCode;
3069
- let re = /\d/;
3070
- if (!re.test(String.fromCharCode(charcode)) && charcode > 9 && !e.ctrlKey) {
3071
- if (e.preventDefault) {
3072
- e.preventDefault();
3073
- } else {
3074
- e.returnValue = false;
3075
- }
3076
- }
3077
- });
3078
- }
3079
- };
3080
- };
3081
- /* harmony default export */ var directives_onlyInt = (onlyInt);
3082
-
3083
- // CONCATENATED MODULE: ./packages/directives/onlyNumber.js
3084
- const onlyNumber = () => {
3085
- return {
3086
- inserted(el, binding, vNode) {
3087
- const node = vNode,
3088
- defaultValue = { max: 9999999999.99, min: 0, decimal: 0 };
3089
- binding.value = { ...defaultValue, ...binding.value };
3090
- let content, setValue, recursion;
3091
- recursion = (els, num, val) => {
3092
- let stop = num === binding.value.model.length;
3093
- num++;
3094
- stop && (els[binding.value.model[num - 1]] = val);
3095
- return (!stop && recursion(els[binding.value.model[num - 1]], num, val)) || false;
3096
- };
3097
- setValue = val => {
3098
- recursion(node.context, 0, val);
3099
- };
3100
- //按键按下=>只允许输入 数字/小数点
3101
- el.addEventListener('keypress', event => {
3102
- const e = event || window.event,
3103
- inputKey = String.fromCharCode(typeof e.charCode === 'number' ? e.charCode : e.keyCode);
3104
- content = e.target.value;
3105
- //定义方法,阻止输入 (1非指定键, 2.已存在小数点, 3.输入小数点,且位数为0,4。输入值大于最大值)
3106
- if ((!/\d|\./.test(inputKey) && !e.ctrlKey) || (content.indexOf('.') > 0 && inputKey === '.') || (inputKey === '.' && binding.value.decimal === 0) || e.target.value > binding.value.max) {
3107
- e.preventDefault ? e.preventDefault() : (e.returnValue = false);
3108
- }
3109
- });
3110
- // 按键弹起=>并限制最大最小
3111
- el.addEventListener('keyup', event => {
3112
- const e = event || window.event;
3113
- content = (!content && 0.0) || parseFloat(e.target.value);
3114
- let argMax = parseFloat(binding.value.max),
3115
- argMin = parseFloat(binding.value.min);
3116
- if (content > argMax) {
3117
- setValue(argMax);
3118
- content = argMax;
3119
- }
3120
- // if (content < argMin) {
3121
- // setValue(argMin);
3122
- // content = argMin;
3123
- // }
3124
- });
3125
- //失去焦点=>保留指定位小数
3126
- el.addEventListener('focus', event => {
3127
- const e = event || window.event;
3128
- if (!isNaN(Number(e.target.value)) && Number(e.target.value) !== 0) {
3129
- content = (!content && 0.0) || parseFloat(e.target.value || 0);
3130
- setValue(content.toFixed(parseFloat(binding.value.decimal)));
3131
- } else if (!isNaN(parseFloat(e.target.value))) {
3132
- setValue(parseFloat(e.target.value));
3133
- } else {
3134
- setValue('');
3135
- }
3136
- });
3137
- }
3138
- };
3139
- };
3140
- /* harmony default export */ var directives_onlyNumber = (onlyNumber);
3141
-
3142
- // CONCATENATED MODULE: ./packages/directives/preventShake.js
3143
- const preventShake = options => {
3144
- return {
3145
- inserted(el, binding) {
3146
- el.addEventListener('click', () => {
3147
- if (!el.disabled) {
3148
- el.disabled = true;
3149
- setTimeout(() => {
3150
- el.disabled = false;
3151
- }, binding.arg || options.time);
3152
- }
3153
- });
3154
- }
3155
- };
3156
- };
3157
- /* harmony default export */ var directives_preventShake = (preventShake);
3158
-
3159
- // CONCATENATED MODULE: ./packages/directives/watermark.js
3160
- const watermark = val => {
3161
- return {
3162
- bind: (el, binding) => {
3163
- function addWaterMarker(title, subTitle, parentNode, font, textColor) {
3164
- // 水印文字,父元素,字体,文字颜色
3165
- const can = document.createElement('canvas');
3166
- parentNode.appendChild(can);
3167
- can.width = val.width;
3168
- can.height = val.height;
3169
- can.style.display = 'none';
3170
- const cans = can.getContext('2d');
3171
- cans.rotate((-20 * Math.PI) / 180);
3172
- cans.font = font;
3173
- cans.fillStyle = textColor;
3174
- cans.textAlign = 'left';
3175
- cans.textBaseline = 'Middle';
3176
- cans.fillText(title, can.width / 3, can.height / 2);
3177
- cans.fillText(subTitle, can.width / 3, can.height / 2 + 20);
3178
- parentNode.style.backgroundImage = 'url(' + can.toDataURL('image/png') + ')';
3179
- }
3180
- addWaterMarker(binding.value.title || val.title, binding.value.subTitle || val.subTitle, el, binding.value.font || val.font, binding.value.textColor || val.fillStyle);
3181
- }
3182
- };
3183
- };
3184
-
3185
- /* harmony default export */ var directives_watermark = (watermark);
3186
-
3187
- // CONCATENATED MODULE: ./packages/directives/rightMenu.js
3188
- class Mask {
3189
- constructor() {
3190
- this.maskStyle = 'position:fixed;top:0;left:0;width:100%;height:100%;z-index:99997;';
3191
- }
3192
- add() {
3193
- const Mask = document.createElement('div');
3194
- Mask.style = this.maskStyle + 'display:none';
3195
- Mask.setAttribute('id', 'hc-right-menu-mask');
3196
- document.body.appendChild(Mask);
3197
- }
3198
- show() {
3199
- document.getElementById('hc-right-menu-mask').style = this.maskStyle + 'display:block';
3200
- }
3201
- hide() {
3202
- document.getElementById('hc-right-menu-mask').style = this.maskStyle + 'display:none';
3203
- }
3204
- }
3205
- // 阻止默认行为
3206
- const stopBehaves = el => {
3207
- el.stopPropagation(); //阻止冒泡事件
3208
- el.cancelBubble = true; //阻止冒泡事件ie
3209
- el.preventDefault(); //阻止默认事件
3210
- };
3211
- const rightMenu = val => {
3212
- let rightMenuNum = 0;
3213
- return {
3214
- // 插入时候触发
3215
- bind(el, binding, vnode) {
3216
- if (!(binding.value instanceof Array)) {
3217
- throw new Error('请设置右键菜单项目,数据类型为Array');
3218
- }
3219
- const Model = new Mask();
3220
- // 存放当前右键菜单ID名称
3221
- const currentDom = 'hc-right-menu' + rightMenuNum;
3222
- // 设置body宽高(为了遮照)
3223
- document.body.style.position = 'fixed';
3224
- document.body.style.width = '100%';
3225
- document.body.style.height = '100%';
3226
- el.style.position = el.style.position || 'relative';
3227
- el.style.zIndex = '99998';
3228
- // 增加一个遮罩层方便我控制菜单显示时候取消其余事件
3229
- Model.add();
3230
- el.addEventListener('contextmenu', event => {
3231
- const e = event || window.event;
3232
- stopBehaves(e);
3233
- // 菜单位置
3234
- const menuX = e.pageX || e.pageY ? e.pageX : e.clientX + document.body.scrollLeft - document.body.clientLeft; //获取pageX 兼容ie
3235
- const menuY = e.pageX || e.pageY ? e.pageY : e.clientY + document.body.scrollTop - document.body.clientTop;
3236
- // 隐藏所有菜单
3237
- for (let i = 0; i < rightMenuNum; i++) {
3238
- let rightMenuDom = document.getElementById('hc-right-menu' + i);
3239
- rightMenuDom && (rightMenuDom.style = `display:none`);
3240
- }
3241
- // 右键显示遮罩层
3242
- Model.show();
3243
- // 找不到这个节点时候 新增一个menu 用于多个菜单的兼容问题
3244
- if (!document.getElementById(currentDom)) {
3245
- // 创建div
3246
- let menuContent = document.createElement('div');
3247
- menuContent.className = 'hcRightMenu';
3248
- // 指令的绑定值进行遍历 生成菜单的节点
3249
- (binding.value || []).map(item => {
3250
- let childMenu = document.createElement('div');
3251
- // 文字内容
3252
- let content = item.name || '空';
3253
- // 设置节点文字不可选中
3254
- childMenu.setAttribute('unselectable', 'on');
3255
- childMenu.innerHTML = content;
3256
- childMenu.className = 'hcRightMenuChild';
3257
- // 菜单点击事件
3258
- childMenu.onclick = function () {
3259
- // 隐藏菜单的父级节点
3260
- childMenu.parentNode.style.display = 'none';
3261
- Model.hide();
3262
- // 用户无点击事件异常处理
3263
- return item.clickFunc ? vnode.context[item.clickFunc](item) : false;
3264
- };
3265
- // 禁用右键默认行为
3266
- childMenu.addEventListener('contextmenu', event => {
3267
- const e = event || window.event;
3268
- stopBehaves(e);
3269
- });
3270
- // 追加选项到总菜单
3271
- menuContent.appendChild(childMenu);
3272
- });
3273
- // 设置唯一id
3274
- menuContent.setAttribute('id', currentDom);
3275
- // 菜单的样式
3276
- menuContent.style = `top:${menuY}px;left:${menuX}px;`;
3277
- // 追加到页面
3278
- document.body.appendChild(menuContent);
3279
- } else {
3280
- // 节点已经存在则不需要重复创建 节省性能,只需要获取后设置位置即可
3281
- let menuContent = document.getElementById(currentDom);
3282
- menuContent.style = `top:${menuY}px;left:${menuX}px;`;
3283
- // 判断是否超出屏幕宽度
3284
- if (menuX + menuContent.clientWidth >= document.body.clientWidth) {
3285
- menuContent.style.left = menuX - menuContent.clientWidth + 'px';
3286
- }
3287
- // 判断是否超出屏幕高度
3288
- if (menuY + menuContent.clientHeight >= document.body.clientHeight) {
3289
- menuContent.style.top = menuY - menuContent.clientHeight + 'px';
3290
- }
3291
- }
3292
- });
3293
- // 每次创建都会使得唯一遍量增加 防止重复
3294
- rightMenuNum++;
3295
- const eventCallback = () => {
3296
- document.getElementById(currentDom) && (document.getElementById(currentDom).style = `display:none`);
3297
- document.getElementById('hc-right-menu-mask').style = 'display:none';
3298
- };
3299
- // 增加遮罩层的点击事件 (在空白处点击移除右键菜单)-》包含左键和右键点击
3300
- document.getElementById('hc-right-menu-mask').addEventListener('click', eventCallback);
3301
- document.getElementById('hc-right-menu-mask').addEventListener('contextmenu', eventCallback);
3302
- },
3303
- unbind(el) {
3304
- // 解绑时候移除右键监听防止影响其他页面
3305
- el.removeEventListener('contextmenu', this, true);
3306
- }
3307
- };
3308
- };
3309
- /* harmony default export */ var directives_rightMenu = (rightMenu);
3310
-
3311
- // CONCATENATED MODULE: ./packages/directives/index.js
3312
-
3313
-
3314
-
3315
-
3316
-
3317
-
3318
-
3319
-
3320
-
3321
- const directives = {
3322
- copy: directives_copy,
3323
- dialogDrag: directives_dialogDrag,
3324
- enter: directives_enter,
3325
- onlyNumber: directives_onlyNumber,
3326
- onlyInt: directives_onlyInt,
3327
- errImg: directives_errImg,
3328
- watermark: directives_watermark,
3329
- rightMenu: directives_rightMenu,
3330
- preventShake: directives_preventShake
3331
- };
3332
- // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
3333
- const directives_install = function (Vue, options) {
3334
- // 判断是否安装
3335
- if (directives_install.installed) return;
3336
- // 遍历注册全局组件
3337
- Object.keys(directives).forEach(e => {
3338
- Vue.directive(e, directives[e](options[e]));
3339
- });
3340
- };
3341
- // 判断是否是直接引入文件
3342
- if (typeof window !== 'undefined' && window.Vue) {
3343
- directives_install(window.Vue);
3344
- }
3345
-
3346
- /* harmony default export */ var packages_directives = ({
3347
- // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
3348
- install: directives_install
3349
- });
3350
-
3351
- // CONCATENATED MODULE: ./packages/filters/index.js
3352
- const timeInterval = val => {
3353
- const timeDiffVal = new Date().valueOf() - new Date(val).valueOf();
3354
- const timeDiff = Math.abs(timeDiffVal) / 1000;
3355
- const time = [
3356
- { time: 3600 * 24 * 365, unit: '年' },
3357
- { time: 3600 * 24 * 30, unit: '月' },
3358
- { time: 3600 * 24, unit: '天' },
3359
- { time: 3600, unit: '小时' },
3360
- { time: 60, unit: '分钟' },
3361
- { time: 1, unit: '秒' }
3362
- ];
3363
- for (let i = 0; i < time.length; i++) {
3364
- if (timeDiff > time[i].time) {
3365
- return Math.floor(timeDiff / time[i].time) + time[i].unit + (timeDiffVal > 0 ? '前' : '后');
3366
- }
3367
- }
3368
- };
3369
- // 手机中间四位加****
3370
- const encryptionPhone = val => {
3371
- val = String(val);
3372
- return val.replace(val.substr(3, 4), '****');
3373
- };
3374
- // 货币三位分隔
3375
- const moneyFormat = (money, isInt = true) => {
3376
- const float = isInt ? '' : '.00';
3377
- if (money) {
3378
- money = String(money);
3379
- let left = money.split('.')[0],
3380
- right = money.split('.')[1],
3381
- temp;
3382
- right = right ? (right.length >= 2 ? '.' + right.substr(0, 2) : '.' + right + 0) : float;
3383
- temp = left
3384
- .split('')
3385
- .reverse()
3386
- .join('')
3387
- .match(/(\d{1,3})/g);
3388
- return (Number(money) < 0 ? '-' : '') + temp.join(',').split('').reverse().join('') + right;
3389
- } else if (money === 0) {
3390
- return '0' + float;
3391
- }
3392
- return '';
3393
- };
3394
- // 数值0-9,添加'0'+value
3395
- const addZero = val => {
3396
- return val < 10 ? '0' + val : val;
3397
- };
3398
-
3399
- // 时间戳和中国标准时间 => 格式化时间的具体年月日时分秒
3400
- const timeLongToString = value => {
3401
- const date = new Date();
3402
- if (value) {
3403
- date.setTime(value);
3404
- }
3405
- let year = date.getFullYear(),
3406
- month = addZero(date.getMonth() + 1),
3407
- day = addZero(date.getDate()),
3408
- hour = addZero(date.getHours()),
3409
- minute = addZero(date.getMinutes()),
3410
- second = addZero(date.getSeconds()),
3411
- weekend = date.getDay();
3412
- return {
3413
- year: year,
3414
- month: month,
3415
- day: day,
3416
- hour: hour,
3417
- minute: minute,
3418
- second: second,
3419
- weekend: weekend
3420
- };
3421
- };
3422
- //中国标准时间和格式化时间 => 时间戳
3423
- const timeStringToLong = date => {
3424
- let timestamp = Date.parse(date);
3425
- return timestamp;
3426
- };
3427
- // 时间戳和中国标准时间 => 格式化时间
3428
- const timeFormat = (value, type = 'yyMMdd hhMMss', separator = '-') => {
3429
- if (!value) {
3430
- return '';
3431
- }
3432
- let timeJson = timeLongToString(value),
3433
- dateTime = '',
3434
- year = timeJson.year,
3435
- month = timeJson.month,
3436
- day = timeJson.day,
3437
- hour = timeJson.hour,
3438
- minute = timeJson.minute,
3439
- second = timeJson.second;
3440
- switch (type) {
3441
- case 'yy':
3442
- dateTime = year;
3443
- break;
3444
- case 'yyMM':
3445
- dateTime = year + separator + month;
3446
- break;
3447
- case 'yyMMdd':
3448
- dateTime = year + separator + month + separator + day;
3449
- break;
3450
- case 'yyMMdd hhMMss':
3451
- dateTime = year + separator + month + separator + day + ' ' + hour + ':' + minute + ':' + second;
3452
- break;
3453
- case 'yyMMdd hhMM':
3454
- dateTime = year + separator + month + separator + day + ' ' + hour + ':' + minute;
3455
- break;
3456
- case 'MMdd hhMM':
3457
- dateTime = month + separator + day + ' ' + hour + ':' + minute;
3458
- break;
3459
- case 'hhMMss':
3460
- dateTime = hour + ':' + minute + ':' + second;
3461
- break;
3462
- case 'hhMM':
3463
- dateTime = hour + ':' + minute;
3464
- break;
3465
- }
3466
- return dateTime;
3467
- };
3468
- const filters = { encryptionPhone, timeInterval, moneyFormat, addZero, timeStringToLong, timeFormat };
3469
- // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
3470
- const filters_install = function (Vue) {
3471
- // 判断是否安装
3472
- if (filters_install.installed) return;
3473
- // 遍历注册全局组件
3474
- Object.keys(filters).forEach(e => {
3475
- Vue.filter(e, filters[e]);
3476
- });
3477
- };
3478
- // 判断是否是直接引入文件
3479
- if (typeof window !== 'undefined' && window.Vue) {
3480
- filters_install(window.Vue);
3481
- }
3482
-
3483
- /* harmony default export */ var packages_filters = ({
3484
- // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
3485
- install: filters_install
3486
- });
3487
-
3488
- // EXTERNAL MODULE: ./node_modules/axios/index.js
3489
- var axios = __webpack_require__("bc3a");
3490
- var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
3491
-
3492
- // CONCATENATED MODULE: ./packages/utils/valid/index.js
3493
- const Valid = {
3494
- /* 证件号码验证 */
3495
- // IDCard: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/g,
3496
- IDCard: /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
3497
-
3498
- /* 数字验证 */
3499
- Number: /^[0-9]*$/g,
3500
-
3501
- /* 6位数验证码验证 */
3502
- VerificationCode: /^\d{6}$/g,
3503
-
3504
- /* 手机号码或者电话号码验证 */
3505
- // MobilePhoneNumber: /^1[3|5|7|8]\d{9}$/,
3506
- // MobilePhoneNumber: /^(\+)?(\d{2,3})?1\d{10}$/,
3507
- MobilePhoneNumber: /^1((34[0-8])|(8\d{2})|(([35][0-35-9]|4[579]|66|7[35678]|9[1389])\d{1}))\d{7}$/,
3508
-
3509
- TelPhoneNumber: /^0\d{2,3}-?\d{7,8}$/,
3510
-
3511
- /* 网址地址验证 */
3512
- Www: /\b(([\w-]+:\/\/?|www[.])[^\s()<>]+(?:[\w\d]+|([^[:punct:]\s]|\/)))/,
3513
-
3514
- /* 邮箱地址输入验证 */
3515
- Email: /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/,
3516
-
3517
- /* 统一社会信用代码验证 */
3518
- CreditCode: /^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/g,
3519
-
3520
- /* 统一社会信用代码验证 */
3521
- Fax: /^(\d{3,4}-)?\d{7,8}$/,
3522
-
3523
- /* 中文、英文、数字 */
3524
- ChEnNumber: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/g,
3525
-
3526
- // 正整数
3527
- positiveInteger: /^\+?[1-9]\d*$/g,
3528
-
3529
- // 邮编
3530
- PostalCode: /^[a-zA-Z0-9 ]{3,12}$/
3531
- };
3532
-
3533
- /* harmony default export */ var valid = (Valid);
3534
-
3535
- // EXTERNAL MODULE: ./node_modules/crypto-js/crypto-js.js
3536
- var crypto_js = __webpack_require__("8429");
3537
- var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
3538
-
3539
- // CONCATENATED MODULE: ./packages/utils/encrypt/AES.js
3540
-
3541
-
3542
- function Init(KEYs, IVs) {
3543
- // 默认的 KEY 与 iv 如果没有给
3544
- const KEY = KEYs || '1234567812345678'; //""中与后台一样 密钥
3545
- const IV = IVs || '1234567812345678'; //""中与后台一样 密钥偏移量
3546
-
3547
- /**
3548
- * AES加密 :字符串 key iv 返回base64
3549
- */
3550
- const Encrypt = (word, keyStr = KEY, ivStr = IV) => {
3551
- let key = crypto_js_default.a.enc.Utf8.parse(keyStr);
3552
- let iv = crypto_js_default.a.enc.Utf8.parse(ivStr);
3553
-
3554
- let srcs = crypto_js_default.a.enc.Utf8.parse(word);
3555
- let encrypted = crypto_js_default.a.AES.encrypt(srcs, key, {
3556
- iv,
3557
- mode: crypto_js_default.a.mode.CBC,
3558
- padding: crypto_js_default.a.pad.Pkcs7
3559
- });
3560
- return crypto_js_default.a.enc.Base64.stringify(encrypted.ciphertext);
3561
- };
3562
-
3563
- /**
3564
- * AES 解密 :字符串 key iv 返回base64
3565
- *
3566
- */
3567
- const Decrypt = (word, keyStr = KEY, ivStr = IV) => {
3568
- let key = crypto_js_default.a.enc.Utf8.parse(keyStr);
3569
- let iv = crypto_js_default.a.enc.Utf8.parse(ivStr);
3570
-
3571
- let src = crypto_js_default.a.enc.Base64.stringify(crypto_js_default.a.enc.Base64.parse(word));
3572
-
3573
- const decrypt = crypto_js_default.a.AES.decrypt(src, key, {
3574
- iv,
3575
- mode: crypto_js_default.a.mode.CBC,
3576
- padding: crypto_js_default.a.pad.Pkcs7
3577
- });
3578
- return decrypt.toString(crypto_js_default.a.enc.Utf8);
3579
- };
3580
- return {
3581
- Encrypt,
3582
- Decrypt
3583
- };
3584
- }
3585
-
3586
- function randomString(len = 16) {
3587
- let $chars = 'ABCDEFabcdef0123456789';
3588
- let maxPos = $chars.length; //获取$char的长度
3589
- let pwd = ''; //初始化密码
3590
- for (let i = 0; i < len; i++) {
3591
- pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
3592
- }
3593
- return pwd;
3594
- }
3595
-
3596
- /* harmony default export */ var encrypt_AES = ({
3597
- encryptInit: Init
3598
- });
3599
-
3600
- // CONCATENATED MODULE: ./packages/utils/encrypt/index.js
3601
-
3602
- // import RSA from './RSA';
3603
- /* harmony default export */ var encrypt = ({
3604
- AES: encrypt_AES
3605
- // RSA
3606
- });
3607
-
3608
- // CONCATENATED MODULE: ./packages/utils/index.js
3609
-
3610
-
3611
-
3612
-
3613
- const setElement = Vue => {
3614
- Vue.use(element_ui_common_default.a);
3615
- // ElementUI的全局函数注册到Vue到全局
3616
- Vue.prototype.$messge = element_ui_common_default.a.Message;
3617
- Vue.prototype.$msgbox = element_ui_common_default.a.MessageBox;
3618
- Vue.prototype.$alert = element_ui_common_default.a.MessageBox.alert;
3619
- Vue.prototype.$confirm = element_ui_common_default.a.MessageBox.confirm;
3620
- Vue.prototype.$prompt = element_ui_common_default.a.MessageBox.prompt;
3621
- Vue.prototype.$notify = element_ui_common_default.a.Notification;
3622
- };
3623
-
3624
- const setEncrypt = (Vue, options) => {
3625
- const AES = encrypt.AES.encryptInit(options.Encrypt.AES.KEY, options.Encrypt.AES.IV);
3626
- Vue.prototype.$AES = {
3627
- encrypt: AES.Encrypt,
3628
- decrypt: AES.Decrypt
3629
- };
3630
- // const RSA = encrypt.RSA.encryptInit(options.Encrypt.RSA.publicKey, options.Encrypt.privateKey);
3631
- // Vue.prototype.$RSA = {
3632
- // encrypt: RSA.Encrypt,
3633
- // decrypt: RSA.Decrypt,
3634
- // signature: RSA.Signature,
3635
- // verify: RSA.Verify,
3636
- // };
3637
- };
3638
-
3639
-
3640
- // CONCATENATED MODULE: ./packages/http/index.js
3641
- /**
3642
- * @file 本文件为服务调用插件实现
3643
- * @author Yang。
3644
- */
3645
-
3646
-
3647
-
3648
-
3649
- /**
3650
- * 深度合并多个对象,返回合并后的新对象
3651
- * @private
3652
- * @param {...Object} objs 多个对象
3653
- * @return {Object} 返回合并后的新对象,原对象内容不变
3654
- */
3655
- const statusCode = {
3656
- 400: '错误请求',
3657
- 401: '未授权,请重新登录',
3658
- 403: '拒绝访问',
3659
- 404: '请求错误,未找到该资源',
3660
- 405: '请求方法未允许',
3661
- 408: '请求超时',
3662
- 500: '服务器端出错',
3663
- 501: '网络未实现',
3664
- 502: '网络错误',
3665
- 503: '服务不可用',
3666
- 504: '网络超时',
3667
- 505: 'http版本不支持该请求'
3668
- };
3669
-
3670
- let showError = (errorMsg, alwaysDisplay) => element_ui_common["Message"].error(errorMsg || '服务调用出错');
3671
-
3672
- const httpInit = (option = {}) => {
3673
- const { config = {}, successCode, token, requestCallback, responseCallback } = option;
3674
- const getInstances = conf => {
3675
- let result = {};
3676
- let opts = func.deepMerge(axios_default.a.defaults, conf);
3677
- for (let key in opts) {
3678
- axios_default.a.defaults[key] = opts[key];
3679
- }
3680
- // axios.defaults.headers['Content-Type'] = 'application/json';
3681
- result.$http = axios_default.a;
3682
- return result;
3683
- },
3684
- requestInterceptor = config => {
3685
- if (requestCallback && typeof requestCallback === 'function') {
3686
- requestCallback(config);
3687
- } else {
3688
- // 将post方法的content-type 设置为 application/x-www-form-item-item-urlencoded
3689
- config.headers.common.token = token;
3690
- if (config.method === 'post') {
3691
- let data = config.data;
3692
- for (let key in data) {
3693
- if (data[key] === null) data[key] = '';
3694
- }
3695
- }
3696
- }
3697
- return config;
3698
- },
3699
- requestError = error => Promise.reject(error),
3700
- responseInterceptor = response => {
3701
- if (responseCallback && typeof responseCallback === 'function') {
3702
- return responseCallback(response);
3703
- }
3704
- return response.data;
3705
- },
3706
- responseError = error => {
3707
- if (error && error.response) {
3708
- showError(statusCode[error.response.status] || `连接错误${error.response.status}`);
3709
- if ([401, 404].includes(error.response.status)) {
3710
- // window.location.href = error.response.status === '401' ? '/login' : '/NotFound';
3711
- }
3712
- } else {
3713
- showError(JSON.stringify(error).includes('timeout') ? '服务器响应超时,请刷新当前页' : '连接服务器失败');
3714
- }
3715
- return Promise.reject(error);
3716
- };
3717
- axios_default.a.defaults.headers = Object.assign(axios_default.a.defaults.headers, config.headers);
3718
- const http = getInstances(config);
3719
- // 默认服务调用拦截器设置
3720
- http.$http.interceptors.request.use(requestInterceptor, requestError);
3721
- http.$http.interceptors.response.use(responseInterceptor, responseError);
3722
-
3723
- return axios_default.a;
3724
- };
3725
-
3726
- /* harmony default export */ var packages_http = (httpInit);
3727
-
3728
- // CONCATENATED MODULE: ./packages/index.js
3729
- // 内需插件: 深度合并、ELementUI
3730
-
3731
-
3732
- // 引入hc-basic包默认配置可被外部传入参数覆盖
3733
-
3734
-
3735
- // 引入公共组件、指令、过滤器
3736
-
3737
-
3738
-
3739
-
3740
- // 引入axios配置
3741
-
3742
-
3743
- // 引入公共函数(数组函数、对象函数、日期函数、cookies函数)、引入验证正则、加密解密方法
3744
-
3745
-
3746
- // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册1
3747
- const packages_install = (Vue, option = {}) => {
3748
- // 判断是否安装
3749
- if (packages_install.installed) return;
3750
- const options = cjs_default()(packages_options, option);
3751
- Vue.prototype.$Config = options;
3752
- setElement(Vue);
3753
- // 遍历注册全局组件
3754
- Vue.use(packages_components);
3755
- Vue.use(packages_directives, options.directives);
3756
- Vue.use(packages_filters);
3757
- Vue.prototype.$hcHttp = packages_http(options.axios);
3758
- Vue.prototype.$Func = func;
3759
- Vue.prototype.$Valid = valid;
3760
- setEncrypt(Vue, options);
3761
- };
3762
-
3763
- // 判断是否是直接引入文件
3764
- if (typeof window !== 'undefined' && window.Vue) {
3765
- packages_install(window.Vue);
3766
- }
3767
-
3768
- /* harmony default export */ var packages_0 = __webpack_exports__["a"] = ({
3769
- // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
3770
- install: packages_install
3771
- });
3772
-
3773
-
3774
- /***/ }),
3775
-
3776
- /***/ "7110":
3777
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3778
-
3779
- "use strict";
3780
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_inputNumber_vue_vue_type_style_index_0_id_1074373a_prod_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("f172");
3781
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_inputNumber_vue_vue_type_style_index_0_id_1074373a_prod_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_inputNumber_vue_vue_type_style_index_0_id_1074373a_prod_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
3782
- /* unused harmony reexport * */
3783
-
3784
-
3785
- /***/ }),
3786
-
3787
- /***/ "8bbf":
3788
- /***/ (function(module, exports) {
3789
-
3790
- module.exports = require("vue");
3791
-
3792
- /***/ }),
3793
-
3794
- /***/ "e3b2":
3795
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3796
-
3797
- "use strict";
3798
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_a4062538_prod_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1ee1");
3799
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_a4062538_prod_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_a4062538_prod_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
3800
- /* unused harmony reexport * */
3801
-
3802
-
3803
- /***/ }),
3804
-
3805
- /***/ "f172":
3806
- /***/ (function(module, exports, __webpack_require__) {
3807
-
3808
- // extracted by mini-css-extract-plugin
3809
-
3810
- /***/ })
3811
-
3812
- },[["fb15",10,2,0,1,5,6,7,3,4,9,11]]]);