@luzhaoqi/test 0.0.15 → 0.0.17

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 (2) hide show
  1. package/dist/lib-cjs.js +855 -53
  2. package/package.json +1 -1
package/dist/lib-cjs.js CHANGED
@@ -17592,7 +17592,7 @@ var variables = {"menuColor":"#bfcbd9","menuLightColor":"rgba(0, 0, 0, 0.7)","me
17592
17592
 
17593
17593
  // import Item from './Item.vue'
17594
17594
 
17595
- var script$2 = {
17595
+ var script$5 = {
17596
17596
  name: 'k-icon',
17597
17597
  data() {
17598
17598
  return {
@@ -17701,10 +17701,10 @@ var normalizeComponent_1 = normalizeComponent;
17701
17701
  var __vue_normalize__ = /*@__PURE__*/getDefaultExportFromCjs(normalizeComponent_1);
17702
17702
 
17703
17703
  /* script */
17704
- const __vue_script__$2 = script$2;
17704
+ const __vue_script__$5 = script$5;
17705
17705
 
17706
17706
  /* template */
17707
- var __vue_render__$2 = function () {
17707
+ var __vue_render__$5 = function () {
17708
17708
  var _vm = this;
17709
17709
  var _h = _vm.$createElement;
17710
17710
  var _c = _vm._self._c || _h;
@@ -17716,17 +17716,17 @@ var __vue_render__$2 = function () {
17716
17716
  _vm._v("\n " + _vm._s(_vm.variables) + "\n"),
17717
17717
  ])
17718
17718
  };
17719
- var __vue_staticRenderFns__$2 = [];
17720
- __vue_render__$2._withStripped = true;
17719
+ var __vue_staticRenderFns__$5 = [];
17720
+ __vue_render__$5._withStripped = true;
17721
17721
 
17722
17722
  /* style */
17723
- const __vue_inject_styles__$2 = undefined;
17723
+ const __vue_inject_styles__$5 = undefined;
17724
17724
  /* scoped */
17725
- const __vue_scope_id__$2 = undefined;
17725
+ const __vue_scope_id__$5 = undefined;
17726
17726
  /* module identifier */
17727
- const __vue_module_identifier__$2 = undefined;
17727
+ const __vue_module_identifier__$5 = undefined;
17728
17728
  /* functional template */
17729
- const __vue_is_functional_template__$2 = false;
17729
+ const __vue_is_functional_template__$5 = false;
17730
17730
  /* style inject */
17731
17731
 
17732
17732
  /* style inject SSR */
@@ -17735,22 +17735,22 @@ __vue_render__$2._withStripped = true;
17735
17735
 
17736
17736
 
17737
17737
 
17738
- const __vue_component__$2 = /*#__PURE__*/__vue_normalize__(
17739
- { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
17740
- __vue_inject_styles__$2,
17741
- __vue_script__$2,
17742
- __vue_scope_id__$2,
17743
- __vue_is_functional_template__$2,
17744
- __vue_module_identifier__$2,
17738
+ const __vue_component__$5 = /*#__PURE__*/__vue_normalize__(
17739
+ { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
17740
+ __vue_inject_styles__$5,
17741
+ __vue_script__$5,
17742
+ __vue_scope_id__$5,
17743
+ __vue_is_functional_template__$5,
17744
+ __vue_module_identifier__$5,
17745
17745
  false,
17746
17746
  undefined,
17747
17747
  undefined,
17748
17748
  undefined
17749
17749
  );
17750
17750
 
17751
- __vue_component__$2.install = function (Vue, option) {
17751
+ __vue_component__$5.install = function (Vue, option) {
17752
17752
  setGolbalData(Vue, option);
17753
- Vue.component(__vue_component__$2.name, __vue_component__$2);
17753
+ Vue.component(__vue_component__$5.name, __vue_component__$5);
17754
17754
  };
17755
17755
 
17756
17756
  var axios$3 = {exports: {}};
@@ -93893,14 +93893,14 @@ function createAxios(Vue) {
93893
93893
  }
93894
93894
  }
93895
93895
 
93896
- function install$2(Vue, option = {}) {
93896
+ function install$3(Vue, option = {}) {
93897
93897
  setGolbalData(Vue, option);
93898
93898
  const $http = createAxios(Vue);
93899
93899
  Vue.prototype.$z.$http = $http;
93900
93900
  }
93901
93901
 
93902
93902
  var RequestZ = {
93903
- install: install$2
93903
+ install: install$3
93904
93904
  };
93905
93905
 
93906
93906
  var nprogress = {exports: {}};
@@ -94467,13 +94467,13 @@ function createRouter(Vue) {
94467
94467
  }
94468
94468
  }
94469
94469
 
94470
- function install$1(Vue, option = {}) {
94470
+ function install$2(Vue, option = {}) {
94471
94471
  setGolbalData(Vue, option);
94472
94472
  createRouter(Vue);
94473
94473
  }
94474
94474
 
94475
94475
  var RouterZ = {
94476
- install: install$1
94476
+ install: install$2
94477
94477
  };
94478
94478
 
94479
94479
  //
@@ -94545,7 +94545,7 @@ var RouterZ = {
94545
94545
  //
94546
94546
  //
94547
94547
 
94548
- var script$1 = {
94548
+ var script$4 = {
94549
94549
  name: 'z-table',
94550
94550
  computed: {
94551
94551
  globalConfig() {
@@ -94690,10 +94690,10 @@ var browser = createInjector;
94690
94690
  var __vue_create_injector__ = /*@__PURE__*/getDefaultExportFromCjs(browser);
94691
94691
 
94692
94692
  /* script */
94693
- const __vue_script__$1 = script$1;
94693
+ const __vue_script__$4 = script$4;
94694
94694
 
94695
94695
  /* template */
94696
- var __vue_render__$1 = function () {
94696
+ var __vue_render__$4 = function () {
94697
94697
  var _vm = this;
94698
94698
  var _h = _vm.$createElement;
94699
94699
  var _c = _vm._self._c || _h;
@@ -94877,43 +94877,43 @@ var __vue_render__$1 = function () {
94877
94877
  1
94878
94878
  )
94879
94879
  };
94880
- var __vue_staticRenderFns__$1 = [];
94881
- __vue_render__$1._withStripped = true;
94880
+ var __vue_staticRenderFns__$4 = [];
94881
+ __vue_render__$4._withStripped = true;
94882
94882
 
94883
94883
  /* style */
94884
- const __vue_inject_styles__$1 = function (inject) {
94884
+ const __vue_inject_styles__$4 = function (inject) {
94885
94885
  if (!inject) return
94886
94886
  inject("data-v-7bdbe6c8_0", { source: ".z-table-comp .z-table-header-btn-group[data-v-7bdbe6c8] {\n padding-bottom: 10px;\n display: flex;\n}\n.z-table-comp .z-table-header-btn-group .leftMenu[data-v-7bdbe6c8] {\n flex: 1;\n margin-right: 20px;\n}\n.z-table-comp .btn-box[data-v-7bdbe6c8] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n}\n.z-table-comp .btn-box[data-v-7bdbe6c8] .el-button {\n padding: 0 !important;\n}\n.z-table-comp .pagination-box[data-v-7bdbe6c8] {\n text-align: right;\n}\n.z-table-comp .pagination-box[data-v-7bdbe6c8] .el-pagination {\n margin-top: 25px;\n}\n\n/*# sourceMappingURL=table.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\table\\table.vue","table.vue"],"names":[],"mappings":"AA8JA;EACA,oBAAA;EACA,aAAA;AC7JA;AD8JA;EACA,OAAA;EACA,kBAAA;AC5JA;AD+JA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,WAAA;AC7JA;AD8JA;EACA,qBAAA;AC5JA;AD+JA;EACA,iBAAA;AC7JA;AD8JA;EACA,gBAAA;AC5JA;;AAEA,oCAAoC","file":"table.vue","sourcesContent":["<template>\r\n <div class=\"z-table-comp\">\r\n <!-- 头部按钮-->\r\n <div class=\"z-table-header-btn-group\" v-if=\"$slots.leftMenu || $slots.rightMenu\">\r\n <div class=\"leftMenu\">\r\n <slot name=\"leftMenu\"></slot>\r\n </div>\r\n <div class=\"rightMenu\">\r\n <slot name=\"rightMenu\"></slot>\r\n </div>\r\n </div>\r\n <!-- 表格 -->\r\n <el-table v-loading=\"loading\" :data=\"tableData\" ref=\"table\" :border=\"tableOption.border\">\r\n <template v-for=\"(o, i) in tableOption.column\">\r\n <!-- 序号和选中 -->\r\n <el-table-column\r\n :key=\"'item' + i\"\r\n v-if=\"o.type && !o.prop\"\r\n :type=\"o.type\"\r\n :width=\"o.width || 60\"\r\n :label=\"o.label\"\r\n :index=\"getIndex(i)\"\r\n :align=\"o.align || 'center'\"\r\n />\r\n <!-- 操作按钮 -->\r\n <el-table-column\r\n :align=\"o.align || 'center'\"\r\n :key=\"'item' + i\"\r\n v-else-if=\"o.slot && o.prop === 'menu'\"\r\n :label=\"o.label\"\r\n :width=\"o.width || null\"\r\n >\r\n <template #default=\"{ row, $index }\">\r\n <div class=\"btn-box\">\r\n <slot :name=\"o.prop\" :row=\"row\" :$index=\"$index\"></slot>\r\n </div>\r\n </template>\r\n </el-table-column>\r\n <!-- 插槽 -->\r\n <el-table-column :align=\"o.align || 'center'\" :key=\"'item' + i\" v-else-if=\"o.slot\" :label=\"o.label\" :width=\"o.width || null\">\r\n <template #default=\"{ row, $index }\">\r\n <div class=\"z-cell\">\r\n <slot :name=\"o.prop\" :row=\"row\" :$index=\"$index\"></slot>\r\n </div>\r\n </template>\r\n </el-table-column>\r\n <!-- 针对其他默认情况 -->\r\n <el-table-column :align=\"o.align || 'center'\" :key=\"'item' + i\" v-else :label=\"o.label\" :prop=\"o.prop\" :width=\"o.width || null\">\r\n </el-table-column>\r\n </template>\r\n </el-table>\r\n <div class=\"pagination-box\" v-if=\"tableOption.pagination || tableOption.pagination === undefined\">\r\n <!-- hide-on-single-page-->\r\n <el-pagination\r\n background\r\n @size-change=\"handleSizeChange\"\r\n @current-change=\"handleCurrentChange\"\r\n :page-sizes=\"[10, 20, 30, 40, 50, 100]\"\r\n :page-size.sync=\"pageParams[globalConfig.pageSize]\"\r\n :current-page.sync=\"pageParams[globalConfig.pageNum]\"\r\n layout=\"total, sizes, prev, pager, next, jumper\"\r\n :total=\"total\"\r\n >\r\n </el-pagination>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'z-table',\r\n computed: {\r\n globalConfig() {\r\n if (!this.pageParamsConfig.isDefault) {\r\n return this.pageParamsConfig\r\n } else if (this.$z.list) {\r\n return this.$z.list\r\n }\r\n return this.pageParamsConfig\r\n }\r\n },\r\n props: {\r\n // 表格配置\r\n tableOption: {\r\n type: Object,\r\n required: true,\r\n default() {\r\n return {\r\n api: function () {\r\n return Promise.resolve()\r\n },\r\n column: []\r\n }\r\n }\r\n },\r\n // 表格数据\r\n tableData: {\r\n type: Array,\r\n default: () => {\r\n return []\r\n }\r\n },\r\n // 页码配置\r\n pageParamsConfig: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n pageSize: 'pageSize',\r\n pageNum: 'pageNum',\r\n isDefault: true\r\n }\r\n }\r\n },\r\n // 页码参数\r\n pageParams: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n pageSize: 10,\r\n pageNum: 1\r\n }\r\n }\r\n },\r\n total: {\r\n type: Number,\r\n default: 0\r\n },\r\n // 禁用\r\n disabled: {\r\n type: Boolean,\r\n default: () => false\r\n },\r\n // 等待\r\n loading: {\r\n type: Boolean,\r\n default: () => false\r\n }\r\n },\r\n methods: {\r\n // 计算序号\r\n getIndex(index) {\r\n return index + 1 + (this.pageParams[this.globalConfig.pageNum] - 1) * this.pageParams[this.globalConfig.pageSize]\r\n },\r\n // 分数数量改变\r\n handleSizeChange() {\r\n this.pageParams[this.globalConfig.pageNum] = 1\r\n this.$emit('getData')\r\n },\r\n // 页码改变\r\n handleCurrentChange() {\r\n this.$emit('getData')\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n.z-table-comp {\r\n .z-table-header-btn-group {\r\n padding-bottom: 10px;\r\n display: flex;\r\n .leftMenu {\r\n flex: 1;\r\n margin-right: 20px;\r\n }\r\n }\r\n .btn-box {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 100%;\r\n ::v-deep .el-button {\r\n padding: 0 !important;\r\n }\r\n }\r\n .pagination-box {\r\n text-align: right;\r\n ::v-deep .el-pagination {\r\n margin-top: 25px;\r\n }\r\n }\r\n}\r\n</style>\r\n",".z-table-comp .z-table-header-btn-group {\n padding-bottom: 10px;\n display: flex;\n}\n.z-table-comp .z-table-header-btn-group .leftMenu {\n flex: 1;\n margin-right: 20px;\n}\n.z-table-comp .btn-box {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n}\n.z-table-comp .btn-box ::v-deep .el-button {\n padding: 0 !important;\n}\n.z-table-comp .pagination-box {\n text-align: right;\n}\n.z-table-comp .pagination-box ::v-deep .el-pagination {\n margin-top: 25px;\n}\n\n/*# sourceMappingURL=table.vue.map */"]}, media: undefined });
94887
94887
 
94888
94888
  };
94889
94889
  /* scoped */
94890
- const __vue_scope_id__$1 = "data-v-7bdbe6c8";
94890
+ const __vue_scope_id__$4 = "data-v-7bdbe6c8";
94891
94891
  /* module identifier */
94892
- const __vue_module_identifier__$1 = undefined;
94892
+ const __vue_module_identifier__$4 = undefined;
94893
94893
  /* functional template */
94894
- const __vue_is_functional_template__$1 = false;
94894
+ const __vue_is_functional_template__$4 = false;
94895
94895
  /* style inject SSR */
94896
94896
 
94897
94897
  /* style inject shadow dom */
94898
94898
 
94899
94899
 
94900
94900
 
94901
- const __vue_component__$1 = /*#__PURE__*/__vue_normalize__(
94902
- { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
94903
- __vue_inject_styles__$1,
94904
- __vue_script__$1,
94905
- __vue_scope_id__$1,
94906
- __vue_is_functional_template__$1,
94907
- __vue_module_identifier__$1,
94901
+ const __vue_component__$4 = /*#__PURE__*/__vue_normalize__(
94902
+ { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
94903
+ __vue_inject_styles__$4,
94904
+ __vue_script__$4,
94905
+ __vue_scope_id__$4,
94906
+ __vue_is_functional_template__$4,
94907
+ __vue_module_identifier__$4,
94908
94908
  false,
94909
94909
  __vue_create_injector__,
94910
94910
  undefined,
94911
94911
  undefined
94912
94912
  );
94913
94913
 
94914
- __vue_component__$1.install = function (Vue, option = {}) {
94914
+ __vue_component__$4.install = function (Vue, option = {}) {
94915
94915
  setGolbalData(Vue, option);
94916
- Vue.component(__vue_component__$1.name, __vue_component__$1);
94916
+ Vue.component(__vue_component__$4.name, __vue_component__$4);
94917
94917
  };
94918
94918
 
94919
94919
  //
@@ -94941,7 +94941,7 @@ __vue_component__$1.install = function (Vue, option = {}) {
94941
94941
  //
94942
94942
  //
94943
94943
 
94944
- var script = {
94944
+ var script$3 = {
94945
94945
  name: 'z-list',
94946
94946
  props: {
94947
94947
  // 表格配置
@@ -94985,8 +94985,8 @@ var script = {
94985
94985
  pageParams: {
94986
94986
  // pageSize: 10,
94987
94987
  // pageNum: 1
94988
- // total: 0
94989
94988
  },
94989
+ total: 0,
94990
94990
  // 搜索参数
94991
94991
  queryParams: {},
94992
94992
  // 表格数据
@@ -95008,8 +95008,7 @@ var script = {
95008
95008
  resetPageParams() {
95009
95009
  this.pageParams = {
95010
95010
  [this.globalConfig.pageSize]: 10,
95011
- [this.globalConfig.pageNum]: 1,
95012
- [this.globalConfig.total]: 0
95011
+ [this.globalConfig.pageNum]: 1
95013
95012
  };
95014
95013
  },
95015
95014
  resetQuery() {
@@ -95037,7 +95036,7 @@ var script = {
95037
95036
  })
95038
95037
  .then((res) => {
95039
95038
  this.tableData = res[this.globalConfig.res];
95040
- this.pageParams.total = res[this.globalConfig.total];
95039
+ this.total = res[this.globalConfig.total];
95041
95040
  this.loading = false;
95042
95041
  });
95043
95042
  // }, 200)
@@ -95046,10 +95045,10 @@ var script = {
95046
95045
  };
95047
95046
 
95048
95047
  /* script */
95049
- const __vue_script__ = script;
95048
+ const __vue_script__$3 = script$3;
95050
95049
 
95051
95050
  /* template */
95052
- var __vue_render__ = function () {
95051
+ var __vue_render__$3 = function () {
95053
95052
  var _vm = this;
95054
95053
  var _h = _vm.$createElement;
95055
95054
  var _c = _vm._self._c || _h;
@@ -95096,6 +95095,7 @@ var __vue_render__ = function () {
95096
95095
  tableOption: _vm.tableOption,
95097
95096
  tableData: _vm.tableData,
95098
95097
  pageParams: _vm.pageParams,
95098
+ total: _vm.total,
95099
95099
  },
95100
95100
  on: { getData: _vm.getList },
95101
95101
  scopedSlots: _vm._u(
@@ -95133,17 +95133,815 @@ var __vue_render__ = function () {
95133
95133
  2
95134
95134
  )
95135
95135
  };
95136
+ var __vue_staticRenderFns__$3 = [];
95137
+ __vue_render__$3._withStripped = true;
95138
+
95139
+ /* style */
95140
+ const __vue_inject_styles__$3 = function (inject) {
95141
+ if (!inject) return
95142
+ inject("data-v-378264cd_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"list.vue"}, media: undefined });
95143
+
95144
+ };
95145
+ /* scoped */
95146
+ const __vue_scope_id__$3 = "data-v-378264cd";
95147
+ /* module identifier */
95148
+ const __vue_module_identifier__$3 = undefined;
95149
+ /* functional template */
95150
+ const __vue_is_functional_template__$3 = false;
95151
+ /* style inject SSR */
95152
+
95153
+ /* style inject shadow dom */
95154
+
95155
+
95156
+
95157
+ const __vue_component__$3 = /*#__PURE__*/__vue_normalize__(
95158
+ { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
95159
+ __vue_inject_styles__$3,
95160
+ __vue_script__$3,
95161
+ __vue_scope_id__$3,
95162
+ __vue_is_functional_template__$3,
95163
+ __vue_module_identifier__$3,
95164
+ false,
95165
+ __vue_create_injector__,
95166
+ undefined,
95167
+ undefined
95168
+ );
95169
+
95170
+ __vue_component__$3.install = function (Vue, option = {}) {
95171
+ setGolbalData(Vue, option);
95172
+ Vue.component(__vue_component__$3.name, __vue_component__$3);
95173
+ };
95174
+
95175
+ /**
95176
+ * @classdesc 字典数据
95177
+ * @property {String} label 标签
95178
+ * @property {*} value 标签
95179
+ * @property {Object} raw 原始数据
95180
+ */
95181
+ class DictData {
95182
+ constructor(label, value, raw) {
95183
+ this.label = label;
95184
+ this.value = value;
95185
+ this.raw = raw;
95186
+ }
95187
+ }
95188
+
95189
+ function dictConverter (dict, dictMeta) {
95190
+ const label = determineDictField(dict, dictMeta.labelField, ...options.DEFAULT_LABEL_FIELDS);
95191
+ const value = determineDictField(dict, dictMeta.valueField, ...options.DEFAULT_VALUE_FIELDS);
95192
+ return new DictData(dict[label], dict[value], dict)
95193
+ }
95194
+
95195
+ /**
95196
+ * 确定字典字段
95197
+ * @param {DictData} dict
95198
+ * @param {...String} fields
95199
+ */
95200
+ function determineDictField(dict, ...fields) {
95201
+ return fields.find((f) => Object.prototype.hasOwnProperty.call(dict, f))
95202
+ }
95203
+
95204
+ const options = {
95205
+ metas: {
95206
+ '*': {
95207
+ /**
95208
+ * 字典请求,方法签名为function(dictMeta: DictMeta): Promise
95209
+ */
95210
+ request: (dictMeta) => {
95211
+ console.log(`load dict ${dictMeta.type}`);
95212
+ return Promise.resolve([])
95213
+ },
95214
+ /**
95215
+ * 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData
95216
+ */
95217
+ responseConverter,
95218
+ labelField: 'label',
95219
+ valueField: 'value'
95220
+ }
95221
+ },
95222
+ /**
95223
+ * 默认标签字段
95224
+ */
95225
+ DEFAULT_LABEL_FIELDS: ['label', 'name', 'title'],
95226
+ /**
95227
+ * 默认值字段
95228
+ */
95229
+ DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key']
95230
+ };
95231
+
95232
+ /**
95233
+ * 映射字典
95234
+ * @param {Object} response 字典数据
95235
+ * @param {DictMeta} dictMeta 字典元数据
95236
+ * @returns {DictData}
95237
+ */
95238
+ function responseConverter(response, dictMeta) {
95239
+ const dicts = response.content instanceof Array ? response.content : response;
95240
+ if (dicts === undefined) {
95241
+ console.warn(`no dict data of "${dictMeta.type}" found in the response`);
95242
+ return []
95243
+ }
95244
+ return dicts.map((d) => dictConverter(d, dictMeta))
95245
+ }
95246
+
95247
+ function mergeOptions(src) {
95248
+ mergeRecursive(options, src);
95249
+ }
95250
+
95251
+ /**
95252
+ * @classdesc 字典元数据
95253
+ * @property {String} type 类型
95254
+ * @property {Function} request 请求
95255
+ * @property {String} label 标签字段
95256
+ * @property {String} value 值字段
95257
+ */
95258
+ class DictMeta {
95259
+ constructor(options) {
95260
+ this.type = options.type;
95261
+ this.request = options.request;
95262
+ this.responseConverter = options.responseConverter;
95263
+ this.labelField = options.labelField;
95264
+ this.valueField = options.valueField;
95265
+ this.lazy = options.lazy === true;
95266
+ }
95267
+ }
95268
+
95269
+ /**
95270
+ * 解析字典元数据
95271
+ * @param {Object} options
95272
+ * @returns {DictMeta}
95273
+ */
95274
+ DictMeta.parse = function (options$1) {
95275
+ let opts = null;
95276
+ if (typeof options$1 === 'string') {
95277
+ opts = options.metas[options$1] || {};
95278
+ opts.type = options$1;
95279
+ } else if (typeof options$1 === 'object') {
95280
+ opts = options$1;
95281
+ }
95282
+ opts = mergeRecursive(options.metas['*'], opts);
95283
+ return new DictMeta(opts)
95284
+ };
95285
+
95286
+ const DEFAULT_DICT_OPTIONS = {
95287
+ types: []
95288
+ };
95289
+
95290
+ /**
95291
+ * @classdesc 字典
95292
+ * @property {Object} label 标签对象,内部属性名为字典类型名称
95293
+ * @property {Object} dict 字段数组,内部属性名为字典类型名称
95294
+ * @property {Array.<DictMeta>} _dictMetas 字典元数据数组
95295
+ */
95296
+ class Dict {
95297
+ constructor(Vue) {
95298
+ this.owner = null;
95299
+ this.label = {};
95300
+ this.type = {};
95301
+ this.Vue = Vue;
95302
+ }
95303
+
95304
+ init(options) {
95305
+ if (options instanceof Array) {
95306
+ options = { types: options };
95307
+ }
95308
+ const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options);
95309
+ if (opts.types === undefined) {
95310
+ throw new Error('need dict types')
95311
+ }
95312
+ const ps = [];
95313
+ this._dictMetas = opts.types.map((t) => DictMeta.parse(t));
95314
+ this._dictMetas.forEach((dictMeta) => {
95315
+ const type = dictMeta.type;
95316
+ this.Vue.set(this.label, type, {});
95317
+ this.Vue.set(this.type, type, []);
95318
+ if (dictMeta.lazy) {
95319
+ return
95320
+ }
95321
+ ps.push(loadDict(this, dictMeta));
95322
+ });
95323
+ return Promise.all(ps)
95324
+ }
95325
+
95326
+ /**
95327
+ * 重新加载字典
95328
+ * @param {String} type 字典类型
95329
+ */
95330
+ reloadDict(type) {
95331
+ const dictMeta = this._dictMetas.find((e) => e.type === type);
95332
+ if (dictMeta === undefined) {
95333
+ return Promise.reject(`the dict meta of ${type} was not found`)
95334
+ }
95335
+ return loadDict(this, dictMeta)
95336
+ }
95337
+
95338
+ /**
95339
+ * 设置form表单的默认值
95340
+ * @param arr dict的数据
95341
+ * @param form 表单数据
95342
+ * @param key 需要修改的字段,可以是字符串或者数据
95343
+ */
95344
+ setDictForm(arr, form, key) {
95345
+ if (arr.length > 0) {
95346
+ let keyArr = key;
95347
+ if (!Array.isArray(key)) {
95348
+ keyArr = [key];
95349
+ }
95350
+ keyArr.forEach((item) => {
95351
+ if (typeof item === 'string') {
95352
+ item = {
95353
+ key: item,
95354
+ index: 0
95355
+ };
95356
+ }
95357
+ form[item.key] = arr[item.index].value;
95358
+ });
95359
+ }
95360
+ }
95361
+ }
95362
+
95363
+ /**
95364
+ * 加载字典
95365
+ * @param {Dict} dict 字典
95366
+ * @param {DictMeta} dictMeta 字典元数据
95367
+ * @returns {Promise}
95368
+ */
95369
+ function loadDict(dict, dictMeta) {
95370
+ return dictMeta.request(dictMeta).then((response) => {
95371
+ const type = dictMeta.type;
95372
+ let dicts = dictMeta.responseConverter(response, dictMeta);
95373
+ if (!(dicts instanceof Array)) {
95374
+ console.error('the return of responseConverter must be Array.<DictData>');
95375
+ dicts = [];
95376
+ } else if (dicts.filter((d) => d instanceof DictData).length !== dicts.length) {
95377
+ console.error('the type of elements in dicts must be DictData');
95378
+ dicts = [];
95379
+ }
95380
+ dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts);
95381
+ dicts.forEach((d) => {
95382
+ dict.Vue.set(dict.label[type], d.value, d.label);
95383
+ });
95384
+ return dicts
95385
+ })
95386
+ }
95387
+
95388
+ function DataDict (Vue, options) {
95389
+ mergeOptions(options);
95390
+ Vue.mixin({
95391
+ data() {
95392
+ if (this.$options === undefined || this.$options.dicts === undefined || this.$options.dicts === null) {
95393
+ return {}
95394
+ }
95395
+ const dict = new Dict(Vue);
95396
+ dict.owner = this;
95397
+ return {
95398
+ dict
95399
+ }
95400
+ },
95401
+ created() {
95402
+ if (!(this.dict instanceof Dict)) {
95403
+ return
95404
+ }
95405
+ options.onCreated && options.onCreated(this.dict);
95406
+ this.dict.init(this.$options.dicts).then(() => {
95407
+ options.onReady && options.onReady(this.dict);
95408
+ this.$nextTick(() => {
95409
+ this.$emit('dictReady', this.dict);
95410
+ if (this.$options.methods && this.$options.methods.onDictReady instanceof Function) {
95411
+ this.$options.methods.onDictReady.call(this, this.dict);
95412
+ }
95413
+ });
95414
+ });
95415
+ }
95416
+ });
95417
+ }
95418
+
95419
+ const state = {
95420
+ dict: new Array()
95421
+ };
95422
+ const mutations = {
95423
+ SET_DICT: (state, { key, value }) => {
95424
+ if (key !== null && key !== '') {
95425
+ state.dict.push({
95426
+ key: key,
95427
+ value: value
95428
+ });
95429
+ }
95430
+ },
95431
+ REMOVE_DICT: (state, key) => {
95432
+ try {
95433
+ for (let i = 0; i < state.dict.length; i++) {
95434
+ if (state.dict[i].key == key) {
95435
+ state.dict.splice(i, i);
95436
+ return true
95437
+ }
95438
+ }
95439
+ } catch (e) {
95440
+ console.log(e);
95441
+ }
95442
+ },
95443
+ CLEAN_DICT: (state) => {
95444
+ state.dict = new Array();
95445
+ }
95446
+ };
95447
+
95448
+ const actions = {
95449
+ // 设置字典
95450
+ setDict({ commit }, data) {
95451
+ commit('SET_DICT', data);
95452
+ },
95453
+ // 删除字典
95454
+ removeDict({ commit }, key) {
95455
+ commit('REMOVE_DICT', key);
95456
+ },
95457
+ // 清空字典
95458
+ cleanDict({ commit }) {
95459
+ commit('CLEAN_DICT');
95460
+ }
95461
+ };
95462
+
95463
+ // 为vuex添加模块,存储dict数据
95464
+ function registerStateModule(store) {
95465
+ if (!store || !store.hasModule) return
95466
+ if (!store.hasModule('dict')) {
95467
+ const statesModule = {
95468
+ namespaced: true,
95469
+ state,
95470
+ mutations,
95471
+ actions
95472
+ };
95473
+ store.registerModule('dict', statesModule);
95474
+ }
95475
+ }
95476
+
95477
+ function searchDictByKey(dict, key) {
95478
+ if (key == null && key == '') {
95479
+ return null
95480
+ }
95481
+ try {
95482
+ for (let i = 0; i < dict.length; i++) {
95483
+ if (dict[i].key == key) {
95484
+ return dict[i].value
95485
+ }
95486
+ }
95487
+ } catch (e) {
95488
+ return null
95489
+ }
95490
+ }
95491
+
95492
+ function install$1(Vue, option = {}) {
95493
+ setGolbalData(Vue, option);
95494
+ const z = Vue.prototype.$z;
95495
+ const dictOption = (z && z.dict) || {};
95496
+ const store = z.store;
95497
+ if (!store) {
95498
+ console.warn('缺少store参数');
95499
+ }
95500
+ registerStateModule(store);
95501
+ let getDicts = function (dictType) {
95502
+ const $http = Vue.prototype.$z.$http;
95503
+ if ($http) {
95504
+ return $http.request({
95505
+ url: (dictOption.dictApi || '/system/dict/data/type/') + dictType,
95506
+ method: 'get'
95507
+ })
95508
+ } else {
95509
+ Promise.resolve([]);
95510
+ }
95511
+ };
95512
+ if (typeof dictOption.dictApi === 'function') {
95513
+ getDicts = dictOption.dictApi;
95514
+ }
95515
+ Vue.use(DataDict, {
95516
+ metas: {
95517
+ '*': {
95518
+ labelField: dictOption.label || 'dictLabel', // 后台返回的字段
95519
+ valueField: dictOption.value || 'dictValue', // 后台返回的字段
95520
+ request(dictMeta) {
95521
+ if (store) {
95522
+ const storeDict = searchDictByKey(store.state.dict.dict, dictMeta.type);
95523
+ if (storeDict) {
95524
+ return new Promise((resolve) => {
95525
+ resolve(storeDict);
95526
+ })
95527
+ } else {
95528
+ return new Promise((resolve, reject) => {
95529
+ getDicts(dictMeta.type)
95530
+ .then((res) => {
95531
+ store.dispatch('dict/setDict', { key: dictMeta.type, value: res });
95532
+ resolve(res);
95533
+ })
95534
+ .catch((error) => {
95535
+ reject(error);
95536
+ });
95537
+ })
95538
+ }
95539
+ } else {
95540
+ return new Promise((resolve) => {
95541
+ resolve([]);
95542
+ })
95543
+ }
95544
+ }
95545
+ }
95546
+ }
95547
+ });
95548
+ }
95549
+
95550
+ var DictZ = {
95551
+ install: install$1
95552
+ };
95553
+
95554
+ //
95555
+ //
95556
+ //
95557
+ //
95558
+ //
95559
+ //
95560
+ //
95561
+ //
95562
+ //
95563
+ //
95564
+ //
95565
+ //
95566
+ //
95567
+ //
95568
+ //
95569
+ //
95570
+ //
95571
+ //
95572
+ //
95573
+ //
95574
+ //
95575
+ //
95576
+ //
95577
+ //
95578
+ //
95579
+
95580
+ var script$2 = {
95581
+ name: 'z-dict-tag',
95582
+ props: {
95583
+ options: {
95584
+ type: Array,
95585
+ default: null
95586
+ },
95587
+ value: [Number, String, Array],
95588
+ // 当未找到匹配的数据时,显示value
95589
+ showValue: {
95590
+ type: Boolean,
95591
+ default: true
95592
+ }
95593
+ },
95594
+ data() {
95595
+ return {
95596
+ unmatchArray: [] // 记录未匹配的项
95597
+ }
95598
+ },
95599
+ computed: {
95600
+ values() {
95601
+ if (this.value !== null && typeof this.value !== 'undefined') {
95602
+ return Array.isArray(this.value) ? this.value : [String(this.value)]
95603
+ } else {
95604
+ return []
95605
+ }
95606
+ },
95607
+ unmatch() {
95608
+ this.unmatchArray = [];
95609
+ if (this.value !== null && typeof this.value !== 'undefined') {
95610
+ // 传入值为非数组
95611
+ if (!Array.isArray(this.value)) {
95612
+ if (this.options.some((v) => v.value == this.value)) return false
95613
+ this.unmatchArray.push(this.value);
95614
+ return true
95615
+ }
95616
+ // 传入值为Array
95617
+ this.value.forEach((item) => {
95618
+ if (!this.options.some((v) => v.value == item)) this.unmatchArray.push(item);
95619
+ });
95620
+ return true
95621
+ }
95622
+ // 没有value不显示
95623
+ return false
95624
+ }
95625
+ },
95626
+ filters: {
95627
+ handleArray(array) {
95628
+ if (array.length === 0) return ''
95629
+ return array.reduce((pre, cur) => {
95630
+ return pre + ' ' + cur
95631
+ })
95632
+ }
95633
+ }
95634
+ };
95635
+
95636
+ /* script */
95637
+ const __vue_script__$2 = script$2;
95638
+
95639
+ /* template */
95640
+ var __vue_render__$2 = function () {
95641
+ var _vm = this;
95642
+ var _h = _vm.$createElement;
95643
+ var _c = _vm._self._c || _h;
95644
+ return _c(
95645
+ "div",
95646
+ [
95647
+ _vm._l(_vm.options, function (item, index) {
95648
+ return [
95649
+ _vm.values.includes(item.value)
95650
+ ? [
95651
+ item.raw.listClass == "default" || item.raw.listClass == ""
95652
+ ? _c(
95653
+ "span",
95654
+ {
95655
+ key: item.value,
95656
+ class: item.raw.cssClass,
95657
+ attrs: { index: index },
95658
+ },
95659
+ [_vm._v(_vm._s(item.label + " "))]
95660
+ )
95661
+ : _c(
95662
+ "el-tag",
95663
+ {
95664
+ key: item.value,
95665
+ class: item.raw.cssClass,
95666
+ attrs: {
95667
+ "disable-transitions": true,
95668
+ index: index,
95669
+ type:
95670
+ item.raw.listClass == "primary"
95671
+ ? ""
95672
+ : item.raw.listClass,
95673
+ },
95674
+ },
95675
+ [
95676
+ _vm._v(
95677
+ "\n " + _vm._s(item.label + " ") + "\n "
95678
+ ),
95679
+ ]
95680
+ ),
95681
+ ]
95682
+ : _vm._e(),
95683
+ ]
95684
+ }),
95685
+ _vm._v(" "),
95686
+ _vm.unmatch && _vm.showValue
95687
+ ? [
95688
+ _vm._v(
95689
+ "\n " +
95690
+ _vm._s(_vm._f("handleArray")(_vm.unmatchArray)) +
95691
+ "\n "
95692
+ ),
95693
+ ]
95694
+ : _vm._e(),
95695
+ ],
95696
+ 2
95697
+ )
95698
+ };
95699
+ var __vue_staticRenderFns__$2 = [];
95700
+ __vue_render__$2._withStripped = true;
95701
+
95702
+ /* style */
95703
+ const __vue_inject_styles__$2 = function (inject) {
95704
+ if (!inject) return
95705
+ inject("data-v-4dd7787c_0", { source: "\n.el-tag + .el-tag[data-v-4dd7787c] {\r\n margin-left: 10px;\n}\r\n", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\dictTag\\dictTag.vue"],"names":[],"mappings":";AAmFA;EACA,iBAAA;AACA","file":"dictTag.vue","sourcesContent":["<template>\r\n <div>\r\n <template v-for=\"(item, index) in options\">\r\n <template v-if=\"values.includes(item.value)\">\r\n <span v-if=\"item.raw.listClass == 'default' || item.raw.listClass == ''\" :key=\"item.value\" :index=\"index\" :class=\"item.raw.cssClass\">{{\r\n item.label + ' '\r\n }}</span>\r\n <el-tag\r\n v-else\r\n :disable-transitions=\"true\"\r\n :key=\"item.value\"\r\n :index=\"index\"\r\n :type=\"item.raw.listClass == 'primary' ? '' : item.raw.listClass\"\r\n :class=\"item.raw.cssClass\"\r\n >\r\n {{ item.label + ' ' }}\r\n </el-tag>\r\n </template>\r\n </template>\r\n <template v-if=\"unmatch && showValue\">\r\n {{ unmatchArray | handleArray }}\r\n </template>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'z-dict-tag',\r\n props: {\r\n options: {\r\n type: Array,\r\n default: null\r\n },\r\n value: [Number, String, Array],\r\n // 当未找到匹配的数据时,显示value\r\n showValue: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data() {\r\n return {\r\n unmatchArray: [] // 记录未匹配的项\r\n }\r\n },\r\n computed: {\r\n values() {\r\n if (this.value !== null && typeof this.value !== 'undefined') {\r\n return Array.isArray(this.value) ? this.value : [String(this.value)]\r\n } else {\r\n return []\r\n }\r\n },\r\n unmatch() {\r\n this.unmatchArray = []\r\n if (this.value !== null && typeof this.value !== 'undefined') {\r\n // 传入值为非数组\r\n if (!Array.isArray(this.value)) {\r\n if (this.options.some((v) => v.value == this.value)) return false\r\n this.unmatchArray.push(this.value)\r\n return true\r\n }\r\n // 传入值为Array\r\n this.value.forEach((item) => {\r\n if (!this.options.some((v) => v.value == item)) this.unmatchArray.push(item)\r\n })\r\n return true\r\n }\r\n // 没有value不显示\r\n return false\r\n }\r\n },\r\n filters: {\r\n handleArray(array) {\r\n if (array.length === 0) return ''\r\n return array.reduce((pre, cur) => {\r\n return pre + ' ' + cur\r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n<style scoped>\r\n.el-tag + .el-tag {\r\n margin-left: 10px;\r\n}\r\n</style>\r\n"]}, media: undefined });
95706
+
95707
+ };
95708
+ /* scoped */
95709
+ const __vue_scope_id__$2 = "data-v-4dd7787c";
95710
+ /* module identifier */
95711
+ const __vue_module_identifier__$2 = undefined;
95712
+ /* functional template */
95713
+ const __vue_is_functional_template__$2 = false;
95714
+ /* style inject SSR */
95715
+
95716
+ /* style inject shadow dom */
95717
+
95718
+
95719
+
95720
+ const __vue_component__$2 = /*#__PURE__*/__vue_normalize__(
95721
+ { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
95722
+ __vue_inject_styles__$2,
95723
+ __vue_script__$2,
95724
+ __vue_scope_id__$2,
95725
+ __vue_is_functional_template__$2,
95726
+ __vue_module_identifier__$2,
95727
+ false,
95728
+ __vue_create_injector__,
95729
+ undefined,
95730
+ undefined
95731
+ );
95732
+
95733
+ __vue_component__$2.install = function (Vue, option = {}) {
95734
+ setGolbalData(Vue, option);
95735
+ Vue.component(__vue_component__$2.name, __vue_component__$2);
95736
+ };
95737
+
95738
+ //
95739
+ //
95740
+ //
95741
+ //
95742
+ //
95743
+ //
95744
+ //
95745
+ //
95746
+ //
95747
+ //
95748
+ //
95749
+ //
95750
+ //
95751
+ //
95752
+ //
95753
+ //
95754
+ //
95755
+
95756
+ var script$1 = {
95757
+ name: 'z-dialog',
95758
+ props: {
95759
+ visible: {
95760
+ type: Boolean,
95761
+ default: false
95762
+ },
95763
+ disabled: {
95764
+ type: Boolean,
95765
+ default: false
95766
+ }
95767
+ },
95768
+ computed: {
95769
+ zVisible: {
95770
+ get: function () {
95771
+ return this.visible
95772
+ },
95773
+ set: function (val) {
95774
+ this.$emit('update:visible', val);
95775
+ }
95776
+ }
95777
+ },
95778
+ methods: {
95779
+ // 给调用的组件初始化数据 再 关闭
95780
+ handleCancel() {
95781
+ this.zVisible = false;
95782
+ this.$emit('cancel');
95783
+ },
95784
+ handelOk() {
95785
+ this.$emit('ok', (message) => {
95786
+ if (message) {
95787
+ this.$message.success(message);
95788
+ }
95789
+ this.handleCancel();
95790
+ });
95791
+ }
95792
+ }
95793
+ };
95794
+
95795
+ /* script */
95796
+ const __vue_script__$1 = script$1;
95797
+
95798
+ /* template */
95799
+ var __vue_render__$1 = function () {
95800
+ var _vm = this;
95801
+ var _h = _vm.$createElement;
95802
+ var _c = _vm._self._c || _h;
95803
+ return _c(
95804
+ "el-dialog",
95805
+ _vm._b(
95806
+ {
95807
+ ref: "dialog",
95808
+ staticClass: "z-dialog",
95809
+ attrs: {
95810
+ visible: _vm.visible,
95811
+ "close-on-click-modal": false,
95812
+ "before-close": _vm.handleCancel,
95813
+ },
95814
+ scopedSlots: _vm._u(
95815
+ [
95816
+ {
95817
+ key: "title",
95818
+ fn: function () {
95819
+ return [_vm._t("title")]
95820
+ },
95821
+ proxy: true,
95822
+ },
95823
+ {
95824
+ key: "footer",
95825
+ fn: function () {
95826
+ return [
95827
+ _vm._t("footer", function () {
95828
+ return [
95829
+ _c(
95830
+ "div",
95831
+ { staticClass: "dialog-footer" },
95832
+ [
95833
+ !_vm.disabled
95834
+ ? _c(
95835
+ "el-button",
95836
+ {
95837
+ attrs: { type: "primary" },
95838
+ on: { click: _vm.handelOk },
95839
+ },
95840
+ [_vm._v("提 交")]
95841
+ )
95842
+ : _vm._e(),
95843
+ _vm._v(" "),
95844
+ _c("el-button", { on: { click: _vm.handleCancel } }, [
95845
+ _vm._v("取 消"),
95846
+ ]),
95847
+ ],
95848
+ 1
95849
+ ),
95850
+ ]
95851
+ }),
95852
+ ]
95853
+ },
95854
+ proxy: true,
95855
+ },
95856
+ ],
95857
+ null,
95858
+ true
95859
+ ),
95860
+ },
95861
+ "el-dialog",
95862
+ _vm.$attrs,
95863
+ false
95864
+ ),
95865
+ [_vm._t("default")],
95866
+ 2
95867
+ )
95868
+ };
95869
+ var __vue_staticRenderFns__$1 = [];
95870
+ __vue_render__$1._withStripped = true;
95871
+
95872
+ /* style */
95873
+ const __vue_inject_styles__$1 = function (inject) {
95874
+ if (!inject) return
95875
+ inject("data-v-be9be238_0", { source: ".z-dialog .el-dialog[data-v-be9be238] {\n border-radius: 10px;\n}\n.z-dialog .el-dialog .el-dialog__header[data-v-be9be238] {\n padding: 12px 20px;\n border-radius: 10px 10px 0 0;\n}\n.z-dialog .el-dialog .el-dialog__header .el-dialog__title[data-v-be9be238] {\n width: 100%;\n text-align: center;\n display: block;\n color: #fff;\n line-height: 24px;\n}\n.z-dialog .el-dialog .el-dialog__header .el-dialog__headerbtn[data-v-be9be238] {\n top: 16px;\n}\n.z-dialog .el-dialog .el-dialog__header .el-dialog__headerbtn .el-icon-close[data-v-be9be238] {\n color: #fff;\n}\n.z-dialog .el-dialog .el-dialog__footer[data-v-be9be238] {\n padding: 14px 20px;\n background: #f1f5ff;\n border-radius: 0 0 10px 10px;\n display: flex;\n justify-content: center;\n}\n.z-dialog .el-dialog .el-dialog__body[data-v-be9be238] {\n padding: 20px;\n}\n\n/*# sourceMappingURL=dialog.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\dialog\\dialog.vue","dialog.vue"],"names":[],"mappings":"AA4DA;EACA,mBAAA;AC3DA;AD4DA;EAEA,kBAAA;EACA,4BAAA;AC3DA;AD4DA;EACA,WAAA;EACA,kBAAA;EACA,cAAA;EACA,WAAA;EACA,iBAAA;AC1DA;AD4DA;EACA,SAAA;AC1DA;AD2DA;EACA,WAAA;ACzDA;AD6DA;EACA,kBAAA;EACA,mBAAA;EACA,4BAAA;EACA,aAAA;EACA,uBAAA;AC3DA;AD6DA;EACA,aAAA;AC3DA;;AAEA,qCAAqC","file":"dialog.vue","sourcesContent":["<template>\r\n <el-dialog class=\"z-dialog\" :visible=\"visible\" ref=\"dialog\" :close-on-click-modal=\"false\" :before-close=\"handleCancel\" v-bind=\"$attrs\">\r\n <slot></slot>\r\n <template #title>\r\n <slot name=\"title\"></slot>\r\n </template>\r\n <template #footer>\r\n <slot name=\"footer\">\r\n <div class=\"dialog-footer\">\r\n <el-button type=\"primary\" @click=\"handelOk\" v-if=\"!disabled\">提 交</el-button>\r\n <el-button @click=\"handleCancel\">取 消</el-button>\r\n </div>\r\n </slot>\r\n </template>\r\n </el-dialog>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'z-dialog',\r\n props: {\r\n visible: {\r\n type: Boolean,\r\n default: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n computed: {\r\n zVisible: {\r\n get: function () {\r\n return this.visible\r\n },\r\n set: function (val) {\r\n this.$emit('update:visible', val)\r\n }\r\n }\r\n },\r\n methods: {\r\n // 给调用的组件初始化数据 再 关闭\r\n handleCancel() {\r\n this.zVisible = false\r\n this.$emit('cancel')\r\n },\r\n handelOk() {\r\n this.$emit('ok', (message) => {\r\n if (message) {\r\n this.$message.success(message)\r\n }\r\n this.handleCancel()\r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n.z-dialog {\r\n .el-dialog {\r\n border-radius: 10px;\r\n .el-dialog__header {\r\n //background: @theme;\r\n padding: 12px 20px;\r\n border-radius: 10px 10px 0 0;\r\n .el-dialog__title {\r\n width: 100%;\r\n text-align: center;\r\n display: block;\r\n color: #fff;\r\n line-height: 24px;\r\n }\r\n .el-dialog__headerbtn {\r\n top: 16px;\r\n .el-icon-close {\r\n color: #fff;\r\n }\r\n }\r\n }\r\n .el-dialog__footer {\r\n padding: 14px 20px;\r\n background: #f1f5ff;\r\n border-radius: 0 0 10px 10px;\r\n display: flex;\r\n justify-content: center;\r\n }\r\n .el-dialog__body {\r\n padding: 20px;\r\n }\r\n }\r\n}\r\n</style>\r\n",".z-dialog .el-dialog {\n border-radius: 10px;\n}\n.z-dialog .el-dialog .el-dialog__header {\n padding: 12px 20px;\n border-radius: 10px 10px 0 0;\n}\n.z-dialog .el-dialog .el-dialog__header .el-dialog__title {\n width: 100%;\n text-align: center;\n display: block;\n color: #fff;\n line-height: 24px;\n}\n.z-dialog .el-dialog .el-dialog__header .el-dialog__headerbtn {\n top: 16px;\n}\n.z-dialog .el-dialog .el-dialog__header .el-dialog__headerbtn .el-icon-close {\n color: #fff;\n}\n.z-dialog .el-dialog .el-dialog__footer {\n padding: 14px 20px;\n background: #f1f5ff;\n border-radius: 0 0 10px 10px;\n display: flex;\n justify-content: center;\n}\n.z-dialog .el-dialog .el-dialog__body {\n padding: 20px;\n}\n\n/*# sourceMappingURL=dialog.vue.map */"]}, media: undefined });
95876
+
95877
+ };
95878
+ /* scoped */
95879
+ const __vue_scope_id__$1 = "data-v-be9be238";
95880
+ /* module identifier */
95881
+ const __vue_module_identifier__$1 = undefined;
95882
+ /* functional template */
95883
+ const __vue_is_functional_template__$1 = false;
95884
+ /* style inject SSR */
95885
+
95886
+ /* style inject shadow dom */
95887
+
95888
+
95889
+
95890
+ const __vue_component__$1 = /*#__PURE__*/__vue_normalize__(
95891
+ { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
95892
+ __vue_inject_styles__$1,
95893
+ __vue_script__$1,
95894
+ __vue_scope_id__$1,
95895
+ __vue_is_functional_template__$1,
95896
+ __vue_module_identifier__$1,
95897
+ false,
95898
+ __vue_create_injector__,
95899
+ undefined,
95900
+ undefined
95901
+ );
95902
+
95903
+ __vue_component__$1.install = function (Vue, option = {}) {
95904
+ setGolbalData(Vue, option);
95905
+ Vue.component(__vue_component__$1.name, __vue_component__$1);
95906
+ };
95907
+
95908
+ //
95909
+ //
95910
+ //
95911
+ //
95912
+ //
95913
+ //
95914
+
95915
+ var script = {
95916
+ name: 'z-button'
95917
+ };
95918
+
95919
+ /* script */
95920
+ const __vue_script__ = script;
95921
+
95922
+ /* template */
95923
+ var __vue_render__ = function () {
95924
+ var _vm = this;
95925
+ var _h = _vm.$createElement;
95926
+ var _c = _vm._self._c || _h;
95927
+ return _c(
95928
+ "el-button",
95929
+ _vm._g(_vm._b({}, "el-button", _vm.$attrs, false), _vm.$listeners),
95930
+ [_vm.$slots.default ? _vm._t("default") : _vm._e()],
95931
+ 2
95932
+ )
95933
+ };
95136
95934
  var __vue_staticRenderFns__ = [];
95137
95935
  __vue_render__._withStripped = true;
95138
95936
 
95139
95937
  /* style */
95140
95938
  const __vue_inject_styles__ = function (inject) {
95141
95939
  if (!inject) return
95142
- inject("data-v-1ea4cbfa_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"list.vue"}, media: undefined });
95940
+ inject("data-v-1411a826_0", { source: "\n\n/*# sourceMappingURL=button.vue.map */", map: {"version":3,"sources":["button.vue"],"names":[],"mappings":";;AAEA,qCAAqC","file":"button.vue"}, media: undefined });
95143
95941
 
95144
95942
  };
95145
95943
  /* scoped */
95146
- const __vue_scope_id__ = "data-v-1ea4cbfa";
95944
+ const __vue_scope_id__ = "data-v-1411a826";
95147
95945
  /* module identifier */
95148
95946
  const __vue_module_identifier__ = undefined;
95149
95947
  /* functional template */
@@ -95175,7 +95973,7 @@ __vue_component__.install = function (Vue, option = {}) {
95175
95973
  if (typeof window !== 'undefined' && window.Vue) {
95176
95974
  install(window.Vue);
95177
95975
  }
95178
- const components = [__vue_component__$2, RequestZ, RouterZ, __vue_component__$1, __vue_component__];
95976
+ const components = [__vue_component__$5, RequestZ, RouterZ, __vue_component__$4, __vue_component__$3, DictZ, __vue_component__$2, __vue_component__$1, __vue_component__];
95179
95977
  const install = (Vue, option = {}) => {
95180
95978
  setGolbalData(Vue, option);
95181
95979
  components.forEach((component) => {
@@ -95186,9 +95984,13 @@ var index = {
95186
95984
  install
95187
95985
  };
95188
95986
 
95189
- exports.IconZ = __vue_component__$2;
95190
- exports.ListZ = __vue_component__;
95987
+ exports.ButtonZ = __vue_component__;
95988
+ exports.DialogZ = __vue_component__$1;
95989
+ exports.DictTagZ = __vue_component__$2;
95990
+ exports.DictZ = DictZ;
95991
+ exports.IconZ = __vue_component__$5;
95992
+ exports.ListZ = __vue_component__$3;
95191
95993
  exports.RequestZ = RequestZ;
95192
95994
  exports.RouterZ = RouterZ;
95193
- exports.TableZ = __vue_component__$1;
95995
+ exports.TableZ = __vue_component__$4;
95194
95996
  exports.default = index;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luzhaoqi/test",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "private": false,
5
5
  "main": "dist/lib-cjs.js",
6
6
  "scripts": {