diff --git a/.env.development b/.env.development
index e12feb9f..0f71a0e7 100644
--- a/.env.development
+++ b/.env.development
@@ -5,11 +5,12 @@ NODE_ENV = development
VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
# 接口地址
- VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
+
+VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
#VUE_APP_API_BASEURL = http://127.0.0.1:8000/api
# 本地端口
VUE_APP_PORT = 2800
# 是否开启代理
-VUE_APP_PROXY = true
\ No newline at end of file
+VUE_APP_PROXY = true
diff --git a/src/api/model/ops.js b/src/api/model/ops.js
new file mode 100644
index 00000000..2d0f2216
--- /dev/null
+++ b/src/api/model/ops.js
@@ -0,0 +1,14 @@
+import config from "@/config"
+import http from "@/utils/request"
+
+export default {
+ logs: {
+ list: {
+ url: `${config.API_URL}/monitor/request_log/`,
+ name: "请求日志",
+ req: async function(data){
+ return await http.get(this.url, data);
+ }
+ }
+ }
+}
diff --git a/src/api/model/system.js b/src/api/model/system.js
index bfb936cf..5744e3e4 100644
--- a/src/api/model/system.js
+++ b/src/api/model/system.js
@@ -173,7 +173,7 @@ export default {
},
user: {
list: {
- url: `${config.API_URL}/system/user/list`,
+ url: `${config.API_URL}/system/user`,
name: "获取用户列表",
req: async function(params){
return await http.get(this.url, params);
@@ -202,12 +202,34 @@ export default {
}
},
},
- log: {
+ post: {
list: {
- url: `${config.API_URL}/system/log/list`,
- name: "日志列表",
- req: async function(params){
- return await http.get(this.url, params);
+ url: `${config.API_URL}/system/post/`,
+ name: "获取岗位列表",
+ req: async function(data){
+ return await http.get(this.url, data);
+ }
+ },
+ create: {
+ url: `${config.API_URL}/system/post/`,
+ name: "新增岗位",
+ req: async function(data){
+ return await http.post(this.url,data);
+ }
+ },
+ update: {
+ name: "更新岗位",
+ req: async function(id, data){
+ return await http.put(
+ `${config.API_URL}/system/post/${id}/`,
+ data
+ );
+ }
+ },
+ delete: {
+ name: "删除岗位",
+ req: async function(id){
+ return await http.delete(`${config.API_URL}/system/post/${id}/`);
}
}
},
diff --git a/src/views/ops/logInfo.vue b/src/views/ops/logInfo.vue
new file mode 100644
index 00000000..eca96198
--- /dev/null
+++ b/src/views/ops/logInfo.vue
@@ -0,0 +1,59 @@
+
+
+
+ {{data.path}}
+ {{data.method}}
+ {{data.status_code}}
+ {{data.id}}
+ {{data.requested_at}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/log_request.vue b/src/views/ops/log_request.vue
index e69de29b..bd109f55 100644
--- a/src/views/ops/log_request.vue
+++ b/src/views/ops/log_request.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查看详情
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/sys/dict.vue b/src/views/sys/dict.vue
index e69de29b..d0bbb3a4 100644
--- a/src/views/sys/dict.vue
+++ b/src/views/sys/dict.vue
@@ -0,0 +1,420 @@
+
+
+
+
+
+
+
+
+
+
+
+ 字典分类
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 保 存
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 保 存
+
+
+
+
+
+
+
+
diff --git a/src/views/sys/user.vue b/src/views/sys/user.vue
index e7eedd54..f663cbcf 100644
--- a/src/views/sys/user.vue
+++ b/src/views/sys/user.vue
@@ -68,8 +68,6 @@
-
-
-
+ -->
+
-
-
-
+
- 查看
-
编辑
+
-
-
-
-
+
@@ -257,40 +224,15 @@
id: "",
username: "",
name: "",
- email: "",
+ // email: "",
phone: "",
- belong_dept: [],
+ // belong_dept: [],
is_active:true
},
//验证规则
rules: {
username: [{required: true, message: "请输入登录账号"}],
name: [{required: true, message: "请输入真实姓名"}],
- password: [
- {required: true, message: "请输入登录密码"},
- {
- validator: (rule, value, callback) => {
- if (this.form.password2 !== "") {
- this.$refs.addForm.validateField(
- "password2"
- );
- }
- callback();
- },
- },
- ],
- password2: [
- {required: true, message: "请再次输入密码"},
- {
- validator: (rule, value, callback) => {
- if (value !== this.form.password) {
- callback(new Error("两次输入密码不一致!"));
- } else {
- callback();
- }
- },
- },
- ],
group: [{required: true, message: "请选择所属角色"}],
},
//所需数据选项
@@ -324,7 +266,6 @@
},
},
mounted() {
- this.getList();
this.getGroup();
},
methods: {
@@ -350,11 +291,10 @@
this.addForm.name = row.name;
this.addForm.username = row.username;
this.addForm.phone = row.phone;
- this.addForm.email = row.email;
- debugger;
- console.log();
+ /*
let belong_dept = this.findParents(this.postList,row.belong_dept);
this.addForm.belong_dept=belong_dept.reverse();
+ */
this.addForm.is_active = row.is_active;
},
findParents(arr,belong_dept){
@@ -378,15 +318,13 @@
this.addForm.id = row.id;
},
//删除
- async table_del(row, index) {
- var reqData = {id: row.id};
- var res = await this.$API.system.user.delete.req(reqData);
- if (res.code == 200) {
- //这里选择刷新整个表格 OR 插入/编辑现有表格数据
- this.$refs.table.tableData.splice(index, 1);
- this.$message.success("删除成功");
- } else {
+ async table_del(row) {
+ let res = await this.$API.system.user.delete.req(row.id);
+ if (res.err.msg) {
this.$alert(res.message, "提示", {type: "error"});
+ } else {
+ this.$refs.table.refresh();
+ this.$message.success("删除成功");
}
},
//表格选择后回调事件
@@ -396,7 +334,7 @@
//加载树数据
async getGroup() {
this.showGrouploading = true;
- var res = await this.$API.system.dept.list.req({page: 0});
+ let res = await this.$API.system.dept.list.req({page: 0});
this.showGrouploading = false;
// var allNode = { id: "", label: "所有" };
// res.data.unshift(allNode);
@@ -431,38 +369,15 @@
},
//树点击事件
groupClick(data) {
- // var params = {dept: data.id};
- debugger;
console.log(data);
debugger;
- this.tableParams = {dept: data.id};
- this.$refs.table.reload(this.tableParams);
+ let params = {belong_dept: data.id};
+ this.$refs.table.reload(params);
},
//搜索
upsearch() {
this.$refs.table.upData(this.search);
},
- //本地更新数据
- handleSuccess(data, mode) {
- if (mode == "add") {
- data.id = new Date().getTime();
- this.$refs.table.tableData.unshift(data);
- } else if (mode == "edit") {
- this.$refs.table.tableData
- .filter((item) => item.id === data.id)
- .forEach((item) => {
- Object.assign(item, data);
- });
- }
- },
- getList() {
- let that = this;
- this.$API.system.user.list.req({page:1,page_size:20}).then((res) => {
- debugger;
- console.log(res);
- that.userList = res.results;
- });
- },
//表单提交方法
submit(){
debugger;
@@ -470,7 +385,7 @@
if (valid) {
debugger;
this.isSaveing = true;
- this.addForm.belong_dept = this.addForm.belong_dept[this.addForm.belong_dept.length - 1];
+ // this.addForm.belong_dept = this.addForm.belong_dept[this.addForm.belong_dept.length - 1];
let res;
if(this.type==='add'){
res = await this.$API.system.user.create.req(this.addForm);
@@ -489,16 +404,6 @@
return false;
}
})
- },
- //表单注入数据
- setData(data){
- this.addForm.id = data.id;
- this.addForm.username = data.username;
- this.addForm.avatar = data.avatar;
- this.addForm.name = data.name;
- this.addForm.group = data.group;
- //可以和上面一样单个注入,也可以像下面一样直接合并进去
- //Object.assign(this.form, data)
}
},
};