sctj-components 1.0.27 → 1.0.29

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.
@@ -1,8 +1,8 @@
1
- import { computed as computed$1, resolveComponent, openBlock, createElementBlock, Fragment, renderList, unref, normalizeClass, toDisplayString, createBlock, withCtx, createTextVNode, createCommentVNode, createElementVNode, ref as ref$1, watch, mergeProps, createSlots, renderSlot, createVNode, TransitionGroup, onMounted as onMounted$1, onUpdated, nextTick, withModifiers, normalizeStyle, pushScopeId, popScopeId, onBeforeMount, onUnmounted, isRef, getCurrentInstance, reactive, resolveDirective, withDirectives, toRefs, resolveDynamicComponent, withKeys, useSlots, vShow, onBeforeUnmount, markRaw, useCssVars, shallowRef } from "vue";
1
+ import { computed as computed$1, resolveComponent, openBlock, createElementBlock, Fragment, renderList, unref, normalizeClass, toDisplayString, createBlock, withCtx, createTextVNode, createCommentVNode, createElementVNode, ref as ref$1, watch, mergeProps, createSlots, renderSlot, createVNode, TransitionGroup, onMounted as onMounted$1, onUpdated, nextTick, withModifiers, normalizeStyle, onUnmounted, isRef, withDirectives, vShow, onBeforeMount, getCurrentInstance, reactive, resolveDirective, toRefs, resolveDynamicComponent, withKeys, pushScopeId, popScopeId, useSlots, onBeforeUnmount, markRaw, useCssVars, shallowRef } from "vue";
2
2
  import VueOfficePdf from "@vue-office/pdf";
3
3
  import VueOfficeDocx from "@vue-office/docx";
4
4
  import VueOfficeExcel from "@vue-office/excel";
5
- import { View, Download, Delete, Plus, Picture, Loading, UploadFilled, QuestionFilled } from "@element-plus/icons-vue";
5
+ import { View, Download, Delete, Plus, Picture, Search, Loading, UploadFilled, QuestionFilled } from "@element-plus/icons-vue";
6
6
  import { ElMessage, ElLoading, ElMessageBox, ElButton, ElIcon } from "element-plus";
7
7
  import * as echarts from "echarts";
8
8
  import { throttle, isEqual } from "lodash";
@@ -135,7 +135,7 @@ const index_vue_vue_type_style_index_1_lang = "";
135
135
  const _hoisted_1$i = { class: "upload-file" };
136
136
  const _hoisted_2$b = { class: "el-upload__tip" };
137
137
  const _hoisted_3$9 = { style: { "color": "#f56c6c" } };
138
- const _hoisted_4$8 = { style: { "color": "#f56c6c" } };
138
+ const _hoisted_4$7 = { style: { "color": "#f56c6c" } };
139
139
  const _hoisted_5$6 = ["title"];
140
140
  const _hoisted_6$3 = { class: "ele-upload-list__item-content-action" };
141
141
  const _hoisted_7$3 = { style: { "width": "100%", "height": "100%", "overflow": "auto" } };
@@ -411,7 +411,7 @@ const _sfc_main$o = {
411
411
  ], 64)) : createCommentVNode("", true),
412
412
  __props.fileType ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
413
413
  createTextVNode(" \u683C\u5F0F\u4E3A "),
414
- createElementVNode("b", _hoisted_4$8, toDisplayString(__props.fileType.join("/")), 1)
414
+ createElementVNode("b", _hoisted_4$7, toDisplayString(__props.fileType.join("/")), 1)
415
415
  ], 64)) : createCommentVNode("", true),
416
416
  createTextVNode(" \u7684\u6587\u4EF6 ")
417
417
  ])
@@ -518,7 +518,7 @@ const _hoisted_2$a = {
518
518
  class: "el-upload__tip"
519
519
  };
520
520
  const _hoisted_3$8 = { style: { "color": "#f56c6c" } };
521
- const _hoisted_4$7 = { style: { "color": "#f56c6c" } };
521
+ const _hoisted_4$6 = { style: { "color": "#f56c6c" } };
522
522
  const _hoisted_5$5 = ["src"];
523
523
  const _sfc_main$n = {
524
524
  __name: "index",
@@ -779,7 +779,7 @@ const _sfc_main$n = {
779
779
  ], 64)) : createCommentVNode("", true),
780
780
  props.fileType ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
