//data
option: {
searchMenuSpan: 18, //控制搜索加按钮
border: true, //边框
columnBtn: false, //显隐
addBtn: false, //不显示自带的新增按钮
viewBtn: false, //查看按钮
editBtn: false, //编辑按钮
delBtn: false, //删除按钮
index: true, //序号
indexLabel: "序号",
// selection: true,
searchBtn: true,
menu: false, //操作
align: "center",
menuAlign: "center",
column: [
{
label: "设备厂家",
prop: "factoryName",
},
{
label: "设备编码",
prop: "coName",
search: true,
},
{
label: "归属街道",
prop: "streetName",
// labelWidth: 140,
type: "select",
// span: 24,
search: true,
// searchLabelWidth: 140,
// searchSpan: 12,
filterMultiple: false,
props: {
label: "name",
value: "code"
},
cascaderItem: ["unityName", "regionName"], //联动下边那两个 社区 小区
dicUrl: "",
hide: true
},
{
label: "归属社区",
prop: "unityName",
// labelWidth: 140, //标题宽度
// span: 24, //栅格占据的列数
type: "select", //展示类型
search: true, //是否为搜索项
// searchLabelWidth: 140, //搜索项标题宽度
// searchSpan: 12, //搜索项框栅列
filterMultiple: false,
props: { //数据字典属性的配置对象,具体参考Props参考配置
label: "name",
value: "code"
},
row: true, //栅格单独成行
cascaderIndex: 0, //级联的默认选项序号
dicUrl: "", //数据字典接口url地址
hide: true //表格字段是否显示
},
{
label: "归属小区",
prop: "regionName",
// labelWidth: 140,
// span: 24,
type: "select",
search: true,
// searchLabelWidth: 140,
// searchSpan: 12,
filterMultiple: false,
props: {
label: "name",
value: "code"
},
row: true,
cascaderIndex: 0,
dicUrl: "",
hide: true
},
{
label: "设备位置",
prop: "installationPosition",
search: true,
},
{
label: "健康宝接口调用次数",
prop: "usedCnt",
},
],
},
created(){
this.$message.info("数据加载中,请稍等");
this.option.column[2].dicUrl =
`${baseURL}geospatial/street/getStreet?username=` +
JSON.parse(window.localStorage.getItem("userInfo")).username;
this.option.column[3].dicUrl =
`${baseURL}geospatial/community/getCommunityByStreetId/{{key}}?username=` +
JSON.parse(window.localStorage.getItem("userInfo")).username;
this.option.column[4].dicUrl =
`${baseURL}geospatial/village/getVillageByCommunityId/{{key}}?username=` +
JSON.parse(window.localStorage.getItem("userInfo")).username;
this.handelInit();
this.DeviceTailFn(); //设备详情接口
this.DeviceTailExcelFun();
this.DeviceTailExcelExcel();
},
//methods