This commit is contained in:
yzy 2024-03-14 14:26:50 +08:00
commit 2edad8e1d5
56 changed files with 17327 additions and 0 deletions

6
.editorconfig Normal file
View File

@ -0,0 +1,6 @@
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2

1
.eslintignore Normal file
View File

@ -0,0 +1 @@
/src/util/qing_dist.js

25
.gitignore vendored Normal file
View File

@ -0,0 +1,25 @@
.DS_Store
node_modules
dist
/security
dist.zip
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# security-app

12
babel.config.js Normal file
View File

@ -0,0 +1,12 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
['import', {
libraryName: 'vant',
libraryDirectory: 'es',
style: true
}, 'vant']
]
}

12538
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

52
package.json Normal file
View File

@ -0,0 +1,52 @@
{
"name": "security-app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.26.1",
"babel-plugin-import": "^1.13.3",
"core-js": "^3.6.5",
"js-base64": "^3.7.2",
"js-md5": "^0.7.3",
"postcss-plugin-px2rem": "^0.8.1",
"qs": "^6.10.3",
"vant": "^2.12.47",
"vconsole": "^3.14.7",
"vue": "^2.6.11",
"vue-router": "3.0.1",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.12",
"@vue/cli-plugin-eslint": "~4.5.12",
"@vue/cli-service": "~4.5.12",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

29
public/index.html Normal file
View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title><%= htmlWebpackPlugin.options.title %></title>
<style>
html,body{
margin: 0;
padding: 0;
outline: none;
width: 100%;
height: 100%;
}
html{
background: #f7f8fa;
}
</style>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

27
src/App.vue Normal file
View File

@ -0,0 +1,27 @@
<template>
<div id="app">
<!-- <keep-alive> -->
<router-view/>
<!-- </keep-alive> -->
</div>
</template>
<script>
export default {
}
</script>
<style scoped>
#app{
width: 100%;
height: 100%;
position: relative;
margin: 0;
padding: 0;
background: #f7f8fa;
}
</style>

31
src/api/face.js Normal file
View File

@ -0,0 +1,31 @@
import request from "../util/request";
import func from "../util/func";
export const faceRegister = (faceVo, file) => {
if (func.isUndefined(file)) {
return
}
let formData = new FormData();
formData.append('file', file);
formData.append('faceVo', new Blob([JSON.stringify(faceVo)], { type: 'application/json' }));
return request({
url: '/sis/api/security-desk/face/register',
method: 'post',
headers: { 'Content-Type': 'multipart/form-data' },
data: formData
})
};
export const faceMatch = (file) => {
if (func.isUndefined(file)) {
return
}
let formData = new FormData();
formData.append('file', file);
return request({
url: '/sis/api/security-desk/face/match',
method: 'post',
headers: { 'Content-Type': 'multipart/form-data' },
data: formData
})
};

160
src/api/index.js Normal file
View File

@ -0,0 +1,160 @@
import request from "../util/request";
import website from "../config/website";
import func from "../util/func";
export const userAuth = (data) => {
return request({
url: '/sis/api/security-auth/app/auth',
method: 'post',
data: data
})
}
//获取待办列表
export const getBacklog = (dataType, type) => {
return request({
url: `/sis/api/${website.hostAddress}/app/backlog`,
method: 'get',
params: {
dataType,
type
}
})
}
//获取教育培训和应急演练待办详情
export const getDetail = (id) => {
return request({
url: `/sis/api/${website.hostAddress}/app/${id}`,
method: 'get'
})
}
//教育培训和应急演练待办提报
export const save = (params) => {
return request({
url: `/sis/api/${website.hostAddress}/app/handIn`,
method: 'post',
head: {
'Content-Type':'multipart/form-data'
},
data: params
})
}
//获取设备检查待办详情
export const getDeviceDetail = (id) => {
return request({
url: `/sis/api/${website.hostAddress}/app/device/${id}`,
method: 'get'
})
}
//获取设备检查/待办项的信息
export const getDeviceItemDetail = (id,type) => {
return request({
url: `/sis/api/${website.hostAddress}/app/device/item`,
method: 'get',
params: {
id,
type
}
})
}
//设备检查待办提报
export const deviceHandin = (params) => {
return request({
url: `/sis/api/${website.hostAddress}/app/device/handIn`,
method: 'post',
data: params
})
}
//设备整改待办提报
export const deviceRectifyHandin = (params) => {
return request({
url: `/sis/api/${website.hostAddress}/app/device/rectify`,
method: 'post',
data: params
})
}
//获取设备整改待办详情
export const getDeviceRectifyDetail = (id) => {
return request({
url: `/sis/api/${website.hostAddress}/app/device/rectify/${id}`,
method: 'get'
})
}
//获取设备持续整改待办详情
export const getDeviceContinuedDetail = (id) => {
return request({
url: `/sis/api/${website.hostAddress}/app/continued/rectify/${id}`,
method: 'get'
})
}
// 单个文件上传
export const singleFileUpload = (query,data) => {
return request({
url: `/sis/api/security-desk/upload/single`,
method: 'post',
headers: { 'Content-Type': 'multipart/form-data' },
params: query,
data
})
}
// 多个文件上传
export const multiFileUpload = (query,data) => {
return request({
url: `/sis/api/security-desk/upload/list`,
method: 'post',
headers: { 'Content-Type': 'multipart/form-data' },
params: query,
data
})
}
//设备持续整改待办提报
export const continuedRectifyHandin = (params) => {
return request({
url: `/sis/api/${website.hostAddress}/app/continued/rectify/handIn`,
method: 'post',
data: params
})
}
export const saveHandoverWithFace = (faceVo, file) => {
if (func.isUndefined(file)) {
return
}
let formData = new FormData();
formData.append('file', file);
formData.append('faceVo', new Blob([JSON.stringify(faceVo)], { type: 'application/json' }));
return request({
url: `/sis/api/${website.hostAddress}/work/handover/save-with-face`,
method: 'post',
headers: { 'Content-Type': 'multipart/form-data' },
data: formData
})
};
export const handoverFaceMatch = (file) => {
if (func.isUndefined(file)) {
return
}
let formData = new FormData();
formData.append('file', file);
return request({
url: `/sis/api/${website.hostAddress}/work/handover/face-match`,
method: 'post',
headers: { 'Content-Type': 'multipart/form-data' },
data: formData
})
};

26
src/api/report.js Normal file
View File

@ -0,0 +1,26 @@
import request from "../util/request";
import website from "../config/website";
export const getReportList = (params) => {
return request({
url: `/sis/api/${website.hostAddress}/publicity/page`,
method: 'get',
params: {
...params
}
})
}
export const getDeatil = (id) => {
return request({
url: `/sis/api/${website.hostAddress}/publicity/${id}`,
method: 'get'
})
}
export const save = (data) => {
return request({
url: `/sis/api/${website.hostAddress}/publicity/save`,
method: 'post',
data: data
})
}

17
src/api/work.js Normal file
View File

@ -0,0 +1,17 @@
import request from "../util/request";
import website from "../config/website";
export const workHandoverCheck = (data) => {
return request({
url: `/sis/api/${website.hostAddress}/work/handover/check`,
method: 'post',
data: data
})
}
export const handoverHistorySave = (data) => {
return request({
url: `/sis/api/${website.hostAddress}/handover/history/save`,
method: 'post',
data: data
})
}

BIN
src/assets/bank.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

10
src/assets/common.css Normal file
View File

@ -0,0 +1,10 @@
.icon{
font-size: 30px;
font-weight: 300;
color: #d0021b;
}
.icon-text{
font-size: 14px;
margin: 8px 0;
}

BIN
src/assets/empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -0,0 +1,35 @@
@font-face {
font-family: "iconfont"; /* Project id 3363340 */
src: url('iconfont.woff2?t=1662514237402') format('woff2'),
url('iconfont.woff?t=1662514237402') format('woff'),
url('iconfont.ttf?t=1662514237402') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-renlianshibie:before {
content: "\e6b6";
}
.icon-jiaojieban:before {
content: "\e601";
}
.icon-shebeiguanli:before {
content: "\e649";
}
.icon-shebeizhuangtai:before {
content: "\ec23";
}
.icon-xuanchuanshipin:before {
content: "\e611";
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,44 @@
{
"id": "3363340",
"name": "security",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "6282765",
"name": "人脸识别",
"font_class": "renlianshibie",
"unicode": "e6b6",
"unicode_decimal": 59062
},
{
"icon_id": "14236675",
"name": "交接班",
"font_class": "jiaojieban",
"unicode": "e601",
"unicode_decimal": 58881
},
{
"icon_id": "5881194",
"name": "设备管理",
"font_class": "shebeiguanli",
"unicode": "e649",
"unicode_decimal": 58953
},
{
"icon_id": "5401578",
"name": "设备状态",
"font_class": "shebeizhuangtai",
"unicode": "ec23",
"unicode_decimal": 60451
},
{
"icon_id": "13529184",
"name": "宣传视频",
"font_class": "xuanchuanshipin",
"unicode": "e611",
"unicode_decimal": 58897
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

8
src/config/website.js Normal file
View File

@ -0,0 +1,8 @@
/**
* 全局配置文件
*/
export default {
// 后端Application应用名appName
hostAddress: 'security-busi',
}

20
src/main.js Normal file
View File

@ -0,0 +1,20 @@
import Vue from 'vue'
import App from '@/App.vue'
import router from '@/router/index'
import http from '@/util/request'
import qing from '@/util/qing_dist'
import store from '@/store/index'
// import Vconsole from 'vconsole'
import '@/vant/index'
import '@/assets/common.css'
import '@/assets/iconfont/iconfont.css'
Vue.config.productionTip = false
Vue.prototype.$http = http
qing;
// eslint-disable-next-line no-unused-vars
// const vConsole = new Vconsole();
new Vue({
router,
store,
render: h => h(App),
}).$mount('#app')

33
src/router/index.js Normal file
View File

@ -0,0 +1,33 @@
/**
* 路由
* 路由统一使用name进行跳转
*/
import Vue from 'vue'
import VueRouter from 'vue-router'
import pages from './pages'
Vue.use(VueRouter);
const routes = new VueRouter({
base: '/sis/',
mode: 'history',
scrollBehavior: () => ({ y: 0 }),
routes: pages
});
routes.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requiresAuth)) {
if (!sessionStorage.getItem('token')) {
next({
path: '/login',
query: to.query
})
} else {
next()
}
} else {
next()
}
});
export default routes;

115
src/router/pages.js Normal file
View File

@ -0,0 +1,115 @@
const pages = [
{
path: '/',
name: 'home',
component: () => import('@/views/login'),
},
{
path: '/index',
name: 'index',
component: () => import('@/views/index'),
},
{
path: '/login-pwd',
name: 'login',
component: () => import('@/views/login-pwd'),
},
{
path: '/educate',
name: 'educate',
component: () => import('@/views/educate')
},
{
path: '/emergency',
name: 'emergency',
component: () => import('@/views/emergency')
},
{
path: '/deviceDetail',
name: 'device-detail',
component: () => import('@/views/device-detail')
},
{
path: '/deviceCheck',
name: 'device-check',
component: () => import('@/views/device-check')
},
{
path: '/report',
name: 'report',
component: () => import('@/views/report')
},
{
path: '/report_detail',
name: 'report_detail',
component: () => import('@/views/report-detail')
},
{
path: '/login',
name: 'login',
component: () => import('@/views/login')
},
{
path: '/educateList',
name: 'educate-list',
component: () => import('@/views/educate-list')
},
{
path: '/emergencyList',
name: 'emergency-list',
component: () => import('@/views/emergency-list')
},
{
path: '/deviceList',
name: 'device-list',
component: () => import('@/views/device-list')
},
{
path: '/deviceRectifyList',
name: 'device-rectify-list',
component: () => import('@/views/device-rectify-list')
},
{
path: '/deviceRectify',
name: 'device-rectify',
component: () => import('@/views/device-rectify')
},
{
path: '/face/register',
name: 'face-register',
component: () => import('@/views/face-register')
},
{
path: '/work/handover',
name: 'work-handover',
component: () => import('@/views/work-handover')
},
{
path: '/face/match',
name: 'face-match',
component: () => import('@/views/face-match')
},
{
path: '/work/handover/form',
name: 'work-handover-form',
component: () => import('@/views/work-handover-form')
},
{
path: '/report/form',
name: 'report-form',
component: () => import('@/views/report-form')
},
{
path: '/deviceContinuedRectify',
name: 'device-continued-rectify',
component: () => import('@/views/device-continued-rectify')
},
{
path: '/deviceContinuedDetail',
name: 'device-continued-detail',
component: () => import('@/views/device-continued-detail')
},
];
export default pages

12
src/store/index.js Normal file
View File

@ -0,0 +1,12 @@
import Vue from 'vue'
import Vuex from 'vuex'
import user from './module/user'
Vue.use(Vuex)
const store = new Vuex.Store({
modules:{
user
}
})
export default store

19
src/store/module/user.js Normal file
View File

@ -0,0 +1,19 @@
const user = {
state:{
userId: '',
userName: '',
userDeptId: '',
userDeptName: '',
userAuthId: '',
token: ''
},
mutations:{
},
actions:{
}
}
export default user

108
src/util/func.js Normal file
View File

@ -0,0 +1,108 @@
/**
* 通用工具类
*/
export default class func {
/**
* 不为空
* @param val
* @returns {boolean}
*/
static notEmpty(val) {
return !this.isEmpty(val);
}
/**
* 是否为定义
* @param val
* @returns {boolean}
*/
static isUndefined(val) {
return val === null || typeof val === 'undefined';
}
/**
* 为空
* @param val
* @returns {boolean}
*/
static isEmpty(val) {
if (
val === null ||
typeof val === 'undefined' ||
(typeof val === 'string' && val === '' && val !== 'undefined')
) {
return true;
}
return false;
}
/**
* 强转int型
* @param val
* @param defaultValue
* @returns {number}
*/
static toInt(val, defaultValue) {
if (this.isEmpty(val)) {
return defaultValue === undefined ? -1 : defaultValue;
}
const num = parseInt(val, 0);
return Number.isNaN(num) ? (defaultValue === undefined ? -1 : defaultValue) : num;
}
/**
* Json强转为Form类型
* @param obj
* @returns {FormData}
*/
static toFormData(obj) {
const data = new FormData();
Object.keys(obj).forEach(key => {
data.append(key, Array.isArray(obj[key]) ? obj[key].join(',') : obj[key]);
});
return data;
}
/**
* date类转为字符串格式
* @param date
* @param format
* @returns {null}
*/
static format(date, format = 'YYYY-MM-DD HH:mm:ss') {
return date ? date.format(format) : null;
}
/**
* 根据逗号联合
* @param arr
* @returns {string}
*/
static join(arr) {
return arr ? arr.join(',') : '';
}
/**
* 根据逗号分隔
* @param str
* @returns {string}
*/
static split(str) {
return str ? String(str).split(',') : '';
}
static base64ImageToFile(base64Data, fileExt) {
var arr = base64Data.split(',');
var bstr = atob(arr[1])
var n = bstr.length;
var u8arr = new Uint8Array(n);
while(n--) {
u8arr[n] = bstr.charCodeAt(n);
}
var theBlob = new Blob([u8arr], {type: 'image/' + fileExt});
theBlob.lastModifiedDate = new Date();
var fileName = 'face.' + fileExt;
theBlob.name = fileName;
return new File([theBlob], fileName, {type: fileExt, lastModified: Date.now()});
}
}

