完成了node的分页组合条件查询
This commit is contained in:
@@ -37,7 +37,11 @@ export namespace Login {
|
|||||||
password: string;
|
password: string;
|
||||||
}
|
}
|
||||||
export interface ResLogin {
|
export interface ResLogin {
|
||||||
|
userid: number;
|
||||||
|
username: string;
|
||||||
|
name: string;
|
||||||
access_token: string;
|
access_token: string;
|
||||||
|
expire_datetime: string;
|
||||||
}
|
}
|
||||||
export interface ResAuthButtons {
|
export interface ResAuthButtons {
|
||||||
[key: string]: string[];
|
[key: string]: string[];
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ import { ReqPage } from ".";
|
|||||||
export namespace Node {
|
export namespace Node {
|
||||||
//这是节点查询时的请求参数,存放查询条件
|
//这是节点查询时的请求参数,存放查询条件
|
||||||
export interface ReqNode extends ReqPage {
|
export interface ReqNode extends ReqPage {
|
||||||
nodeName: string;
|
pageNum: number;
|
||||||
|
pageSize: number;
|
||||||
|
nodename?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Record {
|
export interface Record {
|
||||||
id?: number; //id,有就是修改,没有就是新增
|
id?: number; //id,有就是修改,没有就是新增
|
||||||
nodeName: string;
|
nodename: string;
|
||||||
defaultLevel: number; //默认任务的优先级
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Login } from "./../../api/interface/index";
|
||||||
export type LayoutType = "vertical" | "classic" | "transverse" | "columns";
|
export type LayoutType = "vertical" | "classic" | "transverse" | "columns";
|
||||||
|
|
||||||
export type AssemblySizeType = "large" | "default" | "small";
|
export type AssemblySizeType = "large" | "default" | "small";
|
||||||
@@ -28,7 +29,14 @@ export interface GlobalState {
|
|||||||
/* UserState */
|
/* UserState */
|
||||||
export interface UserState {
|
export interface UserState {
|
||||||
token: string;
|
token: string;
|
||||||
userInfo: { name: string };
|
// userInfo: {
|
||||||
|
// userid: number;
|
||||||
|
// username: string;
|
||||||
|
// name: string;
|
||||||
|
// access_token: string;
|
||||||
|
// expire_datetime: string;
|
||||||
|
// };
|
||||||
|
userInfo: Login.ResLogin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tabsMenuProps */
|
/* tabsMenuProps */
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Login } from "./../../api/interface/index";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { UserState } from "@/stores/interface";
|
import { UserState } from "@/stores/interface";
|
||||||
import piniaPersistConfig from "@/config/piniaPersist";
|
import piniaPersistConfig from "@/config/piniaPersist";
|
||||||
@@ -6,7 +7,7 @@ export const useUserStore = defineStore({
|
|||||||
id: "geeker-user",
|
id: "geeker-user",
|
||||||
state: (): UserState => ({
|
state: (): UserState => ({
|
||||||
token: "",
|
token: "",
|
||||||
userInfo: { name: "张三" }
|
userInfo: { userid: 0, username: "", name: "", access_token: "", expire_datetime: "" }
|
||||||
}),
|
}),
|
||||||
getters: {},
|
getters: {},
|
||||||
actions: {
|
actions: {
|
||||||
@@ -15,7 +16,7 @@ export const useUserStore = defineStore({
|
|||||||
this.token = token;
|
this.token = token;
|
||||||
},
|
},
|
||||||
// Set setUserInfo
|
// Set setUserInfo
|
||||||
setUserInfo(userInfo: UserState["userInfo"]) {
|
setUserInfo(userInfo: Login.ResLogin) {
|
||||||
this.userInfo = userInfo;
|
this.userInfo = userInfo;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -71,8 +71,9 @@ const login = (formEl: FormInstance | undefined) => {
|
|||||||
// 1.执行登录接口
|
// 1.执行登录接口
|
||||||
// console.log("password:md5:" + md5(loginForm.password));
|
// console.log("password:md5:" + md5(loginForm.password));
|
||||||
const { data } = await loginApi({ ...loginForm, password: md5(loginForm.password) });
|
const { data } = await loginApi({ ...loginForm, password: md5(loginForm.password) });
|
||||||
console.log("login data:" + JSON.stringify(data));
|
// console.log("login data:" + JSON.stringify(data));
|
||||||
userStore.setToken(data.access_token);
|
userStore.setToken(data.access_token);
|
||||||
|
userStore.setUserInfo(data);
|
||||||
|
|
||||||
// 2.添加动态路由
|
// 2.添加动态路由
|
||||||
await initDynamicRouter();
|
await initDynamicRouter();
|
||||||
|
|||||||
@@ -42,11 +42,10 @@ const columns: ColumnProps<Node.Record>[] = [
|
|||||||
{ type: "index", label: "序号", width: 80 },
|
{ type: "index", label: "序号", width: 80 },
|
||||||
{ prop: "id", label: "ID", width: 50 },
|
{ prop: "id", label: "ID", width: 50 },
|
||||||
{
|
{
|
||||||
prop: "nodeName",
|
prop: "nodename",
|
||||||
label: "节点名称",
|
label: "节点名称",
|
||||||
search: { el: "input" }
|
search: { el: "input" }
|
||||||
},
|
},
|
||||||
{ prop: "defaultLevel", label: "级别", width: 200 },
|
|
||||||
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user