MenuPhysics.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. <template>
  2. <!-- 表格表头不一样wuli -->
  3. <div class="l_Dialog">
  4. <el-dialog v-model="sendialogVisible" width="470" align-center :modal="false" :close-on-click-modal="false"
  5. modal-class="summary-dlg" draggable class="dialog_class bgcolor zhucentent ">
  6. <template #header="{ titleId, titleClass }">
  7. <div class="my-header xinxi_header">
  8. <el-image :src="icon" fit="contain"></el-image>
  9. <h4 :id="titleId" :class="titleClass">物理属性</h4>
  10. </div>
  11. </template>
  12. <div class="classtab">
  13. <div class="asides_content">
  14. <div class="jc_content tablecolor jc_content">
  15. <div class="font12 my_content1">
  16. <div class="btncolor tablefocus bmar">
  17. <el-table :data="tableData" style="width:480px" :max-height="tableHeight"
  18. :highlight-current-row="currentrow" :row-class-name="tableRowClassName"
  19. @row-click="handleDelete($event)"
  20. :header-cell-style="{ 'background': 'rgba(13, 22, 57, 0.9) ' }">
  21. <el-table-column prop="name" label="名称" />
  22. <el-table-column prop="density" label="密度" />
  23. <el-table-column prop="diffcoe" label="扩散系数" />
  24. <el-table-column prop="speheat" label="比热" />
  25. </el-table>
  26. </div>
  27. </div>
  28. <div class="dialog-footer footer_div l_btn">
  29. <div class="footerbtn flex1">
  30. <div class="borderimg"><el-button @click="addsg();">添加</el-button></div>
  31. </div>
  32. <div class="footerbtn flex1">
  33. <div class="borderimg"><el-button @click="shanchu()">
  34. 删除
  35. </el-button></div>
  36. </div>
  37. <div class="footerbtn flex1">
  38. <div class="borderimg"><el-button @click="amend()">
  39. 修改
  40. </el-button></div>
  41. </div>
  42. <div class="footerbtn flex1">
  43. <div class="borderimg"><el-button @click="sendialogVisible = false;currentrow=false;">
  44. 确认
  45. </el-button></div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </el-dialog>
  52. <!-- 添加 -->
  53. <el-dialog v-model="addVisible" width="400" class="dialog_class bgcolor tianjia foter_l tianjia">
  54. <template #header="{ titleId, titleClass }">
  55. <div class="my-header ">
  56. <el-image :src="icon" fit="contain"></el-image>
  57. <h4 :id="titleId" :class="titleClass">{{ add }}</h4>
  58. </div>
  59. </template>
  60. <el-form class="demo-form-inline" :inline="true" :model="wuliobj">
  61. <el-form-item label="编号" :label-width="formLabelWidth6">
  62. <el-input v-model="wuliobj.code" maxlength="15" class="w-50 m-2" placeholder="请输入" />
  63. </el-form-item>
  64. <el-form-item label="名称" :label-width="formLabelWidth6">
  65. <el-input v-model="wuliobj.name" maxlength="18" class="w-50 m-2" placeholder="请输入" />
  66. </el-form-item>
  67. <el-form-item label="密度" :label-width="formLabelWidth6">
  68. <el-input v-model="wuliobj.density" maxlength="15" oninput ="value=value.replace(/[^0-9.]/g,'')" class="w-50 m-2" placeholder="请输入" />
  69. </el-form-item>
  70. <el-form-item label="扩散系数" :label-width="formLabelWidth6">
  71. <el-input v-model="wuliobj.diffcoe" maxlength="15" oninput ="value=value.replace(/[^0-9.]/g,'')" class="w-50 m-2" placeholder="请输入" />
  72. </el-form-item>
  73. <el-form-item label="比热" :label-width="formLabelWidth6">
  74. <el-input v-model="wuliobj.speheat" maxlength="15" oninput ="value=value.replace(/[^0-9.]/g,'')" class="w-50 m-2" placeholder="请输入" />
  75. </el-form-item>
  76. </el-form>
  77. <div class="dialog-footer footer_div l_btn">
  78. <div class="footerbtn flex1">
  79. <div class="borderimg"><el-button @click="addVisible = false">取消</el-button></div>
  80. </div>
  81. <div class="footerbtn flex1">
  82. <div class="borderimg"><el-button @click="addEied(); addVisible = false">
  83. 确定
  84. </el-button></div>
  85. </div>
  86. </div>
  87. </el-dialog>
  88. <!-- 删除 -->
  89. <el-dialog v-model="dialogsgdelect" width="400" class="dialog_class bgcolor tianjia">
  90. <template #header="{ titleId, titleClass }">
  91. <div class="my-header ">
  92. <el-image :src="icon" fit="contain"></el-image>
  93. <h4 :id="titleId" :class="titleClass">删除框</h4>
  94. </div>
  95. </template>
  96. <h4 class="delecttitle"> 是否确认删除名称 <span class="spanclad">{{ zqname }}</span></h4>
  97. <div class="dialog-footer footer_div l_btn">
  98. <div class="footerbtn flex1">
  99. <div class="borderimg"><el-button @click="dialogsgdelect = false">取消</el-button></div>
  100. </div>
  101. <div class="footerbtn flex1">
  102. <div class="borderimg"><el-button @click="fundeledata(); dialogsgdelect = false">
  103. 确定
  104. </el-button></div>
  105. </div>
  106. </div>
  107. </el-dialog>
  108. <!-- 选择管道 -->
  109. </div>
  110. </template>
  111. <script setup>
  112. import { computed, ref, onMounted, reactive, toRef } from "vue";
  113. import { request, uploadFile } from "@/utils/request";
  114. import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
  115. import icon from "@/assets/img/icon.png";
  116. import { timestampToTime } from '@/js/lindex.js'
  117. let pipeline = ref();
  118. let sendialogVisible = ref(false);
  119. let currentrow=ref(true);
  120. let addVisible = ref(false);
  121. let dialogsgdelect = ref(false)
  122. let classradio1 = ref('Fire');
  123. const formLabelWidth6 = ref(100);
  124. let add = ref("")
  125. const resultactiveName = ref("first");
  126. let tableHeight = ref(570);
  127. let tableData = ref([]);
  128. let tableobj = ref({});
  129. let zqname = ref();
  130. let wuliobj = ref({
  131. coid:'',
  132. code: '',
  133. name:'',
  134. density: "",
  135. diffcoe: '',
  136. speheat: '',
  137. })
  138. let source = ref({
  139. selectstr: '',
  140. site: ''
  141. })
  142. let firepid = ref("")
  143. const tableRowClassName = ({ row, rowIndex }) => {
  144. if (rowIndex % 2 != 0) {
  145. return 'evenRow';
  146. }
  147. return 'oddRow';
  148. }
  149. // 选中一行
  150. const handleDelete = (val) => {
  151. currentrow.value=true;
  152. tableobj.value = val;
  153. console.log(tableobj.value)
  154. }
  155. // 删除
  156. const shanchu = () => {
  157. if (JSON.stringify(tableobj.value) == '{}') {
  158. ElMessage.error("你还没有选中修改的项目")
  159. } else {
  160. dialogsgdelect.value = true
  161. zqname.value = tableobj.value.name;
  162. }
  163. }
  164. const fundeledata = () => {
  165. console.log(zqname.value);
  166. const params = {
  167. transCode: 'D10015',
  168. coid: tableobj.value.coid
  169. }
  170. request(params)
  171. .then((res) => {
  172. getsensor();
  173. })
  174. .catch((err) => {
  175. ElMessage.error(err.returnMsg)
  176. })
  177. }
  178. onMounted(() => {
  179. getsensor();
  180. });
  181. // 查询
  182. const getsensor = () => {
  183. const params = {
  184. transCode: 'D10013',
  185. }
  186. request(params)
  187. .then((res) => {
  188. tableData.value = res.rows;
  189. })
  190. .catch((err) => {
  191. ElMessage.error(err.returnMsg)
  192. })
  193. }
  194. //添加
  195. const addsg = () => {
  196. add.value = "添加";
  197. currentrow.value=false;
  198. addVisible.value = true;
  199. wuliobj.value.coid = '';
  200. wuliobj.value.code = '';
  201. wuliobj.value.name = '';
  202. wuliobj.value.density = '';
  203. wuliobj.value.diffcoe = '';
  204. wuliobj.value.speheat = '';
  205. }
  206. // 添加修改的接口
  207. const addEied = () => {
  208. const params = {
  209. transCode: 'D10014',
  210. coid: wuliobj.value.coid,
  211. code: wuliobj.value.code,
  212. name: wuliobj.value.name ,
  213. density: wuliobj.value.density,
  214. diffcoe:wuliobj.value.diffcoe,
  215. speheat:wuliobj.value.speheat,
  216. }
  217. request(params)
  218. .then((res) => {
  219. tableData.value = res.rows;
  220. getsensor();
  221. })
  222. .catch((err) => {
  223. ElMessage.error(err.returnMsg)
  224. })
  225. }
  226. //修改
  227. const amend = () => {
  228. add.value = "修改";
  229. if (JSON.stringify(tableobj.value) == '{}') {
  230. ElMessage.error("你还没有选中修改的项目")
  231. } else {
  232. addVisible.value = true;
  233. wuliobj.value.coid = tableobj.value.coid;
  234. wuliobj.value.code =tableobj.value.code;
  235. wuliobj.value.name = tableobj.value.name;
  236. wuliobj.value.density = tableobj.value.density;
  237. wuliobj.value.diffcoe =tableobj.value.diffcoe;
  238. wuliobj.value.speheat =tableobj.value.speheat;
  239. }
  240. }
  241. defineExpose({ sendialogVisible, });
  242. </script>
  243. <style lang="scss" scoped>
  244. .jc_padding .el-table tr {
  245. height: 30px !important;
  246. background: rgba(104, 173, 255, 0.3);
  247. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  248. border-radius: 0px 0px 0px 0px;
  249. border: 1px solid;
  250. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  251. }
  252. .flex_a {
  253. flex: 1;
  254. padding: 0 19px;
  255. }
  256. .btns {
  257. width: 72px;
  258. height: 30px;
  259. background-image: url(../../assets/img/Rectangle399.png);
  260. background-repeat: no-repeat;
  261. line-height: 30px;
  262. overflow: hidden;
  263. margin: 10px 0;
  264. .spantext {
  265. font-weight: bold;
  266. font-size: 12px;
  267. color: #FFFFFF;
  268. text-align: left;
  269. font-style: normal;
  270. text-transform: none;
  271. }
  272. }
  273. .header_z {
  274. box-shadow: none !important;
  275. padding: 10px 20px !important;
  276. }
  277. .header_l {
  278. line-height: 10px;
  279. // height: 40px;
  280. text-align: left;
  281. padding: 0 20px;
  282. // border-bottom: 1px solid;
  283. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  284. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  285. border-radius: 0px 0px 0px 0px;
  286. .el-image {
  287. padding: 10px 10px 0 0;
  288. }
  289. h4 {
  290. font-weight: bold;
  291. font-size: 12px;
  292. color: #68ADFF;
  293. line-height: 14px;
  294. text-align: left;
  295. font-style: normal;
  296. text-transform: none;
  297. }
  298. }
  299. .jc_padding {
  300. padding: 18px 10px;
  301. }
  302. .line {
  303. border-bottom: 1px solid rgba(255, 255, 255, 0.20);
  304. box-sizing: border-box;
  305. }
  306. .L_aside {
  307. .iconimg {
  308. width: 37px;
  309. height: 36px;
  310. margin: 0 7px 0 24px;
  311. }
  312. }
  313. .ddd {
  314. margin-top: 20px;
  315. .ddd_div {
  316. padding: 20px 0;
  317. position: relative;
  318. }
  319. .class_btn {
  320. position: absolute;
  321. right: 0;
  322. top: 21px;
  323. }
  324. .header_l {
  325. line-height: 10px;
  326. // height: 40px;
  327. text-align: left;
  328. padding: 0 20px;
  329. // border-bottom: 1px solid;
  330. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  331. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  332. border-radius: 0px 0px 0px 0px;
  333. .el-image {
  334. padding: 10px 10px 0 0;
  335. }
  336. h4 {
  337. font-weight: bold;
  338. font-size: 12px;
  339. color: #68ADFF;
  340. line-height: 14px;
  341. text-align: left;
  342. font-style: normal;
  343. text-transform: none;
  344. }
  345. }
  346. }
  347. .el-dialog__title {
  348. display: inline-block;
  349. }
  350. .bgcolor {
  351. // width: 482px;
  352. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  353. border-radius: 0px 0px 0px 0px;
  354. border: 1px solid;
  355. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  356. }
  357. .dialog_class {
  358. .my-header {
  359. line-height: 10px;
  360. height: 40px;
  361. text-align: left;
  362. padding: 0 20px;
  363. border-bottom: 1px solid;
  364. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  365. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  366. border-radius: 0px 0px 0px 0px;
  367. .el-image {
  368. padding: 10px 10px 0 0;
  369. }
  370. h4 {
  371. font-weight: bold;
  372. font-size: 12px;
  373. color: #68ADFF;
  374. line-height: 14px;
  375. text-align: left;
  376. font-style: normal;
  377. text-transform: none;
  378. }
  379. }
  380. .my_content {
  381. width: 100%;
  382. height: 90px;
  383. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  384. border-radius: 0px 0px 0px 0px;
  385. position: relative;
  386. .radio-group {
  387. display: flex;
  388. justify-content: center;
  389. .el-radio {
  390. flex: 1;
  391. justify-content: center;
  392. font-weight: bold;
  393. font-size: 12px;
  394. color: #FFFFFF;
  395. line-height: 14px;
  396. }
  397. }
  398. }
  399. .el-dialog__footer {
  400. position: absolute;
  401. bottom: 17px;
  402. display: flex;
  403. .footerbtn {
  404. flex: 1;
  405. text-align: center;
  406. }
  407. }
  408. }
  409. .my_content1 {
  410. .el-table .cell {
  411. font-weight: 400;
  412. font-size: 12px;
  413. color: #FFFFFF !important;
  414. line-height: 14px;
  415. text-align: left;
  416. font-style: normal;
  417. text-transform: none;
  418. }
  419. }
  420. .l_btn .borderimg {
  421. width: 70px;
  422. height: 30px;
  423. font-size: 12px;
  424. background: rgba(104, 173, 255, 0.3);
  425. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  426. /* border: 1px solid rgba(31, 107, 255, 1); */
  427. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  428. font-weight: bold;
  429. border-radius: 4px;
  430. display: flex;
  431. display: inline-block;
  432. box-sizing: border-box;
  433. }
  434. .borderimg {
  435. width: 109px;
  436. height: 30px;
  437. background: rgba(104, 173, 255, 0.3);
  438. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  439. /* border: 1px solid rgba(31, 107, 255, 1); */
  440. -o-border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  441. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  442. border-radius: 4px;
  443. display: flex;
  444. display: inline-block;
  445. box-sizing: border-box
  446. }
  447. .el-table,
  448. .el-table thead th {
  449. background-color: rgba(13, 22, 57, 0.96) !important;
  450. }
  451. .L_aside {
  452. height: calc(100vh - 70px);
  453. position: absolute;
  454. top: 70px;
  455. overflow: hidden;
  456. }
  457. .el-form-item__label {
  458. color: #FFFFFF !important;
  459. }
  460. .jiancedian {
  461. width: 380px;
  462. position: absolute;
  463. right: 0;
  464. top: 70px;
  465. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  466. border-radius: 4px 4px 4px 4px;
  467. border: 1px solid;
  468. border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
  469. }
  470. </style>
  471. <style>
  472. .wuli .el-table .el-table__header .el-table__cell{
  473. height:48px !important;
  474. text-align: center;
  475. }
  476. .wuli .el-table .el-table__header .el-table__cell .cell{
  477. text-align: center;
  478. position: relative;
  479. }
  480. .wuli .el-table .el-table__header {
  481. /*
  482. border-top: 1px solid !important;
  483. border-bottom: 1px solid !important;
  484. border-image: linear-gradient(237deg, rgba(16, 92, 240, 1), rgba(164, 195, 255, 1)) 1 1; */
  485. }
  486. .wuli .el-table .el-table__header .el-table__cell:before{
  487. content: '';
  488. width: 100%;
  489. height: 1px;
  490. background-color:rgba(16, 92, 240, 1);
  491. position: absolute;
  492. left: 0;
  493. bottom: 0;
  494. transform: scaleY(0.5);
  495. }
  496. .wuli .el-table .el-table__header .el-table__cell::after{
  497. content: " ";
  498. position: absolute;
  499. top: 0;
  500. left: 0;
  501. width: 200%;
  502. height: 200%;
  503. border-right: 1px solid;
  504. border-top: 1px solid;
  505. border-bottom: 1px solid;
  506. border-image: linear-gradient(180deg, rgb(31, 107, 255), rgba(31, 107, 255, 0.48)) 1 1;
  507. box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  508. transform-origin: 0 0;
  509. transform: scale(0.5);
  510. }
  511. </style>