@wujies/components 5.6.4 → 5.6.5
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/dist/host/components/KCustomTabs.vue.d.ts +27 -0
- package/dist/host/components/KDictTag.vue.d.ts +1 -1
- package/dist/host/components/KIpSegmentInput.vue.d.ts +16 -0
- package/dist/host/components/KSectionTitle.vue.d.ts +15 -0
- package/dist/host/components/KSegmented.vue.d.ts +61 -0
- package/dist/host/components/KSpin.vue.d.ts +27 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.js +387 -1507
- package/dist/index.js.map +1 -1
- package/dist/names.d.ts +3 -3
- package/dist/names.js +7 -5
- package/dist/names.js.map +1 -1
- package/dist/style.css +244 -203
- package/package.json +2 -2
- package/dist/host/api/config.d.ts +0 -2
- package/dist/host/api/oss.d.ts +0 -2
- package/dist/host/api/types.d.ts +0 -11
- package/dist/host/api/user.d.ts +0 -1
- package/dist/host/components/ImageUpload.vue.d.ts +0 -129
- package/dist/host/components/ModuleBusinessSettings.vue.d.ts +0 -7
- package/dist/host/components/ModuleWebsiteSettings.vue.d.ts +0 -7
- package/dist/host/components/UserDetail.vue.d.ts +0 -10
- package/dist/host/contact.d.ts +0 -5
- package/dist/host/request.d.ts +0 -4
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, resolveComponent, openBlock, createBlock, normalizeStyle, unref, withCtx, createElementVNode, createVNode,
|
|
2
|
-
import {
|
|
3
|
-
import { request, globalHeaders as globalHeaders$1 } from "@wujies/ui-shared";
|
|
1
|
+
import { defineComponent, ref, computed, resolveComponent, openBlock, createBlock, normalizeStyle, unref, withCtx, createElementVNode, createVNode, mergeProps, createSlots, renderSlot, createElementBlock, isRef, Fragment, renderList, resolveDynamicComponent, toDisplayString, normalizeClass, createTextVNode, createCommentVNode, reactive, watch, withDirectives, vModelText, useModel, useTemplateRef, mergeModels, Transition, useAttrs, resolveDirective, toRefs, h as h$1, getCurrentInstance, onMounted, nextTick, onUnmounted, onBeforeUnmount } from "vue";
|
|
2
|
+
import { Refresh, Search, Loading, FullScreen, Rank, Back, Right, Operation, Menu } from "@element-plus/icons-vue";
|
|
4
3
|
import { ElForm, ElOption, ElCheckbox, ElRadio, ElTreeSelect, ElTimeSelect, ElTimePicker, ElCascader, ElDatePicker, ElRadioGroup, ElCheckboxGroup, ElSwitch, ElSelect, ElInputNumber, ElInput } from "element-plus";
|
|
5
4
|
import { WUJIES_COMPONENT_NAMES } from "./names.js";
|
|
6
5
|
const config = {
|
|
@@ -555,7 +554,7 @@ class VueTypes extends createTypes() {
|
|
|
555
554
|
}
|
|
556
555
|
const propTypes = VueTypes;
|
|
557
556
|
const _hoisted_1$b = { class: "image-slot" };
|
|
558
|
-
const _sfc_main$
|
|
557
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
559
558
|
__name: "ImagePreview",
|
|
560
559
|
props: {
|
|
561
560
|
src: propTypes.string.def(""),
|
|
@@ -745,655 +744,8 @@ const _export_sfc = (sfc, props) => {
|
|
|
745
744
|
}
|
|
746
745
|
return target;
|
|
747
746
|
};
|
|
748
|
-
const ImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
749
|
-
const
|
|
750
|
-
function getBaseUrl() {
|
|
751
|
-
var _a;
|
|
752
|
-
return String(((_a = request.defaults) == null ? void 0 : _a.baseURL) ?? "");
|
|
753
|
-
}
|
|
754
|
-
function listByIds(ossId) {
|
|
755
|
-
return request({
|
|
756
|
-
url: "/resource/oss/listByIds/" + ossId,
|
|
757
|
-
method: "get"
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
function delOss(ossId) {
|
|
761
|
-
return request({
|
|
762
|
-
url: "/resource/oss/" + ossId,
|
|
763
|
-
method: "delete"
|
|
764
|
-
});
|
|
765
|
-
}
|
|
766
|
-
const oss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
767
|
-
__proto__: null,
|
|
768
|
-
delOss,
|
|
769
|
-
listByIds
|
|
770
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
771
|
-
var conversion$1 = { exports: {} };
|
|
772
|
-
var conversion = conversion$1.exports;
|
|
773
|
-
var hasRequiredConversion;
|
|
774
|
-
function requireConversion() {
|
|
775
|
-
if (hasRequiredConversion) return conversion$1.exports;
|
|
776
|
-
hasRequiredConversion = 1;
|
|
777
|
-
(function(module, exports) {
|
|
778
|
-
!(function(t, e) {
|
|
779
|
-
module.exports = e();
|
|
780
|
-
})(conversion, (function() {
|
|
781
|
-
return (function(t) {
|
|
782
|
-
var e = {};
|
|
783
|
-
function n(r) {
|
|
784
|
-
if (e[r]) return e[r].exports;
|
|
785
|
-
var o = e[r] = { i: r, l: false, exports: {} };
|
|
786
|
-
return t[r].call(o.exports, o, o.exports, n), o.l = true, o.exports;
|
|
787
|
-
}
|
|
788
|
-
return n.m = t, n.c = e, n.d = function(t2, e2, r) {
|
|
789
|
-
n.o(t2, e2) || Object.defineProperty(t2, e2, { enumerable: true, get: r });
|
|
790
|
-
}, n.r = function(t2) {
|
|
791
|
-
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true });
|
|
792
|
-
}, n.t = function(t2, e2) {
|
|
793
|
-
if (1 & e2 && (t2 = n(t2)), 8 & e2) return t2;
|
|
794
|
-
if (4 & e2 && "object" == typeof t2 && t2 && t2.__esModule) return t2;
|
|
795
|
-
var r = /* @__PURE__ */ Object.create(null);
|
|
796
|
-
if (n.r(r), Object.defineProperty(r, "default", { enumerable: true, value: t2 }), 2 & e2 && "string" != typeof t2) for (var o in t2) n.d(r, o, (function(e3) {
|
|
797
|
-
return t2[e3];
|
|
798
|
-
}).bind(null, o));
|
|
799
|
-
return r;
|
|
800
|
-
}, n.n = function(t2) {
|
|
801
|
-
var e2 = t2 && t2.__esModule ? function() {
|
|
802
|
-
return t2.default;
|
|
803
|
-
} : function() {
|
|
804
|
-
return t2;
|
|
805
|
-
};
|
|
806
|
-
return n.d(e2, "a", e2), e2;
|
|
807
|
-
}, n.o = function(t2, e2) {
|
|
808
|
-
return Object.prototype.hasOwnProperty.call(t2, e2);
|
|
809
|
-
}, n.p = "", n(n.s = 0);
|
|
810
|
-
})([function(t, e, n) {
|
|
811
|
-
var r;
|
|
812
|
-
function o(t2) {
|
|
813
|
-
return ["image/png", "image/jpeg", "image/gif"].some((e2) => e2 === t2);
|
|
814
|
-
}
|
|
815
|
-
n.r(e), n.d(e, "canvastoDataURL", (function() {
|
|
816
|
-
return a;
|
|
817
|
-
})), n.d(e, "canvastoFile", (function() {
|
|
818
|
-
return c2;
|
|
819
|
-
})), n.d(e, "dataURLtoFile", (function() {
|
|
820
|
-
return s;
|
|
821
|
-
})), n.d(e, "dataURLtoImage", (function() {
|
|
822
|
-
return l;
|
|
823
|
-
})), n.d(e, "downloadFile", (function() {
|
|
824
|
-
return d;
|
|
825
|
-
})), n.d(e, "filetoDataURL", (function() {
|
|
826
|
-
return f;
|
|
827
|
-
})), n.d(e, "imagetoCanvas", (function() {
|
|
828
|
-
return g2;
|
|
829
|
-
})), n.d(e, "urltoBlob", (function() {
|
|
830
|
-
return w;
|
|
831
|
-
})), n.d(e, "urltoImage", (function() {
|
|
832
|
-
return m;
|
|
833
|
-
})), n.d(e, "compress", (function() {
|
|
834
|
-
return p2;
|
|
835
|
-
})), n.d(e, "compressAccurately", (function() {
|
|
836
|
-
return b;
|
|
837
|
-
})), n.d(e, "EImageType", (function() {
|
|
838
|
-
return r;
|
|
839
|
-
})), (function(t2) {
|
|
840
|
-
t2.PNG = "image/png", t2.JPEG = "image/jpeg", t2.GIF = "image/gif";
|
|
841
|
-
})(r || (r = {}));
|
|
842
|
-
var i = function(t2, e2, n2, r2) {
|
|
843
|
-
return new (n2 || (n2 = Promise))((function(o2, i2) {
|
|
844
|
-
function a2(t3) {
|
|
845
|
-
try {
|
|
846
|
-
u2(r2.next(t3));
|
|
847
|
-
} catch (t4) {
|
|
848
|
-
i2(t4);
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
function c3(t3) {
|
|
852
|
-
try {
|
|
853
|
-
u2(r2.throw(t3));
|
|
854
|
-
} catch (t4) {
|
|
855
|
-
i2(t4);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
function u2(t3) {
|
|
859
|
-
var e3;
|
|
860
|
-
t3.done ? o2(t3.value) : (e3 = t3.value, e3 instanceof n2 ? e3 : new n2((function(t4) {
|
|
861
|
-
t4(e3);
|
|
862
|
-
}))).then(a2, c3);
|
|
863
|
-
}
|
|
864
|
-
u2((r2 = r2.apply(t2, [])).next());
|
|
865
|
-
}));
|
|
866
|
-
};
|
|
867
|
-
function a(t2, e2 = 0.92, n2 = r.JPEG) {
|
|
868
|
-
return i(this, void 0, void 0, (function* () {
|
|
869
|
-
return o(n2) || (n2 = r.JPEG), t2.toDataURL(n2, e2);
|
|
870
|
-
}));
|
|
871
|
-
}
|
|
872
|
-
function c2(t2, e2 = 0.92, n2 = r.JPEG) {
|
|
873
|
-
return new Promise((r2) => t2.toBlob((t3) => r2(t3), n2, e2));
|
|
874
|
-
}
|
|
875
|
-
var u = function(t2, e2, n2, r2) {
|
|
876
|
-
return new (n2 || (n2 = Promise))((function(o2, i2) {
|
|
877
|
-
function a2(t3) {
|
|
878
|
-
try {
|
|
879
|
-
u2(r2.next(t3));
|
|
880
|
-
} catch (t4) {
|
|
881
|
-
i2(t4);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
function c3(t3) {
|
|
885
|
-
try {
|
|
886
|
-
u2(r2.throw(t3));
|
|
887
|
-
} catch (t4) {
|
|
888
|
-
i2(t4);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
function u2(t3) {
|
|
892
|
-
var e3;
|
|
893
|
-
t3.done ? o2(t3.value) : (e3 = t3.value, e3 instanceof n2 ? e3 : new n2((function(t4) {
|
|
894
|
-
t4(e3);
|
|
895
|
-
}))).then(a2, c3);
|
|
896
|
-
}
|
|
897
|
-
u2((r2 = r2.apply(t2, [])).next());
|
|
898
|
-
}));
|
|
899
|
-
};
|
|
900
|
-
function s(t2, e2) {
|
|
901
|
-
return u(this, void 0, void 0, (function* () {
|
|
902
|
-
const n2 = t2.split(",");
|
|
903
|
-
let r2 = n2[0].match(/:(.*?);/)[1];
|
|
904
|
-
const i2 = atob(n2[1]);
|
|
905
|
-
let a2 = i2.length;
|
|
906
|
-
const c3 = new Uint8Array(a2);
|
|
907
|
-
for (; a2--; ) c3[a2] = i2.charCodeAt(a2);
|
|
908
|
-
return o(e2) && (r2 = e2), new Blob([c3], { type: r2 });
|
|
909
|
-
}));
|
|
910
|
-
}
|
|
911
|
-
function l(t2) {
|
|
912
|
-
return new Promise((e2, n2) => {
|
|
913
|
-
const r2 = new Image();
|
|
914
|
-
r2.onload = () => e2(r2), r2.onerror = () => n2(new Error("dataURLtoImage(): dataURL is illegal")), r2.src = t2;
|
|
915
|
-
});
|
|
916
|
-
}
|
|
917
|
-
function d(t2, e2) {
|
|
918
|
-
const n2 = document.createElement("a");
|
|
919
|
-
n2.href = window.URL.createObjectURL(t2), n2.download = e2 || Date.now().toString(36), document.body.appendChild(n2);
|
|
920
|
-
const r2 = document.createEvent("MouseEvents");
|
|
921
|
-
r2.initEvent("click", false, false), n2.dispatchEvent(r2), document.body.removeChild(n2);
|
|
922
|
-
}
|
|
923
|
-
function f(t2) {
|
|
924
|
-
return new Promise((e2) => {
|
|
925
|
-
const n2 = new FileReader();
|
|
926
|
-
n2.onloadend = (t3) => e2(t3.target.result), n2.readAsDataURL(t2);
|
|
927
|
-
});
|
|
928
|
-
}
|
|
929
|
-
var h2 = function(t2, e2, n2, r2) {
|
|
930
|
-
return new (n2 || (n2 = Promise))((function(o2, i2) {
|
|
931
|
-
function a2(t3) {
|
|
932
|
-
try {
|
|
933
|
-
u2(r2.next(t3));
|
|
934
|
-
} catch (t4) {
|
|
935
|
-
i2(t4);
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
function c3(t3) {
|
|
939
|
-
try {
|
|
940
|
-
u2(r2.throw(t3));
|
|
941
|
-
} catch (t4) {
|
|
942
|
-
i2(t4);
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
function u2(t3) {
|
|
946
|
-
var e3;
|
|
947
|
-
t3.done ? o2(t3.value) : (e3 = t3.value, e3 instanceof n2 ? e3 : new n2((function(t4) {
|
|
948
|
-
t4(e3);
|
|
949
|
-
}))).then(a2, c3);
|
|
950
|
-
}
|
|
951
|
-
u2((r2 = r2.apply(t2, [])).next());
|
|
952
|
-
}));
|
|
953
|
-
};
|
|
954
|
-
function g2(t2, e2 = {}) {
|
|
955
|
-
return h2(this, void 0, void 0, (function* () {
|
|
956
|
-
const n2 = Object.assign({}, e2), r2 = document.createElement("canvas"), o2 = r2.getContext("2d");
|
|
957
|
-
let i2, a2;
|
|
958
|
-
for (const t3 in n2) Object.prototype.hasOwnProperty.call(n2, t3) && (n2[t3] = Number(n2[t3]));
|
|
959
|
-
if (n2.scale) {
|
|
960
|
-
const e3 = n2.scale > 0 && n2.scale < 10 ? n2.scale : 1;
|
|
961
|
-
a2 = t2.width * e3, i2 = t2.height * e3;
|
|
962
|
-
} else a2 = n2.width || n2.height * t2.width / t2.height || t2.width, i2 = n2.height || n2.width * t2.height / t2.width || t2.height;
|
|
963
|
-
switch ([5, 6, 7, 8].some((t3) => t3 === n2.orientation) ? (r2.height = a2, r2.width = i2) : (r2.height = i2, r2.width = a2), n2.orientation) {
|
|
964
|
-
case 3:
|
|
965
|
-
o2.rotate(180 * Math.PI / 180), o2.drawImage(t2, -r2.width, -r2.height, r2.width, r2.height);
|
|
966
|
-
break;
|
|
967
|
-
case 6:
|
|
968
|
-
o2.rotate(90 * Math.PI / 180), o2.drawImage(t2, 0, -r2.width, r2.height, r2.width);
|
|
969
|
-
break;
|
|
970
|
-
case 8:
|
|
971
|
-
o2.rotate(270 * Math.PI / 180), o2.drawImage(t2, -r2.height, 0, r2.height, r2.width);
|
|
972
|
-
break;
|
|
973
|
-
case 2:
|
|
974
|
-
o2.translate(r2.width, 0), o2.scale(-1, 1), o2.drawImage(t2, 0, 0, r2.width, r2.height);
|
|
975
|
-
break;
|
|
976
|
-
case 4:
|
|
977
|
-
o2.translate(r2.width, 0), o2.scale(-1, 1), o2.rotate(180 * Math.PI / 180), o2.drawImage(t2, -r2.width, -r2.height, r2.width, r2.height);
|
|
978
|
-
break;
|
|
979
|
-
case 5:
|
|
980
|
-
o2.translate(r2.width, 0), o2.scale(-1, 1), o2.rotate(90 * Math.PI / 180), o2.drawImage(t2, 0, -r2.width, r2.height, r2.width);
|
|
981
|
-
break;
|
|
982
|
-
case 7:
|
|
983
|
-
o2.translate(r2.width, 0), o2.scale(-1, 1), o2.rotate(270 * Math.PI / 180), o2.drawImage(t2, -r2.height, 0, r2.height, r2.width);
|
|
984
|
-
break;
|
|
985
|
-
default:
|
|
986
|
-
o2.drawImage(t2, 0, 0, r2.width, r2.height);
|
|
987
|
-
}
|
|
988
|
-
return r2;
|
|
989
|
-
}));
|
|
990
|
-
}
|
|
991
|
-
function w(t2) {
|
|
992
|
-
return fetch(t2).then((t3) => t3.blob());
|
|
993
|
-
}
|
|
994
|
-
function m(t2) {
|
|
995
|
-
return new Promise((e2, n2) => {
|
|
996
|
-
const r2 = new Image();
|
|
997
|
-
r2.onload = () => e2(r2), r2.onerror = () => n2(new Error("urltoImage(): Image failed to load, please check the image URL")), r2.src = t2;
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
var y = function(t2, e2, n2, r2) {
|
|
1001
|
-
return new (n2 || (n2 = Promise))((function(o2, i2) {
|
|
1002
|
-
function a2(t3) {
|
|
1003
|
-
try {
|
|
1004
|
-
u2(r2.next(t3));
|
|
1005
|
-
} catch (t4) {
|
|
1006
|
-
i2(t4);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
function c3(t3) {
|
|
1010
|
-
try {
|
|
1011
|
-
u2(r2.throw(t3));
|
|
1012
|
-
} catch (t4) {
|
|
1013
|
-
i2(t4);
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
function u2(t3) {
|
|
1017
|
-
var e3;
|
|
1018
|
-
t3.done ? o2(t3.value) : (e3 = t3.value, e3 instanceof n2 ? e3 : new n2((function(t4) {
|
|
1019
|
-
t4(e3);
|
|
1020
|
-
}))).then(a2, c3);
|
|
1021
|
-
}
|
|
1022
|
-
u2((r2 = r2.apply(t2, [])).next());
|
|
1023
|
-
}));
|
|
1024
|
-
};
|
|
1025
|
-
function p2(t2, e2 = {}) {
|
|
1026
|
-
return y(this, void 0, void 0, (function* () {
|
|
1027
|
-
if (!(t2 instanceof Blob)) throw new Error("compress(): First arg must be a Blob object or a File object.");
|
|
1028
|
-
if ("object" != typeof e2 && (e2 = Object.assign({ quality: e2 })), e2.quality = Number(e2.quality), Number.isNaN(e2.quality)) return t2;
|
|
1029
|
-
const n2 = yield f(t2);
|
|
1030
|
-
let i2 = n2.split(",")[0].match(/:(.*?);/)[1], c3 = r.JPEG;
|
|
1031
|
-
o(e2.type) && (c3 = e2.type, i2 = e2.type);
|
|
1032
|
-
const u2 = yield l(n2), d2 = yield g2(u2, Object.assign({}, e2)), h3 = yield a(d2, e2.quality, c3), w2 = yield s(h3, i2);
|
|
1033
|
-
return w2.size > t2.size ? t2 : w2;
|
|
1034
|
-
}));
|
|
1035
|
-
}
|
|
1036
|
-
function b(t2, e2 = {}) {
|
|
1037
|
-
return y(this, void 0, void 0, (function* () {
|
|
1038
|
-
if (!(t2 instanceof Blob)) throw new Error("compressAccurately(): First arg must be a Blob object or a File object.");
|
|
1039
|
-
if ("object" != typeof e2 && (e2 = Object.assign({ size: e2 })), e2.size = Number(e2.size), Number.isNaN(e2.size)) return t2;
|
|
1040
|
-
if (1024 * e2.size > t2.size) return t2;
|
|
1041
|
-
e2.accuracy = Number(e2.accuracy), (!e2.accuracy || e2.accuracy < 0.8 || e2.accuracy > 0.99) && (e2.accuracy = 0.95);
|
|
1042
|
-
const n2 = e2.size * (2 - e2.accuracy) * 1024, i2 = 1024 * e2.size, c3 = e2.size * e2.accuracy * 1024, u2 = yield f(t2);
|
|
1043
|
-
let d2 = u2.split(",")[0].match(/:(.*?);/)[1], h3 = r.JPEG;
|
|
1044
|
-
o(e2.type) && (h3 = e2.type, d2 = e2.type);
|
|
1045
|
-
const w2 = yield l(u2), m2 = yield g2(w2, Object.assign({}, e2));
|
|
1046
|
-
let y2, p3 = 0.5;
|
|
1047
|
-
const b2 = [null, null];
|
|
1048
|
-
for (let t3 = 1; t3 <= 7; t3++) {
|
|
1049
|
-
y2 = yield a(m2, p3, h3);
|
|
1050
|
-
const e3 = 0.75 * y2.length;
|
|
1051
|
-
if (7 === t3) {
|
|
1052
|
-
(n2 < e3 || c3 > e3) && (y2 = [y2, ...b2].filter((t4) => t4).sort((t4, e4) => Math.abs(0.75 * t4.length - i2) - Math.abs(0.75 * e4.length - i2))[0]);
|
|
1053
|
-
break;
|
|
1054
|
-
}
|
|
1055
|
-
if (n2 < e3) b2[1] = y2, p3 -= Math.pow(0.5, t3 + 1);
|
|
1056
|
-
else {
|
|
1057
|
-
if (!(c3 > e3)) break;
|
|
1058
|
-
b2[0] = y2, p3 += Math.pow(0.5, t3 + 1);
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
const v = yield s(y2, d2);
|
|
1062
|
-
return v.size > t2.size ? t2 : v;
|
|
1063
|
-
}));
|
|
1064
|
-
}
|
|
1065
|
-
}]);
|
|
1066
|
-
}));
|
|
1067
|
-
})(conversion$1);
|
|
1068
|
-
return conversion$1.exports;
|
|
1069
|
-
}
|
|
1070
|
-
var imageConversion;
|
|
1071
|
-
var hasRequiredImageConversion;
|
|
1072
|
-
function requireImageConversion() {
|
|
1073
|
-
if (hasRequiredImageConversion) return imageConversion;
|
|
1074
|
-
hasRequiredImageConversion = 1;
|
|
1075
|
-
imageConversion = requireConversion();
|
|
1076
|
-
return imageConversion;
|
|
1077
|
-
}
|
|
1078
|
-
var imageConversionExports = requireImageConversion();
|
|
1079
|
-
const _hoisted_1$a = { class: "component-upload-image" };
|
|
1080
|
-
const _hoisted_2$7 = { class: "naive-image-card" };
|
|
1081
|
-
const _hoisted_3$6 = ["src"];
|
|
1082
|
-
const _hoisted_4$4 = {
|
|
1083
|
-
key: 1,
|
|
1084
|
-
class: "naive-image-card__progress"
|
|
1085
|
-
};
|
|
1086
|
-
const _hoisted_5$4 = { class: "naive-image-card__action" };
|
|
1087
|
-
const _hoisted_6$3 = {
|
|
1088
|
-
key: 0,
|
|
1089
|
-
class: "naive-upload-tip"
|
|
1090
|
-
};
|
|
1091
|
-
const _hoisted_7$3 = {
|
|
1092
|
-
key: 1,
|
|
1093
|
-
class: "naive-upload-tip__text"
|
|
1094
|
-
};
|
|
1095
|
-
const _hoisted_8$2 = ["src"];
|
|
1096
|
-
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1097
|
-
__name: "ImageUpload",
|
|
1098
|
-
props: {
|
|
1099
|
-
modelValue: {
|
|
1100
|
-
type: [String, Object, Array],
|
|
1101
|
-
default: () => []
|
|
1102
|
-
},
|
|
1103
|
-
// 图片数量限制
|
|
1104
|
-
limit: propTypes.number.def(5),
|
|
1105
|
-
// 大小限制(MB)
|
|
1106
|
-
fileSize: propTypes.number.def(5),
|
|
1107
|
-
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
|
1108
|
-
fileType: propTypes.array.def(["png", "jpg", "jpeg"]),
|
|
1109
|
-
// 是否显示提示
|
|
1110
|
-
isShowTip: {
|
|
1111
|
-
type: Boolean,
|
|
1112
|
-
default: true
|
|
1113
|
-
},
|
|
1114
|
-
// 是否支持压缩,默认否
|
|
1115
|
-
compressSupport: {
|
|
1116
|
-
type: Boolean,
|
|
1117
|
-
default: false
|
|
1118
|
-
},
|
|
1119
|
-
// 压缩目标大小,单位KB。默认300KB以上文件才压缩,并压缩至300KB以内
|
|
1120
|
-
compressTargetSize: propTypes.number.def(300),
|
|
1121
|
-
/**
|
|
1122
|
-
* 提示展示方式。
|
|
1123
|
-
* - inline:直接显示在组件下方(默认)
|
|
1124
|
-
* - tooltip:收成一个问号图标,鼠标悬停才展示,适合表单很挤的场景
|
|
1125
|
-
*/
|
|
1126
|
-
tipMode: {
|
|
1127
|
-
type: String,
|
|
1128
|
-
default: "inline"
|
|
1129
|
-
},
|
|
1130
|
-
// 自定义提示文案,传了则覆盖自动拼装的内容
|
|
1131
|
-
tipText: propTypes.string.def(""),
|
|
1132
|
-
// 推荐尺寸描述,例如 '256×256',会拼进提示里
|
|
1133
|
-
recommendSize: propTypes.string.def(""),
|
|
1134
|
-
// 禁用组件(仅查看图片)
|
|
1135
|
-
disabled: propTypes.bool.def(false),
|
|
1136
|
-
// 自定义上传地址(默认走 OSS)
|
|
1137
|
-
action: propTypes.string.def("")
|
|
1138
|
-
},
|
|
1139
|
-
emits: ["update:modelValue", "upload-success"],
|
|
1140
|
-
setup(__props, { emit: __emit }) {
|
|
1141
|
-
const props = __props;
|
|
1142
|
-
const { proxy } = getCurrentInstance();
|
|
1143
|
-
const emit = __emit;
|
|
1144
|
-
const number2 = ref(0);
|
|
1145
|
-
const uploadList = ref([]);
|
|
1146
|
-
const dialogImageUrl = ref("");
|
|
1147
|
-
const dialogVisible = ref(false);
|
|
1148
|
-
const baseUrl = getBaseUrl();
|
|
1149
|
-
const resolvedAction = computed(() => props.action || baseUrl + "/resource/oss/upload");
|
|
1150
|
-
const headers = ref(globalHeaders());
|
|
1151
|
-
const fileList = ref([]);
|
|
1152
|
-
const showTip = computed(() => props.isShowTip && (props.fileType || props.fileSize));
|
|
1153
|
-
const imageUploadRef = ref();
|
|
1154
|
-
const fileAccept = computed(() => props.fileType.map((type) => `.${type}`).join(","));
|
|
1155
|
-
const tipContent = computed(() => {
|
|
1156
|
-
var _a;
|
|
1157
|
-
if (props.tipText) {
|
|
1158
|
-
return props.tipText;
|
|
1159
|
-
}
|
|
1160
|
-
const parts = [];
|
|
1161
|
-
if (props.recommendSize) {
|
|
1162
|
-
parts.push(`建议尺寸 ${props.recommendSize}`);
|
|
1163
|
-
}
|
|
1164
|
-
if (props.fileSize) {
|
|
1165
|
-
parts.push(`大小不超过 ${props.fileSize}MB`);
|
|
1166
|
-
}
|
|
1167
|
-
if ((_a = props.fileType) == null ? void 0 : _a.length) {
|
|
1168
|
-
parts.push(`格式为 ${props.fileType.join("/")}`);
|
|
1169
|
-
}
|
|
1170
|
-
parts.push(`最多 ${props.limit} 张`);
|
|
1171
|
-
return `请上传${parts.join("、")}的图片`;
|
|
1172
|
-
});
|
|
1173
|
-
watch(
|
|
1174
|
-
() => props.modelValue,
|
|
1175
|
-
async (val) => {
|
|
1176
|
-
if (val) {
|
|
1177
|
-
let list = [];
|
|
1178
|
-
if (Array.isArray(val)) {
|
|
1179
|
-
list = val;
|
|
1180
|
-
} else {
|
|
1181
|
-
const res = await listByIds(val);
|
|
1182
|
-
list = res.data;
|
|
1183
|
-
}
|
|
1184
|
-
fileList.value = list.map((item) => {
|
|
1185
|
-
let itemData;
|
|
1186
|
-
if (typeof item === "string") {
|
|
1187
|
-
itemData = { name: item, url: item, uid: `${item}` };
|
|
1188
|
-
} else {
|
|
1189
|
-
itemData = { name: item.ossId, url: item.url, ossId: item.ossId, uid: `${item.ossId}` };
|
|
1190
|
-
}
|
|
1191
|
-
return itemData;
|
|
1192
|
-
});
|
|
1193
|
-
} else {
|
|
1194
|
-
fileList.value = [];
|
|
1195
|
-
return [];
|
|
1196
|
-
}
|
|
1197
|
-
},
|
|
1198
|
-
{ deep: true, immediate: true }
|
|
1199
|
-
);
|
|
1200
|
-
const handleBeforeUpload = (file) => {
|
|
1201
|
-
let isImg = false;
|
|
1202
|
-
if (props.fileType.length) {
|
|
1203
|
-
let fileExtension = "";
|
|
1204
|
-
if (file.name.lastIndexOf(".") > -1) {
|
|
1205
|
-
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
|
1206
|
-
}
|
|
1207
|
-
isImg = props.fileType.some((type) => {
|
|
1208
|
-
if (file.type.indexOf(type) > -1) return true;
|
|
1209
|
-
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
|
1210
|
-
return false;
|
|
1211
|
-
});
|
|
1212
|
-
} else {
|
|
1213
|
-
isImg = file.type.indexOf("image") > -1;
|
|
1214
|
-
}
|
|
1215
|
-
if (!isImg) {
|
|
1216
|
-
proxy == null ? void 0 : proxy.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join("/")}图片格式文件!`);
|
|
1217
|
-
return false;
|
|
1218
|
-
}
|
|
1219
|
-
if (file.name.includes(",")) {
|
|
1220
|
-
proxy == null ? void 0 : proxy.$modal.msgError("文件名不正确,不能包含英文逗号!");
|
|
1221
|
-
return false;
|
|
1222
|
-
}
|
|
1223
|
-
if (props.fileSize) {
|
|
1224
|
-
const isLt = file.size / 1024 / 1024 < props.fileSize;
|
|
1225
|
-
if (!isLt) {
|
|
1226
|
-
proxy == null ? void 0 : proxy.$modal.msgError(`上传头像图片大小不能超过 ${props.fileSize} MB!`);
|
|
1227
|
-
return false;
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
if (props.compressSupport && file.size / 1024 > props.compressTargetSize) {
|
|
1231
|
-
proxy == null ? void 0 : proxy.$modal.loading("正在上传图片,请稍候...");
|
|
1232
|
-
number2.value++;
|
|
1233
|
-
return imageConversionExports.compressAccurately(file, props.compressTargetSize);
|
|
1234
|
-
} else {
|
|
1235
|
-
proxy == null ? void 0 : proxy.$modal.loading("正在上传图片,请稍候...");
|
|
1236
|
-
number2.value++;
|
|
1237
|
-
}
|
|
1238
|
-
};
|
|
1239
|
-
const handleExceed = () => {
|
|
1240
|
-
proxy == null ? void 0 : proxy.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
|
|
1241
|
-
};
|
|
1242
|
-
const handleUploadSuccess = (res, file) => {
|
|
1243
|
-
var _a;
|
|
1244
|
-
if (res.code === 200) {
|
|
1245
|
-
uploadList.value.push({ name: res.data.fileName, url: res.data.url, ossId: res.data.ossId });
|
|
1246
|
-
emit("upload-success", res.data);
|
|
1247
|
-
uploadedSuccessfully();
|
|
1248
|
-
} else {
|
|
1249
|
-
number2.value--;
|
|
1250
|
-
proxy == null ? void 0 : proxy.$modal.closeLoading();
|
|
1251
|
-
proxy == null ? void 0 : proxy.$modal.msgError(res.msg);
|
|
1252
|
-
(_a = imageUploadRef.value) == null ? void 0 : _a.handleRemove(file);
|
|
1253
|
-
uploadedSuccessfully();
|
|
1254
|
-
}
|
|
1255
|
-
};
|
|
1256
|
-
const handleRemove = (file) => {
|
|
1257
|
-
const findex = fileList.value.findIndex((f) => f.uid === file.uid || f.name === file.name);
|
|
1258
|
-
if (findex === -1) {
|
|
1259
|
-
return;
|
|
1260
|
-
}
|
|
1261
|
-
const ossId = fileList.value[findex].ossId;
|
|
1262
|
-
if (ossId) {
|
|
1263
|
-
delOss(ossId);
|
|
1264
|
-
}
|
|
1265
|
-
fileList.value.splice(findex, 1);
|
|
1266
|
-
emit("update:modelValue", listToString(fileList.value));
|
|
1267
|
-
};
|
|
1268
|
-
const uploadedSuccessfully = () => {
|
|
1269
|
-
if (number2.value > 0 && uploadList.value.length === number2.value) {
|
|
1270
|
-
fileList.value = fileList.value.filter((f) => f.url !== void 0).concat(uploadList.value);
|
|
1271
|
-
uploadList.value = [];
|
|
1272
|
-
number2.value = 0;
|
|
1273
|
-
emit("update:modelValue", listToString(fileList.value));
|
|
1274
|
-
proxy == null ? void 0 : proxy.$modal.closeLoading();
|
|
1275
|
-
}
|
|
1276
|
-
};
|
|
1277
|
-
const handleUploadError = () => {
|
|
1278
|
-
number2.value--;
|
|
1279
|
-
proxy == null ? void 0 : proxy.$modal.closeLoading();
|
|
1280
|
-
proxy == null ? void 0 : proxy.$modal.msgError("上传图片失败");
|
|
1281
|
-
};
|
|
1282
|
-
const handlePreview = (file) => {
|
|
1283
|
-
dialogImageUrl.value = file.url;
|
|
1284
|
-
dialogVisible.value = true;
|
|
1285
|
-
};
|
|
1286
|
-
const listToString = (list, separator) => {
|
|
1287
|
-
let strs = "";
|
|
1288
|
-
separator = separator || ",";
|
|
1289
|
-
for (const i in list) {
|
|
1290
|
-
if (void 0 !== list[i].ossId && list[i].url.indexOf("blob:") !== 0) {
|
|
1291
|
-
strs += list[i].ossId + separator;
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
return strs != "" ? strs.substring(0, strs.length - 1) : "";
|
|
1295
|
-
};
|
|
1296
|
-
return (_ctx, _cache) => {
|
|
1297
|
-
const _component_el_icon = resolveComponent("el-icon");
|
|
1298
|
-
const _component_el_button = resolveComponent("el-button");
|
|
1299
|
-
const _component_el_upload = resolveComponent("el-upload");
|
|
1300
|
-
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
1301
|
-
const _component_el_dialog = resolveComponent("el-dialog");
|
|
1302
|
-
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1303
|
-
createVNode(_component_el_upload, {
|
|
1304
|
-
ref_key: "imageUploadRef",
|
|
1305
|
-
ref: imageUploadRef,
|
|
1306
|
-
"file-list": unref(fileList),
|
|
1307
|
-
"onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => isRef(fileList) ? fileList.value = $event : null),
|
|
1308
|
-
accept: unref(fileAccept),
|
|
1309
|
-
action: unref(resolvedAction),
|
|
1310
|
-
"before-upload": handleBeforeUpload,
|
|
1311
|
-
class: normalizeClass({ hide: unref(fileList).length >= __props.limit }),
|
|
1312
|
-
headers: unref(headers),
|
|
1313
|
-
limit: __props.limit,
|
|
1314
|
-
multiple: __props.limit > 1,
|
|
1315
|
-
"on-error": handleUploadError,
|
|
1316
|
-
"on-exceed": handleExceed,
|
|
1317
|
-
"on-success": handleUploadSuccess,
|
|
1318
|
-
"list-type": "picture-card"
|
|
1319
|
-
}, {
|
|
1320
|
-
file: withCtx(({ file }) => [
|
|
1321
|
-
createElementVNode("div", _hoisted_2$7, [
|
|
1322
|
-
file.url ? (openBlock(), createElementBlock("img", {
|
|
1323
|
-
key: 0,
|
|
1324
|
-
alt: "",
|
|
1325
|
-
class: "naive-image-card__img",
|
|
1326
|
-
src: file.url
|
|
1327
|
-
}, null, 8, _hoisted_3$6)) : createCommentVNode("", true),
|
|
1328
|
-
file.status === "uploading" ? (openBlock(), createElementBlock("div", _hoisted_4$4, [
|
|
1329
|
-
createElementVNode("div", {
|
|
1330
|
-
class: "naive-image-card__bar",
|
|
1331
|
-
style: normalizeStyle({ width: `${file.percentage || 0}%` })
|
|
1332
|
-
}, null, 4)
|
|
1333
|
-
])) : createCommentVNode("", true),
|
|
1334
|
-
createElementVNode("div", _hoisted_5$4, [
|
|
1335
|
-
createVNode(_component_el_button, {
|
|
1336
|
-
link: "",
|
|
1337
|
-
icon: unref(ZoomIn),
|
|
1338
|
-
onClick: ($event) => handlePreview(file)
|
|
1339
|
-
}, null, 8, ["icon", "onClick"]),
|
|
1340
|
-
!__props.disabled ? (openBlock(), createBlock(_component_el_button, {
|
|
1341
|
-
key: 0,
|
|
1342
|
-
link: "",
|
|
1343
|
-
icon: unref(Delete),
|
|
1344
|
-
onClick: ($event) => handleRemove(file)
|
|
1345
|
-
}, null, 8, ["icon", "onClick"])) : createCommentVNode("", true)
|
|
1346
|
-
])
|
|
1347
|
-
])
|
|
1348
|
-
]),
|
|
1349
|
-
default: withCtx(() => [
|
|
1350
|
-
createVNode(_component_el_icon, { class: "naive-image-card__plus" }, {
|
|
1351
|
-
default: withCtx(() => [
|
|
1352
|
-
createVNode(unref(Plus))
|
|
1353
|
-
]),
|
|
1354
|
-
_: 1
|
|
1355
|
-
})
|
|
1356
|
-
]),
|
|
1357
|
-
_: 1
|
|
1358
|
-
}, 8, ["file-list", "accept", "action", "class", "headers", "limit", "multiple"]),
|
|
1359
|
-
unref(showTip) ? (openBlock(), createElementBlock("div", _hoisted_6$3, [
|
|
1360
|
-
__props.tipMode === "tooltip" ? (openBlock(), createBlock(_component_el_tooltip, {
|
|
1361
|
-
key: 0,
|
|
1362
|
-
content: unref(tipContent),
|
|
1363
|
-
placement: "top"
|
|
1364
|
-
}, {
|
|
1365
|
-
default: withCtx(() => [
|
|
1366
|
-
createVNode(_component_el_icon, { class: "naive-upload-tip__icon" }, {
|
|
1367
|
-
default: withCtx(() => [
|
|
1368
|
-
createVNode(unref(QuestionFilled))
|
|
1369
|
-
]),
|
|
1370
|
-
_: 1
|
|
1371
|
-
})
|
|
1372
|
-
]),
|
|
1373
|
-
_: 1
|
|
1374
|
-
}, 8, ["content"])) : (openBlock(), createElementBlock("span", _hoisted_7$3, toDisplayString(unref(tipContent)), 1))
|
|
1375
|
-
])) : createCommentVNode("", true),
|
|
1376
|
-
createVNode(_component_el_dialog, {
|
|
1377
|
-
modelValue: unref(dialogVisible),
|
|
1378
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(dialogVisible) ? dialogVisible.value = $event : null),
|
|
1379
|
-
"append-to-body": "",
|
|
1380
|
-
title: "预览",
|
|
1381
|
-
width: "800px"
|
|
1382
|
-
}, {
|
|
1383
|
-
default: withCtx(() => [
|
|
1384
|
-
createElementVNode("img", {
|
|
1385
|
-
src: unref(dialogImageUrl),
|
|
1386
|
-
style: { "display": "block", "max-width": "100%", "margin": "0 auto" }
|
|
1387
|
-
}, null, 8, _hoisted_8$2)
|
|
1388
|
-
]),
|
|
1389
|
-
_: 1
|
|
1390
|
-
}, 8, ["modelValue"])
|
|
1391
|
-
]);
|
|
1392
|
-
};
|
|
1393
|
-
}
|
|
1394
|
-
});
|
|
1395
|
-
const ImageUpload = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-ab47c3bc"]]);
|
|
1396
|
-
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
747
|
+
const ImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-ed5d331b"]]);
|
|
748
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1397
749
|
...{
|
|
1398
750
|
name: "KCard",
|
|
1399
751
|
inheritAttrs: false
|
|
@@ -1426,12 +778,77 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
1426
778
|
};
|
|
1427
779
|
}
|
|
1428
780
|
});
|
|
1429
|
-
const KCard = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
781
|
+
const KCard = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-cbf723b1"]]);
|
|
782
|
+
const _hoisted_1$a = { class: "custom-tabs-wrapper" };
|
|
783
|
+
const _hoisted_2$6 = { class: "custom-tab-label" };
|
|
784
|
+
const _hoisted_3$5 = { class: "tab-text" };
|
|
785
|
+
const _hoisted_4$3 = { class: "custom-tabs-content" };
|
|
786
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
787
|
+
__name: "KCustomTabs",
|
|
788
|
+
props: {
|
|
789
|
+
modelValue: {},
|
|
790
|
+
tabs: {}
|
|
791
|
+
},
|
|
792
|
+
emits: ["update:modelValue", "tab-click"],
|
|
793
|
+
setup(__props, { emit: __emit }) {
|
|
794
|
+
const props = __props;
|
|
795
|
+
const emit = __emit;
|
|
796
|
+
const activeTab = computed({
|
|
797
|
+
get: () => props.modelValue,
|
|
798
|
+
set: (val) => emit("update:modelValue", val)
|
|
799
|
+
});
|
|
800
|
+
const handleTabClick = (pane) => {
|
|
801
|
+
emit("tab-click", pane);
|
|
802
|
+
};
|
|
803
|
+
return (_ctx, _cache) => {
|
|
804
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
805
|
+
const _component_el_tab_pane = resolveComponent("el-tab-pane");
|
|
806
|
+
const _component_el_tabs = resolveComponent("el-tabs");
|
|
807
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
808
|
+
createVNode(_component_el_tabs, {
|
|
809
|
+
modelValue: unref(activeTab),
|
|
810
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(activeTab) ? activeTab.value = $event : null),
|
|
811
|
+
class: "custom-tabs",
|
|
812
|
+
"tab-position": "left",
|
|
813
|
+
onTabClick: handleTabClick
|
|
814
|
+
}, {
|
|
815
|
+
default: withCtx(() => [
|
|
816
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tabs, (tab) => {
|
|
817
|
+
return openBlock(), createBlock(_component_el_tab_pane, {
|
|
818
|
+
key: tab.name,
|
|
819
|
+
label: tab.label,
|
|
820
|
+
name: tab.name
|
|
821
|
+
}, {
|
|
822
|
+
label: withCtx(() => [
|
|
823
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
824
|
+
createVNode(_component_el_icon, { class: "tab-icon" }, {
|
|
825
|
+
default: withCtx(() => [
|
|
826
|
+
(openBlock(), createBlock(resolveDynamicComponent(tab.icon)))
|
|
827
|
+
]),
|
|
828
|
+
_: 2
|
|
829
|
+
}, 1024),
|
|
830
|
+
createElementVNode("span", _hoisted_3$5, toDisplayString(tab.label), 1)
|
|
831
|
+
])
|
|
832
|
+
]),
|
|
833
|
+
_: 2
|
|
834
|
+
}, 1032, ["label", "name"]);
|
|
835
|
+
}), 128))
|
|
836
|
+
]),
|
|
837
|
+
_: 1
|
|
838
|
+
}, 8, ["modelValue"]),
|
|
839
|
+
createElementVNode("div", _hoisted_4$3, [
|
|
840
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
841
|
+
])
|
|
842
|
+
]);
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
const KCustomTabs = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-1a3054fc"]]);
|
|
1430
847
|
const _hoisted_1$9 = {
|
|
1431
848
|
key: 0,
|
|
1432
849
|
class: "dict-tag__text"
|
|
1433
850
|
};
|
|
1434
|
-
const _sfc_main$
|
|
851
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1435
852
|
__name: "KDictTag",
|
|
1436
853
|
props: {
|
|
1437
854
|
options: {},
|
|
@@ -1536,7 +953,138 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1536
953
|
};
|
|
1537
954
|
}
|
|
1538
955
|
});
|
|
1539
|
-
const KDictTag = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
956
|
+
const KDictTag = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-f24d054e"]]);
|
|
957
|
+
const _hoisted_1$8 = { class: "ip-segment-input" };
|
|
958
|
+
const _hoisted_2$5 = {
|
|
959
|
+
key: 0,
|
|
960
|
+
class: "ip-prefix"
|
|
961
|
+
};
|
|
962
|
+
const _hoisted_3$4 = { class: "ip-inputs" };
|
|
963
|
+
const _hoisted_4$2 = ["onUpdate:modelValue", "onInput", "onKeydown"];
|
|
964
|
+
const _hoisted_5$2 = {
|
|
965
|
+
key: 0,
|
|
966
|
+
class: "ip-dot"
|
|
967
|
+
};
|
|
968
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
969
|
+
__name: "KIpSegmentInput",
|
|
970
|
+
props: {
|
|
971
|
+
modelValue: {},
|
|
972
|
+
prefix: { default: "" },
|
|
973
|
+
segmentCount: { default: 1 }
|
|
974
|
+
},
|
|
975
|
+
emits: ["update:modelValue"],
|
|
976
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
977
|
+
const props = __props;
|
|
978
|
+
const emit = __emit;
|
|
979
|
+
const inputRefs = ref([]);
|
|
980
|
+
const setInputRef = (el, index) => {
|
|
981
|
+
if (el) {
|
|
982
|
+
inputRefs.value[index] = el;
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
const segments = reactive(Array.from({ length: props.segmentCount }, () => ({ value: "" })));
|
|
986
|
+
watch(
|
|
987
|
+
() => props.modelValue,
|
|
988
|
+
(newVal) => {
|
|
989
|
+
if (newVal) {
|
|
990
|
+
const parts = newVal.split(".");
|
|
991
|
+
parts.forEach((part, index) => {
|
|
992
|
+
if (index < segments.length) {
|
|
993
|
+
segments[index].value = part;
|
|
994
|
+
}
|
|
995
|
+
});
|
|
996
|
+
} else {
|
|
997
|
+
segments.forEach((seg) => seg.value = "");
|
|
998
|
+
}
|
|
999
|
+
},
|
|
1000
|
+
{ immediate: true }
|
|
1001
|
+
);
|
|
1002
|
+
const updateValue = () => {
|
|
1003
|
+
const value = segments.map((seg) => seg.value).join(".");
|
|
1004
|
+
emit("update:modelValue", value);
|
|
1005
|
+
};
|
|
1006
|
+
const handleInput = (index, event) => {
|
|
1007
|
+
var _a;
|
|
1008
|
+
const input = event.target;
|
|
1009
|
+
let value = input.value;
|
|
1010
|
+
value = value.replace(/[^\d]/g, "");
|
|
1011
|
+
if (value) {
|
|
1012
|
+
const num = parseInt(value, 10);
|
|
1013
|
+
if (num > 255) {
|
|
1014
|
+
value = "255";
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
segments[index].value = value;
|
|
1018
|
+
if (value.length === 3 && index < segments.length - 1) {
|
|
1019
|
+
(_a = inputRefs.value[index + 1]) == null ? void 0 : _a.focus();
|
|
1020
|
+
}
|
|
1021
|
+
updateValue();
|
|
1022
|
+
};
|
|
1023
|
+
const handleKeydown = (index, event) => {
|
|
1024
|
+
var _a, _b;
|
|
1025
|
+
const input = event.target;
|
|
1026
|
+
const value = input.value;
|
|
1027
|
+
if ((event.key === "." || event.key === "ArrowRight") && index < segments.length - 1) {
|
|
1028
|
+
event.preventDefault();
|
|
1029
|
+
inputRefs.value[index + 1].focus();
|
|
1030
|
+
}
|
|
1031
|
+
if (event.key === "ArrowLeft" && index > 0 && input.selectionStart === 0) {
|
|
1032
|
+
event.preventDefault();
|
|
1033
|
+
(_a = inputRefs.value[index - 1]) == null ? void 0 : _a.focus();
|
|
1034
|
+
}
|
|
1035
|
+
if (event.key === "Backspace" && !value && index > 0) {
|
|
1036
|
+
event.preventDefault();
|
|
1037
|
+
(_b = inputRefs.value[index - 1]) == null ? void 0 : _b.focus();
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
const handlePaste = (event) => {
|
|
1041
|
+
var _a;
|
|
1042
|
+
event.preventDefault();
|
|
1043
|
+
const pasteData = ((_a = event.clipboardData) == null ? void 0 : _a.getData("text")) || "";
|
|
1044
|
+
const parts = pasteData.split(".").filter((p2) => /^\d+$/.test(p2));
|
|
1045
|
+
parts.forEach((part, index) => {
|
|
1046
|
+
if (index < segments.length) {
|
|
1047
|
+
const num = parseInt(part, 10);
|
|
1048
|
+
segments[index].value = num > 255 ? "255" : part;
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
updateValue();
|
|
1052
|
+
};
|
|
1053
|
+
const focus = () => {
|
|
1054
|
+
var _a;
|
|
1055
|
+
(_a = inputRefs.value[0]) == null ? void 0 : _a.focus();
|
|
1056
|
+
};
|
|
1057
|
+
__expose({
|
|
1058
|
+
focus
|
|
1059
|
+
});
|
|
1060
|
+
return (_ctx, _cache) => {
|
|
1061
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1062
|
+
_ctx.prefix ? (openBlock(), createElementBlock("div", _hoisted_2$5, toDisplayString(_ctx.prefix), 1)) : createCommentVNode("", true),
|
|
1063
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
1064
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(segments, (segment, index) => {
|
|
1065
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
1066
|
+
withDirectives(createElementVNode("input", {
|
|
1067
|
+
ref_for: true,
|
|
1068
|
+
ref: (el) => setInputRef(el, index),
|
|
1069
|
+
"onUpdate:modelValue": ($event) => segment.value = $event,
|
|
1070
|
+
maxlength: 3,
|
|
1071
|
+
class: "ip-input",
|
|
1072
|
+
type: "text",
|
|
1073
|
+
onInput: ($event) => handleInput(index, $event),
|
|
1074
|
+
onKeydown: ($event) => handleKeydown(index, $event),
|
|
1075
|
+
onPaste: _cache[0] || (_cache[0] = ($event) => handlePaste($event))
|
|
1076
|
+
}, null, 40, _hoisted_4$2), [
|
|
1077
|
+
[vModelText, segment.value]
|
|
1078
|
+
]),
|
|
1079
|
+
index < segments.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_5$2, ".")) : createCommentVNode("", true)
|
|
1080
|
+
], 64);
|
|
1081
|
+
}), 128))
|
|
1082
|
+
])
|
|
1083
|
+
]);
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
const KIpSegmentInput = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-a3d263a5"]]);
|
|
1540
1088
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1541
1089
|
...{
|
|
1542
1090
|
name: "KPlainButton",
|
|
@@ -1575,9 +1123,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1575
1123
|
};
|
|
1576
1124
|
}
|
|
1577
1125
|
});
|
|
1578
|
-
const _hoisted_1$
|
|
1579
|
-
const _hoisted_2$
|
|
1580
|
-
const _hoisted_3$
|
|
1126
|
+
const _hoisted_1$7 = { class: "k-search-bar__title" };
|
|
1127
|
+
const _hoisted_2$4 = { key: 1 };
|
|
1128
|
+
const _hoisted_3$3 = { class: "k-search-bar__actions" };
|
|
1581
1129
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1582
1130
|
...{
|
|
1583
1131
|
name: "KSearchBar",
|
|
@@ -1796,7 +1344,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1796
1344
|
default: withCtx(() => [
|
|
1797
1345
|
createVNode(_component_el_collapse_item, { name: "search" }, {
|
|
1798
1346
|
title: withCtx(() => [
|
|
1799
|
-
createElementVNode("div", _hoisted_1$
|
|
1347
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
1800
1348
|
createElementVNode("span", null, toDisplayString(_ctx.title), 1)
|
|
1801
1349
|
])
|
|
1802
1350
|
]),
|
|
@@ -1875,7 +1423,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1875
1423
|
item.label ? {
|
|
1876
1424
|
name: "label",
|
|
1877
1425
|
fn: withCtx(() => [
|
|
1878
|
-
typeof item.label !== "string" ? (openBlock(), createBlock(resolveDynamicComponent(item.label), { key: 0 })) : (openBlock(), createElementBlock("span", _hoisted_2$
|
|
1426
|
+
typeof item.label !== "string" ? (openBlock(), createBlock(resolveDynamicComponent(item.label), { key: 0 })) : (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(item.label), 1))
|
|
1879
1427
|
]),
|
|
1880
1428
|
key: "0"
|
|
1881
1429
|
} : void 0
|
|
@@ -1893,7 +1441,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1893
1441
|
class: "k-search-bar__actions-col"
|
|
1894
1442
|
}, {
|
|
1895
1443
|
default: withCtx(() => [
|
|
1896
|
-
createElementVNode("div", _hoisted_3$
|
|
1444
|
+
createElementVNode("div", _hoisted_3$3, [
|
|
1897
1445
|
renderSlot(_ctx.$slots, "actions-before", { modelValue: modelValue.value }, void 0, true),
|
|
1898
1446
|
_ctx.showReset ? (openBlock(), createBlock(_component_el_button, {
|
|
1899
1447
|
key: 0,
|
|
@@ -1938,8 +1486,74 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1938
1486
|
}
|
|
1939
1487
|
});
|
|
1940
1488
|
const KSearchBar = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-995c528d"]]);
|
|
1941
|
-
const _hoisted_1$
|
|
1489
|
+
const _hoisted_1$6 = { class: "section-title" };
|
|
1942
1490
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1491
|
+
__name: "KSectionTitle",
|
|
1492
|
+
props: {
|
|
1493
|
+
title: {}
|
|
1494
|
+
},
|
|
1495
|
+
setup(__props) {
|
|
1496
|
+
return (_ctx, _cache) => {
|
|
1497
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
1498
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1499
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
1500
|
+
], true)
|
|
1501
|
+
]);
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
});
|
|
1505
|
+
const KSectionTitle = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-59cb5e35"]]);
|
|
1506
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1507
|
+
...{
|
|
1508
|
+
name: "KSegmented",
|
|
1509
|
+
inheritAttrs: false
|
|
1510
|
+
},
|
|
1511
|
+
__name: "KSegmented",
|
|
1512
|
+
props: {
|
|
1513
|
+
modelValue: {
|
|
1514
|
+
type: [String, Number, Boolean],
|
|
1515
|
+
required: true
|
|
1516
|
+
},
|
|
1517
|
+
options: {
|
|
1518
|
+
type: Array,
|
|
1519
|
+
required: true
|
|
1520
|
+
},
|
|
1521
|
+
size: {
|
|
1522
|
+
type: String,
|
|
1523
|
+
default: "default"
|
|
1524
|
+
},
|
|
1525
|
+
block: {
|
|
1526
|
+
type: Boolean,
|
|
1527
|
+
default: false
|
|
1528
|
+
},
|
|
1529
|
+
disabled: {
|
|
1530
|
+
type: Boolean,
|
|
1531
|
+
default: false
|
|
1532
|
+
}
|
|
1533
|
+
},
|
|
1534
|
+
emits: ["update:modelValue", "change"],
|
|
1535
|
+
setup(__props, { emit: __emit }) {
|
|
1536
|
+
const emit = __emit;
|
|
1537
|
+
const handleUpdate = (value) => {
|
|
1538
|
+
emit("update:modelValue", value);
|
|
1539
|
+
emit("change", value);
|
|
1540
|
+
};
|
|
1541
|
+
return (_ctx, _cache) => {
|
|
1542
|
+
const _component_el_segmented = resolveComponent("el-segmented");
|
|
1543
|
+
return openBlock(), createBlock(_component_el_segmented, mergeProps({
|
|
1544
|
+
block: __props.block,
|
|
1545
|
+
disabled: __props.disabled,
|
|
1546
|
+
"model-value": __props.modelValue,
|
|
1547
|
+
options: __props.options,
|
|
1548
|
+
size: __props.size,
|
|
1549
|
+
class: "k-segmented"
|
|
1550
|
+
}, _ctx.$attrs, { "onUpdate:modelValue": handleUpdate }), null, 16, ["block", "disabled", "model-value", "options", "size"]);
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
});
|
|
1554
|
+
const KSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-bdb6d72b"]]);
|
|
1555
|
+
const _hoisted_1$5 = { class: "title" };
|
|
1556
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1943
1557
|
...{ name: "KSelectedAlert" },
|
|
1944
1558
|
__name: "KSelectedAlert",
|
|
1945
1559
|
props: {
|
|
@@ -1957,7 +1571,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1957
1571
|
type: "primary"
|
|
1958
1572
|
}, {
|
|
1959
1573
|
title: withCtx(() => [
|
|
1960
|
-
createElementVNode("span", _hoisted_1$
|
|
1574
|
+
createElementVNode("span", _hoisted_1$5, toDisplayString(_ctx.count > 0 ? `已选择 ${_ctx.count} 条记录` : "未选中任何记录"), 1),
|
|
1961
1575
|
_ctx.count > 0 ? (openBlock(), createBlock(_component_el_link, {
|
|
1962
1576
|
key: 0,
|
|
1963
1577
|
underline: false,
|
|
@@ -1975,9 +1589,69 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1975
1589
|
};
|
|
1976
1590
|
}
|
|
1977
1591
|
});
|
|
1978
|
-
const KSelectedAlert = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1979
|
-
const _hoisted_1$
|
|
1980
|
-
const
|
|
1592
|
+
const KSelectedAlert = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-cf66b3b3"]]);
|
|
1593
|
+
const _hoisted_1$4 = { class: "k-spin__indicator" };
|
|
1594
|
+
const _hoisted_2$3 = {
|
|
1595
|
+
key: 0,
|
|
1596
|
+
class: "k-spin__description"
|
|
1597
|
+
};
|
|
1598
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1599
|
+
...{ name: "KSpin" },
|
|
1600
|
+
__name: "KSpin",
|
|
1601
|
+
props: {
|
|
1602
|
+
show: { type: Boolean, default: false },
|
|
1603
|
+
size: { default: 28 },
|
|
1604
|
+
description: { default: "" },
|
|
1605
|
+
background: { default: "rgba(255, 255, 255, 0.72)" },
|
|
1606
|
+
contentClass: { default: "" }
|
|
1607
|
+
},
|
|
1608
|
+
setup(__props) {
|
|
1609
|
+
const props = __props;
|
|
1610
|
+
const maskStyle = computed(() => ({
|
|
1611
|
+
background: props.background
|
|
1612
|
+
}));
|
|
1613
|
+
return (_ctx, _cache) => {
|
|
1614
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
1615
|
+
return openBlock(), createElementBlock("div", {
|
|
1616
|
+
class: normalizeClass(["k-spin", { "is-active": _ctx.show }])
|
|
1617
|
+
}, [
|
|
1618
|
+
createElementVNode("div", {
|
|
1619
|
+
class: normalizeClass(["k-spin__content", _ctx.contentClass])
|
|
1620
|
+
}, [
|
|
1621
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1622
|
+
], 2),
|
|
1623
|
+
createVNode(Transition, { name: "k-spin-fade" }, {
|
|
1624
|
+
default: withCtx(() => [
|
|
1625
|
+
_ctx.show ? (openBlock(), createElementBlock("div", {
|
|
1626
|
+
key: 0,
|
|
1627
|
+
class: "k-spin__mask",
|
|
1628
|
+
style: normalizeStyle(unref(maskStyle))
|
|
1629
|
+
}, [
|
|
1630
|
+
renderSlot(_ctx.$slots, "spin", {}, () => [
|
|
1631
|
+
createElementVNode("div", _hoisted_1$4, [
|
|
1632
|
+
createVNode(_component_el_icon, {
|
|
1633
|
+
class: "k-spin__icon is-loading",
|
|
1634
|
+
size: _ctx.size
|
|
1635
|
+
}, {
|
|
1636
|
+
default: withCtx(() => [
|
|
1637
|
+
createVNode(unref(Loading))
|
|
1638
|
+
]),
|
|
1639
|
+
_: 1
|
|
1640
|
+
}, 8, ["size"]),
|
|
1641
|
+
_ctx.description ? (openBlock(), createElementBlock("p", _hoisted_2$3, toDisplayString(_ctx.description), 1)) : createCommentVNode("", true)
|
|
1642
|
+
])
|
|
1643
|
+
], true)
|
|
1644
|
+
], 4)) : createCommentVNode("", true)
|
|
1645
|
+
]),
|
|
1646
|
+
_: 3
|
|
1647
|
+
})
|
|
1648
|
+
], 2);
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
});
|
|
1652
|
+
const KSpin = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-92190b3d"]]);
|
|
1653
|
+
const _hoisted_1$3 = { key: 0 };
|
|
1654
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1981
1655
|
...{ name: "KTable", inheritAttrs: false },
|
|
1982
1656
|
__name: "KTable",
|
|
1983
1657
|
props: {
|
|
@@ -2093,7 +1767,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2093
1767
|
ref: elTableRef
|
|
2094
1768
|
}, unref(mergedTableProps), { onSelectionChange: handleSelectionChange }), {
|
|
2095
1769
|
empty: withCtx(() => [
|
|
2096
|
-
_ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1770
|
+
_ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_1$3)) : (openBlock(), createBlock(_component_el_empty, {
|
|
2097
1771
|
key: 1,
|
|
2098
1772
|
description: _ctx.emptyText,
|
|
2099
1773
|
"image-size": 120
|
|
@@ -2162,7 +1836,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2162
1836
|
};
|
|
2163
1837
|
}
|
|
2164
1838
|
});
|
|
2165
|
-
const KTable = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1839
|
+
const KTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-05ba2501"]]);
|
|
2166
1840
|
var an = Object.defineProperty;
|
|
2167
1841
|
var Pe = Object.getOwnPropertySymbols;
|
|
2168
1842
|
var yt = Object.prototype.hasOwnProperty, wt = Object.prototype.propertyIsEnumerable;
|
|
@@ -3759,18 +3433,18 @@ const ft = [
|
|
|
3759
3433
|
};
|
|
3760
3434
|
}
|
|
3761
3435
|
});
|
|
3762
|
-
const _hoisted_1$
|
|
3763
|
-
const _hoisted_2$
|
|
3436
|
+
const _hoisted_1$2 = { class: "k-table-header__left" };
|
|
3437
|
+
const _hoisted_2$2 = {
|
|
3764
3438
|
key: 0,
|
|
3765
3439
|
class: "k-table-header__title"
|
|
3766
3440
|
};
|
|
3767
|
-
const _hoisted_3$
|
|
3768
|
-
const _hoisted_4$
|
|
3769
|
-
const _hoisted_5$
|
|
3770
|
-
const _hoisted_6
|
|
3771
|
-
const _hoisted_7
|
|
3772
|
-
const _hoisted_8
|
|
3773
|
-
const _sfc_main$
|
|
3441
|
+
const _hoisted_3$2 = { class: "k-table-header__right" };
|
|
3442
|
+
const _hoisted_4$1 = { class: "column-panel" };
|
|
3443
|
+
const _hoisted_5$1 = { class: "column-panel__select-all" };
|
|
3444
|
+
const _hoisted_6 = { class: "column-item__main" };
|
|
3445
|
+
const _hoisted_7 = { class: "column-item__label" };
|
|
3446
|
+
const _hoisted_8 = ["disabled", "onClick"];
|
|
3447
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3774
3448
|
...{ name: "KTableHeader" },
|
|
3775
3449
|
__name: "KTableHeader",
|
|
3776
3450
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -3900,12 +3574,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3900
3574
|
ref: headerRef,
|
|
3901
3575
|
class: "k-table-header"
|
|
3902
3576
|
}, [
|
|
3903
|
-
createElementVNode("div", _hoisted_1$
|
|
3577
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
3904
3578
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
3905
|
-
_ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
3579
|
+
_ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2$2, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true)
|
|
3906
3580
|
], true)
|
|
3907
3581
|
]),
|
|
3908
|
-
createElementVNode("div", _hoisted_3$
|
|
3582
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
3909
3583
|
renderSlot(_ctx.$slots, "right", {}, void 0, true),
|
|
3910
3584
|
shouldShow("refresh") ? (openBlock(), createBlock(_component_KPlainButton, {
|
|
3911
3585
|
key: 0,
|
|
@@ -3942,8 +3616,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3942
3616
|
}, 8, ["icon"])
|
|
3943
3617
|
]),
|
|
3944
3618
|
default: withCtx(() => [
|
|
3945
|
-
createElementVNode("div", _hoisted_4$
|
|
3946
|
-
createElementVNode("div", _hoisted_5$
|
|
3619
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
3620
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
3947
3621
|
createVNode(_component_el_checkbox, {
|
|
3948
3622
|
disabled: unref(visibleStats).total === 0,
|
|
3949
3623
|
indeterminate: unref(selectAllIndeterminate),
|
|
@@ -3973,7 +3647,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3973
3647
|
key: String(item.key),
|
|
3974
3648
|
class: "column-item"
|
|
3975
3649
|
}, [
|
|
3976
|
-
createElementVNode("div", _hoisted_6
|
|
3650
|
+
createElementVNode("div", _hoisted_6, [
|
|
3977
3651
|
createVNode(_component_el_icon, { class: "column-item__drag" }, {
|
|
3978
3652
|
default: withCtx(() => [
|
|
3979
3653
|
createVNode(unref(Rank))
|
|
@@ -3987,7 +3661,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3987
3661
|
onChange: (value) => handleCheckedChange(item, value)
|
|
3988
3662
|
}, {
|
|
3989
3663
|
default: withCtx(() => [
|
|
3990
|
-
createElementVNode("span", _hoisted_7
|
|
3664
|
+
createElementVNode("span", _hoisted_7, toDisplayString(item.label), 1)
|
|
3991
3665
|
]),
|
|
3992
3666
|
_: 2
|
|
3993
3667
|
}, 1032, ["disabled", "model-value", "onChange"])
|
|
@@ -4014,7 +3688,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4014
3688
|
]),
|
|
4015
3689
|
_: 1
|
|
4016
3690
|
}))
|
|
4017
|
-
], 10, _hoisted_8
|
|
3691
|
+
], 10, _hoisted_8)
|
|
4018
3692
|
]);
|
|
4019
3693
|
}), 128))
|
|
4020
3694
|
]),
|
|
@@ -4029,11 +3703,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4029
3703
|
};
|
|
4030
3704
|
}
|
|
4031
3705
|
});
|
|
4032
|
-
const KTableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4033
|
-
const _hoisted_1$
|
|
4034
|
-
const _hoisted_2$
|
|
4035
|
-
const _hoisted_3$
|
|
4036
|
-
const _sfc_main$
|
|
3706
|
+
const KTableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b92b8ec9"]]);
|
|
3707
|
+
const _hoisted_1$1 = { class: "setting-form" };
|
|
3708
|
+
const _hoisted_2$1 = { class: "form-content" };
|
|
3709
|
+
const _hoisted_3$1 = { class: "form-footer" };
|
|
3710
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4037
3711
|
__name: "SettingForm",
|
|
4038
3712
|
props: {
|
|
4039
3713
|
title: { default: "" },
|
|
@@ -4092,8 +3766,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4092
3766
|
const _component_RefreshLeft = resolveComponent("RefreshLeft");
|
|
4093
3767
|
const _component_Check = resolveComponent("Check");
|
|
4094
3768
|
const _component_Close = resolveComponent("Close");
|
|
4095
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4096
|
-
createElementVNode("div", _hoisted_2$
|
|
3769
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
3770
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
4097
3771
|
createVNode(_component_el_form, {
|
|
4098
3772
|
ref_key: "formRef",
|
|
4099
3773
|
ref: formRef,
|
|
@@ -4112,7 +3786,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4112
3786
|
_: 3
|
|
4113
3787
|
}, 8, ["model", "rules", "disabled"])
|
|
4114
3788
|
]),
|
|
4115
|
-
createElementVNode("div", _hoisted_3$
|
|
3789
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
4116
3790
|
!unref(isEditing) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4117
3791
|
createVNode(_component_el_button, {
|
|
4118
3792
|
type: "primary",
|
|
@@ -4188,555 +3862,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4188
3862
|
};
|
|
4189
3863
|
}
|
|
4190
3864
|
});
|
|
4191
|
-
const SettingForm = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
}
|
|
4199
|
-
function updateConfigByKey(key, value) {
|
|
4200
|
-
return request({
|
|
4201
|
-
url: "/system/config/updateByKey",
|
|
4202
|
-
method: "put",
|
|
4203
|
-
data: {
|
|
4204
|
-
configKey: key,
|
|
4205
|
-
configValue: value
|
|
4206
|
-
}
|
|
4207
|
-
});
|
|
4208
|
-
}
|
|
4209
|
-
const _hoisted_1$3 = { class: "business-config-container" };
|
|
4210
|
-
const _hoisted_2$3 = {
|
|
4211
|
-
key: 3,
|
|
4212
|
-
class: "form-item-tip"
|
|
4213
|
-
};
|
|
4214
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
4215
|
-
__name: "ModuleBusinessSettings",
|
|
4216
|
-
props: {
|
|
4217
|
-
category: {},
|
|
4218
|
-
moduleLabel: {}
|
|
4219
|
-
},
|
|
4220
|
-
setup(__props) {
|
|
4221
|
-
const props = __props;
|
|
4222
|
-
const { proxy } = getCurrentInstance();
|
|
4223
|
-
const settingFormRef = ref();
|
|
4224
|
-
const loading = ref(false);
|
|
4225
|
-
const moduleFieldMap = {
|
|
4226
|
-
mall: [
|
|
4227
|
-
{ key: "orderAutoCancelMinutes", label: "订单自动取消分钟", control: "number", min: 0, max: 10080, tip: "0 表示不自动取消" },
|
|
4228
|
-
{ key: "afterSaleDays", label: "售后申请天数", control: "number", min: 0, max: 365 },
|
|
4229
|
-
{ key: "minOrderAmount", label: "最低下单金额", control: "number", min: 0, max: 999999, precision: 2 },
|
|
4230
|
-
{ key: "buyButtonText", label: "购买按钮文案", placeholder: "请输入购买按钮文案", maxlength: 20 }
|
|
4231
|
-
],
|
|
4232
|
-
im: [
|
|
4233
|
-
{ key: "friendRequestNeedVerify", label: "添加好友需验证", control: "switch" },
|
|
4234
|
-
{ key: "messageRecallMinutes", label: "消息撤回时限分钟", control: "number", min: 0, max: 1440, tip: "0 表示不可撤回" },
|
|
4235
|
-
{ key: "groupCreateEnabled", label: "允许创建群聊", control: "switch" },
|
|
4236
|
-
{ key: "maxFileSizeMb", label: "附件大小上限(MB)", control: "number", min: 1, max: 1024 }
|
|
4237
|
-
],
|
|
4238
|
-
exam: [
|
|
4239
|
-
{ key: "practiceEnabled", label: "开启练习模式", control: "switch" },
|
|
4240
|
-
{ key: "showAnswerAfterSubmit", label: "交卷后显示答案", control: "switch" },
|
|
4241
|
-
{ key: "defaultDurationMinutes", label: "默认考试时长(分钟)", control: "number", min: 0, max: 1440 },
|
|
4242
|
-
{ key: "maxRetakeCount", label: "最大补考次数", control: "number", min: 0, max: 99 }
|
|
4243
|
-
],
|
|
4244
|
-
gallery: [
|
|
4245
|
-
{ key: "uploadEnabled", label: "允许上传", control: "switch" },
|
|
4246
|
-
{ key: "reviewBeforePublish", label: "发布前需审核", control: "switch" },
|
|
4247
|
-
{ key: "maxUploadSizeMb", label: "单文件大小上限(MB)", control: "number", min: 1, max: 500 },
|
|
4248
|
-
{ key: "dailyUploadCountLimit", label: "用户日上传数量上限", control: "number", min: 0, max: 1e5, tip: "0 表示不限制" },
|
|
4249
|
-
{ key: "dailyUploadSizeLimitMb", label: "用户日上传容量上限(MB)", control: "number", min: 0, max: 1e6, tip: "0 表示不限制" }
|
|
4250
|
-
]
|
|
4251
|
-
};
|
|
4252
|
-
const moduleFields = computed(() => moduleFieldMap[props.category]);
|
|
4253
|
-
const fieldKeys = computed(() => moduleFields.value.map((item) => item.key));
|
|
4254
|
-
function createFieldState() {
|
|
4255
|
-
return fieldKeys.value.reduce(
|
|
4256
|
-
(result, key) => {
|
|
4257
|
-
result[key] = "";
|
|
4258
|
-
return result;
|
|
4259
|
-
},
|
|
4260
|
-
{}
|
|
4261
|
-
);
|
|
4262
|
-
}
|
|
4263
|
-
const formData = reactive(createFieldState());
|
|
4264
|
-
const originalData = reactive(createFieldState());
|
|
4265
|
-
const defaultData = reactive(createFieldState());
|
|
4266
|
-
const rules = {};
|
|
4267
|
-
const configKeyMap = {
|
|
4268
|
-
orderAutoCancelMinutes: "mall.orderAutoCancelMinutes",
|
|
4269
|
-
afterSaleDays: "mall.afterSaleDays",
|
|
4270
|
-
minOrderAmount: "mall.minOrderAmount",
|
|
4271
|
-
buyButtonText: "mall.buyButtonText",
|
|
4272
|
-
friendRequestNeedVerify: "im.friendRequestNeedVerify",
|
|
4273
|
-
messageRecallMinutes: "im.messageRecallMinutes",
|
|
4274
|
-
groupCreateEnabled: "im.groupCreateEnabled",
|
|
4275
|
-
maxFileSizeMb: "im.maxFileSizeMb",
|
|
4276
|
-
practiceEnabled: "exam.practiceEnabled",
|
|
4277
|
-
showAnswerAfterSubmit: "exam.showAnswerAfterSubmit",
|
|
4278
|
-
defaultDurationMinutes: "exam.defaultDurationMinutes",
|
|
4279
|
-
maxRetakeCount: "exam.maxRetakeCount",
|
|
4280
|
-
uploadEnabled: "gallery.uploadEnabled",
|
|
4281
|
-
reviewBeforePublish: "gallery.reviewBeforePublish",
|
|
4282
|
-
maxUploadSizeMb: "gallery.maxUploadSizeMb",
|
|
4283
|
-
dailyUploadCountLimit: "gallery.dailyUploadCountLimit",
|
|
4284
|
-
dailyUploadSizeLimitMb: "gallery.dailyUploadSizeLimitMb"
|
|
4285
|
-
};
|
|
4286
|
-
const reverseKeyMap = Object.entries(configKeyMap).reduce(
|
|
4287
|
-
(result, [field, key]) => {
|
|
4288
|
-
result[key] = field;
|
|
4289
|
-
return result;
|
|
4290
|
-
},
|
|
4291
|
-
{}
|
|
4292
|
-
);
|
|
4293
|
-
const numberFieldSet = /* @__PURE__ */ new Set([
|
|
4294
|
-
"orderAutoCancelMinutes",
|
|
4295
|
-
"afterSaleDays",
|
|
4296
|
-
"minOrderAmount",
|
|
4297
|
-
"messageRecallMinutes",
|
|
4298
|
-
"maxFileSizeMb",
|
|
4299
|
-
"defaultDurationMinutes",
|
|
4300
|
-
"maxRetakeCount",
|
|
4301
|
-
"maxUploadSizeMb",
|
|
4302
|
-
"dailyUploadCountLimit",
|
|
4303
|
-
"dailyUploadSizeLimitMb"
|
|
4304
|
-
]);
|
|
4305
|
-
function normalizeValue(field, value) {
|
|
4306
|
-
if (numberFieldSet.has(field)) {
|
|
4307
|
-
if (value === "" || value === null || value === void 0) return 0;
|
|
4308
|
-
const parsed = Number(value);
|
|
4309
|
-
return Number.isNaN(parsed) ? 0 : parsed;
|
|
4310
|
-
}
|
|
4311
|
-
return value ?? "";
|
|
4312
|
-
}
|
|
4313
|
-
function stringifyValue(field, value) {
|
|
4314
|
-
if (numberFieldSet.has(field)) {
|
|
4315
|
-
return String(value ?? 0);
|
|
4316
|
-
}
|
|
4317
|
-
return String(value ?? "");
|
|
4318
|
-
}
|
|
4319
|
-
async function loadConfig() {
|
|
4320
|
-
loading.value = true;
|
|
4321
|
-
try {
|
|
4322
|
-
const res = await listConfig({
|
|
4323
|
-
pageNum: 1,
|
|
4324
|
-
pageSize: 100,
|
|
4325
|
-
configCategory: props.category
|
|
4326
|
-
});
|
|
4327
|
-
fieldKeys.value.forEach((key) => {
|
|
4328
|
-
formData[key] = normalizeValue(key, "");
|
|
4329
|
-
originalData[key] = normalizeValue(key, "");
|
|
4330
|
-
defaultData[key] = normalizeValue(key, "");
|
|
4331
|
-
});
|
|
4332
|
-
(res.rows || []).forEach((item) => {
|
|
4333
|
-
const field = reverseKeyMap[item.configKey];
|
|
4334
|
-
if (!field) return;
|
|
4335
|
-
formData[field] = normalizeValue(field, item.configValue);
|
|
4336
|
-
originalData[field] = normalizeValue(field, item.configValue);
|
|
4337
|
-
defaultData[field] = normalizeValue(field, item.defaultValue);
|
|
4338
|
-
});
|
|
4339
|
-
} finally {
|
|
4340
|
-
loading.value = false;
|
|
4341
|
-
}
|
|
4342
|
-
}
|
|
4343
|
-
async function handleSave() {
|
|
4344
|
-
var _a, _b, _c, _d;
|
|
4345
|
-
loading.value = true;
|
|
4346
|
-
try {
|
|
4347
|
-
const changedKeys = fieldKeys.value.filter((key) => stringifyValue(key, formData[key]) !== stringifyValue(key, originalData[key]));
|
|
4348
|
-
if (!changedKeys.length) {
|
|
4349
|
-
proxy == null ? void 0 : proxy.$modal.msg("未检测到变更");
|
|
4350
|
-
(_b = (_a = settingFormRef.value) == null ? void 0 : _a.exitEditMode) == null ? void 0 : _b.call(_a);
|
|
4351
|
-
return;
|
|
4352
|
-
}
|
|
4353
|
-
for (const key of changedKeys) {
|
|
4354
|
-
await updateConfigByKey(configKeyMap[key], stringifyValue(key, formData[key]));
|
|
4355
|
-
originalData[key] = normalizeValue(key, formData[key]);
|
|
4356
|
-
}
|
|
4357
|
-
proxy == null ? void 0 : proxy.$modal.msgSuccess(`已保存 ${changedKeys.length} 项配置`);
|
|
4358
|
-
(_d = (_c = settingFormRef.value) == null ? void 0 : _c.exitEditMode) == null ? void 0 : _d.call(_c);
|
|
4359
|
-
} catch (error) {
|
|
4360
|
-
console.error(`save ${props.category} business config failed`, error);
|
|
4361
|
-
proxy == null ? void 0 : proxy.$modal.msgError("保存失败");
|
|
4362
|
-
} finally {
|
|
4363
|
-
loading.value = false;
|
|
4364
|
-
}
|
|
4365
|
-
}
|
|
4366
|
-
function handleReset() {
|
|
4367
|
-
loadConfig();
|
|
4368
|
-
}
|
|
4369
|
-
function handleCancel() {
|
|
4370
|
-
}
|
|
4371
|
-
function handleResetToDefault() {
|
|
4372
|
-
proxy == null ? void 0 : proxy.$modal.confirm("确认恢复默认值吗?").then(() => {
|
|
4373
|
-
fieldKeys.value.forEach((key) => {
|
|
4374
|
-
formData[key] = normalizeValue(key, defaultData[key]);
|
|
4375
|
-
});
|
|
4376
|
-
proxy == null ? void 0 : proxy.$modal.msgSuccess("已恢复默认值,保存后生效。");
|
|
4377
|
-
}).catch(() => {
|
|
4378
|
-
});
|
|
4379
|
-
}
|
|
4380
|
-
onMounted(() => {
|
|
4381
|
-
loadConfig();
|
|
4382
|
-
});
|
|
4383
|
-
return (_ctx, _cache) => {
|
|
4384
|
-
const _component_el_switch = resolveComponent("el-switch");
|
|
4385
|
-
const _component_el_input_number = resolveComponent("el-input-number");
|
|
4386
|
-
const _component_el_input = resolveComponent("el-input");
|
|
4387
|
-
const _component_el_form_item = resolveComponent("el-form-item");
|
|
4388
|
-
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
4389
|
-
createVNode(SettingForm, {
|
|
4390
|
-
ref_key: "settingFormRef",
|
|
4391
|
-
ref: settingFormRef,
|
|
4392
|
-
"default-data": defaultData,
|
|
4393
|
-
"form-data": formData,
|
|
4394
|
-
loading: loading.value,
|
|
4395
|
-
rules,
|
|
4396
|
-
title: `${_ctx.moduleLabel}业务配置`,
|
|
4397
|
-
onCancel: handleCancel,
|
|
4398
|
-
onReset: handleReset,
|
|
4399
|
-
onSave: handleSave,
|
|
4400
|
-
onResetDefault: handleResetToDefault
|
|
4401
|
-
}, {
|
|
4402
|
-
default: withCtx(({ isEditing }) => [
|
|
4403
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(moduleFields.value, (field) => {
|
|
4404
|
-
return openBlock(), createBlock(_component_el_form_item, {
|
|
4405
|
-
key: field.key,
|
|
4406
|
-
label: field.label,
|
|
4407
|
-
prop: field.key
|
|
4408
|
-
}, {
|
|
4409
|
-
default: withCtx(() => [
|
|
4410
|
-
field.control === "switch" ? (openBlock(), createBlock(_component_el_switch, {
|
|
4411
|
-
key: 0,
|
|
4412
|
-
modelValue: formData[field.key],
|
|
4413
|
-
"onUpdate:modelValue": ($event) => formData[field.key] = $event,
|
|
4414
|
-
"active-value": "true",
|
|
4415
|
-
"inactive-value": "false",
|
|
4416
|
-
disabled: !isEditing
|
|
4417
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : field.control === "number" ? (openBlock(), createBlock(_component_el_input_number, {
|
|
4418
|
-
key: 1,
|
|
4419
|
-
modelValue: formData[field.key],
|
|
4420
|
-
"onUpdate:modelValue": ($event) => formData[field.key] = $event,
|
|
4421
|
-
disabled: !isEditing,
|
|
4422
|
-
min: field.min,
|
|
4423
|
-
max: field.max,
|
|
4424
|
-
precision: field.precision,
|
|
4425
|
-
class: "w-full"
|
|
4426
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "min", "max", "precision"])) : (openBlock(), createBlock(_component_el_input, {
|
|
4427
|
-
key: 2,
|
|
4428
|
-
modelValue: formData[field.key],
|
|
4429
|
-
"onUpdate:modelValue": ($event) => formData[field.key] = $event,
|
|
4430
|
-
maxlength: field.maxlength,
|
|
4431
|
-
placeholder: field.placeholder,
|
|
4432
|
-
rows: field.rows,
|
|
4433
|
-
"show-word-limit": field.type === "textarea",
|
|
4434
|
-
type: field.type || "text",
|
|
4435
|
-
clearable: ""
|
|
4436
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "maxlength", "placeholder", "rows", "show-word-limit", "type"])),
|
|
4437
|
-
field.tip ? (openBlock(), createElementBlock("div", _hoisted_2$3, toDisplayString(field.tip), 1)) : createCommentVNode("", true)
|
|
4438
|
-
]),
|
|
4439
|
-
_: 2
|
|
4440
|
-
}, 1032, ["label", "prop"]);
|
|
4441
|
-
}), 128))
|
|
4442
|
-
]),
|
|
4443
|
-
_: 1
|
|
4444
|
-
}, 8, ["default-data", "form-data", "loading", "title"])
|
|
4445
|
-
]);
|
|
4446
|
-
};
|
|
4447
|
-
}
|
|
4448
|
-
});
|
|
4449
|
-
const ModuleBusinessSettings = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-1df6b0cb"]]);
|
|
4450
|
-
const _hoisted_1$2 = { class: "website-config-container" };
|
|
4451
|
-
const _hoisted_2$2 = { class: "form-section" };
|
|
4452
|
-
const _hoisted_3$2 = { class: "preview-section" };
|
|
4453
|
-
const _hoisted_4$2 = { class: "preview-container" };
|
|
4454
|
-
const _hoisted_5$2 = { class: "preview-header" };
|
|
4455
|
-
const _hoisted_6$1 = ["src"];
|
|
4456
|
-
const _hoisted_7$1 = {
|
|
4457
|
-
key: 1,
|
|
4458
|
-
class: "text-gray-400"
|
|
4459
|
-
};
|
|
4460
|
-
const _hoisted_8 = { class: "preview-content" };
|
|
4461
|
-
const _hoisted_9 = { class: "preview-name" };
|
|
4462
|
-
const _hoisted_10 = { class: "preview-desc" };
|
|
4463
|
-
const _hoisted_11 = {
|
|
4464
|
-
key: 0,
|
|
4465
|
-
class: "preview-meta"
|
|
4466
|
-
};
|
|
4467
|
-
const _hoisted_12 = { key: 0 };
|
|
4468
|
-
const _hoisted_13 = { key: 1 };
|
|
4469
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
4470
|
-
__name: "ModuleWebsiteSettings",
|
|
4471
|
-
props: {
|
|
4472
|
-
category: {},
|
|
4473
|
-
moduleLabel: {}
|
|
4474
|
-
},
|
|
4475
|
-
setup(__props) {
|
|
4476
|
-
const props = __props;
|
|
4477
|
-
const { proxy } = getCurrentInstance();
|
|
4478
|
-
const settingFormRef = ref();
|
|
4479
|
-
const loading = ref(false);
|
|
4480
|
-
const logoUrl = ref("");
|
|
4481
|
-
const baseFields = [
|
|
4482
|
-
{ key: "name", label: "系统名称", placeholder: "请输入系统名称", maxlength: 50 },
|
|
4483
|
-
{ key: "nameEn", label: "英文名称", placeholder: "请输入英文名称", maxlength: 50 },
|
|
4484
|
-
{ key: "description", label: "站点描述", placeholder: "请输入站点描述", maxlength: 200, type: "textarea", rows: 3 },
|
|
4485
|
-
{ key: "copyright", label: "版权信息", placeholder: "请输入版权信息", maxlength: 200, type: "textarea", rows: 2 },
|
|
4486
|
-
{ key: "icp", label: "ICP备案号", placeholder: "请输入 ICP 备案号", maxlength: 50 }
|
|
4487
|
-
];
|
|
4488
|
-
const fieldKeys = computed(() => ["logo", "favicon", "backgroundImage", ...baseFields.map((item) => item.key)]);
|
|
4489
|
-
function createFieldState() {
|
|
4490
|
-
return fieldKeys.value.reduce(
|
|
4491
|
-
(result, key) => {
|
|
4492
|
-
result[key] = "";
|
|
4493
|
-
return result;
|
|
4494
|
-
},
|
|
4495
|
-
{}
|
|
4496
|
-
);
|
|
4497
|
-
}
|
|
4498
|
-
const formData = reactive(createFieldState());
|
|
4499
|
-
const originalData = reactive(createFieldState());
|
|
4500
|
-
const defaultData = reactive(createFieldState());
|
|
4501
|
-
const rules = {
|
|
4502
|
-
name: [{ required: true, message: "请输入系统名称", trigger: "blur" }],
|
|
4503
|
-
copyright: [{ required: true, message: "请输入版权信息", trigger: "blur" }]
|
|
4504
|
-
};
|
|
4505
|
-
const configKeyMap = computed(() => ({
|
|
4506
|
-
logo: `${props.category}.logo`,
|
|
4507
|
-
favicon: `${props.category}.favicon`,
|
|
4508
|
-
name: `${props.category}.name`,
|
|
4509
|
-
nameEn: `${props.category}.nameEn`,
|
|
4510
|
-
backgroundImage: `${props.category}.backgroundImage`,
|
|
4511
|
-
description: `${props.category}.description`,
|
|
4512
|
-
copyright: `${props.category}.copyright`,
|
|
4513
|
-
icp: `${props.category}.icp`
|
|
4514
|
-
}));
|
|
4515
|
-
const reverseKeyMap = computed(
|
|
4516
|
-
() => Object.entries(configKeyMap.value).reduce(
|
|
4517
|
-
(result, [field, key]) => {
|
|
4518
|
-
result[key] = field;
|
|
4519
|
-
return result;
|
|
4520
|
-
},
|
|
4521
|
-
{}
|
|
4522
|
-
)
|
|
4523
|
-
);
|
|
4524
|
-
async function getImageUrl(value) {
|
|
4525
|
-
var _a, _b;
|
|
4526
|
-
if (!value) return "";
|
|
4527
|
-
if (value.startsWith("http")) return value;
|
|
4528
|
-
try {
|
|
4529
|
-
const { listByIds: listByIds2 } = await Promise.resolve().then(() => oss);
|
|
4530
|
-
const res = await listByIds2(value);
|
|
4531
|
-
return ((_b = (_a = res.data) == null ? void 0 : _a[0]) == null ? void 0 : _b.url) || "";
|
|
4532
|
-
} catch {
|
|
4533
|
-
return "";
|
|
4534
|
-
}
|
|
4535
|
-
}
|
|
4536
|
-
async function syncPreview() {
|
|
4537
|
-
logoUrl.value = await getImageUrl(String(formData.logo || ""));
|
|
4538
|
-
}
|
|
4539
|
-
async function loadConfig() {
|
|
4540
|
-
loading.value = true;
|
|
4541
|
-
try {
|
|
4542
|
-
const res = await listConfig({
|
|
4543
|
-
pageNum: 1,
|
|
4544
|
-
pageSize: 100,
|
|
4545
|
-
configCategory: props.category
|
|
4546
|
-
});
|
|
4547
|
-
fieldKeys.value.forEach((key) => {
|
|
4548
|
-
formData[key] = "";
|
|
4549
|
-
originalData[key] = "";
|
|
4550
|
-
defaultData[key] = "";
|
|
4551
|
-
});
|
|
4552
|
-
(res.rows || []).forEach((item) => {
|
|
4553
|
-
const field = reverseKeyMap.value[item.configKey];
|
|
4554
|
-
if (!field) return;
|
|
4555
|
-
formData[field] = item.configValue || "";
|
|
4556
|
-
originalData[field] = item.configValue || "";
|
|
4557
|
-
defaultData[field] = item.defaultValue || "";
|
|
4558
|
-
});
|
|
4559
|
-
await syncPreview();
|
|
4560
|
-
} finally {
|
|
4561
|
-
loading.value = false;
|
|
4562
|
-
}
|
|
4563
|
-
}
|
|
4564
|
-
function handleLogoUpload(data) {
|
|
4565
|
-
formData.logo = String(data.ossId || "");
|
|
4566
|
-
logoUrl.value = data.url || "";
|
|
4567
|
-
}
|
|
4568
|
-
function handleFaviconUpload(data) {
|
|
4569
|
-
formData.favicon = String(data.ossId || "");
|
|
4570
|
-
}
|
|
4571
|
-
function handleBackgroundImageUpload(data) {
|
|
4572
|
-
formData.backgroundImage = String(data.ossId || "");
|
|
4573
|
-
}
|
|
4574
|
-
async function handleSave() {
|
|
4575
|
-
var _a, _b, _c, _d;
|
|
4576
|
-
loading.value = true;
|
|
4577
|
-
try {
|
|
4578
|
-
const changedKeys = fieldKeys.value.filter((key) => formData[key] !== originalData[key]);
|
|
4579
|
-
if (!changedKeys.length) {
|
|
4580
|
-
proxy == null ? void 0 : proxy.$modal.msg("未检测到变更");
|
|
4581
|
-
(_b = (_a = settingFormRef.value) == null ? void 0 : _a.exitEditMode) == null ? void 0 : _b.call(_a);
|
|
4582
|
-
return;
|
|
4583
|
-
}
|
|
4584
|
-
for (const key of changedKeys) {
|
|
4585
|
-
await updateConfigByKey(configKeyMap.value[key], formData[key]);
|
|
4586
|
-
originalData[key] = formData[key];
|
|
4587
|
-
}
|
|
4588
|
-
proxy == null ? void 0 : proxy.$modal.msgSuccess(`已保存 ${changedKeys.length} 项配置`);
|
|
4589
|
-
(_d = (_c = settingFormRef.value) == null ? void 0 : _c.exitEditMode) == null ? void 0 : _d.call(_c);
|
|
4590
|
-
await syncPreview();
|
|
4591
|
-
} catch (error) {
|
|
4592
|
-
console.error(`save ${props.category} website config failed`, error);
|
|
4593
|
-
proxy == null ? void 0 : proxy.$modal.msgError("保存失败");
|
|
4594
|
-
} finally {
|
|
4595
|
-
loading.value = false;
|
|
4596
|
-
}
|
|
4597
|
-
}
|
|
4598
|
-
function handleReset() {
|
|
4599
|
-
loadConfig();
|
|
4600
|
-
}
|
|
4601
|
-
function handleCancel() {
|
|
4602
|
-
}
|
|
4603
|
-
function handleResetToDefault() {
|
|
4604
|
-
proxy == null ? void 0 : proxy.$modal.confirm("确认恢复默认值吗?").then(() => {
|
|
4605
|
-
Object.assign(formData, defaultData);
|
|
4606
|
-
proxy == null ? void 0 : proxy.$modal.msgSuccess("已恢复默认值,保存后生效。");
|
|
4607
|
-
}).catch(() => {
|
|
4608
|
-
});
|
|
4609
|
-
}
|
|
4610
|
-
onMounted(() => {
|
|
4611
|
-
loadConfig();
|
|
4612
|
-
});
|
|
4613
|
-
return (_ctx, _cache) => {
|
|
4614
|
-
const _component_el_form_item = resolveComponent("el-form-item");
|
|
4615
|
-
const _component_el_input = resolveComponent("el-input");
|
|
4616
|
-
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
4617
|
-
createElementVNode("div", _hoisted_2$2, [
|
|
4618
|
-
createVNode(SettingForm, {
|
|
4619
|
-
ref_key: "settingFormRef",
|
|
4620
|
-
ref: settingFormRef,
|
|
4621
|
-
"default-data": defaultData,
|
|
4622
|
-
"form-data": formData,
|
|
4623
|
-
loading: loading.value,
|
|
4624
|
-
rules,
|
|
4625
|
-
title: `${_ctx.moduleLabel}网站配置`,
|
|
4626
|
-
onCancel: handleCancel,
|
|
4627
|
-
onReset: handleReset,
|
|
4628
|
-
onSave: handleSave,
|
|
4629
|
-
onResetDefault: handleResetToDefault
|
|
4630
|
-
}, {
|
|
4631
|
-
default: withCtx(({ isEditing }) => [
|
|
4632
|
-
createVNode(_component_el_form_item, {
|
|
4633
|
-
label: "系统 Logo",
|
|
4634
|
-
prop: "logo"
|
|
4635
|
-
}, {
|
|
4636
|
-
default: withCtx(() => [
|
|
4637
|
-
createVNode(ImageUpload, {
|
|
4638
|
-
modelValue: formData.logo,
|
|
4639
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.logo = $event),
|
|
4640
|
-
disabled: !isEditing,
|
|
4641
|
-
"file-size": 2,
|
|
4642
|
-
"file-type": ["png", "jpg", "jpeg", "svg"],
|
|
4643
|
-
limit: 1,
|
|
4644
|
-
onUploadSuccess: handleLogoUpload
|
|
4645
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
4646
|
-
]),
|
|
4647
|
-
_: 2
|
|
4648
|
-
}, 1024),
|
|
4649
|
-
createVNode(_component_el_form_item, {
|
|
4650
|
-
label: "系统图标",
|
|
4651
|
-
prop: "favicon"
|
|
4652
|
-
}, {
|
|
4653
|
-
default: withCtx(() => [
|
|
4654
|
-
createVNode(ImageUpload, {
|
|
4655
|
-
modelValue: formData.favicon,
|
|
4656
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formData.favicon = $event),
|
|
4657
|
-
disabled: !isEditing,
|
|
4658
|
-
"file-size": 2,
|
|
4659
|
-
"file-type": ["png", "jpg", "jpeg", "ico"],
|
|
4660
|
-
limit: 1,
|
|
4661
|
-
onUploadSuccess: handleFaviconUpload
|
|
4662
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
4663
|
-
]),
|
|
4664
|
-
_: 2
|
|
4665
|
-
}, 1024),
|
|
4666
|
-
createVNode(_component_el_form_item, {
|
|
4667
|
-
label: "背景图",
|
|
4668
|
-
prop: "backgroundImage"
|
|
4669
|
-
}, {
|
|
4670
|
-
default: withCtx(() => [
|
|
4671
|
-
createVNode(ImageUpload, {
|
|
4672
|
-
modelValue: formData.backgroundImage,
|
|
4673
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.backgroundImage = $event),
|
|
4674
|
-
disabled: !isEditing,
|
|
4675
|
-
"file-size": 5,
|
|
4676
|
-
"file-type": ["png", "jpg", "jpeg", "webp"],
|
|
4677
|
-
limit: 1,
|
|
4678
|
-
onUploadSuccess: handleBackgroundImageUpload
|
|
4679
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
4680
|
-
]),
|
|
4681
|
-
_: 2
|
|
4682
|
-
}, 1024),
|
|
4683
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(baseFields, (field) => {
|
|
4684
|
-
return createVNode(_component_el_form_item, {
|
|
4685
|
-
key: field.key,
|
|
4686
|
-
label: field.label,
|
|
4687
|
-
prop: field.key
|
|
4688
|
-
}, {
|
|
4689
|
-
default: withCtx(() => [
|
|
4690
|
-
createVNode(_component_el_input, {
|
|
4691
|
-
modelValue: formData[field.key],
|
|
4692
|
-
"onUpdate:modelValue": ($event) => formData[field.key] = $event,
|
|
4693
|
-
maxlength: field.maxlength,
|
|
4694
|
-
placeholder: field.placeholder,
|
|
4695
|
-
rows: field.rows,
|
|
4696
|
-
"show-word-limit": field.type === "textarea",
|
|
4697
|
-
type: field.type || "text",
|
|
4698
|
-
clearable: ""
|
|
4699
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "maxlength", "placeholder", "rows", "show-word-limit", "type"])
|
|
4700
|
-
]),
|
|
4701
|
-
_: 2
|
|
4702
|
-
}, 1032, ["label", "prop"]);
|
|
4703
|
-
}), 64))
|
|
4704
|
-
]),
|
|
4705
|
-
_: 1
|
|
4706
|
-
}, 8, ["default-data", "form-data", "loading", "title"])
|
|
4707
|
-
]),
|
|
4708
|
-
createElementVNode("div", _hoisted_3$2, [
|
|
4709
|
-
_cache[3] || (_cache[3] = createElementVNode("div", { class: "preview-title" }, "预览效果", -1)),
|
|
4710
|
-
createElementVNode("div", _hoisted_4$2, [
|
|
4711
|
-
createElementVNode("div", _hoisted_5$2, [
|
|
4712
|
-
logoUrl.value ? (openBlock(), createElementBlock("img", {
|
|
4713
|
-
key: 0,
|
|
4714
|
-
src: logoUrl.value,
|
|
4715
|
-
alt: "logo",
|
|
4716
|
-
class: "preview-logo"
|
|
4717
|
-
}, null, 8, _hoisted_6$1)) : (openBlock(), createElementBlock("span", _hoisted_7$1, "未上传 Logo"))
|
|
4718
|
-
]),
|
|
4719
|
-
createElementVNode("div", _hoisted_8, [
|
|
4720
|
-
createElementVNode("h2", _hoisted_9, toDisplayString(formData.name || `${_ctx.moduleLabel}名称`), 1),
|
|
4721
|
-
createElementVNode("p", _hoisted_10, toDisplayString(formData.description || `${_ctx.moduleLabel}描述`), 1),
|
|
4722
|
-
formData.copyright || formData.icp ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
4723
|
-
formData.copyright ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(formData.copyright), 1)) : createCommentVNode("", true),
|
|
4724
|
-
formData.icp ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(formData.icp), 1)) : createCommentVNode("", true)
|
|
4725
|
-
])) : createCommentVNode("", true)
|
|
4726
|
-
])
|
|
4727
|
-
])
|
|
4728
|
-
])
|
|
4729
|
-
]);
|
|
4730
|
-
};
|
|
4731
|
-
}
|
|
4732
|
-
});
|
|
4733
|
-
const ModuleWebsiteSettings = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d11a083d"]]);
|
|
4734
|
-
const _hoisted_1$1 = { class: "setting-tabs" };
|
|
4735
|
-
const _hoisted_2$1 = { class: "tabs-sidebar" };
|
|
4736
|
-
const _hoisted_3$1 = ["onClick"];
|
|
4737
|
-
const _hoisted_4$1 = { class: "tab-label" };
|
|
4738
|
-
const _hoisted_5$1 = { class: "tabs-content" };
|
|
4739
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3865
|
+
const SettingForm = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3296eadc"]]);
|
|
3866
|
+
const _hoisted_1 = { class: "setting-tabs" };
|
|
3867
|
+
const _hoisted_2 = { class: "tabs-sidebar" };
|
|
3868
|
+
const _hoisted_3 = ["onClick"];
|
|
3869
|
+
const _hoisted_4 = { class: "tab-label" };
|
|
3870
|
+
const _hoisted_5 = { class: "tabs-content" };
|
|
3871
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4740
3872
|
__name: "SettingTabs",
|
|
4741
3873
|
props: {
|
|
4742
3874
|
modelValue: {},
|
|
@@ -4750,8 +3882,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4750
3882
|
};
|
|
4751
3883
|
return (_ctx, _cache) => {
|
|
4752
3884
|
const _component_el_icon = resolveComponent("el-icon");
|
|
4753
|
-
return openBlock(), createElementBlock("div", _hoisted_1
|
|
4754
|
-
createElementVNode("div", _hoisted_2
|
|
3885
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
3886
|
+
createElementVNode("div", _hoisted_2, [
|
|
4755
3887
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tabs, (tab) => {
|
|
4756
3888
|
return openBlock(), createElementBlock("div", {
|
|
4757
3889
|
key: tab.name,
|
|
@@ -4764,286 +3896,34 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4764
3896
|
]),
|
|
4765
3897
|
_: 2
|
|
4766
3898
|
}, 1024),
|
|
4767
|
-
createElementVNode("span", _hoisted_4
|
|
4768
|
-
], 10, _hoisted_3
|
|
3899
|
+
createElementVNode("span", _hoisted_4, toDisplayString(tab.label), 1)
|
|
3900
|
+
], 10, _hoisted_3);
|
|
4769
3901
|
}), 128))
|
|
4770
3902
|
]),
|
|
4771
|
-
createElementVNode("div", _hoisted_5
|
|
3903
|
+
createElementVNode("div", _hoisted_5, [
|
|
4772
3904
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
4773
3905
|
])
|
|
4774
3906
|
]);
|
|
4775
3907
|
};
|
|
4776
3908
|
}
|
|
4777
3909
|
});
|
|
4778
|
-
const SettingTabs = /* @__PURE__ */ _export_sfc(_sfc_main
|
|
4779
|
-
function getUser(userId) {
|
|
4780
|
-
return request({
|
|
4781
|
-
url: "/system/user/" + (userId ?? ""),
|
|
4782
|
-
method: "get"
|
|
4783
|
-
});
|
|
4784
|
-
}
|
|
4785
|
-
const UNBOUND_CONTACT_VALUES = /* @__PURE__ */ new Set(["", "-1", "null", "undefined"]);
|
|
4786
|
-
function normalizeContactValue(value) {
|
|
4787
|
-
return `${value ?? ""}`.trim();
|
|
4788
|
-
}
|
|
4789
|
-
function isContactBound(value) {
|
|
4790
|
-
return !UNBOUND_CONTACT_VALUES.has(normalizeContactValue(value).toLowerCase());
|
|
4791
|
-
}
|
|
4792
|
-
function sanitizeContactValue(value) {
|
|
4793
|
-
return isContactBound(value) ? normalizeContactValue(value) : "";
|
|
4794
|
-
}
|
|
4795
|
-
function formatContactDisplay(value, fallback = "未绑定") {
|
|
4796
|
-
return sanitizeContactValue(value) || fallback;
|
|
4797
|
-
}
|
|
4798
|
-
const _hoisted_1 = { class: "user-detail-container" };
|
|
4799
|
-
const _hoisted_2 = {
|
|
4800
|
-
key: 1,
|
|
4801
|
-
class: "detail-content"
|
|
4802
|
-
};
|
|
4803
|
-
const _hoisted_3 = { class: "user-avatar" };
|
|
4804
|
-
const _hoisted_4 = { class: "user-info" };
|
|
4805
|
-
const _hoisted_5 = { key: 2 };
|
|
4806
|
-
const _hoisted_6 = {
|
|
4807
|
-
key: 0,
|
|
4808
|
-
class: "roles-container"
|
|
4809
|
-
};
|
|
4810
|
-
const _hoisted_7 = { key: 1 };
|
|
4811
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4812
|
-
__name: "UserDetail",
|
|
4813
|
-
props: {
|
|
4814
|
-
modelValue: { type: Boolean },
|
|
4815
|
-
userId: {}
|
|
4816
|
-
},
|
|
4817
|
-
emits: ["update:modelValue"],
|
|
4818
|
-
setup(__props, { emit: __emit }) {
|
|
4819
|
-
const props = __props;
|
|
4820
|
-
const emit = __emit;
|
|
4821
|
-
const visible = ref(false);
|
|
4822
|
-
const loading = ref(false);
|
|
4823
|
-
const userData = ref(null);
|
|
4824
|
-
watch(
|
|
4825
|
-
() => props.modelValue,
|
|
4826
|
-
(val) => {
|
|
4827
|
-
visible.value = val;
|
|
4828
|
-
if (val && props.userId) {
|
|
4829
|
-
loadUserDetail();
|
|
4830
|
-
}
|
|
4831
|
-
}
|
|
4832
|
-
);
|
|
4833
|
-
watch(visible, (val) => {
|
|
4834
|
-
emit("update:modelValue", val);
|
|
4835
|
-
});
|
|
4836
|
-
const loadUserDetail = async () => {
|
|
4837
|
-
if (!props.userId) return;
|
|
4838
|
-
loading.value = true;
|
|
4839
|
-
try {
|
|
4840
|
-
const res = await getUser(props.userId);
|
|
4841
|
-
if (res.code === 200) {
|
|
4842
|
-
userData.value = res.data.user;
|
|
4843
|
-
}
|
|
4844
|
-
} catch (error) {
|
|
4845
|
-
console.error("加载用户详情失败:", error);
|
|
4846
|
-
} finally {
|
|
4847
|
-
loading.value = false;
|
|
4848
|
-
}
|
|
4849
|
-
};
|
|
4850
|
-
const handleClose = () => {
|
|
4851
|
-
userData.value = null;
|
|
4852
|
-
};
|
|
4853
|
-
return (_ctx, _cache) => {
|
|
4854
|
-
const _component_el_empty = resolveComponent("el-empty");
|
|
4855
|
-
const _component_el_icon = resolveComponent("el-icon");
|
|
4856
|
-
const _component_el_avatar = resolveComponent("el-avatar");
|
|
4857
|
-
const _component_el_descriptions_item = resolveComponent("el-descriptions-item");
|
|
4858
|
-
const _component_el_tag = resolveComponent("el-tag");
|
|
4859
|
-
const _component_el_descriptions = resolveComponent("el-descriptions");
|
|
4860
|
-
const _component_el_dialog = resolveComponent("el-dialog");
|
|
4861
|
-
const _directive_loading = resolveDirective("loading");
|
|
4862
|
-
return openBlock(), createBlock(_component_el_dialog, {
|
|
4863
|
-
modelValue: visible.value,
|
|
4864
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
4865
|
-
title: "用户详情",
|
|
4866
|
-
width: "600px",
|
|
4867
|
-
onClose: handleClose
|
|
4868
|
-
}, {
|
|
4869
|
-
default: withCtx(() => [
|
|
4870
|
-
withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
4871
|
-
!userData.value ? (openBlock(), createBlock(_component_el_empty, {
|
|
4872
|
-
key: 0,
|
|
4873
|
-
description: "用户不存在"
|
|
4874
|
-
})) : (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
4875
|
-
createElementVNode("div", _hoisted_3, [
|
|
4876
|
-
createVNode(_component_el_avatar, {
|
|
4877
|
-
size: 80,
|
|
4878
|
-
src: userData.value.avatar
|
|
4879
|
-
}, {
|
|
4880
|
-
default: withCtx(() => [
|
|
4881
|
-
createVNode(_component_el_icon, { size: 40 }, {
|
|
4882
|
-
default: withCtx(() => [
|
|
4883
|
-
createVNode(unref(User))
|
|
4884
|
-
]),
|
|
4885
|
-
_: 1
|
|
4886
|
-
})
|
|
4887
|
-
]),
|
|
4888
|
-
_: 1
|
|
4889
|
-
}, 8, ["src"])
|
|
4890
|
-
]),
|
|
4891
|
-
createElementVNode("div", _hoisted_4, [
|
|
4892
|
-
createVNode(_component_el_descriptions, {
|
|
4893
|
-
column: 1,
|
|
4894
|
-
border: ""
|
|
4895
|
-
}, {
|
|
4896
|
-
default: withCtx(() => [
|
|
4897
|
-
createVNode(_component_el_descriptions_item, { label: "用户ID" }, {
|
|
4898
|
-
default: withCtx(() => [
|
|
4899
|
-
createTextVNode(toDisplayString(userData.value.userId), 1)
|
|
4900
|
-
]),
|
|
4901
|
-
_: 1
|
|
4902
|
-
}),
|
|
4903
|
-
createVNode(_component_el_descriptions_item, { label: "用户名" }, {
|
|
4904
|
-
default: withCtx(() => [
|
|
4905
|
-
createTextVNode(toDisplayString(userData.value.userName || "-"), 1)
|
|
4906
|
-
]),
|
|
4907
|
-
_: 1
|
|
4908
|
-
}),
|
|
4909
|
-
createVNode(_component_el_descriptions_item, { label: "昵称" }, {
|
|
4910
|
-
default: withCtx(() => [
|
|
4911
|
-
createTextVNode(toDisplayString(userData.value.nickName || "-"), 1)
|
|
4912
|
-
]),
|
|
4913
|
-
_: 1
|
|
4914
|
-
}),
|
|
4915
|
-
createVNode(_component_el_descriptions_item, { label: "邮箱" }, {
|
|
4916
|
-
default: withCtx(() => [
|
|
4917
|
-
createTextVNode(toDisplayString(unref(formatContactDisplay)(userData.value.email)), 1)
|
|
4918
|
-
]),
|
|
4919
|
-
_: 1
|
|
4920
|
-
}),
|
|
4921
|
-
createVNode(_component_el_descriptions_item, { label: "手机号" }, {
|
|
4922
|
-
default: withCtx(() => [
|
|
4923
|
-
createTextVNode(toDisplayString(unref(formatContactDisplay)(userData.value.phonenumber)), 1)
|
|
4924
|
-
]),
|
|
4925
|
-
_: 1
|
|
4926
|
-
}),
|
|
4927
|
-
createVNode(_component_el_descriptions_item, { label: "性别" }, {
|
|
4928
|
-
default: withCtx(() => [
|
|
4929
|
-
userData.value.sex === "0" ? (openBlock(), createBlock(_component_el_tag, {
|
|
4930
|
-
key: 0,
|
|
4931
|
-
size: "small",
|
|
4932
|
-
type: "info"
|
|
4933
|
-
}, {
|
|
4934
|
-
default: withCtx(() => _cache[1] || (_cache[1] = [
|
|
4935
|
-
createTextVNode("男")
|
|
4936
|
-
])),
|
|
4937
|
-
_: 1
|
|
4938
|
-
})) : userData.value.sex === "1" ? (openBlock(), createBlock(_component_el_tag, {
|
|
4939
|
-
key: 1,
|
|
4940
|
-
size: "small",
|
|
4941
|
-
type: "warning"
|
|
4942
|
-
}, {
|
|
4943
|
-
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
4944
|
-
createTextVNode("女")
|
|
4945
|
-
])),
|
|
4946
|
-
_: 1
|
|
4947
|
-
})) : (openBlock(), createElementBlock("span", _hoisted_5, "-"))
|
|
4948
|
-
]),
|
|
4949
|
-
_: 1
|
|
4950
|
-
}),
|
|
4951
|
-
createVNode(_component_el_descriptions_item, { label: "部门" }, {
|
|
4952
|
-
default: withCtx(() => {
|
|
4953
|
-
var _a;
|
|
4954
|
-
return [
|
|
4955
|
-
createTextVNode(toDisplayString(((_a = userData.value.dept) == null ? void 0 : _a.deptName) || "-"), 1)
|
|
4956
|
-
];
|
|
4957
|
-
}),
|
|
4958
|
-
_: 1
|
|
4959
|
-
}),
|
|
4960
|
-
createVNode(_component_el_descriptions_item, { label: "角色" }, {
|
|
4961
|
-
default: withCtx(() => [
|
|
4962
|
-
userData.value.roles && userData.value.roles.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
4963
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(userData.value.roles, (role) => {
|
|
4964
|
-
return openBlock(), createBlock(_component_el_tag, {
|
|
4965
|
-
key: role.roleId,
|
|
4966
|
-
class: "mr-1",
|
|
4967
|
-
size: "small",
|
|
4968
|
-
type: "success"
|
|
4969
|
-
}, {
|
|
4970
|
-
default: withCtx(() => [
|
|
4971
|
-
createTextVNode(toDisplayString(role.roleName), 1)
|
|
4972
|
-
]),
|
|
4973
|
-
_: 2
|
|
4974
|
-
}, 1024);
|
|
4975
|
-
}), 128))
|
|
4976
|
-
])) : (openBlock(), createElementBlock("span", _hoisted_7, "-"))
|
|
4977
|
-
]),
|
|
4978
|
-
_: 1
|
|
4979
|
-
}),
|
|
4980
|
-
createVNode(_component_el_descriptions_item, { label: "状态" }, {
|
|
4981
|
-
default: withCtx(() => [
|
|
4982
|
-
createVNode(_component_el_tag, {
|
|
4983
|
-
type: userData.value.status === "0" ? "success" : "danger",
|
|
4984
|
-
size: "small"
|
|
4985
|
-
}, {
|
|
4986
|
-
default: withCtx(() => [
|
|
4987
|
-
createTextVNode(toDisplayString(userData.value.status === "0" ? "正常" : "停用"), 1)
|
|
4988
|
-
]),
|
|
4989
|
-
_: 1
|
|
4990
|
-
}, 8, ["type"])
|
|
4991
|
-
]),
|
|
4992
|
-
_: 1
|
|
4993
|
-
}),
|
|
4994
|
-
createVNode(_component_el_descriptions_item, { label: "创建时间" }, {
|
|
4995
|
-
default: withCtx(() => [
|
|
4996
|
-
createTextVNode(toDisplayString(userData.value.createTime || "-"), 1)
|
|
4997
|
-
]),
|
|
4998
|
-
_: 1
|
|
4999
|
-
}),
|
|
5000
|
-
createVNode(_component_el_descriptions_item, { label: "最后登录时间" }, {
|
|
5001
|
-
default: withCtx(() => [
|
|
5002
|
-
createTextVNode(toDisplayString(userData.value.loginDate || "-"), 1)
|
|
5003
|
-
]),
|
|
5004
|
-
_: 1
|
|
5005
|
-
}),
|
|
5006
|
-
createVNode(_component_el_descriptions_item, { label: "最后登录IP" }, {
|
|
5007
|
-
default: withCtx(() => [
|
|
5008
|
-
createTextVNode(toDisplayString(userData.value.loginIp || "-"), 1)
|
|
5009
|
-
]),
|
|
5010
|
-
_: 1
|
|
5011
|
-
}),
|
|
5012
|
-
createVNode(_component_el_descriptions_item, { label: "登录地点" }, {
|
|
5013
|
-
default: withCtx(() => [
|
|
5014
|
-
createTextVNode(toDisplayString(userData.value.loginLocation || "-"), 1)
|
|
5015
|
-
]),
|
|
5016
|
-
_: 1
|
|
5017
|
-
})
|
|
5018
|
-
]),
|
|
5019
|
-
_: 1
|
|
5020
|
-
})
|
|
5021
|
-
])
|
|
5022
|
-
]))
|
|
5023
|
-
])), [
|
|
5024
|
-
[_directive_loading, loading.value]
|
|
5025
|
-
])
|
|
5026
|
-
]),
|
|
5027
|
-
_: 1
|
|
5028
|
-
}, 8, ["modelValue"]);
|
|
5029
|
-
};
|
|
5030
|
-
}
|
|
5031
|
-
});
|
|
5032
|
-
const UserDetail = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c0cb0304"]]);
|
|
3910
|
+
const SettingTabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-97bf5366"]]);
|
|
5033
3911
|
export {
|
|
5034
3912
|
ImagePreview,
|
|
5035
|
-
ImageUpload,
|
|
5036
3913
|
KCard,
|
|
3914
|
+
KCustomTabs,
|
|
5037
3915
|
KDictTag,
|
|
3916
|
+
KIpSegmentInput,
|
|
5038
3917
|
_sfc_main$9 as KPlainButton,
|
|
5039
3918
|
KSearchBar,
|
|
3919
|
+
KSectionTitle,
|
|
3920
|
+
KSegmented,
|
|
5040
3921
|
KSelectedAlert,
|
|
3922
|
+
KSpin,
|
|
5041
3923
|
KTable,
|
|
5042
3924
|
KTableHeader,
|
|
5043
|
-
|
|
5044
|
-
ModuleWebsiteSettings,
|
|
3925
|
+
SettingForm,
|
|
5045
3926
|
SettingTabs,
|
|
5046
|
-
UserDetail,
|
|
5047
3927
|
WUJIES_COMPONENT_NAMES
|
|
5048
3928
|
};
|
|
5049
3929
|
//# sourceMappingURL=index.js.map
|