init
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { Ref, ComputedRef } from "vue";
|
||||
export declare const LevelInjectionKey: unique symbol;
|
||||
export declare function provideLevel(level: Ref<number> | number): void;
|
||||
export default function useLevel(props?: {
|
||||
provideNextLevel?: boolean;
|
||||
}): {
|
||||
level: ComputedRef<number>;
|
||||
};
|
||||
@@ -0,0 +1,232 @@
|
||||
import { w as withInstall } from "../badge/index2.js";
|
||||
import { openBlock, createElementBlock, createElementVNode, defineComponent, useSlots, ref, computed, watch, normalizeClass, unref, renderSlot, createCommentVNode, createBlock, createVNode, withModifiers } from "vue";
|
||||
import { _ as _sfc_main$2E } from "../checkbox/index2.js";
|
||||
import { _ as _export_sfc } from "../dropdownMenu/index2.js";
|
||||
var index = /* @__PURE__ */ (() => ":root{--input-border-radius: var(--global-border-radius);--input-border-color: var(--global-neutral-color-3)}.layui-input{width:100%;height:38px;line-height:38px;border-width:1px;border-style:solid;border-color:var(--input-border-color);border-radius:var(--input-border-radius);display:inline-flex}.layui-input input{height:38px;line-height:38px;background-color:#fff;color:#000000d9;padding-left:10px;display:inline-block;border:none;height:100%;width:100%}.layui-input-append{background-color:#fafafa;border-left:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-prepend{background-color:#fafafa;border-right:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-wrapper{width:100%;display:inline-flex;border:none}.layui-input:hover,.layui-input:focus-within{border-color:#d2d2d2}.layui-input-clear,.layui-input-prefix,.layui-input-suffix,.layui-input-password{background-color:#fff}.layui-input-clear,.layui-input-password,.layui-input-prefix,.layui-input-suffix{display:flex;flex:none;align-items:center;padding:0 10px}.layui-input-has-prefix input{padding:0}.layui-input-clear,.layui-input-password{color:#00000073}.layui-input-clear:hover{opacity:.6}.layui-input input::-webkit-input-placeholder{line-height:1.3}.layui-input input::-ms-reveal{display:none}.layui-input-disabled{border-color:var(--input-border-color)!important}.layui-input-disabled{opacity:.6}.layui-input-disabled,.layui-input-disabled *{cursor:not-allowed!important}.layui-input[size=lg]{height:44px}.layui-input[size=lg] .layui-input{height:44px;line-height:44px}.layui-input[size=md]{height:38px}.layui-input[size=md] .layui-input{height:38px;line-height:38px}.layui-input[size=sm]{height:32px}.layui-input[size=sm] .layui-input{height:32px;line-height:32px}.layui-input[size=xs]{height:26px}.layui-input[size=xs] .layui-input{height:26px;line-height:26px}\n")();
|
||||
const _sfc_main$2 = {};
|
||||
const _hoisted_1$2 = {
|
||||
focusable: "false",
|
||||
class: "",
|
||||
"data-icon": "eye-invisible",
|
||||
width: "1em",
|
||||
height: "1em",
|
||||
fill: "currentColor",
|
||||
"aria-hidden": "true",
|
||||
viewBox: "64 64 896 896"
|
||||
};
|
||||
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("path", { d: "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" }, null, -1);
|
||||
const _hoisted_3$2 = /* @__PURE__ */ createElementVNode("path", { d: "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" }, null, -1);
|
||||
const _hoisted_4$1 = [
|
||||
_hoisted_2$2,
|
||||
_hoisted_3$2
|
||||
];
|
||||
function _sfc_render$1(_ctx, _cache) {
|
||||
return openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_4$1);
|
||||
}
|
||||
var PasswordIcon = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1]]);
|
||||
const _sfc_main$1 = {};
|
||||
const _hoisted_1$1 = {
|
||||
focusable: "false",
|
||||
class: "",
|
||||
"data-icon": "eye",
|
||||
width: "1em",
|
||||
height: "1em",
|
||||
fill: "currentColor",
|
||||
"aria-hidden": "true",
|
||||
viewBox: "64 64 896 896"
|
||||
};
|
||||
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("path", { d: "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" }, null, -1);
|
||||
const _hoisted_3$1 = [
|
||||
_hoisted_2$1
|
||||
];
|
||||
function _sfc_render(_ctx, _cache) {
|
||||
return openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1);
|
||||
}
|
||||
var UnPasswordIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
|
||||
const _hoisted_1 = ["size"];
|
||||
const _hoisted_2 = {
|
||||
key: 0,
|
||||
class: "layui-input-prepend"
|
||||
};
|
||||
const _hoisted_3 = { class: "layui-input-wrapper" };
|
||||
const _hoisted_4 = {
|
||||
key: 0,
|
||||
class: "layui-input-prefix"
|
||||
};
|
||||
const _hoisted_5 = ["type", "name", "disabled", "placeholder", "autofocus", "autocomplete", "maxlength", "max", "min", "readonly", "value"];
|
||||
const _hoisted_6 = {
|
||||
key: 2,
|
||||
class: "layui-input-clear"
|
||||
};
|
||||
const _hoisted_7 = {
|
||||
key: 3,
|
||||
class: "layui-input-suffix"
|
||||
};
|
||||
const _hoisted_8 = {
|
||||
key: 1,
|
||||
class: "layui-input-append"
|
||||
};
|
||||
const __default__ = {
|
||||
name: "LayInput"
|
||||
};
|
||||
const _sfc_main = defineComponent({
|
||||
...__default__,
|
||||
props: {
|
||||
name: null,
|
||||
type: null,
|
||||
prefixIcon: null,
|
||||
suffixIcon: null,
|
||||
modelValue: { default: "" },
|
||||
allowClear: { type: Boolean, default: false },
|
||||
autocomplete: null,
|
||||
placeholder: null,
|
||||
autofocus: { type: Boolean, default: false },
|
||||
disabled: { type: Boolean, default: false },
|
||||
readonly: { type: Boolean, default: false },
|
||||
password: { type: Boolean, default: false },
|
||||
size: { default: "md" },
|
||||
maxlength: null,
|
||||
max: null,
|
||||
min: null
|
||||
},
|
||||
emits: ["blur", "input", "update:modelValue", "change", "focus", "clear"],
|
||||
setup(__props, { emit }) {
|
||||
const props = __props;
|
||||
const slots = useSlots();
|
||||
const type = ref(props.type);
|
||||
const currentValue = ref(String(props.modelValue == null ? "" : props.modelValue));
|
||||
const hasContent = computed(() => {
|
||||
var _a;
|
||||
return ((_a = props.modelValue) == null ? void 0 : _a.length) > 0;
|
||||
});
|
||||
const isPassword = computed(() => type.value == "password");
|
||||
const composing = ref(false);
|
||||
watch(() => props.type, () => {
|
||||
type.value = props.type;
|
||||
});
|
||||
watch(() => props.modelValue, () => {
|
||||
currentValue.value = String(props.modelValue == null ? "" : props.modelValue);
|
||||
});
|
||||
const onInput = function(event) {
|
||||
const inputElement = event.target;
|
||||
const value = inputElement.value;
|
||||
emit("input", value);
|
||||
if (composing.value)
|
||||
return;
|
||||
emit("update:modelValue", value);
|
||||
};
|
||||
const onClear = () => {
|
||||
emit("update:modelValue", "");
|
||||
emit("clear");
|
||||
};
|
||||
const onFocus = (event) => {
|
||||
emit("focus", event);
|
||||
};
|
||||
const onChange = (event) => {
|
||||
const inputElement = event.target;
|
||||
const value = inputElement.value;
|
||||
emit("change", value);
|
||||
};
|
||||
const onBlur = (event) => {
|
||||
if (props.type === "number") {
|
||||
onNumberBlur(event);
|
||||
}
|
||||
emit("blur", event);
|
||||
};
|
||||
const onNumberBlur = (event) => {
|
||||
let value = event.target.value;
|
||||
if (value === "") {
|
||||
value = props.min ? String(props.min) : "0";
|
||||
} else {
|
||||
if (props.max && props.max < Number(value))
|
||||
value = props.max.toString();
|
||||
if (props.min && props.min > Number(value))
|
||||
value = props.min.toString();
|
||||
}
|
||||
emit("update:modelValue", value);
|
||||
};
|
||||
const onCompositionstart = () => {
|
||||
composing.value = true;
|
||||
};
|
||||
const onCompositionend = (event) => {
|
||||
composing.value = false;
|
||||
onInput(event);
|
||||
};
|
||||
const classes = computed(() => {
|
||||
return {
|
||||
"layui-input-disabled": props.disabled,
|
||||
"layui-input-has-prefix": slots.prefix || props.prefixIcon
|
||||
};
|
||||
});
|
||||
const showPassword = () => {
|
||||
if (isPassword.value) {
|
||||
type.value = "text";
|
||||
} else {
|
||||
type.value = "password";
|
||||
}
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("div", {
|
||||
class: normalizeClass(["layui-input", unref(classes)]),
|
||||
size: __props.size
|
||||
}, [
|
||||
unref(slots).prepend ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
||||
renderSlot(_ctx.$slots, "prepend")
|
||||
])) : createCommentVNode("", true),
|
||||
createElementVNode("div", _hoisted_3, [
|
||||
unref(slots).prefix || props.prefixIcon ? (openBlock(), createElementBlock("span", _hoisted_4, [
|
||||
unref(slots).prefix ? renderSlot(_ctx.$slots, "prefix", { key: 0 }) : (openBlock(), createBlock(unref(_sfc_main$2E), {
|
||||
key: 1,
|
||||
type: props.prefixIcon,
|
||||
class: "layui-input-prefix-icon"
|
||||
}, null, 8, ["type"]))
|
||||
])) : createCommentVNode("", true),
|
||||
createElementVNode("input", {
|
||||
type: type.value,
|
||||
name: __props.name,
|
||||
disabled: __props.disabled,
|
||||
placeholder: __props.placeholder,
|
||||
autofocus: __props.autofocus,
|
||||
autocomplete: __props.autocomplete,
|
||||
maxlength: __props.maxlength,
|
||||
max: __props.max,
|
||||
min: __props.min,
|
||||
readonly: __props.readonly,
|
||||
value: currentValue.value,
|
||||
onInput,
|
||||
onChange,
|
||||
onFocus,
|
||||
onBlur,
|
||||
onCompositionstart,
|
||||
onCompositionend
|
||||
}, null, 40, _hoisted_5),
|
||||
__props.password && unref(hasContent) ? (openBlock(), createElementBlock("span", {
|
||||
key: 1,
|
||||
class: "layui-input-password",
|
||||
onClick: showPassword
|
||||
}, [
|
||||
unref(isPassword) ? (openBlock(), createBlock(PasswordIcon, { key: 0 })) : (openBlock(), createBlock(UnPasswordIcon, { key: 1 }))
|
||||
])) : createCommentVNode("", true),
|
||||
__props.allowClear && unref(hasContent) && !__props.disabled ? (openBlock(), createElementBlock("span", _hoisted_6, [
|
||||
createVNode(unref(_sfc_main$2E), {
|
||||
type: "layui-icon-close-fill",
|
||||
onClick: withModifiers(onClear, ["stop"])
|
||||
}, null, 8, ["onClick"])
|
||||
])) : createCommentVNode("", true),
|
||||
unref(slots).suffix || props.suffixIcon ? (openBlock(), createElementBlock("span", _hoisted_7, [
|
||||
unref(slots).suffix ? renderSlot(_ctx.$slots, "suffix", { key: 0 }) : (openBlock(), createBlock(unref(_sfc_main$2E), {
|
||||
key: 1,
|
||||
type: props.suffixIcon,
|
||||
class: "layui-input-suffix-icon"
|
||||
}, null, 8, ["type"]))
|
||||
])) : createCommentVNode("", true)
|
||||
]),
|
||||
unref(slots).append ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
||||
renderSlot(_ctx.$slots, "append")
|
||||
])) : createCommentVNode("", true)
|
||||
], 10, _hoisted_1);
|
||||
};
|
||||
}
|
||||
});
|
||||
const component = withInstall(_sfc_main);
|
||||
export { _sfc_main as _, component as c };
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,34 @@
|
||||
export function getNode(root: any, id: string) {
|
||||
let resultNode = null;
|
||||
findNode(root, id);
|
||||
function findNode(root: any, id: string) {
|
||||
if (!!root) {
|
||||
let type = Object.prototype.toString.call(root);
|
||||
if (type === "[object Object]") {
|
||||
if (root.id && root.id === id) {
|
||||
resultNode = root;
|
||||
} else {
|
||||
let node = root.children || null;
|
||||
findNode(node, id);
|
||||
}
|
||||
} else if (type === "[object Array]") {
|
||||
let needNode = root.find((i: any) => !!i === true && i.id === id);
|
||||
if (!!needNode) {
|
||||
resultNode = needNode;
|
||||
} else {
|
||||
if (root.length) {
|
||||
root.forEach((item: any) => {
|
||||
if (item && item.children) {
|
||||
let node = item.children;
|
||||
if (node && node.length) {
|
||||
findNode(node, id);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultNode;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "ReadIcon",
|
||||
};
|
||||
</script>
|
||||
<script setup lang="ts">
|
||||
import LayIcon from "../component/icon/index";
|
||||
|
||||
const props = defineProps<{
|
||||
color?: string;
|
||||
size?: string;
|
||||
}>();
|
||||
</script>
|
||||
<template>
|
||||
<lay-icon :color="props.color" :size="props.size" type="layui-icon-read" />
|
||||
</template>
|
||||
@@ -0,0 +1,212 @@
|
||||
import { w as withInstall } from "../badge/index2.js";
|
||||
import { defineComponent, useSlots, ref, computed, watch, openBlock, createElementBlock, toDisplayString, unref, createCommentVNode, createElementVNode, normalizeClass, renderSlot, Fragment, createTextVNode, renderList, withDirectives, vModelSelect, withKeys, vModelText } from "vue";
|
||||
import { u as useI18n } from "../datePicker/index2.js";
|
||||
var index = /* @__PURE__ */ (() => ".layui-laypage{display:inline-block;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid var(--global-neutral-color-3)}.layui-laypage a,.layui-laypage span{display:inline-block;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-laypage a:hover{color:var(--global-primary-color)}.layui-laypage-a-red:hover{color:#ff5722!important}.layui-laypage-a-orange:hover{color:#ffb800!important}.layui-laypage-a-green:hover{color:#009688!important}.layui-laypage-a-cyan:hover{color:#2f4056!important}.layui-laypage-a-blue:hover{color:#01aaed!important}.layui-laypage-a-black:hover{color:#000!important}.layui-laypage-a-gray:hover{color:#c2c2c2!important}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:var(--global-primary-color)}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.layui-laypage select{height:22px;padding:3px;margin-top:4px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{display:inline-block;width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input::-webkit-outer-spin-button,.layui-laypage input::-webkit-inner-spin-button{-webkit-appearance:none}.layui-laypage input:focus,.layui-laypage select:focus{border-color:var(--global-primary-color)!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer}\n")();
|
||||
const _hoisted_1 = { class: "layui-laypage layui-laypage-default" };
|
||||
const _hoisted_2 = {
|
||||
key: 0,
|
||||
class: "layui-laypage-count"
|
||||
};
|
||||
const _hoisted_3 = {
|
||||
key: 0,
|
||||
class: "layui-laypage-curr"
|
||||
};
|
||||
const _hoisted_4 = ["onClick"];
|
||||
const _hoisted_5 = {
|
||||
key: 2,
|
||||
class: "layui-laypage-limits"
|
||||
};
|
||||
const _hoisted_6 = ["value"];
|
||||
const _hoisted_7 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-refresh" }, null, -1);
|
||||
const _hoisted_8 = [
|
||||
_hoisted_7
|
||||
];
|
||||
const _hoisted_9 = {
|
||||
key: 4,
|
||||
class: "layui-laypage-skip"
|
||||
};
|
||||
const _hoisted_10 = ["disabled"];
|
||||
const _hoisted_11 = { key: 5 };
|
||||
const __default__ = {
|
||||
name: "LayPage"
|
||||
};
|
||||
const _sfc_main = defineComponent({
|
||||
...__default__,
|
||||
props: {
|
||||
total: null,
|
||||
limit: { default: 10 },
|
||||
theme: { default: "green" },
|
||||
showPage: { type: Boolean, default: false },
|
||||
showSkip: { type: Boolean, default: false },
|
||||
showCount: { type: Boolean, default: false },
|
||||
showLimit: { type: Boolean, default: true },
|
||||
showInput: { type: Boolean, default: false },
|
||||
showRefresh: { type: Boolean, default: false },
|
||||
pages: { default: 10 },
|
||||
limits: { default: () => [10, 20, 30, 40, 50] },
|
||||
modelValue: { default: 1 },
|
||||
count: null
|
||||
},
|
||||
emits: ["update:modelValue", "update:limit", "change"],
|
||||
setup(__props, { emit }) {
|
||||
const props = __props;
|
||||
const { t } = useI18n();
|
||||
const slots = useSlots();
|
||||
const maxPage = ref(0);
|
||||
const limits = ref(props.limits);
|
||||
const pages = computed(() => Math.floor(props.pages / 2));
|
||||
const currentPage = ref(props.modelValue);
|
||||
const currentPageShow = ref(currentPage.value);
|
||||
const inlimit = ref(props.limit);
|
||||
watch(() => props.limit, () => {
|
||||
inlimit.value = props.limit;
|
||||
});
|
||||
const totalPage = computed(() => {
|
||||
maxPage.value = Math.ceil(props.total / inlimit.value);
|
||||
let r = [];
|
||||
let start = maxPage.value <= props.pages ? 1 : currentPage.value > pages.value ? maxPage.value - currentPage.value + 1 < pages.value ? currentPage.value - (pages.value + (pages.value - (maxPage.value - currentPage.value + 1))) : currentPage.value - pages.value : 1;
|
||||
for (let i = start; ; i++) {
|
||||
if (r.length >= props.pages || i > maxPage.value) {
|
||||
break;
|
||||
}
|
||||
r.push(i);
|
||||
}
|
||||
return r;
|
||||
});
|
||||
const prev = () => {
|
||||
if (currentPage.value === 1) {
|
||||
return;
|
||||
}
|
||||
currentPage.value--;
|
||||
emit("change", { current: currentPage.value, limit: inlimit.value });
|
||||
};
|
||||
const next = () => {
|
||||
if (currentPage.value === maxPage.value || maxPage.value === 0) {
|
||||
return;
|
||||
}
|
||||
currentPage.value++;
|
||||
emit("change", { current: currentPage.value, limit: inlimit.value });
|
||||
};
|
||||
const jump = (page) => {
|
||||
currentPage.value = page;
|
||||
emit("change", { current: currentPage.value, limit: inlimit.value });
|
||||
};
|
||||
const jumpPage = () => {
|
||||
currentPage.value = currentPageShow.value;
|
||||
emit("change", { current: currentPage.value, limit: inlimit.value });
|
||||
};
|
||||
const changelimit = () => {
|
||||
const maxPage2 = Math.ceil(props.total / inlimit.value);
|
||||
if (currentPage.value > maxPage2) {
|
||||
currentPage.value = maxPage2;
|
||||
}
|
||||
emit("change", { current: currentPage.value, limit: inlimit.value });
|
||||
};
|
||||
const refresh = () => {
|
||||
emit("change", { current: currentPage.value, limit: inlimit.value });
|
||||
};
|
||||
watch(inlimit, () => {
|
||||
emit("update:limit", inlimit.value);
|
||||
});
|
||||
watch(currentPage, () => {
|
||||
const min = totalPage.value[0];
|
||||
const max = totalPage.value[totalPage.value.length - 1];
|
||||
if (currentPage.value > max)
|
||||
currentPage.value = max;
|
||||
if (currentPage.value < min)
|
||||
currentPage.value = min;
|
||||
currentPageShow.value = currentPage.value;
|
||||
emit("update:modelValue", currentPage.value);
|
||||
});
|
||||
watch(() => props.modelValue, () => {
|
||||
currentPage.value = props.modelValue;
|
||||
currentPageShow.value = currentPage.value;
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("div", _hoisted_1, [
|
||||
__props.showCount ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(t)("page.total")) + " " + toDisplayString(__props.total) + " " + toDisplayString(unref(t)("page.item")) + " " + toDisplayString(maxPage.value) + " " + toDisplayString(unref(t)("page.page")), 1)) : createCommentVNode("", true),
|
||||
createElementVNode("a", {
|
||||
href: "javascript:;",
|
||||
class: normalizeClass(["layui-laypage-prev", [
|
||||
currentPage.value === 1 ? "layui-disabled" : "",
|
||||
__props.theme && currentPage.value !== 1 ? "layui-laypage-a-" + __props.theme : ""
|
||||
]]),
|
||||
onClick: _cache[0] || (_cache[0] = ($event) => prev())
|
||||
}, [
|
||||
unref(slots).prev ? renderSlot(_ctx.$slots, "prev", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
||||
createTextVNode(toDisplayString(unref(t)("page.previous")), 1)
|
||||
], 64))
|
||||
], 2),
|
||||
__props.showPage ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(totalPage), (index2) => {
|
||||
return openBlock(), createElementBlock(Fragment, { key: index2 }, [
|
||||
index2 === currentPage.value ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
||||
createElementVNode("em", {
|
||||
class: normalizeClass(["layui-laypage-em", [__props.theme ? "layui-bg-" + __props.theme : ""]])
|
||||
}, null, 2),
|
||||
createElementVNode("em", null, toDisplayString(index2), 1)
|
||||
])) : (openBlock(), createElementBlock("a", {
|
||||
key: 1,
|
||||
href: "javascript:;",
|
||||
onClick: ($event) => jump(index2),
|
||||
class: normalizeClass([__props.theme ? "layui-laypage-a-" + __props.theme : ""])
|
||||
}, toDisplayString(index2), 11, _hoisted_4))
|
||||
], 64);
|
||||
}), 128)) : createCommentVNode("", true),
|
||||
createElementVNode("a", {
|
||||
href: "javascript:;",
|
||||
class: normalizeClass(["layui-laypage-next", [
|
||||
currentPage.value === maxPage.value || maxPage.value === 0 ? "layui-disabled" : "",
|
||||
__props.theme && currentPage.value !== maxPage.value && maxPage.value !== 0 ? "layui-laypage-a-" + __props.theme : ""
|
||||
]]),
|
||||
onClick: _cache[1] || (_cache[1] = ($event) => next())
|
||||
}, [
|
||||
unref(slots).next ? renderSlot(_ctx.$slots, "next", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
||||
createTextVNode(toDisplayString(unref(t)("page.next")), 1)
|
||||
], 64))
|
||||
], 2),
|
||||
__props.showLimit ? (openBlock(), createElementBlock("span", _hoisted_5, [
|
||||
withDirectives(createElementVNode("select", {
|
||||
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => inlimit.value = $event),
|
||||
onChange: changelimit
|
||||
}, [
|
||||
(openBlock(true), createElementBlock(Fragment, null, renderList(limits.value, (val) => {
|
||||
return openBlock(), createElementBlock("option", {
|
||||
key: val,
|
||||
value: val
|
||||
}, toDisplayString(val) + " " + toDisplayString(unref(t)("page.item")) + "/" + toDisplayString(unref(t)("page.page")), 9, _hoisted_6);
|
||||
}), 128))
|
||||
], 544), [
|
||||
[vModelSelect, inlimit.value]
|
||||
])
|
||||
])) : createCommentVNode("", true),
|
||||
__props.showRefresh ? (openBlock(), createElementBlock("a", {
|
||||
key: 3,
|
||||
href: "javascript:;",
|
||||
onClick: refresh,
|
||||
class: "layui-laypage-refresh"
|
||||
}, _hoisted_8)) : createCommentVNode("", true),
|
||||
props.showSkip ? (openBlock(), createElementBlock("span", _hoisted_9, [
|
||||
createTextVNode(toDisplayString(unref(t)("page.goTo")) + " ", 1),
|
||||
withDirectives(createElementVNode("input", {
|
||||
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => currentPageShow.value = $event),
|
||||
onKeypress: _cache[4] || (_cache[4] = withKeys(($event) => jumpPage(), ["enter"])),
|
||||
type: "number",
|
||||
class: "layui-input layui-input-number"
|
||||
}, null, 544), [
|
||||
[vModelText, currentPageShow.value]
|
||||
]),
|
||||
createTextVNode(toDisplayString(unref(t)("page.page")) + " ", 1),
|
||||
createElementVNode("button", {
|
||||
type: "button",
|
||||
class: "layui-laypage-btn",
|
||||
onClick: _cache[5] || (_cache[5] = ($event) => jumpPage()),
|
||||
disabled: currentPageShow.value > maxPage.value || currentPageShow.value == currentPage.value
|
||||
}, toDisplayString(unref(t)("page.confirm")), 9, _hoisted_10)
|
||||
])) : createCommentVNode("", true),
|
||||
__props.count ? (openBlock(), createElementBlock("span", _hoisted_11, "\u5171" + toDisplayString(__props.count) + "\u6761", 1)) : createCommentVNode("", true)
|
||||
]);
|
||||
};
|
||||
}
|
||||
});
|
||||
const component = withInstall(_sfc_main);
|
||||
export { _sfc_main as _, component as c };
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "AddCircleFineIcon",
|
||||
};
|
||||
</script>
|
||||
<script setup lang="ts">
|
||||
import LayIcon from "../component/icon/index";
|
||||
|
||||
const props = defineProps<{
|
||||
color?: string;
|
||||
size?: string;
|
||||
}>();
|
||||
</script>
|
||||
<template>
|
||||
<lay-icon
|
||||
:color="props.color"
|
||||
:size="props.size"
|
||||
type="layui-icon-add-circle-fine"
|
||||
/>
|
||||
</template>
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user