fix: 国际化优化、任务管理修改

This commit is contained in:
2024-04-08 11:01:56 +08:00
parent 5c533fff98
commit 47e497cb1e
25 changed files with 591 additions and 222 deletions

View File

@@ -8,7 +8,7 @@
v-model="query.blurry"
size="mini"
clearable
placeholder="输入名称"
:placeholder="$t('Role.msg.m1')"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
@@ -24,19 +24,19 @@
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0"
:title="crud.status.title"
width="520px"
:width="computedLabelWidth"
>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="角色名称" prop="name">
<el-input v-model="form.name" style="width: 380px;"/>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" :label-width="computedFormLabelWidth">
<el-form-item :label="$t('Role.dialog.name')" prop="name">
<el-input v-model="form.name" style="width: 240px;"/>
</el-form-item>
<el-form-item label="备注" prop="description">
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea"/>
<el-form-item :label="$t('Role.dialog.description')" prop="description">
<el-input v-model="form.remark" style="width: 240px;" rows="2" type="textarea"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
<el-button type="text" @click="crud.cancelCU">{{ $t('common.Cancel') }}</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">{{ $t('common.Confirm') }}</el-button>
</div>
</el-dialog>
<el-row :gutter="15">
@@ -44,7 +44,7 @@
<el-col :span="12" style="margin-bottom: 10px">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">角色列表</span>
<span class="role-span">{{ $t('Role.title_left') }}</span>
</div>
<el-table
ref="table"
@@ -56,16 +56,16 @@
@current-change="handleCurrentChange"
>
<el-table-column type="selection" width="55"/>
<el-table-column prop="name" label="名称" min-width="100" show-overflow-tooltip/>
<el-table-column show-overflow-tooltip prop="remark" label="描述"/>
<el-table-column show-overflow-tooltip width="135px" prop="create_time" label="创建日期">
<el-table-column prop="name" :label="$t('Role.table.name')" min-width="100" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="remark" :label="$t('Role.table.description')" />
<el-table-column show-overflow-tooltip width="135px" prop="create_time" :label="$t('Role.table.create_time')">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.create_time) }}</span>
</template>
</el-table-column>
<el-table-column
v-permission="['admin','roles:edit','roles:del']"
label="操作"
:label="$t('common.Operate')"
width="130px"
align="center"
fixed="right"
@@ -86,8 +86,8 @@
<el-col :span="12">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<el-tooltip class="item" effect="dark" content="选择指定角色分配菜单" placement="top">
<span class="role-span">菜单分配</span>
<el-tooltip class="item" effect="dark" :content="$t('Role.msg.m2')" placement="top">
<span class="role-span">{{ $t('Role.title_right') }}</span>
</el-tooltip>
<el-button
v-permission="['admin','roles:edit']"
@@ -98,10 +98,9 @@
style="float: right; padding: 6px 10px"
type="primary"
@click="saveMenu"
>保存
>{{ $t('Role.save') }}
</el-button>
</div>
<el-tree
ref="menu"
lazy
@@ -130,13 +129,14 @@ import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import i18n from "@/i18n";
const defaultForm = { role_id: null, name: null, remark: null }
export default {
name: 'Role',
components: { pagination, crudOperation, rrOperation, udOperation, crudMenu },
cruds() {
return CRUD({ idField: 'role_id', title: '角色', url: 'api/sysRole', crudMethod: { ...crudRoles } })
return CRUD({ idField: 'role_id', title: i18n.t('Role.title'), url: 'api/sysRole', crudMethod: { ...crudRoles } })
},
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {
@@ -151,14 +151,30 @@ export default {
},
rules: {
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
{ required: true, message: i18n.t('Role.msg.m3'), trigger: 'blur' }
],
permission: [
{ required: true, message: '请输入权限', trigger: 'blur' }
{ required: true, message: i18n.t('Role.msg.m4'), trigger: 'blur' }
]
}
}
},
computed: {
computedLabelWidth() {
const item = localStorage.getItem('lang')
if (item === 'zh') {
return `400px`
}
return `420px`
},
computedFormLabelWidth() {
const item = localStorage.getItem('lang')
if (item === 'zh') {
return `80px`
}
return `120px`
}
},
created() {
},
methods: {
@@ -244,7 +260,7 @@ export default {
role.menus.push(menu)
})
crudRoles.editMenu(role).then(() => {
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.notify(i18n.t('Role.msg.m5'), CRUD.NOTIFICATION_TYPE.SUCCESS)
this.menuLoading = false
this.crud.toQuery()
// this.update()

View File

@@ -1,7 +1,7 @@
<template>
<div>
<el-tabs type="border-card">
<el-tab-pane v-if="shouldHide('second')" label="">
<el-tab-pane v-if="shouldHide('second')" :label="$t('cron.tab-name.s')">
<CrontabSecond
ref="cronsecond"
:check="checkNumber"
@@ -10,7 +10,7 @@
/>
</el-tab-pane>
<el-tab-pane v-if="shouldHide('min')" label="分钟">
<el-tab-pane v-if="shouldHide('min')" :label="$t('cron.tab-name.min')">
<CrontabMin
ref="cronmin"
:check="checkNumber"
@@ -19,7 +19,7 @@
/>
</el-tab-pane>
<el-tab-pane v-if="shouldHide('hour')" label="小时">
<el-tab-pane v-if="shouldHide('hour')" :label="$t('cron.tab-name.h')">
<CrontabHour
ref="cronhour"
:check="checkNumber"
@@ -28,7 +28,7 @@
/>
</el-tab-pane>
<el-tab-pane v-if="shouldHide('day')" label="">
<el-tab-pane v-if="shouldHide('day')" :label="$t('cron.tab-name.d')">
<CrontabDay
ref="cronday"
:check="checkNumber"
@@ -37,7 +37,7 @@
/>
</el-tab-pane>
<el-tab-pane v-if="shouldHide('month')" label="">
<el-tab-pane v-if="shouldHide('month')" :label="$t('cron.tab-name.m')">
<CrontabMonth
ref="cronmonth"
:check="checkNumber"
@@ -46,7 +46,7 @@
/>
</el-tab-pane>
<el-tab-pane v-if="shouldHide('week')" label="">
<el-tab-pane v-if="shouldHide('week')" :label="$t('cron.tab-name.w')">
<CrontabWeek
ref="cronweek"
:check="checkNumber"
@@ -55,7 +55,7 @@
/>
</el-tab-pane>
<el-tab-pane v-if="shouldHide('year')" label="">
<el-tab-pane v-if="shouldHide('year')" :label="$t('cron.tab-name.y')">
<CrontabYear
ref="cronyear"
:check="checkNumber"
@@ -67,11 +67,11 @@
<div class="popup-main">
<div class="popup-result">
<p class="title">时间表达式</p>
<p class="title">{{ $t('cron.title') }}</p>
<table>
<thead>
<th v-for="item of tabTitles" :key="item" width="40">{{ item }}</th>
<th>Cron 表达式</th>
<th v-for="item of tabTitles" :key="item" width="45">{{ item }}</th>
<th>{{ $t('cron.cron-title') }}</th>
</thead>
<tbody>
<td>
@@ -104,9 +104,9 @@
<CrontabResult :ex="crontabValueString" />
<div class="pop_btn">
<el-button size="small" type="primary" @click="submitFill">确定</el-button>
<el-button size="small" type="warning" @click="clearCron">重置</el-button>
<el-button size="small" @click="hidePopup">取消</el-button>
<el-button size="small" type="primary" @click="submitFill">{{ $t('common.Confirm') }}</el-button>
<el-button size="small" type="warning" @click="clearCron">{{ $t('common.Reset') }}</el-button>
<el-button size="small" @click="hidePopup">{{ $t('common.Cancel') }}</el-button>
</div>
</div>
</div>
@@ -121,6 +121,7 @@ import CrontabMonth from './month.vue'
import CrontabWeek from './week.vue'
import CrontabYear from './year.vue'
import CrontabResult from './result.vue'
import i18n from "@/i18n";
export default {
name: 'Crontab',
@@ -137,7 +138,8 @@ export default {
props: ['expression', 'hideComponent'],
data() {
return {
tabTitles: ['秒', '分钟', '小时', '日', '月', '周', '年'],
tabTitles: [i18n.t('cron.tab-name.s'), i18n.t('cron.tab-name.min'), i18n.t('cron.tab-name.h'),
i18n.t('cron.tab-name.d'), i18n.t('cron.tab-name.m'), i18n.t('cron.tab-name.w'), i18n.t('cron.tab-name.y')],
tabActive: 0,
myindex: 0,
crontabValueObj: {

View File

@@ -2,49 +2,49 @@
<el-form size="small">
<el-form-item>
<el-radio v-model="radioValue" :label="1">
允许的通配符[, - * ? / L W]
{{ $t('cron.d.m1') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
不指定
{{ $t('cron.d.m7') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
周期从
{{ $t('cron.s.m2') }}
<el-input-number v-model="cycle01" :min="1" :max="30" /> -
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="31" />
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="31" /> {{ $t('cron.tab-name.d') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
<el-input-number v-model="average01" :min="1" :max="30" /> 号开始
<el-input-number v-model="average02" :min="1" :max="31 - average01 || 1" /> 日执行一次
{{ $t('cron.s.m4') }}
<el-input-number v-model="average01" :min="1" :max="30" /> {{ $t('cron.d.m2') }}
<el-input-number v-model="average02" :min="1" :max="31 - average01 || 1" /> {{ $t('cron.d.m3') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="5">
每月
<el-input-number v-model="workday" :min="1" :max="31" /> 号最近的那个工作日
{{ $t('cron.d.m4') }}
<el-input-number v-model="workday" :min="1" :max="31" /> {{ $t('cron.d.m5') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="6">
本月最后一天
{{ $t('cron.d.m7') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="7">
指定
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
{{ $t('cron.s.m7') }}
<el-select v-model="checkboxList" clearable :placeholder="$t('cron.tip')" multiple style="width:100%">
<el-option v-for="item in 31" :key="item" :value="item">{{ item }}</el-option>
</el-select>
</el-radio>

View File

@@ -2,30 +2,30 @@
<el-form size="small">
<el-form-item>
<el-radio v-model="radioValue" :label="1">
小时允许的通配符[, - * /]
{{ $t('cron.h.m1') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
周期从
{{ $t('cron.s.m2') }}
<el-input-number v-model="cycle01" :min="0" :max="22" /> -
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> 小时
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> {{ $t('cron.tab-name.h') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
<el-input-number v-model="average01" :min="0" :max="22" /> 小时开始
<el-input-number v-model="average02" :min="1" :max="23 - average01 || 0" /> 小时执行一次
{{ $t('cron.s.m4') }}
<el-input-number v-model="average01" :min="0" :max="22" /> {{ $t('cron.h.m2') }}
<el-input-number v-model="average02" :min="1" :max="23 - average01 || 0" /> {{ $t('cron.h.m3') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
指定
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
{{ $t('cron.s.m7') }}
<el-select v-model="checkboxList" clearable :placeholder="$t('cron.tip')" multiple style="width:100%">
<el-option v-for="item in 24" :key="item" :value="item-1">{{ item-1 }}</el-option>
</el-select>
</el-radio>

View File

@@ -2,30 +2,30 @@
<el-form size="small">
<el-form-item>
<el-radio v-model="radioValue" :label="1">
分钟允许的通配符[, - * /]
{{ $t('cron.min.m1') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
周期从
{{ $t('cron.s.m2') }}
<el-input-number v-model="cycle01" :min="0" :max="58" /> -
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 分钟
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> {{ $t('cron.tab-name.min') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
<el-input-number v-model="average01" :min="0" :max="58" /> 分钟开始
<el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 分钟执行一次
{{ $t('cron.s.m4') }}
<el-input-number v-model="average01" :min="0" :max="58" /> {{ $t('cron.min.m2') }}
<el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> {{ $t('cron.min.m3') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
指定
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
{{ $t('cron.s.m7') }}
<el-select v-model="checkboxList" clearable :placeholder="$t('cron.tip')" multiple style="width:100%">
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item-1 }}</el-option>
</el-select>
</el-radio>

View File

@@ -2,13 +2,13 @@
<el-form size="small">
<el-form-item>
<el-radio v-model="radioValue" :label="1">
允许的通配符[, - * /]
{{ $t('cron.m.m1') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
周期从
{{ $t('cron.w.m2') }}
<el-input-number v-model="cycle01" :min="1" :max="11" /> -
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="12" />
</el-radio>
@@ -16,16 +16,18 @@
<el-form-item>
<el-radio v-model="radioValue" :label="3">
<el-input-number v-model="average01" :min="1" :max="11" /> 月开始
<el-input-number v-model="average02" :min="1" :max="12 - average01 || 0" /> 月月执行一次
{{ $t('cron.s.m4') }}
<el-input-number v-model="average01" :min="1" :max="11" />
{{ $t('cron.m.m2') }}
<el-input-number v-model="average02" :min="1" :max="12 - average01 || 0" />
{{ $t('cron.m.m3') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
指定
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
{{ $t('cron.s.m7') }}
<el-select v-model="checkboxList" clearable :placeholder="$t('cron.tip')" multiple style="width:100%">
<el-option v-for="item in 12" :key="item" :value="item">{{ item }}</el-option>
</el-select>
</el-radio>
@@ -35,7 +37,7 @@
<script>
export default {
name: 'CrontabMonth',
name: 'crontabMonth',
props: ['check', 'cron'],
data() {
return {

View File

@@ -1,11 +1,11 @@
<template>
<div class="popup-result">
<p class="title">最近5次运行时间</p>
<p class="title">{{ $t('cron.result-msg1') }}</p>
<ul class="popup-result-scroll">
<template v-if="isShow">
<li v-for="item in resultList" :key="item">{{ item }}</li>
</template>
<li v-else>计算结果中...</li>
<li v-else>{{ $t('cron.result-msg2') }}</li>
</ul>
</div>
</template>

View File

@@ -2,30 +2,30 @@
<el-form size="small">
<el-form-item>
<el-radio v-model="radioValue" :label="1">
允许的通配符[, - * /]
{{ $t('cron.s.m1') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
周期从
{{ $t('cron.s.m2') }}
<el-input-number v-model="cycle01" :min="0" :max="58" /> -
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" />
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> {{ $t('cron.s.m3') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
<el-input-number v-model="average01" :min="0" :max="58" /> 秒开始
<el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 秒执行一次
{{ $t('cron.s.m4') }}
<el-input-number v-model="average01" :min="0" :max="58" /> {{ $t('cron.s.m5') }}
<el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> {{ $t('cron.s.m6') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="4">
指定
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
{{ $t('cron.s.m7') }}
<el-select v-model="checkboxList" clearable :placeholder="$t('cron.tip')" multiple style="width:100%">
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item-1 }}</el-option>
</el-select>
</el-radio>

View File

@@ -2,19 +2,19 @@
<el-form size="small">
<el-form-item>
<el-radio v-model="radioValue" :label="1">
允许的通配符[, - * ? / L #]
{{ $t('cron.w.m1') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
不指定
{{ $t('cron.d.m7') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
周期从星期
{{ $t('cron.w.m2') }}
<el-select v-model="cycle01" clearable>
<el-option
v-for="(item,index) of weekList"
@@ -39,8 +39,9 @@
<el-form-item>
<el-radio v-model="radioValue" :label="4">
<el-input-number v-model="average01" :min="1" :max="4" /> 周的星期
{{ $t('cron.w.m3') }}
<el-input-number v-model="average01" :min="1" :max="4" />
{{ $t('cron.w.m4') }}
<el-select v-model="average02" clearable>
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key">{{ item.value }}</el-option>
</el-select>
@@ -49,7 +50,7 @@
<el-form-item>
<el-radio v-model="radioValue" :label="5">
本月最后一个星期
{{ $t('cron.w.m5') }}
<el-select v-model="weekday" clearable>
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key">{{ item.value }}</el-option>
</el-select>
@@ -58,8 +59,8 @@
<el-form-item>
<el-radio v-model="radioValue" :label="6">
指定
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
{{ $t('cron.s.m7') }}
<el-select v-model="checkboxList" clearable :placeholder="$t('cron.tip')" multiple style="width:100%">
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="String(item.key)">{{ item.value }}</el-option>
</el-select>
</el-radio>
@@ -69,6 +70,8 @@
</template>
<script>
import i18n from "@/i18n";
export default {
name: 'CrontabWeek',
props: ['check', 'cron'],
@@ -84,31 +87,31 @@ export default {
weekList: [
{
key: 2,
value: '星期一'
value: i18n.t('cron.w.w1')
},
{
key: 3,
value: '星期二'
value: i18n.t('cron.w.w2')
},
{
key: 4,
value: '星期三'
value: i18n.t('cron.w.w3')
},
{
key: 5,
value: '星期四'
value: i18n.t('cron.w.w4')
},
{
key: 6,
value: '星期五'
value: i18n.t('cron.w.w5')
},
{
key: 7,
value: '星期六'
value: i18n.t('cron.w.w6')
},
{
key: 1,
value: '星期日'
value: i18n.t('cron.w.w7')
}
],
checkNum: this.$options.propsData.check

View File

@@ -2,19 +2,19 @@
<el-form size="small">
<el-form-item>
<el-radio v-model="radioValue" :label="1">
不填允许的通配符[, - * /]
{{ $t('cron.y.m1') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="2">
每年
{{ $t('cron.y.m4') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="3">
周期从
{{ $t('cron.w.m2') }}
<el-input-number v-model="cycle01" :min="fullYear" :max="2098" /> -
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : fullYear + 1" :max="2099" />
</el-radio>
@@ -22,17 +22,17 @@
<el-form-item>
<el-radio v-model="radioValue" :label="4">
<el-input-number v-model="average01" :min="fullYear" :max="2098" /> 年开始
<el-input-number v-model="average02" :min="1" :max="2099 - average01 || fullYear" /> 年执行一次
{{ $t('cron.s.m4') }}
<el-input-number v-model="average01" :min="fullYear" :max="2098" /> {{ $t('cron.y.m2') }}
<el-input-number v-model="average02" :min="1" :max="2099 - average01 || fullYear" /> {{ $t('cron.y.m3') }}
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model="radioValue" :label="5">
指定
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple>
{{ $t('cron.s.m7') }}
<el-select v-model="checkboxList" clearable :placeholder="$t('cron.tip')" multiple>
<el-option v-for="item in 9" :key="item" :value="item - 1 + fullYear" :label="item -1 + fullYear" />
</el-select>
</el-radio>

View File

@@ -65,20 +65,20 @@
:width="computedLabelWidth"
>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" :label-width="computedFormLabelWidth" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;">
<el-form-item :label="$t('User.table.user_name')" prop="username">
<el-form-item :label="$t('User.dialog.user_name')" prop="username">
<el-input v-model="form.username" style="width: 200px;" />
</el-form-item>
<el-form-item :label="$t('User.table.phone')" prop="phone">
<el-form-item :label="$t('User.dialog.phone')" prop="phone">
<el-input v-model.number="form.phone" style="width: 200px;" />
</el-form-item>
<el-form-item :label="$t('User.table.person_name')" prop="preson_name">
<el-form-item :label="$t('User.dialog.person_name')" prop="preson_name">
<el-input v-model="form.person_name" style="width: 200px;" />
</el-form-item>
<el-form-item :label="$t('User.table.email')" prop="email">
<el-form-item :label="$t('User.dialog.email')" prop="email">
<el-input v-model="form.email" style="width: 200px;" />
</el-form-item>
<br v-if="!crud.status.edit">
<el-form-item v-if="crud.status.add" :label="$t('User.table.depts')" prop="depts" :rules="[{ required: true, message: '请选择部门', trigger: 'change' }]">
<el-form-item v-if="crud.status.add" :label="$t('User.dialog.depts')" prop="depts" :rules="[{ required: true, message: $t('User.rules.r1'), trigger: 'change' }]">
<treeselect
v-model="form.depts"
:load-options="loadDepts"
@@ -94,13 +94,13 @@
<el-form-item v-if="crud.status.add" :label="$t('User.dialog.password')" prop="password">
<el-input v-model="form.password" style="width: 200px;" show-password auto-complete="new-password" />
</el-form-item>
<el-form-item :label="$t('User.table.gender')">
<el-form-item :label="$t('User.dialog.gender')">
<el-radio-group v-model="form.gender" style="width: 178px">
<el-radio label="1">{{ $t('User.dialog.sex_male') }}</el-radio>
<el-radio label="2">{{ $t('User.dialog.sex_female') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('User.table.enabled')" prop="is_uesd">
<el-form-item :label="$t('User.dialog.enabled')" prop="is_uesd">
<el-switch
v-model="form.is_used"
active-color="#409EFF"
@@ -149,7 +149,7 @@
:label="$t('User.table.person_name')"
:min-width="flexWidth('person_name',crud.data,$t('User.table.person_name'))"
/>
<el-table-column prop="gender" :label="$t('User.table.gender')" :min-width="flexWidth('gender',crud.data,$t('User.table.gender'))">
<el-table-column prop="gender" :label="$t('User.table.gender')" :min-width="flexWidth('gender1',crud.data,$t('User.table.gender'))">
<template slot-scope="scope">
{{ scope.row.gender === '1' ? $t('User.dialog.sex_male') : $t('User.dialog.sex_female') }}
</template>
@@ -173,7 +173,7 @@
:label="$t('common.Operate')"
fixed="right"
align="center"
width="200"
width="250"
>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="crud.toEdit(scope.row)">{{ $t('common.Update') }}</el-button>
@@ -236,12 +236,12 @@
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="name" label="角色名称" min-width="100" show-overflow-tooltip />
<el-table-column prop="name" :label="$t('User.table.role_name')" min-width="100" show-overflow-tooltip />
</el-table>
</div>
<div style="height: 10%">
<el-button @click="cancelForm">取 消</el-button>
<el-button type="primary" @click="saveChecked">保 存</el-button>
<el-button @click="cancelForm">{{ $t('common.Cancel') }}</el-button>
<el-button type="primary" @click="saveChecked">{{ $t('common.Confirm') }}</el-button>
</div>
</div>
</el-drawer>
@@ -610,15 +610,15 @@ export default {
// 改变状态
changeEnabled(row) {
const satus = this.enabledTypeOptions.find(item => { return item.key !== row.is_used })
this.$confirm('此操作将' + satus.display_name + '账号:' + row.username + ', 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(i18n.t('User.msg.m3_1') + satus.display_name + i18n.t('User.msg.m3_2') + row.username + i18n.t('User.msg.m3_3'), i18n.t('common.Tips'), {
confirmButtonText: i18n.t('common.Confirm'),
cancelButtonText: i18n.t('common.Cancel'),
type: 'warning'
}).then(() => {
row.is_used = satus.key
crudUser.edit(row).then(res => {
this.crud.toQuery()
this.crud.notify('账号' + row.username + '已' + satus.display_name)
this.crud.notify(i18n.t('User.msg.m3_2') + row.username + i18n.t('User.msg.m3_4') + satus.display_name)
})
})
},
@@ -641,15 +641,15 @@ export default {
return true
},
resetPassword(row) {
this.$confirm(`确认重置密码?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(i18n.t('User.msg.m1'), i18n.t('common.Tips'), {
confirmButtonText: i18n.t('common.Confirm'),
cancelButtonText: i18n.t('common.Cancel'),
type: 'warning'
}).then(() => {
row.password = '123456'
crudUser.edit(row).then(res => {
this.crud.toQuery()
this.crud.notify('密码重置成功,密码:123456', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.notify(i18n.t('User.msg.m2'), CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
@@ -659,7 +659,7 @@ export default {
this.deptsDatas = res.content
})
this.openDrawer() // 打开抽屉
this.drawerTitle = '分配部门权限'
this.drawerTitle = i18n.t('User.drawerTitle2')
this.flag = true
// 默认选中
const deptIds = []
@@ -689,7 +689,7 @@ export default {
})
})
this.openDrawer()
this.drawerTitle = '分配角色权限'
this.drawerTitle = i18n.t('User.drawerTitle1')
this.flag = false
this.giveValue(row)
},
@@ -699,11 +699,9 @@ export default {
this.multipleSelection = []
// 获取权限范围
crudDataPermission.getDataScopeType().then(res => {
console.log('权限范围', res)
this.dataDialog.dataScopeType = res
// permissions
crudDataPermission.getDataPermissionOption().then(res => {
console.log('数据权限', res)
this.permissions = res
this.dataDialog.person_name = row.person_name
this.dataDialog.username = row.username
@@ -712,7 +710,6 @@ export default {
this.dataPerm = true
// 回显数据
crudDataPermission.getDataShow(row.user_id).then(res => {
console.log('要回显的数据', res)
this.$nextTick(function() {
for (var index = 0; index < res.length; index++) {
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {