|
@@ -3,10 +3,7 @@
|
|
|
<n-card title="权限管理" :bordered="false" class="rounded-16px shadow-sm">
|
|
|
<n-space class="pb-12px" justify="space-between">
|
|
|
<n-space>
|
|
|
- <n-button type="primary">
|
|
|
- <icon-ic-round-plus class="mr-4px text-20px" />
|
|
|
- 新增
|
|
|
- </n-button>
|
|
|
+ <AddView />
|
|
|
<n-button type="error">
|
|
|
<icon-ic-round-delete class="mr-4px text-20px" />
|
|
|
删除
|
|
@@ -21,9 +18,17 @@
|
|
|
<icon-mdi-refresh class="mr-4px text-16px" :class="{ 'animate-spin': false }" />
|
|
|
刷新表格
|
|
|
</n-button>
|
|
|
+ <n-button size="small" type="primary">
|
|
|
+ <icon-mdi-refresh class="mr-4px text-16px" :class="{ 'animate-spin': false }" />
|
|
|
+ 激活
|
|
|
+ </n-button>
|
|
|
<column-setting v-model:columns="columns" />
|
|
|
</n-space>
|
|
|
</n-space>
|
|
|
+ <n-input-group>
|
|
|
+ <n-input :style="{ width: '50%' }" />
|
|
|
+ <n-button type="primary">搜索</n-button>
|
|
|
+ </n-input-group>
|
|
|
<n-data-table :columns="columns" :data="tableData" :pagination="pagination" />
|
|
|
</n-card>
|
|
|
</div>
|
|
@@ -33,11 +38,34 @@
|
|
|
import { ref, reactive } from 'vue';
|
|
|
import type { Ref } from 'vue';
|
|
|
import type { DataTableColumns, PaginationProps } from 'naive-ui';
|
|
|
-import { query } from '../../../service/api/user';
|
|
|
-import type { QueryParams } from '~/src/service/api/user';
|
|
|
+import { query, add } from '../../../service/api/user';
|
|
|
+import type { QueryParams, AddParams } from '~/src/service/api/user';
|
|
|
+import AddView from '~/src/views/management/auth/AddView.vue'
|
|
|
|
|
|
const queryInfo: QueryParams = {};
|
|
|
-
|
|
|
+const addInfo: AddParams = {};
|
|
|
+// // 定义响应式数据:收集用户写进来的关键字
|
|
|
+// const keyword = ref<string>('');
|
|
|
+// // // 搜索按钮的回调
|
|
|
+// const search = () => {
|
|
|
+// // 根据关键字获取信息
|
|
|
+// if(keyword.value === columns.value.keys.name){
|
|
|
+// console.log(111);
|
|
|
+// }
|
|
|
+// };
|
|
|
+export interface Props {
|
|
|
+ /** 弹窗可见性 */
|
|
|
+ visible: boolean;
|
|
|
+ /**
|
|
|
+ * 弹窗类型
|
|
|
+ * add: 新增
|
|
|
+ * edit: 编辑
|
|
|
+ */
|
|
|
+ type?: 'add' | 'edit';
|
|
|
+ /** 编辑的表格行数据 */
|
|
|
+ editData?: UserManagement.User | null;
|
|
|
+}
|
|
|
+const AddTableInfo = ref();
|
|
|
const pagination: PaginationProps = reactive({
|
|
|
page: 1,
|
|
|
pageSize: 10,
|
|
@@ -52,21 +80,19 @@ const pagination: PaginationProps = reactive({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-const tableData = ref<QueryParams[] | null>([]);
|
|
|
+const tableData = ref<QueryParams[]>([]);
|
|
|
|
|
|
query(pagination.page, pagination.pageSize, queryInfo).then(result => {
|
|
|
tableData.value = result.data as [];
|
|
|
});
|
|
|
+add(addInfo).then(_res => {
|
|
|
+ console.log(_res);
|
|
|
+});
|
|
|
const columns: Ref<DataTableColumns<QueryParams>> = ref([
|
|
|
{
|
|
|
type: 'selection',
|
|
|
align: 'center'
|
|
|
},
|
|
|
- {
|
|
|
- key: 'id',
|
|
|
- title: 'ID',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
{
|
|
|
key: 'name',
|
|
|
title: '名称',
|