|
|
|
@ -6,7 +6,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
|
<el-card shadow="hover"> |
|
|
|
|
<el-form class="model" ref="form" label-width="110px" :disabled="isDetail"> |
|
|
|
|
<el-row> |
|
|
|
|
<el-col :span="14" :offset="5"> |
|
|
|
@ -308,8 +308,57 @@ |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 大赛项目配置 --> |
|
|
|
|
<div v-if="form.classificationIds == 3" class="mgb20"> |
|
|
|
|
<div class="mgb20 flex-between"> |
|
|
|
|
<div class="flex-center "> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>大赛项目配置</span> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button @click="handleBatchDelete">批量移除</el-button> |
|
|
|
|
<el-button @click="handleConfig" icon="el-icon-plus" circle></el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="border-b-dashed"></div> |
|
|
|
|
<el-table :data="matches" class="table" header-align="center" max-height="400" |
|
|
|
|
@selection-change="handleSelectionMatch"> |
|
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.projectName || scope.row.paperName }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="排序" align="center" width="100"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input v-model.trim="scope.row.sort" |
|
|
|
|
@input="assessmentSortChange(scope.row, scope.$index)"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="展示控制" align="center" width="100"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-switch v-model="scope.row.isShow" :active-value="0" :inactive-value="1" |
|
|
|
|
:disabled="scope.row.disabled"> |
|
|
|
|
</el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="100"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button :disabled="scope.row.disabled" |
|
|
|
|
@click.native.prevent="handleDelete(scope.$index, matches)">移除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item class="req" label="产品简介" prop="briefIntroduction"> |
|
|
|
|
<el-input v-model="form.mall.productIntroduction" type="textarea" maxlength="200"></el-input> |
|
|
|
|
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mall.productIntroduction" |
|
|
|
|
:init="editorConfig" :disabled="isDetail" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item class="req" label="详情介绍" prop="briefIntroduction"> |
|
|
|
|
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' |
|
|
|
@ -433,16 +482,97 @@ |
|
|
|
|
<Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="true" :fixedNumber.sync="fixedNumber" |
|
|
|
|
:autoCropWidth="autoCropWidth" :autoCropHeight="autoCropHeight" @upload="customUpload" /> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 配置弹窗 --> |
|
|
|
|
<el-dialog :visible.sync="configVisible" width="1200px" center custom-class="config-dia"> |
|
|
|
|
<div class="config-wrap"> |
|
|
|
|
<div class="item system"> |
|
|
|
|
<div class="title-wrap flex-center"> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>系统列表</span> |
|
|
|
|
</div> |
|
|
|
|
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="systemKeyword" |
|
|
|
|
clearable></el-input> |
|
|
|
|
|
|
|
|
|
<ul class="systems"> |
|
|
|
|
<li v-for="(item, i) in systems" :key="i" :title="item.systemName"> |
|
|
|
|
<el-checkbox v-model="item.check" @change="val => systemChange(val, item)"></el-checkbox> |
|
|
|
|
<div :class="['name', { active: curSystem == item.systemId }]" @click="getProject(item)"> |
|
|
|
|
<span>{{ item.systemName }}</span> |
|
|
|
|
<i class="el-icon-arrow-right"></i> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="item project"> |
|
|
|
|
<div class="title-wrap flex-center"> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>项目列表</span> |
|
|
|
|
</div> |
|
|
|
|
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword" |
|
|
|
|
clearable></el-input> |
|
|
|
|
|
|
|
|
|
<ul class="systems"> |
|
|
|
|
<el-checkbox v-if="projects.length" v-model="checkAll" label="全选" |
|
|
|
|
@change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox> |
|
|
|
|
<li v-for="(item, i) in projects" :key="i" :title="item.projectName"> |
|
|
|
|
<el-checkbox v-model="item.check" |
|
|
|
|
:label="item.remark ? item.remark + '(' + item.projectName + ')' : (item.projectName || item.paperName)" |
|
|
|
|
@change="val => projectChange(val, item)"></el-checkbox> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="item checked"> |
|
|
|
|
<div class="title-wrap flex-center"> |
|
|
|
|
<p class="addhr_tag"></p> |
|
|
|
|
<span>已选择项目({{ checkeds.length }}个)</span> |
|
|
|
|
</div> |
|
|
|
|
<el-input style="width: 200px;margin-bottom: 20px;" placeholder="请输入项目名称" prefix-icon="el-icon-search" |
|
|
|
|
v-model.trim="checkedKeyword" clearable></el-input> |
|
|
|
|
<el-table :data="checkeds" class="table" header-align="center" max-height="470"> |
|
|
|
|
<el-table-column type="index" width="55" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="projectName" width="80" label="系统类型" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.type === 1 ? '流程类' : scope.row.type === 3 ? '理论' : '编程类' }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.projectName || scope.row.paperName }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="55"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i :class="['el-icon-delete rm', { disabled: scope.row.disabled }]" |
|
|
|
|
@click="delProject(scope.$index, scope.row)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="configVisible = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitConfig">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import Util from "@/libs/util"; |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
|
import Editor from '@tinymce/tinymce-vue' |
|
|
|
|
import editorConfig from '@/utils/editor' |
|
|
|
|
import Cropper from '@/components/img-upload/Cropper' |
|
|
|
|
import Upload from '@/components/upload'; |
|
|
|
|
import Oss from '@/components/upload/upload.js' |
|
|
|
|
import _ from 'lodash' |
|
|
|
|
export default { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
@ -513,7 +643,7 @@ export default { |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
productVisible: false, |
|
|
|
|
tabs: ['理论课程', '实训课程', '数据前瞻', '职站增值应用'], |
|
|
|
|
tabs: ['理论课程', '实训课程', '理实课程', '数据前瞻', '职站增值应用'], |
|
|
|
|
products: [], |
|
|
|
|
multipleSelection: [], |
|
|
|
|
page: 1, |
|
|
|
@ -560,7 +690,20 @@ export default { |
|
|
|
|
autoCropWidth: 484, |
|
|
|
|
autoCropHeight: 278, |
|
|
|
|
file: {}, // 当前被选择的图片文件 |
|
|
|
|
picType: 1 |
|
|
|
|
picType: 1, |
|
|
|
|
|
|
|
|
|
matches: [], |
|
|
|
|
matcheTotal: 0, |
|
|
|
|
multipleMatch: [], |
|
|
|
|
configVisible: false, |
|
|
|
|
systemKeyword: '', |
|
|
|
|
systems: [], |
|
|
|
|
systemChecked: [], |
|
|
|
|
curSystem: '', |
|
|
|
|
projects: [], |
|
|
|
|
projectKeyword: '', |
|
|
|
|
checkedKeyword: '', |
|
|
|
|
checkeds: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -628,6 +771,9 @@ export default { |
|
|
|
|
url: e.mall.appletIcon |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
this.matches = e.mallProjectConfig |
|
|
|
|
|
|
|
|
|
this.form = e |
|
|
|
|
this.getOp() |
|
|
|
|
this.$nextTick(() => { |
|
|
|
@ -680,8 +826,8 @@ export default { |
|
|
|
|
getProduct () { |
|
|
|
|
const active = this.productActive |
|
|
|
|
const keyword = this.productKeyword |
|
|
|
|
// 理论、实训 |
|
|
|
|
if (!active || active == 1) { |
|
|
|
|
// 理论、实训、理实 |
|
|
|
|
if (active < 3) { |
|
|
|
|
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') |
|
|
|
|
this.$post(this.api.curriculumList, { |
|
|
|
|
curriculumName: keyword, |
|
|
|
@ -689,12 +835,13 @@ export default { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
supplierId: sid ? sid.supplierId : '', |
|
|
|
|
isShelves: 1 |
|
|
|
|
isShelves: 1, |
|
|
|
|
platformId: Setting.platformId |
|
|
|
|
}).then(({ page }) => { |
|
|
|
|
this.products = page.records |
|
|
|
|
this.total = page.total |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
} else if (active == 2) { // 数据前瞻 |
|
|
|
|
} else if (active == 3) { // 数据前瞻 |
|
|
|
|
this.$post(this.api.listByEntity, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
@ -748,26 +895,31 @@ export default { |
|
|
|
|
this.selectedProduct = false |
|
|
|
|
this.isData = false |
|
|
|
|
this.isPython = false |
|
|
|
|
// 实训、理论需要查询课程详情,把课程信息带过来 |
|
|
|
|
if (!active || active == 1) { |
|
|
|
|
// 实训、理论、理实需要查询课程详情,把课程信息带过来 |
|
|
|
|
if (active < 3) { |
|
|
|
|
this.$post(`${this.api.curriculumDetail}?cid=${id}`).then(({ data }) => { |
|
|
|
|
form.supplierIds = data.supplier.split(',').map(e => +e) |
|
|
|
|
this.selectedProduct = true |
|
|
|
|
form.classificationIds = !data.curriculumType ? 2 : data.curriculumType |
|
|
|
|
form.mallDisciplines = [{ |
|
|
|
|
professionalClassList: [], |
|
|
|
|
professionalList: [], |
|
|
|
|
categoryId: data.categoryId, |
|
|
|
|
professionalId: data.professionalId, |
|
|
|
|
professionalCategoryId: data.professionalCategoryId, |
|
|
|
|
}] |
|
|
|
|
|
|
|
|
|
form.mallDisciplines = data.curriculumDisciplines |
|
|
|
|
form.mallDisciplines.forEach(e => { |
|
|
|
|
this.$set(e, 'professionalClassList', []) |
|
|
|
|
this.$set(e, 'professionalList', []) |
|
|
|
|
e.categoryId && this.getProfessionalClassData(e) |
|
|
|
|
e.professionalCategoryId && this.getProfessionalData(e) |
|
|
|
|
if (!e.categoryId) this.$set(e, 'categoryId', '') |
|
|
|
|
if (!e.professionalCategoryId) this.$set(e, 'professionalCategoryId', '') |
|
|
|
|
if (!e.professionalId) this.$set(e, 'professionalId', '') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
form.mallPrices.find(e => e.settlementPriceType && e.area === 0).settlementPrice = data.settlementPrice |
|
|
|
|
this.getProfessionalClassData(form.mallDisciplines[0]) |
|
|
|
|
this.getProfessionalData(form.mallDisciplines[0]) |
|
|
|
|
|
|
|
|
|
if (data.expectedCourse) mall.courseHours = data.expectedCourse |
|
|
|
|
if (data.coverUrl) mall.coverDrawing = data.coverUrl |
|
|
|
|
if (data.miniProgramPictureAddress) mall.appletIcon = data.miniProgramPictureAddress |
|
|
|
|
if (data.briefIntroduction) mall.productIntroduction = data.briefIntroduction |
|
|
|
|
if (data.teachingObjectives) mall.detailedIntroduction = data.teachingObjectives |
|
|
|
|
if (data.marketPrice) mall.marketUnitPrice = data.marketPrice |
|
|
|
|
// 判断是否是python系统 |
|
|
|
|
const systemIds = data.systemIds.split(',') |
|
|
|
@ -775,9 +927,9 @@ export default { |
|
|
|
|
this.calcAllSettlement() |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
} else { |
|
|
|
|
form.classificationIds = active == 2 ? 5 : 3 |
|
|
|
|
form.classificationIds = active == 3 ? 5 : 3 |
|
|
|
|
// 数据前瞻要获取供应厂商、市场建议单价等 |
|
|
|
|
if (active == 2) { |
|
|
|
|
if (active == 3) { |
|
|
|
|
const item = this.products.find(e => e.cid == id) |
|
|
|
|
if (item) { |
|
|
|
|
form.supplierIds = [+item.supplier] |
|
|
|
@ -1213,8 +1365,196 @@ export default { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 竞赛弹框 |
|
|
|
|
handleConfig () { |
|
|
|
|
this.systemKeyword = '' |
|
|
|
|
this.projectKeyword = '' |
|
|
|
|
this.checkedKeyword = '' |
|
|
|
|
this.configVisible = true |
|
|
|
|
this.pageNo = 1 |
|
|
|
|
this.getConfig() |
|
|
|
|
this.checkeds = _.cloneDeep(this.matches) |
|
|
|
|
this.checkedAll = _.cloneDeep(this.checkeds) |
|
|
|
|
}, |
|
|
|
|
handleSelectionMatch (val) { |
|
|
|
|
this.multipleMatch = val |
|
|
|
|
}, |
|
|
|
|
// 批量移除竞赛项目 |
|
|
|
|
handleBatchDelete () { |
|
|
|
|
if (!this.multipleMatch.length) return this.$message.warning("请勾选竞赛项目!") |
|
|
|
|
this.$confirm("此操作将批量移除项目, 是否继续?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
let ids = this.multipleMatch.map(i => i.projectId); |
|
|
|
|
let tempArr = []; |
|
|
|
|
for (let i = 0; i < this.matches.length; i++) { |
|
|
|
|
if (!ids.includes(this.matches[i].projectId)) { |
|
|
|
|
tempArr.push(this.matches[i]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.matches = tempArr; |
|
|
|
|
this.$message.success("批量移除成功") |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
handleDelete (index, data) { // 移除 |
|
|
|
|
this.$confirm("此操作将移除该项目, 是否继续?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
data.splice(index, 1); |
|
|
|
|
this.$message.success("移除成功"); |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.$message.info("已取消移除"); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 获取系统 |
|
|
|
|
getConfig () { |
|
|
|
|
const checked = this.matches |
|
|
|
|
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') |
|
|
|
|
this.$post(this.api.queryServiceConfig, { |
|
|
|
|
systemName: this.systemKeyword, |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
supplierId: sid ? sid.supplierId : '' |
|
|
|
|
}).then(res => { |
|
|
|
|
const list = res.serviceList.records |
|
|
|
|
const result = [] |
|
|
|
|
list.map(e => { |
|
|
|
|
// 如果选中的项目里有该系统的项目,则隐藏 |
|
|
|
|
// if (!checked.find(n => n.systemId == e.systemId)) { |
|
|
|
|
// e.check = !!checked.find(n => n.systemId == e.systemId) |
|
|
|
|
e.check = false |
|
|
|
|
result.push(e) |
|
|
|
|
// } |
|
|
|
|
}) |
|
|
|
|
this.systems = result |
|
|
|
|
this.checkAll = !!checked.find(n => n.systemId == result[0].systemId) // 因为默认显示第一个系统的项目,所以如果系统默认选中,则全选也勾选上 |
|
|
|
|
result.length && this.getProject(result[0]) |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}, |
|
|
|
|
// 获取项目列表 |
|
|
|
|
async getProject (item, fromSystemChange) { |
|
|
|
|
const checked = this.checkeds |
|
|
|
|
if (item) this.curSystem = item.systemId |
|
|
|
|
let res |
|
|
|
|
if (!fromSystemChange) { |
|
|
|
|
res = await this.$get(`${this.api.getInternalProjectBySystemId}?permissions=2&systemId=${this.curSystem}&keyword=${this.projectKeyword}`) |
|
|
|
|
} |
|
|
|
|
const result = [] |
|
|
|
|
const projects = fromSystemChange ? this.projects : res |
|
|
|
|
projects.map(e => { |
|
|
|
|
// 如果选择了该项目,则禁用并选中 |
|
|
|
|
const include = checked.some(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && n.paperId == e.paperId)) |
|
|
|
|
e.check = include |
|
|
|
|
result.push(e) |
|
|
|
|
}) |
|
|
|
|
this.checkAll = !result.filter(e => !e.check).length |
|
|
|
|
this.projects = result |
|
|
|
|
}, |
|
|
|
|
// 系统选择回调 |
|
|
|
|
systemChange (val, item) { |
|
|
|
|
// 项目列表选中状态同步 |
|
|
|
|
const { projects, checkeds } = this |
|
|
|
|
if (projects.length && projects[0].systemId == item.systemId) { |
|
|
|
|
projects.map(e => { |
|
|
|
|
e.check = val |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.projectKeyword = '' |
|
|
|
|
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=2&systemId=${item.systemId}&keyword=${this.projectKeyword}`).then(res => { |
|
|
|
|
if (val) { |
|
|
|
|
// 如果不支持多选系统,选中后全部取消选中再选中当前系统 |
|
|
|
|
if (!this.mulSystem) { |
|
|
|
|
this.systems.map(e => e.check = false) |
|
|
|
|
item.check = true |
|
|
|
|
} |
|
|
|
|
res.map(e => { |
|
|
|
|
if (!checkeds.find(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId))) { |
|
|
|
|
checkeds.push(e) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
res.map(e => { |
|
|
|
|
const i = checkeds.findIndex(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId)) |
|
|
|
|
i === -1 || checkeds.splice(i, 1) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) // 全部已选项目,另外保存 |
|
|
|
|
this.getProject(item, 1) |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}, |
|
|
|
|
// 项目全选回调 |
|
|
|
|
checkAllChange (val, systemId) { |
|
|
|
|
this.systemChange(val, { systemId }) |
|
|
|
|
this.systems.map(e => { |
|
|
|
|
if (e.systemId == systemId) e.check = val |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 项目选择回调 |
|
|
|
|
projectChange (val, item) { |
|
|
|
|
const { systemId, paperId } = item |
|
|
|
|
const i = this.checkeds.findIndex(e => (item.projectId && e.projectId == item.projectId && e.systemId == systemId) || (paperId && paperId == e.paperId)) |
|
|
|
|
// 选中,则push,否则移除 |
|
|
|
|
if (val) { |
|
|
|
|
this.checkeds.push(item) |
|
|
|
|
} else if (i !== -1) { |
|
|
|
|
this.checkeds.splice(i, 1) |
|
|
|
|
} |
|
|
|
|
// 同步系统 |
|
|
|
|
this.systems.map(e => { |
|
|
|
|
if (e.systemId == systemId) e.check = !this.projects.filter(n => !n.check).length |
|
|
|
|
}) |
|
|
|
|
this.checkAll = !this.projects.find(e => !e.check) // 同步全选框 |
|
|
|
|
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) // 全部已选项目,另外保存 |
|
|
|
|
}, |
|
|
|
|
// 已选择项目模糊查询 |
|
|
|
|
filterChecked () { |
|
|
|
|
const val = this.checkedKeyword |
|
|
|
|
this.checkeds = this.checkedAll.filter(e => (e.projectName && e.projectName.includes(val)) || (e.paperName && e.paperName.includes(val))) |
|
|
|
|
}, |
|
|
|
|
// 删除已选项目 |
|
|
|
|
delProject (i, e) { |
|
|
|
|
if (e.disabled) return |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.checkeds.splice(i, 1) |
|
|
|
|
// 如果当前展示的项目列表跟删掉的项目是同个系统,则找到项目列表里删掉的该项目,重置check和disabled |
|
|
|
|
if (e.systemId == this.curSystem) { |
|
|
|
|
const { projectId, paperId } = e |
|
|
|
|
this.projects.map(n => { |
|
|
|
|
if ((projectId && n.projectId == projectId) || (paperId && n.paperId == paperId)) { |
|
|
|
|
n.check = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.checkAll = !this.projects.find(e => !e.check) |
|
|
|
|
} |
|
|
|
|
this.systems.map(n => { |
|
|
|
|
if (n.systemId == e.systemId) n.check = false |
|
|
|
|
}) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
// 确认系统 |
|
|
|
|
submitConfig () { |
|
|
|
|
const list = this.checkeds |
|
|
|
|
if (!list.length) { |
|
|
|
|
this.$message.warning("请选择系统!") |
|
|
|
|
} else { |
|
|
|
|
this.configVisible = false |
|
|
|
|
list.map((e, i) => { |
|
|
|
|
e.isShow = 0 // isShow是否展示(默认0:展示 1:不展示) |
|
|
|
|
e.sort = i + 1 // 排序 |
|
|
|
|
}) |
|
|
|
|
this.matches = JSON.parse(JSON.stringify(list)) |
|
|
|
|
this.matchTotal = this.matches.length; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submit (state, next) { |
|
|
|
|
const form = JSON.parse(JSON.stringify(this.form)) |
|
|
|
|
const form = _.cloneDeep(this.form) |
|
|
|
|
const { mall } = form |
|
|
|
|
if (!mall.productName) return Util.errorMsg('请输入产品名称!') |
|
|
|
|
if (!state) { |
|
|
|
@ -1239,6 +1579,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (priceInvalid) return |
|
|
|
|
if (this.form.classificationIds == 3 && !this.matches.length) return Util.errorMsg('请选择大赛项目!') |
|
|
|
|
if (!mall.productIntroduction) return Util.errorMsg('请输入产品简介!') |
|
|
|
|
if (!mall.detailedIntroduction) return Util.errorMsg('请输入详情介绍!') |
|
|
|
|
} |
|
|
|
@ -1252,6 +1593,20 @@ export default { |
|
|
|
|
form.mallNonAssociatedLinks = links |
|
|
|
|
form.mall.state = state |
|
|
|
|
form.mall.isShelves = state |
|
|
|
|
|
|
|
|
|
// 大赛项目配置 |
|
|
|
|
form.systemIdByCompetition = this.matches.map(i => { |
|
|
|
|
let obj = { |
|
|
|
|
isShow: i.isShow, |
|
|
|
|
projectId: i.projectId, |
|
|
|
|
paperId: i.paperId || '', |
|
|
|
|
sort: +i.sort, |
|
|
|
|
systemId: i.systemId |
|
|
|
|
}; |
|
|
|
|
return obj |
|
|
|
|
}) |
|
|
|
|
form.systemIdByCompetition.sort((a, b) => a.sort - b.sort) |
|
|
|
|
|
|
|
|
|
if (this.submiting) return false |
|
|
|
|
this.submiting = true |
|
|
|
|
if (form.mall.mallId) { |
|
|
|
@ -1310,7 +1665,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.model { |
|
|
|
|
height: calc(100vh - 350px); |
|
|
|
|
height: calc(100vh - 317px); |
|
|
|
|
overflow: auto; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1571,4 +1926,83 @@ $avatar-width: 104px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/deep/.config-dia { |
|
|
|
|
.config-wrap { |
|
|
|
|
display: flex; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.title-wrap { |
|
|
|
|
margin-bottom: 15px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.item { |
|
|
|
|
width: 250px; |
|
|
|
|
max-height: 600px; |
|
|
|
|
padding: 10px; |
|
|
|
|
margin-right: 20px; |
|
|
|
|
overflow: hidden; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.system { |
|
|
|
|
background-color: #f9f9f9; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.systems { |
|
|
|
|
margin-top: 10px; |
|
|
|
|
max-height: 520px; |
|
|
|
|
overflow: auto; |
|
|
|
|
|
|
|
|
|
li { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin: 10px 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.name { |
|
|
|
|
display: inline-flex; |
|
|
|
|
flex: 1; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
align-items: center; |
|
|
|
|
margin-left: 5px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
|
|
&.active, |
|
|
|
|
&:hover { |
|
|
|
|
color: #062c87; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
span { |
|
|
|
|
max-width: 200px; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
overflow: hidden; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.checked { |
|
|
|
|
flex: 1; |
|
|
|
|
width: auto; |
|
|
|
|
|
|
|
|
|
.el-table .cell { |
|
|
|
|
font-size: 12px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.rm { |
|
|
|
|
font-size: 14px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
|
|
&.disabled { |
|
|
|
|
color: #ccc; |
|
|
|
|
cursor: not-allowed; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
&:hover { |
|
|
|
|
color: #17161f; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |