<template>
<div class="staple">
<div class="listfile">
<Row>
<Col span="24">广播播放优先级配置管理</Col>
</Row>
<Table border ref="selection" :columns="historyColumns" :data="historyData" height="500">
<span v-show="seen">123</span>
</Table>
<div slot="footer" style="margin-top:10px;">
<Row :gutter="20" type="flex" justify="end">
<Col span="2">
<Button type="primary" long @click="handleSave()">保存</Button>
</Col>
<Col span="2">
<Button long @click="cancelAdd()">取消</Button>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import Cookies from "js-cookie";
export default {
data() {
const letter = this.$store.state.parameter.deserve;
return {
seen: false,
priorityType: letter.M407,
broadcastinfoType: letter.M408,
historyColumns: [
{ title: "#", key: "key", align: "center" },
{
title: "优先级类型A",key: "priorityType",align: "center",
render: (h, params) => {
return h("Input", {
props: {
placeholder: "请输入...",
value: params.row.priorityType
}
}
);
}
},
{ title: "广播信息类型B",key: "broadcastinfoType",align: "center",
render: (h, params) => {
return h("Input", {
props: {
placeholder: "请输入...",
value: params.row.broadcastinfoType
}
});
}
}
],
historyData: [],
record: [],
originData: [],
list:[],
editAll: {
priorityInfoList: []
}
};
},
methods: {
initSql() {
let list = [];
this.priorityType.map( v => {
this.broadcastinfoType.map( item => {
list.push({
broadcastinfoType: item.itemValue,
priorityType: v.itemValue,
level: 0,
lastmodifytime: "2019-03-25 00:00:00",
reamrk: "123456",
createuserid:this.$store.state.user.userId,
createusername: this.$store.state.user.userName,
})
})
})
this.$axios({
method: "get",
url: this.baseURL + "/priority/PriorityInfo/list_All",
})
.then(res => {
this.originData = res.data;
list.map(v => {
this.originData.map(item => {
if (v.broadcastinfoType === item.broadcastinfoType && v.priorityType === item.priorityType) {
v.level = item.level
}
})
})
})
.catch(error => {});
this.editAll.priorityInfoList = list;
this.$axios({
method: "post",
data: this.editAll,
headers: { "Content-Type": "application/json" },
url: this.baseURL + "/priority/PriorityInfo/update_Priority "
})
.then(res => {
})
.catch(error => {});
this.search_all();
},
search_all() {
this.$axios({
method: "get",