From 98a2b24c89e81a5aacdcbd6b739fef422adf17dd Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期五, 29 三月 2024 09:57:55 +0800 Subject: [PATCH] 代码更新 --- src/views/datamanage/dataUpdata.vue | 1036 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 518 insertions(+), 518 deletions(-) diff --git a/src/views/datamanage/dataUpdata.vue b/src/views/datamanage/dataUpdata.vue index 9023154..10356cf 100644 --- a/src/views/datamanage/dataUpdata.vue +++ b/src/views/datamanage/dataUpdata.vue @@ -1972,559 +1972,559 @@ var fs2 = null; if (this.formInline.uploadType == "v1") { //鍗曟枃浠堕」鐩笂浼� - fs2 = document.getElementById("metaDataFile"); - if (this.pathBak != null && this.pathBak.indexOf("checkMain") > -1) { - if (fs2.files.length == 0) { - return this.$message.error("璇烽�夋嫨闇�瑕佷笂浼犵殑鍏冩暟鎹枃浠�"); - } - } - } else if (this.formInline.uploadType == "v2") { - //鏁翠綋椤圭洰涓婁紶 - fs2 = document.getElementById("wbsDataFile"); - if (fs2.files.length == 0) { - return this.$message.error("璇烽�夋嫨闇�瑕佷笂浼犵殑WBS鏁版嵁鏂囦欢"); - } - } else if (this.formInline.uploadType == "v3") { + // fs2 = document.getElementById("metaDataFile"); + // if (this.pathBak != null && this.pathBak.indexOf("checkMain") > -1) { + // if (fs2.files.length == 0) { + // return this.$message.error("璇烽�夋嫨闇�瑕佷笂浼犵殑鍏冩暟鎹枃浠�"); + // } + // } + } else if(this.formInline.uploadType == "v2") { + //鏁翠綋椤圭洰涓婁紶 + fs2 = document.getElementById("wbsDataFile"); + if (fs2.files.length == 0) { + return this.$message.error("璇烽�夋嫨闇�瑕佷笂浼犵殑WBS鏁版嵁鏂囦欢"); + } +} else if (this.formInline.uploadType == "v3") { +} +for (var i = 0, c = fs1.files.length; i < c; i++) { + formData.append(fs1.files[i].name, fs1.files[i]); + this.fileType.push({ name: fs1.files[i].name, type: "selectData" }); +} +if (fs2 != null) { + for (var i = 0, c = fs2.files.length; i < c; i++) { + formData.append(fs2.files[i].name, fs2.files[i]); + if (this.formInline.uploadType == "v1") { + this.fileType.push({ name: fs2.files[i].name, type: "metaData" }); + } else if (this.formInline.uploadType == "v2") { + this.fileType.push({ name: fs2.files[i].name, type: "wbsData" }); + } + } +} +const that = this; +that.jindudialogVisible = true; +let listval = []; +formData.forEach((key, val) => { + listval.push({ + name: val, + }); +}); +that.$set(this, "jindutiaoname", listval); +that.$set(this, "jindutiao", 0); +// this.loading = true; +$.ajax( + BASE_URL + + "/dataUpload/uploadFiles?token=" + + token + + "&path=" + + this.formInline.path, + { + type: "post", + data: formData, + async: true, + cache: false, + processData: false, + contentType: false, + success: (rs) => { + this.loading = false; + if (rs.code != 200) { + return this.$message.error("鏁版嵁涓婁紶澶辫触"); } - for (var i = 0, c = fs1.files.length; i < c; i++) { - formData.append(fs1.files[i].name, fs1.files[i]); - this.fileType.push({ name: fs1.files[i].name, type: "selectData" }); - } - if (fs2 != null) { - for (var i = 0, c = fs2.files.length; i < c; i++) { - formData.append(fs2.files[i].name, fs2.files[i]); - if (this.formInline.uploadType == "v1") { - this.fileType.push({ name: fs2.files[i].name, type: "metaData" }); - } else if (this.formInline.uploadType == "v2") { - this.fileType.push({ name: fs2.files[i].name, type: "wbsData" }); - } - } - } - const that = this; - that.jindudialogVisible = true; - let listval = []; - formData.forEach((key, val) => { - listval.push({ - name: val, - }); + this.getFileLength(); + this.$set(this, "jindutiao", 100); + this.$message({ + message: "涓婁紶鎴愬姛", + type: "success", }); - that.$set(this, "jindutiaoname", listval); - that.$set(this, "jindutiao", 0); - // this.loading = true; - $.ajax( - BASE_URL + - "/dataUpload/uploadFiles?token=" + - token + - "&path=" + - this.formInline.path, - { - type: "post", - data: formData, - async: true, - cache: false, - processData: false, - contentType: false, - success: (rs) => { - this.loading = false; - if (rs.code != 200) { - return this.$message.error("鏁版嵁涓婁紶澶辫触"); - } - this.getFileLength(); - this.$set(this, "jindutiao", 100); - this.$message({ - message: "涓婁紶鎴愬姛", - type: "success", - }); - this.clearFileSelect(); - }, - error: (rs) => { - this.loading = false; - this.$message.error("鏁版嵁涓婁紶澶辫触"); - }, - xhr: function () { - var myXhr = $.ajaxSettings.xhr(); - - if (myXhr.upload) { - //妫�鏌pload灞炴�ф槸鍚﹀瓨鍦� - myXhr.upload.addEventListener( - "progress", - that.progressHandlingFunction, - false - ); //缁戝畾progress浜嬩欢鐨勫洖璋冨嚱鏁� - } - return myXhr; //xhr瀵硅薄杩斿洖缁檍Query浣跨敤 - }, - } - ); + this.clearFileSelect(); }, - progressHandlingFunction(event) { - var loaded = event.loaded; //宸蹭笂浼� - var loaded = Math.floor(100 * (event.loaded / event.total) - 1); //璁$畻宸茬粡涓婁紶鐨勭櫨鍒嗘瘮 - $("#prog").html(loaded + "%"); //搴旂敤鍒版樉绀篣I锛屽彲鏍规嵁鑷繁闇�瑕佷慨鏀� - this.jindutiao = loaded; - this.$set(this, "jindutiao", loaded); + error: (rs) => { + this.loading = false; + this.$message.error("鏁版嵁涓婁紶澶辫触"); }, - format(percentage) { + xhr: function () { + var myXhr = $.ajaxSettings.xhr(); - // return percentage === 100 ? "涓婁紶瀹屾瘯" : `${percentage}%`; - var label; - if (this.sc.label1 == "涓婁紶") { - label = "涓婁紶瀹屾瘯" - } else { - label = `${percentage}%` + if (myXhr.upload) { + //妫�鏌pload灞炴�ф槸鍚﹀瓨鍦� + myXhr.upload.addEventListener( + "progress", + that.progressHandlingFunction, + false + ); //缁戝畾progress浜嬩欢鐨勫洖璋冨嚱鏁� } - return percentage === 100 ? label : `${percentage}%`; + return myXhr; //xhr瀵硅薄杩斿洖缁檍Query浣跨敤 }, + } +); + }, +progressHandlingFunction(event) { + var loaded = event.loaded; //宸蹭笂浼� + var loaded = Math.floor(100 * (event.loaded / event.total) - 1); //璁$畻宸茬粡涓婁紶鐨勭櫨鍒嗘瘮 + $("#prog").html(loaded + "%"); //搴旂敤鍒版樉绀篣I锛屽彲鏍规嵁鑷繁闇�瑕佷慨鏀� + this.jindutiao = loaded; + this.$set(this, "jindutiao", loaded); +}, +format(percentage) { + + // return percentage === 100 ? "涓婁紶瀹屾瘯" : `${percentage}%`; + var label; + if (this.sc.label1 == "涓婁紶") { + label = "涓婁紶瀹屾瘯" + } else { + label = `${percentage}%` + } + return percentage === 100 ? label : `${percentage}%`; +}, //鑾峰彇鏂囦欢涓婁紶璺緞 async getFilePath() { - const res = await dataUploadSelectPath(); - if (res.code != 200) { - this.$message.error("鏂囦欢涓婁紶璺緞鑾峰彇澶辫触"); - return; - } - this.formInline.path = res.result; - }, - //椤圭洰鍚嶇О鍒囨崲 - entryNameChange(res) { - var val = this.entryOption.filter((rs) => { - if (rs.name == res) { - return rs; - } - }); - this.pathBak = val[0].checks; - this.formInline.dirid = val[0].id; - this.getselectVerByDirid(); - }, + const res = await dataUploadSelectPath(); + if (res.code != 200) { + this.$message.error("鏂囦欢涓婁紶璺緞鑾峰彇澶辫触"); + return; + } + this.formInline.path = res.result; +}, +//椤圭洰鍚嶇О鍒囨崲 +entryNameChange(res) { + var val = this.entryOption.filter((rs) => { + if (rs.name == res) { + return rs; + } + }); + this.pathBak = val[0].checks; + this.formInline.dirid = val[0].id; + this.getselectVerByDirid(); +}, //鑾峰彇椤圭洰鍚嶇О async setProjectName() { - const data = await dataUpload_selectProject(); - if (data.code != 200) { - this.$message.error("椤圭洰鍒楄〃鑾峰彇澶辫触"); - return; - } - this.entryOption = data.result; - this.formInline.entryId = this.entryOption[0].name; - this.formInline.dirid = this.entryOption[0].id; + const data = await dataUpload_selectProject(); + if (data.code != 200) { + this.$message.error("椤圭洰鍒楄〃鑾峰彇澶辫触"); + return; + } + this.entryOption = data.result; + this.formInline.entryId = this.entryOption[0].name; + this.formInline.dirid = this.entryOption[0].id; - this.getselectVerByDirid(); - }, + this.getselectVerByDirid(); +}, //鑾峰彇鎵�鏈夊潗鏍囩郴 async setCoordinateSystem() { - const data = await dataUpload_selectCoords(); - if (data.code != 200) { - this.$message.error("鍧愭爣绯诲垪琛ㄨ幏鍙栧け璐�"); - return; - } - this.coordinateOption = data.result; - this.formInline.coordinateId = this.coordinateOption[0].epsgcode; - }, - //WBS鏁版嵁閫夋嫨 - setWBSFile() { - $("#wbsDataFile").click(); - }, - //閲嶇疆WPS閫夋嫨 - restWBSFile() { - this.formInline.wbsData = "璇烽�夋嫨WBS鏁版嵁"; - document.getElementById("wbsDataFile").value = ""; - }, - //WBS鏁版嵁Change浜嬩欢 - handleWBSFileChange(event) { - var std = []; - var len = event.currentTarget.files.length; - for (var i = 0; i < len; i++) { - var f = event.currentTarget.files[i]; - std.push(f.name); - } - this.formInline.wbsData = std.toString(); - }, - //鏁版嵁璐ㄦ寮圭獥鍏抽棴--椤圭洰鏁翠綋 - handleTestQuayCloseDown() { - this.$confirm("纭鍏抽棴锛�") - .then((_) => { - this.closeTestQuayCloseDialog(); - }) - .catch((_) => { - }); - }, - closeTestQuayCloseDialog() { - this.testQuayVisible = false; - }, - //鏁版嵁璐ㄦ寮圭獥鍏抽棴--鍗曟枃浠� - handleQuayTestCloseDown() { - this.$confirm("纭鍏抽棴锛�") - .then((_) => { - this.closeQuayTestCloseDialog(); - }) - .catch((_) => { - }); - }, - closeQuayTestCloseDialog() { - this.quayTestVisible = false; - }, - //鏁版嵁璐ㄦ鐐瑰嚮浜嬩欢 - handleQuayTestClick() { - if (this.pathBak == null) { - return this.$message("鏃犺川妫�鏂规"); - } - if (this.multipleSelection.length == 0) { - return this.$message("璇烽�夋嫨闇�瑕佽川妫�鐨勬枃浠�"); - } - if (this.formInline.uploadType == "v1") { + const data = await dataUpload_selectCoords(); + if (data.code != 200) { + this.$message.error("鍧愭爣绯诲垪琛ㄨ幏鍙栧け璐�"); + return; + } + this.coordinateOption = data.result; + this.formInline.coordinateId = this.coordinateOption[0].epsgcode; +}, +//WBS鏁版嵁閫夋嫨 +setWBSFile() { + $("#wbsDataFile").click(); +}, +//閲嶇疆WPS閫夋嫨 +restWBSFile() { + this.formInline.wbsData = "璇烽�夋嫨WBS鏁版嵁"; + document.getElementById("wbsDataFile").value = ""; +}, +//WBS鏁版嵁Change浜嬩欢 +handleWBSFileChange(event) { + var std = []; + var len = event.currentTarget.files.length; + for (var i = 0; i < len; i++) { + var f = event.currentTarget.files[i]; + std.push(f.name); + } + this.formInline.wbsData = std.toString(); +}, +//鏁版嵁璐ㄦ寮圭獥鍏抽棴--椤圭洰鏁翠綋 +handleTestQuayCloseDown() { + this.$confirm("纭鍏抽棴锛�") + .then((_) => { + this.closeTestQuayCloseDialog(); + }) + .catch((_) => { + }); +}, +closeTestQuayCloseDialog() { + this.testQuayVisible = false; +}, +//鏁版嵁璐ㄦ寮圭獥鍏抽棴--鍗曟枃浠� +handleQuayTestCloseDown() { + this.$confirm("纭鍏抽棴锛�") + .then((_) => { + this.closeQuayTestCloseDialog(); + }) + .catch((_) => { + }); +}, +closeQuayTestCloseDialog() { + this.quayTestVisible = false; +}, +//鏁版嵁璐ㄦ鐐瑰嚮浜嬩欢 +handleQuayTestClick() { + if (this.pathBak == null) { + return this.$message("鏃犺川妫�鏂规"); + } + if (this.multipleSelection.length == 0) { + return this.$message("璇烽�夋嫨闇�瑕佽川妫�鐨勬枃浠�"); + } + if (this.formInline.uploadType == "v1") { - var value = this.getCheckedKeys - var fileType = value.data.fullName; - this.quayTestForms.names = fileType; - this.quayTestForms.sjzy = this.formInline.specialtyId; - this.quayTestVisible = true; - } else if (this.formInline.uploadType == "v2") { - var fileZip = []; - var fileExcel = []; - for (var i in this.multipleSelection) { - if (this.multipleSelection[i].name.indexOf(".zip") != -1) { - fileZip.push(this.multipleSelection[i].name); - } else if (this.multipleSelection[i].name.indexOf(".xls") != -1) { - fileExcel.push(this.multipleSelection[i].name); - } else if (this.multipleSelection[i].name.indexOf(".xlsx") != -1) { - fileExcel.push(this.multipleSelection[i].name); - } - } - - if (fileZip.length != 1) { - return this.$message("璇烽�夋嫨涓�涓暣浣撻」鐩枃浠�"); - } - if (fileExcel.length != 1) { - return this.$message("璇烽�夋嫨涓�涓猈BS鏂囦欢"); - } - - this.formCheckAll.names = JSON.parse(this.pathBak).toString(); - var val = this.entryOption.filter((res) => { - if (res.id == this.formInline.dirid) { - return res; - } - }); - - this.formCheckAll.xmmc = val[0].name; - this.formCheckAll.sjzy = this.formInline.specialtyId; - if (this.formCheckAll.sjzy.indexOf("鍦扮伨") != -1) { - this.formCheckAll.isDiZai = "YES"; - this.formCheckAll.diZaiType = this.disOptions[0].value; - } else { - this.formCheckAll.isDiZai = "NO"; - this.formCheckAll.diZaiType = "NO"; - } - this.testQuayVisible = true; + var value = this.getCheckedKeys + var fileType = value.data.fullName; + this.quayTestForms.names = fileType; + this.quayTestForms.sjzy = this.formInline.specialtyId; + this.quayTestVisible = true; + } else if (this.formInline.uploadType == "v2") { + var fileZip = []; + var fileExcel = []; + for (var i in this.multipleSelection) { + if (this.multipleSelection[i].name.indexOf(".zip") != -1) { + fileZip.push(this.multipleSelection[i].name); + } else if (this.multipleSelection[i].name.indexOf(".xls") != -1) { + fileExcel.push(this.multipleSelection[i].name); + } else if (this.multipleSelection[i].name.indexOf(".xlsx") != -1) { + fileExcel.push(this.multipleSelection[i].name); } - }, + } + + if (fileZip.length != 1) { + return this.$message("璇烽�夋嫨涓�涓暣浣撻」鐩枃浠�"); + } + if (fileExcel.length != 1) { + return this.$message("璇烽�夋嫨涓�涓猈BS鏂囦欢"); + } + + this.formCheckAll.names = JSON.parse(this.pathBak).toString(); + var val = this.entryOption.filter((res) => { + if (res.id == this.formInline.dirid) { + return res; + } + }); + + this.formCheckAll.xmmc = val[0].name; + this.formCheckAll.sjzy = this.formInline.specialtyId; + if (this.formCheckAll.sjzy.indexOf("鍦扮伨") != -1) { + this.formCheckAll.isDiZai = "YES"; + this.formCheckAll.diZaiType = this.disOptions[0].value; + } else { + this.formCheckAll.isDiZai = "NO"; + this.formCheckAll.diZaiType = "NO"; + } + this.testQuayVisible = true; + } +}, //涓婁紶鏁版嵁鍒楄〃娓呭崟鍒犻櫎 async setWarehouseDel() { - this.loading = true; - var std = []; - for (var i in this.multipleDelete) { - std.push(this.multipleDelete[i].id); - } + this.loading = true; + var std = []; + for (var i in this.multipleDelete) { + std.push(this.multipleDelete[i].id); + } - const res = await dataUpload_deleteMetas({ ids: std.toString() }); - this.loading = false; - if (res.code != 200) { - this.$message.error("鍒犻櫎澶辫触"); - } else { - this.$message({ - message: "鍒犻櫎鎴愬姛", - type: "success", - }); - this.setStartWareTable(); - } - }, - //涓婁紶鏁版嵁鍒楄〃娓呭崟鏌ヨ - setWarehouseSearch() { - this.listData = { - pageIndex: 1, - pageSize: 10, - name: this.formWarehousing.name, - }; - this.getAllWareTable(); - }, - //涓婁紶鏁版嵁鍒楄〃閲嶇疆 - setWarehouseReset() { - this.formWarehousing.name = ""; - this.listData = { - pageIndex: 1, - pageSize: 10, - name: null, - }; - this.getAllWareTable(); - }, - //鏍煎紡鍖栨椂闂� - changetimeFile(res) { - var time = new Date(res.createTime); - var y = time.getFullYear(); - var m = time.getMonth() + 1; - var d = time.getDate(); - var h = time.getHours(); - var mm = time.getMinutes(); - var s = time.getSeconds(); - return ( - y + - "-" + - this.add0(m) + - "-" + - this.add0(d) + - " " + - h + - ":" + - mm + - ":" + - s - ); - }, - //鏍煎紡鍖栨椂闂� - add0(m) { - return m < 10 ? "0" + m : m; - }, - //澶у皬鍊兼敼鍙� - changeSizeFile(row, column, cellValue, index) { - if (cellValue >= 1024) { - return parseFloat(cellValue / 1204).toFixed(3) + "GB"; - } else { - return cellValue + "MB"; - } - }, - //涓婁紶鏁版嵁鍒楄〃娓呭崟閫夋嫨 - handleDelteChange(val) { - this.multipleDelete = val; - }, - //涓婁紶鏁版嵁鍒楄〃娓呭崟鍒濆鍖� - setStartWareTable() { - // this.listData = { - // pageIndex: 1, - // pageSize: 10, - // name: null, - // }; - this.listData.pageIndex = 1; - this.listData.name = null; - this.getAllWareTable(); - }, + const res = await dataUpload_deleteMetas({ ids: std.toString() }); + this.loading = false; + if (res.code != 200) { + this.$message.error("鍒犻櫎澶辫触"); + } else { + this.$message({ + message: "鍒犻櫎鎴愬姛", + type: "success", + }); + this.setStartWareTable(); + } +}, +//涓婁紶鏁版嵁鍒楄〃娓呭崟鏌ヨ +setWarehouseSearch() { + this.listData = { + pageIndex: 1, + pageSize: 10, + name: this.formWarehousing.name, + }; + this.getAllWareTable(); +}, +//涓婁紶鏁版嵁鍒楄〃閲嶇疆 +setWarehouseReset() { + this.formWarehousing.name = ""; + this.listData = { + pageIndex: 1, + pageSize: 10, + name: null, + }; + this.getAllWareTable(); +}, +//鏍煎紡鍖栨椂闂� +changetimeFile(res) { + var time = new Date(res.createTime); + var y = time.getFullYear(); + var m = time.getMonth() + 1; + var d = time.getDate(); + var h = time.getHours(); + var mm = time.getMinutes(); + var s = time.getSeconds(); + return ( + y + + "-" + + this.add0(m) + + "-" + + this.add0(d) + + " " + + h + + ":" + + mm + + ":" + + s + ); +}, +//鏍煎紡鍖栨椂闂� +add0(m) { + return m < 10 ? "0" + m : m; +}, +//澶у皬鍊兼敼鍙� +changeSizeFile(row, column, cellValue, index) { + if (cellValue >= 1024) { + return parseFloat(cellValue / 1204).toFixed(3) + "GB"; + } else { + return cellValue + "MB"; + } +}, +//涓婁紶鏁版嵁鍒楄〃娓呭崟閫夋嫨 +handleDelteChange(val) { + this.multipleDelete = val; +}, +//涓婁紶鏁版嵁鍒楄〃娓呭崟鍒濆鍖� +setStartWareTable() { + // this.listData = { + // pageIndex: 1, + // pageSize: 10, + // name: null, + // }; + this.listData.pageIndex = 1; + this.listData.name = null; + this.getAllWareTable(); +}, //鑾峰彇鏁版嵁涓婁紶鍒楄〃娓呭崟 async getAllWareTable() { - const res = await dataUpload_selectByPageForUpload(this.listData); - if (res.code != 200) { - this.$message.error("鍒楄〃鏁版嵁鑾峰彇澶辫触"); - return; - } - this.count = res.count; - this.waretableData = res.result; - }, - //鏁版嵁涓婁紶鍒楄〃娓呭崟page Count 鍒囨崲 - handleSizeChange(val) { - this.listData.pageIndex = 1; - this.listData.pageSize = val; - this.getAllWareTable(); - }, + const res = await dataUpload_selectByPageForUpload(this.listData); + if (res.code != 200) { + this.$message.error("鍒楄〃鏁版嵁鑾峰彇澶辫触"); + return; + } + this.count = res.count; + this.waretableData = res.result; +}, +//鏁版嵁涓婁紶鍒楄〃娓呭崟page Count 鍒囨崲 +handleSizeChange(val) { + this.listData.pageIndex = 1; + this.listData.pageSize = val; + this.getAllWareTable(); +}, - //鏁版嵁涓婁紶鍒楄〃娓呭崟page鍒囨崲 - handleCurrentChange(val) { - this.listData.pageIndex = val; - this.getAllWareTable(); - }, - //涓婁紶鏁版嵁琛ㄦ牸閫夋嫨 - handleSelectionChange(res) { - this.multipleSelection = res; - }, +//鏁版嵁涓婁紶鍒楄〃娓呭崟page鍒囨崲 +handleCurrentChange(val) { + this.listData.pageIndex = val; + this.getAllWareTable(); +}, +//涓婁紶鏁版嵁琛ㄦ牸閫夋嫨 +handleSelectionChange(res) { + this.multipleSelection = res; +}, - //閫夋嫨鏁版嵁鏂囦欢鍒囨崲 - handleSelectFileChange(event) { - var std = []; - var len = event.currentTarget.files.length; - for (var i = 0; i < len; i++) { - var f = event.currentTarget.files[i]; - std.push(f.name); - } - this.formInline.specialtyData = std.toString(); - }, - //閫夋嫨鍏冩暟鎹� - setMetaFile() { - $("#metaDataFile").click(); - }, - //閲嶇疆鍏冩暟鎹� - restMetaFile() { - this.formInline.metaData = "璇烽�夋嫨鍏冩暟鎹�"; - document.getElementById("metaDataFile").value = ""; - }, - //閫夋嫨鍏冩暟鎹枃浠跺垏鎹� - handleMetaFileChange(event) { - var std = []; - var len = event.currentTarget.files.length; - for (var i = 0; i < len; i++) { - var f = event.currentTarget.files[i]; - std.push(f.name); - } - this.formInline.metaData = std.toString(); - this.metaFileData = std; - }, +//閫夋嫨鏁版嵁鏂囦欢鍒囨崲 +handleSelectFileChange(event) { + var std = []; + var len = event.currentTarget.files.length; + for (var i = 0; i < len; i++) { + var f = event.currentTarget.files[i]; + std.push(f.name); + } + this.formInline.specialtyData = std.toString(); +}, +//閫夋嫨鍏冩暟鎹� +setMetaFile() { + $("#metaDataFile").click(); +}, +//閲嶇疆鍏冩暟鎹� +restMetaFile() { + this.formInline.metaData = "璇烽�夋嫨鍏冩暟鎹�"; + document.getElementById("metaDataFile").value = ""; +}, +//閫夋嫨鍏冩暟鎹枃浠跺垏鎹� +handleMetaFileChange(event) { + var std = []; + var len = event.currentTarget.files.length; + for (var i = 0; i < len; i++) { + var f = event.currentTarget.files[i]; + std.push(f.name); + } + this.formInline.metaData = std.toString(); + this.metaFileData = std; +}, - //From琛ㄥ崟鍒濆鍖� - setFromStart() { - this.formInline.verid = null; - this.formInline.specialtyId = "娴嬮噺涓撲笟"; - this.formInline.specialtyData = "璇烽�夋嫨鏁版嵁"; - this.formInline.metaData = "璇烽�夋嫨鍏冩暟鎹�"; - this.formInline.entryId = null; - this.formInline.selectFileType = "*.*"; - this.formInline.coordinateId = this.coordinateOption[0].epsgcode; - this.formInline.medium = ""; - this.formInline.tab = ""; - }, - //閫夋嫨鏁版嵁 - setSelectFile() { - $("#selectDataFile").click(); - }, - //閲嶇疆鏁版嵁 - restSelectFile() { - this.formInline.specialtyData = "璇烽�夋嫨鏁版嵁"; - document.getElementById("selectDataFile").value = ""; - }, - //鍏ュ簱绫诲瀷鍒囨崲 - uploadTypeChange(res) { - this.setFromStart(); - if (res == "v2") { - this.uploadFlag = false; - this.formInline.selectFileType = ".zip"; - this.formInline.entryId = this.entryOption[0].name; - this.formInline.dirid = this.entryOption[0].id; - this.getselectVerByDirid(); - this.pathBak = this.entryOption[0].checks; - } else if (res == "v3") { - this.formInline.selectFileType = ".kml"; - this.getSelectdirTab(); - this.getselectVerByDirid(); - this.formInline.specialtyId = "绾胯矾涓撲笟"; - this.uploadFlag = true; - this.formInline.tab = this.lineOptions[0].value; - this.formInline.medium = this.mediumOptions[0].value - } else { - this.getSelectdirTab(); - this.getselectVerByDirid(); - this.uploadFlag = true; - } - this.formInline.uploadType = res; - }, +//From琛ㄥ崟鍒濆鍖� +setFromStart() { + this.formInline.verid = null; + this.formInline.specialtyId = "娴嬮噺涓撲笟"; + this.formInline.specialtyData = "璇烽�夋嫨鏁版嵁"; + this.formInline.metaData = "璇烽�夋嫨鍏冩暟鎹�"; + this.formInline.entryId = null; + this.formInline.selectFileType = "*.*"; + this.formInline.coordinateId = this.coordinateOption[0].epsgcode; + this.formInline.medium = ""; + this.formInline.tab = ""; +}, +//閫夋嫨鏁版嵁 +setSelectFile() { + $("#selectDataFile").click(); +}, +//閲嶇疆鏁版嵁 +restSelectFile() { + this.formInline.specialtyData = "璇烽�夋嫨鏁版嵁"; + document.getElementById("selectDataFile").value = ""; +}, +//鍏ュ簱绫诲瀷鍒囨崲 +uploadTypeChange(res) { + this.setFromStart(); + if (res == "v2") { + this.uploadFlag = false; + this.formInline.selectFileType = ".zip"; + this.formInline.entryId = this.entryOption[0].name; + this.formInline.dirid = this.entryOption[0].id; + this.getselectVerByDirid(); + this.pathBak = this.entryOption[0].checks; + } else if (res == "v3") { + this.formInline.selectFileType = ".kml"; + this.getSelectdirTab(); + this.getselectVerByDirid(); + this.formInline.specialtyId = "绾胯矾涓撲笟"; + this.uploadFlag = true; + this.formInline.tab = this.lineOptions[0].value; + this.formInline.medium = this.mediumOptions[0].value + } else { + this.getSelectdirTab(); + this.getselectVerByDirid(); + this.uploadFlag = true; + } + this.formInline.uploadType = res; +}, //鐗堟湰鍙疯幏鍙� async getselectVerByDirid() { - this.verOption = []; + this.verOption = []; - const res = await dataUploadSelectVerByDirid({ - dirid: this.formInline.dirid, - }); + const res = await dataUploadSelectVerByDirid({ + dirid: this.formInline.dirid, + }); - if (res.code != 200) { - this.$message.error("鐗堟湰鍒楄〃鑾峰彇澶辫触"); - return; - } - this.verOption = res.result; - this.formInline.verid = res.result[0].id; - }, + if (res.code != 200) { + this.$message.error("鐗堟湰鍒楄〃鑾峰彇澶辫触"); + return; + } + this.verOption = res.result; + this.formInline.verid = res.result[0].id; +}, //鐩綍鍒楄〃鑾峰彇 async getSelectdirTab() { - const res = await selectdirTab(); - if (res.code != 200) { - this.$message.error("鐩綍鍒楄〃鑾峰彇澶辫触"); - return; - } + const res = await selectdirTab(); + if (res.code != 200) { + this.$message.error("鐩綍鍒楄〃鑾峰彇澶辫触"); + return; + } - this.catalogOption = this.treeData(res.result); - this.formInline.dirName = this.catalogOption[0].name; - this.formInline.dirid = this.catalogOption[0].id; - // this.getStartDirChecked(this.catalogOption); - this.getselectVerByDirid(); - }, + this.catalogOption = this.treeData(res.result); + this.formInline.dirName = this.catalogOption[0].name; + this.formInline.dirid = this.catalogOption[0].id; + // this.getStartDirChecked(this.catalogOption); + this.getselectVerByDirid(); +}, - getStartDirChecked(res) { - if (res.length != 0) { - if (res[0].children == null || res[0].children == undefined) { - this.formInline.dirid = res[0].id; - } else { - this.getStartDirChecked(res[0].children); - } - } - }, - //鍗曟枃浠惰川妫�寮圭獥鍒濆鍖� - startQuayTestForms() { - (this.quayTestForms = { - tolerance: "0.001", - gcdOffset: "20", - rangeOffset: "200", - kzdOffset: "100", - xgMax: "0.005", - coordinateSystem: "CGCS2000/degree", - imgResolution: "0.2", - demTolerance: "5", - demChangeRate: "200", - lazDensity: "1", - imgResolution: "0.2", - }), - (this.quayTestShow = { - checkOsgb: false, - checkXls: false, - checkLaz: false, - checkDem: false, - checkAttrs: false, - checkTopology: false, - checkDecorate: false, - checkOrigin: false, - checkDom: false, - checkMath: false, - checkMeta: false, - checkMain: false, - }); - }, - //鐩綍鍒囨崲 - catalogChange(data, node, nodeData) { - this.startQuayTestForms(); - // this.$refs['selectcascader'].dropDownVisible = false - // var value = this.$refs['selectcascader'].getCheckedNodes(); +getStartDirChecked(res) { + if (res.length != 0) { + if (res[0].children == null || res[0].children == undefined) { + this.formInline.dirid = res[0].id; + } else { + this.getStartDirChecked(res[0].children); + } + } +}, +//鍗曟枃浠惰川妫�寮圭獥鍒濆鍖� +startQuayTestForms() { + (this.quayTestForms = { + tolerance: "0.001", + gcdOffset: "20", + rangeOffset: "200", + kzdOffset: "100", + xgMax: "0.005", + coordinateSystem: "CGCS2000/degree", + imgResolution: "0.2", + demTolerance: "5", + demChangeRate: "200", + lazDensity: "1", + imgResolution: "0.2", + }), + (this.quayTestShow = { + checkOsgb: false, + checkXls: false, + checkLaz: false, + checkDem: false, + checkAttrs: false, + checkTopology: false, + checkDecorate: false, + checkOrigin: false, + checkDom: false, + checkMath: false, + checkMeta: false, + checkMain: false, + }); +}, +//鐩綍鍒囨崲 +catalogChange(data, node, nodeData) { + this.startQuayTestForms(); + // this.$refs['selectcascader'].dropDownVisible = false + // var value = this.$refs['selectcascader'].getCheckedNodes(); - var bak = node.data.checks; - this.getCheckedKeys = node - this.pathBak = bak; - if (bak != null) { - for (var key in this.quayTestShow) { - if (bak.indexOf(key) != -1) { - this.quayTestShow[key] = true; - } - } + var bak = node.data.checks; + this.getCheckedKeys = node + this.pathBak = bak; + if (bak != null) { + for (var key in this.quayTestShow) { + if (bak.indexOf(key) != -1) { + this.quayTestShow[key] = true; } - var fileType = node.data.exts; - if (fileType == null) { - fileType = "*.*"; - } - this.formInline.selectFileType = fileType; - this.formInline.dirid = node.data.id; - this.formInline.dirName = node.data.name; - this.getselectVerByDirid(); - setTimeout(() => { - this.$refs.multiSelect.blur() - }, 100) - }, - //Tabsq鍒囨崲 - handleTabClick(tab, event) { - if (tab.name == "second") { - this.setStartWareTable(); - } else { - this.noteVisible = true - } - this.calHeight(); - }, - //鏍戝垪琛ㄧ敓鎴� - treeData(source) { - let cloneData = JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 - return cloneData.filter((father) => { - // 寰幆鎵�鏈夐」 - let branchArr = cloneData.filter((child) => father.id == child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 - branchArr.length > 0 ? (father.children = branchArr) : ""; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� - return father.pid == 0; // 杩斿洖涓�绾ц彍鍗� - }); - }, + } + } + var fileType = node.data.exts; + if (fileType == null) { + fileType = "*.*"; + } + this.formInline.selectFileType = fileType; + this.formInline.dirid = node.data.id; + this.formInline.dirName = node.data.name; + this.getselectVerByDirid(); + setTimeout(() => { + this.$refs.multiSelect.blur() + }, 100) +}, +//Tabsq鍒囨崲 +handleTabClick(tab, event) { + if (tab.name == "second") { + this.setStartWareTable(); + } else { + this.noteVisible = true + } + this.calHeight(); +}, +//鏍戝垪琛ㄧ敓鎴� +treeData(source) { + let cloneData = JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 + return cloneData.filter((father) => { + // 寰幆鎵�鏈夐」 + let branchArr = cloneData.filter((child) => father.id == child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + branchArr.length > 0 ? (father.children = branchArr) : ""; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� + return father.pid == 0; // 杩斿洖涓�绾ц彍鍗� + }); +}, }, }; </script> -- Gitblit v1.9.3