Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-Server
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
李帅
2023-03-22 17:43:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b113dbd36ff4abfd59b8897a4c3c05dd062f386c
b113dbd3
1 parent
420c7c36
1.重构一言表
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
17 deletions
app/Admin/Controllers/VideoTempController.php
app/Jobs/MakeVideo.php
database/migrations/2023_03_22_163425_update_components_table.php
app/Admin/Controllers/VideoTempController.php
View file @
b113dbd
...
...
@@ -115,7 +115,6 @@ class VideoTempController extends AdminController
$form
->
hasMany
(
'components'
,
'组件'
,
function
(
Form\NestedForm
$form
)
{
$form
->
select
(
'name'
,
'组件名称'
)
->
options
([
'one_poem_with_annotate'
=>
'一言带注解组件'
,
'every_poem'
=>
'每日一言组件'
,
'one_poem'
=>
'一言组件'
,
'weather'
=>
'天气组件'
,
'date'
=>
'日期组件'
,
...
...
@@ -123,22 +122,30 @@ class VideoTempController extends AdminController
]);
$form
->
select
(
'position'
,
'组件位置'
)
->
options
(
VideoTemp
::
POSITION_OPTIONS
);
$form
->
switch
(
'fade'
,
'淡入淡出'
)
->
help
(
"开启淡入淡出会使背景色失效"
);
$form
->
number
(
'text_bg_box'
,
'背景厚度'
)
->
default
(
0
)
->
addElementClass
(
'text_bg_box'
)
->
help
(
'设置背景块边缘厚度(用于在背景块边缘用背景色填充一圈),默认为0'
);
$form
->
color
(
'text_bg_color'
,
'背景色'
)
->
default
(
'#5c6bc6'
)
->
addElementClass
(
'text_bg_color'
);
$form
->
selectTable
(
'font_file'
,
'字体'
)
->
title
(
'字体选择'
)
->
from
(
FontTable
::
make
())
->
model
(
Font
::
class
,
'file'
,
'name'
);
$form
->
number
(
'font_size'
,
'字号'
)
->
default
(
12
)
->
min
(
12
);
$form
->
color
(
'text_color'
,
'字体颜色'
)
->
default
(
'#f5f5f5'
)
->
addElementClass
(
'text_color'
);
$form
->
number
(
'opacity'
,
'透明度'
)
->
min
(
0
)
->
max
(
100
)
->
addElementClass
(
'opacity'
)
->
default
(
100
)
->
help
(
'范围为0-100,100表示不透明,0表示完全透明'
);
$form
->
switch
(
'fix_bounds'
,
'避免剪切'
);
$form
->
radio
(
'draw'
,
'文字效果'
)
->
options
([
'fade'
=>
'淡入淡出'
,
'fix'
=>
'固定显示'
])
->
default
(
'fade'
)
->
when
(
'fade'
,
function
(
Form\NestedForm
$form
){
$form
->
selectTable
(
'font_file'
,
'字体'
)
->
title
(
'字体选择'
)
->
from
(
FontTable
::
make
())
->
model
(
Font
::
class
,
'file'
,
'name'
);
$form
->
number
(
'font_size'
,
'字号'
)
->
default
(
12
)
->
min
(
12
);
$form
->
color
(
'text_color'
,
'字体颜色'
)
->
default
(
'#f5f5f5'
)
->
addElementClass
(
'text_color'
);
})
->
when
(
'fix'
,
function
(
Form\NestedForm
$form
){
$form
->
number
(
'text_bg_box'
,
'背景厚度'
)
->
default
(
0
)
->
addElementClass
(
'text_bg_box'
)
->
help
(
'设置背景块边缘厚度(用于在背景块边缘用背景色填充一圈),默认为0'
);
$form
->
color
(
'text_bg_color'
,
'背景色'
)
->
default
(
'#5c6bc6'
)
->
addElementClass
(
'text_bg_color'
);
$form
->
selectTable
(
'font_file'
,
'字体'
)
->
title
(
'字体选择'
)
->
from
(
FontTable
::
make
())
->
model
(
Font
::
class
,
'file'
,
'name'
);
$form
->
number
(
'font_size'
,
'字号'
)
->
default
(
12
)
->
min
(
12
);
$form
->
color
(
'text_color'
,
'字体颜色'
)
->
default
(
'#f5f5f5'
)
->
addElementClass
(
'text_color'
);
$form
->
number
(
'opacity'
,
'透明度'
)
->
min
(
0
)
->
max
(
100
)
->
addElementClass
(
'opacity'
)
->
default
(
100
)
->
help
(
'范围为0-100,100表示不透明,0表示完全透明'
);
});
});
$form
->
hidden
(
'state'
)
->
default
(
1
)
...
...
app/Jobs/MakeVideo.php
View file @
b113dbd
This diff is collapsed. Click to expand it.
database/migrations/2023_03_22_163425_update_components_table.php
0 → 100644
View file @
b113dbd
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
UpdateComponentsTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
dropColumns
(
'components'
,
[
'fix_bounds'
]);
Schema
::
table
(
'components'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'draw'
)
->
after
(
'position'
)
->
comment
(
'文字效果'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'components'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'fix_bounds'
)
->
after
(
'opacity'
)
->
comment
(
'超出避免剪切'
);
});
}
}
Please
register
or
login
to post a comment