|
|
@ -1,7 +1,9 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="wrap"> |
|
|
|
<div class="wrap"> |
|
|
|
<div class="side"> |
|
|
|
<div class="side"> |
|
|
|
<org ref="tree" @initData="initData" @getData="getData"></org> |
|
|
|
<org ref="tree" |
|
|
|
|
|
|
|
@initData="initData" |
|
|
|
|
|
|
|
@getData="getData"></org> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="right"> |
|
|
|
<div class="right"> |
|
|
@ -9,40 +11,94 @@ |
|
|
|
<div class="tool"> |
|
|
|
<div class="tool"> |
|
|
|
<ul class="filter"> |
|
|
|
<ul class="filter"> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<el-input placeholder="请输入模型名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input> |
|
|
|
<el-input placeholder="请输入模型名称" |
|
|
|
|
|
|
|
prefix-icon="el-icon-search" |
|
|
|
|
|
|
|
v-model.trim="keyword" |
|
|
|
|
|
|
|
clearable></el-input> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" round @click="add">新增模型</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
<el-button type="primary" round @click="batchDel">批量删除</el-button> |
|
|
|
round |
|
|
|
<el-button type="primary" round @click="batchOff(1)">批量禁用</el-button> |
|
|
|
@click="add">新增模型</el-button> |
|
|
|
<el-button type="primary" round @click="batchOff(0)">批量开启</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="batchDel">批量删除</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="batchOff(1)">批量禁用</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="batchOff(0)">批量开启</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> |
|
|
|
<el-table :data="listData" |
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
class="table" |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column> |
|
|
|
ref="table" |
|
|
|
<el-table-column prop="modelName" label="模型名称" align="center"></el-table-column> |
|
|
|
stripe |
|
|
|
<el-table-column v-if="isTopLevel" prop="categoryName" label="分类" width="150" align="center"></el-table-column> |
|
|
|
header-align="center" |
|
|
|
<el-table-column prop="modifyName" label="编辑人" align="center"></el-table-column> |
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
<el-table-column prop="updateTime" label="最新编辑时间" width="150" align="center"></el-table-column> |
|
|
|
<el-table-column type="selection" |
|
|
|
<el-table-column prop="workNumber" label="状态" width="100" align="center"> |
|
|
|
width="55" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column type="index" |
|
|
|
|
|
|
|
label="序号" |
|
|
|
|
|
|
|
width="55" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="modelName" |
|
|
|
|
|
|
|
label="模型名称" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="isTopLevel" |
|
|
|
|
|
|
|
prop="categoryName" |
|
|
|
|
|
|
|
label="分类" |
|
|
|
|
|
|
|
width="150" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="modifyName" |
|
|
|
|
|
|
|
label="编辑人" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.row.schoolName || scope.row.modifyName }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="updateTime" |
|
|
|
|
|
|
|
label="最新编辑时间" |
|
|
|
|
|
|
|
width="150" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="workNumber" |
|
|
|
|
|
|
|
label="状态" |
|
|
|
|
|
|
|
width="100" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.postStatus ? '已发布' : '草稿' }} |
|
|
|
{{ scope.row.postStatus ? '已发布' : '草稿' }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="230"> |
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
width="230"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" @click="show(scope.row)">查看</el-button> |
|
|
|
<el-button type="text" |
|
|
|
<el-button type="text" @click="edit(scope.row)">编辑</el-button> |
|
|
|
@click="show(scope.row)">查看</el-button> |
|
|
|
<el-button type="text" @click="del(scope.row)">删除</el-button> |
|
|
|
<el-button type="text" |
|
|
|
<el-switch v-if="scope.row.postStatus" v-model="scope.row.isOpen" :active-value="0" :inactive-value="1" style="margin: 0 10px 0 5px" :active-text="scope.row.isOpen ? '禁用' : '启用'" @change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
@click="edit(scope.row)">编辑</el-button> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
|
|
|
|
<el-switch v-if="scope.row.postStatus" |
|
|
|
|
|
|
|
v-model="scope.row.isOpen" |
|
|
|
|
|
|
|
:active-value="0" |
|
|
|
|
|
|
|
:inactive-value="1" |
|
|
|
|
|
|
|
style="margin: 0 10px 0 5px" |
|
|
|
|
|
|
|
:active-text="scope.row.isOpen ? '禁用' : '启用'" |
|
|
|
|
|
|
|
@change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="pagination"> |
|
|
|
<div class="pagination"> |
|
|
|
<el-pagination background layout="total, prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination> |
|
|
|
<el-pagination background |
|
|
|
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
|
|
|
:current-page="page" |
|
|
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
|
|
:total="total"></el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -77,35 +133,24 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 获取列表 |
|
|
|
// 获取列表 |
|
|
|
getData() { |
|
|
|
async getData (school) { |
|
|
|
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() // 获取当前选中的分类 |
|
|
|
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() // 获取当前选中的分类 |
|
|
|
this.isTopLevel = !curNode.level |
|
|
|
this.isTopLevel = !curNode.level |
|
|
|
// 如果是首级,要调另一个接口 |
|
|
|
// 如果是首级,要调另一个接口 |
|
|
|
if (!curNode.level) { |
|
|
|
const { data } = await this.$post(this.api[school ? 'InstitutionSourceModel' : !curNode.level ? 'getAllModelListBySys' : 'sysModelDemoList'], { |
|
|
|
this.$post(this.api.getAllModelListBySys, { |
|
|
|
|
|
|
|
modelName: this.keyword, |
|
|
|
|
|
|
|
pageNum: this.page, |
|
|
|
|
|
|
|
pageSize: this.pageSize |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
this.listData = res.data.records |
|
|
|
|
|
|
|
this.total = res.data.total |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$post(this.api.sysModelDemoList, { |
|
|
|
|
|
|
|
modelName: this.keyword, |
|
|
|
modelName: this.keyword, |
|
|
|
pageNum: this.page, |
|
|
|
pageNum: this.page, |
|
|
|
pageSize: this.pageSize, |
|
|
|
pageSize: this.pageSize, |
|
|
|
categoryId: curNode.id |
|
|
|
categoryId: curNode.id, |
|
|
|
}).then(res => { |
|
|
|
founder: 0 |
|
|
|
this.listData = res.data.records |
|
|
|
}) |
|
|
|
this.total = res.data.total |
|
|
|
this.listData = data.records |
|
|
|
}).catch(res => {}) |
|
|
|
this.total = data.total |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
initData() { |
|
|
|
initData (school) { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData(school) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增 |
|
|
|
// 新增 |
|
|
|
add () { |
|
|
|
add () { |
|
|
|