Hwt 2 lat temu
rodzic
commit
12fb221322

+ 9 - 0
operationSupport/src/assets/css/main.scss

@@ -92,9 +92,18 @@ a {
 .el-table--group::after {
     width: 0;
 }
+
+.customer-table-column::before {
+    width: 0;
+}
+
 .customer-table::before {
     width: 0;
 }
+.customer-table-column .el-table__fixed-right::before,
+.el-table__fixed::before {
+    width: 0;
+}
 .customer-table .el-table__fixed-right::before,
 .el-table__fixed::before {
     width: 0;

+ 2 - 2
operationSupport/src/components/common/index.js

@@ -1,8 +1,8 @@
 /*
  * @Author: zouwenying
  * @Date: 2020-04-09 17:56:34
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2020-11-02 18:52:42
+ * @LastEditors: D4THYL3
+ * @LastEditTime: 2022-08-08 11:27:53
  * @Description: file content
  */
 import Vue from 'vue';

+ 417 - 392
operationSupport/src/components/common/table.vue

@@ -1,109 +1,131 @@
 <!--
  * @Author: zzy6937@qq.com
  * @Date: 2019-07-01 09:14:32
- * @LastEditors: wf
- * @LastEditTime: 2021-09-22 21:24:17
+ * @LastEditors: D4THYL3
+ * @LastEditTime: 2022-08-08 14:20:15
  * @Description:
  -->
 <template>
-    <div class="zz-table">
-        <!-- :height='isScroll ? boxHeight : null' -->
-        <el-table
-            :border="settings.tableBorder"
-            :height="height"
-            style="width: 100%"
-            ref="table"
-            v-loading="loading"
-            :data="data"
-            :summary-method="getSummaries"
-            :show-summary="!!(settings.summaryCol && settings.summaryCol.length)"
-            tooltip-effect="light"
-            size="small"
-            :key="updateFlag"
-            @selection-change="selectionChange"
-            row-key="id"
-            :expand-row-keys="expands"
-            @expand-change="toggleRow"
-            @sort-change="sortChange"
-            :default-sort="settings.defaultSort"
-            :empty-text="emptyText"
-            :show-header="settings.showHeader"
-            :row-class-name="setRowClassName"
-            lazy
-            :load="load"
-            :tree-props="treeProps"
-            class="customer-table"
+  <div class="zz-table">
+    <!-- :height='isScroll ? boxHeight : null' -->
+    <el-table
+      :border="settings.tableBorder"
+      :height="height"
+      style="width: 100%"
+      ref="table"
+      v-loading="loading"
+      :data="data"
+      :summary-method="getSummaries"
+      :show-summary="!!(settings.summaryCol && settings.summaryCol.length)"
+      tooltip-effect="light"
+      size="small"
+      :key="updateFlag"
+      @selection-change="selectionChange"
+      row-key="id"
+      :expand-row-keys="expands"
+      @expand-change="toggleRow"
+      @sort-change="sortChange"
+      :default-sort="settings.defaultSort"
+      :empty-text="emptyText"
+      :show-header="settings.showHeader"
+      :row-class-name="setRowClassName"
+      lazy
+      :load="load"
+      :tree-props="treeProps"
+      class="customer-table"
+    >
+      <!-- 显示多选框 -->
+      <el-table-column
+        type="selection"
+        width="60"
+        align="center"
+        v-if="settings.showCheckbox"
+        :selectable="selectable"
+      ></el-table-column>
+      <!-- 显示单选框 -->
+      <el-table-column
+        width="50"
+        align="left"
+        v-if="settings.showRadio"
+      >
+        <template slot-scope="scope">
+          <el-radio-group v-model="radioSelect">
+            <el-radio :label="scope.$index"></el-radio>
+          </el-radio-group>
+        </template>
+      </el-table-column>
+      <!-- 显示序号 -->
+      <el-table-column
+        label="No."
+        type="index"
+        :width="70"
+        align="left"
+        v-if="settings.showIndex"
+      ></el-table-column>
+      <el-table-column
+        label="NO."
+        type="index"
+        :width="settings.showNumberWidth"
+        align="left"
+        v-if="settings.showNumber"
+      ></el-table-column>
+      <!-- 显示具体行 -->
+      <el-table-column
+        v-for="(item, index) in cols"
+        :fixed="item.fixed"
+        :width="item.width"
+        :min-width="item.minWidth"
+        :prop="item.prop"
+        :label="item.label"
+        :key="index"
+        :type="item.type"
+        align="left"
+        :sortable="item.sort || false"
+        filter-placement="bottom"
+        :show-overflow-tooltip="!isIE"
+      >
+        <template
+          slot="header"
+          slot-scope="scope"
         >
-            <!-- 显示多选框 -->
-            <el-table-column
-                type="selection"
-                width="60"
-                align="center"
-                v-if="settings.showCheckbox"
-                :selectable="selectable"
-            ></el-table-column>
-            <!-- 显示单选框 -->
-            <el-table-column width="50" align="left" v-if="settings.showRadio">
-                <template slot-scope="scope">
-                    <el-radio-group v-model="radioSelect">
-                        <el-radio :label="scope.$index"></el-radio>
-                    </el-radio-group>
-                </template>
-            </el-table-column>
-            <!-- 显示序号 -->
-            <el-table-column label="No." type="index" :width="70" align="left" v-if="settings.showIndex"></el-table-column>
-            <el-table-column
-                label="NO."
-                type="index"
-                :width="settings.showNumberWidth"
-                align="left"
-                v-if="settings.showNumber"
-            ></el-table-column>
-            <!-- 显示具体行 -->
-            <el-table-column
-                v-for="(item, index) in cols"
-                :fixed="item.fixed"
-                :width="item.width"
-                :min-width="item.minWidth"
-                :prop="item.prop"
-                :label="item.label"
-                :key="index"
-                :type="item.type"
-                align="left"
-                :sortable="item.sort || false"
-                filter-placement="bottom"
-                :show-overflow-tooltip="!isIE"
-            >
-                <template slot="header" slot-scope="scope">
-                    <slot v-if="item.headerSlot" :name="item.headerSlot" :data="scope"></slot>
-                    <span v-else>{{ item.label }}</span>
-                </template>
-                <template slot-scope="scope">
-                    <!-- 插槽 -->
-                    <slotItem v-if="item.slot" :row="scope.row" :index="scope.$index" :slots="$scopedSlots[item.slot]"></slotItem>
-                    <!-- 过滤方法 -->
-                    <el-tooltip
-                        v-else-if="item.format && isIE"
-                        class="item"
-                        effect="light"
-                        placement="bottom"
-                        :disabled="item.format(scope.row[item.prop]).length < 2"
-                        :content="item.format(scope.row[item.prop])"
-                    >
-                        <p
-                            @click="item.click ? item.click() : null"
-                            v-html="
+          <slot
+            v-if="item.headerSlot"
+            :name="item.headerSlot"
+            :data="scope"
+          ></slot>
+          <span v-else>{{ item.label }}</span>
+        </template>
+        <template slot-scope="scope">
+          <!-- 插槽 -->
+          <slotItem
+            v-if="item.slot"
+            :row="scope.row"
+            :index="scope.$index"
+            :slots="$scopedSlots[item.slot]"
+          ></slotItem>
+          <!-- 过滤方法 -->
+          <el-tooltip
+            v-else-if="item.format && isIE"
+            class="item"
+            effect="light"
+            placement="bottom"
+            :disabled="item.format(scope.row[item.prop]).length < 2"
+            :content="item.format(scope.row[item.prop])"
+          >
+            <p
+              @click="item.click ? item.click() : null"
+              v-html="
                                 item.format(scope.row[item.prop], scope.row) ||
                                 (item.format(scope.row[item.prop], scope.row) === 0 ? 0 : item.empty ? '' : '-')
                             "
-                        ></p>
-                    </el-tooltip>
-                    <p
-                        v-else-if="item.format && !isIE"
-                        @click="item.click ? item.click() : null"
-                        v-html="item.format(scope.row[item.prop]) || (item.format(scope.row[item.prop]) == 0 ? 0 : '-')"
-                    ></p>
-                    <!-- <p
+            ></p>
+          </el-tooltip>
+          <p
+            v-else-if="item.format && !isIE"
+            @click="item.click ? item.click() : null"
+            v-html="item.format(scope.row[item.prop]) || (item.format(scope.row[item.prop]) == 0 ? 0 : '-')"
+          ></p>
+          <!-- <p
                         v-else-if="item.format && isIE"          
                         class="item" effect="light" placement="top-start"  
                         @click="item.click ? item.click() : null"
@@ -113,328 +135,331 @@
                             (item.format(scope.row[item.prop], scope.row) === 0 ? 0 : item.empty ? '' : '-')
                         }}
                     </p> -->
