Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
product
kim3-web-vue
Starter Web Vue
Commits
84ece510
Commit
84ece510
authored
Jul 15, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 国际化处理
parent
d4bbf0d9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
106 additions
and
9 deletions
+106
-9
src/api/index.js
src/api/index.js
+1
-1
src/components/MySelect/url_select.vue
src/components/MySelect/url_select.vue
+1
-1
src/components/table/table.vue
src/components/table/table.vue
+10
-2
src/local/index.js
src/local/index.js
+16
-0
src/local/select.js
src/local/select.js
+4
-0
src/main.js
src/main.js
+3
-1
src/pages/ranger/report/trend/index.vue
src/pages/ranger/report/trend/index.vue
+65
-0
src/pages/ranger/task_managment/center/detail.vue
src/pages/ranger/task_managment/center/detail.vue
+1
-2
src/router/config.js
src/router/config.js
+5
-2
No files found.
src/api/index.js
View file @
84ece510
...
...
@@ -35,5 +35,5 @@ export const getStaticDataApi = async (data) => {
};
export
function
getStaticDataByTwoParamsApi
(
paramModule
,
paramCode
)
{
return
getStaticDataApi
({
paramModule
,
paramCode
});
return
()
=>
getStaticDataApi
({
paramModule
,
paramCode
});
}
src/components/MySelect/url_select.vue
View file @
84ece510
...
...
@@ -2,7 +2,7 @@
<a-select
style=
"width: 100%"
:dropdown-style=
"
{ maxHeight: '400px', overflow: 'auto' }"
placeholder="Please select
"
:placeholder="$t('select.placeholder')
"
allow-clear
:options="options"
v-on="$listeners"
...
...
src/components/table/table.vue
View file @
84ece510
<
template
>
<div
:style=
"`min-width: $
{width}px`" class="tw-overflow-x-auto">
<my-card
v-if=
"$scopedSlots.search"
class=
"tw-mb-2.5
"
>
<my-card
v-if=
"$scopedSlots.search"
:class=
"
{ 'tw-mb-2.5': !noMargin }
">
<div
class=
"tw-flex"
>
<slot
name=
"search"
:query=
"queryForm"
/>
</div>
...
...
@@ -21,7 +21,7 @@
</div>
</my-card>
<my-card
:class=
"noPadding ? 'tw-p-0' : ''"
>
<my-card
:class=
"noPadding ? 'tw-p-0' : ''"
:style=
"tableCardStyle"
>
<a-space
class=
"tw-mb-2"
>
<a-button
type=
"primary"
v-if=
"newBtn"
@
click=
"addBtnClick"
>
{{ newBtn.text || '新增' }}
...
...
@@ -104,6 +104,7 @@ export default {
type
:
Object
,
default
:
()
=>
({}),
},
noMargin
:
Boolean
,
},
data
()
{
...
...
@@ -164,6 +165,13 @@ export default {
},
};
},
tableCardStyle
()
{
return
this
.
noMargin
?
{
paddingTop
:
0
,
}
:
{};
},
},
methods
:
{
...
...
src/local/index.js
0 → 100644
View file @
84ece510
import
selectLang
from
'
./select
'
;
const
zh_CN
=
{};
const
en_US
=
{};
function
formatLang
(
langObject
)
{
for
(
const
key
in
langObject
)
{
const
element
=
langObject
[
key
];
zh_CN
[
key
]
=
element
[
0
];
en_US
[
key
]
=
element
[
1
];
}
}
formatLang
(
selectLang
);
export
{
en_US
,
zh_CN
};
src/local/select.js
0 → 100644
View file @
84ece510
// 0 中文, 1 英文
export
default
{
'
select.placeholder
'
:
[
'
请选择
'
,
'
Please Select
'
],
};
src/main.js
View file @
84ece510
...
...
@@ -12,6 +12,7 @@ import { loadGuards, setAppOptions } from './utils/routerUtil';
import
guards
from
'
./router/guards
'
;
import
{
loadResponseInterceptor
}
from
'
./utils/requestUtil
'
;
import
langUtils
from
'
@/utils/langUtils
'
;
import
{
en_US
,
zh_CN
}
from
'
@/local
'
;
import
'
tailwindcss/tailwind.css
'
;
import
'
animate.css/source/animate.css
'
;
...
...
@@ -43,6 +44,7 @@ const i18n = new VueI18n({
locale
:
localeLang
,
fallbackLocale
:
langUtils
.
fallbackLocale
,
silentFallbackWarn
:
true
,
messages
:
{
zh_CN
,
en_US
},
});
//装载antd控件
...
...
@@ -67,5 +69,5 @@ new Vue({
router
,
store
,
i18n
,
render
:
h
=>
h
(
App
),
render
:
(
h
)
=>
h
(
App
),
}).
$mount
(
'
#app
'
);
src/pages/ranger/report/trend/index.vue
0 → 100644
View file @
84ece510
<
template
>
<my-card
class=
"tw-flex"
>
<div
class=
"tw-mr-2.5"
:class=
"$style.container"
style=
"flex-basis: 500px"
>
<Table
url=
"/ranger/inspection/api/v1/items"
rowKey=
"itemId"
:width=
"700"
:buttons=
"buttons"
noMargin
>
<template
#search
="
{ query }">
<MoreItem
label=
"地区"
>
<UrlSelect
url=
"/ranger/inspection/api/v1/region/list"
v-model=
"query.regionId"
labelFiled=
"regionName"
valueFiled=
"regionId"
/>
</MoreItem>
<MoreItem
label=
"指标名称"
>
<a-input
v-model=
"query.itemName"
/>
</MoreItem>
</
template
>
<a-table-column
title=
"巡检指标"
data-index=
"itemName"
/>
<a-table-column
title=
"单元"
data-index=
"unitName"
/>
</Table>
</div>
<div
:class=
"$style.container"
class=
"tw-flex-1 tw-h-10"
></div>
</my-card>
</template>
<
script
>
import
Table
from
'
@/components/table/table.vue
'
;
import
MoreItem
from
'
@/components/table/more_item.vue
'
;
import
UrlSelect
from
'
@/components/MySelect/url_select.vue
'
;
export
default
{
components
:
{
Table
,
MoreItem
,
UrlSelect
},
data
()
{
return
{
buttons
:
[
{
label
:
'
添加
'
,
click
:
this
.
addToChart
,
isHidden
(
row
)
{
return
row
.
__isHidden__
;
},
},
],
};
},
methods
:
{
addToChart
(
row
)
{
console
.
log
(
row
);
this
.
$set
(
row
,
'
__isHidden__
'
,
true
);
},
},
};
</
script
>
<
style
module
>
.container
{
@apply
tw-border
tw-border-gray-300
tw-border-solid
tw-rounded;
}
</
style
>
src/pages/ranger/task_managment/center/detail.vue
View file @
84ece510
...
...
@@ -142,7 +142,7 @@ export default {
title
:
'
备注 & 附件
'
,
options
:
{
fixed
:
'
right
'
,
width
:
1
5
0
,
width
:
1
0
0
,
},
data
:
[
{
...
...
@@ -166,7 +166,6 @@ export default {
},
methods
:
{
viewDetail
(
row
)
{
console
.
log
(
row
);
this
.
$refs
.
table
.
show
({
row
,
title
:
'
备注 & 附件
'
});
},
},
...
...
src/router/config.js
View file @
84ece510
...
...
@@ -81,13 +81,11 @@ const hasAuthorityRoutes = [
component
:
()
=>
import
(
'
@/pages/ranger/basic/unit
'
),
},
{
path
:
'
major
'
,
name
:
'
专业配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/major
'
),
},
{
path
:
'
item
'
,
name
:
'
项目配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/item
'
),
...
...
@@ -121,6 +119,11 @@ const hasAuthorityRoutes = [
name
:
'
报表中心
'
,
component
:
RouterView
,
children
:
[
{
path
:
'
trend-analysis
'
,
name
:
'
趋势对比
'
,
component
:
()
=>
import
(
'
@/pages/ranger/report/trend/index.vue
'
),
},
{
path
:
'
week
'
,
name
:
'
巡检周报
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment