Skip to content

Commit

Permalink
Merge branch 'dev-1.1.12.1' into dev-1.1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
demonray committed Jun 9, 2023
2 parents dc5282a + 07611cd commit 30f8363
Show file tree
Hide file tree
Showing 11 changed files with 555 additions and 141 deletions.
5 changes: 5 additions & 0 deletions web/packages/apiServices/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"applicant": "Applicant:",
"status": "Status",
"find": "Find",
"approve": "Submit Approval",
"path": "API Path:",
"submitter": "Submitter",
"scriptsPath": "Scripts Path:"
Expand All @@ -93,6 +94,8 @@
"reason": "Reason",
"ip_whitelist": "Ip Whitelist",
"apply_time": "Apply Time",
"applySource": "Apply Source",
"proxyExecuteUser": "Execute User",
"caller": "Caller",
"access": "Access",
"version": "Version",
Expand Down Expand Up @@ -133,6 +136,8 @@
"disable": "Stop",
"normal": "Normal",
"expired": "Expired",
"submited": "已提单",
"unsubmit": "未提单",
"all": "All",
"updateApiModal": {
"modalTitle": "Update API",
Expand Down
5 changes: 5 additions & 0 deletions web/packages/apiServices/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"path": "API路径:",
"submitter": "提交人",
"find": "查询",
"approve": "批量提交审批",
"scriptsPath": "脚本路径:"
},
"buttonText": {
Expand Down Expand Up @@ -102,6 +103,8 @@
"reason": "申请原因",
"ip_whitelist": "白名单IP",
"apply_time": "申请起始时间",
"applySource": "审批单号",
"executeUser": "代理执行用户",
"caller": "调用方",
"access": "限流情况",
"version": "版本号",
Expand Down Expand Up @@ -133,6 +136,8 @@
"disable": "已禁用",
"normal": "正常",
"expired": "已过期",
"submited": "已提单",
"unsubmit": "未提单",
"all": "全部",
"updateApiModal": {
"modalTitle": "数据服务API更新",
Expand Down
45 changes: 36 additions & 9 deletions web/packages/apiServices/module/apiServices/apiCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
</slot>
</div>
<slot>
<div class="desc">{{ desc }}</div>
<div class="desc" :title="desc">描述:{{ desc ? desc : '--' }}</div>
<div class="version" v-if="title.versionVos">当前运行中版本:{{title.versionVos && title.versionVos[0] && title.versionVos[0].version ? title.versionVos[0].version : '--'}} <Tag v-if="title.existNewerVersion" color="red">有新版本</Tag></div>
</slot>
<slot name="floor">
<div class="floor">
Expand Down Expand Up @@ -159,16 +160,42 @@ export default {
}
}
.desc {
text-indent: 2em;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
// font-size: 0.65rem;
// margin: 8px 0;
// word-break: break-all; /* 单词内部也可断行 */
// word-wrap: break-word; /* 允许单词内部断行,并自动溢出,即换行 */
// text-indent: 2em;

// 最多两行 多的在第二行最后显示...
// white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
// display: -webkit-box;
// -webkit-line-clamp: 2;
// -webkit-box-orient: vertical;

display: -webkit-box;
// margin-bottom: 10px;
line-height: 1.5;
font-size: 0.8rem;
height: 2.4rem;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
overflow: hidden;
margin-bottom: 4px;
margin-top: 4px;
height: 36px;
word-wrap: break-word; /* 在需要时断开字符 */
word-break: break-all; /* 在需要时断开单词 */
}
.version {
font-size: 0.65rem;
padding: 0px 0 8px 0;
height: 34px;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
word-break: break-all; /* 单词内部也可断行 */
word-wrap: break-word; /* 允许单词内部断行,并自动溢出,即换行 */
}
.floor {
text-align: center;
Expand Down
24 changes: 20 additions & 4 deletions web/packages/apiServices/module/apiServices/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<div class="main service-cener">
<div class="tap-bar">
<h3 class="title">
<Icon v-if="microModule !== 'apiServices'" type="md-arrow-round-back" @click="goBack" class="back"></Icon>
<SvgIcon v-if="microModule !== 'apiServices'" style="font-size: 16px;display: inline-block;transform: rotate(180deg);"
color="#444444"
@click="goBack"
icon-class="fi-expand-right"/>
<span>{{$t('message.apiServices.title')}}</span>
</h3>
</div>
Expand All @@ -24,6 +27,7 @@
</Col>
<Col span="5">
<Button class="search" type="primary" @click="getApiData">{{$t("message.apiServices.label.find")}}</Button>
<Button class="search" type="primary" @click="gotoSubmit">{{$t("message.apiServices.label.approve")}}</Button>
</Col>
</Row>
<div class="workspace-header-right">
Expand Down Expand Up @@ -411,6 +415,13 @@ export default {
this.getTagList();
this.username = this.getUserName();
},
mounted() {
// 切到非第一页,进入 管理页,再返回数据服务首页,要保留进管理页之前的分页
if (sessionStorage.getItem('apiservicesCurrentPage') && sessionStorage.getItem('apiservicesCurrentPage') !== 'null' && sessionStorage.getItem('apiservicesCurrentPage') !== 'undefined') {
this.page.pageNow = Number(sessionStorage.getItem('apiservicesCurrentPage'));
sessionStorage.removeItem('apiservicesCurrentPage')
}
},
computed: {
pageDatalist() {// 展示的数据
let list = this.apiData;
Expand Down Expand Up @@ -504,6 +515,9 @@ export default {
}
})
},
gotoSubmit() {
this.$router.push({ name: 'ServicesSubmit', query: { workspaceId: this.$route.query.workspaceId} })
},
changeVisual(type) {
this.visual = type;
},
Expand All @@ -517,6 +531,7 @@ export default {
commonAction(row, arg) { // 更多操作的id
const id = arg[0];
if (id === 1) { // 跳到管理页
sessionStorage.setItem('apiservicesCurrentPage', this.page.pageNow)
this.$router.push({path: '/servicesMangement',query: {apiId: arg[0], workspaceId: this.$route.query.workspaceId, id: row.id, scriptPath: row.scriptPath }})
} else if(id === 2) { // 禁用、启用
// 发起请求
Expand Down Expand Up @@ -653,6 +668,7 @@ export default {
height: $percent-all;
display: flex;
flex-direction: column;
overflow: auto;
.title, .search-bar, .workspace-header-right, .page-bar {
flex: none;
}
Expand Down Expand Up @@ -719,9 +735,9 @@ export default {
display: flex;
align-items: $align-center;
justify-content: space-between;
// .tabs-content {
// flex: 1;
// }
.tabs-content {
max-width: calc(100% - 150px);
}
.showAll {
margin: 0 10px;
color: $primary-color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ export default {
key: "status",
align: "center",
render: (h, scope) => {
const colors = ['red','rgb(18, 150, 219)','#0F1222','#F29360']
const list = [this.$t('message.apiServices.disable'),this.$t('message.apiServices.enable'),this.$t('message.apiServices.unsubmit'),this.$t('message.apiServices.submited')]
return h(
"span",
{
style: { color: scope.row.status === 1 ? 'rgb(18, 150, 219)': 'red'}
style: { color: colors[scope.row.status]}
},
scope.row.status === 1 ? this.$t('message.apiServices.enable') : this.$t('message.apiServices.disable')
list[scope.row.status]
);
}
},
Expand All @@ -139,6 +141,11 @@ export default {
key: "creator",
align: "center"
},
{
title: this.$t('message.apiServices.apiTable.executeUser'),
key: "executeUser",
align: "center"
},
{
title: this.$t('message.apiServices.apiTable.publishDateStr'),
key: "createTime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<FormItem :label-width="80" :label="$t('message.apiServices.label.applicant')" style="width: 300px">
<Input v-model="formItem.user" :placeholder="$t('message.apiServices.placeholder.emter')"></Input>
</FormItem>
<FormItem :label-width="80" :label="$t('message.apiServices.apiTable.version')" style="width: 300px">
<Input v-model="formItem.version" :placeholder="$t('message.apiServices.placeholder.emter')"></Input>
</FormItem>
<FormItem :label-width="80" :label="$t('message.apiServices.label.status')" style="width: 300px">
<Select v-model="formItem.status">
<Option value="">{{$t('message.apiServices.all')}}</Option>
Expand Down Expand Up @@ -70,6 +73,7 @@ export default {
formItem: {
applyTime: "",
user: "",
version: "",
status: ""
},
page: {
Expand Down Expand Up @@ -122,11 +126,21 @@ export default {
key: "user",
align: "center"
},
{
title: this.$t('message.apiServices.apiTable.version'),
key: "version",
align: "center"
},
{
title: this.$t('message.apiServices.apiTable.status'),
slot: "status",
align: "center"
},
{
title: this.$t('message.apiServices.apiTable.applySource'),
key: "applySource",
align: "center"
},
{
title: this.$t('message.apiServices.apiTable.duration'),
key: "duration",
Expand Down Expand Up @@ -175,12 +189,14 @@ export default {
apiId: this.$route.query.id,
user: this.formItem.user || undefined,
status: this.formItem.status || undefined,
version: this.formItem.version || undefined,
startDate: this.formItem.applyTime[0] ? this.formItem.applyTime[0].getTime() : undefined,
endDate: this.formItem.applyTime[1] ? this.formItem.applyTime[1].getTime() : undefined,
currentPage: this.page.pageNow,
pageSize: this.page.pageSize,
}, 'get').then((res) => {
this.tokenData = res.queryList;
console.log('this.tokenData: ', this.tokenData);
this.page.totalSize = res.total;
// 每次数据查询之后需比较当前页,是否超出可选范围
const num = Math.ceil(this.page.totalSize / this.page.pageSize);
Expand Down
11 changes: 7 additions & 4 deletions web/packages/apiServices/module/servicesMangement/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<div class="dataServicesContent">
<nav class="title">
<Breadcrumb class="breadcrumb" separator="/">
<Icon type="md-arrow-round-back" @click="goBack" class="back"></Icon>
<SvgIcon style="font-size: 16px;display: inline-block;transform: rotate(180deg);"
color="#444444"
@click="goBack"
icon-class="fi-expand-right"/>
<BreadcrumbItem :to="{ name: 'Apiservices', query:{ workspaceId: $route.query.workspaceId }}">
<!-- <Icon type="ios-home-outline" size="16"></Icon> -->
{{$t('message.apiServices.title')}}
Expand Down Expand Up @@ -84,7 +87,7 @@
</Input>
<Button type="primary" @click="refreshAction">{{ $t('message.apiServices.buttonText.refresh') }}</Button>
</FormItem>
<!-- <FormItem class="submit">
<!-- <FormItem class="submit">
<Button @click="handleSubmit('formValidate')" type="primary">{{$t('message.apiServices.save')}}</Button>
</FormItem> -->
</Form>
Expand Down Expand Up @@ -172,13 +175,13 @@ export default {
},
created() {
// 获取api相关数据
api.fetch('/dss/apiservice/queryById', {
api.fetch('/dss/apiservice/queryByManager', {
id: this.$route.query.id,
}, 'get').then((rst) => {
if (rst.result) {
// api的基础信息
this.apiData = rst.result;
this.formValidate.approvalNo = this.apiData.approvalVo.approvalNo;
this.formValidate.approvalNo = this.apiData.approvalVo && this.apiData.approvalVo.approvalNo ? this.apiData.approvalVo.approvalNo : '';
// 更改网页title
document.title = rst.result.aliasName || rst.result.name;
// 加工api信息tab的数据
Expand Down
8 changes: 8 additions & 0 deletions web/packages/apiServices/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ const routes = [
},
component: () => import('./view/servicesExecute/index.vue')
},
{
path: '/ServicesSubmit',
name: 'ServicesSubmit',
meta: {
publicPage: true
},
component: () => import('./view/servicesSubmit/index.vue')
},
]

export default routes;
Loading

0 comments on commit 30f8363

Please sign in to comment.