定制 spinon/uccello-archive 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spinon/uccello-archive

Composer 安装命令:

composer require spinon/uccello-archive

包简介

Archivage d'objets

README 文档

README

Installation

composer require spinon/uccello-archive
php artisan vendor:publish --provider="Spinon\\UccelloArchive\\Providers\\AppServiceProvider"

Once installation is done, you need to alter your models tables through migrations to add the 'archived_at' field :

$table->dateTime('archived_at')->nullable();

Note : if you want to use a different field name, you'll need to override the $ARCHIVED_AT variable in the model using the ArchiveTrait :

public static $ARCHIVED_AT = 'custom_fiedname';

Then you need to create a new listing view to override Uccello's. Put the code below into resources/views/uccello/modules/default/list/main.blade.php :

@extends('uccello::modules.default.list.main')

@section('script')
    {!! Html::script(mix('js/autoloader.js', 'vendor/spinon/uccello-archive')) !!}
@endsection

<?php $is_archivable = (method_exists($module->model_class, "isArchivable") && ($module->model_class)::isArchivable() === true); ?>

{{-- Row template used by the query --}}
@section('datatable-row-template')
<tr class="template hide" data-row-url="{{ ucroute('uccello.detail', $domain, $module, ['id' => 'RECORD_ID']) }}">
    <td class="select-column hide-on-small-only">&nbsp;</td>

    @foreach ($datatableColumns as $column)
    <td data-field="{{ $column['name'] }}">&nbsp;</td>
    @endforeach

    <td class="actions-column hide-on-small-only hide-on-med-only right-align">
        {{-- Listing view override --}}
        @if (Auth::user()->canUpdate($domain, $module) && $is_archivable)
        <a href="{{ ucroute('uccello.archive', $domain, $module, ['id' => 'RECORD_ID']) }}" data-tooltip="{{ trans('uccello-archive::archive.button.archive') }}" data-unarchive-label="{{ trans('uccello-archive::archive.button.unarchive') }}" data-position="top" class="archive-btn primary-text"><i class="material-icons">archive</i></a>
        @endif

        @if (Auth::user()->canUpdate($domain, $module))
        <a href="{{ ucroute('uccello.edit', $domain, $module, ['id' => 'RECORD_ID']) }}" data-tooltip="{{ uctrans('button.edit', $module) }}" data-position="top" class="edit-btn primary-text"><i class="material-icons">edit</i></a>
        @endif

        @if (Auth::user()->canDelete($domain, $module))
        <a href="{{ ucroute('uccello.delete', $domain, $module, ['id' => 'RECORD_ID']) }}" data-tooltip="{{ uctrans('button.delete', $module) }}" data-position="top" class="delete-btn primary-text" data-config='{"actionType":"link","confirm":true,"dialog":{"title":"{{ uctrans('confirm.button.delete_record', $module) }}"}}'><i class="material-icons">delete</i></a>
        @endif
    </td>
</tr>
@endsection

@section('before-columns-visibility-button')
    @if ($is_archivable)
    <!-- Dropdown Trigger -->
    <a class='dropdown-trigger btn-small primary' href='#' data-target='archive-dropdown' data-constrain-width="false" data-alignment="right">
            <span>{{ trans('uccello-archive::archive.button.display') }}</span>
        <i class="material-icons hide-on-med-and-down right">arrow_drop_down</i>
    </a>

    <!-- Dropdown Structure -->
    <ul id='archive-dropdown' class='dropdown-content' data-table="datatable">
        <li><a href="javascript:void(0);" data-archive-filter="both">{{ trans('uccello-archive::archive.button.all_records') }}</a></li>
        <li class="active"><a href="javascript:void(0);" data-archive-filter="unarchived">{{ trans('uccello-archive::archive.button.unarchived_records') }}</a></li>
        <li><a href="javascript:void(0);" data-archive-filter="archived">{{ trans('uccello-archive::archive.button.archived_records') }}</a></li>
    </ul>
    @endif
@endsection

Finally, to use the ArchiveTrait, you need to add these lines to the corresponding Models :

use Spinon\UccelloArchive\Traits\ArchiveTrait;

class MyModel extends Model
{
  use ArchiveTrait;
  ...
}

spinon/uccello-archive 适用场景与选型建议

spinon/uccello-archive 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 04 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 spinon/uccello-archive 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 spinon/uccello-archive 我们能提供哪些服务?
定制开发 / 二次开发

基于 spinon/uccello-archive 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-18