HistoryDetail.vue
3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<template>
<BasicDrawer
v-bind="$attrs"
title="操作记录"
width="60%"
:isDetail="true"
:showDetailBack="false"
okText="保存"
>
<Tabs animated>
<template v-for="i in achieveList" :key="i.key">
<TabPane :tab="i.name" />
</template>
</Tabs>
<PageWrapper class="prefixCls">
<a-list :pagination="pagination" style="width: 100%">
<template v-for="item in list" :key="item.id">
<a-list-item class="list">
<a-list-item-meta>
<template #avatar>
<!-- <Icon class="icon" v-if="item.icon" :icon="item.icon" :color="item.color" /> -->
</template>
<template #title>
<!-- <span>{{ item.title }}</span> -->
<span>操作人</span>
<!-- <div class="extra" v-if="item.extra">
{{ item.extra }}
</div> -->
</template>
<template #description>
<div class="description">
<!-- {{ item.description }} -->
干了什么
</div>
<div class="info">
<div><span>操作时间</span>{{ item.datetime }}</div>
</div>
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
</PageWrapper>
<!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> -->
<template #appendFooter>
<!-- <a-button type="primary" @click="onGoCheckDetail"> 申请权限</a-button> -->
</template>
</BasicDrawer>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { Tabs, Progress, Row, Col, List } from 'ant-design-vue';
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
import { cardList } from './data';
import { PageWrapper } from '/@/components/Page';
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
const schemas: FormSchema[] = [
{
field: '订单号',
component: 'Input',
label: '字段1',
componentProps: {
readonly: true,
disabled: true,
},
colProps: {
span: 12,
},
defaultValue: '111',
},
{
field: 'field2',
component: 'Input',
label: '字段2',
colProps: {
span: 12,
},
},
];
const achieveList = [
{
key: '1',
name: '编辑记录',
},
{
key: '2',
name: '审批记录',
},
];
export default defineComponent({
components: {
BasicDrawer,
Tabs,
[List.name]: List,
[List.Item.name]: List.Item,
AListItemMeta: List.Item.Meta,
PageWrapper,
},
props: {
onGoCheckDetail: {
type: Function,
},
},
setup() {
const [registerForm, { setFieldsValue }] = useForm({
labelWidth: 120,
schemas,
showActionButtonGroup: false,
actionColOptions: {
span: 24,
},
});
const [register] = useDrawerInner((data) => {
// 方式1
setFieldsValue({
field2: data.data,
field1: data.info,
});
});
return {
register,
schemas,
registerForm,
achieveList,
list: cardList,
prefixCls: 'account-center',
pagination: {
show: true,
pageSize: 3,
},
};
},
});
</script>
<style lang="less" scoped>
.account-center {
&-bottom {
margin: 0 16px 16px;
padding: 10px;
border-radius: 3px;
background-color: @component-background;
}
}
</style>