fix: BUG修改

This commit is contained in:
kun 2023-06-01 16:20:29 +08:00
parent 71192ed33a
commit 215a6ac3d5
10 changed files with 389 additions and 153 deletions

View File

@ -3,8 +3,8 @@ NODE_ENV = "production"
# 线上环境接口地址(easymock)
# VITE_API_URL = "http://139.9.66.234:6688"
# VITE_API_URL = "http://182.90.224.147:6688"
VITE_API_URL = "http://101.43.164.214:6688"
VITE_API_URL = "http://182.90.224.147:6688"
# VITE_API_URL = "http://101.43.164.214:6688"
# 打包
VITE_ULD_API_URL = 'http://182.90.224.147:8012/onlinePreview?url='

View File

@ -58,6 +58,10 @@ export const getpreviewURLS = (params: { cameraIndexCode: string | null }) => {
export const getmanualCaptureL = (params: {}) => {
return http.post(BASEURL + `/xmgl/video/manualCapture`, params);
};
// 海康视频配置信息
export const getConfigInfo = (params: {}) => {
return http.get(BASEURL + `/xmgl/video/getConfig`, params);
};
// 通知公告!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// 新建通知

View File

@ -334,3 +334,13 @@ export const addMember = (params: FormData) => {
export const getMemberList = (params: FormData) => {
return http.post(BASEURL + `/project/workerInfo/page`, params);
};
// 人员管理详情
export const memberInfo = (params: any) => {
return http.post(BASEURL + `/project/workerInfo/queryById`, params);
};
// 人员管理编辑
export const updateMember = (params: any) => {
return http.post(BASEURL + `/project/workerInfo/edit`, params);
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

View File

@ -12,7 +12,7 @@
v-show="isShowSearch"
>
<template #formButton>
<slot name="formButton"></slot>
<slot name="formButton" :selectedListIds="selectedListIds" :selectedList="selectedList" :isSelected="isSelected"></slot>
</template>
</SearchForm>

View File

@ -23,7 +23,7 @@ import { ref, reactive, onMounted, onBeforeUnmount, getCurrentInstance, nextTick
import { ElMessage } from "element-plus";
import { getvideoEngTreeList } from "@/api/modules/enterpriseApi";
import { getpreviewURL } from "@/api/modules/common";
import { getpreviewURL, getConfigInfo } from "@/api/modules/common";
import TreeFilter from "@/components/TreeFilter/index.vue";
import { GlobalStore } from "@/stores";
@ -41,10 +41,10 @@ let initCount = ref(0);
let oWebControl = ref(null);
let cameraIndexCode = ref<Array<string>>([]);
let objData = ref({
appkey: "21582859", //appkey
ip: "120.236.122.37", //ip
secret: "CfxWWzB9MEC5y6R5CmWI", //secret
port: 81,
appkey: "24017757", //appkey
ip: "182.101.141.23", //ip
secret: "VJz0FbzmE6drPQ7egsBi", //secret
port: 18443,
playMode: 0, // 0 1
layout: "4x6" //16
});
@ -87,10 +87,26 @@ const getVideo = async () => {
// await sendRequest({ code: cameraIndexCode.value });
await getpreviewURL({ cameraIndexCode: cameraIndexCode.value });
};
//
const getVideoConfig = async () => {
// await sendRequest({ code: cameraIndexCode.value });
const res = await getConfigInfo({});
// objData.value = ref({
// appkey: res.result.appKey, //appkey
// ip: res.result.ip, //ip
// secret: res.result.appSecret, //secret
// port: +res.result.port,
// playMode: 0, // 0 1
// layout: "4x6" //16
// });
// console.log(objData.value);
};
/** 设备列表的点击操作 */
onMounted(async () => {
//
getVideoConfig();
// ee
const pageInstance = getCurrentInstance();
// dom

View File

@ -159,7 +159,7 @@ import { ref, reactive, onMounted, onBeforeUnmount, getCurrentInstance, nextTick
import { ElMessage, ElMessageBox, ElStep } from "element-plus";
import { getVideoQuestionPage, getvideoProTreeList, getvideoEngTreeList, addmonitorQuestion } from "@/api/modules/goverment";
import { getpreviewURL, getmanualCaptureL, getpreviewURLS } from "@/api/modules/common";
import { getpreviewURL, getmanualCaptureL, getpreviewURLS, getConfigInfo } from "@/api/modules/common";
import TreeFilter from "@/components/TreeFilter/index.vue";
import { GlobalStore } from "@/stores";
import Pagination from "@/components/ProTable/components/Pagination.vue";
@ -219,10 +219,10 @@ let initCount = ref(0);
let oWebControl = ref(null);
let cameraIndexCode = ref<Array<string>>([]);
let objData = ref({
appkey: "21582859", //appkey
ip: "120.236.122.37", //ip
secret: "CfxWWzB9MEC5y6R5CmWI", //secret
port: 81,
appkey: "24017757", //appkey
ip: "182.101.141.23", //ip
secret: "VJz0FbzmE6drPQ7egsBi", //secret
port: 18443,
playMode: 0, // 0 1
layout: "4x6" //16
});
@ -400,6 +400,20 @@ const getVideo = async () => {
// await sendRequest({ code: cameraIndexCode.value });
await getpreviewURL({ cameraIndexCode: cameraIndexCode.value });
};
//
const getVideoConfig = async () => {
// await sendRequest({ code: cameraIndexCode.value });
const res = await getConfigInfo({});
// objData.value = ref({
// appkey: res.result.appKey, //appkey
// ip: res.result.ip, //ip
// secret: res.result.appSecret, //secret
// port: +res.result.port,
// playMode: 0, // 0 1
// layout: "4x6" //16
// });
// console.log(objData.value);
};
// form
const onDatePicker = () => {
@ -450,6 +464,8 @@ watch(
// });
onMounted(async () => {
//
getVideoConfig();
// ee
const pageInstance = getCurrentInstance();
// dom

View File

@ -1,6 +1,6 @@
<template>
<div class="overview">
<el-dialog title="新增工人" show-close v-model="visible1" style="min-width: 1500px">
<el-dialog :title="props.title" show-close v-model="visible1" style="min-width: 1500px">
<el-form ref="ruleFormRef" :model="form" :rules="rules" label-width="200px" class="form" size="default">
<!-- 基础信息 -->
<div>
@ -338,7 +338,7 @@
</el-form-item>
</div>
</div>
<footer class="footer flx-center">
<footer class="footer flx-center" v-if="title == '新增人员'">
<el-button class="cancelButtonStyle" @click="visible1 = false">取消</el-button>
<el-button type="primary" @click="submitForm(form)">保存</el-button>
</footer>
@ -348,7 +348,7 @@
</template>
<script lang="ts" setup>
import { onMounted, ref, watch } from "vue";
import { onMounted, ref, watch, reactive } from "vue";
import type { FormInstance, UploadProps } from "element-plus";
import { ElMessage } from "element-plus";
import { getDicList } from "@/api/modules/jxjview";
@ -356,7 +356,9 @@ import { getBuildUnitAll, getClassGroupAll, getworkTypeAll } from "@/api/modules
const baseUrl = import.meta.env.VITE_API_URL;
const props = defineProps({
newMemberDialog: Boolean,
engineeringSn: String
engineeringSn: String,
title: String,
formData: Object
});
const visible1 = ref(false);
const changeType = ref(1);
@ -461,13 +463,6 @@ const rules = ref({
}
]
});
const enum Type {
One = 1,
Two = 2,
Three = 3,
Four = 4,
Five = 5
}
const politicsStatusList = ref([
{ label: "中共党员", value: 1 },
{ label: "共青团团员", value: 2 },
@ -504,46 +499,7 @@ const bankTypeList: any = ref([
{ label: "邮政储蓄银行", value: 14 },
{ label: "浙商银行", value: 15 }
]);
const form = ref({
personName: "",
sex: 1,
birthday: "",
nation: "",
registerAddress: "",
idCard: "",
issuingAuthorityForIdCard: "",
idCardExpireDate: "",
idCardFront: "",
idCardBack: "",
portrait: "",
phone: "",
address: "",
companySn: "",
teamSn: "",
workerType: null,
personType: Type["One"],
safetyEducation: Type["One"],
isPurchaseInsurance: Type["One"],
isContract: Type["One"],
contractImage: "",
isPhysicalExamination: Type["One"],
bankType: null,
bankCard: "",
realNameCardNumber: "",
bankName: "",
bankCode: "",
politicsStatus: null,
educationLevel: null,
academicDegree: null,
haveMedicalHistory: Type["One"],
natureOfAccount: Type["One"],
maritalStatus: null,
contacts: "",
contactsTel: "",
entryTime: "",
trainingTime: "",
personEmail: ""
});
const form = ref();
//
const handleAvatarSuccess: UploadProps["onSuccess"] = (response, uploadFile, index) => {
console.log(response.result.url);
@ -644,6 +600,11 @@ const getDicMainList = async () => {
educationLevelList.value.length = 0;
educationLevelList.value.push(...result);
};
//
const resetForm = (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.resetFields();
};
// visibleel-dialog
watch(
() => props.newMemberDialog,
@ -660,8 +621,19 @@ watch(
watch(visible1, (n, o) => {
emits("update:newMemberDialog", n);
});
watch(
() => props.formData,
(n, o) => {
resetForm(ruleFormRef.value);
console.log(props.formData);
form.value = reactive(n);
}
);
onMounted(() => {
getDicMainList();
// formData
console.log(props.formData);
form.value = reactive(props.formData);
});
</script>

View File

@ -2,7 +2,7 @@
<div class="table-box">
<ProTable
ref="proTable"
title="班组管理列表"
title="人员管理列表"
:columns="columns"
:requestApi="getTableList"
:dataCallback="dataCallback"
@ -15,15 +15,27 @@
>
<template #formButton="scope">
<el-button class="addButtonStyle" @click="handleAddItem(1)">新增</el-button>
<el-button type="primary" @click="handleAddItem(1)">批量复职</el-button>
<el-button type="primary" @click="handleAddItem(1)">批量离场</el-button>
<el-button type="primary" :disabled="!scope.isSelected" @click="batchOperate(1, scope.selectedListIds)"
>批量复职</el-button
>
<el-button type="primary" :disabled="!scope.isSelected" @click="batchOperate(2, scope)">批量离场</el-button>
</template>
<template #operation="{ row }">
<el-button type="primary" link @click="handleAddItem(2, row)">
<img src="@/assets/images/tableIcon/updateIcon.png" alt="" class="configureIcon" />
<span>编辑</span>
<img src="@/assets/images/tableIcon/look.png" alt="" class="configureIcon" />
<span>查看</span>
</el-button>
<el-button type="danger" link :icon="Delete" @click="deleteGroup(row)">删除</el-button>
<el-button type="primary" link @click="handleEditItem(1, row)">
<img src="@/assets/images/tableIcon/调动.png" alt="" class="configureIcon" />
<span>调动</span>
</el-button>
<el-button type="primary" link @click="handleEditItem(2, row)">
<img src="@/assets/images/tableIcon/离场.png" alt="" class="configureIcon" />
<span>离场</span>
</el-button>
</template>
<template #portrait="{ row }">
<el-image style="width: 26px; height: 37px" :src="row.portrait" fit="fill"></el-image>
</template>
<template #state="{ row }">
<span :class="row.state === 1 ? '' : 'redText'">{{ row.state == 1 ? "启用" : "禁用" }}</span>
@ -49,19 +61,50 @@
</engineeringDrawer>
<allEngineering @click="engVisable = true" />
<addMemberForm
:title="title"
v-model:newMemberDialog="newMemberDialog"
:formData="formData"
:engineeringSn="initParam.engineeringSn"
@confirm="saveItem"
></addMemberForm>
<DialogForm
:title="title"
:formConfig="formConfig"
:formData="formData"
v-model:visible="visible"
title="调动"
:formConfig="moveFormConfig"
:formData="moveFormData"
v-model:visible="moveVisible"
append-to-body
width="700px"
@confirm="saveMoveItem"
>
<template #header>
<div class="title-transform">
<img src="@/assets/images/tableIcon/调动.png" alt="" />
<span>调动</span>
</div>
</template>
</DialogForm>
<DialogForm
title="离场"
:formConfig="exitFormConfig"
:formData="exitFormData"
v-model:visible="exitVisible"
append-to-body
width="700px"
@confirm="saveItem"
>
<template #header>
<div class="title-transform">
<img src="@/assets/images/tableIcon/离场.png" alt="" />
<span>离场</span>
</div>
<div class="title-sub">
<img src="@/assets/images/tableIcon/离场.png" alt="" />
<div>
<img src="@/assets/images/dialogIcon/tipIcon.png" alt="" />
<span>温馨提示:人员到离职时间后不可通过像识别</span>
</div>
</div>
</template>
</DialogForm>
</div>
</template>
@ -81,14 +124,14 @@ import { editRolePermissions, getSystemRole, getTreemRoleList, getTreeByIdList }
import {
addClassGroup,
updateClassGroup,
deleteClassGroup,
getClassGroupAll,
getMemberList,
classGroupInfo,
addMember
memberInfo,
addMember,
updateMember
} from "@/api/modules/project";
import DialogForm from "@/components/DialogForm/index.vue";
import addMemberForm from "./components/addMemberForm.vue";
import { Delete } from "@element-plus/icons-vue";
import { GlobalStore } from "@/stores";
@ -104,66 +147,109 @@ const defaultProps = {
const router = useRouter();
const store = GlobalStore();
const drawerVisible = ref(false);
const visible = ref(false);
const moveVisible = ref(false);
const exitVisible = ref(false);
const newMemberDialog = ref(false);
const title = ref("");
const objRow = ref({});
// ProTable()
const initParam = reactive({
solveFlag: 1,
engineeringSn: ""
});
const formData = ref({});
//
const formConfig = {
// -
const moveFormData = ref({});
// -
const exitFormData = ref({});
const formData = ref({
personName: "",
sex: 1,
birthday: "",
nation: "",
registerAddress: "",
idCard: "",
issuingAuthorityForIdCard: "",
idCardExpireDate: "",
idCardFront: "",
idCardBack: "",
portrait: "",
phone: "",
address: "",
companySn: "",
teamSn: "",
workerType: null,
personType: 1,
safetyEducation: 1,
isPurchaseInsurance: 1,
isContract: 1,
contractImage: "",
isPhysicalExamination: 1,
bankType: null,
bankCard: "",
realNameCardNumber: "",
bankName: "",
bankCode: "",
politicsStatus: null,
educationLevel: null,
academicDegree: null,
haveMedicalHistory: 1,
natureOfAccount: 1,
maritalStatus: null,
contacts: "",
contactsTel: "",
entryTime: "",
trainingTime: "",
personEmail: ""
});
// -
const moveFormConfig = {
formItemConfig: [
{
label: "参建单位",
prop: "companySn",
label: "班组",
prop: "teamSn",
type: "select",
data: []
},
{
label: "班组名称",
prop: "teamName",
type: "input"
},
{
label: "班组长",
prop: "leaderName",
type: "input"
},
{
label: "班组长电话",
prop: "leaderTel",
type: "input"
},
{
label: "进场时间",
prop: "entryTime",
type: "date",
format: "YYYY-MM-DD",
valueFormat: "YYYY-MM-DD"
}
],
rules: {
companySn: [
teamSn: [
{
required: true,
message: "请选择",
trigger: "change"
}
],
teamName: [
]
}
};
// -
const exitFormConfig = {
formItemConfig: [
{
label: "离场人员",
prop: "ids",
type: "input"
},
{
label: "离场时间",
prop: "ids",
type: "radio",
data: [
{
label: "立即离场",
value: 1
},
{
label: "延时离场",
value: 2
}
]
}
],
rules: {
teamSn: [
{
required: true,
message: "请输入",
trigger: "blur"
}
],
leaderTel: [
{
pattern: /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
message: "请输入合法手机号",
message: "请选择",
trigger: "change"
}
]
@ -176,11 +262,14 @@ const getId = ref<number | undefined>(undefined);
//
const columns: ColumnProps[] = [
{ type: "index", label: "序号", width: 80 },
{ type: "selection", width: 80, fixed: "left" },
{ type: "index", label: "序号", width: 80, fixed: "left" },
{
prop: "companyName",
label: "工程名称"
prop: "portrait",
label: "照片",
fixed: "left"
},
{ prop: "personName", label: "姓名", fixed: "left", search: { el: "input" } },
{
prop: "personType",
label: "人员类别",
@ -190,8 +279,6 @@ const columns: ColumnProps[] = [
{ label: "工人", value: 2 }
]
},
{ prop: "teamName", label: "姓名", search: { el: "input" } },
{ prop: "teamName", label: "身份证号", search: { el: "input" } },
{
prop: "inServiceType",
label: "人员状态",
@ -201,8 +288,15 @@ const columns: ColumnProps[] = [
{ label: "离场", value: 2 }
]
},
{ prop: "leaderName", label: "班组长" },
{ prop: "leaderTel", label: "班组长电话" },
{ prop: "phone", label: "手机号" },
{ prop: "idCard", label: "身份证号", search: { el: "input" } },
{ prop: "companyName", label: "参建单位" },
{ prop: "companyType", label: "参建单位类型" },
{ prop: "teamName", label: "班组" },
{ prop: "workerTypeName", label: "工种" },
{ prop: "entryTime", label: "进场时间" },
{ prop: "exitTime", label: "离场时间" },
{ prop: "age", label: "年龄" },
{ prop: "operation", label: "操作", fixed: "right", width: 260 }
];
@ -218,6 +312,21 @@ const dataCallback = (data: any) => {
};
};
//
const batchOperate = (index: number, ids: []) => {
console.log(666);
console.log(index, ids);
// if(index == 1) {
// await useHandleData(deleteUser, { id }, "");
// proTable.value?.clearSelection();
// proTable.value?.getTableList();
// } else if(index == 2){
// await useHandleData(deleteUser, { id }, "");
// proTable.value?.clearSelection();
// proTable.value?.getTableList();
// }
};
const closeDrawer = (done: () => void) => {
datas.length = 0;
done();
@ -266,32 +375,86 @@ const getTableList = (params: any) => {
const handleAddItem = async (index: number, row: any) => {
if (index === 1) {
title.value = "新增班组";
formData.value = reactive({});
title.value = "新增人员";
formData.value = reactive({
personName: "",
sex: 1,
birthday: "",
nation: "",
registerAddress: "",
idCard: "",
issuingAuthorityForIdCard: "",
idCardExpireDate: "",
idCardFront: "",
idCardBack: "",
portrait: "",
phone: "",
address: "",
companySn: "",
teamSn: "",
workerType: null,
personType: 1,
safetyEducation: 1,
isPurchaseInsurance: 1,
isContract: 1,
contractImage: "",
isPhysicalExamination: 1,
bankType: null,
bankCard: "",
realNameCardNumber: "",
bankName: "",
bankCode: "",
politicsStatus: null,
educationLevel: null,
academicDegree: null,
haveMedicalHistory: 1,
natureOfAccount: 1,
maritalStatus: null,
contacts: "",
contactsTel: "",
entryTime: "",
trainingTime: "",
personEmail: ""
});
} else {
title.value = "编辑班组";
title.value = "查看人员";
console.log(row);
const res: any = await classGroupInfo({ id: row.id });
const res: any = await memberInfo({ id: row.id });
res.result.idCardExpireDate = res.result.idCardExpireDate.split(",");
formData.value = reactive({ ...res.result });
}
newMemberDialog.value = true;
};
//
const handleEditItem = async (row: any) => {
getId.value = row.roleId;
drawerVisible.value = true;
const { result = [] } = await getTreemRoleList();
// console.log("test", result);
datas.push(...result);
const res = await getTreeByIdList({ roleId: row.roleId });
//
nextTick(() => {
treeRef.value.setCheckedKeys(res.result.map((item: { authorityId: any }) => item.authorityId));
//
const getGroupList = async () => {
const res = await getClassGroupAll({});
console.log(res);
moveFormConfig.formItemConfig[0].data = res.result.map(item => {
console.log(item);
return {
label: item.teamName,
value: item.teamSn
};
});
};
//
const handleEditItem = async (index: number, row: any) => {
if (index == 1) {
moveVisible.value = true;
} else if (index == 2) {
exitVisible.value = true;
}
objRow.value = row;
};
//
const saveMoveItem = async (form: any) => {
const res = await updateMember(form);
proTable.value.getTableList();
ElMessage.success("编辑成功");
newMemberDialog.value = false;
};
// TODO:
const saveItem = async (form: any) => {
form.engineeringSn = initParam.engineeringSn;
@ -307,12 +470,6 @@ const saveItem = async (form: any) => {
}
newMemberDialog.value = false;
};
//
const deleteGroup = async (params: any) => {
await useHandleData(deleteClassGroup, { id: params.id }, `删除【${params.teamName}`);
proTable.value.getTableList();
};
//
const onUpdate = async row => {
initParam.engineeringSn = row.engineeringSn;
@ -322,5 +479,50 @@ const getengineering = (params: any) => {
// let newParams = JSON.parse(JSON.stringify(params));
return getRelevanceList();
};
onMounted(() => {
getGroupList();
});
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
.title-transform {
display: flex;
align-items: center;
img {
width: 17px;
height: 16px;
}
span {
font-size: 18px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
margin-left: 10px;
}
}
.title-sub {
display: flex;
align-items: center;
margin-top: 10px;
> img {
visibility: hidden;
width: 17px;
height: 16px;
}
> div {
display: flex;
align-items: center;
margin-left: 10px;
img {
width: 18px;
height: 18px;
}
span {
font-size: 12px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #606266;
margin-left: 10px;
}
}
}
</style>

View File

@ -24,7 +24,7 @@ import { ref, reactive, onMounted, onBeforeUnmount, getCurrentInstance, nextTick
import { ElMessage } from "element-plus";
import { getvideoEngTreeList } from "@/api/modules/project";
import { getpreviewURL } from "@/api/modules/common";
import { getpreviewURL, getConfigInfo } from "@/api/modules/common";
import TreeFilter from "@/components/TreeFilter/index.vue";
import { GlobalStore } from "@/stores";
@ -41,10 +41,10 @@ let initCount = ref(0);
let oWebControl = ref(null);
let cameraIndexCode = ref<Array<string>>([]);
let objData = ref({
appkey: "21582859", //appkey
ip: "120.236.122.37", //ip
secret: "CfxWWzB9MEC5y6R5CmWI", //secret
port: 81,
appkey: "24017757", //appkey
ip: "182.101.141.23", //ip
secret: "VJz0FbzmE6drPQ7egsBi", //secret
port: 18443,
playMode: 0, // 0 1
layout: "4x6" //16
});
@ -80,6 +80,20 @@ const getVideo = async () => {
// await sendRequest({ code: cameraIndexCode.value });
await getpreviewURL({ cameraIndexCode: cameraIndexCode.value });
};
//
const getVideoConfig = async () => {
// await sendRequest({ code: cameraIndexCode.value });
const res = await getConfigInfo({});
// objData.value = ref({
// appkey: res.result.appKey, //appkey
// ip: res.result.ip, //ip
// secret: res.result.appSecret, //secret
// port: +res.result.port,
// playMode: 0, // 0 1
// layout: "4x6" //16
// });
// console.log(objData.value);
};
watch(
() => store.editPassword,
@ -91,6 +105,8 @@ watch(
/** 设备列表的点击操作 */
onMounted(async () => {
//
getVideoConfig();
// ee
const pageInstance = getCurrentInstance();
// dom