|
@@ -1,10 +1,16 @@
|
|
|
<template>
|
|
|
<div id="handsontable" v-loading="isLoading">
|
|
|
- <div style="overflow:hidden;margin-bottom:10px;margin-right:20px;height:50px;">
|
|
|
- <el-button @click="undo" style="float:right;margin-top:5px;margin-left:10px;">撤回</el-button>
|
|
|
- <el-button @click="reset" style="float:right;margin-top:5px;">刷新</el-button>
|
|
|
- <el-button @click="addSp" style="float:right;margin-top:5px;">添加</el-button>
|
|
|
- </div>
|
|
|
+ <el-row class="left">
|
|
|
+ <el-select v-model="onlyRead" @change="getData(false)" style="width:100px;margin-right:20px;vertical-align:bottom;">
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="showType" @change="initHot" style="width:100px;margin-right:10px;vertical-align:bottom;">
|
|
|
+ <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button v-show="!onlyRead" @click="addSp">添加</el-button>
|
|
|
+ <el-button @click="reset">刷新</el-button>
|
|
|
+ <el-button v-show="!onlyRead" @click="undo">撤销</el-button>
|
|
|
+ </el-row>
|
|
|
<div v-show="main &&main.length" :id="id"></div>
|
|
|
<div class="center" v-show="!main || !main.length" style="height: 400px;padding-top:140px;box-sizing:border-box;">
|
|
|
<i class="iconwushuju iconfont"></i>
|
|
@@ -30,18 +36,21 @@ import "@/assets/js/handsontable-chosen-editor";
|
|
|
import myPagination from "@/components/common/myPagination";
|
|
|
import addBusiness from "@/components/business_space/dialogs/addDialog/businessDialog"
|
|
|
import showTools from "@/utils/handsontable/notShow"
|
|
|
+import handsonUtils from "@/utils/hasontableUtils"
|
|
|
import Handsontable from "handsontable-pro"
|
|
|
import 'handsontable-pro/dist/handsontable.full.css'
|
|
|
import zhCN from 'handsontable-pro/languages/zh-CN';
|
|
|
import qrcode from "@/components/ledger/lib/qrcode";
|
|
|
-console.log(Handsontable, "Handsontable")
|
|
|
-import { updateBusiness, queryZone, createBusiness, createBusinessList, delManySpace, isSpaceBuss } from "@/api/scan/request";
|
|
|
+import { updateBusiness, queryZone, updateZone, deleteZone, createBusiness, createBusinessList, delManySpace, isSpaceBuss } from "@/api/scan/request";
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
export default {
|
|
|
props: {
|
|
|
id: {
|
|
|
type: String
|
|
|
- }
|
|
|
+ },
|
|
|
+ zoneObj: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
},
|
|
|
components: {
|
|
|
qrcode, //二维码页面
|
|
@@ -49,7 +58,12 @@ export default {
|
|
|
addBusiness
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters("layout", ["projectId", "secret", "userId"])
|
|
|
+ ...mapGetters("layout", ["projectId", "secret", "userId"]),
|
|
|
+ showTypes () {
|
|
|
+ return this.onlyRead?
|
|
|
+ [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]:
|
|
|
+ [{value: "partInfo", label: '隐藏信息点'}, {value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'} ]
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -59,17 +73,18 @@ export default {
|
|
|
},
|
|
|
qrcodeUrl: "",//二维码图片地址
|
|
|
headers: null,
|
|
|
- main: null,
|
|
|
+ main: [],
|
|
|
hot: null,
|
|
|
- tableData: [],
|
|
|
isLoading: true,
|
|
|
- allData: null,
|
|
|
- // page: {
|
|
|
- // size: 50,
|
|
|
- // sizes: [10, 30, 50, 100, 150, 200],
|
|
|
- // total: 2,
|
|
|
- // currentPage: 1
|
|
|
- // },
|
|
|
+ options: [{
|
|
|
+ value: true,
|
|
|
+ label: '只读模式'
|
|
|
+ }, {
|
|
|
+ value: false,
|
|
|
+ label: '编辑模式'
|
|
|
+ }],
|
|
|
+ onlyRead: true,
|
|
|
+ showType: "",
|
|
|
page: {
|
|
|
pageSize: 50,
|
|
|
pageSizes: [10, 20, 50, 100],
|
|
@@ -83,7 +98,7 @@ export default {
|
|
|
},
|
|
|
buildMess: null,
|
|
|
filtersArr: [], //表格数据被过滤后的下标
|
|
|
- copyMain: null, //深拷贝数组
|
|
|
+ copyMain: [], //深拷贝数组
|
|
|
activeType: {}
|
|
|
};
|
|
|
},
|
|
@@ -104,46 +119,35 @@ export default {
|
|
|
},
|
|
|
getData(buildMess) {
|
|
|
if (buildMess) {
|
|
|
- this.buildMess = buildMess;
|
|
|
+ this.buildMess = buildMess
|
|
|
}
|
|
|
- // debugger
|
|
|
- // let params = {
|
|
|
- // Filters: this.cenoteId ? `ProjectId='${this.projectId}';structureInfo.ShaftFuncType='${this.cenoteId}'` : `ProjectId='${this.projectId}'`,
|
|
|
- // Orders: "createTime desc, RoomID asc",
|
|
|
- // PageNumber: this.page.pageNumber,
|
|
|
- // PageSize: this.page.pageSize
|
|
|
- // }
|
|
|
- let param = {
|
|
|
- id: this.buildMess.code,
|
|
|
- type: ["Sp"],
|
|
|
- data: {
|
|
|
- customInfo: true,
|
|
|
- criteria: {
|
|
|
- floor: this.buildMess.code, // 必填, 指定楼层id
|
|
|
- business_type: this.activeType.code, // 必填, 楼层下某个类型的业务空间PowerSupplyZone, 默认是空字符串
|
|
|
- rel_type: this.activeType.rel_type, // 必填, 指定业务类型的关系类型(参考数据平台),
|
|
|
- // 数字型字符串, 例如: 通用是99
|
|
|
- }
|
|
|
- },
|
|
|
- ProjId: this.param.ProjId,
|
|
|
- secret: this.param.secret
|
|
|
- };
|
|
|
- isSpaceBuss(param).then(res => {
|
|
|
- if (res.data.Result == "success") {
|
|
|
- this.allData = res.data.Content;
|
|
|
- this.page.total = res.data.Count;
|
|
|
- this.getMain(this.allData);
|
|
|
- } else {
|
|
|
- this.$message.error("请求错误");
|
|
|
- }
|
|
|
- });
|
|
|
+ let params = {
|
|
|
+ zone: this.zoneObj.code,
|
|
|
+ data: {
|
|
|
+ Filters: ``,
|
|
|
+ Orders: "createTime desc, RoomID asc",
|
|
|
+ PageNumber: this.page.pageNumber,
|
|
|
+ PageSize: this.page.pageSize
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.buildMess.selectd && this.buildMess.selectd[0] && this.buildMess.selectd[1]) {
|
|
|
+ params.data.Filters = `BuildingId='${this.buildMess.selectd[0]}';FloorId='${this.buildMess.selectd[1]}'`
|
|
|
+ } else if (this.buildMess.selectd && this.buildMess.selectd[0] && !this.buildMess.selectd[1]) {
|
|
|
+ params.data.Filters = `BuildingId='${this.buildMess.selectd[0]}'`
|
|
|
+ } else {
|
|
|
+ params.data.Filters = `BuildingId='';FloorId=''`
|
|
|
+ }
|
|
|
+ queryZone(params, res => {
|
|
|
+ this.page.total = res.Total
|
|
|
+ this.main = res.Content
|
|
|
+ if (this.main && this.main.length && this.main[0].RoomID) {
|
|
|
+ this.copyMain = tools.deepCopy(this.main);
|
|
|
+ }
|
|
|
+ this.getMain()
|
|
|
+ })
|
|
|
},
|
|
|
//获取表格主体内容
|
|
|
- getMain(main) {
|
|
|
- this.main = main;
|
|
|
- if (this.main && this.main.length && this.main[0].id) {
|
|
|
- this.copyMain = tools.deepCopy(this.main);
|
|
|
- }
|
|
|
+ getMain() {
|
|
|
this.isLoading = true;
|
|
|
if (!!this.hot) {
|
|
|
this.hot.destroy();
|
|
@@ -156,7 +160,6 @@ export default {
|
|
|
//初始化handsontable组件
|
|
|
initHot() {
|
|
|
let id = this.id
|
|
|
- console.log(id)
|
|
|
var container = document.getElementById(this.id);
|
|
|
let winHeight = document.documentElement.clientHeight;
|
|
|
this.hot = new Handsontable(container, {
|
|
@@ -188,7 +191,7 @@ export default {
|
|
|
// 事件
|
|
|
afterChange: this.tdChange, //修改后
|
|
|
afterFilter: this.trimmedRows, //排序前
|
|
|
- beforeRemoveRow: this.romoveFm, //右键删除
|
|
|
+ afterRemoveRow: this.romoveFm, //右键删除
|
|
|
afterOnCellMouseDown: this.eventClick //鼠标点击
|
|
|
});
|
|
|
let pro = document.getElementById("hot-display-license-info");
|
|
@@ -227,8 +230,8 @@ export default {
|
|
|
let val = this.hot.colToProp(row.col);
|
|
|
if (val == "point") {
|
|
|
this.$emit("lookEqu", infos);
|
|
|
- } else if (val == "infos.RoomQRCode") {
|
|
|
- this.qrcodeUrl = this.main[row.row].infos.RoomQRCode
|
|
|
+ } else if (val == "RoomQRCode") {
|
|
|
+ this.qrcodeUrl = this.main[row.row].RoomQRCode
|
|
|
if (!!this.qrcodeUrl) {
|
|
|
this.dialog.qrcode = true;
|
|
|
} else {
|
|
@@ -240,68 +243,52 @@ export default {
|
|
|
},
|
|
|
//表格发生更改
|
|
|
tdChange(changeData, source) {
|
|
|
- let filter = this.filtersArr;
|
|
|
- if (changeData) {
|
|
|
- let param = this.getParam(changeData, source);
|
|
|
- let data = [];
|
|
|
- for (let i = 0; i < param.length; i++) {
|
|
|
- if (!!param[i].id) {
|
|
|
+ if (!this.onlyRead) {
|
|
|
+ if (changeData) {
|
|
|
+ let trimmedArr = this.trimmedRows();
|
|
|
+ let param = handsonUtils.getParam(changeData, source, this.hot, trimmedArr);
|
|
|
+ let data = []
|
|
|
+ for (let i = 0; i < param.length; i++) {
|
|
|
data.push(param[i]);
|
|
|
- } else {
|
|
|
- this.createSq(param[i], changeData);
|
|
|
}
|
|
|
- }
|
|
|
- if (data && data.length) {
|
|
|
- this.updateBusiness(data, changeData);
|
|
|
+ //如果data中包含/且data长度为1,将其转换成.
|
|
|
+ if (changeData.length == 1 && changeData[0][1].indexOf("/") > 0) {
|
|
|
+ changeData[0][1] = changeData[0][1].split("/").join(".")
|
|
|
+ }
|
|
|
+
|
|
|
+ // 存在data进行修改请求
|
|
|
+ if (data && data.length) {
|
|
|
+ this.updateBusiness(data, changeData)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
//右键删除
|
|
|
- romoveFm(index, amout, physicalRows, source) {
|
|
|
- if (physicalRows && physicalRows.length) {
|
|
|
- let items = [],
|
|
|
- text = null;
|
|
|
- physicalRows.map(item => {
|
|
|
- text = text ?
|
|
|
- this.copyMain[item].infos.RoomName + "、" + text :
|
|
|
- this.copyMain[item].infos.RoomName;
|
|
|
- items.push(this.copyMain[item].id);
|
|
|
- });
|
|
|
- this.$confirm("您正在删除" + text + ", 是否继续?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.delBusiness(items);
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.hot.loadData(tools.deepCopy(this.copyMain));
|
|
|
- });
|
|
|
+ romoveFm() {
|
|
|
+ let params = tools.differenceArr(this.main, this.copyMain)
|
|
|
+ if (params.length < 1 || this.main > this.copyMain) {
|
|
|
+ return
|
|
|
}
|
|
|
- },
|
|
|
- delBusiness(items) {
|
|
|
let param = {
|
|
|
- ProjId: this.param.ProjId,
|
|
|
- secret: this.param.secret,
|
|
|
- data: {
|
|
|
- criteria: {
|
|
|
- ids: items
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- delManySpace(param)
|
|
|
- .then(res => {
|
|
|
- if (res.data.Result == "success") {
|
|
|
- this.$message.success("删除成功");
|
|
|
- this.getData();
|
|
|
- } else {
|
|
|
- this.$message.error("删除失败");
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message.error("请求发生错误");
|
|
|
- });
|
|
|
+ data: [],
|
|
|
+ zone: this.zoneObj.code
|
|
|
+ }
|
|
|
+ params.map(item => {
|
|
|
+ param.data.push({RoomID: item.RoomID})
|
|
|
+ })
|
|
|
+ this.$confirm("此操作将删除业务空间,是否继续?", "提示", {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ deleteZone(param, res => {
|
|
|
+ this.$message.success("删除成功!")
|
|
|
+ this.getData()
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.getData()
|
|
|
+ this.$message("取消删除")
|
|
|
+ })
|
|
|
},
|
|
|
// 新建
|
|
|
createSq(param, change) {
|
|
@@ -321,28 +308,28 @@ export default {
|
|
|
},
|
|
|
// 修改
|
|
|
updateBusiness(data, change) {
|
|
|
- let param = {
|
|
|
- ProjId: this.param.ProjId,
|
|
|
- secret: this.param.secret,
|
|
|
- data: {
|
|
|
- criterias: []
|
|
|
- }
|
|
|
+ let param = {
|
|
|
+ data: {
|
|
|
+ Content: [],
|
|
|
+ Projection: []
|
|
|
+ },
|
|
|
+ zone: this.zoneObj.code
|
|
|
};
|
|
|
+ //生成要修改字段列表
|
|
|
+ change.map((item) => {
|
|
|
+ if(item[1] && param.data.Projection.indexOf(item[1]) == -1) {
|
|
|
+ param.data.Projection.push(item[1])
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //生成对应修改数据
|
|
|
data.map((item, index) => {
|
|
|
- console.log(change[index][1]);
|
|
|
- let arr = change[index][1].split(".");
|
|
|
- let info = {};
|
|
|
- info[arr[1]] = [{
|
|
|
- value: change[index][3] != "" ? change[index][3] : null
|
|
|
- }];
|
|
|
- param.data.criterias.push({
|
|
|
- id: item.id,
|
|
|
- infos: info
|
|
|
- });
|
|
|
- });
|
|
|
- updateBusiness(param).then(res => {
|
|
|
- console.log(res);
|
|
|
- });
|
|
|
+ param.data.Projection.map(value => {
|
|
|
+ let itemData = tools.dataForKey(item, value)
|
|
|
+ tools.setDataForKey(item, value, itemData == "" ? null : itemData)
|
|
|
+ })
|
|
|
+ param.data.Content.push(item);
|
|
|
+ })
|
|
|
+ updateZone(param, (res) => {})
|
|
|
},
|
|
|
/** 请求部分 ------------------------------------ */
|
|
|
createSpace(data) {
|
|
@@ -370,43 +357,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- /**
|
|
|
- * 获取被排序后的数组
|
|
|
- *
|
|
|
- * @param changeData 发生改变的数据
|
|
|
- * @param source 数组
|
|
|
- *
|
|
|
- * @return array 经过排序后或者经过搜索后的数组
|
|
|
- */
|
|
|
- getParam(changeData, source) {
|
|
|
- let param = "";
|
|
|
- //被筛选过后的数组
|
|
|
- let trimmedArr = this.trimmedRows();
|
|
|
- //是否启用了排序
|
|
|
- let isSort = this.hot.getPlugin("columnSorting").isSorted();
|
|
|
- if (trimmedArr.length && isSort) {
|
|
|
- //排序后的数组
|
|
|
- let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
|
|
|
- param = changeData.map(item => {
|
|
|
- return this.hot.getSourceDataAtRow(trimmedArr[sortArr[item[0]]]);
|
|
|
- });
|
|
|
- } else if (isSort) {
|
|
|
- //排序后的数组
|
|
|
- let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
|
|
|
- param = changeData.map(item => {
|
|
|
- return this.hot.getSourceDataAtRow(sortArr[item[0]]);
|
|
|
- });
|
|
|
- } else if (trimmedArr.length) {
|
|
|
- param = changeData.map(item => {
|
|
|
- return this.hot.getSourceDataAtRow(trimmedArr[item[0]]);
|
|
|
- });
|
|
|
- } else {
|
|
|
- param = changeData.map(item => {
|
|
|
- return this.hot.getSourceDataAtRow(item[0]);
|
|
|
- });
|
|
|
- }
|
|
|
- return param;
|
|
|
- },
|
|
|
//获取被筛选掉的行号
|
|
|
trimmedRows() {
|
|
|
// var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
|
|
@@ -449,15 +399,8 @@ export default {
|
|
|
*/
|
|
|
delHeader(list) {
|
|
|
let arr = tools.copyArr(list)
|
|
|
- // 如果不是只读状态,添加四大厂商选择
|
|
|
- let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "X", "L", "L1", "L2", "F1", "F2", "M"]
|
|
|
- if (!this.onlyRead) {
|
|
|
- arr = showTools.arrToArr(arr)
|
|
|
- readArr.push("Own")
|
|
|
- }
|
|
|
- let data = showTools.changeHeader(arr, readArr, false, false, true, false, true)
|
|
|
+ let data = showTools.headerTextFilter(arr, "space", this.onlyRead, this.showType)
|
|
|
data.unshift("是否关联平面图", "与空间相关联的设备");
|
|
|
- console.log("header", data)
|
|
|
return data;
|
|
|
},
|
|
|
/**
|
|
@@ -467,19 +410,17 @@ export default {
|
|
|
* @return 处理好的数据格式
|
|
|
*/
|
|
|
getType(list) {
|
|
|
- let arr = tools.copyArr(list)
|
|
|
- let data = showTools.showTypes(arr, false, false, true, false)
|
|
|
+ let arr = tools.copyArr(list)
|
|
|
+ let data = showTools.headerTypeFilter(arr, "space", this.onlyRead, this.showType)
|
|
|
data.unshift({
|
|
|
data: "hasSi",
|
|
|
renderer: this.myRenderer,
|
|
|
readOnly: true
|
|
|
}, {
|
|
|
- data: "point",
|
|
|
- renderer: this.facilityRender,
|
|
|
- readOnly: true
|
|
|
- });
|
|
|
- data = data.filter(item => item);
|
|
|
- console.log(data)
|
|
|
+ data: "point",
|
|
|
+ renderer: this.facilityRender,
|
|
|
+ readOnly: true
|
|
|
+ });
|
|
|
return data;
|
|
|
},
|
|
|
myRenderer(instance, td, row, col, prop, value, cellProperties) {
|
|
@@ -496,97 +437,22 @@ export default {
|
|
|
td.innerHTML = "点击查看";
|
|
|
return td;
|
|
|
},
|
|
|
- //下拉插件修改
|
|
|
- // customDropdownRenderer(
|
|
|
- // instance,
|
|
|
- // td,
|
|
|
- // row,
|
|
|
- // col,
|
|
|
- // prop,
|
|
|
- // value,
|
|
|
- // cellProperties
|
|
|
- // ) {
|
|
|
- // var selectedId;
|
|
|
- // var optionsList = cellProperties.chosenOptions.data;
|
|
|
- // if (
|
|
|
- // typeof optionsList === "undefined" ||
|
|
|
- // typeof optionsList.length === "undefined" ||
|
|
|
- // !optionsList.length
|
|
|
- // ) {
|
|
|
- // Handsontable.renderers.TextRenderer(
|
|
|
- // instance,
|
|
|
- // td,
|
|
|
- // row,
|
|
|
- // col,
|
|
|
- // prop,
|
|
|
- // value,
|
|
|
- // cellProperties
|
|
|
- // );
|
|
|
- // return td;
|
|
|
- // }
|
|
|
- // var values = (value + "").split(",");
|
|
|
- // value = [];
|
|
|
- // for (var index = 0; index < optionsList.length; index++) {
|
|
|
- // if (optionsList[index].content && optionsList[index].content.length) {
|
|
|
- // for (let i = 0; i < optionsList[index].content.length; i++) {
|
|
|
- // if (
|
|
|
- // optionsList[index].content[i] &&
|
|
|
- // optionsList[index].content[i].length
|
|
|
- // ) {
|
|
|
- // for (let j = 0; j < optionsList[index].content[i].length; j++) {
|
|
|
- // if (
|
|
|
- // values.indexOf(
|
|
|
- // optionsList[index].content[i].content[j].code + ""
|
|
|
- // ) > -1
|
|
|
- // ) {
|
|
|
- // selectedId = optionsList[index].content[i].content[j].code;
|
|
|
- // value.push(optionsList[index].content[i].content[j].name);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // if (
|
|
|
- // values.indexOf(optionsList[index].content[i].code + "") > -1
|
|
|
- // ) {
|
|
|
- // selectedId = optionsList[index].content[i].code;
|
|
|
- // value.push(optionsList[index].content[i].name);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // if (values.indexOf(optionsList[index].code + "") > -1) {
|
|
|
- // selectedId = optionsList[index].code;
|
|
|
- // value.push(optionsList[index].name);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // value = value.join(", ");
|
|
|
- // Handsontable.renderers.TextRenderer(
|
|
|
- // instance,
|
|
|
- // td,
|
|
|
- // row,
|
|
|
- // col,
|
|
|
- // prop,
|
|
|
- // value,
|
|
|
- // cellProperties
|
|
|
- // );
|
|
|
- // return td;
|
|
|
- // },
|
|
|
/** 页面中的按钮事件--------------------------- */
|
|
|
addSp() {
|
|
|
// this.dialog.addDevice = true
|
|
|
// this.hot.downloadFile()
|
|
|
// this.hot.getPlugin('exportFile').downloadFile("csv", { columnHeaders: true, exportHiddenRows: true, exportHiddenColumns: true, rowHeaders: true })
|
|
|
- if (this.main && this.main.length && !!this.main[0].id) {
|
|
|
+ if (this.main && this.main.length && !!this.main[0].RoomID) {
|
|
|
this.hot.destroy();
|
|
|
this.hot = null;
|
|
|
this.main.unshift([]);
|
|
|
- this.getMain(this.main);
|
|
|
+ this.getMain();
|
|
|
} else {
|
|
|
if (this.main && this.main.length) {
|
|
|
this.$message.error("请添加完成后继续添加");
|
|
|
} else {
|
|
|
this.main.unshift([]);
|
|
|
- this.getMain(this.main);
|
|
|
+ this.getMain();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -608,29 +474,33 @@ export default {
|
|
|
handleCurrentChange(val) {
|
|
|
this.page.pageNumber = val
|
|
|
this.getData()
|
|
|
- },
|
|
|
- // pageChange() {
|
|
|
- // this.getMain(
|
|
|
- // this.pagination(this.page.currentPage, this.page.size, this.allData)
|
|
|
- // );
|
|
|
- // },
|
|
|
- // pagination(pageNo, pageSize, array) {
|
|
|
- // let offset = (pageNo - 1) * pageSize;
|
|
|
- // return offset + pageSize >= array.length ?
|
|
|
- // array.slice(offset, array.length) :
|
|
|
- // array.slice(offset, offset + pageSize);
|
|
|
- // }
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
projectId() {
|
|
|
this.setData()
|
|
|
this.main = null
|
|
|
+ },
|
|
|
+ showTypes: {
|
|
|
+ handler(newName, oldName) {
|
|
|
+ if (newName && newName[0] && newName[0].value) {
|
|
|
+ this.showType = newName[0].value
|
|
|
+ } else {
|
|
|
+ this.showType = ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ deep: true
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
#handsontable {
|
|
|
+ .left{
|
|
|
+ padding-top: 0;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ }
|
|
|
.no-data {
|
|
|
height: 150px;
|
|
|
line-height: 150px;
|