Commit b7f31ad3 by chenqiang

栏目、模型、门户

parent 43e69660
......@@ -7,10 +7,10 @@
-->
<template>
<div class="lanmugl-index">
<p class="table-title">
<span class="serch-result-title">查询结果</span>
<span class="search-result-number">共有7条查询结果</span>
</p>
<!-- <p class="table-title">-->
<!-- <span class="serch-result-title">查询结果</span>-->
<!-- <span class="search-result-number">共有7条查询结果</span>-->
<!-- </p>-->
<el-card>
<el-table
:data="tableData"
......
......@@ -406,12 +406,12 @@ export default {
yhpjnr: self.formItem.yhpjnr,
yhpf: self.formItem.yhpf
}
axios.post('/mxgl/template/insertPJ',param,{
headers:{
axios.post('/mxgl/template/insertPJ', param, {
headers: {
'content-Type': 'application/json'
}
}).then(res=>{
if(res.data.status == 'success'){
}).then(res => {
if (res.data.status == 'success') {
self.$message.success('新增评价成功')
self.dialogFormVisible = false
self.getData('yes')
......@@ -533,6 +533,7 @@ export default {
.el-dialog__footer {
border-top: 1px solid #ccc;
}
.form_wdpl {
.el-form-item__label {
margin-top: 5px;
......
......@@ -14,60 +14,48 @@
:defaultProps="{ label: 'name' }"
@add-btn="add"
:mode="mode"
min-height="240px"
openAll
:checkStrictly="true"
>
</tree-transfer>
<div
class="showSelectedDiv"
style="
border: 1px solid rgb(235, 238, 245);
width: 668px;
min-height: 100px;
box-sizing: border-box;
border-radius: 5px;
vertical-align: middle;
background-color: rgb(254, 254, 254);
position: absolute;
right: 10px;
top: 100px;
"
>
<p v-for="(item, index) in nodes" :key="index">
<span
style="display:inline-block;width:200px;text-align:left;margin-left:10px;"
>{{ item.name }}</span
>
<el-button style="padding:5px" @click="removeClicked(item)"
>删除</el-button
>
</p>
class="showSelectedDiv">
<div v-for="(item, index) in nodes" :key="index"
style="display: flex;
justify-content: space-between;
padding: 6px 0;">
<div
style="text-align:left;margin-left:10px;">{{ item.name }}
</div>
<div>
<el-button size="mini" type="danger" @click="removeClicked(item)">删除</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
import treeTransfer from "el-tree-transfer";
import axios from "axios";
import treeTransfer from 'el-tree-transfer'
import axios from 'axios'
export default {
name: "index",
name: 'index',
components: { treeTransfer }, // 注册
data() {
return {
mode: "transfer", // transfer addressList
title: ["全部内容", "选中内容"],
mode: 'transfer', // transfer addressList
title: ['全部内容', '选中内容'],
fromData: [], // 显示的树形组件
toData: [], // 选中的右边的 data
nodes: [] //右边显示的内容
};
}
},
mounted() {
// 得到所有的数据
this.getUnSelectedTableData();
this.getUnSelectedTableData()
// 得到选中的数据
this.getSelectedTableData();
this.getSelectedTableData()
},
methods: {
/**
......@@ -78,38 +66,38 @@ export default {
*/
getUnSelectedTableData() {
let self = this;
let self = this
const headers = {
"content-Type": "application/json"
};
'content-Type': 'application/json'
}
axios
.post("/hy/selectTitleByStatW", {}, { headers: headers })
.then(function(res) {
let fatherArray = [];
.post('/hy/selectTitleByStatW', {}, { headers: headers })
.then(function (res) {
let fatherArray = []
res.data.forEach(each => {
// 找到所有的父级节点
if (each.prentId === "0") {
each.children = [];
each.disabled = true;
fatherArray.push(each);
if (each.prentId === '0') {
each.children = []
each.disabled = true
fatherArray.push(each)
}
});
})
res.data.forEach(each => {
if (each.prentId !== 0) {
fatherArray.forEach((fatherEach, fatherIndex) => {
if (fatherEach.id === each.prentId) {
fatherArray[fatherIndex].children.push(each);
fatherArray[fatherIndex].children.push(each)
}
});
})
}
});
self.tableData = fatherArray;
console.log(self.tableData);
self.fromData = self.tableData;
})
self.tableData = fatherArray
console.log(self.tableData)
self.fromData = self.tableData
})
.catch(function (err) {
console.log(err)
})
.catch(function(err) {
console.log(err);
});
},
/**
* @description: 得到已选中的右侧的数据列表
......@@ -119,18 +107,18 @@ export default {
*/
getSelectedTableData() {
let self = this;
let self = this
const headers = {
"content-Type": "application/json"
};
'content-Type': 'application/json'
}
axios
.post("/hy/selectTitleByStatY", {}, { headers: headers })
.then(function(res) {
self.nodes = res.data;
.post('/hy/selectTitleByStatY', {}, { headers: headers })
.then(function (res) {
self.nodes = res.data
})
.catch(function (err) {
console.log(err)
})
.catch(function(err) {
console.log(err);
});
},
/**
......@@ -141,53 +129,94 @@ export default {
*/
removeClicked(item) {
let deleteArray = [];
deleteArray.push(item);
let self = this;
let deleteArray = []
deleteArray.push(item)
let self = this
const headers = {
"content-Type": "application/json"
};
'content-Type': 'application/json'
}
axios
.post("/hy/updataStatW", deleteArray, { headers: headers })
.then(function(res) {
self.nodes = res.data;
self.getUnSelectedTableData();
self.getSelectedTableData();
.post('/hy/updataStatW', deleteArray, { headers: headers })
.then(function (res) {
self.nodes = res.data
self.getUnSelectedTableData()
self.getSelectedTableData()
})
.catch(function (err) {
console.log(err)
})
.catch(function(err) {
console.log(err);
});
console.log(item);
console.log(item)
},
// 监听穿梭框组件添加
add() {
this.nodes = this.toData;
document.getElementsByClassName("transfer-right")[0].style.display =
"none";
let self = this;
this.nodes = this.toData
// document.getElementsByClassName('transfer-right')[0].style.display =
// 'none'
let self = this
const headers = {
"content-Type": "application/json"
};
'content-Type': 'application/json'
}
axios
.post("/hy/updataStatY", self.nodes, { headers: headers })
.then(function(res) {
self.nodes = res.data;
self.getSelectedTableData();
.post('/hy/updataStatY', self.nodes, { headers: headers })
.then(function (res) {
self.nodes = res.data
self.getSelectedTableData()
})
.catch(function (err) {
console.log(err)
})
.catch(function(err) {
console.log(err);
});
}
}
};
}
</script>
<style lang="scss" scoped>
.nrgl-index {
.add-button {
float: right;
margin-right: 150px;
.nrgl-index {
position: relative;
width: 1100px;
margin: 0 auto;
/deep/ .transfer {
height: 650px !important;
}
/deep/ .component-transfer {
height: 650px;
}
.add-button {
float: right;
margin-right: 150px;
}
/deep/ .transfer-left {
.transfer-main {
.el-tree {
min-height: 578px;
}
}
}
/deep/ .transfer-center {
.transfer-center-item:nth-child(2) {
display: none;
}
}
.showSelectedDiv {
border: 1px solid rgb(235, 238, 245);
width: 440px;
height: 558px;
overflow: auto;
border-radius: 5px;
background-color: rgb(254, 254, 254);
position: absolute;
right: 0;
top: 50px;
color: #606266;
padding: 10px;
z-index: 99;
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment