Browse Source

签到管理系统

kqqd
lzp 10 months ago
parent
commit
82d0235c87
  1. 8
      .env.production
  2. 2
      src/api/login.js
  3. 121
      src/api/school.js
  4. 15
      src/store/modules/user.js
  5. 157
      src/views/index.vue
  6. 2
      src/views/login.vue
  7. 2
      vue.config.js

8
.env.production

@ -6,11 +6,11 @@ NODE_ENV = 'production'
# 大唐
VUE_APP_BASE_API = '/commen_api/'
VUE_APP_IMG_URL = '/commen_api/'
VUE_APP_API_QZURL = '/commen_api/'
VUE_APP_BASE_API = '/multimodal/'
VUE_APP_IMG_URL = '/multimodal/'
VUE_APP_API_QZURL = '/multimodal/'
# 访问路径
VUE_APP_PUBLIC_PATH = '/commen/'
VUE_APP_PUBLIC_PATH = '/multimodal_yf/attendSys/'

2
src/api/login.js

@ -9,7 +9,7 @@ export function login(username, password, code, uuid) {
uuid,
};
return request({
url: "/login",
url: "/app/user/login",
headers: {
isToken: false,
repeatSubmit: false,

121
src/api/school.js

@ -1,116 +1,49 @@
import request from "@/utils/request";
// ------ 教务处学校管理 ------
// 学校列表
export function schoolList(data) {
// 获取设备信息
export function attributes(data) {
return request({
url: "/school/list",
method: "post",
data: data,
});
}
// 新增/修改学校
export function schoolAdd(data) {
return request({
url: "/school/add",
method: "post",
data: data,
});
}
// 新增/修改学校
export function schoolDel(data) {
return request({
url: "/school/del",
method: "post",
data: data,
});
}
// ------ 教务处评审管理 ------
// 评审列表
export function commentList(data) {
return request({
url: "/come/list",
method: "post",
data: data,
});
}
// 评审详情
export function reviewDetails(data) {
return request({
url: "/come/detail",
method: "post",
data: data,
url: "/app/device/attributes",
method: "get",
params: data,
});
}
// ------ 专家评审 ------
// 学校列表
export function expertschoolist(data) {
// 根据项目key查找项目id
export function queryProjectInfoByKey(data) {
return request({
url: "/expert/school/list",
method: "post",
data: data,
});
}
// 评审详情
export function expertReviewDetails(data) {
return request({
url: "/expert/comment/list",
method: "post",
data: data,
});
}
// 评审
export function expertReviewAdd(data) {
return request({
url: "/expert/comment/add",
method: "post",
data: data,
url: "/app/device/queryProjectInfoByKey",
method: "get",
params: data,
});
}
// ------ 分片相关接口 ------
// 校验文件是否已上传
export function register(data) {
// 根据项目id查找设备列表
export function deviceList(data) {
return request({
url: "/mediaUpload/register",
method: "post",
data: data,
url: "/app/device/list",
method: "get",
params: data,
});
}
// 校验分片是否已上传
export function checkchunk(data) {
// 设备日志
export function attributesRecord(data) {
return request({
url: "/mediaUpload/checkchunk",
method: "post",
data: data,
url: "/app/device/attributes/record",
method: "get",
params: data,
});
}
// 循环上传分片
export function uploadchunk(data) {
// 下发属性
export function sendAttribute(data) {
return request({
url: "/mediaUpload/uploadchunk",
url: "/app/device/sendAttribute",
method: "post",
data: data,
headers: {
"Content-Type": "multipart/form-data",
},
});
}
// 合并分片
export function mergechunks(data) {
// 下发命令
export function sendCommand(data) {
return request({
url: "/mediaUpload/mergechunks",
url: "/app/device/sendCommand",
method: "post",
data: data,
});
}
// 合并后上传文件
export function addFile(data) {
return request({
url: "/netdisk/file/add",
method: "post",
data: data,
});
}
}

15
src/store/modules/user.js

@ -43,8 +43,10 @@ const user = {
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
setToken(res.token)
commit('SET_TOKEN', res.token)
console.log('res.data',res.data);
setToken(res.data.token)
commit('SET_TOKEN', res.data.token)
resolve()
}).catch(error => {
reject(error)
@ -56,14 +58,15 @@ const user = {
GetInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.user
console.log('获取用户信息',res);
const user = res.data.user
let avatar = user.avatar || ""
if (!isHttp(avatar)) {
avatar = (isEmpty(avatar)) ? defAva : process.env.VUE_APP_BASE_API + avatar
}
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions)
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.data.roles)
commit('SET_PERMISSIONS', res.data.permissions)
} else {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}

157
src/views/index.vue

@ -1,58 +1,71 @@
<template>
<div class="app-container">
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
@click="handleAdd"
>远程开锁</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> -->
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getAttributes(deviceId)"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="noticeList" max-height="600">
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
<el-table v-loading="loading" :data="tableList" max-height="600">
<el-table-column label="序号" align="center" prop="noticeId" width="100" >
<template slot-scope="scope">
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column
label="ID"
label="时间"
align="center"
prop="noticeTitle"
prop="reportTime"
:show-overflow-tooltip="true"
min-width="100"
/>
<el-table-column
label="时间"
label="类型"
align="center"
prop="noticeTitle"
prop="tips"
:show-overflow-tooltip="true"
min-width="100"
/>
<el-table-column
label="ID"
align="center"
prop="attributeValue.id"
:show-overflow-tooltip="true"
min-width="100"
/>
<el-table-column label="类型" align="center" prop="noticeType" min-width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
@pagination="getqueryProjectInfoByKey"
/>
</div>
</template>
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import {
queryProjectInfoByKey,
deviceList,
attributes,
sendAttribute,
sendCommand,
attributesRecord,
} from "@/api/school";
export default {
name: "Notice",
dicts: ['sys_notice_status', 'sys_notice_type'],
data() {
return {
deviceId: "", // id
//
loading: true,
//
@ -66,7 +79,7 @@ export default {
//
total: 0,
//
noticeList: [],
tableList: [],
//
title: "",
//
@ -75,40 +88,112 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
noticeTitle: undefined,
createBy: undefined,
status: undefined
},
//
form: {},
//
rules: {
noticeTitle: [
{ required: true, message: "公告标题不能为空", trigger: "blur" }
{ required: true, message: "公告标题不能为空", trigger: "blur" },
],
noticeType: [
{ required: true, message: "公告类型不能为空", trigger: "change" }
]
}
{ required: true, message: "公告类型不能为空", trigger: "change" },
],
},
};
},
created() {
this.getList();
this.getqueryProjectInfoByKey();
},
methods: {
/** 查询公告列表 */
getList() {
handleSendCommand() {
sendCommand({
commandId: "447242774207233", // ID,
commandParams: 1, // ,
deviceId: this.deviceId,
}).then((res) => {
this.$message.success("操作成功");
this.getAttributes(this.deviceId); // id
});
},
//
handleSettings() {
this.open = true;
this.form = {
threshold: this.deviceInfo.threshold,
};
// this.$message.success('');
},
// keyid
getqueryProjectInfoByKey() {
this.loading = true;
listNotice(this.queryParams).then(response => {
this.noticeList = response.rows;
this.total = response.total;
queryProjectInfoByKey({
projectKey: "qKStHKKt",
}).then((res) => {
this.getDeviceList(res.data.id); // id
});
},
// id
getDeviceList(_id) {
deviceList({
projectId: _id,
}).then((res) => {
const w2Device = res.rows.find((device) => device.deviceName === "A1");
this.deviceId = w2Device.id;
this.getAttributes(this.deviceId); // id
});
},
// id
getAttributes(_id) {
attributesRecord({
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
deviceId: _id,
}).then((res) => {
this.loading = false;
let isOpenValue = {
0: "开锁失败",
1: "开锁成功",
};
let typeValue = {
A1: "指纹",
A2: "人脸",
};
res.rows.forEach((item) => {
item.attributeValue = JSON.parse(item.attributeValue);
item.tips = `${typeValue[item.attributeValue.type]}`;
});
this.tableList = res.rows;
this.total = res.total;
});
},
/** 下发属性 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
let param = { Wen: `#${this.form.threshold}` }; //
sendAttribute({
attributeParams: JSON.stringify(param), // JSON
deviceId: this.deviceId, // id
}).then((response) => {
this.getAttributes(this.deviceId); // id
this.$modal.msgSuccess("操作成功");
this.open = false;
});
}
});
},
/** 新增按钮操作 */
handleAdd() {
this.$message.success('操作成功');
this.$message.success("操作成功");
},
}
},
};
</script>
<style scoped >
>>> .top-right-btn .el-button:nth-of-type(1) {
display: none;
}
</style>

2
src/views/login.vue

@ -139,7 +139,7 @@ export default {
this.captchaEnabled =
res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.codeUrl = "data:image/gif;base64," + res.data.img;
this.loginForm.uuid = res.uuid;
}
});

2
vue.config.js

@ -40,7 +40,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `https://test.tall.wiki/commen/`,
target: `http://121.37.81.216/multimodal/`,
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save