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.

modelmanage-local-create-2.vue 24 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. <template>
  2. <div>
  3. <div class="header">
  4. <span class="title">{{ type == '1' ? '增加模型文件' : '上传模型文件' }}</span>
  5. </div>
  6. <div class="content ui form">
  7. <div class="guide-c" v-if="type != '1'">
  8. <div class="step">
  9. <div class="num">1</div>
  10. <div class="txt">创建模型</div>
  11. </div>
  12. <div class="line"></div>
  13. <div class="step focused">
  14. <div class="num">2</div>
  15. <div class="txt">上传模型文件</div>
  16. </div>
  17. </div>
  18. <div class="row-c">
  19. <div class="row">
  20. <div class="r-title"><label class="required">模型名称</label></div>
  21. <div class="r-content">
  22. <el-input size="medium" class="input-disabled" v-model="state.name" placeholder="请输入模型名称" readonly>
  23. </el-input>
  24. </div>
  25. </div>
  26. <div class="row" style="align-items:flex-start;">
  27. <div class="r-title"><label class="required">文件上传</label></div>
  28. <div class="r-content">
  29. <div style="position:relative">
  30. <form class="dropzone" ref="dropzoneRef" @click="">
  31. <div class="dropzon-err-tips ui red message" v-show="showUploadErr" style="display:none;margin:2.5rem">
  32. {{ uploadErrTxt }}</div>
  33. </form>
  34. <div class="not-allowed-placeholder" v-show="uploading"></div>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="row" style="margin-top:10px">
  39. <div class="r-title"><label></label></div>
  40. <div class="r-content">
  41. <el-button size="medium" class="green" @click="submit" :disabled="uploading">上传</el-button>
  42. <el-button size="medium" @click="cancel">取消</el-button>
  43. </div>
  44. </div>
  45. <div class="row" style="align-items:flex-start;">
  46. <div class="r-title"><label>上传状态:</label></div>
  47. <div class="r-content">
  48. <div v-for="(item, index) in uploadFiles" :key="item.upload.uuid" class="datast-upload-progress">
  49. <span class="dataset-name nowrap" :title="item.name">{{ item.name }}</span>
  50. <div class="dataset-progress">
  51. <el-progress :text-inside="true" :stroke-width="14" :percentage="uploadProgressList[index].progress">
  52. </el-progress>
  53. </div>
  54. <div class="dataset-status nowrap">
  55. <div class="status-flex">
  56. <i v-if="
  57. uploadProgressList[index].infoCode === 1 ||
  58. uploadProgressList[index].infoCode === 2
  59. " class="ri-close-circle-line failed"></i>
  60. <i v-if="uploadProgressList[index].infoCode === 0" class="ri-checkbox-circle-line success">
  61. </i>
  62. <span>{{ uploadProgressList[index].status }}</span>
  63. <el-tooltip v-if="uploadProgressList[index].infoCode === 1" class="item" effect="dark"
  64. placement="top">
  65. <div slot="content">
  66. {{ uploadProgressList[index].failedInfo }}
  67. </div>
  68. <i style="font-size: 16px; margin-left: 0.5rem; cursor: pointer" class="ri-question-fill"></i>
  69. </el-tooltip>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </template>
  79. <script>
  80. import { getModelInfoByName } from '~/apis/modules/modelmanage';
  81. import { getChunks, getNewMultipart, getMultipartUrl, setCompleteMultipart } from '~/apis/modules/fileupload';
  82. import { getUrlSearchParams } from '~/utils';
  83. import 'dropzone/dist/dropzone.css';
  84. import Dropzone from 'dropzone';
  85. import SparkMD5 from "spark-md5";
  86. Dropzone.autoDiscover = false;
  87. const uploadChunkSize = 1024 * 1024 * 64;
  88. const md5ChunkSize = 1024 * 1024 * 64;
  89. const maxFileSize = 10;
  90. const maxModelFilesSize = 200 * 1024 * 1024 * 1024; // 200 GB
  91. export default {
  92. data() {
  93. return {
  94. dropzoneHandler: null,
  95. type: '0', // 1-修改,其它-新增
  96. state: {
  97. type: '',
  98. id: '',
  99. name: '',
  100. version: '',
  101. engine: '',
  102. label: '',
  103. description: '',
  104. size: '',
  105. },
  106. originData: null,
  107. showUploadErr: false,
  108. uploadErrTxt: '',
  109. defaultErrTxt: '单次最多上传10个文件,模型总文件大小不超过200G',
  110. uploadFiles: [],
  111. uploadLength: 0,
  112. uploadProgressList: [],
  113. uploading: false,
  114. };
  115. },
  116. components: {},
  117. methods: {
  118. initDropZone() {
  119. this.dropzoneHandler = new Dropzone(this.$refs.dropzoneRef, {
  120. url: '/',
  121. maxFiles: 10,
  122. parallelUploads: 20,
  123. uploadMultiple: true,
  124. maxFilesize: maxModelFilesSize,
  125. timeout: 0,
  126. addRemoveLinks: true,
  127. autoProcessQueue: false,
  128. dictDefaultMessage: '点击添加文件或直接拖拽文件到此处',
  129. dictFileTooBig: 'dictFileTooBig',
  130. dictRemoveFile: '移除文件',
  131. dictMaxFilesExceeded: this.defaultErrTxt,
  132. });
  133. this.dropzoneHandler.on("addedfile", file => {
  134. this.checkFiles(file);
  135. });
  136. this.dropzoneHandler.on("removedfile", file => {
  137. this.checkFiles();
  138. });
  139. },
  140. showUploadErrInfo(state, info) {
  141. if (state) {
  142. this.uploadErrTxt = info;
  143. this.showUploadErr = true;
  144. } else {
  145. this.uploadErrTxt = '';
  146. this.showUploadErr = false;
  147. }
  148. },
  149. checkFiles(file) {
  150. const fileList = this.dropzoneHandler.getAcceptedFiles();
  151. const filesSize = fileList.reduce((acc, item, index) => acc + item.size, 0) + (file ? file.size : 0);
  152. const filesCount = fileList.length + (file ? 1 : 0);
  153. const allfilesSize = filesSize + this.state.size;
  154. if (filesCount > maxFileSize || allfilesSize > maxModelFilesSize) {
  155. this.showUploadErrInfo(true, this.defaultErrTxt);
  156. return false;
  157. }
  158. this.showUploadErrInfo(false);
  159. return true;
  160. },
  161. resetFileStatus() {
  162. this.uploadFiles = [];
  163. this.uploadLength = 0;
  164. this.uploadProgressList = [];
  165. },
  166. updateProgress(file, status, progress, infoCode, failedInfo = "") { // updateFileStatus
  167. this.uploadProgressList.forEach((item, index) => {
  168. if (item.uploadUuid === file.upload.uuid) {
  169. this.uploadProgressList[index].status = status;
  170. this.uploadProgressList[index].progress = progress;
  171. this.uploadProgressList[index].infoCode = infoCode;
  172. this.uploadProgressList[index].failedInfo = failedInfo;
  173. }
  174. });
  175. },
  176. calcFileMd5(file) {
  177. const blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
  178. const chunkSize = md5ChunkSize;
  179. const chunks = Math.ceil(file.size / chunkSize);
  180. const spark = new SparkMD5.ArrayBuffer();
  181. const fileReader = new FileReader();
  182. file.totalChunkCounts = chunks;
  183. if (file.size == 0) {
  184. file.totalChunkCounts = 1;
  185. }
  186. let currentChunk = 0;
  187. this.uploadProgressList.push({
  188. uploadUuid: file.upload.uuid,
  189. name: file.name,
  190. status: '计算文件MD5...',
  191. progress: 0,
  192. infoCode: 3,
  193. });
  194. return new Promise((resolve, reject) => {
  195. fileReader.onload = function (e) {
  196. spark.append(e.target.result);
  197. currentChunk++;
  198. if (currentChunk < chunks) {
  199. loadNext();
  200. } else {
  201. const md5 = spark.end();
  202. spark.destroy();
  203. file.uniqueIdentifier = md5;
  204. resolve(md5);
  205. }
  206. };
  207. fileReader.onerror = function (e) {
  208. console.warn(file.name + ': calcFileMd5 went wrong.');
  209. reject(e);
  210. };
  211. function loadNext() {
  212. const start = currentChunk * chunkSize;
  213. const end = ((start + chunkSize) >= file.size) ? file.size : start + chunkSize;
  214. fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
  215. }
  216. loadNext();
  217. });
  218. },
  219. getChunksInfo(file) {
  220. return getChunks({
  221. md5: file.uniqueIdentifier,
  222. type: this.state.type,
  223. file_name: file.name,
  224. scene: 'model',
  225. }).then(res => {
  226. const data = res.data;
  227. file.uploadID = data.uploadID;
  228. file.uuid = data.uuid;
  229. file.uploaded = data.uploaded;
  230. file.chunks = data.chunks;
  231. file.attachID = data.attachID;
  232. file.modelUuid = data.modeluuid || file.modelUuid;
  233. file.modelName = data.modelName || file.modelName;
  234. file.realName = data.fileName;
  235. return file;
  236. }).catch(err => {
  237. console.info('getChunksInfo', err);
  238. return err;
  239. });
  240. },
  241. newUpload(file) {
  242. return getNewMultipart({
  243. totalChunkCounts: file.totalChunkCounts,
  244. md5: file.uniqueIdentifier,
  245. size: file.size,
  246. fileType: file.type,
  247. type: this.state.type,
  248. file_name: file.name,
  249. scene: 'model',
  250. modeluuid: file.modelUuid,
  251. }).then(res => {
  252. const data = res.data;
  253. file.uploadID = data.uploadID;
  254. file.uuid = data.uuid;
  255. if (file.uploadID && file.uuid) {
  256. file.chunks = '';
  257. this.breakpointUpload(file);
  258. } else {
  259. this.uploadError(file, info);
  260. this.updateProgress(file, "上传失败", 0, 2);
  261. }
  262. return file;
  263. }).catch(err => {
  264. console.log('getNewMultipart', err);
  265. this.uploadError(file, info);
  266. this.updateProgress(file, "上传失败", 0, 2);
  267. return err;
  268. });
  269. },
  270. breakpointUpload(file) {
  271. const blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
  272. const fileReader = new FileReader();
  273. const time = new Date().getTime();
  274. const chunkSize = uploadChunkSize;
  275. const chunks = Math.ceil(file.size / chunkSize);
  276. const _this = this;
  277. let currentChunk = 0;
  278. const successChunks = [];
  279. const successParts = file.chunks.split(",");
  280. for (let i = 0; i < successParts.length; i++) {
  281. successChunks[i] = successParts[i].split("-")[0];
  282. }
  283. const urls = [];
  284. const etags = [];
  285. const checkSuccessChunks = () => {
  286. const index = successChunks.indexOf((currentChunk + 1).toString());
  287. if (index == -1) {
  288. return false;
  289. }
  290. return true;
  291. }
  292. const getUploadChunkUrl = async (currentChunk, partSize) => {
  293. const res = await getMultipartUrl({
  294. uuid: file.uuid,
  295. uploadID: file.uploadID,
  296. size: partSize,
  297. chunkNumber: currentChunk + 1,
  298. type: _this.state.type,
  299. file_name: file.name,
  300. scene: 'model',
  301. });
  302. urls[currentChunk] = res.data.url;
  303. };
  304. const uploadMinioNewMethod = async (url, e) => {
  305. const xhr = new XMLHttpRequest();
  306. xhr.open("PUT", url, false);
  307. if (_this.state.type == 0) {
  308. xhr.setRequestHeader("Content-Type", "text/plain");
  309. xhr.send(e.target.result);
  310. const etagValue = xhr.getResponseHeader("etag");
  311. etags[currentChunk] = etagValue;
  312. } else if (_this.state.type == 1) {
  313. xhr.setRequestHeader("Content-Type", "");
  314. xhr.send(e.target.result);
  315. const etagValue = xhr.getResponseHeader("ETag");
  316. etags[currentChunk] = etagValue;
  317. }
  318. }
  319. const uploadChunk = async (e) => {
  320. try {
  321. if (!checkSuccessChunks()) {
  322. const start = currentChunk * chunkSize;
  323. const partSize = start + chunkSize >= file.size ? file.size - start : chunkSize;
  324. // 获取分片上传url
  325. await getUploadChunkUrl(currentChunk, partSize);
  326. if (urls[currentChunk] != '') {
  327. await uploadMinioNewMethod(urls[currentChunk], e);
  328. if (etags[currentChunk] != '') {
  329. } else {
  330. console.log("上传到minio uploadChunk etags[currentChunk] == ''"); // TODO
  331. }
  332. } else {
  333. console.log("uploadChunk urls[currentChunk] != ''"); // TODO
  334. }
  335. }
  336. } catch (error) {
  337. console.log(error);
  338. }
  339. }
  340. const completeUpload = async () => {
  341. return await setCompleteMultipart({
  342. uuid: file.uuid,
  343. uploadID: file.uploadID,
  344. file_name: file.name,
  345. size: file.size,
  346. type: _this.state.type,
  347. scene: 'model',
  348. modeluuid: file.modelUuid,
  349. });
  350. }
  351. function loadNext() {
  352. const start = currentChunk * chunkSize;
  353. const end = start + chunkSize >= file.size ? file.size : start + chunkSize;
  354. fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
  355. }
  356. fileReader.onload = async (e) => {
  357. try {
  358. await uploadChunk(e);
  359. fileReader.abort();
  360. currentChunk++;
  361. if (currentChunk < chunks) {
  362. console.log(`第${currentChunk}个分片上传完成, 开始第${currentChunk + 1}/${chunks}个分片上传`);
  363. this.updateProgress(file, '上传中...', Number(((currentChunk / chunks) * 100).toFixed(2)), 3);
  364. loadNext();
  365. } else {
  366. try {
  367. await completeUpload();
  368. console.log(`文件上传完成:${file.name} \n分片:${chunks} 大小:${file.size} 用时:${(new Date().getTime() - time) / 1000} s`);
  369. this.uploadLength++;
  370. this.updateProgress(file, "上传成功", 100, 0);
  371. this.uploadSuccess(file);
  372. } catch (err) {
  373. const info = "上传失败";
  374. console.log(info, file)
  375. this.uploadLength++;
  376. this.uploadError(file, info);
  377. this.updateProgress(file, info, Number(((currentChunk / chunks) * 100).toFixed(2)) - 1, 2);
  378. }
  379. }
  380. } catch (err) {
  381. console.log(err);
  382. const info = "上传失败";
  383. console.log(info, file)
  384. this.uploadLength++;
  385. this.uploadError(file, info);
  386. this.updateProgress(file, info, Number(((currentChunk / chunks) * 100).toFixed(2)) - 1, 2);
  387. }
  388. };
  389. console.log("上传分片...");
  390. loadNext();
  391. },
  392. uploadError(file, info) {
  393. file.previewTemplate.querySelector('.dz-success-mark').style.opacity = 0;
  394. file.previewTemplate.querySelector('.dz-error-mark').style.opacity = 1;
  395. file.previewTemplate.querySelector('.dz-error-message span').innerHTML = info;
  396. file.previewTemplate.querySelector(".dz-error-message").style.display = 'block';
  397. file.previewTemplate.querySelector(".dz-details").onmouseover = () => {
  398. file.previewTemplate.querySelector('.dz-error-message').style.opacity = 1;
  399. };
  400. file.previewTemplate.querySelector(".dz-details").onmouseout = () => {
  401. file.previewTemplate.querySelector('.dz-error-message').style.opacity = 0;
  402. };
  403. this.uploadFinishCheck(file);
  404. },
  405. uploadSuccess(file) {
  406. file.previewTemplate.querySelector('.dz-error-mark').style.opacity = 0;
  407. file.previewTemplate.querySelector('.dz-error-message span').innerHTML = '';
  408. file.previewTemplate.querySelector('.dz-success-mark').style.opacity = 1;
  409. file.previewTemplate.querySelector(".dz-error-message").style.display = 'none';
  410. file.previewTemplate.querySelector(".dz-details").onmouseover = null;
  411. file.previewTemplate.querySelector(".dz-details").onmouseout = null;
  412. this.uploadFinishCheck(file);
  413. },
  414. uploadFinishCheck(file) {
  415. console.log('uploadFinishCheck', file, this.uploadLength, '/', this.uploadFiles.length);
  416. if (this.uploadLength === this.uploadFiles.length) {
  417. console.log('All file has finish');
  418. this.uploading = false;
  419. }
  420. },
  421. submit() {
  422. const fileList = this.dropzoneHandler.getAcceptedFiles();
  423. if (!fileList.length) return;
  424. this.resetFileStatus();
  425. this.uploadFiles = fileList;
  426. this.uploading = true;
  427. for (let i = 0, iLen = fileList.length; i < iLen; i++) {
  428. const file = fileList[i];
  429. file.modelUuid = this.state.id;
  430. file.modelName = this.state.name;
  431. this.calcFileMd5(file).then(res => { // 计算MD5
  432. this.getChunksInfo(file).then(res => { // 获取Chunk信息
  433. if (file.uploadID == '' || file.uuid == '') { // 未上传过
  434. this.newUpload(file);
  435. } else if (file.uploaded == '1') { // 已上传成功 秒传
  436. if (file.attachID == '0') { // 删除数据集记录,未删除文件
  437. // await addAttachment(file);
  438. console.log(`file.attachID == '0'`);
  439. }
  440. // 同一模型上传同一个文件
  441. if (file.modelUuid != '' && file.modelName != '' && file.realName != '') {
  442. const info = `该文件已上传在模型: ${file.modelName}`;
  443. this.uploadLength++;
  444. this.uploadError(file, info);
  445. this.updateProgress(file, "上传失败", 0, 1, info);
  446. }
  447. console.log(file.name, '文件处理完成');
  448. } else { // 断点续传
  449. this.breakpointUpload(file);
  450. }
  451. }).catch(err => {
  452. console.info('getChunksInfo', err);
  453. this.uploadLength++;
  454. this.uploadError(file, "上传失败");
  455. this.updateProgress(file, "上传失败", 0, 2);
  456. });
  457. }).catch(err => {
  458. console.info('calcFileMd5', err);
  459. this.uploadLength++;
  460. this.uploadError(file, '上传失败');
  461. this.updateProgress(file, "上传失败", 0, 2);
  462. });
  463. }
  464. },
  465. cancel() {
  466. const list = window.location.href.split('/');
  467. list.pop();
  468. list.push('show_model');
  469. window.location.href = list.join('/');
  470. },
  471. },
  472. mounted() {
  473. const urlParams = getUrlSearchParams();
  474. if (urlParams.name && urlParams.id) {
  475. this.type = urlParams.type || '0';
  476. this.state.name = urlParams.name;
  477. this.state.id = urlParams.id;
  478. this.loading = true;
  479. getModelInfoByName({
  480. repo: location.pathname.split('/').slice(0, 3).join('/'),
  481. name: urlParams.name,
  482. id: urlParams.id
  483. }).then(res => {
  484. this.loading = false;
  485. const list = res.data;
  486. if (list && list.length) {
  487. const data = list[0];
  488. this.state.type = data.type;
  489. this.state.id = data.id;
  490. this.state.name = data.name;
  491. this.state.version = data.version;
  492. this.state.engine = data.engine.toString();
  493. this.state.label = data.label;
  494. this.state.description = data.description;
  495. this.state.size = data.size || 0;
  496. this.originData = data;
  497. } else {
  498. this.cancel();
  499. }
  500. }).catch(err => {
  501. this.loading = false;
  502. console.log(err);
  503. this.cancel();
  504. });
  505. } else {
  506. this.cancel();
  507. return;
  508. }
  509. this.initDropZone();
  510. },
  511. beforeDestroy() {
  512. },
  513. };
  514. </script>
  515. <style scoped lang="less">
  516. .header {
  517. height: 45px;
  518. border-color: rgb(212, 212, 213);
  519. border-width: 1px;
  520. border-style: solid;
  521. border-radius: 5px 5px 0px 0px;
  522. font-size: 14px;
  523. background: rgb(240, 240, 240);
  524. display: flex;
  525. align-items: center;
  526. .title {
  527. font-weight: 600;
  528. font-size: 16px;
  529. color: rgb(16, 16, 16);
  530. margin-left: 10px;
  531. }
  532. }
  533. .content {
  534. margin-top: -1px;
  535. border-color: rgb(212, 212, 213);
  536. border-width: 1px;
  537. border-style: solid;
  538. padding: 30px 0;
  539. border-top: none;
  540. .guide-c {
  541. display: flex;
  542. align-items: center;
  543. justify-content: center;
  544. margin-bottom: 20px;
  545. .step {
  546. display: flex;
  547. align-items: center;
  548. color: rgb(136, 136, 136);
  549. .num {
  550. border: 1px solid rgb(136, 136, 136);
  551. width: 34px;
  552. height: 34px;
  553. font-size: 24px;
  554. text-align: center;
  555. line-height: 34px;
  556. border-radius: 17px;
  557. margin-right: 8px;
  558. }
  559. .txt {
  560. font-weight: 600;
  561. }
  562. &.focused {
  563. color: rgb(22, 132, 252);
  564. .num {
  565. border-color: rgb(22, 132, 252);
  566. }
  567. }
  568. }
  569. .line {
  570. height: 2px;
  571. width: 50px;
  572. background-color: rgb(187, 187, 187);
  573. margin: 0 10px;
  574. }
  575. }
  576. .row-c {
  577. display: flex;
  578. align-items: center;
  579. justify-content: center;
  580. flex-direction: column;
  581. margin: 0 auto;
  582. .row {
  583. width: 100%;
  584. display: flex;
  585. align-items: center;
  586. margin: 8px 0;
  587. margin-left: -190px;
  588. .r-title {
  589. text-align: right;
  590. font-size: .92857143em;
  591. font-weight: 700;
  592. color: rgba(0, 0, 0, .87);
  593. width: 200px;
  594. margin-right: 28px;
  595. position: relative;
  596. .required {
  597. &::after {
  598. position: absolute;
  599. margin: -0.2em 0 0 0.2em;
  600. content: '*';
  601. color: #db2828;
  602. }
  603. }
  604. }
  605. .r-content {
  606. flex: 1;
  607. .cluster-type-btn {
  608. display: flex;
  609. align-items: center;
  610. justify-content: center;
  611. border: 1px solid #DCDFE6;
  612. height: 36px;
  613. padding: 10px;
  614. cursor: pointer;
  615. border-radius: 4px;
  616. .icon {
  617. margin-right: 5px;
  618. }
  619. .txt {}
  620. &.focused {
  621. border-color: rgb(50, 145, 248);
  622. color: rgb(50, 145, 248);
  623. cursor: default;
  624. .icon {
  625. :not([stroke]) {
  626. fill: rgb(50, 145, 248);
  627. }
  628. }
  629. }
  630. }
  631. }
  632. }
  633. }
  634. }
  635. .not-allowed-placeholder {
  636. position: absolute;
  637. width: 100%;
  638. height: 100%;
  639. z-index: 20;
  640. cursor: no-drop;
  641. top: 0;
  642. }
  643. .dropzone {
  644. min-height: 186px !important;
  645. /deep/ .dz-default.dz-message {
  646. margin: 76px 0 !important;
  647. }
  648. /deep/ .dz-remove {
  649. margin-top: 10px !important;
  650. }
  651. }
  652. .input-disabled {
  653. /deep/ .el-input__inner {
  654. background-color: #f5f5f6 !important;
  655. color: #888888 !important;
  656. }
  657. }
  658. /deep/ .dz-progress {
  659. display: none;
  660. }
  661. .success {
  662. color: #21ba45;
  663. font-size: 16px;
  664. margin-right: 0.5rem;
  665. }
  666. .failed {
  667. color: red;
  668. font-size: 16px;
  669. margin-right: 0.5rem;
  670. }
  671. .datast-upload-progress {
  672. display: flex;
  673. align-items: center;
  674. }
  675. .datast-upload-progress .dataset-name {
  676. text-align: right;
  677. width: 200px;
  678. margin-right: 1rem;
  679. }
  680. .datast-upload-progress .dataset-progress {
  681. flex: 1;
  682. }
  683. .datast-upload-progress .dataset-status {
  684. width: 100px;
  685. margin-left: 1rem;
  686. }
  687. .datast-upload-progress .dataset-status .status-flex {
  688. display: flex;
  689. align-items: center;
  690. }
  691. /deep/ .el-progress-bar__inner {
  692. background-color: #21ba45;
  693. }
  694. .el-select-dropdown__item.selected {
  695. color: #85b7d9;
  696. }
  697. /deep/ .el-button {
  698. background-color: #e0e1e2;
  699. color: rgba(0, 0, 0, .6);
  700. border-color: transparent;
  701. transition: opacity .1s ease, background-color .1s ease, color .1s ease, box-shadow .1s ease, background .1s ease, -webkit-box-shadow .1s ease;
  702. will-change: auto;
  703. -webkit-tap-highlight-color: transparent;
  704. &:hover {
  705. border-color: transparent;
  706. background-color: #cacbcd;
  707. color: rgba(0, 0, 0, .8);
  708. }
  709. &:focus {
  710. background-color: #cacbcd;
  711. color: rgba(0, 0, 0, .8);
  712. border-color: transparent;
  713. }
  714. &:active {
  715. background-color: #babbbc;
  716. color: rgba(0, 0, 0, .9);
  717. border-color: transparent;
  718. }
  719. &.green {
  720. background-color: #5bb973;
  721. color: #fff;
  722. &:hover {
  723. background-color: #16ab39;
  724. border-color: transparent;
  725. }
  726. &:focus {
  727. background-color: #0ea432;
  728. border-color: transparent;
  729. }
  730. &:active {
  731. background-color: #198f35;
  732. border-color: transparent;
  733. }
  734. }
  735. }
  736. /deep/ .el-select {
  737. .is-focus {
  738. .el-input__inner {
  739. border-color: #85b7d9;
  740. }
  741. }
  742. }
  743. /deep/ .el-input__inner {
  744. &:focus {
  745. border-color: #85b7d9;
  746. }
  747. }
  748. /deep/ .el-textarea__inner {
  749. &:focus {
  750. border-color: #85b7d9;
  751. }
  752. }
  753. </style>