@ctzy-web-client/plugin-component-vue 1.0.23 → 1.0.25

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 (131) hide show
  1. package/es/advance-select/advance-operation.mjs +51 -37
  2. package/es/advance-select/advance-option.mjs +167 -97
  3. package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs +7 -0
  4. package/es/advance-select/advance-select.mjs +368 -310
  5. package/es/advance-select/index.mjs +5 -5
  6. package/es/application-slot/breadcrumb-item.mjs +20 -17
  7. package/es/application-slot/header-tools-item.mjs +20 -17
  8. package/es/breadcrumb-select/breadcrumb-select.mjs +134 -112
  9. package/es/contextmenu/contextmenu-item.mjs +19 -15
  10. package/es/contextmenu/contextmenu.mjs +72 -56
  11. package/es/data-form/data-form-item.mjs +48 -30
  12. package/es/data-form/data-form.mjs +213 -166
  13. package/es/data-form/form-components/bwa-date-picker.mjs +51 -39
  14. package/es/data-form/form-components/bwa-date-time-picker.mjs +56 -44
  15. package/es/data-form/form-components/bwa-input-float.mjs +48 -37
  16. package/es/data-form/form-components/bwa-input-integer.mjs +68 -50
  17. package/es/data-form/form-components/bwa-input.mjs +43 -32
  18. package/es/data-form/form-components/bwa-multi-select.mjs +40 -29
  19. package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +554 -218
  20. package/es/data-form/form-components/bwa-rich-text.mjs +404 -316
  21. package/es/data-form/form-components/bwa-select.mjs +84 -70
  22. package/es/data-form/form-components/bwa-textarea.mjs +38 -27
  23. package/es/data-form/form-components/bwa-upload.mjs +172 -148
  24. package/es/data-form/form-components/bwa-user-multi-select.mjs +35 -24
  25. package/es/data-form/form-components/bwa-user-select.mjs +86 -61
  26. package/es/data-table/data-column-view.mjs +146 -115
  27. package/es/data-table/data-table-card.mjs +48 -40
  28. package/es/data-table/data-table-column.mjs +58 -45
  29. package/es/data-table/data-table.mjs +402 -316
  30. package/es/datatable-settings/datatable-settings.mjs +329 -254
  31. package/es/date-range/date-picker.mjs +130 -116
  32. package/es/date-range/date-range.mjs +215 -161
  33. package/es/drag-list/drag-item.mjs +56 -42
  34. package/es/drag-list/drag-list.mjs +60 -47
  35. package/es/dragable/dragable-item.mjs +23 -18
  36. package/es/dragable/dragable-operation.mjs +32 -24
  37. package/es/dragable/dragable.mjs +32 -23
  38. package/es/filter-panel/conditions/date-range-condition.mjs +50 -40
  39. package/es/filter-panel/conditions/department-condition/department-condition.mjs +99 -72
  40. package/es/filter-panel/conditions/department-condition/department-node.mjs +73 -59
  41. package/es/filter-panel/conditions/input-condition.mjs +90 -76
  42. package/es/filter-panel/conditions/multi-user-condition.mjs +67 -57
  43. package/es/filter-panel/conditions/multiple-menu-condition.mjs +54 -35
  44. package/es/filter-panel/conditions/single-menu-condition.mjs +65 -60
  45. package/es/filter-panel/conditions/single-user-condition.mjs +67 -57
  46. package/es/filter-panel/filter-panel-item.mjs +54 -39
  47. package/es/filter-panel/filter-panel.mjs +153 -135
  48. package/es/layout/layout.mjs +85 -78
  49. package/es/menu/menu-item.mjs +67 -52
  50. package/es/menu/menu.mjs +70 -53
  51. package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +28 -0
  52. package/es/panel/panel.mjs +53 -40
  53. package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +74 -63
  54. package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +76 -67
  55. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +406 -178
  56. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +153 -138
  57. package/es/pct-filter-panel/pct-filter-panel-item.mjs +55 -40
  58. package/es/pct-filter-panel/pct-filter-panel.mjs +247 -227
  59. package/es/progress/progress-item.mjs +81 -61
  60. package/es/progress/progress.mjs +78 -64
  61. package/es/where-filter-panel/where-filter-panel.mjs +15 -12
  62. package/lib/advance-select/advance-operation.js +50 -36
  63. package/lib/advance-select/advance-option.js +166 -96
  64. package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.js +12 -0
  65. package/lib/advance-select/advance-select.js +366 -308
  66. package/lib/application-slot/breadcrumb-item.js +19 -16
  67. package/lib/application-slot/header-tools-item.js +19 -16
  68. package/lib/breadcrumb-select/breadcrumb-select.js +133 -111
  69. package/lib/contextmenu/contextmenu-item.js +18 -14
  70. package/lib/contextmenu/contextmenu.js +71 -55
  71. package/lib/data-form/data-form-item.js +47 -29
  72. package/lib/data-form/data-form.js +212 -165
  73. package/lib/data-form/form-components/bwa-date-picker.js +50 -38
  74. package/lib/data-form/form-components/bwa-date-time-picker.js +55 -43
  75. package/lib/data-form/form-components/bwa-input-float.js +47 -36
  76. package/lib/data-form/form-components/bwa-input-integer.js +67 -49
  77. package/lib/data-form/form-components/bwa-input.js +42 -31
  78. package/lib/data-form/form-components/bwa-multi-select.js +39 -28
  79. package/lib/data-form/form-components/bwa-rich-text-tinymce.js +553 -217
  80. package/lib/data-form/form-components/bwa-rich-text.js +403 -315
  81. package/lib/data-form/form-components/bwa-select.js +83 -69
  82. package/lib/data-form/form-components/bwa-textarea.js +37 -26
  83. package/lib/data-form/form-components/bwa-upload.js +171 -147
  84. package/lib/data-form/form-components/bwa-user-multi-select.js +34 -23
  85. package/lib/data-form/form-components/bwa-user-select.js +85 -60
  86. package/lib/data-table/data-column-view.js +146 -115
  87. package/lib/data-table/data-table-card.js +48 -40
  88. package/lib/data-table/data-table-column.js +57 -44
  89. package/lib/data-table/data-table.js +401 -315
  90. package/lib/datatable-settings/datatable-settings.js +328 -253
  91. package/lib/date-range/date-picker.js +129 -115
  92. package/lib/date-range/date-range.js +214 -160
  93. package/lib/drag-list/drag-item.js +55 -41
  94. package/lib/drag-list/drag-list.js +59 -46
  95. package/lib/dragable/dragable-item.js +22 -17
  96. package/lib/dragable/dragable-operation.js +31 -23
  97. package/lib/dragable/dragable.js +31 -22
  98. package/lib/filter-panel/conditions/date-range-condition.js +49 -39
  99. package/lib/filter-panel/conditions/department-condition/department-condition.js +98 -71
  100. package/lib/filter-panel/conditions/department-condition/department-node.js +72 -58
  101. package/lib/filter-panel/conditions/input-condition.js +89 -75
  102. package/lib/filter-panel/conditions/multi-user-condition.js +66 -56
  103. package/lib/filter-panel/conditions/multiple-menu-condition.js +53 -34
  104. package/lib/filter-panel/conditions/single-menu-condition.js +64 -59
  105. package/lib/filter-panel/conditions/single-user-condition.js +66 -56
  106. package/lib/filter-panel/filter-panel-item.js +53 -38
  107. package/lib/filter-panel/filter-panel.js +152 -134
  108. package/lib/layout/layout.js +84 -77
  109. package/lib/menu/menu-item.js +66 -51
  110. package/lib/menu/menu.js +69 -52
  111. package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +32 -0
  112. package/lib/panel/panel.js +52 -39
  113. package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +73 -62
  114. package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +75 -66
  115. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +405 -177
  116. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +152 -137
  117. package/lib/pct-filter-panel/pct-filter-panel-item.js +54 -39
  118. package/lib/pct-filter-panel/pct-filter-panel.js +246 -226
  119. package/lib/progress/progress-item.js +80 -60
  120. package/lib/progress/progress.js +77 -63
  121. package/lib/where-filter-panel/where-filter-panel.js +14 -11
  122. package/package.json +2 -1
  123. package/src/advance-select/advance-option.vue +64 -13
  124. package/src/data-form/form-components/bwa-rich-text-tinymce.vue +1 -1
  125. package/src/datatable-settings/datatable-settings.vue +33 -3
  126. package/src/date-range/date-picker.vue +1 -1
  127. package/src/filter-panel/filter-panel.vue +2 -2
  128. package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +64 -64
  129. package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +61 -61
  130. package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +302 -178
  131. package/src/pct-filter-panel/pct-filter-panel.vue +4 -4
