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.

ReleaseDialog.vue 2.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License,
  2. Version 2.0 (the "License"); * you may not use this file except in compliance with the License. *
  3. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless
  4. required by applicable law or agreed to in writing, software * distributed under the License is
  5. distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  6. implied. * See the License for the specific language governing permissions and * limitations under
  7. the License. * ============================================================= */
  8. <template>
  9. <div class="wrapper">
  10. <BaseModal
  11. :visible.sync="visible"
  12. title="发布搜索策略"
  13. :loading="releasing"
  14. @cancel="visible = false"
  15. @ok="onVersionRelease"
  16. >
  17. <el-form ref="formRef" :model="form" label-width="100px">
  18. <el-form-item label="策略名称">
  19. <el-input
  20. id="name"
  21. v-model.trim="form.name"
  22. placeholder
  23. disabled
  24. maxlength="50"
  25. show-word-limit
  26. style="width: 300px;"
  27. />
  28. </el-form-item>
  29. <el-form-item label="当前版本">
  30. <el-input
  31. id="currentVersion"
  32. v-model="form.currentVersion"
  33. style="width: 200px;"
  34. disabled
  35. />
  36. </el-form-item>
  37. <el-form-item label="下一版本">
  38. <el-input id="nextVersion" v-model="form.nextVersion" disabled style="width: 200px;">
  39. </el-input>
  40. </el-form-item>
  41. </el-form>
  42. </BaseModal>
  43. </div>
  44. </template>
  45. <script>
  46. import { Message } from 'element-ui';
  47. import { reactive, ref } from '@vue/composition-api';
  48. import { versionRelease } from '@/api/tadl/strategy';
  49. import BaseModal from '@/components/BaseModal';
  50. const defaultForm = {
  51. name: null,
  52. currentVersion: null,
  53. nextVersion: null,
  54. };
  55. export default {
  56. name: 'ReleaseDialog',
  57. components: { BaseModal },
  58. setup(props, ctx) {
  59. const formRef = ref(null);
  60. const form = reactive({ ...defaultForm });
  61. const visible = ref(false);
  62. const releasing = ref(false);
  63. const handleShow = (info) => {
  64. visible.value = true;
  65. Object.assign(form, info);
  66. };
  67. // 版本发布
  68. const onVersionRelease = () => {
  69. formRef.value.validate((valid) => {
  70. if (valid) {
  71. releasing.value = true;
  72. versionRelease(form)
  73. .then(() => {
  74. ctx.emit('release-success');
  75. Message.success('版本发布成功');
  76. visible.value = false;
  77. })
  78. .finally(() => {
  79. releasing.value = false;
  80. });
  81. }
  82. });
  83. };
  84. return {
  85. formRef,
  86. form,
  87. visible,
  88. releasing,
  89. handleShow,
  90. onVersionRelease,
  91. };
  92. },
  93. };
  94. </script>

一站式算法开发平台、高性能分布式深度学习框架、先进算法模型库、视觉模型炼知平台、数据可视化分析平台等一系列平台及工具,在模型高效分布式训练、数据处理和可视分析、模型炼知和轻量化等技术上形成独特优势,目前已在产学研等各领域近千家单位及个人提供AI应用赋能