diff --git a/src/components/global.less b/src/components/global.less
index 853ea67b2..2f6003806 100644
--- a/src/components/global.less
+++ b/src/components/global.less
@@ -845,7 +845,7 @@ body {
.journal-list-content,
.comment-drawer-content {
img {
- width: 100%;
+ width: 50%;
}
}
diff --git a/src/views/sheet/independent/JournalList.vue b/src/views/sheet/independent/JournalList.vue
index e633932e5..5301d9694 100644
--- a/src/views/sheet/independent/JournalList.vue
+++ b/src/views/sheet/independent/JournalList.vue
@@ -15,7 +15,7 @@
>
@@ -27,14 +27,14 @@
{{ journalType[type].text }}
+ >{{ list.journalType[type].text }}
@@ -48,7 +48,7 @@
type="primary"
@click="handleQuery()"
>查询
- 重置
+ 重置
@@ -59,18 +59,18 @@
写日志
-
+
@@ -195,9 +195,9 @@
-
+
- {{ title }}
+ {{ formTitle }}
附件库
-
-
+
+
-
-
+
+
-
-
+
+
-
+
@@ -264,166 +269,172 @@ export default {
components: { TargetCommentDrawer, AttachmentDrawer },
data() {
return {
- journalType: journalApi.journalType,
- title: '发表',
- listLoading: false,
- visible: false,
- journalCommentVisible: false,
- attachmentDrawerVisible: false,
- optionFormVisible: false,
- pagination: {
- page: 1,
- size: 10,
- sort: null,
- total: 1
+ list: {
+ data: [],
+ loading: false,
+ pagination: {
+ page: 1,
+ size: 10,
+ sort: null,
+ total: 1,
+ },
+ queryParam: {
+ page: 0,
+ size: 10,
+ sort: null,
+ keyword: null,
+ type: null,
+ },
+ selected: {},
+
+ journalType: journalApi.journalType,
},
- queryParam: {
- page: 0,
- size: 10,
- sort: null,
- keyword: null,
- type: null
+
+ form: {
+ model: {},
+ rules: {
+ sourceContent: [{ required: true, message: '* 内容不能为空', trigger: ['change'] }],
+ },
+ visible: false,
+ saving: false,
+ saveErrored: false,
+ isPublic: true,
+ },
+ journalCommentDrawer: {
+ visible: false,
+ },
+ attachmentDrawer: {
+ visible: false,
+ },
+ optionModal: {
+ visible: false,
+ options: [],
},
- journals: [],
- comments: [],
- journal: {},
- isPublic: true,
- replyComment: {},
- options: [],
- saving: false,
- errored: false
}
},
- created() {
+ beforeMount() {
this.hanldeListJournals()
this.hanldeListOptions()
},
computed: {
- ...mapGetters(['user'])
+ ...mapGetters(['user']),
+ formTitle() {
+ return this.form.model.id ? '编辑' : '发表'
+ },
},
methods: {
...mapActions(['refreshOptionsCache']),
hanldeListJournals() {
- this.listLoading = true
- this.queryParam.page = this.pagination.page - 1
- this.queryParam.size = this.pagination.size
- this.queryParam.sort = this.pagination.sort
+ this.list.loading = true
+ this.list.queryParam.page = this.list.pagination.page - 1
+ this.list.queryParam.size = this.list.pagination.size
+ this.list.queryParam.sort = this.list.pagination.sort
journalApi
- .query(this.queryParam)
- .then(response => {
- this.journals = response.data.data.content
- this.pagination.total = response.data.data.total
+ .query(this.list.queryParam)
+ .then((response) => {
+ this.list.data = response.data.data.content
+ this.list.pagination.total = response.data.data.total
})
.finally(() => {
setTimeout(() => {
- this.listLoading = false
+ this.list.loading = false
}, 200)
})
},
hanldeListOptions() {
- optionApi.listAll().then(response => {
- this.options = response.data.data
+ optionApi.listAll().then((response) => {
+ this.optionModal.options = response.data.data
})
},
handleQuery() {
- this.handlePaginationChange(1, this.pagination.size)
+ this.handlePaginationChange(1, this.list.pagination.size)
},
- handleNew() {
- this.title = '新建'
- this.visible = true
- this.journal = {}
+ handleResetParam() {
+ this.list.queryParam.keyword = null
+ this.list.queryParam.type = null
+ this.handlePaginationChange(1, this.list.pagination.size)
},
- handleEdit(item) {
- this.title = '编辑'
- this.journal = item
- this.isPublic = item.type !== 'INTIMATE'
- this.visible = true
+ handleOpenPublishModal() {
+ this.form.visible = true
+ this.form.model = {}
+ },
+ handleOpenEditModal(item) {
+ this.form.model = item
+ this.form.isPublic = item.type !== 'INTIMATE'
+ this.form.visible = true
},
handleDelete(id) {
- journalApi
- .delete(id)
- .then(response => {
- this.$message.success('删除成功!')
- })
- .finally(() => {
- this.hanldeListJournals()
- })
+ journalApi.delete(id).finally(() => {
+ this.hanldeListJournals()
+ })
},
- handleShowJournalComments(journal) {
- this.journal = journal
- this.journalCommentVisible = true
+ handleOpenJournalCommentsDrawer(journal) {
+ this.list.selected = journal
+ this.journalCommentDrawer.visible = true
},
- createOrUpdateJournal() {
- this.journal.type = this.isPublic ? 'PUBLIC' : 'INTIMATE'
-
- if (!this.journal.sourceContent) {
- this.$notification['error']({
- message: '提示',
- description: '发布内容不能为空!'
- })
- return
- }
- this.saving = true
- if (this.journal.id) {
- journalApi
- .update(this.journal.id, this.journal)
- .catch(() => {
- this.errored = true
- })
- .finally(() => {
- setTimeout(() => {
- this.saving = false
- }, 400)
- })
+ handleSaveOrUpdate() {
+ const _this = this
+ _this.$refs.journalForm.validate((valid) => {
+ if (valid) {
+ _this.form.model.type = _this.form.isPublic ? 'PUBLIC' : 'INTIMATE'
+ _this.form.saving = true
+ if (_this.form.model.id) {
+ journalApi
+ .update(_this.form.model.id, _this.form.model)
+ .catch(() => {
+ _this.form.saveErrored = true
+ })
+ .finally(() => {
+ setTimeout(() => {
+ _this.form.saving = false
+ }, 400)
+ })
+ } else {
+ journalApi
+ .create(_this.form.model)
+ .catch(() => {
+ _this.form.saveErrored = true
+ })
+ .finally(() => {
+ setTimeout(() => {
+ _this.form.saving = false
+ }, 400)
+ })
+ }
+ }
+ })
+ },
+ handleSaveOrUpdateCallback() {
+ if (this.form.saveErrored) {
+ this.form.saveErrored = false
} else {
- journalApi
- .create(this.journal)
- .catch(() => {
- this.errored = true
- })
- .finally(() => {
- setTimeout(() => {
- this.saving = false
- }, 400)
- })
- }
- },
- handleSavedCallback() {
- if (this.errored) {
- this.errored = false
- } else {
- this.isPublic = true
- this.visible = false
+ this.form.isPublic = true
+ this.form.visible = false
this.hanldeListJournals()
}
},
handlePaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
- this.pagination.page = page
- this.pagination.size = pageSize
+ this.list.pagination.page = page
+ this.list.pagination.size = pageSize
this.hanldeListJournals()
},
- onJournalCommentsClose() {
- this.journal = {}
- this.journalCommentVisible = false
- },
- resetParam() {
- this.queryParam.keyword = null
- this.queryParam.type = null
- this.handlePaginationChange(1, this.pagination.size)
+ onJournalCommentsDrawerClose() {
+ this.form.model = {}
+ this.journalCommentDrawer.visible = false
},
handleSaveOptions() {
optionApi
- .save(this.options)
- .then(response => {
+ .save(this.optionModal.options)
+ .then((response) => {
this.$message.success('保存成功!')
- this.optionFormVisible = false
+ this.optionModal.visible = false
})
.finally(() => {
this.hanldeListOptions()
this.refreshOptionsCache()
})
- }
- }
+ },
+ },
}
diff --git a/src/views/system/developer/tabs/OptionsList.vue b/src/views/system/developer/tabs/OptionsList.vue
index 35f4254d7..04617e80b 100644
--- a/src/views/system/developer/tabs/OptionsList.vue
+++ b/src/views/system/developer/tabs/OptionsList.vue
@@ -59,7 +59,7 @@
新增
@@ -134,35 +134,50 @@
- 保存
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
@@ -174,38 +189,38 @@ const columns = [
title: 'Key',
dataIndex: 'key',
ellipsis: true,
- scopedSlots: { customRender: 'key' }
+ scopedSlots: { customRender: 'key' },
},
{
title: 'Value',
dataIndex: 'value',
ellipsis: true,
- scopedSlots: { customRender: 'value' }
+ scopedSlots: { customRender: 'value' },
},
{
title: '类型',
dataIndex: 'typeProperty',
width: '100px',
- scopedSlots: { customRender: 'type' }
+ scopedSlots: { customRender: 'type' },
},
{
title: '创建时间',
dataIndex: 'createTime',
width: '200px',
- scopedSlots: { customRender: 'createTime' }
+ scopedSlots: { customRender: 'createTime' },
},
{
title: '更新时间',
dataIndex: 'updateTime',
width: '200px',
- scopedSlots: { customRender: 'updateTime' }
+ scopedSlots: { customRender: 'updateTime' },
},
{
title: '操作',
dataIndex: 'action',
width: '120px',
- scopedSlots: { customRender: 'action' }
- }
+ scopedSlots: { customRender: 'action' },
+ },
]
export default {
name: 'OptionsList',
@@ -213,37 +228,46 @@ export default {
return {
optionType: optionApi.type,
columns: columns,
- formVisible: false,
pagination: {
page: 1,
size: 10,
sort: null,
- total: 1
+ total: 1,
},
queryParam: {
page: 0,
size: 10,
sort: null,
keyword: null,
- type: null
+ type: null,
},
- optionToStage: {},
loading: false,
- options: []
+ options: [],
+
+ form: {
+ visible: false,
+ model: {},
+ rules: {
+ key: [{ required: true, message: '* Key 不能为空', trigger: ['change'] }],
+ value: [{ required: true, message: '* Value 不能为空', trigger: ['change'] }],
+ },
+ saving: false,
+ saveErrored: false,
+ },
}
},
computed: {
formattedDatas() {
- return this.options.map(option => {
+ return this.options.map((option) => {
option.typeProperty = this.optionType[option.type]
return option
})
},
formTitle() {
- return this.optionToStage.id ? '编辑' : '新增'
- }
+ return this.form.model.id ? '编辑' : '新增'
+ },
},
- created() {
+ beforeMount() {
this.hanldeListOptions()
},
methods: {
@@ -255,7 +279,7 @@ export default {
this.queryParam.sort = this.pagination.sort
optionApi
.query(this.queryParam)
- .then(response => {
+ .then((response) => {
this.options = response.data.data.content
this.pagination.total = response.data.data.total
})
@@ -271,7 +295,7 @@ export default {
handleDeleteOption(id) {
optionApi
.delete(id)
- .then(response => {
+ .then((response) => {
this.$message.success('删除成功!')
})
.finally(() => {
@@ -280,8 +304,8 @@ export default {
})
},
handleEditOption(option) {
- this.optionToStage = option
- this.formVisible = true
+ this.form.model = option
+ this.form.visible = true
},
handlePaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
@@ -295,51 +319,51 @@ export default {
this.handlePaginationChange(1, this.pagination.size)
},
onFormClose() {
- this.formVisible = false
- this.optionToStage = {}
+ this.form.visible = false
+ this.form.model = {}
},
- createOrUpdateOption() {
- if (!this.optionToStage.key) {
- this.$notification['error']({
- message: '提示',
- description: 'Key 不能为空!'
- })
- return
- }
- if (!this.optionToStage.value) {
- this.$notification['error']({
- message: '提示',
- description: 'Value 不能为空!'
- })
- return
- }
- if (this.optionToStage.id) {
- optionApi
- .update(this.optionToStage.id, this.optionToStage)
- .then(response => {
- this.$message.success('更新成功!')
- this.optionToStage = {}
- this.formVisible = false
- })
- .finally(() => {
- this.hanldeListOptions()
- this.refreshOptionsCache()
- })
+ handleSaveOrUpdate() {
+ const _this = this
+ _this.$refs.optionForm.validate((valid) => {
+ if (valid) {
+ _this.form.saving = true
+ if (_this.form.model.id) {
+ optionApi
+ .update(_this.form.model.id, _this.form.model)
+ .catch(() => {
+ _this.form.saveErrored = true
+ })
+ .finally(() => {
+ setTimeout(() => {
+ _this.form.saving = false
+ }, 400)
+ })
+ } else {
+ _this.form.model.type = _this.optionType.CUSTOM.value
+ optionApi
+ .create(_this.form.model)
+ .catch(() => {
+ _this.form.saveErrored = true
+ })
+ .finally(() => {
+ setTimeout(() => {
+ _this.form.saving = false
+ }, 400)
+ })
+ }
+ }
+ })
+ },
+ handleSaveOrUpdateCallback() {
+ if (this.form.saveErrored) {
+ this.form.saveErrored = false
} else {
- this.optionToStage.type = this.optionType.CUSTOM.value
- optionApi
- .create(this.optionToStage)
- .then(response => {
- this.$message.success('保存成功!')
- this.optionToStage = {}
- this.formVisible = false
- })
- .finally(() => {
- this.hanldeListOptions()
- this.refreshOptionsCache()
- })
+ this.form.model = {}
+ this.form.visible = false
+ this.hanldeListOptions()
+ this.refreshOptionsCache()
}
- }
- }
+ },
+ },
}
diff --git a/src/views/system/developer/tabs/RuntimeLogs.vue b/src/views/system/developer/tabs/RuntimeLogs.vue
index c98d0429c..a6b410a15 100644
--- a/src/views/system/developer/tabs/RuntimeLogs.vue
+++ b/src/views/system/developer/tabs/RuntimeLogs.vue
@@ -24,10 +24,12 @@
刷新
下载
@@ -41,7 +43,7 @@ import moment from 'moment'
export default {
name: 'RuntimeLogs',
components: {
- codemirror
+ codemirror,
},
data() {
return {
@@ -49,14 +51,15 @@ export default {
tabSize: 4,
mode: 'shell',
lineNumbers: true,
- line: true
+ line: true,
},
logContent: '',
loading: false,
- logLines: 200
+ logLines: 200,
+ downloading: false,
}
},
- created() {
+ beforeMount() {
this.handleLoadLogsLines()
},
updated() {
@@ -68,20 +71,21 @@ export default {
this.loading = true
adminApi
.getLogFiles(this.logLines)
- .then(response => {
+ .then((response) => {
this.logContent = response.data.data
})
.finally(() => {
setTimeout(() => {
this.loading = false
- }, 200)
+ }, 400)
})
},
handleDownloadLogFile() {
const hide = this.$message.loading('下载中...', 0)
+ this.downloading = true
adminApi
.getLogFiles(this.logLines)
- .then(response => {
+ .then((response) => {
var blob = new Blob([response.data.data])
var downloadElement = document.createElement('a')
var href = window.URL.createObjectURL(blob)
@@ -91,15 +95,17 @@ export default {
downloadElement.click()
document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href)
- this.$message.success('下载成功!')
})
.catch(() => {
this.$message.error('下载失败!')
})
.finally(() => {
- hide()
+ setTimeout(() => {
+ this.downloading = false
+ hide()
+ }, 400)
})
- }
- }
+ },
+ },
}
diff --git a/src/views/system/developer/tabs/StaticStorage.vue b/src/views/system/developer/tabs/StaticStorage.vue
index 961c29d4f..1994f1303 100644
--- a/src/views/system/developer/tabs/StaticStorage.vue
+++ b/src/views/system/developer/tabs/StaticStorage.vue
@@ -8,18 +8,18 @@
(uploadVisible = true)"
+ @click="uploadModal.visible = true"
>上传
新建文件夹
刷新
@@ -27,11 +27,11 @@
上传
@@ -76,8 +76,8 @@
v-if="!record.isFile"
>
创建文件夹
@@ -87,13 +87,13 @@
cancelText="取消"
@confirm="handleDelete(record.relativePath)"
>
- 删除
+ 删除
重命名
编辑
@@ -113,64 +113,88 @@
- 创建
+
-
-
+
+
-
-
+
+
- 重命名
+
-
-
+
+
-
-
+
+
取消
- 保存
+
@@ -206,7 +234,6 @@