Commit cedb7c6c by Moxun Committed by elunez

1. 为CRUD.operation注入curd,免去属性传递 2. 表格界面零配置实现“表格列过滤显示”功能,弃用v-if方式 (#59)

 CRUD优化
为CRUD.operation注入curd,免去属性传递
表格界面零配置实现“表格列过滤显示”功能,弃用v-if方式
parent fafa2a7e
......@@ -107,7 +107,7 @@ export default {
props: {
permission: {
type: Object,
default: null
default: () => { return {} }
}
},
data() {
......@@ -136,19 +136,22 @@ export default {
this.allColumnsSelected = true
return
}
for (const key in this.crud.props.tableColumns) {
this.crud.props.tableColumns[key].visible = val
this.crud.props.tableColumns.forEach(column => {
if (!column.visible) {
column.visible = true
this.updateColumnVisible(column)
}
})
this.allColumnsSelected = val
this.allColumnsSelectedIndeterminate = false
},
handleCheckedTableColumnsChange(item) {
let totalCount = 0
let selectedCount = 0
for (const key in this.crud.props.tableColumns) {
this.crud.props.tableColumns.forEach(column => {
++totalCount
selectedCount += this.crud.props.tableColumns[key].visible ? 1 : 0
}
selectedCount += column.visible ? 1 : 0
})
if (selectedCount === 0) {
this.crud.notify('请至少选择一列', CRUD.NOTIFICATION_TYPE.WARNING)
this.$nextTick(function() {
......@@ -158,6 +161,23 @@ export default {
}
this.allColumnsSelected = selectedCount === totalCount
this.allColumnsSelectedIndeterminate = selectedCount !== totalCount && selectedCount !== 0
this.updateColumnVisible(item)
},
updateColumnVisible(item) {
const table = this.crud.props.table
const vm = table.$children.find(e => e.prop === item.property)
const columnConfig = vm.columnConfig
if (item.visible) {
let columnIndex = -1
// 找出合适的插入点
table.store.states.columns.find(e => {
columnIndex++
return e.__index !== undefined && e.__index > columnConfig.__index
})
vm.owner.store.commit('insertColumn', columnConfig, columnIndex, null)
} else {
vm.owner.store.commit('removeColumn', columnConfig, null)
}
},
toggleSearch() {
this.crud.props.searchToggle = !this.crud.props.searchToggle
......
......@@ -6,12 +6,10 @@
</span>
</template>
<script>
import { crud } from '@crud/crud'
export default {
mixins: [crud()],
props: {
crud: {
type: Object,
required: true
},
itemClass: {
type: String,
required: false,
......
......@@ -551,13 +551,6 @@ function mergeOptions(src, opts) {
* crud主页
*/
function presenter(crud) {
function obColumns(columns) {
return {
visible(col) {
return !columns || !columns[col] ? true : columns[col].visible
}
}
}
return {
inject: ['crud'],
beforeCreate() {
......@@ -571,8 +564,7 @@ function presenter(crud) {
},
data() {
return {
searchToggle: true,
columns: obColumns()
searchToggle: true
}
},
methods: {
......@@ -588,18 +580,21 @@ function presenter(crud) {
this.crud.unregisterVM(this)
},
mounted() {
const columns = {}
this.$refs.table.columns.forEach(e => {
const columns = []
this.$refs.table.columns.forEach((e, index) => {
if (!e.property || e.type !== 'default') {
return
}
columns[e.property] = {
e.__index = index
columns.push({
property: e.property,
index,
label: e.label,
visible: true
}
})
this.columns = obColumns(columns)
})
this.crud.updateProp('tableColumns', columns)
this.crud.updateProp('table', this.$refs.table)
}
}
}
......
......@@ -4,7 +4,7 @@
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-input v-model="query.name" clearable size="small" placeholder="请输入表名" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation>
<el-tooltip slot="right" class="item" effect="dark" content="数据库中表字段变动时使用该功能" placement="top-start">
......@@ -23,11 +23,11 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('tableName')" :show-overflow-tooltip="true" prop="tableName" label="表名" />
<el-table-column v-if="columns.visible('engine')" :show-overflow-tooltip="true" prop="engine" label="数据库引擎" />
<el-table-column v-if="columns.visible('coding')" :show-overflow-tooltip="true" prop="coding" label="字符编码集" />
<el-table-column v-if="columns.visible('remark')" :show-overflow-tooltip="true" prop="remark" label="备注" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期">
<el-table-column :show-overflow-tooltip="true" prop="tableName" label="表名" />
<el-table-column :show-overflow-tooltip="true" prop="engine" label="数据库引擎" />
<el-table-column :show-overflow-tooltip="true" prop="coding" label="字符编码集" />
<el-table-column :show-overflow-tooltip="true" prop="remark" label="备注" />
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -16,7 +16,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission">
<el-button
......@@ -64,12 +64,12 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row style="width: 100%" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('name')" prop="name" label="应用名称" />
<el-table-column v-if="columns.visible('port')" prop="port" label="端口号" />
<el-table-column v-if="columns.visible('uploadPath')" prop="uploadPath" label="上传目录" />
<el-table-column v-if="columns.visible('deployPath')" prop="deployPath" label="部署目录" />
<el-table-column v-if="columns.visible('backupPath')" prop="backupPath" label="备份目录" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期">
<el-table-column prop="name" label="应用名称" />
<el-table-column prop="port" label="端口号" />
<el-table-column prop="uploadPath" label="上传目录" />
<el-table-column prop="deployPath" label="部署目录" />
<el-table-column prop="backupPath" label="备份目录" />
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -16,7 +16,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission">
<el-button
......@@ -58,10 +58,10 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row stripe style="width: 100%" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('name')" prop="name" width="130px" label="数据库名称" />
<el-table-column v-if="columns.visible('jdbcUrl')" prop="jdbcUrl" label="连接地址" />
<el-table-column v-if="columns.visible('userName')" prop="userName" width="200px" label="用户名" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" width="200px" label="创建日期">
<el-table-column prop="name" width="130px" label="数据库名称" />
<el-table-column prop="jdbcUrl" label="连接地址" />
<el-table-column prop="userName" width="200px" label="用户名" />
<el-table-column prop="createTime" width="200px" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -16,7 +16,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission">
<template slot="right">
......@@ -98,9 +98,9 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row stripe style="width: 100%" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('app.name')" prop="app.name" label="应用名称" />
<el-table-column v-if="columns.visible('servers')" prop="servers" label="服务器列表" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="部署日期">
<el-table-column prop="app.name" label="应用名称" />
<el-table-column prop="servers" label="服务器列表" />
<el-table-column prop="createTime" label="部署日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -17,17 +17,17 @@
start-placeholder="部署开始日期"
end-placeholder="部署结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission" />
</div>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('appName')" prop="appName" label="应用名称" />
<el-table-column v-if="columns.visible('ip')" prop="ip" label="部署IP" />
<el-table-column v-if="columns.visible('deployUser')" prop="deployUser" label="部署人员" />
<el-table-column v-if="columns.visible('deployDate')" prop="deployDate" label="部署时间">
<el-table-column prop="appName" label="应用名称" />
<el-table-column prop="ip" label="部署IP" />
<el-table-column prop="deployUser" label="部署人员" />
<el-table-column prop="deployDate" label="部署时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.deployDate) }}</span>
</template>
......
......@@ -16,7 +16,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission" />
</div>
......@@ -48,11 +48,11 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('name')" prop="name" label="名称" />
<el-table-column v-if="columns.visible('ip')" prop="ip" label="IP" />
<el-table-column v-if="columns.visible('port')" prop="port" label="端口" />
<el-table-column v-if="columns.visible('account')" prop="account" label="账号" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期">
<el-table-column prop="name" label="名称" />
<el-table-column prop="ip" label="IP" />
<el-table-column prop="port" label="端口" />
<el-table-column prop="account" label="账号" />
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -13,7 +13,7 @@
@click="confirmDelAll()"
>
清空
</el-button> v-if="columns.visible('username')"
</el-button>
</crudOperation>
</div>
<!--表格渲染-->
......@@ -30,12 +30,12 @@
</el-form>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('username')" prop="username" label="用户名" />
<el-table-column v-if="columns.visible('requestIp')" prop="requestIp" label="IP" />
<el-table-column v-if="columns.visible('address')" :show-overflow-tooltip="true" prop="address" label="IP来源" />
<el-table-column v-if="columns.visible('description')" prop="description" label="描述" />
<el-table-column v-if="columns.visible('browser')" prop="browser" label="浏览器" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期">
<el-table-column prop="username" label="用户名" />
<el-table-column prop="requestIp" label="IP" />
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源" />
<el-table-column prop="description" label="描述" />
<el-table-column prop="browser" label="浏览器" />
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -30,19 +30,19 @@
</el-form>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('username')" prop="username" label="用户名" />
<el-table-column v-if="columns.visible('requestIp')" prop="requestIp" label="IP" />
<el-table-column v-if="columns.visible('address')" :show-overflow-tooltip="true" prop="address" label="IP来源" />
<el-table-column v-if="columns.visible('description')" prop="description" label="描述" />
<el-table-column v-if="columns.visible('browser')" prop="browser" label="浏览器" />
<el-table-column v-if="columns.visible('time')" prop="time" label="请求耗时" align="center">
<el-table-column prop="username" label="用户名" />
<el-table-column prop="requestIp" label="IP" />
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源" />
<el-table-column prop="description" label="描述" />
<el-table-column prop="browser" label="浏览器" />
<el-table-column prop="time" label="请求耗时" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
<el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag>
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期" width="180px">
<el-table-column prop="createTime" label="创建日期" width="180px">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -19,9 +19,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation
:crud="crud"
/>
<rrOperation />
</div>
</template>
......
......@@ -3,7 +3,7 @@
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-input v-model="query.filter" clearable size="small" placeholder="全表模糊搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation>
<el-button
......@@ -23,13 +23,13 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('userName')" prop="userName" label="用户名" />
<el-table-column v-if="columns.visible('nickName')" prop="nickName" label="用户昵称" />
<el-table-column v-if="columns.visible('job')" prop="job" label="岗位" />
<el-table-column v-if="columns.visible('ip')" prop="ip" label="登录IP" />
<el-table-column v-if="columns.visible('address')" :show-overflow-tooltip="true" prop="address" label="登录地点" />
<el-table-column v-if="columns.visible('browser')" prop="browser" label="浏览器" />
<el-table-column v-if="columns.visible('loginTime')" prop="loginTime" label="登录时间">
<el-table-column prop="userName" label="用户名" />
<el-table-column prop="nickName" label="用户昵称" />
<el-table-column prop="job" label="岗位" />
<el-table-column prop="ip" label="登录IP" />
<el-table-column :show-overflow-tooltip="true" prop="address" label="登录地点" />
<el-table-column prop="browser" label="浏览器" />
<el-table-column prop="loginTime" label="登录时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
......
......@@ -5,7 +5,7 @@
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input v-model="query.blurry" clearable size="small" placeholder="输入名称或者服务地址" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission" />
</div>
......@@ -33,7 +33,7 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('state')" prop="state" label="状态" width="50px">
<el-table-column prop="state" label="状态" width="50px">
<template slot-scope="scope">
<el-tag
:type="scope.row.state === '1' ? 'success' : 'info'"
......@@ -44,12 +44,12 @@
</el-tag>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('name')" prop="name" label="名称" />
<el-table-column v-if="columns.visible('address')" prop="address" label="地址" />
<el-table-column v-if="columns.visible('port')" prop="port" label="端口" width="80px" align="center" />
<el-table-column v-if="columns.visible('cpuRate')" :formatter="formatCpuRate" prop="cpuRate" label="CPU使用率" width="100px" align="center" />
<el-table-column v-if="columns.visible('cpuCore')" prop="cpuCore" label="CPU内核数" width="100px" align="center" />
<el-table-column v-if="columns.visible('memTotal')" prop="memTotal" label="物理内存" align="center">
<el-table-column prop="name" label="名称" />
<el-table-column prop="address" label="地址" />
<el-table-column prop="port" label="端口" width="80px" align="center" />
<el-table-column :formatter="formatCpuRate" prop="cpuRate" label="CPU使用率" width="100px" align="center" />
<el-table-column prop="cpuCore" label="CPU内核数" width="100px" align="center" />
<el-table-column prop="memTotal" label="物理内存" align="center">
<template slot-scope="scope">
<el-row>
<el-col :span="24">{{ formatMem(scope.row) }}</el-col>
......@@ -61,7 +61,7 @@
</el-row>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('diskTotal')" prop="diskTotal" :formatter="formatDisk" label="磁盘使用情况" align="center">
<el-table-column prop="diskTotal" :formatter="formatDisk" label="磁盘使用情况" align="center">
<template slot-scope="scope">
<el-row>
<el-col :span="24">{{ formatDisk(scope.row) }}</el-col>
......@@ -73,7 +73,7 @@
</el-row>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('swapTotal')" prop="swapTotal" label="交换空间" align="center">
<el-table-column prop="swapTotal" label="交换空间" align="center">
<template slot-scope="scope">
<el-row>
<el-col :span="24">{{ formatSwap(scope.row) }}</el-col>
......@@ -91,7 +91,7 @@
:data="scope.row"
:permission="permission"
/>
</template> v-if="columns.visible('name')"
</template>
</el-table-column>
</el-table>
<!--分页组件-->
......
......@@ -19,7 +19,7 @@
<el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 90px" @change="crud.toQuery">
<el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission" />
</div>
......@@ -44,8 +44,8 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" default-expand-all :data="crud.data" row-key="id" @select="crud.selectChange" @select-all="crud.selectAllChange" @selection-change="crud.selectionChangeHandler">
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column v-if="columns.visible('name')" label="名称" prop="name" />
<el-table-column v-if="columns.visible('enabled')" label="状态" align="center" prop="enabled">
<el-table-column label="名称" prop="name" />
<el-table-column label="状态" align="center" prop="enabled">
<template slot-scope="scope">
<el-switch
v-model="scope.row.enabled"
......@@ -56,7 +56,7 @@
/>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期">
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -8,18 +8,18 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('name')" prop="name" label="名称" />
<el-table-column v-if="columns.visible('dept')" prop="dept" label="所属部门">
<el-table-column prop="name" label="名称" />
<el-table-column prop="dept" label="所属部门">
<template slot-scope="scope">
<div>{{ scope.row.deptSuperiorName ? scope.row.deptSuperiorName + ' / ' : '' }}{{ scope.row.dept.name }}</div>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('sort')" prop="sort" label="排序">
<el-table-column prop="sort" label="排序">
<template slot-scope="scope">
{{ scope.row.sort }}
</template>
</el-table-column>
<el-table-column v-if="columns.visible('status')" prop="status" label="状态" align="center">
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.enabled"
......@@ -29,7 +29,7 @@
/>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期">
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -17,9 +17,7 @@
<el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 90px" @change="crud.toQuery">
<el-option v-for="item in dict.dict.job_status" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<rrOperation
:crud="crud"
/>
<rrOperation />
</div>
</template>
......
......@@ -16,7 +16,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission" />
</div>
......@@ -95,39 +95,39 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" row-key="id" @select="crud.selectChange" @select-all="crud.selectAllChange" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('name')" :show-overflow-tooltip="true" label="菜单名称" width="125px" prop="name" />
<el-table-column v-if="columns.visible('icon')" prop="icon" label="图标" align="center" width="60px">
<el-table-column :show-overflow-tooltip="true" label="菜单名称" width="125px" prop="name" />
<el-table-column prop="icon" label="图标" align="center" width="60px">
<template slot-scope="scope">
<svg-icon :icon-class="scope.row.icon" />
</template>
</el-table-column>
<el-table-column v-if="columns.visible('sort')" prop="sort" align="center" label="排序">
<el-table-column prop="sort" align="center" label="排序">
<template slot-scope="scope">
{{ scope.row.sort }}
</template>
</el-table-column>
<el-table-column v-if="columns.visible('path')" :show-overflow-tooltip="true" prop="path" label="路由地址" />
<el-table-column v-if="columns.visible('permission')" :show-overflow-tooltip="true" prop="permission" label="权限标识" />
<el-table-column v-if="columns.visible('component')" :show-overflow-tooltip="true" prop="component" label="组件路径" />
<el-table-column v-if="columns.visible('iframe')" prop="iframe" label="外链" width="75px">
<el-table-column :show-overflow-tooltip="true" prop="path" label="路由地址" />
<el-table-column :show-overflow-tooltip="true" prop="permission" label="权限标识" />
<el-table-column :show-overflow-tooltip="true" prop="component" label="组件路径" />
<el-table-column prop="iframe" label="外链" width="75px">
<template slot-scope="scope">
<span v-if="scope.row.iframe"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('cache')" prop="cache" label="缓存" width="75px">
<el-table-column prop="cache" label="缓存" width="75px">
<template slot-scope="scope">
<span v-if="scope.row.cache"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('hidden')" prop="hidden" label="可见" width="75px">
<el-table-column prop="hidden" label="可见" width="75px">
<template slot-scope="scope">
<span v-if="scope.row.hidden"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期" width="135px">
<el-table-column prop="createTime" label="创建日期" width="135px">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -16,7 +16,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission" />
</div>
......@@ -63,12 +63,12 @@
</div>
<el-table ref="table" v-loading="crud.loading" highlight-current-row style="width: 100%;" :data="crud.data" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange">
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column v-if="columns.visible('name')" prop="name" label="名称" />
<el-table-column v-if="columns.visible('dataScope')" prop="dataScope" label="数据权限" />
<el-table-column v-if="columns.visible('permission')" prop="permission" label="角色权限" />
<el-table-column v-if="columns.visible('level')" prop="level" label="角色级别" />
<el-table-column v-if="columns.visible('remark')" :show-overflow-tooltip="true" prop="remark" label="描述" />
<el-table-column v-if="columns.visible('createTime')" :show-overflow-tooltip="true" width="135px" prop="createTime" label="创建日期">
<el-table-column prop="name" label="名称" />
<el-table-column prop="dataScope" label="数据权限" />
<el-table-column prop="permission" label="角色权限" />
<el-table-column prop="level" label="角色级别" />
<el-table-column :show-overflow-tooltip="true" prop="remark" label="描述" />
<el-table-column :show-overflow-tooltip="true" width="135px" prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -16,7 +16,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission">
<!-- 任务日志 -->
......@@ -65,18 +65,18 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column v-if="columns.visible('jobName')" :show-overflow-tooltip="true" prop="jobName" width="100px" label="任务名称" />
<el-table-column v-if="columns.visible('beanName')" :show-overflow-tooltip="true" prop="beanName" label="Bean名称" />
<el-table-column v-if="columns.visible('methodName')" :show-overflow-tooltip="true" prop="methodName" width="90px" label="执行方法" />
<el-table-column v-if="columns.visible('params')" :show-overflow-tooltip="true" prop="params" width="80px" label="参数" />
<el-table-column v-if="columns.visible('cronExpression')" :show-overflow-tooltip="true" prop="cronExpression" width="100px" label="cron表达式" />
<el-table-column v-if="columns.visible('isPause')" :show-overflow-tooltip="true" prop="isPause" width="90px" label="状态">
<el-table-column :show-overflow-tooltip="true" prop="jobName" width="100px" label="任务名称" />
<el-table-column :show-overflow-tooltip="true" prop="beanName" label="Bean名称" />
<el-table-column :show-overflow-tooltip="true" prop="methodName" width="90px" label="执行方法" />
<el-table-column :show-overflow-tooltip="true" prop="params" width="80px" label="参数" />
<el-table-column :show-overflow-tooltip="true" prop="cronExpression" width="100px" label="cron表达式" />
<el-table-column :show-overflow-tooltip="true" prop="isPause" width="90px" label="状态">
<template slot-scope="scope">
<el-tag :type="scope.row.isPause ? 'warning' : 'success'">{{ scope.row.isPause ? '已暂停' : '运行中' }}</el-tag>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('remark')" :show-overflow-tooltip="true" prop="remark" label="描述" />
<el-table-column v-if="columns.visible('createTime')" :show-overflow-tooltip="true" prop="createTime" label="创建日期">
<el-table-column :show-overflow-tooltip="true" prop="remark" label="描述" />
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -64,7 +64,7 @@
:value="item.key"
/>
</el-select>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation show="" :permission="permission" />
</div>
......@@ -144,17 +144,17 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column v-if="columns.visible('username')" :show-overflow-tooltip="true" prop="username" label="用户名" />
<el-table-column v-if="columns.visible('nickName')" :show-overflow-tooltip="true" prop="nickName" label="昵称" />
<el-table-column v-if="columns.visible('sex')" prop="sex" label="性别" />
<el-table-column v-if="columns.visible('phone')" :show-overflow-tooltip="true" prop="phone" width="100" label="电话" />
<el-table-column v-if="columns.visible('email')" :show-overflow-tooltip="true" width="125" prop="email" label="邮箱" />
<el-table-column v-if="columns.visible('dept')" :show-overflow-tooltip="true" width="110" prop="dept" label="部门 / 岗位">
<el-table-column :show-overflow-tooltip="true" prop="username" label="用户名" />
<el-table-column :show-overflow-tooltip="true" prop="nickName" label="昵称" />
<el-table-column prop="sex" label="性别" />
<el-table-column :show-overflow-tooltip="true" prop="phone" width="100" label="电话" />
<el-table-column :show-overflow-tooltip="true" width="125" prop="email" label="邮箱" />
<el-table-column :show-overflow-tooltip="true" width="110" prop="dept" label="部门 / 岗位">
<template slot-scope="scope">
<div>{{ scope.row.dept.name }} / {{ scope.row.job.name }}</div>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('enabled')" label="状态" align="center" prop="enabled">
<el-table-column label="状态" align="center" prop="enabled">
<template slot-scope="scope">
<el-switch
v-model="scope.row.enabled"
......@@ -165,7 +165,7 @@
/>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('createTime')" :show-overflow-tooltip="true" prop="createTime" width="140" label="创建日期">
<el-table-column :show-overflow-tooltip="true" prop="createTime" width="140" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -16,7 +16,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission">
<!-- 上传 -->
......@@ -66,9 +66,9 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('filename')" width="200" prop="filename" label="文件名" />
<el-table-column v-if="columns.visible('username')" prop="username" label="上传者" />
<el-table-column v-if="columns.visible('url')" ref="table" :show-overflow-tooltip="true" prop="url" label="缩略图">
<el-table-column width="200" prop="filename" label="文件名" />
<el-table-column prop="username" label="上传者" />
<el-table-column ref="table" :show-overflow-tooltip="true" prop="url" label="缩略图">
<template slot-scope="{row}">
<el-image
:src="row.url"
......@@ -79,10 +79,10 @@
/>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('size')" prop="size" label="文件大小" />
<el-table-column v-if="columns.visible('height')" prop="height" label="高度" />
<el-table-column v-if="columns.visible('width')" prop="width" label="宽度" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期">
<el-table-column prop="size" label="文件大小" />
<el-table-column prop="height" label="高度" />
<el-table-column prop="width" label="宽度" />
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -16,7 +16,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission">
<!-- 新增 -->
......@@ -64,7 +64,7 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('name')" prop="name" label="文件名">
<el-table-column prop="name" label="文件名">
<template slot-scope="scope">
<el-popover
:content="'file/' + scope.row.type + '/' + scope.row.realName"
......@@ -85,7 +85,7 @@
</el-popover>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('path')" prop="path" label="预览图">
<el-table-column prop="path" label="预览图">
<template slot-scope="{row}">
<el-image
:src=" baseApi + '/file/' + row.type + '/' + row.realName"
......@@ -100,11 +100,11 @@
</el-image>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('suffix')" prop="suffix" label="文件类型" />
<el-table-column v-if="columns.visible('type')" prop="type" label="类别" />
<el-table-column v-if="columns.visible('size')" prop="size" label="大小" />
<el-table-column v-if="columns.visible('operate')" prop="operate" label="操作人" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建日期">
<el-table-column prop="suffix" label="文件类型" />
<el-table-column prop="type" label="类别" />
<el-table-column prop="size" label="大小" />
<el-table-column prop="operate" label="操作人" />
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -18,7 +18,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<rrOperation :crud="crud" />
<rrOperation />
</div>
<crudOperation :permission="permission">
<template slot="left">
......@@ -58,16 +58,16 @@
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('name')" prop="name" :show-overflow-tooltip="true" label="文件名">
<el-table-column prop="name" :show-overflow-tooltip="true" label="文件名">
<template slot-scope="scope">
<a href="JavaScript:" class="el-link el-link--primary" target="_blank" type="primary" @click="download(scope.row.id)">{{ scope.row.key }}</a>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('suffix')" :show-overflow-tooltip="true" prop="suffix" label="文件类型" @selection-change="crud.selectionChangeHandler" />
<el-table-column v-if="columns.visible('bucket')" prop="bucket" label="空间名称" />
<el-table-column v-if="columns.visible('size')" prop="size" label="文件大小" />
<el-table-column v-if="columns.visible('type')" prop="type" label="空间类型" />
<el-table-column v-if="columns.visible('updateTime')" prop="updateTime" label="创建日期">
<el-table-column :show-overflow-tooltip="true" prop="suffix" label="文件类型" @selection-change="crud.selectionChangeHandler" />
<el-table-column prop="bucket" label="空间名称" />
<el-table-column prop="size" label="文件大小" />
<el-table-column prop="type" label="空间类型" />
<el-table-column prop="updateTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment