@maketribe/ms-app 3.2.34 → 3.2.35

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.
@@ -52,13 +52,19 @@ const _hoisted_3 = { class: "flex items-center" };
52
52
  const _hoisted_4 = { class: "mk-cms-contents__body" };
53
53
  const _hoisted_5 = { class: "mk-cms-contents__body__right__action" };
54
54
  const _hoisted_6 = { class: "el-dropdown-link" };
55
- const _hoisted_7 = { style: { "background": "#fff", "margin-top": "-10px" } };
56
- const _hoisted_8 = { class: "mk-cms-contents__publish" };
57
- const _hoisted_9 = /* @__PURE__ */ createElementVNode("span", null, "是否发布列表:", -1);
58
- const _hoisted_10 = /* @__PURE__ */ createElementVNode("span", null, "是否发布封面:", -1);
59
- const _hoisted_11 = /* @__PURE__ */ createElementVNode("span", null, "是否发布内容:", -1);
60
- const _hoisted_12 = /* @__PURE__ */ createElementVNode("span", null, "是否发布资源:", -1);
61
- const _hoisted_13 = /* @__PURE__ */ createElementVNode("span", null, "是否强制发布:", -1);
55
+ const _hoisted_7 = { style: { "background": "#fff", "margin-top": "10px" } };
56
+ const _hoisted_8 = { style: { "background": "#fff" } };
57
+ const _hoisted_9 = {
58
+ key: 1,
59
+ style: { "background": "#fff", "margin-top": "-10px" }
60
+ };
61
+ const _hoisted_10 = { style: { "background": "#fff", "margin-bottom": "10px" } };
62
+ const _hoisted_11 = { class: "mk-cms-contents__publish" };
63
+ const _hoisted_12 = /* @__PURE__ */ createElementVNode("span", null, "是否发布列表:", -1);
64
+ const _hoisted_13 = /* @__PURE__ */ createElementVNode("span", null, "是否发布封面:", -1);
65
+ const _hoisted_14 = /* @__PURE__ */ createElementVNode("span", null, "是否发布内容:", -1);
66
+ const _hoisted_15 = /* @__PURE__ */ createElementVNode("span", null, "是否发布资源:", -1);
67
+ const _hoisted_16 = /* @__PURE__ */ createElementVNode("span", null, "是否强制发布:", -1);
62
68
  const _sfc_main = /* @__PURE__ */ defineComponent({
63
69
  __name: "index",
64
70
  setup(__props) {
@@ -84,7 +90,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
84
90
  const curSelectPartItem = ref(null);
85
91
  const partTreeRef = ref(null);
86
92
  const partExList = ref([]);
87
- const partContentComponent = ref(null);
93
+ const partContentExtension = ref(null);
88
94
  const partDataForm = reactive(new CmsContentManPartForm());
89
95
  partDataForm.init();
90
96
  let beforeInitFormPart = null;
@@ -109,7 +115,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
109
115
  }
110
116
  router.replace({ name: "cms/contents", query: { pid: curSelectPartItem.value.id } });
111
117
  partExList.value = usePartExtensionList(curSelectPartItem.value.id).concat(usePartExtensionList(curSelectPartItem.value.name));
112
- partContentComponent.value = usePartContentComponent(curSelectPartItem.value.id) || usePartContentComponent(curSelectPartItem.value.name);
118
+ partContentExtension.value = usePartContentComponent(curSelectPartItem.value.id) || usePartContentComponent(curSelectPartItem.value.name);
113
119
  }
114
120
  };
115
121
  const deletePartHandle = (item) => {
@@ -256,190 +262,219 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
256
262
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => activeTabName.value = $event),
257
263
  class: "mk-cms-contents__body__right"
