Browse Source

Merge branch 'zouap_static' of https://git.openi.org.cn/OpenI/aiforge into zouap_static

tags/v1.22.11.2^2
zouap 3 years ago
parent
commit
badce64a25
3 changed files with 51 additions and 18 deletions
  1. +4
    -4
      web_src/vuepages/apis/modules/modelmanage.js
  2. +4
    -2
      web_src/vuepages/pages/modelmanage/common/modelmanage-common-detail.vue
  3. +43
    -12
      web_src/vuepages/pages/modelmanage/local/modelmanage-local-create-1.vue

+ 4
- 4
web_src/vuepages/apis/modules/modelmanage.js View File

@@ -62,7 +62,7 @@ export const deleteModelFile = (params) => {
// return: uploadID, uuid, uploaded, chunks, attachID, modeluuid, modelName, fileName
export const getChunks = (params) => {
return service({
url: `/attachments/get_chunks`,
url: `/attachments/model/get_chunks`,
method: 'get',
params,
data: {},
@@ -74,7 +74,7 @@ export const getChunks = (params) => {
// return: uploadID, uuid
export const getNewMultipart = (params) => {
return service({
url: `/attachments/new_multipart`,
url: `/attachments/model/new_multipart`,
method: 'get',
params,
data: {},
@@ -86,7 +86,7 @@ export const getNewMultipart = (params) => {
// return: url
export const getMultipartUrl = (params) => {
return service({
url: `/attachments/get_multipart_url`,
url: `/attachments/model/get_multipart_url`,
method: 'get',
params,
data: {},
@@ -97,7 +97,7 @@ export const getMultipartUrl = (params) => {
// data: { uuid, uploadID, size, type, file_name, dataset_id, description, scene=model, modeluuid=xxxx }
export const setCompleteMultipart = (data) => {
return service({
url: `/attachments/complete_multipart`,
url: `/attachments/model/complete_multipart`,
method: 'post',
headers: { 'Content-type': 'application/x-www-form-urlencoded' },
params: {},


+ 4
- 2
web_src/vuepages/pages/modelmanage/common/modelmanage-common-detail.vue View File

@@ -164,7 +164,7 @@
</div>
</div>
<div class="table-container">
<el-table :data="filesList" row-key="sn" style="width: 100%" v-loading="loading" stripe>
<el-table ref="tableRef" :data="filesList" row-key="sn" style="width: 100%" v-loading="loading" stripe>
<el-table-column column-key="FileName" prop="FileName" sortable
:sort-method="(a, b) => a.FileName.toLocaleLowerCase().localeCompare(b.FileName.toLocaleLowerCase())"
:label="$t('modelManage.fileName')" align="left" header-align="left">
@@ -259,10 +259,12 @@ export default {
item.SizeShow = item.IsDir ? '' : transFileSize(item.Size);
item.ModTimeNum = new Date(item.ModTime).getTime();
})
list.sort((a, b) => b.ModTimeNum - a.ModTimeNum);
this.filesList = list;
this.$refs['tableRef']?.clearSort();
}).catch(err => {
console.log(err);
})
});
},
goNextDir(item) {
this.filePath.push({


+ 43
- 12
web_src/vuepages/pages/modelmanage/local/modelmanage-local-create-1.vue View File

@@ -23,7 +23,7 @@
<div class="cluster-type-btn" v-if="type != 1 || type == 1 && state.type === 0"
:class="state.type === 0 ? 'focused' : ''"
:style="type != 1 ? 'border-top-right-radius:unset;border-bottom-right-radius:unset;' : ''"
@click="state.type = 0;state.engine='0'">
@click="state.type = 0; state.engine = '0'">
<svg xmlns="http://www.w3.org/2000/svg"
class="icon styles__StyledSVGIconPathComponent-sc-16fsqc8-0 cSaWDI svg-icon-path-icon fill"
viewBox="0 0 32 32" width="16" height="16">
@@ -39,7 +39,7 @@
<div class="cluster-type-btn" v-if="type != 1 || type == 1 && state.type === 1"
:class="state.type === 1 ? 'focused' : ''"
:style="type != 1 ? 'border-top-left-radius:unset;border-bottom-left-radius:unset;' : ''"
@click="state.type = 1;state.engine='2'">
@click="state.type = 1; state.engine = '2'">
<svg xmlns="http://www.w3.org/2000/svg"
class="icon styles__StyledSVGIconPathComponent-sc-16fsqc8-0 iKfgJk svg-icon-path-icon fill"
viewBox="0 0 32 32" width="16" height="16">
@@ -54,10 +54,11 @@
</div>
</div>
</div>
<div class="row">
<div class="row" :class="nameErr ? 'error' : ''">
<div class="r-title"><label class="required">{{ $t('modelManage.modelName') }}</label></div>
<div class="r-content">
<el-input size="medium" :maxLength="25" v-model="state.name" :placeholder="$t('modelManage.pleaseInputModelName')">
<el-input size="medium" :maxLength="25" v-model="state.name" @blur="checkName"
:placeholder="$t('modelManage.pleaseInputModelName')">
</el-input>
</div>
</div>
@@ -80,8 +81,8 @@
<div class="row">
<div class="r-title"><label>{{ $t('modelManage.modelLabel') }}</label></div>
<div class="r-content">
<el-input size="medium" :maxLength="255" v-model="state.label" :placeholder="$t('modelManage.modelLabelInputTips')"
@input="labelInput"></el-input>
<el-input size="medium" :maxLength="255" v-model="state.label"
:placeholder="$t('modelManage.modelLabelInputTips')" @input="labelInput"></el-input>
</div>
</div>
<div class="row" style="align-items:flex-start;">
@@ -95,7 +96,9 @@
<div class="row" style="margin-top:20px">
<div class="r-title"><label></label></div>
<div class="r-content">
<el-button size="medium" class="green" @click="submit">{{ type == '1' ? $t('modelManage.confirm') : $t('modelManage.createModel') }}
<el-button size="medium" class="green" @click="submit">{{ type == '1' ? $t('modelManage.confirm') :
$t('modelManage.createModel')
}}
</el-button>
<el-button size="medium" @click="cancel">{{ $t('modelManage.cancel') }}</el-button>
</div>
@@ -127,23 +130,28 @@ export default {
label: '',
description: '',
},
nameErr: false,
isShowVersion: false,
engineList: MODEL_ENGINES,
};
},
components: {},
methods: {
checkName() {
this.nameErr = !this.state.name;
return !this.nameErr;
},
labelInput() {
const hasEndSpace = this.state.label[this.state.label.length - 1] == ' ';
const list = this.state.label.trim().split(' ').filter(label => label != '');
this.state.label = list.slice(0, MAX_LABEL_COUNT).join(' ') + (hasEndSpace && list.length < MAX_LABEL_COUNT ? ' ' : '');
},
submit() {
if (!this.state.name) {
this.$message({
type: 'info',
message: this.$t('modelManage.pleaseInputModelName'),
});
if (!this.checkName()) {
// this.$message({
// type: 'info',
// message: this.$t('modelManage.pleaseInputModelName'),
// });
return;
}
const submintApi = this.type == '1' ? modifyModel : saveLocalModel;
@@ -161,6 +169,11 @@ export default {
list.pop();
list.push('create_local_model_2');
window.location.href = list.join('/') + '?type=0&name=' + this.state.name + '&id=' + res.id;
} if (res && res.code == '-1') {
this.$message({
type: 'error',
message: res.msg,
});
} else {
this.$message({
type: 'error',
@@ -325,6 +338,24 @@ export default {
}
}

&.error {
.r-title {
color: #9f3a38;
}

.r-content {
/deep/.el-input__inner {
color: #9f3a38;
background: #fff6f6;
border-color: #e0b4b4;

&::placeholder {
color: #e0b4b4;
}
}
}
}

.r-content {
flex: 1;



Loading…
Cancel
Save