787
src/util/qing_dist.js Normal file
View File

@ -0,0 +1,787 @@
/* generated @ 2019-7-3 10:05:58*/
(function (a) {
function b(d) {
if (c[d]) return c[d].exports;
var e = c[d] = {i: d, l: !1, exports: {}};
return a[d].call(e.exports, e, e.exports, b), e.l = !0, e.exports
}
var c = {};
return b.m = a, b.c = c, b.i = function (a) {
return a
}, b.d = function (a, c, d) {
b.o(a, c) || Object.defineProperty(a, c, {configurable: !1, enumerable: !0, get: d})
}, b.n = function (a) {
var c = a && a.__esModule ? function () {
return a['default']
} : function () {
return a
};
return b.d(c, 'a', c), c
}, b.o = function (a, b) {
return Object.prototype.hasOwnProperty.call(a, b)
}, b.p = '/', b(b.s = 28)
})([function (a, b) {
'use strict';
b.c = function (a) {
var b = a.jsApiList, d = {};
(b || []).forEach(function (a) {
e[a] && (d[a] = !0)
});
var f = a.success;
a.success = function (a, b) {
if (a.success) for (var c in d) a.data[c] = !0;
f && f(a, b)
}, c._bridge.checkJsApi(a)
}, b.a = function (a, b, c, g) {
b && (d[a] = b, c && (e[a] = !0), g && (f[a] = !0))
}, b.b = function (a) {
var b = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : {}, e = d[a];
if (e) {
var g = e(b);
g && (a = g.name, b = g.params)
}
f[a] || c._bridge.call(a, b)
};
var c = window.qing, d = {}, e = {}, f = {}
}, function (a, b, c) {
'use strict';
c.d(b, 'b', function () {
return d
}), c.d(b, 'a', function () {
return e
});
var d = function (a) {
console && console.log('[Qing] ' + a)
}, e = function (a) {
console && console.warn('[Qing] ' + a)
}
}, function (a, b, c) {
'use strict';
var d = c(5), e = Object.assign || function (a) {
for (var b, c = 1; c < arguments.length; c++) for (var d in b = arguments[c], b) Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d]);
return a
}, f = '\u9274\u6743\u5931\u8D25', g = '\u83B7\u53D6\u7B7E\u540D\u5931\u8D25';
b.a = function (a, b) {
function h(b, c, d) {
return b && b.appId && b.timeStamp && b.nonceStr && b.signature ? void a.call('runtime.auth', e({}, b, {
success: function (a) {
'string' == typeof a.success && (a.success = 'true' === a.success), a.success ? c && c(a) : d && d(f)
}, error: function () {
d && d(f)
}
})) : d('\u7B7E\u540D\u4FE1\u606F\u9519\u8BEF')
}
if ('function' == typeof b.success) if (b.appId && b.timeStamp && b.nonceStr && b.signature) h(b, b.success, b.error); else if (b.signUrl) {
var i = encodeURIComponent(location.href.split('#')[0]);
/^file:/.test(location.href) && (i = encodeURIComponent(location.href.replace(/file:\/\//, ''))), c.i(d.a)({
url: b.signUrl.replace(/\?|$/, '?url=' + i + '&').replace(/\&$/, ''),
method: b.signMethod || 'post',
success: function (a) {
if (!a || !a.success || !a.data) return void (b.error && b.error(g));
var c = a.data;
'function' == typeof b.signFormat && (c = b.signFormat(c)), h(c, b.success, b.error)
},
error: function () {
b.error && b.error(g)
}
})
} else b.error && b.error('\u53C2\u6570\u9519\u8BEF')
}
}, function (a, b) {
'use strict';
function c() {
function a(a, b, d) {
b.split(',').forEach(function (b) {
var e = c.apis[b] = {version: a};
('both' === d || 'ios' === d) && (e.ios = 1), ('both' === d || 'android' === d) && (e.android = 1)
})
}
if (c.apis) return c.apis;
var b = {
both: {
"0.9.0": 'hideWebViewTitle,setWebViewTitle,gotoApp,getPersonInfo,getNetworkType,share,switchCompany,personInfo,chat,selectPerson,fetchAvatar,joinBandCallback,socialShare,localFunction,selectFile,showFile,selectOrg,selectPic,scanQRCode,selectPersons',
"0.9.3": 'gotoMyFile',
"0.9.4": 'getPersonDepartment,getAdminOpenId',
"0.9.5": 'setWebViewTitleBar,closeWebView',
"0.9.6": 'createPop,closePop,getLocation,selectLocation',
"0.9.11": 'defback,setDepartmentHeader',
"0.9.12": 'clipBoard,freeCall,validate,orgManage',
"0.9.13": 'enterpriseAuth',
"0.9.14": 'selectOrgs',
"0.9.16": 'previewImage',
"0.9.17": 'iAppRevision,selectCloudhubContact,selectMobileContact',
"0.9.18": 'gotoLightApp',
"0.9.19": 'recordScreenshotsInfo,companyRename',
"0.9.20": 'selectPhoto,gotoOpenAppRangeView',
"0.9.21": 'extPersonInfo,selectPersonsInGroup,startLightApp,rotateUI',
"0.9.22": 'startSignFeedback',
"0.9.23": 'startRecord,stopRecord,playVoice,pauseVoice,stopVoice,uploadVoice,downloadVoice',
"0.9.24": 'scanBizCard',
"0.9.25": 'groupAppSort,screenShare,getMobileContact',
"0.9.26": 'shareFile',
"0.9.27": 'selectGroups',
"0.9.28": 'defTitleBar',
"0.9.29": 'selectConcernPersons',
"0.9.30": 'mergeMsgRecord',
"0.9.50": 'invoice,voiceRecognize,projection,getProjectionState,savePic,addCalendarEvent,runtime.auth,runtime.jsReady,ui.toast',
"0.9.51": 'chooseImage,uploadImage,downloadImage,cloudoffice.request,cloudoffice.clearCardNotify,cloudoffice.showCardNotify,cloudoffice.getRoleType,cloudoffice.textShareClosed,cloudoffice.checkAppAuth,cloudoffice.downloadPic',
"0.9.52": 'dateTimePicker',
"0.9.55": 'getWiFi,selectAnyLocation,bluetooth.openBluetoothAdapter,bluetooth.closeBluetoothAdapter,bluetooth.getBluetoothAdapterState,bluetooth.onBluetoothAdapterStateChange,bluetooth.startBluetoothDevicesDiscovery,bluetooth.stopBluetoothDevicesDiscovery,bluetooth.getBluetoothDevices,bluetooth.onBluetoothDeviceFound,bluetooth.getConnectedBluetoothDevices,bluetooth.createBLEConnection,bluetooth.closeBLEConnection,bluetooth.getBLEDeviceServices,bluetooth.getBLEDeviceCharacteristics,bluetooth.readBLECharacteristicValue,bluetooth.writeBLECharacteristicValue,bluetooth.notifyBLECharacteristicValueChange,bluetooth.onBLEConnectionStateChange,bluetooth.onBLECharacteristicValueChange,bluetooth.getBondDevice',
"0.9.56": 'commonRoute',
"0.9.60": 'video.startRecord,video.upload,video.download,video.play',
"0.9.62": 'voidceChanger,bluetooth.BLEPrint',
"0.9.63": 'voiceSynthesize,selectBusinessUnits,keepScreenOn,cloudoffice.dataReport,cloudoffice.checkWorkbenchUpdate',
"0.9.65": 'selectRoles',
"0.9.66": 'ui.navigate',
"0.9.67": 'voiceAssistant',
"0.9.70": 'defHomeMainTitleBar,reloadWebView',
"0.9.71": 'ui.changeNavStyle,ui.webViewPaddingTop',
"0.9.72": 'getCalenderEvent,showTopMenu',
"0.9.73": 'startLocation,stopLocation',
"0.9.74": 'startSpeechRecognize,stopSpeechRecognize',
"0.9.75": 'shareMiniprogram,video.select',
"0.9.76": 'selectPersonsInRole,setCallBackData,storage.getItem,storage.setItem,storage.removeItem,storage.clear',
"0.9.77": 'createLive,createVoiceMeeting',
"0.9.79": 'queryCalenderAccounts,assist,setShortcuts',
"0.9.80": 'todoList'
},
ios: {
"0.9.27": 'setBounce',
"0.9.51": 'getLocalImgData',
"0.9.61": 'showARView',
"0.9.63": 'setWebBottomInset',
"0.9.79": 'setShortcuts'
},
android: {"0.9.30": 'selectLocalFile', "0.9.60": 'getPhoneOSInfo'}
};
return c.apis = {}, Object.keys(b).forEach(function (c) {
var d = b[c];
Object.keys(d).forEach(function (b) {
a(b, d[b], c)
})
}), c.apis
}
b.a = c
}, function (a, b, c) {
'use strict';
var d = c(0), e = window.qing, f = (e.isAndroid || e.isIos) && e.checkVersion('0.9.76'), g = f ? c(21) : c(22);
d.a('storage.getItem', g.getItem, !0), d.a('storage.setItem', g.setItem, !0), d.a('storage.removeItem', g.removeItem, !0), d.a('storage.clear', g.clear)
}, function (a, b) {
'use strict';
b.a = function (a) {
var b, c = new XMLHttpRequest, d = /^(2\d{2}|304)$/;
a.method || (a.method = 'GET'), a.error || (a.error = function () {
}), a.success || (a.success = function () {
}), c.open(a.method, a.url), c.onreadystatechange = function () {
if (4 === c.readyState) if (d.test(c.status)) try {
a.success(JSON.parse(c.responseText), c)
} catch (b) {
a.error('JSON\u89E3\u6790\u5931\u8D25')
} else a.error(c.responseText)
}, a.headers = a.headers || {}, 'json' === a.serializer ? (b = JSON.stringify(a.data), a.headers['Content-type'] = 'application/json; charset=utf-8') : (b = function (a) {
var b = encodeURIComponent;
return 'string' != typeof a && a ? Object.keys(a).map(function (c) {
return b(c) + '=' + b(a[c])
}).join('&') : a
}(a.data), a.headers['Content-type'] = 'application/x-www-form-urlencoded; charset=utf-8'), a.headers && Object.keys(a.headers).forEach(function (b) {
c.setRequestHeader(b, a.headers[b])
}), c.send(b)
}
}, function (a, b) {
'use strict';
function c() {
var a, b = arguments, e = !1;
return 'boolean' == typeof b[0] && (e = Array.prototype.shift.call(b)), a = Array.prototype.shift.call(b), Array.prototype.forEach.call(b, function (b) {
Object.keys(b).forEach(function (f) {
e && 'object' === d(b[f]) && 'object' === d(a[f]) ? c(!0, a[f], b[f]) : 'undefined' != typeof b[f] && (a[f] = b[f])
})
}), a
}
b.a = c;
var d = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (a) {
return typeof a
} : function (a) {
return a && 'function' == typeof Symbol && a.constructor === Symbol && a !== Symbol.prototype ? 'symbol' : typeof a
}
}, function (a, b, c) {
(function (a) {
if (!(a.qing && a.qing.version)) {
var b = a.qing || (a.qing = {});
b.version = '0.0.10', b.isReady = !1, b.debug = !1;
var d = navigator.userAgent.toLowerCase(),
e = d.match(/Qing\/(\d+(?:\.\d+)*)/i) || d.match(/App\/cloudhub \d+\/(\d+(?:\.\d+)*)/i), f = e;
f && (b.nativeJsBridgeVersion = e[1]), b.isSupportNativeJsBridge = !!f, c(8).init(b), c(9).init(b), c(27).init(b), f ? b.isDesktop ? 3 < parseInt(b.nativeJsBridgeVersion.replace(/\./g, '')) ? !a.__hasQingDesktop && c(11) : !a.__hasQingDesktopLE3 && c(10) : b.checkVersion('0.9.50') ? !a.__hasQingMobile && c(15) : !a.__hasQingMobile && c(14) : b.isWX || !a.__hasQingWeb && c(24)
}
})(window)
}, function (a, b, c) {
'use strict';
Object.defineProperty(b, '__esModule', {value: !0});
var d = c(1), e = c(25), f = c(0);
b.init = function (a) {
var b = document, h = [];
a.once = function (b, c) {
a.on(b, function d() {
a.off(b, d), c && c()
})
};
var i = a.ready = a._bridge ? function (a) {
a && a()
} : function (a) {
b.addEventListener('QingReady', function c() {
a(), b.removeEventListener('QingReady', c)
})
};
a.config = function (b) {
a.debug = !!b.debug, i(function () {
a._bridge.config(b)
}), (b.jsEventList || []).forEach(function (b) {
-1 != h.indexOf(b) || (h.push(b), a.on(b, function (a) {
g(b, {data: a})
}))
})
}, a.error = function (b) {
a.on('error', b)
};
var j = ['call', 'off', 'on', 'checkJsApi', 'trigger'];
j.forEach(function (b) {
a[b] = function () {
var d = c.i(e.a)(arguments);
i(function () {
a[b].apply(a, d), d = null
})
}
}), i(function () {
c.i(d.b)('Ready'), a.isReady = !0;
var b = a._bridge;
j.forEach(function (c) {
a[c] = b[c]
}), a.call = f.b, a.checkJsApi = f.c, a.ready = function (a) {
a && a()
}
}), a.error = function (b) {
a.on('error', b)
}, a.checkVersion = function (b) {
var c = a.nativeJsBridgeVersion;
if (!c || 'string' != typeof b) return !1;
if (c == b) return !0;
for (var d = c.split('.'), e = b.split('.'), f = Math.max(d.length, e.length), g = 0; g < f; g++) {
var h = ~~e[g], i = ~~d[g];
if (h < i) return !0;
if (h > i) return !1
}
};
var k = [location.origin];
a.trust = function (a) {
k.push(a)
}, window.addEventListener('message', function (b) {
var c = b.data || {}, d = c.params || {};
!k.includes(b.origin) || c.call && ((c.callbackId || 'number' == typeof c.callbackId) && (d.complete = function (a) {
b.source.postMessage({callbackId: c.callbackId, result: a}, '*')
}), a.call && a.call(c.call, d))
})
};
var g = function (a, b) {
var c = document.createEvent('HTMLEvents');
if (b) for (var d in b) c[d] = b[d];
c.initEvent(a), document.dispatchEvent(c)
}
}, function (a, b, c) {
'use strict';
function d(a) {
return a.replace(/(^|;|\s*)deviceName\s*:[^;]*(;|$)/i, ';')
}
Object.defineProperty(b, '__esModule', {value: !0}), c.d(b, 'init', function () {
return e
});
var e = function (a) {
var b = d(navigator.userAgent.toLowerCase() || ''),
c = navigator.vendor && navigator.vendor.toLowerCase() || '', e = navigator.appVersion.toLowerCase() || '',
f = a.isWX = /micromessenger/i.test(b), g = a.isChrome = /chrome|chromium/i.test(b) && /google inc/.test(c),
h = a.isFirefox = /firefox/i.test(b), i = a.isOpera = /^Opera\//.test(b) || /\x20OPR\//.test(b),
j = a.isSafari = /safari/i.test(b) && /apple computer/i.test(c), k = a.isIe = function (a) {
return a ? 11 <= a ? 'ActiveXObject' in window : new RegExp('msie ' + a).test(b) : /msie/i.test(b) || 'ActiveXObject' in window
}, l = a.isIphone = /iphone/i.test(b), m = a.isIpad = /ipad/i.test(b), n = a.isIpod = /ipod/i.test(b),
o = a.isIos = l || m || n, p = a.isAndroid = /android/i.test(b),
q = a.isAndroidPhone = p && /mobile/i.test(b), r = a.isAndroidTablet = p && !/mobile/i.test(b),
s = a.isBlackberry = /blackberry/i.test(b), t = a.isCoolpad = /coolpad/i.test(b),
u = a.isMac = /mac/i.test(e), v = a.isWindows = /win/i.test(e),
w = a.isWindowsPhone = v && /phone/i.test(b), x = a.isWindowsTablet = v && !w && /touch/i.test(b),
y = a.isMobile = l || n || q || s || w || t, z = a.isTablet = m || r || x, A = a.isDesktop = !y && !z,
B = a.isTouchDevice = 'ontouchstart' in window || 'DocumentTouch' in window && document instanceof DocumentTouch
}
}, function (a, b, c) {
'use strict';
Object.defineProperty(b, '__esModule', {value: !0});
var d = c(1);
(function (a, b, e) {
if (!b.__hasQingDesktopLE3) {
b.__hasQingDesktopLE3 = !0;
var f = {}, g = 0, h = function (a) {
var b = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}, c = b.success,
d = b.complete;
delete b.success, delete b.error, delete b.complete;
var e = ++g;
f[e] = function (a) {
'true' === a.success ? a.success = !0 : 'false' === a.success && (a.success = !1), c && c(a, {
code: 200,
data: a
}), d && d(a, {code: 200, data: a})
};
var h = document.createElement('IFRAME');
h.setAttribute('src', 'xuntong:' + a + ':' + e + ':' + encodeURIComponent(JSON.stringify(b))), h.setAttribute('height', '1px'), h.setAttribute('width', '1px'), document.documentElement.appendChild(h), h.parentNode.removeChild(h), h = null
}, i = function (a, b) {
try {
var c = f[a];
if (!c) return;
c.apply(null, [JSON.parse(b)])
} catch (a) {
alert(a)
}
}, j = {
share: !0,
chat: !0,
personInfo: !0,
getPersonInfo: !0,
gotoLightApp: !0,
selectPersons: !0,
setWebViewTitle: !0,
closeWebView: !0,
close: !0,
hideWebViewTitle: !0,
defback: !0,
showOptionMenu: !0,
hideOptionMenu: !0,
selectOrgs: !0,
closePop: !0,
createPop: !0
}, k = function (a) {
var b = a.jsApiList, c = a.success, d = a.complete, e = {};
(b || []).forEach(function (a) {
e[a] = !!j[a]
});
var f = {success: !0, data: e};
c && c(f), d && d(f)
};
b.XuntongJSBridge.handleMessageFromXT = i;
var l = function (a) {
return function () {
c.i(d.a)('method [' + a + '] not support')
}
};
e._bridge = {
call: h,
on: l,
off: l,
checkJsApi: k,
config: l,
trigger: l
}, a.dispatchEvent(new Event('QingReady'))
}
})(document, window, window.qing || (window.qing = {}))
}, function (a, b, c) {
'use strict';
Object.defineProperty(b, '__esModule', {value: !0});
c(13);
(function (a, b, c) {
if (!b.__hasQingDesktop) {
b.__hasQingDesktop = !0;
var d = b._CloudHubJSBridge;
c._bridge = {
call: d.emit,
on: d.on,
off: d.off,
checkJsApi: d.checkJsApi,
trigger: d.trigger,
config: function () {
}
}, a.dispatchEvent(new Event('QingReady'))
}
})(document, window, window.qing || (window.qing = {}))
}, function (a, b, c) {
'use strict';
var d = c(2), e = c(0);
e.a('getTicket', function (a) {
c.i(d.a)(window.qing, a)
}, !0)
}, function (a, b, c) {
'use strict';
c(12)
}, function (a, b, c) {
'use strict';
Object.defineProperty(b, '__esModule', {value: !0});
var d = c(1), e = c(3), f = Object.assign || function (a) {
for (var b, c = 1; c < arguments.length; c++) for (var d in b = arguments[c], b) Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d]);
return a
};
(function (a, b, g) {
if (!b.__hasQingMobile) {
b.__hasQingMobile = !0;
var h = function (a) {
return function () {
c.i(d.a)('method [' + a + '] not support')
}
}, i = {
index: 1, map: {}, register: function (a) {
this.index += 2;
var b = '' + this.index;
return 'function' == typeof a && (this.map[b] = function (a) {
this.cb.call(null, a)
}.bind({map: this.map, id: b, cb: a})), b
}, invoke: function (a, b) {
var c = this.map[a + ''];
'function' == typeof c && c(b)
}
}, j = {
invoke: function (a, b, c) {
var d, e = i.register(c);
b = 'undefined' == typeof b ? '' : encodeURIComponent(JSON.stringify(b)), d = 'xuntong:' + a + ':' + e + ':' + b;
var f = window.XTBridgeIframes = window.XTBridgeIframes || function () {
var a, b, c = [];
for (b = 0; 9 > b; b++) a = document.createElement('IFRAME'), a.setAttribute('height', '1px'), a.setAttribute('width', '1px'), a.style.display = 'none', document.documentElement.appendChild(a), c.push(a);
return c
}();
j.callbackIndex = j.callbackIndex || 0;
var g = j.callbackIndex;
j.callbackIndex += 1;
var h = f[g % 9];
h.setAttribute('src', d), setTimeout(function () {
h.removeAttribute('src')
}, 10)
}, callback: function (a, b) {
if ('string' == typeof b && b.match(/^\s*\{/)) try {
b = JSON.parse(b), b && 'string' == typeof b.success && (b.success = 'true' === b.success)
} catch (a) {
console.error(a)
}
i.invoke(a, b)
}
};
window.XuntongJSBridge = f({
invoke: j.invoke,
call: j.invoke,
handleMessageFromXT: j.callback
}, window.XuntongJSBridge), g._bridge = {
call: function (a, b) {
b = b || {};
var c = b.success, d = b.complete;
delete b.success, delete b.error, delete b.complete, j.invoke(a, b, function () {
'function' == typeof c && c.apply(null, arguments), 'function' == typeof d && d.apply(null, arguments)
})
}, on: h, off: h, checkJsApi: function (a) {
var b = a.jsApiList, d = {}, f = c.i(e.a)();
(b || []).forEach(function (a) {
var b = f[a], c = g.isAndroid ? 'android' : g.isIos ? 'ios' : 'other';
d[a] = b && b[c] && g.checkVersion(b.version)
}), 'function' == typeof a.success && a.success({success: !0, data: d})
}, config: h, trigger: h
}, a.dispatchEvent(new Event('QingReady'))
}
})(document, window, window.qing || (window.qing = {}))
}, function (a, b, c) {
'use strict';
Object.defineProperty(b, '__esModule', {value: !0});
var d = c(26), e = c(6), f = c(3), g = c(18);
(function (a, b, g) {
function h() {
var a = {
call: function (a) {
c.i(d.a)(p, a) ? n.invoke.apply(null, arguments) : o.call.apply(null, arguments)
}, on: n.on, handleMessageFromXT: o.handleMessageFromXT
};
a.invoke = a.call, b.XuntongJSBridge = a;
var e = 'eventPrefix_', h = {}, j = function (b) {
h[b] || (h[b] = !0, a.on(b, function (a) {
i(e + b, {eventData: a})
}))
};
g._bridge = {
call: function (b, c) {
c = c || {};
var d = c.success, e = c.complete;
delete c.success, delete c.error, delete c.complete, a.call(b, c, function (a) {
var b = {code: 200, data: a};
d && d(a, b), e && e(a, b)
})
}, on: function (a, b) {
b && (j(a), 'function' == typeof b && (b = {success: b}), document.addEventListener(e + a, function (a) {
'function' == typeof b.success && b.success(a.eventData), 'function' == typeof b.complete && b.complete(a.eventData)
}))
}, off: function (a, b) {
document.removeEventListener(e + a, b)
}, checkJsApi: function (a) {
var b = a.jsApiList, d = {};
if (g.checkVersion('0.9.80')) g.call('checkJsApi', a); else {
var e = c.i(f.a)();
(b || []).forEach(function (a) {
var b = e[a], c = g.isAndroid ? 'android' : g.isIos ? 'ios' : 'other';
d[a] = b && b[c] && g.checkVersion(b.version)
}), 'function' == typeof a.success && a.success({success: !0, data: d})
}
}, config: function () {
}, trigger: function (a, b) {
n.trigger(a, b)
}
}, i('QingReady', g._bridge)
}
if (!b.__hasQingMobile) {
b.__hasQingMobile = !0;
var i = function (a, b) {
var d = document.createEvent('HTMLEvents');
c.i(e.a)(d, b), d.initEvent(a), document.dispatchEvent(d)
}, j = function (a) {
var b = a.match(/(.+)\.([^\.]+)/);
return b && 3 === b.length ? {name: b[2], ns: b[1]} : {ns: '', name: a}
}, k = function () {
var a = navigator.userAgent.split(';')[0], b = a.slice(a.indexOf('Qing/') + 5);
return parseFloat(b.slice(2))
}(), l = {
map: {}, index: 1, indexStep: 2, register: function (a) {
this.index += this.indexStep;
var b = '' + this.index;
return 'function' == typeof a && (this.map[b] = function (a) {
this.cb.call(null, a)
}.bind({map: this.map, id: b, cb: a})), b
}, invoke: function (a, b) {
var c = this.map[a + ''];
'function' == typeof c && c(b)
}
}, m = {}, n = {
invoke: function (a, b, c) {
var d = (window.ClientInfo || {}).v9bridge || 'cloudhub';
return o.call(a, b, c, d)
}, callback: function (a, b) {
return o.handleMessageFromXT(a, b)
}, on: function (a, b) {
m[a] || (m[a] = []), m[a].push(b)
}, trigger: function (a, b) {
(m[a] || []).forEach(function (a) {
'function' == typeof a && a(b)
})
}
}, o = {
call: function (a, b, c, d) {
var e, f = l.register(c);
if (b = 'undefined' == typeof b ? '' : encodeURIComponent(JSON.stringify(b)), d ? (a = j(a), e = d + '://' + a.ns + ':' + f + '/' + a.name + '?' + b) : e = 'xuntong:' + a + ':' + f + ':' + b, g.isAndroid) {
if (window.AndroidInterface) return window.AndroidInterface.call(e), f;
if (9.59 <= k) return window.prompt(e), f
} else {
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.wkbridge2) return window.webkit.messageHandlers.wkbridge2.postMessage({url: e}), f;
if (window.kdUIWebViewBridge) return window.kdUIWebViewBridge(e), f
}
var h = window.XTBridgeIframes = window.XTBridgeIframes || function () {
var a, b, c = [];
for (b = 0; 9 > b; b++) a = document.createElement('IFRAME'), a.setAttribute('height', '1px'), a.setAttribute('width', '1px'), a.style.display = 'none', document.documentElement.appendChild(a), c.push(a);
return c
}();
o.callbackIndex = o.callbackIndex || 0;
var i = o.callbackIndex;
o.callbackIndex += 1;
var m = h[i % 9];
return m.setAttribute('src', e), setTimeout(function () {
m.removeAttribute('src')
}, 10), f
}, handleMessageFromXT: function (a, b) {
if ('string' == typeof b && b.match(/^\s*\{/)) try {
b = JSON.parse(b), b && 'string' == typeof b.success && (b.success = 'true' === b.success)
} catch (a) {
console.error(a)
}
l.invoke(a, b)
}
},
p = ['runtime.auth', 'runtime.jsReady', 'cloudoffice.request', 'cloudoffice.showCardNotify', 'cloudoffice.clearCardNotify', 'cloudoffice.getRoleType', 'cloudoffice.checkAppAuth', 'cloudoffice.shareText', 'cloudoffice.downloadPic', 'cloudoffice.checkWorkbenchUpdate', 'cloudoffice.textShareClosed', 'cloudoffice.dataReport', 'cloudoffice.setScrollEnable', 'ui.changeNavBarStyle', 'ui.changeNavStyle', 'ui.toast', 'ui.webViewScrollTo', 'ui.webViewPaddingTop', 'ui.navigate', 'storage.getItem', 'storage.setItem', 'storage.removeItem', 'storage.clear', 'bluetooth.openBluetoothAdapter', 'bluetooth.closeBluetoothAdapter', 'bluetooth.getBluetoothAdapterState', 'bluetooth.onBluetoothAdapterStateChange', 'bluetooth.startBluetoothDevicesDiscovery', 'bluetooth.stopBluetoothDevicesDiscovery', 'bluetooth.getBluetoothDevices', 'bluetooth.onBluetoothDeviceFound', 'bluetooth.getConnectedBluetoothDevices', 'bluetooth.createBLEConnection', 'bluetooth.closeBLEConnection', 'bluetooth.getBLEDeviceServices', 'bluetooth.getBLEDeviceCharacteristic', 'bluetooth.readBLECharacteristicValue', 'bluetooth.writeBLECharacteristicValue', 'bluetooth.notifyBLECharacteristicValueChange', 'bluetooth.onBLEConnectionStateChange', 'bluetooth.onBLECharacteristicValueChange', 'bluetooth.getBLEDeviceCharacteristics', 'bluetooth.BLEPrint', 'bluetooth.getBondDevice', 'bluetooth.connectBluetoothDevice', 'bluetooth.writeBluetoothDevice', 'bluetooth.closeBluetoothConnection', 'video.startRecord', 'video.upload', 'video.download', 'video.play', 'video.select'];
h(), Object.defineProperty(window, 'CloudHubJSBridge', {
set: function () {
}, get: function () {
return n
}
})
}
})(document, window, window.qing || (window.qing = {}))
}, function (a, b, c) {
'use strict';
var d = c(0), e = function (a, b) {
return a = window.qing.checkVersion('0.9.71') ? 'ui.changeNavStyle' : 'ui.changeNavBarStyle', {
name: a,
params: b
}
};
d.a('ui.changeNavBarStyle', e), d.a('ui.changeNavStyle', e)
}, function (a, b, c) {
'use strict';
var d = c(2), e = c(0);
e.a('getTicket', function (a) {
c.i(d.a)(window.qing, a)
}, !0, !0)
}, function (a, b, c) {
'use strict';
var d = c(17), e = c(23), f = c(19), g = c(4), h = c(16)
}, function (a, b, c) {
'use strict';
var d = c(0);
d.a('request', function (a) {
return {name: 'cloudoffice.request', params: a}
})
}, function (a, b) {
'use strict';
b.a = function (a) {
return 'string' == typeof a ? (a = a.replace(/'/gm, '\u25B4\u25B4').replace(/"/gm, '\u25BE\u25BE'), escape(a)) : a
}, b.b = function (a) {
return 'string' == typeof a ? (a = unescape(a), a.replace(/▴▴/gm, '\'').replace(/▾▾/gm, '"')) : a
}
}, function (a, b, c) {
'use strict';
Object.defineProperty(b, '__esModule', {value: !0});
var d = c(20);
b.setItem = function (a) {
return a.value = c.i(d.a)(a.value), {name: 'storage.setItem', params: a}
}, b.getItem = function (a) {
var b = a.success;
return a.success = function (a) {
a.success && a.data && a.data.value && (a.data.value = c.i(d.b)(a.data.value)), b(a)
}, {name: 'storage.getItem', params: a}
}
}, function (a, b) {
'use strict';
Object.defineProperty(b, '__esModule', {value: !0}), b.setItem = function (a) {
var b = 'clientStorage_' + a.key, d = a.success;
c.setItem(b, a.value), d && d()
}, b.getItem = function (a) {
var b = 'clientStorage_' + a.key, d = a.success;
d && d({success: !0, data: {value: c.getItem(b)}})
}, b.removeItem = function (a) {
var b = 'clientStorage_' + a.key, d = a.success;
c.removeItem(b), d && d()
}, b.clear = function () {
};
var c = window.localStorage
}, function (a, b, c) {
'use strict';
var d = c(0);
d.a('toast', function (a) {
return a.message = a.msg, delete a.msg, {name: 'ui.toast', params: a}
})
}, function (a, b, c) {
'use strict';
Object.defineProperty(b, '__esModule', {value: !0});
var d = c(6), e = c(4), f = c(5);
(function (a, b, g) {
function h(a, b) {
var c = window.top.__sessionUser, d = window.top.__myinfo, e = 100;
b = b || 0, c && d ? a({
success: !0,
data: {
id: d.id,
openId: c.openId,
wbnetworkid: c.wbNetworkId,
eid: c.eid,
companyName: c.companyName,
photoUrl: c.photoUrl,
name: c.name,
wbuserid: c.wbUserId
}
}) : b * e > 3e4 ? a({success: !1}) : setTimeout(function () {
h(a)
}, e)
}
function i() {
var a = {
call: function (a, b, d, g) {
switch (a) {
case'toast':
alert(b.msg);
break;
case'request':
c.i(f.a)({
url: b.url,
data: b.data,
method: b.method,
headers: b.headers,
serializer: b.serializer,
success: b.success || d,
error: b.error || g
});
break;
case'gotoLightApp':
'function' == typeof window.top.gotoLightApp && window.top.gotoLightApp(b);
break;
case'getPersonInfo':
h(function (a) {
a.success ? ('function' == typeof b.success && b.success(a), 'function' == typeof d && d(a)) : ('function' == typeof b.error && b.error(a), 'function' == typeof g && g(a)), 'function' == typeof b.complete && b.complete(a)
});
break;
default:
console.log('not support bridge: ' + a);
}
}, on: function () {
}, handleMessageFromXT: function () {
}
};
a.invoke = a.call, b.XuntongJSBridge = a, g._bridge = {
call: function (b, d) {
if (d = d || {}, b.match(/^storage\./)) c.i(e['default'])(g, a, b, d); else {
var f = d.success, h = d.error, i = d.complete;
delete d.success, delete d.error, delete d.complete, 'ui.toast' === b && (b = 'toast', d.msg = d.message, delete d.message), 'cloudoffice.request' === b && (b = 'request'), a.call(b, d, function () {
'function' == typeof f && f.apply(null, arguments), 'function' == typeof i && i.apply(null, arguments)
}, function () {
'function' == typeof h && h.apply(null, arguments), 'function' == typeof i && i.apply(null, arguments)
})
}
}, on: function () {
}, off: function () {
}, checkJsApi: function (a) {
return 'storage' === a || 'storage.getItem' === a || 'storage.setItem' === a || 'storage.removeItem' === a || 'storage.clear' === a || 'ui.toast' === a || 'toast' === a || 'request' === a || 'cloudoffice.request' === a || 'gotoLightApp' === a || 'getPersonInfo' === a
}, config: function () {
}, trigger: function () {
}
}, j('QingReady', g._bridge)
}
if (!b.__hasQingWeb) {
b.__hasQingWeb = !0;
var j = function (a, b) {
var e = document.createEvent('HTMLEvents');
c.i(d.a)(e, b), e.initEvent(a, !0, !1), document.dispatchEvent(e)
};
i()
}
})(document, window, window.qing || (window.qing = {}))
}, function (a, b) {
'use strict';
var c = Array.from;
b.a = c ? c : function (a) {
for (var b = a.length, c = [], d = 0; d < b; d++) c.push(a[d]);
return c
}
}, function (a, b) {
'use strict';
b.a = function (a, b) {
return a && a.some && a.some(function (a) {
return a === b
})
}
}, function (a, b) {
'use strict';
Object.defineProperty(b, '__esModule', {value: !0}), b.init = function (a) {
c.XuntongJSBridge = {
call: function (b) {
var c = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : {}, d = arguments[2];
d && (c.complete = d), a.call(b, c)
}
}
};
var c = window
}, function (a, b, c) {
a.exports = c(7)
}]);

