|
|
|
@ -1,7 +1,9 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="wrap"> |
|
|
|
|
<div class="side"> |
|
|
|
|
<org ref="tree" @initData="initData" @getData="getData"></org> |
|
|
|
|
<org ref="tree" |
|
|
|
|
@initData="initData" |
|
|
|
|
@getData="getData"></org> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="right"> |
|
|
|
@ -9,40 +11,94 @@ |
|
|
|
|
<div class="tool"> |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<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> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" round @click="add">新增模型</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> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
round |
|
|
|
|
@click="add">新增模型</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> |
|
|
|
|
|
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column type="selection" 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"></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"> |
|
|
|
|
<el-table :data="listData" |
|
|
|
|
class="table" |
|
|
|
|
ref="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
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"> |
|
|
|
|
{{ scope.row.postStatus ? '已发布' : '草稿' }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" width="230"> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
width="230"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="show(scope.row)">查看</el-button> |
|
|
|
|
<el-button type="text" @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> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="show(scope.row)">查看</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@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> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<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> |
|
|
|
@ -77,35 +133,24 @@ export default { |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 获取列表 |
|
|
|
|
getData() { |
|
|
|
|
async getData (school) { |
|
|
|
|
const curNode = this.$refs.tree.$refs.tree.getCurrentNode() // 获取当前选中的分类 |
|
|
|
|
this.isTopLevel = !curNode.level |
|
|
|
|
// 如果是首级,要调另一个接口 |
|
|
|
|
if (!curNode.level) { |
|
|
|
|
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, { |
|
|
|
|
const { data } = await this.$post(this.api[school ? 'InstitutionSourceModel' : !curNode.level ? 'getAllModelListBySys' : 'sysModelDemoList'], { |
|
|
|
|
modelName: this.keyword, |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
categoryId: curNode.id |
|
|
|
|
}).then(res => { |
|
|
|
|
this.listData = res.data.records |
|
|
|
|
this.total = res.data.total |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
} |
|
|
|
|
categoryId: curNode.id, |
|
|
|
|
founder: 0 |
|
|
|
|
}) |
|
|
|
|
this.listData = data.records |
|
|
|
|
this.total = data.total |
|
|
|
|
}, |
|
|
|
|
initData() { |
|
|
|
|
initData (school) { |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
this.getData(school) |
|
|
|
|
}, |
|
|
|
|
// 新增 |
|
|
|
|
add () { |
|
|
|
|