suxinf před 5 roky
rodič
revize
858d6415e1

+ 6 - 0
src/router/index.js

@@ -28,6 +28,8 @@ import ContentCategory1 from '../views/parameter/ContentCategory1'
 import ContentCategory2 from '../views/parameter/ContentCategory2'
 // 媒体平台
 import MediaPlatform  from '../views/parameter/MediaPlatform'
+// 权限分组
+import Grouping from '../views/parameter/Grouping'
 // 链接上传
 import LinkUpload  from '../views/parameter/LinkUpload'
 
@@ -97,6 +99,10 @@ const routes = [
         component: MediaPlatform
       },
       {
+        path: 'grouping',
+        component: Grouping
+      },
+      {
         path: 'linkUpload',
         component: LinkUpload
       }

+ 5 - 0
src/tableConfig/parameter.js

@@ -26,6 +26,11 @@ const TAG = [
     },
     {
         num: 6,
+        title: '权限分组',
+        path: 'grouping'
+    },
+    {
+        num: 7,
         title: '链接上传',
         path: 'linkUpload'
     }

+ 166 - 0
src/views/parameter/Grouping.vue

@@ -0,0 +1,166 @@
+<template>
+  <div>
+    <div class="grouping" v-if="queryTag">
+      <div class="count">
+        <button @click="showModal">新增小组</button>
+        <Count :sum="sum"></Count>
+      </div>
+      <div class="table">
+        <Table
+          :tableData="tableData"
+          @edit="edit"
+          @delet_data="deleteData"
+          @group_member="groupMember"
+          :pageSize='sum'
+        ></Table>
+      </div>
+      <div class="page">
+        <Tablepage
+          :totalPage="totalPage"
+          :currentPage="currentPage"
+          @change_page="changePage"
+          @jump_page="jumpPage"
+        ></Tablepage>
+      </div>
+      <div class="modal" v-if="modalFlag">
+        <Modal :modalFlag="modalFlag" @hide_modal="showModal" @submit='submit'></Modal>
+      </div>
+    </div>
+    <div v-else>
+      <GroupMember />
+    </div>
+  </div>
+</template>
+
+<script>
+import Count from "../../components/Count";
+import Tablepage from "../../components/TablePage";
+import Table from "./components/Grouping/GroupingTable";
+import Modal from "./components/Grouping/GroupingModal";
+import GroupMember from "./components/Grouping/GroupMember";
+export default {
+  components: {
+    Count,
+    Table,
+    Tablepage,
+    Modal,
+    GroupMember,
+  },
+  data() {
+    return {
+      sum: 140, // 一共有多少条数据
+      pageSize: 20, // 每页展示的数据
+      currentPage: 1,
+      // 表格配置
+      tableData: [],
+      getDate: [
+        { group: "第一小组", str: "13" },
+        { group: "第二小组", str: "14" },
+        { group: "第三小组", str: "15" },
+        { group: "第四小组", str: "125" },
+        { group: "第五小组", str: "125" },
+      ],
+      functionData: [],
+      modalFlag: false, // 控制模态框展示
+    };
+  },
+  computed: {
+    // 表格总页数
+    totalPage() {
+      return Math.ceil(this.sum / this.pageSize);
+    },
+    // 获取路由参数
+    queryTag() {
+      return this.$route.query && this.$route.query.tag ? 0 : 1;
+    },
+  },
+  methods: {
+    // 获取某一页面的数据,展示在表格
+    changePage: function (page) {
+      this.currentPage = page;
+      console.log(page);
+    },
+    // 点击上一页,下一页,首页,尾页
+    jumpPage: function (item) {
+      switch (item) {
+        case 1:
+          this.currentPage = 1;
+          break;
+        case 2:
+          this.currentPage = this.currentPage - 1;
+          break;
+        case 3:
+          this.currentPage = this.currentPage + 1;
+          break;
+        case 4:
+          this.currentPage = this.totalPage;
+          break;
+      }
+      console.log(this.currentPage);
+    },
+    // 获取数据
+    getData: function () {
+      this.tableData = [];
+      this.functionData = [];
+      this.getDate.forEach((element) => {
+        this.tableData.push({
+          group: element.group,
+        });
+        this.functionData.push({
+          str: element.str,
+        });
+      });
+    },
+    // 展示、隐藏模态框
+    showModal: function () {
+      this.modalFlag = !this.modalFlag;
+    },
+    // 模态框保存
+    submit: function(groupName) {
+      console.log('小组保存', groupName);
+      this.modalFlag = false;
+    },
+    // 点击编辑
+    edit(index, newName) {
+      console.log(this.functionData[index].str, newName);
+    },
+    // 点击删除
+    deleteData: function(index) {
+      console.log("删除", this.functionData[index].str);
+    },
+    // 点击系列车型
+    groupMember: function(index) {
+      // 页面变化
+      this.$router.push({ query: { tag: "group_menber" } });
+      console.log("点击系列车型", this.functionData[index].str);
+    },
+    // 删除数据
+    detletData: function() {
+      console.log('删除数据');
+    }
+  },
+  mounted() {
+    this.getData();
+  },
+};
+</script>
+
+<style scoped lang="less">
+.grouping {
+  .count {
+    height: 40px;
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    button {
+      width: 86px;
+      height: 30px;
+      position: relative;
+      bottom: -5px;
+      margin: 0;
+      border-radius: 2px;
+    }
+  }
+}
+</style>

