index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. <template>
  2. <div class="i_body">
  3. <div
  4. class="i_b_left"
  5. :style="
  6. `width:${isFold ? '70px' : '15%'};min-width:${
  7. isFold ? '70px' : '200px'
  8. }`
  9. "
  10. >
  11. <!-- <div
  12. class="i_b_l_top"
  13. :style="`padding:${isFold ? ' 20px 5px' : '20px'}`"
  14. >
  15. <div @click="checkType(5)" :class="{ i_b_l_t_active: type == 5 }">
  16. <svg
  17. width="20"
  18. height="20"
  19. viewBox="0 0 20 20"
  20. xmlns="http://www.w3.org/2000/svg"
  21. >
  22. <g id="prefixIcon" opacity="0.9">
  23. <g id="Union">
  24. <path
  25. d="M10 11.25C11.9192 11.25 13.475 9.69419 13.475 7.775C13.475 5.85581 11.9192 4.3 10 4.3C8.08081 4.3 6.525 5.85581 6.525 7.775C6.525 9.69419 8.08081 11.25 10 11.25ZM10 10C8.77117 10 7.775 9.00383 7.775 7.775C7.775 6.54617 8.77117 5.55 10 5.55C11.2288 5.55 12.225 6.54617 12.225 7.775C12.225 9.00383 11.2288 10 10 10Z"
  26. fill-opacity="0.9"
  27. />
  28. <path
  29. d="M10 18.75C14.8325 18.75 18.75 14.8325 18.75 10C18.75 5.16751 14.8325 1.25 10 1.25C5.16751 1.25 1.25 5.16751 1.25 10C1.25 14.8325 5.16751 18.75 10 18.75ZM16.2443 14.1557C14.3435 13.0956 12.2319 12.5 9.99997 12.5C7.76802 12.5 5.65649 13.0956 3.75564 14.1557C2.96238 12.9661 2.5 11.5371 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 11.5371 17.0376 12.9662 16.2443 14.1557ZM15.454 15.1482C14.0867 16.5963 12.1489 17.5 10 17.5C7.85112 17.5 5.91332 16.5963 4.54593 15.1482C6.22562 14.247 8.06603 13.75 9.99997 13.75C11.9339 13.75 13.7743 14.247 15.454 15.1482Z"
  30. fill-opacity="0.9"
  31. />
  32. </g>
  33. </g>
  34. </svg>
  35. <span v-show="!isFold">教师画像</span>
  36. </div>
  37. <div
  38. @click="checkType(6)"
  39. v-if="ExamineBase.length > 0"
  40. :class="{ i_b_l_t_active: type == 6 }"
  41. >
  42. <svg
  43. width="20"
  44. height="20"
  45. viewBox="0 0 20 20"
  46. xmlns="http://www.w3.org/2000/svg"
  47. >
  48. <path
  49. d="M14.0625 2.1875C11.9914 2.1875 10.3125 3.86643 10.3125 5.9375C10.3125 8.00857 11.9914 9.6875 14.0625 9.6875C16.1336 9.6875 17.8125 8.00857 17.8125 5.9375C17.8125 3.86643 16.1336 2.1875 14.0625 2.1875ZM11.5625 5.9375C11.5625 4.55679 12.6818 3.4375 14.0625 3.4375C15.4432 3.4375 16.5625 4.55679 16.5625 5.9375C16.5625 7.31821 15.4432 8.4375 14.0625 8.4375C12.6818 8.4375 11.5625 7.31821 11.5625 5.9375Z"
  50. />
  51. <path
  52. d="M2.5 3.75C2.5 3.05964 3.05964 2.5 3.75 2.5H8.125C8.81536 2.5 9.375 3.05964 9.375 3.75V8.125C9.375 8.81536 8.81536 9.375 8.125 9.375H3.75C3.05964 9.375 2.5 8.81536 2.5 8.125V3.75ZM3.75 3.75V8.125H8.125V3.75H3.75Z"
  53. />
  54. <path
  55. d="M2.5 11.875C2.5 11.1846 3.05964 10.625 3.75 10.625H8.125C8.81536 10.625 9.375 11.1846 9.375 11.875V16.25C9.375 16.9404 8.81536 17.5 8.125 17.5H3.75C3.05964 17.5 2.5 16.9404 2.5 16.25V11.875ZM3.75 11.875V16.25H8.125V11.875H3.75Z"
  56. />
  57. <path
  58. d="M10.625 11.875C10.625 11.1846 11.1846 10.625 11.875 10.625H16.25C16.9404 10.625 17.5 11.1846 17.5 11.875V16.25C17.5 16.9404 16.9404 17.5 16.25 17.5H11.875C11.1846 17.5 10.625 16.9404 10.625 16.25V11.875ZM11.875 16.25H16.25V11.875H11.875V16.25Z"
  59. />
  60. </svg>
  61. <span v-show="!isFold">年度考核</span>
  62. </div>
  63. <div @click="checkType(1)" :class="{ i_b_l_t_active: type == 1 }">
  64. <svg
  65. width="20"
  66. height="20"
  67. viewBox="0 0 20 20"
  68. fill="none"
  69. xmlns="http://www.w3.org/2000/svg"
  70. >
  71. <g id="prefixIcon">
  72. <g id="Union">
  73. <path d="M8.75 6.5625H5V5.3125H8.75V6.5625Z" />
  74. <path
  75. d="M1.87531 3.12517C1.87521 2.77993 2.15506 2.5 2.50031 2.5H17.5003C17.8454 2.5 18.1252 2.77972 18.1253 3.12483L18.1265 8.74985C18.1266 9.0951 17.8467 9.37502 17.5015 9.37502H2.50149C2.15638 9.37502 1.87659 9.0953 1.87649 8.75019L1.87531 3.12517ZM3.12632 8.12502H16.8763L16.8755 3.75H3.12547L3.12632 8.12502Z"
  76. />
  77. <path d="M5.00014 14.6875H8.75014V13.4375H5.00014V14.6875Z" />
  78. <path
  79. d="M1.87666 11.25C1.87666 10.9048 2.15648 10.625 2.50166 10.625H17.5017C17.8468 10.625 18.1267 10.9048 18.1267 11.25V16.875C18.1267 17.2202 17.8468 17.5 17.5017 17.5H2.50166C2.15648 17.5 1.87666 17.2202 1.87666 16.875V11.25ZM3.12666 16.25H16.8767V11.875H3.12666V16.25Z"
  80. />
  81. </g>
  82. </g>
  83. </svg>
  84. <span v-show="!isFold">资料提交</span>
  85. </div>
  86. <div
  87. @click="checkType(2)"
  88. :class="{ i_b_l_t_active: type == 2 }"
  89. v-show="oid == '4c686762-1d0a-11ed-8c78-005056b86db5'"
  90. >
  91. <svg
  92. width="20"
  93. height="20"
  94. viewBox="0 0 20 20"
  95. fill="none"
  96. xmlns="http://www.w3.org/2000/svg"
  97. >
  98. <g id="prefixIcon" opacity="0.9">
  99. <g id="Union">
  100. <path d="M5.625 6.25H14.375V7.5H5.625V6.25Z" />
  101. <path d="M11.25 9.375H5.625V10.625H11.25V9.375Z" />
  102. <path
  103. d="M3.75 2.5C3.05964 2.5 2.5 3.05964 2.5 3.75V16.25C2.5 16.9404 3.05964 17.5 3.75 17.5H16.25C16.9404 17.5 17.5 16.9404 17.5 16.25V3.75C17.5 3.05964 16.9404 2.5 16.25 2.5H3.75ZM16.25 3.75V16.25H3.75L3.75 3.75H16.25Z"
  104. />
  105. </g>
  106. </g>
  107. </svg>
  108. <span v-show="!isFold">培训活动</span>
  109. </div>
  110. <div @click="checkType(3)" :class="{ i_b_l_t_active: type == 3 }">
  111. <svg
  112. width="20"
  113. height="20"
  114. viewBox="0 0 20 20"
  115. fill="none"
  116. xmlns="http://www.w3.org/2000/svg"
  117. >
  118. <g id="Frame 52">
  119. <path
  120. id="Union"
  121. fill-rule="evenodd"
  122. clip-rule="evenodd"
  123. d="M3.75 3.125C3.40482 3.125 3.125 3.40482 3.125 3.75V16.25C3.125 17.2855 3.96447 18.125 5 18.125H17.5C17.7949 18.125 18.0496 17.9189 18.1112 17.6306C18.1728 17.3423 18.0246 17.0502 17.7556 16.9297L17.7554 16.9296L17.75 16.9271L17.72 16.9127C17.6926 16.8994 17.6515 16.8788 17.6016 16.8518C17.5001 16.797 17.3689 16.7199 17.2415 16.6276C17.1106 16.5328 17.0049 16.4374 16.9373 16.3511C16.8936 16.2953 16.8802 16.2623 16.8763 16.25C16.8802 16.2377 16.8936 16.2047 16.9373 16.1489C17.0049 16.0626 17.1106 15.9672 17.2415 15.8724C17.3689 15.7801 17.5001 15.703 17.6016 15.6482C17.6515 15.6212 17.6926 15.6006 17.72 15.5873L17.7488 15.5735C17.7868 15.557 17.8228 15.5369 17.8564 15.5135C17.9102 15.4762 17.957 15.4312 17.9958 15.3805C18.0612 15.2955 18.1052 15.1931 18.1197 15.0815C18.1236 15.0518 18.1254 15.0217 18.125 14.9914V3.75C18.125 3.40482 17.8452 3.125 17.5 3.125H3.75ZM16.875 14.375V4.375H4.375V14.375H5H16.875ZM15.7904 15.625H5C4.65482 15.625 4.375 15.9048 4.375 16.25C4.375 16.5952 4.65482 16.875 5 16.875H15.7904C15.6955 16.6993 15.625 16.489 15.625 16.25C15.625 16.011 15.6955 15.8007 15.7904 15.625ZM5.625 8.125C5.625 7.77982 5.90482 7.5 6.25 7.5H11.25C11.5952 7.5 11.875 7.77982 11.875 8.125C11.875 8.47018 11.5952 8.75 11.25 8.75H6.25C5.90482 8.75 5.625 8.47018 5.625 8.125ZM6.25 10.625C5.90482 10.625 5.625 10.9048 5.625 11.25C5.625 11.5952 5.90482 11.875 6.25 11.875H9.375C9.72018 11.875 10 11.5952 10 11.25C10 10.9048 9.72018 10.625 9.375 10.625H6.25Z"
  124. />
  125. </g>
  126. </svg>
  127. <span v-show="!isFold">教学活动</span>
  128. </div>
  129. <div @click="checkType(4)" :class="{ i_b_l_t_active: type == 4 }">
  130. <svg
  131. width="20"
  132. height="20"
  133. viewBox="0 0 20 20"
  134. fill="none"
  135. xmlns="http://www.w3.org/2000/svg"
  136. >
  137. <g id="prefixIcon" opacity="0.9">
  138. <g id="Union">
  139. <path
  140. d="M17.6652 6.18811L13.611 2.13388L14.4948 1.25L18.5491 5.30422L17.6652 6.18811Z"
  141. />
  142. <path
  143. d="M7.46495 16.3885L2.94875 17.2917C2.68636 17.3442 2.45501 17.1129 2.50749 16.8505L3.41073 12.3343L12.5327 3.21227L16.587 7.2665L7.46495 16.3885ZM14.8192 7.2665L12.5327 4.98004L4.56223 12.9505L3.99062 15.8086L6.84869 15.237L14.8192 7.2665Z"
  144. />
  145. <path d="M18.75 13.75H13.75V15H18.75V13.75Z" />
  146. <path d="M18.75 16.25H10.625V17.5H18.75V16.25Z" />
  147. </g>
  148. </g>
  149. </svg>
  150. <span v-show="!isFold">教研活动</span>
  151. </div>
  152. <span>更多</span>
  153. <div :class="{ i_b_l_t_active: type == 7 }">
  154. <svg
  155. width="20"
  156. height="20"
  157. viewBox="0 0 20 20"
  158. xmlns="http://www.w3.org/2000/svg"
  159. >
  160. <path
  161. d="M10.5968 9.37499L7.78958 6.56776L8.67346 5.68388L12.636 9.64644C12.8313 9.8417 12.8313 10.1583 12.636 10.3535L8.67346 14.3161L7.78958 13.4322L10.5968 10.625L1.25 10.625L1.25 9.37497L10.5968 9.37499Z"
  162. />
  163. <path
  164. d="M5.00007 6.25V3.75H15.0001V16.25H5.00007V13.75H3.75007V16.875C3.75007 17.2202 4.02989 17.5 4.37507 17.5H15.6251C15.9702 17.5 16.2501 17.2202 16.2501 16.875V3.125C16.2501 2.77982 15.9702 2.5 15.6251 2.5H4.37507C4.02989 2.5 3.75007 2.77982 3.75007 3.125V6.25H5.00007Z"
  165. />
  166. </svg>
  167. <span>个人资料库</span>
  168. </div>
  169. </div> -->
  170. <div class="i_b_l_top2">
  171. <div class="i_b_l_t_navItem" v-for="(item,index) in navList" :key="index">
  172. <div class="i_b_l_t_ni_title" :class="{navActive:item.children.findIndex(i=>i.navIndex==navIndex)!=-1}" @click="item.open = !item.open">
  173. <span>{{ item.name }}</span>
  174. <svg t="1739861887813" :style="`transform:rotate(${item.open?0:180}deg);`" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4184" width="200" height="200"><path d="M942.936 747.245c29.315-28.497 29.315-74.739 0-103.307l-378.011-367.236c-29.367-28.483-76.982-28.483-106.291 0l-377.997 367.236c-29.367 28.562-29.367 74.806 0 103.307 29.325 28.546 76.929 28.546 106.304 0l324.841-315.6 324.803 315.599c29.367 28.545 76.973 28.544 106.356 0l0 0z" p-id="4185"></path></svg>
  175. </div>
  176. <div class="i_b_l_t_ni_box" v-show="item.open">
  177. <div class="i_b_l_t_ni_b_item" v-show="(item2.navIndex=='0-2'?oid=='4c686762-1d0a-11ed-8c78-005056b86db5':true)" @click="changeNavIndex(item2.navIndex,item2)" :class="{navActive:item2.navIndex==navIndex}" v-for="(item2,index2) in item.children" :key="index+'-'+index2">
  178. <span>{{ item2.name }}</span>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. <div class="i_b_l_bottom">
  184. <!-- <span>
  185. <svg
  186. @click="isFold = !isFold"
  187. :style="`transform: rotate(${isFold ? '0' : '180'}deg);`"
  188. t="1739254286361"
  189. class="icon"
  190. viewBox="0 0 1317 1024"
  191. version="1.1"
  192. xmlns="http://www.w3.org/2000/svg"
  193. p-id="6102"
  194. width="200"
  195. height="200"
  196. >
  197. <path
  198. fill="#868686"
  199. d="M1310.815586 480.686203L1055.295 257.418828a14.717485 14.717485 0 0 0-21.293382 4.070794 15.343761 15.343761 0 0 0-3.444518 9.707277v445.282197a14.717485 14.717485 0 0 0 14.717485 14.717485 13.151795 13.151795 0 0 0 9.394139-3.757656l255.520586-223.267374a14.717485 14.717485 0 0 0 0-20.667107zM1242.864646 1023.35431H73.607456A64.506422 64.506422 0 0 1 0.646308 950.393162 64.506422 64.506422 0 0 1 73.607456 877.432014h1169.25719A64.506422 64.506422 0 0 1 1315.825793 950.393162a64.506422 64.506422 0 0 1-72.961147 72.961148zM1242.864646 146.567986H73.607456A64.506422 64.506422 0 0 1 0.646308 73.606838 64.506422 64.506422 0 0 1 73.607456 0.64569h1169.25719A64.506422 64.506422 0 0 1 1315.825793 73.606838a64.506422 64.506422 0 0 1-72.961147 72.961148zM804.471484 584.961148H73.607456A64.506422 64.506422 0 0 1 0.646308 512 64.506422 64.506422 0 0 1 73.607456 439.038852h730.864028A64.506422 64.506422 0 0 1 877.432632 512a64.506422 64.506422 0 0 1-72.961148 72.961148z"
  200. p-id="6103"
  201. ></path>
  202. </svg>
  203. </span> -->
  204. </div>
  205. </div>
  206. <div class="i_b_right">
  207. <portrait :ExamineBase="ExamineBase" v-if="showCard == 'portraitOfTeacher'" />
  208. <Test :oid="oid" :userid="userid" v-if="showCard == 'formSubmit' && formSubmitObj.id" :typeId="formSubmitObj.id" :typeList="formSubmitObj.typeList"></Test>
  209. <TrainCourse v-if="showCard == 'trainingActivity'"></TrainCourse>
  210. <Course v-if="showCard == 'teachingActivity'"></Course>
  211. <trActivity v-if="showCard == 'teachingAndResearchActivities'" :oid="oid" :userid="userid"></trActivity>
  212. <examine v-if="showCard == 'annualAssessment'"></examine>
  213. </div>
  214. <!-- <div class="i_body_title">
  215. <div class="title_box">
  216. <span @click="checkType(1)" :class="{active:type == 1}">资料提交</span>
  217. <span @click="checkType(2)" :class="{active:type == 2}" v-show="oid == '4c686762-1d0a-11ed-8c78-005056b86db5'">培训活动</span>
  218. <span @click="checkType(3)" :class="{active:type == 3}">教学活动</span>
  219. <span @click="checkType(4)" :class="{active:type == 4}">教研活动</span>
  220. </div>
  221. <div>
  222. </div>
  223. </div> -->
  224. <!-- <el-button type="primary" class="bgColor" @click="returnA()">表单中心</el-button> -->
  225. <!-- <Test :oid="oid" :userid="userid" v-if="type == 1"></Test>
  226. <TrainCourse v-if="type == 2"></TrainCourse>
  227. <Course v-if="type == 3"></Course>
  228. <trActivity v-if="type == 4" :oid="oid" :userid="userid"></trActivity> -->
  229. </div>
  230. </template>
  231. <script>
  232. import Test from "./test.vue";
  233. import TrainCourse from "../../trainCourse/index.vue";
  234. import Course from "../../course/index.vue";
  235. import trActivity from "./trActivity.vue";
  236. import examine from "../examine/index";
  237. import portrait from "../portrait/index";
  238. export default {
  239. props: {
  240. userid: {
  241. type: String
  242. },
  243. oid: {
  244. type: String
  245. }
  246. },
  247. components: {
  248. Test,
  249. TrainCourse,
  250. Course,
  251. trActivity,
  252. examine,
  253. portrait
  254. },
  255. data() {
  256. return {
  257. type: 5,
  258. org: this.$route.query.org,
  259. role: this.$route.query.role,
  260. // oid: this.$route.query.oid,
  261. ExamineBase: [],
  262. isFold: false,
  263. navList:[],
  264. navIndex:'0-5',
  265. showCard:'portraitOfTeacher',
  266. showFormId:"",
  267. };
  268. },
  269. computed: {
  270. getNum() {
  271. return function(array) {
  272. let _array = JSON.parse(array);
  273. let num = 0;
  274. _array.forEach(el => {
  275. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  276. el.array.forEach(item => {
  277. if (item.ttype == 2 && item.array.length > 0) {
  278. item.array.forEach(item2 => {
  279. if (item2.ttype == 1 && item2.json) {
  280. num++;
  281. }
  282. });
  283. } else if (item.ttype == 1 && item.json) {
  284. num++;
  285. }
  286. });
  287. } else if (el.ttype == 1 && el.json) {
  288. num++;
  289. }
  290. });
  291. return num;
  292. };
  293. },
  294. getScore() {
  295. return function(array) {
  296. // let _array = JSON.parse(array)
  297. let _score = 0;
  298. let scoreArray = [];
  299. for (var i = 0; i < array.length; i++) {
  300. let _array = JSON.parse(array[i].courseJson);
  301. let score = 0;
  302. for (var j = 0; j < _array.length; j++) {
  303. let el = _array[j];
  304. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  305. for (var k = 0; k < el.array.length; k++) {
  306. let item = el.array[k];
  307. if (item.ttype == 2 && item.array.length > 0) {
  308. for (var z = 0; z < item.array.length; z++) {
  309. let item2 = item.array[k];
  310. if (item2.ttype == 1 && item2.json && item2.json.score2) {
  311. score += parseInt(item2.json.score2);
  312. }
  313. }
  314. } else if (item.ttype == 1 && item.json && item.json.score2) {
  315. score += parseInt(item.json.score2);
  316. }
  317. }
  318. } else if (el.ttype == 1 && el.json && el.json.score2) {
  319. score += parseInt(el.json.score2);
  320. }
  321. }
  322. scoreArray.push(score);
  323. }
  324. scoreArray.forEach(el => {
  325. _score += el;
  326. });
  327. console.log(scoreArray);
  328. return _score ? _score / scoreArray.length : 0;
  329. };
  330. },
  331. getImg() {
  332. return function(array) {
  333. let _array = JSON.parse(array);
  334. let _img = "";
  335. s: for (var j = 0; j < _array.length; j++) {
  336. let el = _array[j];
  337. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  338. for (var k = 0; k < el.array.length; k++) {
  339. let item = el.array[k];
  340. if (item.ttype == 2 && item.array.length > 0) {
  341. for (var z = 0; z < item.array.length; z++) {
  342. let item2 = item.array[k];
  343. if (
  344. item2.ttype == 1 &&
  345. item2.type == 5 &&
  346. item2.json &&
  347. item2.json.file &&
  348. item2.json.file.length > 0
  349. ) {
  350. for (var k = 0; k < item2.json.file.length; k++) {
  351. let ik = item2.json.file[k];
  352. if (ik.type == 3) {
  353. _img = ik.url;
  354. break s;
  355. }
  356. }
  357. }
  358. }
  359. } else if (
  360. item.ttype == 1 &&
  361. item.type == 5 &&
  362. item.json &&
  363. item.json.file &&
  364. item.json.file.length > 0
  365. ) {
  366. for (var k = 0; k < item.json.file.length; k++) {
  367. let ik = item.json.file[k];
  368. if (ik.type == 3) {
  369. _img = ik.url;
  370. break s;
  371. }
  372. }
  373. }
  374. }
  375. } else if (
  376. el.ttype == 1 &&
  377. el.type == 5 &&
  378. el.json &&
  379. el.json.file &&
  380. el.json.file.length > 0
  381. ) {
  382. for (var k = 0; k < el.json.file.length; k++) {
  383. let ik = el.json.file[k];
  384. if (ik.type == 3) {
  385. _img = ik.url;
  386. break s;
  387. }
  388. }
  389. }
  390. }
  391. return _img;
  392. };
  393. },
  394. formSubmitObj(){
  395. let _result = {
  396. id:"",
  397. typeList:[],
  398. }
  399. if(this.showCard == 'formSubmit'){
  400. let _indexList = this.navIndex.split("-");
  401. let _data = this.navList[parseInt(_indexList[0])];
  402. _result.id = _data.id;
  403. _result.typeList = _data.typeList;
  404. }
  405. return _result;
  406. }
  407. },
  408. methods: {
  409. checkType(type) {
  410. this.type = type;
  411. this.getWorks();
  412. },
  413. selectTestType() {
  414. let params = {
  415. oid: this.oid
  416. };
  417. this.ajax
  418. .get(this.$store.state.api + "selectTestType", params)
  419. .then(res => {
  420. this.typeArray = res.data[0];
  421. })
  422. .catch(err => {
  423. console.error(err);
  424. });
  425. },
  426. getWorks() {
  427. this.loading = true;
  428. let params = {
  429. uid: this.userid,
  430. typeid: this.type
  431. };
  432. this.ajax
  433. .get(this.$store.state.api + "getTestWorksPerson", params)
  434. .then(res => {
  435. this.loading = false;
  436. let array = res.data[0];
  437. let array2 = res.data[1];
  438. // 用于存储归类后的数据的对象
  439. let worksArray = {};
  440. // 遍历原始数据,根据 parentId 进行分组
  441. array2.forEach(item => {
  442. // console.log(item.chapters);
  443. worksArray[item.courseId] = {
  444. id: item.id,
  445. courseid: item.courseId,
  446. title: item.title,
  447. time: item.time,
  448. utime: item.utime,
  449. chapters: item.chapters,
  450. brief: item.brief,
  451. array: []
  452. };
  453. });
  454. worksArray = Object.values(worksArray);
  455. worksArray.forEach(el => {
  456. array.forEach(el2 => {
  457. if (el.courseid == el2.courseid) {
  458. el.array.push(el2);
  459. }
  460. });
  461. });
  462. // worksArray[item.courseid].array.push(item);
  463. this.worksArray = worksArray;
  464. this.$forceUpdate();
  465. })
  466. .catch(err => {
  467. this.loading = false;
  468. console.error(err);
  469. });
  470. },
  471. returnA() {
  472. this.$router.push(
  473. "/testStudent?userid=" +
  474. this.userid +
  475. "&oid=" +
  476. this.oid +
  477. "&org=" +
  478. this.org +
  479. "&role=" +
  480. this.role
  481. );
  482. },
  483. checkTest(cid, tid) {
  484. this.$router.push(
  485. "/checkTest?cid=" +
  486. cid +
  487. "&tid=" +
  488. tid +
  489. "&userid=" +
  490. this.userid +
  491. "&oid=" +
  492. this.oid +
  493. "&org=" +
  494. this.org +
  495. "&type=3" +
  496. "&role=" +
  497. this.role
  498. );
  499. },
  500. doTest(cid, tid) {
  501. this.$router.push(
  502. "/doTest?cid=" +
  503. cid +
  504. "&tid=" +
  505. tid +
  506. "&userid=" +
  507. this.userid +
  508. "&oid=" +
  509. this.oid +
  510. "&org=" +
  511. this.org +
  512. "&type=3" +
  513. "&role=" +
  514. this.role
  515. );
  516. },
  517. doTest2(cid) {
  518. this.$router.push(
  519. "/doTest?cid=" +
  520. cid +
  521. "&userid=" +
  522. this.userid +
  523. "&oid=" +
  524. this.oid +
  525. "&org=" +
  526. this.org +
  527. "&type=3" +
  528. "&role=" +
  529. this.role
  530. );
  531. },
  532. copyTest(tid) {
  533. let params = [
  534. {
  535. tid: tid,
  536. uid: this.userid
  537. }
  538. ];
  539. this.ajax
  540. .post(this.$store.state.api + "copyTestWorks", params)
  541. .then(res => {
  542. this.$message.success("复制成功");
  543. this.getWorks();
  544. })
  545. .catch(err => {
  546. console.error(err);
  547. });
  548. },
  549. deleteTest(tid) {
  550. let _this = this;
  551. _this
  552. .$confirm("确定删除此提交的表单么?", "提示", {
  553. confirmButtonText: "确定",
  554. cancelButtonText: "取消",
  555. type: "warning"
  556. })
  557. .then(() => {
  558. let params = [
  559. {
  560. tid: tid
  561. }
  562. ];
  563. _this.ajax
  564. .post(_this.$store.state.api + "deleteTestCourseWorks", params)
  565. .then(res => {
  566. _this.$message.success("删除成功");
  567. _this.getWorks();
  568. })
  569. .catch(err => {
  570. console.error(err);
  571. });
  572. })
  573. .catch(() => {
  574. return;
  575. });
  576. },
  577. getPageBase(type = 1) {
  578. let params = {
  579. typ: type,
  580. org: this.org,
  581. oid: this.oid
  582. };
  583. this.ajax
  584. .get(this.$store.state.api + "selectTestExamineBase", params)
  585. .then(res => {
  586. this.ExamineBase = res.data[0];
  587. if (type == 1 && !res.data[0].length) {
  588. this.getPageBase(2);
  589. }
  590. // console.log("selectTestExamineBase", res.data);
  591. })
  592. .catch(error => {
  593. console.log(error);
  594. });
  595. },
  596. getNavType() {
  597. let params = {
  598. oid: "",//this.oid
  599. };
  600. this.ajax
  601. .get(this.$store.state.api + "selectTestType", params)
  602. .then(res => {
  603. let _data = res.data[0];
  604. let _type1 = _data.filter(i => i.pid == "");
  605. _type1.forEach((i,index) => {
  606. let _typeList = [];
  607. _typeList = _data.filter(i2 => i2.pid == i.id);
  608. let _children = [{name:"资料提交",type:"formSubmit",typeId:i.id,navIndex:`${index}-0`}]
  609. i.open = false;
  610. if(i.id=='e18d88b3-e828-11ef-b508-005056924926'){
  611. _children.push(...[
  612. {name:"年度考核",type:"annualAssessment",navIndex:`${index}-1`},
  613. {name:"培训活动",type:"trainingActivity",navIndex:`${index}-2`},
  614. {name:"教学活动",type:"teachingActivity",navIndex:`${index}-3`},
  615. {name:"教研活动",type:"teachingAndResearchActivities",navIndex:`${index}-4`},
  616. {name:"教师画像",type:"portraitOfTeacher",navIndex:`${index}-5`}]
  617. )
  618. // if(this.oid=="4c686762-1d0a-11ed-8c78-005056b86db5"){
  619. // _children.splice(1,0,{name:"培训活动",type:"trainingActivity",navIndex:`${index}-2`})
  620. // }
  621. i.open = true;
  622. }
  623. i.children = _children;
  624. i.typeList = _typeList;
  625. i.navIndex = `${index}`
  626. });
  627. this.navList = _type1;
  628. })
  629. .catch(err => {
  630. console.log(err);
  631. });
  632. },
  633. changeNavIndex(newIndex,item){
  634. this.navIndex = newIndex;
  635. this.showCard = item.type;
  636. }
  637. },
  638. mounted() {
  639. this.selectTestType();
  640. this.getWorks();
  641. this.getPageBase();
  642. this.getNavType();
  643. }
  644. };
  645. </script>
  646. <style scoped>
  647. .i_body {
  648. width: 100%;
  649. height: 100%;
  650. /* background: #fff; */
  651. /* padding: 20px 10px; */
  652. box-sizing: border-box;
  653. background: #efeff0;
  654. display: flex;
  655. }
  656. .i_b_left {
  657. width: 15%;
  658. min-width: 200px;
  659. height: 100%;
  660. display: flex;
  661. flex-direction: column;
  662. background-color: #fff;
  663. }
  664. .i_b_l_top {
  665. width: 100%;
  666. height: auto;
  667. flex: 1;
  668. display: flex;
  669. flex-direction: column;
  670. box-sizing: border-box;
  671. padding: 20px;
  672. overflow: auto;
  673. }
  674. .i_b_l_top > div {
  675. width: 100%;
  676. height: 40px;
  677. background-color: #fff;
  678. margin-bottom: 15px;
  679. border-radius: 6px;
  680. display: flex;
  681. align-items: center;
  682. padding: 0 15px 0 10px;
  683. cursor: pointer;
  684. color: #00000099;
  685. box-sizing: border-box;
  686. transition: all 0.2s;
  687. }
  688. .i_b_l_top > div:hover {
  689. background-color: #f5f7fa;
  690. }
  691. .i_b_l_top > div.i_b_l_t_active {
  692. background-color: #3681fc;
  693. color: #fff;
  694. }
  695. .i_b_l_top > div.i_b_l_t_active > svg {
  696. fill: #fff;
  697. }
  698. .i_b_l_top > div > span {
  699. font-size: 18px;
  700. }
  701. .i_b_l_top > div > svg {
  702. width: 20px;
  703. height: 20px;
  704. min-width: 20px;
  705. min-height: 20px;
  706. fill: #00000099;
  707. margin-right: 15px;
  708. margin-left: 10px;
  709. }
  710. .i_b_l_top > span {
  711. margin: 15px 0 15px 20px;
  712. font-size: 16px;
  713. color: #00000066;
  714. }
  715. .i_b_l_bottom {
  716. width: 100%;
  717. height: 80px;
  718. box-sizing: border-box;
  719. padding: 0 25px;
  720. display: flex;
  721. align-items: center;
  722. border-top: solid 1px #e7e7e7;
  723. }
  724. .i_b_l_bottom > span {
  725. width: 20px;
  726. height: 20px;
  727. cursor: pointer;
  728. }
  729. .i_b_l_bottom > span > svg {
  730. width: 20px;
  731. height: 20px;
  732. min-width: 20px;
  733. min-height: 20px;
  734. }
  735. .i_b_right {
  736. flex: 1;
  737. overflow: auto;
  738. height: 100%;
  739. box-sizing: border-box;
  740. padding: 0 10px;
  741. }
  742. /*
  743. .i_body_title {
  744. font-size: 20px;
  745. height: 30px;
  746. line-height: 30px;
  747. display: flex;
  748. align-items: center;
  749. justify-content: space-between;
  750. }
  751. .i_body_title > .title_box span{
  752. cursor: pointer;
  753. border-bottom: 1px solid #40a0ff00;
  754. box-sizing: border-box;
  755. padding: 0px 0 5px;
  756. margin-left: 10px;
  757. }
  758. .i_body_title > .title_box span + span{
  759. margin-left: 20px;
  760. }
  761. .i_body_title > .title_box span.active{
  762. border-bottom: 2px solid rgb(12 125 255);
  763. color: rgb(12 125 255);
  764. } */
  765. .i_b_l_top2{
  766. width: 100%;
  767. height: 100%;
  768. box-sizing: border-box;
  769. padding: 20px 0px 10px 0px;
  770. }
  771. .i_b_l_t_navItem{
  772. width: 100%;
  773. height: auto;
  774. }
  775. .i_b_l_t_ni_title{
  776. width: 100%;
  777. height: 50px;
  778. display: flex;
  779. justify-content: space-between;
  780. align-items: center;
  781. box-sizing: border-box;
  782. padding: 0 30px 0 40px;
  783. transition: .2s;
  784. cursor: pointer;
  785. }
  786. .navActive{
  787. color: #1684FC;
  788. fill: #1684FC;
  789. }
  790. .i_b_l_t_ni_title>span{
  791. font-size: 18px;
  792. }
  793. .i_b_l_t_ni_title>svg{
  794. width: 15px;
  795. height: 15px;
  796. }
  797. .i_b_l_t_ni_title:hover{
  798. color: #1684FC;
  799. fill: #1684FC;
  800. }
  801. .i_b_l_t_ni_box{
  802. width: 100%;
  803. height: auto;
  804. background-color:#F7F7F7;
  805. }
  806. .i_b_l_t_ni_box>.navActive{
  807. background-color: #E6F7FF;
  808. }
  809. .i_b_l_t_ni_b_item{
  810. width: 100%;
  811. height: 50px;
  812. transition: .2s;
  813. display: flex;
  814. align-items: center;
  815. box-sizing: border-box;
  816. padding: 0 30px 0 60px;
  817. cursor: pointer;
  818. }
  819. .i_b_l_t_ni_b_item>span{
  820. font-size: 18px;
  821. }
  822. .i_b_l_t_ni_b_item:hover{
  823. background-color: #E6F7FF;
  824. }
  825. </style>