781
781
  createTextVNode(" \u683C\u5F0F\u4E3A "),
782
- createElementVNode("b", _hoisted_4$7, toDisplayString(props.fileType.join("/")), 1)
782
+ createElementVNode("b", _hoisted_4$6, toDisplayString(props.fileType.join("/")), 1)
783
783
  ], 64)) : createCommentVNode("", true),
784
784
  createTextVNode(" \u7684\u6587\u4EF6 ")
785
785
  ])) : createCommentVNode("", true),
@@ -1023,71 +1023,150 @@ const icons = [
1023
1023
  "wechat",
1024
1024
  "zip"
1025
1025
  ];
1026
- const index_vue_vue_type_style_index_0_scoped_7611a463_lang = "";
1027
- const _withScopeId$5 = (n) => (pushScopeId("data-v-7611a463"), n = n(), popScopeId(), n);
1028
- const _hoisted_1$f = { class: "icon-body" };
1029
- const _hoisted_2$9 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ createElementVNode("i", { class: "el-icon-search el-input__icon" }, null, -1));
1030
- const _hoisted_3$7 = { class: "icon-list" };
1031
- const _hoisted_4$6 = ["onClick"];
1026
+ const index_vue_vue_type_style_index_0_scoped_4dac267e_lang = "";
1027
+ const _hoisted_1$f = { class: "icon-content" };
1028
+ const _hoisted_2$9 = { class: "icon-list" };
1029
+ const _hoisted_3$7 = ["onClick"];
1032
1030
  const _sfc_main$l = {
1033
1031
  __name: "index",
1034
- emits: ["selected"],
1032
+ props: {
1033
+ modelValue: {
1034
+ type: String,
1035
+ default: ""
1036
+ }
1037
+ },
1038
+ emits: ["selected", "update:modelValue"],
1035
1039
  setup(__props, { expose, emit }) {
1036
- const iconName = ref$1("");
1040
+ const props = __props;
1041
+ const iconName = computed$1({
1042
+ get() {
1043
+ return props.modelValue;
1044
+ },
1045
+ set(val) {
1046
+ emit("update:modelValue", val);
1047
+ }
1048
+ });
1049
+ const keyWord = ref$1("");
1037
1050
  const iconList = ref$1(icons);
1051
+ const visible = ref$1(false);
1052
+ const iconBodyRef = ref$1(null);
1053
+ function toggleIconContent() {
1054
+ visible.value = !visible.value;
1055
+ if (visible.value) {
1056
+ keyWord.value = "";
1057
+ filterIcons();
1058
+ }
1059
+ }
1038
1060
  function filterIcons() {
1039
1061
  iconList.value = icons;
1040
- if (iconName.value) {
1041
- iconList.value = icons.filter((item) => item.indexOf(iconName.value) !== -1);
1062
+ if (keyWord.value) {
1063
+ iconList.value = icons.filter((item) => item.indexOf(keyWord.value) !== -1);
1042
1064
  }
1043
1065
  }
1044
1066
  function selectedIcon(name) {
1067
+ iconName.value = name;
1045
1068
  emit("selected", name);
1046
- document.body.click();
1069
+ visible.value = false;
1070
+ keyWord.value = "";
1071
+ filterIcons();
1072
+ }
1073
+ function handleClickOutside(event) {
1074
+ if (iconBodyRef.value && !iconBodyRef.value.contains(event.target)) {
1075
+ visible.value = false;
1076
+ }
1047
1077
  }
1048
1078
  function reset() {
1049
- iconName.value = "";
1079
+ keyWord.value = "";
1050
1080
  iconList.value = icons;
1081
+ visible.value = false;
1051
1082
  }
1083
+ onMounted$1(() => {
1084
+ document.addEventListener("click", handleClickOutside);
1085
+ });
1086
+ onUnmounted(() => {
1087
+ document.removeEventListener("click", handleClickOutside);
1088
+ });
1052
1089
  expose({
1053
1090
  reset
1054
1091
  });
1055
1092
  return (_ctx, _cache) => {
1093
+ const _component_el_icon = resolveComponent("el-icon");
1056
1094
  const _component_el_input = resolveComponent("el-input");
1057
- return openBlock(), createElementBlock("div", _hoisted_1$f, [
1095
+ return openBlock(), createElementBlock("div", {
1096
+ class: "icon-body",
1097
+ ref_key: "iconBodyRef",
1098
+ ref: iconBodyRef
1099
+ }, [
1058
1100
  createVNode(_component_el_input, {
1059
- modelValue: iconName.value,
1060
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => iconName.value = $event),
1101
+ modelValue: unref(iconName),
1102
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(iconName) ? iconName.value = $event : null),
1061
1103
  style: { "position": "relative" },
1062
1104
  clearable: "",
1063
- placeholder: "\u8BF7\u8F93\u5165\u56FE\u6807\u540D\u79F0",
1064
- onClear: filterIcons,
1065
- onInput: filterIcons
1066
- }, {
1105
+ placeholder: "\u8BF7\u9009\u62E9",
1106
+ onClick: toggleIconContent
1107
+ }, createSlots({
1067
1108
  suffix: withCtx(() => [
1068
- _hoisted_2$9
1109
+ createVNode(_component_el_icon, null, {
1110
+ default: withCtx(() => [
1111
+ createVNode(unref(Search))
1112
+ ]),
1113
+ _: 1
1114
+ })
1069
1115
  ]),
1070
- _: 1
1071
- }, 8, ["modelValue"]),
1072
- createElementVNode("div", _hoisted_3$7, [
1073
- (openBlock(true), createElementBlock(Fragment, null, renderList(iconList.value, (item, index2) => {
1074
- return openBlock(), createElementBlock("div", {
1075
- key: index2,
1076
- onClick: ($event) => selectedIcon(item)
1077
- }, [
1078
- createVNode(_sfc_main$p, {
1079
- "icon-class": item,
1080
- style: { "height": "30px", "width": "16px" }
1081
- }, null, 8, ["icon-class"]),
1082
- createElementVNode("span", null, toDisplayString(item), 1)
1083
- ], 8, _hoisted_4$6);
1084
- }), 128))
1116
+ _: 2
1117
+ }, [
1118
+ unref(iconName) ? {
1119
+ name: "prefix",
1120
+ fn: withCtx(() => [
1121
+ createVNode(SCTJDictTag, { "icon-class": unref(iconName) }, null, 8, ["icon-class"])
1122
+ ]),
1123
+ key: "0"
1124
+ } : void 0
1125
+ ]), 1032, ["modelValue"]),
1126
+ withDirectives(createElementVNode("div", _hoisted_1$f, [
1127
+ createElementVNode("div", null, [
1128
+ createVNode(_component_el_input, {
1129
+ modelValue: keyWord.value,
1130
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => keyWord.value = $event),
1131
+ modelModifiers: { trim: true },
1132
+ clearable: "",
1133
+ placeholder: "\u8BF7\u8F93\u5165\u56FE\u6807\u540D\u79F0",
1134
+ onClear: filterIcons,
1135
+ onInput: filterIcons
1136
+ }, {
1137
+ suffix: withCtx(() => [
1138
+ createVNode(_component_el_icon, null, {
1139
+ default: withCtx(() => [
1140
+ createVNode(unref(Search))
1141
+ ]),
1142
+ _: 1
1143
+ })
1144
+ ]),
1145
+ _: 1
1146
+ }, 8, ["modelValue"])
1147
+ ]),
1148
+ createElementVNode("div", _hoisted_2$9, [
1149
+ (openBlock(true), createElementBlock(Fragment, null, renderList(iconList.value, (item, index2) => {
1150
+ return openBlock(), createElementBlock("div", {
1151
+ key: index2,
1152
+ onClick: ($event) => selectedIcon(item)
1153
+ }, [
1154
+ createVNode(SCTJDictTag, {
1155
+ "icon-class": item,
1156
+ style: { "height": "30px", "width": "16px", "flex-shrink": "0" }
1157
+ }, null, 8, ["icon-class"]),
1158
+ createElementVNode("span", null, toDisplayString(item), 1)
1159
+ ], 8, _hoisted_3$7);
1160
+ }), 128))
1161
+ ])
1162
+ ], 512), [
1163
+ [vShow, visible.value]
1085
1164
  ])
1086
- ]);
1165
+ ], 512);
1087
1166
  };
1088
1167
  }
1089
1168
  };
1090
- const SCTJIconSelect = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-7611a463"]]);
1169
+ const SCTJIconSelect = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-4dac267e"]]);
1091
1170
  function useMobile() {
1092
1171
  const isMobile = ref$1(false);
1093
1172
  const checkIsMobile = () => {