mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-02-06 00:55:55 +08:00
commit message
This commit is contained in:
151
manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue
Normal file
151
manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
|
||||
<FormItem label="站点名称" prop="siteName">
|
||||
<Input v-model="formValidate.siteName" />
|
||||
</FormItem>
|
||||
<FormItem label="icp" prop="icp">
|
||||
|
||||
<Input v-model="formValidate.icp" />
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="后台Logo" prop="domainLogo">
|
||||
<div class="label-item-upload">
|
||||
|
||||
<img v-if="formValidate.domainLogo" class="img" :src="formValidate.domainLogo" />
|
||||
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
|
||||
<Button @click="onClickImg('domainLogo')">选择图片</Button>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem label="买家端Logo" prop="buyerSideLogo">
|
||||
<div class="label-item-upload">
|
||||
<img v-if="formValidate.buyerSideLogo" class="img" :src="formValidate.buyerSideLogo" />
|
||||
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
|
||||
<Button @click="onClickImg('buyerSideLogo')">选择图片</Button>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem label="商家端Logo" prop="sellerSideLogo">
|
||||
<div class="label-item-upload">
|
||||
<img v-if="formValidate.sellerSideLogo" class="img" :src="formValidate.sellerSideLogo" />
|
||||
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
|
||||
<Button @click="onClickImg('sellerSideLogo')">选择图片</Button>
|
||||
</div>
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="站点地址" prop="staticPageAddress">
|
||||
<Input v-model="formValidate.staticPageAddress" />
|
||||
</FormItem>
|
||||
<FormItem label="wap站点地址" prop="staticPageWapAddress">
|
||||
<Input v-model="formValidate.staticPageWapAddress" />
|
||||
</FormItem>
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
|
||||
</div>
|
||||
</Form>
|
||||
<Modal width="1200px" v-model="picModelFlag">
|
||||
<ossManage @callback="callbackSelected" ref="ossManage" />
|
||||
</Modal>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "./validate";
|
||||
import ossManage from "@/views/sys/oss-manage/ossManage";
|
||||
export default {
|
||||
title: "基础设置",
|
||||
props: ["res", "type"],
|
||||
components: {
|
||||
ossManage,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
handleSubmit,
|
||||
|
||||
picModelFlag: false,
|
||||
formValidate: {
|
||||
buyerSideLogo: "",
|
||||
domainLogo: "",
|
||||
icp: "",
|
||||
sellerSideLogo: "",
|
||||
siteName: "",
|
||||
staticPageAddress: "",
|
||||
staticPageWapAddress: "",
|
||||
},
|
||||
selected: "",
|
||||
ruleValidate: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
console.log(this.type);
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
// 点击图片
|
||||
onClickImg(item) {
|
||||
this.selected = item;
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
},
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if (handleSubmit(that, name)) {
|
||||
this.setupSetting();
|
||||
}
|
||||
},
|
||||
callbackSelected(val) {
|
||||
this.picModelFlag = false;
|
||||
this.formValidate[this.selected] = val.url;
|
||||
console.log(val);
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**添加必填项 */
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
Object.keys(this.res).forEach((item) => {
|
||||
this.ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写必填项",
|
||||
trigger: "blur",
|
||||
},
|
||||
];
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "./style.scss";
|
||||
.label-item {
|
||||
display: flex;
|
||||
> .ivu-input {
|
||||
width: 200px;
|
||||
margin: 0 10px;
|
||||
}
|
||||
}
|
||||
.label-item-upload {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
img {
|
||||
margin-right: 10px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
151
manager/src/views/sys/setting-manage/setting/GOODS_SETTING.vue
Normal file
151
manager/src/views/sys/setting-manage/setting/GOODS_SETTING.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
<FormItem label="商品审核" prop="goodsCheck">
|
||||
<RadioGroup v-model="formValidate.goodsCheck">
|
||||
<Radio label="true">开启</Radio>
|
||||
<Radio label="false">关闭</Radio>
|
||||
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<div class="label-item">
|
||||
<FormItem label="小图宽" prop="smallPictureWidth">
|
||||
<Input type="number" v-model="formValidate.smallPictureWidth">
|
||||
<span slot="prepend">宽</span>
|
||||
<span slot="append">px</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
<FormItem label="小图高" class="label-item" prop="smallPictureHeight">
|
||||
<Input type="number" v-model="formValidate.smallPictureHeight">
|
||||
<span slot="prepend">高</span>
|
||||
<span slot="append">px</span>
|
||||
</Input>
|
||||
</FormItem>
|
||||
</div>
|
||||
<div class="label-item">
|
||||
<FormItem class="label-item" label="缩略图宽" prop="abbreviationPictureWidth">
|
||||
<Input type="number" v-model="formValidate.abbreviationPictureWidth">
|
||||
<span slot="prepend">宽</span>
|
||||
<span slot="append">px</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
<FormItem class="label-item" label="缩略图高" prop="abbreviationPictureHeight">
|
||||
<Input type="number" v-model="formValidate.abbreviationPictureHeight">
|
||||
<span slot="prepend">高</span>
|
||||
<span slot="append">px</span>
|
||||
</Input>
|
||||
</FormItem>
|
||||
</div>
|
||||
<div class="label-item">
|
||||
<FormItem class="label-item" label="原图宽高" prop="originalPictureWidth">
|
||||
<Input type="number" v-model="formValidate.originalPictureWidth">
|
||||
<span slot="prepend">宽</span>
|
||||
<span slot="append">px</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
<FormItem class="label-item" label="原图宽高" prop="originalPictureHeight">
|
||||
<Input type="number" v-model="formValidate.originalPictureHeight">
|
||||
<span slot="prepend">高</span>
|
||||
<span slot="append">px</span>
|
||||
</Input>
|
||||
</FormItem>
|
||||
</div>
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
|
||||
</div>
|
||||
|
||||
</Form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "./validate";
|
||||
export default {
|
||||
props: ["res", "type"],
|
||||
data() {
|
||||
return {
|
||||
formValidate: {
|
||||
goodsCheck: 1,
|
||||
smallPictureHeight: "0",
|
||||
smallPictureWidth: "0",
|
||||
abbreviationPictureWidth: "0",
|
||||
abbreviationPictureHeight: "0",
|
||||
originalPictureWidth: "0",
|
||||
originalPictureHeight: "0",
|
||||
},
|
||||
ruleValidate: {},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
res: {
|
||||
handler() {},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if( handleSubmit(that, name )){
|
||||
this.setupSetting()
|
||||
}
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 实例化数据
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
|
||||
Object.keys(this.res).map((item) => {
|
||||
this.res[item] += "";
|
||||
});
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
Object.keys(this.formValidate).forEach((item) => {
|
||||
this.ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写必填项",
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value < 0) {
|
||||
callback(new Error("不能输入负数!"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: "change",
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./style.scss";
|
||||
.label-item {
|
||||
display: flex;
|
||||
}
|
||||
/deep/ .ivu-input {
|
||||
width: 100px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
<FormItem label="企业id" prop="ebusinessID">
|
||||
<Input v-model="formValidate.ebusinessID" />
|
||||
</FormItem>
|
||||
<FormItem label="密钥" prop="appKey">
|
||||
<Input class="label-appkey" v-model="formValidate.appKey" />
|
||||
</FormItem>
|
||||
<FormItem label="api地址" prop="reqURL">
|
||||
<Input v-model="formValidate.reqURL" />
|
||||
</FormItem>
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "./validate";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ruleValidate: {},
|
||||
formValidate: { ebusinessID: "", reqURL: "", appKey: "" },
|
||||
};
|
||||
},
|
||||
props: ["res",'type'],
|
||||
watch: {
|
||||
res: {
|
||||
handler() {},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if( handleSubmit(that, name )){
|
||||
this.setupSetting()
|
||||
}
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
// 实例化数据
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
Object.keys(this.formValidate).forEach((item) => {
|
||||
this.ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写必填项",
|
||||
trigger: "blur",
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./style.scss";
|
||||
.label-item {
|
||||
display: flex;
|
||||
> .ivu-input {
|
||||
width: 200px;
|
||||
margin: 0 10px;
|
||||
}
|
||||
}
|
||||
.label-appkey {
|
||||
width: 300px !important;
|
||||
/deep/ input {
|
||||
width: 300px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
124
manager/src/views/sys/setting-manage/setting/ORDER_SETTING.vue
Normal file
124
manager/src/views/sys/setting-manage/setting/ORDER_SETTING.vue
Normal file
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
|
||||
<FormItem label="订单自动取消" prop="autoCancel">
|
||||
<Input type='number' v-model="formValidate.autoCancel">
|
||||
<span slot="append">分</span>
|
||||
</Input>
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="订单自动收货" class="label-item" prop="autoReceive">
|
||||
<Input type='number' v-model="formValidate.autoReceive">
|
||||
<span slot="append">天</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
<FormItem label="订单自动完成" prop="autoComplete">
|
||||
<Input type='number' v-model="formValidate.autoComplete">
|
||||
<span slot="append">天</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="自动评价" prop="autoEvaluation">
|
||||
<Input type='number' v-model="formValidate.autoEvaluation">
|
||||
<span slot="append">天</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
<FormItem label="售后自动取消" prop="autoCancelAfterSale">
|
||||
<Input type='number' v-model="formValidate.autoCancelAfterSale">
|
||||
<span slot="append">天</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "./validate";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ruleValidate: {},
|
||||
formValidate: {
|
||||
autoCancel: "",
|
||||
autoComplete: "",
|
||||
autoEvaluation: "",
|
||||
autoReceive: "",
|
||||
autoCancelAfterSale: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
props: ["res", "type"],
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if (handleSubmit(that, name)) {
|
||||
this.setupSetting();
|
||||
}
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
// 实例化数据
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
Object.keys(this.res).map((item) => {
|
||||
this.res[item] += "";
|
||||
});
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
Object.keys(this.formValidate).forEach((item) => {
|
||||
this.ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写必填项",
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value < 0) {
|
||||
callback(new Error("不能输入负数!"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: "change",
|
||||
},
|
||||
];
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./style.scss";
|
||||
.label-item {
|
||||
display: flex;
|
||||
}
|
||||
.ivu-input-wrapper {
|
||||
width: 100px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
/deep/ .ivu-input {
|
||||
width: 100px !important;
|
||||
}
|
||||
</style>
|
||||
95
manager/src/views/sys/setting-manage/setting/OSS_SETTING.vue
Normal file
95
manager/src/views/sys/setting-manage/setting/OSS_SETTING.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
<FormItem label="endPoint" prop="endPoint">
|
||||
<Input v-model="formValidate.endPoint" />
|
||||
</FormItem>
|
||||
<FormItem label="bucketName" class="label-item" prop="bucketName">
|
||||
<Input v-model="formValidate.bucketName" />
|
||||
</FormItem>
|
||||
<FormItem label="picLocation" prop="bucketName">
|
||||
<Input v-model="formValidate.picLocation" />
|
||||
</FormItem>
|
||||
<FormItem label="accessKeyId" prop="accessKeyId">
|
||||
<Input v-model="formValidate.accessKeyId" />
|
||||
</FormItem>
|
||||
<FormItem label="accessKeySecret" prop="accessKeySecret">
|
||||
<Input v-model="formValidate.accessKeySecret" />
|
||||
</FormItem>
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "./validate";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ruleValidate: {},
|
||||
formValidate: {
|
||||
accessKeyId: "",
|
||||
accessKeySecret: "",
|
||||
bucketName: "",
|
||||
picLocation: "",
|
||||
endPoint: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
props: ["res", "type"],
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if( handleSubmit(that, name )){
|
||||
this.setupSetting()
|
||||
}
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
// 实例化数据
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
Object.keys(this.formValidate).forEach((item) => {
|
||||
this.ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写必填项",
|
||||
trigger: "blur",
|
||||
},
|
||||
];
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./style.scss";
|
||||
.label-item {
|
||||
display: flex;
|
||||
}
|
||||
/deep/ .ivu-input {
|
||||
width: 300px !important;
|
||||
margin: 0 10px;
|
||||
}
|
||||
.ivu-input-wrapper {
|
||||
width: 300px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
175
manager/src/views/sys/setting-manage/setting/POINT_SETTING.vue
Normal file
175
manager/src/views/sys/setting-manage/setting/POINT_SETTING.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
<FormItem label="积分比例" prop="money">
|
||||
<Input type="number" v-model="formValidate.money">
|
||||
<span slot="prepend">1积分=</span>
|
||||
<span slot="append">人民币</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="注册账号" prop="register">
|
||||
<Input type="number" v-model="formValidate.register">
|
||||
<span slot="append">积分</span>
|
||||
</Input>
|
||||
</FormItem>
|
||||
<FormItem label="登录" class="label-item" prop="login">
|
||||
<Input type="number" v-model="formValidate.login">
|
||||
|
||||
<span slot="append">积分</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="每日签到积分" prop="signIn">
|
||||
<Input type="number" v-model="formValidate.signIn">
|
||||
<span slot="append">积分</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
<FormItem label="订单评价赠送积分" prop="comment">
|
||||
<Input type="number" v-model="formValidate.comment">
|
||||
<span slot="append">积分</span>
|
||||
</Input>
|
||||
|
||||
</FormItem>
|
||||
|
||||
<FormItem class="label-item" v-for="(point,index) in formValidate.pointSettingItems" :key="index" :label="'签到设置'+(index+1)">
|
||||
<div class="label-item">
|
||||
|
||||
<InputNumber :min="1" v-model="point.day" :formatter="value => `签到${value}天`" :parser="value => value.replace('天', '') && value.replace('签到', '')"></InputNumber>
|
||||
|
||||
<InputNumber :min="0" :formatter="value => `赠送${value}积分`" :parser="value => value.replace('积分', '') && value.replace('赠送', '')" v-model="point.point"></InputNumber>
|
||||
|
||||
<Button ghost type="error" @click="delSign(point,index)">删除</Button>
|
||||
</div>
|
||||
|
||||
</FormItem>
|
||||
<FormItem label="操作:">
|
||||
<Button @click="addSign">新增签到</Button>
|
||||
</FormItem>
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "./validate";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ruleValidate: {},
|
||||
formValidate: {},
|
||||
};
|
||||
},
|
||||
props: ["res", "type"],
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if (handleSubmit(that, name)) {
|
||||
this.setupSetting();
|
||||
}
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
delSign(item, index) {
|
||||
this.formValidate.pointSettingItems.splice(index, 1);
|
||||
},
|
||||
addSign() {
|
||||
if (this.formValidate.pointSettingItems.length >= 4) {
|
||||
this.$Message.error({
|
||||
content: "最多设置4项签到设置",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.formValidate.pointSettingItems.push({
|
||||
point: "0",
|
||||
day:
|
||||
this.formValidate.pointSettingItems[
|
||||
this.formValidate.pointSettingItems.length - 1
|
||||
].day + 1,
|
||||
});
|
||||
},
|
||||
// 实例化数据
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
Object.keys(this.res).map((item) => {
|
||||
if (item == "pointSettingItems") {
|
||||
return false;
|
||||
}
|
||||
this.res[item] += "";
|
||||
});
|
||||
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
|
||||
Object.keys(this.formValidate).forEach((item) => {
|
||||
this.ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写必填项",
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value < 0) {
|
||||
callback(new Error("不能输入负数!"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: "change",
|
||||
},
|
||||
];
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./style.scss";
|
||||
|
||||
.label-item {
|
||||
display: flex;
|
||||
|
||||
> .ivu-input-number {
|
||||
width: 100px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
> .ivu-input-number:nth-last-of-type(1) {
|
||||
width: 150px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
> .ivu-input {
|
||||
width: 100px;
|
||||
margin: 0 10px;
|
||||
}
|
||||
}
|
||||
/deep/ .ivu-input {
|
||||
width: 70px !important;
|
||||
}
|
||||
.ivu-input-wrapper {
|
||||
width: 70px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.label-btns {
|
||||
/deep/ .ivu-btn {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
92
manager/src/views/sys/setting-manage/setting/SMS_SETTING.vue
Normal file
92
manager/src/views/sys/setting-manage/setting/SMS_SETTING.vue
Normal file
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
<FormItem label="accessKeyId" prop="accessKeyId">
|
||||
<Input v-model="formValidate.accessKeyId" />
|
||||
</FormItem>
|
||||
<FormItem label="accessSecret" prop="accessSecret">
|
||||
<Input v-model="formValidate.accessSecret" />
|
||||
</FormItem>
|
||||
<FormItem label="regionId" prop="regionId">
|
||||
<Input v-model="formValidate.regionId" />
|
||||
</FormItem>
|
||||
<FormItem label="signName" prop="signName">
|
||||
<Input v-model="formValidate.signName" />
|
||||
</FormItem>
|
||||
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "./validate";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ruleValidate: {},
|
||||
formValidate: {
|
||||
accessKeyId: "",
|
||||
regionId: "",
|
||||
picLocation: "",
|
||||
accessSecret: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
props: ["res", "type"],
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if( handleSubmit(that, name )){
|
||||
this.setupSetting()
|
||||
}
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
// 实例化数据
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
Object.keys(this.formValidate).forEach((item) => {
|
||||
this.ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写必填项",
|
||||
trigger: "blur",
|
||||
},
|
||||
];
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./style.scss";
|
||||
.label-item {
|
||||
display: flex;
|
||||
}
|
||||
/deep/ .ivu-input {
|
||||
width: 300px !important;
|
||||
margin: 0 10px;
|
||||
}
|
||||
.ivu-input-wrapper {
|
||||
width: 300px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
|
||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
<FormItem label="提现审核是否开启">
|
||||
<i-switch v-model="formValidate.apply" style="margin-top:7px;"><span slot="open">开</span>
|
||||
<span slot="close">关</span>
|
||||
</i-switch>
|
||||
|
||||
</FormItem>
|
||||
<div class="label-btns">
|
||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setSetting } from "@/api/index";
|
||||
import { handleSubmit } from "./validate";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formValidate: {
|
||||
apply: true,
|
||||
},
|
||||
|
||||
switchTitle: "提现审核是否开启",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
props: ["res", "type"],
|
||||
methods: {
|
||||
submit(name) {
|
||||
let that = this;
|
||||
if( handleSubmit(that, name )){
|
||||
this.setupSetting()
|
||||
}
|
||||
},
|
||||
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$Message.success("保存成功!");
|
||||
} else {
|
||||
this.$Message.error("保存失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
// 实例化数据
|
||||
init() {
|
||||
this.res = JSON.parse(this.res);
|
||||
this.$set(this, "formValidate", { ...this.res });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./style.scss";
|
||||
/deep/ .ivu-form-item-content{
|
||||
align-items: center;
|
||||
paddinig-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
22
manager/src/views/sys/setting-manage/setting/style.scss
Normal file
22
manager/src/views/sys/setting-manage/setting/style.scss
Normal file
@@ -0,0 +1,22 @@
|
||||
/deep/ .ivu-input{
|
||||
width: 200px !important;
|
||||
}
|
||||
|
||||
.label-btns{
|
||||
margin-left: 150px;
|
||||
}
|
||||
|
||||
.ivu-form-item{
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
|
||||
.ivu-input-wrapper {
|
||||
width: 150px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/deep/ .ivu-form-item-content {
|
||||
margin-left: 0 !important;
|
||||
display: flex;
|
||||
}
|
||||
23
manager/src/views/sys/setting-manage/setting/validate.js
Normal file
23
manager/src/views/sys/setting-manage/setting/validate.js
Normal file
@@ -0,0 +1,23 @@
|
||||
//表单中必填
|
||||
export function validateRequired(rule, value, callback) {
|
||||
if (value != void 0 || value != null) {
|
||||
callback();
|
||||
} else {
|
||||
return callback(new Error("必填项不能为空"));
|
||||
}
|
||||
}
|
||||
|
||||
// 验证必填项
|
||||
export function handleSubmit(that, name) {
|
||||
let flag = false;
|
||||
that.$refs[name].validate(valid => {
|
||||
if (valid) {
|
||||
flag = true;
|
||||
return flag;
|
||||
} else {
|
||||
that.$Message.error("请正确填写内容!");
|
||||
return flag;
|
||||
}
|
||||
});
|
||||
return flag
|
||||
}
|
||||
Reference in New Issue
Block a user