258
264
  }, {
259
- default: withCtx(() => [
260
- createElementVNode("div", _hoisted_5, [
261
- (openBlock(true), createElementBlock(Fragment, null, renderList(partExList.value, (ext, i) => {
262
- return openBlock(), createElementBlock(Fragment, null, [
263
- activeTabName.value == `part-ext${i}` && ext.save ? (openBlock(), createBlock(_component_el_button, {
264
- key: 0,
265
- type: "primary",
266
- text: "",
267
- onClick: ($event) => ext.save()
268
- }, {
269
- default: withCtx(() => [
270
- createVNode(_component_MKSvgIcon, {
271
- iconClass: "save",
272
- style: { "margin-right": "5px" }
273
- }),
274
- createTextVNode(" 保存" + toDisplayString(ext.title), 1)
275
- ]),
276
- _: 2
277
- }, 1032, ["onClick"])) : createCommentVNode("", true)
278
- ], 64);
279
- }), 256)),
280
- activeTabName.value == "part" || activeTabName.value == "part-content" && !partContentComponent.value ? (openBlock(), createBlock(_component_el_button, {
281
- key: 0,
282
- type: "primary",
283
- text: "",
284
- onClick: _cache[0] || (_cache[0] = ($event) => savePartHandle()),
285
- disabled: !(partDataForm == null ? void 0 : partDataForm.isChanged)
286
- }, {
287
- default: withCtx(() => [
288
- createVNode(_component_MKSvgIcon, {
289
- iconClass: "save",
290
- style: { "margin-right": "5px" }
291
- }),
292
- createTextVNode(" 保存 ")
293
- ]),
294
- _: 1
295
- }, 8, ["disabled"])) : createCommentVNode("", true),
296
- unref(CmsSettings).publish.mode == "static" && curSelectPartItem.value.coverTemplate || curSelectPartItem.value.listTemplate || curSelectPartItem.value.contentTemplate ? (openBlock(), createBlock(_component_el_dropdown, { key: 1 }, {
297
- dropdown: withCtx(() => [
298
- createVNode(_component_el_dropdown_menu, null, {
299
- default: withCtx(() => [
300
- unref(CmsSettings).publish.mode == "static" && curSelectPartItem.value.coverTemplate ? (openBlock(), createBlock(_component_el_dropdown_item, {
301
- key: 0,
302
- onClick: _cache[1] || (_cache[1] = ($event) => unref(CmsPartForm).openPreview(curSelectPartItem.value.id))
303
- }, {
304
- default: withCtx(() => [
305
- createVNode(_component_MKSvgIcon, {
306
- iconClass: "View",
307
- style: { "margin-left": "10px" }
308
- }),
309
- createTextVNode(" 预览封面 ")
310
- ]),
311
- _: 1
312
- })) : createCommentVNode("", true),
313
- curSelectPartItem.value.listTemplate ? (openBlock(), createBlock(_component_el_dropdown_item, {
314
- key: 1,
315
- onClick: _cache[2] || (_cache[2] = ($event) => unref(CmsPartForm).openPreview(curSelectPartItem.value.id, "1"))
316
- }, {
317
- default: withCtx(() => [
318
- createVNode(_component_MKSvgIcon, {
319
- iconClass: "View",
320
- style: { "margin-left": "10px" }
321
- }),
322
- createTextVNode(" 预览列表 ")
323
- ]),
324
- _: 1
325
- })) : createCommentVNode("", true),
326
- createVNode(_component_el_dropdown_item, {
327
- onClick: _cache[3] || (_cache[3] = ($event) => showPublish.value = true)
265
+ default: withCtx(() => {
266
+ var _a;
267
+ return [
268
+ createElementVNode("div", _hoisted_5, [
269
+ (openBlock(true), createElementBlock(Fragment, null, renderList(partExList.value, (ext, i) => {
270
+ return openBlock(), createElementBlock(Fragment, null, [
271
+ activeTabName.value == `part-ext${i}` && ext.save ? (openBlock(), createBlock(_component_el_button, {
272
+ key: 0,
273
+ type: "primary",
274
+ text: "",
275
+ onClick: ($event) => ext.save()
276
+ }, {
277
+ default: withCtx(() => [
278
+ createVNode(_component_MKSvgIcon, {
279
+ iconClass: "save",
280
+ style: { "margin-right": "5px" }
281
+ }),
282
+ createTextVNode(" 保存" + toDisplayString(ext.title), 1)
283
+ ]),
284
+ _: 2
285
+ }, 1032, ["onClick"])) : createCommentVNode("", true)
286
+ ], 64);
287
+ }), 256)),
288
+ activeTabName.value == "part" || activeTabName.value == "part-content" && !((_a = partContentExtension.value) == null ? void 0 : _a.component) ? (openBlock(), createBlock(_component_el_button, {
289
+ key: 0,
290
+ type: "primary",
291
+ text: "",
292
+ onClick: _cache[0] || (_cache[0] = ($event) => savePartHandle()),
293
+ disabled: !(partDataForm == null ? void 0 : partDataForm.isChanged)
294
+ }, {
295
+ default: withCtx(() => [
296
+ createVNode(_component_MKSvgIcon, {
297
+ iconClass: "save",
298
+ style: { "margin-right": "5px" }
299
+ }),
300
+ createTextVNode(" 保存 ")
301
+ ]),
302
+ _: 1
303
+ }, 8, ["disabled"])) : createCommentVNode("", true),
304
+ unref(CmsSettings).publish.mode == "static" && curSelectPartItem.value.coverTemplate || curSelectPartItem.value.listTemplate || curSelectPartItem.value.contentTemplate ? (openBlock(), createBlock(_component_el_dropdown, { key: 1 }, {
305
+ dropdown: withCtx(() => [
306
+ createVNode(_component_el_dropdown_menu, null, {
307
+ default: withCtx(() => [
308
+ unref(CmsSettings).publish.mode == "static" && curSelectPartItem.value.coverTemplate ? (openBlock(), createBlock(_component_el_dropdown_item, {
309
+ key: 0,
310
+ onClick: _cache[1] || (_cache[1] = ($event) => unref(CmsPartForm).openPreview(curSelectPartItem.value.id))
311
+ }, {
312
+ default: withCtx(() => [
313
+ createVNode(_component_MKSvgIcon, {
314
+ iconClass: "View",
315
+ style: { "margin-left": "10px" }
316
+ }),
317
+ createTextVNode(" 预览封面 ")
318
+ ]),
319
+ _: 1
320
+ })) : createCommentVNode("", true),
321
+ curSelectPartItem.value.listTemplate ? (openBlock(), createBlock(_component_el_dropdown_item, {
322
+ key: 1,
323
+ onClick: _cache[2] || (_cache[2] = ($event) => unref(CmsPartForm).openPreview(curSelectPartItem.value.id, "1"))
324
+ }, {
325
+ default: withCtx(() => [
326
+ createVNode(_component_MKSvgIcon, {
327
+ iconClass: "View",
328
+ style: { "margin-left": "10px" }
329
+ }),
330
+ createTextVNode(" 预览列表 ")
331
+ ]),
332
+ _: 1
333
+ })) : createCommentVNode("", true),
334
+ createVNode(_component_el_dropdown_item, {
335
+ onClick: _cache[3] || (_cache[3] = ($event) => showPublish.value = true)
336
+ }, {
337
+ default: withCtx(() => [
338
+ createVNode(_component_MKSvgIcon, {
339
+ iconClass: "Promotion",
340
+ style: { "margin-left": "10px" }
341
+ }),
342
+ createTextVNode(" 发布当前栏目 ")
343
+ ]),
344
+ _: 1
345
+ })
346
+ ]),
347
+ _: 1
348
+ })
349
+ ]),
350
+ default: withCtx(() => [
351
+ createElementVNode("span", _hoisted_6, [
352
+ createVNode(_component_el_button, {
353
+ type: "primary",
354
+ text: ""
328
355
  }, {
329
356
  default: withCtx(() => [
330
- createVNode(_component_MKSvgIcon, {
331
- iconClass: "Promotion",
332
- style: { "margin-left": "10px" }
333
- }),
334
- createTextVNode(" 发布当前栏目 ")
357
+ createVNode(_component_MKSvgIcon, { iconClass: "MoreFilled" })
335
358
  ]),
336
359
  _: 1
337
360
  })
338
- ]),
339
- _: 1
340
- })
361
+ ])
362
+ ]),
363
+ _: 1
364
+ })) : createCommentVNode("", true)
365
+ ]),
366
+ curSelectPartItem.value.contentTemplate ? (openBlock(), createBlock(_component_el_tab_pane, {
367
+ key: 0,
368
+ label: "文章列表",
369
+ name: "article-list"
370
+ }, {
371
+ default: withCtx(() => [
372
+ activeTabName.value == "article-list" ? (openBlock(), createBlock(_sfc_main$1, {
373
+ key: 0,
374
+ part: curSelectPartItem.value,
375
+ style: { "height": "99%" }
376
+ }, null, 8, ["part"])) : createCommentVNode("", true)
341
377
  ]),
378
+ _: 1
379
+ })) : createCommentVNode("", true),
380
+ withDirectives((openBlock(), createBlock(_component_el_tab_pane, {
381
+ label: "栏目设置",
382
+ name: "part"
383
+ }, {
342
384
  default: withCtx(() => [
343
- createElementVNode("span", _hoisted_6, [
344
- createVNode(_component_el_button, {
345
- type: "primary",
346
- text: ""
347
- }, {
348
- default: withCtx(() => [
349
- createVNode(_component_MKSvgIcon, { iconClass: "MoreFilled" })
350
- ]),
351
- _: 1
352
- })
353
- ])
385
+ activeTabName.value == "part" ? (openBlock(), createBlock(_sfc_main$2, {
386
+ key: 0,
387
+ part: curSelectPartItem.value,
388
+ ref: "partInfoRef",
389
+ partDataForm
390
+ }, null, 8, ["part", "partDataForm"])) : createCommentVNode("", true)
354
391
  ]),
355
392
  _: 1
356
- })) : createCommentVNode("", true)
357
- ]),
358
- curSelectPartItem.value.contentTemplate ? (openBlock(), createBlock(_component_el_tab_pane, {
359
- key: 0,
360
- label: "文章列表",
361
- name: "article-list"
362
- }, {
363
- default: withCtx(() => [
364
- activeTabName.value == "article-list" ? (openBlock(), createBlock(_sfc_main$1, {
365
- key: 0,
366
- part: curSelectPartItem.value,
367
- style: { "height": "99%" }
368
- }, null, 8, ["part"])) : createCommentVNode("", true)
369
- ]),
370
- _: 1
371
- })) : createCommentVNode("", true),
372
- withDirectives((openBlock(), createBlock(_component_el_tab_pane, {
373
- label: "栏目设置",
374
- name: "part"
375
- }, {
376
- default: withCtx(() => [
377
- activeTabName.value == "part" ? (openBlock(), createBlock(_sfc_main$2, {
378
- key: 0,
379
- part: curSelectPartItem.value,
380
- ref: "partInfoRef",
381
- partDataForm
382
- }, null, 8, ["part", "partDataForm"])) : createCommentVNode("", true)
393
+ })), [
394
+ [_directive_loading, partDataForm.loading]
383
395
  ]),
384
- _: 1
385
- })), [
386
- [_directive_loading, partDataForm.loading]
387
- ]),
388
- curSelectPartItem.value.cmsPartTypeId != 1 ? (openBlock(), createBlock(_component_el_tab_pane, {
389
- key: 1,
390
- label: "页面内容",
391
- name: "part-content",
392
- style: { "background-color": "#f4f4f4" }
393
- }, {
394
- default: withCtx(() => {
395
- var _a, _b, _c, _d;
396
- return [
397
- partContentComponent.value && activeTabName.value == "part-content" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
398
- ((_a = partDataForm.data) == null ? void 0 : _a.id) ? (openBlock(), createBlock(_sfc_main$3, {
399
- key: 0,
400
- partId: (_b = partDataForm.data) == null ? void 0 : _b.id,
401
- title: (_c = partDataForm.data) == null ? void 0 : _c.title
402
- }, null, 8, ["partId", "title"])) : createCommentVNode("", true),
403
- createElementVNode("div", _hoisted_7, [
404
- (openBlock(), createBlock(resolveDynamicComponent(partContentComponent.value)))
405
- ])
406
- ], 64)) : activeTabName.value == "part-content" ? (openBlock(), createBlock(unref(MKDocEditor), {
407
- key: 1,
408
- css: unref(CmsSettings).part.doc.css,
409
- js: unref(CmsSettings).part.doc.js,
410
- loading: partDataForm.loading,
411
- content: (_d = partDataForm.data) == null ? void 0 : _d.content,
412
- placeholder: "从这里开始写正文...",
413
- onChange: docEditorChangeHandle
414
- }, {
415
- "before-extentions": withCtx(() => {
416
- var _a2, _b2, _c2;
417
- return [
396
+ curSelectPartItem.value.cmsPartTypeId != 1 ? (openBlock(), createBlock(_component_el_tab_pane, {
397
+ key: 1,
398
+ label: "页面内容",
399
+ name: "part-content",
400
+ style: { "background-color": "#f4f4f4" }
401
+ }, {
402
+ default: withCtx(() => {
403
+ var _a2, _b, _c, _d, _e;
404
+ return [
405
+ partContentExtension.value && activeTabName.value == "part-content" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
406
+ partContentExtension.value.component && partContentExtension.value.adComponent ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
407
+ createElementVNode("div", _hoisted_7, [
408
+ (openBlock(), createBlock(resolveDynamicComponent(partContentExtension.value.adComponent)))
409
+ ]),
410
+ createElementVNode("div", _hoisted_8, [
411
+ (openBlock(), createBlock(resolveDynamicComponent(partContentExtension.value.component)))
412
+ ])
413
+ ], 64)) : createCommentVNode("", true),
414
+ partContentExtension.value.component && !partContentExtension.value.adComponent ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
418
415
  ((_a2 = partDataForm.data) == null ? void 0 : _a2.id) ? (openBlock(), createBlock(_sfc_main$3, {
419
416
  key: 0,
420
- partId: (_b2 = partDataForm.data) == null ? void 0 : _b2.id,
421
- title: (_c2 = partDataForm.data) == null ? void 0 : _c2.title
422
- }, null, 8, ["partId", "title"])) : createCommentVNode("", true)
423
- ];
424
- }),
425
- _: 1
426
- }, 8, ["css", "js", "loading", "content"])) : createCommentVNode("", true)
427
- ];
428
- }),
429
- _: 1
430
- })) : createCommentVNode("", true),
431
- (openBlock(true), createElementBlock(Fragment, null, renderList(partExList.value, (ext, i) => {
432
- return openBlock(), createBlock(_component_el_tab_pane, {
433
- label: ext.title || `页面扩展设置 ${i == 0 ? "" : i}`,
434
- name: `part-ext${i}`
435
- }, {
436
- default: withCtx(() => [
437
- (openBlock(), createBlock(resolveDynamicComponent(ext.component)))
438
- ]),
439
- _: 2
440
- }, 1032, ["label", "name"]);
441
- }), 256))
442
- ]),
417
+ partId: (_b = partDataForm.data) == null ? void 0 : _b.id,
418
+ title: (_c = partDataForm.data) == null ? void 0 : _c.title
419
+ }, null, 8, ["partId", "title"])) : createCommentVNode("", true),
420
+ partContentExtension.value.component ? (openBlock(), createElementBlock("div", _hoisted_9, [
421
+ (openBlock(), createBlock(resolveDynamicComponent(partContentExtension.value.component)))
422
+ ])) : createCommentVNode("", true)
423
+ ], 64)) : createCommentVNode("", true),
424
+ !partContentExtension.value.component && partContentExtension.value.adComponent ? (openBlock(), createBlock(unref(MKDocEditor), {
425
+ key: 2,
426
+ css: unref(CmsSettings).part.doc.css,
427
+ js: unref(CmsSettings).part.doc.js,
428
+ loading: partDataForm.loading,
429
+ content: (_d = partDataForm.data) == null ? void 0 : _d.content,
430
+ placeholder: "从这里开始写正文...",
431
+ onChange: docEditorChangeHandle
432
+ }, {
433
+ "before-extentions": withCtx(() => [
434
+ createElementVNode("div", _hoisted_10, [
435
+ (openBlock(), createBlock(resolveDynamicComponent(partContentExtension.value.adComponent)))
436
+ ])
437
+ ]),
438
+ _: 1
439
+ }, 8, ["css", "js", "loading", "content"])) : createCommentVNode("", true)
440
+ ], 64)) : activeTabName.value == "part-content" ? (openBlock(), createBlock(unref(MKDocEditor), {
441
+ key: 1,
442
+ css: unref(CmsSettings).part.doc.css,
443
+ js: unref(CmsSettings).part.doc.js,
444
+ loading: partDataForm.loading,
445
+ content: (_e = partDataForm.data) == null ? void 0 : _e.content,
446
+ placeholder: "从这里开始写正文...",
447
+ onChange: docEditorChangeHandle
448
+ }, {
449
+ "before-extentions": withCtx(() => {
450
+ var _a3, _b2, _c2;
451
+ return [
452
+ ((_a3 = partDataForm.data) == null ? void 0 : _a3.id) ? (openBlock(), createBlock(_sfc_main$3, {
453
+ key: 0,
454
+ partId: (_b2 = partDataForm.data) == null ? void 0 : _b2.id,
455
+ title: (_c2 = partDataForm.data) == null ? void 0 : _c2.title
456
+ }, null, 8, ["partId", "title"])) : createCommentVNode("", true)
457
+ ];
458
+ }),
459
+ _: 1
460
+ }, 8, ["css", "js", "loading", "content"])) : createCommentVNode("", true)
461
+ ];
462
+ }),
463
+ _: 1
464
+ })) : createCommentVNode("", true),
465
+ (openBlock(true), createElementBlock(Fragment, null, renderList(partExList.value, (ext, i) => {
466
+ return openBlock(), createBlock(_component_el_tab_pane, {
467
+ label: ext.title || `页面扩展设置 ${i == 0 ? "" : i}`,
468
+ name: `part-ext${i}`
469
+ }, {
470
+ default: withCtx(() => [
471
+ (openBlock(), createBlock(resolveDynamicComponent(ext.component)))
472
+ ]),
473
+ _: 2
474
+ }, 1032, ["label", "name"]);
475
+ }), 256))
476
+ ];
477
+ }),
443
478
  _: 1
