提交 5a2fec14 authored 作者: matian's avatar matian

代码优化

上级 9e146e71
<template> <template>
<app-card> <app-list v-bind="tableOptions" ref="list">
<app-list v-bind="tableOptions" ref="list"> <template>
<template> <el-row style="margin-bottom: 20px">
<el-row style="margin-bottom: 20px"> <el-button type="primary" icon="el-icon-plus" size="mini" @click="isShowDialog = true" v-if="btnCreate"
<el-button type="primary" icon="el-icon-plus" size="mini" @click="isShowDialog = true" v-if="btnCreate" >添加客户</el-button
>添加客户</el-button >
> </el-row>
</el-row> </template>
</template> <template v-slot:table-x="{ row }">
<template v-slot:table-x="{ row }"> <el-button type="text" @click="onRemove(row)" v-if="btnDelete">删除</el-button>
<el-button type="text" @click="onRemove(row)" v-if="btnDelete">删除</el-button> </template>
</template>
</app-list>
<AddCustomer :visible.sync="isShowDialog" @success="success" :id="id" /> <AddCustomer :visible.sync="isShowDialog" @success="success" :id="id" />
</app-card> </app-list>
</template> </template>
<script> <script>
......
<template> <template>
<app-card> <app-list v-bind="tableOptions" ref="list">
<app-list v-bind="tableOptions" ref="list"> <template>
<template> <el-row style="margin-bottom: 20px">
<el-row style="margin-bottom: 20px"> <el-button type="primary" icon="el-icon-plus" size="mini" @click="isShowDialog = true" v-if="btnCreate"
<el-button type="primary" icon="el-icon-plus" size="mini" @click="isShowDialog = true" v-if="btnCreate" >添加员工</el-button
>添加员工</el-button >
> </el-row>
</el-row> </template>
</template> <template v-slot:table-x="{ row }">
<template v-slot:table-x="{ row }"> <el-button type="text" @click="onRemove(row)" v-if="btnDelete">删除</el-button>
<el-button type="text" @click="onRemove(row)" v-if="btnDelete">删除</el-button> </template>
</template>
</app-list>
<AddEmployees :visible.sync="isShowDialog" @success="success" :id="id" v-if="isShowDialog" /> <AddEmployees :visible.sync="isShowDialog" @success="success" :id="id" v-if="isShowDialog" />
</app-card> </app-list>
</template> </template>
<script> <script>
import AppList from '@/components/base/AppList.vue'
import AppCard from '@/components/base/AppCard.vue'
import AddEmployees from '../components/AddEmployees.vue' import AddEmployees from '../components/AddEmployees.vue'
import { employeeDetail, delEmployee } from '../api' import { employeeDetail, delEmployee } from '../api'
export default { export default {
...@@ -27,7 +23,7 @@ export default { ...@@ -27,7 +23,7 @@ export default {
isShowDialog: false isShowDialog: false
} }
}, },
components: { AppList, AppCard, AddEmployees }, components: { AddEmployees },
props: { props: {
id: { id: {
type: String, type: String,
......
<template> <template>
<div> <app-card>
<el-card> <h4 class="title" style="margin-bottom: 20px">{{ title || '' }}</h4>
<h4 class="title" style="margin-bottom: 20px">{{ title || '' }}</h4> <el-tabs v-model="tabsActive">
<el-tabs v-model="tabsActive"> <el-tab-pane label="客户" name="customer"> <Customer :id="id" /> </el-tab-pane>
<el-tab-pane label="客户" name="customer"> <Customer :id="id" /> </el-tab-pane> <el-tab-pane label="员工" name="employees" lazy><Employees :id="id" /> </el-tab-pane>
<el-tab-pane label="员工" name="employees" lazy><Employees :id="id" /> </el-tab-pane> </el-tabs>
</el-tabs> </app-card>
</el-card>
</div>
</template> </template>
<script> <script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论