leisure-core 0.4.11 → 0.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -0
- package/le-ad/index.js +7 -0
- package/le-ad/src/main.vue +137 -0
- package/le-ad/src/sub.vue +180 -0
- package/le-ad-space/index.js +7 -0
- package/le-ad-space/src/main.vue +134 -0
- package/le-ad-space/src/sub.vue +119 -0
- package/le-coupon/src/main.vue +1 -2
- package/le-image/src/main.vue +6 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -42,6 +42,8 @@ import { LeHelp, LeHelpDetail } from "./le-help/index.js";
|
|
|
42
42
|
import LeDistribution from "./le-distribution/index.js";
|
|
43
43
|
import LeDistributionCategory from "./le-distribution-category/index.js";
|
|
44
44
|
import LeSelectUser from "./le-select-user/index.js";
|
|
45
|
+
import LeAdSpace from "./le-ad-space/index.js";
|
|
46
|
+
import LeAd from "./le-ad/index.js";
|
|
45
47
|
|
|
46
48
|
const components = [
|
|
47
49
|
LeArea,
|
|
@@ -85,6 +87,8 @@ const components = [
|
|
|
85
87
|
LeDistribution,
|
|
86
88
|
LeDistributionCategory,
|
|
87
89
|
LeSelectUser,
|
|
90
|
+
LeAdSpace,
|
|
91
|
+
LeAd,
|
|
88
92
|
];
|
|
89
93
|
|
|
90
94
|
const install = function (Vue) {
|
|
@@ -198,4 +202,6 @@ export default {
|
|
|
198
202
|
LeDistribution,
|
|
199
203
|
LeDistributionCategory,
|
|
200
204
|
LeSelectUser,
|
|
205
|
+
LeAdSpace,
|
|
206
|
+
LeAd,
|
|
201
207
|
};
|
package/le-ad/index.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form :inline="true" :model="searchData">
|
|
4
|
+
<el-form-item label="终端">
|
|
5
|
+
<el-select
|
|
6
|
+
v-model="searchData.dtype"
|
|
7
|
+
placeholder="请选择终端类型"
|
|
8
|
+
clearable
|
|
9
|
+
>
|
|
10
|
+
<el-option label="PC" value="0" key="0"></el-option>
|
|
11
|
+
<el-option label="移动" value="1" key="1"></el-option>
|
|
12
|
+
</el-select>
|
|
13
|
+
</el-form-item>
|
|
14
|
+
<el-form-item>
|
|
15
|
+
<el-button type="primary" @click="searData">查询</el-button>
|
|
16
|
+
<el-button type="primary" @click="addAd()">新增广告</el-button>
|
|
17
|
+
</el-form-item>
|
|
18
|
+
</el-form>
|
|
19
|
+
<el-table :data="tableData" border row-key="id" stripe style="width: 100%">
|
|
20
|
+
<el-table-column prop="dtype" label="终端">
|
|
21
|
+
<template slot-scope="scope">
|
|
22
|
+
<span v-if="scope.row.dtype == 0">PC端</span>
|
|
23
|
+
<span v-if="scope.row.dtype == 1">移动端</span>
|
|
24
|
+
</template>
|
|
25
|
+
</el-table-column>
|
|
26
|
+
<el-table-column prop="title" label="广告标题"> </el-table-column>
|
|
27
|
+
<el-table-column prop="title" label="广告图片" width="100" align="center">
|
|
28
|
+
<template slot-scope="scope">
|
|
29
|
+
<el-image style="width: 50px; height: 50px" :src="scope.row.imgsrc">
|
|
30
|
+
</el-image>
|
|
31
|
+
</template>
|
|
32
|
+
</el-table-column>
|
|
33
|
+
<el-table-column prop="linktype" label="导航类型">
|
|
34
|
+
<template slot-scope="scope">
|
|
35
|
+
<span v-if="scope.row.linktype == 0">不导航</span>
|
|
36
|
+
<span v-if="scope.row.linktype == 1">商城页面</span>
|
|
37
|
+
<span v-if="scope.row.linktype == 2">商品页面</span>
|
|
38
|
+
<span v-if="scope.row.linktype == 3">自定义链接</span>
|
|
39
|
+
</template>
|
|
40
|
+
</el-table-column>
|
|
41
|
+
<el-table-column prop="link_address" label="导航地址"> </el-table-column>
|
|
42
|
+
<el-table-column prop="note" label="备注"> </el-table-column>
|
|
43
|
+
<el-table-column fixed="right" label="操作" align="center" row>
|
|
44
|
+
<template slot-scope="scope">
|
|
45
|
+
<le-button
|
|
46
|
+
id="btnEdit"
|
|
47
|
+
text="编辑"
|
|
48
|
+
@click="openEditWindow(scope.row)"
|
|
49
|
+
></le-button>
|
|
50
|
+
<le-button-msg @click="del(scope.row)"></le-button-msg>
|
|
51
|
+
</template>
|
|
52
|
+
</el-table-column>
|
|
53
|
+
</el-table>
|
|
54
|
+
<div style="text-align: center; margin-top: 30px">
|
|
55
|
+
<el-pagination
|
|
56
|
+
background
|
|
57
|
+
layout="prev, pager, next"
|
|
58
|
+
:total="searchData.total"
|
|
59
|
+
:page-size="10"
|
|
60
|
+
@current-change="current_change"
|
|
61
|
+
></el-pagination>
|
|
62
|
+
</div>
|
|
63
|
+
<le-dialog-container
|
|
64
|
+
:showDialog="showDialog"
|
|
65
|
+
@close="closeDialog"
|
|
66
|
+
title="广告详情"
|
|
67
|
+
>
|
|
68
|
+
<le-ad-sub
|
|
69
|
+
@close="closeDialog"
|
|
70
|
+
@rowRefresh="list"
|
|
71
|
+
:rowitem="currentRow"
|
|
72
|
+
></le-ad-sub>
|
|
73
|
+
</le-dialog-container>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
<script>
|
|
77
|
+
import { list, del } from "@/api/system-ad";
|
|
78
|
+
import LeAdSub from "./sub.vue";
|
|
79
|
+
export default {
|
|
80
|
+
name: "le-ad",
|
|
81
|
+
components: {
|
|
82
|
+
LeAdSub,
|
|
83
|
+
},
|
|
84
|
+
data() {
|
|
85
|
+
return {
|
|
86
|
+
searchData: {
|
|
87
|
+
pageNo: 1,
|
|
88
|
+
total: 1,
|
|
89
|
+
dtype: null,
|
|
90
|
+
},
|
|
91
|
+
tableData: [],
|
|
92
|
+
showDialog: false,
|
|
93
|
+
currentRow: {},
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
mounted() {
|
|
97
|
+
this.list();
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
list() {
|
|
101
|
+
let params = JSON.parse(JSON.stringify(this.searchData));
|
|
102
|
+
list(params).then((res) => {
|
|
103
|
+
let data = res.data.data;
|
|
104
|
+
if (data) this.tableData = data.list;
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
del(id) {
|
|
108
|
+
let param = {};
|
|
109
|
+
param.id = id;
|
|
110
|
+
del(id).then((response) => {
|
|
111
|
+
this.list();
|
|
112
|
+
this.$message.success(response.data.info);
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
searData() {
|
|
116
|
+
this.searchData.pageNo = 1;
|
|
117
|
+
this.list();
|
|
118
|
+
},
|
|
119
|
+
current_change(currentPage) {
|
|
120
|
+
this.searchData.pageNo = currentPage;
|
|
121
|
+
this.list();
|
|
122
|
+
},
|
|
123
|
+
addAd() {
|
|
124
|
+
this.currentRow = null;
|
|
125
|
+
this.showDialog = true;
|
|
126
|
+
},
|
|
127
|
+
openEditWindow(item) {
|
|
128
|
+
this.currentRow = item;
|
|
129
|
+
this.showDialog = true;
|
|
130
|
+
},
|
|
131
|
+
closeDialog() {
|
|
132
|
+
this.currentRow = null;
|
|
133
|
+
this.showDialog = false;
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
</script>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
3
|
+
<el-form-item label="广告标题" prop="title">
|
|
4
|
+
<el-input v-model="form.title"></el-input>
|
|
5
|
+
</el-form-item>
|
|
6
|
+
<el-form-item label="终端类型" prop="dtype">
|
|
7
|
+
<el-select
|
|
8
|
+
v-model="form.dtype"
|
|
9
|
+
placeholder="请选择终端类型"
|
|
10
|
+
clearable
|
|
11
|
+
@change="changeDType"
|
|
12
|
+
>
|
|
13
|
+
<el-option label="PC" :value="0" :key="0"></el-option>
|
|
14
|
+
<el-option label="移动" :value="1" :key="1"></el-option>
|
|
15
|
+
</el-select>
|
|
16
|
+
</el-form-item>
|
|
17
|
+
<el-form-item label="广告位" prop="sid">
|
|
18
|
+
<el-select v-model="form.sid" placeholder="请选择广告位" clearable>
|
|
19
|
+
<el-option
|
|
20
|
+
v-for="option in sidOptions"
|
|
21
|
+
:key="option.id"
|
|
22
|
+
:label="option.title"
|
|
23
|
+
:value="option.id"
|
|
24
|
+
>
|
|
25
|
+
</el-option>
|
|
26
|
+
</el-select>
|
|
27
|
+
</el-form-item>
|
|
28
|
+
<el-form-item label="图片" prop="imgsrc">
|
|
29
|
+
<le-image
|
|
30
|
+
:images="initPrimaryImages"
|
|
31
|
+
:limit="1"
|
|
32
|
+
@getImages="getPrimaryImages"
|
|
33
|
+
></le-image>
|
|
34
|
+
</el-form-item>
|
|
35
|
+
<el-form-item label="链接类型" prop="linktype">
|
|
36
|
+
<el-select v-model="form.linktype" placeholder="请选择链接类型" clearable>
|
|
37
|
+
<el-option label="不导航" :value="0" :key="0"></el-option>
|
|
38
|
+
<el-option label="商城页面" :value="1" :key="1"></el-option>
|
|
39
|
+
<el-option label="商品页面" :value="2" :key="2"></el-option>
|
|
40
|
+
<el-option label="自定义链接" :value="3" :key="3"></el-option>
|
|
41
|
+
</el-select>
|
|
42
|
+
</el-form-item>
|
|
43
|
+
<el-form-item label="链接地址">
|
|
44
|
+
<el-input v-model="form.link_address"></el-input>
|
|
45
|
+
</el-form-item>
|
|
46
|
+
<el-form-item label="排序">
|
|
47
|
+
<el-input v-model="form.seq"></el-input>
|
|
48
|
+
</el-form-item>
|
|
49
|
+
<el-form-item label="备注" prop="note">
|
|
50
|
+
<el-input v-model="form.note"></el-input>
|
|
51
|
+
</el-form-item>
|
|
52
|
+
<el-form-item v-rfooter>
|
|
53
|
+
<el-button type="primary" @click="onSubmit">保存</el-button>
|
|
54
|
+
<el-button @click="close()">取消</el-button>
|
|
55
|
+
</el-form-item>
|
|
56
|
+
</el-form>
|
|
57
|
+
</template>
|
|
58
|
+
<script>
|
|
59
|
+
import { add, edit } from "@/api/system-ad";
|
|
60
|
+
import { options as listOptions } from "@/api/system-ad-space";
|
|
61
|
+
export default {
|
|
62
|
+
name: "le-ad-sub",
|
|
63
|
+
props: {
|
|
64
|
+
rowitem: {},
|
|
65
|
+
},
|
|
66
|
+
data() {
|
|
67
|
+
return {
|
|
68
|
+
form: {
|
|
69
|
+
id: "",
|
|
70
|
+
sid: "",
|
|
71
|
+
dtype: 0,
|
|
72
|
+
title: "",
|
|
73
|
+
imgsrc: "",
|
|
74
|
+
linktype: 0,
|
|
75
|
+
link_address: "",
|
|
76
|
+
seq: 1,
|
|
77
|
+
status: 0,
|
|
78
|
+
note: "",
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
initPrimaryImages: [],
|
|
82
|
+
|
|
83
|
+
sidOptions: [],
|
|
84
|
+
|
|
85
|
+
rules: {
|
|
86
|
+
sid: [{ required: true, message: "广告位置必须选择", trigger: "blur" }],
|
|
87
|
+
dtype: [
|
|
88
|
+
{ required: true, message: "终端类型必须选择", trigger: "blur" },
|
|
89
|
+
],
|
|
90
|
+
title: [
|
|
91
|
+
{ required: true, message: "请输入标题名称", trigger: "blur" },
|
|
92
|
+
{
|
|
93
|
+
min: 1,
|
|
94
|
+
max: 80,
|
|
95
|
+
message: "长度在 1 到 80 个字符",
|
|
96
|
+
trigger: "blur",
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
imgsrc: [
|
|
100
|
+
{ required: true, message: "图片地址必须定义", trigger: "blur" },
|
|
101
|
+
],
|
|
102
|
+
linktype: [
|
|
103
|
+
{ required: true, message: "链接类型必须选择", trigger: "blur" },
|
|
104
|
+
],
|
|
105
|
+
note: [
|
|
106
|
+
{
|
|
107
|
+
max: 200,
|
|
108
|
+
message: "长度在 0 到 200个字符",
|
|
109
|
+
trigger: "blur",
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
watch: {
|
|
116
|
+
rowitem: {
|
|
117
|
+
handler(newValue) {
|
|
118
|
+
if (newValue && newValue.id && newValue.id.length > 0) {
|
|
119
|
+
this.form = newValue;
|
|
120
|
+
if (this.form.imgsrc && this.form.imgsrc.length > 0) {
|
|
121
|
+
this.initPrimaryImages = [];
|
|
122
|
+
this.initPrimaryImages.push(this.form.imgsrc);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
immediate: true,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
mounted() {
|
|
130
|
+
let params = {};
|
|
131
|
+
params.dtype = null;
|
|
132
|
+
this.getSidOptions();
|
|
133
|
+
},
|
|
134
|
+
methods: {
|
|
135
|
+
onSubmit() {
|
|
136
|
+
this.$refs["form"].validate((valid) => {
|
|
137
|
+
if (valid) {
|
|
138
|
+
let params = JSON.parse(JSON.stringify(this.form));
|
|
139
|
+
if (params.id && params.id.length > 0) {
|
|
140
|
+
edit(params).then((res) => {
|
|
141
|
+
this.$message(res.data.info);
|
|
142
|
+
this.$emit("rowRefresh");
|
|
143
|
+
this.close();
|
|
144
|
+
});
|
|
145
|
+
} else {
|
|
146
|
+
add(params).then((response) => {
|
|
147
|
+
this.$emit("rowRefresh");
|
|
148
|
+
this.$message(response.data.info);
|
|
149
|
+
this.close();
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
close() {
|
|
156
|
+
this.$emit("close");
|
|
157
|
+
},
|
|
158
|
+
changeDType(e) {
|
|
159
|
+
let params = {};
|
|
160
|
+
params.dtype = e;
|
|
161
|
+
this.getSidOptions(params);
|
|
162
|
+
},
|
|
163
|
+
getSidOptions(params) {
|
|
164
|
+
listOptions(params).then((res) => {
|
|
165
|
+
let data = res.data.data;
|
|
166
|
+
if (data) {
|
|
167
|
+
this.sidOptions = data;
|
|
168
|
+
} else this.sidOptions = [];
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
getPrimaryImages(images) {
|
|
172
|
+
if (images && images.length > 0) {
|
|
173
|
+
this.form.imgsrc = images[0];
|
|
174
|
+
} else {
|
|
175
|
+
this.form.imgsrc = "";
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
</script>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form :inline="true" :model="searchData">
|
|
4
|
+
<el-form-item label="终端">
|
|
5
|
+
<el-select
|
|
6
|
+
v-model="searchData.dtype"
|
|
7
|
+
placeholder="请选择终端类型"
|
|
8
|
+
clearable
|
|
9
|
+
>
|
|
10
|
+
<el-option label="PC" value="0" key="0"></el-option>
|
|
11
|
+
<el-option label="移动" value="1" key="1"></el-option>
|
|
12
|
+
</el-select>
|
|
13
|
+
</el-form-item>
|
|
14
|
+
<el-form-item>
|
|
15
|
+
<el-button type="primary" @click="searData">查询</el-button>
|
|
16
|
+
<el-button type="primary" @click="addAd()">新增广告位</el-button>
|
|
17
|
+
</el-form-item>
|
|
18
|
+
</el-form>
|
|
19
|
+
<el-table :data="tableData" border row-key="id" stripe style="width: 100%">
|
|
20
|
+
<el-table-column prop="dtype" label="终端">
|
|
21
|
+
<template slot-scope="scope">
|
|
22
|
+
<span v-if="scope.row.dtype == 0">PC端</span>
|
|
23
|
+
<span v-if="scope.row.dtype == 1">移动端</span>
|
|
24
|
+
</template>
|
|
25
|
+
</el-table-column>
|
|
26
|
+
<el-table-column prop="title" label="广告位"> </el-table-column>
|
|
27
|
+
<el-table-column prop="status" label="状态">
|
|
28
|
+
<template slot-scope="scope">
|
|
29
|
+
<span v-if="scope.row.status == 0">未启用</span>
|
|
30
|
+
<span v-if="scope.row.status == 1">已经启用</span>
|
|
31
|
+
</template>
|
|
32
|
+
</el-table-column>
|
|
33
|
+
<el-table-column prop="note" label="备注"> </el-table-column>
|
|
34
|
+
<el-table-column
|
|
35
|
+
fixed="right"
|
|
36
|
+
label="操作"
|
|
37
|
+
align="center"
|
|
38
|
+
width="160"
|
|
39
|
+
row
|
|
40
|
+
>
|
|
41
|
+
<template slot-scope="scope">
|
|
42
|
+
<le-button
|
|
43
|
+
id="btnEdit"
|
|
44
|
+
text="编辑"
|
|
45
|
+
@click="openEditWindow(scope.row)"
|
|
46
|
+
></le-button>
|
|
47
|
+
<le-button-msg @click="del(scope.row)"></le-button-msg>
|
|
48
|
+
</template>
|
|
49
|
+
</el-table-column>
|
|
50
|
+
</el-table>
|
|
51
|
+
<div style="text-align: center; margin-top: 30px">
|
|
52
|
+
<el-pagination
|
|
53
|
+
background
|
|
54
|
+
layout="prev, pager, next"
|
|
55
|
+
:total="searchData.total"
|
|
56
|
+
:page-size="10"
|
|
57
|
+
@current-change="current_change"
|
|
58
|
+
></el-pagination>
|
|
59
|
+
</div>
|
|
60
|
+
<le-dialog-container
|
|
61
|
+
:showDialog="showDialog"
|
|
62
|
+
@close="closeDialog"
|
|
63
|
+
title="广告位详情"
|
|
64
|
+
>
|
|
65
|
+
<le-ad-space-sub
|
|
66
|
+
@close="closeDialog"
|
|
67
|
+
@rowRefresh="list"
|
|
68
|
+
:rowitem="currentRow"
|
|
69
|
+
></le-ad-space-sub>
|
|
70
|
+
</le-dialog-container>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
<script>
|
|
74
|
+
import { list, del } from "@/api/system-ad-space";
|
|
75
|
+
import LeAdSpaceSub from "./sub.vue";
|
|
76
|
+
export default {
|
|
77
|
+
name: "le-ad-space",
|
|
78
|
+
components: {
|
|
79
|
+
LeAdSpaceSub,
|
|
80
|
+
},
|
|
81
|
+
data() {
|
|
82
|
+
return {
|
|
83
|
+
searchData: {
|
|
84
|
+
pageNo: 1,
|
|
85
|
+
total: 1,
|
|
86
|
+
dtype: null,
|
|
87
|
+
},
|
|
88
|
+
tableData: [],
|
|
89
|
+
showDialog: false,
|
|
90
|
+
currentRow: {},
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
computed: {},
|
|
94
|
+
mounted() {
|
|
95
|
+
this.list();
|
|
96
|
+
},
|
|
97
|
+
methods: {
|
|
98
|
+
list() {
|
|
99
|
+
let params = JSON.parse(JSON.stringify(this.searchData));
|
|
100
|
+
list(params).then((res) => {
|
|
101
|
+
let data = res.data.data;
|
|
102
|
+
if (data) {
|
|
103
|
+
this.tableData = data.list;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
del(id) {
|
|
108
|
+
del(id).then((response) => {
|
|
109
|
+
this.list();
|
|
110
|
+
this.$message.success(response.data.info);
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
searData() {
|
|
114
|
+
this.searchData.pageNo = 1;
|
|
115
|
+
this.list();
|
|
116
|
+
},
|
|
117
|
+
current_change(currentPage) {
|
|
118
|
+
this.searchData.pageNo = currentPage;
|
|
119
|
+
this.list();
|
|
120
|
+
},
|
|
121
|
+
addAd() {
|
|
122
|
+
this.currentRow = null;
|
|
123
|
+
this.showDialog = true;
|
|
124
|
+
},
|
|
125
|
+
openEditWindow(item) {
|
|
126
|
+
this.currentRow = item;
|
|
127
|
+
this.showDialog = true;
|
|
128
|
+
},
|
|
129
|
+
closeDialog() {
|
|
130
|
+
this.showDialog = false;
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
</script>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
3
|
+
<el-form-item label="广告位" prop="title">
|
|
4
|
+
<el-input v-model="form.title"></el-input>
|
|
5
|
+
</el-form-item>
|
|
6
|
+
<el-form-item label="位置编码" prop="code">
|
|
7
|
+
<el-input v-model="form.code"></el-input>
|
|
8
|
+
</el-form-item>
|
|
9
|
+
<el-form-item label="终端类型" prop="dtype">
|
|
10
|
+
<el-select v-model="form.dtype" placeholder="请选择终端类型" clearable>
|
|
11
|
+
<el-option label="PC" :value="0" :key="0"></el-option>
|
|
12
|
+
<el-option label="移动" :value="1" :key="1"></el-option>
|
|
13
|
+
</el-select>
|
|
14
|
+
</el-form-item>
|
|
15
|
+
<el-form-item label="图片长度" prop="img_length">
|
|
16
|
+
<el-input v-model="form.img_length" clearable>
|
|
17
|
+
<template slot="append">像素(PX)</template>
|
|
18
|
+
</el-input>
|
|
19
|
+
</el-form-item>
|
|
20
|
+
<el-form-item label="图片宽度" prop="img_width">
|
|
21
|
+
<el-input v-model="form.img_width" clearable>
|
|
22
|
+
<template slot="append">像素(PX)</template></el-input
|
|
23
|
+
>
|
|
24
|
+
</el-form-item>
|
|
25
|
+
<el-form-item label="是否启用">
|
|
26
|
+
<el-radio-group v-model="form.status">
|
|
27
|
+
<el-radio-button :label="0">不启用</el-radio-button>
|
|
28
|
+
<el-radio-button :label="1">启用</el-radio-button>
|
|
29
|
+
</el-radio-group>
|
|
30
|
+
</el-form-item>
|
|
31
|
+
<el-form-item label="备注" prop="note">
|
|
32
|
+
<el-input v-model="form.note"></el-input>
|
|
33
|
+
</el-form-item>
|
|
34
|
+
<el-form-item v-rfooter>
|
|
35
|
+
<el-button type="primary" @click="onSubmit">保存</el-button>
|
|
36
|
+
<el-button @click="close()">取消</el-button>
|
|
37
|
+
</el-form-item>
|
|
38
|
+
</el-form>
|
|
39
|
+
</template>
|
|
40
|
+
<script>
|
|
41
|
+
import { add, edit } from "@/api/system-ad-space";
|
|
42
|
+
export default {
|
|
43
|
+
name: "le-ad-space-sub",
|
|
44
|
+
props: {
|
|
45
|
+
rowitem: {},
|
|
46
|
+
},
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
form: {
|
|
50
|
+
id: "",
|
|
51
|
+
dtype: 1,
|
|
52
|
+
title: "",
|
|
53
|
+
img_length: 300,
|
|
54
|
+
img_width: 300,
|
|
55
|
+
status: 1,
|
|
56
|
+
note: "",
|
|
57
|
+
},
|
|
58
|
+
rules: {
|
|
59
|
+
dtype: [{ required: true, message: "请选择终端", trigger: "blur" }],
|
|
60
|
+
img_length: [
|
|
61
|
+
{ required: true, message: "请选择终端", trigger: "blur" },
|
|
62
|
+
],
|
|
63
|
+
img_width: [{ required: true, message: "请选择终端", trigger: "blur" }],
|
|
64
|
+
title: [
|
|
65
|
+
{ required: true, message: "请输入广告位名称", trigger: "blur" },
|
|
66
|
+
{
|
|
67
|
+
min: 1,
|
|
68
|
+
max: 100,
|
|
69
|
+
message: "长度在 1 到 80 个字符",
|
|
70
|
+
trigger: "blur",
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
note: [
|
|
74
|
+
{
|
|
75
|
+
max: 100,
|
|
76
|
+
message: "长度在 0 到 100个字符",
|
|
77
|
+
trigger: "blur",
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
watch: {
|
|
84
|
+
rowitem: {
|
|
85
|
+
handler(newValue) {
|
|
86
|
+
if (newValue && newValue.id && newValue.id.length > 0)
|
|
87
|
+
this.form = newValue;
|
|
88
|
+
},
|
|
89
|
+
immediate: true,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
mounted() {},
|
|
93
|
+
methods: {
|
|
94
|
+
onSubmit() {
|
|
95
|
+
this.$refs["form"].validate((valid) => {
|
|
96
|
+
if (valid) {
|
|
97
|
+
let param = JSON.parse(JSON.stringify(this.form));
|
|
98
|
+
if (param.id && param.id.length > 0) {
|
|
99
|
+
edit(param).then((res) => {
|
|
100
|
+
this.$message(res.data.info);
|
|
101
|
+
this.$emit("rowRefresh");
|
|
102
|
+
this.close();
|
|
103
|
+
});
|
|
104
|
+
} else {
|
|
105
|
+
add(param).then((response) => {
|
|
106
|
+
this.$message(response.data.info);
|
|
107
|
+
this.$emit("rowRefresh");
|
|
108
|
+
this.close();
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
close() {
|
|
115
|
+
this.$emit("close");
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
</script>
|
package/le-coupon/src/main.vue
CHANGED
package/le-image/src/main.vue
CHANGED