+ 153 - 0
src/views/parameter/components/Grouping/GroupMember.vue

@@ -0,0 +1,153 @@
+<template>
+  <div>
+  <div class="car_series">
+    <div class="count">
+      <button @click="showModal">新增成员</button>
+      <Count :sum='sum'></Count>
+    </div>
+    <div class="table">
+      <Table
+        :tableData='tableData'
+        @edit='edit'
+        @delet_data='deleteData'
+        :pageSize='sum'
+      ></Table>
+    </div>
+    <div class="page">
+      <Tablepage
+        :totalPage='totalPage'
+        :currentPage='currentPage'
+        @change_page='changePage'
+        @jump_page='jumpPage'
+      ></Tablepage>
+    </div>
+    <div class="modal" v-if="modalFlag">
+      <Modal
+        :modalFlag='modalFlag'
+        @submit='submit'
+        @hide_modal='showModal'
+      ></Modal>
+    </div>
+  </div>
+  </div>
+</template>
+
+<script>
+import Count from '../../../../components/Count'
+import Tablepage from '../../../../components/TablePage';
+import Table from './GroupMemberTable';
+import Modal from "./GroupMemberModal";
+
+export default {
+  components: {
+    Count,
+    Table,
+    Tablepage,
+    Modal
+  },
+  data() {
+    return {
+      sum: 140, // 一共有多少条数据
+      pageSize: 20, // 每页展示的数据
+      currentPage: 1,
+      tableData: [],
+      getDate: [{member: '北京博睿', str: '123'},{member: '北京广通', str: '124'},{member: 'ES4', str: '125'},],
+      functionData: [],
+      modalFlag: false, // 控制模态框展示
+    }
+  },
+  computed:{
+    // 表格总页数
+    totalPage() {
+      return Math.ceil(this.sum/this.pageSize);
+    },
+    // 获取路由参数
+    queryTag() {
+      console.log (111, this.$route.query);
+      return (this.$route.query && this.$route.query.tag) ? 0 : 1
+    }
+  },
+  methods: {
+    // 获取某一页面的数据,展示在表格
+    changePage: function(page) {
+      this.currentPage = page;
+      console.log(page);
+    },
+    // 点击上一页,下一页,首页,尾页
+    jumpPage: function(item) {
+      switch(item) {
+        case 1:
+          this.currentPage = 1;
+          break;
+        case 2:
+          this.currentPage = this.currentPage - 1;
+          break;
+        case 3:
+          this.currentPage = this.currentPage + 1;
+          break;
+        case 4:
+          this.currentPage = this.totalPage;
+          break;
+      }
+      console.log(this.currentPage);
+    },
+    // 获取数据
+    getData: function() {
+      this.tableData = [];
+      this.functionData = [];
+      this.getDate.forEach( (element) => {
+        this.tableData.push(
+          {
+            member: element.member
+          }
+        );
+        this.functionData.push(
+          {
+            str: element.str
+          }
+        )
+      });
+    },
+    // 展示、隐藏模态框
+    showModal: function() {
+      this.modalFlag = !this.modalFlag;
+    },
+    // 点击编辑
+    edit (index, newName) {
+      console.log(this.functionData[index].str, newName);
+    },
+    // 点击删除
+    deleteData (index) {
+      console.log('删除', this.functionData[index].str)
+    },
+    // 新增车型模态框 保存
+    submit: function(list1, list2) {
+        console.log('保存', list1, list2);
+        this.modalFlag = false;
+    },
+  },
+  mounted() {
+    this.getData();
+  }
+}
+</script>
+
+<style scoped lang="less">
+.car_series{
+  .count{
+    height: 40px;
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    button{
+      width: 86px;
+      height: 30px;
+      position: relative;
+      bottom: -5px;
+      margin: 0;
+      border-radius: 2px;
+    }
+  }
+}
+</style>

+ 299 - 0
src/views/parameter/components/Grouping/GroupMemberModal.vue

@@ -0,0 +1,299 @@
+<template>
+  <div v-if="modalFlag">
+    <div class="group_member_modal">
+      <div class="modal_content">
+        <div class="addByArea">
+          <span>按区域添加</span>
+          <div v-for="(item, index) in areaList" :key="index">
+            <input
+              type="checkbox"
+              :value="item.sign"
+              v-model="checkedBoxList"
+            /><span>{{ item.area }}</span>
+          </div>
+          <button @click.prevent="addByArea">添加</button>
+        </div>
+        <div class="addByCustomize">
+          <span>自定义添加</span>
+          <input
+            id="drl"
+            list="drls"
+            class="inputStyle focusStyle"
+            v-model="addByCustomize"
+          />
+          <datalist id="drls" value="12">
+            <option value="BMW" />
+            <option value="Ford" />
+            <option value="Volvo" />
+          </datalist>
+          <button @click.prevent="addBySelf">添加</button>
+        </div>
+        <div class="count">
+          <Count :sum="sum" />
+        </div>
+        <div class="table">
+          <Table
+            :trStyle="trStyle"
+            :tableHeader="tableHeader"
+            :tableData="tableData"
+            :tableHeadStyle="tableHeadStyle"
+            :discolor="discolor"
+            @change_icon="changeIcon"
+            :operationStyle="operationStyle"
+            :imgFlag="imgFlag"
+          >
+          </Table>
+        </div>
+        <div class="page">
+          <Tablepage
+            :totalPage="totalPage"
+            :currentPage="currentPage"
+            @change_page="changePage"
+            @jump_page="jumpPage"
+          />
+        </div>
+        <div class="btn">
+            <div class="current_button" style="width: 120px;margin: 0" @click="submit">保存</div>
+            <div class="current_button" style="width: 120px;margin: 0" @click="hideModal">取消</div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import Count from "../../../../components/Count";
+import Tablepage from "../../../../components/TablePage";
+import Table from "./ModalTable";
+export default {
+  props: {
+    modalFlag: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  components: {
+    Table,
+    Count,
+    Tablepage,
+  },
+  computed: {
+    // 表格总页数
+    totalPage() {
+      return Math.ceil(this.sum / this.pageSize);
+    },
+  },
+  data() {
+    return {
+      sum: 120,
+      pageSize: 10,
+      currentPage: 1,
+      areaList: [
+        {
+          sign: "all",
+          area: "全区",
+          checked: false,
+        },
+        {
+          sign: "n",
+          area: "北区",
+          checked: false,
+        },
+        {
+          sign: "s",
+          area: "南区",
+          checked: false,
+        },
+        {
+          sign: "e",
+          area: "东区",
+          checked: false,
+        },
+        {
+          sign: "self",
+          area: "自定义分组",
+          checked: false,
+        },
+      ], // 按区域添加
+      checkedBoxList: [],
+      addByCustomize: [],
+      trStyle: {
+        background: "#ffffff",
+        height: "36px",
+        width: "20%",
+      },
+      tableHeader: ["序号", "经销商名称", "DLR Code", "所属区域", "筛选"],
+      tableData: [
+        { name: "北京博瑞", code: "L020", area: "东区" },
+        { name: "a", code: "a", area: "N" },
+        { name: "a", code: "a", area: "N" },
+        { name: "a", code: "a", area: "N" },
+        { name: "a", code: "a", area: "N" },
+        { name: "a", code: "a", area: "N" },
+        { name: "a", code: "a", area: "N" },
+        { name: "a", code: "a", area: "N" },
+        { name: "a", code: "a", area: "N" },
+        { name: "a", code: "a", area: "N" },
+        { name: "a", code: "a", area: "N" }
+      ],
+      tableHeadStyle: {
+        background: "#8D9092",
+        height: "36px",
+        color: "#fff",
+      },
+      discolor: false, // 是否隔行变色,
+      imgFlag: new Array(20).fill(true), // 筛选栏用添加图片还是删除图片
+      operationStyle: {
+        width: "20px",
+        height: "20px",
+      },
+    };
+  },
+  methods: {
+    submit: function () {
+      this.$emit("submit",this.checkedBoxList, this.addByCustomize);
+    },
+    hideModal: function () {
+      this.$emit("hide_modal");
+    },
+    // 点击按区域添加button
+    addByArea: function () {
+      console.log(this.checkedBoxList);
+    },
+    // 自定义添加
+    addBySelf: function () {
+      console.log(this.addByCustomize);
+    },
+    // 筛选
+    changeIcon: function (i) {
+      this.imgFlag.splice(i, 1, !this.imgFlag[i]);
+      console.log(i);
+    },
+    // 获取某一页面的数据,展示在表格
+    changePage: function (page) {
+      this.currentPage = page;
+      console.log(page);
+    },
+    // 点击上一页,下一页,首页,尾页
+    jumpPage: function (item) {
+      switch (item) {
+        case 1:
+          this.currentPage = 1;
+          break;
+        case 2:
+          this.currentPage = this.currentPage - 1;
+          break;
+        case 3:
+          this.currentPage = this.currentPage + 1;
+          break;
+        case 4:
+          this.currentPage = this.totalPage;
+          break;
+      }
+      console.log(this.currentPage);
+    },
+  },
+};
+</script>
+
+<style scoped lang="less">
+.group_member_modal {
+  position: fixed;
+  left: 0;
+  top: 0;
+  height: 100vh;
+  width: 100vw;
+  background-color: rgba(127, 127, 127, 0.7);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  .modal_content {
+    width: 800px;
+    height: 650px;
+    background-color: #fff;
+    transform: translateY(-50px);
+    padding: 20px 30px;
+    .addByArea {
+      display: flex;
+      height: 28px;
+      align-items: center;
+      span {
+        margin-right: 10px;
+      }
+      div {
+        margin-right: 18px;
+        height: 18px;
+        input {
+          width: 12px;
+          height: 12px;
+          vertical-align: middle;
+          margin-top: -2px;
+          border: 1px solid #ccc;
+        }
+        span {
+          margin-left: 2px;
+          height: 18px;
+          line-height: 18px;
+        }
+        button {
+          height: 28px;
+        }
+      }
+    }
+    .addByCustomize {
+      margin: 20px 0 0 30px;
+      button {
+        height: 28px;
+      }
+      input {
+        // background: url('../../img/search.svg') no-repeat center left;
+        // background-size: 21px 25px;
+        background-color: #fff;
+      }
+    }
+    .count {
+      display: flex;
+      justify-content: flex-end;
+    }
+    .table{
+        max-height: 450px;
+        overflow: auto;
+    }
+    .btn{
+        padding: 0 180px;
+        margin-top: 20px;
+        display: flex;
+        justify-content: space-around;
+    }
+  }
+}
+.inputStyle {
+  margin-left: 17px;
+  width: 130px;
+  height: 18px;
+  line-height: 18px;
+  padding: 4px 6px;
+  border: 1px solid #ccc;
+  color: #555555;
+  font-size: 12px;
+}
+.focusStyle {
+  border: 1px solid #ccc;
+  line-height: 20px;
+  color: #555555;
+  outline: none;
+}
+.focusStyle:focus {
+  animation: shadowAni 200ms linear forwards;
+}
+@keyframes shadowAni {
+  0% {
+    border-color: #cccccc;
+    box-shadow: inset 0px 0px 0 #ccc;
+  }
+  100% {
+    border-color: #75b9f0;
+    box-shadow: 0px 0px 10px #75b9f0;
+  }
+}
+</style>

+ 119 - 0
src/views/parameter/components/Grouping/GroupMemberTable.vue

@@ -0,0 +1,119 @@
+<template>
+  <div class="table">
+    <table>
+      <thead>
+        <tr>
+          <td>车型</td>
+          <td>操作</td>
+        </tr>
+      </thead>
+      <tbody>
+        <tr
+          v-for="(obj, index) in tableData"
+          :key="index"
+          :class="{ table_gray: index % 2 === 0 }"
+        >
+          <td style="width: 50%">
+            <p>{{ obj.member }}</p>
+          </td>
+          <td style="width: 50%" class="operation">
+            <span @click="showModal(index)">删除</span>
+          </td>
+        </tr>
+      </tbody>
+    </table>
+    <DeleteModal
+      @detlet_data="detletData"
+      @hide_modal="closeModal"
+      :modalFlag="deleteModalFlag"
+    ></DeleteModal>
+  </div>
+</template>
+
+<script>
+import DeleteModal from "../DeleteModal";
+export default {
+  props: {
+    // 表数据
+    tableData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    //  表格一页共有多少数据
+    pageSize: {
+      type: Number,
+      default: 2,
+    },
+  },
+  components: {
+    DeleteModal,
+  },
+  data() {
+    return {
+      deleteModalFlag: false,
+      index: 0,
+      newName: "", // 编辑之后的值
+    };
+  },
+  methods: {
+    // 点击删除,展示模态框
+    showModal: function (i) {
+      this.deleteModalFlag = true;
+      this.index = i;
+    },
+    // 模态框确认删除
+    detletData: function () {
+      this.deleteModalFlag = false;
+      this.$emit("delet_data", this.index);
+    },
+    // 模态框取消
+    closeModal: function () {
+      this.deleteModalFlag = false;
+    },
+    mounted() {
+    },
+  },
+};
+</script>
+
+<style scoped lang="less">
+.table {
+  background-color: #fff;
+  width: 100%;
+  margin-top: 10px;
+  text-align: center;
+  table {
+    width: 100%;
+    border-collapse: collapse;
+    border: none;
+    thead {
+      td {
+        background: #8d9092;
+        height: 36px;
+        color: #fff;
+        border: 1px solid #ccc;
+      }
+    }
+    tbody {
+      td {
+        height: 36px;
+        border: 1px solid #ccc;
+      }
+      .operation {
+        span {
+          color: #00f;
+          margin: 0 20px;
+          &:hover {
+            cursor: pointer;
+          }
+        }
+      }
+    }
+  }
+}
+.table_gray {
+    background: #f5f5f5
+}
+</style>

+ 86 - 0
src/views/parameter/components/Grouping/GroupingModal.vue

@@ -0,0 +1,86 @@
+<template>
+  <div class="vehicle_servies_modal" v-if="modalFlag">
+      <div class="modal_content">
+          <div class="input">
+              <p>小组名称</p>
+              <input type="text" v-model="groupName">
+          </div>
+          <div class="btn">
+              <button @click="submit" style="margin:0">保存</button>
+              <button @click="hideModal" style="margin:0">取消</button>
+          </div>
+      </div>
+  </div>
+</template>
+
+<script>
+export default {
+    props: {
+        modalFlag: {
+            type: Boolean,
+            default: false
+        }
+    },
+    data() {
+        return{
+            groupName: ''
+        }
+    },
+    methods: {
+        submit: function() {
+            this.$emit('submit', this.groupName)
+        },
+        hideModal: function() {
+            this.$emit('hide_modal');
+        }
+    }
+}
+</script>
+
+<style scoped lang="less">
+.vehicle_servies_modal{
+    position: fixed;
+    left: 0;
+    top: 0;
+    height: 100vh;
+    width: 100vw;
+    background-color: rgba(127, 127, 127, 0.7);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    .modal_content{
+        width: 600px;
+        height: 300px;
+        background-color: #fff;
+        transform: translateY(-50px);
+        .input{
+            width: 280px;
+            margin: 0 auto;
+            margin-top: 80px;
+            display: flex;
+            height: 28px;
+            p{
+                width: 80px;
+                height: 28px;
+                line-height: 28px;
+            }
+            input{
+                width: 200px;
+                border: 1px solid #555;
+            }
+
+        }
+        .btn{
+            padding-left: 80px;
+            margin: 0 auto;
+            width: 200px;
+            margin-top: 30px;
+            display: flex;
+            justify-content: space-between;
+            button{
+                margin: 0!;
+            }
+        }
+    }
+}
+</style>

+ 157 - 0
src/views/parameter/components/Grouping/GroupingTable.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="table">
+    <table>
+      <thead>
+        <tr>
+          <td>分组名称</td>
+          <td>操作</td>
+        </tr>
+      </thead>
+      <tbody>
+        <tr
+          v-for="(obj, index) in tableData"
+          :key="index"
+          :class="{ table_gray: index % 2 === 0 }"
+        >
+          <td style="width: 50%">
+            <p v-if="!editFlag[index]">{{ obj.group }}</p>
+            <input
+              type="text"
+              v-model="newName"
+              v-else
+              :placeholder="obj.group"
+            />
+          </td>
+          <td style="width: 50%" class="operation">
+            <span @click="edit(index)" v-if="!editFlag[index]">编辑</span>
+            <span @click="submitEdit(index)" v-else>确定</span>
+            <span @click="showModal(index)">删除</span>
+            <span @click="groupMember(index)">小组成员></span>
+          </td>
+        </tr>
+      </tbody>
+    </table>
+    <DeleteModal
+      @detlet_data="detletData"
+      @hide_modal="closeModal"
+      :modalFlag="deleteModalFlag"
+    ></DeleteModal>
+  </div>
+</template>
+
+<script>
+import DeleteModal from "../DeleteModal";
+
+export default {
+  props: {
+    // 表数据
+    tableData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    //  表格一页共有多少数据
+    pageSize: {
+      type: Number,
+      default: 2,
+    },
+  },
+  components: {
+    DeleteModal,
+  },
+  data() {
+    return {
+      deleteModalFlag: false,
+      index: 0,
+      editFlag: [],
+      newName: "", // 编辑之后的值
+    };
+  },
+  methods: {
+    // 点击编辑
+    edit: function (i) {
+      this.getEditArr(); // 确保只有一个在编辑
+      this.newName = this.tableData[i] && this.tableData[i].group;
+      this.editFlag.splice(i, 1, true);
+    },
+    // 确认编辑
+    submitEdit: function (i) {
+      if (!this.newName) {
+        alert("姓名不能为空");
+      } else if (this.newName === this.tableData[i].group) {
+        this.newName = ""; // 没有改
+      } else {
+        this.$emit("edit", i, this.newName);
+      }
+      this.newName = "";
+      this.editFlag.splice(i, 1, false);
+    },
+    // 点击删除,展示模态框
+    showModal: function (i) {
+      this.deleteModalFlag = true;
+      this.index = i;
+    },
+    groupMember: function (i) {
+      this.$emit("group_member", i);
+    },
+    // 模态框删除确认
+    detletData: function () {
+      this.$emit("delet_data", this.index);
+      this.deleteModalFlag = false;
+    },
+    // 模态框取消
+    closeModal: function () {
+      this.deleteModalFlag = false;
+    },
+    // 生成点击编辑按钮所用额flag,
+    getEditArr: function () {
+      let arr = new Array(this.pageSize).fill(false);
+      this.editFlag = arr;
+    },
+  },
+  created() {
+    this.getEditArr();
+  },
+};
+</script>
+
+<style scoped lang="less">
+.table {
+  background-color: #fff;
+  width: 100%;
+  margin-top: 10px;
+  text-align: center;
+  table {
+    width: 100%;
+    border-collapse: collapse;
+    border: none;
+    thead {
+      td {
+        background: #8d9092;
+        height: 36px;
+        color: #fff;
+        border: 1px solid #ccc;
+      }
+    }
+    tbody {
+      td {
+        height: 36px;
+        border: 1px solid #ccc;
+      }
+      .operation {
+        span {
+          color: #00f;
+          margin: 0 20px;
+          &:hover {
+            cursor: pointer;
+          }
+        }
+      }
+    }
+  }
+}
+.table_gray {
+    background: #f5f5f5
+}
+</style>

+ 131 - 0
src/views/parameter/components/Grouping/ModalTable.vue

@@ -0,0 +1,131 @@
+<template>
+  <div class="table_template">
+    <table class="table">
+        <thead>
+            <tr :style="tableHeadStyle">
+                <td v-for="(item, index) in tableHeader" :key="index" :style="tableHeadStyle">{{ item }}</td>
+            </tr>
+        </thead>
+        <tbody>
+            <tr v-for="(obj, index) in tableData" :key="index" :class="{ table_gray: !discolor && index%2 === 0 }">
+                <td :style="trStyle" v-if="flag">{{ index + 1 }}</td>
+                <td v-for="(item, index) in obj" :key="index" :style="trStyle">
+                    {{ item }}
+                </td>
+                <td :style="trStyle">
+                    <img src="../../../../img/add.png" @click="changeIcon(index)" :style="operationStyle" v-if="imgFlag[index]">
+                    <img src="../../../../img/delete.png" @click="changeIcon(index)" :style="operationStyle" v-else>
+                </td>
+            </tr>
+        </tbody>
+    </table>
+  </div>
+</template>
+
+<script>
+export default {
+    props: {
+        // 表数据
+        tableData: {
+            type: Array,
+            default: () => {
+                return []
+            }
+        },
+        // 表头
+        tableHeader: {
+            type: Array,
+            default: () => {
+                return []
+            }
+        },
+        // 表头样式
+        tableHeadStyle: {
+            type: Object,
+            default: () => {
+                return {
+                    background: '#848484',
+                    height: '50px',
+                    color: '#fff'
+                }
+            }
+        },
+        // 操作样式
+        operationStyle: {
+            type: Object,
+            default: () => {
+                return {
+                    color: '#0000ff'
+                }
+            }
+        },
+        // imgFlag
+        imgFlag: {
+            type: Array,
+            default: () => {
+                let arr = new Array(20).fill(20);
+                return arr
+            }
+        },
+        // 表格除去表头的样式
+        trStyle: {
+            type: Object,
+            default: () => {
+                return {
+                    width: '200px',
+                    height: '50px'
+                }
+            }
+        },
+        // 是否隔行变色
+        discolor: {
+            type: Boolean,
+            default: true
+        },
+        // 每页表格共有多少数据
+        pageSize: {
+            type: Number,
+            default: 20
+        },
+        flag: {
+            type: Boolean,
+            default: true
+        },
+    },
+    methods: { 
+        changeIcon: function(index) {
+            console.log(index);
+            this.$emit('change_icon', index);
+        }
+    },
+    mounted() {
+    },
+    data() {
+        return {
+        }
+    }
+};
+</script>
+
+<style scoped lang="less">
+.table_template{
+    text-align: center;
+    .table{
+        background-color: #fff;
+        border-collapse:collapse;
+        border:none;
+        width: 100%;
+        td{
+            border: 1px solid #ccc;
+        }
+        span{
+            &:hover{
+                cursor: pointer;
+            }
+        }
+    }
+}
+.table_gray{
+    background: #f5f5f5;
+}
+</style>