m-eleplus-crud 0.0.12 → 0.0.13

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 (66) hide show
  1. package/dist/index.full.js +1 -1
  2. package/dist/index.full.min.js +1 -1
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +1 -1
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +1 -1
  7. package/es/index.mjs +5 -5
  8. package/es/packages/components/crud/index.mjs +2 -2
  9. package/es/packages/components/crud/src/crud.mjs +53 -621
  10. package/es/packages/components/crud/src/crud.mjs.map +1 -1
  11. package/es/packages/components/crud/src/crud2.mjs +621 -53
  12. package/es/packages/components/crud/src/crud2.mjs.map +1 -1
  13. package/es/packages/components/form/src/form.mjs +1 -1
  14. package/es/packages/components/form/src/form.mjs.map +1 -1
  15. package/es/packages/components/index.mjs +5 -5
  16. package/es/packages/components/picture/index.mjs +2 -2
  17. package/es/packages/components/picture/src/picture.mjs +19 -26
  18. package/es/packages/components/picture/src/picture.mjs.map +1 -1
  19. package/es/packages/components/picture/src/picture2.mjs +26 -19
  20. package/es/packages/components/picture/src/picture2.mjs.map +1 -1
  21. package/es/packages/components/qrcode/index.mjs +2 -2
  22. package/es/packages/components/qrcode/src/qrcode.mjs +62 -22
  23. package/es/packages/components/qrcode/src/qrcode.mjs.map +1 -1
  24. package/es/packages/components/qrcode/src/qrcode2.mjs +22 -62
  25. package/es/packages/components/qrcode/src/qrcode2.mjs.map +1 -1
  26. package/es/packages/components/search/index.mjs +2 -2
  27. package/es/packages/components/search/src/search.mjs +438 -25
  28. package/es/packages/components/search/src/search.mjs.map +1 -1
  29. package/es/packages/components/search/src/search2.mjs +25 -438
  30. package/es/packages/components/search/src/search2.mjs.map +1 -1
  31. package/es/packages/components/table/index.mjs +2 -2
  32. package/es/packages/components/table/src/table.mjs +37 -420
  33. package/es/packages/components/table/src/table.mjs.map +1 -1
  34. package/es/packages/components/table/src/table2.mjs +420 -37
  35. package/es/packages/components/table/src/table2.mjs.map +1 -1
  36. package/lib/index.js +5 -5
  37. package/lib/packages/components/crud/index.js +2 -2
  38. package/lib/packages/components/crud/src/crud.js +54 -621
  39. package/lib/packages/components/crud/src/crud.js.map +1 -1
  40. package/lib/packages/components/crud/src/crud2.js +621 -54
  41. package/lib/packages/components/crud/src/crud2.js.map +1 -1
  42. package/lib/packages/components/form/src/form.js +1 -1
  43. package/lib/packages/components/form/src/form.js.map +1 -1
  44. package/lib/packages/components/index.js +5 -5
  45. package/lib/packages/components/picture/index.js +2 -2
  46. package/lib/packages/components/picture/src/picture.js +20 -26
  47. package/lib/packages/components/picture/src/picture.js.map +1 -1
  48. package/lib/packages/components/picture/src/picture2.js +26 -20
  49. package/lib/packages/components/picture/src/picture2.js.map +1 -1
  50. package/lib/packages/components/qrcode/index.js +2 -2
  51. package/lib/packages/components/qrcode/src/qrcode.js +66 -23
  52. package/lib/packages/components/qrcode/src/qrcode.js.map +1 -1
  53. package/lib/packages/components/qrcode/src/qrcode2.js +23 -66
  54. package/lib/packages/components/qrcode/src/qrcode2.js.map +1 -1
  55. package/lib/packages/components/search/index.js +2 -2
  56. package/lib/packages/components/search/src/search.js +438 -26
  57. package/lib/packages/components/search/src/search.js.map +1 -1
  58. package/lib/packages/components/search/src/search2.js +26 -438
  59. package/lib/packages/components/search/src/search2.js.map +1 -1
  60. package/lib/packages/components/table/index.js +2 -2
  61. package/lib/packages/components/table/src/table.js +38 -425
  62. package/lib/packages/components/table/src/table.js.map +1 -1
  63. package/lib/packages/components/table/src/table2.js +425 -38
  64. package/lib/packages/components/table/src/table2.js.map +1 -1
  65. package/package.json +1 -1
  66. package/web-types.json +1 -1
