@fmdevui/fm-dev 1.0.98 → 1.0.99

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.99 */
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';
@@ -35620,6 +35620,27 @@ var _sfc_main$b = /* @__PURE__ */ defineComponent({
35620
35620
  required: true
35621
35621
  // 必填项
35622
35622
  },
35623
+ /**
35624
+ * api service name
35625
+ */
35626
+ apiService: {
35627
+ type: String,
35628
+ default: "baseData"
35629
+ },
35630
+ /**
35631
+ * api service 下的方法
35632
+ */
35633
+ apiAction: {
35634
+ type: String,
35635
+ default: "BaseData"
35636
+ },
35637
+ /**
35638
+ * 基础编码 自动获取数据
35639
+ */
35640
+ method: {
35641
+ type: String,
35642
+ default: "post"
35643
+ },
35623
35644
  /**
35624
35645
  * 选中记录后绑定值的属性名
35625
35646
  * 默认为'id',即选中某行后,会取该行数据的id字段作为值
@@ -35858,20 +35879,54 @@ var _sfc_main$b = /* @__PURE__ */ defineComponent({
35858
35879
  state.isQuerying = true;
35859
35880
  state.loading = true;
35860
35881
  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
- });
35882
+ if (typeof props.fetchOptions === "function") {
35883
+ props.fetchOptions(finalParams).then((res) => {
35884
+ const result = res.data?.result;
35885
+ state.tableData.items = result?.items ?? [];
35886
+ state.tableData.total = result?.total ?? 0;
35887
+ state.loading = false;
35888
+ state.isQuerying = false;
35889
+ updateSelectedRows();
35890
+ }).catch((error) => {
35891
+ ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
35892
+ state.tableData.items = [];
35893
+ state.tableData.total = 0;
35894
+ state.loading = false;
35895
+ state.isQuerying = false;
35896
+ });
35897
+ } else {
35898
+ if (props.method == "post") {
35899
+ useBaseApi(props.apiAction).post(finalParams, props.apiAction).then((res) => {
35900
+ const result = res.data?.result;
35901
+ state.tableData.items = result?.items ?? [];
35902
+ state.tableData.total = result?.total ?? 0;
35903
+ state.loading = false;
35904
+ state.isQuerying = false;
35905
+ updateSelectedRows();
35906
+ }).catch((error) => {
35907
+ ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
35908
+ state.tableData.items = [];
35909
+ state.tableData.total = 0;
35910
+ state.loading = false;
35911
+ state.isQuerying = false;
35912
+ });
35913
+ } else {
35914
+ useBaseApi(props.apiAction).get(finalParams, props.apiAction).then((res) => {
35915
+ const result = res.data?.result;
35916
+ state.tableData.items = result?.items ?? [];
35917
+ state.tableData.total = result?.total ?? 0;
35918
+ state.loading = false;
35919
+ state.isQuerying = false;
35920
+ updateSelectedRows();
35921
+ }).catch((error) => {
35922
+ ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
35923
+ state.tableData.items = [];
35924
+ state.tableData.total = 0;
35925
+ state.loading = false;
35926
+ state.isQuerying = false;
35927
+ });
35928
+ }
35929
+ }
35875
35930
  };
35876
35931
  const resetQuery = () => {
35877
35932
  state.loading = true;
@@ -36240,7 +36295,7 @@ var _sfc_main$b = /* @__PURE__ */ defineComponent({
36240
36295
  }
36241
36296
  });
36242
36297
 
36243
- var inputtable = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-fc87e7bb"]]);
36298
+ var inputtable = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-5631ed37"]]);
36244
36299
 
36245
36300
  const _hoisted_1$3 = { style: { "padding": "5px" } };
36246
36301
  const _hoisted_2$2 = { style: { "display": "flex", "align-items": "center", "gap": "8px", "flex-wrap": "nowrap", "overflow": "hidden" } };
