Skip to content

Commit dd1b4d0

Browse files
author
hikki
committed
v4.0
1 parent eac058c commit dd1b4d0

File tree

4 files changed

+33
-21
lines changed

4 files changed

+33
-21
lines changed

resources/assets/component.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@
349349
display: flex;
350350
}
351351
.plane-header .title{
352-
color: rgb(255 0 141);
352+
color: #f39c12;
353353
max-width: 120px;
354354
display: inline-block;
355355
vertical-align: bottom;

resources/assets/component.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ window.ComponentCascadeLine = class {
21212121
let title = '迁移';
21222122
if (aim_node_data.parentNodes.indexOf(node_data.key) !== -1) {
21232123
event = 'exchange';
2124-
title += '.交换';
2124+
title = '迁移.交换';
21252125
} else {
21262126
event = 'migrate';
21272127
}
@@ -2134,9 +2134,9 @@ window.ComponentCascadeLine = class {
21342134
M.insertAdjacentHTML('afterbegin', `<span>${node_data.val}</span><i class="right">${_component.check_circle}</i>`);
21352135
this.PLANE_BODY.insertAdjacentHTML('afterbegin', `<div class="dlp dlp-text dlp-label"><span>${aim_node_data.val}</span></div>`);
21362136
if (event === 'exchange') {
2137-
this.PLANE_BODY.insertAdjacentHTML('beforeend', `<div style="font-size: 20px!important;">⇵</div>`);
2137+
this.PLANE_BODY.insertAdjacentHTML('beforeend', `<div style="font-size: 16px!important;">⇵</div>`);
21382138
} else {
2139-
this.PLANE_BODY.insertAdjacentHTML('beforeend', `<div style="font-size: 18px!important;">↑</div>`);
2139+
this.PLANE_BODY.insertAdjacentHTML('beforeend', `<div style="font-size: 16px!important;">↑</div>`);
21402140
}
21412141
M.addEventListener('click', (() => {
21422142
if (object.submit_block) return;

src/Widget/CascadeLine.php

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@ public function render()
1818
$id = $this->formatName($this->id);
1919
$width = isset($this->attributes['width']) ? $this->attributes['width'] : '100%';
2020
$height = isset($this->attributes['height']) ? $this->attributes['height'] : '230px';
21-
$this->addVariables(['width'=>$width,'height' => $height]);
21+
$this->addVariables(['width' => $width, 'height' => $height]);
2222
$list = json_encode($this->list, JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS);
2323
$xhr = $this->xhr ?? '';
24-
$options = isset($this->attributes['options']) ? json_encode($this->attributes['options']) : json_encode(['movable' => true,'exchange' => true,'insert' => true,'update' => true,'delete' => true]);
24+
25+
$options = json_encode([
26+
'movable' => isset($this->attributes['movable']) ? (bool)$this->attributes['movable'] : true,
27+
'exchange' => isset($this->attributes['exchange']) ? (bool)$this->attributes['exchange'] : true,
28+
'insert' => isset($this->attributes['insert']) ? (bool)$this->attributes['insert'] : true,
29+
'update' => isset($this->attributes['update']) ? (bool)$this->attributes['update'] : true,
30+
'delete' => isset($this->attributes['delete']) ? (bool)$this->attributes['delete'] : true,
31+
'detail' => isset($this->attributes['detail']) ? (bool)$this->attributes['detail'] : true,
32+
]);
2533
$this->script = <<<EOT
2634
new ComponentCascadeLine("{$id}",{$list},'{$xhr}',{$options});
2735
EOT;
@@ -30,10 +38,10 @@ public function render()
3038

3139
/**
3240
* 直接调用ComponentCascadeLine组件
33-
* @param string $name 名称
34-
* @param array $list 数据集 多维
35-
* @param string $xhr ajax接口地址
36-
* @param array $style 组件样式设置 宽:width 高:height
41+
* @param string $name 名称
42+
* @param array $list 数据集 多维
43+
* @param string $xhr ajax接口地址
44+
* @param array $style 组件样式设置 宽:width 高:height
3745
* @param array $options
3846
* options.movable bool 可迁移节点 (迁移该节点与其子集到其他节点下)
3947
* options.exchange bool 可交换节点 (节点与其子节点相互交换)
@@ -43,20 +51,20 @@ public function render()
4351
* options.delete bool 可删除
4452
* @return string
4553
*/
46-
public static function panel($name,array $list,string $xhr,array $style=[],array $options=[])
54+
public static function panel($name, array $list, string $xhr, array $style = [], array $options = [])
4755
{
4856
$list = json_encode($list, JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS);
49-
$style = array_merge(['width'=>'100%','height'=>'230px'],$style);
57+
$style = array_merge(['width' => '100%', 'height' => '230px'], $style);
5058
$style_string = '';
5159
$options = json_encode(array_merge([
52-
'movable' => true,
53-
'exchange' => true,
54-
'detail' => true,
55-
'insert' => true,
56-
'update' => true,
57-
'delete' => true],$options));
58-
foreach ($style as $k=>$s){
59-
$style_string.="$k:$s;";
60+
'movable' => true,
61+
'exchange' => true,
62+
'detail' => true,
63+
'insert' => true,
64+
'update' => true,
65+
'delete' => true], $options));
66+
foreach ($style as $k => $s) {
67+
$style_string .= "$k:$s;";
6068
}
6169

6270
return <<<EOF

src/Widget/Linear.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ public function render()
2929
}
3030
$columns = json_encode($columns);
3131
}
32-
$options = isset($this->attributes['options']) ? json_encode($this->attributes['options']) : json_encode(['sortable' => true, 'delete' => true, 'insert' => true]);
32+
$options = json_encode([
33+
'sortable' => isset($this->attributes['sortable']) ? (bool)$this->attributes['sortable'] : true,
34+
'delete' => isset($this->attributes['delete']) ? (bool)$this->attributes['delete'] : true,
35+
'insert' => isset($this->attributes['insert']) ? (bool)$this->attributes['insert'] : true,
36+
]);
3337
$width = isset($this->attributes['width']) ? $this->attributes['width'] : '100%';
3438
$height = isset($this->attributes['height']) ? $this->attributes['height'] : '355px';
3539
$this->addVariables(['width' => $width, 'height' => $height]);

0 commit comments

Comments
 (0)