<!DOCTYPE html>
<html lang="zh-tw">

<head><?php
      // 引用 head.inc
      include_once "html_head.inc";
      ?></head>

<body>
  <div id="q-app" :visible="IsVueReady==true" @mousemove="FnIdleReset">
    <?php
    // include_once "html_menu.inc";
    include_once "html_layout_header.inc";
    ?>
    <!-- 內容區域 //-->
    <data-table :show-search-field="true" :show-search-btn="false" :show-search-panel="false" :title="$t('menu.admin_page_permission_setting')" :columns="columns" :data="tableData" row-key="name">

      <!-- <template v-slot:row-control="props">
        <q-btn color="primary" :label="$t('sys.view')" @click.native="editUser(props.row_data)"></q-btn>
      </template> -->

      <template v-slot:row_col_view_page="props">
        <q-btn 
          glossy color="primary" 
          :label="$t('sys.view')" 
          @click.native="viewRoleId(props.row_data.row)"  
          v-if="pageEditBtn"
          style="min-width:80px; min-height: 36px; font-size: 20px; font-weight: 600;"
        ></q-btn>
      </template>

    
    </data-table>

    <!--表單-->
    <template>
      <q-modal
        v-model="formPageSet['view']"
        minimized
        no-route-dismiss
        no-esc-dismiss
        no-backdrop-dismiss
        :content-css="{minWidth: '50vw', maxHeight: '100vh'}"
      >
        <div class="modal-title">
          <span>頁面權限設定</span>
        </div>

        <div class="modal-scroll-box"> 
          <div v-for="(item ,idx) in formPageSet['tempPageName']" >

            <span  v-if="item['children'] == undefined || item['children'] != []">
              <q-checkbox  
                @input="checkbox_link(`${idx}`)"
                v-if="item['show_check']"
                v-model="formPageSet['tempSelectUse']" 
                :disable="formPageSet['edit']" 
                :val="item['menu_id']" >
              </q-checkbox>
              <!-- <span class="material-icons">{{ item['icon'] }}</span> -->
              {{ $t('menu.'+item['menu_id']) }}
            </span>
            
            <div v-if="item['children'] != undefined" style="display: flex;flex-flow: column wrap;">
              <span class="q-ml-lg"  v-for="(item2 ,idx2) in item['children']" >

                <q-checkbox v-model="formPageSet['tempSelectUse']" :disable="formPageSet['edit']" @input="checkbox_link(`${idx}-${idx2}`)" :val="item2['menu_id']" class="q-mr-sm"></q-checkbox>
                {{ $t('menu.'+item2['menu_id']) }} 
              </span>
            </div>  

          </div>
        </div>  

        <div style="display:flex; flex-grow: row; justify-content: center;margin: 20px;" >
          <q-btn glossy color="primary" :label="$t('sys.edit')"  class="btn-style2 id-btn" @click="btnSwitch()" v-if="formPageSet['edit']" ></q-btn>
          <q-btn glossy color="primary" :label="$t('sys.update')"  class="btn-style2 id-btn" @click="updateRoleMenu()"  v-if="formPageSet['update']"></q-btn>
          <q-btn glossy color="secondary" :label="$t('sys.close')"  class="btn-style2 id-btn" @click="formPageSet['view'] = false" ></q-btn>
        </div>  

      </q-modal>
    </template>  

   
      
    



    <!-- /內容區域 //-->
    <?php
    include_once "html_layout_footer.inc";
    ?>
  </div>
  <?php
  // loading.inc
  include_once "html_loading.inc";
  ?>
</body><?php
        $is_report_download = true;
        // 引用 down.inc
        include_once "html_down.inc";
        ?>

</html>