dylan 2 роки тому
батько
коміт
40424ca098

+ 14 - 7
src/api/baseinfo/project.js

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 export const getPage = (current, size, params) => {
     return request({
-        url: '/api/galaxy-business/project/base/page',
+        url: '/api/galaxy-business/base/project/page',
         method: 'get',
         params: {
             ...params,
@@ -15,7 +15,7 @@ export const getPage = (current, size, params) => {
 
 export const getUserProjectList = () => {
     return request({
-        url: '/api/galaxy-business/project/base/org/list',
+        url: '/api/galaxy-business/base/project/org/list',
         method: 'get',
 
     })
@@ -24,7 +24,7 @@ export const getUserProjectList = () => {
 
 export const remove = (ids) => {
     return request({
-        url: '/api/galaxy-business/project/base/remove',
+        url: '/api/galaxy-business/base/project/remove',
         method: 'post',
         params: {
             ids,
@@ -34,7 +34,7 @@ export const remove = (ids) => {
 
 export const add = (row) => {
     return request({
-        url: '/api/galaxy-business/project/base/submit',
+        url: '/api/galaxy-business/base/project/save',
         method: 'post',
         data: row
     })
@@ -42,7 +42,7 @@ export const add = (row) => {
 
 export const update = (row) => {
     return request({
-        url: '/api/galaxy-business/project/base/submit',
+        url: '/api/galaxy-business/base/project/update',
         method: 'post',
         data: row
     })
@@ -50,7 +50,7 @@ export const update = (row) => {
 
 export const getDetail = (id) => {
     return request({
-        url: '/api/galaxy-business/project/base/detail',
+        url: '/api/galaxy-business/base/project/detail',
         method: 'get',
         params: {
             id
@@ -60,7 +60,7 @@ export const getDetail = (id) => {
 
 export const warnSetting = (params) => {
     return request({
-        url: '/api/galaxy-business/project/base/setting/warning/submit',
+        url: '/api/galaxy-business/base/project/setting/warning/submit',
         method: 'post',
         params: {
             ...params,
@@ -68,3 +68,10 @@ export const warnSetting = (params) => {
     })
 }
 
+
+export const getTree = () => {
+    return request({
+        url: '/api/galaxy-business/base/project/tree',
+        method: 'get',
+    })
+}

+ 16 - 6
src/api/baseinfo/rtu.js

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 export const getPage = (current, size, params) => {
     return request({
-        url: '/api/galaxy-business/rtu/base/page',
+        url: '/api/galaxy-business/base/rtu/page',
         method: 'get',
         params: {
             ...params,
@@ -14,7 +14,7 @@ export const getPage = (current, size, params) => {
 
 export const getRtuKindList = (code) => {
     return request({
-        url: '/api/galaxy-business/rtu/base/dict/list',
+        url: '/api/galaxy-business/base/rtu/dict/list',
         method: 'get',
         params: {
             code,
@@ -25,7 +25,7 @@ export const getRtuKindList = (code) => {
 
 export const remove = (ids) => {
     return request({
-        url: '/api/galaxy-business/rtu/base/remove',
+        url: '/api/galaxy-business/base/rtu/remove',
         method: 'post',
         params: {
             ids,
@@ -35,7 +35,7 @@ export const remove = (ids) => {
 
 export const add = (row) => {
     return request({
-        url: '/api/galaxy-business/rtu/base/save',
+        url: '/api/galaxy-business/base/rtu/save',
         method: 'post',
         data: row
     })
@@ -43,7 +43,7 @@ export const add = (row) => {
 
 export const update = (row) => {
     return request({
-        url: '/api/galaxy-business/rtu/base/submit',
+        url: '/api/galaxy-business/base/rtu/update',
         method: 'post',
         data: row
     })
@@ -51,7 +51,7 @@ export const update = (row) => {
 
 export const getDetail = (id) => {
     return request({
-        url: '/api/galaxy-business/rtu/base/detail',
+        url: '/api/galaxy-business/base/rtu/detail',
         method: 'get',
         params: {
             id
@@ -59,3 +59,13 @@ export const getDetail = (id) => {
     })
 }
 
+export const bindProject = (params) => {
+    return request({
+        url: '/api/galaxy-business/base/rtu/project/bind',
+        method: 'post',
+        params: {
+            ...params,
+        }
+    })
+}
+

+ 1 - 1
src/lang/zh.js

@@ -68,7 +68,7 @@ export default {
     login: {
         title: '登录',
         info: '内蒙古自治区',
-        subInfo: '水资源管理平台',
+        subInfo: '水资源管理平台',
         tenantId: '请输入租户ID',
         username: '请输入账号',
         password: '请输入密码',

+ 138 - 131
src/views/baseinfo/project.vue

@@ -8,8 +8,8 @@
 -->
 <template>
     <div>
-    <el-row>
-        <!-- <el-col :span="5">
+        <el-row>
+            <!-- <el-col :span="5">
         <div class="box">
           <el-scrollbar>
           <basic-container>
@@ -30,23 +30,23 @@
                         @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
                         @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
                         @before-open="beforeOpen">
-                        <template slot="state" slot-scope="{ row }">
-                        <el-button type="text" @click="openConfig(row)"> 正常 </el-button>
+                        <!-- <template slot="state" slot-scope="{ row }">
+                            <el-button type="text" @click="openConfig(row)"> 正常 </el-button>
                         </template>
-                        <template slot-scope="{ row, index }" slot="menu">
+                        <template slot-scope="{ row, index }" slot="menu"> -->
 
-                            <el-button type="text" size="small" @click="warnSetting(row)">预警配置
-                            </el-button>
+                        <!-- <el-button type="text" size="small" @click="warnSetting(row)">预警配置
+                            </el-button> -->
 
-                            <!-- <el-button type="text" size="small" @click="planManage(row)">巡检计划
+                        <!-- <el-button type="text" size="small" @click="planManage(row)">巡检计划
                 </el-button> -->
 
-                        </template>
+                        <!-- </template> -->
                     </avue-crud>
                 </basic-container>
             </el-col>
         </el-row>
-        <el-dialog title="预警配置" :visible.sync="warnSettingDialog" v-if="warnSettingDialog" width="600px"
+        <!-- <el-dialog title="预警配置" :visible.sync="warnSettingDialog" v-if="warnSettingDialog" width="600px"
             :before-close="handleClose" :close-on-click-modal="false" append-to-body>
             <el-form label-width="120px">
                 <el-form-item label="预警总开关">
@@ -62,12 +62,12 @@
                 <el-form-item label="">
                     <label>延时时长用于测站离线预警监测,当超过配置的时长时触发预警,默认2小时</label>
                 </el-form-item>
-        </el-form>
-        <span slot="footer" class="dialog-footer">
-            <el-button @click="warnSettingDialog = false" size="small">取 消</el-button>
-            <el-button type="primary" @click="confirmConfigClick" size="small">确 定</el-button>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="warnSettingDialog = false" size="small">取 消</el-button>
+                <el-button type="primary" @click="confirmConfigClick" size="small">确 定</el-button>
             </span>
-        </el-dialog>
+        </el-dialog> -->
 
         <!-- <el-dialog title="巡检计划"  :visible.sync="projectPlanDialog" v-if="projectPlanDialog" width="60%" height="60%" :close-on-click-modal="false"
         append-to-body>
@@ -80,11 +80,11 @@
 </template>
 
 <script>
-import { getPage, getDetail, add, update, remove, warnSetting } from "@/api/baseinfo/project";
+import { getPage, getDetail, add, update, remove } from "@/api/baseinfo/project";
 
-import {
-    getDeptTree,
-} from "@/api/system/dept.js";
+// import {
+//     getDeptTree,
+// } from "@/api/system/dept.js";
 
 
 export default {
@@ -93,24 +93,23 @@ export default {
     },
     data() {
         return {
-
-            projectPlanDialog: false,
-            orderDialog: false,
-            warningConfig: {
-                id: '',
-                configSw: true,
-                delayTime: "120",
-            },
-            planSetting: {
-                orgId: 0,
-                projectId: 0,
-                planTitle: ''
-            },
-            infoDialog: false,
-            warnSettingDialog: false,
+            //projectPlanDialog: false,
+            // orderDialog: false,
+            // warningConfig: {
+            //     id: '',
+            //     configSw: true,
+            //     delayTime: "120",
+            // },
+            // planSetting: {
+            //     orgId: 0,
+            //     projectId: 0,
+            //     planTitle: ''
+            // },
+            // infoDialog: false,
+            // warnSettingDialog: false,
             id: "",
-            editForm: {},
-            editDialog: false,
+            // editForm: {},
+            // editDialog: false,
             form: {},
             selectionList: [],
             query: {},
@@ -156,7 +155,7 @@ export default {
                 calcHeight: 80,
                 align: "center",
                 headerAlign: "center",
-                lazy: true,
+                lazy: false,
                 tip: false,
                 simplePage: true,
                 searchShow: true,
@@ -172,74 +171,82 @@ export default {
                 menuWidth: 220,
                 dialogType: "drawer",
                 dialogClickModal: false,
+                addBtnText: "新增项目",
                 column: [
                     {
                         label: "项目名称",
                         prop: "projectName",
                         search: true,
-                        span: 12,
-                    },
-                    {
-                        label: "所属机构",
-                        prop: "orgId",
-                        span: 12,
-                        hide: true,
-                        viewDisplay: false,
-
-
-                        dicData: [],
-                        type: "tree",
-
-                        addDisabled: false,
-                        props: {
-                            label: "title",
-                        },
+                        span: 24,
                         rules: [
                             {
-                                required: false,
-                                message: "请选择机构",
+                                required: true,
+                                message: "请录入项目名称",
                                 trigger: "click",
                             },
                         ],
                     },
+                    // {
+                    //     label: "所属机构",
+                    //     prop: "orgId",
+                    //     span: 12,
+                    //     hide: true,
+                    //     viewDisplay: false,
+
+
+                    //     dicData: [],
+                    //     type: "tree",
+
+                    //     addDisabled: false,
+                    //     props: {
+                    //         label: "title",
+                    //     },
+                    //     rules: [
+                    //         {
+                    //             required: false,
+                    //             message: "请选择机构",
+                    //             trigger: "click",
+                    //         },
+                    //     ],
+                    // },
+                    // {
+                    //     label: "所属机构",
+                    //     prop: "orgName",
+                    //     span: 24,
+                    //     editDisplay: false,
+                    //     addDisplay: false,
+                    // },
+                    // {
+                    //     label: "开启预警",
+                    //     prop: "warnActive",
+                    //     span: 12,
+                    //     editDisplay: false,
+                    //     addDisplay: false,
+                    //     dicData: [{
+                    //         label: '已启预警',
+                    //         value: 1,
+                    //     }, {
+                    //         label: '关闭',
+                    //         value: 0,
+                    //     }],
+                    // },
                     {
-                        label: "所属机构",
-                        prop: "orgName",
-                        span: 12,
-                        editDisplay: false,
-                        addDisplay: false,
-                    },
-                    {
-                        label: "开启预警",
-                        prop: "warnActive",
-                        span: 12,
-                        editDisplay: false,
-                        addDisplay: false,
-                        dicData: [{
-                            label: '已启预警',
-                            value: 1,
-                        }, {
-                            label: '关闭',
-                            value: 0,
-                        }],
-                    },
-                    {
-                        label: "管理人",
+                        label: "负责人",
                         prop: "manageName",
-                        span: 8,
+                        span: 24,
 
                     },
                     {
                         label: "联系方式",
                         prop: "contactPhone",
-                        span: 8,
+                        span: 24,
                     },
                     {
                         label: "备注说明",
                         prop: "remark",
                         span: 24,
-                        type: "textarea",
 
+                        // type: "textarea",
                     },
                 ],
             },
@@ -266,66 +273,66 @@ export default {
     },
     mounted() { },
     created() {
-        this.initData();
+        // this.initData();
     },
     methods: {
-        initData() {
-            getDeptTree('000000').then((res) => {
-                const column = this.findObject(this.option.column, "orgId");
-                column.dicData = res.data.data;
-            });
-        },
+        // initData() {
+        //     getDeptTree('000000').then((res) => {
+        //         const column = this.findObject(this.option.column, "orgId");
+        //         column.dicData = res.data.data;
+        //     });
+        // },
 
-        confirmConfigClick() {
-            var p = {
-                'id': this.warningConfig.id,
-            };
-            if (this.warningConfig.configSw) {
-                p['warnActive'] = 1;
-            } else {
-                p['warnActive'] = 0;
-            }
-            p['delayTime'] = this.warningConfig.delayTime;
+        // confirmConfigClick() {
+        //     var p = {
+        //         'id': this.warningConfig.id,
+        //     };
+        //     if (this.warningConfig.configSw) {
+        //         p['warnActive'] = 1;
+        //     } else {
+        //         p['warnActive'] = 0;
+        //     }
+        //     p['delayTime'] = this.warningConfig.delayTime;
 
-            this.warnSettingDialog = false;
+        //     this.warnSettingDialog = false;
 
-            warnSetting(p).then(
-                () => {
+        //     warnSetting(p).then(
+        //         () => {
 
-                    this.onLoad(this.page);
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!",
-                    });
+        //             this.onLoad(this.page);
+        //             this.$message({
+        //                 type: "success",
+        //                 message: "操作成功!",
+        //             });
 
-                },
-                (error) => {
-                    window.console.log(error);
+        //         },
+        //         (error) => {
+        //             window.console.log(error);
 
-                }
-            );
+        //         }
+        //     );
 
-        },
-        warnSetting(item) {
-            this.warningConfig.id = item.id;
-            if (item.warnActive == 0) {
-                this.warningConfig.configSw = false;
-                this.warningConfig.delayTime = item.delayTime;
-            } else {
-                this.warningConfig.configSw = true;
-                this.warningConfig.delayTime = item.delayTime;
-            }
+        // },
+        // warnSetting(item) {
+        //     this.warningConfig.id = item.id;
+        //     if (item.warnActive == 0) {
+        //         this.warningConfig.configSw = false;
+        //         this.warningConfig.delayTime = item.delayTime;
+        //     } else {
+        //         this.warningConfig.configSw = true;
+        //         this.warningConfig.delayTime = item.delayTime;
+        //     }
 
-            this.warnSettingDialog = true;
-        },
-        planManage(item) {
-            const planDate = new Date();
-            this.planSetting.orgId = item.orgId;
-            this.planSetting.projectId = item.id;
-            const y = planDate.getFullYear();
-            this.planSetting.planTitle = "" + y + "年" + item.orgName + "(" + item.projectName + ")巡检计划";
-            this.projectPlanDialog = true;
-        },
+        //     this.warnSettingDialog = true;
+        // },
+        // planManage(item) {
+        //     const planDate = new Date();
+        //     this.planSetting.orgId = item.orgId;
+        //     this.planSetting.projectId = item.id;
+        //     const y = planDate.getFullYear();
+        //     this.planSetting.planTitle = "" + y + "年" + item.orgName + "(" + item.projectName + ")巡检计划";
+        //     this.projectPlanDialog = true;
+        // },
         // openInfo(item) {
         //   this.id = item.id;
         //   this.infoDialog = true;

+ 181 - 97
src/views/baseinfo/rtu/index.vue

@@ -9,7 +9,7 @@
 <template>
     <div>
         <el-row>
-            <!-- <el-col :span="4">
+            <el-col :span="4">
                 <div class="box">
                     <el-scrollbar>
                         <basic-container>
@@ -24,8 +24,8 @@
                         </basic-container>
                     </el-scrollbar>
                 </div>
-            </el-col> -->
-            <el-col :span="24">
+            </el-col>
+            <el-col :span="20">
                 <basic-container>
                     <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page"
                         :before-open="beforeOpen" ref="crud" v-model="form" :permission="permissionList" @row-del="rowDel"
@@ -33,22 +33,26 @@
                         @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
                         @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
                         @before-open="beforeOpen" @select-change="selectChange">
-                        <template slot-scope="scope" slot="menuLeft">
+                        <!-- <template slot-scope="scope" slot="menuLeft">
                             <el-button v-if="permissionList.importBtn" type="primary" icon="el-icon-upload2" size="small"
                                 @click="toRtuImpoartHandler">导入测站</el-button>
                             <el-button v-if="permissionList.importBtn" type="primary" icon="el-icon-finished" size="small"
                                 @click="toRtuImportHistoryHandler">测站导入历史</el-button>
                             <el-button v-if="permissionList.importBtn" type="primary" icon="el-icon-download" size="small"
-                                @click="downloadTemplate">测站信息模板下载</el-button>
-                            <!-- <el-button v-if="permissionList.videoSiteAdd" type="primary" icon="el-icon-plus" size="small"
+                                @click="downloadTemplate">测站信息模板下载</el-button> -->
+                        <!-- <el-button v-if="permissionList.videoSiteAdd" type="primary" icon="el-icon-plus" size="small"
                                 @click="toAddVideoSite">添加视频站</el-button> -->
-                        </template>
+                        <!-- </template> -->
 
+                        <template slot-scope="{ row, index }" slot="menu">
+                            <el-button type="text" size="small" icon="el-icon-link" @click="toBindProject(row)">项目绑定
+                            </el-button>
+                        </template>
                     </avue-crud>
                 </basic-container>
             </el-col>
         </el-row>
-        <el-drawer :visible.sync="rtuImportHistoryDialog" v-if="rtuImportHistoryDialog" title="测站导入操作记录" direction="rtl"
+        <!-- <el-drawer :visible.sync="rtuImportHistoryDialog" v-if="rtuImportHistoryDialog" title="测站导入操作记录" direction="rtl"
             size="60%" append-to-body="true">
             <rtuImportHistoryView ref="rtuImportHistoryView"></rtuImportHistoryView>
         </el-drawer>
@@ -56,7 +60,7 @@
             append-to-body :v-loading="importLoading" v-if="rtuImportDialog">
             <rtuImportView :importLoading="importLoading" :visible.sync="rtuImportDialog" ref="rtuImportView">
             </rtuImportView>
-        </el-dialog>
+        </el-dialog> -->
         <!-- <el-dialog title="添加视频站" :visible.sync="videoSiteAddDialog" width="60%" height="60%" :close-on-click-modal="false"
             append-to-body :v-loading="importLoading" v-if="videoSiteAddDialog">
             <videositeadd :importLoading="importLoading" :visible.sync="videoSiteAddDialog" ref="videositeadd"
@@ -64,22 +68,49 @@
             </videositeadd>
 
         </el-dialog> -->
+
+        <el-dialog title="项目配置" :visible.sync="bindProjectDialog" v-if="bindProjectDialog" width="600px"
+            :before-close="handleClose" :close-on-click-modal="false" append-to-body>
+            <avue-form :option="bindProjectOption" v-model="bindProjectEditForm" @submit="bindProjectSubmit"
+                @reset-change="bindProjectReset"></avue-form>
+
+            <!-- <el-form label-width="120px">
+                <el-form-item label="预警总开关">
+                    <el-switch v-model="warningConfig.configSw" active-color="#13ce66" inactive-color="#ff4949"
+                        active-text="开" inactive-text="关">
+                    </el-switch>
+                </el-form-item>
+                <el-form-item label="延时配置">
+                    <el-input placeholder="请输入延时时长" v-model="warningConfig.delayTime">
+                        <template slot="append">单位分钟</template>
+                    </el-input>
+                </el-form-item>
+                <el-form-item label="">
+                    <label>延时时长用于测站离线预警监测,当超过配置的时长时触发预警,默认2小时</label>
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="bindProjectDialog = false" size="small">取 消</el-button>
+                <el-button type="primary" @click="bindProjectOkClick" size="small">确 定</el-button>
+            </span> -->
+        </el-dialog>
     </div>
 </template>
 
 <script>
-import { getPage, getDetail, add, update, remove } from "@/api/baseinfo/rtu.js";
-import { getTree } from "@/api/baseinfo/region.js";
-import { getStore } from '@/util/store.js';
+import { getPage, getDetail, add, update, remove, bindProject } from "@/api/baseinfo/rtu.js";
+import { getTree } from "@/api/baseinfo/project.js";
+// import { getTree } from "@/api/baseinfo/region.js";
+// import { getStore } from '@/util/store.js';
 import { mapGetters } from "vuex";
-import rtuImportHistoryView from './rtuimport.vue';
-import rtuImportView from './rtuImportProcess.vue';
-import videositeadd from './videositeadd.vue';
+// import rtuImportHistoryView from './rtuimport.vue';
+// import rtuImportView from './rtuImportProcess.vue';
+// import videositeadd from './videositeadd.vue';
 export default {
     components: {
-        rtuImportView,
-        rtuImportHistoryView,
-        videositeadd
+        // rtuImportView,
+        // rtuImportHistoryView,
+        // videositeadd
     },
     data() {
         return {
@@ -98,6 +129,33 @@ export default {
                 currentPage: 1,
                 total: 0,
             },
+            bindProjectEditForm: {
+                id: '',
+                projectId: ''
+            },
+            bindProjectOption: {
+                column: [
+                    {
+                        label: '所属项目',
+                        prop: 'projectId',
+                        type: 'select',
+                        span: 24,
+                        props: {
+                            label: 'projectName',
+                            value: 'id'
+                        },
+                        dicUrl: 'api/galaxy-business/base/project/org/list',
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择项目",
+                                trigger: "click",
+                            },
+                        ],
+                    }
+                ]
+            },
+            bindProjectDialog: false,
             treeCode: '',
             treeParentCode: '',
             treeData: [],
@@ -311,56 +369,65 @@ export default {
                     //     prop: "manageCompany",
                     //     span: 24,
                     // },
+                    {
+                        label: "所属项目",
+                        prop: "projectName",
+                        span: 24,
+                        addDisplay: false,
+                        editDisplay: false,
+                        viewDisplay: false
+                    },
+                    {
+                        label: '所属项目',
+                        prop: 'projectId',
+                        type: 'select',
+                        span: 24,
+                        props: {
+                            label: 'projectName',
+                            value: 'id'
+                        },
+                        dicUrl: 'api/galaxy-business/base/project/org/list',
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择项目",
+                                trigger: "click",
+                            },
+                        ],
+                        hide: true,
+                    },
                     {
                         label: "经度",
                         prop: "lng",
-                        span: 12,
-                        // hide: true,
+                        span: 24,
+                        hide: true,
                     },
                     {
                         label: "纬度",
                         prop: "lat",
-                        span: 12,
-                        // hide: true,
+                        span: 24,
+                        hide: true,
                     },
                     {
                         label: "测站位置",
                         prop: "locationDesc",
                         span: 24,
-                        overHidden: true,
-                        // hide: true,
+                        hide: true,
                     },
                     {
                         label: "行政区划编码",
                         prop: "adCode",
                         span: 24,
-
                         tip: "请录入县级行政区划编码",
-                        rules: [
-                            {
-                                required: true,
-                                message: "请录入县级行政区划编码",
-                                trigger: "click",
-                            },
-                        ],
                     },
                     {
                         label: "证照编号",
                         prop: "siteCertId",
                         span: 24,
-
-                        rules: [
-                            {
-                                required: true,
-                                message: "请录入证照编号",
-                                trigger: "click",
-                            },
-                        ],
                     },
                     {
                         label: '站点建设来源类型',
                         prop: 'siteOwner',
-
                         type: 'select',
                         props: {
                             label: 'name',
@@ -377,13 +444,6 @@ export default {
                             name: '中央专项资金',
                             code: '3'
                         }],
-                        rules: [
-                            {
-                                required: true,
-                                message: "请选择数据来源类型",
-                                trigger: "click",
-                            },
-                        ],
                     }, {
                         label: '是否同步到金水',
                         prop: 'dataShareActive',
@@ -401,13 +461,6 @@ export default {
                             name: '同步',
                             code: 2
                         }],
-                        rules: [
-                            {
-                                required: true,
-                                message: "请选择是否同步",
-                                trigger: "click",
-                            },
-                        ],
                     },
 
                     // {
@@ -614,36 +667,36 @@ export default {
     computed: {
         ...mapGetters(["userInfo", "permission"]),
         permissionList() {
-            if (this.post_code == '0') {
-                return {
-                    addBtn: this.vaildData(this.permission.rtu_add, false),
-                    viewBtn: this.vaildData(this.permission.rtu_view, false),
-                    delBtn: this.vaildData(this.permission.rtu_del, false),
-                    editBtn: this.vaildData(this.permission.rtu_edit, false),
-                    importBtn: this.vaildData(this.permission.rtu_import, false),
-                    videoSiteAdd: this.vaildData(this.permission.video_site_add, false),
-                };
-            } else {
-                return {
-                    addBtn: false,
-                    viewBtn: true,
-                    delBtn: false,
-                    editBtn: false,
-                    importBtn: false,
-                    videoSiteAdd: false
-                };
-            }
+            // if (this.post_code == '0') {
+            //     return {
+            //         addBtn: this.vaildData(this.permission.rtu_add, false),
+            //         viewBtn: this.vaildData(this.permission.rtu_view, false),
+            //         delBtn: this.vaildData(this.permission.rtu_del, false),
+            //         editBtn: this.vaildData(this.permission.rtu_edit, false),
+            //         importBtn: this.vaildData(this.permission.rtu_import, false),
+            //         videoSiteAdd: this.vaildData(this.permission.video_site_add, false),
+            //     };
+            // } else {
+            return {
+                // addBtn: false,
+                // viewBtn: true,
+                // delBtn: false,
+                // editBtn: false,
+                // importBtn: false,
+                // videoSiteAdd: false
+            };
+            // }
         },
     },
     created() {
-        let u = getStore({ name: 'userInfo' });
-        console.log(JSON.stringify(u));
-        if (u.post_id == this.website.nm_post_code_sysadmin_id) {
-            this.post_code = this.website.nm_post_code_sysadmin_code;
-        } else if (u.post_id == this.website.nm_post_code_office_personnel_id) {
-            this.post_code = this.website.nm_post_code_office_personnel_code;
-        }
-        // this.initTree();
+        // let u = getStore({ name: 'userInfo' });
+        // console.log(JSON.stringify(u));
+        // if (u.post_id == this.website.nm_post_code_sysadmin_id) {
+        //     this.post_code = this.website.nm_post_code_sysadmin_code;
+        // } else if (u.post_id == this.website.nm_post_code_office_personnel_id) {
+        //     this.post_code = this.website.nm_post_code_office_personnel_code;
+        // }
+        this.initTree();
     },
     methods: {
         initTree() {
@@ -662,39 +715,70 @@ export default {
         update_table() {
             this.onLoad(this.page, this.query);
         },
-        toRtuImpoartHandler() {
-            this.rtuImportDialog = true;
+        toBindProject(row) {
+            this.bindProjectDialog = true;
+            this.bindProjectEditForm.id = row.id;
+            this.bindProjectEditForm.projectId = row.projectId;
         },
-        toRtuImportHistoryHandler() {
-            this.rtuImportHistoryDialog = true;
-        },
-        toAddVideoSite() {
-            this.videoSiteAddDialog = true;
-            this.$nextTick(() => {
-                this.$refs["videositeadd"].init();
-            });
+        bindProjectSubmit(form, done) {
+            console.log(JSON.stringify(form))
+            // this.$message({
+            //     type: "success",
+            //     message: JSON.stringify(form),
+            // });
+            bindProject(form).then(
+                () => {
+                    this.onLoad(this.page);
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    });
+                    this.bindProjectDialog = false;
+                    done();
+                },
+                (error) => {
+                    window.console.log(error);
+                }
+            );
+
         },
-        downloadTemplate() {
-            window.open('/file/download/template/站点信息记录表模板.xlsx')
+        bindProjectReset() {
+            this.bindProjectEditForm.id = '';
+            this.bindProjectEditForm.projectId = '';
         },
+        // toRtuImpoartHandler() {
+        //     this.rtuImportDialog = true;
+        // },
+        // toRtuImportHistoryHandler() {
+        //     this.rtuImportHistoryDialog = true;
+        // },
+        // toAddVideoSite() {
+        //     this.videoSiteAddDialog = true;
+        //     this.$nextTick(() => {
+        //         this.$refs["videositeadd"].init();
+        //     });
+        // },
+        // downloadTemplate() {
+        //     window.open('/file/download/template/站点信息记录表模板.xlsx')
+        // },
         nodeClick(data) {
             this.treeCode = data.id;
             this.treeParentCode = data.parentId;
             this.query = {};
-            this.query['adCode'] = this.treeCode;
+            this.query['projectId'] = this.treeCode;
             this.page.currentPage = 1;
             var params = {};
             this.onLoad(this.page, params);
         },
         searchReset() {
             this.query = {};
-            this.query['adCode'] = this.treeCode;
+            this.query['projectId'] = this.treeCode;
             this.page.currentPage = 1;
             this.onLoad(this.page);
         },
         searchChange(params, done) {
             this.query = params;
-            this.query['adCode'] = this.treeCode;
+            this.query['projectId'] = this.treeCode;
             this.page.currentPage = 1;
             this.onLoad(this.page, params);
             done();

+ 14 - 9
src/views/business/monitor/waterflowrate/index.vue

@@ -9,7 +9,7 @@
 <template>
     <div>
         <el-row>
-            <!-- <el-col :span="4">
+            <el-col :span="4">
                 <div class="box">
                     <el-scrollbar>
                         <basic-container>
@@ -24,8 +24,8 @@
                         </basic-container>
                     </el-scrollbar>
                 </div>
-            </el-col> -->
-            <el-col :span="24">
+            </el-col>
+            <el-col :span="20">
                 <basic-container>
                     <avue-crud :option="option" :table-loading="loading" :page.sync="page" :data="data" ref="crud"
                         v-model="form" :permission="permissionList" @search-change="searchChange"
@@ -66,7 +66,7 @@
 
 <script>
 import { getPage, getDetail } from "@/api/business/monitor/waterflowrate.js";
-import { getTree } from "@/api/baseinfo/org";
+import { getTree } from "@/api/baseinfo/project.js";
 import { mapGetters } from "vuex";
 import waterflowratehistorylistvue from "./waterflowratehistorylist.vue"
 export default {
@@ -163,6 +163,11 @@ export default {
                         search: true,
                         span: 24,
                     },
+                    {
+                        label: "所属项目",
+                        prop: "projectName",
+                        span: 24,
+                    },
                     {
                         label: "上次报文时间",
                         prop: "tm",
@@ -219,7 +224,7 @@ export default {
     },
     mounted() { },
     created() {
-        //this.initTree();
+        this.initTree();
     },
     methods: {
         initTree() {
@@ -234,7 +239,7 @@ export default {
                 this.treeOption.defaultExpandedKeys.push(this.treeData[0].id);
                 this.treeCode = this.treeData[0].id;
                 this.query = {};
-                this.query['orgId'] = this.treeCode;
+                // this.query['orgId'] = this.treeCode;
             });
         },
         nodeClick(data) {
@@ -242,7 +247,7 @@ export default {
             this.excludeCode = data.exclude;
             this.treeParentCode = data.parentId;
             this.query = {};
-            this.query['orgId'] = this.treeCode;
+            this.query['projectId'] = this.treeCode;
             this.page.currentPage = 1;
             var params = {};
             this.onLoad(this.page, params);
@@ -290,13 +295,13 @@ export default {
         },
         searchReset() {
             this.query = {};
-            this.query['adCode'] = this.treeCode;
+            this.query['projectId'] = this.treeCode;
             this.page.currentPage = 1;
             this.onLoad(this.page);
         },
         searchChange(params, done) {
             this.query = {};
-            this.query['adCode'] = this.treeCode;
+            this.query['projectId'] = this.treeCode;
             Object.assign(this.query, params)
             this.page.currentPage = 1;
             this.onLoad(this.page, params);

+ 34 - 39
src/views/wel/index.vue

@@ -20,12 +20,12 @@
                                 <div slot="header" class="clearfix">
                                     <span style="color: rgb(84, 112, 198);">测站信息</span>
                                 </div>
-                                <!-- <div style="display: flex;flex-direction: column;justify-content: center;">
-                                    <div><span style="margin-right: 10px;color: 0.9rem;">取用水户数量:</span> <el-button
-                                            type="text" size="medium">{{ waterUseConsumerCount }}
+                                <div style="display: flex;flex-direction: column;justify-content: center;">
+                                    <div><span style="margin-right: 10px;color: 0.9rem;">项目数量:</span> <el-button type="text"
+                                            size="medium">{{ projectCount }}
                                         </el-button></div>
 
-                                </div> -->
+                                </div>
                                 <div style="display: flex;flex-direction: column;justify-content: center;">
                                     <div><span style="margin-right: 10px;color: 0.9rem;">监测站数量:</span> <el-button
                                             type="text" size="medium">{{ monitorSiteCount }}
@@ -54,7 +54,7 @@
                                             type="text" size="medium">{{ dayUpDataCount }}
                                         </el-button></div>
                                     <div><span style="margin-right: 10px;color: 0.9rem;">上报率:</span>
-                                        <el-button type="text" size="medium">
+                                        <el-button type="text" size="medium">{{ dayUpDataPercent }}
                                         </el-button>
                                     </div>
                                     <div style="color: lightcoral;font-size: 0.8rem;margin-top: 10px;">注:统计口径为上一个自然天</div>
@@ -74,7 +74,7 @@
                                             type="text" size="medium">{{ hourUpDataCount }}
                                         </el-button></div>
                                     <div><span style="margin-right: 10px;color: 0.9rem;">上报率:</span>
-                                        <el-button type="text" size="medium">
+                                        <el-button type="text" size="medium">{{ hourUpDataPercent }}
                                         </el-button>
                                     </div>
                                     <div style="color: lightcoral;font-size: 0.8rem;margin-top: 10px;">注:统计口径为上一个整点小时</div>
@@ -225,13 +225,12 @@ export default {
             selectionList: [],
             query: {},
             loading: false,
-            waterUseConsumerCount: '',
-            monitorSiteCount: '',
-            monitorPointCount: '',
-            dayUpDataCount: '',
-            dayUpDataPercent: '',
-            hourUpDataCount: '',
-            hourUpDataPercent: '',
+            projectCount: 0,
+            monitorSiteCount: 0,
+            dayUpDataCount: 0,
+            dayUpDataPercent: 0,
+            hourUpDataCount: 0,
+            hourUpDataPercent: 0,
             data: [],
             option: {
                 height: "420",
@@ -1213,27 +1212,17 @@ export default {
         loadData() {
             this.getRtuStatusCountInfo();
             this.getRtuUpCountInfo();
-            this.getWarnCountInfo();
+            // this.getWarnCountInfo();
             this.getNoticeInfo();
-            // if (this.timer == null) {
-            //     this.timer = setInterval(this.timeCall, 30000);
-            // }
+            if (this.timer == null) {
+                this.timer = setInterval(this.timeCall, 10000);
+            }
         },
         timeCall() {
-            //console.log("time ++++++++++++++++++++");
             this.getRtuStatusCountInfo();
             this.getRtuUpCountInfo();
-            this.getCheckOrderCountInfo();
-            this.getInspectionReportCountInfo();
-            if (this.adminPageStyle) {
-                this.getWarnCountInfo();
-            } else {
-                this.getWarnKindCountInfo();
-            }
-            this.getTodayOrderProcessInfo();
-            this.getTodayInspectionReportInfo();
+            // this.getWarnCountInfo();
             this.getNoticeInfo();
-            this.getAppVersionInfo();
         },
         close() {
             this.dialog = false;
@@ -1307,31 +1296,37 @@ export default {
         },
         getRtuStatusCountInfo() {
             getRtuStatusCountData().then((res) => {
-                //   console.log("status count " + JSON.stringify(res.data))
                 if (res.data.code === 200) {
                     let data = res.data.data;
-                    this.waterUseConsumerCount = data.waterUseConsumers;
-                    this.monitorSiteCount = data.monitorSites;
-                    this.monitorPointCount = data.monitorPoints;
+                    console.log(JSON.stringify(data))
 
+                    let siteCount = data.monitorSites;
+                    let warnRtuCount = data.warnRtus;
+                    let runningRtuCount = siteCount - warnRtuCount;
+                    let offlineRtuCount = data.offlineRtus;
+                    let otherWarnRtuCount = warnRtuCount - offlineRtuCount;
 
-                    this.rtuInfoCountPieOption.title.subtext = "监测站数量【" + data.monitorPoints + "】";
+                    this.rtuInfoCountPieOption.title.subtext = "监测站数量【" + siteCount + "】";
 
                     //正常测站
-                    this.rtuInfoCountPieOption.series[0].data[0].value = data.monitorSites - data.warnRtus;
-                    let num = new Number((data.monitorSites - data.warnRtus) / data.monitorSites * 100);
+                    this.rtuInfoCountPieOption.series[0].data[0].value = runningRtuCount;
+                    let num = new Number(runningRtuCount / siteCount * 100);
                     this.rtuInfoCountPieOption.series[0].data[0].percent = num.toFixed(2);
+
                     //离线
-                    this.rtuInfoCountPieOption.series[0].data[1].value = data.offlineRtus;
-                    let num2 = new Number(data.offlineRtus / data.monitorSites * 100);
+                    this.rtuInfoCountPieOption.series[0].data[1].value = offlineRtuCount;
+                    let num2 = new Number(offlineRtuCount / siteCount * 100);
                     this.rtuInfoCountPieOption.series[0].data[1].percent = num2.toFixed(2);
 
                     //其他异常
-                    this.rtuInfoCountPieOption.series[0].data[2].value = data.warningRtus - data.offlineRtus;
-                    let num3 = new Number((data.warningRtus - data.offlineRtus) / data.rtus * 100);
+                    this.rtuInfoCountPieOption.series[0].data[2].value = otherWarnRtuCount;
+                    let num3 = new Number(otherWarnRtuCount / siteCount * 100);
                     this.rtuInfoCountPieOption.series[0].data[2].percent = num3.toFixed(2);
 
                     this.rtuInfoCountPieMap.setOption(this.rtuInfoCountPieOption);
+
+                    this.monitorSiteCount = siteCount;
+                    this.projectCount = data.projects;
                 }
             });
         },