<template>
  <div style="height: 100%;">
    <!--空白页面-->
    <div style="width:100%;height: 100%;">
      <div style="width: 300px;height: 300px;margin: auto;position: relative;top: 35%">
        <div style="text-align: center;">
          <span><i class="iconfont" style="color: #C2C2C2;font-size: 60px;">&#xe65e;</i></span>
          <p class="text-general-color" style="margin: 15px 0;">您还没添加任何资产库！</p>
        </div>
        <div style="text-align:center;">
          <awsui-button class="button-general-color text-general-color" type="primary" @click="createWs">新建</awsui-button>
          <awsui-button class="button-general-color-reverse" @click="importWs">导入</awsui-button>
        </div>
      </div>
    </div>
    <div>
      <WorkspaceUpdate ref="workspaceUpdate"></WorkspaceUpdate>
    </div>
    <div>
      <WorkspaceImport ref="workspaceImport"></WorkspaceImport>
    </div>
  </div>

</template>

<script>
    import WorkspaceUpdate from "./WorkspaceUpdate";
    import WorkspaceImport from "./WorkspaceImport";
    import {newPageWin} from "../../api/commonFun";

    export default {
      name: "Workspace",
      components : {WorkspaceImport, WorkspaceUpdate},
      data() {
        return {
          wsId : ''
        }
      },
      provide: function () {
        return {
          // openUpdateWsDlg: this.openUpdateWsDlg
        }
      },
      methods : {
        createWs() {// 新建资产库
          this.$refs.workspaceUpdate.openUpdateWsDlg('create', this.wsId, this);
        },
        importWs() {// 导入资产库
          this.$refs.workspaceImport.openImportWsDlg(this);
        },
        updateWorkspaceCallback() {// 新建、更新资产库回调函数
          newPageWin('palMain', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {}, '_top');
        },
        importWorkspaceCallback() {// 导入资产库回调函数
          newPageWin('palMain', this.$store.state.sessionId, 'com.actionsoft.apps.coe.pal_user_home_page', {}, '_top');
        }
      }
    }
</script>

<style scoped>

</style>
