@moment-design/material-library 0.0.13 → 0.0.15

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.
@@ -258,32 +258,32 @@
258
258
  overflow: hidden;
259
259
  text-overflow: ellipsis;
260
260
  }
261
- .l-material-library-upload .form-item[data-v-18b2a5a6] {
261
+ .l-material-library-upload .form-item[data-v-37450ab3] {
262
262
  display: flex;
263
263
  align-items: center;
264
264
  margin-bottom: 16px;
265
265
  }
266
- .l-material-library-upload .form-item[data-v-18b2a5a6]:not(:last-child) {
266
+ .l-material-library-upload .form-item[data-v-37450ab3]:not(:last-child) {
267
267
  margin-bottom: 16px;
268
268
  }
269
- .l-material-library-upload .form-item .label[data-v-18b2a5a6] {
269
+ .l-material-library-upload .form-item .label[data-v-37450ab3] {
270
270
  width: 70px;
271
271
  margin-right: 16px;
272
272
  }
273
- .l-material-library-upload .form-item .label span[data-v-18b2a5a6] {
273
+ .l-material-library-upload .form-item .label span[data-v-37450ab3] {
274
274
  color: red;
275
275
  margin-right: 4px;
276
276
  position: relative;
277
277
  top: 2px;
278
278
  }
279
- .l-material-library-upload .upload[data-v-18b2a5a6] {
279
+ .l-material-library-upload .upload[data-v-37450ab3] {
280
280
  margin-top: 16px;
281
281
  }
282
- .l-material-library-upload .upload .tips[data-v-18b2a5a6] {
282
+ .l-material-library-upload .upload .tips[data-v-37450ab3] {
283
283
  margin-bottom: 16px;
284
284
  color: #86909c;
285
285
  }
286
- .l-material-library-upload .upload[data-v-18b2a5a6] .mo-upload-progress {
286
+ .l-material-library-upload .upload[data-v-37450ab3] .mo-upload-progress {
287
287
  display: none;
288
288
  }
289
289
  .l-material-library-right-content[data-v-1b7acef9] {
@@ -323,6 +323,6 @@
323
323
  color: #1966ff;
324
324
  cursor: pointer;
325
325
  }
326
- .l-material-library[data-v-0ee50179] {
326
+ .l-material-library[data-v-06a3b2f9] {
327
327
  display: flex;
328
328
  }
package/dist/index.cjs.js CHANGED
@@ -6868,7 +6868,7 @@ const _sfc_main$2 = vue.defineComponent({
6868
6868
  };
6869
6869
  const fileChange = (vs) => fileList.value = vs;
6870
6870
  const handleOk = async () => {
6871
- var _a, _b, _c;
6871
+ var _a, _b, _c, _d, _e;
6872
6872
  if (!fileName.value) {
6873
6873
  webVue.Message.error("\u8BF7\u8F93\u5165\u7D20\u6750\u540D\u79F0");
6874
6874
  } else if (!groupId.value) {
@@ -6884,7 +6884,7 @@ const _sfc_main$2 = vue.defineComponent({
6884
6884
  try {
6885
6885
  okLoading.value = true;
6886
6886
  const res = await ((_b = (_a = deepConfig.value) == null ? void 0 : _a.apis) == null ? void 0 : _b.uploadFile(data));
6887
- if (((_c = [0, 200]) == null ? void 0 : _c.includes(+(res == null ? void 0 : res.code))) && (res == null ? void 0 : res.data)) {
6887
+ if (((_d = [0, 200]) == null ? void 0 : _d.includes(+((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.code))) && ((_e = res == null ? void 0 : res.data) == null ? void 0 : _e.data)) {
6888
6888
  webVue.Message.success(`\u7D20\u6750\u4E0A\u4F20\u6210\u529F`);
6889
6889
  visible.value = false;
6890
6890
  emit("upload:success");
@@ -6915,6 +6915,7 @@ const _sfc_main$2 = vue.defineComponent({
6915
6915
  fileName.value = "";
6916
6916
  groupId.value = id;
6917
6917
  fileType.value = 1;
6918
+ fileList.value = [];
6918
6919
  init();
6919
6920
  };
6920
6921
  vue.watch(
@@ -7066,7 +7067,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
7066
7067
  _: 1
7067
7068
  }, 8, ["visible", "others", "onHandle:ok"]);
7068
7069
  }
7069
- var CUpload = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-18b2a5a6"]]);
7070
+ var CUpload = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-37450ab3"]]);
7070
7071
  var cRight_vue_vue_type_style_index_0_scoped_true_lang = "";
7071
7072
  const _sfc_main$1 = vue.defineComponent({
7072
7073
  name: "",
@@ -7452,6 +7453,13 @@ const _sfc_main = vue.defineComponent({
7452
7453
  (v) => deepConfig.value = v,
7453
7454
  { immediate: true, deep: true }
7454
7455
  );
7456
+ vue.onMounted(() => {
7457
+ var _a, _b;
7458
+ if (!((_b = (_a = deepConfig.value) == null ? void 0 : _a.dialog) == null ? void 0 : _b.visible)) {
7459
+ refCLeft.value.init();
7460
+ refCRight.value.initCheckbox();
7461
+ }
7462
+ });
7455
7463
  return {
7456
7464
  deepConfig,
7457
7465
  refCLeft,
@@ -7511,5 +7519,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
7511
7519
  ], 2112))
7512
7520
  ], 2112);
7513
7521
  }
7514
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-0ee50179"]]);
7522
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-06a3b2f9"]]);
7515
7523
  module.exports = index;
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createTextVNode, toDisplayString, renderSlot, createElementVNode, createElementBlock, createCommentVNode, createVNode, ref, Fragment, normalizeStyle, renderList, normalizeClass, withModifiers, watch, computed, unref, reactive } from "vue";
1
+ import { defineComponent, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createTextVNode, toDisplayString, renderSlot, createElementVNode, createElementBlock, createCommentVNode, createVNode, ref, Fragment, normalizeStyle, renderList, normalizeClass, withModifiers, watch, computed, unref, reactive, onMounted } from "vue";
2
2
  import { Message } from "@moment-design/web-vue";
3
3
  import { IconPlus, IconSearch, IconMore, IconDown, IconApps, IconMenu } from "@moment-design/web-vue/es/icon";
4
4
  var _export_sfc = (sfc, props) => {
@@ -6867,7 +6867,7 @@ const _sfc_main$2 = defineComponent({
6867
6867
  };
6868
6868
  const fileChange = (vs) => fileList.value = vs;
6869
6869
  const handleOk = async () => {
6870
- var _a, _b, _c;
6870
+ var _a, _b, _c, _d, _e;
6871
6871
  if (!fileName.value) {
6872
6872
  Message.error("\u8BF7\u8F93\u5165\u7D20\u6750\u540D\u79F0");
6873
6873
  } else if (!groupId.value) {
@@ -6883,7 +6883,7 @@ const _sfc_main$2 = defineComponent({
6883
6883
  try {
6884
6884
  okLoading.value = true;
6885
6885
  const res = await ((_b = (_a = deepConfig.value) == null ? void 0 : _a.apis) == null ? void 0 : _b.uploadFile(data));
6886
- if (((_c = [0, 200]) == null ? void 0 : _c.includes(+(res == null ? void 0 : res.code))) && (res == null ? void 0 : res.data)) {
6886
+ if (((_d = [0, 200]) == null ? void 0 : _d.includes(+((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.code))) && ((_e = res == null ? void 0 : res.data) == null ? void 0 : _e.data)) {
6887
6887
  Message.success(`\u7D20\u6750\u4E0A\u4F20\u6210\u529F`);
6888
6888
  visible.value = false;
6889
6889
  emit("upload:success");
@@ -6914,6 +6914,7 @@ const _sfc_main$2 = defineComponent({
6914
6914
  fileName.value = "";
6915
6915
  groupId.value = id;
6916
6916
  fileType.value = 1;
6917
+ fileList.value = [];
6917
6918
  init();
6918
6919
  };
6919
6920
  watch(
@@ -7065,7 +7066,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
7065
7066
  _: 1
7066
7067
  }, 8, ["visible", "others", "onHandle:ok"]);
7067
7068
  }
7068
- var CUpload = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-18b2a5a6"]]);
7069
+ var CUpload = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-37450ab3"]]);
7069
7070
  var cRight_vue_vue_type_style_index_0_scoped_true_lang = "";
7070
7071
  const _sfc_main$1 = defineComponent({
7071
7072
  name: "",
@@ -7451,6 +7452,13 @@ const _sfc_main = defineComponent({
7451
7452
  (v) => deepConfig.value = v,
7452
7453
  { immediate: true, deep: true }
7453
7454
  );
7455
+ onMounted(() => {
7456
+ var _a, _b;
7457
+ if (!((_b = (_a = deepConfig.value) == null ? void 0 : _a.dialog) == null ? void 0 : _b.visible)) {
7458
+ refCLeft.value.init();
7459
+ refCRight.value.initCheckbox();
7460
+ }
7461
+ });
7454
7462
  return {
7455
7463
  deepConfig,
7456
7464
  refCLeft,
@@ -7510,5 +7518,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
7510
7518
  ], 2112))
7511
7519
  ], 2112);
7512
7520
  }
7513
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-0ee50179"]]);
7521
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-06a3b2f9"]]);
7514
7522
  export { index as default };
package/dist/index.min.js CHANGED
@@ -3269,7 +3269,7 @@
3269
3269
  }, beforeUpload: (e2) => new Promise((n3, r3) => {
3270
3270
  1 === c2.value && e2.size / 1024 / 1024 > 10 || 2 === c2.value && e2.size / 1024 / 1024 > 20 || 3 === c2.value && e2.size / 1024 / 1024 > 300 || 4 === c2.value && e2.size / 1024 / 1024 > 5 ? (t.Message.error("\u60A8\u5F53\u524D\u9009\u62E9\u7684\u7D20\u6750\u5927\u5C0F\u8D85\u51FA\u9650\u5236\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"), r3()) : n3(true);
3271
3271
  }), fileChange: (e2) => p2.value = e2, handleOk: async () => {
3272
- var _a, _b, _c;
3272
+ var _a, _b, _c, _d, _e2;
3273
3273
  if (l2.value)
3274
3274
  if (f2.value)
3275
3275
  if (p2.value.length) {
@@ -3278,7 +3278,7 @@
3278
3278
  try {
3279
3279
  a2.value = true;
3280
3280
  const n3 = await ((_b = (_a = o2.value) == null ? void 0 : _a.apis) == null ? void 0 : _b.uploadFile(e2));
3281
- ((_c = [0, 200]) == null ? void 0 : _c.includes(+(n3 == null ? void 0 : n3.code))) && (n3 == null ? void 0 : n3.data) && (t.Message.success("\u7D20\u6750\u4E0A\u4F20\u6210\u529F"), i2.value = false, r2("upload:success"));
3281
+ ((_d = [0, 200]) == null ? void 0 : _d.includes(+((_c = n3 == null ? void 0 : n3.data) == null ? void 0 : _c.code))) && ((_e2 = n3 == null ? void 0 : n3.data) == null ? void 0 : _e2.data) && (t.Message.success("\u7D20\u6750\u4E0A\u4F20\u6210\u529F"), i2.value = false, r2("upload:success"));
3282
3282
  } catch (e3) {
3283
3283
  console.log(e3);
3284
3284
  } finally {
@@ -3291,7 +3291,7 @@
3291
3291
  else
3292
3292
  t.Message.error("\u8BF7\u8F93\u5165\u7D20\u6750\u540D\u79F0");
3293
3293
  }, init: v2, open: (e2) => {
3294
- i2.value = true, l2.value = "", f2.value = e2, c2.value = 1, v2();
3294
+ i2.value = true, l2.value = "", f2.value = e2, c2.value = 1, p2.value = [], v2();
3295
3295
  } };
3296
3296
  } }), ze = { class: "form-item" }, Ze = { class: "form-item" }, Te = { class: "form-item" }, _e = { class: "upload" }, $e = { class: "tips" }, et = { key: 0 }, tt = { key: 1 }, nt = { key: 2 }, rt = { key: 3 };
3297
3297
  var ot = r(qe, [["render", function(t2, n2, r2, o2, i2, u2) {
@@ -3300,7 +3300,7 @@
3300
3300
  var _a;
3301
3301
  return [e.createElementVNode("div", ze, [n2[4] || (n2[4] = e.createElementVNode("div", { class: "label" }, [e.createElementVNode("span", null, "*"), e.createTextVNode("\u7D20\u6750\u540D\u79F0")], -1)), e.createVNode(a2, { modelValue: t2.fileName, "onUpdate:modelValue": n2[0] || (n2[0] = (e2) => t2.fileName = e2), class: "input", style: { width: "386px" }, placeholder: "\u8BF7\u8F93\u5165", "allow-clear": "", "max-length": 20, "show-word-limit": "" }, null, 8, ["modelValue"])]), e.createElementVNode("div", Ze, [n2[5] || (n2[5] = e.createElementVNode("div", { class: "label" }, [e.createElementVNode("span", null, "*"), e.createTextVNode("\u9009\u62E9\u5206\u7EC4")], -1)), e.createVNode(l2, { modelValue: t2.groupId, "onUpdate:modelValue": n2[1] || (n2[1] = (e2) => t2.groupId = e2), class: "select", style: { width: "386px" }, placeholder: "\u8BF7\u9009\u62E9\u5206\u7EC4", options: (_a = t2.groups) == null ? void 0 : _a.map((e2) => ({ label: e2.groupName, value: e2.id })) }, null, 8, ["modelValue", "options"])]), e.createElementVNode("div", Te, [n2[6] || (n2[6] = e.createElementVNode("div", { class: "label" }, [e.createElementVNode("span", null, "*"), e.createTextVNode("\u7D20\u6750\u7C7B\u578B")], -1)), e.createVNode(c2, { modelValue: t2.fileType, "onUpdate:modelValue": n2[2] || (n2[2] = (e2) => t2.fileType = e2), options: t2.fileTypes }, null, 8, ["modelValue", "options"])]), e.createElementVNode("div", _e, [e.createElementVNode("div", $e, [1 === t2.fileType ? (e.openBlock(), e.createElementBlock("div", et, "\u56FE\u7247\u4E0A\u4F20\u683C\u5F0F\u4E3Ajpg\u3001jpeg\u3001png\u3001bmp\u3001webp\u3001GIF, \u5927\u5C0F\u9650\u5236\u572810M\u4EE5\u5185")) : e.createCommentVNode("v-if", true), 2 === t2.fileType ? (e.openBlock(), e.createElementBlock("div", tt, " \u6587\u6863\u4E0A\u4F20\u683C\u5F0F\u4E3Arar\u3001zip\u3001ttf\u3001doc\u3001docx\u3001xls\u3001xlsx\u3001xlsm\u3001pdf\u3001ppt\u3001pptx\u3001txt, \u5927\u5C0F\u9650\u5236\u572820M\u4EE5\u5185 ")) : e.createCommentVNode("v-if", true), 3 === t2.fileType ? (e.openBlock(), e.createElementBlock("div", nt, "\u89C6\u9891\u4E0A\u4F20\u683C\u5F0F\u4E3ASWF\u3001MP4, \u5927\u5C0F\u9650\u5236\u5728300M\u4EE5\u5185")) : e.createCommentVNode("v-if", true), 4 === t2.fileType ? (e.openBlock(), e.createElementBlock("div", rt, "\u97F3\u4E50\u4E0A\u4F20\u683C\u5F0F\u4E3AMP3, \u5927\u5C0F\u9650\u5236\u57285M\u4EE5\u5185")) : e.createCommentVNode("v-if", true)]), e.createVNode(A2, { style: { "max-height": "300px", "overflow-y": "auto", "padding-right": "24px" } }, { default: e.withCtx(() => [e.createVNode(f2, { "file-list": t2.fileList, "auto-upload": false, accept: t2.accept, limit: t2.limit, "show-retry-button": false, "show-cancel-button": false, onExceedLimit: t2.exceedLimit, onBeforeUpload: t2.beforeUpload, onChange: t2.fileChange }, null, 8, ["file-list", "accept", "limit", "onExceedLimit", "onBeforeUpload", "onChange"])]), _: 1 })])];
3302
3302
  }), _: 1 }, 8, ["loading"])]), _: 1 }, 8, ["visible", "others", "onHandle:ok"]);
3303
- }], ["__scopeId", "data-v-18b2a5a6"]]);
3303
+ }], ["__scopeId", "data-v-37450ab3"]]);
3304
3304
  const it = e.defineComponent({ name: "", components: { IconDown: n.IconDown, IconApps: n.IconApps, IconMenu: n.IconMenu, LModal: o, CRightApps: P, CRightMenus: Je, CChangeGroup: He, CUpload: ot }, props: { config: { type: Object, default: () => ({}) } }, setup(n2, { emit: r2 }) {
3305
3305
  var _a, _b;
3306
3306
  const o2 = e.ref(n2.config), i2 = e.ref(false), u2 = e.ref(false), a2 = e.ref(false), l2 = e.ref(), c2 = e.ref(), f2 = e.ref(), A2 = e.ref(), s2 = e.ref(), g2 = e.ref(), p2 = e.ref((_b = (_a = n2.config) == null ? void 0 : _a.fileType) != null ? _b : ""), v2 = e.ref(1), d2 = e.ref(), h2 = e.ref(1), w2 = e.ref(15), C2 = e.ref({ list: [], total: 0 }), B2 = (e2) => {
@@ -3356,7 +3356,10 @@
3356
3356
  }], ["__scopeId", "data-v-1b7acef9"]]);
3357
3357
  const st = e.defineComponent({ name: "MaterialLibrary", components: { CLeft: L, CRight: At, LModal: o }, props: { config: { type: Object, default: () => ({}) } }, setup(n2, { emit: r2 }) {
3358
3358
  const o2 = e.ref(), i2 = e.ref(), u2 = e.ref(), a2 = e.ref(false);
3359
- return e.watch(() => n2.config, (e2) => o2.value = e2, { immediate: true, deep: true }), { deepConfig: o2, refCLeft: i2, refCRight: u2, visible: a2, handleOk: () => {
3359
+ return e.watch(() => n2.config, (e2) => o2.value = e2, { immediate: true, deep: true }), e.onMounted(() => {
3360
+ var _a, _b;
3361
+ ((_b = (_a = o2.value) == null ? void 0 : _a.dialog) == null ? void 0 : _b.visible) || (i2.value.init(), u2.value.initCheckbox());
3362
+ }), { deepConfig: o2, refCLeft: i2, refCRight: u2, visible: a2, handleOk: () => {
3360
3363
  var _a, _b, _c, _d;
3361
3364
  const e2 = u2.value.getItems();
3362
3365
  (e2 == null ? void 0 : e2.length) ? e2.length > ((_b = (_a = o2.value) == null ? void 0 : _a.max) != null ? _b : 10) ? t.Message.error(`\u6700\u591A\u9009\u62E9${(_d = (_c = o2.value) == null ? void 0 : _c.max) != null ? _d : 10}\u4E2A\u7D20\u6750`) : (a2.value = false, r2("choose", e2)) : t.Message.error("\u8BF7\u9009\u62E9\u7D20\u6750");
@@ -3368,6 +3371,6 @@
3368
3371
  var _a, _b, _c, _d, _e2;
3369
3372
  const a2 = e.resolveComponent("CLeft"), l2 = e.resolveComponent("CRight"), c2 = e.resolveComponent("l-modal");
3370
3373
  return e.openBlock(), e.createElementBlock(e.Fragment, null, [e.createCommentVNode(" dialog "), ((_a = t2.deepConfig.dialog) == null ? void 0 : _a.visible) ? (e.openBlock(), e.createBlock(c2, { key: 0, visible: t2.visible, title: (_c = (_b = t2.deepConfig.dialog) == null ? void 0 : _b.title) != null ? _c : "\u9009\u62E9\u7D20\u6750", others: { width: (_e2 = (_d = t2.deepConfig.dialog) == null ? void 0 : _d.width) != null ? _e2 : 1160 }, "onHandle:cancel": n2[2] || (n2[2] = (e2) => t2.visible = false), "onHandle:ok": t2.handleOk }, { default: e.withCtx(() => [e.createElementVNode("div", gt, [e.createVNode(a2, { ref: "refCLeft", config: t2.deepConfig, "onGroup:change": n2[0] || (n2[0] = (e2) => t2.refCRight.init(e2)) }, null, 8, ["config"]), e.createVNode(l2, { ref: "refCRight", config: t2.deepConfig, "onGroup:init": n2[1] || (n2[1] = (e2) => t2.refCLeft.init()) }, null, 8, ["config"])])]), _: 1 }, 8, ["visible", "title", "others", "onHandle:ok"])) : (e.openBlock(), e.createElementBlock(e.Fragment, { key: 1 }, [e.createCommentVNode(" list "), e.createElementVNode("div", pt, [e.createVNode(a2, { ref: "refCLeft", config: t2.deepConfig, "onGroup:change": n2[3] || (n2[3] = (e2) => t2.refCRight.init(e2)) }, null, 8, ["config"]), e.createVNode(l2, { ref: "refCRight", config: t2.deepConfig, "onGroup:init": n2[4] || (n2[4] = (e2) => t2.refCLeft.init()) }, null, 8, ["config"])])], 2112))], 2112);
3371
- }], ["__scopeId", "data-v-0ee50179"]]);
3374
+ }], ["__scopeId", "data-v-06a3b2f9"]]);
3372
3375
  });
3373
3376
  //# sourceMappingURL=index.min.js.map