mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-19 17:35:53 +08:00
- 将iView组件统一替换为TDesign组件 - 优化表单、表格、弹窗等交互样式 - 修复路由重复添加问题 - 更新依赖版本 - 调整布局间距与响应式 - 修复表单重置方法兼容性 - 统一消息提示组件
71 lines
1.7 KiB
Vue
71 lines
1.7 KiB
Vue
<template>
|
|
<t-card>
|
|
<t-form ref="form" :data="form" :rules="formRule" :labelWidth="120" style="padding: 10px;">
|
|
<t-divider align="left">分销设置</t-divider>
|
|
<t-form-item label="是否开启分销" name="isOpen">
|
|
<t-switch v-model="form.isOpen" />
|
|
</t-form-item>
|
|
<t-form-item label="分销关系绑定天数" name="distributionDay">
|
|
<t-input-number :min="1" :max="365" style="width:100px;" v-model="form.distributionDay" />
|
|
</t-form-item>
|
|
<t-form-item>
|
|
<t-button theme="primary" @click="submit">保存</t-button>
|
|
</t-form-item>
|
|
</t-form>
|
|
</t-card>
|
|
</template>
|
|
|
|
<script>
|
|
import { setSetting, getSetting } from "@/api/index";
|
|
import { MessagePlugin } from "tdesign-vue";
|
|
import { regular } from "@/utils";
|
|
export default {
|
|
name: "distributionSetting",
|
|
data() {
|
|
return {
|
|
form: {
|
|
// 添加或编辑表单对象初始化数据
|
|
isOpen: true,
|
|
distributionDay: 0, //分销关系绑定天数
|
|
},
|
|
formRule: {
|
|
isOpen: [
|
|
regular.REQUIRED
|
|
],
|
|
distributionDay: [
|
|
regular.REQUIRED
|
|
],
|
|
}
|
|
};
|
|
},
|
|
methods: {
|
|
// 初始化数据
|
|
init() {
|
|
this.getDataList();
|
|
},
|
|
// 获取分销设置数据
|
|
getDataList() {
|
|
getSetting("DISTRIBUTION_SETTING").then((res) => {
|
|
if (res.success) {
|
|
this.form = res.result;
|
|
}
|
|
});
|
|
},
|
|
// 提交api
|
|
submit() {
|
|
setSetting("DISTRIBUTION_SETTING", this.form).then((res) => {
|
|
if (res.success) {
|
|
MessagePlugin.success("操作成功");
|
|
this.getDataList();
|
|
}
|
|
});
|
|
},
|
|
},
|
|
mounted() {
|
|
this.init();
|
|
},
|
|
};
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
</style>
|