index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. <template>
  2. <div class="query-index">
  3. <div class="query-index-tree" v-if="showTree">
  4. <div class="query-index-tree-search">
  5. <a-tabs v-model:activeKey="activeTab" @change="tabChange" style="width:97%;">
  6. <a-tab-pane key="1" tab="组织架构目录">
  7. </a-tab-pane>
  8. <a-tab-pane key="2" tab="地质单元目录" forceRender="true">
  9. </a-tab-pane>
  10. </a-tabs>
  11. <DoubleLeftOutlined @click="showTree=false"/>
  12. </div>
  13. <div style="margin-top: -15px">
  14. <a-input-search
  15. v-model:value="subjectTrees.searchStr"
  16. placeholder="查找目录..." allow-clear
  17. @search="searchTree"
  18. />
  19. </div>
  20. <div class="query-index-tree-box">
  21. <a-tree
  22. :show-line="true" blockNode="true"
  23. :tree-data="subjectTrees.data"
  24. v-model:expandedKeys="subjectTrees.expandedKeys"
  25. v-model:selectedKeys="subjectTrees.selectedKeys"
  26. :replace-fields="replaceFields"
  27. :autoExpandParent="subjectTrees.autoExpandParent"
  28. @expand="treeOnExpand" @select="treeOnSelect">
  29. <template #switcherIcon="{ switcherCls }"><caret-down-outlined style="font-size:20px;" :class="switcherCls" /></template>
  30. <template #title="{ label,value,children }">
  31. <span v-if="label!=null&&label.indexOf(subjectTrees.searchStr) > -1">
  32. {{ label.substr(0, label.indexOf(subjectTrees.searchStr)) }}
  33. <span style="color: #f50">{{ subjectTrees.searchStr }}</span>
  34. {{ label.substr(label.indexOf(subjectTrees.searchStr) + subjectTrees.searchStr.length) }}
  35. </span>
  36. <span v-else>{{ label }}</span>
  37. </template>
  38. </a-tree>
  39. </div>
  40. </div>
  41. <div class="query-index-close" v-else>
  42. <DoubleRightOutlined @click="showTree=true"/>
  43. </div>
  44. <div class="query-index-content">
  45. <div class="query-index-form">
  46. <a-form ref="formRef" name="fromQuery"
  47. class="ant-advanced-search-form"
  48. :label-col="labelCol"
  49. :model="formState">
  50. <a-row :gutter="24" class="query-index-row">
  51. <a-col :span="6">
  52. <a-form-item name="well_id" label="井号:">
  53. <a-input v-model:value="formState.well_id"/>
  54. </a-form-item>
  55. </a-col>
  56. <a-col :span="6">
  57. <a-form-item name="well_common_name" label="井名:">
  58. <a-input v-model:value="formState.well_common_name"/>
  59. </a-form-item>
  60. </a-col>
  61. <a-col :span="6">
  62. <a-form-item name="well_type" label="井型:">
  63. <a-select ref="select" v-model:value="formState.well_type"
  64. :options="wellTypeList" :field-names="{label:'name',value:'value'}" :allow-clear="true">
  65. </a-select>
  66. </a-form-item>
  67. </a-col>
  68. <a-col :span="6" style="text-align: left">
  69. <MenuOutlined @click="showQuery=true" v-if="!showQuery"/>
  70. <LineOutlined @click="showQuery=false" v-else/>
  71. <a-button type="primary" html-type="submit" @click="onQuery" style="margin-left: 10px;">查询</a-button>
  72. <a-button html-type="submit"
  73. @click="() => {resetFields();formState.ref_date=new Date(); onQuery()}"
  74. style="margin-left: 10px;">
  75. 重置
  76. </a-button>
  77. </a-col>
  78. </a-row>
  79. <a-row :gutter="24" class="query-index-row" v-if="showQuery">
  80. <a-col :span="6">
  81. <a-form-item name="spud_date_begin" label="开钻日期:">
  82. <a-range-picker :key="formState.ref_date" format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
  83. @change="(d)=>{onRangeChange(d,'spud_date_begin','spud_date_end')}"/>
  84. </a-form-item>
  85. </a-col>
  86. <a-col :span="6">
  87. <a-form-item name="completion_date_begin" label="完井日期:">
  88. <a-range-picker :key="formState.ref_date" format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
  89. @change="(d)=>{onRangeChange(d,'completion_date_begin','completion_date_end')}"/>
  90. </a-form-item>
  91. </a-col>
  92. <a-col :span="6">
  93. <a-form-item name="oil_prod_begin_date_begin" label="开始采油日期:">
  94. <a-range-picker :key="formState.ref_date" format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
  95. @change="(d)=>{onRangeChange(d,'oil_prod_begin_date_begin','oil_prod_begin_date_end')}"/>
  96. </a-form-item>
  97. </a-col>
  98. </a-row>
  99. <a-row :gutter="24" class="query-index-row" v-if="showQuery">
  100. <a-col :span="6">
  101. <a-form-item label="最近采油日期:">
  102. <a-range-picker :key="formState.ref_date" format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
  103. @change="(d)=>{onRangeChange(d,'oil_prod_recent_date_begin','oil_prod_recent_date_end')}"/>
  104. </a-form-item>
  105. </a-col>
  106. </a-row>
  107. <a-row class="edit-operation">
  108. <a-col :span="24" style="text-align: right">
  109. <a-checkbox-group v-model:value="showColumnType">
  110. <a-row>
  111. <a-col :span="12">
  112. <a-checkbox value="oil">显示产油</a-checkbox>
  113. </a-col>
  114. <a-col :span="12">
  115. <a-checkbox value="gas">显示产气</a-checkbox>
  116. </a-col>
  117. </a-row>
  118. </a-checkbox-group>
  119. <a-radio-group v-model:value="viewModel" style="text-align: left">
  120. <a-radio-button value="list">
  121. <UnorderedListOutlined/>
  122. 列表
  123. </a-radio-button>
  124. <a-radio-button value="card">
  125. <TableOutlined/>
  126. 卡片
  127. </a-radio-button>
  128. </a-radio-group>
  129. </a-col>
  130. </a-row>
  131. </a-form>
  132. </div>
  133. <a-spin :spinning="loading">
  134. <div class="query-index-table" v-if="viewModel=='list'">
  135. <a-table :columns="filterColumns" :data-source="data" :scroll="{ x:'100%', y: 550 }"
  136. :row-key="record=>record.tempId" :pagination="false"
  137. bordered>
  138. <template #bodyCell="{ column,record }">
  139. <template v-if="column.dataIndex === 'oil'">
  140. <div style="height:25px">
  141. <ChartCell :timeType="('month')" :dataType="('oil')" :wellId="record.well_id"></ChartCell>
  142. </div>
  143. </template>
  144. <template v-if="column.dataIndex === 'gas'">
  145. <div style="height:25px">
  146. <ChartCell :timeType="('month')" :dataType="('gas')" :wellId="record.well_id"></ChartCell>
  147. </div>
  148. </template>
  149. <template v-if="column.key === 'well_id'">
  150. <a-button type="link" size="small" @click="detail(record.well_id)">{{ record.well_id }}</a-button>
  151. </template>
  152. <template v-if="column.key === 'operation'">
  153. <a-button type="link" size="small" @click="showDoc(record.well_id)">相关文档</a-button>
  154. </template>
  155. </template>
  156. </a-table>
  157. </div>
  158. <div class="query-index-table" v-else>
  159. <a-row :gutter="[24,8]">
  160. <a-col :span="8" v-for="item in data">
  161. <a-card :title="'井名:'+item.well_common_name" bodyStyle="padding: 10px;">
  162. <template #extra>
  163. <a-button type="link" @click="detail(item.well_id)">查看详情</a-button>
  164. <a-button type="link" @click="showDoc(item.well_id)">相关文档</a-button>
  165. </template>
  166. <table class="well-card-table">
  167. <tr>
  168. <th>井型:</th>
  169. <td>{{ item.well_type }}</td>
  170. <th>状态:</th>
  171. <td>{{ item.current_state_name }}</td>
  172. </tr>
  173. <tr>
  174. <th>开钻日期:</th>
  175. <td>{{ item.spud_date }}</td>
  176. <th>含水率:</th>
  177. <td><span style="padding:2px 10px;" :class="getTdColor( item.water_cut)">{{ item.water_cut }}</span>
  178. </td>
  179. </tr>
  180. <tr>
  181. <th>开始采油日期:</th>
  182. <td>{{ item.oil_prod_begin_date }}</td>
  183. <th>最近采油日期:</th>
  184. <td>{{ item.oil_prod_recent_date }}</td>
  185. </tr>
  186. <tr>
  187. <th>月产油量:</th>
  188. <td>{{ item.oil_prod_mon }}t</td>
  189. <td colspan="2" rowspan="2">
  190. <div style="height:25px">
  191. <ChartCell :timeType="('month')" :dataType="('oil')" :wellId="item.well_id"></ChartCell>
  192. </div>
  193. </td>
  194. </tr>
  195. <tr>
  196. <th>累产油量:</th>
  197. <td>{{ item.oil_prod_year }}t</td>
  198. </tr>
  199. <tr>
  200. <th>月产气量:</th>
  201. <td>{{ item.gas_prod_mon }}m³</td>
  202. <td colspan="2" rowspan="2">
  203. <div style="height:25px">
  204. <ChartCell :timeType="('month')" :dataType="('gas')" :wellId="item.well_id"></ChartCell>
  205. </div>
  206. </td>
  207. </tr>
  208. <tr>
  209. <th>累产气量:</th>
  210. <td>{{ item.gas_prod_year }}m³</td>
  211. </tr>
  212. </table>
  213. </a-card>
  214. </a-col>
  215. </a-row>
  216. </div>
  217. <a-pagination :page-size-options="['5', '20', '30', '40', '50']" show-size-changer
  218. v-model:current="pagination.current" :total="pagination.total"
  219. style="float: right;margin-top: 10px;"
  220. :pageSize="pagination.pageSize" :show-total="total => `共 ${total} 条`"
  221. @change="(current)=>handleTableChange({ current: current,pageSize: pagination.pageSize })"
  222. @showSizeChange="(current,pageSize)=>handleTableChange({ current: current,pageSize: pageSize })"/>
  223. </a-spin>
  224. <div style="width:100%;height: 500px;margin-top:15px">
  225. <ChartMap></ChartMap>
  226. </div>
  227. </div>
  228. <a-modal v-model:visible="isShowDoc" title="相关文档" :footer="null" @onCancel="isShowDoc=false">
  229. <a-list item-layout="horizontal" :data-source="docList">
  230. <template #renderItem="{ item }">
  231. <a-list-item>
  232. <template #actions>
  233. <a style="color:#1890ff">下载</a>
  234. </template>
  235. <a-list-item-meta
  236. :description="item.file_business_type">
  237. <template #title>
  238. <a href="">{{ item.file_name }}</a>
  239. </template>
  240. <template #avatar>
  241. <img src="~@/assets/images/file.png"/>
  242. </template>
  243. </a-list-item-meta>
  244. </a-list-item>
  245. </template>
  246. </a-list>
  247. </a-modal>
  248. </div>
  249. </template>
  250. <script lang="ts">
  251. import {ref, defineComponent, reactive, computed, watch} from 'vue';
  252. import type {FormInstance} from 'ant-design-vue';
  253. import {useRoute} from 'vue-router';
  254. import {get} from "@/api/common";
  255. import type {TableColumnsType} from "ant-design-vue";
  256. import dayjs from "dayjs";
  257. import {getPaginationTotalTitle} from "@/utils/common";
  258. import type {TableProps} from "ant-design-vue";
  259. import {useTabsViewStore} from "@/store/modules/tabsView";
  260. import ChartCell from '@/components/basic/chart/chart-cell.vue'
  261. import ChartMap from '@/components/basic/chart/chart-map.vue'
  262. export default defineComponent({
  263. name: 'wellinfoindex',
  264. components: {ChartCell, ChartMap},
  265. setup() {
  266. const route = useRoute();
  267. const expand = ref(false);
  268. const formRef = ref<FormInstance>();
  269. const loading = ref(false);
  270. const showQuery = ref(false);
  271. const selectedRowKeys = ref([]);
  272. const activeTab = ref("1");
  273. const showTree = ref(true);
  274. const isShowDoc = ref(false);
  275. const showColumnType = ref(['oil','gas']);
  276. const data = ref([{children: [], label: '', value: ''}]);
  277. const viewModel = ref("list");
  278. const tabsViewStore = useTabsViewStore();
  279. const docList = ref([]);
  280. const wellTypeList = ref([{label: "直井", value: "直井"}, {label: "定向井", value: "定向井"}, {label: "分支井", value: "分支井"}]);
  281. const replaceFields = {
  282. children: 'children',
  283. title: 'label',
  284. key: 'value',
  285. };
  286. const formState = reactive({
  287. page: 1,
  288. rows: 10,
  289. total: 0,
  290. ref_date: new Date(), //重置查询条件使用
  291. well_common_name: '',
  292. well_id: '',
  293. well_type: '',
  294. spud_date_begin: '',
  295. spud_date_end: '',
  296. completion_date_begin: '',
  297. completion_date_end: '',
  298. oil_prod_begin_date_begin: '',
  299. oil_prod_begin_date_end: '',
  300. oil_prod_recent_date_begin: '',
  301. oil_prod_recent_date_end: '',
  302. org_id_a1: '',
  303. project_id: ''
  304. });
  305. const resetFields = function () {
  306. let keys: string[] = Object.keys(formState);
  307. keys.forEach(key => {
  308. if (typeof (formState[key]) == "string") {
  309. formState[key] = '';
  310. }
  311. })
  312. }
  313. const oilHeader = () => {
  314. return {
  315. style: {'border-top': '2px solid red'},
  316. }
  317. }
  318. const gasHeader = () => {
  319. return {
  320. style: {'border-top': '2px solid #0c6be2'},
  321. }
  322. }
  323. const filterColumns = ref([]);
  324. const columns: TableColumnsType = [
  325. {
  326. title: '序号',
  327. width: 60,
  328. dataIndex: 'index',
  329. key: 'index',
  330. align: "center", fixed: 'left',
  331. customRender: item => `${formState.rows * (formState.page - 1) + item.index + 1}`
  332. },
  333. {title: '井号', dataIndex: 'well_id', key: 'well_id', width: 120, fixed: 'left'},
  334. {title: '井名', dataIndex: 'well_common_name', key: 'well_common_name', width: 120},
  335. {title: '采油厂机构', dataIndex: 'org_name_a1', key: 'org_name_a1', width: 120},
  336. {title: '地质单元', dataIndex: 'project_name', key: 'project_name', width: 120},
  337. {title: '井型', dataIndex: 'well_type', key: 'well_type', width: 120},
  338. {
  339. title: '开钻日期', dataIndex: 'spud_date', key: 'spud_date', width: 120, customRender: ({record}) =>
  340. record.spud_date == null ? "" : (dayjs(record.spud_date).format('YYYY-MM-DD'))
  341. },
  342. {
  343. title: '完钻日期', dataIndex: 'end_drilling_date', key: 'end_drilling_date', width: 120, customRender: ({record}) =>
  344. record.end_drilling_date == null ? "" : (dayjs(record.end_drilling_date).format('YYYY-MM-DD'))
  345. },
  346. {
  347. title: '完井日期', dataIndex: 'completion_date', key: 'completion_date', width: 120, customRender: ({record}) =>
  348. record.end_drilling_date == null ? "" : (dayjs(record.completion_date).format('YYYY-MM-DD'))
  349. },
  350. {
  351. title: '开始采油日期',
  352. dataIndex: 'oil_prod_begin_date',
  353. key: 'oil_prod_begin_date', width: 120,
  354. customRender: ({record}) =>
  355. record.oil_prod_begin_date == null ? "" : (dayjs(record.oil_prod_begin_date).format('YYYY-MM-DD'))
  356. },
  357. {
  358. title: '最近采油日期',
  359. dataIndex: 'oil_prod_recent_date',
  360. key: 'oil_prod_recent_date', width: 120,
  361. customRender: ({record}) =>
  362. record.oil_prod_recent_date == null ? "" : (dayjs(record.oil_prod_recent_date).format('YYYY-MM-DD'))
  363. },
  364. {title: '状态', dataIndex: 'current_state_name', key: 'current_state', width: 120},
  365. {title: '设计井深(m)', dataIndex: 'budgeted_md', key: 'tempNo', width: 120},
  366. {
  367. title: '含水率', dataIndex: 'water_cut', key: 'water_cut', width: 60, align: 'center', customCell: (record) => {
  368. return {class: getTdColor(record.water_cut)};
  369. }
  370. },
  371. {
  372. title: '最近月产油量(t)',
  373. dataIndex: 'oil_prod_mon',
  374. key: 'oil_prod_mon',
  375. width: 120,
  376. customHeaderCell: oilHeader
  377. },
  378. {
  379. title: '累产油量(t)',
  380. dataIndex: 'oil_prod_year',
  381. key: 'oil_prod_year',
  382. width: 120,
  383. customHeaderCell: oilHeader
  384. },
  385. {title: '累产油量趋势', dataIndex: 'oil', key: 'oil', width: 100, customHeaderCell: oilHeader},
  386. {
  387. title: '最近月产气量(m³)',
  388. dataIndex: 'gas_prod_mon',
  389. key: 'gas_prod_mon',
  390. width: 130,
  391. customHeaderCell: gasHeader
  392. },
  393. {
  394. title: '累产气量(m³)',
  395. dataIndex: 'gas_prod_year',
  396. key: 'gas_prod_year',
  397. width: 120,
  398. customHeaderCell: gasHeader
  399. },
  400. {title: '累产气量趋势', dataIndex: 'gas', key: 'gas', width: 100, customHeaderCell: gasHeader},
  401. {title: '操作列', dataIndex: 'operation', key: 'operation', align: 'center', width: 120}
  402. ];
  403. filterColumns.value = columns as any;
  404. watch(
  405. () => showColumnType.value,
  406. () => {
  407. const filterValue = columns.filter((item: any) => {
  408. if (!showColumnType.value.includes("oil")) {
  409. if (["oil_prod_mon", "oil_prod_year", "oil"].includes(item.dataIndex)) {
  410. return false
  411. }
  412. }
  413. if (!showColumnType.value.includes("gas")) {
  414. if (["gas_prod_mon", "gas_prod_year", "gas"].includes(item.dataIndex)) {
  415. return false
  416. }
  417. }
  418. return true
  419. })
  420. filterColumns.value = filterValue as any;
  421. }
  422. );
  423. const getTdColor = (water_cut) => {
  424. if (water_cut == null || water_cut <= 2) {
  425. return "";
  426. } else if (water_cut > 2 && water_cut <= 40) {
  427. return "color_level2";
  428. } else if (water_cut > 40 && water_cut <= 8) {
  429. return "color_level3";
  430. } else {
  431. return "color_level4";
  432. }
  433. }
  434. const onSelectChange = (keys: any) => {
  435. selectedRowKeys.value = keys;
  436. };
  437. const pagination = computed(() => ({
  438. total: formState.total,
  439. current: formState.page,
  440. pageSize: formState.rows,
  441. showSizeChanger: true,
  442. showTotal: total => getPaginationTotalTitle(total)
  443. }));
  444. const loadData = async function () {
  445. loading.value = true;
  446. const result: any = await get('wellInfo/getList', formState);
  447. data.value = result.list;
  448. formState.total = result.total;
  449. loading.value = false;
  450. }
  451. const handleTableChange: TableProps['onChange'] = (
  452. pag: { pageSize: number; current: number },
  453. ) => {
  454. formState.page = pag.current;
  455. formState.rows = pag.pageSize;
  456. loadData();
  457. };
  458. const onRangeChange = (dateString, begin, end) => {
  459. formState[begin] = dateString ? dateString[0].format("YYYY-MM-DD") : '';
  460. formState[end] = dateString ? dateString[1].format("YYYY-MM-DD") : '';
  461. };
  462. const tabChange = (key) => {
  463. console.log("tabChange", key);
  464. if (key == "2") {
  465. formState.org_id_a1 = '';
  466. subjectTrees.value.data = Object.assign(subjectTrees.value.constructUnitTree);
  467. } else {
  468. formState.project_id = ''
  469. subjectTrees.value.data = Object.assign(subjectTrees.value.organizationTree);
  470. }
  471. getSubjectTree();
  472. }
  473. const detail = (well_id) => {
  474. tabsViewStore.addTabByPath('/wellinfo/detail', {id: well_id});
  475. }
  476. const onQuery = () => {
  477. loadData();
  478. }
  479. const subjectTrees = ref({
  480. data: [],
  481. organizationTree: [],
  482. constructUnitTree: [],
  483. expandedKeys: [''],
  484. selectedKeys: [''],
  485. autoExpandParent: true,
  486. searchStr: ''
  487. });
  488. const getSubjectData = async function () {
  489. get('wellInfo/getOrganizationTree', {tabName: subjectTrees.value.searchStr}).then(data => {
  490. subjectTrees.value.organizationTree = data;
  491. subjectTrees.value.data = Object.assign(data);
  492. getSubjectTree();
  493. });
  494. get('wellInfo/getConstructUnitTree', {tabName: subjectTrees.value.searchStr}).then(data => {
  495. subjectTrees.value.constructUnitTree = data;
  496. });
  497. }
  498. const getSubjectTree = async function () {
  499. //计算第一个展开节点
  500. subjectTrees.value.expandedKeys = [];
  501. if (subjectTrees.value.data && subjectTrees.value.data.length > 0) {
  502. subjectTrees.value.expandedKeys.push((subjectTrees.value.data[0] as any).value + "");
  503. }
  504. generateList(subjectTrees.value.data);
  505. }
  506. getSubjectData();
  507. const searchTree = () => {
  508. const expanded = dataList
  509. .map((item: any) => {
  510. if (item.label != null && item.label.indexOf(subjectTrees.value.searchStr) > -1) {
  511. return getParentKey(item.value as string, subjectTrees.value.data);
  512. }
  513. return null;
  514. })
  515. .filter((item, i, self) => item && self.indexOf(item) === i);
  516. subjectTrees.value.expandedKeys = expanded as string[];
  517. subjectTrees.value.autoExpandParent = true;
  518. }
  519. const dataList: any[] = [];
  520. const generateList = (data: any[]) => {
  521. for (let i = 0; i < data.length; i++) {
  522. const node = data[i];
  523. const label = node.label;
  524. dataList.push({value: node.value, label: label as string});
  525. if (node.children) {
  526. generateList(node.children);
  527. }
  528. }
  529. };
  530. const getParentKey = (key: string, tree: any[]): string | number | undefined => {
  531. let parentKey;
  532. for (let i = 0; i < tree.length; i++) {
  533. const node = tree[i];
  534. if (node.children) {
  535. if (node.children.some(item => item.value === key)) {
  536. parentKey = node.value;
  537. } else if (getParentKey(key, node.children)) {
  538. parentKey = getParentKey(key, node.children);
  539. }
  540. }
  541. }
  542. return parentKey;
  543. };
  544. const treeOnExpand = function (keys: string[]) {
  545. subjectTrees.value.expandedKeys = keys;
  546. subjectTrees.value.autoExpandParent = false;
  547. }
  548. const treeOnSelect = function (selected, selectedNodes, node) {
  549. console.log(selected, selectedNodes, node);
  550. if (selectedNodes.node.parent != undefined) {
  551. if (activeTab.value == "1") {
  552. formState.org_id_a1 = selected.length > 0 ? selectedNodes.node.key : '';
  553. } else {
  554. formState.project_id = selected.length > 0 ? selectedNodes.node.key : '';
  555. }
  556. loadData();
  557. }
  558. }
  559. const showDoc = (id) => {
  560. get('wellInfo/getWellDocumentList', {wellId: id}).then(data => {
  561. docList.value = data;
  562. isShowDoc.value = true;
  563. })
  564. };
  565. const labelCol = {style: {width: '100px'}};
  566. return {
  567. route, selectedRowKeys, loading, activeTab, showTree, onSelectChange, data,
  568. expand, onQuery, loadData, onRangeChange, showQuery, wellTypeList, replaceFields,
  569. formRef, viewModel, handleTableChange, detail,
  570. formState, isShowDoc, showDoc, docList, resetFields, showColumnType, filterColumns,
  571. labelCol, getTdColor,
  572. tabChange,
  573. treeOnExpand,
  574. subjectTrees,
  575. getSubjectTree, searchTree,
  576. treeOnSelect, pagination
  577. };
  578. },
  579. created() {
  580. this.loadData();
  581. },
  582. activated() {
  583. }
  584. });
  585. </script>
  586. <style lang="less">
  587. .query-index {
  588. display: flex;
  589. flex-direction: row;
  590. min-height: 100%;
  591. background-color: white;
  592. }
  593. .query-index-tree {
  594. min-width: 260px;
  595. max-width: 360px;
  596. border-right: 2px solid #f2f2f2;
  597. margin-right: 5px;
  598. }
  599. .query-index-close {
  600. width: 15px;
  601. padding-top: 10px;
  602. padding-left: 10px;
  603. }
  604. .query-index-content {
  605. flex-grow: 1;
  606. display: flex;
  607. flex-direction: column;
  608. width: 80%;
  609. }
  610. .query-index-form {
  611. padding: 15px 10px 10px 15px;
  612. }
  613. .query-index-table {
  614. flex-grow: 1;
  615. display: flex;
  616. .ant-row {
  617. width: 100%;
  618. }
  619. }
  620. .query-index-tabs {
  621. margin-left: 10px;
  622. margin-right: 10px;
  623. height: 100%;
  624. flex: 1;
  625. }
  626. .tabs-view-content {
  627. padding: 0px;
  628. }
  629. .query-index-tree-item {
  630. white-space: nowrap; /*强制span不换行*/
  631. display: inline-block; /*将span当做块级元素对待*/
  632. text-overflow: ellipsis; /*超出部分以点号代替*/
  633. }
  634. .query-index-tree-search {
  635. padding: 5px;
  636. border-bottom: 2px solid #f2f2f2;
  637. display: flex;
  638. align-items: center;
  639. }
  640. .query-index-tree-box {
  641. padding: 5px;
  642. padding-top: 10px;
  643. overflow-y: scroll;
  644. max-height: 1000px;
  645. }
  646. .col-text {
  647. padding-right: 0px !important;
  648. text-align: right;
  649. font-weight: bold;
  650. }
  651. .col-content {
  652. width: 200px;
  653. overflow: hidden;
  654. text-overflow: ellipsis;
  655. white-space: nowrap;
  656. }
  657. .ant-card-body {
  658. padding: 10px;
  659. }
  660. .well-card-table {
  661. th {
  662. width: 25%;
  663. text-align: right;
  664. }
  665. td {
  666. width: 25%;
  667. text-align: left;
  668. }
  669. }
  670. .color_level1, .ant-table-tbody>tr>td.color_level1:hover {
  671. }
  672. .color_level2, .ant-table-tbody>tr>td.color_level2:hover {
  673. background-color: #EAF4FF !important;
  674. }
  675. .color_level3, .ant-table-tbody>tr>td.color_level3:hover {
  676. background-color: #D5EAFF !important;
  677. }
  678. .color_level4, .ant-table-tbody>tr>td.color_level4:hover {
  679. background-color: #B7DBFF !important;
  680. }
  681. </style>