From 8f200f2db870c5a006ea2a7f5c1b159bdde858e3 Mon Sep 17 00:00:00 2001 From: xzt <1113240624@qq.com> Date: Fri, 24 May 2024 17:25:54 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/linkNameSelect/linkDike.vue | 111 ++++++++++++++++++ src/components/linkNameSelect/linkSluice.vue | 111 ++++++++++++++++++ src/components/myUpload/index.vue | 93 +++++++++++++++ src/main.js | 9 ++ src/utils/directives/select.js | 14 +++ src/utils/fileUpload.js | 38 ++++++ .../dikeBaseInfo/index.vue | 25 +++- .../components/markForm.vue | 20 ++-- .../identificationPlate/index.vue | 32 ++++- .../archivesManagement/index.vue | 12 +- .../fundGuarantee/index.vue | 45 ++++++- .../listPage/index.vue | 26 ++-- .../confirmDelimitationManage/index.vue | 20 ++-- .../declare/components/listPage/index.vue | 6 +- .../floodControlManagement/power.vue | 53 +++++++-- .../floodControlManagement/preplan.vue | 35 ++++-- .../floodControlManagement/supplies.vue | 58 +++++---- .../floodControlManagement/tissue.vue | 68 ++++++++++- .../components/list.vue | 32 ++++- .../safeProduction/components/list.vue | 21 +++- .../components/markForm.vue | 6 +- .../identificationPlate/index.vue | 22 +++- .../sluiceBaseInfo/index.vue | 13 ++ .../archivesManagement/index.vue | 12 +- .../fundGuarantee/index.vue | 46 +++++++- .../listPage/index.vue | 26 ++-- .../confirmDelimitationManage/index.vue | 20 ++-- .../declare/components/listPage/index.vue | 6 +- .../floodControlManagement/power.vue | 44 +++++-- .../floodControlManagement/preplan.vue | 41 ++++++- .../floodControlManagement/supplies.vue | 39 +++++- .../floodControlManagement/tissue.vue | 10 +- .../components/list.vue | 14 ++- .../safeProduction/components/list.vue | 12 +- 34 files changed, 981 insertions(+), 159 deletions(-) create mode 100644 src/components/linkNameSelect/linkDike.vue create mode 100644 src/components/linkNameSelect/linkSluice.vue create mode 100644 src/components/myUpload/index.vue create mode 100644 src/utils/directives/select.js create mode 100644 src/utils/fileUpload.js diff --git a/src/components/linkNameSelect/linkDike.vue b/src/components/linkNameSelect/linkDike.vue new file mode 100644 index 0000000..83f416d --- /dev/null +++ b/src/components/linkNameSelect/linkDike.vue @@ -0,0 +1,111 @@ + + + + + + diff --git a/src/components/linkNameSelect/linkSluice.vue b/src/components/linkNameSelect/linkSluice.vue new file mode 100644 index 0000000..e96caf0 --- /dev/null +++ b/src/components/linkNameSelect/linkSluice.vue @@ -0,0 +1,111 @@ + + + + + + diff --git a/src/components/myUpload/index.vue b/src/components/myUpload/index.vue new file mode 100644 index 0000000..1a9344f --- /dev/null +++ b/src/components/myUpload/index.vue @@ -0,0 +1,93 @@ + + + + + 点击上传 + + + 支持jpg/png/pdf/word/excel文件等,不超过200M + + + + diff --git a/src/main.js b/src/main.js index ef8d997..57c7708 100644 --- a/src/main.js +++ b/src/main.js @@ -20,6 +20,7 @@ import './permission' // permission control import { getDicts } from "@/api/system/dict/data"; import { getConfigKey } from "@/api/system/config"; import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi"; +import MyUpload from "@/components/myUpload"; import Pagination from "@/components/Pagination"; //自定义表格工具扩展 import RightToolbar from "@/components/RightToolbar" @@ -81,6 +82,13 @@ Vue.prototype.$formatAdcd=function(row) { } } +import { fileBeforeUpload } from "@/utils/fileUpload"; +Vue.prototype.$fileBeforeUpload=fileBeforeUpload +import select from "@/utils/directives/select"; +Object.keys(select).forEach(item => { + Vue.directive(item, select[item]) +}) + // 全局方法挂载 Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey @@ -118,6 +126,7 @@ Vue.use(Viewer); // 全局挂载echarts // Vue.component('v-chart',v_echarts); // 全局组件挂载 +Vue.component('MyUpload', MyUpload) Vue.component('Pagination', Pagination) Vue.component('RightToolbar', RightToolbar) // 上传文件组件 diff --git a/src/utils/directives/select.js b/src/utils/directives/select.js new file mode 100644 index 0000000..4e0f5a3 --- /dev/null +++ b/src/utils/directives/select.js @@ -0,0 +1,14 @@ +export default { + scroll: { + bind (el, binding) { + const SELECTWRAP_DOM=el.querySelector(".el-select-dropdown .el-select-dropdown__wrap") + SELECTWRAP_DOM.addEventListener('scroll', function () { + const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight + if (CONDITION) { + binding.value() + } + + }) + } + } +} \ No newline at end of file diff --git a/src/utils/fileUpload.js b/src/utils/fileUpload.js new file mode 100644 index 0000000..e773001 --- /dev/null +++ b/src/utils/fileUpload.js @@ -0,0 +1,38 @@ +import { getFileStream } from "@/api/system/upload"; + +export function fileBeforeUpload (file, fileListName) { + const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1); + + const whiteList = ["jpg", "jpeg", "png", "doc", "docx", "xls", "xlsx", "ppt", "pptx","bmp", "gif", "html", "htm", "txt", "rar", "zip", "gz", "bz2", "pdf"]; + + if (whiteList.indexOf(fileSuffix) === -1) { + this.msgError("上传文件只能是 jpg, jpeg, png, doc, docx, xls, xlsx, ppt, pptx,bmp, gif, html, htm, txt, rar, zip, gz, bz2, pdf]格式", "error"); + // return false; + this[fileListName] = this[fileListName].slice(0, this[fileListName].length); + } + + const isLt2M = file.size / 1024 / 1024 <200.01; + + if (!isLt2M) { + this.msgError("上传文件大小不能超过 200MB", "error"); + this[fileListName] = this[fileListName].slice(0, this[fileListName].length); + // return false; + } +} + +export function myDownLoadFile(file) { + getFileStream({ fileName: file.fileName }).then((res) => { + const blob = new Blob([res], { + // type类型后端返回来的数据中会有,根据自己实际进行修改 + // 表格下载为 application/xlsx,压缩包为 application/zip等, + type: "application/xlsx", + }); //excel,pdf等 + const href = URL.createObjectURL(blob); //创建新的URL表示指定的blob对象 + const a = document.createElement("a"); //创建a标签 + a.style.display = "none"; + a.href = href; // 指定下载链接 + a.download = file.name; //指定下载文件名 + a.click(); //触发下载 + URL.revokeObjectURL(a.href); //释放URL对象 + }); +} \ No newline at end of file diff --git a/src/views/dike/engineeringCondition/dikeBaseInfo/index.vue b/src/views/dike/engineeringCondition/dikeBaseInfo/index.vue index d8a0454..469e9b4 100644 --- a/src/views/dike/engineeringCondition/dikeBaseInfo/index.vue +++ b/src/views/dike/engineeringCondition/dikeBaseInfo/index.vue @@ -50,6 +50,19 @@ /> + + + + - + @@ -132,7 +132,7 @@ export default { this.form.type = this.type; this.form.dikeName = this.comForm.embankmentName; - this.form.embankmentCode = this.comForm.embankmentCode; + this.form.dikeCode = this.comForm.dikeCode; this.form.adcd = this.comForm.adcd; if (this.form.photo) { this.fileList = JSON.parse(this.form.photo); @@ -141,7 +141,7 @@ export default { this.form = { id: null, adcd: null, - embankmentCode: null, + dikeCode: null, markName: null, dikeName: null, markLocation: null, @@ -161,7 +161,7 @@ export default { this.form.type = this.type; // console.log(7777777777, this.comForm); this.form.dikeName = this.comForm.embankmentName; - this.form.embankmentCode = this.comForm.embankmentCode; + this.form.dikeCode = this.comForm.dikeCode; this.form.adcd = this.comForm.adcd; } console.log("this.form in components", this.form); @@ -188,16 +188,16 @@ export default { // console.log("新的name", newVal); // console.log("旧的name", oldVal); this.form.embankmentName = newVal; - // this.form.embankmentCode = newVal; + // this.form.dikeCode = newVal; }, }, - "comForm.embankmentCode": { + "comForm.dikeCode": { // deep: true, //深度监听设置为 true handler(newVal, oldVal) { // console.log("新的code", newVal); // console.log("旧的code", oldVal); // this.form.dikeName = newVal; - this.form.embankmentCode = newVal; + this.form.dikeCode = newVal; }, }, "comForm.adcd": { @@ -214,7 +214,7 @@ export default { // this.form = { // id: null, // adcd: null, - // embankmentCode: null, + // dikeCode: null, // markName: null, // suliceName: null, // markLocation: null, diff --git a/src/views/dike/engineeringCondition/identificationPlate/index.vue b/src/views/dike/engineeringCondition/identificationPlate/index.vue index 39bb248..cca7bf8 100644 --- a/src/views/dike/engineeringCondition/identificationPlate/index.vue +++ b/src/views/dike/engineeringCondition/identificationPlate/index.vue @@ -22,9 +22,9 @@ v-show="showSearch" label-width="68px" > - + + @@ -547,13 +565,14 @@ import { listDikeInfo } from "@/api/yg/dikeInfo"; import markForm from "./components/markForm.vue"; import { getAreasData } from "@/api/areas/index"; import { regionData, codeToText, TextToCode } from "element-china-area-data"; - +import linkDike from "@/components/linkNameSelect/linkDike.vue"; // import Vue from "vue"; export default { name: "DikeMark", components: { markForm, + linkDike, }, data() { return { @@ -601,6 +620,7 @@ export default { pageSize: 10, ids: null, data: { + embankmentName: null, markName: null, type: null, markType: null, diff --git a/src/views/dike/managementGuarantee/archivesManagement/index.vue b/src/views/dike/managementGuarantee/archivesManagement/index.vue index 2f91b5e..e68402a 100644 --- a/src/views/dike/managementGuarantee/archivesManagement/index.vue +++ b/src/views/dike/managementGuarantee/archivesManagement/index.vue @@ -231,8 +231,8 @@ > - - + - + - - + @@ -258,11 +258,8 @@ - - + - + + + + + + - + - - + - + - + - + @@ -312,9 +317,13 @@ import { import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx"; import { getToken } from "@/utils/auth"; import { getFileStream } from "@/api/system/upload"; +import linkDike from "@/components/linkNameSelect/linkDike.vue"; export default { name: "Yaxx", + components: { + linkDike, + }, data() { return { // 面包屑,路由信息 @@ -372,6 +381,11 @@ export default { owerDept: null, relation: null, }, + cv: { + type: "like", + name: "dikeName", + value: null, + }, // 排序方式 params: { // 按哪个字段排序 @@ -475,6 +489,11 @@ export default { remark: null, relation: null, }, + cv: { + type: "like", + name: "dikeName", + value: null, + }, params: { // 按哪个字段排序 orderBy: "create_time", diff --git a/src/views/dike/safetyManage/floodControlManagement/supplies.vue b/src/views/dike/safetyManage/floodControlManagement/supplies.vue index 4bcf387..23530d9 100644 --- a/src/views/dike/safetyManage/floodControlManagement/supplies.vue +++ b/src/views/dike/safetyManage/floodControlManagement/supplies.vue @@ -16,25 +16,24 @@ v-show="showSearch" label-width="68px" > - - + > + + + + - + - - + @@ -338,9 +342,13 @@ import { exportFxwz, } from "@/api/yg/dike/fxwz"; import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx"; +import linkDike from "@/components/linkNameSelect/linkDike.vue"; export default { name: "Fxwz", + components: { + linkDike, + }, data() { return { // 面包屑,路由信息 @@ -392,6 +400,11 @@ export default { owerDept: null, relation: null, }, + cv: { + type: "like", + name: "dikeName", + value: null, + }, // 排序方式 params: { // 按哪个字段排序 @@ -512,6 +525,11 @@ export default { remark: null, relation: null, }, + cv: { + type: "like", + name: "dikeName", + value: null, + }, params: { // 按哪个字段排序 orderBy: "create_time", diff --git a/src/views/dike/safetyManage/floodControlManagement/tissue.vue b/src/views/dike/safetyManage/floodControlManagement/tissue.vue index b104029..51bc95d 100644 --- a/src/views/dike/safetyManage/floodControlManagement/tissue.vue +++ b/src/views/dike/safetyManage/floodControlManagement/tissue.vue @@ -133,12 +133,18 @@ fixed /> + - + @@ -369,11 +384,13 @@ import { import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx"; import { getAreasData } from "@/api/areas/index"; import msFxzzMember from "./components/msFxzzMember.vue"; +import linkDike from "@/components/linkNameSelect/linkDike.vue"; export default { name: "Fxzz", components: { msFxzzMember, + linkDike, }, data() { return { @@ -391,6 +408,7 @@ export default { areasOptions: [], // 遮罩层 loading: true, + selectLoading: false, // 选中数组 ids: [], // 非单个禁用 @@ -411,6 +429,22 @@ export default { typeOptions: [], // 堤防项目 dikeNameOptions: [], + // 堤防查询参数 + dikeNameQueryParams: { + pageNum: 1, + pageSize: 10, + ids: null, + data: { + dikeName: null, + }, + // 排序方式 + params: { + // 按哪个字段排序 + orderBy: "create_time", + // desc降序,升序asc + sortBy: "desc", + }, + }, // 查询参数 queryParams: { pageNum: 1, @@ -466,7 +500,7 @@ export default { }, created() { this.getList(); - listJbxx({ data: {} }).then((res) => { + listJbxx(this.dikeNameQueryParams).then((res) => { // console.log(111, res); this.dikeNameOptions = res.records; }); @@ -476,6 +510,28 @@ export default { }); }, methods: { + remoteMethod(query) { + if (query !== "") { + this.selectLoading = true; + // console.log(444, query); + this.dikeNameQueryParams.data.dikeName = query; + listJbxx(this.dikeNameQueryParams).then((res) => { + this.dikeNameOptions = res.records; + this.selectLoading = false; + }); + } + }, + selectSearch() { + this.dikeNameQueryParams.pageNum += 1; + listJbxx(this.dikeNameQueryParams).then((res) => { + // console.log(111, res); + this.dikeNameOptions = [...this.dikeNameOptions, ...res.records]; + // console.log(111, this.dikeNameOptions); + }); + }, + chooseDike(item) { + this.form.dikeName = item.dikeName; + }, addForm(index) { // console.log(44444, this.$refs.noticePart.$refs["noticeForm0"]); // 重新赋值每种标牌首项 @@ -636,12 +692,14 @@ export default { this.reset(); this.isEdit = true; const id = row.id || this.ids; + const organizationId = row.id || this.ids[0]; + console.log(444, id); getFxzz(id).then((response) => { this.form = response.data; this.open = true; this.title = "修改防汛组织"; }); - listFxzzcy({ data: { organizationId: id } }).then((res) => { + listFxzzcy({ data: { organizationId: organizationId } }).then((res) => { console.log(6666, res); this.counter = res.records; }); diff --git a/src/views/dike/safetyManage/responsiblePersonManage/components/list.vue b/src/views/dike/safetyManage/responsiblePersonManage/components/list.vue index d338412..2231ca6 100644 --- a/src/views/dike/safetyManage/responsiblePersonManage/components/list.vue +++ b/src/views/dike/safetyManage/responsiblePersonManage/components/list.vue @@ -7,7 +7,7 @@ v-show="showSearch" label-width="68px" > - + + + + + - + - - + @@ -345,10 +350,14 @@ import { import { listJbxx, getJbxx } from "@/api/yg/dike/jbxx"; import { getToken } from "@/utils/auth"; import { getFileStream } from "@/api/system/upload"; +import linkDike from "@/components/linkNameSelect/linkDike.vue"; export default { name: "Yhxx", props: ["chartEleGetData"], + components: { + linkDike, + }, data() { return { // 遮罩层 @@ -518,7 +527,7 @@ export default { instrument: null, dangerDetail: null, photo: null, - status: "0", + status: null, cost: null, finishMethod: null, result: null, diff --git a/src/views/sluice/engineeringCondition/identificationPlate/components/markForm.vue b/src/views/sluice/engineeringCondition/identificationPlate/components/markForm.vue index c108beb..7dac598 100644 --- a/src/views/sluice/engineeringCondition/identificationPlate/components/markForm.vue +++ b/src/views/sluice/engineeringCondition/identificationPlate/components/markForm.vue @@ -30,8 +30,8 @@ - - + diff --git a/src/views/sluice/engineeringCondition/identificationPlate/index.vue b/src/views/sluice/engineeringCondition/identificationPlate/index.vue index e98cdb8..e1636e4 100644 --- a/src/views/sluice/engineeringCondition/identificationPlate/index.vue +++ b/src/views/sluice/engineeringCondition/identificationPlate/index.vue @@ -22,7 +22,24 @@ v-show="showSearch" label-width="68px" > - + + + + + + - + - + - - + @@ -251,11 +251,8 @@ - - + - + + + + + + - - + - + + + + + + - - + @@ -312,9 +329,13 @@ import { import { listJbxx, getJbxx } from "@/api/yg/jbxx"; import { getToken } from "@/utils/auth"; import { getFileStream } from "@/api/system/upload"; +import linkSluice from "@/components/linkNameSelect/linkSluice.vue"; export default { name: "Yaxx", + components: { + linkSluice, + }, data() { return { // 面包屑,路由信息 @@ -372,6 +393,11 @@ export default { owerDept: null, relation: null, }, + cv: { + type: "like", + name: "wagaName", + value: null, + }, // 排序方式 params: { // 按哪个字段排序 @@ -475,6 +501,11 @@ export default { remark: null, relation: null, }, + cv: { + type: "like", + name: "wagaName", + value: null, + }, params: { // 按哪个字段排序 orderBy: "create_time", diff --git a/src/views/sluice/safetyManage/floodControlManagement/supplies.vue b/src/views/sluice/safetyManage/floodControlManagement/supplies.vue index 992e78f..7b68d56 100644 --- a/src/views/sluice/safetyManage/floodControlManagement/supplies.vue +++ b/src/views/sluice/safetyManage/floodControlManagement/supplies.vue @@ -34,7 +34,7 @@ @keyup.enter.native="handleQuery" /> --> - + + + + + - - + @@ -338,9 +355,13 @@ import { exportFxwz, } from "@/api/yg/fxwz"; import { listJbxx, getJbxx } from "@/api/yg/jbxx"; +import linkSluice from "@/components/linkNameSelect/linkSluice.vue"; export default { name: "Fxwz", + components: { + linkSluice, + }, data() { return { // 面包屑,路由信息 @@ -392,6 +413,11 @@ export default { owerDept: null, relation: null, }, + cv: { + type: "like", + name: "wagaName", + value: null, + }, // 排序方式 params: { // 按哪个字段排序 @@ -512,6 +538,11 @@ export default { remark: null, relation: null, }, + cv: { + type: "like", + name: "wagaName", + value: null, + }, params: { // 按哪个字段排序 orderBy: "create_time", diff --git a/src/views/sluice/safetyManage/floodControlManagement/tissue.vue b/src/views/sluice/safetyManage/floodControlManagement/tissue.vue index 375983b..997c102 100644 --- a/src/views/sluice/safetyManage/floodControlManagement/tissue.vue +++ b/src/views/sluice/safetyManage/floodControlManagement/tissue.vue @@ -239,7 +239,8 @@ - + @@ -369,11 +370,13 @@ import { import { listJbxx, getJbxx } from "@/api/yg/jbxx"; import { getAreasData } from "@/api/areas/index"; import msFxzzMember from "./components/msFxzzMember.vue"; +import linkSluice from "@/components/linkNameSelect/linkSluice.vue"; export default { name: "Fxzz", components: { msFxzzMember, + linkSluice, }, data() { return { @@ -636,12 +639,13 @@ export default { this.reset(); this.isEdit = true; const id = row.id || this.ids; + const organizationId = row.id || this.ids[0]; getFxzz(id).then((response) => { this.form = response.data; this.open = true; this.title = "修改防汛组织"; }); - listFxzzcy({ data: { organizationId: id } }).then((res) => { + listFxzzcy({ data: { organizationId: organizationId } }).then((res) => { console.log(6666, res); this.counter = res.records; }); diff --git a/src/views/sluice/safetyManage/responsiblePersonManage/components/list.vue b/src/views/sluice/safetyManage/responsiblePersonManage/components/list.vue index 702e6c5..9ee172c 100644 --- a/src/views/sluice/safetyManage/responsiblePersonManage/components/list.vue +++ b/src/views/sluice/safetyManage/responsiblePersonManage/components/list.vue @@ -224,7 +224,8 @@ > - + - - + @@ -345,10 +345,14 @@ import { import { listJbxx, getJbxx } from "@/api/yg/jbxx"; import { getToken } from "@/utils/auth"; import { getFileStream } from "@/api/system/upload"; +import linkSluice from "@/components/linkNameSelect/linkSluice.vue"; export default { name: "Yhxx", props: ["chartEleGetData"], + components: { + linkSluice, + }, data() { return { // 遮罩层 @@ -518,7 +522,7 @@ export default { instrument: null, dangerDetail: null, photo: null, - status: "0", + status: null, cost: null, finishMethod: null, result: null, From 61d8fded86ffec3f56e2646e8359201290153449 Mon Sep 17 00:00:00 2001 From: xzt <1113240624@qq.com> Date: Mon, 27 May 2024 11:59:30 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/linkNameSelect/linkDike.vue | 71 +++++++++----- src/components/linkNameSelect/linkSluice.vue | 94 ++++++++++++++----- .../components/markForm.vue | 8 +- .../identificationPlate/index.vue | 28 +++--- .../components/list.vue | 8 +- .../safetyManage/safetyAppraisal/task.vue | 17 ++-- .../identificationPlate/index.vue | 11 ++- .../floodControlManagement/power.vue | 9 +- .../floodControlManagement/preplan.vue | 9 +- .../floodControlManagement/supplies.vue | 9 +- .../floodControlManagement/tissue.vue | 8 +- .../safetyManage/safetyAppraisal/task.vue | 19 ++-- 12 files changed, 197 insertions(+), 94 deletions(-) diff --git a/src/components/linkNameSelect/linkDike.vue b/src/components/linkNameSelect/linkDike.vue index 83f416d..459ea1a 100644 --- a/src/components/linkNameSelect/linkDike.vue +++ b/src/components/linkNameSelect/linkDike.vue @@ -1,30 +1,56 @@ - - - + + + + + + + +