@@ -6,75 +6,89 @@ var vue = require('vue');
6
6
  var ElementPlus = require('element-plus');
7
7
  var _pluginVue_exportHelper = require('../../_virtual/_plugin-vue_export-helper.js');
8
8
 
9
- const __default__ = vue.defineComponent({
10
- name: "BwaSelect"
11
- });
12
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
13
- props: {
14
- modelValue: {
15
- type: null
16
- },
17
- options: {
18
- type: Array,
19
- default: () => []
20
- },
21
- labelProp: {
22
- type: String,
23
- default: "label"
24
- },
25
- valueProp: {
26
- type: String,
27
- default: "value"
28
- },
29
- multiple: {
30
- type: Boolean,
31
- default: false
32
- }
33
- },
34
- emits: ["update:modelValue"],
9
+ const _sfc_main = {
10
+ __name: 'bwa-select',
11
+ props: {
12
+ modelValue: {
13
+ type: null,
14
+ },
15
+ options: {
16
+ type: Array,
17
+ default: () => [],
18
+ },
19
+ labelProp: {
20
+ type: String,
21
+ default: 'label',
22
+ },
23
+ valueProp: {
24
+ type: String,
25
+ default: 'value',
26
+ },
27
+ multiple: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+ },
32
+ emits: ['update:modelValue'],
35
33
  setup(__props, { emit }) {
36
- const props = __props;
37
- const options = vue.computed(
38
- () => (props.options || []).map((item) => ({
39
- ...item,
40
- value: item.value + ""
41
- }))
42
- );
43
- const attrs = vue.useAttrs();
44
- const modelValue = vue.computed({
45
- get: () => {
46
- if (props.multiple) {
47
- return Array.isArray(props.modelValue) ? props.modelValue.map((item) => item + "") : [];
48
- } else {
49
- return props.modelValue == null ? "" : props.modelValue + "";
50
- }
51
- },
52
- set: (v) => emit("update:modelValue", v)
53
- });
54
- return (_ctx, _cache) => {
55
- return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElSelect), vue.mergeProps(vue.unref(attrs), {
56
- modelValue: vue.unref(modelValue),
57
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
58
- clearable: "",
59
- multiple: __props.multiple,
60
- teleported: false
61
- }), {
62
- default: vue.withCtx(() => [
63
- vue.renderSlot(_ctx.$slots, "default", {}, () => [
64
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(options), (item) => {
65
- return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElOption), {
66
- key: item.value,
67
- value: item.value,
68
- label: item.label
69
- }, null, 8, ["value", "label"]);
70
- }), 128))
71
- ])
72
- ]),
73
- _: 3
74
- }, 16, ["modelValue", "multiple"]);
75
- };
76
- }
77
- });
78
- var Select = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "bwa-select.vue"]]);
34
+
35
+ const props = __props;
36
+
37
+ defineOptions({
38
+ name: 'BwaSelect',
39
+ });
40
+
41
+
42
+
43
+ const options = vue.computed(() =>
44
+ (props.options || []).map((item) => ({
45
+ ...item,
46
+ value: item.value + '',
47
+ }))
48
+ );
49
+
50
+ const attrs = vue.useAttrs();
51
+
52
+
53
+
54
+ const modelValue = vue.computed({
55
+ get: () => {
56
+ if (props.multiple) {
57
+ return Array.isArray(props.modelValue)
58
+ ? props.modelValue.map((item) => item + '')
59
+ : [];
60
+ } else {
61
+ return props.modelValue == null ? '' : props.modelValue + '';
62
+ }
63
+ },
64
+ set: (v) => emit('update:modelValue', v),
65
+ });
66
+
67
+ return (_ctx, _cache) => {
68
+ return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElSelect), vue.mergeProps(vue.unref(attrs), {
69
+ modelValue: vue.unref(modelValue),
70
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (vue.isRef(modelValue) ? (modelValue).value = $event : null)),
71
+ clearable: "",
72
+ multiple: __props.multiple,
73
+ teleported: false
74
+ }), {
75
+ default: vue.withCtx(() => [
76
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
77
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(options), (item) => {
78
+ return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElOption), {
79
+ key: item.value,
80
+ value: item.value,
81
+ label: item.label
82
+ }, null, 8 /* PROPS */, ["value", "label"]))
83
+ }), 128 /* KEYED_FRAGMENT */))
84
+ ])
85
+ ]),
86
+ _: 3 /* FORWARDED */
87
+ }, 16 /* FULL_PROPS */, ["modelValue", "multiple"]))
88
+ }
89
+ }
90
+
91
+ };
92
+ var Select = /*#__PURE__*/_pluginVue_exportHelper["default"](_sfc_main, [['__file',"bwa-select.vue"]]);
79
93
 
