|
@@ -112,7 +112,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="name">
|
|
|
- <div>
|
|
|
+ <div class="dark-iview-input disabled-iview-input teach-file-name">
|
|
|
<div class="file-icon">
|
|
|
<img v-if="row.extension == 'PPT' || row.extension == 'PPTX'" src="../../assets/icon/ppt50.png" width="15" />
|
|
|
<img v-else-if="row.extension == 'DOC' || row.extension == 'DOCX'" src="../../assets/icon/word50.png" width="15" />
|
|
@@ -124,7 +124,10 @@
|
|
|
<img v-else-if="row.type == 'res'" src="../../assets/icon/htex.png" width="15" />
|
|
|
<img v-else src="../../assets/icon/prelearn50.png" width="15" />
|
|
|
</div>
|
|
|
- <span>{{row.name}}</span>
|
|
|
+ <span v-show="editIndex !== index">{{row.name}}</span>
|
|
|
+ <Input v-model="fileListShow[index].name" v-show="editIndex == index" style="width: 300px;" />
|
|
|
+ <Icon type="md-checkmark" v-show="editIndex == index" @click="confirmRename" class="rename-action-icon" />
|
|
|
+ <Icon type="md-close" v-show="editIndex == index" @click="cancelRename" class="rename-action-icon" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="knowledges">
|
|
@@ -135,6 +138,7 @@
|
|
|
<Icon type="md-download" size="18" color="white" :title="$t('teachContent.tips3')" @click="downloadFile(index)" />
|
|
|
<Icon v-if="activeType !== 'other' " type="md-eye" size="18" color="white" :title="$t('teachContent.tips4')" @click="openPreviewFile(index)" />
|
|
|
<Icon v-if="$access.can('admin.*|content-school-upd') || routerScope == 'private'" type="md-trash" size="18" color="white" :title="$t('teachContent.tips7')" @click="delFile(row,index)" />
|
|
|
+ <Icon v-if="$access.can('admin.*|content-school-upd') || routerScope == 'private'" type="md-create" size="18" color="white" :title="$t('teachContent.tips6')" @click="rename(row,index)" />
|
|
|
</div>
|
|
|
</template>
|
|
|
</Table>
|
|
@@ -194,6 +198,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ editIndex: -1,
|
|
|
modalLoading: false,
|
|
|
containerClient: undefined,
|
|
|
waterfallWidth: 1000,
|
|
@@ -242,6 +247,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ rename(row, index) {
|
|
|
+ this.editIndex = index
|
|
|
+ this.renameBefore = row.name
|
|
|
+ },
|
|
|
+ cancelRename() {
|
|
|
+ this.$set(this.fileListShow[this.editIndex], 'name', this.renameBefore)
|
|
|
+ // 解决UI不刷新问题
|
|
|
+ let dataTemp = JSON.stringify(this.fileListShow);
|
|
|
+ this.fileListShow = JSON.parse(dataTemp);
|
|
|
+ this.editIndex = -1
|
|
|
+ },
|
|
|
+ confirmRename(){
|
|
|
+ console.log(this.fileListShow[this.editIndex])
|
|
|
+ this.editIndex = -1
|
|
|
+ this.$Message.warning('暂未对接API')
|
|
|
+ },
|
|
|
parseComplete() {
|
|
|
this.modalLoading = false
|
|
|
this.$refs['uploadModal'].buttonLoading = false
|
|
@@ -408,7 +429,7 @@ export default {
|
|
|
title: this.$t('teachContent.tableC4'),
|
|
|
slot: 'size',
|
|
|
key: 'size',
|
|
|
- width: 150,
|
|
|
+ width: 100,
|
|
|
align: 'center',
|
|
|
sortable: true
|
|
|
},
|
|
@@ -416,13 +437,14 @@ export default {
|
|
|
title: this.$t('teachContent.tableC6'),
|
|
|
slot: 'createTime',
|
|
|
key: 'createTime',
|
|
|
- width: 180,
|
|
|
- sortable: true
|
|
|
+ width: 150,
|
|
|
+ sortable: true,
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: this.$t('teachContent.tableC2'),
|
|
|
slot: 'action',
|
|
|
- width: 210,
|
|
|
+ width: 160,
|
|
|
align: 'center'
|
|
|
}
|
|
|
]
|
|
@@ -1101,4 +1123,9 @@ export default {
|
|
|
.content-file-list #loadingBox {
|
|
|
margin-top: 0px !important;
|
|
|
}
|
|
|
+.teach-file-name .ivu-input[disabled],
|
|
|
+.teach-file-name fieldset[disabled] .ivu-input {
|
|
|
+ color: white;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
</style>
|