50
src/util/request.js Normal file
View File

@ -0,0 +1,50 @@
import axios from "axios";
import qs from 'qs'
import { Base64 } from 'js-base64';
import store from "../store";
const http = axios.create({
// baseURL: 'http://127.0.0.1:8000',
timeout: 1000 * 60,
withCredentials: true
});
const website = {
key: 'saber',//配置主键,目前用于存储
clientId: 'saber', // 客户端id
clientKey: 'saber_secret',
tenantMode: false, // 是否开启租户模式
tenantId: "000000", // 管理组租户编号
tokenTime: 3000,
tokenHeader: 'Blade-Auth',
};
//request拦截
http.interceptors.request.use(config => {
config.headers[website.tokenHeader] = store.state.user.token || sessionStorage.getItem('token')
config.headers['Authorization'] = `Basic ${Base64.encode(`${website.clientId}:${website.clientKey}`)}`;
if (/^application\/x-www-form-urlencoded/.test(config.headers['Content-Type'])) {
config.data = qs.stringify(config.data)
}
return config
}, error => {
return Promise.reject(new Error(error))
});
//response拦截
http.interceptors.response.use(
res => {
const status = res.data.code || res.status;
const message = res.data.msg || res.data.error_description || '未知错误';
if (status !== 200) {
return Promise.reject(message)
}
return res
},
error => {
console.log(JSON.stringify(error));
const message = error.response.data.error_description || error.message || '未知错误';
return Promise.reject(message)
});
export default http