80
94
  exports["default"] = Select;
@@ -6,32 +6,43 @@ var vue = require('vue');
6
6
  var ElementPlus = require('element-plus');
7
7
  var _pluginVue_exportHelper = require('../../_virtual/_plugin-vue_export-helper.js');
8
8
 
9
- const __default__ = vue.defineComponent({
10
- name: "BwaTextarea"
11
- });
12
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
13
- props: {
14
- value: {
15
- type: [String, Number],
16
- default: ""
17
- }
18
- },
19
- emits: ["update:model-value"],
9
+ const _sfc_main = {
10
+ __name: 'bwa-textarea',
11
+ props: {
12
+ value: {
13
+ type: [String, Number],
14
+ default: '',
15
+ },
16
+ },
17
+ emits: ['update:model-value'],
20
18
  setup(__props, { emit }) {
21
- const props = __props;
22
- const attrs = vue.useAttrs();
23
- const modelValue = vue.computed({
24
- get: () => props.modelValue,
25
- set: (v) => emit("update:model-value", v)
26
- });
27
- return (_ctx, _cache) => {
28
- return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElInput), vue.mergeProps({ type: "textarea" }, vue.unref(attrs), {
29
- modelValue: vue.unref(modelValue),
30
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null)
31
- }), null, 16, ["modelValue"]);
32
- };
33
- }
34
- });
35
- var Textarea = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "bwa-textarea.vue"]]);
19
+
20
+ const props = __props;
21
+
22
+ defineOptions({
23
+ name: 'BwaTextarea',
24
+ });
25
+
26
+
27
+
28
+ const attrs = vue.useAttrs();
29
+
30
+
31
+
32
+ const modelValue = vue.computed({
33
+ get: () => props.modelValue,
34
+ set: (v) => emit('update:model-value', v),
35
+ });
36
+
37
+ return (_ctx, _cache) => {
38
+ return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElInput), vue.mergeProps({ type: "textarea" }, vue.unref(attrs), {
39
+ modelValue: vue.unref(modelValue),
40
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (vue.isRef(modelValue) ? (modelValue).value = $event : null))
41
+ }), null, 16 /* FULL_PROPS */, ["modelValue"]))
42
+ }
43
+ }
44
+
45
+ };
46
+ var Textarea = /*#__PURE__*/_pluginVue_exportHelper["default"](_sfc_main, [['__file',"bwa-textarea.vue"]]);
36
47
 
