代码优化
This commit is contained in:
parent
895864b88d
commit
c5a8c4e7ad
@ -31,8 +31,6 @@ function CRUD(options) {
|
|||||||
form: {},
|
form: {},
|
||||||
// 重置表单
|
// 重置表单
|
||||||
defaultForm: () => {},
|
defaultForm: () => {},
|
||||||
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
|
|
||||||
sort: ['id,desc'],
|
|
||||||
// 等待时间
|
// 等待时间
|
||||||
time: 50,
|
time: 50,
|
||||||
// CRUD Method
|
// CRUD Method
|
||||||
@ -350,7 +348,6 @@ function CRUD(options) {
|
|||||||
return {
|
return {
|
||||||
current: crud.page.page,
|
current: crud.page.page,
|
||||||
size: crud.page.size,
|
size: crud.page.size,
|
||||||
sort: crud.sort,
|
|
||||||
...crud.query,
|
...crud.query,
|
||||||
...crud.params
|
...crud.params
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
// 表格数据
|
// 表格数据
|
||||||
data: [],
|
data: [],
|
||||||
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
|
|
||||||
sort: ['id,desc'],
|
|
||||||
// 页码
|
// 页码
|
||||||
page: 1,
|
page: 1,
|
||||||
// 每页数据条数
|
// 每页数据条数
|
||||||
@ -85,7 +83,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
current: this.page,
|
current: this.page,
|
||||||
size: this.size,
|
size: this.size,
|
||||||
sort: this.sort,
|
|
||||||
...this.query,
|
...this.query,
|
||||||
...this.params
|
...this.params
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,6 @@ export default {
|
|||||||
if (this.deployId === '') {
|
if (this.deployId === '') {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
this.sort = 'deployDate,desc'
|
|
||||||
this.params['deployId'] = this.deployId
|
this.params['deployId'] = this.deployId
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
@ -66,7 +66,7 @@ export default {
|
|||||||
components: { pagination, rrOperation, udOperation },
|
components: { pagination, rrOperation, udOperation },
|
||||||
cruds() {
|
cruds() {
|
||||||
return [
|
return [
|
||||||
CRUD({ title: '字典详情', url: 'api/dictDetail', query: { dictName: '' }, sort: ['dictSort,asc', 'id,desc'],
|
CRUD({ title: '字典详情', url: 'api/dictDetail', query: { dictName: '' },
|
||||||
crudMethod: { ...crudDictDetail },
|
crudMethod: { ...crudDictDetail },
|
||||||
optShow: {
|
optShow: {
|
||||||
add: true,
|
add: true,
|
||||||
|
@ -63,7 +63,6 @@ export default {
|
|||||||
return CRUD({
|
return CRUD({
|
||||||
title: '岗位',
|
title: '岗位',
|
||||||
url: 'api/job',
|
url: 'api/job',
|
||||||
sort: ['jobSort,asc', 'id,desc'],
|
|
||||||
crudMethod: { ...crudJob }
|
crudMethod: { ...crudJob }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -135,7 +135,7 @@ export default {
|
|||||||
name: 'Role',
|
name: 'Role',
|
||||||
components: { Treeselect, pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
components: { Treeselect, pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({ title: '角色', url: 'api/roles', sort: 'level,asc', crudMethod: { ...crudRoles }})
|
return CRUD({ title: '角色', url: 'api/roles', crudMethod: { ...crudRoles }})
|
||||||
},
|
},
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
data() {
|
data() {
|
||||||
|
@ -59,13 +59,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<crudOperation show="" :permission="permission">
|
<crudOperation show="" :permission="permission">
|
||||||
<el-button
|
<el-button
|
||||||
|
slot="right"
|
||||||
v-permission="['admin','user:add']"
|
v-permission="['admin','user:add']"
|
||||||
:disabled="crud.selections.length === 0"
|
:disabled="crud.selections.length === 0"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-refresh-left"
|
icon="el-icon-refresh-left"
|
||||||
slot="right"
|
|
||||||
@click="resetPwd(crud.selections)"
|
@click="resetPwd(crud.selections)"
|
||||||
>重置密码
|
>重置密码
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -376,8 +376,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取左侧部门数据
|
// 获取左侧部门数据
|
||||||
getDeptDatas(node, resolve) {
|
getDeptDatas(node, resolve) {
|
||||||
const sort = 'id,desc'
|
const params = {}
|
||||||
const params = { sort: sort }
|
|
||||||
if (typeof node !== 'object') {
|
if (typeof node !== 'object') {
|
||||||
if (node) {
|
if (node) {
|
||||||
params['name'] = node
|
params['name'] = node
|
||||||
|
Loading…
Reference in New Issue
Block a user