index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <div class="sassPlatform">
  3. <div class="sp_header">
  4. <!-- <div class="sp_h_logo">
  5. </div> -->
  6. <div class="sp_h_tagArea">
  7. <span :class="{tagActive:tagIndex==0}" style="margin-left: 10px;" @click="tagIndex = 0">应用中心</span>
  8. <span :class="{tagActive:tagIndex==1}" style="margin-left: 17.5px;" @click="goTestSmarter()">智能助手</span>
  9. </div>
  10. </div>
  11. <div class="sp_bottom">
  12. <div class="sp_b_left">
  13. <div class="sp_b_l_form" v-for="(item,index) in navList" :key="item.navIndex">
  14. <span @click="item.open = !item.open">{{ item.name }}<svg :style="`transform: rotate(${item.open?'180':'0'}deg);`" t="1739262423649" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7079" width="200" height="200"><path d="M52.335 261.072c-31.269 30.397-31.269 79.722 0 110.194l403.212 391.718c31.325 30.382 82.114 30.382 113.377 0l403.197-391.718c31.325-30.466 31.325-79.793 0-110.194-31.28-30.449-82.058-30.449-113.39 0l-346.497 336.64-346.457-336.64c-31.325-30.448-82.105-30.448-113.446 0l0 0z" p-id="7080"></path></svg></span>
  15. <div v-show="item.open" v-if="item.children.length>0">
  16. <span v-for="(item2,index2) in item.children" :key="item2.navIndex" @click="changeNavIndex(item2.navIndex,item2)" :class="{formActive:item2.navIndex==navIndex}">{{ item2.name }}</span>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="sp_b_right">
  21. <tableView v-if="navType == 'formManage' && navShowCardObj.id" :typeId="navShowCardObj.id" :typeList="navShowCardObj.typeList"/>
  22. <examine v-if="navType == 'annualAssessment'"/>
  23. <databoard v-if="navType == 'evaluationDataVisualization'"/>
  24. </div>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import tableView from './view/tableView.vue';
  30. import examine from './view/examine/index'
  31. import databoard from './view/databoard.vue';
  32. export default {
  33. components:{
  34. tableView,
  35. examine,
  36. databoard
  37. },
  38. data(){
  39. return{
  40. tagIndex:0,
  41. navList:[ ],
  42. navIndex:'0-0',
  43. navType:"",
  44. userId: this.$route.query.userid,
  45. oid: this.$route.query.oid,
  46. org: this.$route.query.org,
  47. role:this.$route.query.role,
  48. }
  49. },
  50. computed:{
  51. navShowCardObj(){
  52. let _result = {
  53. id:"",
  54. typeList:[],
  55. }
  56. if(this.navType == 'formManage'){
  57. let _indexList = this.navIndex.split("-");
  58. let _data = this.navList[parseInt(_indexList[0])];
  59. _result.id = _data.id;
  60. _result.typeList = _data.typeList;
  61. }
  62. return _result;
  63. }
  64. },
  65. methods: {
  66. getNavType() {
  67. return new Promise((resolve)=>{
  68. let params = {
  69. oid: "",//this.oid
  70. };
  71. this.ajax
  72. .get(this.$store.state.api + "selectTestType", params)
  73. .then(res => {
  74. let _data = res.data[0];
  75. let _type1 = _data.filter(i => i.pid == "");
  76. _type1.forEach((i,index) => {
  77. let _typeList = [];
  78. _typeList = _data.filter(i2 => i2.pid == i.id);
  79. let _children = [{name:"表单管理",type:"formManage",typeId:i.id,navIndex:`${index}-0`}]
  80. i.open = false;
  81. if(i.id=='e18d88b3-e828-11ef-b508-005056924926'){
  82. _children.push(...[
  83. {name:"年度考核",type:"annualAssessment",navIndex:`${index}-1`},
  84. {name:"考核数据可视化",type:"evaluationDataVisualization",navIndex:`${index}-2`},
  85. ]
  86. )
  87. i.open = true;
  88. }
  89. i.children = _children;
  90. i.typeList = _typeList;
  91. i.navIndex = `${index}`
  92. });
  93. this.navList = _type1;
  94. resolve()
  95. })
  96. .catch(err => {
  97. console.log(err);
  98. });
  99. })
  100. },
  101. changeNavIndex(newIndex,item){
  102. this.navIndex = newIndex;
  103. this.navType = item.type
  104. },
  105. goTestSmarter(){
  106. this.$router.push(
  107. "/testSmarter?userid=" +
  108. this.userId +
  109. "&oid=" +
  110. this.oid +
  111. "&org=" +
  112. this.org +
  113. "&role=" +
  114. this.role+
  115. "&cid=undefined"+
  116. "&back=sass"
  117. );
  118. },
  119. },
  120. mounted(){
  121. this.getNavType().then(_=>{
  122. if(this.navList.length>0){
  123. let _data = this.navList[0].children[0];
  124. this.changeNavIndex(_data.navIndex,_data)
  125. }
  126. });
  127. }
  128. }
  129. </script>
  130. <style scoped>
  131. .sassPlatform{
  132. width: 100vw;
  133. height: 100vh;
  134. margin: 0;
  135. box-sizing: border-box;
  136. background-color: white;
  137. }
  138. .sp_header{
  139. width: 100%;
  140. height: 54px;
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. box-sizing: border-box;
  145. padding: 10px 0;
  146. box-sizing: border-box;
  147. border-bottom: solid 1px #BBBBBB;
  148. }
  149. .sp_h_tagArea{
  150. width: auto;
  151. height: auto;
  152. display: flex;
  153. align-items: center;
  154. }
  155. .sp_h_tagArea>span{
  156. cursor: pointer;
  157. font-size: 20px;
  158. transition: .2s;
  159. color:#999;
  160. position: relative;
  161. padding: 0 15px;
  162. }
  163. .sp_h_tagArea>span:hover{
  164. color: #000;
  165. }
  166. .tagActive{
  167. font-weight: bold;
  168. color: #000 !important;
  169. }
  170. .tagActive::after{
  171. content: "";
  172. width: 100%;
  173. background: #3681FC;
  174. height: 2px;
  175. position: absolute;
  176. left: 0;
  177. bottom: -8px;
  178. }
  179. .sp_bottom{
  180. width: 100%;
  181. height: calc(100% - 70px);
  182. display: flex;
  183. }
  184. .sp_b_left{
  185. width: 15%;
  186. min-width: 200px;
  187. height: 100%;
  188. box-sizing: border-box;
  189. border-right:solid 1px #D5D5D5;
  190. }
  191. .sp_b_l_form{
  192. width: 100%;
  193. height: auto;
  194. background-color: white;
  195. }
  196. .sp_b_l_form>span{
  197. width: 100%;
  198. height: 60px;
  199. box-sizing: border-box;
  200. display: flex;
  201. align-items: center;
  202. justify-content: space-between;
  203. background-color: white;
  204. padding: 0 30px;
  205. cursor: pointer;
  206. transition: .3s;
  207. font-size: 18px;
  208. }
  209. .sp_b_l_form>span:hover{
  210. color: #1684FC;
  211. }
  212. .sp_b_l_form>span:hover>svg{
  213. fill: #1684FC;
  214. }
  215. .sp_b_l_form>span>svg{
  216. width: 15px;
  217. height: 15px;
  218. }
  219. .sp_b_l_form>div{
  220. width: 100%;
  221. height: auto;
  222. box-sizing: border-box;
  223. background-color: #F7F7F7;
  224. }
  225. .sp_b_l_form>div>span{
  226. width: 100%;
  227. height: 60px;
  228. display: flex;
  229. align-items: center;
  230. justify-content: space-between;
  231. box-sizing: border-box;
  232. padding: 0 0 0 45px;
  233. cursor: pointer;
  234. transition: .3s;
  235. font-size: 18px;
  236. }
  237. .sp_b_l_form>div>span:hover{
  238. color: #1684FC;
  239. }
  240. .formActive{
  241. color: #1684FC;
  242. }
  243. .sp_b_right{
  244. flex: 1;
  245. height: 100%;
  246. overflow: auto;
  247. }
  248. </style>