37
48
  exports["default"] = Textarea;
@@ -8,156 +8,180 @@ var ElementPlus = require('element-plus');
8
8
  var webBaseClientVue = require('@ctzy-web-client/web-base-client-vue');
9
9
  var _pluginVue_exportHelper = require('../../_virtual/_plugin-vue_export-helper.js');
10
10
 
11
- const __default__ = vue.defineComponent({
12
- name: "BwaUpload"
13
- });
14
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
15
- props: {
16
- modelValue: { type: Array, default: () => [] }
17
- },
18
- emits: ["update:modelValue"],
11
+ const _sfc_main = {
12
+ __name: 'bwa-upload',
13
+ props: {
14
+ modelValue: { type: Array, default: () => [] },
15
+ },
16
+ emits: ['update:modelValue'],
19
17
  setup(__props, { emit }) {
20
- const props = __props;
21
- vue.watch(
22
- vue.computed(() => props.modelValue),
23
- (modelValue) => {
24
- if (!Array.isArray(modelValue)) {
25
- emit("update:modelValue", []);
26
- }
27
- },
28
- { immediate: true }
29
- );
30
- const fileList = vue.computed(
31
- () => (Array.isArray(props.modelValue) ? props.modelValue : []).map((fileInfo) => {
32
- return {
33
- name: fileInfo.fileName,
34
- response: fileInfo
35
- };
36
- })
37
- );
38
- const attrs = vue.useAttrs();
39
- const ns = webBaseClientVue.useNamespace("upload");
40
- const fileService = webBaseClientVue.useService("FileService");
41
- const handleHttpRequest = ({ file, onProgress, onSuccess, onError }) => {
42
- if (!vue.unref(fileService)) {
43
- ElementPlus.ElMessage.error("\u65E0\u6CD5\u4E0A\u4F20\u6587\u4EF6\u3002");
44
- return;
45
- }
46
- vue.unref(fileService).uploadFile(file, {
47
- onUploadProgress: (event) => {
48
- onProgress({ ...event, percent: event.progress });
49
- }
50
- }).then((res) => {
51
- if (res.code != 0) {
52
- onError(res.msg);
53
- return;
54
- }
55
- onSuccess(res.data);
56
- }, onError);
57
- };
58
- const handleSuccess = (fileInfo) => {
59
- const value = Array.isArray(props.modelValue) ? props.modelValue : [];
60
- emit("update:modelValue", value.concat(fileInfo));
61
- };
62
- const handleError = (error) => {
63
- console.error(error);
64
- ElementPlus.ElMessage.error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u3002");
65
- };
66
- const handleDelete = (file) => {
67
- emit(
68
- "update:modelValue",
69
- props.modelValue.filter((fileInfo) => fileInfo !== file.response)
70
- );
71
- };
72
- const handleDownload = async (file) => {
73
- if (!vue.unref(fileService)) {
74
- ElementPlus.ElMessage.error("\u65E0\u6CD5\u4E0B\u8F7D\u6587\u4EF6\u3002");
75
- return;
76
- }
77
- try {
78
- const downloadFileResult = await vue.unref(fileService).downloadFile(
79
- file.response
80
- );
81
- if (downloadFileResult.code != 0) {
82
- ElementPlus.ElMessage.error(downloadFileResult.msg);
83
- return;
84
- }
85
- } catch (e) {
86
- console.error(e);
87
- ElementPlus.ElMessage.error("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25\u3002");
88
- }
89
- };
90
- return (_ctx, _cache) => {
91
- const _component_Plus = vue.resolveComponent("Plus");
92
- const _component_ElTooltip = vue.resolveComponent("ElTooltip");
93
- return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElUpload), vue.mergeProps(vue.unref(attrs), {
94
- "file-list": vue.unref(fileList),
95
- "http-request": handleHttpRequest,
96
- class: vue.unref(ns).b(),
97
- "on-success": handleSuccess,
98
- "on-error": handleError
99
- }), {
100
- trigger: vue.withCtx(() => [
101
- vue.createVNode(vue.unref(ElementPlus.ElButton), null, {
18
+
19
+ const props = __props;
20
+
21
+ defineOptions({
22
+ name: 'BwaUpload',
23
+ });
24
+
25
+
26
+
27
+
28
+
29
+ vue.watch(
30
+ vue.computed(() => props.modelValue),
31
+ (modelValue) => {
32
+ if (!Array.isArray(modelValue)) {
33
+ emit('update:modelValue', []);
34
+ }
35
+ },
36
+ { immediate: true }
37
+ );
38
+
39
+ const fileList = vue.computed(() =>
40
+ (Array.isArray(props.modelValue) ? props.modelValue : []).map((fileInfo) => {
41
+ return {
42
+ name: fileInfo.fileName,
43
+ response: fileInfo,
44
+ };
45
+ })
46
+ );
47
+
48
+ const attrs = vue.useAttrs();
49
+
50
+ const ns = webBaseClientVue.useNamespace('upload');
51
+ const fileService = webBaseClientVue.useService('FileService');
52
+
53
+ const handleHttpRequest = ({ file, onProgress, onSuccess, onError }) => {
54
+ if (!vue.unref(fileService)) {
55
+ ElementPlus.ElMessage.error('无法上传文件。');
56
+ return;
57
+ }
58
+
59
+ vue.unref(fileService)
60
+ .uploadFile(file, {
61
+ onUploadProgress: (event) => {
62
+ onProgress({ ...event, percent: event.progress });
63
+ },
64
+ })
65
+ .then((res) => {
66
+ if (res.code != 0) {
67
+ onError(res.msg);
68
+ return;
69
+ }
70
+ onSuccess(res.data);
71
+ }, onError);
72
+ };
73
+
74
+ const handleSuccess = (fileInfo) => {
75
+ const value = Array.isArray(props.modelValue) ? props.modelValue : [];
76
+ emit('update:modelValue', value.concat(fileInfo));
77
+ };
78
+
79
+ const handleError = (error) => {
80
+ console.error(error);
81
+ ElementPlus.ElMessage.error('文件上传失败。');
82
+ };
83
+
84
+ const handleDelete = (file) => {
85
+ emit(
86
+ 'update:modelValue',
87
+ props.modelValue.filter((fileInfo) => fileInfo !== file.response)
88
+ );
89
+ };
90
+
91
+ const handleDownload = async (file) => {
92
+ if (!vue.unref(fileService)) {
93
+ ElementPlus.ElMessage.error('无法下载文件。');
94
+ return;
95
+ }
96
+
97
+ try {
98
+ const downloadFileResult = await vue.unref(fileService).downloadFile(
99
+ file.response
100
+ );
101
+
102
+ if (downloadFileResult.code != 0) {
103
+ ElementPlus.ElMessage.error(downloadFileResult.msg);
104
+ return;
105
+ }
106
+ } catch (e) {
107
+ console.error(e);
108
+ ElementPlus.ElMessage.error('下载文件失败。');
109
+ }
110
+ };
111
+
112
+ return (_ctx, _cache) => {
113
+ const _component_Plus = vue.resolveComponent("Plus");
114
+ const _component_ElTooltip = vue.resolveComponent("ElTooltip");
115
+
116
+ return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElUpload), vue.mergeProps(vue.unref(attrs), {
117
+ "file-list": vue.unref(fileList),
118
+ "http-request": handleHttpRequest,
119
+ class: vue.unref(ns).b(),
120
+ "on-success": handleSuccess,
121
+ "on-error": handleError
122
+ }), {
123
+ trigger: vue.withCtx(() => [
124
+ vue.createVNode(vue.unref(ElementPlus.ElButton), null, {
125
+ default: vue.withCtx(() => [
126
+ vue.createVNode(vue.unref(ElementPlus.ElIcon), null, {
102
127
  default: vue.withCtx(() => [
103
- vue.createVNode(vue.unref(ElementPlus.ElIcon), null, {
104
- default: vue.withCtx(() => [
105
- vue.createVNode(_component_Plus)
106
- ]),
107
- _: 1
108
- }),
109
- vue.createTextVNode(" \u4E0A\u4F20\u6587\u4EF6 ")
128
+ vue.createVNode(_component_Plus)
110
129
  ]),
111
- _: 1
112
- })
130
+ _: 1 /* STABLE */
131
+ }),
132
+ vue.createTextVNode(" 上传文件 ")
113
133
  ]),
114
- file: vue.withCtx(({ file }) => [
115
- vue.createElementVNode("div", {
116
- class: vue.normalizeClass(vue.unref(ns).b("item"))
117
- }, [
118
- vue.createElementVNode("div", {
119
- class: vue.normalizeClass(vue.unref(ns).be("item", "info"))
120
- }, [
121
- vue.createVNode(_component_ElTooltip, {
122
- content: file.name
123
- }, {
124
- default: vue.withCtx(() => [
125
- vue.createElementVNode("div", {
126
- class: vue.normalizeClass(vue.unref(ns).be("item", "file-name"))
127
- }, vue.toDisplayString(file.name), 3)
128
- ]),
129
- _: 2
130
- }, 1032, ["content"])
131
- ], 2),
132
- vue.createElementVNode("div", {
133
- class: vue.normalizeClass(vue.unref(ns).be("item", "tools"))
134
- }, [
135
- vue.createVNode(vue.unref(ElementPlus.ElIcon), {
136
- class: vue.normalizeClass(vue.unref(ns).be("item", "tools-item")),
137
- onClick: ($event) => handleDownload(file)
138
- }, {
139
- default: vue.withCtx(() => [
140
- vue.createVNode(vue.unref(icons.Download))
141
- ]),
142
- _: 2
143
- }, 1032, ["class", "onClick"]),
144
- vue.createVNode(vue.unref(ElementPlus.ElIcon), {
145
- class: vue.normalizeClass(vue.unref(ns).be("item", "tools-item")),
146
- onClick: ($event) => handleDelete(file)
147
- }, {
148
- default: vue.withCtx(() => [
149
- vue.createVNode(vue.unref(icons.Delete))
150
- ]),
151
- _: 2
152
- }, 1032, ["class", "onClick"])
153
- ], 2)
154
- ], 2)
155
- ]),
156
- _: 1
157
- }, 16, ["file-list", "class"]);
158
- };
159
- }
160
- });
161
- var Upload = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "bwa-upload.vue"]]);
134
+ _: 1 /* STABLE */
135
+ })
136
+ ]),
137
+ file: vue.withCtx(({ file }) => [
138
+ vue.createElementVNode("div", {
139
+ class: vue.normalizeClass(vue.unref(ns).b('item'))
140
+ }, [
141
+ vue.createElementVNode("div", {
142
+ class: vue.normalizeClass(vue.unref(ns).be('item', 'info'))
143
+ }, [
144
+ vue.createVNode(_component_ElTooltip, {
145
+ content: file.name
146
+ }, {
147
+ default: vue.withCtx(() => [
148
+ vue.createElementVNode("div", {
149
+ class: vue.normalizeClass(vue.unref(ns).be('item', 'file-name'))
150
+ }, vue.toDisplayString(file.name), 3 /* TEXT, CLASS */)
151
+ ]),
152
+ _: 2 /* DYNAMIC */
153
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["content"])
154
+ ], 2 /* CLASS */),
155
+ vue.createElementVNode("div", {
156
+ class: vue.normalizeClass(vue.unref(ns).be('item', 'tools'))
157
+ }, [
158
+ vue.createVNode(vue.unref(ElementPlus.ElIcon), {
159
+ class: vue.normalizeClass(vue.unref(ns).be('item', 'tools-item')),
160
+ onClick: $event => (handleDownload(file))
161
+ }, {
162
+ default: vue.withCtx(() => [
163
+ vue.createVNode(vue.unref(icons.Download))
164
+ ]),
165
+ _: 2 /* DYNAMIC */
166
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "onClick"]),
167
+ vue.createVNode(vue.unref(ElementPlus.ElIcon), {
168
+ class: vue.normalizeClass(vue.unref(ns).be('item', 'tools-item')),
169
+ onClick: $event => (handleDelete(file))
170
+ }, {
171
+ default: vue.withCtx(() => [
172
+ vue.createVNode(vue.unref(icons.Delete))
173
+ ]),
174
+ _: 2 /* DYNAMIC */
175
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "onClick"])
176
+ ], 2 /* CLASS */)
177
+ ], 2 /* CLASS */)
178
+ ]),
179
+ _: 1 /* STABLE */
180
+ }, 16 /* FULL_PROPS */, ["file-list", "class"]))
181
+ }
182
+ }
183
+
184
+ };
185
+ var Upload = /*#__PURE__*/_pluginVue_exportHelper["default"](_sfc_main, [['__file',"bwa-upload.vue"]]);
162
186
 