-                    <!-- <p v-else-if="item.format" @click='item.click?item.click():null'>{{item.format(scope.row[item.prop]) || (item.format(scope.row[item.prop]) == 0 ? 0 : '-')}}</p> -->
-                    <!-- 默认显示 -->
-                    <el-tooltip
-                        v-else-if="!item.slot && !item.format && isIE"
-                        class="item"
-                        effect="light"
-                        placement="bottom"
-                        :disabled="scope.row[item.prop] && scope.row[item.prop].length < 2"
-                        :content="scope.row[item.prop]"
-                    >
-                        <p
-                            @click="item.click ? item.click() : null"
-                            v-html="scope.row[item.prop] || (scope.row[item.prop] === 0 ? 0 : item.empty ? '' : '-')"
-                        ></p>
-                    </el-tooltip>
-                    <p
-                        v-else
-                        @click="item.click ? item.click() : null"
-                        v-html="scope.row[item.prop] || (scope.row[item.prop] === 0 ? 0 : item.empty ? '' : '-')"
-                    ></p>
-                    <!-- <p v-else-if="item.fixToolTip" v-tip.same :data-txt="scope.row[item.prop]" @click="item.click ? item.click() : null">
+          <!-- <p v-else-if="item.format" @click='item.click?item.click():null'>{{item.format(scope.row[item.prop]) || (item.format(scope.row[item.prop]) == 0 ? 0 : '-')}}</p> -->
+          <!-- 默认显示 -->
+          <el-tooltip
+            v-else-if="!item.slot && !item.format && isIE"
+            class="item"
+            effect="light"
+            placement="bottom"
+            :disabled="scope.row[item.prop] && scope.row[item.prop].length < 2"
+            :content="scope.row[item.prop]"
+          >
+            <p
+              @click="item.click ? item.click() : null"
+              v-html="scope.row[item.prop] || (scope.row[item.prop] === 0 ? 0 : item.empty ? '' : '-')"
+            ></p>
+          </el-tooltip>
+          <p
+            v-else
+            @click="item.click ? item.click() : null"
+            v-html="scope.row[item.prop] || (scope.row[item.prop] === 0 ? 0 : item.empty ? '' : '-')"
+          ></p>
+          <!-- <p v-else-if="item.fixToolTip" v-tip.same :data-txt="scope.row[item.prop]" @click="item.click ? item.click() : null">
                         {{ scope.row[item.prop] || (scope.row[item.prop] === 0 ? 0 : item.empty ? '' : '-') }}
                     </p> -->
