You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Model.vue 23 kB

4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. <template>
  2. <div>
  3. <div class="ui container" id="header">
  4. <el-row style="margin-top: 15px">
  5. <el-table
  6. ref="table"
  7. :data="tableData"
  8. style="min-width: 100%"
  9. row-key="rowKey"
  10. lazy
  11. :load="load"
  12. :tree-props="{ children: 'Children', hasChildren: 'hasChildren' }"
  13. :header-cell-style="tableHeaderStyle"
  14. >
  15. <el-table-column
  16. prop="name"
  17. :label="i18n.model_name"
  18. align="left"
  19. min-width="20%"
  20. >
  21. <template slot-scope="scope">
  22. <div class="expand-icon" v-if="scope.row.hasChildren === false">
  23. <i class="el-icon-arrow-right"></i>
  24. </div>
  25. <!-- <i class="el-icon-time"></i> -->
  26. <span v-if="!scope.row.Children" :class="scope.row.modelType == '1' ? 'm-local' : 'm-online'">{{ scope.row.modelType == '1' ? i18n.local : i18n.online }}</span>
  27. <a
  28. class="text-over"
  29. :href="showinfoHref + encodeURIComponent(scope.row.name)"
  30. :title="scope.row.name"
  31. >{{ scope.row.name }}</a
  32. >
  33. </template>
  34. </el-table-column>
  35. <el-table-column
  36. prop="version"
  37. :label="i18n.model_version"
  38. align="center"
  39. min-width="6%"
  40. >
  41. <template slot-scope="scope">
  42. <span class="text-over" :title="scope.row.version">{{
  43. scope.row.version
  44. }}</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column
  48. prop="versionCount"
  49. :label="i18n.model_version_num"
  50. align="center"
  51. min-width="7%"
  52. >
  53. <template slot-scope="scope">
  54. <span class="text-over" :title="scope.row.versionCount">{{
  55. scope.row.versionCount
  56. }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column
  60. prop="size"
  61. :label="i18n.model_size"
  62. align="center"
  63. min-width="10%"
  64. >
  65. <template slot-scope="scope">
  66. <span class="text-over">{{ renderSize(scope.row.size) }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column
  70. prop="engineName"
  71. :label="i18n.model_egine"
  72. align="center"
  73. min-width="8%"
  74. >
  75. <template slot-scope="scope">
  76. <span class="text-over" :title="scope.row.engineName">{{
  77. scope.row.engineName
  78. }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column
  82. prop="computeResource"
  83. :label="i18n.model_compute_resource"
  84. align="center"
  85. min-width="8%"
  86. >
  87. <template slot-scope="scope">
  88. <span class="text-over">{{ scope.row.computeResource }}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column
  92. prop="isPrivate"
  93. :label="i18n.model_status"
  94. align="center"
  95. min-width="6.75%"
  96. >
  97. <template slot-scope="scope">
  98. <span class="text-over" :title="scope.row.status_title">
  99. <i style="vertical-align: middle" :class="scope.row.status"></i
  100. ></span>
  101. <span class="text-over" :title="scope.row.isPrivate">
  102. {{transStatus(scope.row.isPrivate)}}
  103. </span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column
  107. prop="createdUnix"
  108. :label="i18n.model_create_time"
  109. align="center"
  110. min-width="13.75%"
  111. >
  112. <template slot-scope="scope">
  113. {{ transTime(scope.row.createdUnix) }}
  114. </template>
  115. </el-table-column>
  116. <el-table-column
  117. prop="userName"
  118. :label="i18n.model_creator"
  119. align="center"
  120. min-width="6.75%"
  121. >
  122. <template slot-scope="scope">
  123. <a
  124. :href="!scope.row.userName ? '#' : '/' + scope.row.userName"
  125. :title="scope.row.userName || defaultAvatarName"
  126. >
  127. <img
  128. class="ui avatar image"
  129. :src="scope.row.userRelAvatarLink || defaultAvatar"
  130. />
  131. </a>
  132. </template>
  133. </el-table-column>
  134. <el-table-column
  135. :label="i18n.model_operation"
  136. min-width="15%"
  137. align="center"
  138. >
  139. <template slot-scope="scope">
  140. <div class="space-around" >
  141. <a class="op-btn"
  142. v-show="scope.row.modelType == 1"
  143. :href="url + 'create_local_model_1?type=1&name=' + encodeURIComponent(scope.row.name) + '&id=' + scope.row.id"
  144. :class="{ disabled: !scope.row.isCanOper }"
  145. >{{ i18n.modify }}</a>
  146. <a class="op-btn" v-show="scope.row.modelType != 1" style="color:transparent;cursor:default;" >{{ i18n.modify }}</a>
  147. <a class="op-btn" v-show="repoIsPrivate == false && scope.row.isPrivate==true && scope.row.isCanOper">{{ i18n.modelaccess_setpublic }}</a>
  148. <a class="op-btn" v-show="repoIsPrivate == false && scope.row.isPrivate==false && scope.row.isCanOper">{{ i18n.modelaccess_setprivate }}</a>
  149. <a class="op-btn"
  150. :href="loadhref + scope.row.id"
  151. :class="{ disabled: !scope.row.isCanDownload }"
  152. >{{ i18n.model_download }}</a>
  153. <a class="op-btn"
  154. :class="{ disabled: !scope.row.isCanDelete }"
  155. @click="
  156. deleteModel(scope.row.id, scope.row.cName, scope.row.rowKey)
  157. "
  158. >{{ i18n.model_delete }}</a>
  159. </div>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. </el-row>
  164. <div class="ui container" style="margin-top: 50px; text-align: center">
  165. <el-pagination
  166. background
  167. @size-change="handleSizeChange"
  168. @current-change="handleCurrentChange"
  169. :current-page="currentPage"
  170. :page-sizes="[5, 10, 15]"
  171. :page-size="pageSize"
  172. layout="total, sizes, prev, pager, next, jumper"
  173. :total="totalNum"
  174. >
  175. </el-pagination>
  176. </div>
  177. </div>
  178. </div>
  179. </template>
  180. <script>
  181. const { _AppSubUrl, _StaticUrlPrefix, csrf } = window.config;
  182. const REPOISPRIVATE = window.REPO_IS_PRIVATE;
  183. export default {
  184. components: {},
  185. data() {
  186. return {
  187. i18n: {},
  188. currentPage: 1,
  189. pageSize: 10,
  190. totalNum: 0,
  191. params: { page: 0, pageSize: 10 },
  192. tableData: [],
  193. url: "",
  194. isLoading: true,
  195. loadNodeMap: new Map(),
  196. submitId: {},
  197. defaultAvatar: "/user/avatar/Ghost/-1",
  198. defaultAvatarName: "Ghost",
  199. data: "",
  200. timer: null,
  201. timerFlag: false,
  202. repoIsPrivate: REPOISPRIVATE,
  203. };
  204. },
  205. methods: {
  206. load(tree, treeNode, resolve) {
  207. try {
  208. this.loadNodeMap.set(tree.cName, { tree, treeNode, resolve });
  209. this.$axios
  210. .get(this.url + "show_model_child_api", {
  211. params: {
  212. name: tree.cName,
  213. },
  214. })
  215. .then((res) => {
  216. let trainTaskInfo;
  217. let tableData;
  218. tableData = res.data;
  219. for (let i = 0; i < tableData.length; i++) {
  220. trainTaskInfo = JSON.parse(tableData[i].trainTaskInfo || '{}');
  221. tableData[i].engineName = this.getEngineName(tableData[i]);
  222. // tableData[i].computeResource = trainTaskInfo.ComputeResource;
  223. tableData[i].computeResource = tableData[i].type == '0' ? 'CPU/GPU' : 'NPU';
  224. tableData[i].cName = tableData[i].name;
  225. tableData[i].rowKey = tableData[i].id + Math.random();
  226. tableData[i].name = "";
  227. tableData[i].versionCount = "";
  228. tableData[i].Children = true;
  229. }
  230. resolve(tableData || []);
  231. });
  232. } catch (e) {
  233. this.loading = false;
  234. }
  235. },
  236. tableHeaderStyle({ row, column, rowIndex, columnIndex }) {
  237. if (rowIndex === 0) {
  238. return "background:#f5f5f6;color:#606266";
  239. }
  240. },
  241. handleSizeChange(val) {
  242. this.params.pageSize = val;
  243. this.getModelList();
  244. },
  245. handleCurrentChange(val) {
  246. this.params.page = val;
  247. this.getModelList();
  248. },
  249. showcreateVue(name, version, label) {
  250. let title = this.i18n.model_create_version_title;
  251. $(".ui.modal.second")
  252. .modal({
  253. centered: false,
  254. onShow: function () {
  255. $("#model_header").text(title);
  256. $('input[name="name"]').addClass("model_disabled");
  257. $('input[name="name"]').attr("readonly", "readonly");
  258. $('input[name="modelSelectedFile"]').attr("readonly", "readonly");
  259. $('input[name="version"]').addClass("model_disabled");
  260. $(".ui.dimmer").css({
  261. "background-color": "rgb(136, 136, 136,0.7)",
  262. });
  263. $("#job-name").empty();
  264. $("#name").val(name);
  265. $("#label").val(label);
  266. let version_string = versionAdd(version);
  267. $("#version").val(version_string);
  268. loadTrainList();
  269. },
  270. onHide: function () {
  271. document.getElementById("formId").reset();
  272. $('input[name="name"]').removeClass("model_disabled");
  273. $('input[name="name"]').removeAttr("readonly");
  274. $('input[name="modelSelectedFile"]').removeAttr("readonly");
  275. var cityObj = $("#modelSelectedFile");
  276. cityObj.attr("value", "");
  277. $("#choice_model").dropdown("clear");
  278. $("#choice_version").dropdown("clear");
  279. $("#choice_Engine").dropdown("clear");
  280. $(".ui.dimmer").css({ "background-color": "" });
  281. $(".ui.error.message").text();
  282. $(".ui.error.message").css("display", "none");
  283. },
  284. })
  285. .modal("show");
  286. },
  287. check() {
  288. let jobid = document.getElementById("jobId").value;
  289. let versionname = document.getElementById("versionName").value;
  290. let name = document.getElementById("name").value;
  291. let version = document.getElementById("version").value;
  292. let modelSelectedFile =
  293. document.getElementById("modelSelectedFile").value;
  294. if (jobid == "") {
  295. $(".required.ten.wide.field").addClass("error");
  296. return false;
  297. } else {
  298. $(".required.ten.wide.field").removeClass("error");
  299. }
  300. if (modelSelectedFile == "") {
  301. $("#modelSelectedFile").addClass("error");
  302. return false;
  303. } else {
  304. $("#modelSelectedFile").removeClass("error");
  305. }
  306. if (versionname == "") {
  307. $(".required.six.widde.field").addClass("error");
  308. return false;
  309. } else {
  310. $(".required.six.widde.field").removeClass("error");
  311. }
  312. if (name == "") {
  313. $("#modelname").addClass("error");
  314. return false;
  315. } else {
  316. $("#modelname").removeClass("error");
  317. }
  318. if (versionname == "") {
  319. $("#verionname").addClass("error");
  320. return false;
  321. } else {
  322. $("#verionname").removeClass("error");
  323. }
  324. return true;
  325. },
  326. submit() {
  327. let context = this;
  328. let flag = this.check();
  329. if (flag) {
  330. let cName = $("input[name='name']").val();
  331. let version = $("input[name='version']").val();
  332. let data = $("#formId").serialize();
  333. const initModel = $("input[name='initModel']").val();
  334. let url_href =
  335. version === "0.0.1"
  336. ? context.url_create_newModel
  337. : context.url_create_newVersion;
  338. $("#mask").css({ display: "block", "z-index": "9999" });
  339. $.ajax({
  340. url: url_href,
  341. type: "POST",
  342. data: data,
  343. success: function (res) {
  344. context.getModelList();
  345. $("input[name='modelSelectedFile']").val("");
  346. $(".ui.modal.second").modal("hide");
  347. if (initModel === "0") {
  348. location.reload();
  349. }
  350. },
  351. error: function (xhr) {
  352. // 隐藏 loading
  353. // 只有请求不正常(状态码不为200)才会执行
  354. $(".ui.error.message").text(xhr.responseText);
  355. $(".ui.error.message").css("display", "block");
  356. },
  357. complete: function (xhr) {
  358. $("#mask").css({ display: "none", "z-index": "1" });
  359. },
  360. });
  361. } else {
  362. return false;
  363. }
  364. },
  365. loadrefresh(row) {
  366. const store = this.$refs.table.store;
  367. if (!this.loadNodeMap.get(row.cName)) {
  368. const parent = store.states.data;
  369. const index = parent.findIndex((child) => child.rowKey == row.rowKey);
  370. this.getModelList();
  371. } else {
  372. let { tree, treeNode, resolve } = this.loadNodeMap.get(row.cName);
  373. const keys = Object.keys(store.states.lazyTreeNodeMap);
  374. if (keys.includes(row.rowKey)) {
  375. this.getModelList();
  376. } else {
  377. let parentRow = store.states.data.find(
  378. (child) => child.cName == row.cName
  379. );
  380. let childrenIndex = store.states.lazyTreeNodeMap[
  381. parentRow.rowKey
  382. ].findIndex((child) => child.rowKey == row.rowKey);
  383. parentRow.versionCount = parentRow.versionCount - 1;
  384. const parent = store.states.lazyTreeNodeMap[parentRow.rowKey];
  385. if (parent.length === 1) {
  386. this.getModelList();
  387. } else {
  388. parent.splice(childrenIndex, 1);
  389. }
  390. }
  391. }
  392. },
  393. deleteModel(id, name, rowKey) {
  394. let row = { cName: name, id: id, rowKey: rowKey };
  395. let _this = this;
  396. let flag = 1;
  397. $(".ui.basic.modal.first")
  398. .modal({
  399. onDeny: function () {
  400. flag = false;
  401. },
  402. onApprove: function () {
  403. _this.$axios
  404. .delete(_this.url + "delete_model", {
  405. params: {
  406. id: id,
  407. },
  408. })
  409. .then((res) => {
  410. _this.loadrefresh(row);
  411. // _this.getModelList()
  412. });
  413. flag = true;
  414. },
  415. onHidden: function () {
  416. if (flag == false) {
  417. $(".alert")
  418. .html("您已取消操作")
  419. .removeClass("alert-success")
  420. .addClass("alert-danger")
  421. .show()
  422. .delay(1500)
  423. .fadeOut();
  424. } else {
  425. $(".alert")
  426. .html("删除成功")
  427. .removeClass("alert-danger")
  428. .addClass("alert-success")
  429. .show()
  430. .delay(1500)
  431. .fadeOut();
  432. }
  433. },
  434. })
  435. .modal("show");
  436. },
  437. getEngineName(model) {
  438. if (model.engine == 0) {
  439. return "PyTorch";
  440. } else if (model.engine == 1 || model.engine == 121) {
  441. return "TensorFlow";
  442. } else if (
  443. model.engine == 2 ||
  444. model.engine == 122 ||
  445. model.engine == 35
  446. ) {
  447. return "MindSpore";
  448. } else if (model.engine == 4) {
  449. return "PaddlePaddle";
  450. } else if (model.engine == 5) {
  451. return "OneFlow";
  452. } else if (model.engine == 6) {
  453. return "MXNet";
  454. } else {
  455. return "Other";
  456. }
  457. },
  458. intervalModelist() {
  459. if (!this.timerFlag) {
  460. this.timer = setInterval(() => {
  461. this.getModelList();
  462. }, 10000);
  463. }
  464. },
  465. getModelList() {
  466. let countStatus = 0;
  467. try {
  468. this.loadNodeMap.clear();
  469. this.$axios
  470. .get(this.url + "show_model_api", {
  471. params: this.params,
  472. })
  473. .then((res) => {
  474. $(".ui.grid").removeAttr("style");
  475. $("#loadContainer").removeClass("loader");
  476. let trainTaskInfo;
  477. this.tableData = res.data.data;
  478. for (let i = 0; i < this.tableData.length; i++) {
  479. trainTaskInfo = JSON.parse(this.tableData[i].trainTaskInfo || '{}');
  480. this.tableData[i].cName = this.tableData[i].name;
  481. this.tableData[i].rowKey = this.tableData[i].id + Math.random();
  482. this.tableData[i].engineName = this.getEngineName(
  483. this.tableData[i]
  484. );
  485. // this.tableData[i].computeResource = trainTaskInfo.ComputeResource;
  486. this.tableData[i].computeResource = this.tableData[i].type == '0' ? 'CPU/GPU' : 'NPU';
  487. this.tableData[i].hasChildren = res.data.data[i].versionCount === 1 ? false : true;
  488. if (this.tableData[i].status !== 1) {
  489. countStatus++;
  490. }
  491. switch (this.tableData[i].status) {
  492. case 1:
  493. this.tableData[i].status = "WAITING";
  494. this.tableData[i].status_title = this.i18n.model_wait;
  495. break;
  496. case 2:
  497. this.tableData[i].status = "FAILED";
  498. this.tableData[i].status_title = this.tableData[i].statusDesc;
  499. break;
  500. default:
  501. this.tableData[i].status = "SUCCEEDED";
  502. this.tableData[i].status_title = this.i18n.model_success;
  503. break;
  504. }
  505. }
  506. this.totalNum = res.data.count;
  507. if (countStatus === this.tableData.length) {
  508. clearInterval(this.timer);
  509. this.timer = null;
  510. this.timerFlag = false;
  511. } else {
  512. this.intervalModelist();
  513. this.timerFlag = true;
  514. }
  515. })
  516. .catch((err) => {
  517. console.log(err);
  518. });
  519. } catch (e) {
  520. console.log(e);
  521. }
  522. },
  523. },
  524. computed: {
  525. loadhref() {
  526. return this.url + "downloadall?id=";
  527. },
  528. showinfoHref() {
  529. return this.url + "show_model_info?name=";
  530. },
  531. transStatus(){
  532. return function (state) {
  533. if(state){
  534. return this.i18n.modelaccess_private;
  535. }
  536. return this.i18n.modelaccess_public;
  537. }
  538. },
  539. transTime() {
  540. return function (time) {
  541. let date = new Date(time * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  542. let Y = date.getFullYear() + "-";
  543. let M =
  544. (date.getMonth() + 1 < 10
  545. ? "0" + (date.getMonth() + 1)
  546. : date.getMonth() + 1) + "-";
  547. let D =
  548. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  549. let h =
  550. (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) +
  551. ":";
  552. let m =
  553. (date.getMinutes() < 10
  554. ? "0" + date.getMinutes()
  555. : date.getMinutes()) + ":";
  556. let s =
  557. date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
  558. return Y + M + D + h + m + s;
  559. };
  560. },
  561. renderSize() {
  562. return function (value) {
  563. if (null == value || value == "") {
  564. return "0 Bytes";
  565. }
  566. var unitArr = new Array(
  567. "Bytes",
  568. "KB",
  569. "MB",
  570. "GB",
  571. "TB",
  572. "PB",
  573. "EB",
  574. "ZB",
  575. "YB"
  576. );
  577. var index = 0;
  578. var srcsize = parseFloat(value);
  579. index = Math.floor(Math.log(srcsize) / Math.log(1024));
  580. var size = srcsize / Math.pow(1024, index);
  581. size = size.toFixed(2); //保留的小数位数
  582. return size + unitArr[index];
  583. };
  584. },
  585. },
  586. mounted() {
  587. this.submitId = document.getElementById("submitId");
  588. this.intervalModelist();
  589. this.url = location.href.split("show_model")[0];
  590. this.submitId.addEventListener("click", this.submit);
  591. this.url_create_newVersion = this.url + "create_model";
  592. this.url_create_newModel = this.url + "create_new_model";
  593. },
  594. created() {
  595. if (document.documentElement.attributes["lang"].nodeValue == "en-US") {
  596. this.i18n = this.$locale.US;
  597. } else {
  598. this.i18n = this.$locale.CN;
  599. }
  600. this.getModelList();
  601. },
  602. beforeDestroy() {
  603. // 实例销毁之前对点击事件进行解绑
  604. this.submitId.removeEventListener("click", this.submit);
  605. clearInterval(this.timer);
  606. },
  607. };
  608. </script>
  609. <style scoped>
  610. .text-over {
  611. overflow: hidden;
  612. text-overflow: ellipsis;
  613. vertical-align: middle;
  614. white-space: nowrap;
  615. }
  616. .m-local {
  617. background-color: rgb(22, 132, 252);
  618. color: white;
  619. padding: 2px 3px;
  620. border-radius: 4px;
  621. font-size: 12px;
  622. margin-right: 2px;
  623. }
  624. .m-online {
  625. background-color: rgb(91, 185, 115);
  626. color: white;
  627. padding: 2px 3px;
  628. border-radius: 4px;
  629. font-size: 12px;
  630. margin-right: 2px;
  631. }
  632. .el-icon-arrow-right {
  633. font-family: element-icons !important;
  634. speak: none;
  635. font-style: normal;
  636. font-weight: 400;
  637. font-feature-settings: normal;
  638. font-variant: normal;
  639. text-transform: none;
  640. line-height: 1;
  641. vertical-align: middle;
  642. display: inline-block;
  643. -webkit-font-smoothing: antialiased;
  644. -moz-osx-font-smoothing: grayscale;
  645. border: 1px solid #d4d4d5;
  646. border-radius: 50%;
  647. color: #d4d4d5;
  648. margin-right: 4px;
  649. }
  650. .el-icon-arrow-right::before {
  651. content: "\e6e0";
  652. }
  653. .expand-icon {
  654. display: inline-block;
  655. width: 20px;
  656. line-height: 20px;
  657. height: 20px;
  658. text-align: center;
  659. margin-right: 3px;
  660. font-size: 12px;
  661. }
  662. /deep/ .el-table_1_column_1.is-left .cell {
  663. padding-right: 0px !important;
  664. white-space: nowrap;
  665. }
  666. /deep/ .el-table__expand-icon .el-icon-arrow-right {
  667. font-family: element-icons !important;
  668. speak: none;
  669. font-style: normal;
  670. font-weight: 400;
  671. font-feature-settings: normal;
  672. font-variant: normal;
  673. text-transform: none;
  674. line-height: 1;
  675. vertical-align: middle;
  676. display: inline-block;
  677. -webkit-font-smoothing: antialiased;
  678. -moz-osx-font-smoothing: grayscale;
  679. border: 1px solid #3291f8;
  680. border-radius: 50%;
  681. color: #3291f8;
  682. margin-right: 4px;
  683. }
  684. .space-around {
  685. display: flex;
  686. justify-content: space-around;
  687. }
  688. .op-btn-c {
  689. text-align: right;
  690. padding-right: 20px;
  691. }
  692. .op-btn {
  693. margin: 0 0 0 5px;
  694. }
  695. .disabled {
  696. cursor: default;
  697. pointer-events: none;
  698. color: rgba(0, 0, 0, 0.6) !important;
  699. opacity: 0.45 !important;
  700. }
  701. </style>