@@ -2,74 +2,31 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var Qrcode$1 = require('qrcodejs2-fix');
7
- var qrcode = require('./qrcode.js');
8
- var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
5
+ var runtime = require('../../../utils/vue/props/runtime.js');
6
+ var shared = require('@vue/shared');
9
7
 
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var Qrcode__default = /*#__PURE__*/_interopDefaultLegacy(Qrcode$1);
13
-
14
- const COMPONENT_NAME = "MQrcode";
15
- const __default__ = vue.defineComponent({
16
- name: COMPONENT_NAME
17
- });
18
- const _sfc_main = vue.defineComponent({
19
- ...__default__,
20
- props: qrcode.qrcodeProps,
21
- emits: qrcode.qrcodeEmits,
22
- setup(__props, { emit: __emit }) {
23
- const props = __props;
24
- const emit = __emit;
25
- const qrcodeRef = vue.ref();
26
- const alignComputed = vue.computed(() => {
27
- if (!props.align || props.align === "left") {
28
- return "flex-start";
29
- }
30
- if (props.align === "right") {
31
- return "flex-end";
32
- }
33
- return "center";
34
- });
35
- vue.watch(
36
- () => props.text,
37
- (newVal) => {
38
- if (!newVal)
39
- return;
40
- setTimeout(() => {
41
- qrcodeRef.value.innerHTML = "";
42
- new Qrcode__default["default"](qrcodeRef.value, {
43
- text: newVal,
44
- width: props.qrcodeWidth,
45
- height: props.qrcodeHeight
46
- });
47
- const img = qrcodeRef.value.querySelector("img");
48
- img.onclick = () => {
49
- emit("click", newVal);
50
- };
51
- }, 0);
52
- },
53
- {
54
- immediate: true
55
- }
56
- );
57
- return (_ctx, _cache) => {
58
- return vue.openBlock(), vue.createElementBlock(
59
- "div",
60
- {
61
- ref_key: "qrcodeRef",
62
- ref: qrcodeRef,
63
- class: "m-qrcode-box",
64
- style: vue.normalizeStyle("justify-content: " + alignComputed.value)
65
- },
66
- null,
67
- 4
68
- );
69
- };
8
+ const qrcodeProps = runtime.buildProps({
9
+ text: {
10
+ type: String,
11
+ required: true
12
+ },
13
+ align: {
14
+ type: String,
15
+ default: "left"
16
+ },
17
+ qrcodeWidth: {
18
+ type: Number,
19
+ default: 70
20
+ },
21
+ qrcodeHeight: {
22
+ type: Number,
23
+ default: 70
70
24
  }
71
25
  });
72
- var Qrcode = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "qrcode.vue"]]);
26
+ const qrcodeEmits = {
27
+ click: (val) => shared.isString(val)
28
+ };
73
29
 