-                    <!-- <p v-else v-tip :data-txt="scope.row[item.prop]" @click="item.click ? item.click() : null">
+          <!-- <p v-else v-tip :data-txt="scope.row[item.prop]" @click="item.click ? item.click() : null">
                         {{ scope.row[item.prop] || (scope.row[item.prop] === 0 ? 0 : item.empty ? '' : '-') }}
                     </p> -->
-                </template>
-            </el-table-column>
-        </el-table>
-        <div class="foot" v-if="!settings.hideFoot">
-            <!-- 手动全选及操作 -->
-            <!-- <div v-if="false" class="selectAll" :class="{ hasIndex: settings.showIndex }">
+        </template>
+      </el-table-column>
+    </el-table>
+    <div
+      class="foot"
+      v-if="!settings.hideFoot"
+    >
+      <!-- 手动全选及操作 -->
+      <!-- <div v-if="false" class="selectAll" :class="{ hasIndex: settings.showIndex }">
                 <el-checkbox v-if="checkHide()" v-model="isSelectAll" @change="checkAllChange"></el-checkbox>
                 <el-tooltip class="item" effect="light" content="展示/隐藏" placement="bottom">
                     <span :class="checkHide()?'batch_display':'batch_collapse'" class="batch_button" @click="hideordisplay"></span>
                 </el-tooltip>
                 <slot v-if="checkHide()" name="batchtodo"></slot>
             </div> -->
-            <el-pagination
-                v-if="pageset.hasOwnProperty('total') && !settings.hidePagination"
-                class="pagination"
-                background
-                @size-change="sizeChange"
-                @current-change="currentChange"
-                :current-page="currentPage"
-                :page-sizes="pageset.pageSizes || [15, 30, 60, 120]"
-                :page-size="pageset.pageSize || 15"
-                :total="pageset.total || 0"
-                layout="total, sizes, prev, pager, next, jumper"
-            >
-            </el-pagination>
-        </div>
+      <el-pagination
+        v-if="pageset.hasOwnProperty('total') && !settings.hidePagination"
+        class="pagination"
+        background
+        @size-change="sizeChange"
+        @current-change="currentChange"
+        :current-page="currentPage"
+        :page-sizes="pageset.pageSizes || [15, 30, 60, 120]"
+        :page-size="pageset.pageSize || 15"
+        :total="pageset.total || 0"
+        layout="total, sizes, prev, pager, next, jumper"
+      >
+      </el-pagination>
     </div>
+  </div>
 </template>
 <script>
 export default {
-    name: 'zz-table',
-    props: {
-        /*
-		table例设置
-		[{
-			label: 例名.   必须.  String
-			prop: 数据字段.  必须.  String
-			fixed: 当前例是否固定.  值有left,right。 String
-			width: 例宽.  Number
-			slot: 插槽方式, String
-			format: 数据过滤方法, Function
-			click: 当前内容的点击事件, Function
+  name: 'zz-table',
+  props: {
+    /*
+table例设置
+[{
+  label: 例名.   必须.  String
+  prop: 数据字段.  必须.  String
+  fixed: 当前例是否固定.  值有left,right。 String
+  width: 例宽.  Number
+  slot: 插槽方式, String
+  format: 数据过滤方法, Function
+  click: 当前内容的点击事件, Function
 
-		}]
-		*/
-        cols: {
-            type: Array,
-            default() {
-                return [];
-            }
-        },
-        /*
-		table数据
-		*/
-        data: {
-            type: Array,
-            default() {
-                return [];
-            }
-        },
-        /*
-		table表格设置
-		*/
-        settings: {
-            type: Object,
-            default() {
-                return {
-                    // 是否显示表头
-                    showHeader: true,
-                    // 是否显示序号
-                    showIndex: false,
-                    // 是否显示序列号大写
-                    showNUmber: false,
-                    // 序列号宽度
-                    showNumberWidth: '70',
-                    // 是否显示多选框
-                    showCheckbox: false,
-                    hideAllCheckbox: false,
-                    // 是否显示单选框
-                    showRadio: false,
-                    // 需要统计列的prop集合,从0开始
-                    summaryCol: [],
-                    // 是否显示边框
-                    tableBorder: false
-                };
-            }
-        },
-        /*
-		分页设置
-		*/
-        pageset: {
-            type: Object,
-            default() {
-                return {
-                    total: 0,
-                    pageSize: 10,
-                    pageNum: 1,
-                    pageSizes: [15, 30, 60, 120]
-                };
-            }
-        },
-        loading: {
-            type: Boolean,
-            default() {
-                return false;
-            }
-        },
-        height: 0,
-        updateFlag: false, //触发表格重绘
-        // 统计数据.传入统计数据则显示该统计数据,否则显示现有列表数据
-        summaryData: {},
-        // 判断多选框是否可以勾选
-        selectable: {
-            type: Function,
-            default() {
-                return (row, index) => {
-                    return true;
-                };
-            }
-        },
-        expands: {
-            type: Array,
-            default() {
-                return [];
-            }
-        },
-        treeProps: {
-            type: Object,
-            default() {
-                return {};
-            }
-        },
-        load: {
-            type: Function,
-            default() {
-                return () => {};
-            }
-        },
-        emptyText: {
-            type: String,
-            default() {
-                return '暂无相关结果';
-            }
-        }
+}]
+*/
+    cols: {
+      type: Array,
+      default () {
+        return [];
+      }
     },
