index.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243
  1. <template>
  2. <div class="app-container-list">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item :label="$t('文件名称')" prop="filename">
  5. <el-input
  6. v-model="queryParams.filename"
  7. :placeholder="$t('请输入') + $t('文件名称')"
  8. clearable
  9. size="small"
  10. @input="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item :label="$t('更新负责人')" prop="filename">
  14. <el-input
  15. v-model="queryParams.responsibility"
  16. :placeholder="$t('请输入') + $t('更新负责人')"
  17. clearable
  18. size="small"
  19. @input="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
  24. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
  25. </el-form-item>
  26. </el-form>
  27. <el-row :gutter="10" class="mb8">
  28. <el-col :span="1.5">
  29. <el-button
  30. type="primary"
  31. icon="el-icon-plus"
  32. size="mini"
  33. @click="handleAdd"
  34. v-hasPermi="['document:plantproglist:add']"
  35. >{{ $t('新增') }}
  36. </el-button>
  37. </el-col>
  38. <el-col :span="1.5">
  39. <el-button
  40. type="success"
  41. icon="el-icon-edit"
  42. size="mini"
  43. :disabled="single"
  44. @click="handleUpdate"
  45. v-hasPermi="['document:plantproglist:edit']"
  46. >{{ $t('修改') }}
  47. </el-button>
  48. </el-col>
  49. <el-col :span="1.5">
  50. <el-button
  51. type="danger"
  52. icon="el-icon-delete"
  53. size="mini"
  54. :disabled="multiple"
  55. @click="handleDelete"
  56. v-hasPermi="['document:plantproglist:remove']"
  57. >{{ $t('删除') }}
  58. </el-button>
  59. </el-col>
  60. <el-col :span="1.5">
  61. <el-button
  62. type="info"
  63. icon="el-icon-upload2"
  64. size="mini"
  65. @click="handleImport"
  66. v-hasPermi="['document:plantproglist:edit']"
  67. >{{ $t('导入') }}
  68. </el-button>
  69. </el-col>
  70. <!-- <el-col :span="1.5">-->
  71. <!-- <el-button-->
  72. <!-- type="warning"-->
  73. <!-- icon="el-icon-download"-->
  74. <!-- size="mini"-->
  75. <!-- @click="handleExport"-->
  76. <!-- v-hasPermi="['document:plantproglist:export']"-->
  77. <!-- >{{ $t('导出') }}</el-button>-->
  78. <!-- </el-col>-->
  79. <el-col :span="1.5">
  80. <el-button
  81. type="warning"
  82. icon="el-icon-download"
  83. size="mini"
  84. @click="handleExport"
  85. v-hasPermi="['document:plantproglist:export']"
  86. >{{ $t('导出') }}
  87. </el-button>
  88. </el-col>
  89. <el-col :span="1.5">
  90. <el-button
  91. type="primary"
  92. icon="el-icon-s-data"
  93. size="mini"
  94. @click="handleData"
  95. >{{ $t('数据分析') }}
  96. </el-button>
  97. </el-col>
  98. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  99. </el-row>
  100. <form ref="downloadExportForm" :action="downloadExportAction" target="FORMSUBMIT">
  101. </form>
  102. <el-table v-loading="loading" class="table" :data="plantproglistList" @selection-change="handleSelectionChange"
  103. @sort-change="sortList"
  104. :cell-class-name="tableCellClassName" :height="clientHeight" border>
  105. <el-table-column type="selection" width="55" align="center"/>
  106. <el-table-column :label="$t('文件编号')" align="center" prop="fileno" width="150" :show-overflow-tooltip="true"/>
  107. <el-table-column :label="$t('文件名称')" align="center" width="220" prop="filename" :show-overflow-tooltip="true"/>
  108. <el-table-column :label="$t('版次')" align="center" prop="revision" :show-overflow-tooltip="true"/>
  109. <el-table-column :label="$t('RC代码')" align="center" prop="rccode" :show-overflow-tooltip="true"/>
  110. <el-table-column :label="$t('更新负责人')" align="center" prop="responsibility" :show-overflow-tooltip="true"/>
  111. <el-table-column :label="$t('修订日期')" align="center" prop="filedate" width="100">
  112. <template slot-scope="scope">
  113. <span>{{ parseTime(scope.row.filedate, '{y}-{m}-{d}') }}</span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column :label="$t('下次修订日期')" align="center" sortable="custom" prop="nexteditdate" width="100">
  117. <template slot-scope="scope">
  118. <span v-if="scope.row.nexteditdate == null">按需</span>
  119. <span style="vertical-align:middle">{{ parseTime(scope.row.nexteditdate, '{y}-{m}-{d}') }}</span>
  120. <svg-icon :icon-class="changeColorPiont(scope.row.nexteditdate)"
  121. style="font-size: 8px"></svg-icon>
  122. </template>
  123. </el-table-column>
  124. <el-table-column :label="$t('回顾频率')" align="center" prop="reviewFrequency" :show-overflow-tooltip="true"
  125. v-if="this.itemNum !== '5'"/>
  126. <el-table-column :label="$t('回顾日期')" align="center" prop="reviewdate" width="100" v-if="this.itemNum !== '5'">
  127. <template slot-scope="scope">
  128. <span v-if="scope.row.reviewdate == null">NA</span>
  129. <span>{{ parseTime(scope.row.reviewdate, '{y}-{m}-{d}') }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column :label="$t('回顾结果')" align="center" prop="reviewResult" width="150" :show-overflow-tooltip="true"
  133. v-if="this.itemNum !== '5'"/>
  134. <el-table-column :label="$t('下次回顾日期')" align="center" sortable="custom" prop="nextreviewdate" width="100"
  135. >
  136. <template slot-scope="scope">
  137. <span style="vertical-align:middle">{{ parseTime(scope.row.nextreviewdate, '{y}-{m}-{d}') }}</span>
  138. <svg-icon :icon-class="changeColorPiont(scope.row.nextreviewdate)"
  139. style="font-size: 8px"></svg-icon>
  140. </template>
  141. </el-table-column>
  142. <el-table-column :label="$t('密级分类')" align="center" prop="classify" width="100" v-if="this.itemNum !== '5'"
  143. :formatter="classifyFormat"/>
  144. <el-table-column :label="$t('文件更新状态(控制室)')" align="center" v-if="[5,6].includes(this.itemNum)">
  145. <template slot-scope="scope">
  146. <span v-if="scope.row.revision == scope.row.versionKzs"></span>
  147. <span v-else style="color: #ff6d6d">{{ $t('未更新') }}</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column :label="$t('文件更新状态(公共盘)')" align="center" v-if="this.itemNum !== '5'">
  151. <template slot-scope="scope">
  152. <span v-if="scope.row.revision == scope.row.versionPan">{{ $t('已更新') }}</span>
  153. <span v-else style="color: #ff6d6d">{{ $t('未更新') }}</span>
  154. </template>
  155. </el-table-column>
  156. <el-table-column :label="$t('附件编号')" align="center" prop="attachmentNo" v-if="this.itemNum === '5'"
  157. :show-overflow-tooltip="true"/>
  158. <el-table-column :label="$t('附件名称')" align="center" prop="attachmentName" v-if="this.itemNum === '5'"
  159. :show-overflow-tooltip="true"/>
  160. <el-table-column :label="$t('附件版次')" align="center" prop="attachmentRevision" v-if="this.itemNum === '5'"
  161. :show-overflow-tooltip="true"/>
  162. <el-table-column :label="$t('附件修改日期')" align="center" prop="revisionDate" v-if="this.itemNum === '5'" width="100">
  163. <template slot-scope="scope">
  164. <span>{{ parseTime(scope.row.revisionDate, '{y}-{m}-{d}') }}</span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  168. <el-table-column :label="$t('操作')" align="center" fixed="right" width="190"
  169. class-name="small-padding fixed-width">
  170. <template slot-scope="scope">
  171. <el-button
  172. size="mini"
  173. type="text"
  174. icon="el-icon-edit"
  175. @click="handleUpdate(scope.row)"
  176. v-hasPermi="['document:plantproglist:edit']"
  177. >{{ $t('修改') }}
  178. </el-button>
  179. <el-button
  180. size="mini"
  181. type="text"
  182. icon="el-icon-delete"
  183. @click="handleDelete(scope.row)"
  184. v-hasPermi="['document:plantproglist:remove']"
  185. >{{ $t('删除') }}
  186. </el-button>
  187. <el-button v-if="scope.row.deptId == 103"
  188. size="mini"
  189. type="text"
  190. icon="el-icon-delete"
  191. @click="handleTraining(scope.row)"
  192. v-hasPermi="['document:plantproglist:remove']"
  193. >培训
  194. </el-button>
  195. <el-button
  196. size="mini"
  197. type="text"
  198. icon="el-icon-document"
  199. @click="handleDoc(scope.row)"
  200. v-hasPermi="['document:plantproglist:edit']"
  201. >{{ $t('报告附件') }}
  202. </el-button>
  203. </template>
  204. </el-table-column>
  205. </el-table>
  206. <pagination
  207. v-show="total>0"
  208. :total="total"
  209. :page.sync="queryParams.pageNum"
  210. :limit.sync="queryParams.pageSize"
  211. @pagination="getList"
  212. />
  213. <!-- 添加或修改装置程序清单对话框 -->
  214. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" width="1200px" append-to-body>
  215. <el-form ref="form" :model="form" :rules="rules" label-width="150px">
  216. <el-form-item :label="$t('文件编号')" prop="fileno">
  217. <el-input v-model="form.fileno" :placeholder="$t('请输入') + $t('文件编号')"/>
  218. </el-form-item>
  219. <el-form-item :label="$t('文件名称')" prop="filename">
  220. <el-input v-model="form.filename" :placeholder="$t('请输入') + $t('文件名称')" @change="changeRevisionDate"/>
  221. </el-form-item>
  222. <el-row>
  223. <el-col :span="12">
  224. <el-form-item :label="$t('版次')" prop="revision">
  225. <el-input v-model="form.revision" :placeholder="$t('请输入') + $t('版次')"/>
  226. </el-form-item>
  227. </el-col>
  228. <el-col :span="12">
  229. <el-form-item :label="$t('RC代码')" prop="rccode">
  230. <el-input v-model="form.rccode" :placeholder="$t('请输入') + $t('RC代码')"/>
  231. </el-form-item>
  232. </el-col>
  233. </el-row>
  234. <el-row>
  235. <el-col :span="12">
  236. <el-form-item :label="$t('更新负责人')" prop="responsibility">
  237. <el-input v-model="form.responsibility" :placeholder="$t('请输入') + $t('更新负责人')"/>
  238. </el-form-item>
  239. </el-col>
  240. </el-row>
  241. <el-row>
  242. <el-col :span="12">
  243. <el-form-item :label="$t('修订日期')" prop="filedate">
  244. <el-date-picker clearable size="small" style="width: 200px"
  245. v-model="form.filedate"
  246. type="date"
  247. value-format="yyyy-MM-dd"
  248. :placeholder="$t('请选择') + $t('修订日期')"
  249. @change="changeRevisionDate">
  250. </el-date-picker>
  251. </el-form-item>
  252. </el-col>
  253. <el-col :span="12">
  254. <el-form-item :label="$t('下次修订日期')" prop="nexteditdate">
  255. <el-date-picker clearable size="small" style="width: 200px"
  256. v-model="form.nexteditdate"
  257. type="date"
  258. value-format="yyyy-MM-dd"
  259. :placeholder="$t('请选择') + $t('下次修订日期')">
  260. </el-date-picker>
  261. </el-form-item>
  262. </el-col>
  263. </el-row>
  264. <el-row>
  265. <el-col :span="12">
  266. <el-form-item :label="$t('回顾频率')" prop="reviewFrequency" v-if="this.itemNum !== '5'">
  267. <el-input v-model="form.reviewFrequency" :placeholder="$t('请输入') + $t('回顾频率')" @change="getNextDate()"/>
  268. </el-form-item>
  269. </el-col>
  270. <el-col :span="12">
  271. <el-form-item :label="$t('回顾日期')" prop="reviewdate" v-if="this.itemNum !== '5'">
  272. <el-date-picker clearable size="small" style="width: 200px"
  273. v-model="form.reviewdate"
  274. type="date"
  275. value-format="yyyy-MM-dd"
  276. @change="getNextDate()"
  277. :placeholder="$t('请选择') + $t('回顾日期')">
  278. </el-date-picker>
  279. </el-form-item>
  280. </el-col>
  281. </el-row>
  282. <el-row>
  283. <el-col :span="12">
  284. <el-form-item :label="$t('回顾结果')" prop="reviewResult" v-if="this.itemNum !== '5'">
  285. <el-input v-model="form.reviewResult" :placeholder="$t('请输入') + $t('回顾结果')"/>
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="12">
  289. <el-form-item :label="$t('下次回顾日期')" prop="nextreviewdate" >
  290. <el-date-picker clearable size="small" style="width: 200px"
  291. v-model="form.nextreviewdate"
  292. type="date"
  293. value-format="yyyy-MM-dd"
  294. :placeholder="$t('请选择') + $t('下次回顾日期')">
  295. </el-date-picker>
  296. </el-form-item>
  297. </el-col>
  298. </el-row>
  299. <el-row>
  300. <el-col :span="12">
  301. <el-form-item :label="$t('密级分类')" prop="classify" v-if="this.itemNum !== '5'">
  302. <el-select v-model="form.classify" :placeholder="$t('请选择') + $t('密级分类')">
  303. <el-option
  304. v-for="dict in classifyOptions"
  305. :key="dict.dictValue"
  306. :label="dict.dictLabel"
  307. :value="dict.dictValue"
  308. ></el-option>
  309. </el-select>
  310. </el-form-item>
  311. </el-col>
  312. <el-col :span="12">
  313. <el-form-item :label="$t('公共盘文件版本')" prop="versionPan" v-if="this.itemNum !== '5'">
  314. <el-input v-model="form.versionPan" :placeholder="$t('请输入') + $t('公共盘文件版本')"/>
  315. </el-form-item>
  316. </el-col>
  317. </el-row>
  318. <el-row>
  319. <el-col :span="12">
  320. <el-form-item :label="$t('附件编号')" prop="attachmentNo" v-if="this.itemNum === '5'">
  321. <el-input v-model="form.attachmentNo" :placeholder="$t('请输入') + $t('附件编号')"/>
  322. </el-form-item>
  323. </el-col>
  324. <el-col :span="12">
  325. <el-form-item :label="$t('附件名称')" prop="attachmentName" v-if="this.itemNum === '5'">
  326. <el-input v-model="form.attachmentName" :placeholder="$t('请输入') + $t('附件名称')"/>
  327. </el-form-item>
  328. </el-col>
  329. </el-row>
  330. <el-row>
  331. <el-col :span="12">
  332. <el-form-item :label="$t('附件版次')" prop="attachmentRevision" v-if="this.itemNum === '5'">
  333. <el-input v-model="form.attachmentRevision" :placeholder="$t('请输入') + $t('附件版次')"/>
  334. </el-form-item>
  335. </el-col>
  336. <el-col :span="12">
  337. <el-form-item :label="$t('附件修改日期')" prop="revisionDate" v-if="this.itemNum === '5'">
  338. <el-date-picker clearable size="small" style="width: 200px"
  339. v-model="form.revisionDate"
  340. type="date"
  341. value-format="yyyy-MM-dd"
  342. :placeholder="$t('请选择') + $t('附件修改日期')">
  343. </el-date-picker>
  344. </el-form-item>
  345. </el-col>
  346. </el-row>
  347. <el-row>
  348. <el-col :span="12">
  349. <el-form-item :label="$t('备注')" prop="remarks">
  350. <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')"/>
  351. </el-form-item>
  352. </el-col>
  353. <el-col :span="12">
  354. <el-form-item :label="$t('归属部门')" prop="deptId">
  355. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true"
  356. :placeholder="$t('请选择') + $t('归属部门')"/>
  357. </el-form-item>
  358. </el-col>
  359. </el-row>
  360. </el-form>
  361. <div slot="footer" class="dialog-footer">
  362. <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
  363. <el-button @click="cancel">{{ $t('取 消') }}</el-button>
  364. </div>
  365. </el-dialog>
  366. <!-- 用户导入对话框 -->
  367. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  368. <el-upload
  369. ref="upload"
  370. :limit="1"
  371. accept=".xlsx, .xls"
  372. :headers="upload.headers"
  373. :action="upload.url"
  374. :disabled="upload.isUploading"
  375. :on-progress="handleFileUploadProgress"
  376. :on-success="handleFileSuccess"
  377. :auto-upload="false"
  378. drag
  379. >
  380. <i class="el-icon-upload"></i>
  381. <div class="el-upload__text">
  382. {{ $t('将文件拖到此处,或') }}
  383. <em>{{ $t('点击上传') }}</em>
  384. </div>
  385. <div class="el-upload__tip" slot="tip">
  386. <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  387. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  388. </div>
  389. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  390. <input name="type" :value="upload.type" hidden/>
  391. </form>
  392. <div class="el-upload__tip" style="color:#ff0000" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  393. </el-upload>
  394. <div slot="footer" class="dialog-footer">
  395. <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
  396. <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
  397. </div>
  398. </el-dialog>
  399. <!-- 报告附件对话框 -->
  400. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px" append-to-body>
  401. <el-upload
  402. ref="doc"
  403. :limit="500"
  404. :headers="doc.headers"
  405. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  406. :disabled="doc.isUploading"
  407. :on-progress="handleFileDocProgress"
  408. :on-success="handleFileDocSuccess"
  409. :auto-upload="true"
  410. drag
  411. >
  412. <i class="el-icon-upload"></i>
  413. <div class="el-upload__text">
  414. {{ $t('将文件拖到此处,或') }}
  415. <em>{{ $t('点击上传') }}</em>
  416. </div>
  417. </el-upload>
  418. <el-table :data="doc.commonfileList" border>
  419. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  420. <template slot-scope="scope">
  421. <a class="link-type" @click="handleDownload(scope.row)">
  422. <span>{{ scope.row.fileName }}</span>
  423. </a>
  424. </template>
  425. </el-table-column>
  426. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80"/>
  427. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  428. <el-table-column :label="$t('操作')" align="center" width="150" class-name="small-padding fixed-width">
  429. <template slot-scope="scope">
  430. <el-button
  431. v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
  432. ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
  433. ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
  434. ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
  435. ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
  436. ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
  437. size="mini"
  438. type="text"
  439. icon="el-icon-view"
  440. @click="handleSee(scope.row)"
  441. > {{ $t('预览') }}
  442. </el-button>
  443. <el-button
  444. v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
  445. size="mini"
  446. type="text"
  447. icon="el-icon-view"
  448. @click="handleSeePPT(scope.row)"
  449. > {{ $t('ppt预览') }}
  450. </el-button>
  451. <el-button
  452. size="mini"
  453. type="text"
  454. icon="el-icon-download"
  455. @click="handleDownload(scope.row)"
  456. >{{ $t('下载') }}
  457. </el-button>
  458. <el-button
  459. size="mini"
  460. type="text"
  461. icon="el-icon-delete"
  462. @click="handleDeleteDoc(scope.row)"
  463. >{{ $t('删除') }}
  464. </el-button>
  465. </template>
  466. </el-table-column>
  467. </el-table>
  468. <div slot="footer" class="dialog-footer">
  469. <!-- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
  470. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  471. </div>
  472. </el-dialog>
  473. <el-dialog :close-on-click-modal="false" v-loading="loadingFlash" element-loading-background="rgba(0,0,0,0.2)" v-dialogDrag :title="pdf.title"
  474. :visible.sync="pdf.open" width="1300px" :center="true" append-to-body>
  475. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  476. <el-button size="mini" type="text" @click="openPdf">{{ $t('新页面打开PDF') }}</el-button>
  477. </div>
  478. <div style="margin-top: -30px">
  479. <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"
  480. v-if="ppt"></iframe>
  481. </div>
  482. <div style="padding: 30px; width: 100%; height: 100%;">
  483. <el-carousel class="" ref="carousel" arrow="always" v-if="pptView"
  484. height="700px" trigger="click" :autoplay="false" indicator-position="outside">
  485. <el-carousel-item class="lun_img" v-for="item in imgs" v-bind:key="item">
  486. <img :src="item" width="100%" height="100%" object-fit="cover"/>
  487. </el-carousel-item>
  488. </el-carousel>
  489. </div>
  490. </el-dialog>
  491. <el-drawer
  492. :title="$t('数据分析')"
  493. size="600px"
  494. :visible.sync="drawer"
  495. :direction="direction">
  496. <el-row>
  497. <el-col>
  498. <el-card class="box-card" shadow="hover">
  499. <div slot="header" class="clearfix">
  500. <span>{{ $t('RC代码统计') }}</span>
  501. </div>
  502. <div class="text item">
  503. <rc-data :item=this.item v-if="sonRefresh"></rc-data>
  504. </div>
  505. </el-card>
  506. </el-col>
  507. </el-row>
  508. <el-row>
  509. <el-col>
  510. <el-card class="box-card" shadow="hover">
  511. <div slot="header" class="clearfix">
  512. <span>{{ $t('分级统计') }}</span>
  513. </div>
  514. <div class="text item">
  515. <classify-data :item=this.item v-if="sonRefresh"></classify-data>
  516. </div>
  517. </el-card>
  518. </el-col>
  519. </el-row>
  520. </el-drawer>
  521. </div>
  522. </template>
  523. <script>
  524. import {
  525. addPlantproglist,
  526. delPlantproglist,
  527. exportPlantproglist,
  528. getPlantproglist,
  529. listPlantproglist,
  530. updatePlantproglist,
  531. addProglistTraining,
  532. addProglistTrainingForce
  533. } from "@/api/document/plantproglist";
  534. import {allFileList, delCommonfile} from "@/api/common/commonfile";
  535. import {treeselect} from "@/api/system/dept";
  536. import {getToken} from "@/utils/auth";
  537. import Treeselect from "@riophae/vue-treeselect";
  538. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  539. import RcData from "./rcData";
  540. import ClassifyData from "./classifyData";
  541. import {formatDate} from "../../../utils";
  542. import dayjs from "dayjs";
  543. export default {
  544. name: "index",
  545. props: ['item', 'typename'],
  546. components: {ClassifyData, RcData, Treeselect},
  547. data() {
  548. return {
  549. imgs: [],
  550. jpgList: [],
  551. ppt: false,
  552. pptView: false,
  553. drawer: false,
  554. direction: 'rtl',
  555. sonRefresh: true,
  556. // 遮罩层
  557. loading: true,
  558. loadingFlash: false,
  559. // 选中数组
  560. ids: [],
  561. // 非单个禁用
  562. single: true,
  563. // 非多个禁用
  564. multiple: true,
  565. // 显示搜索条件
  566. showSearch: false,
  567. // 总条数
  568. total: 0,
  569. // 装置程序清单表格数据
  570. plantproglistList: [],
  571. // 弹出层标题
  572. title: "",
  573. // 部门树选项
  574. deptOptions: undefined,
  575. clientHeight: 300,
  576. // 是否显示弹出层
  577. open: false,
  578. // 分级字典
  579. classifyOptions: [],
  580. //分类
  581. itemNum: this.item,
  582. // 用户导入参数
  583. upload: {
  584. //下载模板请求地址
  585. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  586. //下载模板类型
  587. type: this.typename,
  588. // 是否显示弹出层(用户导入)
  589. open: false,
  590. // 弹出层标题(用户导入)
  591. title: "",
  592. // 是否禁用上传
  593. isUploading: false,
  594. // 是否更新已经存在的用户数据
  595. updateSupport: 0,
  596. // 设置上传的请求头部
  597. headers: {Authorization: "Bearer " + getToken()},
  598. // 上传的地址
  599. url: process.env.VUE_APP_BASE_API + "/document/plantproglist/importData"
  600. },
  601. downloadExportAction: process.env.VUE_APP_BASE_API + "/document/plantproglist/importData",
  602. // 报告附件参数
  603. doc: {
  604. file: "123",
  605. // 是否显示弹出层(报告附件)
  606. open: false,
  607. // 弹出层标题(报告附件)
  608. title: "",
  609. // 是否禁用上传
  610. isUploading: false,
  611. // 是否更新已经存在的用户数据
  612. updateSupport: 0,
  613. // 报告附件上传位置编号
  614. ids: 0,
  615. // 设置上传的请求头部
  616. headers: {Authorization: "Bearer " + getToken()},
  617. // 上传的地址
  618. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  619. commonfileList: null,
  620. queryParams: {
  621. pId: null,
  622. pType: 'plantproglist'
  623. },
  624. pType: 'plantproglist',
  625. pId: null
  626. },
  627. pdf: {
  628. title: '',
  629. pdfUrl: '',
  630. numPages: null,
  631. open: false,
  632. pageNum: 1,
  633. pageTotalNum: 1,
  634. loadedRatio: 0,
  635. },
  636. // 查询参数
  637. queryParams: {
  638. pageNum: 1,
  639. pageSize: 20,
  640. fileno: null,
  641. filename: null,
  642. revision: null,
  643. rccode: null,
  644. carrier: null,
  645. responsibility: null,
  646. filedate: null,
  647. reviewdate: null,
  648. nextreviewdate: null,
  649. nexteditdate: null,
  650. item: this.item,
  651. createrCode: null,
  652. createdate: null,
  653. updaterCode: null,
  654. updatedate: null,
  655. deptId: null,
  656. remarks: null,
  657. classify: null,
  658. reviewFrequency: null,
  659. reviewResult: null,
  660. attachmentNo: null,
  661. attachmentName: null,
  662. attachmentRevision: null,
  663. revisionDate: null,
  664. orderByColumn: null,
  665. isAsc: null,
  666. allNo: null
  667. },
  668. // 表单参数
  669. form: {},
  670. // 表单校验
  671. rules: {
  672. fileno: [
  673. {required: true, message: this.$t('文件编号') + this.$t('不能为空'), trigger: "blur"}
  674. ],
  675. filename: [
  676. {required: true, message: this.$t('文件名称') + this.$t('不能为空'), trigger: "blur"}
  677. ],
  678. revision: [
  679. {required: true, message: this.$t('版次') + this.$t('不能为空'), trigger: "blur"}
  680. ],
  681. rccode: [
  682. {required: true, message: this.$t('RC代码') + this.$t('不能为空'), trigger: "blur"}
  683. ],
  684. carrier: [
  685. {required: true, message: this.$t('载体') + this.$t('不能为空'), trigger: "blur"}
  686. ],
  687. responsibility: [
  688. {required: true, message: this.$t('更新负责人') + this.$t('不能为空'), trigger: "blur"}
  689. ],
  690. filedate: [
  691. {required: true, message: this.$t('修订日期') + this.$t('不能为空'), trigger: "blur"}
  692. ],
  693. classify: [
  694. {required: true, message: this.$t('密级分类') + this.$t('不能为空'), trigger: "change"}
  695. ],
  696. deptId: [
  697. {required: true, message: this.$t('归属部门') + this.$t('不能为空'), trigger: "blur"}
  698. ],
  699. }
  700. };
  701. },
  702. watch: {
  703. // 根据名称筛选部门树
  704. deptName(val) {
  705. this.$refs.tree.filter(val);
  706. }
  707. },
  708. created() {
  709. //设置表格高度对应屏幕高度
  710. this.$nextTick(() => {
  711. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  712. })
  713. console.log('============================')
  714. let responsibility = this.$route.query.responsibility
  715. this.queryParams.responsibility = responsibility
  716. this.getList();
  717. this.getTreeselect();
  718. this.getDicts("CLASSIFY").then(response => {
  719. this.classifyOptions = response.data;
  720. });
  721. },
  722. methods: {
  723. getNextDate() {
  724. var reviewFrequency = this.form.reviewFrequency;
  725. if (this.form.reviewdate != null && reviewFrequency != null) {
  726. var s = reviewFrequency.substring(0, reviewFrequency.indexOf("/"));
  727. if (this.form.reviewdate.endsWith("02-29")) {
  728. this.form.nextreviewdate = dayjs(new Date(this.form.reviewdate)).add(1, 'year').format("YYYY-MM-DD");
  729. } else {
  730. this.form.nextreviewdate = dayjs(new Date(this.form.reviewdate)).add(1, 'year').subtract(1, 'day').format("YYYY-MM-DD");
  731. }
  732. }
  733. },
  734. /** 查询装置程序清单列表 */
  735. getList() {
  736. this.loading = true;
  737. listPlantproglist(this.queryParams).then(response => {
  738. this.plantproglistList = response.rows;
  739. this.total = response.total;
  740. this.loading = false;
  741. });
  742. },
  743. //element表格排序
  744. sortList(val) {
  745. var sort = "asc";
  746. let sortTip = val.order
  747. this.queryParams.orderByColumn = val.prop;
  748. if (sortTip === 'descending') {
  749. this.queryParams.isAsc = 'desc' // 降序
  750. } else if (sortTip === 'ascending') {
  751. this.queryParams.isAsc = 'asc' // 升序
  752. } else if (sortTip === null) {
  753. this.queryParams.isAsc = null;
  754. this.queryParams.orderByColumn = null;
  755. }
  756. this.getList();
  757. },
  758. //根据分数显示颜色提示
  759. tableCellClassName({row, column, rowIndex, columnIndex}) {
  760. // if (columnIndex == 7 && row.item !== 5) {
  761. // return this.changeColor(row.nexteditdate)
  762. // }else if (columnIndex == 11 && row.item !== 5) {
  763. // return this.changeColor(row.nextreviewdate)
  764. // }
  765. },
  766. changeColor(value) {
  767. var timeInterval = Date.parse(value) - Date.parse(new Date());
  768. if (timeInterval <= 15 * 24 * 3600 * 1000) {
  769. return 'cellUrgent'
  770. } else if (timeInterval <= 30 * 24 * 3600 * 1000) {
  771. return 'cellCare'
  772. }
  773. },
  774. changeColorPiont(value) {
  775. var timeInterval = Date.parse(value) - Date.parse(new Date());
  776. if (timeInterval <= 15 * 24 * 3600 * 1000) {
  777. return 'roundRed'
  778. } else if (timeInterval <= 30 * 24 * 3600 * 1000) {
  779. return 'roundYellow'
  780. }
  781. return ''
  782. },
  783. /** 查询部门下拉树结构 */
  784. getTreeselect() {
  785. treeselect().then(response => {
  786. this.deptOptions = response.data;
  787. });
  788. },
  789. // 分级字典翻译
  790. classifyFormat(row, column) {
  791. return this.selectDictLabel(this.classifyOptions, row.classify);
  792. },
  793. //根据修订日期生成其他日期
  794. changeRevisionDate() {
  795. const filename = this.form.filename;
  796. var nexteditdate = "";
  797. if (filename && filename.indexOf("应急响应") !== -1) {
  798. if (this.form.filedate.endsWith("02-29")) {
  799. nexteditdate = dayjs(new Date(this.form.filedate)).add(1, 'year').format("YYYY-MM-DD");
  800. } else {
  801. nexteditdate = dayjs(new Date(this.form.filedate)).add(1, 'year').subtract(1, 'day').format("YYYY-MM-DD");
  802. }
  803. } else {
  804. if (this.form.filedate.endsWith("02-29")) {
  805. nexteditdate = dayjs(new Date(this.form.filedate)).add(3, 'year').format("YYYY-MM-DD");
  806. } else {
  807. nexteditdate = dayjs(new Date(this.form.filedate)).add(3, 'year').subtract(1, 'day').format("YYYY-MM-DD");
  808. }
  809. }
  810. var nextedit = new Date(nexteditdate);
  811. this.form.nexteditdate = formatDate(nextedit, 'yyyy-MM-dd')
  812. // var reviewdate = Date.parse(this.form.filedate) + (1 * 365 * 24 * 3600 * 1000)
  813. // var review = new Date(reviewdate);
  814. // this.form.reviewdate = formatDate(review,'yyyy-MM-dd')
  815. // var nextreviewdate = Date.parse(this.form.filedate) + (2 * 365 * 24 * 3600 * 1000)
  816. // var nextreview = new Date(nextreviewdate);
  817. // this.form.nextreviewdate = formatDate(nextreview,'yyyy-MM-dd')
  818. },
  819. // 取消按钮
  820. cancel() {
  821. this.open = false;
  822. this.reset();
  823. },
  824. // 表单重置
  825. reset() {
  826. this.form = {
  827. id: null,
  828. fileno: null,
  829. filename: null,
  830. revision: null,
  831. rccode: null,
  832. carrier: null,
  833. responsibility: null,
  834. filedate: null,
  835. reviewdate: null,
  836. nextreviewdate: null,
  837. nexteditdate: null,
  838. item: this.item,
  839. createrCode: null,
  840. createdate: null,
  841. updaterCode: null,
  842. updatedate: null,
  843. deptId: null,
  844. remarks: null,
  845. classify: null,
  846. reviewFrequency: null,
  847. reviewResult: null,
  848. versionKzs: null,
  849. versionPan: null,
  850. attachmentNo: null,
  851. attachmentName: null,
  852. attachmentRevision: null,
  853. revisionDate: null
  854. };
  855. this.resetForm("form");
  856. },
  857. /** 搜索按钮操作 */
  858. handleQuery() {
  859. this.queryParams.pageNum = 1;
  860. this.getList();
  861. },
  862. /** 重置按钮操作 */
  863. resetQuery() {
  864. this.queryParams.responsibility = null
  865. this.resetForm("queryForm");
  866. this.handleQuery();
  867. },
  868. // 多选框选中数据
  869. handleSelectionChange(selection) {
  870. this.ids = selection.map(item => item.id)
  871. this.single = selection.length !== 1
  872. this.multiple = !selection.length
  873. },
  874. /** 新增按钮操作 */
  875. handleAdd() {
  876. this.reset();
  877. this.open = true;
  878. this.title = this.$t('新增') + " " + this.$t('装置程序清单');
  879. },
  880. /** 修改按钮操作 */
  881. handleUpdate(row) {
  882. this.reset();
  883. const id = row.id || this.ids
  884. getPlantproglist(id).then(response => {
  885. console.log(response)
  886. this.form = response.data;
  887. this.open = true;
  888. this.title = this.$t('修改') + this.$t('装置程序清单');
  889. });
  890. },
  891. /** 提交按钮 */
  892. submitForm() {
  893. this.$refs["form"].validate(valid => {
  894. if (valid) {
  895. if (this.form.id != null) {
  896. updatePlantproglist(this.form).then(response => {
  897. this.msgSuccess(this.$t('修改成功'));
  898. this.open = false;
  899. this.getList();
  900. });
  901. } else {
  902. addPlantproglist(this.form).then(response => {
  903. this.msgSuccess(this.$t('新增成功'));
  904. this.open = false;
  905. this.getList();
  906. });
  907. }
  908. }
  909. });
  910. },
  911. /** 删除按钮操作 */
  912. handleDelete(row) {
  913. const ids = row.id || this.ids;
  914. this.$confirm(this.$t('是否确认删除装置程序清单编号为"') + +ids + this.$t('"的数据项?'), this.$t('警告'), {
  915. confirmButtonText: this.$t('确定'),
  916. cancelButtonText: this.$t('取消'),
  917. type: "warning"
  918. }).then(function () {
  919. return delPlantproglist(ids);
  920. }).then(() => {
  921. this.getList();
  922. this.msgSuccess(this.$t('删除成功'));
  923. })
  924. },
  925. /** 培训按钮操作 */
  926. handleTraining(row) {
  927. const ids = row.id;
  928. this.$confirm('是否确认发起装置培训', {
  929. confirmButtonText: this.$t('确定'),
  930. cancelButtonText: this.$t('取消'),
  931. type: "warning"
  932. }).then(() => {
  933. return addProglistTraining(row.id);
  934. }).then(() => {
  935. this.getList();
  936. this.msgSuccess(this.$t('操作成功'));
  937. }).catch((error) => {
  938. // 如果是用户取消操作,直接返回
  939. if (error === 'cancel') {
  940. return;
  941. }
  942. // 判断是否是"未找到培训矩阵"的错误
  943. // axios 拦截器返回的 Error 对象,错误信息在 message 中
  944. const errorMsg = error.message || error.msg || '';
  945. if (errorMsg.includes('未找到培训矩阵')) {
  946. // 弹出二次确认框
  947. this.$confirm('未找到培训矩阵,是否仍要添加到培训?', '提示', {
  948. confirmButtonText: '确定',
  949. cancelButtonText: '取消',
  950. type: 'warning'
  951. }).then(() => {
  952. // 调用强制添加接口
  953. return addProglistTrainingForce(row.id);
  954. }).then(() => {
  955. this.getList();
  956. this.msgSuccess('已添加培训跟踪(注意:未找到培训矩阵,未自动关联参培人员,请手动添加)');
  957. }).catch(() => {
  958. // 用户取消或失败,不做处理
  959. });
  960. }
  961. });
  962. },
  963. /** 导出按钮操作 */
  964. handleExport() {
  965. const queryParams = this.queryParams;
  966. this.$confirm(this.$t('是否确认导出所有装置程序清单数据项?'), this.$t('警告'), {
  967. confirmButtonText: this.$t('确定'),
  968. cancelButtonText: this.$t('取消'),
  969. type: "warning"
  970. }).then(function () {
  971. return exportPlantproglist(queryParams);
  972. }).then(response => {
  973. this.download(response.msg);
  974. })
  975. },
  976. /** 导出按钮操作 */
  977. handleExport2() {
  978. this.$nextTick(() => {
  979. this.$refs['downloadExportForm'].submit()
  980. })
  981. },
  982. /** 导入按钮操作 */
  983. handleImport() {
  984. this.upload.title = this.$t('用户导入');
  985. this.upload.open = true;
  986. },
  987. /** 下载模板操作 */
  988. importTemplate() {
  989. this.$refs['downloadFileForm'].submit()
  990. },
  991. // 文件上传中处理
  992. handleFileUploadProgress(event, file, fileList) {
  993. this.upload.isUploading = true;
  994. },
  995. // 文件上传成功处理
  996. handleFileSuccess(response, file, fileList) {
  997. this.upload.open = false;
  998. this.upload.isUploading = false;
  999. this.$refs.upload.clearFiles();
  1000. if (response.data[0] != null) {
  1001. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败') + "。", this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  1002. } else {
  1003. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  1004. }
  1005. this.getList();
  1006. },
  1007. /** 报告附件按钮操作 */
  1008. handleDoc(row) {
  1009. this.doc.id = row.id;
  1010. this.doc.title = row.filename;
  1011. this.doc.open = true;
  1012. this.doc.queryParams.pId = row.id
  1013. this.doc.pId = row.id
  1014. this.getFileList()
  1015. this.$nextTick(() => {
  1016. this.$refs.doc.clearFiles()
  1017. })
  1018. },
  1019. getFileList() {
  1020. allFileList(this.doc.queryParams).then(response => {
  1021. this.doc.commonfileList = response;
  1022. });
  1023. },
  1024. //附件上传中处理
  1025. handleFileDocProgress(event, file, fileList) {
  1026. this.doc.file = file;
  1027. this.doc.isUploading = true;
  1028. },
  1029. //附件上传成功处理
  1030. handleFileDocSuccess(response, file, fileList) {
  1031. this.doc.isUploading = false;
  1032. this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  1033. this.getFileList()
  1034. },
  1035. /** 删除按钮操作 */
  1036. handleDeleteDoc(row) {
  1037. const ids = row.id || this.ids;
  1038. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1039. confirmButtonText: this.$t('确定'),
  1040. cancelButtonText: this.$t('取消'),
  1041. type: "warning"
  1042. }).then(function () {
  1043. return delCommonfile(ids);
  1044. }).then(() => {
  1045. this.getFileList()
  1046. this.msgSuccess(this.$t('删除成功'));
  1047. })
  1048. },
  1049. // 文件下载处理
  1050. handleDownload(row) {
  1051. var name = row.fileName;
  1052. var url = row.fileUrl;
  1053. var suffix = url.substring(url.lastIndexOf("."), url.length);
  1054. console.log(url)
  1055. const a = document.createElement('a')
  1056. a.setAttribute('download', name)
  1057. a.setAttribute('target', '_blank')
  1058. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  1059. a.click()
  1060. },
  1061. // 提交上传文件
  1062. submitFileForm() {
  1063. this.$refs.upload.submit();
  1064. },
  1065. //数据分析
  1066. handleData() {
  1067. this.sonRefresh = false;
  1068. this.$nextTick(() => {
  1069. this.sonRefresh = true;
  1070. });
  1071. this.drawer = true
  1072. },
  1073. //文件预览
  1074. openPdf() {
  1075. //ppt就跳路由预览,office就直接打开文件新页面
  1076. const didi = {imgs: this.imgs}
  1077. if (this.pptView == true && this.ppt == false) {
  1078. let routeUrl = this.$router.resolve({
  1079. path: "/cpms/index.html#/pptyulan",
  1080. query: didi
  1081. });
  1082. window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
  1083. console.log(this.imgs)
  1084. } else {
  1085. window.open(this.pdf.pdfUrl)
  1086. }
  1087. },
  1088. handleSeePPT(row) {
  1089. //ppt预览
  1090. this.loadingFlash = true
  1091. this.pdf.open = true
  1092. this.pdf.title = row.fileName
  1093. this.pdf.pdfUrl = row.fileUrl
  1094. this.pptView = true
  1095. this.ppt = false
  1096. const formatDate = new FormData();
  1097. formatDate.append("filepath", row.fileUrl)
  1098. //调用文件预览api
  1099. let res = this.officeConvert.pptConvertCommon(formatDate)
  1100. //查看接受的全局方法的返回结果 console.log(res)
  1101. //利用.then方法接受Promise对象
  1102. res.then((result) => {
  1103. //关闭加载中
  1104. this.loadingFlash = false
  1105. //成功时直接给地址
  1106. this.videoList = result.data.imagePathList
  1107. //将返回的地址集合遍历添加到绑定的数组中
  1108. this.imgs = []
  1109. for (var key = 0; key < this.videoList.length; key++) {
  1110. this.imgs.push(process.env.VUE_APP_BASE_API + this.videoList[key]);
  1111. }
  1112. }).catch(result => {
  1113. //请求失败,关闭loading,pdf地址直接为为空,不显示
  1114. this.pdf.pdfUrl = ""
  1115. this.loadingFlash = false;
  1116. })
  1117. },
  1118. handleSee(row) {
  1119. //office预览
  1120. this.loadingFlash = true
  1121. this.pdf.open = true
  1122. this.pdf.title = row.fileName
  1123. this.pdf.pdfUrl = ""
  1124. this.pptView = false
  1125. this.ppt = true
  1126. //如果是PDF等直接可以打开的就不调接口,否则调用接口
  1127. if (row.fileName.endsWith('pdf')) {
  1128. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  1129. this.loadingFlash = false
  1130. } else {
  1131. const formatDate = new FormData();
  1132. formatDate.append("filepath", row.fileUrl)
  1133. //调用文件预览api
  1134. let res = this.officeConvert.officeConvertCommon(formatDate)
  1135. //查看接受的全局方法的返回结果 console.log(res)
  1136. //利用.then方法接受Promise对象
  1137. res.then((result) => {
  1138. //关闭加载中
  1139. this.loadingFlash = false
  1140. if (result.msg.includes("csv")) {
  1141. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
  1142. this.$alert(result.msg, this.$t('检查乱码'), {dangerouslyUseHTMLString: true});
  1143. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  1144. } else if (result.msg.includes("不存在")) {
  1145. //文件不存在时提示
  1146. this.pdf.pdfUrl = ""
  1147. this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
  1148. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  1149. this.pdf.open = false
  1150. } else if (result.msg.includes("不支持此格式")) {
  1151. this.pdf.pdfUrl = ""
  1152. this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
  1153. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  1154. this.pdf.open = false
  1155. } else {
  1156. //成功时直接给地址
  1157. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
  1158. }
  1159. // this.$nextTick(() => {
  1160. // const iframe = window.frames['iFrame']
  1161. // const handleLoad = () => {
  1162. // setTimeout(() => {
  1163. // const Do = (iframe.contentWindow || iframe.contentDocument)
  1164. // console.log(Do.document.getElementsByTagName('table')[0])
  1165. // Do.document.getElementsByTagName('table')[0].style.width = "100%"
  1166. // Do.document.getElementsByTagName('table')[0].setAttribute("class","table")
  1167. // }, 500)
  1168. // }
  1169. // iframe.addEventListener('load', handleLoad, true)
  1170. // })
  1171. }).catch(result => {
  1172. //请求失败,关闭loading,pdf地址直接为为空,不显示
  1173. this.pdf.pdfUrl = ""
  1174. this.loadingFlash = false;
  1175. })
  1176. }
  1177. },
  1178. }
  1179. }
  1180. </script>
  1181. <style lang="scss">
  1182. .table {
  1183. width: 100%;
  1184. max-width: 100%;
  1185. > thead,
  1186. > tbody,
  1187. > tfoot {
  1188. > tr {
  1189. > th,
  1190. > td {
  1191. vertical-align: top;
  1192. border-top: 1px solid;
  1193. }
  1194. }
  1195. }
  1196. > thead > tr > th {
  1197. vertical-align: bottom;
  1198. border-bottom: 2px solid;
  1199. }
  1200. > caption + thead,
  1201. > colgroup + thead,
  1202. > thead:first-child {
  1203. > tr:first-child {
  1204. > th,
  1205. > td {
  1206. border-top: 0;
  1207. }
  1208. }
  1209. }
  1210. > tbody + tbody {
  1211. border-top: 2px solid;
  1212. }
  1213. }
  1214. </style>