Commit 90a0dc8d authored by 水落(YangLei)'s avatar 水落(YangLei)

feat: 组件优化

parent 7aa0fe42
import Table from './table/index.vue';
import WhiteCard from './white_card/index.vue';
import Upload from './upload/index.vue';
import MyFormItem from './table/my_item.vue';
export { Table, WhiteCard, Upload };
export { Table, WhiteCard, Upload, MyFormItem };
<template>
<a-col v-bind="span">
<a-form-model-item v-bind="layout">
<slot />
<slot class="tw-w-full" />
</a-form-model-item>
</a-col>
</template>
......@@ -16,6 +16,3 @@ export default {
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<my-table url="/api/v1/logger/login" rowKey="logId" ref="table">
<template #search="{query}">
<a-form-model-item label="开始时间">
<a-date-picker show-time v-model="query.startTime" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-model-item>
<a-form-model-item label="结束时间">
<a-date-picker show-time v-model="query.endTime" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-model-item>
<a-form-model-item label="登录用户">
<my-form-item label="开始时间">
<a-date-picker
class="tw-w-full"
show-time
v-model="query.startTime"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</my-form-item>
<my-form-item label="结束时间">
<a-date-picker
class="tw-w-full"
show-time
v-model="query.endTime"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</my-form-item>
<my-form-item label="登录用户">
<a-input v-model="query.userId" />
</a-form-model-item>
<a-form-model-item label="登录IP">
</my-form-item>
<my-form-item label="登录IP">
<a-input v-model="query.loginIp" />
</a-form-model-item>
<a-form-model-item label="事件类型">
<a-select v-model="query.loginType" style="width: 170px" allowClear>
</my-form-item>
<my-form-item label="事件类型">
<a-select v-model="query.loginType" allowClear>
<a-select-option value="LOGIN">登录系统</a-select-option>
<a-select-option value="LOGOUT">退出系统</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="事件状态">
<a-select v-model="query.isSuccess" style="width: 170px" allowClear>
</my-form-item>
<my-form-item label="事件状态">
<a-select v-model="query.isSuccess" allowClear>
<a-select-option value="0">失败</a-select-option>
<a-select-option value="1">成功</a-select-option>
</a-select>
</a-form-model-item>
</my-form-item>
</template>
<a-table-column title="用户Id" data-index="userId" />
<a-table-column title="登录用户" data-index="userName" />
......
......@@ -4,12 +4,12 @@
<Form ref="form" />
</template>
<template #search="{ query }">
<MyFormModelItem label="归属部门">
<my-form-item label="归属部门">
<OrganizationTree v-model="query.orgId" />
</MyFormModelItem>
<MyFormModelItem label="账号">
</my-form-item>
<my-form-item label="账号">
<a-input placeholder="Basic usage" v-model="query.loginId" />
</MyFormModelItem>
</my-form-item>
</template>
<a-table-column title="账号" data-index="loginId" />
......@@ -31,10 +31,10 @@
<script>
import Form from './form.vue';
import PopconfirmDelete from '@/components/popconfirm_delete/index.vue';
import MyFormModelItem from '@/components/table/my_item.vue';
import OrganizationTree from '../components/OrganizationTree.vue';
export default {
components: { Form, PopconfirmDelete, OrganizationTree, MyFormModelItem },
components: { Form, PopconfirmDelete, OrganizationTree },
data() {
return {
addBtn: { width: 600, onOk: () => this.$refs['form']?.submit() },
......@@ -53,4 +53,4 @@ export default {
},
},
};
</script>
\ No newline at end of file
</script>
......@@ -53,7 +53,6 @@ export default {
},
watch: {
'$store.state.userInfo'(userInfo) {
console.log('userInfo');
this.form.userName = userInfo.userName;
this.form.fixedPhone = userInfo.fixedPhone;
this.form.mobilePhone = userInfo.mobilePhone;
......
import VueI18nPlugin from './vueI18nPlugin';
import AuthorityPlugin from './authorityPlugin';
import TabsPagePlugin from './tabsPagePlugin';
import { Table, WhiteCard, Upload } from '@/components';
import { Table, WhiteCard, Upload, MyFormItem } from '@/components';
const Plugins = {
install: function(Vue) {
......@@ -11,6 +11,7 @@ const Plugins = {
Vue.component('my-table', Table);
Vue.component('my-card', WhiteCard);
Vue.component('my-upload', Upload);
Vue.component('my-form-item', MyFormItem);
},
};
export default Plugins;
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