From 182aed85616f7ac60d0ffb02e4feac5661b80e0c Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期三, 08 六月 2022 10:40:21 +0800 Subject: [PATCH] 修复初始化页面 --- src/pages/library/components/carList.vue | 1043 +++++++++++++++++++++------------------------------------ 1 files changed, 389 insertions(+), 654 deletions(-) diff --git a/src/pages/library/components/carList.vue b/src/pages/library/components/carList.vue index bb239de..41208c7 100644 --- a/src/pages/library/components/carList.vue +++ b/src/pages/library/components/carList.vue @@ -4,18 +4,12 @@ <div class="base-tip"> <div class="left-tips"> <span class="ku-name">{{ this.baseObject.tableName }}</span> - <span - class="list" - :class=" - this.baseObject.bwType === '1' ? 'black-list' : 'white-list' - " - >{{ this.baseObject.bwType === "1" ? "榛戝悕鍗�" : "鐧藉悕鍗�" }}</span - > + <span class="list" :class="this.baseObject.bwType === '1' ? 'black-list' : 'white-list'">{{ + this.baseObject.bwType === "1" ? "榛戝悕鍗�" : "鐧藉悕鍗�" + }}</span> <span class="ok-time" >鏈夋晥鏃堕棿锛歿{ this.baseObject.startTime }} -- - {{ - this.baseObject.endTime ? this.baseObject.endTime : "姘镐箙鏈夋晥" - }}</span + {{ this.baseObject.endTime ? this.baseObject.endTime : "姘镐箙鏈夋晥" }}</span > </div> @@ -42,12 +36,8 @@ ></span> </el-tooltip> - <el-tooltip content="缂栬緫" placement="top" popper-class="atooltip"> - <span - class="iconfont iconfont-wrap iconbianjiku-09" - @click.stop="edit" - v-if="isShow('library:set')" - ></span> + <el-tooltip content="缂栬緫2" placement="top" popper-class="atooltip"> + <span class="iconfont iconfont-wrap iconbianjiku-09" @click.stop="edit" v-if="isShow('library:set')"></span> </el-tooltip> </div> </div> @@ -69,15 +59,9 @@ v-model="BaseManageData.contentValue" @keyup.enter.native="handleSearch" ></el-input> - <el-button size="small" type="primary" @click="handleSearch" - >鎼滅储</el-button - > + <el-button size="small" type="primary" @click="handleSearch">鎼滅储</el-button> - <el-tooltip - content="鎵归噺鍒犻櫎" - placement="top" - popper-class="atooltip" - > + <el-tooltip content="鎵归噺鍒犻櫎" placement="top" popper-class="atooltip"> <fTemplate authority="library:set"> <span class="iconfont iconfont-wrap iconpiliangshanchu-09" @@ -87,26 +71,12 @@ </fTemplate> </el-tooltip> - <el-tooltip - content="娣诲姞杞﹁締" - placement="top" - popper-class="atooltip" - > - <span - class="iconfont iconfont-wrap icontianjiacheliang-09" - @click="addCar" - ></span> + <el-tooltip content="娣诲姞杞﹁締" placement="top" popper-class="atooltip"> + <span class="iconfont iconfont-wrap icontianjiacheliang-09" @click="addCar"></span> </el-tooltip> - <el-tooltip - content="鎵归噺涓婁紶杞︾墝" - placement="top" - popper-class="atooltip" - > - <span - class="iconfont iconfont-wrap iconshangchuanchepai-09" - @click="addBatch" - ></span> + <el-tooltip content="鎵归噺涓婁紶杞︾墝" placement="top" popper-class="atooltip"> + <span class="iconfont iconfont-wrap iconshangchuanchepai-09" @click="addBatch"></span> </el-tooltip> </div> </div> @@ -126,7 +96,7 @@ background: '#fff', color: '#222222', padding: '2px 1px', - borderBottom: 'none', + borderBottom: 'none' }" > <el-table-column type="selection" width="30"></el-table-column> @@ -146,15 +116,8 @@ indicator-position="none" :arrow="scope.row.carUrls.length > 1 ? 'always' : 'never'" > - <el-carousel-item - v-for="(item, index) in scope.row.carUrls" - :key="index" - > - <img - style="width: 100px; height: 100px; object-fit: contain" - :src="item.url" - alt - /> + <el-carousel-item v-for="(item, index) in scope.row.carUrls" :key="index"> + <img style="width: 100px; height: 100px; object-fit: contain" :src="item.url" alt /> </el-carousel-item> </el-carousel> </template> @@ -170,13 +133,7 @@ ></el-switch> </template> </el-table-column> - <el-table-column - prop="carNo" - label="杞︾墝鍙�" - sortable - align="center" - width="120" - ></el-table-column> + <el-table-column prop="carNo" label="杞︾墝鍙�" sortable align="center" width="120"></el-table-column> <el-table-column prop="carType" label="杞﹁締绫诲瀷" @@ -185,21 +142,8 @@ sortable align="center" ></el-table-column> - <el-table-column - prop="carBrand" - label="杞﹁締鍝佺墝" - min-width="100" - sortable - align="center" - ></el-table-column> - <el-table-column - prop="carColor" - label="杞﹁韩棰滆壊" - width="100" - show-overflow-tooltip - sortable - align="center" - > + <el-table-column prop="carBrand" label="杞﹁締鍝佺墝" min-width="100" sortable align="center"></el-table-column> + <el-table-column prop="carColor" label="杞﹁韩棰滆壊" width="100" show-overflow-tooltip sortable align="center"> <template slot-scope="scope">{{ getDataName(VideoPhotoData.dictionary.nColor, scope.row.carColor) }}</template> @@ -212,12 +156,7 @@ sortable align="center" ></el-table-column> - <el-table-column - prop="sex" - label="杞︿富鎬у埆" - align="center" - width="80" - ></el-table-column> + <el-table-column prop="sex" label="杞︿富鎬у埆" align="center" width="80"></el-table-column> <el-table-column prop="createTime" @@ -231,11 +170,7 @@ <el-table-column label="鎿嶄綔" min-width="200" align="center"> <template slot-scope="scope"> <fTemplate authority="library:set"> - <el-tooltip - content="缂栬緫" - placement="top" - popper-class="atooltip" - > + <el-tooltip content="缂栬緫" placement="top" popper-class="atooltip"> <span class="iconfont iconbianjixinxi-09" style=" font-size: 24px;cursor: pointer" @@ -243,68 +178,36 @@ ></span> </el-tooltip> </fTemplate> - <el-popover - placement="top" - trigger="click" - popper-class="popper-caozuo1" - > - <el-tooltip - content="鏌ユ壘姝よ溅" - placement="top" - popper-class="atooltip" - > + <el-popover placement="top" trigger="click" popper-class="popper-caozuo1"> + <el-tooltip content="鏌ユ壘姝よ溅" placement="top" popper-class="atooltip"> + <span class="iconfont iconchazhaociren-09" @click="tosearch(scope.row)"></span> + </el-tooltip> + <fTemplate authority="library:set"> + <el-tooltip content="澶嶅埗" placement="top" popper-class="atooltip"> + <span class="iconfont iconfuzhi-09" title="澶嶅埗" @click="copyClick(scope.row)"></span> + </el-tooltip> + </fTemplate> + <fTemplate authority="library:set"> + <el-tooltip content="绉诲姩" placement="top" popper-class="atooltip"> + <span class="iconfont iconyidong-09" title="绉诲姩" @click="moveClick(scope.row)"></span> + </el-tooltip> + </fTemplate> + <fTemplate authority="library:set"> + <el-tooltip content="鍒犻櫎" placement="top" popper-class="atooltip"> + <span + class="iconfont iconshanchu-09" + style="color: #e74c3c" + @click="askDelete('single', scope.row.id)" + title="鍒犻櫎" + ></span> + </el-tooltip> + </fTemplate> <span - class="iconfont iconchazhaociren-09" - @click="tosearch(scope.row)" - ></span> - </el-tooltip> - <fTemplate authority="library:set"> - <el-tooltip - content="澶嶅埗" - placement="top" - popper-class="atooltip" - > - <span - class="iconfont iconfuzhi-09" - title="澶嶅埗" - @click="copyClick(scope.row)" - ></span> - </el-tooltip> - </fTemplate> - <fTemplate authority="library:set"> - <el-tooltip - content="绉诲姩" - placement="top" - popper-class="atooltip" - > - <span - class="iconfont iconyidong-09" - title="绉诲姩" - @click="moveClick(scope.row)" - ></span> - </el-tooltip> - </fTemplate> - <fTemplate authority="library:set"> - <el-tooltip - content="鍒犻櫎" - placement="top" - popper-class="atooltip" - > - <span - class="iconfont iconshanchu-09" - style="color: #e74c3c" - @click="deleteThis(scope.row.id)" - title="鍒犻櫎" - ></span> - </el-tooltip> - </fTemplate> - <span slot="reference" class="iconfont icongengduocaozuo-09" style="font-size: 24px; cursor: pointer" ></span> </el-popover> - </template> </el-table-column> </el-table> @@ -316,48 +219,26 @@ :total="BaseManageData.total" ></el-pagination> </div> - <el-dialog - title="鎻愮ず" - :visible.sync="dialogVisible" - :append-to-body="true" - :close="getCarList" - width="30%" - > + <el-dialog title="鎻愮ず" :visible.sync="dialogVisible" :append-to-body="true" :close="getCarList" width="30%"> <div> <div class="tl"> <span>涓婁紶鎴愬姛鐨勬暟閲忥細{{ uploadResult.successList.length }}</span> </div> <div class="flex-box mt10"> <span>涓婁紶澶辫触鐨勬暟閲忥細{{ uploadResult.failList.length }}</span> - <div - class="ml20" - v-for="(i, index) in uploadResult.failList" - :key="index" - > + <div class="ml20" v-for="(i, index) in uploadResult.failList" :key="index"> {{ i }} </div> </div> <div class="flex-box mt10"> - <span - >鍖呭惈澶氬紶浜鸿劯鐨勫浘鐗囨暟閲忥細{{ - uploadResult.multiFaceList.length - }}</span - > - <div - class="ml20" - v-for="(i, index) in uploadResult.multiFaceList" - :key="index" - > + <span>鍖呭惈澶氬紶浜鸿劯鐨勫浘鐗囨暟閲忥細{{ uploadResult.multiFaceList.length }}</span> + <div class="ml20" v-for="(i, index) in uploadResult.multiFaceList" :key="index"> {{ i }} </div> </div> <div class="flex-box mt10"> <span>涓嶅惈浜鸿劯鐨勫浘鐗囨暟閲忥細{{ uploadResult.noFaceList.length }}</span> - <div - class="ml20" - v-for="(i, index) in uploadResult.noFaceList" - :key="index" - > + <div class="ml20" v-for="(i, index) in uploadResult.noFaceList" :key="index"> {{ i }} </div> </div> @@ -379,21 +260,11 @@ <p>榛戝悕鍗� ></p> </div> <div class="baseList"> - <el-checkbox-group - v-model="BaseManageData.selectBlacks" - @change="blackAngWhite" - > - <div - class="base" - v-for="(item, index) in BaseManageData.blackList" - :key="index" - > - <el-checkbox - :label="item.value" - :title="item.title" - :disabled="item.disabled" - >{{ item.title }}</el-checkbox - > + <el-checkbox-group v-model="BaseManageData.selectBlacks" @change="blackAngWhite"> + <div class="base" v-for="(item, index) in BaseManageData.blackList" :key="index"> + <el-checkbox :label="item.value" :title="item.title" :disabled="item.disabled">{{ + item.title + }}</el-checkbox> </div> </el-checkbox-group> </div> @@ -403,21 +274,11 @@ <p>鐧藉悕鍗� ></p> </div> <div class="baseList"> - <el-checkbox-group - v-model="BaseManageData.selectWhites" - @change="blackAngWhite" - > - <div - class="base" - v-for="(item, index) in BaseManageData.whiteList" - :key="index" - > - <el-checkbox - :label="item.value" - :title="item.title" - :disabled="item.disabled" - >{{ item.title }}</el-checkbox - > + <el-checkbox-group v-model="BaseManageData.selectWhites" @change="blackAngWhite"> + <div class="base" v-for="(item, index) in BaseManageData.whiteList" :key="index"> + <el-checkbox :label="item.value" :title="item.title" :disabled="item.disabled">{{ + item.title + }}</el-checkbox> </div> </el-checkbox-group> </div> @@ -425,9 +286,7 @@ </div> <div slot="footer" class="dialog-footer"> <el-button size="small" @click="copyClose" type="info">鍙� 娑�</el-button> - <el-button size="small" type="primary" @click="copySubmit()" - >纭� 瀹�</el-button - > + <el-button size="small" type="primary" @click="copySubmit()">纭� 瀹�</el-button> </div> </el-dialog> @@ -446,22 +305,11 @@ <p>榛戝悕鍗� ></p> </div> <div class="baseList"> - <el-checkbox-group - v-model="BaseManageData.selectBlacks" - @change="blackAngWhite" - :max="1" - > - <div - class="base" - v-for="(item, index) in BaseManageData.blackList" - :key="index" - > - <el-checkbox - :label="item.value" - :title="item.title" - :disabled="item.disabled" - >{{ item.title }}</el-checkbox - > + <el-checkbox-group v-model="BaseManageData.selectBlacks" @change="blackAngWhite" :max="1"> + <div class="base" v-for="(item, index) in BaseManageData.blackList" :key="index"> + <el-checkbox :label="item.value" :title="item.title" :disabled="item.disabled">{{ + item.title + }}</el-checkbox> </div> </el-checkbox-group> </div> @@ -471,22 +319,11 @@ <p>鐧藉悕鍗� ></p> </div> <div class="baseList"> - <el-checkbox-group - v-model="BaseManageData.selectWhites" - @change="blackAngWhite" - :max="1" - > - <div - class="base" - v-for="(item, index) in BaseManageData.whiteList" - :key="index" - > - <el-checkbox - :label="item.value" - :title="item.title" - :disabled="item.disabled" - >{{ item.title }}</el-checkbox - > + <el-checkbox-group v-model="BaseManageData.selectWhites" @change="blackAngWhite" :max="1"> + <div class="base" v-for="(item, index) in BaseManageData.whiteList" :key="index"> + <el-checkbox :label="item.value" :title="item.title" :disabled="item.disabled">{{ + item.title + }}</el-checkbox> </div> </el-checkbox-group> </div> @@ -494,17 +331,11 @@ </div> <div slot="footer" class="dialog-footer"> <el-button size="small" @click="moveClose" type="info">鍙� 娑�</el-button> - <el-button size="small" type="primary" @click="moveSubmit()" - >纭� 瀹�</el-button - > + <el-button size="small" type="primary" @click="moveSubmit()">纭� 瀹�</el-button> </div> </el-dialog> - <el-dialog - :visible.sync="askDeleteShow" - :center="true" - custom-class="del-dialog" - > + <el-dialog :visible.sync="askDeleteShow" :center="true" custom-class="del-dialog"> <div> <div class="suc-icon"> <i class="iconfont icongantanhao1"></i> @@ -516,7 +347,7 @@ </div> <span slot="footer" class="dialog-footer"> <el-button @click="askDeleteShow = false">鍙� 娑�</el-button> - <el-button type="primary" @click="handleDel">纭� 瀹�</el-button> + <el-button type="primary" @click="handleDel" :loading="delBtnLoading">纭� 瀹�</el-button> </span> </el-dialog> @@ -566,18 +397,10 @@ :rule="rules" > <el-form-item label="杞︾墝鍙�" prop="carNo"> - <el-input - placeholder="璇疯緭鍏ヨ溅鐗屽彿" - v-model="form.carNo" - class="inputWidth" - ></el-input> + <el-input placeholder="璇疯緭鍏ヨ溅鐗屽彿" v-model="form.carNo" class="inputWidth"></el-input> </el-form-item> <el-form-item label="杞﹁締绫诲瀷"> - <el-select - v-model="form.carType" - placeholder="璇烽�夋嫨杞﹁締绫诲瀷" - class="inputWidth" - > + <el-select v-model="form.carType" placeholder="璇烽�夋嫨杞﹁締绫诲瀷" class="inputWidth"> <el-option v-for="item in VideoPhotoData.dictionary.CARTYPE" :key="item.value" @@ -587,11 +410,7 @@ </el-select> </el-form-item> <el-form-item label="杞﹁締鍝佺墝"> - <el-select - v-model="form.carBrand" - placeholder="璇烽�夋嫨杞﹁締鍝佺墝" - class="inputWidth" - > + <el-select v-model="form.carBrand" placeholder="璇烽�夋嫨杞﹁締鍝佺墝" class="inputWidth"> <el-option v-for="item in VideoPhotoData.dictionary.BRAND" :key="item.value" @@ -601,11 +420,7 @@ </el-select> </el-form-item> <el-form-item label="杞﹁韩棰滆壊"> - <el-select - v-model="form.carColor" - placeholder="璇烽�夋嫨杞﹁韩棰滆壊" - class="inputWidth" - > + <el-select v-model="form.carColor" placeholder="璇烽�夋嫨杞﹁韩棰滆壊" class="inputWidth"> <el-option v-for="item in VideoPhotoData.dictionary.nColor" :key="item.value" @@ -643,20 +458,8 @@ </el-form-item> --> </el-form> <div class="dialog-footer"> - <el-button - size="small" - class="sure-btn" - type="primary" - @click="submitCar" - >纭� 瀹�</el-button - > - <el-button - size="small" - class="cancel-btn" - @click="resetForm" - type="info" - >鍙� 娑�</el-button - > + <el-button size="small" class="sure-btn" type="primary" @click="submitCar">纭� 瀹�</el-button> + <el-button size="small" class="cancel-btn" @click="resetForm" type="info">鍙� 娑�</el-button> </div> </el-drawer> @@ -690,20 +493,8 @@ </div> </div> <div class="dialog-footer"> - <el-button - size="small" - class="sure-btn" - type="primary" - @click="platesBatch" - >淇濆瓨</el-button - > - <el-button - size="small" - class="cancel-btn" - @click="resetForm('ruleForm')" - type="info" - >鍙栨秷</el-button - > + <el-button size="small" class="sure-btn" type="primary" @click="platesBatch">淇濆瓨</el-button> + <el-button size="small" class="cancel-btn" @click="resetForm('ruleForm')" type="info">鍙栨秷</el-button> </div> </el-drawer> </div> @@ -715,23 +506,46 @@ deleteBasePersons, plateBatch, updateDbTableStatus, -} from "@/api/baseLibrary"; -import axios from "axios"; -import Upload from "./upload"; -import fTemplate from "@/components/fTemplate"; -import request from "@/scripts/httpRequest"; + deleteDbPersonById, + deleteDBtablesById +} from "@/api/baseLibrary" +import axios from "axios" +import fTemplate from "@/components/fTemplate" +import request from "@/scripts/httpRequest" export default { components: { - fTemplate, + fTemplate }, props: { baseObject: { default: () => {}, - type: Object, + type: Object }, syncType: { - type: String, + type: String + } + }, + + computed: { + isAdmin() { + if (sessionStorage.getItem("userInfo") && sessionStorage.getItem("userInfo") !== "") { + let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username + return loginName === "superadmin" || loginName === "basic" + } + return false }, + delText() { + switch (this.delType) { + case "base": + return ["鍒犻櫎搴曞簱", "纭畾鍒犻櫎璇ュ簳搴擄紵"] + case "single": + return ["鍒犻櫎杞﹁締淇℃伅", "纭畾鍒犻櫎璇ヨ溅杈嗕俊鎭紵"] + case "batch": + return ["鎵归噺鍒犻櫎", "纭畾鍒犻櫎璇ュ簳搴撻�変腑鐨勮溅杈嗕俊鎭紵"] + default: + return ["", ""] + } + } }, data() { return { @@ -744,12 +558,12 @@ fileList: [ { name: "fasjido.jpg", - url: "group2/M00/0A/D7/wKgBnFyjH0-AUE5eAAC8hSMP2Yw110.jpg", + url: "group2/M00/0A/D7/wKgBnFyjH0-AUE5eAAC8hSMP2Yw110.jpg" }, { name: "fasjido.jpg", - url: "group2/M00/0A/D7/wKgBnFyjH0-AUE5eAAC8hSMP2Yw110.jpg", - }, + url: "group2/M00/0A/D7/wKgBnFyjH0-AUE5eAAC8hSMP2Yw110.jpg" + } ], copyVisiabled: false, moveVisiabled: false, @@ -782,14 +596,10 @@ carBrand: "0", carNo: "", enable: 0, - reserved: "", + reserved: "" }, rules: { - carNo: [{ required: true, message: "璇疯緭鍏ヨ溅鐗屽彿", trigger: "change" }], - // sex: [{ required: true, message: "璇峰嬀閫夋�у埆", trigger: "change" }], - // monitorLevel: [ - // { required: true, message: "璇烽�夋嫨浜哄憳绛夌骇", trigger: "change" }, - // ], + carNo: [{ required: true, message: "璇疯緭鍏ヨ溅鐗屽彿", trigger: "change" }] }, tableData: [], oldWidth: "", @@ -802,144 +612,142 @@ failList: [], successList: [], multiFaceList: [], - noFaceList: [], + noFaceList: [] }, - }; + delBtnLoading: false + } }, - computed: { - isAdmin() { - if ( - sessionStorage.getItem("userInfo") && - sessionStorage.getItem("userInfo") !== "" - ) { - let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username; - return loginName === "superadmin" || loginName === "basic"; - } - return false; + watch: { + "BaseManageData.selectBlacks": function(value) { + this.blackAngWhite() }, - delText() { - switch (this.delType) { - case "base": - return ["鍒犻櫎搴曞簱", "纭畾鍒犻櫎璇ュ簳搴擄紵"]; - case "single": - return ["鍒犻櫎浜哄憳", "纭畾鍒犻櫎璇ュ簳搴撲汉鍛橈紵"]; - case "batch": - return ["鎵归噺鍒犻櫎", "纭畾鍒犻櫎璇ュ簳搴撻�変腑浜哄憳锛�"]; - default: - return ["", ""]; + "BaseManageData.selectWhites": function(value) { + this.blackAngWhite() + } + }, + mounted() { + this.getCarList() + this.VideoPhotoData.queryDictionary() + this.BaseManageData.queryTagList() + this.oldWidth = document.body.clientWidth + this.oldHeight = document.body.clientHeight + this.blackAngWhite() + window.onresize = () => { + let width = document.body.clientWidth + let height = document.body.clientHeight + if (width !== this.oldWidth && width < 1750) { } - }, + this.$nextTick(() => { + this.$refs.multipleTable.doLayout() + }) + } + this.$nextTick(() => { + this.$refs.multipleTable.doLayout() + }) + }, + beforeDestroy() { + window.onresize = null }, methods: { - handleDel() { + async handleDel() { + this.delBtnLoading = true if (this.delType == "single") { - this.deleteThis(); + await this.deleteThis() } else if (this.delType == "base") { - this.deleteBase(); + await this.deleteBase() } else if (this.delType == "batch") { - this.deleteBatch(); + await this.deleteBatch() } + + this.delBtnLoading = false + this.askDeleteShow = false }, deleteBase() { - let token = - sessionStorage.getItem("loginedInfo") && - JSON.parse(sessionStorage.getItem("loginedInfo")).access_token; - fetch(`/data/api-v/dbtable/deleteDBtablesById?id=${this.baseObject.id}`, { - method: "GET", - headers: { - "Content-Type": "application/json", - Authorization: token, - }, - }) - .then((res) => { - return res.json(); - }) + deleteDBtablesById({ id: this.baseObject.id }) .then((res) => { if (res.success) { this.$notify({ type: "success", - message: "搴曞簱鍒犻櫎鎴愬姛锛�", - }); + message: "搴曞簱鍒犻櫎鎴愬姛锛�" + }) } - this.askDeleteShow=false - this.$emit("onDelete"); + this.askDeleteShow = false + this.$emit("onDelete") }) .catch((err) => { this.$notify({ type: "error", - message: err, - }); - }); + message: err + }) + }) }, handleRemoveCarPic(file, fileList) { var index = fileList.findIndex((item) => { if (item.uid == file.uid) { - return true; + return true } - }); - this.form.carUrls.splice(index, 1); + }) + this.form.carUrls.splice(index, 1) }, isDisabled(item) { - var flag = true; + var flag = true if (this.isShow("library:set")) { if (item.endTime == "") { - flag = false; + flag = false } else { - flag = !this.$moment(new Date()).isBetween( - item.startTime, - item.endTime - ); + flag = !this.$moment(new Date()).isBetween(item.startTime, item.endTime) } } - return flag; + return flag }, handleRemoveFacePic(file, fileList) { - this.form.faceUrl.splice(0, 1); + this.form.faceUrl.splice(0, 1) }, edit() { - this.$emit("changeShow", this.baseObject, this.syncType); + this.$emit("changeShow", this.baseObject, this.syncType) }, // beforeUoload() {}, handlePictureCardPreview(file) { - this.dialogImageUrl = file.url; - this.dialogVisible = true; + this.dialogImageUrl = file.url + this.dialogVisible = true }, async uploadCar(param) { - const fd = new FormData(); - fd.append("file", param.file); - fd.append("picType", "0"); + const fd = new FormData() + fd.append("file", param.file) + fd.append("picType", "0") let res = await request({ method: "post", url: `/data/api-v/dbperson/fileupload`, - data: fd, - }); + data: fd + }) if (res.success) { - this.form.carUrls.push({ url: "/httpImage/" + res.data.picUrl }); + this.form.carUrls.push({ url: "/httpImage/" + res.data.picUrl }) } }, async uploadPerson(param) { - const fd = new FormData(); - fd.append("file", param.file); - fd.append("picType", "1"); + const fd = new FormData() + fd.append("file", param.file) + fd.append("picType", "1") let res = await request({ method: "post", url: `/data/api-v/dbperson/fileupload`, - data: fd, - }); + data: fd + }) + debugger if (res.success) { - this.form.faceUrl.push({ url: "/httpImage/" + res.data.picUrl }); - this.form.faceFeature = res.data.faceFeature; + this.form.faceUrl.push({ url: "/httpImage/" + res.data.picUrl }) + this.form.faceFeature = res.data.faceFeature } }, addCar() { - this.addDrawer = true; + this.addDrawer = true }, addBatch() { - this.addBatchDrawer = true; + this.addBatchDrawer = true }, resetForm() {}, handleClose1(done) { - (this.form = { + ;(this.form = { id: "", sex: "鐢�", name: "", @@ -958,120 +766,106 @@ carBrand: "0", carNo: "", enable: 0, - reserved: "", + reserved: "" }), - done(); + done() }, handleClose2(done) { - done(); + done() }, isShow(authority) { - return ( - this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 - ); + return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 }, toggleSelection(rows) { if (rows) { rows.forEach((row) => { - this.$refs.multipleTable.toggleRowSelection(row); - }); + this.$refs.multipleTable.toggleRowSelection(row) + }) } else { - this.$refs.multipleTable.clearSelection(); + this.$refs.multipleTable.clearSelection() } }, deleteThis() { - let token = - sessionStorage.getItem("loginedInfo") && - JSON.parse(sessionStorage.getItem("loginedInfo")).access_token; - fetch(`/data/api-v/dbperson/deleteDbPersonById?id=${this.toDeleteId}`, { - method: "GET", - headers: { - "Content-Type": "application/json", - Authorization: token, - }, - }) - .then((res) => { - return res.json(); - }) + deleteDbPersonById({ id: this.toDeleteId }) .then((data) => { if (data.success) { this.$notify({ type: "success", - message: "璇ヤ汉鍛樺垹闄ゆ垚鍔燂紒", - }); + message: "杞﹁締淇℃伅鍒犻櫎鎴愬姛锛�" + }) } - this.getCarList(); + this.getCarList() }) - .catch((err) => {}); + .catch((err) => {}) }, getUploadResult(result) { - this.uploadResult = result.data; - this.dialogVisible = true; - this.getCarList(); + this.uploadResult = result.data + this.dialogVisible = true + this.getCarList() }, async getCarList() { 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.$notify({ type: "error", - message: item.errorMsg.message, - }); - }); + message: item.errorMsg.message + }) + }) }, handleClose() { - this.dialogFormVisible = false; + this.dialogFormVisible = false }, handleSelectionChange(val) { - this.selectedRowKeys = val; + this.selectedRowKeys = val }, refrash(current, pageSize) { - this.current = current; - this.BaseManageData.page = current; - this.getCarList(); + this.current = current + this.BaseManageData.page = current + this.getCarList() }, handleClick(row) { - this.form = row; + this.form = row // 杩欏潡鍎垮悗鍙扮殑瀛楀吀value鍊兼湁闂锛岄渶瑕佸墠绔潵鍥炶浆 - this.form.carColor += ""; - this.form.carType += ""; - this.form.carBrand += ""; - this.addDrawer = true; + this.form.carColor += "" + this.form.carType += "" + this.form.carBrand += "" + this.addDrawer = true }, async submit() { this.$refs["formForEdit"].validate(async (valid) => { if (valid) { - let { ...json } = this.form; - delete json["compareScore"]; - let res = await updateBasePerson(json); + let { ...json } = this.form + delete json["compareScore"] + let res = await updateBasePerson(json) if (res.success) { this.$notify({ type: "success", - message: "浜哄憳淇敼鎴愬姛锛�", - }); - this.dialogFormVisible = false; + message: "杞﹁締淇℃伅淇敼鎴愬姛锛�" + }) + this.dialogFormVisible = false } else { this.$notify({ type: "error", - message: "浜哄憳淇敼澶辫触锛岃閲嶈瘯锛侊紒", - }); + message: "杞﹁締淇℃伅淇敼澶辫触锛岃閲嶈瘯锛侊紒" + }) } } else { - return false; + return false } - }); + }) }, confirm() { this.$confirm({ title: "Confirm", content: "Bla bla ...", okText: "纭", - cancelText: "鍙栨秷", - }); + cancelText: "鍙栨秷" + }) }, async enable(item) { let res = await updateBasePerson({ @@ -1084,44 +878,44 @@ phoneNum: item.phoneNum, monitorLevel: item.monitorLevel, personPicUrl: item.personPicUrl, - reserved: item.reserved, - }); + reserved: item.reserved + }) if (res.success) { this.$notify({ type: "success", - message: "搴曞簱浜哄憳鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒", - }); + message: "杞﹁締淇℃伅鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒" + }) } else { this.$notify({ type: "error", - message: "搴曞簱浜哄憳鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒", - }); + message: "杞﹁締淇℃伅鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒" + }) } }, handleSearch() { - this.getCarList(); + this.getCarList() }, searchImg() { - this.$refs.uploadDrag && this.$refs.uploadDrag.uploadStart(); + this.$refs.uploadDrag && this.$refs.uploadDrag.uploadStart() }, haveScore(row) { - return row.compareScore && row.compareScore !== ""; + return row.compareScore && row.compareScore !== "" }, async setEnable(item) { let res = await updateDbTableStatus({ id: item.id, - enable: item.enable, - }); + enable: item.enable + }) if (res.success) { this.$notify({ type: "success", - message: "搴曞簱鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒", - }); + message: "搴曞簱鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒" + }) } else { this.$notify({ type: "error", - message: "搴曞簱鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒", - }); + message: "搴曞簱鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒" + }) } }, async searchImgList(faceUrl, threshold) { @@ -1132,65 +926,61 @@ faceUrl: faceUrl, threshold: threshold, orderType: this.orderType, - orderName: this.orderName, - }; - let res = await getPersonByPhoto(json); - this.tableData = res.data.datalist; - this.total = res.data.total; - this.compare = true; + orderName: this.orderName + } + let res = await getPersonByPhoto(json) + this.tableData = res.data.datalist + this.total = res.data.total + this.compare = true }, // updateThreshold() {}, async updateFace(param) { - const fd = new FormData(); - fd.append("file", param.file); - fd.append("id", this.form.id); + const fd = new FormData() + fd.append("file", param.file) + fd.append("id", this.form.id) let res = await axios({ method: "post", url: `/data/api-v/dbperson/updateFace`, headers: { Authorization: - sessionStorage.getItem("loginedInfo") && - JSON.parse(sessionStorage.getItem("loginedInfo")).access_token, + sessionStorage.getItem("loginedInfo") && JSON.parse(sessionStorage.getItem("loginedInfo")).access_token }, - data: fd, - }); + data: fd + }) if (res.data.success) { - this.form.personPicUrl = res.data.data.personPicUrl; - this.form.faceFeature = res.data.data.faceFeature; + this.form.personPicUrl = res.data.data.personPicUrl + this.form.faceFeature = res.data.data.faceFeature } }, async deleteBatch() { - let ids = []; + let ids = [] this.selectedRowKeys.map((item, index) => { - ids.push(item.id); - }); - let res = await deleteBasePersons(ids); + ids.push(item.id) + }) + let res = await deleteBasePersons({ ids: ids }) if (res.success) { this.$notify({ type: "success", - message: "鍒犻櫎鎴愬姛锛�", - }); - this.getCarList(); + message: "鍒犻櫎鎴愬姛锛�" + }) + this.getCarList() } else { this.$notify({ type: "error", - message: "鍒犻櫎澶辫触锛�", - }); + message: "鍒犻櫎澶辫触锛�" + }) } }, async init() { - await this.BaseManageData.querySyncTables(); - await this.BaseManageData.queryLocalTables(); + await this.BaseManageData.querySyncTables() + await this.BaseManageData.queryLocalTables() if (this.baseObject.id && this.baseObject.id !== undefined) { - } else if ( - this.BaseManageData.syncTables[0].id && - this.BaseManageData.syncTables[0].id !== undefined - ) { - this.BaseManageData.tableId = this.BaseManageData.syncTables[0].id; - this.BaseManageData.queryPersonList(); + } else if (this.BaseManageData.syncTables[0].id && this.BaseManageData.syncTables[0].id !== undefined) { + this.BaseManageData.tableId = this.BaseManageData.syncTables[0].id + this.BaseManageData.queryPersonList() } else { - this.BaseManageData.tableId = this.BaseManageData.localTables[0].id; - this.BaseManageData.queryPersonList(); + this.BaseManageData.tableId = this.BaseManageData.localTables[0].id + this.BaseManageData.queryPersonList() } }, askDelete(typ, id) { @@ -1198,289 +988,238 @@ if (this.selectedRowKeys.length === 0) { this.$notify({ type: "warning", - message: "璇烽�夋嫨瑕佸垹闄ょ殑浜哄憳", - }); - return; + message: "璇烽�夋嫨瑕佸垹闄ょ殑杞﹁締淇℃伅" + }) + return } } - this.askDeleteShow = true; - this.delType = typ; - id && (this.toDeleteId = id); + this.askDeleteShow = true + this.delType = typ + id && (this.toDeleteId = id) }, blackAngWhite() { if (this.BaseManageData.selectBlacks.length > 0) { for (let i = 0; i < this.BaseManageData.whiteList.length; i++) { //this.VideoPhotoData.whiteList[i].disabled = true - this.$set(this.BaseManageData.whiteList[i], "disabled", true); + this.$set(this.BaseManageData.whiteList[i], "disabled", true) } } if (this.BaseManageData.selectBlacks.length == 0) { for (let i = 0; i < this.BaseManageData.whiteList.length; i++) { //this.VideoPhotoData.whiteList[i].disabled = false - this.$set(this.BaseManageData.whiteList[i], "disabled", false); + this.$set(this.BaseManageData.whiteList[i], "disabled", false) } } if (this.BaseManageData.selectWhites.length > 0) { for (let i = 0; i < this.BaseManageData.blackList.length; i++) { // this.VideoPhotoData.blackList[i].disabled = true - this.$set(this.BaseManageData.blackList[i], "disabled", true); + this.$set(this.BaseManageData.blackList[i], "disabled", true) } } if (this.BaseManageData.selectWhites.length == 0) { for (let i = 0; i < this.BaseManageData.blackList.length; i++) { //this.VideoPhotoData.blackList[i].disabled = false - this.$set(this.BaseManageData.blackList[i], "disabled", false); + this.$set(this.BaseManageData.blackList[i], "disabled", false) } } }, tosearch(item) { - var curWwwPath = window.document.location.href; - var pathname = window.document.location.pathname; - var pos = curWwwPath.indexOf(pathname); - var localhostPath = curWwwPath.substring(0, pos); //ip+port - var href = localhostPath + "/Layout/Searching"; - let captureId = item.id == "" ? item.personId : item.id; - var url = item.personPicUrl ? item.personPicUrl : item.personPicUrl; - var compType = 0; - window.open( - href + - "?showType=findByPic&targetId=" + - captureId + - "&picSmUrl=" + - url + - "&compType=" + - compType - ); + var curWwwPath = window.document.location.href + var pathname = window.document.location.pathname + var pos = curWwwPath.indexOf(pathname) + var localhostPath = curWwwPath.substring(0, pos) //ip+port + var href = localhostPath + "/Layout/Searching" + let captureId = item.id == "" ? item.personId : item.id + var url = item.personPicUrl ? item.personPicUrl : item.personPicUrl + var compType = 0 + window.open(href + "?showType=findByPic&targetId=" + captureId + "&picSmUrl=" + url + "&compType=" + compType) }, async platesBatch() { - var temp = this.plates.split(/[\n,]/g); - var reg = /[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹绮ら潚钘忓窛瀹佺惣浣块]{1}[A-Z]{1}[A-Z0-9]{5,6}/; + var temp = this.plates.split(/[\n,]/g) + var reg = /[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹绮ら潚钘忓窛瀹佺惣浣块]{1}[A-Z]{1}[A-Z0-9]{5,6}/ for (let i = 0; i < temp.length; i++) { if (temp[i] == "") { - temp.splice(i, 1); - i--; + temp.splice(i, 1) + i-- } else { if (!reg.test(temp[i])) { this.$notify({ type: "error", - message: "杞︾墝鍙�:" + temp[i] + "涓嶇鍚堣鍒欙紝璇锋鏌�!", - }); - return; + message: "杞︾墝鍙�:" + temp[i] + "涓嶇鍚堣鍒欙紝璇锋鏌�!" + }) + return } } } if (temp.length == 0) { this.$notify({ type: "error", - message: "璇疯緭鍏ヨ溅鐗屽彿", - }); - return; + message: "璇疯緭鍏ヨ溅鐗屽彿" + }) + return } let param = { tableId: this.baseObject.id, - carNos: temp, - }; - let resp = await plateBatch(param); + carNos: temp + } + let resp = await plateBatch(param) if (resp && resp.success) { // 鍒锋柊car鍒楄〃 this.$notify({ type: "success", - message: resp.msg, - }); - this.getCarList(); - this.addBatchDrawer = false; + message: resp.msg + }) + this.getCarList() + this.addBatchDrawer = false } else { this.$notify({ type: "error", - message: resp.msg, - }); + message: resp.msg + }) } }, async submitCar() { this.$refs["formForCar"].validate(async (valid) => { if (valid) { - let { ...json } = this.form; + let { ...json } = this.form for (let index in json.carUrls) { if (index == 0) { - json.carPicUrls += json.carUrls[index].url.substring(11); + json.carPicUrls += json.carUrls[index].url.substring(11) } else { - json.carPicUrls += ";" + json.carUrls[index].url.substring(11); + json.carPicUrls += ";" + json.carUrls[index].url.substring(11) } } - json.carColor = parseInt(json.carColor); - json.carType = parseInt(json.carType); - json.carBrand = parseInt(json.carBrand); - json.personPicUrl = json.faceUrl[0].url.substring(11); - json.tableId = this.baseObject.id; - delete json["compareScore"]; - let res; + json.carColor = parseInt(json.carColor) + json.carType = parseInt(json.carType) + json.carBrand = parseInt(json.carBrand) + debugger + json.personPicUrl = json.faceUrl[0].url.substring(11) + json.tableId = this.baseObject.id + delete json["compareScore"] + let res if (json.id == "") { - res = await addBaseCar(json); + res = await addBaseCar(json) } else { - res = await updateBaseCar(json); + res = await updateBaseCar(json) } if (res.success) { this.$notify({ type: "success", - message: res.data.msg, - }); - this.getCarList(); - this.addDrawer = false; + message: res.data.msg + }) + this.getCarList() + this.addDrawer = false } else { this.$notify({ type: "error", - message: res.data.msg, - }); + message: res.data.msg + }) } } else { - return false; + return false } - }); + }) }, copyClick(row) { - this.BaseManageData.personId = row.id; - this.copyVisiabled = true; + this.BaseManageData.personId = row.id + this.copyVisiabled = true }, moveClick(row) { - this.BaseManageData.personId = row.id; - this.moveVisiabled = true; + this.BaseManageData.personId = row.id + this.moveVisiabled = true }, copyClose() { - this.copyVisiabled = false; - this.BaseManageData.personId = ""; - this.BaseManageData.selectBlacks = []; - this.BaseManageData.selectWhites = []; + this.copyVisiabled = false + this.BaseManageData.personId = "" + this.BaseManageData.selectBlacks = [] + this.BaseManageData.selectWhites = [] }, moveClose() { - this.moveVisiabled = false; - this.BaseManageData.personId = ""; - this.BaseManageData.selectBlacks = []; - this.BaseManageData.selectWhites = []; + this.moveVisiabled = false + this.BaseManageData.personId = "" + this.BaseManageData.selectBlacks = [] + this.BaseManageData.selectWhites = [] }, copySubmit() { - if ( - this.BaseManageData.selectBlacks.length === 0 && - this.BaseManageData.selectWhites.length === 0 - ) { + if (this.BaseManageData.selectBlacks.length === 0 && this.BaseManageData.selectWhites.length === 0) { this.$notify({ title: "娉ㄦ剰", message: "璇烽�夋嫨瑕佸鍒跺埌鐨勫簱", - type: "warning", - }); - return; + type: "warning" + }) + return } - var resp = this.BaseManageData.copyTo(); + var resp = this.BaseManageData.copyTo() resp.then((data) => { if (data.success) { this.$notify({ title: "鎴愬姛", message: data.data, - type: "success", - }); + type: "success" + }) } else { this.$notify({ title: "澶辫触", message: data.data, - type: "error", - }); + type: "error" + }) } - }); - this.copyVisiabled = false; - this.BaseManageData.personId = ""; - this.BaseManageData.selectBlacks = []; - this.BaseManageData.selectWhites = []; + }) + this.copyVisiabled = false + this.BaseManageData.personId = "" + this.BaseManageData.selectBlacks = [] + this.BaseManageData.selectWhites = [] }, getDataName: (dataList, key) => { - let name = ""; + let name = "" if (Array.isArray(dataList) && dataList.length > 0) { for (let i = 0; i < dataList.length; i++) { if (dataList[i].value == key) { - name = dataList[i].name; + name = dataList[i].name } } } - return name; + return name }, moveSubmit() { - if ( - this.BaseManageData.selectBlacks.length === 0 && - this.BaseManageData.selectWhites.length === 0 - ) { + if (this.BaseManageData.selectBlacks.length === 0 && this.BaseManageData.selectWhites.length === 0) { this.$notify({ title: "娉ㄦ剰", message: "璇烽�夋嫨瑕佺Щ鍔ㄥ埌鐨勫簱", - type: "warning", - }); - return; + type: "warning" + }) + return } - var resp = this.BaseManageData.moveTo(); + var resp = this.BaseManageData.moveTo() resp.then((data) => { if (data.success) { this.$notify({ title: "鎴愬姛", message: data.data, - type: "success", - }); + type: "success" + }) } else { this.$notify({ title: "澶辫触", message: data.data, - type: "error", - }); + type: "error" + }) } - this.moveVisiabled = false; - this.BaseManageData.personId = ""; - this.BaseManageData.selectBlacks = []; - this.BaseManageData.selectWhites = []; - this.BaseManageData.queryPersonList(); - }); + this.moveVisiabled = false + this.BaseManageData.personId = "" + this.BaseManageData.selectBlacks = [] + this.BaseManageData.selectWhites = [] + this.BaseManageData.queryPersonList() + }) }, setLoadSearch(fn) { - this.AuthData.setLoading("multipleTable", this); + this.AuthData.setLoading("multipleTable", this) fn.then((_) => { - this.AuthData.closeLoad(); - }); - }, - }, - mounted() { - this.getCarList(); - this.VideoPhotoData.queryDictionary(); - this.BaseManageData.queryTagList(); - this.oldWidth = document.body.clientWidth; - this.oldHeight = document.body.clientHeight; - this.blackAngWhite(); - window.onresize = () => { - let width = document.body.clientWidth; - let height = document.body.clientHeight; - if (width !== this.oldWidth && width < 1750) { - } - this.$nextTick(() => { - this.$refs.multipleTable.doLayout(); - }); - }; - this.$nextTick(() => { - this.$refs.multipleTable.doLayout(); - }); - }, - beforeDestroy() { - window.onresize = null; - }, - watch: { - baseObject: { - handler(newVal, oldVal) { - this.BaseManageData.cleanData(); - this.getCarList(); - }, - deep: true, - }, - "BaseManageData.selectBlacks": function (value) { - this.blackAngWhite(); - }, - "BaseManageData.selectWhites": function (value) { - this.blackAngWhite(); - }, - }, -}; + this.AuthData.closeLoad() + }) + } + } +} </script> <style lang="scss"> .iconStyle1 { @@ -1625,8 +1364,6 @@ box-shadow: 0px 2px 4px rgb(0 0 0 / 8%); font-size: 14px; } - .el-drawer__body { - } } } @@ -1647,9 +1384,7 @@ display: none; } .el-table--border .el-table__cell, - .el-table__body-wrapper - .el-table--border.is-scrolling-left - ~ .el-table__fixed { + .el-table__body-wrapper .el-table--border.is-scrolling-left ~ .el-table__fixed { border-right: none; } td { -- Gitblit v1.8.0