screen.tsx 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import { useEditor } from "@/modules/editor";
  2. import { Select } from "ant-design-vue";
  3. import { defineComponent } from "vue";
  4. export default defineComponent({
  5. setup(props, ctx) {
  6. const editor = useEditor();
  7. const ctrl = editor.controls.screenCtrl;
  8. return () => {
  9. return (
  10. <div class="px-16px">
  11. {/* <div class="flex items-center my-15px">
  12. <span class="w-70px text-12px">屏幕类型</span>
  13. <Select
  14. value={ctrl.state.screen.useFor}
  15. onChange={(v) => {
  16. const s = {
  17. useFor: v,
  18. pageMode: ctrl.state.screen.pageMode,
  19. pageSizeType: ctrl.state.screen.pageSizeType,
  20. };
  21. ctrl.saveScreenPage();
  22. ctrl.state.setScreen(s as any);
  23. setTimeout(() => {
  24. editor.controls.editorCtrl.autoInScreen();
  25. }, 0);
  26. }}
  27. class="flex-1 overflow-hidden"
  28. options={[
  29. { label: "手机", value: "mobile" },
  30. { label: "PC", value: "pc" },
  31. ]}
  32. />
  33. </div> */}
  34. <div class="flex items-center my-15px">
  35. <span class="w-70px text-12px">页面模式</span>
  36. <Select
  37. onChange={(v) => {
  38. ctrl.saveScreenPage();
  39. const s = {
  40. useFor: ctrl.state.screen.useFor,
  41. pageMode: v,
  42. pageSizeType: ctrl.state.screen.pageSizeType,
  43. };
  44. if (v == "long") {
  45. s.pageSizeType = "normal";
  46. }
  47. ctrl.state.setScreen(s as any);
  48. setTimeout(() => {
  49. editor.controls.editorCtrl.autoInScreen();
  50. }, 0);
  51. }}
  52. value={ctrl.state.screen.pageMode}
  53. class="flex-1 overflow-hidden"
  54. options={[
  55. { label: "H5长页", value: "long" },
  56. { label: "翻页", value: "short" },
  57. ]}
  58. />
  59. </div>
  60. {ctrl.state.screen.pageMode == "short" &&
  61. ctrl.state.screen.useFor == "mobile" && (
  62. <div class="flex items-center my-15px">
  63. <span class="w-70px text-12px">屏幕长度</span>
  64. <Select
  65. onChange={(v) => {
  66. ctrl.saveScreenPage();
  67. const s = {
  68. useFor: ctrl.state.screen.useFor,
  69. pageMode: ctrl.state.screen.pageMode,
  70. pageSizeType: v,
  71. };
  72. ctrl.state.setScreen(s as any);
  73. }}
  74. value={ctrl.state.screen.pageSizeType}
  75. class="flex-1 overflow-hidden"
  76. options={[
  77. { label: "短屏幕", value: "short" },
  78. { label: "普通屏幕", value: "normal" },
  79. // { label: "长屏幕", value: "long" },
  80. ]}
  81. />
  82. </div>
  83. )}
  84. </div>
  85. );
  86. };
  87. },
  88. });