Browse Source

!22 更新

Merge pull request !22 from 高森/feature/gs
pull/12/head
ThinkEnergy Gitee 4 years ago
parent
commit
f752cbbd1d
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
17 changed files with 152 additions and 156 deletions
  1. +34
    -2
      webapp/src/App.vue
  2. +12
    -0
      webapp/src/api/dict.js
  3. +15
    -16
      webapp/src/components/DropdownHeader/index.vue
  4. +1
    -4
      webapp/src/components/LogContainer/podLogContainer.vue
  5. +3
    -3
      webapp/src/components/Training/dataSourceSelector.vue
  6. +4
    -42
      webapp/src/config/index.js
  7. +3
    -0
      webapp/src/store/modules/app.js
  8. +3
    -17
      webapp/src/views/algorithm/components/algorithmForm.vue
  9. +1
    -5
      webapp/src/views/dataset/list/action.js
  10. +15
    -6
      webapp/src/views/dataset/list/create-dataset.vue
  11. +8
    -2
      webapp/src/views/dataset/list/import-dataset.vue
  12. +12
    -9
      webapp/src/views/dataset/list/index.vue
  13. +8
    -7
      webapp/src/views/labelGroup/index.vue
  14. +17
    -8
      webapp/src/views/labelGroup/labelGroupForm.vue
  15. +2
    -5
      webapp/src/views/model/components/createModelForm.vue
  16. +7
    -15
      webapp/src/views/system/user/index.vue
  17. +7
    -15
      webapp/src/views/trainingJob/add.vue

+ 34
- 2
webapp/src/App.vue View File

@@ -7,10 +7,16 @@
</template>

<script>
import { dictByName } from '@/api/dict.js';
import { getToken } from '@/utils/auth';
import { TokenKey } from '@/settings';

