index.vue 1.79 KB
Newer Older
张成 committed
1 2 3 4 5 6 7 8 9 10 11 12
<template>
	<div class="app-container">
		<el-tabs tab-position="left" v-model="activeName">
			<el-tab-pane label="左侧图片" name="first">
				<LeftImg :initValue="workValue['menu.left']" />
			</el-tab-pane>
			<el-tab-pane label="右侧图片" name="second">
				<Right :initValue="workValue['menu.right']" />
			</el-tab-pane>
			<el-tab-pane label="其他设置" name="third">
				<el-form ref="form" label-width="180px">
					<el-form-item label="每件商品数量">
lixiaomin committed
13
						<el-input v-model="workValue['goods.limit'].configValue" placeholder="请输入名称" />
张成 committed
14 15
					</el-form-item>
					<el-form-item label="温馨提示地址">
lixiaomin committed
16
						<el-input v-model="workValue['tips.address'].configValue" placeholder="请输入名称" />
张成 committed
17 18
					</el-form-item>
					<el-form-item label="">
lixiaomin committed
19
						<el-button @click="sumit" v-hasPermi="['system:config:edit']" >提交</el-button>
张成 committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
					</el-form-item>
				</el-form>
			</el-tab-pane>
		</el-tabs>
	</div>
</template>

<script>
import { listConfig } from '@/api/system/config';
import LeftImg from './components/leftImg.vue'
import Right from './components/right.vue'
import Other from './components/other.vue'
import { updateConfig } from '@/api/system/config';

export default {
	components: { LeftImg, Right, Other },
	data() {
		return {
			activeName: 'first',
			workValue: {
				"menu.left": {},
				"menu.right": {},
				"goods.limit": {},
				"tips.address": {},
			}
		};
	},
	mounted() {
		listConfig().then(({ rows }) => {
			rows.forEach(element => {
				this.workValue[element.configKey] = element
			});
		})
	},
	methods: {
		sumit() {
			updateConfig({ ...this.workValue['goods.limit'] }).then(res => {
				updateConfig({ ...this.workValue['tips.address'] }).then(res => {
					this.$modal.msgSuccess("修改成功");
				})
			})

		}
	}
}
</script>

<style>
</style>