Commit b97ded09 authored by xinzhedeai's avatar xinzhedeai

通知公告

parent d2f6a7ce
...@@ -60,11 +60,18 @@ var http2 = { ...@@ -60,11 +60,18 @@ var http2 = {
msg: "请求成功" msg: "请求成功"
success: true success: true
*/ */
if(!value){
vant.Dialog.alert({
title: '信息提示',
message: '请求异常'//'网络错误',
})
return
}
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)
fn && fn(sm2_decrypt_result) fn && fn(sm2_decrypt_result)
}) })
}, },
......
...@@ -22,7 +22,7 @@ const API_KEY_MAP = { ...@@ -22,7 +22,7 @@ const API_KEY_MAP = {
'notice-list': { // 通知公告-列表 'notice-list': { // 通知公告-列表
id: 'gqyjglptfindOwnTag', id: 'gqyjglptfindOwnTag',
publicKey: '049ba9d80cb4284f6cc9f55935b3cd57cec034b5f242c390bf70d2a62ee917cf525b83d524eb700c68af330c9e5bcb82bd1101370318cdce19418a342fa31217ed', publicKey: '049ba9d80cb4284f6cc9f55935b3cd57cec034b5f242c390bf70d2a62ee917cf525b83d524eb700c68af330c9e5bcb82bd1101370318cdce19418a342fa31217ed',
privateKey: '2152ba9b1a9c6526fab2e6f5985da1c36ecc9476fd4ab4b19a43206836d8e496' privateKey: '00d97af0c76917729cec802a38d061f1f08aa4310c9a5642374aa18945b3dd412b'
}, },
'notice-list-detail': { // 通知公告-详情 'notice-list-detail': { // 通知公告-详情
id: 'gqyjglptfindOwn', id: 'gqyjglptfindOwn',
...@@ -46,19 +46,3 @@ const API_KEY_MAP = { ...@@ -46,19 +46,3 @@ const API_KEY_MAP = {
}, },
} }
// aes解密
function aes_Decrypt(word, key) {
var key = CryptoJS.enc.Utf8.parse(key) //转为128bit
var srcs = CryptoJS.enc.Hex.parse(word) //转为16进制
var str = CryptoJS.enc.Base64.stringify(srcs) //变为Base64编码的字符串
var decrypt = CryptoJS.AES.decrypt(str, key, {
mode: CryptoJS.mode.ECB,
spadding: CryptoJS.pad.Pkcs7
})
return decrypt.toString(CryptoJS.enc.Utf8)
}
// sm2解密,需要创建加密应用时的私钥
function sm2_Decrypt(word, key) {
return SM.decrypt(word, key)
}
\ No newline at end of file
...@@ -4,35 +4,13 @@ ...@@ -4,35 +4,13 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<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://cdn.bootcdn.net/ajax/libs/pdf.js/2.0.193/pdf.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/pdf.js/2.0.193/pdf.worker.min.js"></script> -->
<!-- <script src="../js/pdfjs-4.2.67-dist/build/pdf.mjs"></script>
<script src="../js/pdfjs-4.2.67-dist/build/pdf.worker.mjs"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js"></script>
<script type="text/javascript" src="../js/includeHead.js"></script> <script type="text/javascript" src="../js/includeHead.js"></script>
<style> <style>
html, body{ html, body{
background-color: #fff; background-color: #fff;
} }
.pd-01rem{
padding-bottom: 0.1rem;
}
/* 表单相关 */
.formValue{
float: right;
}
.formSubmitBtnWrapper{
display: flex;
justify-content: center;
margin-top: 0.2rem;
margin-bottom:0.2rem;
}
.formSubmitBtnWrapper .van-button{
width: 4rem;
}
/** /**
* 框架样式覆盖修改 * 框架样式覆盖修改
*/ */
......
...@@ -8,8 +8,6 @@ window.addEventListener("load", function() { ...@@ -8,8 +8,6 @@ window.addEventListener("load", function() {
data() { data() {
return { return {
noticeContent: '', noticeContent: '',
// 企业id
companyId: localStorage.getItem('companyId'),
disabled: false, disabled: false,
} }
}, },
...@@ -19,12 +17,28 @@ window.addEventListener("load", function() { ...@@ -19,12 +17,28 @@ window.addEventListener("load", function() {
methods: { methods: {
detail() { detail() {
http.get('/api/notice/findOwn', { http2.post({
noticeId: gemhoUtil.getParameter('noticeId') serviceId: API_KEY_MAP["notice-list-detail"]['id'],
}).then((res) => { interfacePublicKey: API_KEY_MAP["notice-list-detail"]["publicKey"],
console.log('响应结果', res.content) interfacePrivateKey: API_KEY_MAP["notice-list-detail"]["privateKey"],
this.noticeContent = res.noticeContent reqParams: {
noticeId: gemhoUtil.getParameter('noticeId')
}
}, (res) => {
if(res){
console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res)
this.noticeContent = result.noticeContent
}
}) })
// http.get('/api/notice/findOwn', {
// noticeId: gemhoUtil.getParameter('noticeId')
// }).then((res) => {
// console.log('响应结果', res.content)
// this.noticeContent = res.noticeContent
// })
}, },
}, },
......
...@@ -25,20 +25,51 @@ window.addEventListener("load", function() { ...@@ -25,20 +25,51 @@ window.addEventListener("load", function() {
location.href = './notice-list-detail.html?noticeId='+this.list[index].noticeId location.href = './notice-list-detail.html?noticeId='+this.list[index].noticeId
}, },
getList(){ getList(){
http.get('/api/notice/findOwnTag',{ if(this.loading){
page: this.page++,// 每次请求增加下一页 return
size: this.size, }
county: localStorage.getItem('appCounty'), this.loading = true
}).then((res)=>{ http2.post({
serviceId: API_KEY_MAP["notice-list"]['id'],
this.loading = false; // 加载状态结束 interfacePublicKey: API_KEY_MAP["notice-list"]["publicKey"],
this.list.push(...res.content); interfacePrivateKey: API_KEY_MAP["notice-list"]["privateKey"],
this.total = res.totalElements reqParams: {
page: this.page++,// 每次请求增加下一页
if(this.page*this.size >= this.total){ size: this.size,
this.finished = true; // 下滑不在刷新数据 // sort: 'createTime,desc',
}
}, (res) => {
if(res){
console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res)
this.loading = false; // 加载状态结束
this.list.push(...result.content);
this.total = result.totalElements
if(this.page*this.size >= this.total){
this.finished = true; // 下滑不在刷新数据
}
} }
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; // 下滑不在刷新数据
// }
// })
} }
}, },
......
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.hdInspectExpert" :disabled="false" label="检查人员" placeholder="" /> <van-field v-model="form.hdInspectExpert" :disabled="true" label="检查人员" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group :class="{'disable-van-cell': true}"> <van-cell-group :class="{'disable-van-cell': true}">
<van-cell>隐患类型: <van-cell>隐患类型:
<van-radio-group v-model="form.hdLevel" :disabled="false" direction="horizontal"> <van-radio-group v-model="form.hdLevel" :disabled="true" direction="horizontal">
<van-radio name="1">一般隐患</van-radio> <van-radio name="1">一般隐患</van-radio>
<van-radio name="2">重大隐患</van-radio> <van-radio name="2">重大隐患</van-radio>
</van-radio-group> </van-radio-group>
...@@ -86,13 +86,13 @@ ...@@ -86,13 +86,13 @@
</van-popup> </van-popup>
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.comment" :disabled="false" label="隐患描述" placeholder="" /> <van-field v-model="form.comment" :disabled="true" label="隐患描述" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.basis" :disabled="false" label="检查依据" placeholder="" /> <van-field v-model="form.basis" :disabled="true" label="检查依据" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.suggestion" :disabled="false" label="整改建议" placeholder="" /> <van-field v-model="form.suggestion" :disabled="true" label="整改建议" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group :class="{'disable-van-cell': true}"> <van-cell-group :class="{'disable-van-cell': true}">
<van-cell is-link @click="showPopup('showPopup4hdRectificationDate')">整改期限<span class="formValue">{{form.hdRectificationDate}}</span></van-cell> <van-cell is-link @click="showPopup('showPopup4hdRectificationDate')">整改期限<span class="formValue">{{form.hdRectificationDate}}</span></van-cell>
...@@ -123,13 +123,13 @@ ...@@ -123,13 +123,13 @@
</van-cell-group> </van-cell-group>
<div v-if="form.hdStatus===1||form.hdStatus===3"> <div v-if="form.hdStatus===1||form.hdStatus===3">
<van-cell-group> <van-cell-group>
<van-field v-model="form.hdInspectDate" :disabled="false" label="审核日期" placeholder="" /> <van-field v-model="form.hdInspectDate" :disabled="true" label="审核日期" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.hdAcceptancePerson" :disabled="false" label="审核人员" placeholder="" /> <van-field v-model="form.hdAcceptancePerson" :disabled="true" label="审核人员" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.hdRectificationRecord" :disabled="false" type="textarea" label="审核记录" autosize placeholder="" /> <van-field v-model="form.hdRectificationRecord" :disabled="true" type="textarea" label="审核记录" autosize placeholder="" />
</van-cell-group> </van-cell-group>
</div> </div>
......
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