Skip to content

Commit 1d9607a

Browse files
committed
添加表单输入区域宽度设置
1 parent 326a2e1 commit 1d9607a

File tree

8 files changed

+259
-119
lines changed

8 files changed

+259
-119
lines changed

public/app.js

Lines changed: 127 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,23 @@ __webpack_require__.r(__webpack_exports__);
540540
//
541541
//
542542
//
543+
//
544+
//
545+
//
546+
//
547+
//
548+
//
549+
//
550+
//
551+
//
552+
//
553+
//
554+
//
555+
//
556+
//
557+
//
558+
//
559+
//
543560

544561
/* harmony default export */ __webpack_exports__["default"] = ({
545562
components: {
@@ -1362,6 +1379,29 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
13621379
//
13631380
//
13641381
//
1382+
//
1383+
//
1384+
//
1385+
//
1386+
//
1387+
//
1388+
//
1389+
//
1390+
//
1391+
//
1392+
//
1393+
//
1394+
//
1395+
//
1396+
//
1397+
//
1398+
//
1399+
//
1400+
//
1401+
//
1402+
//
1403+
//
1404+
//
13651405

13661406

13671407
/* harmony default export */ __webpack_exports__["default"] = ({
@@ -26893,53 +26933,74 @@ var render = function() {
2689326933
},
2689426934
[
2689526935
[
26896-
item.relationName
26897-
? [
26898-
_c("ItemDiaplsy", {
26899-
attrs: {
26900-
form_item: item,
26901-
form_items: _vm.attrs.formItems,
26902-
form_data: _vm.formData
26903-
},
26904-
model: {
26905-
value:
26906-
_vm.formData[item.relationName][
26907-
item.relationValueKey
26936+
_c(
26937+
"el-row",
26938+
[
26939+
_c(
26940+
"el-col",
26941+
{ attrs: { span: item.inputWidth } },
26942+
[
26943+
item.relationName
26944+
? [
26945+
_c("ItemDiaplsy", {
26946+
attrs: {
26947+
form_item: item,
26948+
form_items: _vm.attrs.formItems,
26949+
form_data: _vm.formData
26950+
},
26951+
model: {
26952+
value:
26953+
_vm.formData[item.relationName][
26954+
item.relationValueKey
26955+
],
26956+
callback: function($$v) {
26957+
_vm.$set(
26958+
_vm.formData[
26959+
item.relationName
26960+
],
26961+
item.relationValueKey,
26962+
$$v
26963+
)
26964+
},
26965+
expression:
26966+
"\n formData[item.relationName][item.relationValueKey]\n "
26967+
}
26968+
})
26969+
]
26970+
: [
26971+
_c("ItemDiaplsy", {
26972+
attrs: {
26973+
form_item: item,
26974+
form_data: _vm.formData
26975+
},
26976+
model: {
26977+
value: _vm.formData[item.prop],
26978+
callback: function($$v) {
26979+
_vm.$set(
26980+
_vm.formData,
26981+
item.prop,
26982+
$$v
26983+
)
26984+
},
26985+
expression: "formData[item.prop]"
26986+
}
26987+
})
2690826988
],
26909-
callback: function($$v) {
26910-
_vm.$set(
26911-
_vm.formData[item.relationName],
26912-
item.relationValueKey,
26913-
$$v
26914-
)
26915-
},
26916-
expression:
26917-
"formData[item.relationName][item.relationValueKey]"
26918-
}
26919-
})
26920-
]
26921-
: [
26922-
_c("ItemDiaplsy", {
26923-
attrs: {
26924-
form_item: item,
26925-
form_data: _vm.formData
26926-
},
26927-
model: {
26928-
value: _vm.formData[item.prop],
26929-
callback: function($$v) {
26930-
_vm.$set(_vm.formData, item.prop, $$v)
26931-
},
26932-
expression: "formData[item.prop]"
26933-
}
26934-
})
26935-
],
26936-
_vm._v(" "),
26937-
item.help
26938-
? _c("div", {
26939-
staticClass: "form-item-help",
26940-
domProps: { innerHTML: _vm._s(item.help) }
26941-
})
26942-
: _vm._e()
26989+
_vm._v(" "),
26990+
item.help
26991+
? _c("div", {
26992+
staticClass: "form-item-help",
26993+
domProps: {
26994+
innerHTML: _vm._s(item.help)
26995+
}
26996+
})
26997+
: _vm._e()
26998+
],
26999+
2
27000+
)
27001+
],
27002+
1
27003+
)
2694327004
]
2694427005
],
2694527006
2
@@ -27849,7 +27910,7 @@ var render = function() {
2784927910
[
2785027911
_c("Actions", {
2785127912
attrs: {
27852-
data: _vm.attrs.actions.data,
27913+
action_list: _vm.attrs.actions.data,
2785327914
scope: node,
2785427915
key_name: _vm.attrs.keyName
2785527916
}
@@ -32789,7 +32850,7 @@ __webpack_require__.r(__webpack_exports__);
3278932850

3279032851

3279132852
axios__WEBPACK_IMPORTED_MODULE_2___default.a.interceptors.request.use(function (config) {
32792-
config.headers['X-Requested-With'] = 'XMLHttpRequest';
32853+
config.headers["X-Requested-With"] = "XMLHttpRequest";
3279332854
return config;
3279432855
}, function (error) {
3279532856
Promise.reject(error);
@@ -32836,12 +32897,25 @@ axios__WEBPACK_IMPORTED_MODULE_2___default.a.interceptors.response.use(function
3283632897
return data;
3283732898
}, function (_ref2) {
3283832899
var response = _ref2.response;
32839-
console.log(response); // 对响应错误做点什么
32900+
console.log(response.status); // 对响应错误做点什么
3284032901

32841-
view_design_src_components_notice__WEBPACK_IMPORTED_MODULE_0__["default"].error({
32842-
title: '请求错误',
32843-
desc: response.data.message
32844-
});
32902+
switch (response.status) {
32903+
case 404:
32904+
view_design_src_components_notice__WEBPACK_IMPORTED_MODULE_0__["default"].error({
32905+
title: "请求页面不存在",
32906+
desc: response.data.message
32907+
});
32908+
32909+
break;
32910+
32911+
default:
32912+
view_design_src_components_notice__WEBPACK_IMPORTED_MODULE_0__["default"].error({
32913+
title: "请求错误",
32914+
desc: response.data.message
32915+
});
32916+
32917+
break;
32918+
}
3284532919

3284632920
return Promise.reject(response);
3284732921
});

public/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"/app.js": "/app.js?id=14188a22b7a480b67b12",
2+
"/app.js": "/app.js?id=6c8d28b670b7528d3aef",
33
"/manifest.js": "/manifest.js?id=d9708e48a6c10ccee4bb",
44
"/vendor.js": "/vendor.js?id=f4679ac178c0e413cb28"
55
}

resources/js/components/form/BaseForm.vue

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,33 @@
3434
:size="item.size"
3535
>
3636
<template>
37-
<template v-if="item.relationName">
38-
<ItemDiaplsy
39-
v-model="formData[item.relationName][item.relationValueKey]"
40-
:form_item="item"
41-
:form_items="attrs.formItems"
42-
:form_data="formData"
43-
/>
44-
</template>
45-
<template v-else>
46-
<ItemDiaplsy v-model="formData[item.prop]" :form_item="item" :form_data="formData" />
47-
</template>
37+
<el-row>
38+
<el-col :span="item.inputWidth">
39+
<template v-if="item.relationName">
40+
<ItemDiaplsy
41+
v-model="
42+
formData[item.relationName][item.relationValueKey]
43+
"
44+
:form_item="item"
45+
:form_items="attrs.formItems"
46+
:form_data="formData"
47+
/>
48+
</template>
49+
<template v-else>
50+
<ItemDiaplsy
51+
v-model="formData[item.prop]"
52+
:form_item="item"
53+
:form_data="formData"
54+
/>
55+
</template>
4856

49-
<div v-if="item.help" class="form-item-help" v-html="item.help"></div>
57+
<div
58+
v-if="item.help"
59+
class="form-item-help"
60+
v-html="item.help"
61+
></div>
62+
</el-col>
63+
</el-row>
5064
</template>
5165
</el-form-item>
5266
</template>
@@ -59,8 +73,11 @@
5973
class="submit-btn"
6074
type="primary"
6175
@click="submitForm('ruleForm')"
62-
>{{ isEdit ? "立即修改" : "立即创建" }}</el-button>
63-
<el-button class="submit-btn" @click="$router.go(-1)">返回</el-button>
76+
>{{ isEdit ? "立即修改" : "立即创建" }}</el-button
77+
>
78+
<el-button class="submit-btn" @click="$router.go(-1)"
79+
>返回</el-button
80+
>
6481
</div>
6582
</div>
6683
</el-form>

resources/js/components/form/ItemDiaplsy.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ export default {
4141
}
4242
}
4343
};
44-
</script>
44+
</script>

resources/js/components/grid/Tree.vue

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,36 @@
1414
@focus="onQuickSearchFocus"
1515
@blur="onQuickSearchBlur"
1616
>
17-
<el-button @click="getData" :loading="loading" slot="append">搜索</el-button>
17+
<el-button @click="getData" :loading="loading" slot="append"
18+
>搜索</el-button
19+
>
1820
</el-input>
1921
</div>
2022
</div>
2123
<div class="grid-top-container-right">
22-
<router-link :to="path + '/create'" v-if="!attrs.attributes.hideCreateButton">
23-
<el-button type="primary" class="mr-10" size="medium" icon="el-icon-plus">新建</el-button>
24+
<router-link
25+
:to="path + '/create'"
26+
v-if="!attrs.attributes.hideCreateButton"
27+
>
28+
<el-button
29+
type="primary"
30+
class="mr-10"
31+
size="medium"
32+
icon="el-icon-plus"
33+
>新建</el-button
34+
>
2435
</router-link>
25-
<el-divider direction="vertical" v-if="!attrs.attributes.hideCreateButton"></el-divider>
36+
<el-divider
37+
direction="vertical"
38+
v-if="!attrs.attributes.hideCreateButton"
39+
></el-divider>
2640
<div class="icon-actions">
27-
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
41+
<el-tooltip
42+
class="item"
43+
effect="dark"
44+
content="刷新"
45+
placement="top"
46+
>
2847
<i class="el-icon-refresh hover" @click="getData"></i>
2948
</el-tooltip>
3049
</div>
@@ -40,9 +59,9 @@
4059
:indent="10"
4160
@node-drop="onNodeDrop"
4261
>
43-
<div class="custom-tree-node" slot-scope="{ data,node}">
62+
<div class="custom-tree-node" slot-scope="{ data, node }">
4463
<div class="custom-tree-node-item">
45-
<template v-for="(column,index) in attrs.columnAttributes">
64+
<template v-for="(column, index) in attrs.columnAttributes">
4665
<TreeColumnDisplay
4766
:key="index"
4867
:data="data"
@@ -53,7 +72,11 @@
5372
</template>
5473
</div>
5574
<div>
56-
<Actions :data="attrs.actions.data" :scope="node" :key_name="attrs.keyName" />
75+
<Actions
76+
:action_list="attrs.actions.data"
77+
:scope="node"
78+
:key_name="attrs.keyName"
79+
/>
5780
</div>
5881
</div>
5982
</el-tree>
@@ -171,4 +194,4 @@ export default {
171194
//padding: 2px 10px;
172195
}
173196
}
174-
</style>
197+
</style>

0 commit comments

Comments
 (0)