@fmdevui/fm-dev 1.0.98 → 1.0.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! fm-dev v1.0.98 */
1
+ /*! fm-dev v1.0.100 */
2
2
  import { defineComponent, reactive, computed, watch, resolveComponent, createBlock, openBlock, withCtx, createVNode, createElementVNode, createTextVNode, toDisplayString as toDisplayString$1, withDirectives, createElementBlock, Fragment, renderList, vShow, ref, onMounted, nextTick, normalizeStyle, createCommentVNode, normalizeClass, withModifiers, mergeModels, useModel, effectScope, getCurrentInstance, shallowRef, isRef as isRef$1, inject, onUnmounted, h, Text, markRaw, hasInjectionContext, toRaw as toRaw$1, isReactive as isReactive$1, toRef, unref, getCurrentScope, onScopeDispose, toRefs, resolveDirective, mergeProps, renderSlot, resolveDynamicComponent, useSlots, createSlots, toHandlers, onBeforeUnmount, onUpdated, useAttrs, normalizeProps, guardReactiveProps } from 'vue';
3
3
  import crypto from 'crypto';
4
4
  import require$$0 from 'url';
@@ -35615,10 +35615,30 @@ var _sfc_main$b = /* @__PURE__ */ defineComponent({
35615
35615
  * };
35616
35616
  */
35617
35617
  fetchOptions: {
35618
- type: Function,
35618
+ type: Function
35619
35619
  // 函数类型
35620
- required: true
35621
- // 必填项
35620
+ //required: true, // 必填项
35621
+ },
35622
+ /**
35623
+ * api service name
35624
+ */
35625
+ apiService: {
35626
+ type: String,
35627
+ default: "baseData"
35628
+ },
35629
+ /**
35630
+ * api service 下的方法
35631
+ */
35632
+ apiAction: {
35633
+ type: String,
35634
+ default: "BaseData"
35635
+ },
35636
+ /**
35637
+ * 基础编码 自动获取数据
35638
+ */
35639
+ method: {
35640
+ type: String,
35641
+ default: "post"
35622
35642
  },
35623
35643
  /**
35624
35644
  * 选中记录后绑定值的属性名
@@ -35858,20 +35878,54 @@ var _sfc_main$b = /* @__PURE__ */ defineComponent({
35858
35878
  state.isQuerying = true;
35859
35879
  state.loading = true;
35860
35880
  const finalParams = Object.assign({}, props.queryParams, state.tableQuery);
35861
- props.fetchOptions(finalParams).then((res) => {
35862
- const result = res.data?.result;
35863
- state.tableData.items = result?.items ?? [];
35864
- state.tableData.total = result?.total ?? 0;
35865
- state.loading = false;
35866
- state.isQuerying = false;
35867
- updateSelectedRows();
35868
- }).catch((error) => {
35869
- ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
35870
- state.tableData.items = [];
35871
- state.tableData.total = 0;
35872
- state.loading = false;
35873
- state.isQuerying = false;
35874
- });
35881
+ if (typeof props.fetchOptions === "function") {
35882
+ props.fetchOptions(finalParams).then((res) => {
35883
+ const result = res.data?.result;
35884
+ state.tableData.items = result?.items ?? [];
35885
+ state.tableData.total = result?.total ?? 0;
35886
+ state.loading = false;
35887
+ state.isQuerying = false;
35888
+ updateSelectedRows();
35889
+ }).catch((error) => {
35890
+ ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
35891
+ state.tableData.items = [];
35892
+ state.tableData.total = 0;
35893
+ state.loading = false;
35894
+ state.isQuerying = false;
35895
+ });
35896
+ } else {
35897
+ if (props.method == "post") {
35898
+ useBaseApi(props.apiAction).post(finalParams, props.apiAction).then((res) => {
35899
+ const result = res.data?.result;
35900
+ state.tableData.items = result?.items ?? [];
35901
+ state.tableData.total = result?.total ?? 0;
35902
+ state.loading = false;
35903
+ state.isQuerying = false;
35904
+ updateSelectedRows();
35905
+ }).catch((error) => {
35906
+ ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
35907
+ state.tableData.items = [];
35908
+ state.tableData.total = 0;
35909
+ state.loading = false;
35910
+ state.isQuerying = false;
35911
+ });
35912
+ } else {
35913
+ useBaseApi(props.apiAction).get(finalParams, props.apiAction).then((res) => {
35914
+ const result = res.data?.result;
35915
+ state.tableData.items = result?.items ?? [];
35916
+ state.tableData.total = result?.total ?? 0;
35917
+ state.loading = false;
35918
+ state.isQuerying = false;
35919
+ updateSelectedRows();
35920
+ }).catch((error) => {
35921
+ ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
35922
+ state.tableData.items = [];
35923
+ state.tableData.total = 0;
35924
+ state.loading = false;
35925
+ state.isQuerying = false;
35926
+ });
35927
+ }
35928
+ }
35875
35929
  };
35876
35930
  const resetQuery = () => {
35877
35931
  state.loading = true;
@@ -36240,7 +36294,7 @@ var _sfc_main$b = /* @__PURE__ */ defineComponent({
36240
36294
  }
36241
36295
  });
36242
36296
 
36243
- var inputtable = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-fc87e7bb"]]);
36297
+ var inputtable = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-32a757fa"]]);
36244
36298
 
36245
36299
  const _hoisted_1$3 = { style: { "padding": "5px" } };
36246
36300
  const _hoisted_2$2 = { style: { "display": "flex", "align-items": "center", "gap": "8px", "flex-wrap": "nowrap", "overflow": "hidden" } };
@@ -736,7 +736,18 @@ declare const Fminputtable: {
736
736
  modelValue: (StringConstructor | ArrayConstructor | NumberConstructor | null)[];
737
737
  fetchOptions: {
738
738
  type: FunctionConstructor;
739
- required: true;
739
+ };
740
+ apiService: {
741
+ type: StringConstructor;
742
+ default: string;
743
+ };
744
+ apiAction: {
745
+ type: StringConstructor;
746
+ default: string;
747
+ };
748
+ method: {
749
+ type: StringConstructor;
750
+ default: string;
740
751
  };
741
752
  valueProp: {
742
753
  type: StringConstructor;
@@ -816,6 +827,9 @@ declare const Fminputtable: {
816
827
  disabled: boolean;
817
828
  placeholder: string;
818
829
  clearable: boolean;
830
+ method: string;
831
+ apiService: string;
832
+ apiAction: string;
819
833
  valueProp: string;
820
834
  labelProp: string;
821
835
  labelFormat: Function;
@@ -841,7 +855,18 @@ declare const Fminputtable: {
841
855
  modelValue: (StringConstructor | ArrayConstructor | NumberConstructor | null)[];
842
856
  fetchOptions: {
843
857
  type: FunctionConstructor;
844
- required: true;
858
+ };
859
+ apiService: {
860
+ type: StringConstructor;
861
+ default: string;
862
+ };
863
+ apiAction: {
864
+ type: StringConstructor;
865
+ default: string;
866
+ };
867
+ method: {
868
+ type: StringConstructor;
869
+ default: string;
845
870
  };
846
871
  valueProp: {
847
872
  type: StringConstructor;
@@ -918,6 +943,9 @@ declare const Fminputtable: {
918
943
  disabled: boolean;
919
944
  placeholder: string;
920
945
  clearable: boolean;
946
+ method: string;
947
+ apiService: string;
948
+ apiAction: string;
921
949
  valueProp: string;
922
950
  labelProp: string;
923
951
  labelFormat: Function;
@@ -937,7 +965,18 @@ declare const Fminputtable: {
937
965
  modelValue: (StringConstructor | ArrayConstructor | NumberConstructor | null)[];
938
966
  fetchOptions: {
939
967
  type: FunctionConstructor;
940
- required: true;
968
+ };
969
+ apiService: {
970
+ type: StringConstructor;
971
+ default: string;
972
+ };
973
+ apiAction: {
974
+ type: StringConstructor;
975
+ default: string;
976
+ };
977
+ method: {
978
+ type: StringConstructor;
979
+ default: string;
941
980
  };
942
981
  valueProp: {
943
982
  type: StringConstructor;
@@ -1017,6 +1056,9 @@ declare const Fminputtable: {
1017
1056
  disabled: boolean;
1018
1057
  placeholder: string;
1019
1058
  clearable: boolean;
1059
+ method: string;
1060
+ apiService: string;
1061
+ apiAction: string;
1020
1062
  valueProp: string;
1021
1063
  labelProp: string;
1022
1064
  labelFormat: Function;
@@ -100,7 +100,27 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
100
100
  */
101
101
  fetchOptions: {
102
102
  type: FunctionConstructor;
103
- required: true;
103
+ };
104
+ /**
105
+ * api service name
106
+ */
107
+ apiService: {
108
+ type: StringConstructor;
109
+ default: string;
110
+ };
111
+ /**
112
+ * api service 下的方法
113
+ */
114
+ apiAction: {
115
+ type: StringConstructor;
116
+ default: string;
117
+ };
118
+ /**
119
+ * 基础编码 自动获取数据
120
+ */
121
+ method: {
122
+ type: StringConstructor;
123
+ default: string;
104
124
  };
105
125
  /**
106
126
  * 选中记录后绑定值的属性名
@@ -308,7 +328,27 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
308
328
  */
309
329
  fetchOptions: {
310
330
  type: FunctionConstructor;
311
- required: true;
331
+ };
332
+ /**
333
+ * api service name
334
+ */
335
+ apiService: {
336
+ type: StringConstructor;
337
+ default: string;
338
+ };
339
+ /**
340
+ * api service 下的方法
341
+ */
342
+ apiAction: {
343
+ type: StringConstructor;
344
+ default: string;
345
+ };
346
+ /**
347
+ * 基础编码 自动获取数据
348
+ */
349
+ method: {
350
+ type: StringConstructor;
351
+ default: string;
312
352
  };
313
353
  /**
314
354
  * 选中记录后绑定值的属性名
@@ -434,6 +474,9 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
434
474
  disabled: boolean;
435
475
  placeholder: string;
436
476
  clearable: boolean;
477
+ method: string;
478
+ apiService: string;
479
+ apiAction: string;
437
480
  valueProp: string;
438
481
  labelProp: string;
439
482
  labelFormat: Function;
package/lib/index.css CHANGED
@@ -1,4 +1,4 @@
1
1
  .drag_verify[data-v-9e8c9ed2]{background-color:#e8e8e8;overflow:hidden;position:relative;text-align:center}.drag_verify .dv_handler[data-v-9e8c9ed2]{cursor:move;left:0;position:absolute;top:0}.drag_verify .dv_handler i[data-v-9e8c9ed2]{color:#666;font-size:16px;padding-left:0}.drag_verify .dv_handler .el-icon-circle-check[data-v-9e8c9ed2]{color:#6c6;margin-top:9px}.drag_verify .dv_progress_bar[data-v-9e8c9ed2]{height:34px;position:absolute;width:0}.drag_verify .dv_text[data-v-9e8c9ed2]{background:-webkit-gradient(linear,left top,right top,color-stop(0,var(--textColor)),color-stop(.4,var(--textColor)),color-stop(.5,#fff),color-stop(.6,var(--textColor)),color-stop(1,var(--textColor)));-webkit-background-clip:text;color:transparent;position:absolute;top:0;-moz-user-select:none;-webkit-user-select:none;user-select:none;-o-user-select:none;-ms-user-select:none;-webkit-text-fill-color:transparent;-webkit-text-size-adjust:none;animation:slidetounlock 3s infinite}.drag_verify .dv_text[data-v-9e8c9ed2] *{-webkit-text-fill-color:var(--textColor)}.goFirst[data-v-9e8c9ed2]{left:0!important;transition:left .5s}.goOrigin[data-v-9e8c9ed2]{transition:transform .5s}.goKeep[data-v-9e8c9ed2]{transition:left .2s}.goFirst2[data-v-9e8c9ed2]{transition:width .5s;width:0!important}.drag-verify-container[data-v-9e8c9ed2]{border-radius:50%;line-height:0;position:relative}.move-bar[data-v-9e8c9ed2]{position:absolute;z-index:100}.clip-bar[data-v-9e8c9ed2]{background:hsla(0,0%,100%,.8);position:absolute}.refresh[data-v-9e8c9ed2]{cursor:pointer;font-size:20px;position:absolute;right:5px;top:5px;z-index:200}.tips[data-v-9e8c9ed2]{bottom:25px;font-size:12px;height:20px;line-height:20px;position:absolute;text-align:center;width:100%;z-index:200}.tips.success[data-v-9e8c9ed2]{background:hsla(0,0%,100%,.6);color:green}.tips.danger[data-v-9e8c9ed2]{background:rgba(0,0,0,.6);color:#ff0}.check-img[data-v-9e8c9ed2]{border-radius:50%;width:100%}
2
2
 
3
- .query-form[data-v-fc87e7bb]{z-index:9999}[data-v-fc87e7bb] .el-select-dropdown{.el-scrollbar>.el-scrollbar__bar{display:none!important}}.popper-class[data-v-fc87e7bb]{min-width:400px!important}[data-v-fc87e7bb] .popper-class :deep(.el-select-dropdown__wrap){max-height:600px!important}
3
+ .query-form[data-v-32a757fa]{z-index:9999}[data-v-32a757fa] .el-select-dropdown{.el-scrollbar>.el-scrollbar__bar{display:none!important}}.popper-class[data-v-32a757fa]{min-width:400px!important}[data-v-32a757fa] .popper-class :deep(.el-select-dropdown__wrap){max-height:600px!important}
4
4
  .el-select-dropdown__wrap[max-height],.popper-class .el-select-dropdown__wrap{max-height:450px!important}.el-table .selected-row,.popper-class .selected-row{background-color:var(--el-color-primary-light-9)!important;border-left:3px solid var(--el-color-primary)!important}.el-table .selected-row:hover,.popper-class .selected-row:hover{background-color:var(--el-color-primary-light-8)!important}.el-table .selected-row td,.popper-class .selected-row td{background-color:var(--el-color-primary-light-9)!important}.el-table .selected-row:hover td,.popper-class .selected-row:hover td{background-color:var(--el-color-primary-light-8)!important}
@@ -7,6 +7,6 @@ require('./index.vue3.js');
7
7
  require('./index.vue4.js');
8
8
  var _pluginVue_exportHelper = require('../../../../../_virtual/_plugin-vue_export-helper.js');
9
9
 
10
- var inputtable = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-fc87e7bb"]]);
10
+ var inputtable = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-32a757fa"]]);
11
11
 
12
12
  exports.default = inputtable;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
+ var index = require('../../../api/base/index.js');
7
8
 
8
9
  const _hoisted_1 = { class: "w100 selector-loading-container" };
9
10
  var _sfc_main = /* @__PURE__ */ vue.defineComponent({
@@ -92,10 +93,30 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
92
93
  * };
93
94
  */
94
95
  fetchOptions: {
95
- type: Function,
96
+ type: Function
96
97
  // 函数类型
97
- required: true
98
- // 必填项
98
+ //required: true, // 必填项
99
+ },
100
+ /**
101
+ * api service name
102
+ */
103
+ apiService: {
104
+ type: String,
105
+ default: "baseData"
106
+ },
107
+ /**
108
+ * api service 下的方法
109
+ */
110
+ apiAction: {
111
+ type: String,
112
+ default: "BaseData"
113
+ },
114
+ /**
115
+ * 基础编码 自动获取数据
116
+ */
117
+ method: {
118
+ type: String,
119
+ default: "post"
99
120
  },
100
121
  /**
101
122
  * 选中记录后绑定值的属性名
@@ -335,20 +356,54 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
335
356
  state.isQuerying = true;
336
357
  state.loading = true;
337
358
  const finalParams = Object.assign({}, props.queryParams, state.tableQuery);
338
- props.fetchOptions(finalParams).then((res) => {
339
- const result = res.data?.result;
340
- state.tableData.items = result?.items ?? [];
341
- state.tableData.total = result?.total ?? 0;
342
- state.loading = false;
343
- state.isQuerying = false;
344
- updateSelectedRows();
345
- }).catch((error) => {
346
- elementPlus.ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
347
- state.tableData.items = [];
348
- state.tableData.total = 0;
349
- state.loading = false;
350
- state.isQuerying = false;
351
- });
359
+ if (typeof props.fetchOptions === "function") {
360
+ props.fetchOptions(finalParams).then((res) => {
361
+ const result = res.data?.result;
362
+ state.tableData.items = result?.items ?? [];
363
+ state.tableData.total = result?.total ?? 0;
364
+ state.loading = false;
365
+ state.isQuerying = false;
366
+ updateSelectedRows();
367
+ }).catch((error) => {
368
+ elementPlus.ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
369
+ state.tableData.items = [];
370
+ state.tableData.total = 0;
371
+ state.loading = false;
372
+ state.isQuerying = false;
373
+ });
374
+ } else {
375
+ if (props.method == "post") {
376
+ index.useBaseApi(props.apiAction).post(finalParams, props.apiAction).then((res) => {
377
+ const result = res.data?.result;
378
+ state.tableData.items = result?.items ?? [];
379
+ state.tableData.total = result?.total ?? 0;
380
+ state.loading = false;
381
+ state.isQuerying = false;
382
+ updateSelectedRows();
383
+ }).catch((error) => {
384
+ elementPlus.ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
385
+ state.tableData.items = [];
386
+ state.tableData.total = 0;
387
+ state.loading = false;
388
+ state.isQuerying = false;
389
+ });
390
+ } else {
391
+ index.useBaseApi(props.apiAction).get(finalParams, props.apiAction).then((res) => {
392
+ const result = res.data?.result;
393
+ state.tableData.items = result?.items ?? [];
394
+ state.tableData.total = result?.total ?? 0;
395
+ state.loading = false;
396
+ state.isQuerying = false;
397
+ updateSelectedRows();
398
+ }).catch((error) => {
399
+ elementPlus.ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
400
+ state.tableData.items = [];
401
+ state.tableData.total = 0;
402
+ state.loading = false;
403
+ state.isQuerying = false;
404
+ });
405
+ }
406
+ }
352
407
  };
353
408
  const resetQuery = () => {
354
409
  state.loading = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fmdevui/fm-dev",
3
- "version": "1.0.98",
3
+ "version": "1.0.100",
4
4
  "description": "Page level components developed based on Element Plus.",
5
5
  "author": "fmdevui",
6
6
  "keywords": [