From d5efa1b1cdbab10b034357ae3e7b65c21754a123 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期六, 11 二月 2023 11:47:01 +0800 Subject: [PATCH] 样式管理界面修改,数据上传添加附件 --- src/views/datamanage/dataUpdata.vue | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 154 insertions(+), 3 deletions(-) diff --git a/src/views/datamanage/dataUpdata.vue b/src/views/datamanage/dataUpdata.vue index 599e1d0..19556e1 100644 --- a/src/views/datamanage/dataUpdata.vue +++ b/src/views/datamanage/dataUpdata.vue @@ -115,7 +115,6 @@ <el-form-item :label="$t('dataManage.dataUpObj.dataSpecialty')"> <el-select :popper-append-to-body="false" - :disabled="tableData.length == 0 ? false : true" v-model="formInline.specialtyId" :placeholder="$t('common.choose')" @@ -393,6 +392,16 @@ size="small" >{{ $t('common.delete') }}</el-button> </el-form-item> + <el-form-item> + <el-button + v-if="menuStatus.upload" + :disabled="multipleDelete.length == 0 ? true : false" + @click="setEnclosure" + icon="el-icon-folder-opened" + type="warning" + size="small" + >{{ $t('common.enclosure') }}</el-button> + </el-form-item> </el-form> </div> <div @@ -457,7 +466,10 @@ :label="$t('dataManage.dataUpObj.tableName')" > <template slot-scope="scope"> - <a @click="detail(scope.row)">{{ scope.row.tab }}</a> + <a + class="scopeRowColor" + @click="detail(scope.row)" + >{{ scope.row.tab }}</a> </template> </el-table-column> <el-table-column @@ -990,6 +1002,35 @@ </div> </el-dialog> + <el-dialog + :title="$t('common.details')" + :visible.sync="enclosureVisible" + :show-close="false" + > + <span + style="font-size:20px" + class="scopeRowColor" + >{{enclosureTitle}}涓嶈兘涓婁紶闄勪欢鏄惁缁х画</span> + <span + slot="footer" + class="dialog-footer" + > + <el-button @click="enclosureVisible = false">鍙� 娑�</el-button> + <el-button + type="primary" + @click="uploadAnFiles" + >缁х画</el-button> + </span> + </el-dialog> + <input + name="file1" + :accept="'.zip'" + type="file" + id="editimageFile" + multiple="multiple" + style="display: none" + @change="uploadAnFilesChange" + /> </div> </template> @@ -1022,6 +1063,7 @@ }, data() { return { + coordinateOption: [], disOptions: [{ name: '宕╁娌荤悊', @@ -1175,7 +1217,10 @@ }, jindutiao: 0, jindudialogVisible: false, - jindutiaoname: [] + jindutiaoname: [], + enclosureData: [], + enclosureVisible: false, + enclosureTitle: '', } }, @@ -1195,6 +1240,109 @@ }, methods: { + //闄勪欢鍙樺寲 + uploadAnFilesChange() { + var formData = new FormData(); + var fs = document.getElementById("editimageFile"); + if (fs.files.length == 0) { + this.$message.error('璇烽�夋嫨瑕佷笂浼犵殑鏂囦欢'); + return; + } + for (var i = 0, c = fs.files.length; i < c; i++) { + formData.append("file", fs.files[i]); // fs.files[i].name,file + } + for (var i in this.enclosureData) { + formData.append('ids', this.enclosureData[i]) + } + const that = this + that.jindudialogVisible = true + that.$set(this, 'jindutiaoname', "闄勪欢涓婁紶") + that.$set(this, 'jindutiao', 0) + this.loading = true; + $.ajax(BASE_URL + "/dataUpload/uploadXlsAnnex?token=" + getToken() + "&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.$set(this, 'jindutiao', 100) + this.$message({ + message: '闄勪欢涓婁紶鎴愬姛', + type: 'success' + }); + + }, + 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浣跨敤 + } + }); + + + + + + + + + + }, + //閫夋嫨涓婁紶闄勪欢鐨勬枃浠� + uploadAnFiles() { + $('#editimageFile').click(); + }, + //涓婁紶闄勪欢 + uploadAnnex() { + + }, + //闄勪欢涓婁紶 + setEnclosure() { + var enclosureData = [ + 'bd.b_pac_hydrogeology', + 'bd.b_pac_frozensoil', + 'bd.b_pac_geologic_hazard', + 'bd.b_pac_marine_meteorological', + 'bd.b_pac_meteorological', + 'bs.m_equipment_nameplate', + 'bs.m_hydraulic_protection', + 'bs.m_marker', + 'bs.s_borehole' + ]; + var std = []; + this.enclosureData = []; + this.enclosureTitle = ""; + for (var i in this.multipleDelete) { + var row = this.multipleDelete[i]; + + if (row.tab && row.rows && enclosureData.indexOf(row.tab) > -1) { + + this.enclosureData.push(row.id) + } else { + std.push(row.name) + } + } + if (std.length != 0) { + this.enclosureTitle = std.toString() + this.enclosureVisible = true; + } else { + this.uploadAnFiles(); + } + }, + //鏉冮檺閰嶇疆 showPermsMenu(res) { switch (res.tag) { @@ -1837,6 +1985,7 @@ }, xhr: function () { var myXhr = $.ajaxSettings.xhr(); + debugger if (myXhr.upload) { //妫�鏌pload灞炴�ф槸鍚﹀瓨鍦� myXhr.upload.addEventListener('progress', that.progressHandlingFunction, false); //缁戝畾progress浜嬩欢鐨勫洖璋冨嚱鏁� } @@ -1884,6 +2033,7 @@ this.entryOption = data.result; this.formInline.entryId = this.entryOption[0].name; this.formInline.dirid = this.entryOption[0].id; + this.getselectVerByDirid(); }, //鑾峰彇鎵�鏈夊潗鏍囩郴 @@ -2192,6 +2342,7 @@ return; } this.catalogOption = this.treeData(res.result); + this.formInline.dirName = this.catalogOption[0].name this.getStartDirChecked(this.catalogOption); this.getselectVerByDirid() }, -- Gitblit v1.9.3