152
src/util/upload.js Normal file
View File

@ -0,0 +1,152 @@
import func from "./func";
import { singleFileUpload, multiFileUpload } from '@/api/index.js'
import request from '@/util/request'
export default class upload {
/**
* 单个附件上传
* @param file element file对象
* @param fileType 1-证件
2-合同
3-发票
4-其他
5-贷后检查材料
6-回单
7-财务报表
8-授权书
9-承诺书
10-协议
11-网贷影像材料
12-马消贷影像材料
13-长安车贷影像材料
14-云按揭材料
15-保险材料
16-ETC材料
17-烟叶资金结算签约影像资料
18-安全信息化管理系统影像
* @param groupName 分组名称
* @return {Promise<*>} 成功-uploadVo数组/失败-undifine
*/
static async singleUpload(file, fileType, groupName) {
if (func.isUndefined(file) || func.isUndefined(fileType) || func.isUndefined(groupName)) {
return
}
let formData = new FormData()
formData.append('file', file)
formData.append('fileType', fileType)
formData.append('groupName', groupName)
return await singleFileUpload({}, formData).then(res => {
if (res.data.code === 200) {
return res.data.data
}
})
}
/**
* 批量文件上传
* @param uploadFiles element上传组件文件列表
* @param fileType 1-证件
2-合同
3-发票
4-其他
5-贷后检查材料
6-回单
7-财务报表
8-授权书
9-承诺书
10-协议
11-网贷影像材料
12-马消贷影像材料
13-长安车贷影像材料
14-云按揭材料
15-保险材料
16-ETC材料
17-烟叶资金结算签约影像资料
18-安全信息化管理系统影像
* @param groupName 分组名称
* @return {Promise<*>} 成功-uploadVo数组/失败-undifine
*/
static async multiUpload(uploadFiles, fileType, groupName) {
if (func.isUndefined(uploadFiles) || func.isUndefined(fileType) || func.isUndefined(groupName)) {
return
}
let formData = new FormData()
if (uploadFiles.length > 0) {
uploadFiles.forEach(item => {
formData.append('files', item)
})
}
formData.append('fileType', fileType)
formData.append('groupName', groupName)
return await multiFileUpload({}, formData).then(res => {
if (res.data.code === 200) {
return res.data.data
}
})
}
/**
* 附件下载
* @param file文件
*/
static download(file) {
let url = '/sis/api/security-desk' + file.url;
if (file.encrypt) {
url = url + '?encrypt=true'
}
request({
url: url,
method: 'get',
headers: { 'Content-Type': 'multipart/form-data' },
responseType: 'blob',
}).then((res) => {
let blob = new Blob([res.data]);
let fileUrl = window.URL.createObjectURL(blob);
let a = document.createElement('a');
a.href = fileUrl;
a.download = file.name;
a.click();
window.URL.revokeObjectURL(fileUrl);
}).catch((err => {
console.log(err);
}))
}
static getImgPreviewFile(file, callback) {
let url = '/sis/api/security-desk' + file.url;
if (file.encrypt) {
url = url + '?encrypt=true'
}
let contentType = 'multipart/form-data';
switch (file.fileType) {
case 'jpg':
case 'jepg':
contentType = 'image/jpeg';
break;
case 'png':
contentType = 'image/png';
break;
case 'svg':
contentType = 'image/svg+xml';
break;
}
let headers = {
'Content-Type': contentType
}
return request({
url: url,
method: 'get',
headers: headers,
responseType: 'blob',
}).then((res) => {
var fileReader = new FileReader();
fileReader.onload = (e) => {
callback(e.target.result);
};
fileReader.readAsDataURL(res.data);
}).catch((err => {
this.$message.error(err);
}))
}
}

352
src/util/validate.js Normal file
View File

