<!--
 * @Author: zhangcx4 zhangcx4@yonyou.com
 * @Date: 2021-08-26 11:26:18
 * @LastEditors: zhangcx4 zhangcx4@yonyou.com
 * @LastEditTime: 2025-01-14 10:39:30
 * @FilePath: /Webapps-11.0/Users/peanut/Documents/U8Cloud应用组件库/vuc-view-master/packages/vuc-datatable/printer/print-config/print-config.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <Form :label-width="80"
        style="width:360px;background:#fff;padding:20px 16px;z-index:999;">
    <FormItem label="标题"
              style="width:320px">
      <Input v-model="printConfig.printTitle"></Input>
    </FormItem>
    <Row>
      <Col span=12>
      <FormItem label="每页行数">
        <InputNumber v-model="printConfig.pageSize"
                     class="number"></InputNumber>
      </FormItem>
      </Col>
      <Col span=12>
      <FormItem label="行高">
        <InputNumber v-model="printConfig.rowHeight"
                     class="number"></InputNumber>
      </FormItem>
      </Col>
      <Col span=12>
      <FormItem label="左边距">
        <InputNumber v-model="printConfig.marginLeft"
                     class="number"></InputNumber>
      </FormItem>
      </Col>
      <Col span=12>
      <FormItem label="右边距">
        <InputNumber v-model="printConfig.marginRight"
                     class="number"></InputNumber>
      </FormItem>
      </Col>
      <Col span=12>
      <FormItem label="上边距">
        <InputNumber v-model="printConfig.marginTop"
                     class="number"></InputNumber>
      </FormItem>
      </Col>
      <Col span=12>
      <FormItem label="下边距">
        <InputNumber v-model="printConfig.marginBottom"
                     class="number"></InputNumber>
      </FormItem>
      </Col>
    </Row>
    <FormItem style="margin-bottom:0px;"
              label="页面分隔">
      <Checkbox v-model="printConfig.showSplit">打印分页线</Checkbox>
      <Checkbox v-model="printConfig.pageBreak">强制分页</Checkbox>
      <Checkbox v-model="printConfig.spaceRow">使用空行填充空白</Checkbox>
    </FormItem>
    <FormItem style="margin-top:0px;"
              label="打印内容"
              v-if="showDataSrc">
      <RadioGroup v-model="printConfig.dataSrc">
        <Radio label="all">所有数据</Radio>
        <Radio label="checked">已选择数据</Radio>

      </RadioGroup>
    </FormItem>
  </Form>
</template>

<script>
export default {
  name: 'PrintConfig',
  props: {
    printConfig: {
      type: Object,
      default: () => { }
    },
    printCheckedData: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    showDataSrc() {
      return this.printCheckedData
    }
  }
}
</script>

<style lang="less" scoped>
.ivu-form-item {
  margin-bottom: 8px;
}
.number {
  width: 80px;
  min-width: 80px;
}
</style>
