zsysview 0.1.34 → 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,10 +1,10 @@
1
- import { defineComponent, ref, watch, reactive, resolveComponent, resolveDirective, createBlock, openBlock, withCtx, withDirectives, withModifiers, createVNode, createCommentVNode, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString, createTextVNode, 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$3, k as _sfc_main$4, m as _sfc_main$5 } from "./index-AWs6yDvi.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$2 = /* @__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$1 = /* @__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 },
@@ -347,7 +347,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
347
347
  new_p: [
348
348
  { required: !0, message: "请输入新密码", trigger: "blur" }
349
349
  ]
350
- }), saveData = async () => await HttpApiV1.Post(HttpApiV1.url_user_change_pwd, { uid: form.value.uid, new_p: h.hashStr(form.value.new_p) }), submitForm = (formEl) => {
350
+ }), saveData = async () => await HttpApiV1.Post(HttpApiV1.url_user_change_pwd, { uid: props.id, new_p: h.hashStr(form.value.new_p) }), submitForm = (formEl) => {
351
351
  formEl && formEl.validate(async (valid) => {
352
352
  if (valid) {
353
353
  view.saving = !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,6 +464,227 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
464
464
  }, 8, ["modelValue"]);
465
465
  };
466
466
  }
467
+ }), _sfc_main$2 = /* @__PURE__ */ defineComponent({
468
+ __name: "user_module_setting",
469
+ setup(__props) {
470
+ const form = reactive({
471
+ need_to_change_password: 2,
472
+ lock_option: 1
473
+ });
474
+ async function saveConfig() {
475
+ (await HttpApiV1.Post(HttpApiV1.url_user_module_setting_save, {
476
+ need_to_change_password: form.need_to_change_password
477
+ })).IsSuccess ? ZSYSMessage.ShowSuccess("应用成功") : ZSYSMessage.ShowError("应用失败");
478
+ }
479
+ async function getConfig() {
480
+ let res = await HttpApiV1.Post(HttpApiV1.url_user_module_setting_get, {});
481
+ if (res.IsSuccess) {
482
+ let data = res.data;
483
+ form.need_to_change_password = data.need_to_change_password;
484
+ }
485
+ }
486
+ return onMounted(getConfig), (_ctx, _cache) => {
487
+ const _component_el_radio = resolveComponent("el-radio"), _component_el_radio_group = resolveComponent("el-radio-group"), _component_el_form_item = resolveComponent("el-form-item"), _component_el_option = resolveComponent("el-option"), _component_el_select = resolveComponent("el-select"), _component_el_button = resolveComponent("el-button"), _component_el_form = resolveComponent("el-form");
488
+ return openBlock(), createBlock(_component_el_form, {
489
+ "label-width": "auto",
490
+ style: { "max-width": "600px", "margin-top": "10px", "margin-left": "20px" }
491
+ }, {
492
+ default: withCtx(() => [
493
+ createVNode(_component_el_form_item, { label: "初始密码选项" }, {
494
+ default: withCtx(() => [
495
+ createVNode(_component_el_radio_group, {
496
+ modelValue: form.need_to_change_password,
497
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.need_to_change_password = $event)
498
+ }, {
499
+ default: withCtx(() => [
500
+ createVNode(_component_el_radio, { value: 2 }, {
501
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
502
+ createTextVNode("强制修改初始密码", -1)
503
+ ])]),
504
+ _: 1
505
+ }),
506
+ createVNode(_component_el_radio, { value: 1 }, {
507
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
508
+ createTextVNode("通知但不强制", -1)
509
+ ])]),
510
+ _: 1
511
+ }),
512
+ createVNode(_component_el_radio, { value: 0 }, {
513
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
514
+ createTextVNode("无要求", -1)
515
+ ])]),
516
+ _: 1
517
+ })
518
+ ]),
519
+ _: 1
520
+ }, 8, ["modelValue"])
521
+ ]),
522
+ _: 1
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
+ }),
541
+ createVNode(_component_el_form_item, { label: "冻结账号" }, {
542
+ default: withCtx(() => [
543
+ createVNode(_component_el_select, {
544
+ modelValue: form.lock_option,
545
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.lock_option = $event),
546
+ style: { width: "320px" }
547
+ }, {
548
+ default: withCtx(() => [
549
+ createVNode(_component_el_option, {
550
+ label: "连续错误5次冻结一段时间,越错越久",
551
+ value: 1
552
+ })
553
+ ]),
554
+ _: 1
555
+ }, 8, ["modelValue"])
556
+ ]),
557
+ _: 1
558
+ }),
559
+ createVNode(_component_el_form_item, null, {
560
+ default: withCtx(() => [
561
+ createVNode(_component_el_button, {
562
+ type: "primary",
563
+ onClick: saveConfig
564
+ }, {
565
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
566
+ createTextVNode("应用设置", -1)
567
+ ])]),
568
+ _: 1
569
+ })
570
+ ]),
571
+ _: 1
572
+ })
573
+ ]),
574
+ _: 1
575
+ });
576
+ };
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
+ }
467
688
  }), _hoisted_1 = { class: "flex_height" }, _hoisted_2 = {
468
689
  style: { padding: "0px 20px" },
469
690
  class: "flex_fill"
@@ -499,17 +720,21 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
499
720
  }), view = reactive({
500
721
  edit_id: BigInt(0),
501
722
  edit_dialog_show: !1,
502
- change_pwd_dialog_show: !1
503
- }), dataformat = computed(() => (item) => formatDateTime(item));
723
+ change_pwd_dialog_show: !1,
724
+ import_dialog_show: !1
725
+ }), dataformat = computed(() => (item) => formatDateTime(item)), unlockUser = async (uid) => {
726
+ let res = await HttpApiV1.Post(HttpApiV1.url_user_unlock, { id: uid });
727
+ res.IsSuccess ? ZSYSMessage.ShowSuccess("操作成功") : ZSYSMessage.ShowError(res.message);
728
+ };
504
729
  return (_ctx, _cache) => {
505
- 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_space = resolveComponent("el-space"), _component_el_tab_pane = resolveComponent("el-tab-pane"), _component_el_tabs = resolveComponent("el-tabs");
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");
506
731
  return openBlock(), createElementBlock(Fragment, null, [
507
732
  createElementVNode("div", _hoisted_1, [
508
- createVNode(_sfc_main$3),
733
+ createVNode(_sfc_main$5),
509
734
  createElementVNode("div", _hoisted_2, [
510
735
  createVNode(_component_el_tabs, {
511
736
  modelValue: activeName.value,
512
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => activeName.value = $event),
737
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => activeName.value = $event),
513
738
  style: { height: "100%" }
514
739
  }, {
515
740
  default: withCtx(() => [
@@ -519,7 +744,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
519
744
  style: { height: "100%" }
520
745
  }, {
521
746
  default: withCtx(() => [
522
- createVNode(_sfc_main$4, {
747
+ createVNode(_sfc_main$6, {
523
748
  config: listconfig,
524
749
  module: "user"
525
750
  }, {
@@ -531,10 +756,18 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
531
756
  view.edit_id = 0n, view.edit_dialog_show = !0;
532
757
  })
533
758
  }, {
534
- default: withCtx(() => [..._cache[4] || (_cache[4] = [
759
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [
535
760
  createTextVNode("新建用户", -1)
536
761
  ])]),
537
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
538
771
  })
539
772
  ]),
540
773
  content: withCtx(() => [
@@ -555,7 +788,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
555
788
  "disable-transitions": !0,
556
789
  size: "small"
557
790
  }, {
558
- default: withCtx(() => [..._cache[5] || (_cache[5] = [
791
+ default: withCtx(() => [..._cache[8] || (_cache[8] = [
559
792
  createTextVNode("正常", -1)
560
793
  ])]),
561
794
  _: 1
@@ -566,7 +799,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
566
799
  "disable-transitions": !0,
567
800
  size: "small"
568
801
  }, {
569
- default: withCtx(() => [..._cache[6] || (_cache[6] = [
802
+ default: withCtx(() => [..._cache[9] || (_cache[9] = [
570
803
  createTextVNode("禁用", -1)
571
804
  ])]),
572
805
  _: 1
@@ -610,7 +843,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
610
843
  createVNode(_component_el_table_column, {
611
844
  fixed: "right",
612
845
  label: "操作",
613
- width: "180"
846
+ width: "220"
614
847
  }, {
615
848
  default: withCtx(({ row }) => [
616
849
  createVNode(_component_el_space, null, {
@@ -621,7 +854,7 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
621
854
  view.edit_id = BigInt(row.uid), view.edit_dialog_show = !0;
622
855
  }
623
856
  }, {
624
- default: withCtx(() => [..._cache[7] || (_cache[7] = [
857
+ default: withCtx(() => [..._cache[10] || (_cache[10] = [
625
858
  createTextVNode("查看和编辑", -1)
626
859
  ])]),
627
860
  _: 1
@@ -632,16 +865,49 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
632
865
  view.edit_id = BigInt(row.uid), view.change_pwd_dialog_show = !0;
633
866
  }
634
867
  }, {
635
- default: withCtx(() => [..._cache[8] || (_cache[8] = [
868
+ default: withCtx(() => [..._cache[11] || (_cache[11] = [
636
869
  createTextVNode("改密码", -1)
637
870
  ])]),
638
871
  _: 1
639
872
  }, 8, ["onClick"]),
640
- createVNode(_sfc_main$5, {
873
+ createVNode(_sfc_main$7, {
641
874
  id: BigInt(row.uid),
642
875
  api_url: unref(HttpApiV1).url_user_del,
643
876
  module: "user"
644
- }, null, 8, ["id", "api_url"])
877
+ }, null, 8, ["id", "api_url"]),
878
+ createVNode(_component_el_dropdown, { trigger: "click" }, {
879
+ dropdown: withCtx(() => [
880
+ createVNode(_component_el_dropdown_menu, null, {
881
+ default: withCtx(() => [
882
+ createVNode(_component_el_dropdown_item, {
883
+ onClick: ($event) => unlockUser(row.uid)
884
+ }, {
885
+ default: withCtx(() => [..._cache[12] || (_cache[12] = [
886
+ createTextVNode("解除账号冻结", -1)
887
+ ])]),
888
+ _: 1
889
+ }, 8, ["onClick"])
890
+ ]),
891
+ _: 2
892
+ }, 1024)
893
+ ]),
894
+ default: withCtx(() => [
895
+ createElementVNode("span", null, [
896
+ createVNode(_component_el_link, { type: "primary" }, {
897
+ default: withCtx(() => [
898
+ createVNode(_component_el_icon, null, {
899
+ default: withCtx(() => [
900
+ createVNode(unref(more_filled_default))
901
+ ]),
902
+ _: 1
903
+ })
904
+ ]),
905
+ _: 1
906
+ })
907
+ ])
908
+ ]),
909
+ _: 2
910
+ }, 1024)
645
911
  ]),
646
912
  _: 2
647
913
  }, 1024)
@@ -657,22 +923,33 @@ const _hoisted_1$2 = { style: { float: "left" } }, _hoisted_2$1 = {
657
923
  createVNode(_component_el_tab_pane, {
658
924
  label: "设置",
659
925
  name: "second"
926
+ }, {
927
+ default: withCtx(() => [
928
+ createVNode(_sfc_main$2)
929
+ ]),
930
+ _: 1
660
931
  })
661
932
  ]),
662
933
  _: 1
663
934
  }, 8, ["modelValue"])
664
935
  ])
665
936
  ]),
666
- createVNode(_sfc_main$2, {
937
+ createVNode(_sfc_main$4, {
667
938
  id: view.edit_id,
668
939
  modelValue: view.edit_dialog_show,
669
- "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)
670
941
  }, null, 8, ["id", "modelValue"]),
671
- createVNode(_sfc_main$1, {
942
+ createVNode(_sfc_main$3, {
672
943
  id: view.edit_id,
673
944
  modelValue: view.change_pwd_dialog_show,
674
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => view.change_pwd_dialog_show = $event)
675
- }, 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"])
676
953
  ], 64);
677
954
  };
678
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-AWs6yDvi.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) {