safecheck-client 3.0.30-74 → 3.0.30-77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/main.js CHANGED
@@ -1,33 +1,33 @@
1
- import Vue from 'vue'
2
- import App from './App'
3
- import { all } from 'vue-client'
4
- import { system } from 'system-clients'
5
- import safecheck from './safecheck'
6
- import echarts from 'echarts'
7
- // import safecheck from './rongcheng'
8
-
9
- all()
10
- // 验证码开关赋值
11
- var Verificationfalg = false
12
- system(Verificationfalg)
13
- // system()
14
- safecheck(process.env.SAFE_CHECK);
15
- // safecheck('rizhao')
16
- require('./bootstrap/less/bootstrap.less')
17
- require('./expandcss.less')
18
-
19
- Vue.prototype.$echarts = echarts
20
- Vue.android = false
21
-
22
- Vue.url = '/SafeCheck/rs/'
23
- if(Vue.android)
24
- Vue.url = Vue.staticUrl
25
- Vue.interval = 1*60*1000
26
- Vue.nopic = 'file:///android_asset/nopic.png'
27
- Vue.mapSetup = false
28
-
29
- /* eslint-disable no-new */
30
- new Vue({
31
- el: 'body',
32
- components: { App }
33
- })
1
+ import Vue from 'vue'
2
+ import App from './App'
3
+ import { all } from 'vue-client'
4
+ import { system } from 'system-clients'
5
+ import safecheck from './safecheck'
6
+ import echarts from 'echarts'
7
+ // import safecheck from './rongcheng'
8
+
9
+ all()
10
+ // 验证码开关赋值
11
+ var Verificationfalg = false
12
+ system(Verificationfalg)
13
+ // system()
14
+ safecheck('wuhai');
15
+ // safecheck('rizhao')
16
+ require('./bootstrap/less/bootstrap.less')
17
+ require('./expandcss.less')
18
+
19
+ Vue.prototype.$echarts = echarts
20
+ Vue.android = false
21
+
22
+ Vue.url = '/SafeCheck/rs/'
23
+ if(Vue.android)
24
+ Vue.url = Vue.staticUrl
25
+ Vue.interval = 1*60*1000
26
+ Vue.nopic = 'file:///android_asset/nopic.png'
27
+ Vue.mapSetup = false
28
+
29
+ /* eslint-disable no-new */
30
+ new Vue({
31
+ el: 'body',
32
+ components: { App }
33
+ })
@@ -1,132 +0,0 @@
1
- <template>
2
- <div>
3
- <button @click="handleClick">渲染</button>
4
- <button @click="savePaper">保存</button>
5
- <iframe v-if="showSketchPage" :src="sketchPageSrc" id="aaaa2" style="width: 100%; height: 500px;"></iframe>
6
- </div>
7
- </template>
8
-
9
- <script>
10
- import HttpResetClass from "vue-client/src/plugins/HttpResetClass";
11
-
12
- export default {
13
- title: 'App',
14
- data() {
15
- return {
16
- inputText: '',
17
- showSketchPage: false,
18
- sketchPageSrc: '/sketch',
19
- sketchId: '',
20
- title: '',
21
- paperMessage: ''
22
- };
23
- },
24
- props: {
25
- row: ''
26
- },
27
- async ready() {
28
- if (this.row) {
29
- await new HttpResetClass().load('POST', 'rs/sql/tel_singleTable_OrderBy', {
30
- data: {
31
- items: 'blob', tablename: 't_blob_sketch', condition: `id = '${this.row}'`, orderitem: 'id'
32
- }
33
- }).then(res => {
34
- if (res.data.length === 0) {
35
- this.handleClick()
36
- return
37
- }
38
- try {
39
- let hex = Buffer.from(res.data[0].blob, 'hex').toString('utf8');
40
- if (!hex.includes('{')) {
41
- this.inputText = Buffer.from(hex, 'hex').toString('utf8');
42
- } else {
43
- this.inputText = hex;
44
- }
45
- } catch (e) {
46
- this.$showMessage('网络异常请联系管理员')
47
- }
48
- this.handleClick()
49
- })
50
- }
51
- },
52
- methods: {
53
- handleClick() {
54
- this.showSketchPage = true;
55
- this.$nextTick(() => {
56
- const sketchIframe = document.getElementById('aaaa2');
57
-
58
- window.addEventListener('message', (event) => {
59
- if (JSON.parse(event.data.param).gadgets.length > 0) {
60
- this.paperMessage = event.data.param;
61
- }
62
- });
63
-
64
- sketchIframe.contentWindow.postMessage(this.inputText, '*');
65
- })
66
- },
67
- savePaper() {
68
- if (!this.paperMessage) {
69
- this.$showMessage('请先点击左上角保存图标')
70
- return
71
- }
72
- let param = JSON.parse(this.paperMessage)
73
- if (!param.title) {
74
- this.$showMessage('请填写示意图标题')
75
- return
76
- }
77
- let gadgets = param.gadgets
78
- if (gadgets.length > 0) {
79
- var jsonString = JSON.stringify(param);
80
- var reqdata = {
81
- blob: Buffer.from(jsonString, 'utf8').toString('hex'),
82
- orgid: this.$login.f.orgid,
83
- orgname: this.$login.f.orgs,
84
- title: param.title,
85
- f_userinfo_id: this.row
86
- }
87
- new HttpResetClass().load('POST', 'rs/logic/savePaperEdit', {data: reqdata}).then(res => {
88
- if (res.data.code === 200) {
89
- this.$showMessage('保存成功')
90
- } else {
91
- this.$showMessage('保存失败')
92
- }
93
- })
94
- }
95
- },
96
- hexToBytes(hex) {
97
- for (var bytes = [], c = 0; c < hex.length; c += 2)
98
- bytes.push(parseInt(hex.substring(c, 2), 16));
99
- return new Uint8Array(bytes);
100
- },
101
- decodeHexStringToJSON(hexString) {
102
- // 去除前缀 "0x"
103
- var cleanHexString = hexString.slice(2);
104
-
105
- // 将十六进制字符串转换为字节数组
106
- var byteArray = this.hexToBytes(cleanHexString);
107
-
108
- // 创建 Blob 对象
109
- var blob = new Blob([byteArray], {type: 'application/json'});
110
-
111
- // 读取 Blob 为文本
112
- return new Promise(function (resolve, reject) {
113
- var reader = new FileReader();
114
- reader.onloadend = function () {
115
- resolve(reader.result);
116
- };
117
- reader.onerror = function () {
118
- reject(reader.error);
119
- };
120
- reader.readAsText(blob, 'UTF-8');
121
- });
122
- }
123
- },
124
- // beforeDestroy() {
125
- // this.savePaper()
126
- // }
127
- }
128
- </script>
129
-
130
- <style>
131
- /* 这里可以添加样式 */
132
- </style>