zxy преди 3 години
родител
ревизия
bf98c44da6

+ 1 - 1
light-application-ui/public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
     <link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css">
-    <title>fastloader-ui</title>
+    <title>轻应用后台管理</title>
   </head>
   <body>
     <noscript>

+ 2 - 2
light-application-ui/src/axios.js

@@ -3,8 +3,8 @@ import router from './router';
 import { Notification } from 'element-ui';
 import { Loading } from 'element-ui';
 
-//axios.defaults.baseURL = 'https://miniapp.cqjudong.com/base';
-axios.defaults.baseURL = 'http://localhost:8081';
+axios.defaults.baseURL = 'https://miniapp.cqjudong.com/base';
+//axios.defaults.baseURL = 'http://localhost:8081';
 
 const request = axios.create({
     timeout: 5000,

+ 3 - 3
light-application-ui/src/views/Login.vue

@@ -64,9 +64,9 @@ export default {
             codeUrl: '',
             cookiePass: '',
             loginForm: {
-                username: 'admin',
-                password: '123456',
-                code: '111111',
+                username: '',
+                password: '',
+                code: '',
                 token: ''
             },
             loginRules: {

+ 53 - 36
light-application-ui/src/views/page/components/manageMember.vue

@@ -6,28 +6,28 @@
             width='60%'>
             <el-row>
                 <el-col :span='14'>
-                    <div class='handle-box'>
-                        <el-form :inline='true'>
-                            <el-form-item>
-                                <el-input
-                                    v-model='searchForm.usernameShow'
-                                    placeholder='用户名称'
-                                    clearable>
-                                </el-input>
-                            </el-form-item>
-                            <el-form-item>
-                                <el-input
-                                    v-model='searchForm.phone'
-                                    placeholder='手机号'
-                                    clearable>
-                                </el-input>
-                            </el-form-item>
+                    <!--                    <div class='handle-box'>
+                                            <el-form :inline='true'>
+                                                <el-form-item>
+                                                    <el-input
+                                                        v-model='searchForm.usernameShow'
+                                                        placeholder='用户名称'
+                                                        clearable>
+                                                    </el-input>
+                                                </el-form-item>
+                                                <el-form-item>
+                                                    <el-input
+                                                        v-model='searchForm.phone'
+                                                        placeholder='手机号'
+                                                        clearable>
+                                                    </el-input>
+                                                </el-form-item>
 
-                            <el-form-item>
-                                <el-button @click='loadData'>搜索</el-button>
-                            </el-form-item>
-                        </el-form>
-                    </div>
+                                                <el-form-item>
+                                                    <el-button @click='loadData'>搜索</el-button>
+                                                </el-form-item>
+                                            </el-form>
+                                        </div>-->
                     <el-table
                         ref='userTable'
                         :data='tableData'
@@ -56,9 +56,9 @@
                         @current-change='handleCurrentChange'
                         layout='total, sizes, prev, pager, next, jumper'
                         :page-sizes='[5, 10, 15, 20]'
-                        :current-page='current'
-                        :page-size='size'
-                        :total='total'>
+                        :current-page='paging.current'
+                        :page-size='paging.size'
+                        :total='paging.total'>
                     </el-pagination>
                 </el-col>
                 <el-col :span='9' style='border-left: 1px solid #DCDFE6;margin-left: 8px;'>
@@ -97,9 +97,11 @@ export default {
         //监听dialogVisible,关闭dialog时清空数据
         dialogVisible: function(newValue, oldValue) {
             if (!newValue) {
-                this.current = 1;
-                this.size = 5;
-                this.total = 0;
+                this.paging = {
+                    size: 5,
+                    total: 0,
+                    current: 1
+                };
                 this.groupUserList = [];
                 this.searchForm = {
                     usernameShow: '',
@@ -119,12 +121,19 @@ export default {
             },
             groupData: {},
             tableData: [],
-            total: 0,
-            size: 5,
-            current: 1,
+            tableDataAll: [],
             groupUserList: [],
             tagType: ['success', 'info', 'warning', 'danger', ''],
-            removeGroupUserTemp: []
+            removeGroupUserTemp: [],
+            page: {
+                cursor: '',//上次查询返回的游标,下次查询会查询本次查询后续的数据
+                limit: 100//请求数据的大小
+            },
+            paging: {
+                size: 5,
+                total: 0,
+                current: 1
+            }
         };
     },
     created() {
@@ -132,9 +141,9 @@ export default {
     },
     methods: {
         show(data) {
+            this.groupData = data;
             //不使用全局的加载loading组件,等到群组详情查询完成了再关闭
             loading = Loading.service(options);
-            this.groupData = data;
             //回显群聊人员
             axios.get('/api/easemob/queryGroupUser?groupId=' + this.groupData.id).then(res => {
                 axios.post('/api/easemob/getUpUserAttributeBath', {
@@ -157,7 +166,9 @@ export default {
             });
         },
         loadData() {
-            axios.post('/api/easemob/queryUserPage', { params: { limit: 100, cursor: '' } }).then(res => {
+            //不使用全局的加载loading组件,等到群组详情查询完成了再关闭
+            loading = Loading.service(options);
+            axios.post('/api/easemob/queryUserPage', { params: this.page }).then(res => {
                 this.loadDataDetails(res.data.data.entities.map(t => {
                     return t.username;
                 }).filter(t => {
@@ -166,25 +177,31 @@ export default {
             });
         },
         loadDataDetails(usernameList) {
+            let _this = this;
             axios.post('/api/easemob/getUpUserAttributeBath', {
                 targets: usernameList,
                 properties: ['phone', 'nickname']
             }).then(res => {
                 let data = res.data.data.data;
+                this.tableDataAll = [];
                 for (let key in data) {
-                    this.tableData.push({ phone: data[key].phone, nickname: data[key].nickname, username: key });
+                    this.tableDataAll.push({ phone: data[key].phone, nickname: data[key].nickname, username: key });
                 }
+                //设置真正的表格数据
+                _this.tableData = _this.tableDataAll.slice((_this.paging.current - 1) * _this.paging.size, _this.paging.current * _this.paging.size);
+                //回写数据条数
+                _this.paging.total = _this.tableDataAll.length;
                 this.dialogVisible = true;
                 //关闭转loading
                 loading.close();
             });
         },
         handleSizeChange(val) {
-            this.size = val;
+            this.paging.size = val;
             this.loadData();
         },
         handleCurrentChange(val) {
-            this.current = val;
+            this.paging.current = val;
             this.loadData();
         },
         addUser(data) {

+ 7 - 6
light-application-ui/src/views/page/faultHandlingManage.vue

@@ -128,12 +128,12 @@
                 <el-row>
                     <el-col :span='12'>
                         <el-form-item label='故障标题:' prop='title' label-width='100px'>
-                            <el-input v-model='editForm.title' autocomplete='off' placeholder='请输入故障标题'></el-input>
+                            <el-input :disabled='editForm.id' v-model='editForm.title' autocomplete='off' placeholder='请输入故障标题'></el-input>
                         </el-form-item>
                     </el-col>
                     <el-col :span='12'>
                         <el-form-item label='提出人员:' prop='proposePersonnel' label-width='100px'>
-                            <el-input v-model='editForm.proposePersonnel' autocomplete='off'
+                            <el-input :disabled='editForm.id' v-model='editForm.proposePersonnel' autocomplete='off'
                                       placeholder='请输入提出人员'></el-input>
                         </el-form-item>
                     </el-col>
@@ -141,7 +141,7 @@
                 <el-row>
                     <el-col :span='24'>
                         <el-form-item label='故障内容:' prop='content' label-width='100px'>
-                            <el-input type='textarea' rows='3' v-model='editForm.content' autocomplete='off'
+                            <el-input :disabled='editForm.id' type='textarea' rows='3' v-model='editForm.content' autocomplete='off'
                                       placeholder='请输入故障内容'></el-input>
                         </el-form-item>
                     </el-col>
@@ -149,7 +149,7 @@
                 <el-row>
                     <el-col :span='24'>
                         <el-form-item label='处理方式:' prop='treatmentMethod' label-width='100px'>
-                            <el-input type='textarea' rows='3' v-model='editForm.treatmentMethod' autocomplete='off'
+                            <el-input :disabled='!editForm.id' type='textarea' rows='3' v-model='editForm.treatmentMethod' autocomplete='off'
                                       placeholder='请输入处理方式'></el-input>
                         </el-form-item>
                     </el-col>
@@ -157,13 +157,14 @@
                 <el-row>
                     <el-col :span='12'>
                         <el-form-item label='处理人员:' prop='treatmentPersonnel' label-width='100px'>
-                            <el-input v-model='editForm.treatmentPersonnel' autocomplete='off'
+                            <el-input :disabled='!editForm.id' v-model='editForm.treatmentPersonnel' autocomplete='off'
                                       placeholder='请输入处理人员'></el-input>
                         </el-form-item>
                     </el-col>
                     <el-col :span='12'>
                         <el-form-item label='处理时间:' prop='updateTime' label-width='100px'>
                             <el-date-picker
+                                :disabled='!editForm.id'
                                 v-model='editForm.updateTime'
                                 type='datetime'
                                 value-format='yyyy-MM-dd HH:mm'
@@ -259,7 +260,7 @@ export default {
             });
         },
         editHandle(row) {
-            this.editForm = row
+            this.editForm = JSON.parse(JSON.stringify(row));
             this.dialogVisible = true;
         },
         delHandle(id) {

+ 33 - 11
light-application-ui/src/views/page/groupManage.vue

@@ -81,6 +81,15 @@
                 </template>
             </el-table-column>
         </el-table>
+        <el-pagination
+            @size-change='handleSizeChange'
+            @current-change='handleCurrentChange'
+            layout='total, sizes, prev, pager, next, jumper'
+            :page-sizes='[5, 10, 15, 20]'
+            :current-page='paging.current'
+            :page-size='paging.size'
+            :total='paging.total'>
+        </el-pagination>
 
         <!--新增对话框-->
         <el-dialog
@@ -203,19 +212,25 @@ export default {
                 ]
             },
             tableData: [],
+            tableDataAll: [],
             page: {
                 cursor: '',//上次查询返回的游标,下次查询会查询本次查询后续的数据
                 limit: 100//请求数据的大小
+            },
+            paging: {
+                size: 10,
+                total: 0,
+                current: 1
             }
 
         };
     },
-    created() {
+    mounted() {
         this.loadData();
     },
     methods: {
         //加载群组列表
-        loadData(cursor) {
+        loadData() {
             //不使用全局的加载loading组件,等到群组详情查询完成了再关闭
             loading = Loading.service(options);
             let _this = this;
@@ -227,20 +242,20 @@ export default {
                     return t.groupid;
                 }).join(',');
                 //再查询群组详情
-                _this.loadDataDetails(groupIds, cursor);
+                _this.loadDataDetails(groupIds);
             });
         },
         //加载群组详情
-        loadDataDetails(groupIds, cursor) {
+        loadDataDetails(groupIds) {
             let _this = this;
             axios.get('/api/easemob/queryGroupDetails/' + groupIds, {}).then(res => {
                 //把数据加入到表格数据中
-                if (cursor) {
-                    _this.tableData.push(...res.data.data.data);
-                }
-                _this.tableData = res.data.data.data;
-                //把游标回写到page对象 后面表格数据是push还是=通过这个cursor值控制
-                _this.page.cursor = cursor;
+                _this.tableDataAll = [];
+                _this.tableDataAll.push(...res.data.data.data);
+                //设置真正的表格数据
+                _this.tableData = _this.tableDataAll.slice((_this.paging.current - 1) * _this.paging.size, _this.paging.current * _this.paging.size);
+                //回写数据条数
+                _this.paging.total = _this.tableDataAll.length;
                 //关闭转loading
                 loading.close();
             });
@@ -275,7 +290,6 @@ export default {
             _this.$refs[formName].validate((valid) => {
                 if (valid) {
                     _this.$axios.post('/api/easemob/' + (_this.gourpForm.id ? 'updateGroup' : 'createGroup'), _this.gourpForm.id ? _this.gourpForm.editParams : _this.gourpForm).then(res => {
-                        _this.loadData();
                         if (res.data.data.data) {
                             _this.$notify({
                                 showClose: true,
@@ -329,6 +343,14 @@ export default {
                 }
             });
         },
+        handleSizeChange(val) {
+            this.paging.size = val;
+            this.loadData();
+        },
+        handleCurrentChange(val) {
+            this.paging.current = val;
+            this.loadData();
+        },
         showManageMember(row) {
             this.$refs['manageMember'].show(row);
         }

+ 1 - 1
light-application-ui/src/views/page/inspectionTemplateManage.vue

@@ -312,7 +312,7 @@ export default {
             });
         },
         editHandle(row) {
-            this.editForm = row;
+            this.editForm = JSON.parse(JSON.stringify(row));
             //回显巡检项目数据
             this.$axios.get('/api/inspection/template/getProjectByTemplateId?templateId=' + row.id)
                 .then(res => {

+ 1 - 1
light-application-ui/src/views/page/meetingManage.vue

@@ -331,7 +331,7 @@ export default {
       });
     },
     editHandle(row) {
-      this.editForm = row;
+      this.editForm = JSON.parse(JSON.stringify(row));
       this.dialogVisible = true;
     },
     delHandle(id) {