@ -0,0 +1,352 @@
/**
* Created by jiachenpan on 16/11/18.
*/
export function isvalidUsername(str) {
const valid_map = ['admin', 'editor']
return valid_map.indexOf(str.trim()) >= 0
}
/* 合法uri*/
export function validateURL(textval) {
const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
return urlregex.test(textval)
}
/**
* 邮箱
* @param {*} s
*/
export function isEmail(s) {
return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
}
/**
* 手机号码
* @param {*} s
*/
export function isMobile(s) {
return /^1[0-9]{10}$/.test(s)
}
/**
* 电话号码
* @param {*} s
*/
export function isPhone(s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
}
/**
* URL地址
* @param {*} s
*/
export function isURL(s) {
return /^http[s]?:\/\/.*/.test(s)
}
/* 小写字母*/
export function validateLowerCase(str) {
const reg = /^[a-z]+$/
return reg.test(str)
}
/* 大写字母*/
export function validateUpperCase(str) {
const reg = /^[A-Z]+$/
return reg.test(str)
}
/* 大小写字母*/
export function validatAlphabets(str) {
const reg = /^[A-Za-z]+$/
return reg.test(str)
}
/*验证pad还是pc*/
export const vaildatePc = function () {
const userAgentInfo = navigator.userAgent;
const Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
"iPad", "iPod"
];
let flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
}
/**
* validate email
* @param email
* @returns {boolean}
*/
export function validateEmail(email) {
const re = /^(([^<>()\\[\]\\.,;:\s@"]+(\.[^<>()\\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
return re.test(email)
}
/**
* 判断身份证号码
*/
export function validIdCard(code) {
let result = true;
let msg = '';
var city = {
11: "北京",
12: "天津",
13: "河北",
14: "山西",
15: "内蒙古",
21: "辽宁",
22: "吉林",
23: "黑龙江 ",
31: "上海",
32: "江苏",
33: "浙江",
34: "安徽",
35: "福建",
36: "江西",
37: "山东",
41: "河南",
42: "湖北 ",
43: "湖南",
44: "广东",
45: "广西",
46: "海南",
50: "重庆",
51: "四川",
52: "贵州",
53: "云南",
54: "西藏 ",
61: "陕西",
62: "甘肃",
63: "青海",
64: "宁夏",
65: "新疆",
71: "台湾",
81: "香港",
82: "澳门",
91: "国外 "
};
if (!validatenull(code)) {
if (code.length == 18) {
if (!code || !/(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(code)) {
msg = "证件号码格式错误";
} else if (!city[code.substr(0, 2)]) {
msg = "地址编码错误";
} else {
//18位身份证需要验证最后一位校验位
code = code.split('');
//∑(ai×Wi)(mod 11)
//加权因子
var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
//校验位
var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2, 'x'];
var sum = 0;
var ai = 0;
var wi = 0;
for (var i = 0; i < 17; i++) {
ai = code[i];
wi = factor[i];
sum += ai * wi;
}
if (parity[sum % 11] != code[17]) {
msg = "证件号码校验位错误";
} else {
result = false;
}
}
} else {
msg = "证件号码长度不为18位";
}
} else {
msg = "证件号码不能为空";
}
return {result: result, msg: msg};
}
/**
* 判断手机号码是否正确
*/
export function isvalidatemobile(phone) {
let list = [];
let result = true;
let msg = '';
var isPhone = /^0\d{2,3}-?\d{7,8}$/;
//增加134 减少|1349[0-9]{7}增加181,增加145增加17[678]
if (!validatenull(phone)) {
if (phone.length == 11) {
if (isPhone.test(phone)) {
msg = '手机号码格式不正确';
} else {
result = false;
}
} else {
msg = '手机号码长度不为11位';
}
} else {
msg = '手机号码不能为空';
}
list.push(result);
list.push(msg);
return list;
}
/**
* 判断是否为正整数
*/
export function isvalidateinteger(num) {
let list = [];
let result = true;
let msg = '';
var isnum = /^[1-9]\d*$/;
if (!validatenull(num)) {
if (isnum.test(num)) {
result = false;
} else {
msg = "请输入正整数";
}
} else {
msg = '不能为空';
}
list.push(result);
list.push(msg);
return list;
}
/**
* 判断是否为小数
*/
export function isvalidatenumber(num) {
let list = [];
let result = true;
let msg = '';
var isnum = /^[0-9]+.?[0-9]*/;
if (!validatenull(num)) {
if (isnum.test(num)) {
result = false;
} else {
msg = "请输入整数或小数";
}
} else {
msg = '不能为空';
}
list.push(result);
list.push(msg);
return list;
}
/**
* 判断姓名是否正确
*/
export function validatename(name) {
var regName = /^[\u4e00-\u9fa5]{2,4}$/;
if (!regName.test(name)) return false;
return true;
}
/**
* 判断是否为整数
*/
export function validatenum(num, type) {
let regName = /[^\d.]/g;
if (type == 1) {
if (!regName.test(num)) return false;
} else if (type == 2) {
regName = /[^\d]/g;
if (!regName.test(num)) return false;
}
return true;
}
/**
* 判断是否为小数
*/
export function validatenumord(num, type) {
let regName = /[^\d.]/g;
if (type == 1) {
if (!regName.test(num)) return false;
} else if (type == 2) {
regName = /[^\d.]/g;
if (!regName.test(num)) return false;
}
return true;
}
/**
* 判断是否为空
*/
export function validatenull(val) {
if (typeof val == 'boolean') {
return false;
}
if (typeof val == 'number') {
return false;
}
if (val instanceof Array) {
if (val.length == 0) return true;
} else if (val instanceof Object) {
if (JSON.stringify(val) === '{}') return true;
} else {
if (val == 'null' || val == null || val == 'undefined' || val == undefined || val == '') return true;
return false;
}
return false;
}
/**
* element表单验证验证手机号
* @param rule
* @param value
* @param callback
* @return {*}
*/
export function validmobile(rule, value, callback) {
let res = isvalidatemobile(value)
if (res[0]) {
return callback(new Error(res[1]))
}
callback()
}
/**
* element表单验证整数验证
* @param rule
* @param value
* @param callback
* @return {*}
*/
export function validnum(rule, value, callback) {
let res = isvalidateinteger(value)
if (res[0]) {
return callback(new Error(res[1]))
}
callback()
}
/**
* element表单验证必需为小数或者整数验证
* @param rule
* @param value
* @param callback
* @return {*}
*/
export function validnumber(rule, value, callback) {
let res = isvalidatenumber(value)
if (res[0]) {
return callback(new Error(res[1]))
}
callback()
}

57
src/vant/index.js Normal file
View File

@ -0,0 +1,57 @@
import Vue from 'vue'
import { Form } from 'vant'
import { Field } from 'vant'
import { Button } from 'vant'
import { NavBar } from 'vant'
import { Uploader } from 'vant'
import { RadioGroup, Radio } from 'vant'
import { Divider } from 'vant'
import { Cell, CellGroup } from 'vant'
import { Grid, GridItem } from 'vant'
import { List } from 'vant'
import { Swipe, SwipeItem } from 'vant'
import { Empty } from 'vant'
import { CountDown } from 'vant'
import { PullRefresh } from 'vant'
import { Dialog } from "vant"
import {Sidebar, SidebarItem} from "vant"
import {Loading} from "vant"
import {Overlay} from "vant"
import {Toast} from "vant"
import {Tag} from "vant"
import {Calendar} from "vant"
import {Image} from "vant";
import {Row} from "vant";
import {Col} from "vant";
Vue.use(Tag)
Vue.use(Toast)
Vue.use(Overlay)
Vue.use(Loading)
Vue.use(Sidebar)
Vue.use(SidebarItem)
Vue.use(Dialog)
Vue.use(Form)
Vue.use(Field)
Vue.use(Button)
Vue.use(NavBar)
Vue.use(Uploader)
Vue.use(Grid)
Vue.use(GridItem)
Vue.use(List)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Divider)
Vue.use(Cell)
Vue.use(CellGroup)
Vue.use(Swipe)
Vue.use(SwipeItem)
Vue.use(Empty)
Vue.use(CountDown)
Vue.use(Calendar)
Vue.use(PullRefresh)
Vue.use(Image)
Vue.use(Row)
Vue.use(Col)
Vue.prototype.$dialog = Dialog

141
src/views/device-check.vue Normal file
View File

@ -0,0 +1,141 @@
<!--设备检查-->
<template>
<div class="device">
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>上传中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar title="设备检查" left-text="返回" left-arrow @click-left="$router.back()" />
<van-form>
<van-empty v-show="list.length === 0" description="无设备检查项" />
<div v-show="list.length > 0" v-for="(item, index) in list" :key="index">
<van-field v-model="item.name" name="设备检查项" label="设备检查项" readonly />
<van-field name="1" label="检查结果状态" required>
<template #input>
<van-radio-group v-model="item.problemLevel" direction="horizontal">
<van-radio name="1">正常</van-radio>
<van-radio name="2">异常</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-model="item.result" name="检查结果" label="检查结果" placeholder="请输入检查结果描述" required/>
<van-field name="uploader" label="检查时照片" required>
<template #input>
<van-uploader v-model="item.unUploadImgUrl" :name="index" :ref="'upload' + index" capture="camera"
accept="image/*" />
</template>
</van-field>
</div>
<van-field v-model="form.remark" name="备注" label="备注" type="textarea" v-show="list.length > 0" />
<div style="margin: 16px">
<van-button round block type="danger" native-type="submit" v-show="list.length > 0" @click="submit()">提交
</van-button>
</div>
</van-form>
</div>
</template>
<script>
import { getDeviceItemDetail, deviceHandin } from "../api";
import upload from "@/util/upload";
import func from "@/util/func";
export default {
name: "device-check",
data() {
return {
form: {
id: "",
remark: "",
},
list: [
{
id: "",
name: "",
result: "",
problemLevel: "",
imgUrl: [],
unUploadImgUrl: [],
},
],
loading:false,
};
},
// activated() {
// this.getData();
// },
mounted() {
this.getData();
},
methods: {
//
getData() {
this.loading=true
const id = this.$route.params.dataId;
const type = '1';
this.form.id = id;
getDeviceItemDetail(id, type).then((res) => {
this.loading=false
this.list = res.data.data;
});
},
//
submit() {
this.loading=true
let data = this.form;
let syncList = [];
let hasNoFileItem = false;
this.list.forEach((element) => {
if (typeof element.unUploadImgUrl == 'undefined' || element.unUploadImgUrl.length < 1) {
this.loading=false;
hasNoFileItem = true;
return
}
let fileList = [];
element.unUploadImgUrl.forEach((imgFile) => {
fileList.push(imgFile.file);
});
syncList.push(new Promise((resolve, reject) => {
//
upload.multiUpload(fileList, '18', 'beforePicIds').then(res => {
if (!func.isEmpty(res)) {
element.beforePicIds = "beforePicIds";
element.imgUrl = res
resolve();
} else {
reject();
}
}).catch(err => {
reject();
return this.$dialog.alert({ message: err });
})
}))
});
if (hasNoFileItem) {
this.$dialog.alert({ message: "请上传所有检查时照片再提交" });
return
}
Promise.all(syncList).then(() => {
data.appDeviceDTOList = this.list;
deviceHandin(data).then((res) => {
this.loading=false
if (res.data.code !== 200) {
return this.$dialog.alert({ message: res.data.msg });
}
this.$dialog.alert({ message: '提交成功' }).then(() => {
this.$router.push({ name: 'index' })
})
});
}).catch((err) => {
console.log(err);
});
},
},
};
</script>
<style scoped>
</style>

View File

@ -0,0 +1,181 @@
<!--设备持续整改-->
<template>
<div class="device">
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>上传中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar title="设备持续整改" left-text="返回" left-arrow @click-left="$router.back()" />
<van-form>
<van-empty v-show="list.length === 0" description="无设备持续整改项" />
<div v-show="list.length > 0" v-for="(item, index) in list" :key="index">
<van-field v-model="item.name" name="检查内容" label="检查内容" readonly />
<van-field v-model="item.result" name="检查结果" label="检查结果" readonly />
<van-field name="1" label="整改结果状态" required>
<template #input>
<van-radio-group v-model="item.rectificationStatus" direction="horizontal">
<van-radio name="1">正常</van-radio>
<van-radio name="2">异常</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-model="item.rectifyResult" name="整改结果" label="整改结果" placeholder="请输入整改结果描述" required/>
<van-field name="1" label="是否需要持续整改">
<template #input>
<van-radio-group v-model="item.recordFlag" direction="horizontal">
<van-radio name="1"></van-radio>
<van-radio name="2"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field readonly clickable :value="item.rectificationDeadline" name="calendar" label="持续整改期限"
placeholder="请选择持续整改期限" @click="showCalendarMethod(index)" v-if="item.recordFlag === '2'" />
<van-field name="uploader" label="整改后照片">
<template #input>
<van-uploader v-model="item.unUploadImgUrl" :ref="'upload' + index" capture="camera" />
</template>
</van-field>
</div>
<div style="margin: 16px">
<van-button round block type="danger" native-type="submit" v-show="list.length > 0" @click="submit">提交
</van-button>
</div>
<van-calendar v-model="showCalendar" @confirm="onConfirm($event)" @close="closeCalendar" />
</van-form>
</div>
</template>
<script>
import { getDeviceItemDetail, continuedRectifyHandin } from "../api";
import upload from "@/util/upload";
import func from "@/util/func";
export default {
name: "device-continued-detail",
data() {
return {
form: {
id: "",
remark: "",
},
list: [
{
id: "",
name: "",
recordFlag: "",
result: "",
rectificationDeadline: "",
problemLevel: "",
imgUrl: [],
unUploadImgUrl: [],
rectifyResult: '',
},
],
deadlineDate: "",
showCalendar: false,
itemIdex: 0,
loaidng:false,
};
},
mounted() {
this.getData();
},
methods: {
formDate(date) {
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
},
onConfirm(date) {
this.deadlineDate = this.formDate(date);
this.list[this.itemIdex].rectificationDeadline = this.deadlineDate;
this.showCalendar = false;
},
// onConfirm(item) {
// let date = new Date();
// this.deadlineDate = this.formDate(date);
// console.log(item);
// console.log(this.deadlineDate);
// item.rectificationDeadline = this.deadlineDate;
// console.log(item.rectificationDeadline);
// console.log(item);
// this.showCalendar = false;
// },
//
getData() {
this.loading=true
const id = this.$route.params.dataId;
const type = '3';
this.form.id = id;
getDeviceItemDetail(id, type).then((res) => {
this.loading=false
this.list = res.data.data;
});
},
//
submit() {
this.loading=true
let data = this.form;
let syncList = [];
let hasNoFileItem = false;
this.list.forEach((element) => {
if (typeof element.unUploadImgUrl == 'undefined' || element.unUploadImgUrl.length < 1) {
this.loading=false
hasNoFileItem = true;
return
}
let fileList = [];
element.unUploadImgUrl.forEach((imgFile) => {
fileList.push(imgFile.file);
});
syncList.push(new Promise((resolve, reject) => {
//
upload.multiUpload(fileList, '18', 'afterPicIds').then(res => {
if (!func.isEmpty(res)) {
element.afterPicIds = "afterPicIds";
element.imgUrl = res
resolve();
} else {
reject();
}
}).catch(err => {
reject();
return this.$dialog.alert({ message: err });
})
}))
});
if (hasNoFileItem) {
this.$dialog.alert({ message: "请上传所有整改后照片再提交" });
return
}
Promise.all(syncList).then(() => {
data.appDeviceDTOList = this.list;
continuedRectifyHandin(data).then((res) => {
this.loading=false
if (res.data.code !== 200) {
return this.$dialog.alert({ message: res.data.msg });
}
this.$dialog.alert({ message: '提交成功' }).then(() => {
this.$router.push({ name: 'index' })
})
});
}).catch((err) => {
console.log(err);
})
},
showCalendarMethod(index) {
this.showCalendar = true;
this.itemIndex = index
},
closeCalendar() {
this.showCalendar = false;
}
},
};
</script>
<style scoped>
</style>

View File

@ -0,0 +1,105 @@
<template>
<div class="deviceList">
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar
title="设备持续整改待办"
left-text="返回"
left-arrow
@click-left="$router.back()"
/>
<van-empty v-show="list.length === 0" description="无设备持续整改待办事项">
<img slot="image" src="@/assets/empty.png" alt="">
</van-empty>
<div
v-show="list.length > 0"
class="backlog_item"
v-for="item in list"
:key="item.id"
>
<p class="backlog_item_type">业务类型设备持续整改</p>
<p>设备名称{{ item.taskName }}</p>
<p>设备编号{{ item.deviceNum }}</p>
<p>
剩余时间<van-count-down
:time="item.overTime"
format="DD 天 HH 时 mm 分 ss 秒"
style="display: inline"
/>
</p>
<p>截止时间{{ item.deadline }}</p>
<p>
<van-button
size="small"
style="width: 100%"
color="linear-gradient(to right, #ff6034, #ee0a24)"
@click="backlogHandler(item.id)"
>
去处理
</van-button>
</p>
</div>
</div>
</template>
<script>
import { getBacklog } from "../api";
export default {
name: "device-continued-rectify",
data() {
return {
list: [],
loading: false,
finished: false,
refreshing: false,
dataType: "",
type: ""
};
},
mounted() {
this.getBackLogList();
},
methods: {
onLoad() {
setInterval(() => {
this.loading = false;
this.finished = true;
}, 1000);
},
//
getBackLogList() {
this.loading=true
this.dataType = "5";
this.type = "all";
getBacklog(this.dataType,this.type).then((res) => {
this.loading=false
this.list = res.data.data;
});
},
//
backlogHandler(id) {
return this.$router.push({ name: "device-detail", params: { dataId: id , type: "3"} });
},
},
};
</script>
<style scoped>
.backlog_item {
background: #ffffff;
padding: 8px;
margin: 10px 8px;
border-radius: 10px;
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.05);
}
.backlog_item .backlog_item_type {
font-size: 18px;
font-weight: bold;
}
</style>

135
src/views/device-detail.vue Normal file
View File

@ -0,0 +1,135 @@
<!--设备信息-->
<template>
<div class="deviceDetail">
<van-nav-bar title="设备信息" left-text="返回" left-arrow @click-left="$router.back()" />
<van-form>
<van-field v-model="form.name" name="设备名称" label="设备名称" readonly/>
<van-field v-model="form.deviceNum" name="设备编号" label="设备编号" readonly/>
<van-field v-model="form.company" name="设备厂商" label="设备厂商" readonly/>
<van-field v-model="form.modelNum" name="设备型号" label="设备型号" readonly/>
<van-field v-model="form.typeName" name="设备分类" label="设备分类" readonly/>
<van-field v-model="form.depName" name="所属部门" label="所属部门" readonly/>
<van-field v-model="form.address" name="设备位置" label="设备位置" readonly/>
<van-field v-model="form.maintenanceDate" name="维保时间" label="维保时间" readonly/>
<van-field v-model="form.state" name="待检状态" label="待检状态" readonly/>
<div style="margin: 16px">
<van-button round block type="danger" @click="startCheck()" v-if="type==='1'">录入整改结果</van-button>
<van-button round block type="danger" @click="scanning()" v-if="type==='2'">扫描设备二维码录入检查结果</van-button>
<van-button round block type="danger" @click="startCheck()" v-if="type==='3'">录入持续整改结果</van-button>
<!-- pc端测试跳开二维码验证 -->
<!-- <van-button round block type="danger" @click="startCheck()" v-if="type==='2'">直接录入检查结果</van-button> -->
</div>
</van-form>
</div>
</template>
<script>
import { getDeviceDetail, getDeviceRectifyDetail, getDeviceContinuedDetail } from "../api";
export default {
name: "device-detail",
data() {
return {
form: {
id: "",
name: "",
deviceNum: "",
company: "",
modelNum: "",
typeName: "",
depName: "",
address: "",
maintenanceDate: "",
state: "",
},
deviceId: "",
pushFlag: false,
aimId: "",
type:"",//1- 2- 3-
};
},
mounted() {
this.getData();
window.aimThisData = this.aimThisData;
},
methods: {
//
getData() {
this.aimId = this.$route.params.dataId;
const type = this.$route.params.type;
this.type=type;
//
if (type === "1") {
getDeviceRectifyDetail(this.aimId).then((res) => {
if (res.data.code !== 200) {
return this.$dialog.alert({message: res.data.msg});
}
this.form = res.data.data;
});
}
//
if (type === "2") {
getDeviceDetail(this.aimId).then((res) => {
if (res.data.code !== 200) {
return this.$dialog.alert({message: res.data.msg});
}
this.form = res.data.data;
});
}
//
if (type === "3") {
getDeviceContinuedDetail(this.aimId).then((res) => {
if (res.data.code !== 200) {
return this.$dialog.alert({message: res.data.msg});
}
this.form = res.data.data;
});
}
},
//
startCheck() {
//pc 线
// this.pushFlag=true;
const type = this.$route.params.type;
if (type === "1") {
return this.$router.push({ name: "device-rectify", params: { dataId: this.aimId } });
}
if (type === "2" && this.pushFlag) {
return this.$router.push({ name: "device-check", params: { dataId: this.aimId } });
}
if (type === "3") {
return this.$router.push({ name: "device-continued-detail", params: { dataId: this.aimId } });
}
},
//
scanning() {
window.qing.call("scanQRCode", {
"needResult": 1,
"success": function (result) {
if(result.data && result.data.qrcode_str){
let deviceId = result.data.qrcode_str.substring(0, 19);
// eslint-disable-next-line no-undef
aimThisData(deviceId);
}else{
return this.$dialog.alert({message: "扫描结果无法获取设备信息,请确认二维码是否属于设备二维码!"});
}
},
"error": function (res) {
return this.$dialog.alert({message: res.errMsg});
}
})
},
aimThisData(deviceId) {
this.deviceId = deviceId;
if (this.form.id === this.deviceId) {
this.pushFlag = true;
this.startCheck();
} else {
return this.$dialog.alert({message:"二维码和检测目标设备不匹配,请重新扫码"});
}
}
},
};
</script>
<style scoped>
</style>

105
src/views/device-list.vue Normal file
View File

@ -0,0 +1,105 @@
<template>
<div class="deviceList">
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar
title="设备检查待办"
left-text="返回"
left-arrow
@click-left="$router.back()"
/>
<van-empty v-show="list.length === 0" description="无设备检查待办事项">
<img slot="image" src="@/assets/empty.png" alt="">
</van-empty>
<div
v-show="list.length > 0"
class="backlog_item"
v-for="item in list"
:key="item.id"
>
<p class="backlog_item_type">业务类型{{ item.businessType }}</p>
<p>设备名称{{ item.taskName }}</p>
<p>设备编号{{ item.deviceNum }}</p>
<p>
剩余时间<van-count-down
:time="item.overTime"
format="DD 天 HH 时 mm 分 ss 秒"
style="display: inline"
/>
</p>
<p>截止时间{{ item.deadline }}</p>
<p>
<van-button
size="small"
style="width: 100%"
color="linear-gradient(to right, #ff6034, #ee0a24)"
@click="backlogHandler(item.id)"
>
去处理
</van-button>
</p>
</div>
</div>
</template>
<script>
import { getBacklog } from "../api";
export default {
name: "device-list",
data() {
return {
list: [],
loading: false,
finished: false,
refreshing: false,
dataType: "",
type: ""
};
},
mounted() {
this.getBackLogList();
},
methods: {
onLoad() {
setInterval(() => {
this.loading = false;
this.finished = true;
}, 1000);
},
//
getBackLogList() {
this.loading=true
this.dataType = "3";
this.type = "all";
getBacklog(this.dataType,this.type).then((res) => {
this.loading=false
this.list = res.data.data;
});
},
//
backlogHandler(id) {
return this.$router.push({ name: "device-detail", params: { dataId: id , type: "2"} });
},
},
};
</script>
<style scoped>
.backlog_item {
background: #ffffff;
padding: 8px;
margin: 10px 8px;
border-radius: 10px;
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.05);
}
.backlog_item .backlog_item_type {
font-size: 18px;
font-weight: bold;
}
</style>

