@fmdevui/fm-dev 1.0.9 → 1.0.11
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/es/core/index.d.ts +2 -0
- package/es/core/ui/components/index.d.ts +2 -0
- package/es/core/ui/components/noticeBar/index.vue.d.ts +114 -0
- package/es/core/ui/components/noticeBar/style/css.d.ts +1 -0
- package/es/core/ui/components/noticeBar/style/index.d.ts +1 -0
- package/es/core/ui/components/svgIcon/index.d.ts +7 -0
- package/es/core/ui/components/svgIcon/svgicon.vue.d.ts +27 -0
- package/es/core/ui/components/transfer/index.vue.d.ts +59 -0
- package/es/core/ui/components/transfer/style/css.d.ts +1 -0
- package/es/core/ui/components/transfer/style/index.d.ts +1 -0
- package/es/core/ui/loading/index.d.ts +9 -0
- package/es/index.mjs +2 -0
- package/es/packages/core/index.mjs +2 -0
- package/es/packages/core/ui/components/index.mjs +18 -0
- package/es/packages/core/ui/components/noticeBar/index.vue.mjs +5 -0
- package/es/packages/core/ui/components/noticeBar/index.vue2.mjs +126 -0
- package/es/packages/core/ui/components/noticeBar/style/css.mjs +1 -0
- package/es/packages/core/ui/components/noticeBar/style/index.mjs +1 -0
- package/es/packages/core/ui/components/svgIcon/index.mjs +13 -0
- package/es/packages/core/ui/components/svgIcon/svgicon.vue.mjs +5 -0
- package/es/packages/core/ui/components/svgIcon/svgicon.vue2.mjs +87 -0
- package/es/packages/core/ui/components/transfer/index.vue.mjs +5 -0
- package/es/packages/core/ui/components/transfer/index.vue2.mjs +370 -0
- package/es/packages/core/ui/components/transfer/style/css.mjs +1 -0
- package/es/packages/core/ui/components/transfer/style/index.mjs +1 -0
- package/es/packages/core/ui/loading/index.mjs +40 -0
- package/index.css +1 -0
- package/index.js +6692 -3
- package/index.min.js +43 -24
- package/index.min.mjs +42 -23
- package/index.mjs +6692 -5
- package/lib/core/index.d.ts +2 -0
- package/lib/core/ui/components/index.d.ts +2 -0
- package/lib/core/ui/components/noticeBar/index.vue.d.ts +114 -0
- package/lib/core/ui/components/noticeBar/style/css.d.ts +1 -0
- package/lib/core/ui/components/noticeBar/style/index.d.ts +1 -0
- package/lib/core/ui/components/svgIcon/index.d.ts +7 -0
- package/lib/core/ui/components/svgIcon/svgicon.vue.d.ts +27 -0
- package/lib/core/ui/components/transfer/index.vue.d.ts +59 -0
- package/lib/core/ui/components/transfer/style/css.d.ts +1 -0
- package/lib/core/ui/components/transfer/style/index.d.ts +1 -0
- package/lib/core/ui/loading/index.d.ts +9 -0
- package/lib/index.js +47 -43
- package/lib/packages/core/index.js +47 -43
- package/lib/packages/core/ui/components/index.js +20 -0
- package/lib/packages/core/ui/components/noticeBar/index.vue.js +9 -0
- package/lib/packages/core/ui/components/noticeBar/index.vue2.js +130 -0
- package/lib/packages/core/ui/components/noticeBar/style/css.js +4 -0
- package/lib/packages/core/ui/components/noticeBar/style/index.js +4 -0
- package/lib/packages/core/ui/components/svgIcon/index.js +34 -0
- package/lib/packages/core/ui/components/svgIcon/svgicon.vue.js +9 -0
- package/lib/packages/core/ui/components/svgIcon/svgicon.vue2.js +91 -0
- package/lib/packages/core/ui/components/transfer/index.vue.js +9 -0
- package/lib/packages/core/ui/components/transfer/index.vue2.js +374 -0
- package/lib/packages/core/ui/components/transfer/style/css.js +4 -0
- package/lib/packages/core/ui/components/transfer/style/index.js +4 -0
- package/lib/packages/core/ui/loading/index.js +42 -0
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -0
- package/theme-chalk/src/index.scss +2 -0
- package/theme-chalk/src/t-noticebar.scss +32 -0
- package/theme-chalk/src/t-transfer.scss +46 -0
- package/theme-chalk/t-t-noticebar.css +1 -0
- package/theme-chalk/t-t-transfer.css +1 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
|
|
7
|
+
const _hoisted_1 = { class: "notice-bar-warp-text-box" };
|
|
8
|
+
const _hoisted_2 = ["innerHTML"];
|
|
9
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
10
|
+
__name: "index",
|
|
11
|
+
props: {
|
|
12
|
+
mode: { type: String, default: "" },
|
|
13
|
+
// 通知栏模式,可选值为 closeable link
|
|
14
|
+
text: { type: String, default: "" },
|
|
15
|
+
// 通知文本内容
|
|
16
|
+
color: { type: String, default: "var(--el-color-warning)" },
|
|
17
|
+
// 通知文本颜色
|
|
18
|
+
background: { type: String, default: "var(--el-color-warning-light-9)" },
|
|
19
|
+
// 通知背景色
|
|
20
|
+
size: { type: [Number, String], default: 14 },
|
|
21
|
+
// 字体大小,单位px
|
|
22
|
+
height: { type: Number, default: 40 },
|
|
23
|
+
// 通知栏高度,单位px
|
|
24
|
+
delay: { type: Number, default: 1 },
|
|
25
|
+
// 动画延迟时间 (s)
|
|
26
|
+
speed: { type: Number, default: 100 },
|
|
27
|
+
// 滚动速率 (px/s)
|
|
28
|
+
scrollable: { type: Boolean, default: false },
|
|
29
|
+
// 是否开启垂直滚动
|
|
30
|
+
leftIcon: { type: String, default: "iconfont icon-tongzhi2" },
|
|
31
|
+
// 自定义左侧图标
|
|
32
|
+
rightIcon: { type: String, default: "" }
|
|
33
|
+
// 自定义右侧图标
|
|
34
|
+
},
|
|
35
|
+
emits: ["close", "link"],
|
|
36
|
+
setup(__props, { emit: __emit }) {
|
|
37
|
+
const props = __props;
|
|
38
|
+
const emit = __emit;
|
|
39
|
+
const noticeBarWarpRef = vue.ref(null);
|
|
40
|
+
const noticeBarTextRef = vue.ref(null);
|
|
41
|
+
const state = vue.reactive({
|
|
42
|
+
isMode: false,
|
|
43
|
+
warpOWidth: 0,
|
|
44
|
+
textOWidth: 0,
|
|
45
|
+
animationDuration: 0
|
|
46
|
+
});
|
|
47
|
+
vue.onMounted(async () => {
|
|
48
|
+
if (!props.scrollable) initAnimation();
|
|
49
|
+
});
|
|
50
|
+
const initAnimation = () => {
|
|
51
|
+
vue.nextTick(() => {
|
|
52
|
+
if (noticeBarWarpRef.value && noticeBarTextRef.value) {
|
|
53
|
+
state.warpOWidth = noticeBarWarpRef.value.offsetWidth;
|
|
54
|
+
state.textOWidth = noticeBarTextRef.value.scrollWidth;
|
|
55
|
+
state.animationDuration = (state.textOWidth + state.warpOWidth) / props.speed;
|
|
56
|
+
noticeBarTextRef.value.style.animation = "none";
|
|
57
|
+
noticeBarTextRef.value.offsetHeight;
|
|
58
|
+
noticeBarTextRef.value.style.animation = `marquee ${state.animationDuration}s linear infinite`;
|
|
59
|
+
const keyframes = `
|
|
60
|
+
@keyframes marquee {
|
|
61
|
+
0% { transform: translateX(${state.warpOWidth}px); }
|
|
62
|
+
100% { transform: translateX(-${state.textOWidth}px); }
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
const styleSheet = document.createElement("style");
|
|
66
|
+
styleSheet.innerText = keyframes;
|
|
67
|
+
document.head.appendChild(styleSheet);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
return (_ctx, _cache) => {
|
|
72
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
class: "fm-notice-bar",
|
|
76
|
+
style: vue.normalizeStyle({ background: __props.background, height: `${__props.height}px` })
|
|
77
|
+
},
|
|
78
|
+
[
|
|
79
|
+
vue.createElementVNode(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
class: "notice-bar-warp",
|
|
83
|
+
style: vue.normalizeStyle({ color: __props.color, fontSize: `${__props.size}px` }),
|
|
84
|
+
ref_key: "noticeBarWarpRef",
|
|
85
|
+
ref: noticeBarWarpRef
|
|
86
|
+
},
|
|
87
|
+
[
|
|
88
|
+
__props.leftIcon ? (vue.openBlock(), vue.createElementBlock(
|
|
89
|
+
"i",
|
|
90
|
+
{
|
|
91
|
+
key: 0,
|
|
92
|
+
class: vue.normalizeClass(["notice-bar-warp-left-icon", __props.leftIcon])
|
|
93
|
+
},
|
|
94
|
+
null,
|
|
95
|
+
2
|
|
96
|
+
/* CLASS */
|
|
97
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
98
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
99
|
+
vue.createElementVNode(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
class: "notice-bar-warp-text",
|
|
103
|
+
ref_key: "noticeBarTextRef",
|
|
104
|
+
ref: noticeBarTextRef
|
|
105
|
+
},
|
|
106
|
+
[
|
|
107
|
+
vue.createElementVNode("div", {
|
|
108
|
+
innerHTML: props.text,
|
|
109
|
+
"data-slate-editor": ""
|
|
110
|
+
}, null, 8, _hoisted_2)
|
|
111
|
+
],
|
|
112
|
+
512
|
|
113
|
+
/* NEED_PATCH */
|
|
114
|
+
)
|
|
115
|
+
])
|
|
116
|
+
],
|
|
117
|
+
4
|
|
118
|
+
/* STYLE */
|
|
119
|
+
)
|
|
120
|
+
],
|
|
121
|
+
4
|
|
122
|
+
/* STYLE */
|
|
123
|
+
)), [
|
|
124
|
+
[vue.vShow, !state.isMode]
|
|
125
|
+
]);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var svg = require('@element-plus/icons-vue');
|
|
4
|
+
require('./svgicon.vue.js');
|
|
5
|
+
var svgicon_vue_vue_type_script_setup_true_name_svgIcon_lang = require('./svgicon.vue2.js');
|
|
6
|
+
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var svg__namespace = /*#__PURE__*/_interopNamespaceDefault(svg);
|
|
25
|
+
|
|
26
|
+
function elSvg(app) {
|
|
27
|
+
const icons = svg__namespace;
|
|
28
|
+
for (const i in icons) {
|
|
29
|
+
app.component(`ele-${icons[i].name}`, icons[i]);
|
|
30
|
+
}
|
|
31
|
+
app.component("SvgIcon", svgicon_vue_vue_type_script_setup_true_name_svgIcon_lang.default);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.elSvg = elSvg;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var svgicon_vue_vue_type_script_setup_true_name_svgIcon_lang = require('./svgicon.vue2.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.default = svgicon_vue_vue_type_script_setup_true_name_svgIcon_lang.default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
|
|
7
|
+
const _hoisted_1 = ["src"];
|
|
8
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9
|
+
__name: "svgicon",
|
|
10
|
+
props: {
|
|
11
|
+
// svg 图标组件名字
|
|
12
|
+
name: {
|
|
13
|
+
type: String
|
|
14
|
+
},
|
|
15
|
+
// svg 大小
|
|
16
|
+
size: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: () => 14
|
|
19
|
+
},
|
|
20
|
+
// svg 颜色
|
|
21
|
+
color: {
|
|
22
|
+
type: String
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(__props) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const linesString = ["https", "http", "/src", "/assets", "data:image", window.__env__.VITE_PUBLIC_PATH];
|
|
28
|
+
const getIconName = vue.computed(() => {
|
|
29
|
+
return props?.name;
|
|
30
|
+
});
|
|
31
|
+
const isShowIconSvg = vue.computed(() => {
|
|
32
|
+
return props?.name?.startsWith("ele-");
|
|
33
|
+
});
|
|
34
|
+
const isShowIconImg = vue.computed(() => {
|
|
35
|
+
return linesString.find((str) => props.name?.startsWith(str));
|
|
36
|
+
});
|
|
37
|
+
const setIconSvgStyle = vue.computed(() => {
|
|
38
|
+
return `font-size: ${props.size}px;color: ${props.color};`;
|
|
39
|
+
});
|
|
40
|
+
const setIconImgOutStyle = vue.computed(() => {
|
|
41
|
+
return `width: ${props.size}px;height: ${props.size}px;display: inline-block;overflow: hidden;`;
|
|
42
|
+
});
|
|
43
|
+
const setIconSvgInsStyle = vue.computed(() => {
|
|
44
|
+
const filterStyle = [];
|
|
45
|
+
const compatibles = ["-webkit", "-ms", "-o", "-moz"];
|
|
46
|
+
compatibles.forEach((j) => filterStyle.push(`${j}-filter: drop-shadow(${props.color} ${props.size}px 0);`));
|
|
47
|
+
return `width: ${props.size}px;height: ${props.size}px;position: relative;left: -${props.size}px;${filterStyle.join("")}`;
|
|
48
|
+
});
|
|
49
|
+
return (_ctx, _cache) => {
|
|
50
|
+
return isShowIconSvg.value ? (vue.openBlock(), vue.createElementBlock(
|
|
51
|
+
"i",
|
|
52
|
+
{
|
|
53
|
+
key: 0,
|
|
54
|
+
class: "el-icon",
|
|
55
|
+
style: vue.normalizeStyle(setIconSvgStyle.value)
|
|
56
|
+
},
|
|
57
|
+
[
|
|
58
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getIconName.value)))
|
|
59
|
+
],
|
|
60
|
+
4
|
|
61
|
+
/* STYLE */
|
|
62
|
+
)) : isShowIconImg.value ? (vue.openBlock(), vue.createElementBlock(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
key: 1,
|
|
66
|
+
style: vue.normalizeStyle(setIconImgOutStyle.value)
|
|
67
|
+
},
|
|
68
|
+
[
|
|
69
|
+
vue.createElementVNode("img", {
|
|
70
|
+
src: getIconName.value,
|
|
71
|
+
style: vue.normalizeStyle(setIconSvgInsStyle.value)
|
|
72
|
+
}, null, 12, _hoisted_1)
|
|
73
|
+
],
|
|
74
|
+
4
|
|
75
|
+
/* STYLE */
|
|
76
|
+
)) : (vue.openBlock(), vue.createElementBlock(
|
|
77
|
+
"i",
|
|
78
|
+
{
|
|
79
|
+
key: 2,
|
|
80
|
+
class: vue.normalizeClass(getIconName.value),
|
|
81
|
+
style: vue.normalizeStyle(setIconSvgStyle.value)
|
|
82
|
+
},
|
|
83
|
+
null,
|
|
84
|
+
6
|
|
85
|
+
/* CLASS, STYLE */
|
|
86
|
+
));
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index_vue_vue_type_script_setup_true_name_transfer_lang = require('./index.vue2.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.default = index_vue_vue_type_script_setup_true_name_transfer_lang.default;
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
|
|
7
|
+
const _hoisted_1 = { class: "fm-transfer-panel" };
|
|
8
|
+
const _hoisted_2 = { class: "fm-transfer-panel__header" };
|
|
9
|
+
const _hoisted_3 = { class: "fm-transfer-panel__body" };
|
|
10
|
+
const _hoisted_4 = { class: "fm-transfer-buttons__item" };
|
|
11
|
+
const _hoisted_5 = { class: "fm-transfer-buttons__item" };
|
|
12
|
+
const _hoisted_6 = { class: "fm-transfer-buttons__item" };
|
|
13
|
+
const _hoisted_7 = { class: "fm-transfer-buttons__item" };
|
|
14
|
+
const _hoisted_8 = { class: "fm-transfer-panel" };
|
|
15
|
+
const _hoisted_9 = { class: "fm-transfer-panel__header" };
|
|
16
|
+
const _hoisted_10 = { class: "fm-transfer-panel__body" };
|
|
17
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
18
|
+
...{
|
|
19
|
+
name: "FmTransfer"
|
|
20
|
+
},
|
|
21
|
+
__name: "index",
|
|
22
|
+
props: {
|
|
23
|
+
leftTitle: String,
|
|
24
|
+
rightTitle: String,
|
|
25
|
+
options: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: () => ({
|
|
28
|
+
value: "id",
|
|
29
|
+
label: "name",
|
|
30
|
+
disabled: "disabled"
|
|
31
|
+
})
|
|
32
|
+
},
|
|
33
|
+
leftData: { type: Array, default: () => [] },
|
|
34
|
+
// 左边全部数据
|
|
35
|
+
rightData: { type: Array, default: () => [] }
|
|
36
|
+
// 右边全部数据
|
|
37
|
+
},
|
|
38
|
+
emits: ["left", "right", "allLeft", "allRight", "update:leftData", "update:rightData"],
|
|
39
|
+
setup(__props, { emit: __emit }) {
|
|
40
|
+
const props = __props;
|
|
41
|
+
const emits = __emit;
|
|
42
|
+
const state = vue.reactive({
|
|
43
|
+
leftAllChecked: false,
|
|
44
|
+
// 左边是否全选
|
|
45
|
+
leftKeyword: "",
|
|
46
|
+
// 左边搜索关键词
|
|
47
|
+
leftChecked: [],
|
|
48
|
+
// 左边选中数据
|
|
49
|
+
rightAllChecked: false,
|
|
50
|
+
// 右边是否全选
|
|
51
|
+
rightKeyword: "",
|
|
52
|
+
// 右边搜索关键词
|
|
53
|
+
rightChecked: []
|
|
54
|
+
// 右边选中数据
|
|
55
|
+
});
|
|
56
|
+
const leftFilterData = vue.computed(() => {
|
|
57
|
+
let result = props.leftData.filter((e) => e[props.options.label].toLowerCase().includes(state.leftKeyword.toLowerCase()));
|
|
58
|
+
if (state.leftChecked.length > 0) {
|
|
59
|
+
for (let i = state.leftChecked.length - 1; i >= 0; i--) {
|
|
60
|
+
const index = result.findIndex((e) => e[props.options.value] == state.leftChecked[i]);
|
|
61
|
+
if (index == -1) state.leftChecked.splice(i, 1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
});
|
|
66
|
+
const handleLeftAllChecked = (value) => {
|
|
67
|
+
state.leftChecked = value ? leftFilterData.value.filter((e) => e[props.options.disabled] == false).map((e) => e[props.options.value]) : [];
|
|
68
|
+
};
|
|
69
|
+
const leftIndeterminate = vue.computed(() => {
|
|
70
|
+
const checkedLength = state.leftChecked.length;
|
|
71
|
+
const result = checkedLength > 0 && checkedLength < leftFilterData.value.filter((e) => e[props.options.disabled] == false).length;
|
|
72
|
+
return result;
|
|
73
|
+
});
|
|
74
|
+
vue.watch(
|
|
75
|
+
() => state.leftChecked,
|
|
76
|
+
(val) => {
|
|
77
|
+
state.leftAllChecked = val.length > 0 && val.length == leftFilterData.value.filter((e) => e[props.options.disabled] == false).length;
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
const rightFilterData = vue.computed(() => {
|
|
81
|
+
let result = props.rightData.filter((e) => e[props.options.label].toLowerCase().includes(state.rightKeyword.toLowerCase()));
|
|
82
|
+
if (state.rightChecked.length > 0) {
|
|
83
|
+
for (let i = state.rightChecked.length - 1; i >= 0; i--) {
|
|
84
|
+
const index = result.findIndex((e) => e[props.options.value] == state.rightChecked[i]);
|
|
85
|
+
if (index == -1) state.rightChecked.splice(i, 1);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
|
+
});
|
|
90
|
+
const handleRightAllChecked = (value) => {
|
|
91
|
+
state.rightChecked = value ? rightFilterData.value.filter((e) => e[props.options.disabled] == false).map((e) => e[props.options.value]) : [];
|
|
92
|
+
};
|
|
93
|
+
const rightIndeterminate = vue.computed(() => {
|
|
94
|
+
const checkedLength = state.rightChecked.length;
|
|
95
|
+
const result = checkedLength > 0 && checkedLength < rightFilterData.value.filter((e) => e[props.options.disabled] == false).length;
|
|
96
|
+
return result;
|
|
97
|
+
});
|
|
98
|
+
vue.watch(
|
|
99
|
+
() => state.rightChecked,
|
|
100
|
+
(val) => {
|
|
101
|
+
state.rightAllChecked = val.length > 0 && val.length == rightFilterData.value.filter((e) => e[props.options.disabled] == false).length;
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
const dbClickToRight = (item) => {
|
|
105
|
+
if (item[props.options.value] && item[props.options.disabled] === false) {
|
|
106
|
+
let adds = props.leftData.filter((e) => item[props.options.value] == e[props.options.value]);
|
|
107
|
+
let cuts = props.leftData.filter((e) => item[props.options.value] != e[props.options.value]);
|
|
108
|
+
emits("update:leftData", cuts);
|
|
109
|
+
emits("update:rightData", props.rightData.concat(adds));
|
|
110
|
+
emits("right");
|
|
111
|
+
state.leftChecked = state.leftChecked.filter((e) => item[props.options.value] != e);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const toRight = () => {
|
|
115
|
+
if (state.leftChecked?.length > 0) {
|
|
116
|
+
let adds = props.leftData.filter((e) => state.leftChecked.some((x) => x == e[props.options.value]));
|
|
117
|
+
let cuts = props.leftData.filter((e) => state.leftChecked.every((x) => x != e[props.options.value]));
|
|
118
|
+
emits("update:leftData", cuts);
|
|
119
|
+
emits("update:rightData", props.rightData.concat(adds));
|
|
120
|
+
emits("right");
|
|
121
|
+
state.leftChecked = [];
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const allToRight = () => {
|
|
125
|
+
if (leftFilterData.value?.length > 0) {
|
|
126
|
+
let temp = leftFilterData.value.filter((e) => e[props.options.disabled] == false);
|
|
127
|
+
let adds = props.leftData.filter((e) => temp.some((x) => x[props.options.value] == e[props.options.value]));
|
|
128
|
+
let cuts = props.leftData.filter((e) => temp.every((x) => x[props.options.value] != e[props.options.value]));
|
|
129
|
+
emits("update:leftData", cuts);
|
|
130
|
+
emits("update:rightData", props.rightData.concat(adds));
|
|
131
|
+
emits("allRight");
|
|
132
|
+
state.leftChecked = [];
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const dbClickToLeft = (item) => {
|
|
136
|
+
if (item[props.options.value] && item[props.options.disabled] === false) {
|
|
137
|
+
let adds = props.rightData.filter((e) => item[props.options.value] == e[props.options.value]);
|
|
138
|
+
let cuts = props.rightData.filter((e) => item[props.options.value] != e[props.options.value]);
|
|
139
|
+
emits("update:leftData", props.leftData.concat(adds));
|
|
140
|
+
emits("update:rightData", cuts);
|
|
141
|
+
emits("left");
|
|
142
|
+
state.rightChecked = state.rightChecked.filter((e) => item[props.options.value] != e);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const toLeft = () => {
|
|
146
|
+
if (state.rightChecked?.length > 0) {
|
|
147
|
+
let adds = props.rightData.filter((e) => state.rightChecked.some((x) => x == e[props.options.value]));
|
|
148
|
+
let cuts = props.rightData.filter((e) => state.rightChecked.every((x) => x != e[props.options.value]));
|
|
149
|
+
emits("update:leftData", props.leftData.concat(adds));
|
|
150
|
+
emits("update:rightData", cuts);
|
|
151
|
+
emits("left");
|
|
152
|
+
state.rightChecked = [];
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const allToLeft = () => {
|
|
156
|
+
if (rightFilterData.value?.length > 0) {
|
|
157
|
+
let temp = rightFilterData.value.filter((e) => e[props.options.disabled] == false);
|
|
158
|
+
let adds = props.rightData.filter((e) => temp.some((x) => x[props.options.value] == e[props.options.value]));
|
|
159
|
+
let cuts = props.rightData.filter((e) => temp.every((x) => x[props.options.value] != e[props.options.value]));
|
|
160
|
+
emits("update:leftData", props.leftData.concat(adds));
|
|
161
|
+
emits("update:rightData", cuts);
|
|
162
|
+
emits("allLeft");
|
|
163
|
+
state.rightChecked = [];
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return (_ctx, _cache) => {
|
|
167
|
+
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
|
|
168
|
+
const _component_el_input = vue.resolveComponent("el-input");
|
|
169
|
+
const _component_el_checkbox_group = vue.resolveComponent("el-checkbox-group");
|
|
170
|
+
const _component_el_col = vue.resolveComponent("el-col");
|
|
171
|
+
const _component_el_button = vue.resolveComponent("el-button");
|
|
172
|
+
const _component_el_row = vue.resolveComponent("el-row");
|
|
173
|
+
return vue.openBlock(), vue.createBlock(_component_el_row, { gutter: 10 }, {
|
|
174
|
+
default: vue.withCtx(() => [
|
|
175
|
+
vue.createVNode(_component_el_col, { span: 10 }, {
|
|
176
|
+
default: vue.withCtx(() => [
|
|
177
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
178
|
+
vue.createElementVNode("p", _hoisted_2, [
|
|
179
|
+
vue.createVNode(_component_el_checkbox, {
|
|
180
|
+
modelValue: state.leftAllChecked,
|
|
181
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.leftAllChecked = $event),
|
|
182
|
+
indeterminate: leftIndeterminate.value,
|
|
183
|
+
"validate-event": false,
|
|
184
|
+
onChange: handleLeftAllChecked
|
|
185
|
+
}, {
|
|
186
|
+
default: vue.withCtx(() => [
|
|
187
|
+
vue.createTextVNode(
|
|
188
|
+
vue.toDisplayString(props.leftTitle),
|
|
189
|
+
1
|
|
190
|
+
/* TEXT */
|
|
191
|
+
)
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
/* STABLE */
|
|
195
|
+
}, 8, ["modelValue", "indeterminate"]),
|
|
196
|
+
vue.createElementVNode(
|
|
197
|
+
"span",
|
|
198
|
+
null,
|
|
199
|
+
vue.toDisplayString(state.leftChecked.length) + "/" + vue.toDisplayString(props.leftData.length),
|
|
200
|
+
1
|
|
201
|
+
/* TEXT */
|
|
202
|
+
)
|
|
203
|
+
]),
|
|
204
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
205
|
+
vue.createVNode(_component_el_input, {
|
|
206
|
+
class: "transfer-panel__filter",
|
|
207
|
+
modelValue: state.leftKeyword,
|
|
208
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.leftKeyword = $event),
|
|
209
|
+
placeholder: "\u641C\u7D22",
|
|
210
|
+
"prefix-icon": "ele-Search",
|
|
211
|
+
clearable: "",
|
|
212
|
+
"validate-event": false
|
|
213
|
+
}, null, 8, ["modelValue"]),
|
|
214
|
+
vue.withDirectives(vue.createVNode(_component_el_checkbox_group, {
|
|
215
|
+
modelValue: state.leftChecked,
|
|
216
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => state.leftChecked = $event),
|
|
217
|
+
"validate-event": false,
|
|
218
|
+
class: "fm-transfer-panel__list"
|
|
219
|
+
}, {
|
|
220
|
+
default: vue.withCtx(() => [
|
|
221
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
222
|
+
vue.Fragment,
|
|
223
|
+
null,
|
|
224
|
+
vue.renderList(leftFilterData.value, (item, index) => {
|
|
225
|
+
return vue.openBlock(), vue.createBlock(_component_el_checkbox, {
|
|
226
|
+
key: index,
|
|
227
|
+
value: item[props.options.value],
|
|
228
|
+
label: item[props.options.label],
|
|
229
|
+
disabled: item[props.options.disabled],
|
|
230
|
+
"validate-event": false,
|
|
231
|
+
class: "fm-transfer-panel__item",
|
|
232
|
+
onDblclick: ($event) => dbClickToRight(item)
|
|
233
|
+
}, null, 8, ["value", "label", "disabled", "onDblclick"]);
|
|
234
|
+
}),
|
|
235
|
+
128
|
|
236
|
+
/* KEYED_FRAGMENT */
|
|
237
|
+
))
|
|
238
|
+
]),
|
|
239
|
+
_: 1
|
|
240
|
+
/* STABLE */
|
|
241
|
+
}, 8, ["modelValue"]), [
|
|
242
|
+
[vue.vShow, true]
|
|
243
|
+
])
|
|
244
|
+
])
|
|
245
|
+
])
|
|
246
|
+
]),
|
|
247
|
+
_: 1
|
|
248
|
+
/* STABLE */
|
|
249
|
+
}),
|
|
250
|
+
vue.createVNode(_component_el_col, {
|
|
251
|
+
span: 4,
|
|
252
|
+
class: "fm-transfer-buttons"
|
|
253
|
+
}, {
|
|
254
|
+
default: vue.withCtx(() => [
|
|
255
|
+
vue.createElementVNode("div", _hoisted_4, [
|
|
256
|
+
vue.createVNode(_component_el_button, {
|
|
257
|
+
type: "primary",
|
|
258
|
+
style: {},
|
|
259
|
+
icon: "ele-ArrowRight",
|
|
260
|
+
onClick: toRight
|
|
261
|
+
})
|
|
262
|
+
]),
|
|
263
|
+
vue.createElementVNode("div", _hoisted_5, [
|
|
264
|
+
vue.createVNode(_component_el_button, {
|
|
265
|
+
type: "primary",
|
|
266
|
+
style: {},
|
|
267
|
+
icon: "ele-ArrowLeft",
|
|
268
|
+
onClick: toLeft
|
|
269
|
+
})
|
|
270
|
+
]),
|
|
271
|
+
vue.createElementVNode("div", _hoisted_6, [
|
|
272
|
+
vue.createVNode(_component_el_button, {
|
|
273
|
+
type: "primary",
|
|
274
|
+
style: {},
|
|
275
|
+
icon: "ele-DArrowRight",
|
|
276
|
+
onClick: allToRight
|
|
277
|
+
})
|
|
278
|
+
]),
|
|
279
|
+
vue.createElementVNode("div", _hoisted_7, [
|
|
280
|
+
vue.createVNode(_component_el_button, {
|
|
281
|
+
type: "primary",
|
|
282
|
+
style: {},
|
|
283
|
+
icon: "ele-DArrowLeft",
|
|
284
|
+
onClick: allToLeft
|
|
285
|
+
})
|
|
286
|
+
])
|
|
287
|
+
]),
|
|
288
|
+
_: 1
|
|
289
|
+
/* STABLE */
|
|
290
|
+
}),
|
|
291
|
+
vue.createVNode(_component_el_col, { span: 10 }, {
|
|
292
|
+
default: vue.withCtx(() => [
|
|
293
|
+
vue.createElementVNode("div", _hoisted_8, [
|
|
294
|
+
vue.createElementVNode("p", _hoisted_9, [
|
|
295
|
+
vue.createVNode(_component_el_checkbox, {
|
|
296
|
+
modelValue: state.rightAllChecked,
|
|
297
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => state.rightAllChecked = $event),
|
|
298
|
+
indeterminate: rightIndeterminate.value,
|
|
299
|
+
"validate-event": false,
|
|
300
|
+
onChange: handleRightAllChecked
|
|
301
|
+
}, {
|
|
302
|
+
default: vue.withCtx(() => [
|
|
303
|
+
vue.createTextVNode(
|
|
304
|
+
vue.toDisplayString(props.rightTitle),
|
|
305
|
+
1
|
|
306
|
+
/* TEXT */
|
|
307
|
+
)
|
|
308
|
+
]),
|
|
309
|
+
_: 1
|
|
310
|
+
/* STABLE */
|
|
311
|
+
}, 8, ["modelValue", "indeterminate"]),
|
|
312
|
+
vue.createElementVNode(
|
|
313
|
+
"span",
|
|
314
|
+
null,
|
|
315
|
+
vue.toDisplayString(state.rightChecked.length) + "/" + vue.toDisplayString(props.rightData.length),
|
|
316
|
+
1
|
|
317
|
+
/* TEXT */
|
|
318
|
+
)
|
|
319
|
+
]),
|
|
320
|
+
vue.createElementVNode("div", _hoisted_10, [
|
|
321
|
+
vue.createVNode(_component_el_input, {
|
|
322
|
+
class: "transfer-panel__filter",
|
|
323
|
+
modelValue: state.rightKeyword,
|
|
324
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => state.rightKeyword = $event),
|
|
325
|
+
placeholder: "\u641C\u7D22",
|
|
326
|
+
"prefix-icon": "ele-Search",
|
|
327
|
+
clearable: "",
|
|
328
|
+
"validate-event": false
|
|
329
|
+
}, null, 8, ["modelValue"]),
|
|
330
|
+
vue.withDirectives(vue.createVNode(_component_el_checkbox_group, {
|
|
331
|
+
modelValue: state.rightChecked,
|
|
332
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => state.rightChecked = $event),
|
|
333
|
+
"validate-event": false,
|
|
334
|
+
class: "fm-transfer-panel__list"
|
|
335
|
+
}, {
|
|
336
|
+
default: vue.withCtx(() => [
|
|
337
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
338
|
+
vue.Fragment,
|
|
339
|
+
null,
|
|
340
|
+
vue.renderList(rightFilterData.value, (item, index) => {
|
|
341
|
+
return vue.openBlock(), vue.createBlock(_component_el_checkbox, {
|
|
342
|
+
key: index,
|
|
343
|
+
value: item[props.options.value],
|
|
344
|
+
label: item[props.options.label],
|
|
345
|
+
disabled: item[props.options.disabled],
|
|
346
|
+
"validate-event": false,
|
|
347
|
+
class: "fm-transfer-panel__item",
|
|
348
|
+
onDblclick: ($event) => dbClickToLeft(item)
|
|
349
|
+
}, null, 8, ["value", "label", "disabled", "onDblclick"]);
|
|
350
|
+
}),
|
|
351
|
+
128
|
|
352
|
+
/* KEYED_FRAGMENT */
|
|
353
|
+
))
|
|
354
|
+
]),
|
|
355
|
+
_: 1
|
|
356
|
+
/* STABLE */
|
|
357
|
+
}, 8, ["modelValue"]), [
|
|
358
|
+
[vue.vShow, true]
|
|
359
|
+
])
|
|
360
|
+
])
|
|
361
|
+
])
|
|
362
|
+
]),
|
|
363
|
+
_: 1
|
|
364
|
+
/* STABLE */
|
|
365
|
+
})
|
|
366
|
+
]),
|
|
367
|
+
_: 1
|
|
368
|
+
/* STABLE */
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
exports.default = _sfc_main;
|