@fmdevui/fm-dev
Version:
Page level components developed based on Element Plus.
1,454 lines (1,398 loc) • 2.38 MB
JavaScript
/*! fm-dev v1.0.85 */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('crypto'), require('url'), require('http'), require('https'), require('util'), require('stream'), require('assert'), require('zlib'), require('element-plus')) :
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'crypto', 'url', 'http', 'https', 'util', 'stream', 'assert', 'zlib', 'element-plus'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.FmPlus = {}, global.Vue, global.crypto, global.require$$0, global.require$$1, global.require$$2, global.util, global.stream, global.require$$4, global.zlib, global.ElementPlus));
})(this, (function (exports, vue, crypto, require$$0, require$$1, require$$2, util, stream, require$$4, zlib, elementPlus) { 'use strict';
const _hoisted_1$7 = { class: "fm-transfer-panel" };
const _hoisted_2$5 = { class: "fm-transfer-panel__header" };
const _hoisted_3$4 = { class: "fm-transfer-panel__body" };
const _hoisted_4$4 = { class: "fm-transfer-buttons__item" };
const _hoisted_5$2 = { class: "fm-transfer-buttons__item" };
const _hoisted_6 = { class: "fm-transfer-buttons__item" };
const _hoisted_7 = { class: "fm-transfer-buttons__item" };
const _hoisted_8 = { class: "fm-transfer-panel" };
const _hoisted_9 = { class: "fm-transfer-panel__header" };
const _hoisted_10 = { class: "fm-transfer-panel__body" };
var _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
...{
name: "FmTransfer"
},
__name: "index",
props: {
leftTitle: String,
rightTitle: String,
options: {
type: Object,
default: () => ({
value: "id",
label: "name",
disabled: "disabled"
})
},
leftData: { type: Array, default: () => [] },
// 左边全部数据
rightData: { type: Array, default: () => [] }
// 右边全部数据
},
emits: ["left", "right", "allLeft", "allRight", "update:leftData", "update:rightData"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const state = vue.reactive({
leftAllChecked: false,
// 左边是否全选
leftKeyword: "",
// 左边搜索关键词
leftChecked: [],
// 左边选中数据
rightAllChecked: false,
// 右边是否全选
rightKeyword: "",
// 右边搜索关键词
rightChecked: []
// 右边选中数据
});
const leftFilterData = vue.computed(() => {
let result = props.leftData.filter((e) => e[props.options.label].toLowerCase().includes(state.leftKeyword.toLowerCase()));
if (state.leftChecked.length > 0) {
for (let i = state.leftChecked.length - 1; i >= 0; i--) {
const index = result.findIndex((e) => e[props.options.value] == state.leftChecked[i]);
if (index == -1) state.leftChecked.splice(i, 1);
}
}
return result;
});
const handleLeftAllChecked = (value) => {
state.leftChecked = value ? leftFilterData.value.filter((e) => e[props.options.disabled] == false).map((e) => e[props.options.value]) : [];
};
const leftIndeterminate = vue.computed(() => {
const checkedLength = state.leftChecked.length;
const result = checkedLength > 0 && checkedLength < leftFilterData.value.filter((e) => e[props.options.disabled] == false).length;
return result;
});
vue.watch(
() => state.leftChecked,
(val) => {
state.leftAllChecked = val.length > 0 && val.length == leftFilterData.value.filter((e) => e[props.options.disabled] == false).length;
}
);
const rightFilterData = vue.computed(() => {
let result = props.rightData.filter((e) => e[props.options.label].toLowerCase().includes(state.rightKeyword.toLowerCase()));
if (state.rightChecked.length > 0) {
for (let i = state.rightChecked.length - 1; i >= 0; i--) {
const index = result.findIndex((e) => e[props.options.value] == state.rightChecked[i]);
if (index == -1) state.rightChecked.splice(i, 1);
}
}
return result;
});
const handleRightAllChecked = (value) => {
state.rightChecked = value ? rightFilterData.value.filter((e) => e[props.options.disabled] == false).map((e) => e[props.options.value]) : [];
};
const rightIndeterminate = vue.computed(() => {
const checkedLength = state.rightChecked.length;
const result = checkedLength > 0 && checkedLength < rightFilterData.value.filter((e) => e[props.options.disabled] == false).length;
return result;
});
vue.watch(
() => state.rightChecked,
(val) => {
state.rightAllChecked = val.length > 0 && val.length == rightFilterData.value.filter((e) => e[props.options.disabled] == false).length;
}
);
const dbClickToRight = (item) => {
if (item[props.options.value] && item[props.options.disabled] === false) {
let adds = props.leftData.filter((e) => item[props.options.value] == e[props.options.value]);
let cuts = props.leftData.filter((e) => item[props.options.value] != e[props.options.value]);
emits("update:leftData", cuts);
emits("update:rightData", props.rightData.concat(adds));
emits("right");
state.leftChecked = state.leftChecked.filter((e) => item[props.options.value] != e);
}
};
const toRight = () => {
if (state.leftChecked?.length > 0) {
let adds = props.leftData.filter((e) => state.leftChecked.some((x) => x == e[props.options.value]));
let cuts = props.leftData.filter((e) => state.leftChecked.every((x) => x != e[props.options.value]));
emits("update:leftData", cuts);
emits("update:rightData", props.rightData.concat(adds));
emits("right");
state.leftChecked = [];
}
};
const allToRight = () => {
if (leftFilterData.value?.length > 0) {
let temp = leftFilterData.value.filter((e) => e[props.options.disabled] == false);
let adds = props.leftData.filter((e) => temp.some((x) => x[props.options.value] == e[props.options.value]));
let cuts = props.leftData.filter((e) => temp.every((x) => x[props.options.value] != e[props.options.value]));
emits("update:leftData", cuts);
emits("update:rightData", props.rightData.concat(adds));
emits("allRight");
state.leftChecked = [];
}
};
const dbClickToLeft = (item) => {
if (item[props.options.value] && item[props.options.disabled] === false) {
let adds = props.rightData.filter((e) => item[props.options.value] == e[props.options.value]);
let cuts = props.rightData.filter((e) => item[props.options.value] != e[props.options.value]);
emits("update:leftData", props.leftData.concat(adds));
emits("update:rightData", cuts);
emits("left");
state.rightChecked = state.rightChecked.filter((e) => item[props.options.value] != e);
}
};
const toLeft = () => {
if (state.rightChecked?.length > 0) {
let adds = props.rightData.filter((e) => state.rightChecked.some((x) => x == e[props.options.value]));
let cuts = props.rightData.filter((e) => state.rightChecked.every((x) => x != e[props.options.value]));
emits("update:leftData", props.leftData.concat(adds));
emits("update:rightData", cuts);
emits("left");
state.rightChecked = [];
}
};
const allToLeft = () => {
if (rightFilterData.value?.length > 0) {
let temp = rightFilterData.value.filter((e) => e[props.options.disabled] == false);
let adds = props.rightData.filter((e) => temp.some((x) => x[props.options.value] == e[props.options.value]));
let cuts = props.rightData.filter((e) => temp.every((x) => x[props.options.value] != e[props.options.value]));
emits("update:leftData", props.leftData.concat(adds));
emits("update:rightData", cuts);
emits("allLeft");
state.rightChecked = [];
}
};
return (_ctx, _cache) => {
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
const _component_el_input = vue.resolveComponent("el-input");
const _component_el_checkbox_group = vue.resolveComponent("el-checkbox-group");
const _component_el_col = vue.resolveComponent("el-col");
const _component_el_button = vue.resolveComponent("el-button");
const _component_el_row = vue.resolveComponent("el-row");
return vue.openBlock(), vue.createBlock(_component_el_row, { gutter: 10 }, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_col, { span: 10 }, {
default: vue.withCtx(() => [
vue.createElementVNode("div", _hoisted_1$7, [
vue.createElementVNode("p", _hoisted_2$5, [
vue.createVNode(_component_el_checkbox, {
modelValue: state.leftAllChecked,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.leftAllChecked = $event),
indeterminate: leftIndeterminate.value,
"validate-event": false,
onChange: handleLeftAllChecked
}, {
default: vue.withCtx(() => [
vue.createTextVNode(
vue.toDisplayString(props.leftTitle),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["modelValue", "indeterminate"]),
vue.createElementVNode(
"span",
null,
vue.toDisplayString(state.leftChecked.length) + "/" + vue.toDisplayString(props.leftData.length),
1
/* TEXT */
)
]),
vue.createElementVNode("div", _hoisted_3$4, [
vue.createVNode(_component_el_input, {
class: "transfer-panel__filter",
modelValue: state.leftKeyword,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.leftKeyword = $event),
placeholder: "\u641C\u7D22",
"prefix-icon": "ele-Search",
clearable: "",
"validate-event": false
}, null, 8, ["modelValue"]),
vue.withDirectives(vue.createVNode(_component_el_checkbox_group, {
modelValue: state.leftChecked,
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => state.leftChecked = $event),
"validate-event": false,
class: "fm-transfer-panel__list"
}, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(leftFilterData.value, (item, index) => {
return vue.openBlock(), vue.createBlock(_component_el_checkbox, {
key: index,
value: item[props.options.value],
label: item[props.options.label],
disabled: item[props.options.disabled],
"validate-event": false,
class: "fm-transfer-panel__item",
onDblclick: ($event) => dbClickToRight(item)
}, null, 8, ["value", "label", "disabled", "onDblclick"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
}, 8, ["modelValue"]), [
[vue.vShow, true]
])
])
])
]),
_: 1
/* STABLE */
}),
vue.createVNode(_component_el_col, {
span: 4,
class: "fm-transfer-buttons"
}, {
default: vue.withCtx(() => [
vue.createElementVNode("div", _hoisted_4$4, [
vue.createVNode(_component_el_button, {
type: "primary",
style: {},
icon: "ele-ArrowRight",
onClick: toRight
})
]),
vue.createElementVNode("div", _hoisted_5$2, [
vue.createVNode(_component_el_button, {
type: "primary",
style: {},
icon: "ele-ArrowLeft",
onClick: toLeft
})
]),
vue.createElementVNode("div", _hoisted_6, [
vue.createVNode(_component_el_button, {
type: "primary",
style: {},
icon: "ele-DArrowRight",
onClick: allToRight
})
]),
vue.createElementVNode("div", _hoisted_7, [
vue.createVNode(_component_el_button, {
type: "primary",
style: {},
icon: "ele-DArrowLeft",
onClick: allToLeft
})
])
]),
_: 1
/* STABLE */
}),
vue.createVNode(_component_el_col, { span: 10 }, {
default: vue.withCtx(() => [
vue.createElementVNode("div", _hoisted_8, [
vue.createElementVNode("p", _hoisted_9, [
vue.createVNode(_component_el_checkbox, {
modelValue: state.rightAllChecked,
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => state.rightAllChecked = $event),
indeterminate: rightIndeterminate.value,
"validate-event": false,
onChange: handleRightAllChecked
}, {
default: vue.withCtx(() => [
vue.createTextVNode(
vue.toDisplayString(props.rightTitle),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["modelValue", "indeterminate"]),
vue.createElementVNode(
"span",
null,
vue.toDisplayString(state.rightChecked.length) + "/" + vue.toDisplayString(props.rightData.length),
1
/* TEXT */
)
]),
vue.createElementVNode("div", _hoisted_10, [
vue.createVNode(_component_el_input, {
class: "transfer-panel__filter",
modelValue: state.rightKeyword,
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => state.rightKeyword = $event),
placeholder: "\u641C\u7D22",
"prefix-icon": "ele-Search",
clearable: "",
"validate-event": false
}, null, 8, ["modelValue"]),
vue.withDirectives(vue.createVNode(_component_el_checkbox_group, {
modelValue: state.rightChecked,
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => state.rightChecked = $event),
"validate-event": false,
class: "fm-transfer-panel__list"
}, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(rightFilterData.value, (item, index) => {
return vue.openBlock(), vue.createBlock(_component_el_checkbox, {
key: index,
value: item[props.options.value],
label: item[props.options.label],
disabled: item[props.options.disabled],
"validate-event": false,
class: "fm-transfer-panel__item",
onDblclick: ($event) => dbClickToLeft(item)
}, null, 8, ["value", "label", "disabled", "onDblclick"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
}, 8, ["modelValue"]), [
[vue.vShow, true]
])
])
])
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
});
};
}
});
const _hoisted_1$6 = { class: "notice-bar-warp-text-box" };
const _hoisted_2$4 = ["innerHTML"];
var _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
...{
name: "FmNoticeBar"
},
__name: "index",
props: {
mode: { type: String, default: "" },
// 通知栏模式,可选值为 closeable link
text: { type: String, default: "" },
// 通知文本内容
color: { type: String, default: "var(--el-color-warning)" },
// 通知文本颜色
background: { type: String, default: "var(--el-color-warning-light-9)" },
// 通知背景色
size: { type: [Number, String], default: 14 },
// 字体大小,单位px
height: { type: Number, default: 40 },
// 通知栏高度,单位px
delay: { type: Number, default: 1 },
// 动画延迟时间 (s)
speed: { type: Number, default: 100 },
// 滚动速率 (px/s)
scrollable: { type: Boolean, default: false },
// 是否开启垂直滚动
leftIcon: { type: String, default: "iconfont icon-tongzhi2" },
// 自定义左侧图标
rightIcon: { type: String, default: "" }
// 自定义右侧图标
},
emits: ["close", "link"],
setup(__props, { emit: __emit }) {
const props = __props;
const noticeBarWarpRef = vue.ref(null);
const noticeBarTextRef = vue.ref(null);
const state = vue.reactive({
isMode: false,
warpOWidth: 0,
textOWidth: 0,
animationDuration: 0
});
vue.onMounted(async () => {
if (!props.scrollable) initAnimation();
});
const initAnimation = () => {
vue.nextTick(() => {
if (noticeBarWarpRef.value && noticeBarTextRef.value) {
state.warpOWidth = noticeBarWarpRef.value.offsetWidth;
state.textOWidth = noticeBarTextRef.value.scrollWidth;
state.animationDuration = (state.textOWidth + state.warpOWidth) / props.speed;
noticeBarTextRef.value.style.animation = "none";
noticeBarTextRef.value.offsetHeight;
noticeBarTextRef.value.style.animation = `marquee ${state.animationDuration}s linear infinite`;
const keyframes = `
@keyframes marquee {
0% { transform: translateX(${state.warpOWidth}px); }
100% { transform: translateX(-${state.textOWidth}px); }
}
`;
const styleSheet = document.createElement("style");
styleSheet.innerText = keyframes;
document.head.appendChild(styleSheet);
}
});
};
return (_ctx, _cache) => {
return vue.withDirectives((vue.openBlock(), vue.createElementBlock(
"div",
{
class: "fm-notice-bar",
style: vue.normalizeStyle({ background: __props.background, height: `${__props.height}px` })
},
[
vue.createElementVNode(
"div",
{
class: "notice-bar-warp",
style: vue.normalizeStyle({ color: __props.color, fontSize: `${__props.size}px` }),
ref_key: "noticeBarWarpRef",
ref: noticeBarWarpRef
},
[
__props.leftIcon ? (vue.openBlock(), vue.createElementBlock(
"i",
{
key: 0,
class: vue.normalizeClass(["notice-bar-warp-left-icon", __props.leftIcon])
},
null,
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("div", _hoisted_1$6, [
vue.createElementVNode(
"div",
{
class: "notice-bar-warp-text",
ref_key: "noticeBarTextRef",
ref: noticeBarTextRef
},
[
vue.createElementVNode("div", {
innerHTML: props.text,
"data-slate-editor": ""
}, null, 8, _hoisted_2$4)
],
512
/* NEED_PATCH */
)
])
],
4
/* STYLE */
)
],
4
/* STYLE */
)), [
[vue.vShow, !state.isMode]
]);
};
}
});
var _sfc_main$e = {
name: "dragVerify",
props: {
isPassing: {
type: Boolean,
default: false
},
width: {
type: Number,
default: 250
},
height: {
type: Number,
default: 40
},
text: {
type: String,
default: "swiping to the right side"
},
successText: {
type: String,
default: "success"
},
background: {
type: String,
default: "#eee"
},
progressBarBg: {
type: String,
default: "#76c61d"
},
completedBg: {
type: String,
default: "#76c61d"
},
circle: {
type: Boolean,
default: false
},
radius: {
type: String,
default: "4px"
},
handlerIcon: {
type: String
},
successIcon: {
type: String
},
handlerBg: {
type: String,
default: "#fff"
},
textSize: {
type: String,
default: "14px"
},
textColor: {
type: String,
default: "#333"
},
imgsrc: {
type: String
},
showTips: {
type: Boolean,
default: true
},
successTip: {
type: String,
default: "\u9A8C\u8BC1\u901A\u8FC7"
},
failTip: {
type: String,
default: "\u9A8C\u8BC1\u5931\u8D25"
},
diffDegree: {
type: Number,
default: 10
},
minDegree: {
type: Number,
default: 90
},
maxDegree: {
type: Number,
default: 270
}
},
mounted: function() {
const dragEl = this.$refs.dragVerify;
dragEl.style.setProperty("--textColor", this.textColor);
dragEl.style.setProperty("--width", Math.floor(this.width / 2) + "px");
dragEl.style.setProperty("--pwidth", -Math.floor(this.width / 2) + "px");
},
computed: {
handlerStyle: function() {
return {
width: this.height + "px",
height: this.height + "px",
background: this.handlerBg
};
},
message: function() {
return this.isPassing ? "" : this.text;
},
successMessage: function() {
return this.isPassing ? this.successText : "";
},
dragVerifyStyle: function() {
return {
width: this.width + "px",
height: this.height + "px",
lineHeight: this.height + "px",
marginTop: "20px",
background: this.background,
borderRadius: this.circle ? this.height / 2 + "px" : this.radius
};
},
dragVerifyImgStyle: function() {
return {
width: this.width + "px",
height: this.width + "px",
position: "relative",
overflow: "hidden",
"border-radius": "50%"
};
},
progressBarStyle: function() {
return {
background: this.progressBarBg,
height: this.height + "px",
borderRadius: this.circle ? this.height / 2 + "px 0 0 " + this.height / 2 + "px" : this.radius
};
},
textStyle: function() {
return {
height: this.height + "px",
width: this.width + "px",
fontSize: this.textSize
};
},
factor: function() {
if (this.minDegree == this.maxDegree) {
return Math.floor(1 + Math.random() * 6) / 10 + 1;
}
return 1;
}
},
data() {
return {
isMoving: false,
x: 0,
isOk: false,
showBar: false,
showErrorTip: false,
ranRotate: 0,
cRotate: 0,
imgStyle: {}
};
},
methods: {
checkimgLoaded: function() {
var minDegree = this.minDegree;
var maxDegree = this.maxDegree;
var ranRotate = Math.floor(minDegree + Math.random() * (maxDegree - minDegree));
this.ranRotate = ranRotate;
this.imgStyle = {
transform: `rotateZ(${ranRotate}deg)`
};
},
dragStart: function(e) {
if (!this.isPassing) {
this.isMoving = true;
this.x = e.pageX || e.touches[0].pageX;
}
this.showBar = true;
this.showErrorTip = false;
this.$emit("handlerMove");
},
dragMoving: function(e) {
if (this.isMoving && !this.isPassing) {
var _x = (e.pageX || e.touches[0].pageX) - this.x;
var handler = this.$refs.handler;
handler.style.left = _x + "px";
var progressBar = this.$refs.progressBar;
progressBar.style.width = _x + this.height / 2 + "px";
var cRotate = Math.ceil(_x / (this.width - this.height) * this.maxDegree * this.factor);
this.cRotate = cRotate;
var rotate = this.ranRotate - cRotate;
this.imgStyle = {
transform: `rotateZ(${rotate}deg)`
};
}
},
dragFinish: function(e) {
if (this.isMoving && !this.isPassing) {
if (Math.abs(this.ranRotate - this.cRotate) > this.diffDegree) {
this.isOk = true;
this.imgStyle = {
transform: `rotateZ(${this.ranRotate}deg)`
};
var that = this;
setTimeout(function() {
var handler = that.$refs.handler;
var progressBar = that.$refs.progressBar;
handler.style.left = "0";
progressBar.style.width = "0";
that.isOk = false;
}, 500);
this.showErrorTip = true;
this.$emit("passfail");
} else {
this.passVerify();
}
this.isMoving = false;
}
},
passVerify: function() {
this.$emit("update:isPassing", true);
this.isMoving = false;
var handler = this.$refs.handler;
handler.children[0].className = this.successIcon;
this.$refs.progressBar.style.background = this.completedBg;
this.$refs.message.style["-webkit-text-fill-color"] = "unset";
this.$refs.message.style.animation = "slidetounlock2 3s infinite";
this.$refs.progressBar.style.color = "#fff";
this.$refs.progressBar.style.fontSize = this.textSize;
this.$emit("passcallback");
},
reset: function() {
this.reImg();
this.checkimgLoaded();
},
reImg: function() {
this.$emit("update:isPassing", false);
const oriData = this.$options.data();
for (const key in oriData) {
if (Object.prototype.hasOwnProperty.call(oriData, key)) {
this[key] = oriData[key];
}
}
var handler = this.$refs.handler;
var message = this.$refs.message;
handler.style.left = "0";
this.$refs.progressBar.style.width = "0";
handler.children[0].className = this.handlerIcon;
message.style["-webkit-text-fill-color"] = "transparent";
message.style.animation = "slidetounlock 3s infinite";
message.style.color = this.background;
},
refreshimg: function() {
this.$emit("refresh");
}
},
watch: {
imgsrc: {
immediate: false,
handler: function() {
this.reImg();
}
}
}
};
var _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _hoisted_1$5 = { class: "drag-verify-container" };
const _hoisted_2$3 = ["src"];
const _hoisted_3$3 = {
key: 0,
class: "tips success"
};
const _hoisted_4$3 = {
key: 1,
class: "tips danger"
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
vue.createElementVNode(
"div",
{
style: vue.normalizeStyle([$options.dragVerifyImgStyle, { "background-color": "var(--el-color-primary)" }])
},
[
vue.createElementVNode("img", {
ref: "checkImg",
src: $props.imgsrc,
class: vue.normalizeClass(["check-img", { goOrigin: $data.isOk }]),
onLoad: _cache[0] || (_cache[0] = (...args) => $options.checkimgLoaded && $options.checkimgLoaded(...args)),
style: vue.normalizeStyle($data.imgStyle),
alt: ""
}, null, 46, _hoisted_2$3),
$props.showTips && $props.isPassing ? (vue.openBlock(), vue.createElementBlock(
"div",
_hoisted_3$3,
vue.toDisplayString($props.successTip),
1
/* TEXT */
)) : vue.createCommentVNode("v-if", true),
$props.showTips && !$props.isPassing && $data.showErrorTip ? (vue.openBlock(), vue.createElementBlock(
"div",
_hoisted_4$3,
vue.toDisplayString($props.failTip),
1
/* TEXT */
)) : vue.createCommentVNode("v-if", true)
],
4
/* STYLE */
),
vue.createElementVNode(
"div",
{
ref: "dragVerify",
class: "drag_verify",
style: vue.normalizeStyle($options.dragVerifyStyle),
onMousemove: _cache[3] || (_cache[3] = (...args) => $options.dragMoving && $options.dragMoving(...args)),
onMouseup: _cache[4] || (_cache[4] = (...args) => $options.dragFinish && $options.dragFinish(...args)),
onMouseleave: _cache[5] || (_cache[5] = (...args) => $options.dragFinish && $options.dragFinish(...args)),
onTouchmove: _cache[6] || (_cache[6] = vue.withModifiers((...args) => $options.dragMoving && $options.dragMoving(...args), ["prevent"])),
onTouchend: _cache[7] || (_cache[7] = vue.withModifiers((...args) => $options.dragFinish && $options.dragFinish(...args), ["prevent"]))
},
[
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["dv_progress_bar", { goFirst2: $data.isOk }]),
ref: "progressBar",
style: vue.normalizeStyle($options.progressBarStyle)
},
vue.toDisplayString($options.successMessage),
7
/* TEXT, CLASS, STYLE */
),
vue.createElementVNode(
"div",
{
class: "dv_text",
style: vue.normalizeStyle($options.textStyle),
ref: "message"
},
vue.toDisplayString($options.message),
5
/* TEXT, STYLE */
),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["dv_handler dv_handler_bg", { goFirst: $data.isOk }]),
onMousedown: _cache[1] || (_cache[1] = (...args) => $options.dragStart && $options.dragStart(...args)),
onTouchstart: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.dragStart && $options.dragStart(...args), ["prevent"])),
ref: "handler",
style: vue.normalizeStyle([$options.handlerStyle, { "background-color": "var(--el-color-primary)" }])
},
[
vue.createElementVNode(
"i",
{
class: vue.normalizeClass($props.handlerIcon),
style: { "color": "#fff" }
},
null,
2
/* CLASS */
)
],
38
/* CLASS, STYLE, NEED_HYDRATION */
)
],
36
/* STYLE, NEED_HYDRATION */
)
]);
}
var dragimg = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render], ["__scopeId", "data-v-9e8c9ed2"]]);
var _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
...{
name: "Fmselect"
},
__name: "index",
props: /* @__PURE__ */ vue.mergeModels({
//数据
optionData: {
type: Array,
default: []
},
/**
* 值的属性值
*/
bvalue: {
type: String,
default: "id"
},
/**
* 值的属性标签
*/
blabel: {
type: String,
default: "name"
}
}, {
"id": {
type: Number,
default: 0
},
"idModifiers": {},
"name": {
type: String,
default: ""
},
"nameModifiers": {}
}),
emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:id", "update:name"]),
setup(__props, { emit: __emit }) {
const modeValueId = vue.useModel(__props, "id");
const modeValueName = vue.useModel(__props, "name");
const props = __props;
const emit = __emit;
const handleSelectChange = (value) => {
const fitem = props.optionData.find((item) => item[props.bvalue] == value);
modeValueName.value = fitem == null ? "" : fitem[props.blabel];
emit("change", fitem);
};
return (_ctx, _cache) => {
const _component_el_option = vue.resolveComponent("el-option");
const _component_el_select = vue.resolveComponent("el-select");
return vue.openBlock(), vue.createBlock(_component_el_select, {
modelValue: modeValueId.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modeValueId.value = $event),
placeholder: "\u8BF7\u9009\u62E9",
onChange: handleSelectChange
}, {
default: vue.withCtx(() => [
vue.createVNode(_component_el_option, {
value: 0,
label: ""
}),
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(__props.optionData, (item, index) => {
return vue.openBlock(), vue.createBlock(_component_el_option, {
key: index,
value: item[__props.bvalue],
label: item[__props.blabel]
}, null, 8, ["value", "label"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
}, 8, ["modelValue"]);
};
}
});
function bind(fn, thisArg) {
return function wrap() {
return fn.apply(thisArg, arguments);
};
}
// utils is a library of generic helper functions non-specific to axios
const {toString} = Object.prototype;
const {getPrototypeOf} = Object;
const {iterator, toStringTag} = Symbol;
const kindOf = (cache => thing => {
const str = toString.call(thing);
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
})(Object.create(null));
const kindOfTest = (type) => {
type = type.toLowerCase();
return (thing) => kindOf(thing) === type
};
const typeOfTest = type => thing => typeof thing === type;
/**
* Determine if a value is an Array
*
* @param {Object} val The value to test
*
* @returns {boolean} True if value is an Array, otherwise false
*/
const {isArray: isArray$3} = Array;
/**
* Determine if a value is undefined
*
* @param {*} val The value to test
*
* @returns {boolean} True if the value is undefined, otherwise false
*/
const isUndefined$1 = typeOfTest('undefined');
/**
* Determine if a value is a Buffer
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a Buffer, otherwise false
*/
function isBuffer$1(val) {
return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor)
&& isFunction$2(val.constructor.isBuffer) && val.constructor.isBuffer(val);
}
/**
* Determine if a value is an ArrayBuffer
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
*/
const isArrayBuffer = kindOfTest('ArrayBuffer');
/**
* Determine if a value is a view on an ArrayBuffer
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
*/
function isArrayBufferView(val) {
let result;
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
result = ArrayBuffer.isView(val);
} else {
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
}
return result;
}
/**
* Determine if a value is a String
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a String, otherwise false
*/
const isString$2 = typeOfTest('string');
/**
* Determine if a value is a Function
*
* @param {*} val The value to test
* @returns {boolean} True if value is a Function, otherwise false
*/
const isFunction$2 = typeOfTest('function');
/**
* Determine if a value is a Number
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a Number, otherwise false
*/
const isNumber$2 = typeOfTest('number');
/**
* Determine if a value is an Object
*
* @param {*} thing The value to test
*
* @returns {boolean} True if value is an Object, otherwise false
*/
const isObject$2 = (thing) => thing !== null && typeof thing === 'object';
/**
* Determine if a value is a Boolean
*
* @param {*} thing The value to test
* @returns {boolean} True if value is a Boolean, otherwise false
*/
const isBoolean$2 = thing => thing === true || thing === false;
/**
* Determine if a value is a plain Object
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a plain Object, otherwise false
*/
const isPlainObject$3 = (val) => {
if (kindOf(val) !== 'object') {
return false;
}
const prototype = getPrototypeOf(val);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
};
/**
* Determine if a value is a Date
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a Date, otherwise false
*/
const isDate$2 = kindOfTest('Date');
/**
* Determine if a value is a File
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a File, otherwise false
*/
const isFile = kindOfTest('File');
/**
* Determine if a value is a Blob
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a Blob, otherwise false
*/
const isBlob = kindOfTest('Blob');
/**
* Determine if a value is a FileList
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a File, otherwise false
*/
const isFileList = kindOfTest('FileList');
/**
* Determine if a value is a Stream
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a Stream, otherwise false
*/
const isStream = (val) => isObject$2(val) && isFunction$2(val.pipe);
/**
* Determine if a value is a FormData
*
* @param {*} thing The value to test
*
* @returns {boolean} True if value is an FormData, otherwise false
*/
const isFormData = (thing) => {
let kind;
return thing && (
(typeof FormData === 'function' && thing instanceof FormData) || (
isFunction$2(thing.append) && (
(kind = kindOf(thing)) === 'formdata' ||
// detect form-data instance
(kind === 'object' && isFunction$2(thing.toString) && thing.toString() === '[object FormData]')
)
)
)
};
/**
* Determine if a value is a URLSearchParams object
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
*/
const isURLSearchParams = kindOfTest('URLSearchParams');
const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
/**
* Trim excess whitespace off the beginning and end of a string
*
* @param {String} str The String to trim
*
* @returns {String} The String freed of excess whitespace
*/
const trim = (str) => str.trim ?
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
/**
* Iterate over an Array or an Object invoking a function for each item.
*
* If `obj` is an Array callback will be called passing
* the value, index, and complete array for each item.
*
* If 'obj' is an Object callback will be called passing
* the value, key, and complete object for each property.
*
* @param {Object|Array} obj The object to iterate
* @param {Function} fn The callback to invoke for each item
*
* @param {Boolean} [allOwnKeys = false]
* @returns {any}
*/
function forEach$1(obj, fn, {allOwnKeys = false} = {}) {
// Don't bother if no value provided
if (obj === null || typeof obj === 'undefined') {
return;
}
let i;
let l;
// Force an array if not already something iterable
if (typeof obj !== 'object') {
/*eslint no-param-reassign:0*/
obj = [obj];
}
if (isArray$3(obj)) {
// Iterate over array values
for (i = 0, l = obj.length; i < l; i++) {
fn.call(null, obj[i], i, obj);
}
} else {
// Iterate over object keys
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
const len = keys.length;
let key;
for (i = 0; i < len; i++) {
key = keys[i];
fn.call(null, obj[key], key, obj);
}
}
}
function findKey(obj, key) {
key = key.toLowerCase();
const keys = Object.keys(obj);
let i = keys.length;
let _key;
while (i-- > 0) {
_key = keys[i];
if (key === _key.toLowerCase()) {
return _key;
}
}
return null;
}
const _global$1 = (() => {
/*eslint no-undef:0*/
if (typeof globalThis !== "undefined") return globalThis;
return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
})();
const isContextDefined = (context) => !isUndefined$1(context) && context !== _global$1;
/**
* Accepts varargs expecting each argument to be an object, then
* immutably merges the properties of each object and returns result.
*
* When multiple objects contain the same key the later object in
* the arguments list will take precedence.
*
* Example:
*
* ```js
* var result = merge({foo: 123}, {foo: 456});
*
* ```
*
* @param {Object} obj1 Object to merge
*
* @returns {Object} Result of all merge properties
*/
function merge$1(/* obj1, obj2, obj3, ... */) {
const {caseless} = isContextDefined(this) && this || {};
const result = {};
const assignValue = (val, key) => {
const targetKey = caseless && findKey(result, key) || key;
if (isPlainObject$3(result[targetKey]) && isPlainObject$3(val)) {
result[targetKey] = merge$1(result[targetKey], val);
} else if (isPlainObject$3(val)) {
result[targetKey] = merge$1({}, val);
} else if (isArray$3(val)) {
result[targetKey] = val.slice();
} else {
result[targetKey] = val;
}
};
for (let i = 0, l = arguments.length; i < l; i++) {
arguments[i] && forEach$1(arguments[i], assignValue);
}
return result;
}
/**
* Extends object a by mutably adding to it the properties of object b.
*
* @param {Object} a The object to be extended
* @param {Object} b The object to copy properties from
* @param {Object} thisArg The object to bind function to
*
* @param {Boolean} [allOwnKeys]
* @returns {Object} The resulting value of object a
*/
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
forEach$1(b, (val, key) => {
if (thisArg && isFunction$2(val)) {
a[key] = bind(val, thisArg);
} else {
a[key] = val;
}
}, {allOwnKeys});
return a;
};
/**
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
*
* @param {string} content with BOM
*
* @returns {string} content value without BOM
*/
const stripBOM = (content) => {
if (content.charCodeAt(0) === 0xFEFF) {
content = content.slice(1);
}
return content;
};
/**
* Inherit the prototype methods from one constructor into another
* @param {function} constructor
* @param {function} superConstructor
* @param {object} [props]
* @param {object} [descriptors]
*
* @returns {void}
*/
const inherits = (constructor, superConstructor, props, descriptors) => {
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
constructor.prototype.constructor = constructor;
Object.defineProperty(constructor, 'super', {
value: superConstructor.prototype
});
props && Object.assign(constructor.prototype, props);
};
/**
* Resolve object with deep prototype chain to a flat object
* @param {Object} sourceObj source object
* @param {Object} [destObj]
* @param {Function|Boolean} [filter]
* @param {Function} [propFilter]
*
* @returns {Object}
*/
const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
let props;
let i;
let prop;
const merged = {};
destObj = destObj || {};
// eslint-disable-next-line no-eq-null,eqeqeq
if (sourceObj == null) return destObj;
do {
props = Object.getOwnPropertyNames(sourceObj);
i = props.length;
while (i-- > 0) {
prop = props[i];
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
destObj[prop] = sourceObj[prop];
merged[prop] = true;
}
}
sourceObj = filter !== false && getPrototypeOf(sourceObj);
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
return destObj;
};
/**
* Determines whether a string ends with the characters of a specified string
*
* @param {String} str
* @param {String} searchString
* @param {Number} [position= 0]
*
* @returns {boolean}
*/
const endsWith = (str, searchString, position) => {
str = String(str);
if (position === undefined || position > str.length) {
position = str.length;
}
position -= searchString.length;
const lastIndex = str.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
};
/**
* Returns new array from array like object or null if failed
*
* @param {*} [thing]
*
* @returns {?Array}
*/
const toArray = (thing) => {
if (!thing) return null;
if (isArray$3(thing)) return thing;
let i = thing.length;
if (!isNumber$2(i)) return null;
const arr = new Array(i);
while (i-- > 0) {
arr[i] = thing[i];
}
return arr;
};
/**
* Checking if the Uint8Array exists and if it does, it returns a function that checks if the
* thing passed in is an instance of Uint8Array
*
* @param {TypedArray}
*
* @returns {Array}
*/
// eslint-disable-next-line func-names
const isTypedArray$2 = (TypedArray => {
// eslint-disable-next-line func-names
return thing => {
return TypedArray && thing instanceof TypedArray;
};
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
/**
* For each entry in the object, call the function with the key and value.
*
* @param {Object<any, any>} obj - The object to iterate over.
* @param {Function} fn - The function to call for each entry.
*
* @returns {void}
*/
const forEachEntry = (obj,