diff --git a/src/components/linkNameSelect/linkDike.vue b/src/components/linkNameSelect/linkDike.vue new file mode 100644 index 0000000..b31c3d8 --- /dev/null +++ b/src/components/linkNameSelect/linkDike.vue @@ -0,0 +1,148 @@ + + diff --git a/src/components/linkNameSelect/linkSluice.vue b/src/components/linkNameSelect/linkSluice.vue new file mode 100644 index 0000000..6491026 --- /dev/null +++ b/src/components/linkNameSelect/linkSluice.vue @@ -0,0 +1,155 @@ + + diff --git a/src/components/myUpload/index.vue b/src/components/myUpload/index.vue new file mode 100644 index 0000000..412d68b --- /dev/null +++ b/src/components/myUpload/index.vue @@ -0,0 +1,93 @@ + + diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 9c92c4f..485bcb8 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -47,11 +47,25 @@ export default { activeMenu() { const route = this.$route; const { meta, path } = route; + let newPath = path; + if (path.includes("/sluice/engineeringCondition/sluiceBaseInfo/")) { + newPath = "/sluice/engineeringCondition/sluiceBaseInfo"; + } else if (path.includes("/sluice/safetyManage/declare/")) { + newPath = "/sluice/safetyManage/declare"; + } else if (path.includes("/sluice/safetyManage/examine/")) { + newPath = "/sluice/safetyManage/examine"; + } else if (path.includes("/dike/engineeringCondition/dikeBaseInfo/")) { + newPath = "/dike/engineeringCondition/dikeBaseInfo"; + } else if (path.includes("/dike/safetyManage/declare/")) { + newPath = "/dike/safetyManage/declare"; + } else if (path.includes("/dike/safetyManage/examine/")) { + newPath = "/dike/safetyManage/examine"; + } // if set path, the sidebar will highlight the path you set if (meta.activeMenu) { return meta.activeMenu; } - return path; + return newPath; }, showLogo() { return this.$store.state.settings.sidebarLogo; 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 @@ /> + + + + - + @@ -131,8 +131,8 @@ export default { this.form = this.editItem; this.form.type = this.type; - this.form.dikeName = this.comForm.embankmentName; - this.form.embankmentCode = this.comForm.embankmentCode; + this.form.dikeName = this.comForm.dikeName; + 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, @@ -160,8 +160,8 @@ 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.dikeName = this.comForm.dikeName; + this.form.dikeCode = this.comForm.dikeCode; this.form.adcd = this.comForm.adcd; } console.log("this.form in components", this.form); @@ -182,22 +182,22 @@ export default { // console.log("新的name", newVal); }, }, - "comForm.embankmentName": { + "comForm.dikeName": { // deep: true, //深度监听设置为 true handler(newVal, oldVal) { // console.log("新的name", newVal); // console.log("旧的name", oldVal); - this.form.embankmentName = newVal; - // this.form.embankmentCode = newVal; + this.form.dikeName = 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..179938a 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: { + dikeName: null, markName: null, type: null, markType: null, @@ -616,7 +636,7 @@ export default { // 表单参数 form: {}, comForm: { - embankmentName: null, + dikeName: null, embankmentCode: null, adcd: null, }, @@ -627,8 +647,8 @@ export default { // 表单校验 comRule: { - embankmentName: [ - { required: true, message: "请选择堤防名称", trigger: "blur" }, + dikeCode: [ + { required: true, message: "请选择堤防名称", trigger: "change" }, ], }, rules: { @@ -636,7 +656,7 @@ export default { { required: true, message: "请输入标志名称", trigger: "blur" }, ], }, - embankmentNameOptions: [], + dikeNameOptions: [], isEdit: false, counter0: [{}], counter1: [{}], @@ -664,8 +684,8 @@ export default { this.markTypeOptions4 = response.data; }); listDikeInfo({ data: { exprDate: null } }).then((response) => { - console.log("embankmentNameOptions", response); - this.embankmentNameOptions = response.records; + console.log("dikeNameOptions", response); + this.dikeNameOptions = response.records; }); }, // mounted() { @@ -846,7 +866,7 @@ export default { this.counter2 = [{}]; this.counter3 = [{}]; this.comForm = { - embankmentName: null, + dikeName: null, embankmentCode: null, adcd: null, }; @@ -1000,7 +1020,7 @@ export default { getDikeMark(embankmentCode).then((response) => { // this.form = response.data; console.log("回显的数据", response); - this.comForm.embankmentName = response.data[0].embankmentName; + this.comForm.dikeName = response.data[0].dikeName; this.comForm.embankmentCode = response.data[0].embankmentCode; this.comForm.adcd = response.data[0].adcd; console.log("this.comForm", this.comForm); diff --git a/src/views/dike/managementGuarantee/archivesManagement/index.vue b/src/views/dike/managementGuarantee/archivesManagement/index.vue index 2f91b5e..d027ed5 100644 --- a/src/views/dike/managementGuarantee/archivesManagement/index.vue +++ b/src/views/dike/managementGuarantee/archivesManagement/index.vue @@ -231,8 +231,8 @@ > - - + - - + - - + @@ -256,15 +321,18 @@ import { updateJfgl, exportJfgl, } from "@/api/yg/dike/jfgl"; +import { listDagl } from "@/api/yg/dike/dagl"; // import { listJbxx } from "@/api/yg/jbxx"; import personnelExpenses from "./components/personnelExpenses.vue"; import maintenanceFund from "./components/maintenanceFund.vue"; +import linkDike from "@/components/linkNameSelect/linkDike.vue"; export default { name: "Jfgl", components: { personnelExpenses, maintenanceFund, + linkDike, }, data() { return { @@ -291,21 +359,15 @@ export default { // 工程规模字典 projectScaleOptions: [], // 查询参数 + // 查询参数 queryParams: { pageNum: 1, pageSize: 10, ids: null, data: { dikeCode: null, - unitName: null, - peopleNum: null, - funds: null, - fundsPurpose: null, - createUid: null, - updateUid: null, - owerDept: null, - relation: null, - type: null, + dikeName: null, + unit: null, }, // 排序方式 params: { @@ -350,7 +412,7 @@ export default { /** 查询经费管理列表 */ getList() { this.loading = true; - listJfgl(this.queryParams).then((response) => { + listDagl(this.queryParams).then((response) => { this.jfglList = response.records; this.total = response.total; this.loading = false; @@ -374,7 +436,9 @@ export default { this.form = { id: null, dikeCode: null, + dikeName: null, unitName: null, + unit: null, peopleNum: null, funds: null, fundsPurpose: null, @@ -397,7 +461,9 @@ export default { data: { id: null, dikeCode: null, + dikeName: null, unitName: null, + unit: null, peopleNum: null, funds: null, fundsPurpose: null, diff --git a/src/views/dike/managementGuarantee/standardizationConstruction/listPage/index.vue b/src/views/dike/managementGuarantee/standardizationConstruction/listPage/index.vue index e3c14df..d6c2301 100644 --- a/src/views/dike/managementGuarantee/standardizationConstruction/listPage/index.vue +++ b/src/views/dike/managementGuarantee/standardizationConstruction/listPage/index.vue @@ -178,8 +178,8 @@ > - - + - - + @@ -258,11 +258,8 @@ - - + -
+
@@ -11,7 +11,9 @@ export default { data() { return { pieChartData: [], + selected: {}, barChartData: [], + loading: true, }; }, created() { @@ -19,18 +21,29 @@ export default { }, methods: { async getData() { + this.loading = true; const res1 = await getPie(); const res2 = await getHistogram(); this.pieChartData = []; for (let key in res1[0]) { - this.pieChartData.push({ value: res1[0][key], name: key }); + this.pieChartData.push({ + value: res1[0][key], + name: key?.substring(0, 10), + }); } + // 处理数据 + for (let i = 0; i < this.pieChartData.length; i++) { + let name = this.pieChartData[i].name; + this.selected[name] = i < 7; //限制图表中起始显示10个,这里必须保证 name 不为空 + } + // for (let key in res1[0]) { // this.barChartData.push({ value: res1[0][key], name: key }); // } this.barChartData = res2; this.pieInit(); this.barInit(); + this.loading = false; console.log("pieChartData", this.pieChartData); console.log("barChartData", this.barChartData); }, @@ -51,6 +64,8 @@ export default { orient: "horizontal", bottom: "2%", icon: "circle", + type: "scroll", + selected: this.selected, }, series: [ { @@ -106,6 +121,18 @@ export default { bottom: "12%", containLabel: true, }, + dataZoom: [ + { + type: "inside", + show: false, + xAxisIndex: [0], + start: 0, + end: 50, + // textStyle: { + // color: "#ccd7d7", + // }, + }, + ], xAxis: { type: "category", axisLine: { diff --git a/src/views/dike/safetyManage/declarationManage/declare/components/listPage/index.vue b/src/views/dike/safetyManage/declarationManage/declare/components/listPage/index.vue index 5b80030..36fef66 100644 --- a/src/views/dike/safetyManage/declarationManage/declare/components/listPage/index.vue +++ b/src/views/dike/safetyManage/declarationManage/declare/components/listPage/index.vue @@ -161,37 +161,51 @@ fixed="right" > + + + - - 换证 + -
+
@@ -11,7 +11,9 @@ export default { data() { return { pieChartData: [], + selected: {}, barChartData: [], + loading: true, }; }, created() { @@ -19,11 +21,19 @@ export default { }, methods: { async getData() { + this.loading = true; const res1 = await getPie(); const res2 = await getHistogram(); this.pieChartData = []; for (let key in res1[0]) { - this.pieChartData.push({ value: res1[0][key], name: key }); + this.pieChartData.push({ + value: res1[0][key], + name: key?.substring(0, 10), + }); + } + for (let i = 0; i < this.pieChartData.length; i++) { + let name = this.pieChartData[i].name; + this.selected[name] = i < 7; //限制图表中起始显示10个,这里必须保证 name 不为空 } // for (let key in res1[0]) { // this.barChartData.push({ value: res1[0][key], name: key }); @@ -31,6 +41,7 @@ export default { this.barChartData = res2; this.pieInit(); this.barInit(); + this.loading = false; console.log("pieChartData", this.pieChartData); console.log("barChartData", this.barChartData); }, @@ -51,6 +62,8 @@ export default { orient: "horizontal", bottom: "2%", icon: "circle", + type: "scroll", + selected: this.selected, }, series: [ { @@ -106,6 +119,18 @@ export default { bottom: "12%", containLabel: true, }, + dataZoom: [ + { + type: "inside", + show: false, + xAxisIndex: [0], + start: 0, + end: 50, + // textStyle: { + // color: "#ccd7d7", + // }, + }, + ], xAxis: { type: "category", axisLine: { diff --git a/src/views/dike/safetyManage/floodControlManagement/power.vue b/src/views/dike/safetyManage/floodControlManagement/power.vue index 12c8cb7..ecb2c5a 100644 --- a/src/views/dike/safetyManage/floodControlManagement/power.vue +++ b/src/views/dike/safetyManage/floodControlManagement/power.vue @@ -16,7 +16,24 @@ v-show="showSearch" label-width="68px" > - + + + + + + - + - - + - + - + - + @@ -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..2e62543 100644 --- a/src/views/dike/safetyManage/floodControlManagement/tissue.vue +++ b/src/views/dike/safetyManage/floodControlManagement/tissue.vue @@ -53,7 +53,7 @@ > - - + --> - + @@ -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..79d8900 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" > - + + + + + - + - + - - + @@ -298,12 +303,8 @@ - - +