123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Title</title>
- </head>
- <body>
- <script type="text/javascript" src="../utijs/vue.js"></script>
- <script type="text/javascript">
- var db = openDatabase('test1341', '', '测试', 2 * 1024 * 1024);
- var fileData = {
- };
- var fieldData = [];
- var treeType = 'c';
- var projectId='1656519060089176066';
- var list = [];
- //获取文件元数据
- db.transaction(function (tx) {
- tx.executeSql('select * from u_metadata_file where file_id = ?',
- [this.projectId], function (tx, results) {
- var len = results.rows.length, i;
- console.log("长度"+len);
- this.fileData = results.rows.item(0);
- console.log("结果"+this.fileData.contract_id);
- }, null);
- });
- //获取节点类型
- db.transaction(function (tx) {
- 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 = ?',
- [this.projectId], function (tx, results) {
- var len = results.rows.length, i;
- console.log("节点类型"+results.rows.item(0).storage_type);
- }, null);
- });
- //获取文件字段
- db.transaction(function (tx) {
- tx.executeSql('select * from u_metadata_classification',
- [], function (tx, results) {
- var len = results.rows.length, i;
- console.log("长度"+len);
- this.fieldData = results.rows;
- console.log("结果"+this.fieldData[0].code);
- //判断是否包含
- for (let i=0; i<fieldData.length; i++){
- if (fieldData[i].file_storage_type.indexOf(this.treeType) != -1){
- // console.log(fieldData[i].code)
- fieldData[i].keyValue = this.fileData[fieldData[i].field_key];
- // console.log(fieldData[i])
- var r = {
- title: '',
- value:''
- }
- r.title = fieldData[i].container_name;
- r.value = this.fileData[fieldData[i].field_key];
- if (r.title.indexOf('生成方式') != -1){
- if (r.value == 1){
- r.value = '原生';
- }else {
- r.value = '数字化';
- }
- }
- if (r.title.indexOf('密级') != -1){
- if (r.value == 1){
- r.value = '机密';
- }else if (r.value == 2){
- r.value = '绝密';
- }else {
- r.value = '秘密';
- }
- }
- this.list.push(r);
- }
- }
- for (let j = 0 ;j < this.list.length ; j++){
- console.log(list[j]);
- }
- console.log(this.list);
- }, null);
- });
- </script>
- <div id="status" name="status">状态信息</div>
- </body>
- </html>
|