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 25 kB

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