init 二期ACS
This commit is contained in:
132
acs2/nladmin-ui/src/views/acs/device/address/index.vue
Normal file
132
acs2/nladmin-ui/src/views/acs/device/address/index.vue
Normal file
@@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item :label="$t('opc.placeholder.name_code')">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
size="small"
|
||||
clearable
|
||||
:placeholder="$t('device.placeholder.enter_name_code')"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="600px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item :label="$t('address.methods_code')" prop="methods_code">
|
||||
<el-input v-model="form.methods_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('address.methods_name')" prop="methods_name">
|
||||
<el-input v-model="form.methods_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('address.methods_url')" prop="methods_url">
|
||||
<el-input v-model="form.methods_url" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('address.remark')">
|
||||
<el-input v-model="form.remark" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="methods_code" :label="$t('address.methods_code')" />
|
||||
<el-table-column prop="methods_name" :label="$t('address.methods_name')" />
|
||||
<el-table-column prop="methods_url" :label="$t('address.methods_url')" />
|
||||
<el-table-column prop="remark" :label="$t('address.remark')" />
|
||||
<el-table-column v-permission="['admin','Address:edit','Address:del']" :label="$t('auto.common.Cancel')" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudAddress from '@/api/acs/Address'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
const defaultForm = { methods_id: null, methods_code: null, methods_name: null, methods_url: null, remark: null, create_by: null, create_time: null, update_by: null, update_time: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Address',
|
||||
// eslint-disable-next-line vue/no-unused-components
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: i18n.t('address.title'), url: 'api/Address', idField: 'methods_id', sort: 'methods_id,desc', crudMethod: { ...crudAddress }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'Address:add'],
|
||||
edit: ['admin', 'Address:edit'],
|
||||
del: ['admin', 'Address:del']
|
||||
},
|
||||
rules: {
|
||||
methods_id: [
|
||||
{ required: true, message: '方法标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
methods_code: [
|
||||
{ required: true, message: '方法编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
methods_name: [
|
||||
{ required: true, message: '方法名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
methods_url: [
|
||||
{ required: true, message: '请求地址不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_by: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_time: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_delete: [
|
||||
{ required: true, message: '是否删除不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user