|
@@ -1,171 +1,193 @@
|
|
|
<template>
|
|
|
- <div id="app" class="app-container">
|
|
|
- <el-button type="primary" class="btn-new" @click="newEvent">{{this.$t("htcommunity.addEvent")}}</el-button>
|
|
|
- <el-table :data="activities" class="table-main" border v-loading="mainLoading">
|
|
|
- <el-table-column prop="index" :label="this.$t('htcommunity.serialNumber')" min-width="50"></el-table-column>
|
|
|
- <el-table-column prop="name" :label="this.$t('htcommunity.activityName')"></el-table-column>
|
|
|
- <el-table-column prop="time" :label="this.$t('htcommunity.schedule')" min-width="150"></el-table-column>
|
|
|
- <el-table-column prop="admin" :label="this.$t('htcommunity.administrator')"></el-table-column>
|
|
|
- <el-table-column :label="this.$t('htcommunity.details')">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="viewDetails(scope.row)">{{$t("htcommunity.view")}}</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column :label="this.$t('htcommunity.eventExam')">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- <el-button type="text" @click="viewExams(scope.row)">{{$t("htcommunity.view")}}</el-button> -->
|
|
|
- <el-button type="text" @click="return false">{{$t("htcommunity.view")}}</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <!-- 詳細內容彈出視窗 -->
|
|
|
- <el-dialog :title="this.$t('htcommunity.details')" :visible.sync="showDetailsModal" width="50%">
|
|
|
- <p>{{this.$t("htcommunity.activityName")}}: {{ selectedActivity.name }}</p>
|
|
|
- <p>{{this.$t("htcommunity.schedule")}}: {{ selectedActivity.time }}</p>
|
|
|
- <p>{{this.$t("htcommunity.administrator")}}: {{ selectedActivity.admin }}</p>
|
|
|
- <p>原始資料: {{ selectedActivity.originalData }}</p>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="showDetailsModal = false">{{this.$t("htcommunity.cancel")}}</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 新增活動彈出視窗 -->
|
|
|
- <el-dialog :title="this.$t('htcommunity.addEvent')" :visible.sync="showAddModal" width="90%"
|
|
|
- :close-on-click-modal="false" :close-on-press-escape="false" :close="resetNewActivity" top="6vh">
|
|
|
- <el-form :model="newActivity" label-width="100px" :rules="rules" ref="newActivity">
|
|
|
- <div class="form-container">
|
|
|
- <div class="form-left">
|
|
|
- <el-form-item :label="this.$t('htcommunity.activityName')" prop="name">
|
|
|
- <el-input v-model="newActivity.name"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item :label="this.$t('htcommunity.eventArea')">
|
|
|
- <el-select v-model="newActivity.region" :placeholder="this.$t('htcommunity.pleaseChoose')">
|
|
|
- <!-- <el-option v-for="(name,code) in twCityArr" :label="name" :value="code" :key="code"></el-option> -->
|
|
|
- <el-option v-for="item in twCityArr" :key="item.code" :label="item.name" :value="item.code" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item :label="this.$t('htcommunity.administrator')">
|
|
|
- <el-input v-model="newActivity.admin"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item :label="this.$t('htcommunity.schedule')" prop="time">
|
|
|
- <el-date-picker v-model="newActivity.time" type="datetimerange" start-placeholder="Start"
|
|
|
- end-placeholder="End" style="width: 400px;">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- <div class="form-right">
|
|
|
- <!-- 組別表格 -->
|
|
|
- <el-form-item :label="this.$t('htcommunity.group')">
|
|
|
- <!-- <el-tooltip content="指定評審,請檢查確認為正確醍摩豆ID" placement="bottom" effect="light"> -->
|
|
|
- <el-tooltip placement="bottom" effect="light">
|
|
|
- <div slot="content" style="color: red;font-size: 1.2em;">指定評審,請輸入醍摩豆用戶編號,檢查確認為正確醍摩豆ID</div>
|
|
|
- <i class="el-icon-warning-outline" style="font-size: 2em;"></i>
|
|
|
- </el-tooltip>
|
|
|
- <!-- <span>指定評審請輸入<span class="point">手機號碼</span>、<span class="point">醍摩豆用戶編號</span>或<span class="point">電子信箱</span>等資訊進行搜尋</span> -->
|
|
|
- <el-table :data="newActivity.groups" style="width: 100%;" border :cell-style="{ textAlign: 'center' }"
|
|
|
- :header-cell-style="{ textAlign: 'center' }" v-loading="groupsLoading">
|
|
|
- <el-table-column prop="groupName" :label="this.$t('htcommunity.groupName')" min-width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.groupName"></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="groupJudge" :label="this.$t('htcommunity.designatedReviewer')" min-width="245">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.groupJudge" style="width: 200px;margin-right: 10px"></el-input>
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="checkTmdid(scope)"
|
|
|
- style="margin-top: 5px;">檢查</el-button>
|
|
|
- <span v-if="scope.row.valid">✔️</span>
|
|
|
-
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column :label="this.$t('htcommunity.operation')" min-width="60">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="removeGroup(scope)">{{$t("htcommunity.delete")}}</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-button type="primary" class="btn-add" icon="el-icon-plus" @click="addGroup"></el-button>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <p style="font-size: medium; margin-bottom: 10px;">{{this.$t("htcommunity.importantTimetable")}}:</p>
|
|
|
- <el-checkbox v-model="newActivity.requireOrderCompletion">{{this.$t("htcommunity.activitiesMustBeCompletedInOrder")}}</el-checkbox>
|
|
|
- <!-- 計畫內容表格 -->
|
|
|
- <el-table :data="newActivity.planContent" style="width: 100%;" border :cell-style="{ textAlign: 'center' }"
|
|
|
- :header-cell-style="{ textAlign: 'center' }" v-loading="scheduleLoading">
|
|
|
- <el-table-column prop="step" label="step" min-width="30px">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.$index + 1 }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="schedule" :label="this.$t('htcommunity.schedule')" min-width="235px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-date-picker v-model="scope.row.schedule" type="datetimerange" start-placeholder="Start"
|
|
|
- end-placeholder="End" style="width: 100%;" :disabled="scheduleDisabled(scope, '')">
|
|
|
- </el-date-picker>
|
|
|
- <span style="color:red;font-size: small;" v-show="scope.row.progress==='going'">進行中時程不可編輯</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="name" :label="this.$t('htcommunity.stage')" min-width="100px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.name" :disabled="scheduleDisabled(scope, '')"></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="location" :label="this.$t('htcommunity.activityPlace')" min-width="100px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.location" :disabled="scheduleDisabled(scope, '')"></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="description" :label="this.$t('htcommunity.description')" min-width="150px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input type="textarea" autosize v-model="scope.row.description" :disabled="scheduleDisabled(scope, '')"></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="blobs" :label="this.$t('htcommunity.fileUrl')" min-width="150px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input type="textarea" autosize v-model="scope.row.blobs" :disabled="scheduleDisabled(scope, '')"></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="type" :label="this.$t('htcommunity.signup')" min-width="33px">
|
|
|
+ <div id="app" class="app-container">
|
|
|
+ <el-button type="primary" class="btn-new" @click="newEvent">{{this.$t("htcommunity.addEvent")}}</el-button>
|
|
|
+ <el-table :data="activities" class="table-main" border v-loading="mainLoading">
|
|
|
+ <el-table-column prop="index" :label="this.$t('htcommunity.serialNumber')" min-width="50"></el-table-column>
|
|
|
+ <el-table-column prop="name" :label="this.$t('htcommunity.activityName')"></el-table-column>
|
|
|
+ <el-table-column prop="time" :label="this.$t('htcommunity.schedule')" min-width="150"></el-table-column>
|
|
|
+ <el-table-column prop="admin" :label="this.$t('htcommunity.administrator')"></el-table-column>
|
|
|
+ <el-table-column :label="this.$t('htcommunity.details')">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-checkbox v-model="scope.row.type" :disabled="scheduleDisabled(scope, '')"></el-checkbox>
|
|
|
+ <el-button type="text" @click="viewDetails(scope.row)">{{$t("htcommunity.view")}}</el-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="examType" :label="this.$t('htcommunity.Eventlayout')" min-width="50px">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="this.$t('htcommunity.joinStatus')">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-checkbox v-model="scope.row.examType" :disabled="scheduleDisabled(scope, 'examType')"></el-checkbox>
|
|
|
+ <el-button type="text" @click="viewJoinStatus(scope.row)">{{$t("htcommunity.view")}}</el-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="evaluation" :label="this.$t('htcommunity.examCanBeChecked')" min-width="60px">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="this.$t('htcommunity.eventExam')">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-checkbox v-model="scope.row.evaluation" :disabled="scheduleDisabled(scope, 'evaluation')"></el-checkbox>
|
|
|
+ <!-- <el-button type="text" @click="viewExams(scope.row)">{{$t("htcommunity.view")}}</el-button> -->
|
|
|
+ <el-button type="text" @click="return false">{{$t("htcommunity.view")}}</el-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column :label="this.$t('htcommunity.operation')" min-width="33px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="removePlanContent(scope)">{{$t("htcommunity.delete")}}</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 詳細內容彈出視窗 -->
|
|
|
+ <el-dialog :title="this.$t('htcommunity.details')" :visible.sync="showDetailsModal" width="50%">
|
|
|
+ <p>{{this.$t("htcommunity.activityName")}}: {{ selectedActivity.name }}</p>
|
|
|
+ <p>{{this.$t("htcommunity.schedule")}}: {{ selectedActivity.time }}</p>
|
|
|
+ <p>{{this.$t("htcommunity.administrator")}}: {{ selectedActivity.admin }}</p>
|
|
|
+ <p>原始資料: {{ selectedActivity.originalData }}</p>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="showDetailsModal = false">{{this.$t("htcommunity.cancel")}}</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 新增活動彈出視窗 -->
|
|
|
+ <el-dialog :title="this.$t('htcommunity.addEvent')" :visible.sync="showAddModal" width="90%"
|
|
|
+ :close-on-click-modal="false" :close-on-press-escape="false" :close="resetNewActivity" top="6vh">
|
|
|
+ <el-form :model="newActivity" label-width="100px" :rules="rules" ref="newActivity">
|
|
|
+ <div class="form-container">
|
|
|
+ <div class="form-left">
|
|
|
+ <el-form-item :label="this.$t('htcommunity.activityName')" prop="name">
|
|
|
+ <el-input v-model="newActivity.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="this.$t('htcommunity.eventArea')">
|
|
|
+ <el-select v-model="newActivity.region" :placeholder="this.$t('htcommunity.pleaseChoose')">
|
|
|
+ <!-- <el-option v-for="(name,code) in twCityArr" :label="name" :value="code" :key="code"></el-option> -->
|
|
|
+ <el-option v-for="item in twCityArr" :key="item.code" :label="item.name" :value="item.code" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="this.$t('htcommunity.administrator')">
|
|
|
+ <el-input v-model="newActivity.admin"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="this.$t('htcommunity.schedule')" prop="time">
|
|
|
+ <el-date-picker v-model="newActivity.time" type="datetimerange" start-placeholder="Start"
|
|
|
+ end-placeholder="End" style="width: 400px;">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="form-right">
|
|
|
+ <!-- 組別表格 -->
|
|
|
+ <el-form-item :label="this.$t('htcommunity.group')">
|
|
|
+ <!-- <el-tooltip content="指定評審,請檢查確認為正確醍摩豆ID" placement="bottom" effect="light"> -->
|
|
|
+ <el-tooltip placement="bottom" effect="light">
|
|
|
+ <div slot="content" style="color: red;font-size: 1.2em;">指定評審,請輸入醍摩豆用戶編號,檢查確認為正確醍摩豆ID</div>
|
|
|
+ <i class="el-icon-warning-outline" style="font-size: 2em;"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <!-- <span>指定評審請輸入<span class="point">手機號碼</span>、<span class="point">醍摩豆用戶編號</span>或<span class="point">電子信箱</span>等資訊進行搜尋</span> -->
|
|
|
+ <el-table :data="newActivity.groups" style="width: 100%;" border :cell-style="{ textAlign: 'center' }"
|
|
|
+ :header-cell-style="{ textAlign: 'center' }" v-loading="groupsLoading">
|
|
|
+ <el-table-column prop="groupName" :label="this.$t('htcommunity.groupName')" min-width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.groupName"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="groupJudge" :label="this.$t('htcommunity.designatedReviewer')" min-width="245">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.groupJudge" style="width: 200px;margin-right: 10px"></el-input>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="checkTmdid(scope)"
|
|
|
+ style="margin-top: 5px;">檢查</el-button>
|
|
|
+ <span v-if="scope.row.valid">✔️</span>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="this.$t('htcommunity.operation')" min-width="60">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="removeGroup(scope)">{{$t("htcommunity.delete")}}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-button type="primary" class="btn-add" icon="el-icon-plus" @click="addGroup"></el-button>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <p style="font-size: medium; margin-bottom: 10px;">{{this.$t("htcommunity.importantTimetable")}}:</p>
|
|
|
+ <el-checkbox v-model="newActivity.requireOrderCompletion">{{this.$t("htcommunity.activitiesMustBeCompletedInOrder")}}</el-checkbox>
|
|
|
+ <!-- 計畫內容表格 -->
|
|
|
+ <el-table :data="newActivity.planContent" style="width: 100%;" border :cell-style="{ textAlign: 'center' }"
|
|
|
+ :header-cell-style="{ textAlign: 'center' }" v-loading="scheduleLoading">
|
|
|
+ <el-table-column prop="step" label="step" min-width="30px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="schedule" :label="this.$t('htcommunity.schedule')" min-width="235px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-date-picker v-model="scope.row.schedule" type="datetimerange" start-placeholder="Start"
|
|
|
+ end-placeholder="End" style="width: 100%;" :disabled="scheduleDisabled(scope, '')">
|
|
|
+ </el-date-picker>
|
|
|
+ <span style="color:red;font-size: small;" v-show="scope.row.progress==='going'">進行中時程不可編輯</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name" :label="this.$t('htcommunity.stage')" min-width="100px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.name" :disabled="scheduleDisabled(scope, '')"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="location" :label="this.$t('htcommunity.activityPlace')" min-width="100px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.location" :disabled="scheduleDisabled(scope, '')"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="description" :label="this.$t('htcommunity.description')" min-width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input type="textarea" autosize v-model="scope.row.description" :disabled="scheduleDisabled(scope, '')"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="blobs" :label="this.$t('htcommunity.fileUrl')" min-width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input type="textarea" autosize v-model="scope.row.blobs" :disabled="scheduleDisabled(scope, '')"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="type" :label="this.$t('htcommunity.Eventlayout')" min-width="100px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select v-model="scope.row.type" placeholder="Please select" :disabled="scheduleDisabled(scope, '')">
|
|
|
+ <el-option v-for="item in eventScheduleTypes" :key="item.code" :label="item.name" :value="item.code">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <!--<el-checkbox v-model="scope.row.type" :disabled="scheduleDisabled(scope, '')"></el-checkbox>-->
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="examType" :label="this.$t('htcommunity.examType')" min-width="50px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-checkbox v-model="scope.row.examType" :disabled="scheduleDisabled(scope, 'examType')"></el-checkbox>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="evaluation" :label="this.$t('htcommunity.examCanBeChecked')" min-width="60px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-checkbox v-model="scope.row.evaluation" :disabled="scheduleDisabled(scope, 'evaluation')"></el-checkbox>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="this.$t('htcommunity.operation')" min-width="33px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="removePlanContent(scope)">{{$t("htcommunity.delete")}}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-button type="primary" class="btn-add" icon="el-icon-plus" @click="addPlanContent"></el-button>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancelUpsert">{{this.$t("htcommunity.cancel")}}</el-button>
|
|
|
+ <el-button type="primary" @click="saveNewEvent">{{this.$t("htcommunity.confirm")}}</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 報名狀況彈出視窗 -->
|
|
|
+ <el-dialog :title="this.$t('htcommunity.joinStatus')" :visible.sync="showJoinModal" width="70%">
|
|
|
+ <el-button type="primary" class="btn-new" size="small" style="margin-top: 0" @click="exportExcel('teacherCourse')">{{this.$t("htcommunity.export")}}</el-button>
|
|
|
+ <el-table :data="joinTeacherCourseArr" class="table-main" border v-loading="teacherCourseLoading" @sort-change="onSortChangeCourse">
|
|
|
+ <el-table-column prop="jointGroupName" :label="this.$t('htcommunity.jointGroup')" sortable="custom" min-width="50"></el-table-column>
|
|
|
+ <el-table-column prop="schoolName" :label="this.$t('htcommunity.schoolName')" sortable="custom" min-width="50"></el-table-column>
|
|
|
+ <el-table-column prop="creatorName" :label="this.$t('htcommunity.teacherName')" sortable="custom" min-width="50"></el-table-column>
|
|
|
+ <el-table-column prop="creatorId" :label="this.$t('htcommunity.tmid')" min-width="50"></el-table-column>
|
|
|
+ <el-table-column prop="courseName" :label="this.$t('htcommunity.course')" min-width="50"></el-table-column>
|
|
|
+ <el-table-column prop="groupName" :label="this.$t('htcommunity.courseGroup')" min-width="50"></el-table-column>
|
|
|
</el-table>
|
|
|
- <el-button type="primary" class="btn-add" icon="el-icon-plus" @click="addPlanContent"></el-button>
|
|
|
- </div>
|
|
|
- </el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="cancelUpsert">{{this.$t("htcommunity.cancel")}}</el-button>
|
|
|
- <el-button type="primary" @click="saveNewEvent">{{this.$t("htcommunity.confirm")}}</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
//import twTCitys from '@/static/twJsonT.js'
|
|
|
import option_gl from '@/static/region_gl.json'
|
|
|
import { forEach } from 'jszip';
|
|
|
+import excel from '@/utils/excel.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -183,7 +205,12 @@ export default {
|
|
|
// time: "2024-07-01~2024-07-31",
|
|
|
// admin: "管理員A"
|
|
|
// }
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ eventScheduleTypes: [
|
|
|
+ { code: 'join', name: this.$t("htcommunity.signup") },
|
|
|
+ { code: 'exam', name: this.$t("htcommunity.exam") },
|
|
|
+ { code: 'other', name: this.$t("htcommunity.other") }
|
|
|
+ ],
|
|
|
showDetailsModal: false,
|
|
|
showAddModal: false,
|
|
|
selectedActivity: {},
|
|
@@ -212,17 +239,21 @@ export default {
|
|
|
required: true, message: '請輸入時程'
|
|
|
}
|
|
|
],
|
|
|
- }
|
|
|
+ },
|
|
|
+ showJoinModal: false, //報名狀況子視窗
|
|
|
+ teacherCourseLoading: false,
|
|
|
+ joinTeacherCourseArr: [],
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
// 時程編輯的啟用及關閉 以及 動態切換活動布置及評量可重複啟用及關閉
|
|
|
scheduleDisabled(scope, column) {
|
|
|
+ console.log('scheduleDisabled scope:', scope)
|
|
|
if (scope.row.progress === "going") {
|
|
|
return true;
|
|
|
} else {
|
|
|
if (column === 'examType' || column === 'evaluation') {
|
|
|
- if (scope.row.type) {
|
|
|
+ if (scope.row.type != 'exam') {
|
|
|
scope.row.examType = false;
|
|
|
scope.row.evaluation = false;
|
|
|
return true;
|
|
@@ -390,19 +421,107 @@ export default {
|
|
|
step: item.orderby,
|
|
|
schedule: [this.$jsFn.secondTimeFormat(item.startTime), this.$jsFn.secondTimeFormat(item.endTime)],
|
|
|
name: item.name,
|
|
|
- type: item.type === "join" ? true : false,
|
|
|
+ type: item.type,
|
|
|
examType: item.examType === "regular" ? true : false,
|
|
|
evaluation: item.examOverwrite,
|
|
|
progress: item.progress,
|
|
|
description: item.description,
|
|
|
location: item.location,
|
|
|
blobs: item.blobs === null ? "" : item.blobs[0].blob,
|
|
|
- }
|
|
|
+ }
|
|
|
+ console.log('activity.originalData.schedule', schedule);
|
|
|
this.newActivity.planContent.push(schedule);
|
|
|
});
|
|
|
|
|
|
// #endregion
|
|
|
},
|
|
|
+ //查看報名狀況
|
|
|
+ viewJoinStatus(activity) {
|
|
|
+ this.showJoinModal = true;
|
|
|
+ this.getJoinList(activity);
|
|
|
+ },
|
|
|
+ // 取得報名老師資料
|
|
|
+ getJoinList(activity) {
|
|
|
+ this.teacherCourseLoading = true;
|
|
|
+ //先清除列表
|
|
|
+ this.joinTeacherCourseArr.splice(0, this.joinTeacherCourseArr.length);
|
|
|
+ try {
|
|
|
+ let param = {
|
|
|
+ jointEventId: activity.id
|
|
|
+ };
|
|
|
+ // 取得報名老師資料API
|
|
|
+ this.$api.htcommunity.jointCourseFind(param).then(
|
|
|
+ res => {
|
|
|
+ if (res) {
|
|
|
+ let index = 1;
|
|
|
+ console.log('res.data', res.data)
|
|
|
+ res.data.forEach(item => {
|
|
|
+ //群組名
|
|
|
+ let groupName = '';
|
|
|
+ activity.originalData.groups.forEach((g) => {
|
|
|
+ if (g.id == item.jointGroupId) {
|
|
|
+ groupName = g.name;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //課程
|
|
|
+ let courseId = '';
|
|
|
+ let courseName = '';
|
|
|
+ let courseGroupId = '';
|
|
|
+ let courseGroupName = '';
|
|
|
+ item.courseLists.forEach((c) => {
|
|
|
+ courseId = c.courseId;
|
|
|
+ courseName = c.courseName;
|
|
|
+ c.groupLists.forEach((g) => {
|
|
|
+ courseGroupId = g.id;
|
|
|
+ courseGroupName = g.name;
|
|
|
+ //資料生成
|
|
|
+ let jointCourseRow = {
|
|
|
+ id: item.id,
|
|
|
+ index: index,
|
|
|
+ jointGroupId: item.jointGroupId,
|
|
|
+ jointGroupName: groupName,
|
|
|
+ schoolId: item.schoolId,
|
|
|
+ schoolName: item.schoolName,
|
|
|
+ creatorId: item.creatorId,
|
|
|
+ creatorName: item.creatorName,
|
|
|
+ courseId: courseId,
|
|
|
+ courseName: courseName,
|
|
|
+ groupId: courseGroupId,
|
|
|
+ groupName: courseGroupName,
|
|
|
+ }
|
|
|
+ this.joinTeacherCourseArr.push(jointCourseRow);
|
|
|
+ index++;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ err => { console.log("API error : " + err); }
|
|
|
+ )
|
|
|
+ } catch (error) {
|
|
|
+ console.log("API error : " + error);
|
|
|
+ } finally {
|
|
|
+ this.teacherCourseLoading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //匯出Excel資料
|
|
|
+ exportExcel(type) {
|
|
|
+ //老師報名資料
|
|
|
+ if (type == 'teacherCourse') {
|
|
|
+ let titles = [this.$t('htcommunity.jointGroup'), this.$t('htcommunity.schoolName'), this.$t('htcommunity.teacherName'), this.$t('htcommunity.tmid'), this.$t('htcommunity.course'), this.$t('htcommunity.courseGroup')];
|
|
|
+ let keys = ['jointGroupName', 'schoolName', 'creatorName', 'creatorId', 'courseName', 'groupName'];
|
|
|
+ const params = {
|
|
|
+ title: titles,
|
|
|
+ key: keys,
|
|
|
+ data: this.joinTeacherCourseArr,
|
|
|
+ autoWidth: true,
|
|
|
+ filename: this.$t('htcommunity.joinStatus')
|
|
|
+ }
|
|
|
+ excel.export_array_to_excel(params)
|
|
|
+ }
|
|
|
+ },
|
|
|
//查看活動評量
|
|
|
viewExams(activity) {
|
|
|
// let params = {
|
|
@@ -489,9 +608,11 @@ export default {
|
|
|
]
|
|
|
};
|
|
|
this.newActivity.planContent.forEach(item => {
|
|
|
- let pType = item.type === true ? "join" : "exam";
|
|
|
- //let pExamType = item.type === true ? "" : (item.examType === true ? "regular" : "custom");
|
|
|
- let pExamType = item.examType === true ? "regular" : "custom";
|
|
|
+ let pType = item.type;
|
|
|
+ let pExamType = null;
|
|
|
+ if (item.type == 'exam') {
|
|
|
+ pExamType = item.examType === true ? "regular" : "custom";
|
|
|
+ }
|
|
|
let pStartTime = new Date(item.schedule[0]);
|
|
|
let pEndTime = new Date(item.schedule[1]);
|
|
|
let upItem = {
|
|
@@ -650,7 +771,40 @@ export default {
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 排序操作
|
|
|
+ onSortChangeCourse(data) {
|
|
|
+ let order = data.order // 当前排序方式 升序、降序、正常
|
|
|
+ let key = data.prop // 当前排序依据
|
|
|
+ switch (order) {
|
|
|
+ case 'ascending':
|
|
|
+ if (key == 'jointGroupName' || key == 'creatorName' || key == 'schoolName') {
|
|
|
+ this.joinTeacherCourseArr = this.joinTeacherCourseArr.sort((a, b) => {
|
|
|
+ return a[key].toLowerCase().localeCompare(b[key].toLowerCase());
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.joinTeacherCourseArr = this.joinTeacherCourseArr.sort((a, b) => {
|
|
|
+ return Number(a[key]) - Number(b[key])
|
|
|
+ })
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case 'descending':
|
|
|
+ if (key == 'jointGroupName' || key == 'creatorName' || key == 'schoolName') {
|
|
|
+ this.joinTeacherCourseArr = this.joinTeacherCourseArr.sort((a, b) => {
|
|
|
+ return b[key].toLowerCase().localeCompare(a[key].toLowerCase());
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.joinTeacherCourseArr = this.joinTeacherCourseArr.sort((a, b) => {
|
|
|
+ return Number(b[key]) - Number(a[key])
|
|
|
+ })
|
|
|
+ }
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ break
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
created () {
|
|
|
this.twCityArr = option_gl[0].children;
|