Skip to content

Commit

Permalink
Merge pull request #5 from osindex/develop
Browse files Browse the repository at this point in the history
🎨
  • Loading branch information
SmallRuralDog authored Apr 15, 2020
2 parents 0d8185a + 61bfeee commit b235773
Show file tree
Hide file tree
Showing 28 changed files with 86,506 additions and 182 deletions.
6 changes: 6 additions & 0 deletions docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ $toolbars->addRight(Grid\Tools\ToolButton::make("采集")->dialog(function (Dial

基于element-ui的表单组件实现,基本上所有的组件功能都实现了。使用过程中可查看element-ui的文档,调用的时候`make()->`即可

### IconChoose 图标选择器

```php
IconChoose::make()
```

### Radio 单选框

更多属性请查看element-ui文档
Expand Down
21 changes: 21 additions & 0 deletions docs/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,27 @@ $form->item('username', '用户名')->vif("key","value")
$form->item('username', '用户名')->vif("key.key","value") //支持点操作
```

### 忽略空值(留空则不修改)

> 若此字段的值为 ''/null/undefined 或 空对象/空数组 则在提交的表单对象中删除键名
```php
$form->item('password', '密码')->ignoreEmpty()
```

### 隐藏组件

> 有些字段在编辑或创建状态下并不一致需要,配合ignoreEmpty使用效果更佳
```php
## 创建时不输入密码
$form->item('password', '密码')->hiddenMode('create')
$form->item('password', '密码')->hiddenInCreate()

## 编辑时不输入密码
$form->item('password', '密码')->hiddenMode('edit')
$form->item('password', '密码')->hiddenInEdit()
```


### 帮助信息
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"start": "concurrently -r \"npm:watch*\""
"start":"concurrently -r \"npm:watch*\""
},
"devDependencies": {
"@chenfengyuan/vue-qrcode": "^1.0.2",
Expand Down
11 changes: 2 additions & 9 deletions public/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ __webpack_require__.r(__webpack_exports__);
ItemIf: _ItemIf__WEBPACK_IMPORTED_MODULE_1__["default"]
},
props: {
attrs: Object,
keys: String
attrs: Object
},
data: function data() {
return {
Expand All @@ -125,12 +124,6 @@ __webpack_require__.r(__webpack_exports__);
mounted: function mounted() {
this.formData = this._.cloneDeep(this.attrs.formItemsValue);
},
computed: {
actionUrl: function actionUrl() {
var keys = this.$store.getters.thisPage.grids.selectionKeys;
return this._.replace(this.attrs.action, "selectionKeys", keys);
}
},
methods: {
submitForm: function submitForm(formName) {
var _this = this;
Expand All @@ -139,7 +132,7 @@ __webpack_require__.r(__webpack_exports__);
if (valid) {
_this.loading = true;

_this.$http.post(_this.actionUrl, _this.formData).then(function (_ref) {
_this.$http.post(_this.attrs.action, _this.formData).then(function (_ref) {
var data = _ref.data,
code = _ref.code,
message = _ref.message;
Expand Down
Loading

0 comments on commit b235773

Please sign in to comment.