-    data() {
+    /*
+table数据
+*/
+    data: {
+      type: Array,
+      default () {
+        return [];
+      }
+    },
+    /*
+table表格设置
+*/
+    settings: {
+      type: Object,
+      default () {
         return {
-            isIE: false,
-            radioSelect: '',
-            boxHeight: null,
-            currentPage: 1,
-            isSelectAll: false,
-            isScroll: false,
-            hideornot: true
+          // 是否显示表头
+          showHeader: true,
+          // 是否显示序号
+          showIndex: false,
+          // 是否显示序列号大写
+          showNUmber: false,
+          // 序列号宽度
+          showNumberWidth: '70',
+          // 是否显示多选框
+          showCheckbox: false,
+          hideAllCheckbox: false,
+          // 是否显示单选框
+          showRadio: false,
+          // 需要统计列的prop集合,从0开始
+          summaryCol: [],
+          // 是否显示边框
+          tableBorder: false
         };
+      }
     },
-    methods: {
-        checkHide() {
-            if (this.settings.showCheckbox && this.hideornot) {
-                return true;
-            } else {
-                return false;
-            }
-        },
-        hideordisplay() {
-            this.hideornot = !this.hideornot;
-        },
-        setRadioIndex(index) {
-            this.radioSelect = index;
-        },
-        sortChange(column, prop, order) {
-            //点击排序按钮后拿到column.order,可以发送column.order给后台,后台再根据什么排序来返回排序过后的数据
-            // console.log(column + '---' + column.prop + '---' + column.order)
-            const data = JSON.parse(JSON.stringify(column));
-            data.prop = (data.prop && data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()) || null;
-            if (this.settings.defaultSort && this.settings.defaultSort.propExtend) {
-                data.prop = `${data.prop}${this.settings.defaultSort.propExtend}`;
-            }
-            data.order = data.order == 'ascending' ? 'ASC' : column.order == 'descending' ? 'DESC' : null;
-            this.$emit('sort-change', data);
-        },
-        toggleRow(row, expandedRows) {
-            // this.expands = [];
-            const index = _.findIndex(expandedRows, (v) => v.id == row.id);
-            if (index != -1) {
-                this.expands.push(row.id);
-                this.$emit('toggle-change', row);
-            } else {
-                this.expands = _.filter(this.expands, (v) => v != row.id);
-            }
-        },
-        // 多选派发事件selection-change
-        selectionChange(val) {
-            this.isSelectAll = val.length == this.data.length;
-            this.$emit('selection-change', val);
-        },
-        /*
-		页数改变时,派发pageChange事件,并传递当前分页参数;
-		其中pageSize为每页显示多少条数据,page为当前显示多少页
-		*/
-        sizeChange(pageSize) {
-            this.$emit('page-change', {
-                pageSize: pageSize
-            });
-        },
-        currentChange(page) {
-            this.currentPage = page;
-            this.$emit('page-change', {
-                page: page
-            });
-        },
-        // 合计
-        getSummaries(params) {
-            let { data } = params;
-            if ('{}' != JSON.stringify(this.summaryData)) {
-                data = [this.summaryData];
-            }
-            let sums = [];
-            sums[0] = '合计';
-            let cols = JSON.parse(JSON.stringify(this.settings.summaryCol));
-            let i = cols.length;
-            while (i--) {
-                // 计算当前列的prop字段
-                let index = cols[i];
-                if (this.settings.showIndex) {
-                    index -= 1;
-                }
-                if (this.settings.showCheckbox) {
-                    index -= 1;
-                }
-                if (this.settings.showRadio) {
-                    index -= 1;
-                }
-                let prop = this.cols[index].prop;
-                const values = data.map((item) => Number(item[prop]));
-                if (!values.every((value) => isNaN(value))) {
-                    sums[cols[i]] = values.reduce((prev, curr) => {
-                        const value = Number(curr);
-                        if (!isNaN(value)) {
-                            let sumVa = Number(prev) + curr;
-                            return sumVa.toFixed(2);
-                        } else {
-                            return Number(prev.toFixed(2));
-                        }
-                    }, 0);
-                    sums[cols[i]];
-                }
-            }
-
-            return sums;
-        },
-        checkAllChange(val) {
-            if (val) {
-                this.$refs.table.toggleAllSelection();
+    /*
+分页设置
+*/
+    pageset: {
+      type: Object,
+      default () {
+        return {
+          total: 0,
+          pageSize: 10,
+          pageNum: 1,
+          pageSizes: [15, 30, 60, 120]
+        };
+      }
+    },
+    loading: {
+      type: Boolean,
+      default () {
+        return false;
+      }
+    },
+    height: 0,
+    updateFlag: false, //触发表格重绘
+    // 统计数据.传入统计数据则显示该统计数据,否则显示现有列表数据
+    summaryData: {},
+    // 判断多选框是否可以勾选
+    selectable: {
+      type: Function,
+      default () {
+        return (row, index) => {
+          return true;
+        };
+      }
+    },
+    expands: {
+      type: Array,
+      default () {
+        return [];
+      }
+    },
+    treeProps: {
+      type: Object,
+      default () {
+        return {};
+      }
+    },
+    load: {
+      type: Function,
+      default () {
+        return () => { };
+      }
+    },
+    emptyText: {
+      type: String,
+      default () {
+        return '暂无相关结果';
+      }
+    }
+  },
+  data () {
+    return {
+      isIE: false,
+      radioSelect: '',
+      boxHeight: null,
+      currentPage: 1,
+      isSelectAll: false,
+      isScroll: false,
+      hideornot: true
+    };
+  },
+  methods: {
+    checkHide () {
+      if (this.settings.showCheckbox && this.hideornot) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    hideordisplay () {
+      this.hideornot = !this.hideornot;
+    },
+    setRadioIndex (index) {
+      this.radioSelect = index;
+    },
+    sortChange (column, prop, order) {
+      //点击排序按钮后拿到column.order,可以发送column.order给后台,后台再根据什么排序来返回排序过后的数据
+      // console.log(column + '---' + column.prop + '---' + column.order)
+      const data = JSON.parse(JSON.stringify(column));
+      data.prop = (data.prop && data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()) || null;
+      if (this.settings.defaultSort && this.settings.defaultSort.propExtend) {
+        data.prop = `${data.prop}${this.settings.defaultSort.propExtend}`;
+      }
+      data.order = data.order == 'ascending' ? 'ASC' : column.order == 'descending' ? 'DESC' : null;
+      this.$emit('sort-change', data);
+    },
+    toggleRow (row, expandedRows) {
+      // this.expands = [];
+      const index = _.findIndex(expandedRows, (v) => v.id == row.id);
+      if (index != -1) {
+        this.expands.push(row.id);
+        this.$emit('toggle-change', row);
+      } else {
+        this.expands = _.filter(this.expands, (v) => v != row.id);
+      }
+    },
+    // 多选派发事件selection-change
+    selectionChange (val) {
+      this.isSelectAll = val.length == this.data.length;
+      this.$emit('selection-change', val);
+    },
+    /*
+页数改变时,派发pageChange事件,并传递当前分页参数;
+其中pageSize为每页显示多少条数据,page为当前显示多少页
+*/
+    sizeChange (pageSize) {
+      this.$emit('page-change', {
+        pageSize: pageSize
+      });
+    },
+    currentChange (page) {
+      this.currentPage = page;
+      this.$emit('page-change', {
+        page: page
+      });
+    },
+    // 合计
+    getSummaries (params) {
+      let { data } = params;
+      if ('{}' != JSON.stringify(this.summaryData)) {
+        data = [this.summaryData];
+      }
+      let sums = [];
+      sums[0] = '合计';
+      let cols = JSON.parse(JSON.stringify(this.settings.summaryCol));
+      let i = cols.length;
+      while (i--) {
+        // 计算当前列的prop字段
+        let index = cols[i];
+        if (this.settings.showIndex) {
+          index -= 1;
+        }
+        if (this.settings.showCheckbox) {
+          index -= 1;
+        }
+        if (this.settings.showRadio) {
+          index -= 1;
+        }
+        let prop = this.cols[index].prop;
+        const values = data.map((item) => Number(item[prop]));
+        if (!values.every((value) => isNaN(value))) {
+          sums[cols[i]] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              let sumVa = Number(prev) + curr;
+              return sumVa.toFixed(2);
             } else {
-                this.$refs.table.clearSelection();
-            }
-        },
-        //自定义表头斑马线
-        setRowClassName({ row, rowIndex }) {
-            let index = rowIndex;
-            if (index % 2 == 0) {
-                return 'warning-row';
+              return Number(prev.toFixed(2));
             }
+          }, 0);
+          sums[cols[i]];
         }
+      }
+
+      return sums;
     },
-    watch: {
-        radioSelect(n) {
-            this.$emit('radio-change', this.data[n]);
-        },
-        pageset: {
-            deep: true,
-            handler(n) {
-                this.currentPage = n.pageNum;
-            }
-        }
+    checkAllChange (val) {
+      if (val) {
+        this.$refs.table.toggleAllSelection();
+      } else {
+        this.$refs.table.clearSelection();
+      }
     },
-    components: {
-        slotItem: {
-            props: ['slots', 'row', 'index'],
-            render(h) {
-                let vnode = this.slots({
-                    row: this.row,
-                    index: this.index
-                });
-                return h('div', vnode);
-            }
-        }
+    //自定义表头斑马线
+    setRowClassName ({ row, rowIndex }) {
+      let index = rowIndex;
+      if (index % 2 == 0) {
+        return 'warning-row';
+      }
+    }
+  },
+  watch: {
+    radioSelect (n) {
+      this.$emit('radio-change', this.data[n]);
     },
-    created() {
-        const userAgent = window.navigator.userAgent;
-        const isIE = userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1; //判断是否IE<11浏览器
-        const isEdge = userAgent.indexOf('Edge') > -1 && !isIE; //判断是否IE的Edge浏览器
-        const isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
-        this.isIE = isIE11 || isEdge || isIE;
+    pageset: {
+      deep: true,
+      handler (n) {
+        this.currentPage = n.pageNum;
+      }
+    }
+  },
+  components: {
+    slotItem: {
+      props: ['slots', 'row', 'index'],
+      render (h) {
+        let vnode = this.slots({
+          row: this.row,
+          index: this.index
+        });
+        return h('div', vnode);
+      }
     }
+  },
+  created () {
+    const userAgent = window.navigator.userAgent;
+    const isIE = userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1; //判断是否IE<11浏览器
+    const isEdge = userAgent.indexOf('Edge') > -1 && !isIE; //判断是否IE的Edge浏览器
+    const isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
+    this.isIE = isIE11 || isEdge || isIE;
+  }
 };
 </script>
 

+ 4 - 0
operationSupport/src/router/dynamicMuen.js

@@ -84,6 +84,10 @@ const staticMuen = [
     //     path: '/employeeServices',
     //     component: () => import(/* webpackChunkName: "404" */ '@views/workOrders/employeeServices/index.vue')
     // },
+    // {
+    //     path: '/PatrolStatistics',
+    //     component: () => import(/* webpackChunkName: "404" */ '@views/patrolManagement/PatrolStatistics.vue')
+    // },
     {
         path: '*',
         redirect: '/404'

+ 268 - 0
operationSupport/src/views/patrolManagement/PatrolStatistics.vue

@@ -0,0 +1,268 @@
+<!--
+ * @Author:韩玮涛
+ * @Date: 2022-08-08 09:38:04
+ * @LastEditTime: 2022-08-08 15:22:09
+ * @LastEditors: D4THYL3
+ * @Description: In User Settings Edit
+ * @FilePath: \operationSupport\src\views\patrolManagement\PatrolStatistics.vue
+-->
+<template>
+  <div class="main">
+    <div class="search">
+      <el-select
+        v-model="mixins_query.communityId"
+        clearable
+        placeholder="请选择社区名称"
+      >
+        <el-option
+          v-for="(item, index) in communityList"
+          :label="item.label"
+          :value="item.id"
+          :key="index"
+        ></el-option>
+      </el-select>
+
+      <el-select
+        v-model="mixins_query.patrolType"
+        placeholder="请选择巡更类型"
+        clearable
+      >
+        <el-option
+          v-for="(item,index) in patrolTypeList"
+          :key="index"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option>
+      </el-select>
+
+      <el-date-picker
+        v-model="times"
+        value-format="yyyy-MM-dd"
+        type="daterange"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+        @change="effectiveDateToggle"
+      ></el-date-picker>
+      <el-button
+        type="primary"
+        class="search-btn"
+        @click="mixins_search"
+        icon="el-icon-search"
+      >查询</el-button>
+      <div class="search-icon">
+        <el-tooltip
+          class="item"
+          effect="light"
+          placement="bottom"
+          content="导出"
+        >
+          <i
+            class="zoniot_font zoniot-icon-daochu2"
+            @click="exportExcel()"
+          ></i>
+        </el-tooltip>
+      </div>
+    </div>
+
+    <div class="tablecolumn">
+      <el-table
+        :data="tableData"
+        style="width: 100%"
+        border
+      >
+        <el-table-column
+          prop="communityName"
+          label="所属社区"
+        ></el-table-column>
+
+        <el-table-column
+          prop="communityName"
+          label="巡更路线"
+        ></el-table-column>
+
+        <el-table-column
+          prop="communityName"
+          label="巡更人员"
+        ></el-table-column>
+
+        <el-table-column
+          prop="communityName"
+          label="巡更日期"
+        ></el-table-column>
+
+        <el-table-column
+          prop="communityName"
+          label="巡更时间"
+        ></el-table-column>
+
+        <el-table-column
+          :label="item.oneTitle"
+          v-for="(item,index) in outermostTitle"
+          :key="index"
+        >
+
+          <el-table-column
+            :label="it.title"
+            v-for="(it,ine) in item.twoTitle"
+            :key="ine"
+          >
+            <template slot-scope="scope">
+              {{ it.optionValue[scope.$index]}}
+            </template>
+          </el-table-column>
+        </el-table-column>
+
+      </el-table>
+      <el-pagination
+        class="pagination"
+        background
+        @size-change="sizeChange"
+        @current-change="currentChange"
+        :current-page="currentPage"
+        :page-sizes="pageset.pageSizes || [15, 30, 60, 120]"
+        :page-size="pageset.pageSize || 15"
+        :total="pageset.total || 0"
+        layout="total, sizes, prev, pager, next, jumper"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      tableData: [
+        {
+          communityName: '222222',
+          index: '1'
+        },
+        {
+          communityName: '555555',
+          index: '2'
+        },
+      ],
+      outermostTitle: [
+        {
+          oneTitle: '1111',
+          twoTitle: [
+            {
+              title: '55566',
+              optionValue: ['5555', '44444', '33333'],
+            },
+            {
+              title: '666644',
+              optionValue: ['7777', '147878']
+            }
+          ]
+        }, {
+          oneTitle: '2222'
+        }
+      ],
+      pageset: {
+        total: 0,
+        pageSize: 1,
+        pageNum: 15,
+        pageSizes: [15, 30, 60, 120]
+      },
+      currentPage: 1,
+      mixins_query: {
+        communityId: '',
+        patrolType: '',
+        startTime: '',
+        endTime: ''
+      },
+      times: [],
+      communityList: [],
+      patrolTypeList: [{
+        label: '市容市貌',
+        value: '1'
+      },
+      {
+        label: '环境卫生',
+        value: '2'
+      },
+      {
+        label: '公共秩序',
+        value: '3'
+      },
+      {
+        label: '设备设施',
+        value: '4'
+      },
+      {
+        label: '消防安全',
+        value: '5'
+      },]
+
+    }
+  },
+  watch: {
+    pageset: {
+      deep: true,
+      handler (n) {
+        debugger
+        this.currentPage = n.pageNum;
+      }
+    }
+  },
+  methods: {
+    sizeChange (pageSize) {
+      this.pageset.pageSize = pageSize;
+      // this.$emit('page-change', {
+      //   pageSize: pageSize
+      // });
+    },
+    currentChange (page) {
+      this.currentPage = page;
+      this.pageset.pageNum = page;
+      // this.$emit('page-change', {
+      //   page: page
+      // });
+    },
+    //获取社区名称下拉列表
+    communityNameList () {
+      this.communityList = [];
+      this.$http.get('/czc-community/assets/community/list', {}).then(({ status, data, msg }) => {
+        if (status == 0) {
+          data.map((item, index) => {
+            this.communityList.push({
+              label: item.communityName,
+              id: item.id
+            })
+          })
+          // 默认选中第一个
+          this.mixins_query.communityId = this.communityList[0].id;
+          // 默认选择市容市貌
+          this.mixins_query.patrolType = '1';
+        }
+      })
+    },
+    // 时间
+    effectiveDateToggle (va) {
+      let arr = va;
+      if (!arr) {
+        arr = ['', ''];
+      }
+      this.mixins_query.startTime = !!arr[0] ? arr[0] + ' 00:00:00' : '';
+      this.mixins_query.endTime = !!arr[1] ? arr[1] + ' 23:59:59' : '';
+      console.log('5555', this.mixins_query);
+    },
+    mixins_search () {
+      console.log('11');
+    }
+  },
+  created () {
+    this.communityNameList();
+  }
+}
+</script>
+
+
+
+<style lang='scss' scoped >
+@import '@assets/css/public-style.scss';
+</style>

+ 163 - 133
operationSupport/src/views/patrolManagement/popups/mapValue.vue

@@ -1,149 +1,179 @@
 <template>
-    <div>
-        <div id="mapValue" :style="`height:${height || 300}px`"></div>
-        <!--控制条-->
-        <div class="map-control" v-if="isStart && !!line.length">
-            <div class="clickIco">
-                <i class="zoniot_font zoniot-icon-kaishi" v-if="palyStayus == 0" @click="navgControl('start')"></i>
-                <i class="zoniot_font zoniot-icon-tingzhi" v-else-if="palyStayus == 2" @click="navgControl('pause')"></i>
-                <i class="zoniot_font zoniot-icon-kaishi" v-else-if="palyStayus == 1" @click="navgControl('resume')"></i>
-            </div>
-            <el-slider
-                class="slider"
-                v-model="sliderVal"
-                :show-tooltip="false"
-                :format-tooltip="hideFormat"
-                :step="0.0001"
-                :disabled="beforeInit"
-                @change="carReLocate"
-            ></el-slider>
-            <el-select v-model="times">
-                <el-option :value="1" label="1倍速"></el-option>
-                <el-option :value="2" label="2倍速"></el-option>
-                <el-option :value="3" label="3倍速"></el-option>
-                <el-option :value="4" label="4倍速"></el-option>
-            </el-select>
-        </div>
+  <div>
+    <div
+      id="mapValue"
+      :style="`height:${height || 300}px`"
+    ></div>
+    <!--控制条-->
+    <div
+      class="map-control"
+      v-if="isStart && !!line.length"
+    >
+      <div class="clickIco">
+        <i
+          class="zoniot_font zoniot-icon-kaishi"
+          v-if="palyStayus == 0"
+          @click="navgControl('start')"
+        ></i>
+        <i
+          class="zoniot_font zoniot-icon-tingzhi"
+          v-else-if="palyStayus == 2"
+          @click="navgControl('pause')"
+        ></i>
+        <i
+          class="zoniot_font zoniot-icon-kaishi"
+          v-else-if="palyStayus == 1"
+          @click="navgControl('resume')"
+        ></i>
+      </div>
+      <el-slider
+        class="slider"
+        v-model="sliderVal"
+        :show-tooltip="false"
+        :format-tooltip="hideFormat"
+        :step="0.0001"
+        :disabled="beforeInit"
+        @change="carReLocate"
+      ></el-slider>
+      <el-select v-model="times">
+        <el-option
+          :value="1"
+          label="1倍速"
+        ></el-option>
+        <el-option
+          :value="2"
+          label="2倍速"
+        ></el-option>
+        <el-option
+          :value="3"
+          label="3倍速"
+        ></el-option>
+        <el-option
+          :value="4"
+          label="4倍速"
+        ></el-option>
+      </el-select>
     </div>
+  </div>
 </template>
 
 <script>
 import functionJs from './pathSimplifierIns';
 export default {
-    props: ['point', 'isStart', 'height', 'line'],
-    mixins: [functionJs],
-    data() {
-        return {
-            marker: '',
-            markerArr: [],
-            polyline: null,
-            lineArr2: []
-        };
-    },
-    watch: {
-        point: {
-            handler() {
-                if (!!this.map) {
-                    // 判断当前是否有绘制点位清除
-                    if (this.markerArr.length > 0) {
-                        this.map.remove(this.markerArr);
-                        this.markerArr = [];
-                    }
-                    // 判断当前是否有轨迹清除
-                    if (!!this.polyline) {
-                        this.map.remove(this.polyline);
-                        this.polyline = null;
-                        this.lineArr2 = [];
-                    }
-                    // 先初始化点位信息
-                    this.point.map((item, index) => {
-                        this.addIcon(item, index);
-                    });
-                    this.setMap();
-                }
-            },
-            deep: true,
-            immediate: true
-        },
-        line: {
-            handler() {
-                if (!!this.map) {
-                    this.lineArr = [];
-                    // 判断当前是否有巡航路线清除
-                    if (!!this.pathSimplifierIns) {
-                        this.pathSimplifierIns.setData([]);
-                        this.pathSimplifierIns = null;
-                    }
-                    this.line.map((item) => {
-                        this.lineArr.push([item.longitude, item.latitude]);
-                    });
-                    // 是否巡航开启
-                    if (this.isStart && this.lineArr.length != 0) {
-                        this.$nextTick(() => {
-                            this.initPlayBox();
-                            this.beforeInit = true;
-                            this.initLineArr(true);
-                        });
-                    }
-                }
-            },
-            deep: true,
-            immediate: true
+  props: ['point', 'isStart', 'height', 'line'],
+  mixins: [functionJs],
+  data () {
+    return {
+      marker: '',
+      markerArr: [],
+      polyline: null,
+      lineArr2: []
+    };
+  },
+  watch: {
+    point: {
+      handler () {
+        if (!!this.map) {
+          // 判断当前是否有绘制点位清除
+          if (this.markerArr.length > 0) {
+            this.map.remove(this.markerArr);
+            this.markerArr = [];
+          }
+          // 判断当前是否有轨迹清除
+          if (!!this.polyline) {
+            this.map.remove(this.polyline);
+            this.polyline = null;
+            this.lineArr2 = [];
+          }
+          // 先初始化点位信息
+          this.point.map((item, index) => {
+            this.addIcon(item, index);
+          });
+          this.setMap();
         }
+      },
+      deep: true,
+      immediate: true
     },
-    methods: {
-        init() {
-            this.map = new AMap.Map('mapValue', {
-                resizeEnable: true, //是否监控地图容器尺寸变化
-                zoom: 11 //初始化地图层级
-            });
-        },
-        //绘制点位信息
-        addIcon(e, index) {
-            let lineArr = [e.longitude, e.latitude];
-            let self = this;
-            this.marker = new AMap.Marker({
-                icon: new AMap.Icon({
-                    image: !!e.id ? self.pointIcon : self.pointGradIcon,
-                    size: new AMap.Size(20, 25),
-                    imageSize: new AMap.Size(20, 28)
-                }),
-                position: lineArr
-            });
-            this.marker.setLabel({
-                offset: new AMap.Pixel(-22, 30),
-                content: `巡更点:${index + 1}`
-            });
-            this.markerArr.push(this.marker);
-            this.lineArr2.push(lineArr);
-        },
-        // 添加点位 添加路线到地图
-        setMap() {
-            this.map.add(this.markerArr);
-            this.map.setFitView();
-            // 大于一个点创建 轨迹回放
-            if (this.point.length > 1 && !this.isStart) {
-                this.addPolyline();
-            }
-        },
-        //轨迹路线
-        addPolyline() {
-            this.polyline = new AMap.Polyline({
-                map: this.map,
-                path: this.lineArr2,
-                showDir: true,
-                strokeColor: '#28F', //线颜色
-                // strokeOpacity: 1,     //线透明度
-                strokeWeight: 6 //线宽
-                // strokeStyle: "solid"  //线样式
+    line: {
+      handler () {
+        if (!!this.map) {
+          this.lineArr = [];
+          // 判断当前是否有巡航路线清除
+          if (!!this.pathSimplifierIns) {
+            this.pathSimplifierIns.setData([]);
+            this.pathSimplifierIns = null;
+          }
+          this.line.map((item) => {
+            this.lineArr.push([item.longitude, item.latitude]);
+          });
+          // 是否巡航开启
+          if (this.isStart && this.lineArr.length != 0) {
+            this.$nextTick(() => {
+              this.initPlayBox();
+              this.beforeInit = true;
+              this.initLineArr(true);
             });
+          }
         }
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  methods: {
+    init () {
+      this.map = new AMap.Map('mapValue', {
+        resizeEnable: true, //是否监控地图容器尺寸变化
+        zoom: 11 //初始化地图层级
+      });
+    },
+    //绘制点位信息
+    addIcon (e, index) {
+      let lineArr = [e.longitude, e.latitude];
+      let self = this;
+      this.marker = new AMap.Marker({
+        icon: new AMap.Icon({
+          image: !!e.id ? self.pointIcon : self.pointGradIcon,
+          size: new AMap.Size(20, 25),
+          imageSize: new AMap.Size(20, 28)
+        }),
+        position: lineArr
+      });
+      this.marker.setLabel({
+        offset: new AMap.Pixel(-22, 30),
+        content: `巡更点:${index + 1}`
+      });
+      this.markerArr.push(this.marker);
+      this.lineArr2.push(lineArr);
+    },
+    // 添加点位 添加路线到地图
+    setMap () {
+      this.map.add(this.markerArr);
+      this.map.setFitView();
+      // 大于一个点创建 轨迹回放
+      if (this.point.length > 1 && !this.isStart) {
+        this.addPolyline();
+      }
     },
-    created() {
-        this.$nextTick(() => {
-            this.init();
-        });
+    //轨迹路线
+    addPolyline () {
+      this.polyline = new AMap.Polyline({
+        map: this.map,
+        path: this.lineArr2,
+        showDir: true,
+        strokeColor: '#28F', //线颜色
+        // strokeOpacity: 1,     //线透明度
+        strokeWeight: 6 //线宽
+        // strokeStyle: "solid"  //线样式
+      });
     }
+  },
+  created () {
+    this.$nextTick(() => {
+      this.init();
+    });
+  }
 };
 </script>
 <style scoped  lang="scss">

+ 2 - 1
operationSupport/src/views/patrolManagement/popups/pathSimplifierIns.js

@@ -11,7 +11,8 @@ export default {
             sliderVal: 0, // 进度条
             times: 1, // 倍速
             maxSpeed: 10, // 最高倍速
-            navgtrSpeed: 5000, // 速度
+            navgtrSpeed: 500, // 速度
+            // navgtrSpeed: 5000, // 速度
             isMinSpeed: true,
             isMaxSpeed: false,
             navgtr: null,

+ 9 - 5
operationSupport/src/views/patrolManagement/popups/patrolDetails.vue

@@ -100,7 +100,13 @@
                 v-for="(it,ine) in item.twoTitle"
                 :key="ine"
               >
-                {{it.optionValue}} </el-table-column>
+                <span
+                  v-if="it.status == 1"
+                  style="color: red;"
+                >{{it.optionValue}}</span>
+                <span v-else> {{it.optionValue}}</span>
+                <!-- {{it.optionValue}} -->
+              </el-table-column>
             </el-table-column>
 
           </el-table>
@@ -242,9 +248,7 @@ export default {
       leftItem: [],
       targetData: [],
       tableData: [],
-      outermostTitle: [
-
-      ]
+      outermostTitle: []
     };
   },
   filters: {
@@ -293,11 +297,11 @@ export default {
               oneTitle: data.details[i].patrolType == '1' ? '市容市貌' : data.details[i].patrolType == '2' ? '环境卫生' : data.details[i].patrolType == '3' ? '公共秩序' : data.details[i].patrolType == '4' ? '设备实施' : '消防安全',
               twoTitle: []
             })
-            console.log(this.outermostTitle);
             for (let k = 0; k < data.details[i].list.length; k++) {
               this.outermostTitle[i].twoTitle.push({
                 title: data.details[i].list[k].content,
                 optionValue: data.details[i].list[k].optionValue,
+                status: data.details[i].list[k].status,
               })
             }
           }