mirror of
https://github.com/cjango/dcat-vue.git
synced 2025-12-06 14:20:03 +08:00
新增(覆盖)tags表单组件
This commit is contained in:
@@ -1 +1 @@
|
||||
.file-list-wrap[data-v-91edc86c]{margin-top:2px!important}.custom-upload-dragger[data-v-91edc86c]{max-width:400px}.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;touch-action:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:#3399ffbf;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.3333333333%;left:0;top:33.3333333333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.3333333333%;top:0;width:33.3333333333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:before,.cropper-center:after{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width: 768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width: 992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width: 1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(../images/bg.png)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}.n-modal-container{z-index:99999999!important}.modal-container[data-v-7a8a7584]{display:flex;flex-direction:column}.modal-container .cropper-container[data-v-7a8a7584]{width:480px;height:270px}.modal-container .cropper-container img[data-v-7a8a7584]{max-width:100%;display:block}.modal-container .large[data-v-7a8a7584]{width:960px!important;height:540px!important}.modal-container .cropper-controls[data-v-7a8a7584]{height:50px;display:flex;align-items:center}.modal-container .cropper-controls .controls-first[data-v-7a8a7584]{margin-left:12px}.file-list-wrap[data-v-4ff4f70c]{margin-top:2px!important}.preview[data-v-4ff4f70c]{width:138px;height:138px;border:1px solid #dae1e7;border-radius:10px;background-color:#f1f1f1;display:flex;justify-content:center;align-items:center}.preview img[data-v-4ff4f70c]{max-width:100%;max-height:100%;border-radius:4px;padding:1px}.preview[data-v-4ff4f70c]:hover{border:1px dashed #2dd3c4}.custom-upload-dragger[data-v-4ff4f70c]{width:138px;height:138px;display:flex;justify-content:center;align-items:center;border-radius:10px}.custom-upload-dragger .btn-plus[data-v-4ff4f70c]{font-size:88px;color:#b0b0b0}
|
||||
.file-list-wrap[data-v-91edc86c]{margin-top:2px!important}.custom-upload-dragger[data-v-91edc86c]{max-width:400px}.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;touch-action:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:#3399ffbf;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.3333333333%;left:0;top:33.3333333333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.3333333333%;top:0;width:33.3333333333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:before,.cropper-center:after{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width: 768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width: 992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width: 1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(../images/bg.png)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}.n-modal-container{z-index:99999999!important}.modal-container[data-v-7a8a7584]{display:flex;flex-direction:column}.modal-container .cropper-container[data-v-7a8a7584]{width:480px;height:270px}.modal-container .cropper-container img[data-v-7a8a7584]{max-width:100%;display:block}.modal-container .large[data-v-7a8a7584]{width:960px!important;height:540px!important}.modal-container .cropper-controls[data-v-7a8a7584]{height:50px;display:flex;align-items:center}.modal-container .cropper-controls .controls-first[data-v-7a8a7584]{margin-left:12px}.file-list-wrap[data-v-4ff4f70c]{margin-top:2px!important}.preview[data-v-4ff4f70c]{width:138px;height:138px;border:1px solid #dae1e7;border-radius:10px;background-color:#f1f1f1;display:flex;justify-content:center;align-items:center}.preview img[data-v-4ff4f70c]{max-width:100%;max-height:100%;border-radius:4px;padding:1px}.preview[data-v-4ff4f70c]:hover{border:1px dashed #2dd3c4}.custom-upload-dragger[data-v-4ff4f70c]{width:138px;height:138px;display:flex;justify-content:center;align-items:center;border-radius:10px}.custom-upload-dragger .btn-plus[data-v-4ff4f70c]{font-size:88px;color:#b0b0b0}.add[data-v-31410b3c]{font-size:20px}
|
||||
|
||||
File diff suppressed because one or more lines are too long
17
resources/views/tag.blade.php
Normal file
17
resources/views/tag.blade.php
Normal file
@@ -0,0 +1,17 @@
|
||||
@php($id = $column . random_int(123456, 987654))
|
||||
|
||||
<div class="{{$viewClass['form-group']}}" >
|
||||
|
||||
<label class="{{$viewClass['label']}} control-label pt-0">{!! $label !!}</label>
|
||||
|
||||
<div class="{{$viewClass['field']}}" id="{{ $id }}">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" id="{{$column}}">
|
||||
import app from '/vendor/dcat-admin-extensions/weiwait/dcat-vue/js/index.js';
|
||||
const App = app()
|
||||
|
||||
App.provide('provides', @json($provides, true))
|
||||
App.mount('#{{ $id }}')
|
||||
</script>
|
||||
@@ -10,6 +10,7 @@ use Weiwait\DcatVue\Field\File;
|
||||
use Weiwait\DcatVue\Field\Image;
|
||||
use Weiwait\DcatVue\Field\MultipleFile;
|
||||
use Weiwait\DcatVue\Field\MultipleImage;
|
||||
use Weiwait\DcatVue\Field\Tag;
|
||||
use Weiwait\DcatVue\Field\Vue;
|
||||
use Weiwait\DcatVue\Models\FilesystemConfig;
|
||||
|
||||
@@ -38,6 +39,7 @@ class DcatVueServiceProvider extends ServiceProvider
|
||||
Form::extend('multipleFile', MultipleFile::class);
|
||||
Form::extend('image', Image::class);
|
||||
Form::extend('multipleImage', MultipleImage::class);
|
||||
Form::extend('tags', Tag::class);
|
||||
|
||||
Admin::asset()->css(Admin::asset()->getAlias('@weiwait.dcat-vue')['css']);
|
||||
|
||||
|
||||
77
src/Field/Tag.php
Normal file
77
src/Field/Tag.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace Weiwait\DcatVue\Field;
|
||||
|
||||
use Dcat\Admin\Form\Field;
|
||||
use Dcat\Admin\Support\Helper;
|
||||
|
||||
class Tag extends Field\Tags
|
||||
{
|
||||
protected $view = 'weiwait.dcat-vue::tag';
|
||||
|
||||
public function render()
|
||||
{
|
||||
/****************************** parent ************************************/
|
||||
$value = Helper::array($this->value());
|
||||
|
||||
if ($this->options instanceof \Closure) {
|
||||
$this->options(
|
||||
$this->options->call($this->values(), $value, $this)
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->keyAsValue) {
|
||||
$options = $value + $this->options;
|
||||
} else {
|
||||
$options = array_unique(array_merge($value, (array) $this->options));
|
||||
}
|
||||
|
||||
$this->addVariables([
|
||||
'options' => $options,
|
||||
'keyAsValue' => $this->keyAsValue,
|
||||
]);
|
||||
|
||||
/****************************** end parent ************************************/
|
||||
|
||||
/****************************** field ************************************/
|
||||
|
||||
if (!$this->shouldRender()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$this->setDefaultClass();
|
||||
|
||||
$this->callComposing();
|
||||
|
||||
$this->withScript();
|
||||
|
||||
/****************************** end field ************************************/
|
||||
|
||||
$this->withProvides();
|
||||
|
||||
$this->addVariables([
|
||||
'provides' => $this->variables(),
|
||||
]);
|
||||
|
||||
return view($this->view(), $this->variables());
|
||||
}
|
||||
|
||||
protected function formatAttributes()
|
||||
{
|
||||
return $this->attributes;
|
||||
}
|
||||
|
||||
protected function withProvides()
|
||||
{
|
||||
$this->addVariables([
|
||||
'component' => 'Tag',
|
||||
]);
|
||||
}
|
||||
|
||||
public function max(int $max): self
|
||||
{
|
||||
$this->addVariables(['max' => $max]);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -21,4 +21,7 @@ return [
|
||||
'1.1.4' => [
|
||||
'修复样式完整性'
|
||||
],
|
||||
'1.2.0' => [
|
||||
'新增(覆盖)tags表单组件'
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user