dev_202412
yujialong 2 months ago
parent 6beec3d7e7
commit b4b748d3ca
  1. 2
      src/assets/css/main.css
  2. 2
      src/components/Navbar.vue
  3. 2
      src/setting.js
  4. 143
      src/views/resourse/index.vue
  5. 148
      src/views/resourse/upload.vue
  6. 6
      src/views/shop/add.vue

@ -8,7 +8,7 @@ body,
#app,
.wrapper {
width: 100%;
height: 100%;
min-height: 100%;
display: flex;
flex-direction: column;
}

@ -124,7 +124,7 @@ export default {
<style lang="scss" scoped>
.menus {
z-index: 1000;
z-index: 2000;
position: sticky;
top: 0;
display: flex;

@ -51,7 +51,7 @@ const Setting = {
isDev,
isPro,
// 是否使用动态路由
dynamicRoute: true,
dynamicRoute: false,
/**
* @description 默认密码
*/

@ -44,7 +44,8 @@
</li>
</ul>
<div>
<el-button type="primary" @click="delAllSelection" v-auth>批量删除</el-button>
<el-button type="primary" @click="uploadFile">上传文件</el-button>
<el-button type="primary" @click="delAllSelection">批量删除</el-button>
</div>
</div>
@ -62,12 +63,12 @@
<el-table-column prop="name" min-width="160" label="章节" align="center"></el-table-column>
<el-table-column prop="createTime" label="入库时间" align="center" width="160"></el-table-column>
<el-table-column prop="founderName" label="编辑人" width="130" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="280">
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="download(scope.row)">下载</el-button>
<el-button type="text" @click="preview(scope.row)" v-auth>预览</el-button>
<el-button type="text" @click="del(scope.row)" v-auth>删除</el-button>
<el-button type="text" @click="preview(scope.row)">预览</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -136,14 +137,17 @@
<Pdf :visible.sync="pdfVisible" :src.sync="pdfSrc" />
<div class="player-download" id="playerDownload"></div>
<Upload :visible.sync="uploadVisible" />
</div>
</template>
<script>
import Util from '@/libs/util'
import Pdf from "@/components/pdf";
import Pdf from '@/components/pdf'
import Upload from './upload'
export default {
components: { Pdf },
components: { Pdf, Upload },
data () {
return {
active: this.$route.query.type || 'tab1',
@ -293,6 +297,8 @@ export default {
pdfVisible: false,
pdfSrc: "",
previewing: false,
uploadVisible: false,
};
},
watch: {
@ -375,20 +381,24 @@ export default {
})
},
changeType () {
this.$refs.table.clearSelection();
this.$refs.table.clearSelection()
this.initData();
},
initData () {
this.page = 1;
this.getData();
this.page = 1
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val;
this.multipleSelection = val
},
handleCurrentChange (val) {
this.page = val;
this.$router.push(`match?page=${val}`)
this.getData();
this.page = val
this.$router.push(`/resourse?page=${val}`)
this.getData()
},
//
uploadFile () {
this.uploadVisible = true
},
//
delAllSelection () {
@ -499,17 +509,15 @@ export default {
}
},
del (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => {
row.fileUrl && Oss.del(row.fileUrl)
this.$message.success("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => { })
this.$confirm('删除后用户将无法再查看和使用此资源,确定删除?', '提示', {
type: 'warning'
}).then(() => {
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => {
row.fileUrl && Oss.del(row.fileUrl)
this.$message.success("删除成功")
this.getData()
}).catch(res => { })
}).catch(() => { })
},
sectionNameSubmit () {
if (!this.sectionForm.sectionName) return this.$message.warning("请填写资源名称")
@ -526,11 +534,11 @@ export default {
}).catch(err => { })
},
closePlayer () {
this.playAuth = "";
this.playAuth = ''
this.player.pause();
},
closeIframe () {
this.iframeSrc = "";
this.iframeSrc = ''
this.videoSrc = ''
this.showMask = false;
this.showMask1 = false;
@ -561,4 +569,87 @@ export default {
}
}
}
.el-image-viewer__wrapper {
transform: translateY(-10px);
transition: transform 0.5s;
&.active {
transform: translateY(0);
}
}
.el-image-viewer__close {
z-index: 10000;
top: 15px;
right: 15px;
&.doc-close {
i {
color: #000 !important;
}
}
}
.player {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 1200px !important;
height: 600px !important;
}
.player-download {
position: absolute;
top: -9999px;
}
.fileIframe {
z-index: 1;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
}
.mask {
z-index: 1000;
position: fixed;
background-color: rgb(57, 58, 61);
}
.word-mask {
z-index: 1000;
position: fixed;
right: 0;
width: 100%;
background-color: rgb(243, 242, 241);
}
.word-mask1 {
z-index: 1000;
position: fixed;
top: 0;
right: 0;
background-color: #2b579a;
}
.word-mask2 {
z-index: 1000;
position: fixed;
background-color: transparent;
}
.excel-mask1 {
z-index: 9;
position: absolute;
top: 0;
left: 20%;
width: 80%;
background-color: #107c41;
}
</style>

@ -0,0 +1,148 @@
<template>
<el-drawer title="上传文件" :visible.sync="uploadVisible" size="600px" :close-on-click-modal="false"
custom-class="source-dia" @closed="closeDia">
<el-form label-width="80px" style="padding: 20px">
<el-form-item prop="userName">
<el-upload name="file" accept=".xls,.xlsx" ref="upload" class="import-file" drag :before-upload="beforeUpload"
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove"
:limit="1" :disabled="uploading" v-loading="uploading" :on-exceed="handleExceed" action=""
:file-list="uploadList" :headers="headers">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip" style="line-height: 1.8;">
<p>视频请上传MP4格式大小不超过150M</p>
<p>其他格式文件大小不要超过10M</p>
</div>
</el-upload>
</el-form-item>
<el-form-item label="资源名称">
<el-input v-model="form.name" placeholder="请输入资源名称" />
</el-form-item>
<el-form-item label="资源类型">
<el-input v-model="form.name" placeholder="请输入资源名称" />
</el-form-item>
<el-form-item label="资源描述">
<el-input v-model="form.name" placeholder="请输入资源描述" />
</el-form-item>
</el-form>
<div class="btns">
<el-button @click="uploadVisible = false">取消</el-button>
<el-button type="primary" :loading="submiting" @click="submit">确定</el-button>
</div>
</el-drawer>
</template>
<script>
import Util from '@/libs/util'
import Setting from '@/setting'
import axios from 'axios'
import { Form } from 'element-ui';
export default {
props: ['visible'],
data () {
return {
uploadVisible: false,
uploadList: [],
info: null,
headers: {
token: sessionStorage.getItem("token")
},
uploading: false,
submiting: false,
form: {
},
};
},
watch: {
visible () {
this.uploadVisible = this.visible
this.visible && this.init()
}
},
mounted () {
},
methods: {
init () {
this.info = null
this.uploadList = []
},
//
handleExceed () {
Util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
//
showFaild () {
axios.get(`${this.api.batchImportQuesFailure}?exportCode=${this.info.exportCode}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
Util.downloadFileDirect('批量导入题目管理失败数据导出.xlsx', new Blob([res.data]))
}).catch(res => { })
},
uploadSuccess ({ data, status, message }) {
this.uploading = false
if (status === 200) {
// this.init()
this.info = data
} else {
Util.errorMsg(message || '上传失败,请检查数据', 3000)
}
},
uploadError () {
this.uploading = false
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeUpload (file) {
this.uploading = true
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
handleRemove (file, fileList) {
this.uploadList = fileList
this.info = null
},
submit () {
},
//
closeDia () {
this.$parent.initData()
this.$emit('update:visible', false)
}
}
};
</script>
<style lang="scss" scoped>
/deep/.import-file {
.el-upload__tip {
margin-top: 0;
}
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
.btns {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 14px 0;
text-align: center;
background-color: #fff;
box-shadow: 4px -2px 6px 0px rgba(198, 198, 198, 0.3500);
}
</style>

@ -763,7 +763,7 @@ export default {
if (e.typeIds && e.typeIds.length) e.typeIds = e.typeIds[0]
e.mall.interfaceDiagrams = e.mall.interfaceDiagram ? e.mall.interfaceDiagram.split(',') : []
e.mallAnnex.forEach(e => e.name = e.fileName)
if (e.systemId && e.systemId.split(',').filter(e => e != 11 && e != 12 && e != 19).length) this.isPython = true // python
if (e.systemId && e.systemId.split(',').filter(e => e != 11 && e != 12 && e != 19 && e != 31).length) this.isPython = true // python
if (!e.mall.themeId) e.mall.themeId = ''
if (e.mall.appletIcon) this.appletList = [
{
@ -772,7 +772,7 @@ export default {
}
]
this.matches = e.mallProjectConfig
if (e.mallProjectConfig) this.matches = e.mallProjectConfig
this.form = e
this.getOp()
@ -923,7 +923,7 @@ export default {
if (data.marketPrice) mall.marketUnitPrice = data.marketPrice
// python
const systemIds = data.systemIds.split(',')
this.isPython = systemIds.filter(e => e != 11 && e != 12 && e != 19).length
this.isPython = systemIds.filter(e => e != 11 && e != 12 && e != 19 && e != 31).length
this.calcAllSettlement()
}).catch(err => { })
} else {

Loading…
Cancel
Save