Commit cd431ef6 authored by 陈浩玮's avatar 陈浩玮

Merge branch 'feature/shuiluo' into 'master'

Feature/shuiluo

See merge request product/kim3-web-vue/starter-web-vue!52
parents ca9a6587 e93b692c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<a-select <a-select
show-search show-search
class="tw-w-full" class="tw-w-full"
placeholder="input search text" :placeholder="$t('input.placeholder')"
:default-active-first-option="false" :default-active-first-option="false"
:show-arrow="false" :show-arrow="false"
:filter-option="false" :filter-option="false"
......
...@@ -16,11 +16,13 @@ export default { ...@@ -16,11 +16,13 @@ export default {
<style module lang="less"> <style module lang="less">
.container { .container {
max-width: 400px; max-width: 400px;
> :last-child {
flex: 1;
}
} }
.label { .label {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
width: 6em;
text-align: right; text-align: right;
margin-right: 1em; margin-right: 1em;
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
<slot name="moreSearch" :query="queryForm" /> <slot name="moreSearch" :query="queryForm" />
</div> </div>
</template> </template>
<a-button>更多查询</a-button> <a-button>{{ $t('table.moreSearch') }}</a-button>
</a-popover> </a-popover>
<a-button @click="reset">重置</a-button> <a-button @click="reset">{{ $t('table.reset') }}</a-button>
<a-button type="primary" @click="getData">查询</a-button> <a-button type="primary" @click="getData">{{ $t('table.search') }}</a-button>
</a-space> </a-space>
</div> </div>
</my-card> </my-card>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<my-card :class="noPadding ? 'tw-p-0' : ''" :style="tableCardStyle"> <my-card :class="noPadding ? 'tw-p-0' : ''" :style="tableCardStyle">
<a-space class="tw-mb-2"> <a-space class="tw-mb-2">
<a-button type="primary" v-if="newBtn" @click="addBtnClick"> <a-button type="primary" v-if="newBtn" @click="addBtnClick">
{{ newBtn.text || '新增' }} {{ newBtn.text || $t('table.add') }}
</a-button> </a-button>
<slot name="operation" /> <slot name="operation" />
</a-space> </a-space>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
> >
<slot /> <slot />
<a-table-column <a-table-column
:title="newButtons.title" :title="newButtons.title || $t('table.operation')"
v-if="this.newButtons" v-if="this.newButtons"
v-bind="this.newButtons.options" v-bind="this.newButtons.options"
> >
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
:width="dWidth" :width="dWidth"
@close="hidden" @close="hidden"
:maskClosable="false" :maskClosable="false"
:title="title" :title="drawerTitle"
:afterVisibleChange="afterVisibleChange" :afterVisibleChange="afterVisibleChange"
> >
<slot name="drawer" :hidden="hidden" :refresh="getData" :type="type" :row="row" /> <slot name="drawer" :hidden="hidden" :refresh="getData" :type="type" :row="row" />
...@@ -83,8 +83,6 @@ const initQuery = { ...@@ -83,8 +83,6 @@ const initQuery = {
pageNum: 1, pageNum: 1,
}; };
const defaultTitle = '新增';
export default { export default {
props: { props: {
url: String, url: String,
...@@ -123,7 +121,7 @@ export default { ...@@ -123,7 +121,7 @@ export default {
loading: false, loading: false,
total: 0, total: 0,
visible: false, visible: false,
title: newBtn.title ?? defaultTitle, title: null,
drawerStyle: { drawerStyle: {
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
...@@ -160,7 +158,7 @@ export default { ...@@ -160,7 +158,7 @@ export default {
newButtons() { newButtons() {
return this.buttons return this.buttons
? Array.isArray(this.buttons) ? Array.isArray(this.buttons)
? { data: this.buttons, title: '操作' } ? { data: this.buttons }
: this.buttons : this.buttons
: null; : null;
}, },
...@@ -188,6 +186,9 @@ export default { ...@@ -188,6 +186,9 @@ export default {
} }
: {}; : {};
}, },
drawerTitle() {
return this.title ?? this.addBtn?.title ?? this.$t('table.add');
},
}, },
methods: { methods: {
...@@ -228,7 +229,7 @@ export default { ...@@ -228,7 +229,7 @@ export default {
}, },
afterVisibleChange(visible) { afterVisibleChange(visible) {
if (!visible) { if (!visible) {
this.title = this.addBtn?.title ?? defaultTitle; this.title = null;
this.type = null; this.type = null;
this.row = null; this.row = null;
this.dWidth = this.drawerWidth; this.dWidth = this.drawerWidth;
......
<template> <template>
<div > <div>
<div :class="['mask', visible ? 'open' : 'close']" @click="close"></div> <div :class="['mask', visible ? 'open' : 'close']" @click="close"></div>
<div :class="['drawer', placement, visible ? 'open' : 'close']"> <div :class="['drawer', placement, visible ? 'open' : 'close']">
<div ref="drawer" class="content beauty-scroll"> <div ref="drawer" class="content beauty-scroll">
<slot></slot> <slot />
</div> </div>
<div v-if="showHandler" :class="['handler-container', placement, visible ? 'open' : 'close']" ref="handler" @click="toggle"> <div
<slot v-if="$slots.handler" name="handler"></slot> v-if="showHandler"
<div v-else class="handler"> :class="['handler-container', placement, visible ? 'open' : 'close']"
<a-icon :type="visible ? 'close' : 'bars'" /> ref="handler"
</div> @click="toggle"
</div> >
<slot v-if="$slots.handler" name="handler" />
<div v-else class="handler">
<a-icon :type="visible ? 'close' : 'bars'" />
</div>
</div>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'Drawer', name: 'Drawer',
data () { data() {
return { return {};
}
},
model: {
prop: 'visible',
event: 'change'
},
props: {
visible: {
type: Boolean,
required: false,
default: false
}, },
placement: { model: {
type: String, prop: 'visible',
required: false, event: 'change',
default: 'left'
}, },
showHandler: { props: {
type: Boolean, visible: {
required: false, type: Boolean,
default: true required: false,
} default: false,
}, },
methods: { placement: {
open () { type: String,
this.$emit('change', true) required: false,
default: 'left',
},
showHandler: {
type: Boolean,
required: false,
default: true,
},
}, },
close () { methods: {
this.$emit('change', false) open() {
this.$emit('change', true);
},
close() {
this.$emit('change', false);
},
toggle() {
this.$emit('change', !this.visible);
},
}, },
toggle () { };
this.$emit('change', !this.visible)
}
}
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.mask{ .mask {
position: fixed; position: fixed;
left: 0; left: 0;
right: 0; right: 0;
...@@ -67,50 +71,50 @@ export default { ...@@ -67,50 +71,50 @@ export default {
background-color: @shadow-color; background-color: @shadow-color;
transition: all 0.5s; transition: all 0.5s;
z-index: 100; z-index: 100;
&.open{ &.open {
display: inline-block; display: inline-block;
} }
&.close{ &.close {
display: none; display: none;
} }
} }
.drawer{ .drawer {
position: fixed; position: fixed;
transition: all 0.5s; transition: all 0.5s;
height: 100vh; height: 100vh;
z-index: 100; z-index: 100;
&.left{ &.left {
left: 0px; left: 0px;
&.open{ &.open {
.content{ .content {
box-shadow: 2px 0 8px @shadow-color; box-shadow: 2px 0 8px @shadow-color;
}
}
&.close {
transform: translateX(-100%);
} }
}
&.close{
transform: translateX(-100%);
}
} }
&.right{ &.right {
right: 0px; right: 0px;
.content{ .content {
float: right; float: right;
} }
&.open{ &.open {
.content{ .content {
box-shadow: -2px 0 8px @shadow-color; box-shadow: -2px 0 8px @shadow-color;
}
}
&.close {
transform: translateX(100%);
} }
}
&.close{
transform: translateX(100%);
}
} }
} }
.content{ .content {
display: inline-block; display: inline-block;
height: 100vh; height: 100vh;
overflow-y: auto; overflow-y: auto;
} }
.handler-container{ .handler-container {
position: absolute; position: absolute;
display: inline-block; display: inline-block;
text-align: center; text-align: center;
...@@ -119,24 +123,24 @@ export default { ...@@ -119,24 +123,24 @@ export default {
top: 200px; top: 200px;
z-index: 100; z-index: 100;
.handler { .handler {
height: 40px; height: 40px;
width: 40px; width: 40px;
background-color: @base-bg-color; background-color: @base-bg-color;
font-size: 26px; font-size: 26px;
box-shadow: 0 2px 8px @shadow-color; box-shadow: 0 2px 8px @shadow-color;
line-height: 40px; line-height: 40px;
} }
&.left{ &.left {
right: -40px; right: -40px;
.handler{ .handler {
border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0;
} }
} }
&.right{ &.right {
left: -40px; left: -40px;
.handler{ .handler {
border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px;
} }
} }
} }
</style> </style>
<template> <template>
<a-upload :customRequest="customRequest" :showUploadList="showUploadList" v-bind="$attrs"> <a-upload :customRequest="customRequest" :showUploadList="showUploadList" v-bind="$attrs">
<slot> <slot>
<a-button> <a-icon type="upload" /> 上传 </a-button> <a-button> <a-icon type="upload" />{{ $t('user.upload') }}</a-button>
</slot> </slot>
</a-upload> </a-upload>
</template> </template>
......
import selectLang from './select'; import selectLang from './select';
import TableLang from './table';
import UserLang from './user';
const zh_CN = {}; const zh_CN = {};
const en_US = {}; const en_US = {};
...@@ -12,5 +14,7 @@ function formatLang(langObject) { ...@@ -12,5 +14,7 @@ function formatLang(langObject) {
} }
formatLang(selectLang); formatLang(selectLang);
formatLang(TableLang);
formatLang(UserLang);
export { en_US, zh_CN }; export { en_US, zh_CN };
// 0 中文, 1 英文 // 0 中文, 1 英文
export default { export default {
'select.placeholder': ['请选择', 'Please Select'], 'select.placeholder': ['请选择', 'Please Select'],
'select.startTime': ['开始时间', 'Start Time'],
'select.endTime': ['结束时间', 'End Time'],
'select.region': ['地区', 'Region'],
'select.speciality': ['专业', 'Speciality'],
'select.shiftTypeName': ['班组', 'ShiftTypeName'],
export: ['导出', 'Export'],
'select.routes': ['线路', 'Routes'],
'select.examine': ['巡检状态', 'Examine Status'],
'select.taskType': ['任务类型', 'Task Type'],
'select.examiner': ['巡检人', 'Examiner'],
'select.routeName': ['线路名称', 'RouteName'],
}; };
export default {
'table.operation': ['操作', 'Operation'],
'table.moreSearch': ['更多查询', 'More Search'],
'table.reset': ['重置', 'Reset'],
'table.add': ['新增', 'Add'],
'table.search': ['查询', 'Search'],
'input.placeholder': ['请输入', 'Please Input'],
'table.jobTime': ['任务时间', 'Job Time'],
'table.inspectionStartTime': ['巡检开始时间', 'InspectionStartTime'],
'table.inspectionEndTime': ['巡检结束时间', 'InspectionEndTime'],
'table.newTemporaryTask': ['新建临时任务', 'New Temporary Task'],
'table.detail': ['详情', 'Detail'],
'table.progress': ['进度', 'Progress'],
'table.pleaseSelect': ['请选择需要导出的数据', 'Please select the data to export'],
'table.taskDetail': ['任务明细', 'Task Detail'],
'table.taskProgress': ['任务进度', 'Task Progress'],
title: ['标题', 'Title'],
content: ['内容', 'Content'],
sender: ['发送者', 'Sender'],
recipient: ['接受者', 'Recipient'],
};
export default {
profile: ['个人中心', 'Profile'],
setting: ['个人设置', 'Setting'],
loginOut: ['退出登录', 'Login Out'],
tabNotice: ['通知', 'Notice'],
tabTodo: ['待办', 'Todo'],
'user.modifyPassword': ['修改密码', 'ModifyPassword'],
'user.account': ['用户账户', 'Account'],
'user.name': ['姓名', 'Name'],
'user.email': ['电子邮箱', 'Email'],
'user.fixedPhone': ['固定电话', 'Fixed Telephone'],
'user.mobilePhone': ['移动电话', 'Mobile Phone'],
'user.updateInfo': ['更新信息', 'Update Info'],
'user.avator': ['头像', 'Avator'],
'user.upload': ['上传', 'Upload'],
'table.createTime': ['创建时间', 'Create Time'],
'table.hasRead': ['是否已读', 'hasRead'],
'table.read': ['已读', 'Read'],
'table.unread': ['未读', 'Unread'],
'user.readTime': ['已读时间', 'Read Time'],
};
...@@ -20,12 +20,10 @@ ...@@ -20,12 +20,10 @@
<script> <script>
import { logout } from '@/pages/frame/services/accountService'; import { logout } from '@/pages/frame/services/accountService';
import layoutTopHeaderI18n from './i18n';
import { getUserInfo } from '@/utils'; import { getUserInfo } from '@/utils';
export default { export default {
name: 'LayoutTopHeaderAvatar', name: 'LayoutTopHeaderAvatar',
i18n: layoutTopHeaderI18n,
data: () => ({ userInfo: {} }), data: () => ({ userInfo: {} }),
computed: { computed: {
userAvatar() { userAvatar() {
......
...@@ -2,22 +2,41 @@ ...@@ -2,22 +2,41 @@
<a-dropdown :trigger="['click']" v-model="show"> <a-dropdown :trigger="['click']" v-model="show">
<div slot="overlay"> <div slot="overlay">
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}"> <a-tabs
class="dropdown-tabs"
:tabBarStyle="{ textAlign: 'center' }"
:style="{ width: '297px' }"
>
<a-tab-pane :tab="tabNoticeTitle" key="1"> <a-tab-pane :tab="tabNoticeTitle" key="1">
<a-list class="tab-pane"> <a-list class="tab-pane">
<a-list-item> <a-list-item>
<a-list-item-meta title="你收到了 14 份新周报" description="一年前"> <a-list-item-meta title="你收到了 14 份新周报" description="一年前">
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png" /> <a-avatar
style="background-color: white"
slot="avatar"
src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"
/>
</a-list-item-meta> </a-list-item-meta>
</a-list-item> </a-list-item>
<a-list-item> <a-list-item>
<a-list-item-meta title="你推荐的 曲妮妮 已通过第三轮面试" description="一年前"> <a-list-item-meta
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png" /> title="你推荐的 曲妮妮 已通过第三轮面试"
description="一年前"
>
<a-avatar
style="background-color: white"
slot="avatar"
src="https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png"
/>
</a-list-item-meta> </a-list-item-meta>
</a-list-item> </a-list-item>
<a-list-item> <a-list-item>
<a-list-item-meta title="这种模板可以区分多种通知类型" description="一年前"> <a-list-item-meta title="这种模板可以区分多种通知类型" description="一年前">
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png" /> <a-avatar
style="background-color: white"
slot="avatar"
src="https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png"
/>
</a-list-item-meta> </a-list-item-meta>
</a-list-item> </a-list-item>
</a-list> </a-list>
...@@ -37,11 +56,8 @@ ...@@ -37,11 +56,8 @@
</template> </template>
<script> <script>
import layoutTopHeaderI18n from './i18n';
export default { export default {
name: 'LayoutTopHeaderNotice', name: 'LayoutTopHeaderNotice',
i18n: layoutTopHeaderI18n,
data() { data() {
return { return {
loading: false, loading: false,
......
export default {
messages: {
zh_CN: {
profile: '个人中心',
setting: '个人设置',
loginOut: '退出登录',
tabNotice: '通知',
tabTodo: '待办',
},
en_US: {
profile: 'Profile',
setting: 'Setting',
loginOut: 'Login Out',
tabNotice: 'Notice',
tabTodo: 'Todo',
},
},
};
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</setting-item> </setting-item>
<setting-item :title="$t('theme.title')"> <setting-item :title="$t('theme.title')">
<img-checkbox-group <img-checkbox-group
@change="values => setTheme({ ...theme, mode: values[0] })" @change="(values) => setTheme({ ...theme, mode: values[0] })"
:default-values="[theme.mode]" :default-values="[theme.mode]"
> >
<img-checkbox <img-checkbox
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</setting-item> </setting-item>
<a-divider /> <a-divider />
<setting-item :title="$t('navigate.title')"> <setting-item :title="$t('navigate.title')">
<img-checkbox-group @change="values => setLayout(values[0])" :default-values="[layout]"> <img-checkbox-group @change="(values) => setLayout(values[0])" :default-values="[layout]">
<img-checkbox <img-checkbox
:title="$t('navigate.side')" :title="$t('navigate.side')"
img="https://gw.alipayobjects.com/zos/rmsportal/JopDzEhOqwOjeNTXkoje.svg" img="https://gw.alipayobjects.com/zos/rmsportal/JopDzEhOqwOjeNTXkoje.svg"
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
:checked="animate.disabled" :checked="animate.disabled"
slot="actions" slot="actions"
size="small" size="small"
@change="val => setAnimate({ ...animate, disabled: val })" @change="(val) => setAnimate({ ...animate, disabled: val })"
/> />
</a-list-item> </a-list-item>
<a-list-item> <a-list-item>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<a-select <a-select
:value="animate.name" :value="animate.name"
:getPopupContainer="getPopupContainer" :getPopupContainer="getPopupContainer"
@change="val => setAnimate({ ...animate, name: val })" @change="(val) => setAnimate({ ...animate, name: val })"
class="select-item" class="select-item"
size="small" size="small"
slot="actions" slot="actions"
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<a-select <a-select
:value="animate.direction" :value="animate.direction"
:getPopupContainer="getPopupContainer" :getPopupContainer="getPopupContainer"
@change="val => setAnimate({ ...animate, direction: val })" @change="(val) => setAnimate({ ...animate, direction: val })"
class="select-item" class="select-item"
size="small" size="small"
slot="actions" slot="actions"
...@@ -238,7 +238,7 @@ export default { ...@@ -238,7 +238,7 @@ export default {
}, },
computed: { computed: {
directions() { directions() {
return this.animates.find(item => item.name == this.animate.name).directions; return this.animates.find((item) => item.name == this.animate.name).directions;
}, },
...mapState('settingModule', [ ...mapState('settingModule', [
'theme', 'theme',
...@@ -254,7 +254,7 @@ export default { ...@@ -254,7 +254,7 @@ export default {
]), ]),
}, },
watch: { watch: {
'animate.name': function(val) { 'animate.name': function (val) {
this.setAnimate({ name: val, direction: this.directions[0] }); this.setAnimate({ name: val, direction: this.directions[0] });
}, },
}, },
...@@ -282,7 +282,7 @@ export default { ...@@ -282,7 +282,7 @@ export default {
let config = {}; let config = {};
let mySetting = this.$store.state.settingModule; let mySetting = this.$store.state.settingModule;
let dftSetting = local ? settingConfig : settingConfig; let dftSetting = local ? settingConfig : settingConfig;
Object.keys(mySetting).forEach(key => { Object.keys(mySetting).forEach((key) => {
const dftValue = dftSetting[key], const dftValue = dftSetting[key],
myValue = mySetting[key]; myValue = mySetting[key];
if (dftValue != undefined && !fastEqual(dftValue, myValue)) { if (dftValue != undefined && !fastEqual(dftValue, myValue)) {
...@@ -309,6 +309,7 @@ export default { ...@@ -309,6 +309,7 @@ export default {
<style lang="less" module> <style lang="less" module>
.side-setting { .side-setting {
min-height: 100%; min-height: 100%;
width: 280px;
background-color: @base-bg-color; background-color: @base-bg-color;
padding: 24px; padding: 24px;
font-size: 14px; font-size: 14px;
......
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
<script> <script>
import LayoutTopHeader from '../components/header/LayoutTopHeader.vue'; import LayoutTopHeader from '../components/header/LayoutTopHeader.vue';
import Drawer from '@/components/tool/Drawer'; import Drawer from '@/components/tool/Drawer.vue';
import SideMenu from '@/components/menu/SideMenu.vue'; import SideMenu from '@/components/menu/SideMenu.vue';
import Setting from '../components/setting/Setting'; import Setting from '../components/setting/Setting.vue';
import { mapState, mapMutations, mapGetters } from 'vuex'; import { mapState, mapMutations, mapGetters } from 'vuex';
import { convertListToTree, getUserInfo } from '@/utils'; import { convertListToTree, getUserInfo } from '@/utils';
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
:selected.sync="selected" :selected.sync="selected"
ref="table" ref="table"
:drawerWidth="800" :drawerWidth="800"
:scroll="scroll"
> >
<template #search="{ query }"> <template #search="{ query }">
<MoreItem label="开始时间"> <MoreItem :label="$t('select.startTime')">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
/> />
</MoreItem> </MoreItem>
<MoreItem label="结束时间"> <MoreItem :label="$t('select.endTime')">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
/> />
</MoreItem> </MoreItem>
<MoreItem label="地区"> <MoreItem :label="$t('select.region')">
<UrlSelect <UrlSelect
url="/ranger/inspection/api/v1/region/list" url="/ranger/inspection/api/v1/region/list"
v-model="query.regionId" v-model="query.regionId"
...@@ -37,31 +38,7 @@ ...@@ -37,31 +38,7 @@
</template> </template>
<template #moreSearch="{ query }"> <template #moreSearch="{ query }">
<MoreItem label="开始时间"> <MoreItem :label="$t('select.speciality')">
<a-date-picker
class="tw-w-full"
show-time
v-model="query.startTime"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</MoreItem>
<MoreItem label="结束时间">
<a-date-picker
class="tw-w-full"
show-time
v-model="query.endTime"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</MoreItem>
<MoreItem label="地区">
<UrlSelect
url="/ranger/inspection/api/v1/region/list"
v-model="query.regionId"
labelFiled="regionName"
valueFiled="regionId"
/>
</MoreItem>
<MoreItem label="专业">
<UrlSelect <UrlSelect
:url=" :url="
query.regionId query.regionId
...@@ -73,7 +50,7 @@ ...@@ -73,7 +50,7 @@
valueFiled="specialityId" valueFiled="specialityId"
/> />
</MoreItem> </MoreItem>
<MoreItem label="线路"> <MoreItem :label="$t('select.routes')">
<UrlSelect <UrlSelect
:url=" :url="
query.regionId query.regionId
...@@ -85,7 +62,7 @@ ...@@ -85,7 +62,7 @@
v-model="query.routeId" v-model="query.routeId"
/> />
</MoreItem> </MoreItem>
<MoreItem label="班组"> <MoreItem :label="$t('select.shiftTypeName')">
<RequestSelect <RequestSelect
:request="getBanZuListApi" :request="getBanZuListApi"
v-model="query.shiftType" v-model="query.shiftType"
...@@ -93,7 +70,7 @@ ...@@ -93,7 +70,7 @@
valueFiled="paramValue" valueFiled="paramValue"
/> />
</MoreItem> </MoreItem>
<MoreItem label="巡检状态"> <MoreItem :label="$t('select.examine')">
<RequestSelect <RequestSelect
:request="getBusinessListApi" :request="getBusinessListApi"
v-model="query.inspectionState" v-model="query.inspectionState"
...@@ -101,7 +78,7 @@ ...@@ -101,7 +78,7 @@
valueFiled="paramValue" valueFiled="paramValue"
/> />
</MoreItem> </MoreItem>
<MoreItem label="任务类型"> <MoreItem :label="$t('select.taskType')">
<RequestSelect <RequestSelect
:request="getTaskTypeApi" :request="getTaskTypeApi"
v-model="query.jobType" v-model="query.jobType"
...@@ -109,7 +86,7 @@ ...@@ -109,7 +86,7 @@
valueFiled="paramValue" valueFiled="paramValue"
/> />
</MoreItem> </MoreItem>
<MoreItem label="巡检人"> <MoreItem :label="$t('select.examiner')">
<SearchSelect <SearchSelect
url="/api/v1/users/searching" url="/api/v1/users/searching"
searchField="userName" searchField="userName"
...@@ -121,7 +98,7 @@ ...@@ -121,7 +98,7 @@
</template> </template>
<template #operation> <template #operation>
<a-button @click="download">导出</a-button> <a-button @click="download">{{ $t('export') }}</a-button>
</template> </template>
<template #drawer="{ hidden, refresh, type, row }"> <template #drawer="{ hidden, refresh, type, row }">
...@@ -130,16 +107,16 @@ ...@@ -130,16 +107,16 @@
<Detail v-if="type === 'detail'" :hidden="hidden" :row="row" /> <Detail v-if="type === 'detail'" :hidden="hidden" :row="row" />
</template> </template>
<a-table-column title="线路名称" data-index="routeName" /> <a-table-column :title="$t('select.routeName')" data-index="routeName" />
<a-table-column title="专业" data-index="specialityName" /> <a-table-column :title="$t('select.speciality')" data-index="specialityName" />
<a-table-column title="地区" data-index="regionName" /> <a-table-column :title="$t('select.region')" data-index="regionName" />
<a-table-column title="班组" data-index="shiftTypeName" /> <a-table-column :title="$t('select.shiftTypeName')" data-index="shiftTypeName" width="180px" />
<a-table-column title="任务时间" data-index="jobTime" /> <a-table-column :title="$t('table.jobTime')" data-index="jobTime" />
<a-table-column title="巡检状态" data-index="inspectionStateName" /> <a-table-column :title="$t('select.examine')" data-index="inspectionStateName" />
<a-table-column title="任务类型" data-index="jobTypeName" /> <a-table-column :title="$t('select.taskType')" data-index="jobTypeName" />
<a-table-column title="巡检开始时间" data-index="inspectionStartTime" /> <a-table-column :title="$t('table.inspectionStartTime')" data-index="inspectionStartTime" />
<a-table-column title="巡检结束时间" data-index="inspectionEndTime" /> <a-table-column :title="$t('table.inspectionEndTime')" data-index="inspectionEndTime" />
<a-table-column title="巡检人" data-index="lastInspectionStaffName" /> <a-table-column :title="$t('select.examiner')" data-index="lastInspectionStaffName" />
</Table> </Table>
</template> </template>
...@@ -173,26 +150,30 @@ export default { ...@@ -173,26 +150,30 @@ export default {
getBanZuListApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'shift_type'), getBanZuListApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'shift_type'),
getTaskTypeApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'job_type'), getTaskTypeApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'job_type'),
addBtn: { addBtn: {
title: '新建临时任务', title: this.$t('table.newTemporaryTask'),
},
buttons: {
options: { fixed: 'right', width: 200 },
data: [
{
label: this.$t('table.detail'),
click: this.viewDetail,
},
{ label: this.$t('table.progress'), click: this.viewProgress },
{
type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/jobs/${row.jobId}`,
after: this.refresh,
},
],
}, },
buttons: [
{
label: '详情',
click: this.viewDetail,
},
{ label: '进度', click: this.viewProgress },
{
type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/jobs/${row.jobId}`,
after: this.refresh,
},
],
selected: {}, selected: {},
scroll: { x: 1500 },
}; };
}, },
methods: { methods: {
async download() { async download() {
if (!this.selected?.keys?.length) return this.$message.error('请选择需要导出的数据'); if (!this.selected?.keys?.length) return this.$message.error(this.$t('table.pleaseSelect'));
const url = await getXunJianDownloadUrlApi(this.selected.keys); const url = await getXunJianDownloadUrlApi(this.selected.keys);
downloadFileByUrl(`${this.$fileUrl}${url}`); downloadFileByUrl(`${this.$fileUrl}${url}`);
}, },
...@@ -200,10 +181,10 @@ export default { ...@@ -200,10 +181,10 @@ export default {
this.$refs['table'].getData(); this.$refs['table'].getData();
}, },
viewProgress(row) { viewProgress(row) {
this.$refs.table.show({ title: '任务进度', type: 'progress', row }); this.$refs.table.show({ title: this.$t('table.taskProgress'), type: 'progress', row });
}, },
viewDetail(row) { viewDetail(row) {
this.$refs.table.show({ title: '任务明细', type: 'detail', row }); this.$refs.table.show({ title: this.$t('table.taskDetail'), type: 'detail', row });
}, },
}, },
}; };
......
<template>
<h1>TODO</h1>
</template>
<template> <template>
<div class="tw-flex"> <div class="tw-flex">
<a-form-model layout="vertical" style="flex: 0 0 400px"> <a-form-model layout="vertical" style="flex: 0 0 400px">
<a-form-model-item label="用户账户"> <a-form-model-item :label="$t('user.account')">
<a-input disabled :value="loginId" /> <a-input disabled :value="loginId" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="姓名"> <a-form-model-item :label="$t('user.name')">
<a-input v-model="form.userName" /> <a-input v-model="form.userName" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="固定电话"> <a-form-model-item :label="$t('user.fixedPhone')">
<a-input v-model="form.fixedPhone" /> <a-input v-model="form.fixedPhone" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="移动电话"> <a-form-model-item :label="$t('user.mobilePhone')">
<a-input v-model="form.mobilePhone" /> <a-input v-model="form.mobilePhone" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="电子邮箱"> <a-form-model-item :label="$t('user.email')">
<a-input v-model="form.userEmail" /> <a-input v-model="form.userEmail" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item> <a-form-model-item>
<a-button type="primary" :loading="loading" @click="update">更新信息</a-button> <a-button type="primary" :loading="loading" @click="update">
{{ $t('user.updateInfo') }}
</a-button>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<div style="flex: 0 0 300px" class="tw-flex tw-flex-col tw-items-center "> <div style="flex: 0 0 300px" class="tw-flex tw-flex-col tw-items-center">
<div>头像</div> <div>{{ $t('user.avator') }}</div>
<img <img
style="width: 100px;height: 100px" style="width: 100px; height: 100px"
class="tw-max-w-full tw-max-h-full tw-rounded-full tw-my-4" class="tw-max-w-full tw-max-h-full tw-rounded-full tw-my-4"
:src="userAvatar" :src="userAvatar"
/> />
......
<template> <template>
<my-table url="/api/v1/messages/notices"> <Table url="/api/v1/messages/notices" noMargin>
<template #search="{query}"> <template #search="{ query }">
<my-form-item label="开始时间"> <MoreItem :label="$t('select.startTime')">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
v-model="query.startTime" v-model="query.startTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
/> />
</my-form-item> </MoreItem>
<my-form-item label="结束时间"> <MoreItem :label="$t('select.endTime')">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
v-model="query.endTime" v-model="query.endTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
/> />
</my-form-item> </MoreItem>
<my-form-item label="是否已读"> <MoreItem :label="$t('table.hasRead')">
<a-select v-model="query.isRead" allowClear> <a-select v-model="query.isRead" allowClear :placeholder="$t('input.placeholder')">
<a-select-option :value="1">已读</a-select-option> <a-select-option :value="1">{{ $t('table.read') }}</a-select-option>
<a-select-option :value="0">未读</a-select-option> <a-select-option :value="0">{{ $t('table.unread') }}</a-select-option>
</a-select> </a-select>
</my-form-item> </MoreItem>
</template> </template>
<a-table-column title="标题" data-index="noticeTitle" /> <a-table-column :title="$t('title')" data-index="noticeTitle" />
<a-table-column title="内容" data-index="noticeContent" /> <a-table-column :title="$t('content')" data-index="noticeContent" />
<a-table-column title="创建时间" data-index="createTime" /> <a-table-column :title="$t('table.createTime')" data-index="createTime" />
<a-table-column title="发送者" data-index="noticeSenderName" /> <a-table-column :title="$t('sender')" data-index="noticeSenderName" />
<a-table-column title="接受者" data-index="noticeReceiverName" /> <a-table-column :title="$t('recipient')" data-index="noticeReceiverName" />
<a-table-column title="是否已读" data-index="isReadName" /> <a-table-column :title="$t('user.read')" data-index="isReadName" />
<a-table-column title="已读时间" data-index="readTime" /> <a-table-column :title="$t('user.readTime')" data-index="readTime" />
</my-table> </Table>
</template> </template>
<script>
import MoreItem from '@/components/table/more_item.vue';
import Table from '@/components/table/table.vue';
export default {
components: { MoreItem, Table },
};
</script>
\ No newline at end of file
<template>
<h1>ToDo</h1>
</template>
\ No newline at end of file
<template>
<h1>TODO</h1>
</template>
<template> <template>
<my-card class="tw-flex"> <my-card class="tw-flex">
<a-menu style="flex: 0 0 100px" v-model="selectKeys"> <a-menu style="flex: 0 0 100px" v-model="selectKeys">
<a-menu-item key="UserInfo">个人信息</a-menu-item> <a-menu-item key="UserInfo">{{ $t('profile') }}</a-menu-item>
<a-menu-item key="ModifyPassword">修改密码</a-menu-item> <a-menu-item key="ModifyPassword">{{ $t('user.modifyPassword') }}</a-menu-item>
<a-menu-item key="MessageCenter">消息中心</a-menu-item> <a-menu-item key="MessageCenter">{{ $t('tabNotice') }}</a-menu-item>
<a-menu-item key="ToDo">代办事宜</a-menu-item> <a-menu-item key="ToDo">{{ $t('tabTodo') }}</a-menu-item>
</a-menu> </a-menu>
<div class="tw-flex-1 tw-ml-6"> <div class="tw-flex-1 tw-ml-6">
<component :is="currentCom" /> <component :is="currentCom" />
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<script> <script>
import UserInfo from './components/info.vue'; import UserInfo from './components/info.vue';
import MessageCenter from './components/message.vue'; import MessageCenter from './components/message.vue';
import ToDo from './components/todo.vue'; import ToDo from './components/page_todo.vue';
import ModifyPassword from './components/modify_password.vue'; import ModifyPassword from './components/modify_password.vue';
const components = { const components = {
......
...@@ -239,7 +239,7 @@ const hasAuthorityRoutes = [ ...@@ -239,7 +239,7 @@ const hasAuthorityRoutes = [
], ],
}, },
{ {
path: 'user', path: 'profile/accout',
name: '个人中心', name: '个人中心',
meta: { icon: 'user' }, meta: { icon: 'user' },
component: () => import('@/pages/user/index.vue'), component: () => import('@/pages/user/index.vue'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment