dev_202412
yujialong 2 months ago
parent 07b36913d2
commit 69fc4e49b2
  1. 5
      src/utils/api.js
  2. 37
      src/views/course/list.vue
  3. 8
      src/views/match/add/set.vue
  4. 54
      src/views/order/selectClient.vue
  5. 131
      src/views/resourse/index.vue
  6. 73
      src/views/resourse/upload.vue
  7. 30
      src/views/serve/projectList.vue
  8. 28
      src/views/shop/list.vue
  9. 59
      src/views/system/role.vue
  10. 1
      src/views/theoreticalCourse/add/index.vue

@ -531,4 +531,9 @@ export default {
saveMarketing: `nakadai/nakadai/mall/marketing/promotion/save`,
updateMarketing: `nakadai/nakadai/mall/marketing/promotion/update`,
bannerEnableOrDisable: `nakadai/nakadai/mall/marketing/promotion/bannerEnableOrDisable`,
paginatedFootagesList: `nakadai/resourceLibrary/paginatedFootagesList`,
resourceDel: `nakadai/resourceLibrary/batchDeletion`,
resourceFind: `nakadai/resourceLibrary/findById`,
resourceSave: `nakadai/resourceLibrary/saveOrUpdate`,
};

@ -64,7 +64,7 @@
</div>
</div>
<el-table v-loading="loading" :data="courseData" class="table" ref="table" header-align="center"
@selection-change="handleSelectionChange" :row-key="getRowKeys">
@selection-change="handleSelectionChange" row-key="cid">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="70" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" label="课程名称" align="center"></el-table-column>
@ -148,24 +148,23 @@ export default {
this.getData();
},
methods: {
getRowKeys (row) {
return row.cid;
},
//
getData () {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
let data = {
...this.form,
pageNum: this.page,
pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : '',
platformId: Setting.platformId
};
this.$post(this.api.curriculumList, data).then(res => {
this.courseData = res.page.records;
this.totals = res.page.total;
this.loading = false;
}).catch(err => { });
async getData () {
try {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
this.loading = true
const { page } = await this.$post(this.api.curriculumList, {
...this.form,
pageNum: this.page,
pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : '',
platformId: Setting.platformId
})
this.courseData = page.records
this.totals = page.total
this.loading = false
} finally {
this.loading = false
}
},
initData () {
this.page = 1;

@ -263,9 +263,11 @@ export default {
})
res.serviceList.forEach(e => e.systemId = +e.systemId)
this.services = res.serviceList
this.systemId = this.form.systemId || this.services[0].systemId
this.loadIns = Loading.service()
this.getProject()
if (this.services.length) {
this.systemId = this.form.systemId || this.services[0].systemId
this.getProject()
this.loadIns = Loading.service()
}
},
//
courseSystemChange (val) {

@ -98,7 +98,7 @@
</el-table-column>
<el-table-column label="操作" width="270" align="center">
<template slot-scope="scope">
<el-checkbox @change="checkboxChenge(scope.row)" v-model="scope.row.checked"></el-checkbox>
<el-radio class="client-check" v-model="scope.row.checked" :label="true" @change="checkboxChenge(scope.row)"> </el-radio>
</template>
</el-table-column>
</el-table>
@ -242,11 +242,11 @@ export default {
// checkbox
checkboxChenge (row) {
this.listData.map(e => {
e.checked = false;
e.checked = false
});
row.checked = true;
this.checkedName = row.customerName;
this.checkedID = row.customerId;
row.checked = true
this.checkedName = row.customerName
this.checkedID = row.customerId
},
clearSearch () {
@ -262,45 +262,9 @@ export default {
margin-right: 20px;
}
/deep/ .el-checkbox__inner {
border-radius: 50%;
width: 19px;
height: 19px;
}
/deep/ .el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
background: #FFF;
}
/deep/ .el-checkbox__inner::after {
transform: none;
transition: all .3s ease-in;
width: 0;
height: 0;
position: relative;
top: 50%;
left: 50%;
transform: translate(-46%, -48%);
border-radius: 50%;
}
/deep/ .el-checkbox__input.is-checked .el-checkbox__inner::after {
width: 13px;
height: 13px;
background: #9278FF;
position: relative;
top: 50%;
left: 50%;
transform: translate(-46%, -48%);
display: block;
border-radius: 50%;
transition: all .3s ease-in;
border: 0;
}
/deep/ .el-checkbox__input {
line-height: 0;
/deep/ .client-check {
.el-radio__label {
display: none;
}
}
</style>

@ -24,7 +24,7 @@
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<el-input placeholder="请输入资源名称、章节" suffix-icon="el-icon-search" v-model="form.keyWord" clearable></el-input>
<el-input placeholder="请输入资源名称、章节" suffix-icon="el-icon-search" v-model="form.keyword" clearable></el-input>
</li>
</ul>
</div>
@ -32,13 +32,13 @@
<ul class="filter">
<li>
<label>资源类型</label>
<el-select v-model="form.platformSource" clearable @change="initData">
<el-option v-for="(item, i) in sourceList" :key="i" :label="item.name" :value="item.id"></el-option>
<el-select v-model="form.resourceType" clearable @change="initData">
<el-option v-for="(item, i) in types" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>编辑人</label>
<el-select v-model="form.releaseType" clearable @change="initData">
<el-select v-model="form.editor" clearable @change="initData">
<el-option v-for="(item, i) in releaseTypes" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
@ -49,18 +49,26 @@
</div>
</div>
<el-table ref="table" :data="matchData" class="table" header-align="center"
@selection-change="handleSelectionChange" row-key="id">
<el-table ref="table" :data="list" class="table" header-align="center" @selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="name" min-width="160" label="资源名称" align="center"></el-table-column>
<el-table-column prop="name" min-width="160" label="资源类型" align="center"></el-table-column>
<el-table-column prop="name" min-width="160" label="课程名称" align="center"></el-table-column>
<el-table-column prop="name" min-width="160" label="章节" align="center"></el-table-column>
<el-table-column prop="resourceName" min-width="160" label="资源名称" align="center"></el-table-column>
<el-table-column prop="resourceType" min-width="160" label="资源类型" align="center"></el-table-column>
<template v-if="active === 'tab3'">
<el-table-column prop="resourceDescription" min-width="160" label="资源描述" align="center"></el-table-column>
<el-table-column prop="name" min-width="160" label="是否被引用" align="center">
<template slot-scope="scope">{{ scope.row.isReferenced ? '是' : '否' }}</template>
</el-table-column>
</template>
<template v-else>
<el-table-column prop="name" min-width="160" label="课程名称" align="center"></el-table-column>
<el-table-column prop="name" min-width="160" label="章节" align="center"></el-table-column>
</template>
<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="180">
@ -143,7 +151,9 @@
</template>
<script>
import Setting from '@/setting'
import Util from '@/libs/util'
import SourceConst from '@/const/source'
import Pdf from '@/components/pdf'
import Upload from './upload'
export default {
@ -157,20 +167,7 @@ export default {
tab3: '文件素材',
},
timer: null,
sourceList: [
{
id: null,
name: "不限"
},
{
id: 0,
name: "平台创建"
},
{
id: 1,
name: "院校创建"
}
],
types: SourceConst.types,
releaseTypes: [
{
id: '',
@ -231,17 +228,14 @@ export default {
name: '已发布'
}
],
matchData: [],
list: [],
form: {
keyWord: null,
month: '',
startTime: null,
endTime: null,
releaseType: '',
publishStatus: '',
competitionType: '',
platformSource: 0, // (01)
competitionScope: null, // (0: 1: 2.)
keyword: '',
startTime: '',
endTime: '',
resourceType: '',
editor: '',
},
multipleSelection: [],
dateList: [
@ -320,31 +314,14 @@ export default {
}
this.initData();
},
'form.keyWord': function (val) {
'form.keyword': function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
this.initData()
}, 500)
}
},
mounted () {
const { query } = this.$route
if (query.page) {
const { keyWord, month, startTime, endTime, platformSource, competitionScope, competitionType, publishStatus, releaseType } = query
this.form = {
keyWord: keyWord || null,
month: +month || '',
startTime: startTime || null,
endTime: endTime || null,
competitionType: competitionType || '',
publishStatus: publishStatus || '',
releaseType: releaseType || '',
platformSource: platformSource === 'null' ? null : (+platformSource || 0), // (01)
competitionScope: competitionScope ? +competitionScope : null, // (0: 1: 2.)
}
this.$router.push('/match').catch(() => { })
}
this.getData()
},
methods: {
@ -352,21 +329,15 @@ export default {
this.loading = true
try {
const { form } = this
const { data } = await this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
const { page } = await this.$post(this.api.paginatedFootagesList, {
pageNum: this.page,
pageSize: this.pageSize,
platformId: Setting.platformId,
...form
})
this.matchData = data.records
this.total = data.total
this.$refs.table.clearSelection()
this.loading = false
if (!this.matchData.length && this.total) {
this.page--
this.getData()
}
} catch (e) {
this.list = page.records
this.total = page.total
} finally {
this.loading = false
}
},
@ -402,21 +373,19 @@ export default {
},
//
delAllSelection () {
if (this.multipleSelection.length) {
const list = this.multipleSelection
if (list.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => 'competitionIds=' + i.id);
this.$post(`${this.api.batchDeleteCompetition}?${ids.join('&')}`).then(res => {
this.getData();
this.$message.success("删除成功");
this.$post(this.api.resourceDel, list.map(e => e.id)).then(res => {
this.getData()
this.$message.success("删除成功")
this.$refs.table.clearSelection()
}).catch(err => {
});
}).catch(() => {
});
}).catch(err => { })
}).catch(() => { })
} else {
this.$message.warning("请先选择赛事 !");
this.$message.warning("请先选择赛事 !")
}
},
@ -447,9 +416,14 @@ export default {
})
}).catch(res => { })
} else {
this.downloadFile(row.name + '.' + row.fileType, row.fileUrl)
this.downloadFile(row.originalFileName, row.fileUrl)
}
},
transferType (ext) {
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片";
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频";
return ext;
},
preview (row) {
if (this.transferType(row.fileType) == "视频") {
//
@ -503,17 +477,14 @@ export default {
this.$nextTick(() => {
this.iframeOnload();
});
})
.catch(err => {
});
}).catch(err => { })
}
},
del (row) {
this.$confirm('删除后用户将无法再查看和使用此资源,确定删除?', '提示', {
type: 'warning'
}).then(() => {
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => {
row.fileUrl && Oss.del(row.fileUrl)
this.$post(this.api.resourceDel, [row.id]).then(res => {
this.$message.success("删除成功")
this.getData()
}).catch(res => { })

@ -3,10 +3,11 @@
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">
<el-upload name="file" ref="upload" class="import-file" drag :before-upload="beforeUpload"
:on-remove="handleRemove" :on-error="uploadError" :before-remove="beforeRemove" :limit="1"
:disabled="uploading" v-loading="uploading" :on-exceed="handleExceed" :file-list="uploadList" action=""
:http-request="handleRequest">
<!-- <img v-if="form.coverUrl" :src="form.coverUrl" class="avatar"> -->
<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;">
@ -16,13 +17,15 @@
</el-upload>
</el-form-item>
<el-form-item label="资源名称">
<el-input v-model="form.name" placeholder="请输入资源名称" />
<el-input v-model="form.resourceName" placeholder="请输入资源名称" />
</el-form-item>
<el-form-item label="资源类型">
<el-input v-model="form.name" placeholder="请输入资源名称" />
<el-select v-model="form.resourceType" clearable>
<el-option v-for="(item, i) in types" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="资源描述">
<el-input v-model="form.name" placeholder="请输入资源描述" />
<el-input type="textarea" :rows="3" v-model="form.resourceDescription" placeholder="请输入资源描述" />
</el-form-item>
</el-form>
<div class="btns">
@ -34,22 +37,26 @@
<script>
import Util from '@/libs/util'
import Setting from '@/setting'
import axios from 'axios'
import { Form } from 'element-ui';
import SourceConst from '@/const/source'
import Oss from '@/components/upload/upload.js'
export default {
props: ['visible'],
data () {
return {
uploadVisible: false,
types: SourceConst.types,
uploadList: [],
info: null,
headers: {
token: sessionStorage.getItem("token")
},
uploading: false,
submiting: false,
form: {
fileType: '',
fileUrl: '',
fileName: '',
originalFileName: '',
resourceName: '',
resourceType: '',
resourceDescription: '',
},
};
},
@ -74,23 +81,15 @@ export default {
`当前限制选择 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)
}
//
async handleRequest ({ file }) {
Oss.upload(file).then(res => {
console.log("🚀 ~ Oss.upload ~ res:", res, file)
this.uploading = false
this.form.fileType = res.format
this.form.fileUrl = res.url
this.form.fileName = res.name
})
},
uploadError () {
this.uploading = false
@ -102,6 +101,7 @@ export default {
},
beforeUpload (file) {
this.uploading = true
this.form.originalFileName = file.name
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
@ -110,8 +110,17 @@ export default {
this.uploadList = fileList
this.info = null
},
submit () {
async submit () {
if (this.submiting) return false
const { form } = this
if (!form.fileUrl) return Util.warningMsg('请上传资源')
if (!form.resourceName) return Util.warningMsg('请填写资源名称')
this.submiting = true
await this.$post(this.api.resourceSave, {
platformId: Setting.platformId,
...form
})
this.uploadVisible = false
},
//
closeDia () {

@ -58,7 +58,7 @@
<el-button type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" header-align="center" row-key="projectId"
<el-table v-loading="loading" :data="list" class="table" ref="table" header-align="center" row-key="projectId"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
@ -195,7 +195,8 @@ export default {
copyVisible: false,
projectName: '',
currentRow: {}, //
listDataAll: []
listDataAll: [],
loading: false,
};
},
watch: {
@ -215,17 +216,20 @@ export default {
this.getData();
},
methods: {
getData () {
let data = {
...this.form,
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId
};
this.$post(this.api.queryProjectManage, data).then(res => {
this.list = res.data.records;
this.total = res.data.total;
}).catch(err => { });
async getData () {
try {
this.loading = true
const { data } = await this.$post(this.api.queryProjectManage, {
...this.form,
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId
})
this.list = data.records
this.total = data.total
} finally {
this.loading = false
}
},
initData () {
this.page = 1;

@ -43,7 +43,7 @@
</div>
</div>
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange"
<el-table v-loading="loading" :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange"
row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="60" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="70" label="序号" align="center">
@ -118,7 +118,8 @@ export default {
multipleSelection: [],
page: +this.$route.query.page || 1, //
pageSize: 10,
total: 0
total: 0,
loading: false,
};
},
watch: {
@ -140,16 +141,19 @@ export default {
this.getData()
},
methods: {
getData () {
this.$post(this.api.listOfGoods, {
pageNum: this.page,
pageSize: this.pageSize,
...this.form
}).then(({ page }) => {
this.list = page.records;
this.total = page.total;
}).catch(res => {
});
async getData () {
try {
this.loading = true
const { page } = await this.$post(this.api.listOfGoods, {
pageNum: this.page,
pageSize: this.pageSize,
...this.form
})
this.list = page.records
this.total = page.total
} finally {
this.loading = false
}
},
initData () {
this.page = 1;

@ -64,7 +64,7 @@
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="roleVisible = false"> </el-button>
<el-button type="primary" @click="saveData"> </el-button>
<el-button type="primary" :loading="submiting" @click="saveData"> </el-button>
</span>
</el-dialog>
@ -116,6 +116,7 @@ export default {
suppliers: [],
dataCheckAll: false,
curData: {},
submiting: false,
};
},
watch: {
@ -340,33 +341,37 @@ export default {
if (!form.remark) return this.$message.warning("请填写角色描述");
const tree = this.$refs.per
if (!tree.getCheckedKeys().length) return this.$message.warning("请选择角色权限");
// ,(),
const checks = [...this.$refs.per.getHalfCheckedNodes(), ...this.$refs.per.getCheckedNodes()];
const ids = []
const roleId = form.id
// id
checks.map(e => {
//
if (datas.includes(e.name) && e.supplierIds) {
e.supplierIds.map(n => {
ids.push({
permissionId: e.id,
roleId,
supplierId: n
try {
this.submiting = true
// ,(),
const checks = [...this.$refs.per.getHalfCheckedNodes(), ...this.$refs.per.getCheckedNodes()];
const ids = []
const roleId = form.id
// id
checks.map(e => {
//
if (datas.includes(e.name) && e.supplierIds) {
e.supplierIds.map(n => {
ids.push({
permissionId: e.id,
roleId,
supplierId: n
})
})
})
}
})
this.$post(this.api.saveOrUpdate, {
...this.form,
permissionId: [...tree.getHalfCheckedKeys(), ...tree.getCheckedKeys()],
dataPermissionList: ids,
platformId: Setting.platformId,
}).then(res => {
this.$message.success(form.id ? "修改成功" : "新增成功");
this.getData();
this.roleVisible = false;
}).catch(res => { });
}
})
await this.$post(this.api.saveOrUpdate, {
...this.form,
permissionId: [...tree.getHalfCheckedKeys(), ...tree.getCheckedKeys()],
dataPermissionList: ids,
platformId: Setting.platformId,
})
this.$message.success(form.id ? "修改成功" : "新增成功")
this.getData()
this.roleVisible = false
} finally {
this.submiting = false
}
}
}
};

@ -108,6 +108,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary"
:loading="submiting"
@click="save"
v-show="!isDetail">{{ form.id ? "更新" : "创建" }}</el-button>
</el-form-item>

Loading…
Cancel
Save