阅行客电子档案
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.

320 lines
11 KiB

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