74
- exports["default"] = Qrcode;
30
+ exports.qrcodeEmits = qrcodeEmits;
31
+ exports.qrcodeProps = qrcodeProps;
75
32
  //# sourceMappingURL=qrcode2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"qrcode2.js","sources":["../../../../../../../packages/components/qrcode/src/qrcode.vue"],"sourcesContent":["<template>\r\n <div\r\n ref=\"qrcodeRef\"\r\n class=\"m-qrcode-box\"\r\n :style=\"'justify-content: ' + alignComputed\"\r\n />\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\nimport { computed, ref, watch } from 'vue'\r\n// @ts-ignore\r\nimport Qrcode from 'qrcodejs2-fix'\r\nimport { qrcodeEmits, qrcodeProps } from './qrcode'\r\n\r\nconst COMPONENT_NAME = 'MQrcode'\r\ndefineOptions({\r\n name: COMPONENT_NAME,\r\n})\r\n\r\nconst props = defineProps(qrcodeProps)\r\nconst emit = defineEmits(qrcodeEmits)\r\n\r\nconst qrcodeRef = ref<any>()\r\n\r\nconst alignComputed = computed(() => {\r\n if (!props.align || props.align === 'left') {\r\n return 'flex-start'\r\n }\r\n if (props.align === 'right') {\r\n return 'flex-end'\r\n }\r\n return 'center'\r\n})\r\n\r\nwatch(\r\n () => props.text as string,\r\n (newVal: string) => {\r\n if (!newVal) return\r\n setTimeout(() => {\r\n qrcodeRef.value.innerHTML = ''\r\n new Qrcode(qrcodeRef.value, {\r\n text: newVal,\r\n width: props.qrcodeWidth,\r\n height: props.qrcodeHeight,\r\n })\r\n const img = qrcodeRef.value.querySelector('img')\r\n img.onclick = () => {\r\n emit('click', newVal)\r\n }\r\n }, 0)\r\n },\r\n {\r\n immediate: true,\r\n }\r\n)\r\n</script>\r\n"],"names":["DO_defineComponent","ref","computed","watch","Qrcode"],"mappings":";;;;;;;;;;;;;;AAec,MAAA,cAAAA,mBAAA,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;AAEA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAA,MAAM,YAAYC,OAAS,EAAA,CAAA;AAErB,IAAA,MAAA,aAAA,GAAgBC,aAAS,MAAM;AACnC,MAAA,IAAI,CAAC,KAAA,CAAM,KAAS,IAAA,KAAA,CAAM,UAAU,MAAQ,EAAA;AACnC,QAAA,OAAA,YAAA,CAAA;AAAA,OACT;AACI,MAAA,IAAA,KAAA,CAAM,UAAU,OAAS,EAAA;AACpB,QAAA,OAAA,UAAA,CAAA;AAAA,OACT;AACO,MAAA,OAAA,QAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAAC,SAAA;AAAA,MACE,MAAM,KAAM,CAAA,IAAA;AAAA,MACZ,CAAC,MAAmB,KAAA;AAClB,QAAA,IAAI,CAAC,MAAA;AAAQ,UAAA,OAAA;AACb,QAAA,UAAA,CAAW,MAAM;AACf,UAAA,SAAA,CAAU,MAAM,SAAY,GAAA,EAAA,CAAA;AACxB,UAAA,IAAAC,0BAAA,CAAO,UAAU,KAAO,EAAA;AAAA,YAC1B,IAAM,EAAA,MAAA;AAAA,YACN,OAAO,KAAM,CAAA,WAAA;AAAA,YACb,QAAQ,KAAM,CAAA,YAAA;AAAA,WACf,CAAA,CAAA;AACD,UAAA,MAAM,GAAM,GAAA,SAAA,CAAU,KAAM,CAAA,aAAA,CAAc,KAAK,CAAA,CAAA;AAC/C,UAAA,GAAA,CAAI,UAAU,MAAM;AAClB,YAAA,IAAA,CAAK,SAAS,MAAM,CAAA,CAAA;AAAA,WACtB,CAAA;AAAA,WACC,CAAC,CAAA,CAAA;AAAA,OACN;AAAA,MACA;AAAA,QACE,SAAW,EAAA,IAAA;AAAA,OACb;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"qrcode2.js","sources":["../../../../../../../packages/components/qrcode/src/qrcode.ts"],"sourcesContent":["import { buildProps, isString } from '@m-eleplus-crud/utils'\r\n\r\nimport type { ExtractPropTypes } from 'vue'\r\n\r\nexport const qrcodeProps = buildProps({\r\n /**\r\n * @description 二维码内容\r\n */\r\n text: {\r\n type: String,\r\n required: true,\r\n },\r\n /**\r\n * @description 对齐方式\r\n */\r\n align: {\r\n type: String,\r\n default: 'left',\r\n },\r\n /**\r\n * @description qrcode宽度\r\n */\r\n qrcodeWidth: {\r\n type: Number,\r\n default: 70,\r\n },\r\n /**\r\n * @description qrcode高度\r\n */\r\n qrcodeHeight: {\r\n type: Number,\r\n default: 70,\r\n },\r\n} as const)\r\nexport type QrcodeProps = ExtractPropTypes<typeof qrcodeProps>\r\n\r\nexport const qrcodeEmits = {\r\n click: (val: string) => isString(val),\r\n}\r\nexport type QrcodeEmits = typeof qrcodeEmits\r\n"],"names":["buildProps","isString"],"mappings":";;;;;;;AAIO,MAAM,cAAcA,kBAAW,CAAA;AAAA,EAIpC,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,MAAA;AAAA,IACN,QAAU,EAAA,IAAA;AAAA,GACZ;AAAA,EAIA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,MAAA;AAAA,GACX;AAAA,EAIA,WAAa,EAAA;AAAA,IACX,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EAIA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AACF,CAAU,EAAA;AAGH,MAAM,WAAc,GAAA;AAAA,EACzB,KAAO,EAAA,CAAC,GAAgB,KAAAC,eAAA,CAAS,GAAG,CAAA;AACtC;;;;;"}
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var search$1 = require('./src/search2.js');
6
- var search = require('./src/search.js');
5
+ var search$1 = require('./src/search.js');
6
+ var search = require('./src/search2.js');
7
7
  var install = require('../../utils/vue/install.js');
