Advertisement
Guest User

Component A

a guest
Apr 11th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <template>
  2.   <div>
  3.     <button type="submit" class="btn btn-primary btn-style" @click.prevent="AddCommentDialog()">Comment</button>
  4.     <button type="submit" class="btn btn-primary btn-style" @click.prevent="AddCharacterDialog()">Character</button>
  5.     <button type="submit" class="btn btn-primary btn-style" @click.prevent="AddStatisticsDialog()">Statistics</button>
  6.     <button type="submit" class="btn btn-primary btn-style" @click.prevent="AddAthleticTestDialog()">Athletic Test</button>
  7.     <!--     <button
  8.       type="submit"
  9.       class="btn btn-primary btn-style"
  10.       @click.prevent="wrireCharacter();"
  11.     >Timetable</button>
  12.     <button
  13.       type="submit"
  14.       class="btn btn-primary btn-style"
  15.       @click.prevent="wrireCharacter();"
  16.     >Statistics</button>-->
  17.     <vue-good-table
  18.       ref="sr-table"
  19.       :ltr="true"
  20.       :columns="columns"
  21.       :rows="rows"
  22.       :pagination-options="{ enabled: true, perPage: 10}"
  23.       :search-options="{ enabled: false}"
  24.       max-height="700px"
  25.       :fixed-header="true"
  26.       @on-row-click="onRowClick"
  27.     >
  28.       <template slot="table-row" slot-scope="props">
  29.         <span v-if="props.column.field == 'details' && props.row.details != null">
  30.  
  31.           <span v-if="props.row.details.indexOf(',') == -1">{{props.row.details}}</span>
  32.           <span v-else-if="props.row.details.split(',')[0] == 'character'">
  33.               <span v-if="props.row.details.split(',')[1] === '1'"  title="Discipline" class="bg-success text-center text-white" style="padding:12px; vertical-align: middle; border-right: 1px solid #dee2e6;">1</span>
  34.               <span v-else-if="props.row.details.split(',')[1] === '2'" title="Discipline" div class="bg-info text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">2</span>
  35.               <span v-else-if="props.row.details.split(',')[1] === '3'" title="Discipline" div class="bg-warning text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">3</span>
  36.               <span v-else-if="props.row.details.split(',')[1] === '4'" title="Discipline" div class="bg-danger text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">4</span>
  37.  
  38.               <span v-if="props.row.details.split(',')[2] === '1'" title="Commitment" class="bg-success text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6;">1</span>
  39.               <span v-else-if="props.row.details.split(',')[2] === '2'" title="Commitment" div class="bg-info text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">2</span>
  40.               <span v-else-if="props.row.details.split(',')[2] === '3'" title="Commitment" div class="bg-warning text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">3</span>
  41.               <span v-else-if="props.row.details.split(',')[2] === '4'" title="Commitment" div class="bg-danger text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">4</span>
  42.  
  43.               <span v-if="props.row.details.split(',')[3] === '1'" title="Concentration" class="bg-success text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6;">1</span>
  44.               <span v-else-if="props.row.details.split(',')[3] === '2'" title="Concentration" div class="bg-info text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">2</span>
  45.               <span v-else-if="props.row.details.split(',')[3] === '3'" title="Concentration" div class="bg-warning text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">3</span>
  46.               <span v-else-if="props.row.details.split(',')[3] === '4'" title="Concentration" div class="bg-danger text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">4</span>
  47.           </span>
  48.        <span v-else-if="props.row.details.split(',')[0] == 'statistics'">
  49.             <div title="FGMA" class="d-inline-block ml-1">
  50.               <div style="width: 130px" class="mr-1">
  51.                 <table>
  52.                   <b>FGMA</b>
  53.                 </table>
  54.                 <table>{{props.row.details.split(',')[1]}}</table>
  55.               </div>
  56.             </div>
  57.             <div v-if="props.row.details.split(',')[2] !=null" title="PMA2" class="d-inline-block ml-1">
  58.               <div style="width: 130px">
  59.                 <table>
  60.                   <b>PMA2</b>
  61.                 </table>
  62.                 <table>{{props.row.details.split(',')[2]}}</table>
  63.               </div>
  64.             </div>
  65.             <div title="PMA3" class="d-inline-block ml-1">
  66.               <div style="width: 130px">
  67.                 <table>
  68.                   <b>PMA3</b>
  69.                 </table>
  70.                 <table>{{props.row.details.split(',')[3]}}</table>
  71.               </div>
  72.             </div>
  73.             <div title="FTMA" class="d-inline-block ml-1">
  74.               <div style="width: 130px">
  75.                 <table>
  76.                   <b>FTMA</b>
  77.                 </table>
  78.                 <table>{{props.row.details.split(',')[4]}}</table>
  79.               </div>
  80.             </div>
  81.             <div title="OFF" class="d-inline-block ml-1">
  82.               <div style="width: 130px">
  83.                 <table>
  84.                   <b>OFF</b>
  85.                 </table>
  86.                 <table>{{props.row.details.split(',')[5]}}</table>
  87.               </div>
  88.             </div>
  89.             <div title="DEF" class="d-inline-block ml-1">
  90.               <div style="width: 130px">
  91.                 <table>
  92.                   <b>DEF</b>
  93.                 </table>
  94.                 <table>{{props.row.details.split(',')[6]}}</table>
  95.               </div>
  96.             </div>
  97.             <div title="TOT" class="d-inline-block ml-1">
  98.               <div style="width: 130px">
  99.                 <table>
  100.                   <b>TOT</b>
  101.                 </table>
  102.                 <table>{{props.row.details.split(',')[7]}}</table>
  103.               </div>
  104.             </div>
  105.             <div title="AST" class="d-inline-block ml-1">
  106.               <div style="width: 130px">
  107.                 <table>
  108.                   <b>AST</b>
  109.                 </table>
  110.                 <table>{{props.row.details.split(',')[8]}}</table>
  111.               </div>
  112.             </div>
  113.             <div title="TO" class="d-inline-block ml-1">
  114.               <div style="width: 130px">
  115.                 <table>
  116.                   <b>TO</b>
  117.                 </table>
  118.                 <table>{{props.row.details.split(',')[10]}}</table>
  119.               </div>
  120.             </div>
  121.  
  122.             <div title="BS" class="d-inline-block ml-1">
  123.               <div style="width: 130px">
  124.                 <table>
  125.                   <b>BS</b>
  126.                 </table>
  127.                 <table>{{props.row.details.split(',')[11]}}</table>
  128.               </div>
  129.             </div>
  130.             <div title="FPF" class="d-inline-block ml-1">
  131.               <div style="width: 130px">
  132.                 <table>
  133.                   <b>FPF</b>
  134.                 </table>
  135.                 <table>{{props.row.details.split(',')[13]}}</table>
  136.               </div>
  137.             </div>
  138.             <div title="EFF" class="d-inline-block ml-1">
  139.               <div style="width: 130px">
  140.                 <table>
  141.                   <b>EFF</b>
  142.                 </table>
  143.                 <table>{{props.row.details.split(',')[14]}}</table>
  144.               </div>
  145.             </div>
  146.             <div title="PTS" class="d-inline-block ml-1">
  147.               <div style="width: 130px">
  148.                 <table>
  149.                   <b>PTS</b>
  150.                 </table>
  151.                 <table>{{props.row.details.split(',')[15]}}</table>
  152.               </div>
  153.             </div>
  154.             <div title="ST" class="d-inline-block ml-1">
  155.               <div style="width: 130px">
  156.                 <table>
  157.                   <b>ST</b>
  158.                 </table>
  159.                 <table>{{props.row.details.split(',')[9]}}</table>
  160.               </div>
  161.             </div>
  162.             <div title="PF" class="d-inline-block ml-1">
  163.               <div style="width: 130px">
  164.                 <table>
  165.                   <b>PF</b>
  166.                 </table>
  167.                 <table>{{props.row.details.split(',')[12]}}</table>
  168.               </div>
  169.             </div>
  170.           </span>
  171.  
  172.           <span v-else-if="props.row.details.split(',')[0] == 'athletics'">
  173.             <div title="Athletes" class="d-inline-block ml-1">
  174.               <div style="width: 130px">
  175.                 <table>
  176.                   <b>Athletes</b>
  177.                 </table>
  178.                 <table>{{props.row.details.split(',')[1]}}</table>
  179.               </div>
  180.             </div>
  181.             <div v-if="props.row.details.split(',')[2] !=null" title="Testing Day" class="d-inline-block ml-1">
  182.               <div style="width: 130px">
  183.                 <table>
  184.                   <b>Testing Day</b>
  185.                 </table>
  186.                 <table>{{props.row.details.split(',')[3]}}</table>
  187.               </div>
  188.             </div>
  189.             <div title="Age" class="d-inline-block ml-1">
  190.               <div style="width: 130px">
  191.                 <table>
  192.                   <b>Age</b>
  193.                 </table>
  194.                 <table>{{props.row.details.split(',')[3]}}</table>
  195.               </div>
  196.             </div>
  197.             <div title="Bodyweight" class="d-inline-block ml-1">
  198.               <div style="width: 130px">
  199.                 <table>
  200.                   <b>Bodyweight</b>
  201.                 </table>
  202.                 <table>{{props.row.details.split(',')[4]}}</table>
  203.               </div>
  204.             </div>
  205.             <div title="Bodyfat" class="d-inline-block ml-1">
  206.               <div style="width: 130px">
  207.                 <table>
  208.                   <b>Bodyfat</b>
  209.                 </table>
  210.                 <table>{{props.row.details.split(',')[5]}}</table>
  211.               </div>
  212.             </div>
  213.             <div title="Height" class="d-inline-block ml-1">
  214.               <div style="width: 130px">
  215.                 <table>
  216.                   <b>Height</b>
  217.                 </table>
  218.                 <table>{{props.row.details.split(',')[6]}}</table>
  219.               </div>
  220.             </div>
  221.             <div title="StandReach" class="d-inline-block ml-1">
  222.               <div style="width: 130px">
  223.                 <table>
  224.                   <b>Stand/Reach</b>
  225.                 </table>
  226.                 <table>{{props.row.details.split(',')[7]}}</table>
  227.               </div>
  228.             </div>
  229.             <div title="Wingspan" class="d-inline-block ml-1">
  230.               <div style="width: 130px">
  231.                 <table>
  232.                   <b>Wingspan</b>
  233.                 </table>
  234.                 <table>{{props.row.details.split(',')[8]}}</table>
  235.               </div>
  236.             </div>
  237.             <div title="Birthday" class="d-inline-block ml-1">
  238.               <div style="width: 130px">
  239.                 <table>
  240.                   <b>Birthday</b>
  241.                 </table>
  242.                 <table>{{props.row.details.split(',')[9]}}</table>
  243.               </div>
  244.             </div>
  245.             <div title="FMS" class="d-inline-block ml-1">
  246.               <div style="width: 130px">
  247.                 <table>
  248.                   <b>FMS</b>
  249.                 </table>
  250.                 <table>{{props.row.details.split(',')[10]}}</table>
  251.               </div>
  252.             </div>
  253.             <div title="SJ" class="d-inline-block ml-1">
  254.               <div style="width: 130px">
  255.                 <table>
  256.                   <b>SJ</b>
  257.                 </table>
  258.                 <table>{{props.row.details.split(',')[11]}}</table>
  259.               </div>
  260.             </div>
  261.             <div title="CMJ" class="d-inline-block ml-1">
  262.               <div style="width: 130px">
  263.                 <table>
  264.                   <b>CMJ</b>
  265.                 </table>
  266.                 <table>{{props.row.details.split(',')[12]}}</table>
  267.               </div>
  268.             </div>
  269.             <div title="AJ" class="d-inline-block ml-1">
  270.               <div style="width: 130px">
  271.                 <table>
  272.                   <b>AJ</b>
  273.                 </table>
  274.                 <table>{{props.row.details.split(',')[13]}}</table>
  275.               </div>
  276.             </div>
  277.             <div title="DJ" class="d-inline-block ml-1">
  278.               <div style="width: 130px">
  279.                 <table>
  280.                   <b>DJ</b>
  281.                 </table>
  282.                 <table>{{props.row.details.split(',')[14]}}</table>
  283.               </div>
  284.             </div>
  285.             <div title="ModTest" class="d-inline-block ml-1">
  286.               <div style="width: 130px">
  287.                 <table>
  288.                   <b>mod. T-Test</b>
  289.                 </table>
  290.                 <table>{{props.row.details.split(',')[15]}}</table>
  291.               </div>
  292.             </div>
  293.             <div title="FMSprint" class="d-inline-block ml-1">
  294.               <div style="width: 130px">
  295.                 <table>
  296.                   <b>5m Sprint</b>
  297.                 </table>
  298.                 <table>{{props.row.details.split(',')[16]}}</table>
  299.               </div>
  300.             </div>
  301.             <div title="ZEMSprint" class="d-inline-block ml-1">
  302.               <div style="width: 130px">
  303.                 <table>
  304.                   <b>10m Sprint</b>
  305.                 </table>
  306.                 <table>{{props.row.details.split(',')[17]}}</table>
  307.               </div>
  308.             </div>
  309.             <div title="FZMSprint" class="d-inline-block ml-1">
  310.               <div style="width: 130px">
  311.                 <table>
  312.                   <b>15m Sprint</b>
  313.                 </table>
  314.                 <table>{{props.row.details.split(',')[18]}}</table>
  315.               </div>
  316.             </div>
  317.             <div title="ZWMSprint" class="d-inline-block ml-1">
  318.               <div style="width: 130px">
  319.                 <table>
  320.                   <b>20m Sprint</b>
  321.                 </table>
  322.                 <table>{{props.row.details.split(',')[19]}}</table>
  323.               </div>
  324.             </div>
  325.             <div title="BenchPress" class="d-inline-block ml-1">
  326.               <div style="width: 130px">
  327.                 <table>
  328.                   <b>Bench Press</b>
  329.                 </table>
  330.                 <table>{{props.row.details.split(',')[20]}}</table>
  331.               </div>
  332.             </div>
  333.             <div title="PullUps" class="d-inline-block ml-1">
  334.               <div style="width: 130px">
  335.                 <table>
  336.                   <b>Pull ups reg.</b>
  337.                 </table>
  338.                 <table>{{props.row.details.split(',')[21]}}</table>
  339.               </div>
  340.             </div>
  341.             <div title="BackSquat" class="d-inline-block ml-1">
  342.               <div style="width: 130px">
  343.                 <table>
  344.                   <b>Back Squat</b>
  345.                 </table>
  346.                 <table>{{props.row.details.split(',')[22]}}</table>
  347.               </div>
  348.             </div>
  349.             <div title="StraightHobLe" class="d-inline-block ml-1">
  350.               <div style="width: 130px">
  351.                 <table>
  352.                   <b>Straight hob le.</b>
  353.                 </table>
  354.                 <table>{{props.row.details.split(',')[23]}}</table>
  355.               </div>
  356.             </div>
  357.             <div title="StraightHobRi" class="d-inline-block ml-1">
  358.               <div style="width: 130px">
  359.                 <table>
  360.                   <b>Straight hob ri.</b>
  361.                 </table>
  362.                 <table>{{props.row.details.split(',')[24]}}</table>
  363.               </div>
  364.             </div>
  365.             <div title="LatBoundLe" class="d-inline-block ml-1">
  366.               <div style="width: 130px">
  367.                 <table>
  368.                   <b>Lat. bound le.</b>
  369.                 </table>
  370.                 <table>{{props.row.details.split(',')[25]}}</table>
  371.               </div>
  372.             </div>
  373.             <div title="LatBoundRi" class="d-inline-block ml-1">
  374.               <div style="width: 130px">
  375.                 <table>
  376.                   <b>Lat bound ri.</b>
  377.                 </table>
  378.                 <table>{{props.row.details.split(',')[26]}}</table>
  379.               </div>
  380.             </div>
  381.             <div title="TTest" class="d-inline-block ml-1">
  382.               <div style="width: 130px">
  383.                 <table>
  384.                   <b>T-Test</b>
  385.                 </table>
  386.                 <table>{{props.row.details.split(',')[27]}}</table>
  387.               </div>
  388.             </div>
  389.             <div title="VerticalJump" class="d-inline-block ml-1">
  390.               <div style="width: 130px">
  391.                 <table>
  392.                   <b>Vert. Jump</b>
  393.                 </table>
  394.                 <table>{{props.row.details.split(',')[27]}}</table>
  395.               </div>
  396.             </div>
  397.             <div title="LateralJump" class="d-inline-block ml-1">
  398.               <div style="width: 130px">
  399.                 <table>
  400.                   <b>Lat. Jump</b>
  401.                 </table>
  402.                 <table>{{props.row.details.split(',')[28]}}</table>
  403.               </div>
  404.             </div>
  405.             <div title="TWMSprint" class="d-inline-block ml-1">
  406.               <div style="width: 130px">
  407.                 <table>
  408.                   <b>20m Sprint</b>
  409.                 </table>
  410.                 <table>{{props.row.details.split(',')[29]}}</table>
  411.               </div>
  412.             </div>
  413.           </span>
  414.  
  415.  
  416.              <!--  <span v-if="props.row.details.split(',')[1] === '1'"  title="Discipline" class="bg-success text-center text-white" style="padding:12px; vertical-align: middle; border-right: 1px solid #dee2e6;">1</span>
  417.               <span v-else-if="props.row.details.split(',')[1] === '2'" title="Discipline" div class="bg-info text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">2</span>
  418.               <span v-else-if="props.row.details.split(',')[1] === '3'" title="Discipline" div class="bg-warning text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">3</span>
  419.               <span v-else-if="props.row.details.split(',')[1] === '4'" title="Discipline" div class="bg-danger text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">4</span>
  420.  
  421.               <span v-if="props.row.details.split(',')[2] === '1'" title="Commitment" class="bg-success text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6;">1</span>
  422.               <span v-else-if="props.row.details.split(',')[2] === '2'" title="Commitment" div class="bg-info text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">2</span>
  423.               <span v-else-if="props.row.details.split(',')[2] === '3'" title="Commitment" div class="bg-warning text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">3</span>
  424.               <span v-else-if="props.row.details.split(',')[2] === '4'" title="Commitment" div class="bg-danger text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">4</span>
  425.  
  426.               <span v-if="props.row.details.split(',')[3] === '1'" title="Concentration" class="bg-success text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6;">1</span>
  427.               <span v-else-if="props.row.details.split(',')[3] === '2'" title="Concentration" div class="bg-info text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">2</span>
  428.               <span v-else-if="props.row.details.split(',')[3] === '3'" title="Concentration" div class="bg-warning text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">3</span>
  429.               <span v-else-if="props.row.details.split(',')[3] === '4'" title="Concentration" div class="bg-danger text-center text-white" style="padding:12px;  vertical-align: middle; border-right: 1px solid #dee2e6; ">4</span> -->
  430.  
  431.         </span>
  432.         <span v-else-if="props.column.field == 'action'">
  433.         <!-- src="https://thesite.sharepoint.com/sites/Playercard//Site Library/img/Entrance.png"-->
  434.  
  435.           <!--
  436.           <span v-if="props.row.action === 'Entry'">
  437.             <img src="https://thesite.sharepoint.com/DEV/BBUlm/Site%20Library/img/Entrance.png"    style="height:30px ;width:30px">Entrance
  438.             <img src="https://thesite.sharepoint.com/sites/Playercard/Site Library/img/Entrance.png"    style="height:30px ;width:30px">Entry
  439.           </span>
  440.           -->
  441.  
  442.           <span v-if="props.row.action === 'AthleticTests'">
  443.           <!--  <img src="https://thesite.sharepoint.com/DEV/BBUlm/Site%20Library/img/Sport.png"    style="height:30px ;width:30px">Athletic Test -->
  444.             <img src="https://thesite.sharepoint.com/sites/Playercard/Site Library/img/Sport.png"    style="height:30px ;width:30px">Athletic Test
  445.           </span>
  446.  
  447.  
  448.  
  449.           <span v-if="props.row.action === 'Social (Comment)'">
  450.             <!-- <img src="https://thesite.sharepoint.com/DEV/BBUlm/Site%20Library/img/Social.png"    style="height:30px ;width:30px">Social -->
  451.             <img src="https://thesite.sharepoint.com/sites/Playercard/Site Library/img/Social.png"    style="height:30px ;width:30px">Social (Comment)
  452.           </span>
  453.  
  454.           <span v-if="props.row.action === 'Sport (Comment)'">
  455.            <!-- <img src="https://thesite.sharepoint.com/DEV/BBUlm/Site%20Library/img/Sport.png"    style="height:30px ;width:30px">Sport -->
  456.             <img src="https://thesite.sharepoint.com/sites/Playercard/Site Library/img/Sport.png"    style="height:30px ;width:30px">Sport (Comment)
  457.           </span>
  458.  
  459.           <span v-if="props.row.action === 'School (Comment)'">
  460.            <!-- <img src="https://thesite.sharepoint.com/DEV/BBUlm/Site%20Library/img/Social.png"    style="height:30px ;width:30px">School -->
  461.             <img src="https://thesite.sharepoint.com/sites/Playercard/Site Library/img/Social.png"    style="height:30px ;width:30px">School (Comment)
  462.           </span>
  463.  
  464.           <!--
  465.           <span v-if="props.row.action === 'Exit'">
  466.             <img src="https://thesite.sharepoint.com/DEV/BBUlm/Site%20Library/img/Exit.png"   style="height:30px ;width:30px">Exit
  467.             <img src="https://thesite.sharepoint.com/sites/Playercard/Site Library/img/Exit.png"   style="height:30px ;width:30px">Exit
  468.           </span>
  469.           -->
  470.  
  471.           <span v-if="props.row.action === 'Character'">
  472.           <!--  <img src="https://thesite.sharepoint.com/DEV/BBUlm/Site%20Library/img/Character.png"       style="height:30px ;width:30px">Character        -->
  473.             <img src="https://thesite.sharepoint.com/sites/Playercard/Site Library/img/Character.png"       style="height:30px ;width:30px">Character
  474.           </span>
  475.  
  476.           <span v-if="props.row.action === 'Statistics'">
  477.           <!--  <img src="https://thesite.sharepoint.com/DEV/BBUlm/Site%20Library/img/flash.png"    style="height:30px ;width:30px">Statistics -->
  478.             <img src="https://thesite.sharepoint.com/sites/Playercard/Site Library/img/flash.png"    style="height:30px ;width:30px">Statistics
  479.           </span>
  480.  
  481.           <span v-if="(props.row.action === 'Others (Comment)')">
  482.           <!--  <img src="https://thesite.sharepoint.com/DEV/BBUlm/Site%20Library/img/flash.png"    style="height:30px ;width:30px">Statistics -->
  483.             <img src="https://thesite.sharepoint.com/sites/Playercard/Site Library/img/Character.png"    style="height:30px ;width:30px">Others (Comment)
  484.           </span>
  485.  
  486.         </span>
  487.  
  488.  
  489.         <span v-else>{{props.formattedRow[props.column.field]}}</span>
  490.       </template>
  491.     </vue-good-table>
  492.   </div>
  493. </template>
  494.  
  495. <script>
  496. import * as $ from "jquery";
  497. // import Character from "./Character/Character.vue";
  498. import ShowAthleticTest from "./AthleticTest/ShowAthleticTest.vue"
  499. import AddAthleticTest from "./AthleticTest/AddAthleticTest.vue"
  500. import ShowCharacter from "./Character/ShowCharacter.vue";
  501. import AddCharacter from "./Character/AddCharacter.vue";
  502. import AddComment from "./Comment/AddComment.vue";
  503. import ShowComment from "./Comment/ShowComment.vue";
  504. import AddStatistics from "./Statistics/AddStatistics.vue";
  505. import ShowStatistics from "./Statistics/ShowStatistics.vue";
  506.  
  507.  
  508.  
  509. export default {
  510.    components: {
  511.     // appCharacter: Character,
  512.     appAddAthleticTest: AddAthleticTest,
  513.     appAddCharacter: AddCharacter,
  514.     appAddComment: AddComment,
  515.     appShowAthleticTest: ShowAthleticTest,
  516.     appShowCharacter: ShowCharacter,
  517.     appShowComment: ShowComment,
  518.     appAddStatistics: AddStatistics,
  519.     appShowStatistics: ShowStatistics,
  520.  
  521.   },
  522.   data: function() {
  523.  
  524.     return {
  525.       baseImageUrl: this.$store.state.baseImageUrl,
  526.       histories: [],
  527.  
  528.       columns: [
  529.         {
  530.           label: "Created On",
  531.           field: "createdAt",
  532.           type: "date",
  533.           dateInputFormat: "dd.MM.yyyy",
  534.           dateOutputFormat: "dd.MM.yyyy'",
  535.           thClass: "text-left",
  536.           tdClass: "text-center",
  537.           width: '160px',
  538.           filterOptions: {
  539.             enabled: true,
  540.             placeholder: "Date",
  541.            // filterFn: this.myColumnFilter
  542.           }
  543.         },
  544.         {
  545.           label: "Action",
  546.           field: "action",
  547.           type: "string",
  548.           width: '135px',
  549.           filterOptions: {
  550.             enabled: true,
  551.             placeholder: "All",
  552.             filterDropdownItems: [
  553.               "Comment",
  554.               "Character",
  555.               "Statistics",
  556.               "AthleticTest"
  557.             ]
  558.           }
  559.         },
  560.         {
  561.           label: "Details",
  562.           field: "details",
  563.           type: "string",
  564.           tdClass: "text-left",
  565.           width: '700px',
  566.           filterOptions: {
  567.             enabled: true,
  568.             placeholder: "Details"
  569.           }
  570.         },
  571.       ],
  572.       rows: []
  573.  
  574.     };
  575.   },
  576.   created: function() {
  577.     var playerID = this.$store.state.selectedPlayer.ID;
  578.     this.loadHistory(playerID);
  579.   },
  580.   methods: {
  581.     loadHistory: function(playerID) {
  582.       this.rows = [];
  583.       // var baseUrl = "/DEV/BBUlm" + "/_api/web/lists/";
  584.       var baseUrl = this.$store.state.baseUrl;
  585.       var listName = "History";
  586.       var select =
  587.         "$select=id,act,details,date,CorrespondingListID,PlayerName/Name";
  588.       var expand = "&$expand=PlayerName";
  589.       var filter = "&$filter=PlayerNameId eq '" + playerID + "'";
  590.       var orderby = "&$orderby=date desc ";
  591.       baseUrl +=
  592.         "GetByTitle('" +
  593.         listName +
  594.         "')/items?" +
  595.         select +
  596.         expand +
  597.         filter +
  598.         orderby; //+ select;
  599.       var $this = this;
  600.       $.ajax({
  601.         url: baseUrl,
  602.         type: "GET",
  603.         headers: {
  604.           Accept: "application/json;odata=verbose"
  605.         },
  606.         async: false,
  607.         success: function(data, textStatus, xhr) {
  608.           $this.HistorysData(data);
  609.         },
  610.         error: function(xhr, textStatus, errorThrown) {
  611.           alert("error:" + JSON.stringify(xhr));
  612.           $("#start" + "records").html(" [0]");
  613.         }
  614.       });
  615.     },
  616.     HistorysData: function(data) {
  617.       var data = data.d.results;
  618.       this.histories = [];
  619.       var $this = this;
  620.       for (var i = 0; i < data.length; i++) {
  621.         // var Created = this.getJSONDateAsString(data[i].Date, "dd.MM.yyyy");
  622.  
  623.         $this.rows.push({
  624.           createdAt: this.getJSONDateAsString(data[i].date, "dd.MM.yyyy"),
  625.           action: data[i].act,
  626.           details: data[i].details,
  627.           correspondingListID: data[i].CorrespondingListID
  628.         });
  629.       }
  630.     },
  631.     AddCharacterDialog: function() {
  632.       var SelectedPlayerID = this.$store.state.selectedPlayer.ID;
  633.       var $this = this;
  634.       this.$modal.show(
  635.         AddCharacter,
  636.         {
  637.           text: SelectedPlayerID
  638.         },
  639.         {
  640.           draggable: true,
  641.           width: 400,
  642.           height: 400
  643.         },
  644.         {
  645.           closed: function(event) {
  646.             $this.loadHistory(SelectedPlayerID);
  647.           }
  648.         }
  649.       );
  650.     },
  651.     AddCommentDialog: function() {
  652.       var SelectedPlayerID = this.$store.state.selectedPlayer.ID;
  653.       var $this = this;
  654.       this.$modal.show(
  655.         AddComment,
  656.         {
  657.           text: SelectedPlayerID
  658.         },
  659.         {
  660.           draggable: true,
  661.           width: 400,
  662.           height: 400
  663.         },
  664.         {
  665.           closed: function(event) {
  666.             $this.loadHistory(SelectedPlayerID);
  667.           }
  668.         }
  669.       );
  670.     },
  671.     AddStatisticsDialog: function() {
  672.       var SelectedPlayerID = this.$store.state.selectedPlayer.ID;
  673.       var $this = this;
  674.       this.$modal.show(
  675.         AddStatistics,
  676.         {
  677.           text: SelectedPlayerID
  678.         },
  679.         {
  680.           draggable: true,
  681.           width: 550,
  682.           height: 750
  683.         },
  684.         {
  685.           closed: function(event) {
  686.             $this.loadHistory(SelectedPlayerID);
  687.           }
  688.         }
  689.       );
  690.     },
  691.     AddAthleticTestDialog: function() {
  692.       var SelectedPlayerID = this.$store.state.selectedPlayer.ID;
  693.       var $this = this;
  694.       this.$modal.show(
  695.         AddAthleticTest,
  696.         {
  697.           text: SelectedPlayerID
  698.         },
  699.         {
  700.           draggable: true,
  701.           width: 1200,
  702.           height: 750
  703.         },
  704.         {
  705.           closed: function(event) {
  706.             $this.loadHistory(SelectedPlayerID);
  707.           }
  708.         }
  709.       );
  710.     },
  711.     onRowClick(params) {
  712.       var recordNumber = params.row.correspondingListID;
  713.       if (params.row.action == "Character") {
  714.         this.showCharacterDialog(recordNumber);
  715.       }
  716.       if (params.row.action == "Social (Comment)" || params.row.action == "Sport (Comment)" || params.row.action == 'Others (Comment)' || params.row.action == 'School (Comment)') {
  717.         this.showCommentDialog(recordNumber);
  718.       }
  719.       if(params.row.action == "Statistics"){
  720.         this.showStatisticsDialog(recordNumber);
  721.       }
  722.       if(params.row.action == "AthleticTests"){
  723.         this.showAthleticTestDialog(recordNumber);
  724.       }
  725.  
  726.       // showCharacterDialog
  727.       // params.row - row object
  728.       // params.pageIndex - index of this row on the current page.
  729.       // params.selected - if selection is enabled this argument
  730.       // indicates selected or not
  731.       // params.event - click event
  732.     },
  733.     showCharacterDialog: function(recordNumber) {
  734.       this.$modal.show(
  735.         ShowCharacter,
  736.         {
  737.           characterRecID: recordNumber
  738.         },
  739.         {
  740.           draggable: true,
  741.           width: 400,
  742.           height: 450
  743.         },
  744.         {
  745.           closed: function(event) {}
  746.         }
  747.       );
  748.     },
  749.     showCommentDialog: function(recordNumber) {
  750.       this.$modal.show(
  751.         ShowComment,
  752.         {
  753.           commentRecId: recordNumber
  754.         },
  755.         {
  756.           draggable: true,
  757.           width: 400,
  758.           height: 250
  759.         },
  760.         {
  761.           closed: function(event) {}
  762.         }
  763.       );
  764.     },
  765.     showStatisticsDialog: function(recordNumber) {
  766.       this.$modal.show(
  767.         ShowStatistics,
  768.         {
  769.           statisticsRecID: recordNumber
  770.         },
  771.         {
  772.           draggable: true,
  773.           width: 1000,
  774.           height: 500
  775.         },
  776.         {
  777.           closed: function(event) {}
  778.         }
  779.       );
  780.     },
  781.     showAthleticTestDialog: function(recordNumber) {
  782.       this.$modal.show(
  783.         ShowAthleticTest,
  784.         {
  785.           athleticsRecID: recordNumber
  786.         },
  787.         {
  788.           draggable: true,
  789.           width: 1400,
  790.           height: 700
  791.         },
  792.         {
  793.           closed: function(event) {}
  794.         }
  795.       );
  796.     },
  797.  
  798.     getJSONDateAsString: function(jsdatevalue, returnFormat) {
  799.       if ((jsdatevalue == "") | (jsdatevalue == null)) {
  800.         return "";
  801.       }
  802.       return new Date(jsdatevalue).toString(returnFormat);
  803.     }
  804.   }
  805. };
  806. </script>
  807.  
  808. <style scoped>
  809. .btn-style {
  810.   margin: 10px;
  811. }
  812. .vgt-right-align {
  813.   text-align: center !important;
  814. }
  815. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement