测试 arco design
This commit is contained in:
parent
79c22c6348
commit
405f7f0872
@ -1,297 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href="bootstrap-3.4.1-dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<layout class="layout hinnn-layout hinnn-layout-has-sider height-100-per" style="background:#fff;">
|
||||
<div id="app">
|
||||
|
||||
{{ message }}
|
||||
@* <a-calendar v-model="value" />
|
||||
select: {{value}} *@
|
||||
|
||||
<content class="hinnn-layout-content" style="border-left:1px solid #e8e8e8;">
|
||||
<div class="container-fluid height-100-per print-content">
|
||||
<a-divider dashed />
|
||||
<a-space >
|
||||
<a-button type="primary">Primary</a-button>
|
||||
<a-button>Secondary</a-button>
|
||||
<a-button type="dashed">Dashed</a-button>
|
||||
<a-button type="outline">Outline</a-button>
|
||||
<a-button type="text">Text</a-button>
|
||||
<a-button type="primary">Item1</a-button>
|
||||
<a-button type="primary">Item2</a-button>
|
||||
</a-space>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 col-md-2" style="padding-right:0px;">
|
||||
<a-table :columns="columns" :data="data" :row-selection="rowSelection" />
|
||||
</div>
|
||||
|
||||
<div class="rect-printElement-types hiprintEpContainer">
|
||||
<ul class="hiprint-printElement-type">
|
||||
|
||||
<li>
|
||||
<span class="title"><code>拖拽列表</code></span>
|
||||
<ul>
|
||||
<li>
|
||||
<a class="ep-draggable-item" tid="testModule.text" style="">
|
||||
|
||||
<span class="glyphicon glyphicon-text-width" aria-hidden="true"></span>
|
||||
<span class="glyphicon-class">文本</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="ep-draggable-item" tid="testModule.image" style="">
|
||||
<span class="glyphicon glyphicon-picture" aria-hidden="true"></span>
|
||||
<span class="glyphicon-class">图片</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="ep-draggable-item" tid="testModule.longText">
|
||||
<span class="glyphicon glyphicon-subscript" aria-hidden="true"></span>
|
||||
<span class="glyphicon-class">长文</span>
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="ep-draggable-item" tid="testModule.tableCustom" style="">
|
||||
<span class="glyphicon glyphicon-th" aria-hidden="true"></span>
|
||||
<span class="glyphicon-class">表格</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="ep-draggable-item" tid="testModule.html">
|
||||
<span class="glyphicon glyphicon-header" aria-hidden="true"></span>
|
||||
<span class="glyphicon-class">html</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<span class="title">辅助</span>
|
||||
<ul>
|
||||
<li>
|
||||
<a class="ep-draggable-item" tid="testModule.hline" style="">
|
||||
|
||||
<span class="glyphicon glyphicon-resize-horizontal" aria-hidden="true"></span>
|
||||
<span class="glyphicon-class">横线</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="ep-draggable-item" tid="testModule.vline" style="">
|
||||
<span class="glyphicon glyphicon-resize-vertical" aria-hidden="true"></span>
|
||||
<span class="glyphicon-class">竖线</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="ep-draggable-item" tid="testModule.rect">
|
||||
<span class="glyphicon glyphicon-unchecked" aria-hidden="true"></span>
|
||||
<span class="glyphicon-class">矩形</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="ep-draggable-item" tid="testModule.oval">
|
||||
<span class="glyphicon glyphicon-record" aria-hidden="true"></span>
|
||||
<span class="glyphicon-class">椭圆</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-9 col-md-10">
|
||||
<div class="hiprint-toolbar" style="margin-top:15px;">
|
||||
<ul>
|
||||
<li><a class="hiprint-toolbar-item" onclick="setPaper('A3')">A3</a></li>
|
||||
<li><a class="hiprint-toolbar-item" onclick="setPaper('A4')">A4</a></li>
|
||||
<li><a class="hiprint-toolbar-item" onclick="setPaper('A5')">A5</a></li>
|
||||
<li><a class="hiprint-toolbar-item" onclick="setPaper('B3')">B3</a></li>
|
||||
<li><a class="hiprint-toolbar-item" onclick="setPaper('B4')">B4</a></li>
|
||||
<li><a class="hiprint-toolbar-item" onclick="setPaper('B5')">B5</a></li>
|
||||
|
||||
<li><a class="hiprint-toolbar-item"><input type="text" id="customWidth" style="width: 50px;height: 19px;border: 0px;" placeholder="宽/mm" /></a></li>
|
||||
<li><a class="hiprint-toolbar-item"><input type="text" id="customHeight" style="width: 50px;height: 19px;border: 0px;" placeholder="高/mm" /></a></li>
|
||||
|
||||
<li><a class="hiprint-toolbar-item" onclick="setPaper($('#customWidth').val(),$('#customHeight').val())">自定义</a></li>
|
||||
<li><a class="hiprint-toolbar-item" onclick="rotatePaper()">旋转</a></li>
|
||||
<li><a class="hiprint-toolbar-item" onclick="clearTemplate()">清空</a></li>
|
||||
|
||||
<li>
|
||||
<a class="btn hiprint-toolbar-item " style="color: #fff;
|
||||
background-color: #d9534f;
|
||||
border-color: #d43f3a;" id="A4_preview">快速预览</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="A4_directPrint" class="btn hiprint-toolbar-item " style="color: #fff;
|
||||
background-color: #d9534f;
|
||||
border-color: #d43f3a;">打印</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<div id="hiprint-printTemplate" class="hiprint-printTemplate" style="margin-top:20px;">
|
||||
</div>
|
||||
<div style="padding-top:15px;">
|
||||
<button type="button" class="btn btn-primary" id="A4_getJson_toTextarea">生成json到textarea</button>
|
||||
<button type="button" class="btn btn-primary" id="A4_getJson_toDesign">生成打印设计 json to 模板</button>
|
||||
</div>
|
||||
<div class="hinnn-callout hinnn-callout-danger">
|
||||
<p><code>可视化</code>结果以Json的形式存在,用户可以<code>编辑Json</code>实现特殊化操作,如:数据<code>formatter</code>,<code>文本变色</code>,单元格<code>改变背景</code>等。具体请参考文档。</p>
|
||||
</div>
|
||||
<textarea class="form-control" rows="10" id="A4_textarea_json"></textarea>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<sider class="hinnn-layout-sider" style="">
|
||||
<div class="container height-100-per" style="width:250px;">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div id="PrintElementOptionSetting" style="margin-top:10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</sider>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</content>
|
||||
|
||||
</layout>
|
||||
|
||||
|
||||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog modal-lg" role="document" style="width: 825px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">打印预览</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<button type="button" class="btn btn-danger" id="A4_printByHtml">打印</button>
|
||||
<div class="prevViewDiv"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--[[ 测试专用 单独使用无需引入 -->
|
||||
<script src="custom_test/custom-etype-provider.js"></script>
|
||||
<script src="custom_test/custom-print-json.js"></script>
|
||||
<script src="custom_test/print-data.js"></script>
|
||||
<!--测试专用 单独使用无需引入 ]] -->
|
||||
<!--单独使用无需引入 -->
|
||||
|
||||
<script src="bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<script>
|
||||
var hiprintTemplate;
|
||||
$(document).ready(function () {
|
||||
|
||||
//初始化打印插件
|
||||
hiprint.init({
|
||||
providers: [new customElementTypeProvider()]
|
||||
});
|
||||
|
||||
// hiprint.PrintElementTypeManager.build('.hiprintEpContainer', 'testModule');
|
||||
//设置左侧拖拽事件
|
||||
hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'));
|
||||
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: customPrintJson,
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
});
|
||||
//打印设计
|
||||
hiprintTemplate.design('#hiprint-printTemplate');
|
||||
|
||||
$('#A4_preview').click(function () {
|
||||
$('#myModal .modal-body .prevViewDiv').html(hiprintTemplate.getHtml(printData))
|
||||
$('#myModal').modal('show')
|
||||
});
|
||||
$('#A4_directPrint').click(function () {
|
||||
hiprintTemplate.print(printData);
|
||||
});
|
||||
$('#A4_printByHtml').click(function () {
|
||||
hiprintTemplate.printByHtml($('#myModal .modal-body .prevViewDiv'));
|
||||
})
|
||||
$('#A4_getJson_toTextarea').click(function () {
|
||||
$('#A4_textarea_json').html(JSON.stringify(hiprintTemplate.getJson()))
|
||||
})
|
||||
$('#A4_getJson_toDesign').click(function () {
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: JSON.parse($('#A4_textarea_json').val()),
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
});
|
||||
$('#hiprint-printTemplate').html('');
|
||||
hiprintTemplate.design('#hiprint-printTemplate');
|
||||
})
|
||||
});
|
||||
|
||||
//调整纸张
|
||||
var setPaper = function (paperTypeOrWidth, height) {
|
||||
hiprintTemplate.setPaper(paperTypeOrWidth, height);
|
||||
<script>
|
||||
const { createApp, ref, reactive } = Vue
|
||||
const { Button, Calendar, Divider, Space, Table } = ArcoVue
|
||||
createApp({
|
||||
setup() {
|
||||
const message = ref('Hello vue!')
|
||||
const value = ref(new Date('2023-01-01'));
|
||||
const rowSelection = {
|
||||
type: 'radio'
|
||||
};
|
||||
const columns = [
|
||||
{
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: 'Salary',
|
||||
dataIndex: 'salary',
|
||||
},
|
||||
{
|
||||
title: 'Address',
|
||||
dataIndex: 'address',
|
||||
},
|
||||
{
|
||||
title: 'Email',
|
||||
dataIndex: 'email',
|
||||
},
|
||||
]
|
||||
const data = reactive([{
|
||||
key: '1',
|
||||
name: 'Jane Doe',
|
||||
salary: 23000,
|
||||
address: '32 Park Road, London',
|
||||
email: 'jane.doe@example.com'
|
||||
}, {
|
||||
key: '2',
|
||||
name: 'Alisa Ross',
|
||||
salary: 25000,
|
||||
address: '35 Park Road, London',
|
||||
email: 'alisa.ross@example.com'
|
||||
}, {
|
||||
key: '3',
|
||||
name: 'Kevin Sandra',
|
||||
salary: 22000,
|
||||
address: '31 Park Road, London',
|
||||
email: 'kevin.sandra@example.com'
|
||||
}, {
|
||||
key: '4',
|
||||
name: 'Ed Hellen',
|
||||
salary: 17000,
|
||||
address: '42 Park Road, London',
|
||||
email: 'ed.hellen@example.com'
|
||||
}, {
|
||||
key: '5',
|
||||
name: 'William Smith',
|
||||
salary: 27000,
|
||||
address: '62 Park Road, London',
|
||||
email: 'william.smith@example.com'
|
||||
}]);
|
||||
return {
|
||||
message,
|
||||
value,
|
||||
rowSelection,
|
||||
columns,
|
||||
data
|
||||
}
|
||||
}
|
||||
|
||||
//旋转
|
||||
var rotatePaper = function () {
|
||||
hiprintTemplate.rotatePaper();
|
||||
}
|
||||
var clearTemplate = function () {
|
||||
hiprintTemplate.clear();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
//设置左侧拖拽事件
|
||||
var hiprintTemplate_bill = new hiprint.PrintTemplate({
|
||||
template: JSON.parse($('#textarea_bill').val()),
|
||||
settingContainer: '#PrintElementOptionSetting'
|
||||
});
|
||||
//打印设计
|
||||
hiprintTemplate_bill.design('#hiprint-printTemplate_bill');
|
||||
|
||||
$('#bill_preview').click(function () {
|
||||
$('#myModal .modal-body .prevViewDiv').html(hiprintTemplate_bill.getHtml(printData))
|
||||
$('#myModal').modal('show')
|
||||
});
|
||||
$('#bill_print').click(function () {
|
||||
hiprintTemplate_bill.print(printData);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('#barcode_button_preview').click(function () {
|
||||
var barCodehiprintTemplate = new hiprint.PrintTemplate({ template: JSON.parse($('#textarea_barcode').val()) });
|
||||
|
||||
var $html = barCodehiprintTemplate.getHtml([{ name: '黄山', barcode: '13234567' }, { name: '黄波', barcode: '1224567' }, { name: '黄磊', barcode: '1234567' }, { name: '黄磊', barcode: '1234567' }, { name: '古丽娜', barcode: '7654321' }])
|
||||
|
||||
$('#myModal .modal-body .prevViewDiv').html($html)
|
||||
$('#myModal').modal('show')
|
||||
});
|
||||
|
||||
$('#barcode_button_print').click(function () {
|
||||
var barCodehiprintTemplate = new hiprint.PrintTemplate({ template: JSON.parse($('#textarea_barcode').val()) });
|
||||
|
||||
var $html = barCodehiprintTemplate.getHtml([{ name: '黄山', barcode: '13234567' }, { name: '黄波', barcode: '1224567' }, { name: '黄磊', barcode: '1234567' }, { name: '黄磊', barcode: '1234567' }, { name: '古丽娜', barcode: '7654321' }])
|
||||
barCodehiprintTemplate.printByHtml($html);
|
||||
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
})
|
||||
.use(Calendar)
|
||||
.use(Button)
|
||||
.use(Divider)
|
||||
.use(Space)
|
||||
.use(Table)
|
||||
.mount('#app')
|
||||
</script>
|
||||
|
||||
@ -13,12 +13,17 @@
|
||||
<link rel="stylesheet" href="/font/iconfont.css">
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
|
||||
<!-- 引入样式 -->
|
||||
<link rel="stylesheet" href="/lib/arco/arco.min.css">
|
||||
<script src="/lib/arco/vue.global.js"></script>
|
||||
<script src="/lib/arco/arco-vue.js"></script>
|
||||
<script src="/lib/arco/arco-vue-icon.js"></script>
|
||||
|
||||
@* <!-- 引入样式 -->
|
||||
<link rel="stylesheet" href="/lib/element-ui/lib/theme-chalk/index.css">
|
||||
<!-- import Vue before Element -->
|
||||
<script src="/lib/vue/dist/vue.min.js"></script>
|
||||
<!-- import JavaScript -->
|
||||
<script src="lib/element-ui/lib/index.js"></script>
|
||||
<script src="lib/element-ui/lib/index.js"></script> *@
|
||||
|
||||
<link rel="stylesheet" href="/hiprint/css/hiprint.css" />
|
||||
<link rel="stylesheet" href="/hiprint/css/print-lock.css" />
|
||||
|
||||
24059
HHWMS.Web/wwwroot/lib/arco/arco-vue-icon.js
Normal file
24059
HHWMS.Web/wwwroot/lib/arco/arco-vue-icon.js
Normal file
File diff suppressed because it is too large
Load Diff
1
HHWMS.Web/wwwroot/lib/arco/arco-vue-icon.js.map
Normal file
1
HHWMS.Web/wwwroot/lib/arco/arco-vue-icon.js.map
Normal file
File diff suppressed because one or more lines are too long
4635
HHWMS.Web/wwwroot/lib/arco/arco-vue-icon.min.js
vendored
Normal file
4635
HHWMS.Web/wwwroot/lib/arco/arco-vue-icon.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
HHWMS.Web/wwwroot/lib/arco/arco-vue-icon.min.js.map
Normal file
1
HHWMS.Web/wwwroot/lib/arco/arco-vue-icon.min.js.map
Normal file
File diff suppressed because one or more lines are too long
48708
HHWMS.Web/wwwroot/lib/arco/arco-vue.js
Normal file
48708
HHWMS.Web/wwwroot/lib/arco/arco-vue.js
Normal file
File diff suppressed because one or more lines are too long
1
HHWMS.Web/wwwroot/lib/arco/arco-vue.js.map
Normal file
1
HHWMS.Web/wwwroot/lib/arco/arco-vue.js.map
Normal file
File diff suppressed because one or more lines are too long
11692
HHWMS.Web/wwwroot/lib/arco/arco-vue.min.js
vendored
Normal file
11692
HHWMS.Web/wwwroot/lib/arco/arco-vue.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
HHWMS.Web/wwwroot/lib/arco/arco-vue.min.js.map
Normal file
1
HHWMS.Web/wwwroot/lib/arco/arco-vue.min.js.map
Normal file
File diff suppressed because one or more lines are too long
17314
HHWMS.Web/wwwroot/lib/arco/arco.css
Normal file
17314
HHWMS.Web/wwwroot/lib/arco/arco.css
Normal file
File diff suppressed because it is too large
Load Diff
2
HHWMS.Web/wwwroot/lib/arco/arco.less
Normal file
2
HHWMS.Web/wwwroot/lib/arco/arco.less
Normal file
@ -0,0 +1,2 @@
|
||||
@import '../es/index.less';
|
||||
|
||||
1
HHWMS.Web/wwwroot/lib/arco/arco.min.css
vendored
Normal file
1
HHWMS.Web/wwwroot/lib/arco/arco.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
16658
HHWMS.Web/wwwroot/lib/arco/vue.global.js
Normal file
16658
HHWMS.Web/wwwroot/lib/arco/vue.global.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user