template3.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. export const name = '合并示例';
  2. export const desc = '首列合并示例';
  3. export const author = 'CcSimple'
  4. export const link = 'https://github.com/CcSimple'
  5. // url 或者 base64 或者 require('../../../assets/logo.png')
  6. export const preview = 'https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/template3.png';
  7. export const printData = {
  8. table: [
  9. {
  10. code: 2223068061,
  11. uName: "张三",
  12. tName: "李丽",
  13. id: 217001,
  14. name2: "普通课程名称 1",
  15. type: "学位课",
  16. time: 48,
  17. score: 3,
  18. score2: 75,
  19. start: "20年秋季",
  20. tName2: "张丽莎",
  21. type2: "考试"
  22. },
  23. {
  24. code: 2223068061,
  25. uName: "张三",
  26. tName: "李丽",
  27. id: 258905,
  28. name2: "普通课程名称 2",
  29. type: "学位课",
  30. time: 32,
  31. score: 2,
  32. score2: 84,
  33. start: "21年春季",
  34. tName2: "张丽莎",
  35. type2: "考试"
  36. },
  37. {
  38. code: 2223068061,
  39. uName: "张三",
  40. tName: "李丽",
  41. id: 217502,
  42. name2: "普通课程名称 3",
  43. type: "学位课",
  44. time: 16,
  45. score: 1,
  46. score2: 91,
  47. start: "20年秋季",
  48. tName2: "张丽莎",
  49. type2: "考试"
  50. },
  51. {
  52. code: 2223068061,
  53. uName: "张三",
  54. tName: "李丽",
  55. id: 258904,
  56. name2: "高级不普通的课程名称 1",
  57. type: "学位课",
  58. time: 32,
  59. score: 2,
  60. score2: 86,
  61. start: "20年秋季",
  62. tName2: "张丽莎",
  63. type2: "考试"
  64. },
  65. {
  66. code: 2223068061,
  67. uName: "张三",
  68. tName: "李丽",
  69. id: 258903,
  70. name2: "高级不普通的课程名称 2",
  71. type: "学位课",
  72. time: 48,
  73. score: 3,
  74. score2: 90,
  75. start: "20年秋季",
  76. tName2: "张丽莎",
  77. type2: "考试"
  78. },
  79. {
  80. code: 2223068061,
  81. uName: "张三",
  82. tName: "李丽",
  83. id: 259307,
  84. name2: "高级不普通的课程名称 3",
  85. type: "学位课",
  86. time: 32,
  87. score: 2,
  88. score2: 69,
  89. start: "20年秋季",
  90. tName2: "张丽莎",
  91. type2: "考试"
  92. },
  93. {
  94. code: 2223068061,
  95. uName: "张三",
  96. tName: "李丽",
  97. id: 258906,
  98. name2: "高级不普通的课程名称 4",
  99. type: "学位课",
  100. time: 32,
  101. score: 2,
  102. score2: 91,
  103. start: "21年春季",
  104. tName2: "张丽莎",
  105. type2: "考试",
  106. },
  107. {
  108. code: 2223068061,
  109. uName: "张三",
  110. tName: "李丽",
  111. id: 217503,
  112. name2: "普通的课程名称 6",
  113. type: "学位课",
  114. time: 32,
  115. score: 2,
  116. score2: 80,
  117. start: "21年春季",
  118. tName2: "张丽莎",
  119. type2: "考试"
  120. },
  121. {
  122. code: 2223068061,
  123. uName: "张三",
  124. tName: "李丽",
  125. id: 216001,
  126. name2: "普通的课程名称 7",
  127. type: "必修环节",
  128. time: 16,
  129. score: 1,
  130. score2: 79,
  131. start: "21年春季",
  132. tName2: "张丽莎",
  133. type2: "考查"
  134. },
  135. {
  136. code: 2223068061,
  137. uName: "张三",
  138. tName: "李丽",
  139. id: 258919,
  140. name2: "普通的课程名称 8",
  141. type: "必修环节",
  142. time: 0,
  143. score: 6,
  144. score2: 0,
  145. start: "21年秋季",
  146. tName2: "张丽莎",
  147. type2: ""
  148. },
  149. {
  150. code: 2223068061,
  151. uName: "张三",
  152. tName: "李丽",
  153. id: 258915,
  154. name2: "高级不普通的课程名称 6",
  155. type: "选修课",
  156. time: 16,
  157. score: 1,
  158. score2: 87,
  159. start: "20年秋季",
  160. tName2: "张丽莎",
  161. type2: "考查"
  162. },
  163. {
  164. code: 2223068061,
  165. uName: "张三",
  166. tName: "李丽",
  167. id: 258911,
  168. name2: "高级不普通的课程名称 7",
  169. type: "选修课",
  170. time: 32,
  171. score: 2,
  172. score2: 91,
  173. start: "20年秋季",
  174. tName2: "张丽莎",
  175. type2: "考查"
  176. },
  177. {
  178. code: 2223068061,
  179. uName: "张三",
  180. tName: "李丽",
  181. id: 258907,
  182. name2: "高级不普通的课程名称 8",
  183. type: "选修课",
  184. time: 32,
  185. score: 2,
  186. score2: 82,
  187. start: "20年秋季",
  188. tName2: "张丽莎",
  189. type2: "考试"
  190. },
  191. ]
  192. }
  193. export const json = {
  194. "panels": [{
  195. "index": 0, "name": 1, "height": 296.6, "width": 210, "paperHeader": 24, "paperFooter": 805.5, "printElements": [{
  196. "options": {
  197. "left": 15,
  198. "top": 42,
  199. "height": 64.5,
  200. "width": 555,
  201. "field": "table",
  202. "coordinateSync": false,
  203. "widthHeightSync": false,
  204. "right": 565,
  205. "bottom": 96,
  206. "vCenter": 290,
  207. "hCenter": 69,
  208. "tableHeaderRowHeight": 30,
  209. "tableBodyRowHeight": 30,
  210. "rowsColumnsMerge": "function (data, col, colIndex, rowIndex) {\n console.log('data', data);\n console.log('col', col);\n console.log('colIndex', colIndex);\n console.log('rowIndex', rowIndex);\n // 返回一个数组,参数一为行(rowspan)合并数,参数二为列(colspan)合并数, 被合并的行或者列值设为0\n if (rowIndex >= 0 && rowIndex < 8) {\n return colIndex == 0 ? [rowIndex == 0 ? 8 - 0 : 0, 1] : [1, 1];\n } else if (rowIndex >= 8 && rowIndex < 10) {\n return colIndex == 0 ? [rowIndex == 8 ? 10 - 8 : 0, 1] : [1, 1];\n } else if (rowIndex >= 10 && rowIndex < 13) {\n return colIndex == 0 ? [rowIndex == 10 ? 13 - 10 : 0, 1] : [1, 1];\n } else {\n return [1, 1]\n }\n}",
  211. "rowsColumnsMergeClean": true,
  212. "tableHeaderRepeat": "first",
  213. "columns": [[{
  214. "width": 51.517525000000006,
  215. "title": "课程<br/>类别",
  216. "field": "type",
  217. "checked": true,
  218. "columnId": "type",
  219. "fixed": false,
  220. "rowspan": 1,
  221. "colspan": 1,
  222. "align": "center",
  223. "tableColumnHeight": "30",
  224. "tableTextType": "text",
  225. "tableBarcodeMode": "CODE128A",
  226. "tableQRCodeLevel": 0,
  227. "tableSummaryTitle": true,
  228. "tableSummary": ""
  229. }, {
  230. "width": 125.68322499999994,
  231. "title": "课程编号",
  232. "field": "id",
  233. "checked": true,
  234. "columnId": "id",
  235. "fixed": false,
  236. "rowspan": 1,
  237. "colspan": 1,
  238. "align": "center",
  239. "tableColumnHeight": "30",
  240. "tableTextType": "text",
  241. "tableBarcodeMode": "CODE128A",
  242. "tableQRCodeLevel": 0,
  243. "tableSummaryTitle": true,
  244. "tableSummary": ""
  245. }, {
  246. "width": 212.86675000000005,
  247. "title": "课程名称",
  248. "field": "name2",
  249. "checked": true,
  250. "columnId": "name2",
  251. "fixed": false,
  252. "rowspan": 1,
  253. "colspan": 1,
  254. "align": "center",
  255. "tableColumnHeight": "30",
  256. "tableTextType": "text",
  257. "tableBarcodeMode": "CODE128A",
  258. "tableQRCodeLevel": 0,
  259. "tableSummaryTitle": true,
  260. "tableSummary": ""
  261. }, {
  262. "width": 55.02175000000007,
  263. "title": "学时",
  264. "field": "time",
  265. "checked": true,
  266. "columnId": "time",
  267. "fixed": false,
  268. "rowspan": 1,
  269. "colspan": 1,
  270. "align": "center",
  271. "tableColumnHeight": "30",
  272. "tableTextType": "text",
  273. "tableBarcodeMode": "CODE128A",
  274. "tableQRCodeLevel": 0,
  275. "tableSummaryTitle": true,
  276. "tableSummary": ""
  277. }, {
  278. "width": 54.910749999999936,
  279. "title": "学分",
  280. "field": "score",
  281. "checked": true,
  282. "columnId": "score",
  283. "fixed": false,
  284. "rowspan": 1,
  285. "colspan": 1,
  286. "align": "center",
  287. "tableColumnHeight": "30",
  288. "tableTextType": "text",
  289. "tableBarcodeMode": "CODE128A",
  290. "tableQRCodeLevel": 0,
  291. "tableSummaryTitle": true,
  292. "tableSummary": ""
  293. }, {
  294. "width": 100,
  295. "title": "开课时间",
  296. "field": "start",
  297. "checked": true,
  298. "columnId": "start",
  299. "fixed": false,
  300. "rowspan": 1,
  301. "colspan": 1,
  302. "align": "center",
  303. "tableColumnHeight": "30",
  304. "tableTextType": "text",
  305. "tableBarcodeMode": "CODE128A",
  306. "tableQRCodeLevel": 0,
  307. "tableSummaryTitle": true,
  308. "tableSummary": ""
  309. }, {
  310. "width": 100,
  311. "title": "任课老师",
  312. "field": "tName2",
  313. "checked": true,
  314. "columnId": "tName2",
  315. "fixed": false,
  316. "rowspan": 1,
  317. "colspan": 1,
  318. "align": "center",
  319. "tableColumnHeight": "30",
  320. "tableTextType": "text",
  321. "tableBarcodeMode": "CODE128A",
  322. "tableQRCodeLevel": 0,
  323. "tableSummaryTitle": true,
  324. "tableSummary": ""
  325. }, {
  326. "width": 100,
  327. "title": "考核成绩",
  328. "field": "score2",
  329. "checked": true,
  330. "columnId": "score2",
  331. "fixed": false,
  332. "rowspan": 1,
  333. "colspan": 1,
  334. "align": "center",
  335. "tableColumnHeight": "30",
  336. "tableTextType": "text",
  337. "tableBarcodeMode": "CODE128A",
  338. "tableQRCodeLevel": 0,
  339. "tableSummaryTitle": true,
  340. "tableSummary": ""
  341. }, {
  342. "width": 100,
  343. "title": "备注",
  344. "checked": true,
  345. "fixed": false,
  346. "rowspan": 1,
  347. "colspan": 1,
  348. "align": "center",
  349. "tableColumnHeight": "30",
  350. "tableTextType": "text",
  351. "tableBarcodeMode": "CODE128A",
  352. "tableQRCodeLevel": 0,
  353. "tableSummaryTitle": true,
  354. "tableSummary": ""
  355. }]]
  356. },
  357. "printElementType": {
  358. "title": "订单数据",
  359. "type": "table",
  360. "editable": true,
  361. "columnDisplayEditable": true,
  362. "columnDisplayIndexEditable": true,
  363. "columnTitleEditable": true,
  364. "columnResizable": true,
  365. "columnAlignEditable": true,
  366. "isEnableEditField": true,
  367. "isEnableContextMenu": true,
  368. "isEnableInsertRow": true,
  369. "isEnableDeleteRow": true,
  370. "isEnableInsertColumn": true,
  371. "isEnableDeleteColumn": true,
  372. "isEnableMergeCell": true
  373. }
  374. }], "paperNumberLeft": 565.5, "paperNumberTop": 814.5, "watermarkOptions": {}
  375. }]
  376. }
  377. export default {
  378. preview: preview,
  379. name: name,
  380. desc: desc,
  381. author: author,
  382. link: link,
  383. printData: printData,
  384. json: json
  385. }