Commit 219fdf8d authored by xinzhedeai's avatar xinzhedeai

控制打印注释

parent c659c63a
/** 爱山东网管请求封装 /** 爱山东网管请求封装
* 请求拦截、相应拦截、错误统一处理 * 请求拦截、相应拦截、错误统一处理
*/ */
const BASE_URL = 'https://gqyjpt.weihai.cn'
var http2 = { var http2 = {
post: function(params, fn) { post: function(params, fn) {
...@@ -37,7 +38,7 @@ var http2 = { ...@@ -37,7 +38,7 @@ var http2 = {
// vaildInterfacefn("gqyjglptxiefn", params.serviceId, data, "1", "https://" + urldomaincreatesign, "https://" + urldomaingateway).then((value) => { // vaildInterfacefn("gqyjglptxiefn", params.serviceId, data, "1", "https://" + urldomaincreatesign, "https://" + urldomaingateway).then((value) => {
vaildInterfacefn("gqyjglptxiefn", params.serviceId, data, "1", extraData).then((value) => { vaildInterfacefn("gqyjglptxiefn", params.serviceId, data, "1", extraData).then((value) => {
console.log('vaildInterfacefn响应', value) // console.log('vaildInterfacefn响应', value)
/** /**
* code: 200 * code: 200
data: "048b04671ad85e52e" // value 值就是接口返回的data值 data: "048b04671ad85e52e" // value 值就是接口返回的data值
...@@ -58,7 +59,7 @@ var http2 = { ...@@ -58,7 +59,7 @@ var http2 = {
let sm2_encrypt_result = value // 后台返回待解密内容 let sm2_encrypt_result = value // 后台返回待解密内容
let sm2_decrypt_result = sm2_Decrypt(sm2_encrypt_result, params.interfacePrivateKey) let sm2_decrypt_result = sm2_Decrypt(sm2_encrypt_result, params.interfacePrivateKey)
console.log('vaildInterfacefn响应解密', sm2_decrypt_result) // console.log('vaildInterfacefn响应解密', sm2_decrypt_result)
const decryptRes = JSON.parse(sm2_decrypt_result) const decryptRes = JSON.parse(sm2_decrypt_result)
if(decryptRes.code === 400 || decryptRes.code === 401 || decryptRes.status === 401){ if(decryptRes.code === 400 || decryptRes.code === 401 || decryptRes.status === 401){
vant.Dialog.alert({ vant.Dialog.alert({
......
...@@ -59,5 +59,7 @@ const API_KEY_MAP = { ...@@ -59,5 +59,7 @@ const API_KEY_MAP = {
publicKey: '04fcdb9f752aa40e2f75078ae4817b3c4684042747d82b7bd9640146001aaf885e9b9627c2273498bc9940174132af52ed19cbe2f871bcaab52018123e5311e58f', publicKey: '04fcdb9f752aa40e2f75078ae4817b3c4684042747d82b7bd9640146001aaf885e9b9627c2273498bc9940174132af52ed19cbe2f871bcaab52018123e5311e58f',
privateKey: '0092ba7d7629e681f4a82cede0c129749710e4f7cd2437ac83141036053896c08e' privateKey: '0092ba7d7629e681f4a82cede0c129749710e4f7cd2437ac83141036053896c08e'
}, },
// 应急演练编辑
// 应急演练图片上传(危险备案和应急演练可以共用,返回全路径)
} }
...@@ -22,7 +22,7 @@ function getUserInfo() { ...@@ -22,7 +22,7 @@ function getUserInfo() {
if (typeof data == 'string') if (typeof data == 'string')
data = JSON.parse(data) data = JSON.parse(data)
console.log('用户授权请求成功的数据', data) // console.log('用户授权请求成功的数据', data)
// 对于该方法的返回结果,需要进行两步解密才能得到明文用户信息, // 对于该方法的返回结果,需要进行两步解密才能得到明文用户信息,
// 先对返回结果进行sm2解密,需要用到 接入方在创建应用时,选择应用的加密方式为sm2,并成功创建应用后,拿到的应用私钥来进行解密 // 先对返回结果进行sm2解密,需要用到 接入方在创建应用时,选择应用的加密方式为sm2,并成功创建应用后,拿到的应用私钥来进行解密
const sm2_privateKey = '145e8920d0ec9b60eaaa73a208e711a68e8aa614b786e45d3eb7eca850ba7843' const sm2_privateKey = '145e8920d0ec9b60eaaa73a208e711a68e8aa614b786e45d3eb7eca850ba7843'
...@@ -37,11 +37,11 @@ console.log('用户授权请求成功的数据', data) ...@@ -37,11 +37,11 @@ console.log('用户授权请求成功的数据', data)
let aes_encrypt_result = sm2_decrypt_result.data let aes_encrypt_result = sm2_decrypt_result.data
let aes_decrypt_result = aes_Decrypt(aes_encrypt_result, appword) let aes_decrypt_result = aes_Decrypt(aes_encrypt_result, appword)
if(!aes_decrypt_result){ if(!aes_decrypt_result){
console.log('授权用户信息为空') // console.log('授权用户信息为空')
return return
} }
let tempResult = JSON.parse(aes_decrypt_result) let tempResult = JSON.parse(aes_decrypt_result)
console.log('授权用户信息', tempResult) // console.log('授权用户信息', tempResult)
let reqParammm ={ let reqParammm ={
sex: tempResult.sex, sex: tempResult.sex,
mobile: tempResult.mobile, mobile: tempResult.mobile,
...@@ -61,7 +61,7 @@ console.log('用户授权请求成功的数据', data) ...@@ -61,7 +61,7 @@ console.log('用户授权请求成功的数据', data)
reqParams: reqParammm reqParams: reqParammm
}, function(res){ }, function(res){
if(res){ if(res){
console.log('sdk2用户信息绑定接口回调数据', JSON.parse(res)) // console.log('sdk2用户信息绑定接口回调数据', JSON.parse(res))
var result = JSON.parse(res) var result = JSON.parse(res)
// 存储后台返回token存储本地localstorage // 存储后台返回token存储本地localstorage
// localStorage.setItem('token', result.token) // localStorage.setItem('token', result.token)
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<van-cell>文件预览: <van-cell>文件预览:
<div style="width: 6.5rem;"> <div style="width: 6.5rem;">
<van-image <van-image
v-show="(form.filePathList[0]) && (form.filePathList[0].indexOf('.png')>-1 || form.filePathList[0].indexOf('.jpg')>-1 || form.filePathList[0].indexOf('.jpeg')>-1)" v-show="(form.filePathList[0])"
width="100" width="100"
height="100" height="100"
:src="previewUrl+'/' + form.filePathList[0]" :src="previewUrl+'/' + form.filePathList[0]"
......
...@@ -9,8 +9,6 @@ window.addEventListener("load", function() { ...@@ -9,8 +9,6 @@ window.addEventListener("load", function() {
return { return {
form: { form: {
id: "", id: "",
// companyIds: [],
// 企业id
planName: "", planName: "",
// 验收人 // 验收人
publishDate: "", publishDate: "",
...@@ -26,7 +24,7 @@ window.addEventListener("load", function() { ...@@ -26,7 +24,7 @@ window.addEventListener("load", function() {
completionDate: '', completionDate: '',
showPopup4completionDate: false, showPopup4completionDate: false,
// companyId: localStorage.getItem('companyId'), // companyId: localStorage.getItem('companyId'),
previewUrl: axios.defaults.baseURL, previewUrl: BASE_URL,
disabled: false, disabled: false,
fileList: [], fileList: [],
} }
...@@ -56,7 +54,7 @@ window.addEventListener("load", function() { ...@@ -56,7 +54,7 @@ window.addEventListener("load", function() {
return; return;
} }
var reqParam = { var reqParam = {
companyId: localStorage.getItem('companyId'), // companyId: localStorage.getItem('companyId'),
drillPhotoList: this.form.filePathList, drillPhotoList: this.form.filePathList,
planId: gemhoUtil.getParameter('planId'), planId: gemhoUtil.getParameter('planId'),
// planName: this.form.planName, // planName: this.form.planName,
...@@ -74,18 +72,19 @@ window.addEventListener("load", function() { ...@@ -74,18 +72,19 @@ window.addEventListener("load", function() {
history.back() history.back()
}) })
}, },
previewFile(){ // previewFile(){ // 预览图片和下载pdf文件(应急演练主要是图片展示)
// var src = 'emergencydrill/e40eda16-7a86-4a2a-976b-892e17eeed49.pdf' // // var src = 'emergencydrill/e40eda16-7a86-4a2a-976b-892e17eeed49.pdf'
// location.href = './pdfViewer.html?pdfSrc='+ src // // location.href = './pdfViewer.html?pdfSrc='+ src
console.log(this.previewUrl + '/' + this.form.filePathList[0]) // console.log(this.previewUrl + '/' + this.form.filePathList[0])
location.href = this.previewUrl + '/' + this.form.filePathList[0] // location.href = this.previewUrl + '/' + this.form.filePathList[0]
}, // },
beforeUpload(file) { beforeUpload(file) {
console.log('beforeUpload',file) console.log('beforeUpload',file)
// 在文件上传之前的处理逻辑,例如校验文件大小、文件类型等 // 在文件上传之前的处理逻辑,例如校验文件大小、文件类型等
return true; // 返回 true 继续上传,返回 false 中止上传 return true; // 返回 true 继续上传,返回 false 中止上传
}, },
afterRead(file) { afterRead(file) {
// 获取文件流,调用网关中台接口,获取文件全路径url
console.log('afterRead',file) console.log('afterRead',file)
// 文件读取完成后的处理逻辑 // 文件读取完成后的处理逻辑
const formData = new FormData(); const formData = new FormData();
...@@ -123,37 +122,52 @@ window.addEventListener("load", function() { ...@@ -123,37 +122,52 @@ window.addEventListener("load", function() {
this.showPopup4completionDate = false this.showPopup4completionDate = false
}, },
getEnterprisePlansCompanyDetail() { // // 整改后照片
// transferUrl(hdRectificationPic) {
}, // console.log(hdRectificationPic);
// 整改后照片 // if (hdRectificationPic) {
transferUrl(hdRectificationPic) { // return (
console.log(hdRectificationPic); // BASE_URL +
if (hdRectificationPic) { // "/hd_rectification_pic_to_verify" +
return ( // hdRectificationPic.split("hd_rectification_pic_to_verify")[1]
axios.defaults.baseURL + // );
"/hd_rectification_pic_to_verify/" + // } else {
hdRectificationPic.split("\\hd_rectification_pic_to_verify\\")[1] // return null;
); // }
} else { // },
return null;
}
},
detail(){ detail(){
http.get('/api/enterpriseDrills', { vant.Toast.loading({
page: 0, // 每次请求增加下一页 message: '加载中...',
size: 1, forbidClick: true,
planId: gemhoUtil.getParameter('planId'), loadingType: 'spinner',
companyId: localStorage.getItem('companyId'), });
}).then((res) => {
this.loading = false; // 加载状态结束 http2.post({
this.form = res.body.content[0] serviceId: API_KEY_MAP["emergency-detail"]['id'],
if(this.form.completionStatus===1){ interfacePublicKey: API_KEY_MAP["emergency-detail"]["publicKey"],
this.disabled = true interfacePrivateKey: API_KEY_MAP["emergency-detail"]["privateKey"],
}else{ reqParams: {
this.disabled = false planId: gemhoUtil.getParameter('planId'),
}
}, (res) => {
if(res){
// console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res)
this.loading = false; // 加载状态结束
// console.log('响应结果', result.content)
this.form = res.body.content[0]
if(this.form.completionStatus===1){
this.disabled = true
}else{
this.disabled = false
}
this.form.filePathList = this.form.drillPhotoList || [];
vant.Toast.clear()
} }
this.form.filePathList = this.form.drillPhotoList || [];
}) })
}, },
}, },
......
...@@ -8,7 +8,6 @@ window.addEventListener("load", function() { ...@@ -8,7 +8,6 @@ window.addEventListener("load", function() {
data() { data() {
return { return {
planName: '', planName: '',
value: '',
list: [], list: [],
loading: false, loading: false,
finished: false, finished: false,
...@@ -55,7 +54,7 @@ window.addEventListener("load", function() { ...@@ -55,7 +54,7 @@ window.addEventListener("load", function() {
gemhoUtil.navigatePage('./dw-list-detail.html?type=add') gemhoUtil.navigatePage('./dw-list-detail.html?type=add')
}, },
edit(item){ edit(item){
gemhoUtil.navigatePage('./dw-list-detail.html?dwId='+item.id+'&type=edit') gemhoUtil.navigatePage('./dw-list-detail.html?planId='+item.id+'&type=edit')
}, },
getList(){ getList(){
if(this.loading){ if(this.loading){
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<meta name="viewport" <meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover"> content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover">
<title>法律法规-详情</title> <title>法律法规-详情</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js"></script>
<script type="text/javascript" src="../sdk/includeHead.js"></script> <script type="text/javascript" src="../sdk/includeHead.js"></script>
<style> <style>
html, body{ html, body{
......
...@@ -8,8 +8,6 @@ window.addEventListener("load", function() { ...@@ -8,8 +8,6 @@ window.addEventListener("load", function() {
data() { data() {
return { return {
lawChapter: '', lawChapter: '',
// 企业id
companyId: localStorage.getItem('companyId'),
disabled: false, disabled: false,
} }
}, },
...@@ -19,6 +17,11 @@ window.addEventListener("load", function() { ...@@ -19,6 +17,11 @@ window.addEventListener("load", function() {
methods: { methods: {
detail() { detail() {
vant.Toast.loading({
message: '加载中...',
forbidClick: true,
loadingType: 'spinner',
});
http2.post({ http2.post({
serviceId: API_KEY_MAP["law-list-detail"]['id'], serviceId: API_KEY_MAP["law-list-detail"]['id'],
interfacePublicKey: API_KEY_MAP["law-list-detail"]["publicKey"], interfacePublicKey: API_KEY_MAP["law-list-detail"]["publicKey"],
...@@ -34,6 +37,7 @@ window.addEventListener("load", function() { ...@@ -34,6 +37,7 @@ window.addEventListener("load", function() {
var result = JSON.parse(res) var result = JSON.parse(res)
this.lawChapter = result.lawChapter this.lawChapter = result.lawChapter
} }
vant.Toast.clear()
}) })
}, },
}, },
......
...@@ -23,7 +23,8 @@ window.addEventListener("load", function() { ...@@ -23,7 +23,8 @@ window.addEventListener("load", function() {
methods: { methods: {
detail(index){ detail(index){
this.list[index].currentUserRead = true this.list[index].currentUserRead = true
location.href = './law-list-detail.html?law_id='+this.list[index].lawId // location.href = './law-list-detail.html?law_id='+this.list[index].lawId
gemhoUtil.navigatePage('./law-list-detail.html?law_id='+this.list[index].lawId)
}, },
getList(){ getList(){
if(this.loading){ if(this.loading){
......
...@@ -22,7 +22,8 @@ window.addEventListener("load", function() { ...@@ -22,7 +22,8 @@ window.addEventListener("load", function() {
}, },
methods: { methods: {
nav(item){ nav(item){
location.href='./law-lv2.html?pid=' + item.id // location.href='./law-lv2.html?pid=' + item.id
gemhoUtil.navigatePage('./law-lv2.html?pid=' + item.id)
}, },
getList(){ getList(){
if(this.loading){ if(this.loading){
...@@ -51,8 +52,6 @@ window.addEventListener("load", function() { ...@@ -51,8 +52,6 @@ window.addEventListener("load", function() {
if(this.page*this.size >= this.total){ if(this.page*this.size >= this.total){
this.finished = true; // 下滑不在刷新数据 this.finished = true; // 下滑不在刷新数据
} }
} }
this.loading = false this.loading = false
}) })
......
...@@ -7,8 +7,6 @@ window.addEventListener("load", function() { ...@@ -7,8 +7,6 @@ window.addEventListener("load", function() {
el: '#app', el: '#app',
data() { data() {
return { return {
companyName: '',
value: '',
list: [], list: [],
loading: false, loading: false,
finished: false, finished: false,
...@@ -23,7 +21,8 @@ window.addEventListener("load", function() { ...@@ -23,7 +21,8 @@ window.addEventListener("load", function() {
}, },
methods: { methods: {
nav(category_id){ nav(category_id){
location.href = './law-list.html?category_id=' + category_id // location.href = './law-list.html?category_id=' + category_id
gemhoUtil.navigatePage('./law-list.html?category_id=' + category_id)
}, },
getList(){ getList(){
if(this.loading){ if(this.loading){
...@@ -50,31 +49,15 @@ window.addEventListener("load", function() { ...@@ -50,31 +49,15 @@ window.addEventListener("load", function() {
this.list.push(...result.content); this.list.push(...result.content);
this.total = result.totalElements this.total = result.totalElements
if(!this.list.length){
this.nav(gemhoUtil.getParameter('pid'))
}
if(this.page*this.size >= this.total){ if(this.page*this.size >= this.total){
this.finished = true; // 下滑不在刷新数据 this.finished = true; // 下滑不在刷新数据
} }
} }
this.loading = false this.loading = false
}) })
// http.get('/api/lawCategory',{
// page: this.page++,// 每次请求增加下一页
// size: this.size,
// county: localStorage.getItem('appCounty'),
// pid: gemhoUtil.getParameter('pid'),
// }).then((res)=>{
// this.loading = false; // 加载状态结束
// this.list.push(...res.content);
// this.total = res.totalElements
// if(!this.list.length){
// this.nav(gemhoUtil.getParameter('pid'))
// }
// if(this.page*this.size >= this.total){
// this.finished = true; // 下滑不在刷新数据
// }
// })
} }
}, },
}); });
......
...@@ -17,6 +17,11 @@ window.addEventListener("load", function() { ...@@ -17,6 +17,11 @@ window.addEventListener("load", function() {
methods: { methods: {
detail() { detail() {
vant.Toast.loading({
message: '加载中...',
forbidClick: true,
loadingType: 'spinner',
});
http2.post({ http2.post({
serviceId: API_KEY_MAP["notice-list-detail"]['id'], serviceId: API_KEY_MAP["notice-list-detail"]['id'],
interfacePublicKey: API_KEY_MAP["notice-list-detail"]["publicKey"], interfacePublicKey: API_KEY_MAP["notice-list-detail"]["publicKey"],
...@@ -32,13 +37,8 @@ window.addEventListener("load", function() { ...@@ -32,13 +37,8 @@ window.addEventListener("load", function() {
var result = JSON.parse(res) var result = JSON.parse(res)
this.noticeContent = result.noticeContent this.noticeContent = result.noticeContent
} }
vant.Toast.clear()
}) })
// http.get('/api/notice/findOwn', {
// noticeId: gemhoUtil.getParameter('noticeId')
// }).then((res) => {
// console.log('响应结果', res.content)
// this.noticeContent = res.noticeContent
// })
}, },
}, },
......
...@@ -7,8 +7,6 @@ window.addEventListener("load", function() { ...@@ -7,8 +7,6 @@ window.addEventListener("load", function() {
el: '#app', el: '#app',
data() { data() {
return { return {
companyName: '',
value: '',
list: [], list: [],
loading: false, loading: false,
finished: false, finished: false,
...@@ -22,7 +20,8 @@ window.addEventListener("load", function() { ...@@ -22,7 +20,8 @@ window.addEventListener("load", function() {
}, },
methods: { methods: {
detail(index){ detail(index){
location.href = './notice-list-detail.html?noticeId='+this.list[index].noticeId // location.href = './notice-list-detail.html?noticeId='+this.list[index].noticeId
gemhoUtil.navigatePage('./notice-list-detail.html?noticeId='+this.list[index].noticeId)
}, },
getList(){ getList(){
if(this.loading){ if(this.loading){
...@@ -51,26 +50,9 @@ window.addEventListener("load", function() { ...@@ -51,26 +50,9 @@ window.addEventListener("load", function() {
if(this.page*this.size >= this.total){ if(this.page*this.size >= this.total){
this.finished = true; // 下滑不在刷新数据 this.finished = true; // 下滑不在刷新数据
} }
} }
this.loading = false this.loading = false
}) })
// http.get('/api/notice/findOwnTag',{
// page: this.page++,// 每次请求增加下一页
// size: this.size,
// county: localStorage.getItem('appCounty'),
// }).then((res)=>{
// this.loading = false; // 加载状态结束
// this.list.push(...res.content);
// this.total = res.totalElements
// if(this.page*this.size >= this.total){
// this.finished = true; // 下滑不在刷新数据
// }
// })
} }
}, },
}); });
......
...@@ -73,12 +73,12 @@ window.addEventListener("load", function() { ...@@ -73,12 +73,12 @@ window.addEventListener("load", function() {
}, (res) => { }, (res) => {
if(res){ if(res){
console.log('接口回调数据', JSON.parse(res)) // console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res) var result = JSON.parse(res)
this.loading = false; // 加载状态结束 this.loading = false; // 加载状态结束
console.log('响应结果', result.content) // console.log('响应结果', result.content)
this.form = result.content[0] this.form = result.content[0]
if(this.form.hdPic && this.form.hdPic.length){ if(this.form.hdPic && this.form.hdPic.length){
this.form.hdPic = this.form.hdPic[0] this.form.hdPic = this.form.hdPic[0]
...@@ -122,12 +122,12 @@ window.addEventListener("load", function() { ...@@ -122,12 +122,12 @@ window.addEventListener("load", function() {
}, (res) => { }, (res) => {
if(res){ if(res){
console.log('接口回调数据', JSON.parse(res)) // console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res) var result = JSON.parse(res)
this.loading = false; // 加载状态结束 this.loading = false; // 加载状态结束
console.log('响应结果', result) // console.log('响应结果', result)
// vant.Toast.clear() // vant.Toast.clear()
// vant.Toast({ // vant.Toast({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment