|
@@ -7,11 +7,11 @@
|
|
|
:visible.sync="isShow"
|
|
|
:title="this.curObj && this.curObj.id ? '编辑规则' : '添加规则'"
|
|
|
:fullscreen="false"
|
|
|
- width="470px"
|
|
|
+ width="800px"
|
|
|
custom-class="xl-dialog"
|
|
|
center
|
|
|
>
|
|
|
- <base-form ref="ruleForm" :data="formData" :is-inline="false" label-width="110px">
|
|
|
+ <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px">
|
|
|
<div slot="footer">
|
|
|
<el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
|
|
|
<el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
|
|
@@ -47,13 +47,28 @@ export default {
|
|
|
methods: {
|
|
|
getDef() {
|
|
|
const params = { ...this.curObj }
|
|
|
- this.formData = [
|
|
|
- { label: '标题', key: 'title', rules: 1 },
|
|
|
- { label: '分类', key: 'type', rules: 1 },
|
|
|
- { label: '奖励积分', key: 'reward_point', class: 'c-2', rules: 1 },
|
|
|
- { label: '奖励次数', key: 'reward_num', class: 'c-2', rules: 1 },
|
|
|
- { label: '奖励周期(天)', key: 'cycle', rules: 1},
|
|
|
- ]
|
|
|
+ if (params.id) {
|
|
|
+ this.formData = [
|
|
|
+ { label: '标题', key: 'title', rules: 1 },
|
|
|
+ { label: '排序', key: 'sort', class: 'c-2', rules: 1 },
|
|
|
+ { label: '奖励积分', key: 'reward_point', class: 'c-2', rules: 1 },
|
|
|
+ { label: '奖励次数', key: 'reward_num', class: 'c-2', rules: 1 },
|
|
|
+ { label: '奖励周期(天)', key: 'cycle', class: 'c-2', rules: 1},
|
|
|
+ { label: '小程序图标', key: 'icon', class: 'c-2', type: 'uploads'},
|
|
|
+ { label: '小程序描述', key: 'remark', class: 'c-2', type: 'textarea'},
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ this.formData = [
|
|
|
+ { label: '标题', key: 'title', class: 'c-2', rules: 1 },
|
|
|
+ { label: '排序', key: 'sort', class: 'c-2', rules: 1 },
|
|
|
+ { label: '分类', key: 'type', class: 'c-2', rules: 1 },
|
|
|
+ { label: '奖励积分', key: 'reward_point', class: 'c-2', rules: 1 },
|
|
|
+ { label: '奖励次数', key: 'reward_num', class: 'c-2', rules: 1 },
|
|
|
+ { label: '奖励周期(天)', key: 'cycle', class: 'c-2', rules: 1},
|
|
|
+ { label: '小程序图标', key: 'icon', class: 'c-2', type: 'uploads'},
|
|
|
+ { label: '小程序描述', key: 'remark', class: 'c-2', type: 'textarea'},
|
|
|
+ ]
|
|
|
+ }
|
|
|
this.setDefaultValue(params)
|
|
|
},
|
|
|
close(str) {
|
|
@@ -82,4 +97,15 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+@import "../../../../styles/libEdit.scss";
|
|
|
+.lib-edit {
|
|
|
+ padding-top: 0;
|
|
|
+ width:100%;
|
|
|
+ ::v-deep .el-form-item {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+ ::v-deep .el-date-editor.el-input {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|