diff --git a/src/layout/components/el-data-table/components/el-data-table-column.js b/src/components/el-data-table/components/el-data-table-column.js similarity index 100% rename from src/layout/components/el-data-table/components/el-data-table-column.js rename to src/components/el-data-table/components/el-data-table-column.js diff --git a/src/layout/components/el-data-table/components/self-loading-button.vue b/src/components/el-data-table/components/self-loading-button.vue similarity index 100% rename from src/layout/components/el-data-table/components/self-loading-button.vue rename to src/components/el-data-table/components/self-loading-button.vue diff --git a/src/layout/components/el-data-table/components/text-button.vue b/src/components/el-data-table/components/text-button.vue similarity index 100% rename from src/layout/components/el-data-table/components/text-button.vue rename to src/components/el-data-table/components/text-button.vue diff --git a/src/layout/components/el-data-table/components/the-dialog.vue b/src/components/el-data-table/components/the-dialog.vue similarity index 100% rename from src/layout/components/el-data-table/components/the-dialog.vue rename to src/components/el-data-table/components/the-dialog.vue diff --git a/src/layout/components/el-data-table/el-data-table.md b/src/components/el-data-table/el-data-table.md similarity index 100% rename from src/layout/components/el-data-table/el-data-table.md rename to src/components/el-data-table/el-data-table.md diff --git a/src/layout/components/el-data-table/el-data-table.vue b/src/components/el-data-table/el-data-table.vue similarity index 91% rename from src/layout/components/el-data-table/el-data-table.vue rename to src/components/el-data-table/el-data-table.vue index 907197391..ab4d640d2 100644 --- a/src/layout/components/el-data-table/el-data-table.vue +++ b/src/components/el-data-table/el-data-table.vue @@ -9,7 +9,7 @@ - - - + @slot 额外的搜索内容, 当searchForm不满足需求时可以使用--> + - + @@ -66,10 +66,58 @@ :disabled="selected.length === 0 || (single && selected.length > 1)" @click="onDefaultDelete(single ? selected[0] : selected)" >{{ deleteText }} - + + + + 更多菜单 + + + 批量删除 + 批量更新 + 禁用所选 + 激活所选 + + + + + + CSV + + + 上传 + 下载 + 更新 + + + + + + + + + 查询 + 重置 + + - diff --git a/src/layout/components/index.js b/src/layout/components/index.js index aec829fbb..748a8db5f 100644 --- a/src/layout/components/index.js +++ b/src/layout/components/index.js @@ -4,6 +4,5 @@ export { default as AppMain } from './AppMain' export { default as Page } from './Page' export { default as ListTables } from './ListTables' export { default as TagsView } from './TagsView' -export { default as ElDataTable } from './el-data-table' export { default as Footer } from './Footer' export { default as IBox } from './IBox' diff --git a/src/main.js b/src/main.js index 2bba465ae..14bd30106 100644 --- a/src/main.js +++ b/src/main.js @@ -36,8 +36,8 @@ Vue.use(ElementUI, { locale }) Vue.config.productionTip = false -import ElDataTable from '@/layout/components/el-data-table/el-data-table.vue' -import ElFormRenderer from '@/layout/components/el-form-renderer/el-form-renderer.vue' +import ElDataTable from '@/components/el-data-table/el-data-table.vue' +import ElFormRenderer from '@/components/el-form-renderer/el-form-renderer.vue' import { Message, MessageBox diff --git a/src/views/users/UserList.vue b/src/views/users/UserList.vue index e9c549dd8..105354766 100644 --- a/src/views/users/UserList.vue +++ b/src/views/users/UserList.vue @@ -1,20 +1,6 @@ @@ -41,6 +27,8 @@ export default { hasEdit: false, // 有编辑按钮 newText: '创建', hasDelete: false, + hasAction: true, // 是否有更多操作 + hasUpload: false, hasNew: true, // editText: this.$t('action.update'), // 编辑按钮文案 tableAttrs: { @@ -67,6 +55,15 @@ export default { } } ], + searchForm: [ + { + type: 'input', + id: 'search', // 发起请求附带的查询参数 + width: '200px', + el: { placeholder: '搜索', clearable: true, size: 'small' }, + rules: [{ required: false, trigger: 'blur', max: 12 }] + } + ], columns: [ { type: 'selection' }, // Bug @@ -74,7 +71,8 @@ export default { { prop: 'name', label: this.$t('users.name'), - sortable: true // 可排序 + sortable: true, // 可排序 + url: 'UserDetail' // 第一个函数指定 路由Template }, { prop: 'username', @@ -104,7 +102,9 @@ export default { created() { }, methods: { - + onNew: () => { + alert('创建') + } } }