index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. <template>
  2. <div class="data-table" :style="{ marginTop: marginTop }">
  3. <div :style="dataTableContentStyle" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="data-table-content">
  4. <div :class="isStatus ? 'flex' : 'flex-end'" class="data-table-btn">
  5. <div v-if="isStatus" class="vStatus">
  6. <slot />
  7. </div>
  8. <el-button v-if="isBtn" size="small" @click="handleAdd" plain type="primary">新增</el-button>
  9. </div>
  10. <template v-if="tableData.length">
  11. <div>
  12. <el-table v-el-table-infinite-scroll="load" :data="filteredTableData" :summary-method="getSummaries" :span-method="tableSpanMethod" stripe :show-summary="showSummary" border ref="table" :height="tableHeight ? tableHeight : minHeight - 8 + 'vh'" class="table infinite-list" style="width: 100%; overflow: auto" @select="selectHandler">
  13. <el-table-column v-if="selectionEnable" type="selection" width="35" />
  14. <el-table-column v-for="(item, index) in tableColsCopy" :sortable="item.needSort ? true : false" :key="index" :prop="item.columnName" :label="item.columnLabel" :show-overflow-tooltip="showOverflowTooltip">
  15. <template #header>
  16. <span class="colTips">
  17. <el-tooltip :content="item.columnDescribe" placement="top">
  18. <span>{{ item.columnLabel }}</span>
  19. </el-tooltip>
  20. </span>
  21. <span v-if="item.needFilters">
  22. <el-popover placement="bottom" trigger="click" @show="popoverShowHandler(item.columnName)" @hide="popoverHideHandler">
  23. <i slot="reference" :class="[
  24. 'filter-arrow',
  25. 'el-icon-arrow-down',
  26. arrowClass(item.columnName),
  27. ]" />
  28. <el-form>
  29. <el-form-item :label="item.columnLabel">
  30. <el-select v-model="filterValues[item.columnName]" size="small" placeholder="筛选" default-first-option filterable clearable>
  31. <el-option v-for="(option, optionIndex) in tableDataFilters[
  32. item.columnName
  33. ]" :key="option.value + optionIndex" :value="option.value" :label="option.text" />
  34. </el-select>
  35. </el-form-item>
  36. </el-form>
  37. </el-popover>
  38. </span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column fixed="right" label="操作" width="180">
  42. <template slot-scope="scope">
  43. <div class="hd-td">
  44. <div class="hd-tr">
  45. <!-- <el-button class="hrefBtn" type="text" @click="handleHerf(scope.row)" size="small">跳转</el-button> -->
  46. <el-button type="text" @click="handleEdit(scope.row)" size="small" class="rmScs">编辑</el-button>
  47. <el-button class="rmSc" type="text" @click="handleRemove(scope.row)" size="small">删除</el-button>
  48. <el-button class="rmScs" v-if="withColumnSet" type="text" size="small" @click="handleColumnSet(scope.row)">列设置</el-button>
  49. <el-button class="rmScs" v-if="withItemSet" type="text" size="small" @click="handleItemSet(scope.row)">数据项</el-button>
  50. <el-button class="rmScser" v-if="withlodSet" type="text" size="small" @click="handlelodSet(scope.row)">航站设置</el-button>
  51. <el-button class="rmScser" v-if="withnodeSet" type="text" size="small" @click="handlenodeSet(scope.row)">节点设置</el-button>
  52. </div>
  53. </div>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <!-- <p v-if="noMore" style="text-align: center">没有更多了</p> -->
  58. </div>
  59. </template>
  60. <template v-else>
  61. <NoData image-width="auto" image-height="100%" />
  62. </template>
  63. </div>
  64. <div class="data-table-dialog">
  65. <!--新增/编辑-->
  66. <Dialog :width="width" :flag="flag">
  67. <div class="dialog-content">
  68. <div class="title">{{ tableTitle }}</div>
  69. <div class="content">
  70. <el-form ref="ruleForm" :model="tableForm" :label-width="labelWidth">
  71. <el-row :gutter="20">
  72. <el-col v-for="(item, index) in tableColsCopy" :key="index" :span="rows">
  73. <el-form-item :label="item.columnLabel">
  74. <template v-if="
  75. item.listqueryTemplateID ||
  76. item.listqueryTemplateID == 0
  77. ">
  78. <el-select size="small" clearable style="width: 100%" v-model="tableForm[item.columnName]" @change="changeSelect(item.columnName)" placeholder="请选择">
  79. <el-option v-for="item in tableOptions[item.columnName]" :key="item.v" :label="item.k" :value="item.v">
  80. </el-option>
  81. </el-select>
  82. </template>
  83. <!-- <template v-else-if="item.dataType == 'longtext'">
  84. <el-input size="small" :rows="1" type="textarea" v-model="tableForm[item.columnName]"></el-input>
  85. </template> -->
  86. <template v-else>
  87. <el-input size="small" v-model="tableForm[item.columnName]" @change="inputChangeHandler(item.columnName)"></el-input>
  88. </template>
  89. </el-form-item>
  90. </el-col>
  91. </el-row>
  92. </el-form>
  93. </div>
  94. <div class="foot right t30">
  95. <el-button size="medium" @click="handleOk" class="r24" type="primary">确定</el-button>
  96. <el-button @click="flag = false" size="medium">取消</el-button>
  97. </div>
  98. </div>
  99. </Dialog>
  100. <Dialog :flag="rmFlag">
  101. <div class="airportInfoDialog">
  102. <div class="title del-title">删除</div>
  103. <div class="content del-content">
  104. <span class="el-icon-error error r10"></span>您是否确认删除<span class="error l10">{{ rmTitle }}</span>
  105. </div>
  106. <div class="foot right Delfoot t30">
  107. <el-button size="medium" class="r24" @click="tableRemove" type="danger">删除</el-button>
  108. <el-button size="medium" @click="rmFlag = false">取消</el-button>
  109. </div>
  110. </div>
  111. </Dialog>
  112. </div>
  113. </div>
  114. </template>
  115. <script>
  116. import { setTableFilters } from "@/utils/table";
  117. import Dialog from "@/layout/components/Dialog/index.vue";
  118. import NoData from "@/components/nodata";
  119. import { Query, GeneralDataReception } from "@/api/dataIntegration";
  120. export default {
  121. name: "DataTable",
  122. props: {
  123. isDialog: {
  124. type: Boolean,
  125. default: true,
  126. },
  127. //接口ID
  128. dataId: {
  129. type: [String, Number],
  130. default: "",
  131. },
  132. editId: {
  133. type: [String, Number],
  134. default: "",
  135. },
  136. dataContent: {
  137. type: Object,
  138. default: () => ({}),
  139. },
  140. //是否显示状态
  141. isStatus: {
  142. type: Boolean,
  143. default: false,
  144. },
  145. //弹框宽度
  146. width: {
  147. type: String,
  148. default: "560px",
  149. },
  150. //弹框表单-行数
  151. rows: {
  152. type: Number,
  153. default: 3,
  154. },
  155. //弹框-表单文字宽度
  156. labelWidth: {
  157. type: String,
  158. default: "80px",
  159. },
  160. //表格高度
  161. tableHeight: {
  162. type: [String, Number],
  163. default: 0,
  164. },
  165. minHeight: {
  166. type: Number,
  167. default: 65,
  168. },
  169. //是否显示新增按钮
  170. isBtn: {
  171. type: Boolean,
  172. default: true,
  173. },
  174. // 是否显示合计行
  175. showSummary: {
  176. type: Boolean,
  177. default: false,
  178. },
  179. marginTop: {
  180. type: String,
  181. default: "0px",
  182. },
  183. // 是否可选中行
  184. selectionEnable: {
  185. type: Boolean,
  186. default: false,
  187. },
  188. // 懒加载
  189. withLazyLoad: {
  190. type: Boolean,
  191. default: false,
  192. },
  193. // 不换行,溢出隐藏
  194. showOverflowTooltip: {
  195. type: Boolean,
  196. default: false,
  197. },
  198. // 表格-操作-列设置按钮显示
  199. withColumnSet: {
  200. type: Boolean,
  201. default: false,
  202. },
  203. // 表格-操作-项设置按钮显示
  204. withItemSet: {
  205. type: Boolean,
  206. default: false,
  207. },
  208. // 表格-操作-项设置按钮显示
  209. withlodSet: {
  210. type: Boolean,
  211. default: false,
  212. },
  213. // 表格-操作-节点按钮显示
  214. withnodeSet: {
  215. type: Boolean,
  216. default: false,
  217. },
  218. },
  219. components: { Dialog, NoData },
  220. data () {
  221. return {
  222. loading: false,
  223. flag: false,
  224. serviceId: null,
  225. rmFlag: false,
  226. rowTitle: "",
  227. page: 0,
  228. noMore: false,
  229. tableCols: [], //表头数据
  230. tableData: [], //表格数据
  231. tableColsCopy: [], //表头数据缓存
  232. tableDataFilters: {}, //表头-下拉数据
  233. filterValues: {}, //表头-下拉-选中数据
  234. tableDataCopy: [], //缓存table数据
  235. tableGroups: [], //表格分组数据
  236. colShowFilter: "", //表头-下拉-箭头
  237. spanArr: [], //表格分组数据缓存
  238. pos: 0, //表格分组计数
  239. tableTitle: "新增", //弹框标题
  240. tableType: "add", //弹框类型=新增/编辑
  241. tableForm: {}, //弹框表单
  242. rmTitle: "", //弹框-删除-标题
  243. tableObj: {}, //增/删/改数据缓存
  244. tableOptions: {}, //弹框-下来数据缓存
  245. tableArrs: [], //重组table-表头下拉
  246. proAll: false, //重组时-所有请求是否都完成
  247. };
  248. },
  249. computed: {
  250. dataTableContentStyle () {
  251. const style = {};
  252. if (this.minHeight) {
  253. style["min-height"] = this.minHeight;
  254. }
  255. if (this.tableHeight) {
  256. style["height"] = this.tableHeight;
  257. }
  258. return style;
  259. },
  260. //设置表头-下拉-箭头样式
  261. arrowClass () {
  262. return function (prop) {
  263. let classString = "";
  264. if (this.colShowFilter === prop) {
  265. return "arrow-active";
  266. }
  267. if (
  268. Object.entries(this.tableDataFilters).find(
  269. ([key, arr]) => this.filterValues[prop]
  270. )
  271. ) {
  272. classString += "arrow-blue";
  273. }
  274. return classString;
  275. };
  276. },
  277. //设置表头-下拉-选中数据
  278. filteredTableData () {
  279. return this.tableData.filter((item) => {
  280. let flag = true;
  281. Object.entries(this.filterValues).forEach(([key, value]) => {
  282. if (value !== "" && item[key] !== value) {
  283. flag = false;
  284. }
  285. });
  286. return flag;
  287. });
  288. },
  289. },
  290. watch: {
  291. dataContent: {
  292. handler (val) {
  293. if (val) {
  294. console.log(val);
  295. if (val.companyID) {
  296. this.resetTable();
  297. this.getQuery();
  298. }
  299. }
  300. },
  301. deep: true,
  302. },
  303. },
  304. mounted () {
  305. this.getQuery();
  306. },
  307. updated () {
  308. this.$refs["table"]?.doLayout();
  309. },
  310. methods: {
  311. load () {
  312. // console.log("分页");
  313. if (this.noMore || this.loading) {
  314. return;
  315. }
  316. this.getQuery();
  317. },
  318. resetTable () {
  319. this.page = 0;
  320. this.noMore = false;
  321. this.tableData = [];
  322. },
  323. changeSelect (data) {
  324. if (this.tableForm[data] === "") {
  325. this.tableForm[data] = null;
  326. }
  327. this.tableForm[this.tableOptions[data][0].setvalue] =
  328. this.tableForm[data];
  329. // console.log(this.tableForm)
  330. },
  331. inputChangeHandler (data) {
  332. if (this.tableForm[data] === "") {
  333. this.tableForm[data] = null;
  334. }
  335. },
  336. //获取表格数据
  337. async getQuery () {
  338. try {
  339. this.loading = true;
  340. const { code, returnData } = await Query({
  341. id: this.dataId,
  342. needPage: ++this.page,
  343. dataContent: Object.values(this.dataContent),
  344. });
  345. if (code == 0) {
  346. if (returnData.listValues.length === 0) {
  347. this.page--;
  348. this.noMore = true;
  349. this.loading = false;
  350. }
  351. const titleColumn = returnData.columnSet.find(
  352. (item) => item.needShow === 1
  353. );
  354. if (titleColumn) {
  355. this.rowTitle = titleColumn.columnName;
  356. }
  357. this.tableData.push(...returnData.listValues);
  358. this.tableCols = returnData.columnSet;
  359. this.serviceId = returnData.submitID;
  360. setTimeout(() => {
  361. this.initTableData();
  362. this.loading = false;
  363. }, 100);
  364. } else {
  365. this.page--;
  366. this.loading = false;
  367. this.$message.error("获取表格数据失败");
  368. }
  369. } catch (error) {
  370. this.page--;
  371. this.loading = false;
  372. console.log(error);
  373. }
  374. },
  375. //表格-增/删/改
  376. async generalDataReception (data) {
  377. try {
  378. data = {
  379. ...data,
  380. ...this.dataContent,
  381. };
  382. const { code, message } = await GeneralDataReception({
  383. serviceId: this.serviceId,
  384. dataContent: JSON.stringify(data),
  385. });
  386. if (code == 0) {
  387. this.$message.success("操作成功");
  388. this.resetTable();
  389. this.getQuery();
  390. this.flag = false;
  391. this.rmFlag = false;
  392. this.tableObj = {};
  393. this.tableForm = {};
  394. } else {
  395. this.$message.error("操作失败");
  396. this.flag = false;
  397. this.rmFlag = false;
  398. this.tableObj = {};
  399. this.tableForm = {};
  400. }
  401. } catch (error) {
  402. console.log(error);
  403. this.flag = false;
  404. this.rmFlag = false;
  405. this.tableObj = {};
  406. this.tableForm = {};
  407. }
  408. },
  409. // 表格勾选
  410. toggleRowSelection (row, isSelected) {
  411. this.$refs["table"].toggleRowSelection(row, isSelected);
  412. },
  413. // 表格初始勾选
  414. selectTableRows (tableData, selectFlagName) {
  415. tableData.forEach((row) => {
  416. this.$refs["table"].toggleRowSelection(row, !!row[selectFlagName]);
  417. });
  418. },
  419. //初始化表格
  420. initTableData () {
  421. this.tableColsCopy = this.tableCols.filter((item) => item.needShow);
  422. // console.log(this.tableColsCopy);
  423. // debugger;
  424. this.tableDataCopy = _.cloneDeep(this.tableData);
  425. const datas = _.cloneDeep(this.tableColsCopy);
  426. // const reqUts = [];
  427. datas.forEach(async (item) => {
  428. this.tableDataFilters[item.columnName] = [];
  429. if (item.needGroup) {
  430. this.tableGroups.push(item.columnName);
  431. }
  432. if (item.listqueryTemplateID || item.listqueryTemplateID == 0) {
  433. this.tableArrs.push(item.columnName);
  434. // const reqUt = this.getSelectData(item.listqueryTemplateID)
  435. // reqUts.push(reqUt)
  436. this.tableOptions[item.columnName] = await this.getSelectData(
  437. item.listqueryTemplateID
  438. );
  439. // console.log(this.tableOptions[item.columnName])
  440. }
  441. // this.filterValues[item.columnName] = ''
  442. });
  443. setTableFilters(this.tableData, this.tableDataFilters);
  444. this.tableGroup(this.tableData);
  445. this.selectTableRows(this.tableData, "DeployID");
  446. // this.getSelectDataAll(reqUts)
  447. },
  448. //获取所有获取弹框-下拉数据-请求状态
  449. getSelectDataAll (reqUts) {
  450. Promise.all(reqUts)
  451. .then((res) => {
  452. this.proAll = true;
  453. })
  454. .catch((err) => {
  455. this.proAll = false;
  456. });
  457. },
  458. //获取弹框-下拉数据
  459. async getSelectData (id) {
  460. const { code, returnData } = await Query({
  461. id,
  462. dataContent: [],
  463. });
  464. if (code == 0) {
  465. return returnData.listValues;
  466. } else {
  467. return [];
  468. }
  469. },
  470. //重组table-显示名称
  471. setTable () {
  472. this.tableArrs.forEach((item) => {
  473. this.tableOptions[item].forEach((p) => {
  474. this.tableDataCopy.forEach((msg) => {
  475. if (msg[item] == p.v) {
  476. msg[item] = p.k;
  477. }
  478. });
  479. this.tableDataFilters[item].forEach((cap) => {
  480. if (cap.value == p.v) {
  481. cap.text = p.k;
  482. cap.value = p.k;
  483. }
  484. });
  485. });
  486. });
  487. this.tableData = this.tableDataCopy;
  488. },
  489. //分组
  490. tableGroup (tableData) {
  491. const spanArr = [];
  492. let pos = 0;
  493. let ifYj = this.tableGroups[0];
  494. for (let i = 0; i < tableData.length; i++) {
  495. if (i === 0) {
  496. spanArr.push(1);
  497. } else {
  498. if (tableData[i][ifYj] === tableData[i - 1][ifYj]) {
  499. spanArr[pos] += 1;
  500. spanArr.push(0);
  501. } else {
  502. spanArr.push(1);
  503. pos = i;
  504. }
  505. }
  506. }
  507. this.spanArr = spanArr;
  508. this.pos = pos;
  509. },
  510. popoverShowHandler (prop) {
  511. this.colShowFilter = prop;
  512. },
  513. popoverHideHandler () {
  514. this.colShowFilter = "";
  515. },
  516. //分组
  517. tableSpanMethod ({ row, column, rowIndex, columnIndex }) {
  518. if (this.tableGroups.includes(column["property"])) {
  519. const _row = this.spanArr[rowIndex];
  520. const _col = _row > 0 ? 1 : 0;
  521. return {
  522. rowspan: _row,
  523. colspan: _col,
  524. };
  525. }
  526. },
  527. //合计
  528. getSummaries (param) {
  529. const { columns, data } = param;
  530. const sums = [];
  531. columns.forEach((column, index) => {
  532. this.tableColsCopy.forEach((p) => {
  533. if (column.property == p.columnName && p.needCount) {
  534. const values = data.map((item) => Number(item[column.property]));
  535. if (!values.every((value) => isNaN(value))) {
  536. sums[index] = values.reduce((prev, curr) => {
  537. const value = Number(curr);
  538. if (!isNaN(value)) {
  539. return prev + curr;
  540. } else {
  541. return prev;
  542. }
  543. }, 0);
  544. sums[index] += "";
  545. }
  546. }
  547. });
  548. });
  549. return sums;
  550. },
  551. //弹框-确定
  552. handleOk () {
  553. this.submitClickHandler();
  554. },
  555. //滚动
  556. tableLoad () {
  557. console.log("d");
  558. },
  559. //表格-新增
  560. handleAdd () {
  561. // this.flag = true;
  562. // this.tableType = "add";
  563. // this.tableTitle = "新增";
  564. // this.tableForm = {};
  565. if (this.isDialog) {
  566. this.flag = true;
  567. this.tableType = "add";
  568. this.tableTitle = "新增";
  569. this.tableForm = {};
  570. if (this.dataContent.nodeID) {
  571. this.tableForm.nodeCode = this.dataContent.nodeID;
  572. }
  573. if (this.dataContent.companyID) {
  574. this.tableForm.companyID = this.dataContent.companyID;
  575. }
  576. if (this.dataContent.IATACode) {
  577. this.tableForm.IATACode = this.dataContent.IATACode;
  578. }
  579. // this.tableForm.
  580. } else {
  581. if (this.dataContent.nodeID) {
  582. this.tableForm.nodeCode = this.dataContent.nodeID;
  583. }
  584. if (this.dataContent.IATACode) {
  585. this.tableForm.IATACode = this.dataContent.IATACode;
  586. }
  587. if (this.dataContent.companyID) {
  588. this.tableForm.companyID = this.dataContent.companyID;
  589. }
  590. this.$emit("handleAdd");
  591. }
  592. // console.log(this.tableOptions);
  593. },
  594. //表格-编辑
  595. async handleEdit (row) {
  596. if (this.isDialog) {
  597. if (this.editId) {
  598. let data = await this.queryOriginRow(
  599. this.editId,
  600. row.queryTemplateColumnSetID
  601. );
  602. this.tableForm = JSON.parse(JSON.stringify(data));
  603. if (this.dataContent.nodeID) {
  604. this.tableForm.nodeCode = this.dataContent.nodeID;
  605. }
  606. if (this.dataContent.companyID) {
  607. this.tableForm.companyID = this.dataContent.companyID;
  608. }
  609. if (this.dataContent.IATACode) {
  610. this.tableForm.IATACode = this.dataContent.IATACode;
  611. }
  612. // this.tableForm =this.tableForm;
  613. // Object.entries(tableForm).forEach(([key, value]) => {
  614. // this.tableForm[key] = value
  615. // })
  616. } else {
  617. this.tableForm = JSON.parse(JSON.stringify(row));
  618. if (this.dataContent.nodeID) {
  619. this.tableForm.nodeCode = this.dataContent.nodeID;
  620. }
  621. if (this.dataContent.companyID) {
  622. this.tableForm.companyID = this.dataContent.companyID;
  623. }
  624. if (this.dataContent.IATACode) {
  625. this.tableForm.IATACode = this.dataContent.IATACode;
  626. }
  627. }
  628. this.flag = true;
  629. this.tableType = "edit";
  630. this.tableTitle = "编辑";
  631. } else {
  632. this.$emit("handleEdit", row);
  633. }
  634. },
  635. async queryOriginRow (editId, queryTemplateColumnSetID) {
  636. try {
  637. const { code, returnData } = await Query({
  638. id: editId,
  639. dataContent: [queryTemplateColumnSetID],
  640. });
  641. if (Number(code) === 0) {
  642. return returnData.listValues[0];
  643. } else {
  644. this.$message.error("失败");
  645. }
  646. } catch (error) {
  647. console.log(error);
  648. }
  649. },
  650. //表格-跳转
  651. handleHerf (row) {
  652. alert("跳转");
  653. },
  654. // 新增/编辑-确认
  655. submitClickHandler () {
  656. this.$refs["ruleForm"].validate((valid) => {
  657. if (valid) {
  658. if (this.tableType == "add") {
  659. this.tableForm.event = 1;
  660. } else {
  661. this.tableForm.event = 2;
  662. }
  663. this.generalDataReception(this.tableForm);
  664. } else {
  665. return false;
  666. }
  667. });
  668. },
  669. //表格-删除
  670. handleRemove (row) {
  671. this.rmFlag = true;
  672. // this.rmTitle = row.className || row.username || row.serviceName || row.queryTemplateName;
  673. this.rmTitle = row[this.rowTitle];
  674. this.tableObj = row;
  675. },
  676. //表格-删除-确认
  677. tableRemove () {
  678. this.tableObj.event = 3;
  679. this.generalDataReception(this.tableObj);
  680. },
  681. // 表格-跳转列设置页
  682. handleColumnSet (row) {
  683. this.$router.push({
  684. path: "/systemSettings/queryTemplateChild",
  685. query: {
  686. queryTemplateID: row.queryTemplateID,
  687. },
  688. });
  689. },
  690. // 表格-跳转数据项设置页
  691. handleItemSet (row) {
  692. this.$router.push({
  693. path: "/systemSettings/datastructureChild",
  694. query: {
  695. dataStructureID: row.dataStructureID,
  696. },
  697. });
  698. },
  699. // 表格-跳转航站设置页
  700. handlelodSet (row) {
  701. this.$router.push({
  702. path: "/BasicsData/airportInfoChild",
  703. query: {
  704. IATACode: row.IATACode,
  705. },
  706. });
  707. },
  708. // 表格-节点置页
  709. handlenodeSet (row) {
  710. this.$router.push({
  711. path: "/BasicsData/deployNodeChild",
  712. query: {
  713. nodeID: row.nodeID,
  714. },
  715. });
  716. },
  717. // 表格-选中行
  718. selectHandler (selection, row) {
  719. this.$emit("selection-change", selection, row);
  720. },
  721. },
  722. };
  723. </script>
  724. <style lang="scss" scoped>
  725. .data-table {
  726. width: 100%;
  727. // background-color: #fff;
  728. // padding: 20px;
  729. ::v-deep .table {
  730. width: 100%;
  731. .cell {
  732. padding: 0;
  733. text-align: center;
  734. font-size: 14px;
  735. font-family: Helvetica, "Microsoft YaHei";
  736. letter-spacing: 0;
  737. }
  738. .cell-click {
  739. cursor: pointer;
  740. color: #2d7cff;
  741. &.cell-clicked {
  742. color: purple;
  743. }
  744. }
  745. .el-table__header-wrapper {
  746. .cell {
  747. font-weight: bold;
  748. color: #101116;
  749. > .el-checkbox {
  750. display: none;
  751. }
  752. }
  753. .has-gutter {
  754. tr {
  755. .bgl-huang {
  756. background: #fcf0b1;
  757. }
  758. }
  759. }
  760. }
  761. .el-table__body-wrapper {
  762. tr.bgl-hui {
  763. background: #d2d6df;
  764. td {
  765. background: #d2d6df;
  766. }
  767. &.redBorder {
  768. position: relative;
  769. &::after {
  770. content: "";
  771. position: absolute;
  772. left: 0;
  773. bottom: 0;
  774. width: 100%;
  775. height: 2px;
  776. background: #e83f82;
  777. }
  778. }
  779. }
  780. }
  781. .rmScs {
  782. width: 48px;
  783. height: 24px;
  784. border-color: #9ebbf7;
  785. box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
  786. border-radius: 4px;
  787. display: flex;
  788. align-items: center;
  789. justify-content: center;
  790. float: left;
  791. span {
  792. color: #2d67e3;
  793. }
  794. }
  795. .rmScser {
  796. width: 60px;
  797. height: 24px;
  798. border-color: #9ebbf7;
  799. box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
  800. border-radius: 4px;
  801. display: flex;
  802. align-items: center;
  803. justify-content: center;
  804. float: left;
  805. span {
  806. color: #2d67e3;
  807. }
  808. }
  809. .rmSc {
  810. width: 48px;
  811. height: 24px;
  812. background: #eb2f3b;
  813. box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
  814. border-radius: 4px;
  815. display: flex;
  816. align-items: center;
  817. justify-content: center;
  818. span {
  819. color: #ffffff;
  820. }
  821. }
  822. .hrefBtn {
  823. width: 48px;
  824. height: 24px;
  825. background: #6f81bc;
  826. box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
  827. border-radius: 4px;
  828. display: flex;
  829. align-items: center;
  830. justify-content: center;
  831. span {
  832. color: #ffffff;
  833. }
  834. }
  835. .el-table__fixed-right {
  836. thead {
  837. div {
  838. color: #101116;
  839. }
  840. }
  841. }
  842. .hd-td {
  843. .hd-tr {
  844. display: flex;
  845. justify-content: center;
  846. flex-direction: row;
  847. padding: 0 8px;
  848. }
  849. }
  850. }
  851. .data-table-btn {
  852. line-height: 32px;
  853. margin-bottom: 20px;
  854. }
  855. }
  856. .filter-arrow {
  857. cursor: pointer;
  858. transition: 0.3s transform;
  859. &.arrow-active {
  860. transform: rotate(-180deg);
  861. }
  862. &.arrow-blue {
  863. color: #2d7cff;
  864. font-weight: bold;
  865. }
  866. }
  867. .el-select-dropdown__item.hover {
  868. background: #d2d6df;
  869. }
  870. </style>