|
@@ -3,50 +3,67 @@
|
|
|
<Toptitle title="项目设置">
|
|
|
</Toptitle>
|
|
|
<div style="padding: 10px" class="setting" >
|
|
|
- <Card :title="examine_title" :padding="0" >
|
|
|
+ <Card :padding="0" v-for="(item,index) in switch_list" :key="index">
|
|
|
+
|
|
|
+ <Input slot="title" v-if="item.title_type" @on-blur="change_title(item,1)" v-model="item.title" autofocus='true' style="width:90%"></Input>
|
|
|
+ <p slot="title" v-else @click="change_title(item)">{{item.title}}</p>
|
|
|
<CellGroup>
|
|
|
- <Cell :title="item.title" v-for="(item,index) in cell_title" :key="index">
|
|
|
- <i-switch v-model="item.state" slot="extra" @on-change="change($event,index)" />
|
|
|
+ <Cell :title="_item.title" v-for="(_item,_index) in item.content" :key="_index">
|
|
|
+ <i-switch v-model="_item.state" slot="extra" @on-change="change($event,_index,item)" />
|
|
|
</Cell>
|
|
|
</CellGroup>
|
|
|
- <Tooltip max-width="200" :content="examine_remark"
|
|
|
+ <Tooltip max-width="200" :content="item.remark"
|
|
|
style="min-width:200px;position:absolute;right:-168px;top:169px;cursor: pointer">
|
|
|
<Icon type="md-help-circle" size="24" />
|
|
|
</Tooltip>
|
|
|
</Card>
|
|
|
- <Card :title="logo_title" :padding="0" >
|
|
|
- <a @click="upload" class="upload_pic">上传</a>
|
|
|
+ <Card :title="item.title" :padding="0" v-for="(item,index) in logo_list" :key="index" >
|
|
|
+ <Input slot="title" v-if="item.title_type" @on-blur="change_title(item,1)" v-model="item.title" autofocus='true' style="width:80%"></Input>
|
|
|
+ <p slot="title" v-else @click="change_title(item)">{{item.title}}</p>
|
|
|
+ <a @click="upload(item)" class="upload_pic">上传</a>
|
|
|
<div class="product-add">
|
|
|
<div
|
|
|
class="items"
|
|
|
- v-for="(_item, _index) of tempItem.url"
|
|
|
- :key="_index"
|
|
|
+ v-if="item.content"
|
|
|
>
|
|
|
<img
|
|
|
- @click="looks(_item)"
|
|
|
- :src="$store.state.ip + _item"
|
|
|
+ @click="looks(item.content)"
|
|
|
+ :src="$store.state.ip + item.content"
|
|
|
alt=""
|
|
|
/>
|
|
|
<Icon
|
|
|
size="20"
|
|
|
- @click="delItems(_index, tempItem.url)"
|
|
|
+ @click="delItems(item)"
|
|
|
class="delete-img"
|
|
|
type="ios-close-circle"
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- <div class="add-items" v-show="this.tempItem.url.length == 0">
|
|
|
+ <div class="add-items" v-show="!item.content">
|
|
|
<div class="_item">
|
|
|
<Icon size="50" type="ios-add" />
|
|
|
</div>
|
|
|
<input
|
|
|
- @change="changeIpt($event, tempItem.url)"
|
|
|
+ @change="changeIpt($event,index)"
|
|
|
type="file"
|
|
|
class="ipt"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Tooltip max-width="200" :content="logo_remark"
|
|
|
+ <Tooltip max-width="200" :content="item.remark"
|
|
|
+ style="min-width:200px;position:absolute;right:-168px;top:169px;cursor: pointer">
|
|
|
+ <Icon type="md-help-circle" size="24" />
|
|
|
+ </Tooltip>
|
|
|
+ </Card>
|
|
|
+ <Card v-for="(item,index) in text_list" :key="index" :title="item.title" style="width:520px">
|
|
|
+ <Input slot="title" v-if="item.title_type" @on-blur="change_title(item,1)" v-model="item.title" autofocus='true' style="width:80%"></Input>
|
|
|
+ <p slot="title" v-else @click="change_title(item)">{{item.title}}</p>
|
|
|
+ <a @click="upload(item)" class="upload_text">保存</a>
|
|
|
+
|
|
|
+ <div v-for="(_item,_index) in item.content" :key="_index" style="position: relative;top:-40px;display:flex;margin-top:20px">
|
|
|
+ <label style="width:80px;margin-right:60px">{{_item.title}}:</label> <Input v-model="_item.value" />
|
|
|
+ </div>
|
|
|
+ <Tooltip max-width="200" :content="item.remark"
|
|
|
style="min-width:200px;position:absolute;right:-168px;top:169px;cursor: pointer">
|
|
|
<Icon type="md-help-circle" size="24" />
|
|
|
</Tooltip>
|
|
@@ -65,53 +82,59 @@ export default {
|
|
|
},
|
|
|
logo_title:'',
|
|
|
content:[],
|
|
|
- examine_title:{},
|
|
|
logo_title:{},
|
|
|
- cell_title:{},
|
|
|
tempItem_op:{},
|
|
|
- examine_data:{},
|
|
|
- examine_remark:'',
|
|
|
- logo_remark:''
|
|
|
+ logo_remark:'',
|
|
|
+ switch_list:[],
|
|
|
+ logo_list:[],
|
|
|
+ text_list:[],
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|
|
|
this.axios.get('/api/basics_config_list').then(res=>{
|
|
|
this.content = res.data;
|
|
|
- this.content.forEach(item =>{
|
|
|
+ this.content.forEach(item =>{//sub_type 1 文本 2 开关 3 图片
|
|
|
if(item.sub_type == 2){
|
|
|
- this.examine_title = item.title
|
|
|
- this.examine_remark = item.remark
|
|
|
- this.examine_data = item
|
|
|
- this.cell_title =item.content
|
|
|
- this.cell_title.forEach(item=>{
|
|
|
- if(item.state == 0){
|
|
|
- item.state = false
|
|
|
- }else{
|
|
|
- item.state = true
|
|
|
- }
|
|
|
- })
|
|
|
- console.log(this.cell_title)
|
|
|
+ this.switch_list.push(item);
|
|
|
+ this.switch_list.forEach(item=>{
|
|
|
+ item.title_type = false;
|
|
|
+ })
|
|
|
}
|
|
|
if(item.sub_type == 3){
|
|
|
+ this.logo_list.push(item);
|
|
|
this.logo_title = item.title
|
|
|
this.logo_remark = item.remark
|
|
|
this.tempItem_op = item
|
|
|
this.tempItem.url = item.content.split(',')
|
|
|
- console.log(this.tempItem.url)
|
|
|
+ this.logo_list.forEach(item=>{
|
|
|
+ item.title_type = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(item.sub_type == 1){
|
|
|
+ this.text_list.push(item);
|
|
|
+ this.text_list.forEach(item=>{
|
|
|
+ item.title_type = false;
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
methods:{
|
|
|
- change(e,index){
|
|
|
- this.examine_data.content[index].state = e;
|
|
|
- this.axios.post('/api/basics_config_edit',this.examine_data).then(res=>{
|
|
|
+ change_title(item,type){
|
|
|
+ item.title_type = !item.title_type;
|
|
|
+ this.$forceUpdate();
|
|
|
+ if(type){
|
|
|
+ this.upload(item)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ change(e,index,item){
|
|
|
+ this.axios.post('/api/basics_config_edit',item).then(res=>{
|
|
|
console.log(res)
|
|
|
})
|
|
|
},
|
|
|
- upload(){
|
|
|
- this.tempItem_op.content = this.tempItem.url[0];
|
|
|
- this.axios.post('/api/basics_config_edit',{...this.tempItem_op}).then(res=>{
|
|
|
+ upload(item){
|
|
|
+ this.axios.post('/api/basics_config_edit',item).then(res=>{
|
|
|
if(res.code == 200){
|
|
|
this.$Message.success(res.msg)
|
|
|
}
|
|
@@ -127,21 +150,24 @@ export default {
|
|
|
baseTitleField: "",
|
|
|
});
|
|
|
},
|
|
|
- delItems(n, arr) {
|
|
|
- arr.splice(n, 1);
|
|
|
+ delItems(item) {
|
|
|
+ item.content = null;
|
|
|
},
|
|
|
- changeIpt(e, row) {
|
|
|
+ changeIpt(e,index) {
|
|
|
let file = e.target.files[0];
|
|
|
- this.postImg(file, row);
|
|
|
- e.target.value = null;
|
|
|
+
|
|
|
+ this.postImg(file,index);
|
|
|
+ // e.target.value = null;
|
|
|
},
|
|
|
- postImg(file, row) {
|
|
|
+ postImg(file, index) {
|
|
|
let formData = new FormData();
|
|
|
formData.append("file", file);
|
|
|
this.axios.post("/api/upload_pic", formData).then((res) => {
|
|
|
this.$nextTick(() => {
|
|
|
- row.push(res.data.url);
|
|
|
- this.$forceUpdate();
|
|
|
+ this.logo_list[index].content= res.data.url;
|
|
|
+
|
|
|
+
|
|
|
+ // this.$forceUpdate();
|
|
|
});
|
|
|
});
|
|
|
},
|
|
@@ -157,7 +183,7 @@ export default {
|
|
|
}
|
|
|
.product-add {
|
|
|
position: relative;
|
|
|
- top: -20px;
|
|
|
+ top: -25px;
|
|
|
height: 140px;
|
|
|
.ipt {
|
|
|
position: absolute;
|
|
@@ -227,6 +253,7 @@ export default {
|
|
|
}
|
|
|
/deep/ .ivu-card-head{
|
|
|
border-bottom: none;
|
|
|
+ height: 60px;
|
|
|
p{
|
|
|
font-weight: 800;
|
|
|
}
|
|
@@ -241,8 +268,18 @@ export default {
|
|
|
}
|
|
|
.upload_pic{
|
|
|
position: relative;
|
|
|
- top: -38px;
|
|
|
- right: -196px;
|
|
|
+ top: -44px;
|
|
|
+ right: -200px;
|
|
|
+ color: red;
|
|
|
+}
|
|
|
+.upload_text{
|
|
|
+ position: relative;
|
|
|
+ top: -60px;
|
|
|
+ right: -444px;
|
|
|
color: red;
|
|
|
}
|
|
|
+/deep/ .ivu-cell-group{
|
|
|
+ position: relative;
|
|
|
+ top: -10px;
|
|
|
+}
|
|
|
</style>
|