import {HttpClient} from "/@/api/admin/http-client";
import {pageInput} from "/@/api/admin/shareDto/shareDto";

export class ComponentDetails<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
  /**
  * No description
  *
  * @tags data
  * @name getBasicInfo
  * @summary  获取产品详情基础信息
  * @request GET:
  * @secure
  */

  timer = 500
  getBasicInfo = (params : any) : any  => {
    // eslint-disable-next-line no-console
    console.log(params)
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          basicInfo: [
            {
              goodsTitle: "部件名称",
              goodsValue: "TQC+主板12321312312311231231231231232312312312123"
            },
            {
              goodsTitle: "部件类型",
              goodsValue: "计控主板12312312311231231231231232323123112312312312312323231231231123123123123123232"
            },
            {
              goodsTitle: "物料号",
              goodsValue: "TOK-20021203"
            },
            {
              goodsTitle: "生产料号",
              goodsValue: "SC202307051"
            },
            {
              goodsTitle: "序列号",
              goodsValue: "20121221"
            },
            {
              goodsTitle: "软件版本",
              goodsValue: ""
            },
            {
              goodsTitle: "厂商名称",
              goodsValue: "托肯恒山"
            },
            {
              goodsTitle: "中化密钥状态",
              goodsValue: "已绑定"
            },
            {
              goodsTitle: "团标密钥状态",
              goodsValue: "已备案"
            },
            {
              goodsTitle: "状态",
              goodsValue: "正常"
            },
            {
              goodsTitle: "创建时间",
              goodsValue: "2023-07-05"
            },
            {
              goodsTitle: "生产时间",
              goodsValue: "2023-07-05"
            },
            {
              goodsTitle: "备注",
              goodsValue: ""
            },
            {
              goodsTitle: "检测时间",
              goodsValue: "2023-07-06"
            },
            {
              goodsTitle: "检测员",
              goodsValue: "生产员"
            }
          ],
          goodsImg: {
            imgUrl: "https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg",
            title: "哈哈"
          }
        })
      },this.timer)

    })

  }

  /**
  * No description
  *
  * @tags data
  * @name getProductionLog
  * @summary  获取产品详情生产日志
  * @request GET:
  * @secure
  */

  getProductionLog = (data: pageInput, params: any ) : any => {
    // eslint-disable-next-line no-console
    console.log(params)
    console.log(data)
    return new Promise((resolve) => {
      setTimeout(()=> {
        resolve({
          tableData:[
            {
              dateOfManufacture:"2023-07-05",
              operator:"蒋工1",
              workingProcedure:"团标密钥灌注1",
              state:true,
              productionPictures:"111",
              remarks:"222"
            },
            {
              dateOfManufacture:"2023-07-05",
              operator:"蒋工2",
              workingProcedure:"团标密钥灌注2",
              state:true,
              productionPictures:"111",
              remarks:"222"
            },
            {
              dateOfManufacture:"2023-07-05",
              operator:"蒋工3",
              workingProcedure:"团标密钥灌3",
              state:true,
              productionPictures:"2323",
              remarks:"333"
            },
          ],
          dynamicColumns: [
            { prop: 'dateOfManufacture', label: '生产时间' },
            { prop: 'operator', label: '操作人' },
            { prop: 'workingProcedure', label: '工序' },
            { prop: 'state', label: '状态' },
            { prop: 'productionPictures', label: '生产图片' },
            { prop: 'remarks', label: '备注' },
            { prop: 'remarks', label: '备注' },
            { prop: 'remarks', label: '备注' },
            { prop: 'remarks', label: '备注' },
            { prop: 'remarks', label: '备注' },
            // You can generate and push more columns based on your data
          ],
          pageInput: {
            currentPage: 1,
            pageSize: 20
          },
          total: 100
        })
      },this.timer)
    })
  }

  /**
  * No description
  *
  * @tags
  * @name getAlarmLog
  * @summary 获取产品详情报警日志
  * @request GET:
  * @secure
  */
  getAlarmLog = (data: pageInput, params:any ) : any => {
    // eslint-disable-next-line no-console
    console.log(params)
    console.log(data)
    return new Promise((resolve) => {
      setTimeout(()=> {
        resolve({
          tableData:[
            {
              alarmDate:"23-07-06 09:14",
              eventName:"通讯异常1",
              remarks:"",
              state:false
            },
            {
              alarmDate:"23-07-06 09:14",
              eventName:"通讯异常2",
              remarks:"",
              state:false
            },
            {
              alarmDate:"23-07-06 09:14",
              eventName:"通讯异常3",
              remarks:"",
              state:false
            }
          ],
          dynamicColumns:[
            { prop: 'alarmDate', label: '生产时间' },
            { prop: 'eventName', label: '操作人' },
            { prop: 'remarks', label: '工序' },
            { prop: 'state', label: '状态' },
            { prop: 'state', label: '状态' },
            { prop: 'state', label: '状态' },
          ],
          pageInput: {
            currentPage: 1,
            pageSize: 20
          },
          total: 100
        })
      },this.timer)
    })
  }
}
