printer-schema.xsd 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <?xml version="1.0"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3. <xs:element name="page">
  4. <xs:annotation>
  5. <xs:documentation>一个模板的根节点,可用于配置一些基本信息</xs:documentation>
  6. </xs:annotation>
  7. <xs:complexType>
  8. <xs:sequence>
  9. <xs:element name="font-type" minOccurs="0" maxOccurs="unbounded">
  10. <xs:complexType>
  11. <xs:attribute name="fontType" type="xs:string">
  12. <xs:annotation>
  13. <xs:documentation>字体名称</xs:documentation>
  14. </xs:annotation>
  15. </xs:attribute>
  16. <xs:attribute name="fontBaseWidth" type="xs:integer">
  17. <xs:annotation>
  18. <xs:documentation>字体大小1的时候的宽度</xs:documentation>
  19. </xs:annotation>
  20. </xs:attribute>
  21. <xs:attribute name="fontBaseHeight" type="xs:integer">
  22. <xs:annotation>
  23. <xs:documentation>字体大小1的时候的宽度</xs:documentation>
  24. </xs:annotation>
  25. </xs:attribute>
  26. </xs:complexType>
  27. </xs:element>
  28. <xs:element name="printer-config" minOccurs="0" maxOccurs="1">
  29. <xs:complexType>
  30. <xs:attributeGroup ref="textGroup" />
  31. </xs:complexType>
  32. </xs:element>
  33. <xs:element name="eval-property" minOccurs="0" maxOccurs="unbounded">
  34. <xs:annotation>
  35. <xs:documentation>
  36. 计算字段
  37. </xs:documentation>
  38. </xs:annotation>
  39. <xs:complexType>
  40. <xs:attribute name="attch" type="xs:string">
  41. <xs:annotation>
  42. <xs:documentation>
  43. 表示依附到某个的路径上
  44. </xs:documentation>
  45. </xs:annotation>
  46. </xs:attribute>
  47. <xs:attribute name="propertyName" type="xs:string">
  48. <xs:annotation>
  49. <xs:documentation>
  50. 计算属性名
  51. </xs:documentation>
  52. </xs:annotation>
  53. </xs:attribute>
  54. </xs:complexType>
  55. </xs:element>
  56. <xs:group ref="control" minOccurs="1"></xs:group>
  57. </xs:sequence>
  58. <xs:attributeGroup ref="sizeRWidth" />
  59. </xs:complexType>
  60. </xs:element>
  61. <xs:group name="control">
  62. <xs:sequence>
  63. <!-- 条形码 -->
  64. <xs:element name="barcode" minOccurs="0" maxOccurs="unbounded">
  65. <xs:annotation>
  66. <xs:documentation>显示条形码组件</xs:documentation>
  67. </xs:annotation>
  68. <xs:complexType>
  69. <xs:attributeGroup ref="directive" />
  70. <xs:attributeGroup ref="sizeRHeight" />
  71. <xs:attributeGroup ref="offsetGroup" />
  72. <xs:attributeGroup ref="bindingGroup" />
  73. <xs:attribute name="lineWidth" type="xs:integer">
  74. <xs:annotation>
  75. <xs:documentation>
  76. 单条线的宽度
  77. </xs:documentation>
  78. </xs:annotation>
  79. </xs:attribute>
  80. <xs:attribute name="showText" type="xs:boolean">
  81. <xs:annotation>
  82. <xs:documentation>
  83. 是否显示文字
  84. </xs:documentation>
  85. </xs:annotation>
  86. </xs:attribute>
  87. </xs:complexType>
  88. </xs:element>
  89. <!-- End 条形码 -->
  90. <!-- 二维码 -->
  91. <xs:element name="qrcode" minOccurs="0" maxOccurs="unbounded">
  92. <xs:annotation>
  93. <xs:documentation>显示二维码组件</xs:documentation>
  94. </xs:annotation>
  95. <xs:complexType>
  96. <xs:attributeGroup ref="directive" />
  97. <xs:attributeGroup ref="size" />
  98. <xs:attributeGroup ref="offsetGroup" />
  99. <xs:attributeGroup ref="bindingGroup" />
  100. <xs:attribute name="ecc">
  101. <xs:annotation>
  102. <xs:documentation>
  103. 纠错等级
  104. </xs:documentation>
  105. </xs:annotation>
  106. <xs:simpleType>
  107. <xs:restriction base="xs:string">
  108. <xs:enumeration value="L"></xs:enumeration>
  109. <xs:enumeration value="M"></xs:enumeration>
  110. <xs:enumeration value="Q"></xs:enumeration>
  111. <xs:enumeration value="H"></xs:enumeration>
  112. </xs:restriction>
  113. </xs:simpleType>
  114. </xs:attribute>
  115. <xs:attribute name="dataSize" type="xs:int">
  116. <xs:annotation>
  117. <xs:documentation>
  118. 数据大小等级,越大可放的数据越多,但是识别率更低
  119. </xs:documentation>
  120. </xs:annotation>
  121. </xs:attribute>
  122. <xs:attribute name="showText" type="xs:boolean">
  123. <xs:annotation>
  124. <xs:documentation>
  125. 是否显示文字
  126. </xs:documentation>
  127. </xs:annotation>
  128. </xs:attribute>
  129. </xs:complexType>
  130. </xs:element>
  131. <!-- End 二维码 -->
  132. <!-- 文字 -->
  133. <xs:element name="text" minOccurs="0" maxOccurs="unbounded">
  134. <xs:annotation>
  135. <xs:documentation>显示文字的组件</xs:documentation>
  136. </xs:annotation>
  137. <xs:complexType>
  138. <xs:simpleContent>
  139. <xs:extension base="xs:string">
  140. <xs:attributeGroup ref="directive" />
  141. <xs:attributeGroup ref="size" />
  142. <xs:attributeGroup ref="offsetGroup" />
  143. <xs:attributeGroup ref="bindingGroup" />
  144. <xs:attributeGroup ref="textGroup" />
  145. </xs:extension>
  146. </xs:simpleContent>
  147. </xs:complexType>
  148. </xs:element>
  149. <!-- End 文字 -->
  150. <!-- 线条 -->
  151. <xs:element name="line" minOccurs="0" maxOccurs="unbounded">
  152. <xs:annotation>
  153. <xs:documentation>显示线条的组件</xs:documentation>
  154. </xs:annotation>
  155. <xs:complexType>
  156. <xs:attributeGroup ref="directive" />
  157. <xs:attributeGroup ref="size" />
  158. <xs:attributeGroup ref="offsetGroup" />
  159. </xs:complexType>
  160. </xs:element>
  161. <!-- End 线条 -->
  162. <!-- 纵向排列 -->
  163. <xs:element name="column" minOccurs="0" maxOccurs="unbounded">
  164. <xs:annotation>
  165. <xs:documentation>从上往下排列组件, 子组件的y属性代表相对上一个子组件的位置</xs:documentation>
  166. </xs:annotation>
  167. <xs:complexType>
  168. <xs:group ref="control"></xs:group>
  169. <xs:attributeGroup ref="directive" />
  170. <xs:attributeGroup ref="size" />
  171. <xs:attributeGroup ref="offsetGroup" />
  172. </xs:complexType>
  173. </xs:element>
  174. <!-- End 纵向排列 -->
  175. <!-- 横向排列 -->
  176. <xs:element name="row" minOccurs="0" maxOccurs="unbounded">
  177. <xs:annotation>
  178. <xs:documentation>从左到右排列组件, 子组件的x属性代表相对上一个子组件的位置</xs:documentation>
  179. </xs:annotation>
  180. <xs:complexType>
  181. <xs:group ref="control"></xs:group>
  182. <xs:attributeGroup ref="directive" />
  183. <xs:attributeGroup ref="size" />
  184. <xs:attributeGroup ref="offsetGroup" />
  185. </xs:complexType>
  186. </xs:element>
  187. <!-- End 横向排列 -->
  188. <!-- 横向排列-循环 -->
  189. <xs:element name="row-for" minOccurs="0" maxOccurs="unbounded">
  190. <xs:annotation>
  191. <xs:documentation>从左到右排列组件, 子组件的x属性代表相对上一个子组件的位置, 带有循环数组的功能,适用于多行渲染, y属性代表当前数据行的相对位置</xs:documentation>
  192. </xs:annotation>
  193. <xs:complexType>
  194. <xs:group ref="control"></xs:group>
  195. <xs:attributeGroup ref="directive" />
  196. <xs:attributeGroup ref="size" />
  197. <xs:attributeGroup ref="offsetGroup" />
  198. <xs:attributeGroup ref="bindingListGroup" />
  199. </xs:complexType>
  200. </xs:element>
  201. <!-- End 横向排列-循环 -->
  202. <!-- 绝对布局 -->
  203. <xs:element name="stack" minOccurs="0" maxOccurs="unbounded">
  204. <xs:annotation>
  205. <xs:documentation>绝对布局 使用子组件的x和y定位</xs:documentation>
  206. </xs:annotation>
  207. <xs:complexType>
  208. <xs:group ref="control"></xs:group>
  209. <xs:attributeGroup ref="size" />
  210. <xs:attributeGroup ref="directive" />
  211. <xs:attributeGroup ref="offsetGroup" />
  212. </xs:complexType>
  213. </xs:element>
  214. <!-- End 绝对布局 -->
  215. <!-- 表格 -->
  216. <xs:element name="table" minOccurs="0" maxOccurs="unbounded">
  217. <xs:annotation>
  218. <xs:documentation>表格组件, 支持纵向合并, 边框线 子组件的x和y无效 子组件只支持table-column</xs:documentation>
  219. </xs:annotation>
  220. <xs:complexType>
  221. <xs:sequence>
  222. <xs:element name="table-column" minOccurs="0" maxOccurs="unbounded">
  223. <xs:complexType>
  224. <xs:simpleContent>
  225. <xs:extension base="xs:string">
  226. <xs:attribute name="columnMerge" type="xs:boolean">
  227. <xs:annotation>
  228. <xs:documentation>
  229. 是否合并
  230. </xs:documentation>
  231. </xs:annotation>
  232. </xs:attribute>
  233. <xs:attributeGroup ref="bindingGroup"></xs:attributeGroup>
  234. <xs:attributeGroup ref="sizeRWidth"></xs:attributeGroup>
  235. <xs:attributeGroup ref="textGroup"></xs:attributeGroup>
  236. </xs:extension>
  237. </xs:simpleContent>
  238. </xs:complexType>
  239. </xs:element>
  240. </xs:sequence>
  241. <xs:attributeGroup ref="directive" />
  242. <xs:attributeGroup ref="sizeRHeight" />
  243. <xs:attributeGroup ref="offsetGroup" />
  244. <xs:attributeGroup ref="bindingListGroup"></xs:attributeGroup>
  245. <xs:attribute name="borderTop" type="xs:integer">
  246. <xs:annotation>
  247. <xs:documentation>
  248. 外边框上
  249. </xs:documentation>
  250. </xs:annotation>
  251. </xs:attribute>
  252. <xs:attribute name="borderRight" type="xs:integer">
  253. <xs:annotation>
  254. <xs:documentation>
  255. 外边框右
  256. </xs:documentation>
  257. </xs:annotation>
  258. </xs:attribute>
  259. <xs:attribute name="borderBottom" type="xs:integer">
  260. <xs:annotation>
  261. <xs:documentation>
  262. 外边框下
  263. </xs:documentation>
  264. </xs:annotation>
  265. </xs:attribute>
  266. <xs:attribute name="borderLeft" type="xs:integer">
  267. <xs:annotation>
  268. <xs:documentation>
  269. 外边框左
  270. </xs:documentation>
  271. </xs:annotation>
  272. </xs:attribute>
  273. <xs:attribute name="borderHorizontalInside" type="xs:integer">
  274. <xs:annotation>
  275. <xs:documentation>
  276. 内边框横向
  277. </xs:documentation>
  278. </xs:annotation>
  279. </xs:attribute>
  280. <xs:attribute name="borderVerticalInside" type="xs:integer">
  281. <xs:annotation>
  282. <xs:documentation>
  283. 内边框纵向
  284. </xs:documentation>
  285. </xs:annotation>
  286. </xs:attribute>
  287. </xs:complexType>
  288. </xs:element>
  289. <!-- End 表格 -->
  290. </xs:sequence>
  291. </xs:group>
  292. <!-- 大小 位置 -->
  293. <xs:attributeGroup name="size">
  294. <xs:attribute name="width" type="xs:integer">
  295. <xs:annotation>
  296. <xs:documentation>
  297. 相对位置X轴&#x000A;
  298. 父组件为Stack、Page、Column时代表相对父组件的位置&#x000A;
  299. Row、RowFor代表相对上一个组件的位置&#x000A;
  300. Table无效
  301. </xs:documentation>
  302. </xs:annotation>
  303. </xs:attribute>
  304. <xs:attribute name="height" type="xs:integer">
  305. <xs:annotation>
  306. <xs:documentation>
  307. 相对位置y轴&#x000A;
  308. 父组件为Stack、Page、Row时代表相对父组件的位置&#x000A;
  309. RowFor代表当前行的相对位置&#x000A;
  310. Column代表相对上一个组件的位置&#x000A;
  311. Table无效
  312. </xs:documentation>
  313. </xs:annotation>
  314. </xs:attribute>
  315. </xs:attributeGroup>
  316. <xs:attributeGroup name="sizeRWidth">
  317. <xs:attribute name="width" type="xs:integer" use="required">
  318. <xs:annotation>
  319. <xs:documentation>宽度</xs:documentation>
  320. </xs:annotation>
  321. </xs:attribute>
  322. <xs:attribute name="height" type="xs:integer">
  323. <xs:annotation>
  324. <xs:documentation>高度</xs:documentation>
  325. </xs:annotation>
  326. </xs:attribute>
  327. </xs:attributeGroup>
  328. <xs:attributeGroup name="sizeRHeight">
  329. <xs:attribute name="width" type="xs:integer">
  330. <xs:annotation>
  331. <xs:documentation>宽度</xs:documentation>
  332. </xs:annotation>
  333. </xs:attribute>
  334. <xs:attribute name="height" type="xs:integer" use="required">
  335. <xs:annotation>
  336. <xs:documentation>高度</xs:documentation>
  337. </xs:annotation>
  338. </xs:attribute>
  339. </xs:attributeGroup>
  340. <xs:attributeGroup name="offsetGroup">
  341. <xs:attribute name="x" type="xs:integer">
  342. <xs:annotation>
  343. <xs:documentation>
  344. 相对位置X轴&#x000A;
  345. 父组件为Stack、Page、Column时代表相对父组件的位置&#x000A;
  346. Row、RowFor代表相对上一个组件的位置&#x000A;
  347. Table无效
  348. </xs:documentation>
  349. </xs:annotation>
  350. </xs:attribute>
  351. <xs:attribute name="y" type="xs:integer">
  352. <xs:annotation>
  353. <xs:documentation>
  354. 相对位置y轴&#x000A;
  355. 父组件为Stack、Page、Row时代表相对父组件的位置
  356. RowFor代表当前行的相对位置&#x000A;
  357. Column代表相对上一个组件的位置&#x000A;
  358. Table无效
  359. </xs:documentation>
  360. </xs:annotation>
  361. </xs:attribute>
  362. </xs:attributeGroup>
  363. <!-- End 大小 位置 -->
  364. <!-- Data -->
  365. <xs:attributeGroup name="bindingGroup">
  366. <xs:attribute name="binding" type="xs:string">
  367. <xs:annotation>
  368. <xs:documentation>
  369. 绑定的数据
  370. </xs:documentation>
  371. </xs:annotation>
  372. </xs:attribute>
  373. <xs:attribute name="format" type="xs:string">
  374. <xs:annotation>
  375. <xs:documentation>
  376. 格式化,需要和binding一起使用
  377. </xs:documentation>
  378. </xs:annotation>
  379. </xs:attribute>
  380. </xs:attributeGroup>
  381. <xs:attributeGroup name="bindingListGroup">
  382. <xs:attribute name="binding" type="xs:string" use="required">
  383. <xs:annotation>
  384. <xs:documentation>
  385. 绑定的数据
  386. </xs:documentation>
  387. </xs:annotation>
  388. </xs:attribute>
  389. </xs:attributeGroup>
  390. <!-- End Data -->
  391. <!-- 文字 -->
  392. <xs:attributeGroup name="textGroup">
  393. <xs:attribute name="align">
  394. <xs:annotation>
  395. <xs:documentation>文字位置</xs:documentation>
  396. </xs:annotation>
  397. <xs:simpleType>
  398. <xs:restriction base="xs:string">
  399. <xs:enumeration value="start">
  400. <xs:annotation>
  401. <xs:documentation>左侧</xs:documentation>
  402. </xs:annotation>
  403. </xs:enumeration>
  404. <xs:enumeration value="center">
  405. <xs:annotation>
  406. <xs:documentation>居中</xs:documentation>
  407. </xs:annotation>
  408. </xs:enumeration>
  409. <xs:enumeration value="end">
  410. <xs:annotation>
  411. <xs:documentation>右侧</xs:documentation>
  412. </xs:annotation>
  413. </xs:enumeration>
  414. </xs:restriction>
  415. </xs:simpleType>
  416. </xs:attribute>
  417. <xs:attribute name="fontType" type="xs:string">
  418. <xs:annotation>
  419. <xs:documentation>字体</xs:documentation>
  420. </xs:annotation>
  421. </xs:attribute>
  422. <xs:attribute name="fontSize" type="xs:integer">
  423. <xs:annotation>
  424. <xs:documentation>字体大小</xs:documentation>
  425. </xs:annotation>
  426. </xs:attribute>
  427. <xs:attribute name="fontBlod" type="xs:boolean">
  428. <xs:annotation>
  429. <xs:documentation>是否粗体</xs:documentation>
  430. </xs:annotation>
  431. </xs:attribute>
  432. <xs:attribute name="underline" type="xs:boolean">
  433. <xs:annotation>
  434. <xs:documentation>是否删除线</xs:documentation>
  435. </xs:annotation>
  436. </xs:attribute>
  437. <xs:attribute name="lineSpace" type="xs:integer">
  438. <xs:annotation>
  439. <xs:documentation>行距</xs:documentation>
  440. </xs:annotation>
  441. </xs:attribute>
  442. <xs:attribute name="lineHeight" type="xs:integer">
  443. <xs:annotation>
  444. <xs:documentation>行高</xs:documentation>
  445. </xs:annotation>
  446. </xs:attribute>
  447. </xs:attributeGroup>
  448. <!-- End 文字 -->
  449. <!-- 指令 -->
  450. <xs:attributeGroup name="directive">
  451. <xs:attribute name="if" type="xs:string">
  452. <xs:annotation>
  453. <xs:documentation>
  454. 用于判断是否显示 填写具体条件 注: 不可使用于table-column
  455. </xs:documentation>
  456. </xs:annotation>
  457. </xs:attribute>
  458. </xs:attributeGroup>
  459. <!-- End 指令 -->
  460. </xs:schema>