View File

@ -0,0 +1,105 @@
<template>
<div class="deviceList">
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar
title="设备整改待办"
left-text="返回"
left-arrow
@click-left="$router.back()"
/>
<van-empty v-show="list.length === 0" description="无设备整改待办事项">
<img slot="image" src="@/assets/empty.png" alt="">
</van-empty>
<div
v-show="list.length > 0"
class="backlog_item"
v-for="item in list"
:key="item.id"
>
<p class="backlog_item_type">业务类型{{ item.businessType }}</p>
<p>设备名称{{ item.taskName }}</p>
<p>设备编号{{ item.deviceNum }}</p>
<p>
剩余时间<van-count-down
:time="item.overTime"
format="DD 天 HH 时 mm 分 ss 秒"
style="display: inline"
/>
</p>
<p>截止时间{{ item.deadline }}</p>
<p>
<van-button
size="small"
style="width: 100%"
color="linear-gradient(to right, #ff6034, #ee0a24)"
@click="backlogHandler(item.id)"
>
去处理
</van-button>
</p>
</div>
</div>
</template>
<script>
import { getBacklog } from "../api";
export default {
name: "device-rectify-list",
data() {
return {
list: [],
loading: false,
finished: false,
refreshing: false,
dataType: "",
type: ""
};
},
mounted() {
this.getBackLogList();
},
methods: {
onLoad() {
setInterval(() => {
this.loading = false;
this.finished = true;
}, 1000);
},
//
getBackLogList() {
this.loading=true
this.dataType = "4";
this.type = "all";
getBacklog(this.dataType,this.type).then((res) => {
this.loading=false
this.list = res.data.data;
});
},
//
backlogHandler(id) {
return this.$router.push({ name: "device-detail", params: { dataId: id , type: "1"} });
},
},
};
</script>
<style scoped>
.backlog_item {
background: #ffffff;
padding: 8px;
margin: 10px 8px;
border-radius: 10px;
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.05);
}
.backlog_item .backlog_item_type {
font-size: 18px;
font-weight: bold;
}
</style>

View File

@ -0,0 +1,174 @@
<!--设备整改-->
<template>
<div class="device">
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>上传中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar title="设备整改" left-text="返回" left-arrow @click-left="$router.back()" />
<van-form>
<van-empty v-show="list.length === 0" description="无设备整改项" />
<div v-show="list.length > 0" v-for="(item, index) in list" :key="index">
<van-field v-model="item.name" name="检查内容" label="检查内容" readonly />
<van-field v-model="item.result" name="检查结果" label="检查结果" readonly />
<van-field name="1" label="整改结果状态" required>
<template #input>
<van-radio-group v-model="item.rectificationStatus" direction="horizontal">
<van-radio name="1">正常</van-radio>
<van-radio name="2">异常</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-model="item.rectifyResult" name="整改结果" label="整改结果" placeholder="请输入整改结果描述" required/>
<van-field name="1" label="是否需要持续整改">
<template #input>
<van-radio-group v-model="item.recordFlag" direction="horizontal">
<van-radio name="1"></van-radio>
<van-radio name="2"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field readonly clickable :value="item.rectificationDeadline" name="calendar" label="持续整改期限"
placeholder="请选择持续整改期限" @click="showCalendarMethod(index)" v-if="item.recordFlag === '2'" />
<van-field name="uploader" label="整改后照片" required>
<template #input>
<van-uploader v-model="item.unUploadImgUrl" :name="index" :ref="'upload' + index"
capture="camera" />
</template>
</van-field>
</div>
<div style="margin: 16px">
<van-button round block type="danger" native-type="submit" v-show="list.length > 0" @click="submit">提交
</van-button>
</div>
<van-calendar v-model="showCalendar" @confirm="onConfirm($event)" @close="closeCalendar" />
</van-form>
</div>
</template>
<script>
import { getDeviceItemDetail, deviceRectifyHandin } from "../api";
import upload from "@/util/upload";
import func from "@/util/func";
export default {
name: "device-rectify",
data() {
return {
form: {
id: "",
remark: "",
},
list: [
{
id: "",
name: "",
recordFlag: "1",
result: "",
rectificationDeadline: "",
problemLevel: "",
imgUrl: [],
show: false,
rectifyResult: '',
rectificationStatus: '',
unUploadImgUrl: [],
},
],
deadlineDate: "",
showCalendar: false,
itemIndex: 0,//index,
loading:false,
};
},
mounted() {
this.getData();
},
methods: {
formDate(date) {
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
},
onConfirm(date) {
this.deadlineDate = this.formDate(date);
this.list[this.itemIndex].rectificationDeadline = this.deadlineDate;
this.showCalendar = false;
},
//
getData() {
this.loading=true
const id = this.$route.params.dataId;
const type = '2';
this.form.id = id;
getDeviceItemDetail(id, type).then((res) => {
this.loading=false
this.list = res.data.data;
});
},
//
submit() {
this.loading=true
let data = this.form;
let syncList = [];
let hasNoFileItem = false;
this.list.forEach(async (element) => {
if (typeof element.unUploadImgUrl == 'undefined' || element.unUploadImgUrl.length < 1) {
this.loading=false
hasNoFileItem = true;
return
}
let fileList = [];
element.unUploadImgUrl.forEach((imgFile) => {
fileList.push(imgFile.file);
});
//
syncList.push(new Promise((resolve, reject) => {
upload.multiUpload(fileList, '18', 'afterPicIds').then(res => {
if (!func.isEmpty(res)) {
element.afterPicIds = "afterPicIds";
element.imgUrl = res
resolve();
} else {
reject();
}
}).catch(err => {
reject();
return this.$dialog.alert({ message: err });
})
}))
});
if (hasNoFileItem) {
this.$dialog.alert({ message: "请上传所有整改后照片再提交" });
return
}
Promise.all(syncList).then(() => {
data.appDeviceDTOList = this.list;
deviceRectifyHandin(data).then((res) => {
this.loading=false
if (res.data.code !== 200) {
return this.$dialog.alert({ message: res.data.msg });
}
this.$dialog.alert({ message: '提交成功' }).then(() => {
this.$router.push({ name: 'index' })
})
});
}).catch((err) => {
console.log(err);
})
},
showCalendarMethod(index) {
this.showCalendar = true;
this.itemIndex = index
},
closeCalendar() {
this.showCalendar = false;
}
},
};
</script>
<style scoped>
</style>

View File

@ -0,0 +1,96 @@
<template>
<div class="educateList">
<van-nav-bar
title="教育培训待办"
left-text="返回"
left-arrow
@click-left="$router.back()"
/>
<van-empty
v-show="list.length === 0"
description="无教育培训待办事项"
/>
<div
v-show="list.length > 0"
class="backlog_item"
v-for="item in list"
:key="item.id"
>
<p class="backlog_item_type">业务类型{{ item.businessType }}</p>
<p>任务名称{{ item.taskName }}</p>
<p>
剩余时间<van-count-down
:time="item.overTime"
format="DD 天 HH 时 mm 分 ss 秒"
style="display: inline"
/>
</p>
<p>截止时间{{ item.deadline }}</p>
<p>
<van-button
size="small"
style="width: 100%"
color="linear-gradient(to right, #ff6034, #ee0a24)"
@click="backlogHandler(item.id)"
>
去处理
</van-button>
</p>
</div>
</div>
</template>
<script>
import { getBacklog } from "../api";
export default {
name: "educate-list",
data() {
return {
list: [],
loading: false,
finished: false,
refreshing: false,
dataType: "",
type: ""
};
},
mounted() {
this.getBackLogList();
},
methods: {
onLoad() {
setInterval(() => {
this.loading = false;
this.finished = true;
}, 1000);
},
//
getBackLogList() {
this.dataType = "1";
this.type = "all";
getBacklog(this.dataType,this.type).then((res) => {
this.list = res.data.data;
});
},
//
backlogHandler(id) {
return this.$router.push({ name: "educate", params: { dataId: id } });
},
},
};
</script>
<style scoped>
.backlog_item {
background: #ffffff;
padding: 8px;
margin: 10px 8px;
border-radius: 10px;
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.05);
}
.backlog_item .backlog_item_type {
font-size: 18px;
font-weight: bold;
}
</style>

105
src/views/educate.vue Normal file
View File

@ -0,0 +1,105 @@
<!--教育培训-->
<template>
<div class="educate">
<van-nav-bar
title="教育培训"
left-text="返回"
left-arrow
@click-left="$router.back()"
/>
<van-form>
<van-field
v-model="form.deptName"
name="当前机构"
label="当前机构"
placeholder="当前机构"
readonly
/>
<van-field
v-model="form.title"
name="标题"
label="标题"
placeholder="标题"
readonly
/>
<van-field
v-model="form.script"
name="简要描述"
label="简要描述"
type="textarea"
placeholder="简要描述"
readonly
/>
<van-field name="uploader" label="相关照片">
<template #input>
<van-uploader capture="camera" v-model="form.imgUrl" ref="upload" />
</template>
</van-field>
</van-form>
<div style="margin: 16px">
<van-button
round
block
type="danger"
native-type="submit"
@click="submit()"
>提交</van-button
>
</div>
</div>
</template>
<script>
import { getDetail, save } from "../api";
export default {
name: "educate",
data() {
return {
form: {
id: "",
deptName: "",
title: "",
script: "",
imgUrl: [],
},
};
},
activated() {
this.getData();
},
methods: {
//
getData() {
const id = this.$route.params.dataId;
getDetail(id).then((res) => {
if (res.data.code !== 200) {
return this.$message.error(res.data.msg);
}
this.form = res.data.data;
});
},
//
submit() {
const formData = new FormData();
this.$refs["upload"].value.forEach(element => {
formData.append("imgUrl", element.file);
});
formData.append("id", this.$route.params.dataId);
let data = formData;
save(data).then((res) => {
if (res.data.code !== 200) {
return this.$message.error(res.data.msg);
}
this.$router.push({ name: "educate-list" });
});
},
},
};
</script>
<style scoped>
.educate {
width: 100%;
height: 400px;
}
</style>

View File

@ -0,0 +1,96 @@
<template>
<div class="emergencyList">
<van-nav-bar
title="应急演练待办"
left-text="返回"
left-arrow
@click-left="$router.back()"
/>
<van-empty
v-show="list.length === 0"
description="无应急演练待办事项"
/>
<div
v-show="list.length > 0"
class="backlog_item"
v-for="item in list"
:key="item.id"
>
<p class="backlog_item_type">业务类型{{ item.businessType }}</p>
<p>任务名称{{ item.taskName }}</p>
<p>
剩余时间<van-count-down
:time="item.overTime"
format="DD 天 HH 时 mm 分 ss 秒"
style="display: inline"
/>
</p>
<p>截止时间{{ item.deadline }}</p>
<p>
<van-button
size="small"
style="width: 100%"
color="linear-gradient(to right, #ff6034, #ee0a24)"
@click="backlogHandler(item.id)"
>
去处理
</van-button>
</p>
</div>
</div>
</template>
<script>
import { getBacklog } from "../api";
export default {
name: "emergency-list",
data() {
return {
list: [],
loading: false,
finished: false,
refreshing: false,
dataType: "",
type: ""
};
},
mounted() {
this.getBackLogList();
},
methods: {
onLoad() {
setInterval(() => {
this.loading = false;
this.finished = true;
}, 1000);
},
//
getBackLogList() {
this.dataType = "2";
this.type = "all";
getBacklog(this.dataType,this.type).then((res) => {
this.list = res.data.data;
});
},
//
backlogHandler(id) {
return this.$router.push({ name: "emergency", params: { dataId: id } });
},
},
};
</script>
<style scoped>
.backlog_item {
background: #ffffff;
padding: 8px;
margin: 10px 8px;
border-radius: 10px;
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.05);
}
.backlog_item .backlog_item_type {
font-size: 18px;
font-weight: bold;
}
</style>

104
src/views/emergency.vue Normal file
View File

@ -0,0 +1,104 @@
<!--应急演练-->
<template>
<div class="emergency">
<van-nav-bar
title="应急演练"
left-text="返回"
left-arrow
@click-left="$router.back()"
/>
<van-form>
<van-field
v-model="form.deptName"
name="当前机构"
label="当前机构"
placeholder="当前机构"
readonly
/>
<van-field
v-model="form.title"
name="标题"
label="标题"
placeholder="标题"
readonly
/>
<van-field
v-model="form.script"
name="简要描述"
label="简要描述"
placeholder="简要描述"
readonly
/>
<van-field
v-model="form.joinNumber"
name="参加人数"
label="参加人数"
placeholder="参加人数"
/>
<van-field name="uploader" label="相关照片">
<template #input>
<van-uploader v-model="form.uploader" />
</template>
</van-field>
<div style="margin: 16px">
<van-button round block type="danger" native-type="submit" @click="submit()"
>提交</van-button
>
</div>
</van-form>
</div>
</template>
<script>
import { getDetail, save } from "../api";
export default {
name: "emergency",
data() {
return {
form: {
deptName: "",
deptId: "",
title: "",
script: "",
joinNumber: "",
uploader: [],
},
};
},
activated() {
this.getData();
},
methods: {
//
getData() {
const id = this.$route.params.dataId;
getDetail(id).then((res) => {
if (res.data.code !== 200) {
return this.$message.error(res.data.msg);
}
this.form = res.data.data;
});
},
//
submit() {
// this.$refs["form"].validate((valid) => {
// if (!valid) {
// return false;
// }
this.form.id = this.$route.params.dataId;
let data = this.form;
console.log(this.form);
save(data).then((res) => {
if (res.data.code !== 200) {
return this.$message.error(res.data.msg);
}
this.$router.push({ name: "emergency-list" });
});
// });
},
},
};
</script>
<style scoped>
</style>

137
src/views/face-match.vue Normal file
View File

@ -0,0 +1,137 @@
<!--人脸识别-->
<template>
<div style="text-align: center">
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>上传中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar title="人脸验证" left-text="返回" left-arrow @click-left="$router.back()"/>
<van-form>
<van-field readonly v-model="form.handoverFrom" name="交接人" label="交接人" placeholder="交接人"/>
<van-field readonly name="交接人照片" label="交接人照片">
<template #input>
<van-uploader v-model="fromImages" accept="image/*" capture="camera" multiple="false"/>
</template>
<template #button>
<van-tag v-show="validHandoverForm === false" :type="validHandoverForm ? 'success':'danger'">
{{fromValidMsg}}
</van-tag>
</template>
</van-field>
<van-field readonly v-model="form.handoverTo" name="被交接人" label="被交接人" placeholder="被交接人"/>
<van-field readonly name="被交接人照片" label="被交接人照片">
<template #input>
<van-uploader v-model="toImages" accept="image/*" capture="camera" multiple="false"/>
</template>
<template #button>
<van-tag v-show="validHandoverTo === false" :type="validHandoverTo ? 'success':'danger'">
{{toValidMsg}}
</van-tag>
</template>
</van-field>
</van-form>
<div style="margin: 16px">
<van-button round block type="danger" native-type="submit" @click="startValid()">开始验证</van-button>
</div>
</div>
</template>
<script>
import { faceMatch } from "@/api/face";
export default {
name: "face-match",
data() {
return {
videoSrc: '',
faceImg: '',
validHandoverForm: false, //
validHandoverTo: false,//
form: {
handoverFrom: '',
handoverTo: ''
},
fromImages: [],
toImages: [],
fromValidMsg: '未验证',
toValidMsg: '未验证',
loading: false,
}
},
mounted() {
this.form.handoverFrom = this.$route.query.handoverFrom
this.form.handoverTo = this.$route.query.handoverTo
window.handleQing = this.handleQing;
},
methods: {
startValid() {
this.loading = true;
this.$nextTick(() => {
if (this.fromImages.length != 1) {
this.loading = false;
return this.$dialog.alert({
message: '请上传一张交接人人脸照片'
})
}
if (!this.toImages.length != 1) {
this.loading = false;
return this.$dialog.alert({
message: '请上传一张被交接人人脸照片'
})
}
let syncList = []
syncList.push(
faceMatch(this.fromImages[0].file).then(res => {
if (res.data.code === 200) {
this.validHandoverForm = true;
} else {
this.fromValidMsg = '验证失败'
}
})
);
syncList.push(
faceMatch(this.toImages[0].file).then(res => {
if (res.data.code === 200) {
this.validHandoverTo = true;
} else {
this.toValidMsg = '验证失败'
}
})
);
Promise.all(syncList).then(() => {
this.loading = false;
if (this.validHandoverForm && this.validHandoverTo) {
this.$router.push({ name: 'work-handover-form' })
}
}).catch((err) => {
this.loading = false;
this.$dialog.alert({ message: err })
})
})
},
}
}
</script>
<style scoped>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.block {
width: 120px;
height: 120px;
background-color: #ffffff;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
}
</style>

165
src/views/face-register.vue Normal file
View File

@ -0,0 +1,165 @@
<!--人脸注册-->
<template>
<div>
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>上传中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar title="人脸录入" left-text="返回" left-arrow @click-left="$router.back()"/>
<van-form>
<van-field v-model="account" name="工号" label="工号" placeholder="请输入员工工号" v-if="!outsiders"/>
<van-field v-model="fullName" name="姓名" label="姓名" placeholder="请输入姓名"/>
<van-field v-model="idCard" name="身份证号" label="身份证号" placeholder="请输入身份证号"/>
<van-field name="uploader" label="人脸照片">
<template #input>
<van-uploader v-model="faceImages" ref="faceImages" accept="image/*" capture="camera" max-count="1" disabled/>
</template>
<template #button>
<van-button type="info" @click="takePicture()">拍摄</van-button>
</template>
</van-field>
<div style="margin: 16px">
<van-button
round
block
type="danger"
@click="submit()"
>提交
</van-button>
</div>
</van-form>
</div>
</template>
<script>
import { saveHandoverWithFace } from "@/api/index";
import func from "@/util/func";
import { validIdCard } from "../util/validate";
export default {
name: "face-register",
mounted() {
const outsiders = this.$route.params.outsiders;
if (!outsiders) {
const user = JSON.parse(sessionStorage.getItem('user'));
this.fullName = user.real_name;
this.account = user.account;
}
this.outsiders = outsiders;
window.setPicture = this.setPicture;
window.takePictureError = this.takePictureError;
},
data() {
return {
idCard: '',
faceImg: '',
videoSrc: '',
faceImages: [],
loading: false,
outsiders: false,
fullName: '',
account: '',
}
},
methods: {
submit() {
this.loading = true;
this.$nextTick(() => {
if (func.isEmpty(this.fullName)) {
this.loading = false;
return this.$dialog.alert({ message: '请输入姓名' })
}
if (!this.outsiders && func.isEmpty(this.account)) {
this.loading = false;
return this.$dialog.alert({ message: '请输入工号' })
}
let valid = validIdCard(this.idCard);
if (valid.result) {
this.loading = false;
return this.$dialog.alert({ message: valid.msg })
}
if (this.faceImages.length != 1) {
this.loading = false;
return this.$dialog.alert({ message: '完成上传人脸照片后再试!' })
}
saveHandoverWithFace({
fullName: this.fullName,
employeeNo: this.account,
idCardNo: this.idCard,
identNo: this.account,
outsiders: this.outsiders
}, this.faceImages[0].file).then(res => {
if (res.data.code === 200) {
this.$dialog.alert({
message: '录入成功'
}).then(() => {
this.$router.push({ name: 'index' })
});
return
}
this.loading = false;
this.$dialog.alert({ message: res.data.msg })
}).catch(err => {
this.loading = false;
this.$dialog.alert({ message: err })
})
})
},
setPicture(fileData, fileExt) {
var faceFile = func.base64ImageToFile(fileData, fileExt);
var faceImages = [];
faceImages.push({
content: fileData,
file: faceFile,
message: '',
status: 'done',
isImage: true
});
this.faceImages = faceImages;
},
takePicture() {
window.qing.call('selectPic', {
'type': 'camera',
'success': function (res) {
if ("true" == res.success) {
// eslint-disable-next-line no-undef
setPicture('data:image/' + res.data.fileExt + ';base64,' + res.data.fileData, res.data.fileExt);
} else if ("false" == res.success) {
// eslint-disable-next-line no-undef
takePictureError(res.errorCode + '' + res.error);
}
},
'error': function (err) {
// eslint-disable-next-line no-undef
takePictureError(JSON.stringify(err));
}
})
},
takePictureError(errMsg) {
return this.$dialog.alert({ message: '拍摄失败!' + errMsg })
}
}
}
</script>
<style scoped>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.block {
width: 120px;
height: 120px;
background-color: #ffffff;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
}
</style>

228
src/views/index.vue Normal file
View File

@ -0,0 +1,228 @@
<template>
<div class="index">
<van-swipe :autoplay="3000" style="height: 200px" indicator-color="white">
<van-swipe-item>
<img class="index_bg" src="@/assets/bank.jpg">
</van-swipe-item>
</van-swipe>
<van-grid class="gride" :border="false" :column-num="3" style="">
<van-grid-item
text="设备检查"
@click="$router.push({ name: 'device-list' })">
<i slot="icon" class="iconfont icon-shebeiguanli icon"></i>
<span slot="text" class="icon-text">设备检查</span>
</van-grid-item>
<van-grid-item
icon="setting-o"
text="设备整改"
@click="$router.push({ name: 'device-rectify-list' })">
<i slot="icon" class="iconfont icon-shebeizhuangtai icon"></i>
<span slot="text" class="icon-text">设备整改</span>
</van-grid-item>
<van-grid-item
icon="setting-o"
text="持续整改"
@click="$router.push({ name: 'device-continued-rectify' })">
<i slot="icon" class="iconfont icon-shebeizhuangtai icon"></i>
<span slot="text" class="icon-text">持续整改</span>
</van-grid-item>
<!-- <van-grid-item
icon="photo-o"
text="宣传报道"
@click="$router.push({ name: 'report' })">
<i slot="icon" class="iconfont icon-xuanchuanshipin icon"></i>
<span slot="text" class="icon-text">宣传报道</span>
</van-grid-item> -->
<!-- <van-grid-item
icon="photo-o"
text="人脸录入"
@click="faceRegClick">
<i slot="icon" class="iconfont icon-renlianshibie icon"></i>
<span slot="text" class="icon-text">交接人脸录入</span>
</van-grid-item>
<van-grid-item
icon="photo-o"
text="款箱交接"
@click="$router.push({ name: 'work-handover' })">
<i slot="icon" class="iconfont icon-jiaojieban icon"></i>
<span slot="text" class="icon-text">款箱交接</span>
</van-grid-item> -->
</van-grid>
<van-dialog v-model="showFaceReg" theme="round-button" confirm-button-text="取消">
<van-row style="padding: 0 24px;padding-top: 16px;">
<van-button round block size="small" @click="goRegFace(false)">录入行内人员</van-button>
<van-button round block size="small" @click="goRegFace(true)" style="margin-top: 8px">录入行外人员</van-button>
</van-row>
</van-dialog>
<!-- <div style="width: 100%; height: auto">
<p class="todo_label" style="margin: 8px; font-size: 20px">我的待办</p>
<div class="backlog_item" v-show="list.length === 0">
<van-empty description="无待办事项">
<img slot="image" src="@/assets/empty.png" alt="">
</van-empty>
</div>
<div
v-show="list.length > 0"
class="backlog_item"
v-for="item in list"
:key="item.id"
>
<p class="backlog_item_type">业务类型{{ item.businessType }}</p>
<p>任务名称{{ item.taskName }}</p>
<p>
剩余时间
<van-count-down
:time="item.overTime"
format="DD 天 HH 时 mm 分 ss 秒"
style="display: inline"
/>
</p>
<p>截止时间{{ item.deadline }}</p>
<p>
<van-button
size="small"
style="width: 100%"
color="linear-gradient(to right, #ff6034, #ee0a24)"
@click="backlogHandler(item.module)"
>
去处理
</van-button>
</p>
</div>
</div> -->
</div>
</template>
<script>
import {getBacklog, userAuth} from "../api";
import func from "../util/func";
export default {
name: "index",
data() {
return {
loading: false,
finished: false,
list: [],
dataType: "",
type: "",
showFaceReg: false,
};
},
mounted() {
this.getBackLogList();
this.auth()
},
methods: {
auth() {
if (func.isEmpty(this.$store.state.user.token)) {
window.qing.call('getperson', {
success: function (res) {
let user = JSON.stringify(res)
userAuth({code: user.jobNo}).then(res => {
if (res.data.code !== 200) {
this.$dialog.alert({message: res.data.msg})
window.qing.call('closeWebView')
return
}
this.$store.state.user.token = res.data.token
sessionStorage.setItem('token', res.data.token)
})
},
error: function () {
window.qing.call('closeWebView')
}
});
}
},
getBackLogList() {
this.dataType = ""
this.type = "all"
getBacklog(this.dataType, this.type).then((res) => {
if (res.data.data.code === 200) {
this.list = res.data.data;
}
});
},
backlogHandler(type) {
if (type === "edu") {
return this.$router.push({name: "educate"});
}
if (type === "drill") {
return this.$router.push({name: "emergency"});
}
if (type === "deviceCheck") {
return this.$router.push({name: "device-detail"});
}
if (type === "deviceRectify") {
return this.$router.push({name: "device-detail"});
}
},
checkTime() {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth();
const day = now.getDate();
const start = new Date(year, month, day, 7, 30, 0);
const end = new Date(year, month, day, 19, 30, 0);
return now.getTime() > start.getTime() && now.getTime() < end.getTime();
},
faceRegClick() {
const allowTime = this.checkTime();
if (!allowTime) {
return this.$dialog.alert({ message: '此功能由于需要联网核查只在7:30至19:30开放' })
}
this.showFaceReg = !this.showFaceReg
},
goRegFace(outsiders) {
this.$router.push({ name: "face-register", params: { outsiders: outsiders} })
}
},
};
</script>
<style scoped>
.index {
width: 100%;
height: auto;
}
.index_bg {
width: 100%;
height: 200px;
background-position: center center;
background-repeat: no-repeat;
object-fit: cover;
}
.gride {
width: 100%;
background: #ffffff;
/*margin: 10px 0;*/
border-radius: 10px;
}
.swipe .van-swipe-item {
color: #fff;
font-size: 20px;
line-height: 200px;
text-align: center;
background-color: #39a9ed;
}
.backlog_item {
background: #ffffff;
padding: 8px;
margin: 10px 8px;
border-radius: 10px;
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.05);
}
.backlog_item .backlog_item_type {
font-size: 18px;
font-weight: bold;
}
</style>

94
src/views/login-pwd.vue Normal file
View File

@ -0,0 +1,94 @@
<template>
<div>
<van-nav-bar
title="登录"/>
<van-form>
<van-field
v-model="form.username"
name="用户名"
label="用户名"/>
<van-field
v-model="form.password"
name="密码"
label="密码"/>
<!-- <van-cell title="验证码" value="内容" >
<template #default>
<img :src="form.img">
</template>
</van-cell> -->
<!-- <van-field
v-model="form.code"
name="验证码"
label="验证码"/> -->
</van-form>
<div style="margin: 16px;">
<van-button round block type="danger" native-type="submit" @click="getToken()">提交</van-button>
</div>
</div>
</template>
<script>
import md5 from "js-md5";
export default {
name: "login",
data(){
return{
form: {
username: '',
password: '',
code: '',
img: '',
key: ''
}
}
},
mounted() {
// this.getCaptcha()
},
methods:{
getCaptcha(){
this.$http({
url: '/sis/api/security-auth/oauth/captcha',
method: 'get'
}).then(res => {
console.log(res)
this.form.img = res.data.image
this.form.key = res.data.key
})
},
getToken(){
this.$http({
url: '/sis/api/security-auth/oauth/token',
method: 'post',
headers: {
'Tenant-Id': '000000',
'Captcha-Key': this.form.key,
'Captcha-Code': this.form.code,
},
params: {
tenantId: '000000',
username: this.form.username,
password: md5(this.form.password),
//grant_type: 'captcha',
grant_type: 'password',
scope: "all",
type: 'account'
}
}).then(res => {
this.$store.state.user = res.data
this.$store.state.user.token = res.data.access_token
sessionStorage.setItem('token',res.data.access_token)
sessionStorage.setItem('user',JSON.stringify(res.data))
this.$router.push({name: 'index'})
})
}
}
}
</script>
<style scoped>
</style>

