three-trees-ui 1.0.18 → 1.0.19
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/lib/three-trees-ui.common.js +660 -629
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +660 -629
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/Autocomplete/src/main.vue +1 -0
- package/packages/Avatar/src/AvatarImage.vue +1 -1
- package/packages/Button/src/main.vue +1 -0
- package/packages/Cascader/src/main.vue +1 -0
- package/packages/Checkbox/src/main.vue +1 -0
- package/packages/CustomDialog/src/main.vue +1 -1
- package/packages/Date/src/main.vue +1 -0
- package/packages/DatePicker/src/main.vue +1 -0
- package/packages/Demension/src/main.vue +1 -1
- package/packages/Dictionary/src/main.vue +1 -0
- package/packages/DimensionSelector/src/main.vue +1 -0
- package/packages/DimensionSelectorInput/src/main.vue +1 -0
- package/packages/Divider/src/main.vue +1 -0
- package/packages/Editor/src/main.vue +7 -7
- package/packages/File/src/main.vue +1 -0
- package/packages/Iframe/src/main.vue +177 -176
- package/packages/Image/src/main.vue +12 -9
- package/packages/Input/src/main.vue +1 -0
- package/packages/JobSelector/src/main.vue +1 -0
- package/packages/JobSelectorInput/src/main.vue +1 -0
- package/packages/OrgSelector/src/main.vue +1 -0
- package/packages/OrgSelectorInput/src/OrgSelectorInput.vue +1 -0
- package/packages/PostSelector/src/main.vue +1 -0
- package/packages/PostSelectorInput/src/PostSelectorInput.vue +1 -0
- package/packages/Radio/src/main.vue +1 -0
- package/packages/Rate/src/main.vue +1 -0
- package/packages/ReadonlyInput/src/main.vue +1 -0
- package/packages/RoleSelector/src/main.vue +1 -0
- package/packages/RoleSelectorInput/src/main.vue +1 -0
- package/packages/Select/src/main.vue +1 -0
- package/packages/SelectTree/src/SelectTree.vue +1 -0
- package/packages/Switch/src/main.vue +1 -0
- package/packages/TimePicker/src/main.vue +1 -0
- package/packages/TimeSelect/src/main.vue +1 -0
- package/packages/Tree/src/main.vue +1 -1
- package/packages/UserDialog/src/main.vue +1 -1
- package/packages/UserSelector/src/main.vue +1 -0
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
disabled ? 'is-disabled' : '',
|
|
10
10
|
]"
|
|
11
11
|
:style="styleEditor"
|
|
12
|
+
class="ht-editor"
|
|
12
13
|
>
|
|
13
14
|
<input
|
|
14
15
|
v-if="inputWriteable && !hasTextValue"
|
|
@@ -150,7 +151,7 @@
|
|
|
150
151
|
},
|
|
151
152
|
},
|
|
152
153
|
watch: {
|
|
153
|
-
value: function
|
|
154
|
+
value: function(newVal) {
|
|
154
155
|
if (this.editor && newVal) {
|
|
155
156
|
let text = this.editor.txt.html()
|
|
156
157
|
if (text !== newVal && encode(text) !== newVal) {
|
|
@@ -159,18 +160,18 @@
|
|
|
159
160
|
}
|
|
160
161
|
},
|
|
161
162
|
textValue: {
|
|
162
|
-
handler: function
|
|
163
|
+
handler: function(newVal) {
|
|
163
164
|
this.loadCompiledTextValue(newVal)
|
|
164
165
|
},
|
|
165
166
|
immediate: true,
|
|
166
167
|
},
|
|
167
|
-
permission_sub: function
|
|
168
|
+
permission_sub: function(newVal, oldVal) {
|
|
168
169
|
if (newVal !== oldVal) {
|
|
169
170
|
// 现在是无权限,需要销毁
|
|
170
171
|
newVal == 'n' && this.destroyEditor()
|
|
171
172
|
}
|
|
172
173
|
},
|
|
173
|
-
inputWriteable: function
|
|
174
|
+
inputWriteable: function(newVal, oldVal) {
|
|
174
175
|
if (newVal !== oldVal) {
|
|
175
176
|
// 可编辑,渲染
|
|
176
177
|
if (newVal && !this.hasTextValue) {
|
|
@@ -182,7 +183,7 @@
|
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
},
|
|
185
|
-
formInstance: function
|
|
186
|
+
formInstance: function(newVal, oldVal) {
|
|
186
187
|
if (!oldVal && newVal && newVal.$on) {
|
|
187
188
|
newVal.$off('updateData', this.loadCompiledTextValue)
|
|
188
189
|
newVal.$on('updateData', this.loadCompiledTextValue)
|
|
@@ -247,8 +248,7 @@
|
|
|
247
248
|
this.editor.config.uploadImgHeaders &&
|
|
248
249
|
!this.editor.config.uploadImgHeaders.Authorization
|
|
249
250
|
) {
|
|
250
|
-
this.editor.config.uploadImgHeaders.Authorization =
|
|
251
|
-
this.$requestConfig.getToken()
|
|
251
|
+
this.editor.config.uploadImgHeaders.Authorization = this.$requestConfig.getToken()
|
|
252
252
|
}
|
|
253
253
|
this.editor.create()
|
|
254
254
|
if (this.disabled) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :name="iframeNmae + 'Div'">
|
|
2
|
+
<div :name="iframeNmae + 'Div'" class="ht-iframe">
|
|
3
3
|
<iframe
|
|
4
4
|
id="iframeControl"
|
|
5
5
|
v-if="isReday"
|
|
@@ -13,196 +13,197 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</template>
|
|
15
15
|
<script>
|
|
16
|
-
import { decode } from '@/util/base64'
|
|
17
|
-
export default {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
height: { type: String, default: '500px' },
|
|
26
|
-
width: { type: String, default: '100%' },
|
|
27
|
-
iframeStyle: { type: String, default: '' },
|
|
28
|
-
iframeNmae: { type: String, default: 'iframeControl' },
|
|
29
|
-
frameborder: { type: String, default: '1' },
|
|
30
|
-
data: {
|
|
31
|
-
type: Object,
|
|
32
|
-
default: () => {
|
|
33
|
-
return []
|
|
16
|
+
import { decode } from '@/util/base64'
|
|
17
|
+
export default {
|
|
18
|
+
name: 'HtIframe',
|
|
19
|
+
componentName: 'HtIframe',
|
|
20
|
+
props: {
|
|
21
|
+
src: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '',
|
|
34
24
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
type:
|
|
38
|
-
default:
|
|
39
|
-
|
|
25
|
+
height: { type: String, default: '500px' },
|
|
26
|
+
width: { type: String, default: '100%' },
|
|
27
|
+
iframeStyle: { type: String, default: '' },
|
|
28
|
+
iframeNmae: { type: String, default: 'iframeControl' },
|
|
29
|
+
frameborder: { type: String, default: '1' },
|
|
30
|
+
data: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => {
|
|
33
|
+
return []
|
|
34
|
+
},
|
|
40
35
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
default: () => {
|
|
47
|
-
return {}
|
|
36
|
+
permission: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => {
|
|
39
|
+
return {}
|
|
40
|
+
},
|
|
48
41
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
instId: { type: String, default: '' },
|
|
43
|
+
isBusinessForm: { type: Boolean, default: false },
|
|
44
|
+
urlParameter: {
|
|
45
|
+
type: [Array, Object],
|
|
46
|
+
default: () => {
|
|
47
|
+
return {}
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
returnParameter: {
|
|
51
|
+
type: [Array, Object],
|
|
52
|
+
default: () => {
|
|
53
|
+
return {}
|
|
54
|
+
},
|
|
54
55
|
},
|
|
56
|
+
iframeType: {
|
|
57
|
+
type: String, // static dynamic
|
|
58
|
+
default: 'static',
|
|
59
|
+
},
|
|
60
|
+
iframeSrcJs: String, // 动态url base64格式
|
|
55
61
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
subPageData: {},
|
|
65
|
+
endSrc: '',
|
|
66
|
+
isReday: false,
|
|
67
|
+
}
|
|
59
68
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
isReday: false,
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
async mounted() {
|
|
70
|
-
let _this = this
|
|
71
|
-
//拼接url参数
|
|
72
|
-
if (!this.src) {
|
|
73
|
-
this.$message.error('当前URL表单地址未填写。')
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
if (this.iframeType == 'dynamic') {
|
|
77
|
-
await this.getDynamicSrc()
|
|
78
|
-
} else {
|
|
79
|
-
this.endSrc = this.src
|
|
80
|
-
}
|
|
81
|
-
if (this.isBusinessForm) {
|
|
82
|
-
if (
|
|
83
|
-
this.urlParameter &&
|
|
84
|
-
this.urlParameter instanceof Array &&
|
|
85
|
-
this.urlParameter.length > 0
|
|
86
|
-
) {
|
|
87
|
-
this.disposeUrl()
|
|
69
|
+
async mounted() {
|
|
70
|
+
let _this = this
|
|
71
|
+
//拼接url参数
|
|
72
|
+
if (!this.src) {
|
|
73
|
+
this.$message.error('当前URL表单地址未填写。')
|
|
74
|
+
return
|
|
88
75
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (e.data.type == 'getParentPageData') {
|
|
94
|
-
_this.getParentPageDataMsg()
|
|
95
|
-
} else if (e.data.type == 'getSubPageData') {
|
|
96
|
-
_this.getSubPageData(e.data.data)
|
|
97
|
-
} else if (e.data.type == 'addHeight') {
|
|
98
|
-
_this.addHeight(e.data.height)
|
|
99
|
-
}
|
|
76
|
+
if (this.iframeType == 'dynamic') {
|
|
77
|
+
await this.getDynamicSrc()
|
|
78
|
+
} else {
|
|
79
|
+
this.endSrc = this.src
|
|
100
80
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
81
|
+
if (this.isBusinessForm) {
|
|
82
|
+
if (
|
|
83
|
+
this.urlParameter &&
|
|
84
|
+
this.urlParameter instanceof Array &&
|
|
85
|
+
this.urlParameter.length > 0
|
|
86
|
+
) {
|
|
87
|
+
this.disposeUrl()
|
|
88
|
+
}
|
|
109
89
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
90
|
+
//父子页面事件监听器
|
|
91
|
+
window.addEventListener('message', (e) => {
|
|
92
|
+
if (e.data && e.data.type && e.data.iframeNmae == this.iframeNmae) {
|
|
93
|
+
if (e.data.type == 'getParentPageData') {
|
|
94
|
+
_this.getParentPageDataMsg()
|
|
95
|
+
} else if (e.data.type == 'getSubPageData') {
|
|
96
|
+
_this.getSubPageData(e.data.data)
|
|
97
|
+
} else if (e.data.type == 'addHeight') {
|
|
98
|
+
_this.addHeight(e.data.height)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
this.isReday = true
|
|
103
|
+
},
|
|
104
|
+
created() {},
|
|
105
|
+
methods: {
|
|
106
|
+
async getDynamicSrc() {
|
|
107
|
+
if (!this.iframeSrcJs) {
|
|
108
|
+
return
|
|
109
|
+
}
|
|
110
|
+
let _this = this
|
|
111
|
+
let data = this.data
|
|
112
|
+
let currentUserDetail = await this.$requestConfig.getCurrentUser()
|
|
113
|
+
let userId = this.$requestConfig.getUserId()
|
|
114
|
+
let account = this.$requestConfig.getAccount()
|
|
115
|
+
let token = this.$requestConfig.getToken()
|
|
116
|
+
const preScript = `const scriptFunction = function(_this,data,currentUserDetail,userId,account,token){
|
|
117
117
|
${decode(this.iframeSrcJs)}
|
|
118
118
|
};`
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
this.endSrc = eval(
|
|
120
|
+
`${preScript} scriptFunction(_this,data,currentUserDetail,userId,account,token);`
|
|
121
|
+
)
|
|
122
|
+
},
|
|
123
|
+
addHeight(height) {
|
|
124
|
+
this.height = height
|
|
125
|
+
},
|
|
126
|
+
async disposeUrl() {
|
|
127
|
+
let currentUserDetail = await this.$requestConfig.getCurrentUser()
|
|
126
128
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
let vStr = ''
|
|
130
|
+
for (let x = 0; x < this.urlParameter.length; x++) {
|
|
131
|
+
let parma = this.urlParameter[x]
|
|
132
|
+
if (parma.type == 1) {
|
|
133
|
+
vStr = vStr + `&${parma.key}=${this.getFromData(parma.value)}`
|
|
134
|
+
} else if (parma.type == 2) {
|
|
135
|
+
vStr = vStr + `&${parma.key}=${parma.value}`
|
|
136
|
+
} else if (parma.type == 3 && parma.value) {
|
|
137
|
+
let _this = this
|
|
138
|
+
const preScript = `const scriptFunction = function(_this){
|
|
137
139
|
${Base64.decode(parma.value)}
|
|
138
140
|
};`
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
const result = eval(`${preScript} scriptFunction(_this);`)
|
|
142
|
+
if (result) {
|
|
143
|
+
vStr = vStr + `&${parma.key}=${result}`
|
|
144
|
+
}
|
|
145
|
+
} else if (parma.type == 4) {
|
|
146
|
+
let res = ''
|
|
147
|
+
if (parma.value == 1) {
|
|
148
|
+
res = currentUserDetail.fullname
|
|
149
|
+
} else if (parma.value == 2) {
|
|
150
|
+
res = currentUserDetail.userId
|
|
151
|
+
} else if (parma.value == 3) {
|
|
152
|
+
res = currentUserDetail.account
|
|
153
|
+
} else if (parma.value == 4) {
|
|
154
|
+
res = this.$requestConfig.getToken()
|
|
155
|
+
} else if (parma.value == 5) {
|
|
156
|
+
//得到任务id
|
|
157
|
+
res = this.$route.query.taskId
|
|
158
|
+
} else if (parma.value == 6) {
|
|
159
|
+
res = this.instId
|
|
160
|
+
}
|
|
161
|
+
vStr = vStr + `&${parma.key}=${res}`
|
|
142
162
|
}
|
|
143
|
-
} else if (parma.type == 4) {
|
|
144
|
-
let res = ''
|
|
145
|
-
if (parma.value == 1) {
|
|
146
|
-
res = currentUserDetail.fullname
|
|
147
|
-
} else if (parma.value == 2) {
|
|
148
|
-
res = currentUserDetail.userId
|
|
149
|
-
} else if (parma.value == 3) {
|
|
150
|
-
res = currentUserDetail.account
|
|
151
|
-
} else if (parma.value == 4) {
|
|
152
|
-
res = this.$requestConfig.getToken()
|
|
153
|
-
} else if (parma.value == 5) {
|
|
154
|
-
//得到任务id
|
|
155
|
-
res = this.$route.query.taskId
|
|
156
|
-
} else if (parma.value == 6) {
|
|
157
|
-
res = this.instId
|
|
158
|
-
}
|
|
159
|
-
vStr = vStr + `&${parma.key}=${res}`
|
|
160
163
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
164
|
+
if (this.endSrc.includes('?')) {
|
|
165
|
+
this.endSrc = this.endSrc + vStr
|
|
166
|
+
} else {
|
|
167
|
+
this.endSrc = this.endSrc + vStr.replace('&', '?')
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
getFromData(path) {
|
|
171
|
+
let pathAry = path.split('.')
|
|
172
|
+
let v = this.data
|
|
173
|
+
for (let x = 0; x < pathAry.length; x++) {
|
|
174
|
+
v = v[pathAry[x]]
|
|
175
|
+
}
|
|
176
|
+
return v
|
|
177
|
+
},
|
|
178
|
+
getSubPageData(subPageData) {
|
|
179
|
+
this.subPageData = subPageData
|
|
180
|
+
console.log(subPageData)
|
|
181
|
+
},
|
|
182
|
+
getParentPageDataMsg() {
|
|
183
|
+
const frm = this.getIframeDom()
|
|
184
|
+
frm.contentWindow.postMessage(
|
|
185
|
+
{
|
|
186
|
+
type: 'getParentPageData',
|
|
187
|
+
instId: this.instId,
|
|
188
|
+
data: this.data,
|
|
189
|
+
permission: this.permission,
|
|
190
|
+
},
|
|
191
|
+
'*'
|
|
192
|
+
)
|
|
193
|
+
},
|
|
194
|
+
getIframeDom() {
|
|
195
|
+
const frmControl = document.querySelectorAll(
|
|
196
|
+
`[name='${this.iframeNmae}']`
|
|
197
|
+
)
|
|
198
|
+
if (!frmControl || !frmControl[0]) {
|
|
199
|
+
this.$message.error('当前URL表单加载不正确。')
|
|
200
|
+
return
|
|
201
|
+
}
|
|
202
|
+
return frmControl[0]
|
|
203
|
+
},
|
|
204
|
+
//流程系统获取业务系统的表单数据
|
|
205
|
+
getSubPageData() {},
|
|
201
206
|
},
|
|
202
|
-
|
|
203
|
-
getSubPageData() {},
|
|
204
|
-
},
|
|
205
|
-
}
|
|
207
|
+
}
|
|
206
208
|
</script>
|
|
207
|
-
<style lang="scss" scoped>
|
|
208
|
-
</style>
|
|
209
|
+
<style lang="scss" scoped></style>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
:src="src"
|
|
5
5
|
:style="imgStyle"
|
|
6
6
|
@click="imgClick"
|
|
7
|
+
class="ht-image"
|
|
7
8
|
/>
|
|
8
9
|
</template>
|
|
9
10
|
<script>
|
|
@@ -45,15 +46,17 @@
|
|
|
45
46
|
if (this.fileJson && this.$requestConfig.download) {
|
|
46
47
|
var json = JSON.parse(this.fileJson)
|
|
47
48
|
// 全局附件下载方法
|
|
48
|
-
this.$requestConfig
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
this.$requestConfig
|
|
50
|
+
.download(json[0].id)
|
|
51
|
+
.then((response) => {
|
|
52
|
+
const data =
|
|
53
|
+
response instanceof ArrayBuffer ? response : response.data
|
|
54
|
+
this.src = createObjectURL(new Blob([data]))
|
|
55
|
+
})
|
|
56
|
+
.catch((err) => {
|
|
57
|
+
//表单预览,下载图片等文件失败时,提示语
|
|
58
|
+
this.$message.error(`文件下载失败,请重新上传`)
|
|
59
|
+
})
|
|
57
60
|
}
|
|
58
61
|
} else {
|
|
59
62
|
this.src = this.imgSrc
|