sctj-components 1.0.28 → 1.0.30

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, isRef, pushScopeId, popScopeId, onBeforeMount, onUnmounted, 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,87 +1023,150 @@ const icons = [
1023
1023
  "wechat",
1024
1024
  "zip"
1025
1025
  ];
1026
- const index_vue_vue_type_style_index_0_scoped_cf88a853_lang = "";
1027
- const _withScopeId$5 = (n) => (pushScopeId("data-v-cf88a853"), 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_37029e19_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
1032
  props: {
1035
- modalValue: {
1033
+ modelValue: {
1036
1034
  type: String,
1037
1035
  default: ""
1038
1036
  }
1039
1037
  },
1040
- emits: ["selected", "update:modalValue"],
1038
+ emits: ["selected", "update:modelValue"],
1041
1039
  setup(__props, { expose, emit }) {
1042
1040
  const props = __props;
1043
1041
  const iconName = computed$1({
1044
1042
  get() {
1045
- return props.modalValue;
1043
+ return props.modelValue;
1046
1044
  },
1047
1045
  set(val) {
1048
- emit("update:modalValue", val);
1046
+ emit("update:modelValue", val);
1049
1047
  }
1050
1048
  });
1049
+ const keyWord = ref$1("");
1051
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
+ }
1052
1060
  function filterIcons() {
1053
1061
  iconList.value = icons;
1054
- if (iconName.value) {
1055
- 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);
1056
1064
  }
1057
1065
  }
1058
1066
  function selectedIcon(name) {
1059
1067
  iconName.value = name;
1060
1068
  emit("selected", name);
1061
- 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
+ }
1062
1077
  }
1063
1078
  function reset() {
1064
- iconName.value = "";
1079
+ keyWord.value = "";
1065
1080
  iconList.value = icons;
1081
+ visible.value = false;
1066
1082
  }
1083
+ onMounted$1(() => {
1084
+ document.addEventListener("click", handleClickOutside);
1085
+ });
1086
+ onUnmounted(() => {
1087
+ document.removeEventListener("click", handleClickOutside);
1088
+ });
1067
1089
  expose({
1068
1090
  reset
1069
1091
  });
1070
1092
  return (_ctx, _cache) => {
1093
+ const _component_el_icon = resolveComponent("el-icon");
1071
1094
  const _component_el_input = resolveComponent("el-input");
1072
- return openBlock(), createElementBlock("div", _hoisted_1$f, [
1095
+ return openBlock(), createElementBlock("div", {
1096
+ class: "icon-body",
1097
+ ref_key: "iconBodyRef",
1098
+ ref: iconBodyRef
1099
+ }, [
1073
1100
  createVNode(_component_el_input, {
1074
1101
  modelValue: unref(iconName),
1075
1102
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(iconName) ? iconName.value = $event : null),
1076
- modelModifiers: { trim: true },
1077
1103
  style: { "position": "relative" },
1078
1104
  clearable: "",
1079
- placeholder: "\u8BF7\u8F93\u5165\u56FE\u6807\u540D\u79F0",
1080
- onClear: filterIcons,
1081
- onChange: filterIcons
1082
- }, {
1105
+ placeholder: "\u8BF7\u9009\u62E9",
1106
+ onClick: toggleIconContent
1107
+ }, createSlots({
1083
1108
  suffix: withCtx(() => [
1084
- _hoisted_2$9
1109
+ createVNode(_component_el_icon, null, {
1110
+ default: withCtx(() => [
1111
+ createVNode(unref(Search))
1112
+ ]),
1113
+ _: 1
1114
+ })
1085
1115
  ]),
1086
- _: 1
1087
- }, 8, ["modelValue"]),
1088
- createElementVNode("div", _hoisted_3$7, [
1089
- (openBlock(true), createElementBlock(Fragment, null, renderList(iconList.value, (item, index2) => {
1090
- return openBlock(), createElementBlock("div", {
1091
- key: index2,
1092
- onClick: ($event) => selectedIcon(item)
1093
- }, [
1094
- createVNode(_sfc_main$p, {
1095
- "icon-class": item,
1096
- style: { "height": "30px", "width": "16px" }
1097
- }, null, 8, ["icon-class"]),
1098
- createElementVNode("span", null, toDisplayString(item), 1)
1099
- ], 8, _hoisted_4$6);
1100
- }), 128))
1116
+ _: 2
1117
+ }, [
1118
+ unref(iconName) ? {
1119
+ name: "prefix",
1120
+ fn: withCtx(() => [
1121
+ createVNode(_sfc_main$p, { "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(_sfc_main$p, {
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]
1101
1164
  ])
1102
- ]);
1165
+ ], 512);
1103
1166
  };
1104
1167
  }
1105
1168
  };
1106
- const SCTJIconSelect = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-cf88a853"]]);
1169
+ const SCTJIconSelect = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-37029e19"]]);
1107
1170
  function useMobile() {
1108
1171
  const isMobile = ref$1(false);
1109
1172
  const checkIsMobile = () => {