refactor: 前端驼峰转下划线

This commit is contained in:
2024-01-27 15:41:13 +08:00
parent 1c6f2bd7be
commit 29ca5f703c
18 changed files with 496 additions and 400 deletions

View File

@@ -1,7 +1,14 @@
<template>
<div class="app-container">
<!--表单组件-->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-dialog
append-to-body
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible="crud.status.cu > 0"
:title="crud.status.title"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="字典编码" prop="code">
<el-input v-model="form.code" style="width: 370px;" />
@@ -23,7 +30,15 @@
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input v-model="query.blurry" clearable size="mini" placeholder="输入名称或者描述搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<el-input
v-model="query.blurry"
clearable
size="mini"
placeholder="输入名称或者描述搜索"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation />
</div>
<crudOperation :permission="permission" />
@@ -36,11 +51,18 @@
highlight-current-row
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange">
@current-change="handleCurrentChange"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="code" label="编码" />
<el-table-column show-overflow-tooltip prop="name" label="名称" />
<el-table-column v-permission="['admin','dict:edit','dict:del']" label="操作" width="130px" align="center" fixed="right">
<el-table-column
v-permission="['admin','dict:edit','dict:del']"
label="操作"
width="130px"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
:data="scope.row"
@@ -66,7 +88,8 @@
type="primary"
icon="el-icon-plus"
@click="$refs.dictDetail && $refs.dictDetail.crud.toAdd()"
>新增</el-button>
>新增
</el-button>
</div>
<dictDetail ref="dictDetail" :permission="permission" />
</el-card>
@@ -86,14 +109,25 @@ import pagination from '@crud/Pagination'
import rrOperation from '@crud/RR.operation'
import udOperation from '@crud/UD.operation'
const defaultForm = { dictId: null, code: null, name: null, label: null, value: null, dictSort: null, dictType: null, para1: null, para2: null, para3: null, createId: null, createName: null, createTime: null, updateId: null, updateName: null, updateTime: null }
const defaultForm = {
dict_id: null,
code: null,
name: null,
label: null,
value: null,
dict_sort: null,
dict_type: null,
para1: null,
para2: null,
para3: null
}
export default {
name: 'Dict',
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
cruds() {
return [
CRUD({ title: '字典', url: 'api/dict', idField: 'dictId', crudMethod: { ...crudDict }})
CRUD({ title: '字典', url: 'api/dict', idField: 'dict_id', crudMethod: { ...crudDict }})
]
},
mixins: [presenter(), header(), form(defaultForm)],