|
@@ -5,14 +5,14 @@
|
|
|
<div class="dark-iview-tabs-line" style="padding-top:10px;">
|
|
|
<Tabs v-model="listType" @on-click="toggleList">
|
|
|
<div slot="extra">
|
|
|
- <Icon type="md-add" class="to-create-icon" @click="goToCreate" title="删除" />
|
|
|
- <Icon type="md-trash" class="to-create-icon" @click="toggleList" title="新增" />
|
|
|
- <Icon type="md-create" class="to-create-icon" @click="toggleList" title="编辑" />
|
|
|
+ <Icon type="md-add" class="to-create-icon" @click="createData" title="新增" />
|
|
|
+ <Icon type="md-trash" :color="editIconStatus ? 'white':'#808080'" :style="{'cursor': editIconStatus ? 'pointer':'not-allowed'}" class="to-create-icon" @click="deleteData" title="删除" />
|
|
|
+ <Icon type="md-create" :color="editIconStatus ? 'white':'#808080'" :style="{'cursor': editIconStatus ? 'pointer':'not-allowed'}" class="to-create-icon" @click="editInfo" title="编辑" />
|
|
|
</div>
|
|
|
- <TabPane :label="tabLabelOrder" name="order">
|
|
|
+ <TabPane label="编序式单元" name="order">
|
|
|
<OrderLearnList :class="listType == 0 ? 'animated fadeIn':''" @selectIndex="selectOrderLearn" :orderLearnList="orderLearnList"></OrderLearnList>
|
|
|
</TabPane>
|
|
|
- <TabPane :label="tabLabelUnit" name="unit">
|
|
|
+ <TabPane label="学习单元" name="unit">
|
|
|
<UnitList :class="listType == 1 ? 'animated fadeIn':''" @selectIndex="selectOrderLearn" :unitList="unitList"></UnitList>
|
|
|
</TabPane>
|
|
|
</Tabs>
|
|
@@ -24,119 +24,60 @@
|
|
|
<div class="main-bar-wrap">
|
|
|
<span :class="currentTabIndex == 0 ? 'main-header-tab line-bottom line-bottom-active':'main-header-tab line-bottom'" @click="selectTab(0)">详细信息</span>
|
|
|
<span :class="currentTabIndex == 1 ? 'main-header-tab line-bottom line-bottom-active':'main-header-tab line-bottom'" @click="selectTab(1)">活动数据</span>
|
|
|
- <span class="main-bar-action-btn" @click="editInfo()">
|
|
|
- <Icon type="ios-create-outline" size="20" />
|
|
|
- 编辑内容
|
|
|
- </span>
|
|
|
- <span class="main-bar-action-btn">
|
|
|
- <Icon type="ios-send" size="20" />
|
|
|
- 发布活动
|
|
|
+ <span class="main-bar-action-btn" @click="publishActivity">
|
|
|
+ <Icon type="ios-send" size="20" />发布活动
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div class="order-learn-main-body dark-iview-split">
|
|
|
-
|
|
|
- <Split v-model="split1">
|
|
|
- <div slot="left">
|
|
|
- <div class="order-learn-main-label">
|
|
|
- 基础信息
|
|
|
- </div>
|
|
|
- <NoData v-if="orderLearnList.length == 0"></NoData>
|
|
|
- <div class="base-info-wrap" v-if="orderLearnList.length > 0">
|
|
|
- <div class="base-info-item">
|
|
|
- <span class="base-info-label">
|
|
|
- 名称:
|
|
|
- </span>
|
|
|
- <p class="base-info-value">
|
|
|
- {{orderLearnList[currentLearnIndex].name}}
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- <div class="base-info-item">
|
|
|
- <span class="base-info-label">
|
|
|
- 学段:
|
|
|
- </span>
|
|
|
- <p class="base-info-value">
|
|
|
-
|
|
|
- <!--{{orderLearnList[currentLearnIndex].periodCode}}-->
|
|
|
- 小学
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- <div class="base-info-item">
|
|
|
- <span class="base-info-label">
|
|
|
- 学科:
|
|
|
- </span>
|
|
|
- <p class="base-info-value">
|
|
|
- {{orderLearnList[currentLearnIndex].subjectCode}}
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- <div class="base-info-item">
|
|
|
- <span class="base-info-label">
|
|
|
- 创建时间:
|
|
|
- </span>
|
|
|
- <p class="base-info-value">
|
|
|
- 2020/04/02
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- <div class="base-info-item">
|
|
|
- <p class="base-info-label">
|
|
|
- 说明:
|
|
|
- </p>
|
|
|
- <p class="base-info-value">
|
|
|
- {{orderLearnList[currentLearnIndex].introduce}}
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div slot="right" class="order-learn-content-wrap">
|
|
|
- <div style="height:100%;" class="dark-iview-split">
|
|
|
- <Split v-model="split2">
|
|
|
- <div slot="left">
|
|
|
- <div class="order-learn-main-label">
|
|
|
- 学习阶段
|
|
|
- </div>
|
|
|
- <NoData v-if="orderLearnList.length == 0"></NoData>
|
|
|
- <div v-if="orderLearnList.length > 0">
|
|
|
- <div v-for="(item,index) in orderLearnList[currentLearnIndex].steps" @click="selectStep(index)" :class="currentStepIndex == index ? 'order-learn-step-item order-learn-step-item-active':'order-learn-step-item'">
|
|
|
- <span>
|
|
|
- {{item.name}}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div slot="right" style="padding-left:18px;height:100%;">
|
|
|
- <div class="order-learn-main-label">
|
|
|
- 自学内容
|
|
|
- </div>
|
|
|
- <div style="height:calc(100% - 45px);">
|
|
|
- <vuescroll>
|
|
|
- <p class="order-learn-content-label">
|
|
|
- 内容:{{orderLearnList.length == 0 ? 0 : orderLearnList[currentLearnIndex].steps[currentStepIndex].resource.length}}
|
|
|
- </p>
|
|
|
- <div style="min-height:220px;">
|
|
|
- <Loading v-show="isLoading"></Loading>
|
|
|
- <ContentFileList v-show="!isLoading" :class="isLoading ? '':'animated fadeIn'" :resources="orderLearnList[currentLearnIndex].steps[currentStepIndex].resource"></ContentFileList>
|
|
|
- </div>
|
|
|
- <p class="order-learn-content-label" style="margin-bottom: 15px;">
|
|
|
- 题目:{{orderLearnList.length == 0 ? 0 : orderLearnList[currentLearnIndex].steps[currentStepIndex].item.length}}
|
|
|
- </p>
|
|
|
- <div class="unit-content-detail">
|
|
|
- <NoData v-if="orderLearnList.length == 0" style="margin-top:120px;"></NoData>
|
|
|
- <Loading v-show="isLoading"></Loading>
|
|
|
- <QuestionList v-show="!isLoading" :class="isLoading ? '':'animated fadeIn'" :questions="orderLearnList[currentLearnIndex].steps[currentStepIndex].item" style="margin-top:12px;"></QuestionList>
|
|
|
- </div>
|
|
|
- </vuescroll>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </Split>
|
|
|
- </div>
|
|
|
-
|
|
|
- </div>
|
|
|
- </Split>
|
|
|
+ <div class="order-learn-main-body dark-iview-split" v-if="listType == 'order'">
|
|
|
+ <OrderLearnInfo :orderLearnInfo="orderLearnList[currentLearnIndex]"></OrderLearnInfo>
|
|
|
+ </div>
|
|
|
+ <div class="order-learn-main-body dark-iview-split" v-else>
|
|
|
+ <UnitInfo :unitInfo="unitList[currentUnitIndex]"></UnitInfo>
|
|
|
</div>
|
|
|
</div>
|
|
|
<Modal v-model="editStatus"
|
|
|
- title="编辑内容"
|
|
|
+ :title="listType == 'order' ? '编辑编序式教材' : '编辑自学单元'"
|
|
|
@on-ok="confirmEdit">
|
|
|
- <p>确认跳转到编序式教材编辑页面?</p>
|
|
|
+ <p>确认跳转到<span style="padding:0px 5px;">{{ listType == 'order' ? '编序式教材':'自学单元'}}</span>编辑页面?</p>
|
|
|
+ </Modal>
|
|
|
+ <Modal v-model="deleteStatus"
|
|
|
+ :title="listType == 'order' ? '删除编序式教材' : '删除自学单元'"
|
|
|
+ @on-ok="confirmDelete">
|
|
|
+ <p>确认删除<span style="color:blue;padding:0px 5px;font-weight:600;" v-if="deleteStatus">{{ listType == 'order' ? orderLearnList[currentLearnIndex].name : unitList[currentUnitIndex].name}}</span>?</p>
|
|
|
+ </Modal>
|
|
|
+ <Modal v-model="publishStatus"
|
|
|
+ title="发布自主学习活动"
|
|
|
+ class-name="dark-iview-modal dark-iview-form publish-modal"
|
|
|
+ @on-ok="confirmPublish">
|
|
|
+ <Form :model="activityInfo" label-colon label-position="left" :label-width="80">
|
|
|
+
|
|
|
+
|
|
|
+ <FormItem label="发布对象">
|
|
|
+ <Select v-model="activityInfo.target">
|
|
|
+ <Option v-for="item in targetList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="发布方式">
|
|
|
+ <RadioGroup v-model="activityInfo.publishType" style="color:white;">
|
|
|
+ <Radio :label="item.value" v-for="item in publishTypeList">
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
+ </Radio>
|
|
|
+ </RadioGroup>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="发布时间" v-show="activityInfo.publishType == 1">
|
|
|
+ <DatePicker type="datetime" placeholder="设置开始时间" style="width: 100%;"></DatePicker>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="活动类型">
|
|
|
+ <RadioGroup v-model="activityInfo.type" style="color:white;">
|
|
|
+ <Radio :label="item.value" v-for="item in activityTypeList">
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
+ </Radio>
|
|
|
+ </RadioGroup>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="截止时间" v-show="activityInfo.type == 1">
|
|
|
+ <DatePicker type="datetime" placeholder="设置截止时间" style="width: 100%;"></DatePicker>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -147,20 +88,49 @@
|
|
|
import ContentFileList from '@/components/learnactivity/ContentFileList.vue'
|
|
|
import OrderLearnList from '@/components/selflearn/OrderLearnList.vue'
|
|
|
import UnitList from '@/components/selflearn/UnitList.vue'
|
|
|
+ import OrderLearnInfo from '@/components/selflearn/OrderLearnInfo.vue'
|
|
|
+ import UnitInfo from '@/components/selflearn/UnitInfo.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
- NoData, QuestionList, ContentFileList, Loading, OrderLearnList, UnitList
|
|
|
-
|
|
|
+ NoData, QuestionList, ContentFileList, Loading, OrderLearnList, UnitList,OrderLearnInfo,UnitInfo
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ targetList: [],
|
|
|
+ publishTypeList: [
|
|
|
+ {
|
|
|
+ value: '0',
|
|
|
+ label:'立即发布'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '1',
|
|
|
+ label:'定时发布'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ activityTypeList: [
|
|
|
+ {
|
|
|
+ value: '0',
|
|
|
+ label:'自主学习'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '1',
|
|
|
+ label:'课前预习'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ activityInfo: {
|
|
|
+ type: '',
|
|
|
+ endTime: 0,
|
|
|
+ target: [],
|
|
|
+ publishType: '',
|
|
|
+ publishTime:0
|
|
|
+ },
|
|
|
currentTabIndex: 0,
|
|
|
listType: 'order',//order: 编序式教材 unit:学习单元
|
|
|
isLoading: false,
|
|
|
sasString: '',
|
|
|
+ publishStatus: false,
|
|
|
+ deleteStatus: false,
|
|
|
editStatus: false,
|
|
|
- split1: 0.2,
|
|
|
- split2: 0.2,
|
|
|
demoLoginInfo: {
|
|
|
user: 'admin',
|
|
|
TEAMModelId: 'habook#0001',
|
|
@@ -170,99 +140,115 @@
|
|
|
orderLearnList: [],
|
|
|
unitList: [],
|
|
|
currentLearnIndex: 0,
|
|
|
- currentStepIndex: 0,
|
|
|
+ currentUnitIndex: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ editIconStatus(){
|
|
|
+ if (this.listType == 'order') {
|
|
|
+ if (this.orderLearnList.length > 0) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.unitList.length > 0) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
/**
|
|
|
- *
|
|
|
- * */
|
|
|
- tabLabelOrder(h) {
|
|
|
- return h('span', '编序式单元')
|
|
|
+ * 发布活动
|
|
|
+ */
|
|
|
+ publishActivity() {
|
|
|
+ this.publishStatus = true
|
|
|
},
|
|
|
- tabLabelUnit(h) {
|
|
|
- return h('span', '学习单元')
|
|
|
+ confirmPublish() {
|
|
|
+
|
|
|
},
|
|
|
- /**
|
|
|
- * 切换列表类型
|
|
|
- * */
|
|
|
- toggleList() {
|
|
|
- this.listType = 1 - this.listType
|
|
|
+ selectTab(index) {
|
|
|
+ this.currentTabIndex = index
|
|
|
+ },
|
|
|
+ createData() {
|
|
|
if (this.listType == 'order') {
|
|
|
- this.findOrderLearn()
|
|
|
+ this.$router.push({
|
|
|
+ name: 'createOrderLearn'
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.findUnit()
|
|
|
+ this.$router.push({
|
|
|
+ name: 'createLearnUnit'
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
- * 通过id查询内容信息
|
|
|
+ * 删除编序式教材或自学单元
|
|
|
+ * */
|
|
|
+ deleteData() {
|
|
|
+ this.deleteStatus = true
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 确认删除编序式教材或自学单元
|
|
|
* */
|
|
|
- findResourceById() {
|
|
|
- if (this.orderLearnList.length > 0) {
|
|
|
- this.isLoading = true
|
|
|
- if (!this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].requestedR) {
|
|
|
- this.$api.learnActivity.FindSyllabusResourceById(this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].resource).then(
|
|
|
- res => {
|
|
|
- if (res.error == null) {
|
|
|
- this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].resource.length = 0
|
|
|
- this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].resource = res.result.data
|
|
|
- this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].requestedR = true
|
|
|
- } else {
|
|
|
- this.$Message.error("API ERROR!")
|
|
|
- }
|
|
|
- setTimeout(() => {
|
|
|
- this.isLoading = false
|
|
|
- }, 500)
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error("API ERROR!")
|
|
|
- setTimeout(() => {
|
|
|
- this.isLoading = false
|
|
|
- }, 500)
|
|
|
+ confirmDelete() {
|
|
|
+ if (this.listType == 'order') {
|
|
|
+ let requestData = {
|
|
|
+ id: this.orderLearnList[this.currentLearnIndex].id,
|
|
|
+ pk: this.orderLearnList[this.currentLearnIndex].scopeCode
|
|
|
+ }
|
|
|
+ this.$api.learnActivity.DeleteLeanProcess(requestData).then(
|
|
|
+ res => {
|
|
|
+ if (res.error == null) {
|
|
|
+ let index = this.currentLearnIndex
|
|
|
+ this.currentLearnIndex = 0
|
|
|
+ this.orderLearnList.splice(index,1)
|
|
|
+ this.$Message.success('删除成功!')
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$Message.success('删除失败!')
|
|
|
}
|
|
|
- )
|
|
|
- } else {
|
|
|
- setTimeout(() => {
|
|
|
- this.isLoading = false
|
|
|
- }, 200)
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.success('删除失败!')
|
|
|
+ }
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ let requestData = {
|
|
|
+ id: this.unitList[this.currentUnitIndex].id,
|
|
|
+ pk: this.unitList[this.currentUnitIndex].scopeCode
|
|
|
}
|
|
|
+ this.$api.learnActivity.DeleteUnit(requestData).then(
|
|
|
+ res => {
|
|
|
+ if (res.error == null) {
|
|
|
+ let index = this.currentUnitIndex
|
|
|
+ this.currentUnitIndex = 0
|
|
|
+ this.unitList.splice(index,1)
|
|
|
+ this.$Message.success('删除成功!')
|
|
|
+ } else {
|
|
|
+ this.$Message.success('删除失败!')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.success('删除失败!')
|
|
|
+ }
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
- * 通过id查询题目信息
|
|
|
+ * 切换列表类型
|
|
|
* */
|
|
|
- findQuestionById() {
|
|
|
- if (this.orderLearnList.length > 0) {
|
|
|
- this.isLoading = true
|
|
|
- if (!this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].requestedI) {
|
|
|
- this.$api.learnActivity.FindQuestionById(this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].item).then(
|
|
|
- res => {
|
|
|
- if (res.error == null) {
|
|
|
- this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].item.length = 0
|
|
|
- this.$set(this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex], 'item', res.result.data)
|
|
|
- this.orderLearnList[this.currentLearnIndex].steps[this.currentStepIndex].requestedI = true
|
|
|
- console.log(this.orderLearnList[this.currentLearnIndex])
|
|
|
- } else {
|
|
|
- this.$Message.error("API ERROR!")
|
|
|
- setTimeout(() => {
|
|
|
- this.isLoading = false
|
|
|
- }, 500)
|
|
|
- }
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error("API ERROR!")
|
|
|
- setTimeout(() => {
|
|
|
- this.isLoading = false
|
|
|
- }, 500)
|
|
|
- }
|
|
|
- )
|
|
|
- } else {
|
|
|
- setTimeout(() => {
|
|
|
- this.isLoading = false
|
|
|
- }, 200)
|
|
|
- }
|
|
|
+ toggleList() {
|
|
|
+ if (this.listType == 'order') {
|
|
|
+ this.findOrderLearn()
|
|
|
+ } else {
|
|
|
+ this.findUnit()
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
goToCreate() {
|
|
|
if (this.listType == 'order') {
|
|
|
this.$router.push({
|
|
@@ -289,25 +275,25 @@
|
|
|
})
|
|
|
} else {
|
|
|
//编辑最小单元
|
|
|
+ let unitInfo = this.unitList[this.currentUnitIndex]
|
|
|
+ this.$router.push({
|
|
|
+ name: 'createLearnUnit',
|
|
|
+ params: {
|
|
|
+ unitInfo
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
},
|
|
|
editInfo() {
|
|
|
this.editStatus = true
|
|
|
},
|
|
|
- selectStep(index) {
|
|
|
- this.currentStepIndex = index
|
|
|
- this.findQuestionById()
|
|
|
- this.findResourceById()
|
|
|
- },
|
|
|
selectOrderLearn(index) {
|
|
|
if (this.listType == 'order') {
|
|
|
this.currentStepIndex = 0
|
|
|
this.currentLearnIndex = index
|
|
|
- this.findQuestionById()
|
|
|
- this.findResourceById()
|
|
|
} else {
|
|
|
-
|
|
|
+ this.currentUnitIndex = index
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -323,8 +309,6 @@
|
|
|
res => {
|
|
|
if (res.error == null) {
|
|
|
this.orderLearnList = res.result.data
|
|
|
- this.findResourceById()
|
|
|
- this.findQuestionById()
|
|
|
} else {
|
|
|
this.$Message.error('API ERROR!')
|
|
|
}
|
|
@@ -333,9 +317,7 @@
|
|
|
|
|
|
}
|
|
|
)
|
|
|
- } else {
|
|
|
- this.$Message.info('数据已加载')
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
/**
|
|
@@ -350,10 +332,6 @@
|
|
|
res => {
|
|
|
if (res.error == null) {
|
|
|
this.unitList = res.result.data
|
|
|
- if (this.unitList.length > 0) {
|
|
|
- this.findResourceById()
|
|
|
- this.findQuestionById()
|
|
|
- }
|
|
|
} else {
|
|
|
this.$Message.error('API ERROR!')
|
|
|
}
|
|
@@ -362,9 +340,7 @@
|
|
|
|
|
|
}
|
|
|
)
|
|
|
- } else {
|
|
|
- this.$Message.info('数据已加载')
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -380,4 +356,7 @@
|
|
|
.order-learn-content-wrap #loadingBox {
|
|
|
margin-top: 88px !important;
|
|
|
}
|
|
|
+ .publish-modal .ivu-picker-confirm-time {
|
|
|
+ color: #515a6e;
|
|
|
+ }
|
|
|
</style>
|