index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div class="full-security" v-if="data && !isFull">
  3. <div class="btns">
  4. <span v-for="v in views" @click="active = v" class="fun-ctrl">
  5. {{ v.name }}
  6. </span>
  7. </div>
  8. <div class="view" v-if="active">
  9. <ui-icon type="close" ctrl class="close" @click="active = void 0" />
  10. <h2>{{ active.name }}</h2>
  11. <!-- <component :is="active.view" v-if="mdata" /> -->
  12. <template v-if="mdata">
  13. <div class="item" v-for="item in mdata.items">
  14. <h3 class="title">{{ item.title }}</h3>
  15. <div class="content">
  16. <p v-for="c in item.content" :class="{ link: c.link, zk: kzs.includes(c) }">
  17. {{ kzs.includes(c) ? c.zk : c.title }}
  18. <Link :name="c.link" v-if="c.link" :fly-link="flyLink" :type="c.type" />
  19. <span
  20. class="mspan fun-ctrl"
  21. v-else-if="c.zk"
  22. @click="
  23. kzs.includes(c) ? (kzs = kzs.filter((i) => i !== c)) : kzs.push(c)
  24. "
  25. >
  26. {{ kzs.includes(c) ? "收起" : "更多" }}
  27. </span>
  28. </p>
  29. </div>
  30. </div>
  31. </template>
  32. </div>
  33. </div>
  34. <Mode />
  35. </template>
  36. <script setup lang="ts">
  37. import { computed, reactive, ref } from "vue";
  38. import { data, flyLink as flyLinkRaw } from "./store";
  39. import Link from "./link.vue";
  40. import Mode from "./mode.vue";
  41. const isFull = ref(false);
  42. const flyLink = async (name: string, type?: string) => {
  43. isFull.value = true;
  44. await flyLinkRaw(name, type);
  45. isFull.value = false;
  46. };
  47. const kzs = ref<any[]>([]);
  48. const views = reactive([
  49. { name: "职责要求", view: "0" },
  50. { name: "场所情况", view: "1" },
  51. { name: "勤务要求", view: "2" },
  52. ]);
  53. const active = ref<typeof views[0]>();
  54. const mdata = computed(() => {
  55. return active.value && data[Number(active.value?.view)];
  56. });
  57. </script>
  58. <style lang="scss" scoped>
  59. .full-security {
  60. position: absolute;
  61. z-index: 9;
  62. inset: 0;
  63. pointer-events: none;
  64. > * {
  65. pointer-events: all;
  66. }
  67. }
  68. .btns {
  69. position: absolute;
  70. bottom: 40px;
  71. left: 50%;
  72. display: flex;
  73. transform: translate(-50%, 0);
  74. span {
  75. cursor: pointer;
  76. margin: 0 35px;
  77. background: rgba(0, 0, 0, 0.9);
  78. width: 110px;
  79. height: 85px;
  80. text-align: center;
  81. line-height: 85px;
  82. color: #fff;
  83. font-size: 14px;
  84. border-radius: 6px;
  85. }
  86. }
  87. .view {
  88. position: absolute;
  89. right: 24px;
  90. top: 24px;
  91. border-radius: 10px;
  92. background: rgba(0, 0, 0, 0.9);
  93. bottom: 24px;
  94. width: 536px;
  95. overflow-y: auto;
  96. padding: 30px;
  97. .close {
  98. position: absolute;
  99. top: 15px;
  100. right: 15px;
  101. font-size: 20px;
  102. }
  103. > h2 {
  104. font-size: 18px;
  105. font-weight: bold;
  106. }
  107. }
  108. .c-item {
  109. margin-top: 10px;
  110. p {
  111. display: flex;
  112. align-items: center;
  113. justify-content: space-between;
  114. img {
  115. height: 15px;
  116. cursor: pointer;
  117. }
  118. }
  119. }
  120. .item:not(:last-child) .content {
  121. margin-bottom: 20px;
  122. border-bottom: 1px solid #000;
  123. padding-bottom: 20px;
  124. }
  125. .jb {
  126. display: flex;
  127. align-items: center;
  128. justify-content: space-between;
  129. }
  130. .item {
  131. margin-top: 20px;
  132. h3 {
  133. font-size: 15px;
  134. margin-bottom: 10px;
  135. }
  136. p {
  137. font-size: 14px;
  138. line-height: 1.89em;
  139. color: #9e9e9e;
  140. &.link {
  141. color: #fff;
  142. margin: 6px 0;
  143. display: flex;
  144. justify-content: space-between;
  145. align-items: center;
  146. }
  147. span {
  148. float: right;
  149. cursor: pointer;
  150. }
  151. &.zk {
  152. white-space: pre-line;
  153. span {
  154. float: none;
  155. display: block;
  156. text-align: center;
  157. }
  158. }
  159. }
  160. }
  161. </style>