{"id":16464485,"url":"https://github.com/deatil/dcat-form-media","last_synced_at":"2025-05-12T04:30:35.306Z","repository":{"id":38247249,"uuid":"315696574","full_name":"deatil/dcat-form-media","owner":"deatil","description":"Dcat-admin 表单媒体扩展","archived":false,"fork":false,"pushed_at":"2023-12-28T07:57:20.000Z","size":355,"stargazers_count":67,"open_issues_count":0,"forks_count":16,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T19:51:00.359Z","etag":null,"topics":["dcat-admin","media","video"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deatil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-11-24T16:53:06.000Z","updated_at":"2025-02-06T19:15:50.000Z","dependencies_parsed_at":"2023-12-28T08:47:53.926Z","dependency_job_id":null,"html_url":"https://github.com/deatil/dcat-form-media","commit_stats":{"total_commits":65,"total_committers":1,"mean_commits":65.0,"dds":0.0,"last_synced_commit":"8c1b80d075a52f24af76a7c2acd413753bdfeea6"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fdcat-form-media","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fdcat-form-media/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fdcat-form-media/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fdcat-form-media/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deatil","download_url":"https://codeload.github.com/deatil/dcat-form-media/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253675066,"owners_count":21945891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dcat-admin","media","video"],"created_at":"2024-10-11T11:27:59.752Z","updated_at":"2025-05-12T04:30:34.836Z","avatar_url":"https://github.com/deatil.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dcat-admin 表单媒体拓展\n\n\n## 预览\n\n### 表单\n![form](https://user-images.githubusercontent.com/24578855/105875109-5aa30400-6038-11eb-9b5c-1c833e0c6b92.jpg)\n\n### 动态表单\n![form-array](https://user-images.githubusercontent.com/24578855/145700810-e648aa6e-4753-42a4-9fef-d5f397536ba3.jpg)\n\n### 弹出选择框\n![form-modal](https://user-images.githubusercontent.com/24578855/104125985-1277b680-5395-11eb-835b-c20e7c7585f9.jpg)\n\n\n## 环境\n - PHP \u003e= 7.2.5\n - Dcat-admin ^2.0\n\n\n## 安装\n\n### composer 安装\n\n```\ncomposer require lake/form-media\n```\n\n### 安装扩展\n\n在 `开发工具-\u003e扩展` 安装本扩展\n\n\n## 使用\n\n#### 单图 数据库结构 varchar\n\n##### 可删除\n\n```\n$form-\u003ephoto('photo','图片')\n    -\u003enametype('datetime')\n    -\u003eremove(true)\n    -\u003ehelp('单图，可删除');\n```\n\n##### 不可删除\n\n```\n$form-\u003ephoto('photo','图片')\n    -\u003epath('pic') \n    -\u003enametype('uniqid') \n    -\u003eremove(false)\n    -\u003ehelp('单图，不可删除');\n\n$form-\u003ephoto('photo','图片')\n    -\u003enametype('uniqid') \n    -\u003ehelp('单图，不可删除');\n```\n\n#### 多图 数据库结构 json\n\n```\n$form-\u003ephotos('photo', '图片')\n    -\u003epath('pic') \n    -\u003epageSize(16)\n    -\u003enametype('uniqid') \n    -\u003elimit(9)\n    -\u003eremove(true);  //可删除\n```\n\n#### 视频 数据库结构 json/varchar\n\n```\n$form-\u003evideo('video','视频')\n    -\u003epath('video') \n    -\u003enametype('uniqid') \n    -\u003eremove(true);  //可删除\n```\n\n### 参数说明\n```\npath(string)         ： 快速定位目录，默认为根目录\nnametype(string)     ： 文件重命名方式 uniqid|datetime|sequence|original，默认 uniqid\naccept(string)       ： 设置 input accept 属性, 自定义，默认类型不设置\npageSize(int)        ： 弹出层列表每页显示数量\nlimit(int)           ： 限制条数\nremove(boolean)      :  是否有删除按钮\nsaveFullUrl(boolean) :  是否保存完整链接\ndisk(string)         :  文件存储的磁盘，具体信息可以查看 `config/filesystems.php`\n\nphoto 、 photos 、 video 的参数默认值不一样\n\nphoto  默认 limit = 1  remove = false\n\nphotos 默认 limit = 9  remove = true\n\nvideo  默认 limit = 1  remove = true\n```\n\n##### 多图上传提交的数据为 json 字符串，如需输出数组，请在对应模型中加入下面代码\n```\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Demo extends Model\n{\n    \n    public function getPicturesAttribute($pictures)\n    {\n\n        return json_decode($pictures, true);\n\n    }\n\n}\n```\n\n\n## 开源协议\n\n*  本扩展遵循 `MIT` 开源协议发布，在保留本扩展版权的情况下提供个人及商业免费使用。 \n\n\n## 版权\n\n*  该系统所属版权归 deatil(https://github.com/deatil) 所有。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fdcat-form-media","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeatil%2Fdcat-form-media","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fdcat-form-media/lists"}