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

代码优化

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