8
8
 
9
9
  const MSearch = install.withInstall(search$1["default"]);
@@ -2,34 +2,446 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var runtime = require('../../../utils/vue/props/runtime.js');
6
- var index = require('../../../hooks/use-size/index.js');
7
- var shared = require('@vue/shared');
5
+ var vue = require('vue');
6
+ var lodashUnified = require('lodash-unified');
7
+ var search = require('./search2.js');
8
+ var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
9
+ var index = require('../../../hooks/use-locale/index.js');
10
+ var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
11
+ var error = require('../../../utils/error.js');
8
12
 
9
- const searchProps = runtime.buildProps({
10
- size: index.useSizeProp,
11
- loading: {
12
- type: Boolean,
13
- default: false
14
- },
15
- permission: {
16
- type: Object,
17
- default: {}
18
- },
19
- model: {
20
- type: Object,
21
- required: true
22
- },
23
- option: {
24
- type: runtime.definePropType(Object),
25
- required: false
13
+ const COMPONENT_NAME = "MSearch";
14
+ const __default__ = vue.defineComponent({
15
+ name: COMPONENT_NAME
16
+ });
17
+ const _sfc_main = vue.defineComponent({
18
+ ...__default__,
19
+ props: search.searchProps,
20
+ emits: search.searchEmits,
21
+ setup(__props, { expose: __expose, emit: __emit }) {
22
+ const props = __props;
23
+ const emit = __emit;
24
+ const slots = vue.useSlots();
25
+ const { t } = index.useLocale();
26
+ const INPUT_TYPES = ["input", "textarea", "number", "password"];
27
+ const SELECT_TYPES = ["select", "checkbox", "radio", "switch"];
28
+ const DATE_TYPES = [
29
+ "year",
30
+ "month",
31
+ "date",
32
+ "datetime",
33
+ "week",
34
+ "datetimerange",
35
+ "daterange",
36
+ "monthrange",
37
+ "yearrange",
38
+ "time",
39
+ "timerange"
40
+ ];
41
+ const searchOption = vue.ref({
42
+ searchBtnText: t("m.search.searchBtnText"),
43
+ resetBtnText: t("m.search.resetBtnText"),
44
+ searchBtnIcon: "Search",
45
+ resetBtnIcon: "Delete",
46
+ labelWidth: "80px",
47
+ colIndex: 3,
48
+ col: false,
49
+ column: []
50
+ });
51
+ const formRef = vue.ref();
52
+ const globalConfig = useGlobalConfig.useGlobalConfig();
53
+ const searchCol = vue.ref(true);
54
+ const proxys = new Proxy(props.model, {
55
+ get(target, property) {
56
+ return lodashUnified.get(target, property);
57
+ },
58
+ set(target, property, value) {
59
+ lodashUnified.set(target, property, value);
60
+ return true;
61
+ }
62
+ });
63
+ const initValue = () => {
64
+ var _a;
65
+ if (searchOption.value && searchOption.value.column) {
66
+ for (let i = 0; i < ((_a = searchOption.value.column) == null ? void 0 : _a.length); i++) {
67
+ const column = searchOption.value.column[i];
68
+ if (column.prop && proxys[column.prop] === void 0) {
69
+ if (column.value) {
70
+ proxys[column.prop] = column.value;
71
+ } else {
72
+ const ARR_TYPES = [
73
+ "checkbox",
74
+ "datetimerange",
75
+ "daterange",
76
+ "monthrange",
77
+ "yearrange",
78
+ "timerange"
79
+ ];
80
+ if (column.type === "select" && column.multiple || ARR_TYPES.includes(column.type || "")) {
81
+ proxys[column.prop] = [];
82
+ } else {
83
+ proxys[column.prop] = "";
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ };
90
+ const getValueFormatByType = (type) => {
91
+ let format = "";
92
+ switch (type) {
93
+ case "yearrange":
94
+ case "year":
95
+ format = "YYYY";
96
+ break;
97
+ case "monthrange":
98
+ case "month":
99
+ format = "YYYY-MM";
100
+ break;
101
+ case "daterange":
102
+ case "week":
103
+ case "date":
104
+ format = "YYYY-MM-DD";
105
+ break;
106
+ case "datetimerange":
107
+ case "datetime":
108
+ format = "YYYY-MM-DD HH:mm:ss";
109
+ break;
110
+ case "time":
111
+ format = "HH:mm:ss";
112
+ break;
113
+ }
114
+ return format;
115
+ };
116
+ const search = (page = 1) => {
117
+ var _a;
118
+ if (searchOption.value.column && searchOption.value.column.length) {
119
+ (_a = formRef.value) == null ? void 0 : _a.validate((valid) => {
120
+ if (valid) {
121
+ if (proxys.page) {
122
+ proxys.page = page;
123
+ }
124
+ emit("search", proxys);
125
+ }
126
+ });
127
+ } else {
128
+ if (proxys.page) {
129
+ proxys.page = page;
130
+ }
131
+ emit("search", proxys);
132
+ }
133
+ };
134
+ const reset = () => {
135
+ var _a;
136
+ if (proxys.page) {
137
+ proxys.page = 1;
138
+ }
139
+ if (proxys.limit) {
140
+ proxys.limit = 10;
141
+ }
142
+ (_a = formRef.value) == null ? void 0 : _a.resetFields();
143
+ emit("reset");
144
+ };
145
+ const toggleCol = () => {
146
+ searchCol.value = !searchCol.value;
147
+ };
148
+ const getAllRemoteDics = () => {
149
+ var _a, _b, _c, _d;
150
+ const hasDicUrl = (_b = (_a = searchOption.value) == null ? void 0 : _a.column) == null ? void 0 : _b.some((column) => column.dicUrl);
151
+ if (hasDicUrl && !((_c = globalConfig.value) == null ? void 0 : _c.httpGet)) {
152
+ error.debugWarn("MSearch", "global config httpGet is null");
153
+ return;
154
+ }
155
+ const updateRemoteDic = (column) => {
156
+ return new Promise((resolve) => {
157
+ let isSuccess = false;
158
+ globalConfig.value.httpGet(column.dicUrl, column.dicQuery, column.dicHeaders).then((e) => {
159
+ const { list, label, value } = column.dicFormatter(e);
160
+ if (list && Array.isArray(list)) {
161
+ column["dicData"] = list.map((item) => {
162
+ const lastLabel = label.replace(/\{(\w+)\}/g, (match, key) => {
163
+ return item[key] || match;
164
+ });
165
+ return {
166
+ label: lastLabel,
167
+ value: item[value]
168
+ };
169
+ });
170
+ isSuccess = true;
171
+ }
172
+ }).finally(() => {
173
+ if (!isSuccess) {
174
+ column["dicData"] = [];
175
+ }
176
+ resolve(null);
177
+ });
178
+ });
179
+ };
180
+ for (let i = 0; i < (((_d = searchOption.value) == null ? void 0 : _d.column) || []).length; i++) {
181
+ const column = searchOption.value.column[i];
182
+ if (column.dicUrl) {
183
+ if (!column.dicFormatter) {
184
+ error.debugWarn("MSearch", "dicUrl and dicFormatter must be used together");
185
+ continue;
186
+ }
187
+ updateRemoteDic(column);
188
+ }
189
+ }
190
+ };
191
+ const wrapSelectData = (arr) => {
192
+ if (!arr) {
193
+ return [];
194
+ }
195
+ return [{ label: "\u5168\u90E8", value: "" }, ...arr];
196
+ };
197
+ vue.watch(
198
+ () => props.option,
199
+ (newVal) => {
200
+ if (newVal) {
201
+ searchOption.value = Object.assign({}, searchOption.value, newVal);
202
+ if (newVal.column) {
203
+ searchOption.value.column = lodashUnified.cloneDeep(
204
+ newVal.column.filter(
205
+ (column) => !(props.permission[column.prop || ""] === false)
206
+ ).sort((a, b) => (b.order || 0) - (a.order || 0))
207
+ );
208
+ }
209
+ getAllRemoteDics();
210
+ initValue();
211
+ }
212
+ },
213
+ {
214
+ immediate: true,
215
+ deep: true
216
+ }
217
+ );
218
+ __expose({
219
+ search,
220
+ reset
221
+ });
222
+ return (_ctx, _cache) => {
223
+ const _component_el_input = vue.resolveComponent("el-input");
224
+ const _component_el_option = vue.resolveComponent("el-option");
225
+ const _component_el_select = vue.resolveComponent("el-select");
226
+ const _component_el_date_picker = vue.resolveComponent("el-date-picker");
227
+ const _component_el_time_picker = vue.resolveComponent("el-time-picker");
228
+ const _component_el_form_item = vue.resolveComponent("el-form-item");
229
+ const _component_el_col = vue.resolveComponent("el-col");
230
+ const _component_el_button = vue.resolveComponent("el-button");
231
+ const _component_ArrowDown = vue.resolveComponent("ArrowDown");
232
+ const _component_ArrowUp = vue.resolveComponent("ArrowUp");
233
+ const _component_el_icon = vue.resolveComponent("el-icon");
234
+ const _component_el_link = vue.resolveComponent("el-link");
235
+ const _component_el_row = vue.resolveComponent("el-row");
236
+ const _component_el_form = vue.resolveComponent("el-form");
237
+ return searchOption.value.column && searchOption.value.column.length ? (vue.openBlock(), vue.createElementBlock("div", {
238
+ key: 0,
239
+ class: "m-search"
240
+ }, [
241
+ vue.createVNode(_component_el_form, {
242
+ ref_key: "formRef",
243
+ ref: formRef,
244
+ inline: true,
245
+ model: vue.unref(proxys),
246
+ size: _ctx.size || vue.unref(globalConfig).size,
247
+ disabled: _ctx.loading,
248
+ "label-width": searchOption.value.labelWidth,
249
+ onSubmit: vue.withModifiers(() => {
250
+ }, ["prevent"])
251
+ }, {
252
+ default: vue.withCtx(() => [
253
+ vue.createVNode(_component_el_row, { gutter: 0 }, {
254
+ default: vue.withCtx(() => [
255
+ (vue.openBlock(true), vue.createElementBlock(
256
+ vue.Fragment,
257
+ null,
258
+ vue.renderList(searchOption.value.column, (column, columnIndex) => {
259
+ return vue.openBlock(), vue.createElementBlock(
260
+ vue.Fragment,
261
+ { key: columnIndex },
262
+ [
263
+ !searchOption.value.col || !searchCol.value || columnIndex < (searchOption.value.colIndex || 3) ? (vue.openBlock(), vue.createBlock(_component_el_col, {
264
+ key: 0,
265
+ span: column.span || 6
266
+ }, {
267
+ default: vue.withCtx(() => [
268
+ vue.createVNode(_component_el_form_item, {
269
+ style: { "width": "100%" },
270
+ "label-width": column.labelWidth || searchOption.value.labelWidth,
271
+ label: column.label + ":",
272
+ prop: column.prop,
273
+ rules: column.rules
274
+ }, {
275
+ default: vue.withCtx(() => [
276
+ vue.createCommentVNode("\u63D2\u69FD"),
277
+ vue.unref(slots)[column.prop || ""] ? vue.renderSlot(_ctx.$slots, column.prop, vue.mergeProps({
278
+ key: 0,
279
+ ref_for: true
280
+ }, { size: _ctx.size || vue.unref(globalConfig).size, loading: _ctx.loading })) : !column.type || INPUT_TYPES.includes(column.type) ? (vue.openBlock(), vue.createElementBlock(
281
+ vue.Fragment,
282
+ { key: 1 },
283
+ [
284
+ vue.createCommentVNode(""),
285
+ vue.createCommentVNode("\u8F93\u5165\u6846"),
286
+ vue.createVNode(_component_el_input, {
287
+ modelValue: vue.unref(proxys)[column.prop || ""],
288
+ "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
289
+ modelModifiers: { trim: true },
290
+ placeholder: column.placeholder,
291
+ style: { "width": "100%" },
292
+ type: "text",
293
+ onKeyup: vue.withKeys(($event) => search(1), ["enter"])
294
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onKeyup"])
295
+ ],
296
+ 64
297
+ )) : SELECT_TYPES.includes(column.type) ? (vue.openBlock(), vue.createElementBlock(
298
+ vue.Fragment,
299
+ { key: 2 },
300
+ [
301
+ vue.createCommentVNode(""),
302
+ vue.createCommentVNode("\u5355\u9009/\u591A\u9009"),
303
+ vue.createVNode(_component_el_select, {
304
+ modelValue: vue.unref(proxys)[column.prop || ""],
305
+ "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
306
+ style: { "width": "100%" },
307
+ placeholder: column.placeholder,
308
+ multiple: column.multiple || column.type === "checkbox",
309
+ clearable: column.clearable === void 0 ? true : column.clearable,
310
+ "empty-values": [null, void 0]
311
+ }, {
312
+ default: vue.withCtx(() => [
313
+ (vue.openBlock(true), vue.createElementBlock(
314
+ vue.Fragment,
315
+ null,
316
+ vue.renderList(wrapSelectData(column.dicData), (dicItem, dicIndex) => {
317
+ return vue.openBlock(), vue.createBlock(_component_el_option, {
318
+ key: dicIndex,
319
+ label: dicItem.label,
320
+ value: dicItem.value
321
+ }, null, 8, ["label", "value"]);
322
+ }),
323
+ 128
324
+ ))
325
+ ]),
326
+ _: 2
327
+ }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "clearable"])
328
+ ],
329
+ 64
330
+ )) : DATE_TYPES.includes(column.type) ? (vue.openBlock(), vue.createElementBlock(
331
+ vue.Fragment,
332
+ { key: 3 },
333
+ [
334
+ vue.createCommentVNode(""),
335
+ vue.createCommentVNode("\u65F6\u95F4\u9009\u62E9"),
336
+ column.type !== "time" && column.type !== "timerange" ? (vue.openBlock(), vue.createBlock(_component_el_date_picker, {
337
+ key: 0,
338
+ modelValue: vue.unref(proxys)[column.prop || ""],
339
+ "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
340
+ type: column.type,
341
+ clearable: column.clearable,
342
+ "start-placeholder": column.startPlaceholder,
343
+ "end-placeholder": column.endPlaceholder,
344
+ format: column.format,
345
+ "value-format": column.valueFormat || getValueFormatByType(column.type)
346
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "clearable", "start-placeholder", "end-placeholder", "format", "value-format"])) : (vue.openBlock(), vue.createBlock(_component_el_time_picker, {
347
+ key: 1,
348
+ modelValue: vue.unref(proxys)[column.prop || ""],
349
+ "onUpdate:modelValue": ($event) => vue.unref(proxys)[column.prop || ""] = $event,
350
+ "is-range": column.type === "timerange",
351
+ clearable: column.clearable,
352
+ "start-placeholder": column.startPlaceholder,
353
+ "end-placeholder": column.endPlaceholder,
354
+ "value-format": column.valueFormat || getValueFormatByType(column.type)
355
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "is-range", "clearable", "start-placeholder", "end-placeholder", "value-format"]))
356
+ ],
357
+ 64
358
+ )) : vue.createCommentVNode("v-if", true)
359
+ ]),
360
+ _: 2
361
+ }, 1032, ["label-width", "label", "prop", "rules"])
362
+ ]),
363
+ _: 2
364
+ }, 1032, ["span"])) : vue.createCommentVNode("v-if", true)
365
+ ],
366
+ 64
367
+ );
368
+ }),
369
+ 128
370
+ )),
371
+ vue.createVNode(_component_el_col, { span: 6 }, {
372
+ default: vue.withCtx(() => [
373
+ vue.createVNode(_component_el_form_item, {
374
+ class: "m-search-btns",
375
+ style: { "width": "100%" }
376
+ }, {
377
+ default: vue.withCtx(() => [
378
+ vue.createVNode(_component_el_button, {
379
+ type: "primary",
380
+ icon: searchOption.value.searchBtnIcon,
381
+ loading: _ctx.loading,
382
+ onClick: ($event) => search(1)
383
+ }, {
384
+ default: vue.withCtx(() => [
385
+ vue.createTextVNode(
386
+ vue.toDisplayString(searchOption.value.searchBtnText),
387
+ 1
388
+ )
389
+ ]),
390
+ _: 1
391
+ }, 8, ["icon", "loading", "onClick"]),
392
+ vue.createVNode(_component_el_button, {
393
+ type: "default",
394
+ icon: searchOption.value.resetBtnIcon,
395
+ loading: _ctx.loading,
396
+ onClick: reset
397
+ }, {
398
+ default: vue.withCtx(() => [
399
+ vue.createTextVNode(
400
+ vue.toDisplayString(searchOption.value.resetBtnText),
401
+ 1
402
+ )
403
+ ]),
404
+ _: 1
405
+ }, 8, ["icon", "loading"]),
406
+ searchOption.value.col ? (vue.openBlock(), vue.createBlock(_component_el_link, {
407
+ key: 0,
408
+ style: { "width": "54px", "margin-left": "12px" },
409
+ underline: "never",
410
+ disabled: _ctx.loading,
411
+ type: "default",
412
+ onClick: toggleCol
413
+ }, {
414
+ default: vue.withCtx(() => [
415
+ vue.createVNode(_component_el_icon, { style: { "margin-right": "6px" } }, {
416
+ default: vue.withCtx(() => [
417
+ searchCol.value ? (vue.openBlock(), vue.createBlock(_component_ArrowDown, { key: 0 })) : (vue.openBlock(), vue.createBlock(_component_ArrowUp, { key: 1 }))
418
+ ]),
419
+ _: 1
420
+ }),
421
+ vue.createTextVNode(
422
+ " " + vue.toDisplayString(searchCol.value ? vue.unref(t)("m.search.expandBtn") : vue.unref(t)("m.search.colBtn")),
423
+ 1
424
+ )
425
+ ]),
426
+ _: 1
427
+ }, 8, ["disabled"])) : vue.createCommentVNode("v-if", true)
428
+ ]),
429
+ _: 1
430
+ })
431
+ ]),
432
+ _: 1
433
+ })
434
+ ]),
435
+ _: 3
436
+ })
437
+ ]),
438
+ _: 3
439
+ }, 8, ["model", "size", "disabled", "label-width", "onSubmit"])
440
+ ])) : vue.createCommentVNode("v-if", true);
441
+ };
26
442
  }
27
443
  });
28
- const searchEmits = {
29
- search: (model) => shared.isObject(model),
30
- reset: () => true
31
- };
444
+ var Search = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "search.vue"]]);
32
445
 
33
- exports.searchEmits = searchEmits;
34
- exports.searchProps = searchProps;
446
+ exports["default"] = Search;
35
447
  //# sourceMappingURL=search.js.map