Merge branch 'bhomebus' of http://192.168.5.5:10010/r/web/vue-smart-ai into bhomebus
| | |
| | | }, |
| | | methods: { |
| | | onSubmit(formName) { |
| | | debugger |
| | | if (this.form.id) { |
| | | // id不为空,修改底库 |
| | | this.$refs[formName].validate(async (valid) => { |
| | |
| | | type: "success", |
| | | }); |
| | | this.$emit("refresh"); |
| | | this.$emit("closeAdd"); |
| | | } else { |
| | | this.$notify({ |
| | | title: "失败", |
| | |
| | | <span |
| | | class="iconfont iconbianjixinxi-09" |
| | | style="font-size: 24px; cursor: pointer" |
| | | @click="handleClick(scope.row)" |
| | | @click="editRow(scope.row)" |
| | | ></span> |
| | | </el-tooltip> |
| | | </fTemplate> |
| | |
| | | <el-drawer title="修改信息" :modal="false" :visible.sync="showInfoDrawer"> |
| | | <el-form |
| | | ref="formForEdit" |
| | | :model="form" |
| | | :model="inputPersonForm" |
| | | label-width="100px" |
| | | :rules="rules" |
| | | > |
| | |
| | | </div> |
| | | </div> |
| | | <img |
| | | v-if="`httpImage/` + form.personPicUrl" |
| | | :src="`/httpImage/` + form.personPicUrl" |
| | | v-if="`httpImage/` + inputPersonForm.personPicUrl" |
| | | :src="`/httpImage/` + inputPersonForm.personPicUrl" |
| | | style=" |
| | | max-height: 100px; |
| | | width: 100px; |
| | |
| | | <el-form-item label="ID" style="width: 100%; margin-bottom: 20px"> |
| | | <el-input |
| | | size="small" |
| | | v-model="form.id" |
| | | v-model="inputPersonForm.id" |
| | | disabled |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="form.picDesc" |
| | | v-model="inputPersonForm.picDesc" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="姓名" style="width: 100%; margin-bottom: 20px"> |
| | | <el-input |
| | | size="small" |
| | | v-model="form.personName" |
| | | v-model="inputPersonForm.personName" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | prop="sex" |
| | | style="width: 100%; margin-bottom: 20px; text-align: left" |
| | | > |
| | | <el-radio-group v-model="form.sex" class="mt10"> |
| | | <el-radio-group v-model="inputPersonForm.sex" class="mt10"> |
| | | <el-radio label="男"></el-radio> |
| | | <el-radio label="女"></el-radio> |
| | | </el-radio-group> |
| | |
| | | <el-col :span="20"> |
| | | <el-form-item |
| | | label="身份证号" |
| | | prop="idCard" |
| | | style="width: 100%; margin-bottom: 20px" |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="form.idCard" |
| | | v-model="inputPersonForm.idCard" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | <el-col :span="20"> |
| | | <el-form-item |
| | | label="手机号" |
| | | prop="phoneNum" |
| | | style="width: 100%; margin-bottom: 20px" |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="form.phoneNum" |
| | | v-model="inputPersonForm.phoneNum" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | > |
| | | <el-select |
| | | size="small" |
| | | v-model="form.monitorLevel" |
| | | v-model="inputPersonForm.monitorLevel" |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | > |
| | |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="form.fromServerId" |
| | | v-model="inputPersonForm.fromServerId" |
| | | disabled |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | > |
| | | <el-input |
| | | size="small" |
| | | v-model="form.createTime" |
| | | v-model="inputPersonForm.createTime" |
| | | disabled |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="其他" style="width: 100%; margin-bottom: 20px"> |
| | | <el-input |
| | | size="small" |
| | | v-model="form.reserved" |
| | | v-model="inputPersonForm.reserved" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | </el-form> |
| | | <div class="dialog-footer"> |
| | | <!-- {{BaseManageData.personList[1].idCard}} --> |
| | | <el-button |
| | | size="small" |
| | | class="cancel-btn" |
| | |
| | | updateDbTableStatus, |
| | | } from "@/api/baseLibrary"; |
| | | import { getCameraFaceData } from "@/api/es"; |
| | | // import { checkIDCard } from "@/api/utils"; |
| | | import { isIDCard, isPhone } from "../../../scripts/validate"; |
| | | |
| | | import axios from "axios"; |
| | | import UploadBtn from "./upload"; |
| | | import fTemplate from "@/components/fTemplate"; |
| | |
| | | }, |
| | | cameraDetailData: [], |
| | | cameraDetailVisible: false, |
| | | dialogFormVisible: false, |
| | | copyVisiabled: false, |
| | | moveVisiabled: false, |
| | | buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], |
| | |
| | | visible: false, |
| | | showInfoDrawer: false, |
| | | selectedRowKeys: [], |
| | | form: { |
| | | id: "", |
| | | sex: "男", |
| | | personName: "呵呵呵", |
| | | tableId: "", |
| | | picDesc: "", |
| | | idCard: "12312938102143253", |
| | | phoneNum: "18712766787", |
| | | monitorLevel: "one", |
| | | faceUrl: "group2/M00/0A/D7/wKgBnFyjH0-AUE5eAAC8hSMP2Yw110.jpg", |
| | | enable: 0, |
| | | reserved: "", |
| | | }, |
| | | inputPersonForm: {}, |
| | | rules: { |
| | | picDesc: [ |
| | | { required: true, message: "请输入照片标识", trigger: "change" }, |
| | | ], |
| | | sex: [{ required: true, message: "请勾选性别", trigger: "change" }], |
| | | idCard: [{ validator: isIDCard, trigger: "blur" }], |
| | | phoneNum: [{ validator: isPhone, trigger: "blur" }], |
| | | monitorLevel: [ |
| | | { required: true, message: "请选择人员等级", trigger: "change" }, |
| | | ], |
| | |
| | | async getPersonList() { |
| | | this.$nextTick(() => { |
| | | if (this.baseObject.id && this.baseObject.id !== undefined) { |
| | | this.BaseManageData.tableId = this.baseObject.id; |
| | | this.setLoadSearch(this.BaseManageData.queryPersonList()); |
| | | } |
| | | }) |
| | | this.BaseManageData.tableId = this.baseObject.id; |
| | | this.setLoadSearch(this.BaseManageData.queryPersonList()); |
| | | } |
| | | }); |
| | | }, |
| | | changeDialog(data) { |
| | | data.erFileList.map((item, index) => { |
| | |
| | | this.BaseManageData.size = val; |
| | | this.getPersonList(); |
| | | }, |
| | | handleClick(row) { |
| | | this.form = row; |
| | | editRow(row) { |
| | | debugger; |
| | | this.inputPersonForm = { ...row }; |
| | | this.showInfoDrawer = true; |
| | | }, |
| | | async submit() { |
| | | this.$refs["formForEdit"].validate(async (valid) => { |
| | | if (valid) { |
| | | let { ...json } = this.form; |
| | | let { ...json } = this.inputPersonForm; |
| | | delete json["compareScore"]; |
| | | let res = await updateBasePerson(json); |
| | | if (res.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "人员修改成功!", |
| | | }); |
| | | this.$notify.success("人员修改成功!"); |
| | | this.showInfoDrawer = false; |
| | | } else { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: "人员修改失败,请重试!!", |
| | | }); |
| | | this.$notify.error("人员修改失败,请重试!"); |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | confirm() { |
| | | this.$confirm({ |
| | | title: "Confirm", |
| | | content: "Bla bla ...", |
| | | okText: "确认", |
| | | cancelText: "取消", |
| | | }); |
| | | }, |
| | | // confirm() { |
| | | // this.$confirm({ |
| | | // title: "Confirm", |
| | | // content: "Bla bla ...", |
| | | // okText: "确认", |
| | | // cancelText: "取消", |
| | | // }); |
| | | // }, |
| | | async enable(item) { |
| | | let res = await updateBasePerson({ |
| | | id: item.id, |
| | |
| | | async updateFace(param) { |
| | | const fd = new FormData(); |
| | | fd.append("file", param.file); |
| | | fd.append("id", this.form.id); |
| | | fd.append("id", this.inputPersonForm.id); |
| | | let res = await axios({ |
| | | method: "post", |
| | | url: `/data/api-v/dbperson/updateFace`, |
| | |
| | | data: fd, |
| | | }); |
| | | if (res.data.success) { |
| | | this.form.persoasyncnPicUrl = res.data.data.personPicUrl; |
| | | this.form.faceFeature = res.data.data.faceFeature; |
| | | this.inputPersonForm.persoasyncnPicUrl = res.data.data.personPicUrl; |
| | | this.inputPersonForm.faceFeature = res.data.data.faceFeature; |
| | | } |
| | | }, |
| | | uploadSuccess() {}, |
| | |
| | | v-show="showType == 'car'" |
| | | ></car-list> |
| | | </div> |
| | | <add-base |
| | | <addBase |
| | | ref="addBase" |
| | | :baseObject="baseForEdit" |
| | | :type="syncType" |
| | | v-if="!showList" |
| | | @refresh="findBaseSync" |
| | | @closeAdd="closeAdd" |
| | | ></add-base> |
| | | ></addBase> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | });
|
| | | const url = this.curUser.backgroundpic;
|
| | | this.activeIcons = this.curUser.useIconType-1
|
| | | this.universalColor = this.colorList.findIndex((x) => {
|
| | | return x.color == localStorage.getItem("--colorCard")
|
| | | })
|
| | | if (url) {
|
| | | // const arr = url.split("/");
|
| | | this.activeBg = this.tableBGList.findIndex((x) => {
|
| | | return x.url == url;
|
| | | });
|
| | |
| | | }).then((res) => {
|
| | | if (res.success) {
|
| | | sessionStorage.setItem("userInfo", JSON.stringify(res.data))
|
| | | debugger
|
| | | this.$message.success(res.msg);
|
| | | }
|
| | | });
|
| | |
| | | if (res.success) {
|
| | | window.parent.postMessage({ msg: "AppUpdate" }, "*");
|
| | | sessionStorage.setItem("userInfo", JSON.stringify(res.data))
|
| | | debugger
|
| | | this.$message.success(res.msg);
|
| | | }
|
| | | });
|
| | |
| | | } |
| | | return callback(new Error("输入的手机号错误")); |
| | | } |
| | | // if (value.trim()) { |
| | | // var pattern = /^1[345789]\d{9}$/ |
| | | // if (pattern.test(value)) { |
| | | // return callback() |
| | | // } |
| | | // return callback(new Error('输入的手机号错误')) |
| | | // } |
| | | }, |
| | | nodeContextMenu(e, data, node, comp) { |
| | | this.showMenu = true; |
| | |
| | | value: item.val,
|
| | | }).then((res) => {
|
| | | if (res.code == 200) {
|
| | | this.$notify.success("更新成功");
|
| | | this.$notify.success("配置成功");
|
| | | }
|
| | | });
|
| | | },
|
| | |
| | | return callback(new Error('输入的手机号错误')) |
| | | } |
| | | |
| | | export function isIDCard(rule, idcode, callback) { |
| | | var weight_factor = [7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2]; |
| | | var check_code = ['1', '0', 'X' , '9', '8', '7', '6', '5', '4', '3', '2']; |
| | | |
| | | var code = idcode + ""; |
| | | var last = idcode[17];//最后一位 |
| | | |
| | | var seventeen = code.substring(0,17); |
| | | |
| | | var arr = seventeen.split(""); |
| | | var len = arr.length; |
| | | var num = 0; |
| | | for(var i = 0; i < len; i++){ |
| | | num = num + +arr[i] * weight_factor[i]; |
| | | } |
| | | |
| | | var resisue = num%11; |
| | | var last_no = check_code[resisue]; |
| | | |
| | | var idcard_patter = /^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/; |
| | | |
| | | var format = idcard_patter.test(idcode); |
| | | return last === last_no && format ? callback() : callback(new Error('身份证号格式错误')); |
| | | } |
| | | |
| | | export function isIPv4(rule, value, callback) { |
| | | if (!value) { |
| | | return callback(new Error('输入不可以为空')); |