@@ -738,6 +738,18 @@ declare const Fminputtable: {
738
738
  type: FunctionConstructor;
739
739
  required: true;
740
740
  };
741
+ apiService: {
742
+ type: StringConstructor;
743
+ default: string;
744
+ };
745
+ apiAction: {
746
+ type: StringConstructor;
747
+ default: string;
748
+ };
749
+ method: {
750
+ type: StringConstructor;
751
+ default: string;
752
+ };
741
753
  valueProp: {
742
754
  type: StringConstructor;
743
755
  default: string;
@@ -816,6 +828,9 @@ declare const Fminputtable: {
816
828
  disabled: boolean;
817
829
  placeholder: string;
818
830
  clearable: boolean;
831
+ method: string;
832
+ apiService: string;
833
+ apiAction: string;
819
834
  valueProp: string;
820
835
  labelProp: string;
821
836
  labelFormat: Function;
@@ -843,6 +858,18 @@ declare const Fminputtable: {
843
858
  type: FunctionConstructor;
844
859
  required: true;
845
860
  };
861
+ apiService: {
862
+ type: StringConstructor;
863
+ default: string;
864
+ };
865
+ apiAction: {
866
+ type: StringConstructor;
867
+ default: string;
868
+ };
869
+ method: {
870
+ type: StringConstructor;
871
+ default: string;
872
+ };
846
873
  valueProp: {
847
874
  type: StringConstructor;
848
875
  default: string;
@@ -918,6 +945,9 @@ declare const Fminputtable: {
918
945
  disabled: boolean;
919
946
  placeholder: string;
920
947
  clearable: boolean;
948
+ method: string;
949
+ apiService: string;
950
+ apiAction: string;
921
951
  valueProp: string;
922
952
  labelProp: string;
923
953
  labelFormat: Function;
@@ -939,6 +969,18 @@ declare const Fminputtable: {
939
969
  type: FunctionConstructor;
940
970
  required: true;
941
971
  };
972
+ apiService: {
973
+ type: StringConstructor;
974
+ default: string;
975
+ };
976
+ apiAction: {
977
+ type: StringConstructor;
978
+ default: string;
979
+ };
980
+ method: {
981
+ type: StringConstructor;
982
+ default: string;
983
+ };
942
984
  valueProp: {
943
985
  type: StringConstructor;
944
986
  default: string;
@@ -1017,6 +1059,9 @@ declare const Fminputtable: {
1017
1059
  disabled: boolean;
1018
1060
  placeholder: string;
1019
1061
  clearable: boolean;
1062
+ method: string;
1063
+ apiService: string;
1064
+ apiAction: string;
1020
1065
  valueProp: string;
1021
1066
  labelProp: string;
1022
1067
  labelFormat: Function;
@@ -103,6 +103,27 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
103
103
  required: true;
104
104
  };
105
105
  /**
106
+ * api service name
107
+ */
108
+ apiService: {
109
+ type: StringConstructor;
110
+ default: string;
111
+ };
112
+ /**
113
+ * api service 下的方法
114
+ */
115
+ apiAction: {
116
+ type: StringConstructor;
117
+ default: string;
118
+ };
119
+ /**
120
+ * 基础编码 自动获取数据
121
+ */
122
+ method: {
123
+ type: StringConstructor;
124
+ default: string;
125
+ };
126
+ /**
106
127
  * 选中记录后绑定值的属性名
107
128
  * 默认为'id',即选中某行后,会取该行数据的id字段作为值
108
129
  */
@@ -311,6 +332,27 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
311
332
  required: true;
312
333
  };
313
334
  /**
335
+ * api service name
336
+ */
337
+ apiService: {
338
+ type: StringConstructor;
339
+ default: string;
340
+ };
341
+ /**
342
+ * api service 下的方法
343
+ */
344
+ apiAction: {
345
+ type: StringConstructor;
346
+ default: string;
347
+ };
348
+ /**
349
+ * 基础编码 自动获取数据
350
+ */
351
+ method: {
352
+ type: StringConstructor;
353
+ default: string;
354
+ };
355
+ /**
314
356
  * 选中记录后绑定值的属性名
315
357
  * 默认为'id',即选中某行后,会取该行数据的id字段作为值
316
358
  */
@@ -434,6 +476,9 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
434
476
  disabled: boolean;
435
477
  placeholder: string;
436
478
  clearable: boolean;
479
+ method: string;
480
+ apiService: string;
481
+ apiAction: string;
437
482
  valueProp: string;
438
483
  labelProp: string;
439
484
  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-5631ed37]{z-index:9999}[data-v-5631ed37] .el-select-dropdown{.el-scrollbar>.el-scrollbar__bar{display:none!important}}.popper-class[data-v-5631ed37]{min-width:400px!important}[data-v-5631ed37] .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-5631ed37"]]);
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({
@@ -97,6 +98,27 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
97
98
  required: true
98
99
  // 必填项
99
100
  },
101
+ /**
102
+ * api service name
103
+ */
104
+ apiService: {
105
+ type: String,
106
+ default: "baseData"
107
+ },
108
+ /**
109
+ * api service 下的方法
110
+ */
111
+ apiAction: {
112
+ type: String,
113
+ default: "BaseData"
114
+ },
115
+ /**
116
+ * 基础编码 自动获取数据
117
+ */
118
+ method: {
119
+ type: String,
120
+ default: "post"
121
+ },
100
122
  /**
101
123
  * 选中记录后绑定值的属性名
102
124
  * 默认为'id',即选中某行后,会取该行数据的id字段作为值
@@ -335,20 +357,54 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
335
357
  state.isQuerying = true;
336
358
  state.loading = true;
337
359
  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
- });
360
+ if (typeof props.fetchOptions === "function") {
361
+ props.fetchOptions(finalParams).then((res) => {
362
+ const result = res.data?.result;
363
+ state.tableData.items = result?.items ?? [];
364
+ state.tableData.total = result?.total ?? 0;
365
+ state.loading = false;
366
+ state.isQuerying = false;
367
+ updateSelectedRows();
368
+ }).catch((error) => {
369
+ elementPlus.ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
370
+ state.tableData.items = [];
371
+ state.tableData.total = 0;
372
+ state.loading = false;
373
+ state.isQuerying = false;
374
+ });
375
+ } else {
376
+ if (props.method == "post") {
377
+ index.useBaseApi(props.apiAction).post(finalParams, props.apiAction).then((res) => {
378
+ const result = res.data?.result;
379
+ state.tableData.items = result?.items ?? [];
380
+ state.tableData.total = result?.total ?? 0;
381
+ state.loading = false;
382
+ state.isQuerying = false;
383
+ updateSelectedRows();
384
+ }).catch((error) => {
385
+ elementPlus.ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
386
+ state.tableData.items = [];
387
+ state.tableData.total = 0;
388
+ state.loading = false;
389
+ state.isQuerying = false;
390
+ });
391
+ } else {
392
+ index.useBaseApi(props.apiAction).get(finalParams, props.apiAction).then((res) => {
393
+ const result = res.data?.result;
394
+ state.tableData.items = result?.items ?? [];
395
+ state.tableData.total = result?.total ?? 0;
396
+ state.loading = false;
397
+ state.isQuerying = false;
398
+ updateSelectedRows();
399
+ }).catch((error) => {
400
+ elementPlus.ElMessage.error("\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
401
+ state.tableData.items = [];
402
+ state.tableData.total = 0;
403
+ state.loading = false;
404
+ state.isQuerying = false;
405
+ });
406
+ }
407
+ }
352
408
  };
353
409
  const resetQuery = () => {
354
410
  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.99",
4
4
  "description": "Page level components developed based on Element Plus.",
5
5
  "author": "fmdevui",
6
6
  "keywords": [