Compare commits

..

No commits in common. "89fe4e4c004cfb48006d44c2f698645952b241e7" and "3e680d0033ede7a2d67f09c7dbad865d1fa7e298" have entirely different histories.

5 changed files with 140 additions and 210 deletions

View File

@ -126,12 +126,10 @@
</el-table-column>
</el-table>
<div style="text-align: right; padding-top: 10px; padding-right: 10px">
<el-button size="mini" @click="drawer = false"
>{{ $t('common:button:cancel') }}
</el-button>
<el-button size="mini" type="primary" @click="handleSave">{{
$t('common:button:save')
}}</el-button>
<el-button size="mini" @click="drawer = false">取消 </el-button>
<el-button size="mini" type="primary" @click="handleSave"
>保存</el-button
>
</div>
</el-drawer>
<feedBack v-if="$route.matched.length > 0" />

View File

@ -171,11 +171,7 @@
:label="$t('curriculumVitae:info:form:email')"
prop="EMail"
>
<el-input
v-model="form.EMail"
clearable
:disabled="DATA.IsHaveAccount"
></el-input>
<el-input v-model="form.EMail" clearable disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">

View File

@ -8,10 +8,7 @@
size="small"
:rules="rules"
>
<el-form-item
:label="$t('system:l18n:search:InternationalizationType')"
prop="InternationalizationType"
>
<el-form-item label="国际化类型" prop="InternationalizationType">
<el-radio-group v-model="form.InternationalizationType">
<el-radio
v-for="item of $d.InternationalizationType"
@ -21,7 +18,7 @@
>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('system:l18n:search:State')" prop="State">
<el-form-item label="状态" prop="State">
<el-radio-group v-model="form.State">
<el-radio
v-for="item of $d.InternationalizationKeyState"
@ -31,10 +28,7 @@
>
</el-radio-group>
</el-form-item>
<el-form-item
:label="$t('system:l18n:search:PublishVersion')"
prop="PublishLogId"
>
<el-form-item label="迭代" prop="PublishLogId">
<el-select v-model="form.PublishLogId" clearable filterable>
<el-option
v-for="item in PublishVersionList"
@ -45,7 +39,7 @@
</el-select>
</el-form-item>
<el-table :data="form.AddList" style="width: 100%" height="300">
<el-table-column prop="" :label="$t('system:l18n:search:Module')">
<el-table-column prop="" label="功能模块/服务名">
<template slot-scope="scope">
<el-form-item
label=""
@ -67,7 +61,7 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="" :label="$t('system:l18n:search:Code')">
<el-table-column prop="" label="标识">
<template slot-scope="scope">
<el-form-item
label=""
@ -93,7 +87,7 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="" :label="$t('system:l18n:search:ValueCN')">
<el-table-column prop="" label="中文值">
<template slot-scope="scope">
<el-form-item
label=""
@ -119,7 +113,7 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="" :label="$t('system:l18n:search:Value')">
<el-table-column prop="" label="英文值">
<template slot-scope="scope">
<el-form-item
label=""
@ -145,10 +139,7 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop=""
:label="$t('system:l18n:search:Description')"
>
<el-table-column prop="" label="说明">
<template slot-scope="scope">
<el-form-item
label=""
@ -178,7 +169,7 @@
type="primary"
icon="el-icon-plus"
@click="handleAdd"
>{{ $t('common:button:new') }}</el-button
>{{ $t("common:button:new") }}</el-button
>
</template>
<template slot-scope="scope">
@ -188,7 +179,7 @@
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.$index)"
>{{ $t('common:button:delete') }}</el-button
>{{ $t("common:button:delete") }}</el-button
>
</template>
</el-table-column>
@ -196,28 +187,28 @@
</el-form>
</template>
<template slot="dialog-footer">
<el-button size="small" type="primary" @click="handleCancle">{{
$t('common:button:cancel')
}}</el-button>
<el-button size="small" type="primary" @click="handleSave">{{
$t('common:button:save')
}}</el-button>
<el-button size="small" type="primary" @click="handleCancle"
>取消</el-button
>
<el-button size="small" type="primary" @click="handleSave"
>保存</el-button
>
</template>
</base-model>
</template>
<script>
import { batchAddInternationalization } from '@/api/admin'
import BaseModel from '@/components/BaseModel'
import { batchAddInternationalization } from "@/api/admin";
import BaseModel from "@/components/BaseModel";
const formDataDefault = () => {
return {
State: 0,
InternationalizationType: 1,
PublishLogId: null,
AddList: [],
}
}
};
};
export default {
name: 'BatcnAddForm',
name: "BatcnAddForm",
components: { BaseModel },
data() {
return {
@ -226,65 +217,59 @@ export default {
model_cfg: {
visible: false,
showClose: true,
width: '800px',
title: '',
width: "800px",
title: "",
appendToBody: true,
},
rules: {
PublishLogId: [
{
required: true,
message: this.$t('system:l18n:rule:selectPublishLogId'),
trigger: 'blur',
},
],
PublishLogId: [{ required: true, message: "请选择", trigger: "blur" }],
},
PublishVersionList: [],
}
};
},
mounted() {},
methods: {
openDialog(title, data, options = []) {
this.PublishVersionList = options
this.model_cfg.visible = true
this.model_cfg.title = title
this.form = formDataDefault()
this.PublishVersionList = options;
this.model_cfg.visible = true;
this.model_cfg.title = title;
this.form = formDataDefault();
},
handleSave() {
this.$refs.batcnAddForm.validate((valid) => {
if (!valid) return
this.loading = true
if (!valid) return;
this.loading = true;
batchAddInternationalization(this.form)
.then((res) => {
this.loading = false
this.$message.success(this.$t('common:message:savedSuccessfully'))
this.model_cfg.visible = false
this.$emit('getList')
this.loading = false;
this.$message.success(this.$t("common:message:savedSuccessfully"));
this.model_cfg.visible = false;
this.$emit("getList");
})
.catch(() => {
this.loading = false
})
})
this.loading = false;
});
});
},
handleCancle() {
this.model_cfg.visible = false
this.model_cfg.visible = false;
},
handleAdd() {
this.form.AddList.push({
Description: '',
Code: '',
ValueCN: '',
Value: '',
})
Description: "",
Code: "",
ValueCN: "",
Value: "",
});
},
handleDelete(index) {
this.$confirm(this.$t('system:l18n:confirm:delete'), {
type: 'warning',
this.$confirm("是否确认删除?", {
type: "warning",
distinguishCancelAndClose: true,
}).then(() => {
this.form.AddList.splice(index, 1)
})
this.form.AddList.splice(index, 1);
});
},
},
}
};
</script>

