NodeLine.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <template>
  2. <div>
  3. <el-dialog v-model="dialogVisiblenode" width="700"
  4. :z-index='9999'
  5. align-center :append-to-body="true"
  6. class="dialog_class bgcolor tianjia asideg asidegbg leftbgimg">
  7. <template #header="{ titleId, titleClass }">
  8. <div class="my-header ">
  9. <el-image :src="icon" fit="contain"></el-image>
  10. <h4 :id="titleId" :class="titleClass"> 选择节点</h4>
  11. </div>
  12. </template>
  13. <div class="demo-input-suffix firsttitle leftbgimg2 my_content1">
  14. <div class="guand_1">
  15. <el-form-item label="节点选择" :label-width="formLabelWidth5">
  16. <el-input v-model="searchtaggd" class="w-50 m-2" placeholder="节点" />
  17. </el-form-item>
  18. <div class="asdis_btn">
  19. <div class="flex_a" style="margin-top: 10px;">
  20. <div class="btns" @click="searchgd"><span class="spantext">搜索</span></div>
  21. </div>
  22. </div>
  23. </div>
  24. <el-table :row-class-name="tableRowClassName" :max-height="tableHeight" ref="multipleTableRef"
  25. :data="tableData2" style="width: 100%" @selection-change="projectsSelectionChange" @select="projectsSelectionSelect"
  26. show-header="false"
  27. :header-cell-style="{ 'background': 'rgba(13, 22, 57, 0.96) ' }">
  28. <template v-slot:empty>
  29. <p>暂无数据</p>
  30. </template>
  31. <el-table-column type="selection" width="55" />
  32. <el-table-column property="id" label='节点编号' />
  33. <el-table-column property="name" label="名称" />
  34. <el-table-column property="ntype" label="类型" />
  35. <el-table-column property="x" label="x" />
  36. <el-table-column property="y" label="y" />
  37. <el-table-column property="z" label="z" />
  38. </el-table>
  39. <div class="demo-pagination-block" style="margin-top: 20px;">
  40. <el-config-provider :locale="zhCn">
  41. <el-pagination v-model:current-page="currentPage4" v-model:page-size="pageSize4" small background
  42. layout="prev, total,pager, next, jumpe," :total="parseInt(total)" class="mt-4"
  43. @current-change="handleCurrentChange" />
  44. </el-config-provider>
  45. </div>
  46. <div class="dialog-footer footer_div l_btn">
  47. <div class="footerbtn flex1">
  48. <div class="borderimg"><el-button @click="dialogVisiblenode = false; searchtag='';">取消</el-button></div>
  49. </div>
  50. <div class="footerbtn flex1">
  51. <div class="borderimg"><el-button @click="queding(); dialogVisiblenode = false">
  52. 确定
  53. </el-button></div>
  54. </div>
  55. </div>
  56. </div>
  57. </el-dialog>
  58. </div>
  59. </template>
  60. <script setup>
  61. import { ref, onMounted, reactive, } from "vue";
  62. import { RouterView, RouterLink } from "vue-router"
  63. import { request, uploadFile } from "@/utils/request";
  64. import { ElMessage, ElButton, ElDialog, ElSelect,ElConfigProvider } from 'element-plus'
  65. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  66. import icon from "@/assets/img/icon.png";
  67. const props = defineProps({});
  68. let emit = defineEmits(['queding'])
  69. let sdialog = ref({
  70. dianadddialog: false,
  71. })
  72. let formLabelWidth5 = ref(99)
  73. let tableHeight = ref(500);
  74. let tableData2 = ref([]);
  75. const multipleTableRef = ref()
  76. const multipleSelection = ref([])
  77. let dialogVisiblenode = ref(false);
  78. let total = ref(1);
  79. let searchtaggd = ref("");
  80. let searchtag=ref("")
  81. const currentPage4 = ref(1);
  82. const pageSize4 = ref(5)
  83. onMounted(() => {
  84. })
  85. const tableRowClassName = ({ row, rowIndex }) => {
  86. if (rowIndex % 2 != 0) {
  87. return 'evenRow';
  88. }
  89. return 'oddRow';
  90. }
  91. //节点分页查询
  92. const handleCurrentChange = (val) => {
  93. pipelinedata('');
  94. }
  95. //节点数据查询
  96. const pipelinedata = () => {
  97. const params = {
  98. transCode: 'D00000',
  99. count: pageSize4.value,
  100. page: currentPage4.value,
  101. searchtag: searchtag.value,
  102. }
  103. request(params)
  104. .then((res) => {
  105. tableData2.value = res.rows;
  106. total.value = res.total;
  107. })
  108. .catch((err) => {
  109. ElMessage.error(err.returnMsg)
  110. })
  111. }
  112. function searchgd() {
  113. searchtag.value=searchtaggd.value;
  114. pipelinedata();
  115. }
  116. const projectsSelectionChange = (val) => {
  117. // console.log(11111)
  118. // console.log(val)
  119. // if (val.length > 1) {
  120. // // 获取已选中的行数据
  121. // const selected = val.find(item => item.id === row.id);
  122. // // 如果已选中,则取消选中
  123. // // if (selected) {
  124. // // this.$refs.multipleTable.toggleRowSelection(row, false);
  125. // // }
  126. // }
  127. }
  128. //选中项
  129. const projectsSelectionSelect = (selection, row) => {
  130. if (selection.length > 1) {
  131. multipleTableRef.value.clearSelection();
  132. multipleTableRef.value.toggleRowSelection(row, true);
  133. let arrp=[];
  134. arrp.push(selection[1])
  135. multipleSelection.value = arrp;
  136. return;
  137. }
  138. // console.log(row);
  139. if (selection.length == 1) {
  140. multipleSelection.value = selection;
  141. } else if (selection.length == 0) {
  142. }
  143. }
  144. const selectfun = () => {
  145. currentPage4.value = 1;
  146. if (multipleSelection.value.length != 0) {
  147. console.log(multipleSelection.value[0]);
  148. emit('queding', multipleSelection.value[0]);
  149. } else {
  150. }
  151. }
  152. // 确定
  153. const queding = () => {
  154. searchtag.value='';
  155. selectfun();
  156. }
  157. defineExpose({ dialogVisiblenode, pipelinedata,searchtaggd });
  158. </script>
  159. <style lang="scss" scoped>
  160. .dialog_class .my-header .el-image {
  161. padding: 0px 10px 0 0 !important;
  162. }
  163. .dialog_class .my-header h4{
  164. font-size: 14px;
  165. }
  166. .vtk {
  167. position: absolute;
  168. z-index: 150;
  169. top: 70px;
  170. }
  171. .jc_padding .el-table tr {
  172. height: 30px !important;
  173. background: rgba(104, 173, 255, 0.3);
  174. box-shadow: inset 0px 0px 17px 5px rgba(111, 138, 170, 0.2);
  175. border-radius: 0px 0px 0px 0px;
  176. border: 1px solid;
  177. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  178. }
  179. .flex_a {
  180. flex: 1;
  181. padding: 0 19px;
  182. }
  183. .btns {
  184. width: 72px;
  185. height: 30px;
  186. background-image: url(../../assets/img/Rectangle399.png);
  187. background-repeat: no-repeat;
  188. line-height: 30px;
  189. overflow: hidden;
  190. margin: 10px 0;
  191. .spantext {
  192. font-weight: bold;
  193. font-size: 12px;
  194. color: #FFFFFF;
  195. text-align: left;
  196. font-style: normal;
  197. text-transform: none;
  198. }
  199. }
  200. .header_z {
  201. box-shadow: none !important;
  202. padding: 10px 20px !important;
  203. }
  204. .header_l {
  205. line-height: 10px;
  206. text-align: left;
  207. padding: 0 20px;
  208. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  209. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  210. border-radius: 0px 0px 0px 0px;
  211. .el-image {
  212. padding: 10px 10px 0 0;
  213. }
  214. h4 {
  215. font-weight: bold;
  216. font-size: 12px;
  217. color: #68ADFF;
  218. line-height: 14px;
  219. text-align: left;
  220. font-style: normal;
  221. text-transform: none;
  222. }
  223. }
  224. .jc_padding {
  225. padding: 18px 10px;
  226. }
  227. .line {
  228. border-bottom: 1px solid rgba(255, 255, 255, 0.20);
  229. box-sizing: border-box;
  230. }
  231. .L_aside {
  232. .iconimg {
  233. width: 37px;
  234. height: 36px;
  235. margin: 0 7px 0 24px;
  236. }
  237. }
  238. .ddd {
  239. margin-top: 20px;
  240. .ddd_div {
  241. padding: 20px 0;
  242. position: relative;
  243. }
  244. .class_btn {
  245. position: absolute;
  246. right: 0;
  247. top: 21px;
  248. }
  249. }
  250. .el-dialog__title {
  251. display: inline-block;
  252. }
  253. .bgcolor {
  254. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  255. border-radius: 0px 0px 0px 0px;
  256. border: 1px solid;
  257. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  258. }
  259. .dialog_class {
  260. .my-header {
  261. line-height: 10px;
  262. height: 40px;
  263. text-align: left;
  264. padding: 0 20px;
  265. border-bottom: 1px solid;
  266. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  267. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  268. border-radius: 0px 0px 0px 0px;
  269. .el-image {
  270. padding: 10px 10px 0 0;
  271. }
  272. h4 {
  273. font-weight: bold;
  274. font-size: 14px;
  275. color: #68ADFF;
  276. line-height: 14px;
  277. text-align: left;
  278. font-style: normal;
  279. text-transform: none;
  280. }
  281. }
  282. .my_content {
  283. width: 100%;
  284. height: 90px;
  285. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  286. border-radius: 0px 0px 0px 0px;
  287. position: relative;
  288. .radio-group {
  289. display: flex;
  290. justify-content: center;
  291. .el-radio {
  292. flex: 1;
  293. justify-content: center;
  294. font-weight: bold;
  295. font-size: 12px;
  296. color: #FFFFFF;
  297. line-height: 14px;
  298. }
  299. }
  300. }
  301. .el-dialog__footer {
  302. position: absolute;
  303. bottom: 17px;
  304. display: flex;
  305. .footerbtn {
  306. flex: 1;
  307. text-align: center;
  308. }
  309. }
  310. }
  311. .my_content1 {
  312. .el-table .cell {
  313. font-weight: 400;
  314. font-size: 12px;
  315. color: #FFFFFF !important;
  316. line-height: 14px;
  317. text-align: left;
  318. font-style: normal;
  319. text-transform: none;
  320. }
  321. }
  322. .el-table,
  323. .el-table thead th {
  324. background-color: rgba(13, 22, 57, 0.96) !important;
  325. }
  326. .el-form-item__label {
  327. color: #FFFFFF !important;
  328. }
  329. .jiancedian {
  330. width: 380px;
  331. position: absolute;
  332. right: 0;
  333. top: 70px;
  334. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  335. border-radius: 4px 4px 4px 4px;
  336. border: 1px solid;
  337. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  338. }
  339. .el-table__fixed-header-wrapper .el-table-column--selection{
  340. display: none;
  341. // border: 1px solid red;
  342. // text-indent:-999999px;
  343. }
  344. </style>