12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <!-- import element-ui CSS -->
- <link rel="stylesheet" href="../css/element-plus.css">
- <!-- import Vue before Element -->
- <script src="../utijs/vue.js"></script>
- <!-- import element-ui JavaScript -->
- <script src="../utijs/elementui.js"></script>
- <link rel="stylesheet" href="../css/query.css">
- <!-- 拖拽 -->
- <script src="../utijs/sorttable.js"></script>
- <script src="http://www.itxst.com/package/vuedraggable/vuedraggable.umd.min.js"></script>
- </head>
- <body>
- <!--编写标签-->
- <div id="app">
- <!-- 内容区域 -->
- <div class="hc-layout-box">
- <div class="main_box">
- <div class="main_nox_header">
- <span class="inner-text">
- {{projectName}}
- </span>
- </div>
- <!-- 内容区域 -->
- <div class="maininfo">
- <div class="leftbox">
- <div class="treebox tree-line">
- <el-tree class="tree-line" highlight-current :data="data" :props="defaultProps" @node-click="handleNodeClick" lazy :load="loadNode" accordion>
- <template #default="{ node, data }">
-
- <!--树组件,节点名称-->
- <div :class="node.level === 1?'level-name':''">
- <!-- <span>{{ node.label }}</span> -->
- <span v-if=" node.label && node.label.length <=12">{{ node.label }}</span>
- <el-tooltip :content=" node.label" raw-content placement="right" effect="light" v-if=" node.label && node.label.length >12">
- <span>{{ node.label|ellipsis }}</span>
- </el-tooltip>
-
- </div>
-
- </template>
- </el-tree>
- </div>
- </div>
- <div class="contentbox">
- <div class="contentbox_head">
- <div class="serachbox">
- <div style="margin-right: 10px;">
-
- <el-button type="primary" v-if="!showSearchinfo" @click="moreSearch">条件筛选<i class="el-icon-arrow-up mlft" ></i></el-button>
- <el-button type="primary" v-else @click="moreSearch">条件筛选<i class="el-icon-arrow-down mlft" ></i></el-button>
- </div>
- <el-input
- v-if="!showSearchinfo"
- placeholder="请输入内容"
- v-model="searchinput"
- @keyup.enter.native="searchByTitle()"
- clearable
- >
- <i slot="prefix" class="el-input__icon el-icon-search"></i>
- </el-input>
- <div style="margin-left:10px" v-if="!showSearchinfo">
- <el-button type="primary" @click="searchByTitle">搜索</el-button>
- </div>
-
- <div class="serachbox_info " v-if="showSearchinfo" :class="showSearchinfo?'mask':''">
- <el-alert
- title="支持模糊搜索,可选择多个搜索条件组合查询,最多可同时设置4个搜索条件"
- type="info"
- :closable="false"
- show-icon>
- </el-alert>
- <div class="form_box">
- <el-form label-position="left" label-width="80px" :model="searchform">
- <el-form-item label="保管期限">
- <el-checkbox-group v-model="checkList">
- <el-checkbox label="3" >永久</el-checkbox>
- <el-checkbox label="2" >30年</el-checkbox>
- <el-checkbox label="1" >10年</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <el-form-item label="案卷档号">
- <el-input v-model="searchform.num" clearable></el-input>
- </el-form-item>
- <el-form-item label="案卷题名">
- <el-input v-model="searchform.title" clearable></el-input>
- </el-form-item>
- <el-form-item label="日期范围">
-
- <el-date-picker
- v-model="searchform.time"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- style="width:100%"
- />
- />
- </el-form-item>
- </el-form>
- <el-divider class="mp20"></el-divider>
- <div class="form_box_btn">
- <el-button type="primary" @click="clickmoresearchinfo">搜索</el-button>
- <el-button type="primary" @click="clearInput">重置</el-button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="contentbox_table">
- <el-table
- highlight-current-row
- stripe
- @row-dblclick="handledbClick"
- :data="tableData"
- style="width: 100%;
- height: 100%;
- width: 100%;
- overflow-y: auto;
- background-color: transparent; "
- :cell-class-name="addClass"
- :cell-style="cellStyle"
- class="mytable"
- :header-cell-style="{ background: '#DAE8F3'}"
-
- >
- <el-table-column
- prop="number"
- label="档号"
- width="180">
- </el-table-column>
- <el-table-column prop="title" label="案卷题名">
- <template slot-scope="scope">
- <a @click="handlerowclick(scope.row,false)">{{scope.row.title}}</a>
- </template>
- </el-table-column>
- <el-table-column
- prop="time"
- label="保管期限">
- </el-table-column>
-
- <el-table-column
- prop="secret"
- label="密级">
- </el-table-column>
- <el-table-column
- prop="unit"
- label="立卷单位">
- </el-table-column>
- <el-table-column
- prop="startendtime"
- label="文件起止日期">
- </el-table-column>
- </el-table>
- </div>
- <div class="page_box">
- <el-pagination
- background
- layout="total,prev, pager, next"
- :total="tableTotal"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-size="15"
- >
- </el-pagination>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 排序弹窗 -->
- <!-- 卷内文件弹窗 -->
- <el-dialog
- :visible.sync="innerdialogVisible"
- width="85%"
- :before-close="handleinnerClose"
- :close-on-click-modal="false"
- >
- <div slot="title" class="dialog-title dialog-title_box" >
- <span class="title-text" style="margin-right:10px">卷内文件</span>
- <span class="title-textsmall">共
- <span class="fontoringe">{{innertableTotal}}</span>
- 份卷内文件</span>
- </div>
- <div class="contentbox" style="height: 650px;">
- <div class="contentbox_head">
- <div class="serachbox">
- <el-input
- placeholder="请输入内容"
- v-model="innerinput" clearable
- @keyup.enter.native="searchinnerByTitle()"
- v-if="!innershowSearchinfo"
- >
- <i slot="prefix" class="el-input__icon el-icon-search"></i>
- </el-input>
-
- <div style="margin-left:10px" v-if="!innershowSearchinfo">
- <el-button type="primary" @click="searchinnerByTitle">搜索</el-button>
- </div>
- </div>
- <div class="serachbox_btn">
- <el-button type="primary" @click="openrealData">元数据</el-button>
- </div>
- </div>
- <div class="contentbox_table1">
- <el-table
- highlight-current-row
- @selection-change="handleInnerSelectionChange"
- stripe
- ref="metaTableref"
- :data="innertableData"
- style="width: 100%;
- height: 100%;
- width: 100%;
- overflow-y: auto;
- background-color: transparent;
- "
- :header-cell-style="{ background: '#DAE8F3'}"
- :cell-class-name="addClass1"
- :cell-style="cellStyle"
-
-
- >
- <el-table-column
- type="selection"
- width="55">
- </el-table-column>
-
-
- <el-table-column prop="title" label="文件名称">
- <template slot-scope="scope">
- <a @click="handlerowclick(scope.row,true)">{{scope.row.title}}</a>
- </template>
- </el-table-column>
- <el-table-column
- prop="dutyUser"
- label="责任人">
- </el-table-column>
- <el-table-column
- prop="startime"
- label="创建日期">
- </el-table-column>
- </el-table>
- </div>
- <div class="page_box1" >
- <el-pagination
- background
- layout="total,prev, pager, next"
- :total="innertableTotal">
- </el-pagination>
- </div>
-
- </div>
-
-
- </el-dialog>
- <!-- 元数据弹窗 -->
- <el-dialog
- :visible.sync="openrealDataDialog"
- width="50%"
-
- :before-close="handleCloserealDataDialog">
- <div slot="title" class="dialog-title dialog-title_box" style="padding-right:10px;">
- <span class="bulefont">
- {{cheeckFileTitle}}
- <span style="color: black;"> 文件元数据信息</span>
- </span>
-
- </div>
-
- <div class="hc-csc-meta-table-data" v-loading="isrealDataLoading">
- <el-scrollbar>
- <table class="hc-csc-meta-table" border="1" >
- <template>
- <template v-for="(item,key) in metaDataTable" >
- <tr class="hc-csc-meta-table-tr hc-csc-meta-table-tr1" v-if="item.type === 2">
- <td colspan="2" class="hc-csc-meta-table-td title">{{item.title}}</td>
- </tr>
- <tr class="hc-csc-meta-table-tr" v-else>
- <td class="hc-csc-meta-table-td name">{{item.title}}</td>
- <td class="hc-csc-meta-table-td val" style="width:380px" >{{item.val}}</td>
- </tr>
- </template>
-
- </template>
-
-
-
- </table>
- </el-scrollbar>
- </div>
- </el-dialog>
- <!-- 预览pdf -->
- <el-drawer
- :visible.sync="pdfdrawer"
- direction="ttb"
- size="100%"
- :before-close="handlepdfClose">
- <div slot="title" >
- <span style="font-weight: bolder;">预览pdf</span>
- </div>
- <div class="pdfbox">
-
- <div class="pdfiframe" v-if="!isHavePdfTitle">
- <iframe :src="pdfurl" style="height: 100%;width:100%"></iframe>
- </div>
- <div class="pdfiframe1" v-else>
- <iframe :src="pdfurl" style="height: 100%;width:100%"></iframe>
- </div>
- <div class="pdftitle" v-if="!isHavePdfTitle" >
- <el-scrollbar style="height:100%">
- <table class="hc-csc-meta-table" border="1">
- <template>
- <tr class="hc-csc-meta-table-tr">
- <td class="pdftitlename">卷内文件名称</td>
-
- </tr>
- <tr class="hc-csc-meta-table-tr" style="cursor: pointer;" v-for="(item,key) in pdfTitlelist" @click="changepdf(item)" >
- <td class="hc-csc-meta-table-td name" :class="item.isselect?'is_select':''">{{item.title}}</td>
- </tr>
-
- </template>
-
-
-
- </table>
- </el-scrollbar>
- </div>
- </div>
- </el-drawer>
- </div>
- </body>
- <script>
-
- // 创建vue
- new Vue({
- // 控制的标签容器
- el: '#app',
- component:{
- draggable: window.vuedraggable
- },
- // 交互的数据
- data: function () {
- return {
- projectName:'安康至来凤国家高速公路奉节至巫山段-档案管理',
- visible: false,
- //本地文件前缀
- aliFile: '../alilib/',
- //父类id
- parentId: '0',
- //page
- currentPage:1,
- pageSize:15,
- data: [],//左边树形控件数据
- defaultProps: {
- children: 'children',
- label: 'label',
- isLeaf: function (data) {
- if (data['isLeaf']==='true') {
- return false;
- } else{
- return true
- }
- },
-
- },
- tableData: [
- {
- number: '2016-05-02',
- title: '王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎',
- time: '永久',
- secret:'机密',
- unit:'贵州路桥集团',
- startendtime:'2016-05-04~2016-05-04'
- },
- {
- number: '2016-05-02',
- title: '王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎',
- time: '永久',
- secret:'机密',
- unit:'贵州路桥集团',
- startendtime:'2016-05-04~2016-05-04'
- },
- {
- number: '2016-05-02',
- title: '王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎',
- time: '永久',
- secret:'机密',
- unit:'贵州路桥集团',
- startendtime:'2016-05-04~2016-05-04'
- },
-
- ],
- tableTotal:200,
- innertableTotal:200,
- innertableData:[
- {
- number: '2016-05-02',
- title: '王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎',
- dutyUser:'贵州路桥集团',
- startime:'2016-05-04~2016-05-04'
- },
-
- {
- id:'1',
- number: '2016-05-02',
- title: '王小虎王小虎王小虎王小虎王小虎王小虎王小虎王小虎',
- dutyUser:'贵州路桥集团',
- startime:'2016-05-04~2016-05-04'
- },
- ],
- multipleTableRef:null,//卷内文件表格
- innerinput4:'',//卷内文件输入框
- searchinput:'',
- innerinput:'',
- //选中的案卷id
- archiveId:'',
- searchform:{
- num:'',
- title:'',
- time:'',
- start_time:'',
- end_time:'',
- timelimit:''
- },
-
- innersearchform:{
- num:'',
- title:'',
- time:'',
- },
- checkList: [],
-
- formLabelAlign:{},
- showSearchinfo:false,
- innershowSearchinfo:false,
- sortdialogVisible:false,
- sort:[
- {id: "1623580501841694722",nodeName: "某某大桥1",sort: 1},
- {id: "1623580501841694722",nodeName: "某某大桥2",sort: 2},
- {id: "1623580501841694722",nodeName: "某某大桥3",sort: 3},
- ],//排序数据
- //卷内文件
- innerdialogVisible:false,
- openrealDataDialog:false,//元数据
- isrealDataLoading:false,
- cheeckFileTitle:'',
- metaDataTable:[
-
- {type: 2, title: '来源', val: ''},
- {type: 1, title: '全宗名称', val: ''},
- {type: 1, title: '立档单位名称', val: ''},
- {type: 1, title: '电子文件号', val: ''},
- {type: 2, title: '文件联', val: ''},
- {type: 1, title: '目录文件', val: ''},
- {type: 1, title: '文件件数', val: ''},
- {type: 1, title: '文件页数', val: ''},
- {type: 1, title: '元数据目录文件', val: ''},
- {type: 1, title: '验证码', val: ''},
- {type: 2, title: '内容描述', val: ''},
- {type: 1, title: '题名', val: ''},
- {type: 1, title: '关键词', val: ''},
- {type: 1, title: '摘要', val: ''},
- {type: 1, title: '生成方式', val: ''},
- {type: 1, title: '责任者', val: ''},
- {type: 1, title: '文件创建日期', val: ''},
- {type: 2, title: '组件', val: ''},
- {type: 1, title: 'IP地址', val: ''},
- {type: 1, title: '桩号', val: ''},
- {type: 1, title: '上传时间', val: ''},
- {type: 2, title: '文件标识码', val: ''},
- {type: 1, title: '文号', val: ''},
- {type: 1, title: '表单标识码', val: ''},
- {type: 2, title: '竣工图', val: ''},
- {type: 1, title: '图号', val: ''},
- {type: 1, title: '图幅', val: ''},
- {type: 1, title: '图表来源', val: ''},
- {type: 1, title: '引用变更令编号', val: ''},
- {type: 2, title: '照片文件', val: ''},
- {type: 1, title: '主题', val: ''},
- {type: 1, title: '拍摄时间', val: ''},
- {type: 1, title: '拍摄地点', val: ''},
- {type: 1, title: '摄影者', val: ''},
- {type: 1, title: '背景', val: ''},
- {type: 1, title: '分组号', val: ''},
- {type: 1, title: '组内照片编号', val: ''},
- {type: 1, title: '水平分辨率', val: ''},
- {type: 1, title: '垂直分辨率', val: ''},
- {type: 1, title: '保管期限', val: ''},
- {type: 1, title: '格式信息', val: ''},
- {type: 2, title: '电子属性', val: ''},
- {type: 1, title: '位置', val: ''},
- {type: 1, title: '计算机文件名', val: ''},
- {type: 1, title: '计算机文件大小', val: ''},
- {type: 2, title: '数字化属性', val: ''},
- {type: 1, title: '扫描分辨率', val: ''},
- {type: 1, title: '扫描色彩模式', val: ''},
- {type: 2, title: '电子签名', val: ''},
- {type: 1, title: '签名类型', val: ''},
- {type: 1, title: '签名时间', val: ''},
- {type: 1, title: '签名人', val: ''},
- {type: 1, title: '建设项目', val: ''},
- {type: 2, title: '业务事项', val: ''},
- {type: 1, title: '单位工程', val: ''},
- {type: 1, title: '分部工程', val: ''},
- {type: 1, title: '分项工程', val: ''},
- {type: 1, title: '单位工程编码', val: ''},
- {type: 1, title: '分部工程编码', val: ''},
- {type: 1, title: '分项工程编码', val: ''},
- {type: 2, title: '责任者', val: ''},
- {type: 1, title: '责任者名称', val: ''},
- {type: 1, title: '个人职位', val: ''},
- {type: 1, title: '责任者手机号', val: ''},
- {type: 2, title: '关系实体', val: ''},
- {type: 1, title: '关系标识', val: ''},
- {type: 1, title: '关系类型', val: ''},
- {type: 1, title: '关系', val: ''},
- {type: 1, title: '相关实体标识', val: ''},
- ],
- metaTableref:null,
- pdfdrawer:false,
- pdfurl:'',//pdf地址
- pdfTitlelist:[
- {id:'1',title:'文件一',url:''},
- {id:'2',title:'文件二',url:''},
- {id:'3',title:'文件三',url:''},
-
- ],
- tableCheckItem:[],//选中的案卷
- tableinnerCheckItem:[],//选中的卷内文件
- isHavePdfTitle:true,//pdf是否有右侧表格
- isselect:true,
- nowData:[],
- //元数据集合
- metadataList:[]
-
-
-
-
- }
- },
- // 方法
- methods: {
- //格式化时间
- dateFormat(fmt, date) {
- let ret;
- const opt = {
- "Y+": date.getFullYear().toString(), // 年
- "m+": (date.getMonth() + 1).toString(), // 月
- "d+": date.getDate().toString(), // 日
- "H+": date.getHours().toString(), // 时
- "M+": date.getMinutes().toString(), // 分
- "S+": date.getSeconds().toString(), // 秒
- // 有其他格式化字符需求可以继续添加,必须转化成字符串
- };
- for (let k in opt) {
- ret = new RegExp("(" + k + ")").exec(fmt);
- if (ret) {
- fmt = fmt.replace(
- ret[1],
- ret[1].length === 1 ? opt[k] : opt[k].padStart(ret[1].length, "0")
- );
- }
- }
- return fmt;
- },
- //获取项目名称
- getProjectName(){
- let that = this;
- var db = openDatabase('test1341', '1.0', '测试', 2 * 1024 * 1024);
- db.transaction(function (tx) {
- tx.executeSql('select node_name as name FROM m_archive_tree_contract WHERE parent_id=0 ',
- [], function (tx, results) {
- that.projectName = results.rows[0].name;
- }, null);
- });
- },
- //加载树
- lazyTree(parentId){
- let that = this;
- return new Promise((resolve, reject)=>{
- var db = openDatabase('test1341', '1.0', '测试', 2 * 1024 * 1024);
- db.transaction(function (tx) {
- tx.executeSql('SELECT (id||"") as "id",m1.node_name as "label",(select CASE WHEN COUNT(1)>0 THEN "true" ELSE "false" END FROM m_archive_tree_contract m2 WHERE m2.parent_id = m1.id)as isLeaf FROM m_archive_tree_contract m1 where parent_id = ? ',
- [parentId], function (tx, results) {
- var len = results.rows.length, i;
- var list=[];
- for (i = 0; i < len; i++) {
- list.push(results.rows.item(i));
- }
- resolve(list)
- }, null);
- });
-
- })
- },
-
- //树形控件懒加载
- async loadNode(node, resolve) {
- console.log(node,'树形控件懒加载');
- //懒加载获取节点
- if (node.level === 0) {
- const testData = await this.lazyTree(this.parentId)
- console.log('当前节点',testData);
- return resolve(
- await this.lazyTree( this.parentId)
- );
- // resolve([])
- }
- if (node.level > 0) {
- return resolve(
- await this.lazyTree( node.data.id)
- );
- }
- },
- //获取当前节点的档案,搜索也走此方法
- getCurrentNodeArchives(parentId,currentPage,pageSize,searchTitle,searchNum,start_time,end_time,timelimit){
- console.log("开始时间:"+start_time);
- console.log("结束时间:"+end_time);
- console.log("保管期限:"+timelimit);
- var time;
- if (timelimit == '' || timelimit == undefined){
- time = '1,2,3';
- }else {
- time = timelimit;
- }
- console.log("time:"+time);
- var title;
- if (searchTitle == '' || searchTitle == undefined){
- title = '%';
- }else {
- title = '%'+searchTitle+'%';
- }
- var num;
- if (searchNum == '' || searchNum == undefined){
- num = '%';
- }else {
- num = '%'+searchNum+'%';
- }
- if (start_time == '' || start_time == undefined) {
- let that = this;
- var db = openDatabase('test1341', '1.0', '测试', 2 * 1024 * 1024);
- db.transaction(function (tx) {
- tx.executeSql('SELECT u.id,u.file_number as number,u.name as title,case u.storage_time when 1 then "10年" when 2 then "30年" else "永久" end as time,case u.secret_level when 1 then "机密" when 2 then "绝密" else "秘密" end as secret,u.unit as unit,(strftime("%Y/%m/%d",u.start_date)||"~"||strftime("%Y/%m/%d",u.end_date)) as startendtime,u.all_file_pdf as allFilePdf FROM u_archives_auto u WHERE storage_time in ('+time+') and node_id in (select id FROM m_archive_tree_contract WHERE (ancestors like ? or id = ?)) and u.name like ? and u.file_number like ? order by u.tree_sort,u.file_number asc LIMIT ? OFFSET ?',
- ['%' + parentId + '%', parentId, title, num, pageSize, (currentPage - 1) * pageSize], function (tx, results) {
- var len = results.rows.length, i;
- var list = [];
- for (i = 0; i < len; i++) {
- list.push(results.rows.item(i));
- // console.log("一行档案:"+results.rows.item(i).id);
- }
- that.tableData = list;
- // console.log("获取当前档案"+that.tableData.length);
- }, null);
- });
- db.transaction(function (tx) {
- tx.executeSql('SELECT count(*) as count FROM u_archives_auto u WHERE storage_time in ('+time+') and node_id in (select id FROM m_archive_tree_contract WHERE (ancestors like ? or id = ?)) and u.name like ? and u.file_number like ? ',
- ['%' + parentId + '%', parentId, title, num], function (tx, results) {
- that.tableTotal = results.rows[0].count;
- // console.log("当前档案总数"+that.tableTotal);
- }, null);
- });
- }else {
- console.log("选择了开始日期:"+start_time);
- let that = this;
- var db = openDatabase('test1341', '1.0', '测试', 2 * 1024 * 1024);
- db.transaction(function (tx) {
- tx.executeSql('SELECT u.id,u.file_number as number,u.name as title,case u.storage_time when 1 then "10年" when 2 then "30年" else "永久" end as time,case u.secret_level when 1 then "机密" when 2 then "绝密" else "秘密" end as secret,u.unit as unit,(strftime("%Y/%m/%d",u.start_date)||"~"||strftime("%Y/%m/%d",u.end_date)) as startendtime,u.all_file_pdf as allFilePdf FROM u_archives_auto u WHERE storage_time in ('+time+') and ? < end_date and ? > start_date and node_id in (select id FROM m_archive_tree_contract WHERE (ancestors like ? or id = ?)) and u.name like ? and u.file_number like ? order by u.tree_sort,u.file_number asc LIMIT ? OFFSET ?',
- [start_time, end_time, '%' + parentId + '%', parentId, title, num, pageSize, (currentPage - 1) * pageSize], function (tx, results) {
- var len = results.rows.length, i;
- var list = [];
- for (i = 0; i < len; i++) {
- list.push(results.rows.item(i));
- }
- that.tableData = list;
- // console.log("获取当前档案"+that.tableData.length);
- }, null);
- });
- db.transaction(function (tx) {
- tx.executeSql('SELECT count(*) as count FROM u_archives_auto u WHERE storage_time in ('+time+') and ? < end_date and ? > start_date and node_id in (select id FROM m_archive_tree_contract WHERE (ancestors like ? or id = ?)) and u.name like ? and u.file_number like ? ',
- [start_time, end_time, '%' + parentId + '%', parentId, title, num], function (tx, results) {
- that.tableTotal = results.rows[0].count;
- // console.log("当前档案总数"+that.tableTotal);
- }, null);
- });
- }
- },
- //获取卷内文件列表
- getInnerTableData(archiveId,innerInput){
- console.log('获取卷内文件列表');
- //拼接文件名
- var title;
- if (innerInput == '' || innerInput == undefined){
- title = '%';
- }else {
- title = '%'+innerInput+'%';
- }
- console.log('拼接的文件名:'+title);
- let that = this;
- var db = openDatabase('test1341', '1.0', '测试', 2 * 1024 * 1024);
- db.transaction(function (tx) {
- tx.executeSql('select id,file_number as number,file_name as title,pdf_file_url as url,file_time as startime,duty_user as dutyUser from u_archive_file where archive_id = ? and file_name like ?',
- [archiveId,title], function (tx, results) {
- var len = results.rows.length, i;
- var list=[];
- for (i = 0; i < len; i++) {
- list.push(results.rows.item(i));
- console.log(results.rows.item(i));
- }
- that.innertableData = list;
- that.pdfTitlelist = list;
- that.innertableTotal = list.length;
- }, null);
- });
- },
- //查看元数据
- getFileMetadata(fileId){
- console.log('文件id'+fileId);
- let that = this;
- var fileData = {
- };
- var fieldData = [];
- var treeType = 'c';
- var db = openDatabase('test1341', '1.0', '测试', 2 * 1024 * 1024);
- //获取文件元数据
- db.transaction(function (tx) {
- tx.executeSql('select * from u_metadata_file where file_id = ?',
- [fileId], function (tx, results) {
- var len = results.rows.length, i;
- // console.log("长度"+len);
- fileData = results.rows.item(0);
- console.log("结果"+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 = ?',
- [fileId], function (tx, results) {
- var len = results.rows.length, i;
- treeType = results.rows.item(0).storage_type
- console.log("节点类型"+treeType);
- if (treeType == 1){
- treeType = 'a';
- }else if (treeType == 2){
- treeType = 'b';
- }else if (treeType == 3){
- treeType = 'c';
- }else if (treeType == 4){
- treeType = 'd';
- }else if (treeType == 5){
- treeType = 'e';
- }else if (treeType == 6){
- treeType = 'f';
- }else if (treeType == 7){
- treeType = 'g';
- }else if (treeType == 8){
- treeType = 'h';
- }else if (treeType == 9){
- treeType = 'i';
- }
- }, null);
- });
- //获取文件字段
- db.transaction(function (tx) {
- tx.executeSql('select * from u_metadata_classification',
- [], function (tx, results) {
- var len = results.rows.length, i;
- // console.log("长度"+len);
- fieldData = results.rows;
- console.log("结果"+fieldData[0].code);
- //判断是否包含
- for (let i=0; i<fieldData.length; i++){
- if (fieldData[i].file_storage_type.indexOf(treeType) != -1){
- // console.log(fieldData[i].code)
- fieldData[i].keyValue = fileData[fieldData[i].field_key];
- // console.log(fieldData[i])
- var r = {
- title: '',
- val:''
- }
- r.title = fieldData[i].container_name;
- r.val = fileData[fieldData[i].field_key];
- if (r.title.indexOf('生成方式') != -1){
- if (r.val == 1){
- r.val = '原生';
- }else {
- r.val = '数字化';
- }
- }
- if (r.title.indexOf('密级') != -1){
- if (r.val == 1){
- r.val = '机密';
- }else if (r.val == 2){
- r.val = '绝密';
- }else {
- r.val = '秘密';
- }
- }
- that.metadataList.push(r);
- }
- }
- // console.log("元数据结果:"+that.metadataList);
- for (let j = 0 ;j < that.metadataList.length ; j++){
- console.log(that.metadataList[j]);
- }
- that.metaDataTable=that.metadataList
- that.metadataList = []
- }, null);
- });
- },
- handleInnerSelectionChange(val){
- console.log('选中的卷内文件',val);
- if(val.length>1){
- this.$message.warning('只能选择一条数据')
- this.tableinnerCheckItem=[]
- this.$refs.metaTableref.clearSelection()
- }
- else{
- this.tableinnerCheckItem=val
- }
- },
- handleNodeClick(data){
- // this.lazyTree(data.id);
- console.log(data,'点击wbs节点');
- this.parentId = data.id;
- this.getCurrentNodeArchives(data.id,this.currentPage,this.pageSize,this.searchinput);
- },
- moreSearch(){
- this.showSearchinfo=!this.showSearchinfo
- this.searchform={}
- },
- //卷内文件更多搜索
- innermoreSearch(){
- console.log('卷内文件更多搜索');
- this.getInnerTableData(this.archiveId,this.innersearchform.title,this.innersearchform.num);
- this.innershowSearchinfo=!this.innershowSearchinfo
- this.innersearchform={}
- },
-
- //行点击事件
- handlerowclick(row,type){
- if(type){
- this.isHavePdfTitle=false
-
- console.log('查看卷内文件pdf',row);
- this.pdfdrawer=true;
- if( this.pdfTitlelist.length>0){
- // this.pdfTitlelist[0].isselect=true;
- this.pdfurl=this.aliFile+row.url
- this.pdfTitlelist.forEach((ele)=>{
- if(ele.id===row.id){
- ele.isselect=true
- }else{
- ele.isselect=false
- }
- })
- this.$forceUpdate()
-
- }
- }else{
- console.log('查看案卷pdf',row);
- this.isHavePdfTitle=true
- this.pdfdrawer=true;
- this.pdfurl=this.aliFile + row.allFilePdf;
- }
- },
-
- //为ting'ming添加样式
- addClass({row,column,rowIndex,columnIndex}){
- if( columnIndex==1){ //此判断为前两列
- return 'addColor'
- }
- },
- addClass1({row,column,rowIndex,columnIndex}){
- if( columnIndex==1){ //此判断为前两列
- return 'addColor'
- }
- },
- /* 加入小手状态 */
- cellStyle(data) {
- if (data) {
- return 'cursor:pointer;'
- }
- },
- //卷内文件
- handleinnerClose(){
- this.innerdialogVisible=false
- this.$refs.metaTableref.clearSelection()
- },
- //打开元数据
- openrealData(){
- if(this.tableinnerCheckItem.length==0){
- this.$message.warning('请先选择文件')
- }else if(this.tableinnerCheckItem.length>1){
- this.$message.warning('只能选择一条数据')
- this.tableinnerCheckItem=[]
-
- }
- else if(this.tableinnerCheckItem.length===1){
- this.openrealDataDialog=true
- this.cheeckFileTitle=this.tableinnerCheckItem[0].title
- this.getFileMetadata(this.tableinnerCheckItem[0].id)
- }
-
- },
- handleCloserealDataDialog(){
- this.openrealDataDialog=false
- this.$refs.metaTableref.clearSelection()
- },
- //预览pdf
- handlepdfClose(){
- this.pdfdrawer=false
- },
-
- handledbClick(row){
- this.innerdialogVisible=true
-
- console.log('双击');
- console.log(this.data);
- console.log(row);
- this.archiveId = row.id;
- this.getInnerTableData(row.id);
- },
- changepdf(item){
- console.log('切换查看卷内文件',item);
- this.pdfurl=this.aliFile+item.url;
- this.pdfTitlelist.forEach(element => {
- element.isselect=false
- });
-
- item.isselect=true
- this.$forceUpdate()
- },
- //分页
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`);
- },
- handleCurrentChange(val) {
- this.getCurrentNodeArchives(this.parentId,val,this.pageSize);
- },
- //更多搜索
- clickmoresearchinfo(){
- // 日期格式化
- if(Array.isArray(this.searchform.time)&&this.searchform.time.length>0){
- this.searchform.start_time = this.dateFormat("YYYY-mm-dd", this.searchform.time[0]);
- this.searchform.end_time = this.dateFormat("YYYY-mm-dd", this.searchform.time[1]);
- }else{
- this.searchform.end_time =''
- this.searchform.start_time =''
- }
- this.searchform.timelimit=this.checkList.join(',')//保管期限
- console.log( this.searchform,' this.searchform');
- this.showSearchinfo=false
- this.getCurrentNodeArchives(this.parentId,this.currentPage,this.pageSize,this.searchform.title,this.searchform.num,this.searchform.start_time,this.searchform.end_time,this.searchform.timelimit);
- this.checkList = [];
- },
- innerclickmoresearchinfo(){
- console.log(this.innersearchform,'this.innersearchform');
- // 日期格式化
- if(Array.isArray(this.innersearchform.time)&&this.innersearchform.time.length>0){
- this.innersearchform.start_time = this.dateFormat("YYYY-mm-dd", this.innersearchform.time[0]);
- this.innersearchform.end_time = this.dateFormat("YYYY-mm-dd", this.innersearchform.time[1]);
- }else{
- this.innersearchform.end_time =''
- this.innersearchform.start_time =''
- }
- this.innershowSearchinfo=false
-
- },
- //回车搜索
- searchByTitle(e){
- console.log(this.searchinput,'this.searchinput');
- console.log(this.parentId,'parentId');
- this.getCurrentNodeArchives(this.parentId,this.currentPage,this.pageSize,this.searchinput);
- },
- //卷内文件回车
- searchinnerByTitle(e){
- console.log(this.innerinput,'this.innerinput4');
- this.getInnerTableData(this.archiveId,this.innerinput);
- },
- //下载案卷
- downLoad(){
- console.log(this.tableCheckItem,'选中的文件');
- console.log('下载卷内文件');
- },
- //删除案卷、
- delTabledata(){
- console.log(this.tableCheckItem,'选中的文件');
- if(this.tableCheckItem.length<1){
- this.$message({
- message: '请选择你要删除的文件',
- type: 'warning'
- });
- }else{
- this.$confirm('是否确认删除?', '删除案卷', {
- distinguishCancelAndClose: true,
- confirmButtonText: '删除',
- cancelButtonText: '取消'
- }).then(() => {
- console.log('删除案卷');
- })
- }
-
-
- },
- //重置搜索输入值
- clearInput(){
- this.searchform={}
-
- },
- clearInnerInput(){
- this.innersearchform={}
- this.checkList=[]
- }
- },
- mounted(){
- // this.lazyTree(this.parentId);
- this.getProjectName();
- this.getCurrentNodeArchives(this.parentId,this.currentPage,this.pageSize,this.searchinput,this.searchform.title);
- },
- filters:{
- ellipsis(value) {
- if (!value) return "";
- if (value.length > 12) {
- return value.slice(0, 12) + "...";
- }
- return value;
- },
-
- },
- })
- </script>
- <style scoped>
- /* //高亮字体颜色 */
- .treebox .el-tree-node.is-current > .el-tree-node__content {
- background-color: #e6f2ff!important;
- color: #409eff;
- }
- .addColor{
- color: #409eff !important;
-
- }
- /* 树形控件样式 */
- .level-name{
- font-weight: bold;
- font-size: 16px;
- }
- .treebox .el-tree-node{
- background: #f1f5f8;
- }
- .treebox .el-tree-node__content{
- padding-left: 5px !important;
- background: #f1f5f8;
-
- }
- .treebox{
- width: 340px;
-
- height: 100%;
- overflow-y: auto;
- overflow-x:clip;
-
- }
- .treebox .el-tree{
- display: inline-block;
- /* min-width: 100%; */
- }
- .tree-line .el-tree-node{
- position: relative;
- padding-left: 16px !important;
- }
- .tree-line .el-tree__empty-block{
- background-color: #f1f5f8;
- min-height:calc(100vh - 170px);
- width: 340px;
- }
- .tree-line .el-tree-node__label {
- font-size: 14px;
- }
- .tree-line .el-tree-node__children {
- padding-left: 20px !important;
- }
-
- .tree-line .el-tree-node::before {
- content: '';
- height: 100%;
- width: 2px;
- position: absolute;
- left: -3px;
- top: -26px;
- border-width: 2px;
- border-left: 2px dashed #0081ff;
- }
- .tree-line .el-tree-node:last-child::before {
- height: 38px;
- }
- .tree-line .el-tree-node::after {
- content: '';
- width: 24px;
- height: 20px;
- position: absolute;
- left: -3px;
- top: 12px;
- border-width: 2px;
- border-top: 2px dashed #0081ff;
- }
- .tree-line > .el-tree-node::after {
- border-top: none;
- }
- .tree-line > .el-tree-node::before {
- border-left: none;
- }
- .tree-line .el-tree-node__expand-icon{
- font-size: 16px;
- }
- .tree-line .el-tree-node__expand-icon.is-leaf {
- color: transparent;
- cursor: default;
- display: none;
-
- }
-
- .is_select{
- color:#0081ff;
- background-color:#ecf5ff;
- }
-
- .contentbox_table .el-table tr{
- background-color: #F1F5F8;
- }
- .contentbox_table .el-table tr .el-table__row--striped{
- background-color:#DAE8F3;
- }
- .contentbox_table1 .el-table tr{
- background-color: #F1F5F8;
- }
- .contentbox_table1 .el-table tr .el-table__row--striped{
- background-color:#DAE8F3;
- }
- </style>
- </html>
|