444
479
  }, 8, ["modelValue"])) : (openBlock(), createBlock(_component_el_empty, {
445
480
  key: 1,
@@ -475,9 +510,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
475
510
  }, 8, ["loading"])
476
511
  ]),
477
512
  default: withCtx(() => [
478
- createElementVNode("div", _hoisted_8, [
513
+ createElementVNode("div", _hoisted_11, [
479
514
  createElementVNode("div", null, [
480
- _hoisted_9,
515
+ _hoisted_12,
481
516
  createTextVNode(),
482
517
  createVNode(unref(ElSwitch), {
483
518
  modelValue: optionData.value.isPublishList,
@@ -486,7 +521,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
486
521
  }, null, 8, ["modelValue", "disabled"])
487
522
  ]),
488
523
  createElementVNode("div", null, [
489
- _hoisted_10,
524
+ _hoisted_13,
490
525
  createTextVNode(),
491
526
  createVNode(unref(ElSwitch), {
492
527
  modelValue: optionData.value.isPublishCover,
@@ -495,7 +530,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
495
530
  }, null, 8, ["modelValue", "disabled"])
496
531
  ]),
497
532
  createElementVNode("div", null, [
498
- _hoisted_11,
533
+ _hoisted_14,
499
534
  createTextVNode(),
500
535
  createVNode(unref(ElSwitch), {
501
536
  modelValue: optionData.value.isPublishContent,
@@ -504,7 +539,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
504
539
  }, null, 8, ["modelValue", "disabled"])
505
540
  ]),
506
541
  createElementVNode("div", null, [
507
- _hoisted_12,
542
+ _hoisted_15,
508
543
  createTextVNode(),
509
544
  createVNode(unref(ElSwitch), {
510
545
  modelValue: optionData.value.isPublishAssets,
@@ -512,7 +547,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
512
547
  }, null, 8, ["modelValue"])
513
548
  ]),
514
549
  createElementVNode("div", null, [
515
- _hoisted_13,
550
+ _hoisted_16,
516
551
  createTextVNode(),
517
552
  createVNode(unref(ElSwitch), {
518
553
  modelValue: optionData.value.isCompulsion,
@@ -1 +1 @@
1
- {"version":3,"file":"index.vue2.js","sources":["../../../../../../src/modules/cms/pages/cms-contents/index.vue"],"sourcesContent":["<template>\r\n <div class=\"mk-cms-contents__warp\" v-loading=\"loading\">\r\n <el-page-header style=\"background-color: #fff; padding: 10px\" :icon=\"null\">\r\n <template #title>\r\n <h3 style=\"color: var(--el-text-color-regular); margin-left: 10px\">\r\n <MKSvgIcon iconClass=\"richtext-outline\" style=\"margin-right: 5px\" />\r\n 内容管理\r\n </h3>\r\n </template>\r\n <template #extra>\r\n <div class=\"flex items-center\">\r\n <el-button-group>\r\n <el-button type=\"primary\" size=\"large\" text v-if=\"CmsSettings.publish.mode == 'static'\"\r\n @click=\"publishAllPartHandle\">\r\n <MKSvgIcon iconClass=\"Promotion\" style=\"margin-right: 10px\" />\r\n 整站发布\r\n </el-button>\r\n <el-button type=\"primary\" size=\"large\" text @click=\"showPartFormHandle\">\r\n <MKSvgIcon iconClass=\"Plus\" style=\"margin-right: 10px\" />\r\n 新增栏目\r\n </el-button>\r\n </el-button-group>\r\n </div>\r\n </template>\r\n </el-page-header>\r\n <div class=\"mk-cms-contents__body\">\r\n <MKPartTree class=\"mk-cms-contents__body__left\" @select=\"selectPartHandle\" @edit=\"editPartHandle\"\r\n @add=\"showPartFormHandle\" @deleteSuccessfully=\"deletePartHandle\" ref=\"partTreeRef\"\r\n :curSelectId=\"curSelectPartId\" />\r\n <el-tabs v-if=\"curSelectPartItem\" v-model=\"activeTabName\" class=\"mk-cms-contents__body__right\">\r\n <div class=\"mk-cms-contents__body__right__action\">\r\n\r\n <template v-for=\"(ext, i) in partExList\" :label=\"ext.title || `页面扩展设置 ${i+1}`\" :name=\"\">\r\n <el-button type=\"primary\" text @click=\"ext.save()\" v-if=\"activeTabName == `part-ext${i}` && ext.save\">\r\n <MKSvgIcon iconClass=\"save\" style=\"margin-right: 5px\" />\r\n 保存{{ ext.title }}\r\n </el-button>\r\n </template>\r\n <template v-if=\"activeTabName == 'part' || (activeTabName == 'part-content' && !partContentComponent)\">\r\n <el-button type=\"primary\" text @click=\"savePartHandle()\" :disabled=\"!partDataForm?.isChanged\">\r\n <MKSvgIcon iconClass=\"save\" style=\"margin-right: 5px\" />\r\n 保存\r\n </el-button>\r\n </template>\r\n <el-dropdown\r\n v-if=\"CmsSettings.publish.mode == 'static' && curSelectPartItem.coverTemplate || curSelectPartItem.listTemplate || curSelectPartItem.contentTemplate\">\r\n <span class=\"el-dropdown-link\">\r\n <el-button type=\"primary\" text>\r\n <MKSvgIcon iconClass=\"MoreFilled\" />\r\n </el-button>\r\n </span>\r\n <template #dropdown>\r\n <el-dropdown-menu>\r\n <el-dropdown-item @click=\"CmsPartForm.openPreview(curSelectPartItem.id)\"\r\n v-if=\"CmsSettings.publish.mode == 'static' && curSelectPartItem.coverTemplate\">\r\n <MKSvgIcon iconClass=\"View\" style=\"margin-left: 10px;\" />\r\n 预览封面\r\n </el-dropdown-item>\r\n <el-dropdown-item @click=\"CmsPartForm.openPreview(curSelectPartItem.id, '1')\"\r\n v-if=\"curSelectPartItem.listTemplate\">\r\n <MKSvgIcon iconClass=\"View\" style=\"margin-left: 10px;\" />\r\n 预览列表\r\n </el-dropdown-item>\r\n <el-dropdown-item @click=\"showPublish = true\">\r\n <MKSvgIcon iconClass=\"Promotion\" style=\"margin-left: 10px;\" />\r\n 发布当前栏目\r\n </el-dropdown-item>\r\n </el-dropdown-menu>\r\n </template>\r\n </el-dropdown>\r\n </div>\r\n <el-tab-pane label=\"文章列表\" name=\"article-list\" v-if=\"curSelectPartItem.contentTemplate\">\r\n <ArticleList v-if=\"activeTabName == 'article-list'\" :part=\"curSelectPartItem\" style=\"height: 99%;\" />\r\n </el-tab-pane>\r\n <el-tab-pane label=\"栏目设置\" name=\"part\" v-loading=\"partDataForm.loading\">\r\n <PartInfo v-if=\"activeTabName == 'part'\" :part=\"curSelectPartItem\" ref=\"partInfoRef\"\r\n :partDataForm=\"partDataForm\" />\r\n </el-tab-pane>\r\n <el-tab-pane label=\"页面内容\" name=\"part-content\" style=\"background-color: #f4f4f4\"\r\n v-if=\"curSelectPartItem.cmsPartTypeId != 1\">\r\n\r\n <template v-if=\"partContentComponent && activeTabName == 'part-content'\">\r\n <PartBannerEdit v-if=\"partDataForm.data?.id\" :partId=\"partDataForm.data?.id\"\r\n :title=\"partDataForm.data?.title\" />\r\n <div style=\"background: #fff;margin-top: -10px;\">\r\n <component :is=\"partContentComponent\" />\r\n </div>\r\n </template>\r\n <template v-else-if=\"activeTabName == 'part-content'\">\r\n <MKDocEditor :css=\"CmsSettings.part.doc.css\" :js=\"CmsSettings.part.doc.js\" :loading=\"partDataForm.loading\"\r\n :content=\"partDataForm.data?.content\" placeholder=\"从这里开始写正文...\" @change=\"docEditorChangeHandle\">\r\n <template #before-extentions>\r\n <PartBannerEdit v-if=\"partDataForm.data?.id\" :partId=\"partDataForm.data?.id\"\r\n :title=\"partDataForm.data?.title\" />\r\n </template>\r\n </MKDocEditor>\r\n </template>\r\n\r\n </el-tab-pane>\r\n <el-tab-pane v-for=\"(ext, i) in partExList\" :label=\"ext.title || `页面扩展设置 ${i == 0 ? '' : i}`\" :name=\"`part-ext${i}`\">\r\n <component :is=\"ext.component\" />\r\n </el-tab-pane>\r\n\r\n </el-tabs>\r\n <el-empty v-else description=\"请选择栏目\" style=\"width: 100%\" />\r\n </div>\r\n <el-dialog v-model=\"showPublish\" title=\"栏目发布\" width=\"475px\" :append-to-body=\"false\">\r\n <div class=\"mk-cms-contents__publish\">\r\n <div><span>是否发布列表:</span> <el-switch v-model=\"optionData.isPublishList\"\r\n :disabled=\"!curSelectPartItem.listTemplate\" /></div>\r\n <div><span>是否发布封面:</span> <el-switch v-model=\"optionData.isPublishCover\"\r\n :disabled=\"!curSelectPartItem.coverTemplate\" /></div>\r\n <div><span>是否发布内容:</span> <el-switch v-model=\"optionData.isPublishContent\"\r\n :disabled=\"!curSelectPartItem.contentTemplate\" /></div>\r\n <div><span>是否发布资源:</span> <el-switch v-model=\"optionData.isPublishAssets\" /></div>\r\n <div><span>是否强制发布:</span> <el-switch v-model=\"optionData.isCompulsion\" /></div>\r\n </div>\r\n <template #footer>\r\n <el-button @click=\"showPublish = false\">取消</el-button>\r\n <el-button type=\"primary\" @click=\"publishPartHandle\" :loading=\"publishLoading\">确定</el-button>\r\n </template>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { MKPartTree } from \"../../components\";\r\nimport ArticleList from \"./components/article-list.vue\";\r\nimport PartInfo from \"./components/part-info.vue\";\r\nimport PartBannerEdit from \"./components/part-banner-edit.vue\";\r\nimport { MKDocEditor } from \"../../../../components\";\r\nimport { reactive, ref, watch, watchEffect } from \"vue\";\r\nimport { Dialoger } from \"@maketribe/dm\";\r\nimport { CmsContentManPartForm, CmsPartForm, CmsPartMiniForm } from \"../../dataviews/cms-parts\";\r\nimport { useRoute, useRouter } from \"vue-router\";\r\nimport { usePartExtensionList, usePartContentComponent, type PartExtension } from \"../../composables/part-extensions\"\r\nimport { ElSwitch } from \"element-plus\";\r\nimport { useCmsSettings } from \"../../cms-settings\"\r\n//路由 \r\nconst route = useRoute();\r\nconst router = useRouter();\r\n\r\n// 当前选中的栏目id\r\nconst curSelectPartId = ref<string>(route.query.pid as string)\r\nwatch(() => route.query.pid, (v: any) => {\r\n curSelectPartId.value = v\r\n}, { immediate: true });\r\n\r\n//栏目Mini表单\r\nconst partMiniForm = reactive<CmsPartMiniForm>(new CmsPartMiniForm());\r\n\r\n// cms 配置\r\nconst CmsSettings = useCmsSettings(true);\r\n\r\n//发布栏目时的配置\r\nconst showPublish = ref(false)\r\n\r\n//发布配置项\r\nconst optionData = ref({\r\n isPublishList: false,\r\n isPublishCover: false,\r\n isPublishContent: false,\r\n isPublishAssets: false,\r\n isCompulsion: true\r\n});\r\n\r\n//发布加载状态\r\nconst publishLoading = ref(false);\r\n\r\n// 数据加载状态\r\nconst loading = ref(false)\r\n\r\n// 激活的tab\r\nconst activeTabName = ref(\"article-list\");\r\n\r\n// 当前选中的菜单\r\nconst curSelectPartItem = ref(null as any);\r\n\r\n// 栏目树ref\r\nconst partTreeRef = ref(null);\r\n\r\n//栏目扩展\r\nconst partExList = ref<Array<PartExtension>>([]);\r\nconst partContentComponent = ref<any>(null)\r\n\r\n//栏目数据\r\nconst partDataForm = reactive(new CmsContentManPartForm()) as CmsContentManPartForm;\r\n\r\n// 初始化表单\r\npartDataForm.init();\r\n\r\n// 切换tab 加载栏目表单数据\r\nlet beforeInitFormPart: any = null;\r\nwatchEffect(async () => {\r\n if ((activeTabName.value == \"part\" || activeTabName.value == \"part-content\") && curSelectPartItem.value != beforeInitFormPart && curSelectPartItem.value) {\r\n try {\r\n beforeInitFormPart = curSelectPartItem.value;\r\n await partDataForm.editRecord(curSelectPartItem.value.id);\r\n } catch (error) {\r\n console.log(132)\r\n console.log(error)\r\n }\r\n }\r\n});\r\n\r\n// 选择栏目\r\nconst selectPartHandle = async (item: any) => {\r\n\r\n if (curSelectPartItem.value != item) {\r\n\r\n curSelectPartItem.value = item;\r\n\r\n if (!curSelectPartItem.value.contentTemplate) {\r\n activeTabName.value = \"part\";\r\n }\r\n else {\r\n activeTabName.value = \"article-list\";\r\n }\r\n router.replace({ name: 'cms/contents', query: { pid: curSelectPartItem.value.id } } as any)\r\n partExList.value = usePartExtensionList(curSelectPartItem.value.id).concat(usePartExtensionList(curSelectPartItem.value.name));\r\n partContentComponent.value = usePartContentComponent(curSelectPartItem.value.id) || usePartContentComponent(curSelectPartItem.value.name)\r\n }\r\n};\r\n\r\n//删除栏目\r\nconst deletePartHandle = (item: any) => {\r\n if (item.id == curSelectPartItem.value.id) {\r\n curSelectPartItem.value = null;\r\n }\r\n};\r\n\r\n//编辑栏目\r\nconst editPartHandle = (item: any) => {\r\n curSelectPartItem.value = item;\r\n activeTabName.value = \"part\";\r\n};\r\n\r\n/**\r\n * 显示添加栏目表单\r\n */\r\nconst showPartFormHandle = async (item?: any) => {\r\n await Dialoger.dataFormDialog({\r\n dataForm: partMiniForm as CmsContentManPartForm,\r\n });\r\n\r\n if (item.id) {\r\n partMiniForm.addRecord({ parentId: item.id });\r\n }\r\n\r\n};\r\n\r\nwatch(showPublish, async (v) => {\r\n if (v) {\r\n console.log(2)\r\n optionData.value.isPublishList = !!curSelectPartItem.value.listTemplate\r\n optionData.value.isPublishCover = !!curSelectPartItem.value.coverTemplate\r\n optionData.value.isPublishContent = !!curSelectPartItem.value.contentTemplate\r\n }\r\n})\r\n\r\n//监听表单完成事件\r\npartMiniForm.submittedEvent.on(({ response }: any) => {\r\n if (response.data.data) {\r\n // 重置选中\r\n curSelectPartId.value = response.data.data;\r\n // 刷新完成直接选中\r\n (partTreeRef.value! as any).dataTree?.load();\r\n }\r\n\r\n});\r\n\r\n//栏目发布\r\nconst publishAllPartHandle = async () => {\r\n\r\n try {\r\n\r\n loading.value = true;\r\n\r\n await CmsPartForm.publishAll()\r\n }\r\n finally {\r\n loading.value = false;\r\n }\r\n\r\n}\r\nconst publishPartHandle = async () => {\r\n\r\n try {\r\n\r\n publishLoading.value = true\r\n\r\n await CmsPartForm.publish(curSelectPartItem.value.id, optionData.value);\r\n\r\n showPublish.value = false;\r\n\r\n } finally {\r\n publishLoading.value = false\r\n }\r\n}\r\n\r\n/**\r\n * 保存栏目信息\r\n */\r\nconst savePartHandle = async () => {\r\n curSelectPartItem.value = partDataForm.data;\r\n await partDataForm.submit();\r\n}\r\n\r\n/**\r\n * 更新编辑器内容\r\n * @param v 内容\r\n */\r\nconst docEditorChangeHandle = (v: any) => {\r\n if(partDataForm.data){\r\n partDataForm.data.content = v\r\n }\r\n}\r\n</script>\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0IA,UAAM,QAAQ;AACd,UAAM,SAAS;AAGf,UAAM,kBAAkB,IAAY,M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A,IAAA;AAGF,UAAM,oBAAoB,YAAY;AAEhC,UAAA;AAEF,uBAAe,QAAQ;AAEvB,cAAM,YAAY,QAAQ,kBAAkB,MAAM,IAAI,WAAW,KAAK;AAEtE,oBAAY,QAAQ;AAAA,MAAA,UAEpB;AACA,uBAAe,QAAQ;AAAA,MACzB;AAAA,IAAA;AAMF,UAAM,iBAAiB,YAAY;AACjC,wBAAkB,QAAQ,aAAa;AACvC,YAAM,aAAa;IAAO;AAOtB,UAAA,wBAAwB,CAAC,MAAW;AACxC,UAAG,aAAa,MAAK;AACnB,qBAAa,KAAK,UAAU;AAAA,MAC9B;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.vue2.js","sources":["../../../../../../src/modules/cms/pages/cms-contents/index.vue"],"sourcesContent":["<template>\r\n <div class=\"mk-cms-contents__warp\" v-loading=\"loading\">\r\n <el-page-header style=\"background-color: #fff; padding: 10px\" :icon=\"null\">\r\n <template #title>\r\n <h3 style=\"color: var(--el-text-color-regular); margin-left: 10px\">\r\n <MKSvgIcon iconClass=\"richtext-outline\" style=\"margin-right: 5px\" />\r\n 内容管理\r\n </h3>\r\n </template>\r\n <template #extra>\r\n <div class=\"flex items-center\">\r\n <el-button-group>\r\n <el-button type=\"primary\" size=\"large\" text v-if=\"CmsSettings.publish.mode == 'static'\"\r\n @click=\"publishAllPartHandle\">\r\n <MKSvgIcon iconClass=\"Promotion\" style=\"margin-right: 10px\" />\r\n 整站发布\r\n </el-button>\r\n <el-button type=\"primary\" size=\"large\" text @click=\"showPartFormHandle\">\r\n <MKSvgIcon iconClass=\"Plus\" style=\"margin-right: 10px\" />\r\n 新增栏目\r\n </el-button>\r\n </el-button-group>\r\n </div>\r\n </template>\r\n </el-page-header>\r\n <div class=\"mk-cms-contents__body\">\r\n <MKPartTree class=\"mk-cms-contents__body__left\" @select=\"selectPartHandle\" @edit=\"editPartHandle\"\r\n @add=\"showPartFormHandle\" @deleteSuccessfully=\"deletePartHandle\" ref=\"partTreeRef\"\r\n :curSelectId=\"curSelectPartId\" />\r\n <el-tabs v-if=\"curSelectPartItem\" v-model=\"activeTabName\" class=\"mk-cms-contents__body__right\">\r\n <div class=\"mk-cms-contents__body__right__action\">\r\n\r\n <template v-for=\"(ext, i) in partExList\" :label=\"ext.title || `页面扩展设置 ${i+1}`\" :name=\"\">\r\n <el-button type=\"primary\" text @click=\"ext.save()\" v-if=\"activeTabName == `part-ext${i}` && ext.save\">\r\n <MKSvgIcon iconClass=\"save\" style=\"margin-right: 5px\" />\r\n 保存{{ ext.title }}\r\n </el-button>\r\n </template>\r\n <template v-if=\"activeTabName == 'part' || (activeTabName == 'part-content' && !partContentExtension?.component)\">\r\n <el-button type=\"primary\" text @click=\"savePartHandle()\" :disabled=\"!partDataForm?.isChanged\">\r\n <MKSvgIcon iconClass=\"save\" style=\"margin-right: 5px\" />\r\n 保存\r\n </el-button>\r\n </template>\r\n <el-dropdown\r\n v-if=\"CmsSettings.publish.mode == 'static' && curSelectPartItem.coverTemplate || curSelectPartItem.listTemplate || curSelectPartItem.contentTemplate\">\r\n <span class=\"el-dropdown-link\">\r\n <el-button type=\"primary\" text>\r\n <MKSvgIcon iconClass=\"MoreFilled\" />\r\n </el-button>\r\n </span>\r\n <template #dropdown>\r\n <el-dropdown-menu>\r\n <el-dropdown-item @click=\"CmsPartForm.openPreview(curSelectPartItem.id)\"\r\n v-if=\"CmsSettings.publish.mode == 'static' && curSelectPartItem.coverTemplate\">\r\n <MKSvgIcon iconClass=\"View\" style=\"margin-left: 10px;\" />\r\n 预览封面\r\n </el-dropdown-item>\r\n <el-dropdown-item @click=\"CmsPartForm.openPreview(curSelectPartItem.id, '1')\"\r\n v-if=\"curSelectPartItem.listTemplate\">\r\n <MKSvgIcon iconClass=\"View\" style=\"margin-left: 10px;\" />\r\n 预览列表\r\n </el-dropdown-item>\r\n <el-dropdown-item @click=\"showPublish = true\">\r\n <MKSvgIcon iconClass=\"Promotion\" style=\"margin-left: 10px;\" />\r\n 发布当前栏目\r\n </el-dropdown-item>\r\n </el-dropdown-menu>\r\n </template>\r\n </el-dropdown>\r\n </div>\r\n <el-tab-pane label=\"文章列表\" name=\"article-list\" v-if=\"curSelectPartItem.contentTemplate\">\r\n <ArticleList v-if=\"activeTabName == 'article-list'\" :part=\"curSelectPartItem\" style=\"height: 99%;\" />\r\n </el-tab-pane>\r\n <el-tab-pane label=\"栏目设置\" name=\"part\" v-loading=\"partDataForm.loading\">\r\n <PartInfo v-if=\"activeTabName == 'part'\" :part=\"curSelectPartItem\" ref=\"partInfoRef\"\r\n :partDataForm=\"partDataForm\" />\r\n </el-tab-pane>\r\n <el-tab-pane label=\"页面内容\" name=\"part-content\" style=\"background-color: #f4f4f4\"\r\n v-if=\"curSelectPartItem.cmsPartTypeId != 1\">\r\n <!-- 存在内容扩展配置 -->\r\n <template v-if=\"partContentExtension && activeTabName == 'part-content'\">\r\n\r\n <!-- 都自定义扩展的话 -->\r\n <template v-if=\"partContentExtension.component && partContentExtension.adComponent\">\r\n <div style=\"background: #fff;margin-top: 10px;\">\r\n <component :is=\"partContentExtension.adComponent\" />\r\n </div>\r\n <div style=\"background: #fff;\">\r\n <component :is=\"partContentExtension.component\" />\r\n </div>\r\n </template>\r\n <!-- 只扩展内容 -->\r\n <template v-if=\"partContentExtension.component && !partContentExtension.adComponent\">\r\n <PartBannerEdit v-if=\"partDataForm.data?.id\" :partId=\"partDataForm.data?.id\" :title=\"partDataForm.data?.title\" />\r\n <div style=\"background: #fff;margin-top: -10px;\" v-if=\"partContentExtension.component\">\r\n <component :is=\"partContentExtension.component\" />\r\n </div>\r\n </template>\r\n <!-- 只扩展栏目广告栏 -->\r\n <template v-if=\"!partContentExtension.component && partContentExtension.adComponent\">\r\n <MKDocEditor :css=\"CmsSettings.part.doc.css\" :js=\"CmsSettings.part.doc.js\" :loading=\"partDataForm.loading\"\r\n :content=\"partDataForm.data?.content\" placeholder=\"从这里开始写正文...\" @change=\"docEditorChangeHandle\">\r\n <template #before-extentions>\r\n <div style=\"background: #fff;margin-bottom: 10px;\">\r\n <component :is=\"partContentExtension.adComponent\" />\r\n </div>\r\n </template>\r\n </MKDocEditor>\r\n </template>\r\n \r\n </template>\r\n\r\n <template v-else-if=\"activeTabName == 'part-content'\">\r\n <MKDocEditor :css=\"CmsSettings.part.doc.css\" :js=\"CmsSettings.part.doc.js\" :loading=\"partDataForm.loading\"\r\n :content=\"partDataForm.data?.content\" placeholder=\"从这里开始写正文...\" @change=\"docEditorChangeHandle\">\r\n <template #before-extentions>\r\n <PartBannerEdit v-if=\"partDataForm.data?.id\" :partId=\"partDataForm.data?.id\"\r\n :title=\"partDataForm.data?.title\" />\r\n </template>\r\n </MKDocEditor>\r\n </template>\r\n\r\n </el-tab-pane>\r\n <el-tab-pane v-for=\"(ext, i) in partExList\" :label=\"ext.title || `页面扩展设置 ${i == 0 ? '' : i}`\" :name=\"`part-ext${i}`\">\r\n <component :is=\"ext.component\" />\r\n </el-tab-pane>\r\n\r\n </el-tabs>\r\n <el-empty v-else description=\"请选择栏目\" style=\"width: 100%\" />\r\n </div>\r\n <el-dialog v-model=\"showPublish\" title=\"栏目发布\" width=\"475px\" :append-to-body=\"false\">\r\n <div class=\"mk-cms-contents__publish\">\r\n <div><span>是否发布列表:</span> <el-switch v-model=\"optionData.isPublishList\"\r\n :disabled=\"!curSelectPartItem.listTemplate\" /></div>\r\n <div><span>是否发布封面:</span> <el-switch v-model=\"optionData.isPublishCover\"\r\n :disabled=\"!curSelectPartItem.coverTemplate\" /></div>\r\n <div><span>是否发布内容:</span> <el-switch v-model=\"optionData.isPublishContent\"\r\n :disabled=\"!curSelectPartItem.contentTemplate\" /></div>\r\n <div><span>是否发布资源:</span> <el-switch v-model=\"optionData.isPublishAssets\" /></div>\r\n <div><span>是否强制发布:</span> <el-switch v-model=\"optionData.isCompulsion\" /></div>\r\n </div>\r\n <template #footer>\r\n <el-button @click=\"showPublish = false\">取消</el-button>\r\n <el-button type=\"primary\" @click=\"publishPartHandle\" :loading=\"publishLoading\">确定</el-button>\r\n </template>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { MKPartTree } from \"../../components\";\r\nimport ArticleList from \"./components/article-list.vue\";\r\nimport PartInfo from \"./components/part-info.vue\";\r\nimport PartBannerEdit from \"./components/part-banner-edit.vue\";\r\nimport { MKDocEditor } from \"../../../../components\";\r\nimport { reactive, ref, watch, watchEffect } from \"vue\";\r\nimport { Dialoger } from \"@maketribe/dm\";\r\nimport { CmsContentManPartForm, CmsPartForm, CmsPartMiniForm } from \"../../dataviews/cms-parts\";\r\nimport { useRoute, useRouter } from \"vue-router\";\r\nimport { usePartExtensionList, usePartContentComponent, type PartExtension } from \"../../composables/part-extensions\"\r\nimport { ElSwitch } from \"element-plus\";\r\nimport { useCmsSettings } from \"../../cms-settings\"\r\n//路由 \r\nconst route = useRoute();\r\nconst router = useRouter();\r\n\r\n// 当前选中的栏目id\r\nconst curSelectPartId = ref<string>(route.query.pid as string)\r\nwatch(() => route.query.pid, (v: any) => {\r\n curSelectPartId.value = v\r\n}, { immediate: true });\r\n\r\n//栏目Mini表单\r\nconst partMiniForm = reactive<CmsPartMiniForm>(new CmsPartMiniForm());\r\n\r\n// cms 配置\r\nconst CmsSettings = useCmsSettings(true);\r\n\r\n//发布栏目时的配置\r\nconst showPublish = ref(false)\r\n\r\n//发布配置项\r\nconst optionData = ref({\r\n isPublishList: false,\r\n isPublishCover: false,\r\n isPublishContent: false,\r\n isPublishAssets: false,\r\n isCompulsion: true\r\n});\r\n\r\n//发布加载状态\r\nconst publishLoading = ref(false);\r\n\r\n// 数据加载状态\r\nconst loading = ref(false)\r\n\r\n// 激活的tab\r\nconst activeTabName = ref(\"article-list\");\r\n\r\n// 当前选中的菜单\r\nconst curSelectPartItem = ref(null as any);\r\n\r\n// 栏目树ref\r\nconst partTreeRef = ref(null);\r\n\r\n//栏目扩展\r\nconst partExList = ref<Array<PartExtension>>([]);\r\nconst partContentExtension = ref<any>(null)\r\n\r\n//栏目数据\r\nconst partDataForm = reactive(new CmsContentManPartForm()) as CmsContentManPartForm;\r\n\r\n// 初始化表单\r\npartDataForm.init();\r\n\r\n// 切换tab 加载栏目表单数据\r\nlet beforeInitFormPart: any = null;\r\nwatchEffect(async () => {\r\n if ((activeTabName.value == \"part\" || activeTabName.value == \"part-content\") && curSelectPartItem.value != beforeInitFormPart && curSelectPartItem.value) {\r\n try {\r\n beforeInitFormPart = curSelectPartItem.value;\r\n await partDataForm.editRecord(curSelectPartItem.value.id);\r\n } catch (error) {\r\n console.log(132)\r\n console.log(error)\r\n }\r\n }\r\n});\r\n\r\n// 选择栏目\r\nconst selectPartHandle = async (item: any) => {\r\n\r\n if (curSelectPartItem.value != item) {\r\n\r\n curSelectPartItem.value = item;\r\n\r\n if (!curSelectPartItem.value.contentTemplate) {\r\n activeTabName.value = \"part\";\r\n }\r\n else {\r\n activeTabName.value = \"article-list\";\r\n }\r\n router.replace({ name: 'cms/contents', query: { pid: curSelectPartItem.value.id } } as any)\r\n partExList.value = usePartExtensionList(curSelectPartItem.value.id).concat(usePartExtensionList(curSelectPartItem.value.name));\r\n partContentExtension.value = usePartContentComponent(curSelectPartItem.value.id) || usePartContentComponent(curSelectPartItem.value.name)\r\n }\r\n};\r\n\r\n//删除栏目\r\nconst deletePartHandle = (item: any) => {\r\n if (item.id == curSelectPartItem.value.id) {\r\n curSelectPartItem.value = null;\r\n }\r\n};\r\n\r\n//编辑栏目\r\nconst editPartHandle = (item: any) => {\r\n curSelectPartItem.value = item;\r\n activeTabName.value = \"part\";\r\n};\r\n\r\n/**\r\n * 显示添加栏目表单\r\n */\r\nconst showPartFormHandle = async (item?: any) => {\r\n await Dialoger.dataFormDialog({\r\n dataForm: partMiniForm as CmsContentManPartForm,\r\n });\r\n\r\n if (item.id) {\r\n partMiniForm.addRecord({ parentId: item.id });\r\n }\r\n\r\n};\r\n\r\nwatch(showPublish, async (v) => {\r\n if (v) {\r\n console.log(2)\r\n optionData.value.isPublishList = !!curSelectPartItem.value.listTemplate\r\n optionData.value.isPublishCover = !!curSelectPartItem.value.coverTemplate\r\n optionData.value.isPublishContent = !!curSelectPartItem.value.contentTemplate\r\n }\r\n})\r\n\r\n//监听表单完成事件\r\npartMiniForm.submittedEvent.on(({ response }: any) => {\r\n if (response.data.data) {\r\n // 重置选中\r\n curSelectPartId.value = response.data.data;\r\n // 刷新完成直接选中\r\n (partTreeRef.value! as any).dataTree?.load();\r\n }\r\n\r\n});\r\n\r\n//栏目发布\r\nconst publishAllPartHandle = async () => {\r\n\r\n try {\r\n\r\n loading.value = true;\r\n\r\n await CmsPartForm.publishAll()\r\n }\r\n finally {\r\n loading.value = false;\r\n }\r\n\r\n}\r\nconst publishPartHandle = async () => {\r\n\r\n try {\r\n\r\n publishLoading.value = true\r\n\r\n await CmsPartForm.publish(curSelectPartItem.value.id, optionData.value);\r\n\r\n showPublish.value = false;\r\n\r\n } finally {\r\n publishLoading.value = false\r\n }\r\n}\r\n\r\n/**\r\n * 保存栏目信息\r\n */\r\nconst savePartHandle = async () => {\r\n curSelectPartItem.value = partDataForm.data;\r\n await partDataForm.submit();\r\n}\r\n\r\n/**\r\n * 更新编辑器内容\r\n * @param v 内容\r\n */\r\nconst docEditorChangeHandle = (v: any) => {\r\n if(partDataForm.data){\r\n partDataForm.data.content = v\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0BAAY,MAAe,aAA3B,mBAAqC;AAAA,MACxC;AAAA,IAAA,CAED;AAGD,UAAM,uBAAuB,YAAY;AAEnC,UAAA;AAEF,gBAAQ,QAAQ;AAEhB,cAAM,YAAY;MAAW,UAE/B;AACE,gBAAQ,QAAQ;AAAA,MAClB;AAAA,IAAA;AAGF,UAAM,oBAAoB,YAAY;AAEhC,UAAA;AAEF,uBAAe,QAAQ;AAEvB,cAAM,YAAY,QAAQ,kBAAkB,MAAM,IAAI,WAAW,KAAK;AAEtE,oBAAY,QAAQ;AAAA,MAAA,UAEpB;AACA,uBAAe,QAAQ;AAAA,MACzB;AAAA,IAAA;AAMF,UAAM,iBAAiB,YAAY;AACjC,wBAAkB,QAAQ,aAAa;AACvC,YAAM,aAAa;IAAO;AAOtB,UAAA,wBAAwB,CAAC,MAAW;AACxC,UAAG,aAAa,MAAK;AACnB,qBAAa,KAAK,UAAU;AAAA,MAC9B;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -31,4 +31,4 @@ export declare const usePartContentComponent: (partIdorName: string | number) =>
31
31
  * @param partId
32
32
  * @returns
33
33
  */
34
- export declare const registerPartContentComponent: (partIdorName: string | number, component: any) => void;
34
+ export declare const registerPartContentComponent: (partIdorName: string | number, component: any, adComponent?: any) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maketribe/ms-app",
3
- "version": "3.2.34",
3
+ "version": "3.2.35",
4
4
  "description": "",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -52,9 +52,9 @@
52
52
  "vue-cropper": "^1.1.4",
53
53
  "vue-router": "^4.2.4",
54
54
  "@maketribe/dm": "^3.2.11",
55
+ "@maketribe/request": "^3.2.3",
55
56
  "@maketribe/locale": "^3.2.0",
56
- "@maketribe/utils": "^3.2.1",
57
- "@maketribe/request": "^3.2.3"
57
+ "@maketribe/utils": "^3.2.1"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/sortablejs": "^1.15.8"