飞天云平台-国产化
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.

243 lines
8.8 KiB

6 months ago
4 days ago
6 months ago
4 days ago
6 months ago
  1. <template>
  2. <div class="app-container row-container">
  3. <div class="head-container">
  4. <div class="head-search">
  5. <!-- 搜索 -->
  6. <el-select v-model="selectFloorVal" size="small" placeholder="楼层" class="filter-item" style="width: 80px" value-key="id" @change="changeBeforeFloor">
  7. <el-option v-for="(item,index) in floorOptions" :key="index" :label="item.floorName" :value="item" />
  8. </el-select>
  9. <el-select v-model="selectRegionVal" size="small" placeholder="区域" class="filter-item" style="width: 140px" value-key="id" @change="changeBeforeRegion">
  10. <el-option v-for="(item,index) in regionOptions" :key="index" :label="item.regionName" :value="item" />
  11. </el-select>
  12. <el-input v-model="query.search" clearable size="small" placeholder="输入检索条件检索" prefix-icon="el-icon-search" style="width: 220px;" class="filter-item" @clear="crud.toQuery" @keyup.enter.native="crud.toQuery" />
  13. <rrOperation>
  14. <template v-slot:right>
  15. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery()">重置</el-button>
  16. </template>
  17. </rrOperation>
  18. </div>
  19. <crudOperation :permission="permission">
  20. <template v-slot:right>
  21. <el-button :loading="crud.downloadLoading" size="mini" @click="doExport(crud.selections)">
  22. <i class="iconfont icon-daochu" />
  23. 导出
  24. </el-button>
  25. </template>
  26. </crudOperation>
  27. </div>
  28. <div class="container-wrap">
  29. <span class="right-top-line" />
  30. <span class="left-bottom-line" />
  31. <el-table
  32. ref="table"
  33. v-loading="crud.loading"
  34. class="archives-table"
  35. :data="crud.data"
  36. style="width: 100%;"
  37. height="calc(100vh - 329px)"
  38. @selection-change="crud.selectionChangeHandler"
  39. @row-click="clickRowHandler"
  40. >
  41. <el-table-column type="selection" align="center" width="55" />
  42. <el-table-column prop="gridName" label="层位名称">
  43. <template slot-scope="scope">
  44. {{ scope.row.gridName | removeQUPrefix }}
  45. </template>
  46. </el-table-column>
  47. <el-table-column prop="gridCode" label="层位编码" />
  48. <el-table-column prop="floorName" label="所属机构" />
  49. <el-table-column prop="floorName" label="所属楼层" />
  50. <el-table-column prop="regionName" label="所属区域" />
  51. <el-table-column prop="createTime" label="操作" width="100">
  52. <template slot-scope="scope">
  53. <el-button @click="handlePosition(scope.row)">定位</el-button>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <!--分页组件-->
  58. <pagination v-if="crud.data.length!==0" />
  59. </div>
  60. <el-dialog class="positionDialog" append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleCloseDialog" :visible="positionVisible" title="层位定位">
  61. <span class="dialog-right-top" />
  62. <span class="dialog-left-bottom" />
  63. <div class="setting-dialog">
  64. <ul class="book-detail">
  65. <li><span>所属机构</span>{{ user.fonds.fondsName }}</li>
  66. <li><span>所属楼层</span>{{ positionContent.floorName }}</li>
  67. <li><span>所属区域</span>{{ positionContent.regionName }}</li>
  68. <li><span>所属书架</span>{{ positionTitle }}</li>
  69. </ul>
  70. <div class="position-content">
  71. <div class="position-left">
  72. <h5>平面图</h5>
  73. <div class="venue-preview">
  74. <div v-show="currentMarkData && currentMarkData.signPoint ">
  75. <canvas :id="`canvasPreview${currentMarkData && currentMarkData.id}`" :width="width" :height="height" />
  76. </div>
  77. <img v-if="currentMarkData && !currentMarkData.signPoint" :src="imageUrl" :onerror="defaultImg" alt="">
  78. <img v-if="!currentMarkData" :src="imageUrl" :onerror="defaultImg" alt="">
  79. </div>
  80. </div>
  81. <div class="position-right">
  82. <h5>书架图</h5>
  83. <div class="shelf-top" :style="rowStyle">
  84. <p v-for="(item,index) in reversedRackNum" :key="index" :style="{width: `calc(${'100%/' + rackNum} - 4px )`}"><span>{{ item + '架' }}</span></p>
  85. </div>
  86. <ul class="data-shelf-row" :style="rowStyle">
  87. <li
  88. v-for="(cell,i) in booShelfGrid"
  89. :key="i"
  90. :class="{ active: i === cellIndex }"
  91. class="data-shelf-cell"
  92. :style="cellStyle"
  93. >
  94. <span class="cell-name">{{ cell.gridName | removeMianBeforeRefix }}</span>
  95. </li>
  96. </ul>
  97. </div>
  98. </div>
  99. </div>
  100. </el-dialog>
  101. </div>
  102. </template>
  103. <script>
  104. import { positionCrud } from '../../visualCheck/checkManage/positionMixins/index'
  105. import { FetchLibraryFloorListAll } from '@/api/floor/index'
  106. import { FetchInitLibraryRegionList } from '@/api/area/index'
  107. import crudShelf from '@/api/shelf/index'
  108. import CRUD, { presenter, header, crud } from '@crud/crud'
  109. import crudOperation from '@crud/CRUD.operation'
  110. import rrOperation from '@crud/RR.operation'
  111. import pagination from '@crud/Pagination'
  112. // import { exportFile } from '@/utils/index'
  113. // import qs from 'qs'
  114. import { mapGetters } from 'vuex'
  115. export default {
  116. name: 'ShelfAllSearch',
  117. components: { crudOperation, rrOperation, pagination },
  118. cruds() {
  119. return CRUD({ title: '架位查询', url: 'api/bookShelf/initShelfGridSearch', crudMethod: { ...crudShelf }, sort: [], optShow: {
  120. add: false,
  121. edit: false,
  122. del: false,
  123. download: false,
  124. group: false,
  125. reset: false
  126. }})
  127. },
  128. mixins: [presenter(), header(), crud(), positionCrud],
  129. data() {
  130. return {
  131. permission: {
  132. add: ['admin', 'search:add'],
  133. edit: ['admin', 'search:edit'],
  134. del: ['admin', 'search:del']
  135. },
  136. floorOptions: [],
  137. regionOptions: [],
  138. selectFloorVal: null,
  139. selectRegionVal: null
  140. }
  141. },
  142. computed: {
  143. ...mapGetters([
  144. 'baseApi',
  145. 'user'
  146. ])
  147. },
  148. async created() {
  149. this.getLibraryFloorListAll()
  150. },
  151. methods: {
  152. // 获取楼层数据
  153. getLibraryFloorListAll() {
  154. FetchLibraryFloorListAll().then(res => {
  155. this.floorOptions = res
  156. }).catch(() => {
  157. })
  158. },
  159. getInitLibraryRegionList(val) {
  160. const params = {
  161. 'floorId': val
  162. }
  163. FetchInitLibraryRegionList(params).then(res => {
  164. this.regionOptions = res.content
  165. this.crud.toQuery()
  166. }).catch(() => {
  167. })
  168. },
  169. changeBeforeFloor(val) {
  170. if (val) {
  171. this.selectFloorVal = val
  172. this.crud.query.floorId = val.id
  173. this.selectRegionVal = null
  174. this.crud.query.regionId = null
  175. this.getInitLibraryRegionList(val.id)
  176. }
  177. },
  178. changeBeforeRegion(val) {
  179. if (val) {
  180. this.selectRegionVal = val
  181. this.crud.query.regionId = val.id
  182. this.crud.toQuery()
  183. }
  184. },
  185. resetQuery() {
  186. this.crud.query.search = ''
  187. this.selectFloorVal = null
  188. this.selectRegionVal = null
  189. this.crud.query.floorId = null
  190. this.crud.query.regionId = null
  191. this.crud.toQuery()
  192. },
  193. clickRowHandler(row) {
  194. this.$refs.table.clearSelection()
  195. this.$refs.table.toggleRowSelection(row)
  196. },
  197. doExport() {
  198. console.log('doExport', this.crud.page.total)
  199. if (this.crud.page.total > 10000) {
  200. this.handleExport('导出数据大于10000条,时间可能较长')
  201. } else {
  202. this.handleExport('此操作将导出所有数据')
  203. }
  204. },
  205. handleExport(message) {
  206. this.crud.downloadLoading = true
  207. this.$confirm(message + '<span>你是否还要继续?</span>', '提示', {
  208. confirmButtonText: '继续',
  209. cancelButtonText: '取消',
  210. type: 'warning',
  211. dangerouslyUseHTMLString: true
  212. }).then(() => {
  213. const params = {
  214. 'libcode': this.user.fonds.fondsNo,
  215. 'floorId': this.selectFloorVal.id,
  216. 'regionId': this.selectRegionVal.id,
  217. 'search': this.crud.query.search
  218. }
  219. console.log('exportFile', params)
  220. // exportFile(this.baseApi + '/api/person/downloadFaceRecognizeLog?' + qs.stringify(params, { indices: false, allowDots: true, skipNulls: false }))
  221. this.crud.downloadLoading = false
  222. }).catch(() => {
  223. console.log('取消')
  224. })
  225. }
  226. }
  227. }
  228. </script>
  229. <style lang="scss" scoped>
  230. .tag-info{
  231. p{
  232. margin-right: 20px;
  233. }
  234. }
  235. </style>