zsysview 0.1.35 → 0.1.37

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.
@@ -1,53 +1,43 @@
1
- import { defineComponent, ref, reactive, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, createElementVNode, withCtx, createTextVNode } from "vue";
2
- import { i as _sfc_main$1, H as HttpApiV1, Z as ZSYSMessage } from "./index-CtKk28NV.js";
1
+ import { defineComponent, ref, reactive, onMounted, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, createElementVNode, withCtx, createTextVNode } from "vue";
2
+ import { i as _sfc_main$1, H as HttpApiV1, Z as ZSYSMessage } from "./index-AG3yhDG9.js";
3
3
  const _hoisted_1 = { style: { padding: "0px 20px" } }, _sfc_main = /* @__PURE__ */ defineComponent({
4
4
  __name: "systemsetting",
5
5
  setup(__props) {
6
- const tab = ref("base"), form = reactive({
7
- auto: !0,
8
- plan: "Everyday",
9
- hour: "01",
10
- minute: "00",
11
- path: "",
12
- keep: "keep20",
13
- use_ftp: !1,
14
- f_host: "",
15
- f_port: 21,
16
- f_u: "",
17
- f_p: "",
18
- f_path: "",
19
- f_tls: !0
6
+ const tab = ref("base"), view = reactive({
7
+ app_name: ""
20
8
  });
21
9
  async function saveConfig() {
22
10
  try {
23
11
  let data = {
24
- auto: form.auto ? 1 : 0,
25
- plan: form.plan,
26
- hour: form.hour,
27
- minute: form.minute,
28
- path: form.path,
29
- keep: form.keep,
30
- use_ftp: form.use_ftp ? 1 : 0,
31
- f_host: form.f_host,
32
- f_port: form.f_port,
33
- f_u: form.f_u,
34
- f_p: form.f_p,
35
- f_path: form.f_path,
36
- f_tls: form.f_tls ? 1 : 0
12
+ app_name: view.app_name
37
13
  }, res = await HttpApiV1.Post(HttpApiV1.url_backup_config_save, data);
38
- res.IsSuccess ? ZSYSMessage.ShowSuccess("保存成功") : ZSYSMessage.ShowError(res.message);
14
+ res.IsSuccess ? (ZSYSMessage.ShowSuccess("保存成功"), location.reload()) : ZSYSMessage.ShowError(res.message);
39
15
  } catch (e) {
40
16
  console.log(e), ZSYSMessage.ShowError("保存配置失败");
41
17
  }
42
18
  }
43
- return (_ctx, _cache) => {
19
+ async function getConfig() {
20
+ try {
21
+ let res = await HttpApiV1.Post(HttpApiV1.url_system_public, {});
22
+ if (res.IsSuccess) {
23
+ let data = res.data;
24
+ view.app_name = data.app_name;
25
+ } else
26
+ ZSYSMessage.ShowError(res.message);
27
+ } catch (e) {
28
+ console.log(e), ZSYSMessage.ShowError("获取配置失败");
29
+ }
30
+ }
31
+ return onMounted(() => {
32
+ getConfig();
33
+ }), (_ctx, _cache) => {
44
34
  const _component_el_input = resolveComponent("el-input"), _component_el_space = resolveComponent("el-space"), _component_el_form_item = resolveComponent("el-form-item"), _component_el_button = resolveComponent("el-button"), _component_el_form = resolveComponent("el-form"), _component_el_tab_pane = resolveComponent("el-tab-pane"), _component_el_tabs = resolveComponent("el-tabs");
45
35
  return openBlock(), createElementBlock(Fragment, null, [
46
36
  createVNode(_sfc_main$1),
47
37
  createElementVNode("div", _hoisted_1, [
48
38
  createVNode(_component_el_tabs, {
49
39
  modelValue: tab.value,
50
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => tab.value = $event)
40
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tab.value = $event)
51
41
  }, {
52
42
  default: withCtx(() => [
53
43
  createVNode(_component_el_tab_pane, {
@@ -68,22 +58,11 @@ const _hoisted_1 = { style: { padding: "0px 20px" } }, _sfc_main = /* @__PURE__
68
58
  alignment: "stretch"
69
59
  }, {
70
60
  default: withCtx(() => [
71
- createVNode(_component_el_input, { style: { width: "300px" } })
72
- ]),
73
- _: 1
74
- })
75
- ]),
76
- _: 1
77
- }),
78
- createVNode(_component_el_form_item, { label: "ICP备案" }, {
79
- default: withCtx(() => [
80
- createVNode(_component_el_space, {
81
- direction: "vertical",
82
- size: 2,
83
- alignment: "stretch"
84
- }, {
85
- default: withCtx(() => [
86
- createVNode(_component_el_input, { style: { width: "300px" } })
61
+ createVNode(_component_el_input, {
62
+ style: { width: "300px" },
63
+ modelValue: view.app_name,
64
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => view.app_name = $event)
65
+ }, null, 8, ["modelValue"])
87
66
  ]),
88
67
  _: 1
89
68
  })
@@ -96,7 +75,7 @@ const _hoisted_1 = { style: { padding: "0px 20px" } }, _sfc_main = /* @__PURE__
96
75
  type: "primary",
97
76
  onClick: saveConfig
98
77
  }, {
99
- default: withCtx(() => [..._cache[1] || (_cache[1] = [
78
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
100
79
  createTextVNode("应用设置", -1)
101
80
  ])]),
102
81
  _: 1
@@ -1,10 +1,10 @@
1
- import { defineComponent, ref, watch, reactive, resolveComponent, resolveDirective, createBlock, openBlock, withCtx, withDirectives, withModifiers, createVNode, createCommentVNode, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString, createTextVNode, onMounted, computed, unref } from "vue";
2
- import { z as zsysEventBus, l as useMagicKeys, w as whenever, H as HttpApiV1, Z as ZSYSMessage, j as formatDateTime, i as _sfc_main$4, k as _sfc_main$5, m as _sfc_main$6, n as more_filled_default } from "./index-CtKk28NV.js";
1
+ import { defineComponent, ref, watch, reactive, resolveComponent, resolveDirective, createBlock, openBlock, withCtx, withDirectives, withModifiers, createVNode, createCommentVNode, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString, createTextVNode, onMounted, vShow, computed, unref } from "vue";
2
+ import { z as zsysEventBus, l as useMagicKeys, w as whenever, H as HttpApiV1, Z as ZSYSMessage, j as formatDateTime, i as _sfc_main$5, k as _sfc_main$6, m as _sfc_main$7, n as more_filled_default } from "./index-AG3yhDG9.js";
3
3
  import { h } from "./index.es-DrN1BLo5.js";
4
- const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
4
+ const _hoisted_1$3 = { style: { float: "left" } }, _hoisted_2$1 = {
5
5
  key: 0,
6
6
  style: { float: "right", color: "var(--el-text-color-secondary)", "font-size": "13px" }
7
- }, _hoisted_3 = { style: { display: "flex", "justify-content": "right" } }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
7
+ }, _hoisted_3 = { style: { display: "flex", "justify-content": "right" } }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
8
8
  __name: "user_edit_dialog",
9
9
  props: {
10
10
  modelValue: { type: Boolean, required: !0 },
@@ -292,7 +292,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
292
292
  value: item.value
293
293
  }, {
294
294
  default: withCtx(() => [
295
- createElementVNode("span", _hoisted_1$2, toDisplayString(item.label), 1),
295
+ createElementVNode("span", _hoisted_1$3, toDisplayString(item.label), 1),
296
296
  item.enable ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_2$1, " 禁用不生效 "))
297
297
  ]),
298
298
  _: 2
@@ -313,7 +313,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
313
313
  }, 8, ["modelValue"]);
314
314
  };
315
315
  }
316
- }), _hoisted_1$1 = { style: { display: "flex", "justify-content": "right" } }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
316
+ }), _hoisted_1$2 = { style: { display: "flex", "justify-content": "right" } }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
317
317
  __name: "change_user_password_dialog",
318
318
  props: {
319
319
  modelValue: { type: Boolean, required: !0 },
@@ -382,7 +382,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
382
382
  "close-on-click-modal": !1
383
383
  }, {
384
384
  footer: withCtx(() => [
385
- createElementVNode("div", _hoisted_1$1, [
385
+ createElementVNode("div", _hoisted_1$2, [
386
386
  createVNode(_component_el_tooltip, {
387
387
  content: "快捷键 Alt+S",
388
388
  "show-after": 800
@@ -464,7 +464,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
464
464
  }, 8, ["modelValue"]);
465
465
  };
466
466
  }
467
- }), _sfc_main$1 = /* @__PURE__ */ defineComponent({
467
+ }), _sfc_main$2 = /* @__PURE__ */ defineComponent({
468
468
  __name: "user_module_setting",
469
469
  setup(__props) {
470
470
  const form = reactive({
@@ -521,6 +521,23 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
521
521
  ]),
522
522
  _: 1
523
523
  }),
524
+ createVNode(_component_el_form_item, { label: "登录验证码" }, {
525
+ default: withCtx(() => [
526
+ createVNode(_component_el_select, {
527
+ "model-value": 1,
528
+ style: { width: "200px" }
529
+ }, {
530
+ default: withCtx(() => [
531
+ createVNode(_component_el_option, {
532
+ label: "错误2次需要验证码",
533
+ value: 1
534
+ })
535
+ ]),
536
+ _: 1
537
+ })
538
+ ]),
539
+ _: 1
540
+ }),
524
541
  createVNode(_component_el_form_item, { label: "冻结账号" }, {
525
542
  default: withCtx(() => [
526
543
  createVNode(_component_el_select, {
@@ -558,6 +575,116 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
558
575
  });
559
576
  };
560
577
  }
578
+ }), _hoisted_1$1 = { style: { display: "flex", "justify-content": "right" } }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
579
+ __name: "import_dialog",
580
+ props: {
581
+ modelValue: { type: Boolean, required: !0 },
582
+ // 控制显示隐藏
583
+ template_url: { type: String, required: !0 },
584
+ upload_url: { type: String, required: !0 }
585
+ // exportUrl: { type: String, required: true },
586
+ // exportColumn: { type: [] }
587
+ },
588
+ emits: ["update:modelValue"],
589
+ setup(__props, { emit: __emit }) {
590
+ const inputRef = ref(null), props = __props, emit = __emit, visible = ref(!1);
591
+ watch(
592
+ () => props.modelValue,
593
+ (val) => {
594
+ visible.value = val;
595
+ },
596
+ { immediate: !0 }
597
+ ), watch(visible, (val) => {
598
+ emit("update:modelValue", val);
599
+ });
600
+ const open = () => {
601
+ view.exporting = !1;
602
+ };
603
+ function download() {
604
+ window.open(props.template_url);
605
+ }
606
+ const handleBeforeClose = (done) => {
607
+ ruleFormRef.value?.clearValidate(), done();
608
+ }, view = reactive({
609
+ exporting: !1,
610
+ // 导出框当前的状态
611
+ exportId: 0n
612
+ //导出id
613
+ }), ruleFormRef = ref(), focus = () => {
614
+ inputRef.value?.focus(), inputRef.value?.select();
615
+ };
616
+ return (_ctx, _cache) => {
617
+ const _component_el_button = resolveComponent("el-button"), _component_el_upload = resolveComponent("el-upload"), _component_el_space = resolveComponent("el-space"), _component_export_progress = resolveComponent("export_progress"), _component_el_dialog = resolveComponent("el-dialog");
618
+ return openBlock(), createBlock(_component_el_dialog, {
619
+ modelValue: visible.value,
620
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
621
+ title: "导入",
622
+ "align-center": !0,
623
+ "before-close": handleBeforeClose,
624
+ onOpen: open,
625
+ width: "800",
626
+ draggable: !0,
627
+ overflow: !0,
628
+ onOpened: focus,
629
+ "destroy-on-close": "",
630
+ "close-on-click-modal": !1
631
+ }, {
632
+ footer: withCtx(() => [
633
+ createElementVNode("div", _hoisted_1$1, [
634
+ withDirectives(createVNode(_component_el_button, { type: "primary" }, {
635
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
636
+ createTextVNode("开始导入", -1)
637
+ ])]),
638
+ _: 1
639
+ }, 512), [
640
+ [vShow, view.exporting == !1]
641
+ ])
642
+ ])
643
+ ]),
644
+ default: withCtx(() => [
645
+ createVNode(_component_el_space, {
646
+ direction: "vertical",
647
+ alignment: ""
648
+ }, {
649
+ default: withCtx(() => [
650
+ createVNode(_component_el_space, null, {
651
+ default: withCtx(() => [
652
+ createVNode(_component_el_button, { onClick: download }, {
653
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [
654
+ createTextVNode("下载模板进行填写", -1)
655
+ ])]),
656
+ _: 1
657
+ }),
658
+ createVNode(_component_el_upload, {
659
+ action: props.upload_url,
660
+ limit: 1
661
+ }, {
662
+ default: withCtx(() => [
663
+ createVNode(_component_el_button, null, {
664
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
665
+ createTextVNode("上传填好的模板", -1)
666
+ ])]),
667
+ _: 1
668
+ })
669
+ ]),
670
+ _: 1
671
+ }, 8, ["action"])
672
+ ]),
673
+ _: 1
674
+ })
675
+ ]),
676
+ _: 1
677
+ }),
678
+ withDirectives(createVNode(_component_export_progress, {
679
+ "export-id": view.exportId
680
+ }, null, 8, ["export-id"]), [
681
+ [vShow, view.exporting]
682
+ ])
683
+ ]),
684
+ _: 1
685
+ }, 8, ["modelValue"]);
686
+ };
687
+ }
561
688
  }), _hoisted_1 = { class: "flex_height" }, _hoisted_2 = {
562
689
  style: { padding: "0px 20px" },
563
690
  class: "flex_fill"
@@ -593,7 +720,8 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
593
720
  }), view = reactive({
594
721
  edit_id: BigInt(0),
595
722
  edit_dialog_show: !1,
596
- change_pwd_dialog_show: !1
723
+ change_pwd_dialog_show: !1,
724
+ import_dialog_show: !1
597
725
  }), dataformat = computed(() => (item) => formatDateTime(item)), unlockUser = async (uid) => {
598
726
  let res = await HttpApiV1.Post(HttpApiV1.url_user_unlock, { id: uid });
599
727
  res.IsSuccess ? ZSYSMessage.ShowSuccess("操作成功") : ZSYSMessage.ShowError(res.message);
@@ -602,11 +730,11 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
602
730
  const _component_el_button = resolveComponent("el-button"), _component_el_table_column = resolveComponent("el-table-column"), _component_el_tag = resolveComponent("el-tag"), _component_el_link = resolveComponent("el-link"), _component_el_icon = resolveComponent("el-icon"), _component_el_dropdown_item = resolveComponent("el-dropdown-item"), _component_el_dropdown_menu = resolveComponent("el-dropdown-menu"), _component_el_dropdown = resolveComponent("el-dropdown"), _component_el_space = resolveComponent("el-space"), _component_el_tab_pane = resolveComponent("el-tab-pane"), _component_el_tabs = resolveComponent("el-tabs");
603
731
  return openBlock(), createElementBlock(Fragment, null, [
604
732
  createElementVNode("div", _hoisted_1, [
605
- createVNode(_sfc_main$4),
733
+ createVNode(_sfc_main$5),
606
734
  createElementVNode("div", _hoisted_2, [
607
735
  createVNode(_component_el_tabs, {
608
736
  modelValue: activeName.value,
609
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => activeName.value = $event),
737
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => activeName.value = $event),
610
738
  style: { height: "100%" }
611
739
  }, {
612
740
  default: withCtx(() => [
@@ -616,7 +744,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
616
744
  style: { height: "100%" }
617
745
  }, {
618
746
  default: withCtx(() => [
619
- createVNode(_sfc_main$5, {
747
+ createVNode(_sfc_main$6, {
620
748
  config: listconfig,
621
749
  module: "user"
622
750
  }, {
@@ -628,10 +756,18 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
628
756
  view.edit_id = 0n, view.edit_dialog_show = !0;
629
757
  })
630
758
  }, {
631
- default: withCtx(() => [..._cache[4] || (_cache[4] = [
759
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [
632
760
  createTextVNode("新建用户", -1)
633
761
  ])]),
634
762
  _: 1
763
+ }),
764
+ createVNode(_component_el_button, {
765
+ onClick: _cache[1] || (_cache[1] = ($event) => view.import_dialog_show = !0)
766
+ }, {
767
+ default: withCtx(() => [..._cache[7] || (_cache[7] = [
768
+ createTextVNode("导入", -1)
769
+ ])]),
770
+ _: 1
635
771
  })
636
772
  ]),
637
773
  content: withCtx(() => [
@@ -652,7 +788,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
652
788
  "disable-transitions": !0,
653
789
  size: "small"
654
790
  }, {
655
- default: withCtx(() => [..._cache[5] || (_cache[5] = [
791
+ default: withCtx(() => [..._cache[8] || (_cache[8] = [
656
792
  createTextVNode("正常", -1)
657
793
  ])]),
658
794
  _: 1
@@ -663,7 +799,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
663
799
  "disable-transitions": !0,
664
800
  size: "small"
665
801
  }, {
666
- default: withCtx(() => [..._cache[6] || (_cache[6] = [
802
+ default: withCtx(() => [..._cache[9] || (_cache[9] = [
667
803
  createTextVNode("禁用", -1)
668
804
  ])]),
669
805
  _: 1
@@ -718,7 +854,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
718
854
  view.edit_id = BigInt(row.uid), view.edit_dialog_show = !0;
719
855
  }
720
856
  }, {
721
- default: withCtx(() => [..._cache[7] || (_cache[7] = [
857
+ default: withCtx(() => [..._cache[10] || (_cache[10] = [
722
858
  createTextVNode("查看和编辑", -1)
723
859
  ])]),
724
860
  _: 1
@@ -729,12 +865,12 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
729
865
  view.edit_id = BigInt(row.uid), view.change_pwd_dialog_show = !0;
730
866
  }
731
867
  }, {
732
- default: withCtx(() => [..._cache[8] || (_cache[8] = [
868
+ default: withCtx(() => [..._cache[11] || (_cache[11] = [
733
869
  createTextVNode("改密码", -1)
734
870
  ])]),
735
871
  _: 1
736
872
  }, 8, ["onClick"]),
737
- createVNode(_sfc_main$6, {
873
+ createVNode(_sfc_main$7, {
738
874
  id: BigInt(row.uid),
739
875
  api_url: unref(HttpApiV1).url_user_del,
740
876
  module: "user"
@@ -746,7 +882,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
746
882
  createVNode(_component_el_dropdown_item, {
747
883
  onClick: ($event) => unlockUser(row.uid)
748
884
  }, {
749
- default: withCtx(() => [..._cache[9] || (_cache[9] = [
885
+ default: withCtx(() => [..._cache[12] || (_cache[12] = [
750
886
  createTextVNode("解除账号冻结", -1)
751
887
  ])]),
752
888
  _: 1
@@ -789,7 +925,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
789
925
  name: "second"
790
926
  }, {
791
927
  default: withCtx(() => [
792
- createVNode(_sfc_main$1)
928
+ createVNode(_sfc_main$2)
793
929
  ]),
794
930
  _: 1
795
931
  })
@@ -798,16 +934,22 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
798
934
  }, 8, ["modelValue"])
799
935
  ])
800
936
  ]),
801
- createVNode(_sfc_main$3, {
937
+ createVNode(_sfc_main$4, {
802
938
  id: view.edit_id,
803
939
  modelValue: view.edit_dialog_show,
804
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => view.edit_dialog_show = $event)
940
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => view.edit_dialog_show = $event)
805
941
  }, null, 8, ["id", "modelValue"]),
806
- createVNode(_sfc_main$2, {
942
+ createVNode(_sfc_main$3, {
807
943
  id: view.edit_id,
808
944
  modelValue: view.change_pwd_dialog_show,
809
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => view.change_pwd_dialog_show = $event)
810
- }, null, 8, ["id", "modelValue"])
945
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => view.change_pwd_dialog_show = $event)
946
+ }, null, 8, ["id", "modelValue"]),
947
+ createVNode(_sfc_main$1, {
948
+ modelValue: view.import_dialog_show,
949
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => view.import_dialog_show = $event),
950
+ template_url: "/api/user_import_template",
951
+ upload_url: "/api/user_import_upload"
952
+ }, null, 8, ["modelValue"])
811
953
  ], 64);
812
954
  };
813
955
  }
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, reactive, onMounted, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, createElementVNode, createBlock, createCommentVNode, createTextVNode, toDisplayString } from "vue";
2
- import { H as HttpApiV1, i as _sfc_main$1 } from "./index-CtKk28NV.js";
2
+ import { H as HttpApiV1, i as _sfc_main$1 } from "./index-AG3yhDG9.js";
3
3
  const _hoisted_1 = { style: { padding: "0px 20px", "white-space": "pre" } }, _sfc_main = /* @__PURE__ */ defineComponent({
4
4
  __name: "version",
5
5
  setup(__props) {