Browse Source

12周需求修改

pull/12/head
高森 4 years ago
parent
commit
3cb5e0710d
9 changed files with 43 additions and 24 deletions
  1. +2
    -2
      webapp/src/api/dict.js
  2. +6
    -4
      webapp/src/components/Training/dataSourceSelector.vue
  3. +20
    -3
      webapp/src/components/Training/jobForm.vue
  4. +2
    -2
      webapp/src/utils/locale/zh.js
  5. +1
    -4
      webapp/src/views/algorithm/utils.js
  6. +1
    -1
      webapp/src/views/dataset/list/create-dataset.vue
  7. +2
    -1
      webapp/src/views/labelGroup/labelGroupForm.vue
  8. +4
    -3
      webapp/src/views/register.vue
  9. +5
    -4
      webapp/src/views/resetpassword.vue

+ 2
- 2
webapp/src/api/dict.js View File

@@ -1,11 +1,11 @@
import request from '@/utils/request';
import { API_MODULE_NAME } from '@/config';

export function dictByName(dictVal) {
export function dictByName(dictVal, params = {}) {
return request({
url: `/${API_MODULE_NAME.ADMIN}/dict/${dictVal}`,
method: 'get',
params: {},
params,
});
}



+ 6
- 4
webapp/src/components/Training/dataSourceSelector.vue View File

@@ -14,7 +14,6 @@ the License. * ============================================================= */
filterable
@change="onAlgorithmUsageChange"
>
<el-option :value="null" label="全部" />
<el-option
v-for="item in algorithmUsageList"
:key="item.value"
@@ -84,10 +83,9 @@ export default {
},
data() {
return {
algorithmUsageList: [],
datasetIdList: [],
datasetVersionList: [],
algorithmUsageList: [],
algoUsage: null,
dataSource: null,
dataSourceVersion: null,
@@ -114,10 +112,14 @@ export default {
},
mounted() {
this.algoUsage = this.algoUsage || null;
this.algorithmUsageList = this.$store.state.app.datasetType;
// this.getAlgorithmUsages();
},
methods: {
initList(list) {
console.log('啦啦啦:', 123);
this.algorithmUsageList = list;
this.algoUsage = null;
},
// handlers
onAlgorithmUsageChange(annotateType, datasetInit = false) {
// 模型类别修改之后,重新获取数据集列表,清空数据集结果


+ 20
- 3
webapp/src/components/Training/jobForm.vue View File

@@ -423,7 +423,7 @@ the License. * ============================================================= */

<script>
import { isNil, isObjectLike } from 'lodash';
import { dictByName } from '@/api/dict.js';
import {
validateNameWithHyphen,
getQueueMessage,
@@ -523,7 +523,6 @@ export default {
delayCreateDelete: false,
selectedAlgorithm: null,
trainConfig,

useModel: false, // 本地判断是否使用模型
teacherModelIds: [],
studentModelIds: [],
@@ -1065,11 +1064,29 @@ export default {
this.form.valDataSourcePath = result.dataSourcePath;
this.form.valAlgorithmUsage = result.algorithmUsage;
},
getDic(val) {
// 过滤数据集 1.重置list 2.清空绑定的value
dictByName('dataset_type', {
filter: `algorithmUsage:${val}`,
}).then((res) => {
if (res) {
this.$refs.trainDataSourceSelector.initList(res.dictDetails);
}
});
},
async onAlgorithmChange(id) {
// 选用算法变更时,需要对自动填充的表单项进行验证
this.validateField('algorithmId');
let label;
// 选用算法变更时,需要同步算法的模型类别、运行项目、运行镜像、运行命令、运行参数
const algorithm = this.algorithmIdList.find((i) => i.id === id);
const algorithm = this.algorithmIdList.find((i) => {
if (i.id === id) {
label = i.algorithmUsage;
}
return i.id === id;
});
// 关联数据集 过滤查询
this.getDic(label);
this.selectedAlgorithm = algorithm;
// this.form.algorithmUsage = algorithm?.algorithmUsage || null; // 同步算法用途
// this.form.valAlgorithmUsage = algorithm?.algorithmUsage || null; // 同步算法用途到验证数据集


+ 2
- 2
webapp/src/utils/locale/zh.js View File

@@ -58,10 +58,10 @@ const lang = {
resetPsdEmail: '请输入您的邮箱',
resetPsdCode: '请输入邮箱验证码',
resetPsdPassword: '请输入您的新密码',
resetPsdPass: '请再次确认新密码',
resetPsdPass: '请再次验证密码',
resetPsdBtn: '修改密码',
resetPsdBackBtn: '返回登录',
resetPsdPassLenght: "长度在 6 到 20 个字符"
resetPsdPassLenght: '长度在 6 到 20 个字符',
};

export default lang;

+ 1
- 4
webapp/src/views/algorithm/utils.js View File

@@ -40,13 +40,12 @@ export function getColumns({
label: '名称',
prop: 'algorithmName',
fixed: true,
width: '200px',
},
{
label: '模型类别',
prop: 'algorithmUsage',
formatter: getEmptyFormatter(),
width: '100px',
dropdownList: allAlgorithmUsageList,
},
// {
@@ -74,13 +73,11 @@ export function getColumns({
{
label: '描述',
prop: 'description',
width: '200px',
},
{
label: '创建时间',
prop: 'createTime',
type: 'time',
width: '160px',
sortable: 'custom',
},
{


+ 1
- 1
webapp/src/views/dataset/list/create-dataset.vue View File

@@ -224,7 +224,7 @@ export default {
formKey: 1,
visible: props.visible,
loading: false, // 数据集创建进行中
customAnnotationType: 102,
customAnnotationType: '102',
});

const labelGroupOptions = ref(initialLabelGroupOptions);


+ 2
- 1
webapp/src/views/labelGroup/labelGroupForm.vue View File

@@ -313,7 +313,7 @@ export default {
createForm: {
labels: initialLabels,
name: '',
labelGroupType: undefined,
labelGroupType: '10',
remark: '',
type: 0,
datasetName: '',
@@ -676,6 +676,7 @@ export default {
...state.createForm,
...res,
labels,
labelGroupType: `${res.labelGroupType}`,
},
addWay: operateTypeMap[res.operateType] || 'custom',
activeLabels: uniqBy(state.activeLabels.concat(res.labels), 'id'),


+ 4
- 3
webapp/src/views/register.vue View File

@@ -413,11 +413,12 @@ export default {
? 'The email address is already registered!'
: '该邮箱已被注册!';
}
if (msg === '邮件发送不能超过三次!') {
if (msg && msg.startsWith('邮件发送次数每天不能超过')) {
const count = msg.replace(/[^0-9]/gi, '');
str =
this.$i18n.locale === 'en'
? 'Emails cannot be sent more than three times!'
: '邮件发送不能超过三次!';
? `Emails cannot be sent more than ${count} times!`
: `邮件发送次数每天不能超过${count}次!`;
}
if (msg === '系统繁忙!') {
str = this.$i18n.locale === 'en' ? 'The system is busy!' : '系统繁忙!';


+ 5
- 4
webapp/src/views/resetpassword.vue View File

@@ -105,7 +105,7 @@ export default {
const validatePass2 = (rule, value, callback) => {
if (value === '') {
const msg =
this.$i18n.locale === 'en' ? 'Please enter your new password' : '新密码不能为空';
this.$i18n.locale === 'en' ? 'Please enter your new password again' : '请再次验证密码';
callback(new Error(msg));
} else if (value !== this.registerForm.password) {
const msg =
@@ -249,11 +249,12 @@ export default {
: '邮箱地址格式有误';
}

if (msg === '邮件发送不能超过三次!') {
if (msg && msg.startsWith('邮件发送次数每天不能超过')) {
const count = msg.replace(/[^0-9]/gi, '');
str =
this.$i18n.locale === 'en'
? 'Emails cannot be sent more than three times!'
: '邮件发送不能超过三次!';
? `Emails cannot be sent more than ${count} times!`
: `邮件发送次数每天不能超过${count}次!`;
}

if (msg === '系统繁忙!') {


Loading…
Cancel
Save