@kyfe/fms-vue2-components 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/css/fms-ks-search-tips-new.css +1 -1
- package/dist/{date-picker-bottom.17e75dc0.js → date-picker-bottom.08bb5468.js} +1 -1
- package/dist/{date-picker-dropdown.1d8e9f00.js → date-picker-dropdown.6bdf8884.js} +1 -1
- package/dist/{date-picker-right.b939e886.js → date-picker-right.0b16e9e5.js} +1 -1
- package/dist/{date-picker-top.c38046f7.js → date-picker-top.bb84a0cf.js} +1 -1
- package/dist/{date-week-month.169b98bc.js → date-week-month.7ac3a67e.js} +1 -1
- package/dist/fms-ks-components/index.js +2 -2
- package/dist/{fms-ks-components.a5d9329b.js → fms-ks-components.53289d17.js} +6 -6
- package/dist/fms-ks-form-grid/index.js +1 -1
- package/dist/fms-ks-search-tips-new/index.js +2 -2
- package/dist/{fms-ks-search-tips-new.7d08f710.js → fms-ks-search-tips-new.d68b86e6.js} +19 -16
- package/dist/fms-ks-upload/index.js +143 -0
- package/dist/fms-ks-upload/style.css +1 -0
- package/dist/index.js +29 -26
- package/dist/{mixin.f4bc60f0.js → mixin.7a8d8392.js} +1 -1
- package/dist/oa-datetime-picker-new/style.css +1 -1
- package/package.json +1 -1
- package/src/components/datetime-popup/index.js +0 -1
- package/src/components/fms-ks-search-tips-new/fms-ks-search-tips-new.vue +7 -2
- package/src/components/fms-ks-upload/camera.svg +1 -0
- package/src/components/fms-ks-upload/fms-ks-upload.vue +302 -0
- package/src/components/fms-ks-upload/index.js +7 -0
- package/src/components/fms-ks-upload//344/270/212/344/274/240/347/273/204/344/273/266.md +0 -0
- package/src/index.js +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
.fms-search-tips-new[data-v-
|
|
1
|
+
.fms-search-tips-new[data-v-349961a0] .van-cell__value{overflow:initial}.fms-search-tips-new__content[data-v-349961a0]{display:flex;flex-direction:column;border-radius:12px 12px 0 0;font-size:14px;overflow:hidden}.fms-search-tips-new__content-title[data-v-349961a0]{height:48px;color:#333;font-weight:700;padding:0 16px;border-bottom:1px solid #ebedf5;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;flex-grow:0;font-size:16px}.fms-search-tips-new__content-title .van-icon[data-v-349961a0]{cursor:pointer}.fms-search-tips-new__content-title.close-left[data-v-349961a0]{justify-content:flex-start}.fms-search-tips-new__content-title.close-left .van-icon[data-v-349961a0]{margin-right:8px}.fms-search-tips-new__content-search[data-v-349961a0]{flex-shrink:0;flex-grow:0;padding:8px 16px!important}.fms-search-tips-new__content-search[data-v-349961a0] .van-cell{background-color:transparent!important}.fms-search-tips-new__content-search[data-v-349961a0] .van-cell .van-field__body{padding-left:0}.fms-search-tips-new__content-search.has-action[data-v-349961a0] .van-search__content{border-radius:8px 0 0 8px!important}.fms-search-tips-new__content-search.has-action[data-v-349961a0] .van-search__action{padding:0;height:100%}.fms-search-tips-new__content-search.has-action[data-v-349961a0] .van-search__action .van-button{border-radius:0 8px 8px 0!important;height:36px}.fms-search-tips-new__content-loading[data-v-349961a0]{display:flex;justify-content:center;padding:12px 0}.fms-search-tips-new__content-current[data-v-349961a0]{flex-shrink:0;flex-grow:0;margin:0 16px;border-bottom:1px solid #ebedf5}.fms-search-tips-new__content-current .current-title[data-v-349961a0]{color:#1a1a1a;font-weight:700}.fms-search-tips-new__content-current .current-value[data-v-349961a0]{height:36px;line-height:36px;border-radius:18px;background:#f7f8fa;display:inline-flex;padding:0 12px;align-items:center;margin:8px 0;max-width:100%;overflow:hidden}.fms-search-tips-new__content-current .current-value__text[data-v-349961a0]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fms-search-tips-new__content-current .current-value__line[data-v-349961a0]{width:1px;height:12px;opacity:1;flex-grow:0;flex-shrink:0;background:#d7d7db;margin:0 8px}.fms-search-tips-new__content-current .current-value__icon[data-v-349961a0]{flex-grow:0;flex-shrink:0}.fms-search-tips-new__content-list[data-v-349961a0]{padding:0 16px;overflow:auto;height:0;flex:1;-webkit-overflow-scrolling:touch}.fms-search-tips-new__content-list .list-item[data-v-349961a0]{line-height:1.2;padding:12px 0;color:#333;word-break:break-all}.ios .fms-search-tips-new__content.is-full-popup{padding-top:20px!important}.ipx .fms-search-tips-new__content.is-full-popup{padding-top:46px!important}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as r, M as s, W as c } from "./fms-ks-components.
|
|
1
|
+
import { D as r, M as s, W as c } from "./fms-ks-components.53289d17.js";
|
|
2
2
|
import { t as o } from "./utils.159fba19.js";
|
|
3
3
|
import { n as i } from "./plugin-vue2_normalizer.ed7092a9.js";
|
|
4
4
|
import './oa-datetime-picker-new/style.css';const _ = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './../fms-copy-box/style.css';
|
|
2
|
-
import { F as o } from "../fms-ks-components.
|
|
3
|
-
import { F as a } from "../fms-ks-components.
|
|
2
|
+
import { F as o } from "../fms-ks-components.53289d17.js";
|
|
3
|
+
import { F as a } from "../fms-ks-components.53289d17.js";
|
|
4
4
|
o.install = function(n) {
|
|
5
5
|
n.component(o.name, o);
|
|
6
6
|
};
|
|
@@ -7,7 +7,7 @@ import { F as d_ } from "./fms-ks-select.59416fd8.js";
|
|
|
7
7
|
import { F as __ } from "./fms-ks-picker.766b55f9.js";
|
|
8
8
|
import { F as v_ } from "./fms-ks-select-box.a00f0f08.js";
|
|
9
9
|
import { F as m_ } from "./fms-ks-search-tips.d36859c3.js";
|
|
10
|
-
import { F as g_ } from "./fms-ks-search-tips-new.
|
|
10
|
+
import { F as g_ } from "./fms-ks-search-tips-new.d68b86e6.js";
|
|
11
11
|
import { F as y_ } from "./fms-ks-clamp-text.24eb5e8d.js";
|
|
12
12
|
import './assets/css/fms-ks-components.css';var fr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Bt = {
|
|
13
13
|
exports: {}
|
|
@@ -3902,19 +3902,19 @@ const B_ = I_.exports, z_ = {
|
|
|
3902
3902
|
"./quarter-select.b6256880.js"
|
|
3903
3903
|
), Z_ = () => import(
|
|
3904
3904
|
/* webpackChunkName: "date-week-month" */
|
|
3905
|
-
"./date-week-month.
|
|
3905
|
+
"./date-week-month.7ac3a67e.js"
|
|
3906
3906
|
), Q_ = () => import(
|
|
3907
3907
|
/* webpackChunkName: "date-picker-bottom" */
|
|
3908
|
-
"./date-picker-bottom.
|
|
3908
|
+
"./date-picker-bottom.08bb5468.js"
|
|
3909
3909
|
), G_ = () => import(
|
|
3910
3910
|
/* webpackChunkName: "date-picker-top" */
|
|
3911
|
-
"./date-picker-top.
|
|
3911
|
+
"./date-picker-top.bb84a0cf.js"
|
|
3912
3912
|
), J_ = () => import(
|
|
3913
3913
|
/* webpackChunkName: "date-picker-right" */
|
|
3914
|
-
"./date-picker-right.
|
|
3914
|
+
"./date-picker-right.0b16e9e5.js"
|
|
3915
3915
|
), X_ = () => import(
|
|
3916
3916
|
/* webpackChunkName: "date-picker-dropdown" */
|
|
3917
|
-
"./date-picker-dropdown.
|
|
3917
|
+
"./date-picker-dropdown.6bdf8884.js"
|
|
3918
3918
|
), Rv = q_, Ov = V_, Nv = U_, Ev = K_, Iv = W_, Bv = H_, zv = Z_, ev = Q_, tv = G_, rv = J_, nv = X_;
|
|
3919
3919
|
const iv = {
|
|
3920
3920
|
month: "YYYY/MM",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './../fms-copy-box/style.css';
|
|
2
2
|
import { get as n } from "lodash";
|
|
3
|
-
import { F as f } from "../fms-ks-components.
|
|
3
|
+
import { F as f } from "../fms-ks-components.53289d17.js";
|
|
4
4
|
import { n as a } from "../plugin-vue2_normalizer.ed7092a9.js";
|
|
5
5
|
import './style.css';class c {
|
|
6
6
|
constructor(t) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './../fms-copy-box/style.css';
|
|
2
|
-
import { F as o } from "../fms-ks-search-tips-new.
|
|
3
|
-
import { F as s } from "../fms-ks-search-tips-new.
|
|
2
|
+
import { F as o } from "../fms-ks-search-tips-new.d68b86e6.js";
|
|
3
|
+
import { F as s } from "../fms-ks-search-tips-new.d68b86e6.js";
|
|
4
4
|
o.install = function(a) {
|
|
5
5
|
a.component(o.name, o);
|
|
6
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n } from "./plugin-vue2_normalizer.ed7092a9.js";
|
|
2
|
-
import './assets/css/fms-ks-search-tips-new.css';const
|
|
2
|
+
import './assets/css/fms-ks-search-tips-new.css';const l = window.vant && window.vant.Toast, i = {
|
|
3
3
|
name: "FmsKsSearchTipsNew",
|
|
4
4
|
props: {
|
|
5
5
|
label: String,
|
|
@@ -69,23 +69,26 @@ import './assets/css/fms-ks-search-tips-new.css';const a = window.vant && window
|
|
|
69
69
|
t.value = "", this.searchStr = "", s.inputValue = "";
|
|
70
70
|
},
|
|
71
71
|
async onChange(s) {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
this.searchStr = s;
|
|
73
|
+
},
|
|
74
|
+
async onSearch() {
|
|
75
|
+
let s = this.searchStr, e = s.length;
|
|
76
|
+
if (e !== 0)
|
|
74
77
|
if (e >= this.inputLength && this.url && this.appkey)
|
|
75
78
|
try {
|
|
76
79
|
this.loading = !0;
|
|
77
|
-
let t = this.formatData(s),
|
|
78
|
-
|
|
80
|
+
let t = this.formatData(s), a = await this.$http(this.url, this.appkey, t) || [];
|
|
81
|
+
a = this.formatResult ? this.formatResult(a, s) : a, a.length === 0 && !this.noEmptyMessage && l(this.message || "\u641C\u7D22\u7ED3\u679C\u4E3A\u7A7A"), this.searchList = a;
|
|
79
82
|
} catch {
|
|
80
83
|
this.onClose();
|
|
81
84
|
} finally {
|
|
82
85
|
this.loading = !1;
|
|
83
86
|
}
|
|
84
87
|
else
|
|
85
|
-
|
|
88
|
+
l(`\u5B57\u6570\u4E0D\u5C11\u4E8E${this.inputLength}`);
|
|
86
89
|
},
|
|
87
90
|
getValue(s) {
|
|
88
|
-
return this.keys.reduce((t,
|
|
91
|
+
return this.keys.reduce((t, a) => (t.push(s[a]), t), []).join(", ");
|
|
89
92
|
},
|
|
90
93
|
onSelect(s) {
|
|
91
94
|
this.$emit("select", s), this.$emit("selectItem", s), this.hidePopup(), this.onClose();
|
|
@@ -100,14 +103,14 @@ import './assets/css/fms-ks-search-tips-new.css';const a = window.vant && window
|
|
|
100
103
|
};
|
|
101
104
|
var o = function() {
|
|
102
105
|
var e = this, t = e._self._c;
|
|
103
|
-
return t("div", { staticClass: "fms-search-tips-new" }, [t("van-field", { attrs: { required: e.required, inputAlign: e.inputAlign, placeholder: e.placeholder, value: e.value, rules: e.rules, label: e.label, maxlength: e.maxlength, "is-link": e.isLink, readonly: "" }, on: { click: e.showPopup } }, [e.$slots.label ? t("template", { slot: "label" }, [e._t("label")], 2) : e._e(), e.$slots.rightIcon ? t("template", { slot: "right-icon" }, [e._t("rightIcon")], 2) : e._e()], 2), t("van-popup", { staticClass: "fms-search-tips-new__content", class: { "is-full-popup": e.isFullPopup }, style: { height: e.isFullPopup ? "100%" : e.popupHeight, ...e.popupStyle }, attrs: { position: "bottom", "get-container": e.getContainer }, on: { opened: e.onOpened, close: e.onClose }, model: { value: e.show, callback: function(
|
|
104
|
-
e.show =
|
|
105
|
-
}, expression: "show" } }, [e.isFullPopup ? t("div", { staticClass: "fms-search-tips-new__content-title close-left" }, [t("van-icon", { attrs: { name: "arrow-left", color: "#333", size: "20" }, on: { click: e.hidePopup } }), e._v(" " + e._s(e.label) + " ")], 1) : t("div", { staticClass: "fms-search-tips-new__content-title" }, [e._v(" " + e._s(e.label) + " "), t("van-icon", { attrs: { name: "cross", color: "#A2A2AD" }, on: { click: e.hidePopup } })], 1), t("form", { attrs: { action: "/" } }, [t("ks-input-search", { ref: "search", staticClass: "fms-search-tips-new__content-search", class: { "has-action": e.$scopedSlots.action }, attrs: { placeholder: e.placeholder, "show-action": !!e.$scopedSlots.action, maxlength: e.maxlength }, on: { change: e.onChange }, model: { value: e.searchStr, callback: function(
|
|
106
|
-
e.searchStr =
|
|
107
|
-
}, expression: "searchStr" } }, [e._t("action", null, { slot: "action", input: e.searchStr, close: e.hidePopup })], 2)], 1), e._t("default", null, { list: e.searchList, input: e.searchStr, loading: e.loading }), e.$scopedSlots.default ? e._e() : [e.value ? t("div", { staticClass: "fms-search-tips-new__content-current" }, [t("div", { staticClass: "current-title" }, [e._v("\u5F53\u524D\u9009\u62E9")]), t("div", { staticClass: "current-value" }, [t("span", { staticClass: "current-value__text" }, [e._v(e._s(e.value))]), t("i", { staticClass: "current-value__line" }), t("van-icon", { staticClass: "currnet-value__icon", attrs: { name: "cross", color: "#A2A2AD" }, on: { click: e.onClear } })], 1)]) : e._e(), t("div", { staticClass: "fms-search-tips-new__content-list" }, [e.loading ? t("div", { staticClass: "fms-search-tips-new__content-loading" }, [t("van-loading", { attrs: { size: "36px" } })], 1) : e._l(e.searchList, function(
|
|
108
|
-
return t("div", { key:
|
|
109
|
-
return e.onSelect(
|
|
110
|
-
} } }, [e._v(" " + e._s(e.getValue(
|
|
106
|
+
return t("div", { staticClass: "fms-search-tips-new" }, [t("van-field", { attrs: { required: e.required, inputAlign: e.inputAlign, placeholder: e.placeholder, value: e.value, rules: e.rules, label: e.label, maxlength: e.maxlength, "is-link": e.isLink, readonly: "" }, on: { click: e.showPopup } }, [e.$slots.label ? t("template", { slot: "label" }, [e._t("label")], 2) : e._e(), e.$slots.rightIcon ? t("template", { slot: "right-icon" }, [e._t("rightIcon")], 2) : e._e()], 2), t("van-popup", { staticClass: "fms-search-tips-new__content", class: { "is-full-popup": e.isFullPopup }, style: { height: e.isFullPopup ? "100%" : e.popupHeight, ...e.popupStyle }, attrs: { position: "bottom", "get-container": e.getContainer }, on: { opened: e.onOpened, close: e.onClose }, model: { value: e.show, callback: function(a) {
|
|
107
|
+
e.show = a;
|
|
108
|
+
}, expression: "show" } }, [e.isFullPopup ? t("div", { staticClass: "fms-search-tips-new__content-title close-left" }, [t("van-icon", { attrs: { name: "arrow-left", color: "#333", size: "20" }, on: { click: e.hidePopup } }), e._v(" " + e._s(e.label) + " ")], 1) : t("div", { staticClass: "fms-search-tips-new__content-title" }, [e._v(" " + e._s(e.label) + " "), t("van-icon", { attrs: { name: "cross", color: "#A2A2AD" }, on: { click: e.hidePopup } })], 1), t("form", { attrs: { action: "/" } }, [t("ks-input-search", { ref: "search", staticClass: "fms-search-tips-new__content-search", class: { "has-action": e.$scopedSlots.action }, attrs: { placeholder: e.placeholder, "show-action": !!e.$scopedSlots.action, maxlength: e.maxlength }, on: { change: e.onChange, blur: e.onSearch }, model: { value: e.searchStr, callback: function(a) {
|
|
109
|
+
e.searchStr = a;
|
|
110
|
+
}, expression: "searchStr" } }, [e._t("action", null, { slot: "action", input: e.searchStr, close: e.hidePopup })], 2)], 1), e._t("default", null, { list: e.searchList, input: e.searchStr, loading: e.loading }), e.$scopedSlots.default ? e._e() : [e.value ? t("div", { staticClass: "fms-search-tips-new__content-current" }, [t("div", { staticClass: "current-title" }, [e._v("\u5F53\u524D\u9009\u62E9")]), t("div", { staticClass: "current-value" }, [t("span", { staticClass: "current-value__text" }, [e._v(e._s(e.value))]), t("i", { staticClass: "current-value__line" }), t("van-icon", { staticClass: "currnet-value__icon", attrs: { name: "cross", color: "#A2A2AD" }, on: { click: e.onClear } })], 1)]) : e._e(), t("div", { staticClass: "fms-search-tips-new__content-list" }, [e.loading ? t("div", { staticClass: "fms-search-tips-new__content-loading" }, [t("van-loading", { attrs: { size: "36px" } })], 1) : e._l(e.searchList, function(a) {
|
|
111
|
+
return t("div", { key: a[e.valueKey], staticClass: "list-item", on: { click: function(u) {
|
|
112
|
+
return e.onSelect(a);
|
|
113
|
+
} } }, [e._v(" " + e._s(e.getValue(a)) + " ")]);
|
|
111
114
|
})], 2)]], 2)], 1);
|
|
112
115
|
}, r = [], c = /* @__PURE__ */ n(
|
|
113
116
|
i,
|
|
@@ -115,7 +118,7 @@ var o = function() {
|
|
|
115
118
|
r,
|
|
116
119
|
!1,
|
|
117
120
|
null,
|
|
118
|
-
"
|
|
121
|
+
"349961a0",
|
|
119
122
|
null,
|
|
120
123
|
null
|
|
121
124
|
);
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import './../fms-copy-box/style.css';
|
|
2
|
+
import { n as l } from "../plugin-vue2_normalizer.ed7092a9.js";
|
|
3
|
+
import './style.css';const r = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBmaWxsPSJub25lIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxNS4wMTAyNTM5MDYyNSIgaGVpZ2h0PSIxMy45MzgxMTAzNTE1NjI1IiB2aWV3Qm94PSIwIDAgMTUuMDEwMjUzOTA2MjUgMTMuOTM4MTEwMzUxNTYyNSI+PGc+PGc+PHBhdGggZD0iTTMuNzUyNDQsMi4xNDQyOUwyLjI1LDIuMTQ0MjlDMS4wMDczNiwyLjE0NDI5LDAsMy4xNTE2NSwwLDQuMzk0MjlMMCwxMS42ODgxQzAsMTIuOTMwOCwxLjAwNzM2LDEzLjkzODEsMi4yNSwxMy45MzgxTDEyLjc2MDMsMTMuOTM4MUMxNC4wMDI5LDEzLjkzODEsMTUuMDEwMywxMi45MzA4LDE1LjAxMDMsMTEuNjg4MUwxNS4wMTAzLDQuMzk0MjlDMTUuMDEwMywzLjE1MTY1LDE0LjAwMjksMi4xNDQyOSwxMi43NjAzLDIuMTQ0MjlMMTEuMjU3OCwyLjE0NDI5QzExLjI1NzgsMC45NjAwMDYsMTAuMjk3NiwwLDkuMTEzMjgsMEw1Ljg5Njk3LDBDNC43MTI2OSwwLDMuNzUyNDQsMC45NjAwMDYsMy43NTI0NCwyLjE0NDI5Wk0xMS4yMDM2LDcuNzcyNzFDMTEuMjAzNiw5LjgxNTMsOS41NDc0OCwxMS40NzExLDcuNTA0ODgsMTEuNDcxMUM1LjQ2MjI4LDExLjQ3MTEsMy44MDY2NCw5LjgxNTMsMy44MDY2NCw3Ljc3MjcxQzMuODA2NjQsNS43MzAxMSw1LjQ2MjI4LDQuMDc0MjIsNy41MDQ4OCw0LjA3NDIyQzkuNTQ3NDgsNC4wNzQyMiwxMS4yMDM2LDUuNzMwMTEsMTEuMjAzNiw3Ljc3MjcxWk05LjcwMzYxLDcuNzcyNzFDOS43MDM2MSw2LjU1ODUzLDguNzE5MDYsNS41NzQyMiw3LjUwNDg4LDUuNTc0MjJDNi4yOTA3MSw1LjU3NDIyLDUuMzA2NjQsNi41NTg1Myw1LjMwNjY0LDcuNzcyNzFDNS4zMDY2NCw4Ljk4Njg4LDYuMjkwNzEsOS45NzEwNyw3LjUwNDg4LDkuOTcxMDdDOC43MTkwNiw5Ljk3MTA3LDkuNzAzNjEsOC45ODY4OCw5LjcwMzYxLDcuNzcyNzFaIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiNFM0U1RUQiIGZpbGwtb3BhY2l0eT0iMSIvPjwvZz48L2c+PC9zdmc+";
|
|
4
|
+
const c = window.vant && window.vant.Toast, M = {
|
|
5
|
+
name: "FmsKsUpload",
|
|
6
|
+
props: {
|
|
7
|
+
value: {
|
|
8
|
+
type: Array,
|
|
9
|
+
default: () => []
|
|
10
|
+
},
|
|
11
|
+
bizId: String,
|
|
12
|
+
bizCode: String,
|
|
13
|
+
maxLength: Number,
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "edit"
|
|
17
|
+
},
|
|
18
|
+
process: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 100
|
|
21
|
+
},
|
|
22
|
+
onPreviewBefore: Function
|
|
23
|
+
},
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
show: !1,
|
|
27
|
+
actions: [{ name: "\u4ECE\u76F8\u518C\u9009\u62E9" }, { name: "\u62CD\u7167" }],
|
|
28
|
+
showPdf: !1,
|
|
29
|
+
pdfUrl: ""
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
onPreview() {
|
|
34
|
+
this.onPreviewBefore && typeof this.onPreviewBefore == "function" && this.onPreviewBefore() || (this.show = !0);
|
|
35
|
+
},
|
|
36
|
+
onCancel() {
|
|
37
|
+
this.show = !1;
|
|
38
|
+
},
|
|
39
|
+
async onSelect(t) {
|
|
40
|
+
let e = null;
|
|
41
|
+
try {
|
|
42
|
+
if (this.$emit("beforeSelect", t), t.name === "\u4ECE\u76F8\u518C\u9009\u62E9") {
|
|
43
|
+
const s = Number(this.maxLength - this.value.length);
|
|
44
|
+
console.log("\u4ECE\u76F8\u518C\u9009\u62E9", t, s, this.maxLength, this.value.length), e = await window.ks.callFunc({
|
|
45
|
+
method: "pickAssets",
|
|
46
|
+
params: {
|
|
47
|
+
totalCount: s,
|
|
48
|
+
allowRecordVideo: !1,
|
|
49
|
+
selectType: 1,
|
|
50
|
+
quality: 80
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
} else
|
|
54
|
+
t.name === "\u62CD\u7167" && (e = await window.ks.takeByCamera());
|
|
55
|
+
this.onCancel(), this.maxLength && e.length > this.maxLength ? c("\u9009\u62E9\u6587\u4EF6\u592A\u591A") : this.upload(e);
|
|
56
|
+
} catch (s) {
|
|
57
|
+
console.info("onSelect--error", s), s && s.msg && c(s.msg), this.onCancel();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
onDelete(t) {
|
|
61
|
+
let e = JSON.parse(JSON.stringify(this.value)), s = e[t];
|
|
62
|
+
e.splice(t, 1), this.$emit("input", e), this.$http("file.deleteByBizAndId", 10124, s).then((a) => {
|
|
63
|
+
this.$emit("deleteSuccess", a, s);
|
|
64
|
+
}).catch((a) => {
|
|
65
|
+
console.log(a);
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
async upload(t) {
|
|
69
|
+
try {
|
|
70
|
+
let e = await window.ks.uploadAssets({
|
|
71
|
+
filePaths: t.map((s) => s.filePath),
|
|
72
|
+
fileNames: t.map((s) => s.fileName),
|
|
73
|
+
bizCode: this.bizCode,
|
|
74
|
+
bizId: this.bizId
|
|
75
|
+
});
|
|
76
|
+
console.log("uploadRes---", e), this.$emit("input", e.reverse()), this.$emit("uploadsuccess", t, e), this.onCancel();
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.log("\u4E0A\u4F20\u5931\u8D25--", e);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
previewAssets(t, e) {
|
|
82
|
+
let s = e.filter((i) => (i.contentType || "").toLowerCase().startsWith("image") || ["jpg", "jpeg", "png", "bmp", "HEIC", "webp", "tiff"].includes(
|
|
83
|
+
(i.extendName || "").toLowerCase()
|
|
84
|
+
)).map((i) => i.url);
|
|
85
|
+
const a = s.findIndex((i) => i === t);
|
|
86
|
+
this.$emit("beforePreviewAssets", {
|
|
87
|
+
index: a,
|
|
88
|
+
list: e
|
|
89
|
+
}), window.ks.previewAssets({
|
|
90
|
+
index: a,
|
|
91
|
+
filePaths: s
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
pdfPreview(t) {
|
|
95
|
+
this.$emit("beforePreviewAssets", {
|
|
96
|
+
index,
|
|
97
|
+
list
|
|
98
|
+
}), window.ks.callFunc({
|
|
99
|
+
method: "previewFile",
|
|
100
|
+
params: {
|
|
101
|
+
filePath: t.url,
|
|
102
|
+
fileName: t.name,
|
|
103
|
+
fileSize: String(t.size)
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var w = function() {
|
|
110
|
+
var e = this, s = e._self._c;
|
|
111
|
+
return s("div", { staticClass: "van-uploader" }, [s("div", { staticClass: "van-uploader__wrapper" }, [e._l(e.value, function(a, i) {
|
|
112
|
+
return s("div", { key: i, staticClass: "van-uploader__preview" }, [s("div", { class: { "van-image": !0, "van-uploader__preview-image": !0 }, staticStyle: { overflow: "hidden", "border-radius": "4px", width: "52px", height: "52px" } }, [e.process !== 100 ? s("div", { staticClass: "mask-wrap" }, [s("div", { staticClass: "mask-content" }, [s("div", { staticClass: "mask-progress-bar" }, [s("div", { staticClass: "mask-progress-step", style: { width: `${e.process / 100 * 44}px` } })]), s("div", { staticClass: "mask-text" }, [e._v("\u8BC6\u522B\u4E2D")])])]) : e._e(), (a.contentType || "").toLowerCase().startsWith("image") || ["jpg", "jpeg", "png", "bmp", "HEIC", "webp", "tiff"].includes(
|
|
113
|
+
(a.extendName || "").toLowerCase()
|
|
114
|
+
) ? s("img", { staticClass: "van-image__img", staticStyle: { "object-fit": "cover" }, attrs: { src: a.url }, on: { click: function(o) {
|
|
115
|
+
return e.previewAssets(a.url, e.value);
|
|
116
|
+
} } }) : (a.contentType || "").toLowerCase().includes("pdf") || ["pdf"].includes((a.extendName || "").toLowerCase()) ? s("div", { on: { click: function(o) {
|
|
117
|
+
return e.pdfPreview(a);
|
|
118
|
+
} } }, [s("img", { staticClass: "van-image__img", attrs: { src: "https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/kuasheng-oa/images/pdf.svg", alt: "" } })]) : s("div", { staticClass: "van-uploader__upload", staticStyle: { margin: "0" } }, [e._m(0, !0)])]), e.type === "edit" ? s("i", { staticClass: "van-icon van-icon-clear van-uploader__preview-delete", staticStyle: { color: "#a7aab7", border: "1px solid #fff", fontSize: "14px" }, on: { click: function(o) {
|
|
119
|
+
return e.onDelete(i);
|
|
120
|
+
} } }) : e._e()]);
|
|
121
|
+
}), (e.maxLength && e.value.length < e.maxLength || !e.maxLength) && e.type === "edit" ? s("div", { staticClass: "van-uploader__upload", staticStyle: { "font-size": "22px" }, on: { click: e.onPreview } }, [s("img", { staticClass: "upload-icon", attrs: { src: r } })]) : e._e()], 2), s("ks-action-sheet", { attrs: { actions: e.actions, "get-container": "body", "cancel-text": "\u53D6\u6D88" }, on: { select: e.onSelect, cancel: e.onCancel }, model: { value: e.show, callback: function(a) {
|
|
122
|
+
e.show = a;
|
|
123
|
+
}, expression: "show" } })], 1);
|
|
124
|
+
}, u = [function() {
|
|
125
|
+
var t = this, e = t._self._c;
|
|
126
|
+
return e("div", { staticClass: "van-uploader__preview-show" }, [t._v("\u6587\u4EF6\u8BF7\u5230"), e("br"), t._v("ERP\u67E5\u770B")]);
|
|
127
|
+
}], d = /* @__PURE__ */ l(
|
|
128
|
+
M,
|
|
129
|
+
w,
|
|
130
|
+
u,
|
|
131
|
+
!1,
|
|
132
|
+
null,
|
|
133
|
+
"d54b97c2",
|
|
134
|
+
null,
|
|
135
|
+
null
|
|
136
|
+
);
|
|
137
|
+
const n = d.exports;
|
|
138
|
+
n.install = function(t) {
|
|
139
|
+
t.component(n.name, n);
|
|
140
|
+
};
|
|
141
|
+
export {
|
|
142
|
+
n as default
|
|
143
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.van-uploader[data-v-d54b97c2]{padding-top:4px}.van-uploader__upload[data-v-d54b97c2]{cursor:pointer;border-radius:4px}.van-uploader__preview-delete[data-v-d54b97c2]{font-size:18px;top:-8px;right:-8px;bottom:unset;border-radius:100%;background-color:#fff;color:#969799}.van-uploader .pdf-border[data-v-d54b97c2]{border:1px solid #e8e8e8;display:flex;align-items:center;padding:2px;color:#a6a6a6;font-size:12px}.van-uploader .mask-wrap[data-v-d54b97c2]{width:52px;height:52px;background-color:#000000b3;position:absolute;display:flex;justify-content:center;align-items:center}.van-uploader .mask-wrap .mask-content[data-v-d54b97c2]{display:flex;align-items:center;flex-direction:column;justify-content:center;margin-top:4px}.van-uploader .mask-wrap .mask-content .mask-progress-bar[data-v-d54b97c2]{width:44px;height:4px;background-color:#ffffff80;border-radius:2px}.van-uploader .mask-wrap .mask-content .mask-progress-bar .mask-progress-step[data-v-d54b97c2]{height:4px;background-color:#ffffffe6;border-radius:2px}.van-uploader .mask-wrap .mask-content .mask-text[data-v-d54b97c2]{line-height:24px;color:#fff;font-size:10px}.van-popup[data-v-d54b97c2]{overflow:inherit!important}.van-popup .close-btn[data-v-d54b97c2]{bottom:150px;position:absolute;left:50%;transform:translate(-50%);color:#fff;font-size:25px;background-color:#7972fe;border-radius:50%;border:none;padding:8px}[data-v-d54b97c2] .van-uploader__upload{border:.5px dashed #c6c6d0;width:52px;height:52px;background-color:#fff}.van-uploader__preview-show[data-v-d54b97c2]{font-size:12px;color:#999;text-align:center}
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
import './fms-copy-box/style.css';
|
|
2
|
-
import
|
|
3
|
-
import { default as
|
|
4
|
-
import
|
|
5
|
-
import { default as
|
|
2
|
+
import s from "./fms-copy-box/index.js";
|
|
3
|
+
import { default as G } from "./fms-copy-box/index.js";
|
|
4
|
+
import r from "./fms-empty/index.js";
|
|
5
|
+
import { default as T } from "./fms-empty/index.js";
|
|
6
6
|
import "./fms-ks-decrypt/index.js";
|
|
7
7
|
import t from "./fms-ks-file-upload/index.js";
|
|
8
|
-
import { default as
|
|
8
|
+
import { default as b } from "./fms-ks-file-upload/index.js";
|
|
9
9
|
import p from "./fms-ks-file-view/index.js";
|
|
10
|
-
import { default as
|
|
10
|
+
import { default as j } from "./fms-ks-file-view/index.js";
|
|
11
11
|
import e from "./fms-scroll-list/index.js";
|
|
12
|
-
import { default as
|
|
13
|
-
import
|
|
14
|
-
import { default as
|
|
12
|
+
import { default as q } from "./fms-scroll-list/index.js";
|
|
13
|
+
import a from "./fms-ks-form-grid/index.js";
|
|
14
|
+
import { default as z } from "./fms-ks-form-grid/index.js";
|
|
15
15
|
import "./fms-ks-search-tips/index.js";
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import { F
|
|
19
|
-
import { F as
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
import f from "./fms-ks-upload/index.js";
|
|
17
|
+
import { default as H } from "./fms-ks-upload/index.js";
|
|
18
|
+
import { F } from "./fms-ks-decrypt.2f88e659.js";
|
|
19
|
+
import { F as J } from "./fms-ks-decrypt.2f88e659.js";
|
|
20
|
+
import { F as i } from "./fms-ks-search-tips.d36859c3.js";
|
|
21
|
+
import { F as N } from "./fms-ks-search-tips.d36859c3.js";
|
|
22
|
+
const l = [s, r, F, t, p, e, a, i, f], d = function(m) {
|
|
23
|
+
l.forEach((o) => {
|
|
22
24
|
m.component(o.name, o);
|
|
23
25
|
});
|
|
24
|
-
},
|
|
25
|
-
install:
|
|
26
|
+
}, B = {
|
|
27
|
+
install: d
|
|
26
28
|
};
|
|
27
29
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
G as FmsCopyBox,
|
|
31
|
+
T as FmsEmpty,
|
|
32
|
+
J as FmsKsDecrypt,
|
|
33
|
+
b as FmsKsFileUpload,
|
|
34
|
+
j as FmsKsFileView,
|
|
35
|
+
z as FmsKsFormGrid,
|
|
36
|
+
N as FmsKsSearchTips,
|
|
37
|
+
H as FmsKsUpload,
|
|
38
|
+
q as FmsScrollList,
|
|
39
|
+
B as default
|
|
37
40
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as s } from "./utils.159fba19.js";
|
|
2
|
-
import { D as a, a as n, M as r, b as i, W as l, Q as h, c as o } from "./fms-ks-components.
|
|
2
|
+
import { D as a, a as n, M as r, b as i, W as l, Q as h, c as o } from "./fms-ks-components.53289d17.js";
|
|
3
3
|
const m = {
|
|
4
4
|
components: {
|
|
5
5
|
DateSelect: a,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ks-
|
|
1
|
+
.ks-week__day{width:50%;height:44px}.ks-week__selected-day{color:#7972fe!important;position:relative}.ks-week__selected-day:after{font: 14px/1 vant-icon;font-size:12px;text-rendering:auto;-webkit-font-smoothing:antialiased;content:"\f0c8";display:inline-block;position:absolute;right:4px;top:16px}
|
package/package.json
CHANGED
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
ref="search"
|
|
51
51
|
:maxlength="maxlength"
|
|
52
52
|
v-model="searchStr"
|
|
53
|
-
@change="onChange"
|
|
53
|
+
@change="onChange"
|
|
54
|
+
@blur="onSearch">
|
|
54
55
|
<slot name="action"
|
|
55
56
|
:input="searchStr"
|
|
56
57
|
:close="hidePopup"
|
|
@@ -175,8 +176,12 @@
|
|
|
175
176
|
$search.inputValue = ''
|
|
176
177
|
},
|
|
177
178
|
async onChange (val) {
|
|
178
|
-
let len = val.length
|
|
179
179
|
this.searchStr = val
|
|
180
|
+
},
|
|
181
|
+
// 发起请求
|
|
182
|
+
async onSearch () {
|
|
183
|
+
let val = this.searchStr
|
|
184
|
+
let len = val.length
|
|
180
185
|
if (len === 0) return
|
|
181
186
|
if (len >= this.inputLength && this.url && this.appkey) {
|
|
182
187
|
try {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="15.01025390625" height="13.9381103515625" viewBox="0 0 15.01025390625 13.9381103515625"><g><g><path d="M3.75244,2.14429L2.25,2.14429C1.00736,2.14429,0,3.15165,0,4.39429L0,11.6881C0,12.9308,1.00736,13.9381,2.25,13.9381L12.7603,13.9381C14.0029,13.9381,15.0103,12.9308,15.0103,11.6881L15.0103,4.39429C15.0103,3.15165,14.0029,2.14429,12.7603,2.14429L11.2578,2.14429C11.2578,0.960006,10.2976,0,9.11328,0L5.89697,0C4.71269,0,3.75244,0.960006,3.75244,2.14429ZM11.2036,7.77271C11.2036,9.8153,9.54748,11.4711,7.50488,11.4711C5.46228,11.4711,3.80664,9.8153,3.80664,7.77271C3.80664,5.73011,5.46228,4.07422,7.50488,4.07422C9.54748,4.07422,11.2036,5.73011,11.2036,7.77271ZM9.70361,7.77271C9.70361,6.55853,8.71906,5.57422,7.50488,5.57422C6.29071,5.57422,5.30664,6.55853,5.30664,7.77271C5.30664,8.98688,6.29071,9.97107,7.50488,9.97107C8.71906,9.97107,9.70361,8.98688,9.70361,7.77271Z" fill-rule="evenodd" fill="#E3E5ED" fill-opacity="1"/></g></g></svg>
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="van-uploader">
|
|
3
|
+
<!-- <van-button @click="demo">单击</van-button> -->
|
|
4
|
+
<div class="van-uploader__wrapper">
|
|
5
|
+
<!-- 已经上传后的附件预览 -->
|
|
6
|
+
<div v-for="(item, index) of value"
|
|
7
|
+
:key="index"
|
|
8
|
+
class="van-uploader__preview">
|
|
9
|
+
<div :class="{'van-image': true, 'van-uploader__preview-image': true,}"
|
|
10
|
+
style="overflow: hidden; border-radius: 4px; width: 52px;height: 52px;">
|
|
11
|
+
<!-- 显示识别进度-报销申请页面有使用到 -->
|
|
12
|
+
<div v-if="process !== 100"
|
|
13
|
+
class="mask-wrap">
|
|
14
|
+
<div class="mask-content">
|
|
15
|
+
<div class="mask-progress-bar">
|
|
16
|
+
<div class="mask-progress-step"
|
|
17
|
+
:style="{width: `${process/100*44}px` }"></div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="mask-text">识别中</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<img v-if="(item.contentType || '').toLowerCase().startsWith('image') ||
|
|
23
|
+
['jpg', 'jpeg', 'png', 'bmp', 'HEIC', 'webp', 'tiff'].includes(
|
|
24
|
+
(item.extendName || '').toLowerCase()
|
|
25
|
+
)"
|
|
26
|
+
:src="item.url"
|
|
27
|
+
@click="previewAssets(item.url, value)"
|
|
28
|
+
class="van-image__img"
|
|
29
|
+
style="object-fit: cover;" />
|
|
30
|
+
<div v-else-if="(item.contentType || '').toLowerCase().includes('pdf') ||
|
|
31
|
+
['pdf'].includes((item.extendName || '').toLowerCase())"
|
|
32
|
+
@click="pdfPreview(item)"><img class="van-image__img"
|
|
33
|
+
src="https://erphostjs.kye-erp.com/hr-oa-kts/ks-app/kuasheng-oa/images/pdf.svg"
|
|
34
|
+
alt=""></div>
|
|
35
|
+
<div v-else
|
|
36
|
+
class="van-uploader__upload"
|
|
37
|
+
style="margin:0;">
|
|
38
|
+
<div class="van-uploader__preview-show">文件请到<br />ERP查看</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<i class="van-icon van-icon-clear van-uploader__preview-delete"
|
|
42
|
+
v-if="type === 'edit'"
|
|
43
|
+
style="color: #a7aab7;border:1px solid #fff;fontSize: 14px;"
|
|
44
|
+
@click="onDelete(index)"></i>
|
|
45
|
+
</div>
|
|
46
|
+
<!-- 上传按钮 -->
|
|
47
|
+
<div v-if="((maxLength && value.length < maxLength) || !maxLength) && type === 'edit'"
|
|
48
|
+
class="van-uploader__upload"
|
|
49
|
+
@click="onPreview"
|
|
50
|
+
style="font-size: 22px;">
|
|
51
|
+
<img class="upload-icon" src="./camera.svg" />
|
|
52
|
+
<!-- <i class="van-icon van-icon-photograph van-uploader__upload-icon" style="font-size: 16px;"></i> -->
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<ks-action-sheet v-model="show"
|
|
56
|
+
:actions="actions"
|
|
57
|
+
get-container="body"
|
|
58
|
+
cancel-text="取消"
|
|
59
|
+
@select="onSelect"
|
|
60
|
+
@cancel="onCancel" />
|
|
61
|
+
<!-- <van-popup v-model="showPdf" get-container="body">
|
|
62
|
+
<pdf-prev :url="pdfUrl" v-if="showPdf"></pdf-prev>
|
|
63
|
+
<van-icon name="cross"
|
|
64
|
+
class="close-btn"
|
|
65
|
+
@click="showPdf = false" />
|
|
66
|
+
</van-popup> -->
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script>
|
|
71
|
+
const Toast = window.vant && window.vant.Toast
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
name: "FmsKsUpload",
|
|
75
|
+
// components: { PdfPrev },
|
|
76
|
+
props: {
|
|
77
|
+
value: {
|
|
78
|
+
type: Array,
|
|
79
|
+
default: () => ([])
|
|
80
|
+
},
|
|
81
|
+
bizId: String,
|
|
82
|
+
bizCode: String,
|
|
83
|
+
maxLength: Number
|
|
84
|
+
,
|
|
85
|
+
type: { // edit 可以编辑 detail 不可以编辑
|
|
86
|
+
type: String,
|
|
87
|
+
default: 'edit'
|
|
88
|
+
},
|
|
89
|
+
process: { // 识别进度
|
|
90
|
+
type: Number,
|
|
91
|
+
default: 100
|
|
92
|
+
},
|
|
93
|
+
onPreviewBefore: Function, // 点击上传按钮之前的操作,可终止唤起弹框
|
|
94
|
+
},
|
|
95
|
+
data () {
|
|
96
|
+
return {
|
|
97
|
+
show: false,
|
|
98
|
+
actions: [{ name: "从相册选择" }, { name: "拍照" }],
|
|
99
|
+
showPdf: false,
|
|
100
|
+
pdfUrl: ''
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
methods: {
|
|
104
|
+
onPreview () {
|
|
105
|
+
if (this.onPreviewBefore && typeof this.onPreviewBefore === 'function') {
|
|
106
|
+
const flag = this.onPreviewBefore()
|
|
107
|
+
if (flag) {
|
|
108
|
+
return
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
this.show = true;
|
|
112
|
+
},
|
|
113
|
+
onCancel () {
|
|
114
|
+
this.show = false;
|
|
115
|
+
},
|
|
116
|
+
async onSelect(item) {
|
|
117
|
+
let fileList = null
|
|
118
|
+
try {
|
|
119
|
+
// NOTE: 此处原代码为 this.$store.commit('setPreviewFile', true),因改为组件库,所以此处改为暴露事件 beforeSelect
|
|
120
|
+
this.$emit('beforeSelect', item)
|
|
121
|
+
if (item.name === '从相册选择') {
|
|
122
|
+
// 选择照片的数量( 默认可选9张图片 )
|
|
123
|
+
const totalCount = Number(this.maxLength - this.value.length)
|
|
124
|
+
console.log('从相册选择', item, totalCount, this.maxLength, this.value.length)
|
|
125
|
+
fileList = await window.ks.callFunc({
|
|
126
|
+
method: 'pickAssets',
|
|
127
|
+
params: {
|
|
128
|
+
totalCount: totalCount,
|
|
129
|
+
allowRecordVideo: false,
|
|
130
|
+
selectType: 1,
|
|
131
|
+
quality: 80,
|
|
132
|
+
},
|
|
133
|
+
})
|
|
134
|
+
} else if (item.name === '拍照') {
|
|
135
|
+
fileList = await window.ks.takeByCamera()
|
|
136
|
+
}
|
|
137
|
+
this.onCancel()
|
|
138
|
+
if (this.maxLength && fileList.length > this.maxLength) {
|
|
139
|
+
Toast('选择文件太多')
|
|
140
|
+
} else {
|
|
141
|
+
this.upload(fileList)
|
|
142
|
+
}
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.info('onSelect--error', error)
|
|
145
|
+
if (error && error.msg) {
|
|
146
|
+
Toast(error.msg)
|
|
147
|
+
}
|
|
148
|
+
this.onCancel()
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
onDelete (index) {
|
|
152
|
+
let list = JSON.parse(JSON.stringify(this.value))
|
|
153
|
+
let data = list[index]
|
|
154
|
+
list.splice(index, 1)
|
|
155
|
+
this.$emit('input', list)
|
|
156
|
+
this.$http('file.deleteByBizAndId', 10124, data).then(res => {
|
|
157
|
+
this.$emit('deleteSuccess', res, data)
|
|
158
|
+
}).catch(err => {
|
|
159
|
+
console.log(err)
|
|
160
|
+
})
|
|
161
|
+
},
|
|
162
|
+
async upload (list) {
|
|
163
|
+
try {
|
|
164
|
+
let res = await window.ks.uploadAssets({
|
|
165
|
+
filePaths: list.map(item => item.filePath),
|
|
166
|
+
fileNames: list.map(item => item.fileName),
|
|
167
|
+
bizCode: this.bizCode,
|
|
168
|
+
bizId: this.bizId
|
|
169
|
+
})
|
|
170
|
+
// 这里有个坑,安卓与IOS机型不同的地方,list中的name,安卓同样图片name不同,为时间戳;苹果同样图片name相同,为之前的文件名称
|
|
171
|
+
console.log('uploadRes---', res)
|
|
172
|
+
this.$emit('input', res.reverse())
|
|
173
|
+
this.$emit('uploadsuccess', list, res)
|
|
174
|
+
this.onCancel()
|
|
175
|
+
} catch (error) {
|
|
176
|
+
console.log('上传失败--', error)
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
previewAssets(url, list) {
|
|
180
|
+
// NOTE: 此处原代码为 this.$store.commit('setPreviewFile', true),因改为组件库,所以此处改为暴露事件 beforePreviewAssets
|
|
181
|
+
let filePaths = list.filter(item => (item.contentType || '').toLowerCase().startsWith('image') ||
|
|
182
|
+
['jpg', 'jpeg', 'png', 'bmp', 'HEIC', 'webp', 'tiff'].includes(
|
|
183
|
+
(item.extendName || '').toLowerCase()
|
|
184
|
+
)).map(item => item.url)
|
|
185
|
+
const index = filePaths.findIndex(item => item === url)
|
|
186
|
+
|
|
187
|
+
this.$emit('beforePreviewAssets', {
|
|
188
|
+
index,
|
|
189
|
+
list,
|
|
190
|
+
})
|
|
191
|
+
window.ks.previewAssets({
|
|
192
|
+
index, // 默认从第几个资源开始浏览 index不能大于assetsPaths的长度
|
|
193
|
+
filePaths // 接口返回的文件系统路径,或者本地路径
|
|
194
|
+
})
|
|
195
|
+
},
|
|
196
|
+
pdfPreview (item) {
|
|
197
|
+
// this.showPdf = true
|
|
198
|
+
// this.pdfUrl = item.url
|
|
199
|
+
// NOTE: 此处原代码为 this.$store.commit('setPreviewFile', true),因改为组件库,所以此处改为暴露事件 beforePreviewAssets
|
|
200
|
+
this.$emit('beforePreviewAssets', {
|
|
201
|
+
index,
|
|
202
|
+
list,
|
|
203
|
+
})
|
|
204
|
+
window.ks.callFunc({
|
|
205
|
+
method: 'previewFile',
|
|
206
|
+
params: {
|
|
207
|
+
filePath: item.url,
|
|
208
|
+
fileName: item.name,
|
|
209
|
+
fileSize: String(item.size) // 改为string类型
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
</script>
|
|
216
|
+
|
|
217
|
+
<style lang="less" scoped>
|
|
218
|
+
.van-uploader {
|
|
219
|
+
// padding-bottom: 10px;
|
|
220
|
+
padding-top: 4px;
|
|
221
|
+
&__upload {
|
|
222
|
+
cursor: pointer;
|
|
223
|
+
border-radius: 4px;
|
|
224
|
+
}
|
|
225
|
+
&__preview-delete {
|
|
226
|
+
font-size: 18px;
|
|
227
|
+
top: -8px;
|
|
228
|
+
right: -8px;
|
|
229
|
+
bottom: unset;
|
|
230
|
+
border-radius: 100%;
|
|
231
|
+
background-color: #fff;
|
|
232
|
+
color: #969799;
|
|
233
|
+
}
|
|
234
|
+
.pdf-border {
|
|
235
|
+
border: 1px solid #e8e8e8;
|
|
236
|
+
display: flex;
|
|
237
|
+
align-items: center;
|
|
238
|
+
padding: 2px;
|
|
239
|
+
color: #a6a6a6;
|
|
240
|
+
font-size: 12px;
|
|
241
|
+
}
|
|
242
|
+
.mask-wrap {
|
|
243
|
+
width: 52px;
|
|
244
|
+
height: 52px;
|
|
245
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
246
|
+
position: absolute;
|
|
247
|
+
display: flex;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
align-items: center;
|
|
250
|
+
.mask-content {
|
|
251
|
+
display: flex;
|
|
252
|
+
align-items: center;
|
|
253
|
+
flex-direction: column;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
margin-top: 4px;
|
|
256
|
+
.mask-progress-bar {
|
|
257
|
+
width: 44px;
|
|
258
|
+
height: 4px;
|
|
259
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
260
|
+
border-radius: 2px;
|
|
261
|
+
.mask-progress-step {
|
|
262
|
+
// width: 20px;
|
|
263
|
+
height: 4px;
|
|
264
|
+
background-color: rgba(255, 255, 255, 0.9);
|
|
265
|
+
border-radius: 2px;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
.mask-text {
|
|
269
|
+
line-height: 24px;
|
|
270
|
+
color: #fff;
|
|
271
|
+
font-size: 10px;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
.van-popup {
|
|
277
|
+
overflow: inherit !important;
|
|
278
|
+
.close-btn {
|
|
279
|
+
bottom: 150px;
|
|
280
|
+
position: absolute;
|
|
281
|
+
left: 50%;
|
|
282
|
+
transform: translateX(-50%);
|
|
283
|
+
color: #fff;
|
|
284
|
+
font-size: 25px;
|
|
285
|
+
background-color: #7972fe;
|
|
286
|
+
border-radius: 50%;
|
|
287
|
+
border: none;
|
|
288
|
+
padding: 8px;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/deep/ .van-uploader__upload {
|
|
292
|
+
border: 0.5px dashed #c6c6d0;
|
|
293
|
+
width: 52px;
|
|
294
|
+
height: 52px;
|
|
295
|
+
background-color: #fff;
|
|
296
|
+
}
|
|
297
|
+
.van-uploader__preview-show {
|
|
298
|
+
font-size: 12px;
|
|
299
|
+
color: #999;
|
|
300
|
+
text-align: center;
|
|
301
|
+
}
|
|
302
|
+
</style>
|
|
File without changes
|
package/src/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import FmsKsFileView from './components/fms-ks-file-view/index'
|
|
|
7
7
|
import FmsScrollList from './components/fms-scroll-list/index'
|
|
8
8
|
import FmsKsFormGrid from './components/fms-ks-form-grid'
|
|
9
9
|
import FmsKsSearchTips from './components/fms-ks-search-tips'
|
|
10
|
+
import FmsKsUpload from './components/fms-ks-upload/index'
|
|
10
11
|
|
|
11
12
|
const components = [
|
|
12
13
|
FmsCopyBox,
|
|
@@ -16,7 +17,8 @@ const components = [
|
|
|
16
17
|
FmsKsFileView,
|
|
17
18
|
FmsScrollList,
|
|
18
19
|
FmsKsFormGrid,
|
|
19
|
-
FmsKsSearchTips
|
|
20
|
+
FmsKsSearchTips,
|
|
21
|
+
FmsKsUpload
|
|
20
22
|
]
|
|
21
23
|
|
|
22
24
|
const install = function(Vue) {
|
|
@@ -34,7 +36,8 @@ export {
|
|
|
34
36
|
FmsKsFileView,
|
|
35
37
|
FmsScrollList,
|
|
36
38
|
FmsKsFormGrid,
|
|
37
|
-
FmsKsSearchTips
|
|
39
|
+
FmsKsSearchTips,
|
|
40
|
+
FmsKsUpload
|
|
38
41
|
}
|
|
39
42
|
// 全量导出
|
|
40
43
|
export default {
|