阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

324 lines
11 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
7 months ago
2 years ago
  1. <template>
  2. <el-dialog class="detail-dialog" :title="detailTitle" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="archivesInfoVisible" :before-close="handleClose">
  3. <!-- <span class="dialog-right-top" />
  4. <span class="dialog-left-bottom" /> -->
  5. <div class="setting-dialog">
  6. <div class="detail-tab tab-content">
  7. <!-- tab -->
  8. <ul class="tab-nav">
  9. <li :class="{'active-tab-nav': archivesTabIndex == 0}" @click="changeActiveTab(0)">基本信息</li>
  10. <li v-if="isHasFile" :class="{'active-tab-nav': archivesTabIndex == 1}" @click="changeActiveTab(1)">原文列表</li>
  11. <li v-if="!isHasFile && isTitleType === 3" :class="{'active-tab-nav': archivesTabIndex == 5}" @click="changeActiveTab(5)">文件列表</li>
  12. <li v-if="!isHasFile && isTitleType === 2" :class="{'active-tab-nav': archivesTabIndex == 5}" @click="changeActiveTab(5)">案卷列表</li>
  13. <li :class="{'active-tab-nav': archivesTabIndex == 2}" @click="changeActiveTab(2)">元数据</li>
  14. <li v-if="isFourTest" :class="{'active-tab-nav': archivesTabIndex == 3}" @click="changeActiveTab(3)">四性检测</li>
  15. <li v-if="isFourTest && isHasFile" :class="{'active-tab-nav': archivesTabIndex == 4}" @click="changeActiveTab(4)">操作记录</li>
  16. <li v-if="isFourTest && isHasFile" :class="{'active-tab-nav': archivesTabIndex == 6}" @click="changeActiveTab(6)">标注信息</li>
  17. </ul>
  18. <!-- 基本信息 -->
  19. <div v-if="archivesTabIndex==0" class="base-info item-content">
  20. <el-row>
  21. <el-col v-for="(item,index) in filteredArray" :key="index" :span="item.isLine ? 24 : 12" class="base-info-item">
  22. <span>{{ item.fieldCnName }}</span>
  23. <p :style="{ width: ( item.editLength ? item.editLength+'px' : '' ), flex: ( !item.editLength ? 1 : '' )}">{{ item.context }}</p>
  24. </el-col>
  25. </el-row>
  26. <el-row v-for="(item,index) in archivesDetailsData" :key="index">
  27. <el-col v-if="item.fieldName === 'is_entity'" :span="24" class="base-info-item">
  28. <span>有无实体</span>
  29. <p style="flex:1">{{ item.context === 1 ? '有' : '无' }}</p>
  30. </el-col>
  31. </el-row>
  32. </div>
  33. <!-- 附件 -->
  34. <UploadFile v-if="archivesTabIndex==1" ref="uploadFile" class="item-content" :is-upload-detail="false" :selected-category="selectedCategory" :arc-id="arcId" />
  35. <!-- 元数据 -->
  36. <div v-if="archivesTabIndex==2" class="metadata-cont item-content">
  37. <pre v-highlightjs="xml_show">
  38. <code class="highlight_s">
  39. {[xml_show]}
  40. </code>
  41. </pre>
  42. </div>
  43. <FourTestInfo v-show="archivesTabIndex===3" ref="fourTestInfoRefs" />
  44. <HandleInfo v-show="archivesTabIndex===4" ref="handleInfoRefs" />
  45. <ArchivesListModule v-show="archivesTabIndex===5" ref="archivesListModuleRef" :selected-category="selectedCategory" :is-title-type="isTitleType" :is-collect="isCollect" />
  46. <MarkInfo v-show="archivesTabIndex===6" ref="markInfoRefs" :selected-category="selectedCategory" />
  47. </div>
  48. </div>
  49. </el-dialog>
  50. </template>
  51. <script>
  52. import { form } from '@crud/crud'
  53. import { FetchDetailsById, FetchArchivesMetadata } from '@/api/collect/collect'
  54. import UploadFile from '../uploadFile/index'
  55. import FourTestInfo from '../fourTestInfo/index'
  56. import HandleInfo from '../handleInfo/index'
  57. import MarkInfo from '../markInfo/index'
  58. export default {
  59. name: 'ArchivesInfo',
  60. components: { UploadFile, FourTestInfo, HandleInfo, MarkInfo },
  61. mixins: [
  62. form({})
  63. ],
  64. props: {
  65. selectedCategory: {
  66. type: Object,
  67. default: function() {
  68. return {}
  69. }
  70. },
  71. arcId: {
  72. type: String,
  73. default: function() {
  74. return ''
  75. }
  76. },
  77. isTitleType: {
  78. type: Number,
  79. default: 2
  80. },
  81. isCollect: {
  82. type: Boolean,
  83. default: true
  84. }
  85. },
  86. data() {
  87. return {
  88. detailTitle: '',
  89. isHasFile: false, // 卷内/文件才有附件
  90. isFourTest: false,
  91. isDetailsInfo: false, // 项目不显示最下面5行基本信息
  92. archivesInfoVisible: false,
  93. archivesTabIndex: 0,
  94. archivesDetailsData: [],
  95. archivesDetailsMetadata: [],
  96. xml_show: null
  97. }
  98. },
  99. computed: {
  100. filteredArray() {
  101. const lastIndex = this.archivesDetailsData.length - 1
  102. return this.archivesDetailsData
  103. .filter((item, index) => index !== lastIndex || item.fieldName !== 'is_entity')
  104. }
  105. },
  106. created() {
  107. },
  108. mounted() {
  109. },
  110. methods: {
  111. getDetial(collectLevel, rowId) {
  112. const params = {
  113. 'categoryId': this.selectedCategory.id,
  114. 'categoryLevel': collectLevel,
  115. 'id': rowId
  116. }
  117. FetchDetailsById(params).then(data => {
  118. this.archivesDetailsData = data.showFiled
  119. .filter(field => field.fieldName in data.echo)
  120. .map(field => ({
  121. editLength: field.editLength,
  122. isLine: field.isLine,
  123. fieldCnName: field.fieldCnName,
  124. fieldName: field.fieldName,
  125. context: data.echo[field.fieldName]
  126. }))
  127. })
  128. const metaDataParams = {
  129. 'categoryId': this.selectedCategory.id,
  130. 'categoryLevel': collectLevel,
  131. 'archivesId': rowId
  132. }
  133. FetchArchivesMetadata(metaDataParams).then(data => {
  134. this.archivesDetailsMetadata = data
  135. })
  136. },
  137. setXml() {
  138. const xmlstr = this.archivesDetailsMetadata
  139. this.xml_show = this.showXml(xmlstr)
  140. },
  141. changeActiveTab(index) {
  142. this.archivesTabIndex = index
  143. if (this.archivesTabIndex === 2) {
  144. this.setXml()
  145. } else if (this.archivesTabIndex === 3) {
  146. console.log(this.$refs.fourTestInfoRefs)
  147. this.$refs.fourTestInfoRefs.currentArcId = this.arcId
  148. this.$refs.fourTestInfoRefs.getFourCheckRecord(this.arcId)
  149. } else if (this.archivesTabIndex === 4) {
  150. console.log(this.$refs.handleInfoRefs)
  151. this.$refs.handleInfoRefs.currentArcId = this.arcId
  152. this.$refs.handleInfoRefs.getArchivesOperateLog(this.arcId)
  153. } else if (this.archivesTabIndex === 5) {
  154. if (this.isTitleType === 2) {
  155. this.$refs.archivesListModuleRef.detailLevel = 2
  156. } else if (this.isTitleType === 3) {
  157. this.$refs.archivesListModuleRef.detailLevel = 3
  158. } else {
  159. this.$refs.archivesListModuleRef.detailLevel = 4
  160. }
  161. this.$refs.archivesListModuleRef.parentId = this.arcId
  162. this.$refs.archivesListModuleRef.isDetail = true
  163. this.$refs.archivesListModuleRef.getViewTable()
  164. } else if (this.archivesTabIndex === 6) {
  165. console.log(this.$refs.markInfoRefs)
  166. this.$refs.markInfoRefs.archivesDetailsData = this.archivesDetailsData
  167. this.$refs.markInfoRefs.currentArcId = this.arcId
  168. this.$refs.markInfoRefs.getFileMarkList(this.arcId)
  169. }
  170. this.$nextTick(() => {
  171. if (this.$refs.uploadFile) {
  172. this.$refs.uploadFile.parentInfo = this.archivesDetailsData
  173. this.$refs.uploadFile.tableData = []
  174. this.$refs.uploadFile.getFileList()
  175. }
  176. })
  177. },
  178. // getFourCheckRecord() {
  179. // const params = {
  180. // 'archivesId': this.arcId
  181. // }
  182. // FetchFourCheckRecord(params).then(data => {
  183. // console.log(data)
  184. // if (data.content && data.content.length !== 0) {
  185. // this.$refs.fourTestInfoRefs.tableData = data.content
  186. // this.$refs.fourTestInfoRefs.page.total = data.totalElements
  187. // } else {
  188. // this.$refs.fourTestInfoRefs.tableData = []
  189. // }
  190. // })
  191. // },
  192. // 删除 - 关闭
  193. handleClose(done) {
  194. this.archivesInfoVisible = false
  195. localStorage.removeItem('collectLevelList')
  196. done()
  197. },
  198. // xml格式化
  199. showXml(str) {
  200. var that = this
  201. var text = str
  202. // 去掉多余的空格
  203. text =
  204. '\n' +
  205. text
  206. .replace(/(<\w+)(\s.*?>)/g, function($0, name, props) {
  207. return name + ' ' + props.replace(/\s+(\w+=)/g, ' $1')
  208. })
  209. .replace(/>\s*?</g, '>\n<')
  210. // 把注释编码
  211. text = text
  212. .replace(/\n/g, '\r')
  213. .replace(/<!--(.+?)-->/g, function($0, text) {
  214. var ret = '<!--' + escape(text) + '-->'
  215. return ret
  216. })
  217. .replace(/\r/g, '\n')
  218. // 调整格式
  219. var rgx = /\n(<(([^\?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(?:(\/)>)|(?:<(\/)\2>)))?)/gm
  220. var nodeStack = []
  221. var output = text.replace(rgx, function(
  222. $0,
  223. all,
  224. name,
  225. isBegin,
  226. isCloseFull1,
  227. isCloseFull2,
  228. isFull1,
  229. isFull2
  230. ) {
  231. var isClosed =
  232. isCloseFull1 === '/' ||
  233. isCloseFull2 === '/' ||
  234. isFull1 === '/' ||
  235. isFull2 === '/'
  236. var prefix = ''
  237. if (isBegin === '!') {
  238. prefix = that.getPrefix(nodeStack.length)
  239. } else {
  240. if (isBegin !== '/') {
  241. prefix = that.getPrefix(nodeStack.length)
  242. if (!isClosed) {
  243. nodeStack.push(name)
  244. }
  245. } else {
  246. nodeStack.pop()
  247. prefix = that.getPrefix(nodeStack.length)
  248. }
  249. }
  250. var ret = '\n' + prefix + all
  251. return ret
  252. })
  253. var outputText = output.substring(1)
  254. // 把注释还原并解码,调格式
  255. outputText = outputText
  256. .replace(/\n/g, '\r')
  257. .replace(/(\s*)<!--(.+?)-->/g, function($0, prefix, text) {
  258. if (prefix.charAt(0) === '\r') prefix = prefix.substring(1)
  259. text = unescape(text).replace(/\r/g, '\n')
  260. var ret =
  261. '\n' + prefix + '<!--' + text.replace(/^\s*/gm, prefix) + '-->'
  262. return ret
  263. })
  264. outputText = outputText.replace(/\s+$/g, '').replace(/\r/g, '\r\n')
  265. return outputText
  266. },
  267. getPrefix(prefixIndex) {
  268. var span = ' '
  269. var output = []
  270. for (var i = 0; i < prefixIndex; ++i) {
  271. output.push(span)
  272. }
  273. return output.join('')
  274. }
  275. }
  276. }
  277. </script>
  278. <style lang="scss" scoped>
  279. .base-info,
  280. .metadata-cont{
  281. background-color: #F6F8FC;
  282. }
  283. // 档案详情
  284. .base-info{
  285. padding: 20px 0;
  286. overflow: hidden;
  287. overflow-y: scroll;
  288. .base-info-item{
  289. display: flex;
  290. flex-direction: row;
  291. margin-bottom: 20px;
  292. color: #545B65;
  293. span{
  294. display: block;
  295. width: 120px;
  296. margin-right: 5px;
  297. text-align: right;
  298. color: #0C0E1E;
  299. }
  300. }
  301. }
  302. code.hljs {
  303. font-size: 12px;
  304. color: #0C0E1E !important;
  305. height: 530px !important;
  306. }
  307. ::v-deep .hljs-name{
  308. color: #0C0E1E !important;
  309. }
  310. .base-info .base-info-item span.el-tag{
  311. width: auto;
  312. color: #fff;
  313. }
  314. .detail-tab .tab-nav{
  315. margin: 10px 0 18px 0;
  316. }
  317. </style>