export default {
name: 'App',
data() {
return {};
watch: {
$route() {
this.initDic();
},
},
mounted() {
const script = document.createElement('script');
@@ -18,7 +24,33 @@ export default {
script.src = 'https://s9.cnzz.com/z_stat.php?id=1280834206&web_id=1280834206';
document.getElementsByTagName('head')[0].appendChild(script);
},
created() {
this.initDic();
},
methods: {
initDic() {
if (!getToken(TokenKey)) {
return;
}
// 数据集类型
dictByName('dataset_type').then((res) => {
if (res) {
this.$store.state.app.datasetType = res.dictDetails;
}
});
// 模型类别
dictByName('model_category').then((res) => {
if (res) {
this.$store.state.app.modelType = res.dictDetails;
}
});
// 标签类型
dictByName('label_type').then((res) => {
if (res) {
this.$store.state.app.labelType = res.dictDetails;
}
});
},
/**
* @description: 获取缩放值
* @param { Void }


+ 12
- 0
webapp/src/api/dict.js View File

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

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

export default { dictByName };

+ 15
- 16
webapp/src/components/DropdownHeader/index.vue View File

@@ -1,18 +1,10 @@
/** Copyright 2020 Tianshu AI Platform. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================
*/
/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License,
Version 2.0 (the "License"); * you may not use this file except in compliance with the License. *
You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless
required by applicable law or agreed to in writing, software * distributed under the License is
distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. * See the License for the specific language governing permissions and * limitations under
the License. * ============================================================= */

<template>
<el-dropdown trigger="click" placement="bottom-start" @command="onCommand">
@@ -70,10 +62,17 @@ export default {
default: '',
},
},
watch: {
list: {
immediate: true,
handler(newVal) {
this.list = newVal;
},
},
},
setup(props, ctx) {
// 记录当前选择值
const currentValue = ref(null);

const onCommand = (value) => {
currentValue.value = value;
ctx.emit('command', value);


+ 1
- 4
webapp/src/components/LogContainer/podLogContainer.vue View File

@@ -47,10 +47,7 @@ import { throttle } from 'throttle-debounce';

import PrismRender from '@/components/Prism';
import { getPodLog, countPodLogs } from '@/api/system/pod';
/**
* TODO: 二期需求
* 是否可以增加另一个定速向下滚动功能?
*/


export default {
name: 'PodLogContainer',


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

@@ -61,7 +61,6 @@ the License. * ============================================================= */
<script>
import { list as getAlgorithmUsages } from '@/api/algorithm/algorithmUsage';
import { getPublishedDatasets, getDatasetVersions } from '@/api/preparation/dataset';
import { typeList } from '@/config';

export default {
name: 'DataSourceSelector',
@@ -85,7 +84,7 @@ export default {
},
data() {
return {
algorithmUsageList: typeList,
algorithmUsageList: [],
datasetIdList: [],
datasetVersionList: [],

@@ -115,7 +114,8 @@ export default {
},
mounted() {
this.algoUsage = this.algoUsage || null;
this.getAlgorithmUsages();
this.algorithmUsageList = this.$store.state.app.datasetType;
// this.getAlgorithmUsages();
},
methods: {
// handlers


+ 4
- 42
webapp/src/config/index.js View File

@@ -1,5 +1,5 @@
import {isNil} from "lodash";
import {annotationMap} from "../views/dataset/util";
import { isNil } from 'lodash';
import { annotationMap } from '../views/dataset/util';

/** Copyright 2020 Tianshu AI Platform. All Rights Reserved.
*
@@ -77,47 +77,9 @@ export const atlasConfig = {
};

// demo list
export const algList = [
{
id: 10,
auxInfo: '健康状态',
},
{
id: 11,
auxInfo: '安全预警',
},
{
id: 12,
auxInfo: '异常检测',
},
{
id: 13,
auxInfo: '其他',
},
];
export const algList = [];

export const typeList = [
{
label: '车端数据',
value: 102,
code: 102,
},
{
label: '桩端数据',
value: 101,
code: 101,
},
{
label: '实验数据',
value: 105,
code: 105,
},
{
label: '其他',
value: 106,
code: 106,
},
];
export const typeList = [];

// 根据 code 编码放回标注类型(数据集数据类型)
export const datasetTypeBy = (valueBy) => (value, key) => {


+ 3
- 0
webapp/src/store/modules/app.js View File

@@ -26,6 +26,9 @@ const state = {
allRoutes: constantRoutes,
asyncRoutes: [],
menuLoaded: false,
labelType: [], // 标签类型
datasetType: [], // 数据集类型
modelType: [], // 模型类别
};

const mutations = {


+ 3
- 17
webapp/src/views/algorithm/components/algorithmForm.vue View File

@@ -193,7 +193,7 @@ import UploadInline from '@/components/UploadForm/inline';
import UploadProgress from '@/components/UploadProgress';
import RunParamForm from '@/components/Training/runParamForm';
import { useMapGetters } from '@/hooks';
import { algorithmConfig, algList } from '@/config';
import { algorithmConfig } from '@/config';
import {
list as getAlgoUsages,
add as addAlgoUsage,
@@ -238,20 +238,7 @@ export default {
setup(props) {
// 状态
const state = reactive({
algorithmUsageList: [
{
auxInfo: '健康状态',
},
{
auxInfo: '安全预警',
},
{
auxInfo: '异常检测',
},
{
auxInfo: '其他',
},
], // 算法用途列表
algorithmUsageList: [], // 算法用途列表
imageNameList: [], // 镜像名列表
imageTagList: [], // 镜像版本列表
uploading: false, // 上传算法 Loading
@@ -321,8 +308,7 @@ export default {
current: 1,
size: 1000,
}).then((res) => {
console.log(res, 12312);
// state.algorithmUsageList = res.result;
state.algorithmUsageList = res.result;
});
};
const createAlgorithmUsage = async (auxInfo) => {


+ 1
- 5
webapp/src/views/dataset/list/action.js View File

@@ -73,11 +73,7 @@ export default {
数据集「自动标注」功能需要关联预置标签组,
<br />
详见
<a
href="https://docs.vloong.thinkenergy.tech/"
class="primary"
target="_blank"
>
<a href="https://docs.vloong.thinkenergy.tech/" class="primary" target="_blank">
说明文档
</a>
</div>


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

@@ -50,7 +50,7 @@ the License. * ============================================================= */
@change="(val) => selectCustomAnnotationType(val)"
>
<el-option
v-for="(item, index) in allAnnotationList"
v-for="(item, index) in list"
:key="index"
:label="item.label"
:value="item.value"
@@ -139,7 +139,7 @@ the License. * ============================================================= */
</BaseModal>
</template>
<script>
import { onMounted, reactive, watch, ref, computed } from '@vue/composition-api';
import { onMounted, reactive, watch, ref, computed, toRefs } from '@vue/composition-api';
import { Message } from 'element-ui';
import cx from 'classnames';
import { set, omit } from 'lodash';
@@ -154,12 +154,12 @@ import {
} from '@/views/dataset/util';
import BaseModal from '@/components/BaseModal';
import InfoRadio from '@/components/InfoRadio';
import { isEmptyValue } from '@/utils';
import { validateName } from '@/utils/validate';

import { getLabelGroupTreeList } from '@/api/preparation/labelGroup';
import { add } from '@/api/preparation/dataset';
import { typeList } from '@/config/index';

import { dictByName } from '@/api/dict.js';

const annotationByDataType = annotationBy('dataType');

@@ -200,6 +200,9 @@ export default {
type: 0,
};
const formRef = ref(null);
const allAnnotationList = reactive({
list: [],
});

const initialLabelGroupOptions = [
{
@@ -287,7 +290,13 @@ export default {
// code: annotationMap[d].code,
// }));
// });
const allAnnotationList = typeList;

// 获取数据集
dictByName('dataset_type').then((res) => {
if (res) {
allAnnotationList.list = res.dictDetails;
}
});

const transformOptions = (list) => {
return list.map((d) => ({
@@ -442,6 +451,7 @@ export default {
});

return {
...toRefs(allAnnotationList),
state,
formRef,
VUE_APP_DOCS_URL: process.env.VUE_APP_DOCS_URL,
@@ -456,7 +466,6 @@ export default {
getImageKlass,
getImgUrl,
annotationList,
allAnnotationList,
handleClose,
handleOk,
rules,


+ 8
- 2
webapp/src/views/dataset/list/import-dataset.vue View File

@@ -113,7 +113,7 @@ import {
} from '@/views/dataset/util';

import { add } from '@/api/preparation/dataset';
import { typeList } from '@/config/index';
import { dictByName } from '@/api/dict.js';

const annotationByDataType = annotationBy('dataType');

@@ -137,7 +137,13 @@ export default {
},
},
setup(props) {
const options = typeList;
const options = ref([]);
dictByName('dataset_type').then((res) => {
if (res) {
options.value = res.dictDetails;
}
});

const { toggleVisible, onResetFresh } = props;
const initialForm = {
name: '',


+ 12
- 9
webapp/src/views/dataset/list/index.vue View File

@@ -208,7 +208,7 @@ the License. * ============================================================= */
<template slot="header">
<dropdown-header
title="数据类型"
:list="annotateTypeList"
:list="dictList"
:filtered="!isNil(annotateType)"
@command="(cmd) => filter('annotateType', cmd)"
/>
@@ -362,7 +362,8 @@ import DataEnhance from './data-enhance';
import EditDataset from './edit-dataset';
import UploadDataFile from './upload-datafile';
import '../style/list.scss';
import { typeList, datasetTypeBy } from '@/config/index';
import { datasetTypeBy } from '@/config/index';
import { dictByName } from '@/api/dict.js';

const defaultForm = {
id: null,
@@ -429,6 +430,7 @@ export default {
mixins: [presenter(), header(), form(defaultForm), crud(), datePickerMixin],
data() {
return {
dictList: [],
chosenDatasetId: 0,
chosenDatasetStatus: 0,
createDatasetVisible: false, // 创建数据集对话框
@@ -476,13 +478,13 @@ export default {
type: this.activePanel || 0,
};
},
annotateTypeList() {
const annotateTypeData = Object.keys(typeList).map((d) => ({
label: typeList[d].label,
value: typeList[d].code,
}));
return [{ label: '全部', value: null }].concat(annotateTypeData);
},
// annotateTypeList() {
// const annotateTypeData = Object.keys(typeList).map((d) => ({
// label: typeList[d].label,
// value: typeList[d].code,
// }));
// return [{ label: '全部', value: null }].concat(annotateTypeData);
// },
dataTypeList() {
const rawDataTypeList = Object.keys(dataTypeMap).map((d) => ({
label: dataTypeMap[d],
@@ -562,6 +564,7 @@ export default {
created() {
this.pollDone = false;
this.crud.toQuery();
this.dictList = [{ label: '全部', value: null }].concat(this.$store.state.app.datasetType);
},
mounted() {
if (this.$route.params.type === 'add') {


+ 8
- 7
webapp/src/views/labelGroup/index.vue View File

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

<script>
import { isNil } from 'lodash';
import {mapGetters, mapState} from 'vuex';
import { mapGetters, mapState } from 'vuex';

import CRUD, { presenter, header, form, crud } from '@crud/crud';
import rrOperation from '@crud/RR.operation';
@@ -282,14 +282,15 @@ export default {
},

labelGroupTypeList() {
const data = JSON.parse(JSON.stringify(algList));
data.forEach((item) => {
item.label = item.auxInfo;
item.value = item.id;
});
// const data = JSON.parse(JSON.stringify(algList));
// data.forEach((item) => {
// item.label = item.auxInfo;
// item.value = item.id;
// });
// return data;
return [{ label: '全部', value: null }].concat(data);
// return [{ label: '全部', value: null }].concat(data);
// return [{ label: '全部', value: null }].concat(Object.values(labelGroupTypeMap));
return [{ label: '全部', value: null }].concat(this.$store.state.app.labelType);
},

// 区分预置标签组和普通便签组操作权限


+ 17
- 8
webapp/src/views/labelGroup/labelGroupForm.vue View File

@@ -7,7 +7,7 @@ implied. * See the License for the specific language governing permissions and *
the License. * ============================================================= */

<template>
<div v-loading="state.loading" class="app-container" style="width: 600px; margin-top: 28px;">
<div v-loading="state.loading" class="app-container" style="margin-top: 28px;">
<el-form ref="formRef" :model="state.createForm" :rules="rules" label-width="100px">
<el-form-item label="名称" prop="name">
<el-input
@@ -31,7 +31,12 @@ the License. * ============================================================= */
placeholder="类型"
@change="handleLabelGroupTypeChange2"
>
<el-option v-for="item in options" :key="item.id" :label="item.auxInfo" :value="item.id">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
@@ -211,7 +216,6 @@ import { getAutoLabels } from '@/api/preparation/datalabel';
import { getNotContainList } from '@/api/preparation/dataset';
import { add, edit, getLabelGroupDetail, importLabelGroup } from '@/api/preparation/labelGroup';
import InfoSelect from '@/components/InfoSelect';
import { algList, typeList } from '@/config/index';
import DynamicField from './dynamicField';

const defaultColor = '#FFFFFF';
@@ -237,8 +241,17 @@ export default {
Exception,
InfoSelect,
},
data() {
return {
options: [],
datasetTypeList: [],
};
},
created() {
this.options = this.$store.state.app.labelType;
this.datasetTypeList = this.$store.state.app.datasetType;
},
setup(props, ctx) {
const options = algList;
const editorRef = ref(null);
const formRef = ref(null);
const uploadFormRef = ref(null);
@@ -263,8 +276,6 @@ export default {
3: 'upload',
};

const datasetTypeList = typeList;

// 表单规则
const rules = {
name: [
@@ -706,8 +717,6 @@ export default {
handleLabelGroupTypeChange,
handleLabelGroupTypeChange2,
handleCodeChange,
datasetTypeList,
options,
};
},
};


+ 2
- 5
webapp/src/views/model/components/createModelForm.vue View File

@@ -105,7 +105,6 @@ import { getModelTypeMap } from '@/api/model/model';

import ModelUploader from './modelUploader';
import { atlasFrameTypeList, atlasModelTypeList } from '../util';
import { algList } from '@/config';

const defaultForm = {
name: null,
@@ -131,8 +130,7 @@ export default {
},
data() {
return {
algorithmUsageList: algList,

algorithmUsageList: [],
form: { ...defaultForm },
rules: {
name: [
@@ -214,8 +212,7 @@ export default {
size: 1000,
};
getAlgorithmUsages(params).then((res) => {
console.log('啦啦啦:', res);
// this.algorithmUsageList = res.result;
this.algorithmUsageList = res.result;
});
},
async createAlgorithmUsage(auxInfo) {


+ 7
- 15
webapp/src/views/system/user/index.vue View File

@@ -1,18 +1,9 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* * Copyright 2019-2020 Zheng Jie * * Licensed under the Apache License, Version 2.0 (the
"License"); * you may not use this file except in compliance with the License. * You may obtain a
copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by
applicable law or agreed to in writing, software * distributed under the License is distributed on
an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See
the License for the specific language governing permissions and * limitations under the License. */

<template>
<div class="app-container">
@@ -117,6 +108,7 @@
>
<el-table-column :selectable="checkboxT" type="selection" width="40" />
<el-table-column show-overflow-tooltip prop="username" label="用户名" />
<el-table-column show-overflow-tooltip width="80" prop="id" label="用户ID" />
<el-table-column show-overflow-tooltip prop="nickName" label="昵称" />
<el-table-column prop="sex" width="60" label="性别" />
<el-table-column show-overflow-tooltip prop="phone" width="120" label="手机号" />


+ 7
- 15
webapp/src/views/trainingJob/add.vue View File

@@ -1,18 +1,10 @@
/** Copyright 2020 Tianshu AI Platform. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================
*/
/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License,
Version 2.0 (the "License"); * you may not use this file except in compliance with the License. *
You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless
required by applicable law or agreed to in writing, software * distributed under the License is
distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. * See the License for the specific language governing permissions and * limitations under
the License. * ============================================================= */

<template>
<div class="app-container">


Loading…
Cancel
Save