163
187
  exports["default"] = Upload;
@@ -6,29 +6,40 @@ var vue = require('vue');
6
6
  var bwaUserSelect = require('./bwa-user-select.js');
7
7
  var _pluginVue_exportHelper = require('../../_virtual/_plugin-vue_export-helper.js');
8
8
 
9
- const __default__ = vue.defineComponent({
10
- name: "BwaUserMultiSelect"
11
- });
12
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
13
- props: {
14
- modelValue: null
15
- },
16
- emits: ["update:model-value"],
9
+ const _sfc_main = {
10
+ __name: 'bwa-user-multi-select',
11
+ props: {
12
+ modelValue: null,
13
+ },
14
+ emits: ['update:model-value'],
17
15
  setup(__props, { emit }) {
18
- const props = __props;
19
- const modelValue = vue.computed({
20
- get: () => props.modelValue,
21
- set: (v) => emit("update:model-value", v)
22
- });
23
- const attrs = vue.useAttrs();
24
- return (_ctx, _cache) => {
25
- return vue.openBlock(), vue.createBlock(bwaUserSelect["default"], vue.mergeProps({
26
- modelValue: vue.unref(modelValue),
27
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null)
28
- }, vue.unref(attrs), { multiple: "" }), null, 16, ["modelValue"]);
29
- };
30
- }
31
- });
32
- var UserMultiSelect = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "bwa-user-multi-select.vue"]]);
16
+
17
+ const props = __props;
18
+
19
+ defineOptions({
20
+ name: 'BwaUserMultiSelect',
21
+ });
22
+
23
+
24
+
25
+
26
+
27
+ const modelValue = vue.computed({
28
+ get: () => props.modelValue,
29
+ set: (v) => emit('update:model-value', v),
30
+ });
31
+
32
+ const attrs = vue.useAttrs();
33
+
34
+ return (_ctx, _cache) => {
35
+ return (vue.openBlock(), vue.createBlock(bwaUserSelect["default"], vue.mergeProps({
36
+ modelValue: vue.unref(modelValue),
37
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (vue.isRef(modelValue) ? (modelValue).value = $event : null))
38
+ }, vue.unref(attrs), { multiple: "" }), null, 16 /* FULL_PROPS */, ["modelValue"]))
39
+ }
40
+ }
41
+
42
+ };
43
+ var UserMultiSelect = /*#__PURE__*/_pluginVue_exportHelper["default"](_sfc_main, [['__file',"bwa-user-multi-select.vue"]]);
33
44
 
34
45
  exports["default"] = UserMultiSelect;