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`, saveMarketing: `nakadai/nakadai/mall/marketing/promotion/save`,
updateMarketing: `nakadai/nakadai/mall/marketing/promotion/update`, updateMarketing: `nakadai/nakadai/mall/marketing/promotion/update`,
bannerEnableOrDisable: `nakadai/nakadai/mall/marketing/promotion/bannerEnableOrDisable`, 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>
</div> </div>
<el-table v-loading="loading" :data="courseData" class="table" ref="table" header-align="center" <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="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 type="index" width="70" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" 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(); this.getData();
}, },
methods: { methods: {
getRowKeys (row) { async getData () {
return row.cid; try {
}, const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
// this.loading = true
getData () { const { page } = await this.$post(this.api.curriculumList, {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') ...this.form,
let data = { pageNum: this.page,
...this.form, pageSize: this.pageSize,
pageNum: this.page, supplierId: sid ? sid.supplierId : '',
pageSize: this.pageSize, platformId: Setting.platformId
supplierId: sid ? sid.supplierId : '', })
platformId: Setting.platformId this.courseData = page.records
}; this.totals = page.total
this.$post(this.api.curriculumList, data).then(res => { this.loading = false
this.courseData = res.page.records; } finally {
this.totals = res.page.total; this.loading = false
this.loading = false; }
}).catch(err => { });
}, },
initData () { initData () {
this.page = 1; this.page = 1;

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

@ -98,7 +98,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="270" align="center"> <el-table-column label="操作" width="270" align="center">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -242,11 +242,11 @@ export default {
// checkbox // checkbox
checkboxChenge (row) { checkboxChenge (row) {
this.listData.map(e => { this.listData.map(e => {
e.checked = false; e.checked = false
}); });
row.checked = true; row.checked = true
this.checkedName = row.customerName; this.checkedName = row.customerName
this.checkedID = row.customerId; this.checkedID = row.customerId
}, },
clearSearch () { clearSearch () {
@ -262,45 +262,9 @@ export default {
margin-right: 20px; margin-right: 20px;
} }
/deep/ .el-checkbox__inner { /deep/ .client-check {
border-radius: 50%; .el-radio__label {
width: 19px; display: none;
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;
} }
</style> </style>

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

@ -3,10 +3,11 @@
custom-class="source-dia" @closed="closeDia"> custom-class="source-dia" @closed="closeDia">
<el-form label-width="80px" style="padding: 20px"> <el-form label-width="80px" style="padding: 20px">
<el-form-item prop="userName"> <el-form-item prop="userName">
<el-upload name="file" accept=".xls,.xlsx" ref="upload" class="import-file" drag :before-upload="beforeUpload" <el-upload name="file" ref="upload" class="import-file" drag :before-upload="beforeUpload"
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :on-remove="handleRemove" :on-error="uploadError" :before-remove="beforeRemove" :limit="1"
:limit="1" :disabled="uploading" v-loading="uploading" :on-exceed="handleExceed" action="" :disabled="uploading" v-loading="uploading" :on-exceed="handleExceed" :file-list="uploadList" action=""
:file-list="uploadList" :headers="headers"> :http-request="handleRequest">
<!-- <img v-if="form.coverUrl" :src="form.coverUrl" class="avatar"> -->
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip" style="line-height: 1.8;"> <div class="el-upload__tip" slot="tip" style="line-height: 1.8;">
@ -16,13 +17,15 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="资源名称"> <el-form-item label="资源名称">
<el-input v-model="form.name" placeholder="请输入资源名称" /> <el-input v-model="form.resourceName" placeholder="请输入资源名称" />
</el-form-item> </el-form-item>
<el-form-item label="资源类型"> <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>
<el-form-item label="资源描述"> <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-item>
</el-form> </el-form>
<div class="btns"> <div class="btns">
@ -34,22 +37,26 @@
<script> <script>
import Util from '@/libs/util' import Util from '@/libs/util'
import Setting from '@/setting' import Setting from '@/setting'
import axios from 'axios' import SourceConst from '@/const/source'
import { Form } from 'element-ui'; import Oss from '@/components/upload/upload.js'
export default { export default {
props: ['visible'], props: ['visible'],
data () { data () {
return { return {
uploadVisible: false, uploadVisible: false,
types: SourceConst.types,
uploadList: [], uploadList: [],
info: null, info: null,
headers: {
token: sessionStorage.getItem("token")
},
uploading: false, uploading: false,
submiting: false, submiting: false,
form: { form: {
fileType: '',
fileUrl: '',
fileName: '',
originalFileName: '',
resourceName: '',
resourceType: '',
resourceDescription: '',
}, },
}; };
}, },
@ -74,23 +81,15 @@ export default {
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
) )
}, },
// //
showFaild () { async handleRequest ({ file }) {
axios.get(`${this.api.batchImportQuesFailure}?exportCode=${this.info.exportCode}`, { Oss.upload(file).then(res => {
headers: this.headers, console.log("🚀 ~ Oss.upload ~ res:", res, file)
responseType: 'blob' this.uploading = false
}).then((res) => { this.form.fileType = res.format
Util.downloadFileDirect('批量导入题目管理失败数据导出.xlsx', new Blob([res.data])) this.form.fileUrl = res.url
}).catch(res => { }) this.form.fileName = res.name
}, })
uploadSuccess ({ data, status, message }) {
this.uploading = false
if (status === 200) {
// this.init()
this.info = data
} else {
Util.errorMsg(message || '上传失败,请检查数据', 3000)
}
}, },
uploadError () { uploadError () {
this.uploading = false this.uploading = false
@ -102,6 +101,7 @@ export default {
}, },
beforeUpload (file) { beforeUpload (file) {
this.uploading = true this.uploading = true
this.form.originalFileName = file.name
}, },
beforeRemove (file, fileList) { beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`) return this.$confirm(`确定移除 ${file.name}`)
@ -110,8 +110,17 @@ export default {
this.uploadList = fileList this.uploadList = fileList
this.info = null 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 () { closeDia () {

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

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

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

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

Loading…
Cancel
Save