项目列表更新
This commit is contained in:
parent
35a75281b1
commit
eabac82e45
|
@ -38,14 +38,17 @@
|
|||
</span>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<template>
|
||||
<a v-if="hasPerm(power.release) && record.status == '1'" href="javascript:;" @click="handledRelease(record)">发布</a>
|
||||
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list')" />
|
||||
<a-popconfirm title="是否发布?" @confirm="() => handledRelease(record)">
|
||||
<a v-if="hasPerm(power.release) && record.status == '1'" href="javascript:;">发布</a>
|
||||
</a-popconfirm>
|
||||
<!-- <a v-if="hasPerm(power.release) && record.status == '1'" href="javascript:;" @click="handledRelease(record)">发布</a> -->
|
||||
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list') && hasPerm(power.release) && record.status == '1'" />
|
||||
<a v-if="hasPerm('project:list')" href="javascript:;" @click="getDetail(record)">详情</a>
|
||||
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list')" />
|
||||
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list') && ['1','2'].includes(record.status)" />
|
||||
<a v-if="hasPerm(power.edit) && ['1','2'].includes(record.status)" href="javascript:;" @click="handledCreate(record)">修改</a>
|
||||
<a-divider type="vertical" v-if="hasPerm(power.del) && hasPerm('project:list')" />
|
||||
<a-divider type="vertical" v-if="hasPerm(power.del) && hasPerm('project:list') && ['1'].includes(record.status)" />
|
||||
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
|
||||
<a v-if="hasPerm(power.del)" href="javascript:;">删除</a>
|
||||
<a v-if="hasPerm(power.del) && ['1'].includes(record.status)" href="javascript:;">删除</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</span>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</s-table>
|
||||
</a-space>
|
||||
<project-course-select ref="CourseSelect" @selectKeyDataSubmit="selectKeyDataChange" :selectRows="selData"></project-course-select>
|
||||
<a-col :span="24" style="text-align: center;">
|
||||
<a-col :span="24" style="text-align: center;margin-top: 10px;">
|
||||
<a-button type="primary" size="default" @click="toPrep" style="margin-right: 8px;">上一步</a-button>
|
||||
<a-button type="primary" size="default" @click="toNext">下一步</a-button>
|
||||
</a-col>
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!-- onChange: onSelectChange, -->
|
||||
<s-table ref="table" :columns="columns" :data="loadData" :rowKey="(record) => record.id"
|
||||
:rowSelection="{ selectedRowKeys: selectedRowKeys, selectedRows: selectedRows, onChange: onSelectChange }">
|
||||
:rowSelection="{ selectedRowKeys: selectedRowKeys, selectedRows: selectedRows,onChange: onSelectChange, onSelect: tableOnSelect }">
|
||||
<span slot="serial" slot-scope="text, record, index">
|
||||
{{ index + 1 }}
|
||||
</span>
|
||||
|
@ -144,6 +145,22 @@ export default {
|
|||
this.selectedRows = this.unique([...this.selectedRows, ...selectedRows])
|
||||
},
|
||||
|
||||
/** 用户手动选择/取消选择某列的回调 */
|
||||
tableOnSelect(record, selected, selectedRows, nativeEvent){
|
||||
if(!selected) { //取消勾选操作
|
||||
console.log('tableOnSelect - record:{}', record)
|
||||
console.log('tableOnSelect - selected:{}', selected)
|
||||
console.log('tableOnSelect - selectedRows:{}', selectedRows)
|
||||
console.log('tableOnSelect - nativeEvent:{}', nativeEvent)
|
||||
|
||||
let keys = this.selectedRowKeys.filter(item => item != record.id);
|
||||
let rows = this.selectedRows.filter(item => item.id != record.id);
|
||||
|
||||
this.selectedRows = rows;
|
||||
this.selectedRowKeys = keys;
|
||||
}
|
||||
},
|
||||
|
||||
//对象去重
|
||||
unique(arr) {
|
||||
const res = new Map()
|
||||
|
|
Loading…
Reference in New Issue