diff --git a/src/views/system/public-log/components/LogForm.vue b/src/views/system/public-log/components/LogForm.vue index 6e71ade..8e8c630 100644 --- a/src/views/system/public-log/components/LogForm.vue +++ b/src/views/system/public-log/components/LogForm.vue @@ -9,30 +9,64 @@ label-width="120px" size="small" > - - + + - + + + + - + + + + + + + + + + + + + @@ -43,8 +77,11 @@ const formDataDefault = () => { return { Id: null, Version: null, + Version_US: null, PublishTime: null, - UpdateContent: null + UpdateContent: null, + State: null, + IsCurrentVersion: null, } } export default { @@ -56,24 +93,53 @@ export default { form: formDataDefault(), rules: { Version: [ - { required: true, message: '请注明', trigger: 'blur' }, - { max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` } + { + required: true, + message: this.$t('common:ruleMessage:specify'), + trigger: 'blur', + }, + { max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` }, ], - PublishTime: [ - { required: true, message: '请注明', trigger: 'blur' } + // PublishTime: [ + // { required: true, message: '请注明', trigger: 'blur' } + // ], + IsCurrentVersion: [ + { + required: true, + message: this.$t('common:ruleMessage:select'), + trigger: 'blur', + }, + ], + State: [ + { + required: true, + message: this.$t('common:ruleMessage:select'), + trigger: 'blur', + }, ], UpdateContent: [ - { required: true, message: '请注明', trigger: 'blur' }, - { max: 1000, message: `${this.$t('common:ruleMessage:maxLength')} 500` } - ] + { + required: true, + message: this.$t('common:ruleMessage:specify'), + trigger: 'blur', + }, + { + max: 1000, + message: `${this.$t('common:ruleMessage:maxLength')} 500`, + }, + ], + }, + model_cfg: { + visible: false, + showClose: true, + width: '500px', + title: '', + appendToBody: true, }, - model_cfg: { visible: false, showClose: true, width: '500px', title: '', appendToBody: true } } }, - mounted() { - }, + mounted() {}, methods: { - openDialog(title, data) { this.model_cfg.visible = true this.model_cfg.title = title @@ -88,22 +154,30 @@ export default { } }, handleSave() { - this.$refs.LogForm.validate(valid => { + this.$refs.LogForm.validate((valid) => { if (!valid) return this.loading = true - addOrUpdatePublishLog(this.form).then(res => { - this.loading = false - this.$message.success('保存成功!') - this.model_cfg.visible = false - this.$emit('getList') - }).catch(() => { - this.loading = false - }) + addOrUpdatePublishLog(this.form) + .then((res) => { + this.loading = false + this.$message.success(this.$t('common:message:savedSuccessfully')) + this.model_cfg.visible = false + this.$emit('getList') + }) + .catch(() => { + this.loading = false + }) }) }, handleCancle() { this.model_cfg.visible = false - } - } + }, + }, } + diff --git a/src/views/system/public-log/index.vue b/src/views/system/public-log/index.vue index 6336fc9..6ef475b 100644 --- a/src/views/system/public-log/index.vue +++ b/src/views/system/public-log/index.vue @@ -2,25 +2,14 @@
- - + + - - + + + + + + - + + + + - + + + - 编辑 + {{ $t('common:button:edit') }} - 删除 + {{ $t('common:button:delete') }} - -
@@ -129,11 +142,12 @@ import moment from 'moment' const searchDataDefault = () => { return { Version: null, + Version_US: null, UpdateContent: null, - Asc: true, - SortField: '', + Asc: false, + SortField: 'PublishTime', PageIndex: 1, - PageSize: 20 + PageSize: 20, } } export default { @@ -144,7 +158,7 @@ export default { searchData: searchDataDefault(), list: [], total: 0, - loading: false + loading: false, } }, mounted() { @@ -153,13 +167,15 @@ export default { methods: { getList() { this.loading = true - getPublishLogList(this.searchData).then((res) => { - this.loading = false - this.list = res.Result.CurrentPageData - this.total = res.Result.TotalCount - }).catch(() => { - this.loading = false - }) + getPublishLogList(this.searchData) + .then((res) => { + this.loading = false + this.list = res.Result.CurrentPageData + this.total = res.Result.TotalCount + }) + .catch(() => { + this.loading = false + }) }, handleAdd() { this.$nextTick(() => { @@ -180,19 +196,23 @@ export default { handleDelete(row) { this.$confirm('是否确认删除?', { type: 'warning', - distinguishCancelAndClose: true + distinguishCancelAndClose: true, + }).then(() => { + this.loading = true + deletePublishLog(row.Id) + .then((res) => { + this.loading = false + if (res.IsSuccess) { + this.getList() + this.$message.success( + this.$t('common:message:deletedSuccessfully') + ) + } + }) + .catch(() => { + this.loading = false + }) }) - .then(() => { - this.loading = true - deletePublishLog(row.Id) - .then(res => { - this.loading = false - if (res.IsSuccess) { - this.getList() - this.$message.success(this.$t('common:message:deletedSuccessfully')) - } - }).catch(() => { this.loading = false }) - }) }, // 排序 handleSortByColumn(column) { @@ -204,35 +224,35 @@ export default { this.searchData.SortField = column.prop this.searchData.PageIndex = 1 this.getList() - } - } + }, + }, }