<template>
  <div class="board">
    <div class="divborder newSearchDiv" style="margin:0px;">
       <div class="filter">
        <label>{{$t('960422')}}：</label>
        <Input class="searchInput"  type="text" v-model="name" />
       </div>
        <div class="searchBtn">
        <Button type="primary" class="twoWord" icon="ios-search" @click="searchclick">{{$t('1001')}}</Button>
        <Button type="success" class="twoWord" icon="md-add-circle" @click="showmodal(1)">{{$t('1002')}}</Button>
        <Button type="warning" class="twoWord" icon="ios-create-outline" @click="showmodal(2)">{{$t('1003')}}</Button>
        <Button type="error" class="twoWord" icon="md-close-circle" @click="del">{{$t('1004')}}</Button>
      </div>
    </div>
    <!-- 表格 -->
    <div class="divborder newTableDiv" >
      <Table
        class="tableClass"
        highlight-row
        :data="tableData"
        :columns="tableColumns"
        @on-current-change="handleRowChange"
      ></Table>
      <div class="pageDiv">
        <div class="pageDirection">
          <Page
            :total="total"
            :current="page"
            @on-change="changePage"
            show-elevator
            show-sizer
            show-total
            @on-page-size-change="handlePageSize"
            :page-size-opts="[10,20,30,40,100]"
          ></Page>
        </div>
      </div>
    </div>
    <!-- 模态框 -->
    <Modal class="newModalClass" :title="$t(950169)" v-model="modal" :styles="{width:'1000px'}">
      <div
        class="modal_body"
        style="width:1000px!important;padding:0 10px;min-height:380px!important;"
      >
        <div style="width:1000px;float:left;height:100%;padding-left:0px;">
          <label><i>*</i>{{$t('960422')}}：</label>
          <Input class="searchInput" type="text" style="margin-right:30px" v-model="data.name" />
          <label style="width:150px!important;"><i>*</i>{{$t('960425')}}：</label>
          <Input
            class="searchInput"
            type="number"
            style="margin-right:30px"
            v-model="data.repeattime"
          />
          <label>{{$t("1030")}}：</label>
          <Input class="searchInput" type="text" style="margin-right:30px" v-model="data.remark" />
          <Row>
            <Col span="11">
              <div style="border:1px solid #ccc;margin-top:8px">
                <Row>
                  <Col span="24">
                    <span>{{$t('960426')}}</span>
                  </Col>
                </Row>
                <Row>
                  <Col span="6">
                    <div style="width:60px;height:20px"></div>
                    <Steps direction="vertical" :current="6" status="finish" size="small">
                      <Step title="Level 1"></Step>
                      <Step title="Level 2"></Step>
                      <Step title="Level 3"></Step>
                      <Step title="Level 4"></Step>
                      <Step title="Level 5"></Step>
                      <Step title="Level 6"></Step>
                    </Steps>
                  </Col>
                  <Col span="6">
                    <div style="background:#FF0000;" class="modalLabel">
                      <label style="text-align:left!important;">{{$t('960428')}}</label>
                    </div>
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time1_1.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time2_1.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time3_1.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time4_1.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time5_1.space_time"
                    />
                  </Col>
                  <Col span="6">
                    <div style="background:#FFFF00;" class="modalLabel">
                      <label style="text-align:left!important;">{{$t('960429')}}</label>
                    </div>
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time1_2.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time2_2.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time3_2.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time4_2.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time5_2.space_time"
                    />
                  </Col>
                  <Col span="6">
                    <div style="background:#66FF00;" class="modalLabel">
                      <label style="text-align:left!important;">{{$t('8000004')}}</label>
                    </div>
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time1_3.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time2_3.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time3_3.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time4_3.space_time"
                    />
                    <Input
                      class="searchInput modalInput"
                      type="number"
                      min="0"
                      v-model="time5_3.space_time"
                    />
                  </Col>
                </Row>
              </div>
            </Col>
            <Col span="11">
              <div style="border:1px solid #ccc;margin-top:8px">
                <Row>
                  <Col span="24">
                    <span>{{$t('960427')}}</span>
                  </Col>
                </Row>
                <Row>
                  <Col span="6">
                    <div style="width:60px;height:20px"></div>
                    <Steps direction="vertical" :current="6" status="finish" size="small">
                      <Step title="Level 1"></Step>
                      <Step title="Level 2"></Step>
                      <Step title="Level 3"></Step>
                      <Step title="Level 4"></Step>
                      <Step title="Level 5"></Step>
                      <Step title="Level 6"></Step>
                    </Steps>
                  </Col>
                  <Col span="18">
                    <div style="width:60px;height:20px"></div>
                    <Input
                      class="searchInput"
                      type="text"
                      disabled
                      style="width:290px;margin-bottom:12px"
                      v-model="level1.groupname"
                    />
                    <Button style="margin-bottom:12px" icon="md-create" @click="onLevelEdit(1)"></Button>
                    <Input
                      class="searchInput"
                      type="text"
                      disabled
                      style="width:290px;margin-bottom:12px"
                      v-model="level2.groupname"
                    />
                    <Button style="margin-bottom:12px" icon="md-create" @click="onLevelEdit(2)"></Button>
                    <Input
                      class="searchInput"
                      type="text"
                      disabled
                      style="width:290px;margin-bottom:12px"
                      v-model="level3.groupname"
                    />
                    <Button style="margin-bottom:12px" icon="md-create" @click="onLevelEdit(3)"></Button>
                    <Input
                      class="searchInput"
                      type="text"
                      disabled
                      style="width:290px;margin-bottom:12px"
                      v-model="level4.groupname"
                    />
                    <Button style="margin-bottom:12px" icon="md-create" @click="onLevelEdit(4)"></Button>
                    <Input
                      class="searchInput"
                      type="text"
                      disabled
                      style="width:290px;margin-bottom:12px"
                      v-model="level5.groupname"
                    />
                    <Button style="margin-bottom:12px" icon="md-create" @click="onLevelEdit(5)"></Button>
                    <Input
                      class="searchInput"
                      type="text"
                      disabled
                      style="width:290px;margin-bottom:12px"
                      v-model="level6.groupname"
                    />
                    <Button style="margin-bottom:12px" icon="md-create" @click="onLevelEdit(6)"></Button>
                  </Col>
                </Row>
              </div>
            </Col>
          </Row>
        </div>
      </div>
      <div slot="footer">
        <Button type="text" size="large" @click="cancleModal">{{$t('1033')}}</Button>
        <Button type="primary" v-if="edittype===1" size="large" @click="handledata">{{$t('1002')}}</Button>
        <Button type="primary" v-if="edittype===2" size="large" @click="handledata">{{$t('1003')}}</Button>
      </div>
    </Modal>
    <Modal v-model="levelmodal" :styles="{top: '40px',width:'950px'}" class="edit">
      <div
        class="modal_body"
        style="width:900px!important;padding:0 10px;max-height:450px!important;overflow-y:scroll"
      >
        <div style="width:750px;float:left;height:100%;padding-left:0px;">
          <Tree :data="usergroup" show-checkbox multiple  ref="tree" @on-select-change="treeselectchange" @on-check-change="handletreechanged"></Tree>
        </div>
      </div>
      <div slot="footer">
        <Button type="text" size="large" @click="canclelevelmodal">{{$t('1033')}}</Button>
        <Button type="primary" @click="handleLevelChange">{{$t('1011')}}</Button>
      </div>
    </Modal>
  </div>
</template>
<script>
import axios from '@/libs/api.request'
import moment from 'moment'

export default {
    created () {
        this.search()
        // 格式化表格样式
        this.tableColumns = this.$time.initTableTitle(this.tableColumns)
    },
    data () {
        return {
            usergroup: [],
            total: 0,
            page: 1,
            pagesize: 10,
            tableData: [],
            tableColumns: [
                {
                    type: 'index2',
                    title: this.$t(1008),
                    key: 'xuhao',
                    render: (h, params) => {
                        return h('span', params.index + (this.page - 1) * this.pagesize + 1)
                    },
                    width: 90
                },
                {
                    title: this.$t('960422'),
                    key: 'name'
                },
                {
                    title: this.$t('960423'),
                    key: 'creator_name'
                },
                {
                    title: this.$t('1020'),
                    key: 'createtime'
                },
                {
                    title: this.$t('960424'),
                    key: 'node'
                },
                {
                    title: this.$t('1030'),
                    key: 'remark'
                }
            ],
            obj: {},
            name: '', // 搜索框名称
            modal: false,
            levelmodal: false,
            cruentlevel: 0, // 当前级别
            edittype: 0, // 模态框处理类型 1：添加 2：修改
            data: {}, // 添加或修改的数据
            time1_1: { type: 1, start_level: 1, end_level: 2, space_time: 0 },
            time2_1: { type: 1, start_level: 2, end_level: 3, space_time: 0 },
            time3_1: { type: 1, start_level: 3, end_level: 4, space_time: 0 },
            time4_1: { type: 1, start_level: 4, end_level: 5, space_time: 0 },
            time5_1: { type: 1, start_level: 5, end_level: 6, space_time: 0 },
            time1_2: { type: 2, start_level: 1, end_level: 2, space_time: 0 },
            time2_2: { type: 2, start_level: 2, end_level: 3, space_time: 0 },
            time3_2: { type: 2, start_level: 3, end_level: 4, space_time: 0 },
            time4_2: { type: 2, start_level: 4, end_level: 5, space_time: 0 },
            time5_2: { type: 2, start_level: 5, end_level: 6, space_time: 0 },
            time1_3: { type: 3, start_level: 1, end_level: 2, space_time: 0 },
            time2_3: { type: 3, start_level: 2, end_level: 3, space_time: 0 },
            time3_3: { type: 3, start_level: 3, end_level: 4, space_time: 0 },
            time4_3: { type: 3, start_level: 4, end_level: 5, space_time: 0 },
            time5_3: { type: 3, start_level: 5, end_level: 6, space_time: 0 },
            level1: { level: 1, usergroup: [], groupname: [] },
            level2: { level: 2, usergroup: [], groupname: [] },
            level3: { level: 3, usergroup: [], groupname: [] },
            level4: { level: 4, usergroup: [], groupname: [] },
            level5: { level: 5, usergroup: [], groupname: [] },
            level6: { level: 6, usergroup: [], groupname: [] }
        }
    },
    methods: {
        treeselectchange () {
        },
        onLevelEdit (no) {
            this.cruentlevel = no
            this.levelmodal = true
            this.initUserGroup()
        },
        getMenuBtnList (menuTreeList, newgroupname) {
            var newgroupname = []

            for (let item of menuTreeList) {
                if (item.children.length < 1) {
                    newgroupname.push(item.title)
                } else {
                    this.getMenuBtnList(item.children, newgroupname)
                }
            }
            return newgroupname
        },
        getMenuBtnList1 (menuTreeList) {
            var newusergroup = []
            for (let item of menuTreeList) {
                if (item.children.length < 1) {
                    newusergroup.push(item.value)
                } else {
                    this.getMenuBtnList(item.children, newusergroup)
                }
            }
            // console.log(newusergroup)
            return newusergroup
        },
        searchclick () {
            this.page = 1
            this.search()
        },
        handleLevelChange () {
            var data = this.$refs.tree.getCheckedNodes()
            // console.log(data)
            // var newgroupname = []
            // var newusergroup = []
            var newgroupname = this.getMenuBtnList(data)
            var newusergroup = this.getMenuBtnList1(data)
            // console.log(newgroupname,newusergroup)
            switch (this.cruentlevel) {
            case 1:
                this.level1.usergroup = newusergroup
                this.level1.groupname = newgroupname
                this.level1.level = this.cruentlevel
                break
            case 2:
                this.level2.usergroup = newusergroup
                this.level2.groupname = newgroupname
                this.level2.level = this.cruentlevel
                break
            case 3:
                this.level3.usergroup = newusergroup
                this.level3.groupname = newgroupname
                this.level3.level = this.cruentlevel
                break
            case 4:
                this.level4.usergroup = newusergroup
                this.level4.groupname = newgroupname
                this.level4.level = this.cruentlevel
                break
            case 5:
                this.level5.usergroup = newusergroup
                this.level5.groupname = newgroupname
                this.level5.level = this.cruentlevel

                break
            case 6:
                this.level6.usergroup = newusergroup
                this.level6.groupname = newgroupname
                this.level6.level = this.cruentlevel
                break
            }
            this.levelmodal = false
        },
        resetData () {
            // 初始化数据
            this.data = {}
            this.time1_1 = { type: 1, start_level: 1, end_level: 2, space_time: 0 }
            this.time2_1 = { type: 1, start_level: 2, end_level: 3, space_time: 0 }
            this.time3_1 = { type: 1, start_level: 3, end_level: 4, space_time: 0 }
            this.time4_1 = { type: 1, start_level: 4, end_level: 5, space_time: 0 }
            this.time5_1 = { type: 1, start_level: 5, end_level: 6, space_time: 0 }

            this.time1_2 = { type: 2, start_level: 1, end_level: 2, space_time: 0 }
            this.time2_2 = { type: 2, start_level: 2, end_level: 3, space_time: 0 }
            this.time3_2 = { type: 2, start_level: 3, end_level: 4, space_time: 0 }
            this.time4_2 = { type: 2, start_level: 4, end_level: 5, space_time: 0 }
            this.time5_2 = { type: 2, start_level: 5, end_level: 6, space_time: 0 }

            this.time1_3 = { type: 3, start_level: 1, end_level: 2, space_time: 0 }
            this.time2_3 = { type: 3, start_level: 2, end_level: 3, space_time: 0 }
            this.time3_3 = { type: 3, start_level: 3, end_level: 4, space_time: 0 }
            this.time4_3 = { type: 3, start_level: 4, end_level: 5, space_time: 0 }
            this.time5_3 = { type: 3, start_level: 5, end_level: 6, space_time: 0 }
            this.level1 = { level: 1, usergroup: [], groupname: [] }
            this.level2 = { level: 2, usergroup: [], groupname: [] }
            this.level3 = { level: 3, usergroup: [], groupname: [] }
            this.level4 = { level: 4, usergroup: [], groupname: [] }
            this.level5 = { level: 5, usergroup: [], groupname: [] }
            this.level6 = { level: 6, usergroup: [], groupname: [] }
        },
        initData () {
            // 选定数据绑定

            this.time1_1 = this.obj.processTime[this.obj.time.indexOf('1_1')]
            this.time1_2 = this.obj.processTime[this.obj.time.indexOf('1_2')]
            this.time1_3 = this.obj.processTime[this.obj.time.indexOf('1_3')]
            this.time2_1 = this.obj.processTime[this.obj.time.indexOf('2_1')]
            this.time2_2 = this.obj.processTime[this.obj.time.indexOf('2_2')]
            this.time2_3 = this.obj.processTime[this.obj.time.indexOf('2_3')]
            this.time3_1 = this.obj.processTime[this.obj.time.indexOf('3_1')]
            this.time3_2 = this.obj.processTime[this.obj.time.indexOf('3_2')]
            this.time3_3 = this.obj.processTime[this.obj.time.indexOf('3_3')]
            this.time4_1 = this.obj.processTime[this.obj.time.indexOf('4_1')]
            this.time4_2 = this.obj.processTime[this.obj.time.indexOf('4_2')]
            this.time4_3 = this.obj.processTime[this.obj.time.indexOf('4_3')]
            this.time5_1 = this.obj.processTime[this.obj.time.indexOf('5_1')]
            this.time5_2 = this.obj.processTime[this.obj.time.indexOf('5_2')]
            this.time5_3 = this.obj.processTime[this.obj.time.indexOf('5_3')]
            if (
                this.obj.processLevel !== null &&
        this.obj.processLevel !== undefined &&
        this.obj.processLevel !== []
            ) {
                this.level1 = this.obj.processLevel[0]
                this.level2 = this.obj.processLevel[1]
                this.level3 = this.obj.processLevel[2]
                this.level4 = this.obj.processLevel[3]
                this.level5 = this.obj.processLevel[4]
                this.level6 = this.obj.processLevel[5]
                if (this.level1 === {} || this.level1 === undefined) {
                    this.level1 = { level: 1, usergroup: [], groupname: [] }
                }
                if (this.level2 === {} || this.level2 === undefined) {
                    this.level2 = { level: 2, usergroup: [], groupname: [] }
                }
                if (this.level3 === {} || this.level3 === undefined) {
                    this.level3 = { level: 3, usergroup: [], groupname: [] }
                }
                if (this.level4 === {} || this.level4 === undefined) {
                    this.level4 = { level: 4, usergroup: [], groupname: [] }
                }
                if (this.level5 === {} || this.level5 === undefined) {
                    this.level5 = { level: 5, usergroup: [], groupname: [] }
                }
                if (this.level6 === {} || this.level6 === undefined) {
                    this.level6 = { level: 6, usergroup: [], groupname: [] }
                }
            }
            this.data = this.obj
        },
        bindData () {
            // 绑定填写数据
            this.data.processTime = []
            this.data.processLevel = []
            this.data.processTime.push(this.time1_1)
            this.data.processTime.push(this.time1_2)
            this.data.processTime.push(this.time1_3)
            this.data.processTime.push(this.time2_1)
            this.data.processTime.push(this.time2_2)
            this.data.processTime.push(this.time2_3)
            this.data.processTime.push(this.time3_1)
            this.data.processTime.push(this.time3_2)
            this.data.processTime.push(this.time3_3)
            this.data.processTime.push(this.time4_1)
            this.data.processTime.push(this.time4_2)
            this.data.processTime.push(this.time4_3)
            this.data.processTime.push(this.time5_1)
            this.data.processTime.push(this.time5_2)
            this.data.processTime.push(this.time5_3)
            this.data.processLevel.push(this.level1)
            this.data.processLevel.push(this.level2)
            this.data.processLevel.push(this.level3)
            this.data.processLevel.push(this.level4)
            this.data.processLevel.push(this.level5)
            this.data.processLevel.push(this.level6)
        },
        validData (data) {
            console.log(data)
            if (data.processTime.length === 15 && data.processLevel.length === 6) {
                if (
                    data.name !== undefined &&
          data.name !== '' &&
          data.repeattime !== '' &&
          data.repeattime !== undefined
                ) {
                    return true
                }
            }
            this.$Message.error(this.$t('1063'))
            return false
        },
        handletreechanged (node, value) {
            // // console.log(node[0],value)
            // // var data=value
            // if (value.children.length < 1) {
            //   // console.log(2222)
            //   // console.log(value.checked)
            //   // // node[0].checked = false
            //   // value.checked = !value.checked
            //   // console.log(value.checked)
            //   // console.log(value)
            //   // console.log(node)
            //   // node[0].expand = !(node[0].expand)
            // } else {
            //   value.checked = false
            //   value.expand = !value.expand
            // }
            // // value.expand = !value.expand
        },
        search () {
            var params = {
                name: this.name,
                page: this.page,
                pagesize: this.pagesize
            }
            axios
                .request({
                    url: '/tpm/AndonBaseSetting/GetInfoProcessData',
                    params,
                    method: 'get'
                })
                .then(res => {
                    var data = res.data.data
                    data.forEach(
                        item =>
                            (item.createtime = moment(item.createtime * 1000).format(
                                'YYYY-MM-DD HH:mm:ss'
                            ))
                    )
                    this.tableData = data
                    this.total = res.data.total
                })
        },
        initUserGroup () {
            axios
                .request({
                    url: '/config/ProjectUserGroup/ListSectionUsergroup',
                    method: 'get'
                })
                .then(res => {
                    var data = res.data.data
                    var ret = []
                    var group = []
                    switch (this.cruentlevel) {
                    case 1:
                        group = this.level1.usergroup
                        break
                    case 2:
                        group = this.level2.usergroup
                        break
                    case 3:
                        group = this.level3.usergroup
                        break
                    case 4:
                        group = this.level4.usergroup
                        break
                    case 5:
                        group = this.level5.usergroup
                        break
                    case 6:
                        group = this.level6.usergroup
                        break
                    }
                    data.forEach(item => {
                        var level = {}
                        level.title = item.title
                        level.value = item.value
                        level.children = this.handleGroupData(item.children, group)
                        // level.disableCheckbox = true
                        ret.push(level)
                    })
                    this.usergroup = ret
                })
        },
        handleGroupData (children, group) {
            var ret = []
            if (children != null && children.length > 0) {
                children.forEach(element => {
                    var data = {}
                    if (group.indexOf(element.groupID) !== -1) {
                        data.checked = true
                    }
                    data.title = element.groupTitle
                    data.value = element.groupID
                    data.expand = false
                    if (element.children.length > 0) {
                        data.children = this.handleGroupData(element.children, group)
                    } else {
                        data.children = []
                    }
                    ret.push(data)
                })
            }
            return ret
        },
        del () {
            if (JSON.stringify(this.obj) === '{}') {
                this.$Message.error(this.$t('1043'))
                return false
            }
            var params = { code: this.obj.code }
            axios
                .request({
                    url: '/tpm/AndonBaseSetting/DeleteProcessData',
                    params,
                    method: 'get'
                })
                .then(res => {
                    if (res.data.ret === 1) {
                        this.$Message.success(this.$t('1058'))
                        this.page = 1
                        this.search()
                    } else {
                        this.$Message.error(this.$t('1059'))
                        this.search()
                    }
                })
        },
        cancleModal () {
            this.search()
            this.modal = false
            this.resetData()
        },
        canclelevelmodal () {
            this.levelmodal = false
        },
        showmodal (type) {
            this.edittype = type
            this.resetData()
            if (type == 2) {
                if (JSON.stringify(this.obj) === '{}') {
                    this.$Message.error(this.$t('1043'))
                    return false
                }
                this.initData()
            }
            this.modal = true
        },
        handledata () {
            // if (
            //   this.level1 == undefined || this.level1 == {} || this.level1.usergroup.length == 0 ||
            //   this.level2 == undefined || this.level2 == {} || this.level2.usergroup.length == 0 ||
            //   this.level3 == undefined || this.level3 == {} || this.level3.usergroup.length == 0 ||
            //   this.level4 == undefined || this.level4 == {} || this.level4.usergroup.length == 0 ||
            //   this.level5 == undefined || this.level5 == {} || this.level5.usergroup.length == 0 ||
            //   this.level6 == undefined || this.level6 == {} || this.level6.usergroup.length == 0
            // ) {
            //   window_warning(this.$t('1063'))
            //   return
            // }
            switch (this.edittype) {
            case 1:
                this.add()
                break
            case 2:
                this.edit()
                break
            default:
                console.log('Error')
                break
            }
        },
        edit () {
            this.bindData()
            var data = this.data

            if (!this.validData(data)) {
                return
            }
            axios
                .request({
                    url: '/tpm/AndonBaseSetting/ModifyProcessData',
                    data,
                    method: 'post'
                })
                .then(res => {
                    if (res.data.ret === 1) {
                        this.$Message.success(this.$t(1060))
                        this.settingmodal = false
                        this.page = 1
                        this.search()
                        this.modal = false
                    } else {
                        this.$Message.error(this.$t(res.data.msg))
                        this.search()
                    }
                })
        },
        add () {
            this.bindData()
            var data = this.data
            if (!this.validData(data)) {
                return
            }
            axios
                .request({
                    url: '/tpm/AndonBaseSetting/AddProcessData',
                    data,
                    method: 'post'
                })
                .then(res => {
                    if (res.data.ret === 1) {
                        this.$Message.success(this.$t(1055))
                        this.settingmodal = false
                        this.page = 1
                        this.search()
                        this.modal = false
                    } else {
                        this.$Message.error(this.$t(res.data.msg))
                        this.search()
                    }
                })
        },
        handleRowChange (currentRow, oldCurrentRow) {
            this.obj = currentRow
        },
        handlePageSize (value) {
            this.pagesize = value
            this.tableData = this.search()
        },
        changePage (value) {
            this.page = value
            this.tableData = this.search()
        }
    }
}
</script>
<style lang="less" scoped>
.board {
  width: 100%;
  height: 100%;
}
.edit {
  .filter {
    height: 40px;
    label {
      display: inline-block;
      width: 80px;
    }
    .publicinput {
      width: 150px;
    }
  }
}
.modalLabel {
  margin: 20px 0px 20px 0px;
  width: 60px;
  height: 20px;
}
.modalInput {
  width: 60px;
  margin-bottom: 15px;
}
</style>
