MenuPhysics.vue 16 KB

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