detail.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. <template>
  2. <div id="wellInfoDetail">
  3. <a-layout>
  4. <a-layout-sider>
  5. <a-anchor wrapper-class="anchor" :target-offset="50"
  6. @click.prevent="handleClickAnchor"
  7. :get-container="getContainer">
  8. <a-anchor-link v-for="(item, index) in steps"
  9. :href="item.id" :key="index" :title="item.title"/>
  10. </a-anchor>
  11. </a-layout-sider>
  12. <a-layout-content>
  13. <a-card id="jsjj" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
  14. <template #title>
  15. <div slot="title" style="width:100%" @click="cardSettings.cardSummary.expand=!cardSettings.cardSummary.expand">
  16. 井史简介
  17. </div>
  18. </template>
  19. <template #extra>
  20. <UpSquareOutlined v-if="cardSettings.cardSummary.expand" @click="cardSettings.cardSummary.expand=false"
  21. :style="cardSettings.buttonStyle"/>
  22. <DownSquareOutlined v-else @click="cardSettings.cardSummary.expand=true"
  23. :style="cardSettings.buttonStyle"/>
  24. </template>
  25. <div v-if="cardSettings.cardSummary.expand" class="info-body" style="font-size: larger;">
  26. <p>
  27. 井名<span>{{ dataModel.well_common_name }}</span>,
  28. 井别<span>{{ dataModel.well_purpose }}</span>
  29. </p>
  30. <p>
  31. 构造位置<span>{{dataModel.structure_pos}}</span>,
  32. <template v-if="dataModel.spud_date_fmt">
  33. 于<span>{{ dataModel.spud_date_fmt }}</span>开钻
  34. </template>
  35. <template v-if="dataModel.end_drilling_date_fmt">
  36. ,<span>{{ dataModel.end_drilling_date_fmt }}</span>完钻
  37. </template>
  38. <template v-if="dataModel.completion_method">
  39. ,采取<span>{{ dataModel.completion_method }}</span>方式完井。
  40. </template>
  41. </p>
  42. <p>
  43. <template v-if="dataModel.prod_horizon">
  44. 投产于<span>{{ dataModel.start_prod_date }},</span>
  45. </template>
  46. <template v-if="dataModel.prod_horizon">
  47. 生产层位<span>{{ dataModel.prod_horizon }}</span>层位。
  48. </template>
  49. <template v-if="dataModel.recent_testing_date">
  50. <span>{{ dataModel.recent_testing_date }}</span>
  51. </template>
  52. <template v-if="dataModel.recent_testing_name">
  53. 进行最近一次<span>{{ dataModel.recent_testing_name }}</span>测试。
  54. </template>
  55. <template v-if="dataModel.recent_prod_date">
  56. 最近一次产油时间<span>{{ dataModel.recent_prod_date }}</span>,
  57. </template>
  58. 油嘴<span>{{ dataModel.oil_nozzle ?? '--' }}</span>mm
  59. ,油压<span>{{ dataModel.tubing_pres ?? '--' }}</span>MPa
  60. ,套压<span>{{ dataModel.casing_pres ?? '--' }}</span>MPa
  61. ,日产液量<span>{{ dataModel.fluid_prod_daily ?? '--' }}</span>t/d
  62. ,日产油量<span>{{ dataModel.oil_prod_daily ?? '--' }}</span>t/d
  63. ,含水<span>{{ dataModel.water_cut ?? '--' }}</span>%
  64. ,动液面<span>{{ dataModel.start_pump_liq_level ?? '--' }}</span>m
  65. ,截止目前累产油<span>{{ dataModel.oil_prod_cum ?? '--' }}</span>t。
  66. </p>
  67. </div>
  68. </a-card>
  69. <a-card id="scdt" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
  70. <template #title>
  71. <div slot="title" style="width:100%" @click="cardSettings.cardChat.expand=!cardSettings.cardChat.expand">生产动态
  72. </div>
  73. </template>
  74. <template #extra>
  75. <UpSquareOutlined v-if="cardSettings.cardChat.expand" @click="cardSettings.cardChat.expand=false"
  76. :style="cardSettings.buttonStyle"/>
  77. <DownSquareOutlined v-else @click="cardSettings.cardChat.expand=true"
  78. :style="cardSettings.buttonStyle"/>
  79. </template>
  80. <div v-if="cardSettings.cardChat.expand">
  81. <ChartProdDynmics :wellId="dataModel.well_id"></ChartProdDynmics>
  82. </div>
  83. </a-card>
  84. <a-card id="jbxx" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
  85. <template #title>
  86. <div slot="title" style="width:100%"
  87. @click="cardSettings.cardBaseInfo.expand=!cardSettings.cardBaseInfo.expand">基本信息
  88. </div>
  89. </template>
  90. <template #extra>
  91. <UpSquareOutlined v-if="cardSettings.cardBaseInfo.expand" @click="cardSettings.cardBaseInfo.expand=false"
  92. :style="cardSettings.buttonStyle"/>
  93. <DownSquareOutlined v-else @click="cardSettings.cardBaseInfo.expand=true"
  94. :style="cardSettings.buttonStyle"/>
  95. </template>
  96. <div v-if="cardSettings.cardBaseInfo.expand" style="display: flex">
  97. <div style="width:70%">
  98. <a-divider type="vertical" class="info-title" style="margin-top: 0px" dashed>井身结构</a-divider>
  99. <a-descriptions bordered>
  100. <a-descriptions-item label="井名:" :labelStyle="{'width':'12%'}" :contentStyle="{'width':'21%'}">
  101. {{ dataModel.well_common_name }}
  102. </a-descriptions-item>
  103. <a-descriptions-item style="color: well_purpose" label="井别:">{{ dataModel.well_purpose }}</a-descriptions-item>
  104. <a-descriptions-item label="井型:">{{ dataModel.well_type }}</a-descriptions-item>
  105. <a-descriptions-item label="开钻日期:">{{ dataModel.spud_date_fmt }}</a-descriptions-item>
  106. <a-descriptions-item label="完钻日期:">{{ dataModel.end_drilling_date_fmt }}</a-descriptions-item>
  107. <a-descriptions-item label="设计井深:">{{
  108. dataModel.budgeted_md == null ? "" : (dataModel.budgeted_md + "m")
  109. }}
  110. </a-descriptions-item>
  111. <a-descriptions-item label="完钻层位:">{{ dataModel.completion_formation }}</a-descriptions-item>
  112. <a-descriptions-item label="完井方式:">{{ dataModel.completion_method }}</a-descriptions-item>
  113. <a-descriptions-item label="生产井段:">{{ dataModel.well_production_sections }}</a-descriptions-item>
  114. <a-descriptions-item label="造斜点:">{{
  115. dataModel.ko_azimuth == null ? "" : (dataModel.ko_azimuth + "m")
  116. }}
  117. </a-descriptions-item>
  118. <a-descriptions-item label="水平位移:">
  119. {{ dataModel.ko_horizontal_dislocation == null ? "" : (dataModel.ko_horizontal_dislocation + "m") }}
  120. </a-descriptions-item>
  121. <a-descriptions-item label="方位角:">{{
  122. dataModel.azimuth_angle == null ? "" : (dataModel.azimuth_angle + "°")
  123. }}
  124. </a-descriptions-item>
  125. <a-descriptions-item label="井位坐标经度:">{{ dataModel.well_coordinates_x }}</a-descriptions-item>
  126. <a-descriptions-item label="井位坐标纬度:">{{ dataModel.well_coordinates_y }}</a-descriptions-item>
  127. <a-descriptions-item label="x轴">{{ dataModel.geo_offset_east }}</a-descriptions-item>
  128. <a-descriptions-item label="y轴">{{ dataModel.geo_offset_nonth }}</a-descriptions-item>
  129. </a-descriptions>
  130. <a-divider type="vertical" class="info-title" dashed>井A1信息</a-divider>
  131. <a-descriptions bordered>
  132. <a-descriptions-item :labelStyle="{'width':'12%'}" :contentStyle="{'width':'21%'}" label="采油厂机构:">
  133. {{ dataModel.org_name_a1 }}
  134. </a-descriptions-item>
  135. <a-descriptions-item label="单位名称:">{{ dataModel.org_name_a2 }}</a-descriptions-item>
  136. <a-descriptions-item label="标准井名:">{{ dataModel.well_legal_name }}</a-descriptions-item>
  137. <a-descriptions-item label="地理位置描述:" :span="3">{{ dataModel.geo_description }}</a-descriptions-item>
  138. <a-descriptions-item label="构造位置描述:" :span="3">{{ dataModel.structure_pos }}</a-descriptions-item>
  139. <a-descriptions-item label="创建/更新日期:">
  140. {{ dataModel.update_date_fmt == null ? dataModel.create_date_fmt : dataModel.update_date_fmt }}
  141. </a-descriptions-item>
  142. <a-descriptions-item label="井筒生命阶段:">{{ dataModel.phase }}</a-descriptions-item>
  143. <a-descriptions-item label="通用井筒名:">{{ dataModel.wellbore_common_name }}</a-descriptions-item>
  144. <a-descriptions-item label="目的层:">{{ dataModel.target_formation }}</a-descriptions-item>
  145. <a-descriptions-item label="审定测量深度:">
  146. {{ dataModel.authorized_md }}
  147. <template v-if="dataModel.authorized_md">m</template>
  148. </a-descriptions-item>
  149. <a-descriptions-item label="审定真垂直深度:">{{ dataModel.authorized_tvd }}
  150. <template v-if="dataModel.authorized_tvd">m</template>
  151. </a-descriptions-item>
  152. <a-descriptions-item label="井底测量深度:">{{ dataModel.bh_md }}
  153. <template v-if="dataModel.bh_md">m</template>
  154. </a-descriptions-item>
  155. <a-descriptions-item label="井底位置描述信息:" :span="2">{{
  156. dataModel.geo_description_bh
  157. }}
  158. </a-descriptions-item>
  159. <a-descriptions-item label="井底真垂直深度:">{{ dataModel.bh_tvd }}
  160. <template v-if="dataModel.bh_tvd">m</template>
  161. </a-descriptions-item>
  162. <a-descriptions-item label="相对于参考面的造斜点深度:">{{ dataModel.ko_md }}
  163. <template v-if="dataModel.ko_md">m</template>
  164. </a-descriptions-item>
  165. <a-descriptions-item label="实际造斜点真垂直深度:">{{ dataModel.ko_tvd }}
  166. <template v-if="dataModel.ko_tvd">m</template>
  167. </a-descriptions-item>
  168. <a-descriptions-item label="地质单元:">{{ dataModel.project_name }}</a-descriptions-item>
  169. <a-descriptions-item label="单元类型:">{{ dataModel.project_type }}</a-descriptions-item>
  170. <a-descriptions-item label="单元等级:">{{ dataModel.project_level }}</a-descriptions-item>
  171. <a-descriptions-item label="备注:" :span="3">{{ dataModel.remarks }}</a-descriptions-item>
  172. </a-descriptions>
  173. <a-divider type="vertical" class="info-title" dashed>井盆地凹陷信息</a-divider>
  174. <a-descriptions bordered>
  175. <a-descriptions-item :labelStyle="{'width':'12%'}" :contentStyle="{'width':'21%'}" label="标准盆地:">
  176. {{ dataModel.bz_basin }}
  177. </a-descriptions-item>
  178. <a-descriptions-item label="标准地陷:">{{ dataModel.bz_depression }}</a-descriptions-item>
  179. <a-descriptions-item label="标准凹陷:">{{ dataModel.bz_depressed }}</a-descriptions-item>
  180. <a-descriptions-item label="标准构造带:">{{ dataModel.bz_structural_belt }}</a-descriptions-item>
  181. <a-descriptions-item label="标准区块:">{{ dataModel.bz_qkdy }}</a-descriptions-item>
  182. <a-descriptions-item label="标准组织机构:">{{ dataModel.bz_org_name }}</a-descriptions-item>
  183. <a-descriptions-item label="标准作业区名:">{{ dataModel.bz_dwmc }}</a-descriptions-item>
  184. </a-descriptions>
  185. </div>
  186. <div id="jsjgtp" style="flex:1;">
  187. <a-divider type="vertical" class="info-title" style="margin-top: 0px" dashed>
  188. 井身结构图片({{ dataModel.well_common_name }})</a-divider>
  189. <ChartImage ref="chartImageRef" :wellname="dataModel.well_common_name" style="margin-left: 10px"></ChartImage>
  190. <a-divider type="vertical" class="info-title" dashed>相关文档</a-divider>
  191. <div style="margin-left:10px;border:1px solid #f0f0f0;padding:5px;">
  192. <a-input-search
  193. v-model:value="fileOptions.docKey"
  194. placeholder="查找文档" allow-clear
  195. />
  196. <div class="files-type">
  197. <a-checkable-tag color="processing"
  198. :checked="fileOptions.selectBusinessType.length==0||fileOptions.selectBusinessType.length==fileOptions.businessType.length"
  199. @change="() => fileOptions.selectBusinessType=[]">全部
  200. </a-checkable-tag>
  201. <template v-for="tag in fileOptions.businessType">
  202. <a-checkable-tag color="processing"
  203. :checked="fileOptions.selectBusinessType.includes(tag)"
  204. @change="checked => onBusTypeChange(checked,tag)">{{ tag }}
  205. </a-checkable-tag>
  206. </template>
  207. </div>
  208. <div style="max-height:990px;overflow-y:scroll;padding:0px 10px;">
  209. <a-list item-layout="horizontal" :data-source="dataIndexList">
  210. <template #renderItem="{ item }">
  211. <a-list-item v-if="(item.file_name.indexOf(fileOptions.docKey)>-1||fileOptions.docKey=='')
  212. &&(fileOptions.selectBusinessType.length==0||fileOptions.selectBusinessType.includes(item.file_business_type))">
  213. <template #actions>
  214. <PlusOutlined v-if="!item.isApply" @click="onAddCart(item)" title="加入购物车"
  215. :style="{fontSize: '16px', color: '#08c'}"/>
  216. <a-button type="link" @click="downFile(item)" v-if="item.isDown" danger>下载</a-button>
  217. <filePreview :fileName="item.file_name" :filePath="item.storage_path" :title="item.well_common_name"></filePreview>
  218. </template>
  219. <a-list-item-meta
  220. :description="item.file_business_type">
  221. <template #title>
  222. {{ item.file_name }}
  223. </template>
  224. <template #avatar>
  225. <img src="~@/assets/images/file.png"/>
  226. </template>
  227. </a-list-item-meta>
  228. </a-list-item>
  229. </template>
  230. </a-list>
  231. </div>
  232. </div>
  233. </div>
  234. </div>
  235. </a-card>
  236. <a-card id="csls" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
  237. <template #title>
  238. <div slot="title" style="width:100%" @click="cardSettings.cardTest.expand=!cardSettings.cardTest.expand">测试历史
  239. </div>
  240. </template>
  241. <template #extra>
  242. <UpSquareOutlined v-if="cardSettings.cardTest.expand" @click="cardSettings.cardTest.expand=false"
  243. :style="cardSettings.buttonStyle"/>
  244. <DownSquareOutlined v-else @click="cardSettings.cardTest.expand=true"
  245. :style="cardSettings.buttonStyle"/>
  246. </template>
  247. <div v-if="cardSettings.cardTest.expand">
  248. <p v-if="testHistoryList.length>0" class="info-body">本井共实施
  249. <template v-for="it in testHistorySummary">
  250. <span>{{ it.testing_num }}</span>次{{ it.testing_name }},
  251. </template>
  252. <span>{{ lastTestHistory.testing_date }}</span>进行最近一次<span>{{ lastTestHistory.testing_name }}</span>,
  253. <span>{{ lastTestHistory.construction_description }}</span>
  254. </p>
  255. <br/>
  256. <a-table :columns="testHistoryColumns" :data-source="testHistoryList" :scroll="{ x:'100%', y: 500 }"
  257. :pagination="testHistoryPage"
  258. @change="handleTestHistoryChange" @resizeColumn="handleResizeColumn" :rowClassName = "rowClassName"
  259. bordered>
  260. </a-table>
  261. </div>
  262. </a-card>
  263. <a-card id="fxhy" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
  264. <template #title>
  265. <div slot="title" style="width:100%"
  266. @click="cardSettings.cardAnalysis.expand=!cardSettings.cardAnalysis.expand">分析化验
  267. </div>
  268. </template>
  269. <template #extra>
  270. <UpSquareOutlined v-if="cardSettings.cardAnalysis.expand" @click="cardSettings.cardAnalysis.expand=false"
  271. :style="cardSettings.buttonStyle"/>
  272. <DownSquareOutlined v-else @click="cardSettings.cardAnalysis.expand=true"
  273. :style="cardSettings.buttonStyle"/>
  274. </template>
  275. <div v-if="cardSettings.cardAnalysis.expand">
  276. <p class="info-body">
  277. <template v-for="it in analyticalAssaysSummary">
  278. {{ it.item_code }}<span>{{ it[it.item_code] }}</span>组、
  279. </template>
  280. </p>
  281. <br>
  282. <a-table :columns="analyticalAssaysColumns" :data-source="analyticalAssaysList" :scroll="{ x:'100%', y: 500 }"
  283. :pagination="analyticalAssaysPage"
  284. @change="handleAnalyticalAssaysChange" @resizeColumn="handleResizeColumn" :rowClassName = "rowClassName"
  285. bordered>
  286. </a-table>
  287. </div>
  288. </a-card>
  289. <a-card id="zyjs" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
  290. <template #title>
  291. <div slot="title" style="width:100%" @click="cardSettings.cardWork.expand=!cardSettings.cardWork.expand">
  292. 作业简史(业务过程)
  293. </div>
  294. </template>
  295. <template #extra>
  296. <UpSquareOutlined v-if="cardSettings.cardWork.expand" @click="cardSettings.cardWork.expand=false"
  297. :style="cardSettings.buttonStyle"/>
  298. <DownSquareOutlined v-else @click="cardSettings.cardWork.expand=true"
  299. :style="cardSettings.buttonStyle"/>
  300. </template>
  301. <div v-if="cardSettings.cardWork.expand">
  302. <p class="info-body" v-if="historyAssignmentList.length>0">
  303. 井实施井下作业施工<span>{{ historyAssignmentCount }}</span>次,其中:
  304. <template v-for="it in historyAssignmentSummary">
  305. {{ it.test_processes_name }}<span>{{ it.testing_num }}</span>次、
  306. </template>
  307. <span v-if="lastHistoryAssignment.test_processes_name">{{
  308. lastHistoryAssignment.start_time
  309. }}{{ lastHistoryAssignment.test_processes_name }},</span>
  310. <span>{{
  311. lastHistoryAssignment.test_processes_name
  312. }}</span><span v-if="lastHistoryAssignment.well_production_sections">井段{{
  313. lastHistoryAssignment.well_production_sections
  314. }}</span></p>
  315. <br/>
  316. <a-table :columns="historyAssignmentColumns" :data-source="historyAssignmentList" :scroll="{ x:'100%', y: 500 }"
  317. :pagination="false" @resizeColumn="handleResizeColumn" :rowClassName = "rowClassName"
  318. bordered>
  319. </a-table>
  320. </div>
  321. </a-card>
  322. <a-card id="cjjs" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
  323. <template #title>
  324. <div slot="title" style="width:100%" @click="cardSettings.cardExplain.expand=!cardSettings.cardExplain.expand">
  325. 测井解释
  326. </div>
  327. </template>
  328. <template #extra>
  329. <UpSquareOutlined v-if="cardSettings.cardExplain.expand" @click="cardSettings.cardExplain.expand=false"
  330. :style="cardSettings.buttonStyle"/>
  331. <DownSquareOutlined v-else @click="cardSettings.cardExplain.expand=true"
  332. :style="cardSettings.buttonStyle"/>
  333. </template>
  334. <div v-if="cardSettings.cardExplain.expand">
  335. <ColumnsSetting style="display: flex;justify-content: flex-end;"
  336. :table-columns="boreholeInterColumns" :checked-table-columns="checkBoreholeInterColumns"
  337. @on-check="boreholeInterColumnsCheckSub"></ColumnsSetting>
  338. <a-table :columns="checkBoreholeInterColumns" :data-source="boreholeInterList" :scroll="{ x:'1500', y: 500 }"
  339. :pagination="false" @resizeColumn="handleResizeColumn" :rowClassName = "rowClassName"
  340. bordered>
  341. </a-table>
  342. </div>
  343. </a-card>
  344. <a-card id="gisdt" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
  345. <template #title>
  346. <div slot="title" style="width:100%" @click="cardSettings.cardGIS.expand=!cardSettings.cardGIS.expand">GIS地图
  347. </div>
  348. </template>
  349. <template #extra>
  350. <UpSquareOutlined v-if="cardSettings.cardGIS.expand" @click="cardSettings.cardGIS.expand=false"
  351. :style="cardSettings.buttonStyle"/>
  352. <DownSquareOutlined v-else @click="cardSettings.cardGIS.expand=true"
  353. :style="cardSettings.buttonStyle"/>
  354. </template>
  355. <div v-if="cardSettings.cardGIS.expand">
  356. <div style="width:100%;height: 500px;margin-top:15px;">
  357. <ChartMap :datas="mapDatas"></ChartMap>
  358. </div>
  359. </div>
  360. </a-card>
  361. </a-layout-content>
  362. </a-layout>
  363. </div>
  364. </template>
  365. <script lang="ts">
  366. import {ref, defineComponent, toRefs, reactive, watch} from 'vue';
  367. import {get, postData} from "@/api/common";
  368. import {useTabsViewStore} from "@/store/modules/tabsView";
  369. import dayjs from "dayjs";
  370. import {useRoute} from "vue-router";
  371. import router from "@/router";
  372. import * as columns from './columns';
  373. import {boreholeInterColumns} from "./columns";
  374. import ChartProdDynmics from '@/components/basic/chart/chart-prod-dynamics.vue'
  375. import ChartMap from '@/components/basic/chart/chart-map.vue'
  376. import filePreview from '@/components/basic/file-preview/index.vue'
  377. import {download} from "@/utils/downloadFile";
  378. import {getPaginationTotalTitle} from "@/utils/common";
  379. import type {TableProps} from "ant-design-vue";
  380. import {message} from "ant-design-vue";
  381. import ChartImage from "@/components/basic/chart/chart-image.vue";
  382. import ColumnsSetting from "@/components/common/ColumnsSetting.vue";
  383. export default defineComponent({
  384. name: 'wellinfoDetail',
  385. components: {ChartImage, ChartProdDynmics, ChartMap, filePreview, ColumnsSetting},
  386. setup() {
  387. const tabsViewStore = useTabsViewStore();
  388. const route = useRoute();
  389. const chartImageRef = ref();
  390. const cardSettings = ref({
  391. cardHeadStyle: {fontWeight: 'bold'},
  392. buttonStyle: {fontSize: '20px', cursor: 'pointer'},
  393. cardSummary: {expand: true},
  394. cardChat: {expand: true},
  395. cardBaseInfo: {expand: true},
  396. cardExplain: {expand: true},
  397. cardFile: {expand: true},
  398. cardTest: {expand: true},
  399. cardAnalysis: {expand: true},
  400. cardWork: {expand: true},
  401. cardGIS: {expand: true}
  402. })
  403. const wellId = ref(history.state.params?.id);
  404. const checkBoreholeInterColumns: any = ref(boreholeInterColumns.value);
  405. const testHistoryPage = ref({
  406. total: 0,
  407. current: 1,
  408. pageSize: 10,
  409. showSizeChanger: true,
  410. showTotal: total => getPaginationTotalTitle(total)
  411. });
  412. const handleTestHistoryChange: TableProps['onChange'] = (
  413. pag: { pageSize: number; current: number },
  414. ) => {
  415. testHistoryPage.value.current = pag.current;
  416. testHistoryPage.value.pageSize = pag.pageSize;
  417. loadTestHistoryData();
  418. };
  419. const loadTestHistoryData=()=> {
  420. let id = history.state.params?.id ?? wellData.dataModel.well_id;
  421. get('wellInfo/getTestHistoryList', {
  422. page: testHistoryPage.value.current,
  423. rows: testHistoryPage.value.pageSize,
  424. well_id: id
  425. }).then(result => {
  426. wellData.testHistoryList = result.list;
  427. testHistoryPage.value.total = result.total;
  428. })
  429. }
  430. const analyticalAssaysPage = ref({
  431. total: 0,
  432. current: 1,
  433. pageSize: 10,
  434. showSizeChanger: true,
  435. showTotal: total => getPaginationTotalTitle(total)
  436. });
  437. const handleAnalyticalAssaysChange: TableProps['onChange'] = (
  438. pag: { pageSize: number; current: number },
  439. ) => {
  440. analyticalAssaysPage.value.current = pag.current;
  441. analyticalAssaysPage.value.pageSize = pag.pageSize;
  442. loadAnalyticalAssaysData();
  443. };
  444. const loadAnalyticalAssaysData=()=> {
  445. let id = history.state.params?.id ?? wellData.dataModel.well_id;
  446. get('wellInfo/getAnalyticalAssaysList', {
  447. page: analyticalAssaysPage.value.current,
  448. rows: analyticalAssaysPage.value.pageSize,
  449. well_id: id
  450. }).then(result => {
  451. wellData.analyticalAssaysList = rowSpan(result.list);
  452. analyticalAssaysPage.value.total = result.total;
  453. })
  454. }
  455. const fileOptions = reactive({
  456. docKey: '',
  457. businessType: [] as any[],
  458. selectBusinessType: [] as any[]
  459. })
  460. const onBusTypeChange=(checked, it) =>{
  461. if (checked) {
  462. fileOptions.selectBusinessType.push(it);
  463. } else {
  464. fileOptions.selectBusinessType.splice(fileOptions.selectBusinessType.indexOf(it), 1);
  465. }
  466. console.log(checked, it);
  467. }
  468. watch(
  469. () => cardSettings,
  470. () => {
  471. let id = history.state.params?.id ?? wellData.dataModel.well_id;
  472. postData('wellInfo/saveExpendSetting', {well_id: id, setting_json: JSON.stringify(cardSettings.value)});
  473. }, {deep: true, immediate: false}
  474. );
  475. const wellData = reactive({
  476. dataModel: {well_id: null},
  477. boreholeInterList: [],
  478. testHistoryList: [],
  479. testHistorySummary: [],
  480. lastTestHistory: {},
  481. analyticalAssaysList: [] as any[],
  482. analyticalAssaysSummary: [],
  483. historyAssignmentList: [],
  484. historyAssignmentSummary: [],
  485. lastHistoryAssignment: {},
  486. historyAssignmentCount: 0,
  487. dataIndexList: [] as any[],
  488. mapDatas: [] as any
  489. });
  490. const loadData = async (id) => {
  491. if (id == undefined) {
  492. return;
  493. }
  494. loadTestHistoryData();
  495. loadAnalyticalAssaysData();
  496. get('wellInfo/getWellInfo', {well_id: id}).then(data => {
  497. wellData.dataModel = data.dataModel;
  498. wellData.boreholeInterList = data.boreholeInterList;
  499. wellData.testHistorySummary = data.testHistorySummary;
  500. wellData.lastTestHistory = data.lastTestHistory ?? {};
  501. wellData.analyticalAssaysSummary = data.analyticalAssaysSummary;
  502. wellData.historyAssignmentList = data.historyAssignmentList;
  503. wellData.historyAssignmentSummary = data.historyAssignmentSummary;
  504. wellData.lastHistoryAssignment = data.lastHistoryAssignment ?? {};
  505. wellData.dataIndexList = checkApplyFile(data.dataIndexList);
  506. wellData.historyAssignmentCount = wellData.historyAssignmentSummary.reduce((total, it: any) => total + it.testing_num, 0);
  507. wellData.mapDatas = [{
  508. well_id: wellData.dataModel.well_id,
  509. well_common_name: data.dataModel.well_common_name,
  510. geo_description: data.dataModel.geo_description,
  511. x: data.dataModel.well_coordinates_x,
  512. y: data.dataModel.well_coordinates_y
  513. }];
  514. fileOptions.businessType = wellData.dataIndexList.map(x => x.file_business_type);
  515. fileOptions.businessType = Array.from(new Set(fileOptions.businessType));
  516. if(chartImageRef.value){
  517. chartImageRef.value.getImageUrl(data.dataModel.well_common_name);
  518. }
  519. })
  520. get('wellInfo/getExpendSetting', {wellId: id}).then(data => {
  521. if (data != null) {
  522. cardSettings.value = JSON.parse(data.setting_json);
  523. }
  524. })
  525. }
  526. const checkApplyFile=(dataIndexList: any[]) =>{
  527. let applyFileList = getStoreFiles();
  528. dataIndexList.forEach(it => {
  529. if (!it.isApply) {
  530. it.isApply = applyFileList.filter(file => file.well_common_name == it.well_common_name && file.file_name == it.file_name).length > 0;
  531. }
  532. })
  533. return dataIndexList;
  534. }
  535. const getStoreFiles=()=> {
  536. let applyFileList = new Array();
  537. let storeList = localStorage.getItem("applyFileList");
  538. if (storeList != null) {
  539. applyFileList = JSON.parse(storeList);
  540. }
  541. return applyFileList;
  542. }
  543. const rowSpan=(list: any[]) =>{
  544. for (let i = 0; i < list.length; i++) {
  545. list[i].rowSpan = getRowSpan(list[i].item_code, i + 1, list);
  546. }
  547. return list;
  548. }
  549. const getRowSpan=(itemCode, starIndex, list: any[])=> {
  550. let rowSpan = 1;
  551. for (let i = starIndex; i < list.length; i++) {
  552. if (list[i].item_code != itemCode) {
  553. break;
  554. }
  555. if (list[i].rowSpan == 0) {
  556. break;
  557. }
  558. ++rowSpan;
  559. list[i].rowSpan = 0;
  560. }
  561. return list[starIndex - 1].rowSpan == 0 ? 0 : rowSpan;
  562. }
  563. const downFile = (record: any) => {
  564. download(record.storage_path, record.file_name);
  565. };
  566. const onAddCart = (file) => {
  567. let applyFileList = new Array();
  568. let storeList = localStorage.getItem("applyFileList");
  569. if (storeList != null) {
  570. applyFileList = JSON.parse(storeList);
  571. }
  572. applyFileList.push({
  573. well_common_name: file.well_common_name,
  574. file_name: file.file_name,
  575. storage_path: file.storage_path
  576. });
  577. localStorage.setItem("applyFileList", JSON.stringify(applyFileList));
  578. file.isApply = true;
  579. message.info('成功加入购物车');
  580. }
  581. const onClose = () => {
  582. tabsViewStore.closeCurrentTab(route);
  583. router.back();
  584. };
  585. const rowClassName = (record,index) => {
  586. console.log(record);
  587. return index % 2 === 0 ? 'even' : 'odd';
  588. }
  589. //#regin 锚点
  590. const getContainer = () => {
  591. return document.querySelector(".tabs-view-content")
  592. // return document.querySelector("#wellInfoDetail")
  593. }
  594. const handleClickAnchor = (e: any, link: any) => {
  595. console.log(e)
  596. if (link.href) {
  597. const element = document.querySelector(link.href);
  598. element && element.scrollIntoView({block: 'start', behavior: 'smooth', alignToTop: 'false'});
  599. }
  600. }
  601. const steps = ref([
  602. {id: '#jsjj', title: '井史简介', content: '井史简介'},
  603. {id: '#scdt', title: '生产动态', content: '生产动态'},
  604. {id: '#jbxx', title: '基本信息', content: '基本信息'},
  605. {id: '#jsjgtp', title: '井身结构图片', content: '井身结构图片'},
  606. {id: '#csls', title: '测试历史', content: '测试历史'},
  607. {id: '#fxhy', title: '分析化验', content: '分析化验'},
  608. {id: '#zyjs', title: '作业简史(业务过程)', content: '作业简史(业务过程)'},
  609. {id: '#cjjs', title: '测井解释', content: '测井解释'},
  610. {id: '#gisdt', title: 'GIS地图', content: 'GIS地图'},
  611. ]);
  612. //#endregin
  613. // 字段展示列选择完毕
  614. const boreholeInterColumnsCheckSub = (columnsKeys: Array<string>) => {
  615. // 从原始表格定义数据中过滤出已选择的字段
  616. checkBoreholeInterColumns.value = boreholeInterColumns.value.filter((item: any) => columnsKeys.includes(item.key));
  617. }
  618. return {
  619. ...toRefs(wellData),
  620. loadData, cardSettings,
  621. onClose, ...columns, analyticalAssaysPage, handleAnalyticalAssaysChange, onAddCart, rowClassName,
  622. dayjs, wellId, fileOptions, downFile, onBusTypeChange, handleTestHistoryChange, testHistoryPage,
  623. handleResizeColumn: (w, col) => {
  624. col.width = w;
  625. },
  626. chartImageRef, boreholeInterColumns, checkBoreholeInterColumns , boreholeInterColumnsCheckSub,
  627. getContainer, handleClickAnchor, steps
  628. };
  629. },
  630. created() {
  631. const id = history.state.params?.id;
  632. if (id == undefined) {
  633. this.onClose();
  634. }
  635. this.loadData(id);
  636. }
  637. });
  638. </script>
  639. <style lang="less">
  640. #wellInfoDetail{
  641. .ant-layout-sider{
  642. background-color: white;
  643. }
  644. .anchor{
  645. margin: 0px 20px;
  646. position: fixed;
  647. top: 200px;
  648. }
  649. .even {
  650. background-color: #f2f2f2;
  651. }
  652. .odd {
  653. background-color: #ffffff;
  654. }
  655. .card-detail {
  656. width: 100%;
  657. margin-top: 10px;
  658. a {
  659. color: #1890ff;
  660. }
  661. .ant-card-head-title {
  662. font-weight: bold;
  663. color: #40a9ff;
  664. font-size: 20px;
  665. }
  666. .ant-card-head {
  667. padding: 0px 10px;
  668. height: 35px;
  669. cursor: pointer;
  670. }
  671. .ant-card-head-wrapper {
  672. height: 35px;
  673. margin-top: 5px;
  674. }
  675. .checkbox-group{
  676. width: 100%;
  677. text-align: right;
  678. padding: 5px 0px;
  679. }
  680. }
  681. .files-type {
  682. margin-top: 10px;
  683. span {
  684. color: #8e9ae1;
  685. border: 1px solid #c6ccf0;
  686. padding: 3px 5px;
  687. margin-bottom: 5px;
  688. }
  689. .ant-tag-checkable-checked, .ant-tag-checkable-checked:active {
  690. background-color: #8e9ae1;
  691. color: #ffffff;
  692. }
  693. }
  694. .info-body {
  695. line-height: 40px;
  696. span {
  697. color: #1890ff;
  698. font-weight: 600;
  699. font-size: 25px;
  700. }
  701. }
  702. .info-title {
  703. border-color: #7cb305;
  704. margin: 15px;
  705. font-weight: bold;
  706. }
  707. }
  708. </style>