three-trees-ui 1.0.13 → 1.0.14
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 +464 -1036
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +464 -1036
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/CustomDialog/src/customDialog.vue +165 -475
- package/packages/CustomDialog/src/customMobileDialog.vue +155 -453
- package/packages/CustomDialog/src/main.vue +8 -150
- package/packages/DimensionSelector/src/main.vue +0 -2
- package/packages/Tree/src/main.vue +2 -7
|
@@ -25,15 +25,10 @@
|
|
|
25
25
|
<span
|
|
26
26
|
v-for="(item, index) in inputVal"
|
|
27
27
|
:key="item.value"
|
|
28
|
-
class="el-tag el-tag--info el-tag--small
|
|
29
|
-
@click
|
|
28
|
+
class="el-tag el-tag--info el-tag--small"
|
|
29
|
+
@click="showEditInput"
|
|
30
30
|
>
|
|
31
|
-
<span
|
|
32
|
-
class="el-select__tags-text"
|
|
33
|
-
:class="{ 'src-color': isSrcColor }"
|
|
34
|
-
>
|
|
35
|
-
{{ item.value }}
|
|
36
|
-
</span>
|
|
31
|
+
<span class="el-select__tags-text">{{ item.value }}</span>
|
|
37
32
|
<i
|
|
38
33
|
class="el-tag__close el-icon-close"
|
|
39
34
|
@click.stop="removeSelectOrg(index)"
|
|
@@ -97,17 +92,15 @@
|
|
|
97
92
|
</div>
|
|
98
93
|
</div>
|
|
99
94
|
</el-tooltip>
|
|
100
|
-
<span v-if="!inputWriteable"
|
|
95
|
+
<span v-if="!inputWriteable">
|
|
101
96
|
<span
|
|
102
97
|
v-for="item in inputVal"
|
|
103
98
|
:key="item.value"
|
|
104
|
-
class="el-tag el-tag--info el-tag--small
|
|
99
|
+
class="el-tag el-tag--info el-tag--small"
|
|
105
100
|
style="margin-right: 8px"
|
|
106
|
-
@click.stop
|
|
101
|
+
@click.stop
|
|
107
102
|
>
|
|
108
|
-
<span class="el-select__tags-text"
|
|
109
|
-
{{ item.value }}
|
|
110
|
-
</span>
|
|
103
|
+
<span class="el-select__tags-text">{{ item.value }}</span>
|
|
111
104
|
</span>
|
|
112
105
|
</span>
|
|
113
106
|
<custom-mobile-dialog
|
|
@@ -119,8 +112,6 @@
|
|
|
119
112
|
:sun-index="sunIndex"
|
|
120
113
|
:sub-path="subPath"
|
|
121
114
|
:current-sub-data="currentSubData"
|
|
122
|
-
:dialog-config="dialogConfig"
|
|
123
|
-
:dialog-type="dialogType"
|
|
124
115
|
@calacInputSuffixHeight="calacInputSuffixHeight"
|
|
125
116
|
@updateInput="updateInput"
|
|
126
117
|
></custom-mobile-dialog>
|
|
@@ -135,8 +126,6 @@
|
|
|
135
126
|
:sub-path="subPath"
|
|
136
127
|
:current-sub-data="currentSubData"
|
|
137
128
|
:is-read-only="!inputWriteable"
|
|
138
|
-
:dialog-config="dialogConfig"
|
|
139
|
-
:dialog-type="dialogType"
|
|
140
129
|
@calacInputSuffixHeight="calacInputSuffixHeight"
|
|
141
130
|
@updateInput="updateInput"
|
|
142
131
|
></custom-dialog>
|
|
@@ -174,15 +163,9 @@
|
|
|
174
163
|
sunIndex: Number,
|
|
175
164
|
subPath: String,
|
|
176
165
|
currentSubData: Array,
|
|
177
|
-
dialogType: {
|
|
178
|
-
// search表示在查询条件使用 form表示在表单中使用
|
|
179
|
-
type: String,
|
|
180
|
-
default: 'form',
|
|
181
|
-
},
|
|
182
166
|
},
|
|
183
167
|
data() {
|
|
184
168
|
return {
|
|
185
|
-
dialogConfig: null, // 对话框配置信息
|
|
186
169
|
isEditInputShow: false,
|
|
187
170
|
customValue: '',
|
|
188
171
|
defualtTooltipplacement: 'bottom',
|
|
@@ -222,25 +205,7 @@
|
|
|
222
205
|
}
|
|
223
206
|
let result = []
|
|
224
207
|
nameAry.forEach((m) => {
|
|
225
|
-
|
|
226
|
-
// 上横向保存数据库后 有可能被改变此处兼容写了一种上横线
|
|
227
|
-
let n = {}
|
|
228
|
-
if (
|
|
229
|
-
(m.includes('¯') && m.split('¯')[1]) ||
|
|
230
|
-
(m.includes('ˉ') && m.split('ˉ')[1])
|
|
231
|
-
) {
|
|
232
|
-
let val1 = m.includes('¯') ? m.split('¯')[0] : m.split('ˉ')[0]
|
|
233
|
-
let val2 = m.includes('¯') ? m.split('¯')[1] : m.split('ˉ')[1]
|
|
234
|
-
n.value = val1
|
|
235
|
-
let jumpParamStr = val2
|
|
236
|
-
if (jumpParamStr) {
|
|
237
|
-
let jumpParam = jumpParamStr.split(':')
|
|
238
|
-
n.jumpParamKey = jumpParam[0]
|
|
239
|
-
n.jumpParamValue = jumpParam[1]
|
|
240
|
-
}
|
|
241
|
-
} else {
|
|
242
|
-
n = { value: m }
|
|
243
|
-
}
|
|
208
|
+
let n = { value: m }
|
|
244
209
|
result.push(n)
|
|
245
210
|
})
|
|
246
211
|
return result
|
|
@@ -249,19 +214,6 @@
|
|
|
249
214
|
isAllowCustom() {
|
|
250
215
|
return this.custdialog && this.custdialog.allowInput
|
|
251
216
|
},
|
|
252
|
-
// 是否展示可跳转颜色
|
|
253
|
-
isSrcColor() {
|
|
254
|
-
return (
|
|
255
|
-
this.dialogConfig &&
|
|
256
|
-
this.dialogType !== 'search' &&
|
|
257
|
-
((this.isMobile && this.dialogConfig.mobileUrl) ||
|
|
258
|
-
(!this.isMobile && this.dialogConfig.pcUrl))
|
|
259
|
-
)
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
created() {
|
|
263
|
-
// 获取对话框配置,看是否有配置url跳转
|
|
264
|
-
this.getDialogConfig()
|
|
265
217
|
},
|
|
266
218
|
mounted() {
|
|
267
219
|
setTimeout(() => {
|
|
@@ -285,81 +237,9 @@
|
|
|
285
237
|
}
|
|
286
238
|
//获取对话框按钮名称宽度
|
|
287
239
|
this.calacInputSuffixWidth()
|
|
288
|
-
if (this.value && this.inputWriteable) {
|
|
289
|
-
this.calacInputSuffixHeight()
|
|
290
|
-
}
|
|
291
240
|
}, 50)
|
|
292
241
|
},
|
|
293
242
|
methods: {
|
|
294
|
-
// 跳转url页面
|
|
295
|
-
jumpUrl(item) {
|
|
296
|
-
if (!this.isSrcColor) {
|
|
297
|
-
if (this.inputWriteable) {
|
|
298
|
-
this.showEditInput()
|
|
299
|
-
}
|
|
300
|
-
return
|
|
301
|
-
}
|
|
302
|
-
let url = this.isMobile
|
|
303
|
-
? this.dialogConfig.mobileUrl
|
|
304
|
-
: this.dialogConfig.pcUrl
|
|
305
|
-
// 获取通用token 和 url翻译
|
|
306
|
-
Promise.all([
|
|
307
|
-
this.$requestConfig.getThreeTreeToken(),
|
|
308
|
-
this.transformUrl(url),
|
|
309
|
-
]).then((res) => {
|
|
310
|
-
if (res[0] && res[0].code == 200) {
|
|
311
|
-
let token = res[0].value
|
|
312
|
-
let endUrl = res[1]
|
|
313
|
-
// 拼接参数 token和参数
|
|
314
|
-
if (endUrl.indexOf('?') == -1) {
|
|
315
|
-
endUrl += `?bnsToken=${token}&${item.jumpParamKey}=${item.jumpParamValue}`
|
|
316
|
-
} else {
|
|
317
|
-
endUrl += `&bnsToken=${token}&${item.jumpParamKey}=${item.jumpParamValue}`
|
|
318
|
-
}
|
|
319
|
-
window.open(endUrl)
|
|
320
|
-
} else {
|
|
321
|
-
this.$message.info(res.message || '获取token失败!')
|
|
322
|
-
}
|
|
323
|
-
})
|
|
324
|
-
},
|
|
325
|
-
// 替换url中域名通配符 需要发送接口
|
|
326
|
-
transformUrl(url) {
|
|
327
|
-
return new Promise((resolve) => {
|
|
328
|
-
var reg = /(\$\{(\w+)\})/
|
|
329
|
-
var match = reg.exec(url)
|
|
330
|
-
if (match) {
|
|
331
|
-
let alias = match[2]
|
|
332
|
-
if (alias) {
|
|
333
|
-
this.$requestConfig.getHostByAlias(alias).then((res) => {
|
|
334
|
-
if (res && res.value && res.value.rootAddress) {
|
|
335
|
-
resolve(url.replace(match[1], res.value.rootAddress))
|
|
336
|
-
} else {
|
|
337
|
-
resolve(url)
|
|
338
|
-
}
|
|
339
|
-
})
|
|
340
|
-
} else {
|
|
341
|
-
resolve(url)
|
|
342
|
-
}
|
|
343
|
-
} else {
|
|
344
|
-
resolve(url)
|
|
345
|
-
}
|
|
346
|
-
})
|
|
347
|
-
},
|
|
348
|
-
// 获取对话框配置
|
|
349
|
-
getDialogConfig() {
|
|
350
|
-
if (
|
|
351
|
-
this.custdialog &&
|
|
352
|
-
this.custdialog.custDialog &&
|
|
353
|
-
this.custdialog.custDialog.alias
|
|
354
|
-
)
|
|
355
|
-
this.$requestConfig
|
|
356
|
-
.getCustomDialogByAlias(this.custdialog.custDialog.alias)
|
|
357
|
-
.then((response) => {
|
|
358
|
-
if (response) {
|
|
359
|
-
this.dialogConfig = response
|
|
360
|
-
}
|
|
361
|
-
})
|
|
362
|
-
},
|
|
363
243
|
editInputBlur() {
|
|
364
244
|
this.$emit('input', this.customValue)
|
|
365
245
|
this.isEditInputShow = false
|
|
@@ -609,26 +489,4 @@
|
|
|
609
489
|
display: block;
|
|
610
490
|
margin: 8px 0;
|
|
611
491
|
}
|
|
612
|
-
.src-color {
|
|
613
|
-
cursor: pointer;
|
|
614
|
-
color: #409eff !important;
|
|
615
|
-
}
|
|
616
|
-
.el-tag.el-tag--info.no-background {
|
|
617
|
-
background: none;
|
|
618
|
-
border: none;
|
|
619
|
-
}
|
|
620
|
-
.dialog-readonly {
|
|
621
|
-
& > .el-tag {
|
|
622
|
-
&::after {
|
|
623
|
-
display: inline;
|
|
624
|
-
content: ',';
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
& > .el-tag:last-child {
|
|
628
|
-
&::after {
|
|
629
|
-
display: none;
|
|
630
|
-
content: '';
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
492
|
</style>
|
|
@@ -267,18 +267,13 @@
|
|
|
267
267
|
return (
|
|
268
268
|
this.data &&
|
|
269
269
|
this.data.length < 1 &&
|
|
270
|
-
this.treeData &&
|
|
271
|
-
this.treeData.length < 1
|
|
270
|
+
this.treeData && this.treeData.length < 1
|
|
272
271
|
)
|
|
273
272
|
},
|
|
274
273
|
},
|
|
275
274
|
watch: {
|
|
276
275
|
filterText(val) {
|
|
277
|
-
|
|
278
|
-
this.$emit('loadALL', val)
|
|
279
|
-
} else {
|
|
280
|
-
this.$refs.elTree.filter(val)
|
|
281
|
-
}
|
|
276
|
+
this.$refs.elTree.filter(val)
|
|
282
277
|
},
|
|
283
278
|
defaultCheckedKeys(val) {
|
|
284
279
|
this.$refs.elTree.setCheckedKeys(val)
|