HolyKnightIX 9 месяцев назад
Родитель
Сommit
6b8e8c36fb
4 измененных файлов: 16 добавлений и 9 удалений
  1. +1
    -1
      example/page/designer.vue
  2. +1
    -1
      example/page/index.vue
  3. +10
    -3
      src/App.vue
  4. +4
    -4
      src/components/panel/page.vue

+ 1
- 1
example/page/designer.vue Просмотреть файл

@@ -2,7 +2,7 @@
<kr-print-designer ref="printDesigner" :temp-value="value" :widget-options="widgets" @save="handleSave" />
</template>
<script>
// import { OutStockOptions, InStockOptions } from '../data/options'
import { OutStockOptions, InStockOptions } from '../data/options'
const baseUrl = process.env.VUE_APP_BASE_API;
export default {
data() {


+ 1
- 1
example/page/index.vue Просмотреть файл

@@ -225,7 +225,7 @@ export default {
path: '/designer',
query: {
tenantId: this.tenantId,
printData: row
templateId: row.id
},
})
},


+ 10
- 3
src/App.vue Просмотреть файл

@@ -7,9 +7,7 @@
</el-scrollbar>
<div class="kr-designer-tool_bar">
<el-button size="mini" type="success" @click="saveTemp">保存</el-button>
<el-button size="mini" type="primary" @click="previewTemp"
>预览</el-button
>
<el-button size="mini" type="primary" @click="previewTemp">预览</el-button>
</div>
</div>
</div>
@@ -52,6 +50,7 @@ export default {
// 预览模板
previewTemp() {
let page = { ...this.$vptd.state.page };
console.log(page, 'page')
this.$lodop.previewTemp(cloneDeep(page));
},

@@ -74,6 +73,7 @@ html {
height: 100%;
box-sizing: border-box;
}

.kr-designer {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
@@ -84,25 +84,30 @@ html {
text-align: left;
display: flex;
flex-direction: row;

.kr-designer-view {
flex: 1;
display: flex;
flex-direction: column;
}

.kr-designer-tool {
width: 400px;
height: 100%;
display: flex;
flex-direction: column;

.el-scrollbar__wrap {
overflow: auto;
}

&_con {
flex: 1;
height: 100%;
width: 100%;
overflow: hidden;
}

&_bar {
padding: 10px;
text-align: center;
@@ -114,9 +119,11 @@ html {
.el-form-item--mini.el-form-item {
margin-bottom: 10px;
}

.min-input {
width: 100px;
}

.unit-text {
font-size: 12px;
color: #999999;


+ 4
- 4
src/components/panel/page.vue Просмотреть файл

@@ -55,9 +55,9 @@ export default {
// 宽度与高度的比例必须约等于纸张宽度与纸张高度的比例,否则拖拽组件将错位
shapeChanged(element) {
if (element === "pageWidth") {
this.pageInfo.width = this.pageInfo.pageWidth * 2.5
this.pageInfo.width = this.pageInfo.pageWidth / 0.28
} else if (element === "pageHeight") {
this.pageInfo.height = this.pageInfo.pageHeight * 2.5
this.pageInfo.height = this.pageInfo.pageHeight / 0.28
}
},

@@ -68,8 +68,8 @@ export default {
this.shapeChanged("pageWidth")
this.shapeChanged("pageHeight")
} else if (num == 2) {
this.pageInfo.pageWidth = 210
this.pageInfo.pageHeight = 105
this.pageInfo.pageWidth = 215
this.pageInfo.pageHeight = 140
this.shapeChanged("pageWidth")
this.shapeChanged("pageHeight")
}


Загрузка…
Отмена
Сохранить