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

feat: 组件优化

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