View File

@ -10,7 +10,7 @@
size="small"
>
<el-form-item
:label="$t('system:l18n:search:InternationalizationType')"
label="国际化类型"
prop="InternationalizationType"
v-if="status !== 'batch'"
>
@ -24,7 +24,7 @@
</el-radio-group>
</el-form-item>
<el-form-item
:label="$t('system:l18n:search:Module')"
label="功能模块/服务名"
prop="Module"
v-if="status !== 'batch'"
>
@ -35,11 +35,7 @@
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item>
<el-form-item
:label="$t('system:l18n:search:Code')"
prop="Code"
v-if="status !== 'batch'"
>
<el-form-item label="标识" prop="Code" v-if="status !== 'batch'">
<el-input
v-model="form.Code"
type="textarea"
@ -47,11 +43,7 @@
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item>
<el-form-item
:label="$t('system:l18n:search:ValueCN')"
prop="ValueCN"
v-if="status !== 'batch'"
>
<el-form-item label="中文值" prop="ValueCN" v-if="status !== 'batch'">
<el-input
v-model="form.ValueCN"
type="textarea"
@ -59,11 +51,7 @@
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item>
<el-form-item
:label="$t('system:l18n:search:Value')"
prop="Value"
v-if="status !== 'batch'"
>
<el-form-item label="英文值" prop="Value" v-if="status !== 'batch'">
<el-input
v-model="form.Value"
type="textarea"
@ -71,7 +59,7 @@
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item>
<el-form-item :label="$t('system:l18n:search:State')" prop="State">
<el-form-item label="状态" prop="State">
<el-radio-group v-model="form.State">
<el-radio
v-for="item of $d.InternationalizationKeyState"
@ -81,11 +69,7 @@
>
</el-radio-group>
</el-form-item>
<el-form-item
:label="$t('system:l18n:search:Description')"
prop="Description"
v-if="status !== 'batch'"
>
<el-form-item label="说明" prop="Description" v-if="status !== 'batch'">
<el-input
v-model="form.Description"
type="textarea"
@ -93,10 +77,7 @@
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item>
<el-form-item
:label="$t('system:l18n:search:PublishVersion')"
prop="PublishLogId"
>
<el-form-item label="迭代" prop="PublishLogId">
<el-select v-model="form.PublishLogId" clearable filterable>
<el-option
v-for="item in PublishVersionList"
@ -109,18 +90,18 @@
</el-form>
</template>
<template slot="dialog-footer">
<el-button size="small" type="primary" @click="handleCancle">{{
$t('common:button:cancel')
}}</el-button>
<el-button size="small" type="primary" @click="handleSave">{{
$t('common:button:save')
}}</el-button>
<el-button size="small" type="primary" @click="handleCancle"
>取消</el-button
>
<el-button size="small" type="primary" @click="handleSave"
>保存</el-button
>
</template>
</base-model>
</template>
<script>
import { addOrUpdateInternationalization } from '@/api/admin'
import BaseModel from '@/components/BaseModel'
import { addOrUpdateInternationalization } from "@/api/admin";
import BaseModel from "@/components/BaseModel";
const formDataDefault = () => {
return {
Id: null,
@ -132,138 +113,110 @@ const formDataDefault = () => {
ValueCN: null,
InternationalizationType: 1,
PublishLogId: null,
}
}
};
};
export default {
name: 'I18nForm',
name: "I18nForm",
components: { BaseModel },
data() {
return {
status: 'add', // add update batch
status: "add", // add update batch
loading: false,
form: formDataDefault(),
rules: {
State: [
{
required: true,
message: this.$t('system:l18n:rule:selectState'),
trigger: 'blur',
},
],
State: [{ required: true, message: "请选择", trigger: "blur" }],
Module: [
{
max: 200,
message: `${this.$t('common:ruleMessage:maxLength')} 200`,
trigger: 'blur',
message: `${this.$t("common:ruleMessage:maxLength")} 200`,
trigger: "blur",
},
],
Description: [
{
max: 200,
message: `${this.$t('common:ruleMessage:maxLength')} 200`,
trigger: 'blur',
message: `${this.$t("common:ruleMessage:maxLength")} 200`,
trigger: "blur",
},
],
Code: [
{
required: true,
message: this.$t('system:l18n:rule:inputCode'),
trigger: 'blur',
},
{ required: true, message: "请注明", trigger: "blur" },
{
max: 200,
message: `${this.$t('common:ruleMessage:maxLength')} 200`,
message: `${this.$t("common:ruleMessage:maxLength")} 200`,
},
],
Value: [
{
required: true,
message: this.$t('system:l18n:rule:inputValue'),
trigger: 'blur',
},
{ required: true, message: "请注明", trigger: "blur" },
{
max: 1000,
message: `${this.$t('common:ruleMessage:maxLength')} 1000`,
message: `${this.$t("common:ruleMessage:maxLength")} 1000`,
},
],
ValueCN: [
{
required: true,
message: this.$t('system:l18n:rule:inputValueCN'),
trigger: 'blur',
},
{ required: true, message: "请注明", trigger: "blur" },
{
max: 1000,
message: `${this.$t('common:ruleMessage:maxLength')} 1000`,
message: `${this.$t("common:ruleMessage:maxLength")} 1000`,
},
],
InternationalizationType: [
{
required: true,
message: this.$t('system:l18n:rule:selectInternationalizationType'),
trigger: 'blur',
},
],
PublishLogId: [
{
required: true,
message: this.$t('system:l18n:rule:selectPublishLogId'),
trigger: 'blur',
},
{ required: true, message: "请选择", trigger: "blur" },
],
PublishLogId: [{ required: true, message: "请选择", trigger: "blur" }],
},
model_cfg: {
visible: false,
showClose: true,
width: '600px',
title: '',
width: "600px",
title: "",
appendToBody: true,
},
PublishVersionList: [],
}
};
},
mounted() {},
methods: {
openDialog(title, data, options = [], status) {
this.PublishVersionList = options
this.PublishVersionList = options;
this.loading = false
this.status = status
this.model_cfg.visible = true
this.model_cfg.title = title
this.status = status;
this.model_cfg.visible = true;
this.model_cfg.title = title;
if (Object.keys(data).length > 0) {
for (const k in this.form) {
if (data.hasOwnProperty(k)) {
this.form[k] = data[k]
this.form[k] = data[k];
}
}
} else {
this.form = formDataDefault()
this.form = formDataDefault();
}
},
handleSave() {
this.$refs.i18nForm.validate((valid) => {
if (!valid) return
this.loading = true
if (this.status === 'batch') {
return this.$emit('batch', this.form)
if (!valid) return;
this.loading = true;
if (this.status === "batch") {
return this.$emit("batch", this.form);
}
addOrUpdateInternationalization(this.form)
.then((res) => {
this.loading = false
this.$message.success(this.$t('common:message:savedSuccessfully'))
this.model_cfg.visible = false
this.$emit('getList')
this.loading = false;
this.$message.success(this.$t("common:message:savedSuccessfully"));
this.model_cfg.visible = false;
this.$emit("getList");
})
.catch(() => {
this.loading = false
})
})
this.loading = false;
});
});
},
handleCancle() {
this.model_cfg.visible = false
this.model_cfg.visible = false;
},
},
}
};
</script>
<style lang="scss" scoped>
::v-deep .el-select {

View File

@ -2,9 +2,7 @@
<div class="log">
<div ref="leftContainer" class="left">
<el-form :inline="true">
<el-form-item
:label="$t('system:l18n:search:InternationalizationType')"
>
<el-form-item label="国际化类型">
<el-select
v-model="searchData.InternationalizationType"
clearable
@ -19,7 +17,7 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('system:l18n:search:Module')">
<el-form-item label="功能模块/服务名">
<el-input
v-model="searchData.Module"
size="small"
@ -27,7 +25,7 @@
style="width: 130px"
/>
</el-form-item>
<el-form-item :label="$t('system:l18n:search:Code')">
<el-form-item label="标识">
<el-input
v-model="searchData.Code"
size="small"
@ -35,7 +33,7 @@
style="width: 130px"
/>
</el-form-item>
<el-form-item :label="$t('system:l18n:search:ValueCN')">
<el-form-item label="中文值">
<el-input
v-model="searchData.ValueCN"
size="small"
@ -43,7 +41,7 @@
style="width: 130px"
/>
</el-form-item>
<el-form-item :label="$t('system:l18n:search:Value')">
<el-form-item label="英文值">
<el-input
v-model="searchData.Value"
size="small"
@ -51,7 +49,7 @@
clearable
/>
</el-form-item>
<el-form-item :label="$t('system:l18n:search:State')">
<el-form-item label="状态">
<el-select
v-model="searchData.State"
clearable
@ -66,7 +64,7 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('system:l18n:search:Description')">
<el-form-item label="说明">
<el-input
v-model="searchData.Description"
size="small"
@ -74,7 +72,7 @@
style="width: 130px"
/>
</el-form-item>
<el-form-item :label="$t('system:l18n:search:PublishVersion')">
<el-form-item label="迭代">
<el-select
v-model="searchData.PublishLogId"
clearable
@ -120,7 +118,7 @@
size="mini"
@click="getList"
>
{{ $t('common:button:search') }}
查询
</el-button>
<!-- 重置 -->
<el-button
@ -137,7 +135,7 @@
size="mini"
@click="handleAdd"
>
{{ $t('common:button:new') }}
新增
</el-button>
<el-button
type="primary"
@ -145,7 +143,7 @@
size="mini"
@click="handleBatchAdd"
>
{{ $t('system:l18n:button:batchAdd') }}
批量新增
</el-button>
<el-button
type="primary"
@ -154,7 +152,7 @@
:disabled="selectTableList.length <= 0"
@click="handleBatchUpdate"
>
{{ $t('system:l18n:button:batchUpdate') }}
批量更新
</el-button>
<el-button
type="primary"
@ -163,7 +161,7 @@
:disabled="selectTableList.length <= 0"
@click="handleBatchUpdateToChange"
>
{{ $t('system:l18n:button:batchEdit') }}
批量编辑
</el-button>
<el-button
size="mini"
@ -186,7 +184,7 @@
><el-table-column type="selection" width="50" />
<el-table-column type="index" width="50" />
<el-table-column
:label="$t('system:l18n:search:InternationalizationType')"
label="国际化类型"
prop="InternationalizationType"
width="120"
show-overflow-tooltip
@ -226,35 +224,35 @@
</template>
</el-table-column>
<el-table-column
:label="$t('system:l18n:search:Module')"
label="功能模块/服务名"
prop="Module"
min-width="140"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('system:l18n:search:Code')"
label="标识"
prop="Code"
min-width="150"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('system:l18n:search:ValueCN')"
label="中文值"
prop="ValueCN"
min-width="150"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('system:l18n:search:Value')"
label="英文值"
prop="Value"
min-width="150"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('system:l18n:search:State')"
label="状态"
prop="State"
width="100"
show-overflow-tooltip
@ -273,35 +271,35 @@
</template>
</el-table-column>
<el-table-column
:label="$t('system:l18n:search:Description')"
label="说明"
prop="Description"
min-width="100"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('system:l18n:search:PublishVersion')"
label="迭代"
prop="Version"
min-width="100"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('system:l18n:form:uploadTime')"
label="更新时间"
prop="UpdateTime"
width="150"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('system:l18n:form:createTime')"
label="创建时间"
prop="CreateTime"
width="150"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('common:action:action')"
label="操作"
fixed="right"
prop=""
min-width="120"
@ -314,7 +312,7 @@
icon="el-icon-edit-outline"
@click="handleEdit(scope.row)"
>
{{ $t('common:button:edit') }}
编辑
</el-button>
<el-button
:disabled="scope.row.State === 1"
@ -323,7 +321,7 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>
{{ $t('common:button:delete') }}
删除
</el-button>
</template>
</el-table-column>
@ -423,7 +421,7 @@ export default {
handleBatchUpdate() {
this.$nextTick(() => {
this.$refs['i18nForm'].openDialog(
this.$t('system:l18n:button:batchUpdate'),
'批量更新',
{},
this.PublishVersionList,
'batch'
@ -457,7 +455,7 @@ export default {
handleAdd() {
this.$nextTick(() => {
this.$refs['i18nForm'].openDialog(
this.$t("system:l18n:button:add"),
'新增',
{},
this.PublishVersionList,
'add'
@ -467,7 +465,7 @@ export default {
handleBatchAdd() {
this.$nextTick(() => {
this.$refs['batcnAddForm'].openDialog(
this.$t("system:l18n:button:batchAdd"),
'批量新增',
{},
this.PublishVersionList
)
@ -476,7 +474,7 @@ export default {
handleEdit(row) {
this.$nextTick(() => {
this.$refs['i18nForm'].openDialog(
this.$t("system:l18n:button:edit"),
'编辑',
row,
this.PublishVersionList,
'update'
@ -492,7 +490,7 @@ export default {
},
//
handleDelete(row) {
this.$confirm(this.$t("system:l18n:confirm:delete"), {
this.$confirm('是否确认删除?', {
type: 'warning',
distinguishCancelAndClose: true,
}).then(() => {