Commit d90077fe authored by 陈浩玮's avatar 陈浩玮

组件修改

parent 68b039f8
<template>
<a-drawer
placement="right"
:visible="visible"
:visible="value"
:drawerStyle="drawerStyle"
:bodyStyle="bodyStyle"
destroyOnClose
:width="600"
v-bind="$attrs"
v-on="$listeners"
@close="onClose"
>
<div class="tw-overflow-y-hidden">
<div class="tw-overflow-y-hidden tw-flex-1">
<div class="tw-overflow-y-auto tw-h-full">
<slot />
</div>
</div>
<template>
<a-divider />
<a-space>
<slot name="footer">
<a-space class="tw-justify-end">
<a-button @click="cancel">取消</a-button>
<slot name="footer">
<a-button type="primary" @click="ok" :loading="loading">确认</a-button>
</slot>
</a-space>
......@@ -29,6 +32,11 @@ export default {
props: {
oncancel: Function,
onok: Function,
value: Boolean,
},
model: {
prop: 'value',
event: 'change',
},
data() {
return {
......@@ -48,15 +56,12 @@ export default {
};
},
methods: {
show() {
this.visiable = true;
},
hidden() {
this.visiable = false;
},
cancel() {
this.oncancel && this.oncancel();
this.visiable = false;
this.$emit('change', false);
},
onClose() {
this.cancel();
},
async ok() {
this.loading = true;
......
......@@ -63,7 +63,7 @@
</div>
<template v-if="!noFooter">
<a-divider />
<a-space>
<a-space class="tw-justify-end">
<a-button @click="addVisible = false">取消</a-button>
<a-button type="primary" @click="submit" :loading="submitLoading"> 确认 </a-button>
</a-space>
......
<template>
<div>
<my-table url="/api/v1/users" rowKey="userId" ref="table">
<template #drawer>
<Form ref="form" />
</template>
<template #search="{ query }">
<my-form-item label="归属部门">
<OrganizationTree v-model="query.orgId" />
......@@ -12,7 +10,7 @@
</my-form-item>
</template>
<template #buttons>
<a-button type="primary">新增</a-button>
<a-button type="primary" @click="onAdd">新增</a-button>
</template>
<a-table-column title="账号" data-index="loginId" />
......@@ -24,13 +22,12 @@
<a-table-column title="是否锁定" data-index="isLockedName" />
<a-table-column title="操作">
<template #default="row">
<!-- <a @click="() => view(row, 1)">编辑</a>
<a-divider type="vertical" />
<PopconfirmDelete :url="`/api/v1/jobs/${row.jobId}`" :cb="refreshTable" /> -->
<ActionButton :buttons="buttons" :row="row" />
</template>
</a-table-column>
</my-table>
<Form ref="form" />
</div>
</template>
<script>
import Form from './form.vue';
......@@ -103,6 +100,9 @@ export default {
refreshTable() {
this.$refs['table']?.getData();
},
onAdd() {
this.$refs['form']?.open();
},
// view(data, type) {
// this.$refs['table']?.show({ type });
// this.$nextTick(() => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment