<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
      <el-form-item label="用户编号" prop="userCode">
        <el-input
          v-model="queryParams.userCode"
          placeholder="请输入用户编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="考勤月份" prop="clockingInMonth">
        <el-date-picker clearable size="small"
                        v-model="queryParams.clockingInMonth"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="选择考勤月份">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="工号" prop="jobNo">
        <el-input
          v-model="queryParams.jobNo"
          placeholder="请输入工号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门" prop="department">
        <el-input
          v-model="queryParams.department"
          placeholder="请输入部门"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="累积积休" prop="upLjjx">
        <el-input
          v-model="queryParams.upLjjx"
          placeholder="请输入累积积休"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公休" prop="upWorkLeave">
        <el-input
          v-model="queryParams.upWorkLeave"
          placeholder="请输入公休"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="疫情增休" prop="upYqAddLeave">
        <el-input
          v-model="queryParams.upYqAddLeave"
          placeholder="请输入疫情增休"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="育儿假" prop="upParentalLeave">
        <el-input
          v-model="queryParams.upParentalLeave"
          placeholder="请输入育儿假"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="育儿假截至时间" prop="upParentalLeaveEndTime">
        <el-date-picker clearable size="small"
                        v-model="queryParams.upParentalLeaveEndTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="选择育儿假截至时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="本月-应出勤" prop="thisShouldJob">
        <el-input
          v-model="queryParams.thisShouldJob"
          placeholder="请输入本月-应出勤"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="本月-已出勤" prop="thisAlreadyJob">
        <el-input
          v-model="queryParams.thisAlreadyJob"
          placeholder="请输入本月-已出勤"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="本月-事假" prop="thisPersonalLeave">
        <el-input
          v-model="queryParams.thisPersonalLeave"
          placeholder="请输入本月-事假"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="本月-病假" prop="thisSickLeave">
        <el-input
          v-model="queryParams.thisSickLeave"
          placeholder="请输入本月-病假"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="本月-积休" prop="thisProductLeave">
        <el-input
          v-model="queryParams.thisProductLeave"
          placeholder="请输入本月-积休"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="本月-公休" prop="thisWorkLeave">
        <el-input
          v-model="queryParams.thisWorkLeave"
          placeholder="请输入本月-公休"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="本月-增休" prop="thisAddLeave">
        <el-input
          v-model="queryParams.thisAddLeave"
          placeholder="请输入本月-增休"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="育儿假" prop="thisSumParentalLeave">
        <el-input
          v-model="queryParams.thisSumParentalLeave"
          placeholder="请输入育儿假"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="累计积休" prop="thisSumLjjx">
        <el-input
          v-model="queryParams.thisSumLjjx"
          placeholder="请输入累计积休"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公休" prop="thisSumWorkLeave">
        <el-input
          v-model="queryParams.thisSumWorkLeave"
          placeholder="请输入公休"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="疫情增休" prop="thisSumYqAddLeave">
        <el-input
          v-model="queryParams.thisSumYqAddLeave"
          placeholder="请输入疫情增休"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['clockingin:stat:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['clockingin:stat:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['clockingin:stat:remove']"
        >删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleImport"
          v-hasPermi="['salary:salaryslip:add']"
        >导入
        </el-button>
        <el-col :span="1.5">
          <el-button
            type="warning"
            plain
            icon="el-icon-download"
            size="mini"
            :loading="exportLoading"
            @click="handleExport"
          >导出
          </el-button>
        </el-col>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="statList" @selection-change="handleSelectionChange" border>
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="操作" align="center" width="160px" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-date"
            @click="handleDetailed(scope.row,true)"
          >查看详细
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-date"
            @click="handleDetailed(scope.row,false)"
          >修改详细
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['clockingin:stat:edit']"
          >修改
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['clockingin:stat:remove']"
          >删除
          </el-button>
        </template>
      </el-table-column>
      <el-table-column label="用户编号" align="center" prop="userCode"/>
      <el-table-column label="导入日期" align="center" prop="createTime">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="考勤月份" align="center" prop="clockingInMonth"/>
      <el-table-column label="工号" align="center" prop="jobNo"/>
      <el-table-column label="姓名" align="center" prop="userName"/>
      <el-table-column label="部门" align="center" prop="department"/>
      <el-table-column label="上月" align="center">
        <el-table-column label="累积积休" align="center" prop="upLjjx"/>
        <el-table-column label="公休" align="center" prop="upWorkLeave"/>
        <el-table-column label="疫情增休" align="center" prop="upYqAddLeave"/>
        <el-table-column label="育儿假" align="center" prop="upParentalLeave"/>
        <el-table-column label="育儿假截至时间" align="center" prop="upParentalLeaveEndTime">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.upParentalLeaveEndTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="本月出勤" align="center">
        <el-table-column label="应出勤" align="center" prop="thisShouldJob"/>
        <el-table-column label="已出勤" align="center" prop="thisAlreadyJob"/>
      </el-table-column>
      <el-table-column label="本月（请 / 休）假" align="center">
        <el-table-column label="本月-事假" align="center" prop="thisPersonalLeave"/>
        <el-table-column label="本月-病假" align="center" prop="thisSickLeave"/>
        <el-table-column label="本月-积休" align="center" prop="thisProductLeave"/>
        <el-table-column label="本月-公休" align="center" prop="thisWorkLeave"/>
        <el-table-column label="本月-增休" align="center" prop="thisAddLeave"/>
      </el-table-column>
      <el-table-column label="本月累计休假" align="center">
        <el-table-column label="育儿假" align="center" prop="thisSumParentalLeave"/>
        <el-table-column label="累计积休" align="center" prop="thisSumLjjx"/>
        <el-table-column label="公休" align="center" prop="thisSumWorkLeave"/>
        <el-table-column label="疫情增休" align="center" prop="thisSumYqAddLeave"/>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改统计考勤对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules">
        <el-form-item label="用户编号" prop="userCode">
          <el-input v-model="form.userCode" placeholder="请输入用户编号"/>
        </el-form-item>
        <el-form-item label="考勤月份" prop="clockingInMonth">
          <el-date-picker clearable size="small"
                          v-model="form.clockingInMonth"
                          type="month"
                          value-format="yyyy-MM"
                          placeholder="选择考勤月份">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="工号" prop="jobNo">
          <el-input v-model="form.jobNo" placeholder="请输入工号"/>
        </el-form-item>
        <el-form-item label="姓名" prop="userName">
          <el-input v-model="form.userName" placeholder="请输入姓名"/>
        </el-form-item>
        <el-form-item label="部门" prop="department">
          <el-input v-model="form.department" placeholder="请输入部门"/>
        </el-form-item>
        <el-form-item label="上月-累积积休" prop="upLjjx">
          <el-input v-model="form.upLjjx" placeholder="请输入累积积休"/>
        </el-form-item>
        <el-form-item label="上月-公休" prop="upWorkLeave">
          <el-input v-model="form.upWorkLeave" placeholder="请输入公休"/>
        </el-form-item>
        <el-form-item label="上月-疫情增休" prop="upYqAddLeave">
          <el-input v-model="form.upYqAddLeave" placeholder="请输入疫情增休"/>
        </el-form-item>
        <el-form-item label="上月-育儿假" prop="upParentalLeave">
          <el-input v-model="form.upParentalLeave" placeholder="请输入育儿假"/>
        </el-form-item>
        <el-form-item label="上月-育儿假截至时间" prop="upParentalLeaveEndTime">
          <el-date-picker clearable size="small"
                          v-model="form.upParentalLeaveEndTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="选择育儿假截至时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="本月-应出勤" prop="thisShouldJob">
          <el-input v-model="form.thisShouldJob" placeholder="请输入本月-应出勤"/>
        </el-form-item>
        <el-form-item label="本月-已出勤" prop="thisAlreadyJob">
          <el-input v-model="form.thisAlreadyJob" placeholder="请输入本月-已出勤"/>
        </el-form-item>
        <el-form-item label="本月-事假" prop="thisPersonalLeave">
          <el-input v-model="form.thisPersonalLeave" placeholder="请输入本月-事假"/>
        </el-form-item>
        <el-form-item label="本月-病假" prop="thisSickLeave">
          <el-input v-model="form.thisSickLeave" placeholder="请输入本月-病假"/>
        </el-form-item>
        <el-form-item label="本月-积休" prop="thisProductLeave">
          <el-input v-model="form.thisProductLeave" placeholder="请输入本月-积休"/>
        </el-form-item>
        <el-form-item label="本月-公休" prop="thisWorkLeave">
          <el-input v-model="form.thisWorkLeave" placeholder="请输入本月-公休"/>
        </el-form-item>
        <el-form-item label="本月-增休" prop="thisAddLeave">
          <el-input v-model="form.thisAddLeave" placeholder="请输入本月-增休"/>
        </el-form-item>
        <el-form-item label="育儿假" prop="thisSumParentalLeave">
          <el-input v-model="form.thisSumParentalLeave" placeholder="请输入育儿假"/>
        </el-form-item>
        <el-form-item label="累计积休" prop="thisSumLjjx">
          <el-input v-model="form.thisSumLjjx" placeholder="请输入累计积休"/>
        </el-form-item>
        <el-form-item label="公休" prop="thisSumWorkLeave">
          <el-input v-model="form.thisSumWorkLeave" placeholder="请输入公休"/>
        </el-form-item>
        <el-form-item label="疫情增休" prop="thisSumYqAddLeave">
          <el-input v-model="form.thisSumYqAddLeave" placeholder="请输入疫情增休"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
                   @click="importTemplate">下载模板
          </el-link>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="cancelTemplate">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog :title="detailedWind.title" :visible.sync="detailedWind.open" append-to-body fullscreen="fullscreen">
      <!--      <el-calendar :range="['2019-03-04', '2019-03-24']">-->
      <!--      </el-calendar>-->

      <el-button type="primary" style="position: absolute;top: 15px;left: 270px" @click="isWriteDetailed">保存</el-button>
      <div>
        <div>
        </div>
        <div style="padding: 0 45px 0">
          <div class="myInlineBlock outerBorder" v-for="(item,index) in detailedWind.monthData" :key="index">
            <div class=" dateContent">
              {{ item.title + '日' }}
            </div>
            <div class="myInlineBlock">
              <div class="resultContentTitle">
                情况：
              </div>
              <div class="inputTextField">
                <el-input type="textarea" :rows="4" v-model="item.value" :disabled="item.isWrite" placeholder="请输入"/>
              </div>
              <!-- <div v-show="item.isWrite === false" class="resultContent" >-->
              <!--   {{ item.value }}-->
              <!-- </div>-->
            </div>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>


<style lang="css">
.myInlineBlock {
  display: inline-block;
}

.dateContent {
  padding: 10px 0 0 10px;
  font-size: 28px;
  font-weight: bold;
}

.resultContentTitle {
  margin-left: 10px;
  margin-top: 10px;
}

.inputTextField {
  width: 176px;
  height: 95px;
  border-radius: 20px;
  margin: 3px 10px 10px 10px;
  padding: 5px;
}

.resultContent {
  width: 170px;
  height: 100px;
  border-radius: 20px;
  margin: 3px 10px 10px 10px;
  padding: 5px;
  background: rgb(255, 255, 255);
}

.outerBorder {
  width: 195px;
  height: 190px;
  margin: 4px;
  border-radius: 15%;
  background: rgba(150, 155, 158, 0.12);
}
</style>
<script>
import {
  listStat,
  getStat,
  delStat,
  addStat,
  updateStat,
  exportStat,
  importTemp,
  getStatZend
} from '@/api/clockingin/stat'
import { getToken } from '@/utils/auth'

export default {
  name: 'Stat',
  data() {
    return {
      detailedWind: {
        open: false,
        title: '详细情况',
        monthData: []
      },
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 统计考勤表格数据
      statList: [],
      // 弹出层标题
      title: '',
      // 是否显示弹出层
      open: false,
      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: '',
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        // 设置上传的请求头部
        headers: { Authorization: 'Bearer ' + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + '/clockingin/stat/importData'
      },
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userCode: null,
        clockingInMonth: null,
        jobNo: null,
        userName: null,
        department: null,
        upLjjx: null,
        upWorkLeave: null,
        upYqAddLeave: null,
        upParentalLeave: null,
        upParentalLeaveEndTime: null,
        thisShouldJob: null,
        thisAlreadyJob: null,
        thisPersonalLeave: null,
        thisSickLeave: null,
        thisProductLeave: null,
        thisWorkLeave: null,
        thisAddLeave: null,
        thisSumParentalLeave: null,
        thisSumLjjx: null,
        thisSumWorkLeave: null,
        thisSumYqAddLeave: null,
        zend: null,
        orgCode: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {}
    }
  },
  created() {
    this.getList()
  },
  methods: {
    isWriteDetailed() {
      this.form.zend = this.detailedWind.monthData
      updateStat(this.form).then(() => {
        this.$modal.msgSuccess('修改成功')
      })
    },
    /** 查询统计考勤列表 */
    getList() {
      this.loading = true
      listStat(this.queryParams).then(response => {
        this.statList = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        userCode: null,
        clockingInMonth: null,
        jobNo: null,
        userName: null,
        department: null,
        upLjjx: null,
        upWorkLeave: null,
        upYqAddLeave: null,
        upParentalLeave: null,
        upParentalLeaveEndTime: null,
        thisShouldJob: null,
        thisAlreadyJob: null,
        thisPersonalLeave: null,
        thisSickLeave: null,
        thisProductLeave: null,
        thisWorkLeave: null,
        thisAddLeave: null,
        thisSumParentalLeave: null,
        thisSumLjjx: null,
        thisSumWorkLeave: null,
        thisSumYqAddLeave: null,
        zend: null,
        orgCode: null,
        isDelete: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null
      }
      this.resetForm('form')
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm('queryForm')
      this.handleQuery()
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset()
      this.open = true
      this.title = '添加统计考勤'
    },
    /** 打开详细 */
    handleDetailed(row, is) {
      this.detailedWind.monthData = []
      this.detailedWind.title = row.userName + ' 【' + row.clockingInMonth + '】考勤详细'
      this.detailedWind.open = true
      this.form = row
      getStatZend(row.id).then(response => {
        if (response.code === 200) {
          if (response.data[0].length) {
            this.detailedWind.monthData = response.data[0]
          } else {
            this.detailedWind.monthData = response.data
          }
          if (this.detailedWind.monthData) {
            this.form.zend = this.detailedWind.monthData
            console.log(this.form)
            this.detailedWind.monthData.forEach(item => {
              item.isWrite = is
            })
          }
        }
      })

    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset()
      this.open = true
      this.form = row
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs['form'].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateStat(this.form).then(() => {
              this.$modal.msgSuccess('修改成功')
              this.open = false
              this.getList()
            })
          } else {
            addStat(this.form).then(() => {
              this.$modal.msgSuccess('新增成功')
              this.open = false
              this.getList()
            })
          }
        }
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids
      this.$modal.confirm('是否确认删除统计考勤编号为"' + ids + '"的数据项？').then(function() {
        return delStat(ids)
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess('删除成功')
      }).catch(() => {
      })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams
      this.$modal.confirm('是否确认导出所有统计考勤数据项？').then(() => {
        this.exportLoading = true
        return exportStat(queryParams)
      }).then(response => {
        this.$download.name(response.msg)
        this.exportLoading = false
      }).catch(() => {
      })
    },
    handleImport() {
      this.upload.title = '工资信息导入'
      this.upload.open = true
    },
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false
      this.upload.isUploading = false
      this.$refs.upload.clearFiles()
      this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
      this.cancel()
      this.getList()
    },
    importTemplate() {
      window.open('http://114.115.142.166:8087/down/1KUCoUFTa57E')
    },
    submitFileForm() {
      this.$refs.upload.submit()
    },
    cancelTemplate() {
      this.upload.open = false
      this.form.moneyType = '2'
    }
  }
}
</script>
