node的增删改查
This commit is contained in:
@@ -11,8 +11,8 @@ VITE_DROP_CONSOLE = true
|
|||||||
VITE_PWA = false
|
VITE_PWA = false
|
||||||
|
|
||||||
# 开发环境接口地址
|
# 开发环境接口地址
|
||||||
VITE_API_URL = /api
|
VITE_API_URL =/api
|
||||||
#VITE_API_URL="http://localhost:8426"
|
# VITE_API_URL="http://localhost:8426"
|
||||||
|
|
||||||
# 开发环境跨域代理,支持配置多个
|
# 开发环境跨域代理,支持配置多个
|
||||||
VITE_PROXY=[["/api","http://localhost:8426"]]
|
VITE_PROXY=[["/api","http://localhost:8426"]]
|
||||||
|
|||||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.stylelint": true
|
"source.fixAll.stylelint": "explicit"
|
||||||
},
|
},
|
||||||
"stylelint.enable": true,
|
"stylelint.enable": true,
|
||||||
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass", "html"],
|
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass", "html"],
|
||||||
|
|||||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -4491,9 +4491,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001522",
|
"version": "1.0.30001608",
|
||||||
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001522.tgz",
|
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001608.tgz",
|
||||||
"integrity": "sha512-TKiyTVZxJGhsTszLuzb+6vUZSjVOAhClszBr2Ta2k9IwtNBT/4dzmL6aywt0HCgEZlmwJzXJd8yNiob6HgwTRg==",
|
"integrity": "sha512-cjUJTQkk9fQlJR2s4HMuPMvTiRggl0rAVMtthQuyOlDWuqHXqN8azLq+pi8B2TjwKJ32diHjUqRIKeFX4z1FoA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/chalk": {
|
"node_modules/chalk": {
|
||||||
@@ -17683,9 +17683,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"caniuse-lite": {
|
"caniuse-lite": {
|
||||||
"version": "1.0.30001522",
|
"version": "1.0.30001608",
|
||||||
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001522.tgz",
|
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001608.tgz",
|
||||||
"integrity": "sha512-TKiyTVZxJGhsTszLuzb+6vUZSjVOAhClszBr2Ta2k9IwtNBT/4dzmL6aywt0HCgEZlmwJzXJd8yNiob6HgwTRg==",
|
"integrity": "sha512-cjUJTQkk9fQlJR2s4HMuPMvTiRggl0rAVMtthQuyOlDWuqHXqN8azLq+pi8B2TjwKJ32diHjUqRIKeFX4z1FoA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"chalk": {
|
"chalk": {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class RequestHttp {
|
|||||||
// 当前请求不需要显示 loading,在 api 服务中通过指定的第三个参数: { noLoading: true } 来控制
|
// 当前请求不需要显示 loading,在 api 服务中通过指定的第三个参数: { noLoading: true } 来控制
|
||||||
config.noLoading || showFullScreenLoading();
|
config.noLoading || showFullScreenLoading();
|
||||||
if (config.headers && typeof config.headers.set === "function") {
|
if (config.headers && typeof config.headers.set === "function") {
|
||||||
config.headers.set("x-access-token", userStore.token);
|
config.headers.set("x-access-token", "Bearer " + userStore.token);
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import { ReqPage } from ".";
|
|||||||
export namespace Node {
|
export namespace Node {
|
||||||
//这是节点查询时的请求参数,存放查询条件
|
//这是节点查询时的请求参数,存放查询条件
|
||||||
export interface ReqNode extends ReqPage {
|
export interface ReqNode extends ReqPage {
|
||||||
pageNum: number;
|
|
||||||
pageSize: number;
|
|
||||||
nodename?: string;
|
nodename?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="dialogVisible" :title="PARAMS.title" :close-on-click-modal="false" width="500px" :destroy-on-close="true">
|
<el-dialog v-model="dialogVisible" :title="PARAMS.title" :close-on-click-modal="false" width="500px" :destroy-on-close="true">
|
||||||
<el-form ref="refForm" label-width="100px" :model="PARAMS.data" :rules="rules" :hide-required-asterisk="PARAMS.readonly">
|
<el-form ref="refForm" label-width="100px" :model="PARAMS.data" :rules="rules" :hide-required-asterisk="PARAMS.readonly">
|
||||||
<el-form-item label="节点名称" prop="nodeName"><el-input v-model="PARAMS.data.nodeName"></el-input></el-form-item>
|
<el-form-item label="节点名称" prop="nodeName"><el-input v-model="PARAMS.data.nodename"></el-input></el-form-item>
|
||||||
<el-form-item label="优先级" prop="defaultLevel">
|
|
||||||
<el-select v-model="PARAMS.data.defaultLevel">
|
|
||||||
<el-option label="高" value="1"></el-option>
|
|
||||||
<el-option label="中" value="2"></el-option>
|
|
||||||
<el-option label="低" value="3"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="">
|
<el-form-item label="">
|
||||||
<el-button type="primary" @click="handleSubmit" v-if="!PARAMS.readonly">保存</el-button>
|
<el-button type="primary" @click="handleSubmit" v-if="!PARAMS.readonly">保存</el-button>
|
||||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||||
@@ -26,8 +19,7 @@ const dialogVisible = ref(false);
|
|||||||
|
|
||||||
//定义from的校验规则
|
//定义from的校验规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
nodeName: [{ required: true, message: "请填写节点名称" }],
|
nodename: [{ required: true, message: "请填写节点名称" }]
|
||||||
defaultLevel: [{ required: true, message: "请填写优先等级" }]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//接收参数的接口定义
|
//接收参数的接口定义
|
||||||
@@ -59,6 +51,7 @@ const handleSubmit = () => {
|
|||||||
await PARAMS.value.api!(PARAMS.value.data);
|
await PARAMS.value.api!(PARAMS.value.data);
|
||||||
ElMessage.success({ message: `${PARAMS.value.title}成功!` });
|
ElMessage.success({ message: `${PARAMS.value.title}成功!` });
|
||||||
PARAMS.value.getTableList!();
|
PARAMS.value.getTableList!();
|
||||||
|
dialogVisible.value = false;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<template #operation="scope">
|
<template #operation="scope">
|
||||||
<el-button type="primary" link @click="viewNode(scope.row)"> 查看 </el-button>
|
<el-button type="primary" link @click="viewNode(scope.row)"> 查看 </el-button>
|
||||||
<el-button type="primary" link @click="editNode(scope.row)"> 编辑 </el-button>
|
<el-button type="primary" link @click="editNode(scope.row)"> 编辑 </el-button>
|
||||||
<el-button type="primary" link @click="deleteNode([scope.row.ID])"> 删除 </el-button>
|
<el-button type="primary" link @click="deleteNode([scope.row.id])"> 删除 </el-button>
|
||||||
</template>
|
</template>
|
||||||
</ProTable>
|
</ProTable>
|
||||||
|
|
||||||
@@ -50,6 +50,7 @@ const columns: ColumnProps<Node.Record>[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const getTableList = (params: any) => {
|
const getTableList = (params: any) => {
|
||||||
|
// console.log("proTable的参数:" + JSON.stringify(params));
|
||||||
return GetNodeList(params);
|
return GetNodeList(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user