test7.31.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. </head>
  7. <body>
  8. <script type="text/javascript" src="../utijs/vue.js"></script>
  9. <script type="text/javascript">
  10. var db = openDatabase('test1341', '', '测试', 2 * 1024 * 1024);
  11. var fileData = {
  12. };
  13. var fieldData = [];
  14. var treeType = 'c';
  15. var projectId='1656519060089176066';
  16. var list = [];
  17. //获取文件元数据
  18. db.transaction(function (tx) {
  19. tx.executeSql('select * from u_metadata_file where file_id = ?',
  20. [this.projectId], function (tx, results) {
  21. var len = results.rows.length, i;
  22. console.log("长度"+len);
  23. this.fileData = results.rows.item(0);
  24. console.log("结果"+this.fileData.contract_id);
  25. }, null);
  26. });
  27. //获取节点类型
  28. db.transaction(function (tx) {
  29. tx.executeSql('select atc.storage_type from u_archive_file uaf left join m_archive_tree_contract atc on uaf.node_id = atc.id where uaf.id = ?',
  30. [this.projectId], function (tx, results) {
  31. var len = results.rows.length, i;
  32. console.log("节点类型"+results.rows.item(0).storage_type);
  33. }, null);
  34. });
  35. //获取文件字段
  36. db.transaction(function (tx) {
  37. tx.executeSql('select * from u_metadata_classification',
  38. [], function (tx, results) {
  39. var len = results.rows.length, i;
  40. console.log("长度"+len);
  41. this.fieldData = results.rows;
  42. console.log("结果"+this.fieldData[0].code);
  43. //判断是否包含
  44. for (let i=0; i<fieldData.length; i++){
  45. if (fieldData[i].file_storage_type.indexOf(this.treeType) != -1){
  46. // console.log(fieldData[i].code)
  47. fieldData[i].keyValue = this.fileData[fieldData[i].field_key];
  48. // console.log(fieldData[i])
  49. var r = {
  50. title: '',
  51. value:''
  52. }
  53. r.title = fieldData[i].container_name;
  54. r.value = this.fileData[fieldData[i].field_key];
  55. if (r.title.indexOf('生成方式') != -1){
  56. if (r.value == 1){
  57. r.value = '原生';
  58. }else {
  59. r.value = '数字化';
  60. }
  61. }
  62. if (r.title.indexOf('密级') != -1){
  63. if (r.value == 1){
  64. r.value = '机密';
  65. }else if (r.value == 2){
  66. r.value = '绝密';
  67. }else {
  68. r.value = '秘密';
  69. }
  70. }
  71. this.list.push(r);
  72. }
  73. }
  74. for (let j = 0 ;j < this.list.length ; j++){
  75. console.log(list[j]);
  76. }
  77. console.log(this.list);
  78. }, null);
  79. });
  80. </script>
  81. <div id="status" name="status">状态信息</div>
  82. </body>
  83. </html>