Commit 1a6c93de by 潘建波

【new】提价第一个完整版本

1 parent cc117438
No preview for this file type
......@@ -13,6 +13,7 @@
"element-ui": "^2.12.0",
"fabric": "^4.6.0",
"vue": "^2.6.11",
"vue-i18n": "^8.26.8",
"vue-router": "^3.5.3"
},
"devDependencies": {
......
<!--
* @Author: your name
* @Date: 2021-12-16 10:55:51
* @LastEditTime: 2021-12-30 09:20:45
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /SDC-Face-Web/public/index.html
-->
<!DOCTYPE html>
<html lang="">
<head>
......@@ -5,6 +13,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<script src="<%= BASE_URL %>js/config.js"></script>
<script src="<%= BASE_URL %>js/dateUnit.js"></script>
<script src="<%= BASE_URL %>js/echarts.common.min.js"></script>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
......
/*
* @Author: panda
* @Date: 2021-12-28 16:16:47
* @LastEditTime: 2022-01-04 21:51:45
* @LastEditors: Please set LastEditors
* @Description: 全局配置
* @FilePath: /SDC-Face-Web/public/js/config.js
*/
window.config = {
BASE_URL:'https://'+ location.host
}
\ No newline at end of file
/*
* @Author: your name
* @Date: 2021-12-30 08:38:29
* @LastEditTime: 2021-12-30 08:38:29
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /SDC-Face-Web/src/assets/js/dateUnit.js
*/
var dateUnit={
dateAdd:function(strInterval, NumDay, dtTmp){
if (dtTmp == null | dtTmp == "")
dtTmp = new Date();
switch (strInterval) {
case "m":
return new Date(Date.parse(dtTmp) + (60000 * NumDay));
case "h":
return new Date(Date.parse(dtTmp) + (3600000 * NumDay));
case "d":
return new Date(Date.parse(dtTmp) + (86400000 * (NumDay + 1)));
case "w":
return new Date(Date.parse(dtTmp) + ((86400000 * 7) * NumDay)
+ 86400000);
case "M":
return new Date(dtTmp.getFullYear(), (dtTmp.getMonth()) + NumDay, dtTmp
.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp
.getSeconds());
case "y":
return new Date((dtTmp.getFullYear() + NumDay), dtTmp.getMonth(), dtTmp
.getDate(), dtTmp.getHours(), dtTmp.getMinutes(), dtTmp
.getSeconds());
}
},
dateFormat:function(date, fmt){
var o = {
"M+" : date.getMonth() + 1, // 月份
"d+" : date.getDate(), // 日
"h+" : date.getHours() % 12 == 0 ? 12 : date.getHours() % 12, // 小时
"H+" : date.getHours(), // 小时
"m+" : date.getMinutes(), // 分
"s+" : date.getSeconds(), // 秒
"q+" : Math.floor((date.getMonth() + 3) / 3), // 季度
"S" : date.getMilliseconds()
// 毫秒
};
// var week = {
// "0" : "\u65e5",
// "1" : "\u4e00",
// "2" : "\u4e8c",
// "3" : "\u4e09",
// "4" : "\u56db",
// "5" : "\u4e94",
// "6" : "\u516d"
// };
var week = {
"0" : "Sunday",
"1" : "Monday",
"2" : "Tuesday",
"3" : "Wednesday",
"4" : "Thursday",
"5" : "Friday",
"6" : "Saturday"
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "")
.substr(4 - RegExp.$1.length));
}
// if (/(E+)/.test(fmt)) {
// fmt = fmt
// .replace(
// RegExp.$1,
// ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "\u661f\u671f"
// : "\u5468")
// : "")
// + week[date.getDay() + ""]);
// }
if (/(E+)/.test(fmt)) {
fmt = fmt
.replace(
RegExp.$1,
((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? ""
: "")
: "")
+ week[date.getDay() + ""]);
}
for ( var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k])
: (("00" + o[k]).substr(("" + o[k]).length)));
}
}
return fmt;
},
strToDate:function(strDate) {
var st = strDate;
var date;
if(st.indexOf(' ')!=-1){
var a = st.split(" ");
var b = a[0].split("-");
var c = a[1].split(":");
date = new Date(b[0], b[1], b[2], c[0], c[1], c[2]);
}else{
var c = st.split(":");
if(c[2]){
date= new Date(2000, 1, 1, c[0], c[1], c[2]);
}else{
date= new Date(2000, 1, 1, c[0], c[1], 0);
}
}
return date;
}
}
var utiljs = {};
utiljs.weekComputedfn = {
dates: [],
formatDate: function (date) {
var year = date.getFullYear() + '-';
var month = (date.getMonth() + 1) + '-';
var day = date.getDate();
return month + day;
},
addDate: function (date, n) {
date.setDate(date.getDate() + n);
return date;
},
setDate: function (date) {
dates = [];
var week = date.getDay() - 1;
date = this.addDate(date, week * -1);
currentFirstDate = new Date(date);
for (var i = 0; i < 7; i++) {
dates.push(this.formatDate(i == 0 ? date : this.addDate(date, 1)));
}
return dates;
}
}
This diff could not be displayed because it is too large.
<!--
* @Author: your name
* @Date: 2021-12-16 10:55:51
* @LastEditTime: 2021-12-26 10:24:08
* @LastEditors: your name
* @LastEditTime: 2021-12-30 09:16:52
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/src/App.vue
-->
......@@ -62,7 +62,7 @@ export default {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
width: 1200px;
width: 1280px;
margin: 0 auto;
}
.menus{
......
/*
* @Author: panda
* @Date: 2021-12-18 13:48:39
* @LastEditTime: 2021-12-24 17:30:03
* @LastEditTime: 2021-12-31 15:59:05
* @LastEditors: Please set LastEditors
* @Description: api列表
* @FilePath: /sdc-face/src/api/apilist.js
*/
import api from './index'
const baseUrl = "http://huayan.320.io:80"
const baseUrl = window.config.BASE_URL
export default {
//截图
captureImage(params){
......@@ -31,7 +31,7 @@ export default {
},
//设置中心配置参数
setCenterParam(params) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/setCenterParam'
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/modCenterParam'
return api.post(url, params);
},
//获取存储配置
......@@ -48,5 +48,38 @@ export default {
setWorking(params, id) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/setWorkTime'
return api.post(url, params);
},
//获取模型
getModel(params, id) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/getModels'
return api.get(url, params);
},
//获取当前使用模型
getBussinessModel(params, id) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/getBusiness'
return api.get(url, params);
},
//设置模型
setModel(params){
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/modBusiness'
return api.post(url, params);
},
//表格数据
getFaceDetail(params){
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/getFaceDetail'
return api.post(url, params);
},
//chart
getFaceReport(params){
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/getFaceReport'
return api.post(url, params);
},
getFaceDetailNumber(params){
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/getFaceDetailNumber'
return api.post(url, params);
},
backupParams(params){
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/backupParams'
return api.post(url, params);
}
}
\ No newline at end of file
/*
* @Author: panda
* @Date: 2021-12-18 13:45:24
* @LastEditTime: 2021-12-24 15:47:12
* @LastEditTime: 2021-12-27 19:18:50
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/src/api/axios.js
......@@ -65,7 +65,7 @@ service.interceptors.request.use(
// 添加响应拦截器
service.interceptors.response.use(response => {
// endLoading();
if (response.data && response.data.ecode && response.data.ecode == 401) {
if (response.data.success && response.data.ecode && response.data.ecode == 401) {
Message.warning({ message: "用户登录过期,请重新登录!" });
localStorage.removeItem("atoken");
router.replace({
......
......@@ -41,3 +41,13 @@
.algobox .el-form-item__label{
font-size: 12px;
}
.el-slider__runway.show-input{
margin-right:120px!important;
}
.el-slider__button{
width: 12px!important;
height: 12px!important;
}
.advancedbox .el-slider__runway.show-input{
margin-right:82px!important;
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
/*
* @Author: panda
* @Date: 2021-12-16 10:55:51
* @LastEditTime: 2021-12-18 14:24:05
* @LastEditTime: 2021-12-30 09:14:06
* @LastEditors: Please set LastEditors
* @Description: 入口
* @FilePath: /sdc-face/src/main.js
......@@ -13,10 +13,24 @@ import ElementUI from "element-ui";
import api from "./api/install";
import './assets/css/public.css'
import "element-ui/lib/theme-chalk/index.css";
import VueI18n from 'vue-i18n'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import axios from 'axios'
Vue.prototype.axios = axios;
Vue.config.productionTip = false
Vue.use(VueI18n)
const i18n = new VueI18n({
locale: localStorage.lang || 'zh', // 语言标识
messages: {
'zh': {...require('./zh'),...zhLocale},
'en': {...require('./en'),...enLocale}
}
})
Vue.use(ElementUI, { size: "small", zIndex: 3000 });
Vue.use(api);
new Vue({
router,
i18n,
render: h => h(App),
}).$mount('#app')
<!--
* @Author: panda
* @Date: 2021-12-20 10:11:31
* @LastEditTime: 2021-12-24 14:46:50
* @LastEditTime: 2021-12-30 14:49:08
* @LastEditors: Please set LastEditors
* @Description: 算法参数高级设置
* @FilePath: /sdc-face/src/views/Algo/advancedset.vue
......@@ -11,11 +11,8 @@
<div>
<el-form ref="form" :model="advconfig" label-width="95px">
<el-form-item label="请选择模型:">
<el-select size="mini" v-model="advconfig.displaymode">
<el-option :value="0" label="录像"></el-option>
<el-option :value="1" label="经典"></el-option>
<el-option :value="2" label="调试"></el-option>
<el-option :value="3" label="展示"></el-option>
<el-select size="mini" v-model="modelid" @change="setModel">
<el-option v-for="(item,index) in modelsList" :value="item.modelid" :label="item.modelname" :key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="正面敏感度:">
......@@ -311,7 +308,7 @@
<el-button size="mini" type="primary" @click="saveConfig">保存</el-button>
</div>
<div class="btn-item">
<el-button size="mini" @click="returnSet">返回</el-button>
<el-button size="mini" @click="returnSet">基础</el-button>
</div>
</div>
</el-form>
......@@ -325,6 +322,8 @@ export default {
data() {
return {
form: {},
modelid:0,
modelsList:[],
senData2: {
minValue: 0,
maxValue: 100,
......@@ -364,8 +363,46 @@ export default {
saveConfig(){
this.$emit("saveconfig", 'config',this.advconfig);
},
/**
* @description: 获取算法模型
* @return {*}
*/
getModels(){
this.$api.getModel().then(res => {
let {models} = res;
this.modelsList = models;
})
},
/**
* @description: 获取当前使用模型
*/
getBussinessModel(){
this.$api.getBussinessModel().then(res => {
let {business:{model:{id}}} = res;
this.modelid = id;
})
},
/**
* @description: 设置模型
*/
setModel(){
this.$api.setModel().then(res => {
let data = {business:{model:{id:this.modelid}},channelid:1}
this.$api.setModel(data).then(res => {
if(res.success){
this.$message({
message: res.describe,
type: 'success'
});
}
})
})
}
},
created() {
this.getModels();
this.getBussinessModel()
},
created() {},
};
</script>
......
<!--
* @Author: panda
* @Date: 2021-12-18 12:57:47
* @LastEditTime: 2021-12-26 10:16:32
* @LastEditTime: 2022-01-04 16:29:58
* @LastEditors: Please set LastEditors
* @Description: 算法配置
* @FilePath: /sdc-face/src/views/Algo/index.vue
......@@ -92,6 +92,12 @@
<el-button slot="reference" style="float:right;margin:5px 20px 0 0;" type="primary" @click="saveRoi()" size="mini"
>保存</el-button
>
<el-button slot="reference" style="float:right;margin:5px 20px 0 0;" type="defalut" @click="resetRoi()" size="mini"
>全部清空</el-button
>
<el-button slot="reference" style="float:right;margin:5px 20px 0 0;" type="defalut" @click="refresh()" size="mini"
>刷新</el-button
>
</span>
</div>
<div class=""></div>
......@@ -124,8 +130,8 @@
class="algoslider"
input-size="mini"
v-model="algoform.zoomscale"
:min="algoform.zoomscalemin"
:max="algoform.zoomscalemax"
:min="defalutConfig.zoomscalemin"
:max="defalutConfig.zoomscalemax"
:step="defalutConfig.zoomstep"
@change="senDataChange"
show-input
......@@ -195,8 +201,8 @@ export default {
algconfigData:{},
algoform: {
zoomscale: 3, //人头尺寸 [0.5,4] step=0.01 alg:x100 表示传入算法时,该值要*100
zoomscalemin: 20, //最小人头尺寸 [0,1000] step=5
zoomscalemax: 300, //最大人头尺寸 [0,1000] step=5
zoomscalemin: 0.5, //最小人头尺寸 [0,1000] step=5
zoomscalemax: 8, //最大人头尺寸 [0,1000] step=5
sensitivity1: 20, //敏感度1 [0,100] step=1
sensitivity2: 40, //敏感度2 [0,100] step=1
sensitivity3: 20, //敏感度3 [0,100] step=1
......@@ -218,6 +224,8 @@ export default {
},
defalutConfig: {
zoomstep: 0.1,
zoomscalemin: 0.5, //最小人头尺寸 [0,1000] step=5
zoomscalemax: 8, //最大人头尺寸 [0,1000] step=5
},
};
},
......@@ -242,18 +250,28 @@ export default {
closeadvancedModal() {
this.advvisbale = false;
},
/**
* @description: 刷新
* @param {*}
* @return {*}
*/
refresh(){
this.getConfig('refresh')
},
/**
* @description: 获取配置参数
* @param {*}
* @return {*}
*/
getConfig(){
getConfig(type){
this.$api.getAlgo().then(res => {
this.algconfigData = res;
this.algoform = res.algconfig.config.face;
this.roidata = res.algconfig.roi
this.algoform = res.scene.config.json.face;
this.roidata = res.scene.rois
if(type == 'refresh'){
this.$refs.rois.resetRoi();
this.$refs.rois.capImg();
}
})
},
/**
......@@ -262,17 +280,24 @@ export default {
* @return {*}
*/
saveConfig(type,data){
debugger
let info = "";
if(type == 'config') {
this.algconfigData.config.face = JSON.stringify(data);
// this.algconfigData.scene[0].config.json = JSON.stringify(data);
this.algconfigData.scene.config.json.face = data;
info = "参数配置成功!"
} else if(type == 'roi') {
debugger
this.algconfigData.roi = JSON.stringify(data)
// this.algconfigData.scene[0].rois.roi = JSON.stringify(data)
this.algconfigData.scene.rois = data;
info = "标定配置成功!"
}
console.log(JSON.stringify(this.algconfigData).length)
this.$api.setAlgo(JSON.stringify(this.algconfigData), headers).then(res => {
if(res.code == 200) {
this.algconfigData.scene.config = this.algoform;
this.$api.setAlgo(this.algconfigData).then(res => {
if(res.success) {
// this.algconfigData.scene.config = this.algoform;
this.$message({
message: info,
type: 'success'
});
}
})
},
......@@ -284,6 +309,9 @@ export default {
saveRoi(){
this.$refs.rois.saveRoi()
},
resetRoi(){
this.$refs.rois.resetRoi()
},
},
created(){
this.getConfig()
......@@ -353,7 +381,7 @@ export default {
.algoslider {
float: left;
width: 230px;
width: 245px;
}
.topset {
text-align: right;
......
This diff is collapsed. Click to expand it.
/*
* @Author: your name
* @Date: 2021-12-24 14:16:06
* @LastEditTime: 2021-12-24 14:21:47
* @LastEditTime: 2021-12-28 16:32:37
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/API20211215/vue.config.js
*/
const CopyWebpackPlugin = require("copy-webpack-plugin") //引入插件
module.exports = {
outputDir:process.env.outputDir || 'dist',
productionSourceMap: false,
lintOnSave: false,
publicPath: "./",
// 由于浏览器有跨域限制,这里cli 工具提供了 启动本地代理服务器 请求
devServer:{
open:false, // 是否打开浏览器;
......@@ -37,6 +40,16 @@ module.exports = {
},
},
configureWebpack: {
plugins: [
new CopyWebpackPlugin([ //打包时执行拷贝
{
from: __dirname + "/public/config/js/config.js",
to: __dirname + "/dist/config/js/config.js"
}
])
]
},
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!