70
src/views/login.vue Normal file
View File

@ -0,0 +1,70 @@
<template>
<div class="wrapper">
<van-loading v-if="loading" size="30px" vertical color="#0094ff">登录中</van-loading>
</div>
</template>
<script>
import request from '../util/request';
export default {
name: "login",
data() {
return {
loading: true
}
},
mounted() {
this.getToken();
},
methods: {
getToken() {
var params = this.$route.query;
if (params && params.dev) {
return this.$router.push({ name: 'login' })
} else
request({
url: '/sis/api/security-auth/oauth/token',
method: 'post',
params: {
...params,
tenantId: '000000',
grant_type: 'xyun',
scope: 'all',
client_id: 'saber',
client_secret: 'saber_secret'
}
}).then(res => {
this.loading = false;
this.$store.state.user = res.data
this.$store.state.user.token = res.data.access_token;
sessionStorage.setItem('token', res.data.access_token);
sessionStorage.setItem('xYunAccessToken', res.data.detail.xYunAccessToken);
sessionStorage.setItem('user',JSON.stringify(res.data))
this.$router.push({ name: 'index' })
}).catch(err => {
err += '。请返回重试';
this.loading = false;
this.$dialog.alert({
title: '登录失败',
confirmButtonText: '返回',
message: err
}).then(() => {
window.qing.call('closeWebView');
})
})
}
}
}
</script>
<style>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>

View File

@ -0,0 +1,83 @@
<template>
<div class="report-detail">
<van-nav-bar
title=""
left-text="返回"
left-arrow
:fixed="true"
:placeholder="true"
@click-left="$router.back()"
/>
<div style="margin: 10px 0">
<p class="title">{{content.title}}</p>
<p class="content_time">{{content.reportDate}}</p>
<div v-for="item in content.picList" :key="item.id">
<van-image :src="item.content"/>
</div>
<div class="content" v-html="content.content"></div>
</div>
</div>
</template>
<script>
import {getDeatil} from '@/api/report.js'
import upload from "@/util/upload";
export default {
name: "report-detail",
data(){
return{
content:{
id: 0,
title: '',
reportDate: '',
content: ''
}
}
},
mounted() {
this.getDetail()
},
methods:{
getDetail(){
getDeatil(this.$route.query.id).then(res => {
let getImgSync = [];
res.data.data.picList.forEach((file) => {
getImgSync.push(new Promise(((resolve) => {
upload.getImgPreviewFile(file, (base64Data) => {
file.content = base64Data;
file.originUrl = file.url;
resolve();
})
})))
})
Promise.all(getImgSync).then(() => {
this.content = res.data.data
this.content.reportDate = this.content.reportDate.slice(0, 10)
})
})
}
}
}
</script>
<style scoped>
.report-detail{
width: 100%;
height: auto;
background: #ffffff;
}
.report-detail .title{
text-align: center;
font-size: 16px;
font-weight: bold;
}
.report-detail .content_time{
text-align: center;
}
.report-detail .content{
padding: 10px;
text-indent: 20px;
line-height: 2;
}
</style>

75
src/views/report-form.vue Normal file
View File

@ -0,0 +1,75 @@
<!--宣传报道录入-->
<template>
<div>
<van-nav-bar title="宣传报道" left-text="返回" left-arrow @click-left="$router.back()" />
<van-form @submit="submit()">
<van-field v-model="form.title" name="主题" label="主题" placeholder="请输入主题"
:rules="[{ required: true, trigger: 'onSubmit' }]" />
<van-field v-model="form.content" name="简要描述" label="简要描述" placeholder="请输入简要描述" type="textarea" />
<van-field name="uploader" label="首页宣传图">
<template #input>
<van-uploader v-model="imgUrl" ref="upload" capture="camera" accept="image/*" :max-count="1" />
</template>
</van-field>
<div style="margin: 16px">
<van-button round block type="danger" native-type="submit">暂存
</van-button>
</div>
</van-form>
</div>
</template>
<script>
import { save } from "../api/report";
import upload from "@/util/upload";
import func from "@/util/func";
export default {
name: "report-form",
data() {
return {
form: {
title: '',
content: '',
reportImgRoute: '',
picList: [],
},
imgUrl: []
}
},
methods: {
async submit() {
let files = this.$refs['upload'].value
if (files.length === 0) {
return this.$dialog.alert({ message: '请上传首页宣传图(现场照片)' })
}
let fileList = [];
files.forEach((imgFile) => {
fileList.push(imgFile.file);
});
//
await upload.multiUpload(fileList, '18', 'publicityPic').then(res => {
if (!func.isEmpty(res)) {
this.form.reportImgRoute = "publicityPic";
this.form.picList = res;
}
}).catch(err => {
return this.$dialog.alert({ message: err });
})
this.$toast({ type: 'loading', forbidClick: true, loadingType: 'spinner', duration: 0 })
save(this.form).then(res => {
this.$toast.clear()
if (res.data.code !== 200) {
return this.$dialog.alert({ message: res.data.msg })
}
this.$dialog.alert({ message: '录入成功' }).then(() => {
this.$router.push({ name: 'index' })
})
})
}
}
}
</script>
<style scoped>
</style>

65
src/views/report.vue Normal file
View File

@ -0,0 +1,65 @@
<template>
<div class="report">
<van-nav-bar
title="宣传报道"
left-text="返回"
right-text="录入"
left-arrow
@click-left="$router.back()"
@click-right="$router.push({name: 'report-form'})"
/>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<van-cell v-for="item in list" :key="item.id" @click="$router.push({name: 'report_detail', query:{id:item.id}})">
<template #title>
<div class="title">{{item.title}}</div>
</template>
<template #label>
<div class="van-multi-ellipsis--l2" v-html="item.content"></div>
</template>
</van-cell>
</van-list>
</div>
</template>
<script>
import {getReportList} from '@/api/report.js'
export default {
name: "report",
data(){
return{
loading: false,
finished: false,
list: [],
pageSize: 20,
pageIndex: 0,
total: 0
}
},
methods:{
onLoad(){
const index = this.pageIndex * this.pageSize
if(index > this.total){
return
}
getReportList({current: index, size: this.pageSize}).then(res => {
this.pageIndex++;
this.list = this.list.concat(res.data.data.records)
this.total = res.data.data.total
this.loading = false
this.finished = true
})
},
}
}
</script>
<style scoped>
.report .title{
font-weight: bold;
}
</style>

View File

@ -0,0 +1,91 @@
<!--工作交接表单-->
<template>
<div>
<van-nav-bar title="工作交接" left-text="返回" left-arrow @click-left="$router.back()" />
<van-form @submit="submit()">
<van-field readonly v-model="form.handoverFrom" name="交接人" label="交接人" placeholder="请输入交接人" />
<van-field readonly v-model="form.handoverTo" name="被交接人" label="被交接人" placeholder="请输入被交接人" />
<van-field v-model="form.content" name="交接内容" label="交接内容" type="textarea" placeholder="请输入交接内容"
:rules="[{ required: true, trigger: 'onSubmit' }]" />
<van-field v-model="form.handoverCount" name="交接数量" label="交接数量" placeholder="请输入交接数量" />
<van-field v-model="form.handoverDetail" name="交接详情" label="交接详情" type="textarea" placeholder="请输入交接详情" />
<van-field name="uploader" label="现场照片">
<template #input>
<van-uploader v-model="unUploadImgUrl" ref="upload" accept="image" capture="camera" />
</template>
</van-field>
<div style="margin: 16px">
<van-button round block type="danger" native-type="submit">提交
</van-button>
</div>
</van-form>
</div>
</template>
<script>
import { handoverHistorySave } from "../api/work";
import upload from "@/util/upload";
import func from "@/util/func";
export default {
name: "work-transfer-form",
data() {
return {
form: {
content: '',
imgUrl: [],
handoverFrom: '',
handoverTo: '',
handoverFromIdCard: '',
handoverToIdCard: '',
groupName: '',
handoverCount:'',
handoverDetail:'',
},
unUploadImgUrl: [],
}
},
mounted() {
this.form.handoverFrom = this.$route.params.handoverData.handoverFrom
this.form.handoverTo = this.$route.params.handoverData.handoverTo
this.form.handoverFromIdCard = this.$route.params.handoverData.handoverFromIdCard
this.form.handoverToIdCard = this.$route.params.handoverData.handoverToIdCard
},
methods: {
async submit() {
console.log(this.$refs['upload'].value)
let files = this.$refs['upload'].value
if (files.length === 0) {
return this.$dialog.alert({ message: '请上传现场照片' })
}
let fileList = [];
files.forEach((imgFile) => {
fileList.push(imgFile.file);
});
//
await upload.multiUpload(fileList, '18', 'workHandoverPics').then(res => {
if (!func.isEmpty(res)) {
this.form.groupName = "workHandoverPics";
this.form.imgUrl = res;
}
}).catch(err => {
return this.$dialog.alert({ message: err });
})
this.$toast({ type: 'loading', forbidClick: true, loadingType: 'spinner', duration: 0 })
handoverHistorySave(this.form).then(res => {
this.$toast.clear()
if (res.data.code !== 200) {
return this.$dialog.alert({ message: res.data.msg })
}
this.$dialog.alert({ message: '操作成功' }).then(() => {
this.$router.push({ name: 'index' })
})
})
}
}
}
</script>
<style scoped>
</style>

216
src/views/work-handover.vue Normal file
View File

@ -0,0 +1,216 @@
<!--工作交接-->
<template>
<div>
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>操作中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar
title="工作交接"
left-text="返回"
left-arrow
@click-left="$router.back()"
/>
<van-form label-width="100">
<van-divider>交接人信息</van-divider>
<van-field name="handoverFromUpload" label="人脸照片">
<template #input>
<van-uploader v-model="handoverFromUpload" accept="image/*" capture="camera" max-count="1" disabled/>
</template>
<template #button>
<van-button type="info" @click="takePicture(true)">拍摄并识别</van-button>
</template>
</van-field>
<van-field
v-model="form.handoverFrom"
name="交接人"
label="交接人"
placeholder="识别后自动填充"
disabled
/>
<van-field
v-model="form.handoverFromIdCard"
name="交接人工号/身份证"
label="交接人工号/身份证"
placeholder="识别后自动填充"
disabled
/>
<van-divider>被交接人信息</van-divider>
<van-field name="handoverFromUpload" label="人脸照片">
<template #input>
<van-uploader v-model="handoverToUpload" accept="image/*" capture="camera" max-count="1" disabled/>
</template>
<template #button>
<van-button type="info" @click="takePicture(false)">拍摄并识别</van-button>
</template>
</van-field>
<van-field
v-model="form.handoverTo"
name="被交接人"
label="被交接人"
placeholder="识别后自动填充"
disabled
/>
<van-field
v-model="form.handoverToIdCard"
name="被交接人工号/身份证"
label="被交接人工号/身份证"
placeholder="识别后自动填充"
disabled
/>
<div style="margin: 16px">
<van-button
round
block
type="danger"
@click="submitData()"
>开始交接
</van-button
>
</div>
</van-form>
</div>
</template>
<script>
import { workHandoverCheck } from "@/api/work";
import { handoverFaceMatch } from "@/api/index";
import func from "@/util/func";
export default {
name: "work-transfer",
mounted() {
window.match = this.match;
window.takePictureError = this.takePictureError;
},
data() {
return {
form: {
handoverFrom: '', //
handoverTo: '', //
handoverFromType: 1,
handoverToType: 1,
handoverToIdCard: '',
handoverFromIdCard: '',
handoverFromAcc: '',
handoverToAcc: ''
},
handoverFromUpload: [],
handoverToUpload: [],
loading: false,
validateFrom: false,
validateTo: false,
}
},
methods: {
submitData() {
if (!this.validateFrom || !this.validateTo) {
return this.$dialog.alert({ message: "请完成身份识别后再试" })
}
this.$toast({ type: 'loading', forbidClick: true, loadingType: 'spinner', duration: 0 })
let data = this.form;
if (1 === this.form.handoverFromType) {
data.handoverFromAcc = this.form.handoverFromIdCard
}
if (1 === this.form.handoverToType) {
data.handoverToAcc = this.form.handoverToIdCard
}
workHandoverCheck(data).then((res) => {
if (res.data.code !== 200) {
return this.$dialog.alert({ message: res.data.msg })
}
this.$toast.clear()
this.$router.push({ name: 'work-handover-form', params: { handoverData: this.form } })
}).catch((err) => {
this.$toast.clear()
this.$dialog.alert({ message: err })
})
},
match(hadoverFrom, fileData, fileExt) {
var faceFile = func.base64ImageToFile(fileData, fileExt);
var faceImages = [];
faceImages.push({
content: fileData,
file: faceFile,
message: '',
status: 'done',
isImage: true
});
if (hadoverFrom) {
this.handoverFromUpload = faceImages;
} else {
this.handoverToUpload = faceImages;
}
this.loading = true;
handoverFaceMatch(faceFile).then(res => {
if (res.data.code === 200) {
const facevo = res.data.data;
if (hadoverFrom) {
this.form.handoverFrom = facevo.fullName;
this.form.handoverFromType = facevo.outsiders ? 2 : 1;
this.form.handoverFromIdCard = facevo.idCardNo;
this.validateFrom = true;
} else {
this.form.handoverTo = facevo.fullName;
this.form.handoverToType = facevo.outsiders ? 2 : 1;
this.form.handoverToIdCard = facevo.identNo;
this.validateTo = true;
}
this.loading = false;
} else {
this.loading = false;
this.$dialog.alert({ message: res.data.data })
}
}).catch(err => {
this.loading = false;
this.$dialog.alert({ message: err })
})
},
takePicture(isFrom) {
window.qing.call('selectPic', {
'type': 'camera',
'success': function (res) {
if ("true" == res.success) {
// eslint-disable-next-line no-undef
match(isFrom, 'data:image/' + res.data.fileExt + ';base64,' + res.data.fileData, res.data.fileExt);
} else if ("false" == res.success) {
// eslint-disable-next-line no-undef
takePictureError(res.errorCode + '' + res.error);
}
},
'error': function (err) {
// eslint-disable-next-line no-undef
takePictureError(JSON.stringify(err));
}
})
},
takePictureError(errMsg) {
return this.$dialog.alert({ message: '拍摄失败!' + errMsg })
}
}
}
</script>
<style scoped>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.block {
width: 120px;
height: 120px;
background-color: #ffffff;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
}
</style>

27
vue.config.js Normal file
View File

@ -0,0 +1,27 @@
const path = require('path')
const resolve = dir => path.join(__dirname, dir)
module.exports={
publicPath: "/sis",
outputDir: 'dist/sis',
assetsDir: 'static',
productionSourceMap: false,
chainWebpack: config => {
config.resolve.alias.set('@', resolve('src'))
},
//开发模式反向代理配置生产模式请使用Nginx部署并配置反向代理
devServer: {
port: 1889,
proxy: {
'/sis/api': {
//本地服务接口地址
target: 'http://36.147.33.60:8000',
//远程演示服务地址,可用于直接启动项目
//target: 'https://saber.bladex.vip/api',
ws: true,
pathRewrite: {
'^/sis/api': '/'
}
}
}
}
}