Commit 27431299 by hank

fix bug

parent 97d5d6ad
...@@ -108,7 +108,6 @@ ...@@ -108,7 +108,6 @@
</template> </template>
<script> <script>
import { updateArticle } from '@/api/article'
import { addKey, getValueList } from '@/api/common' import { addKey, getValueList } from '@/api/common'
import waves from '@/directive/waves' // waves directive import waves from '@/directive/waves' // waves directive
import Pagination from '@/components/Pagination' // secondary package based on el-pagination import Pagination from '@/components/Pagination' // secondary package based on el-pagination
...@@ -282,14 +281,8 @@ export default { ...@@ -282,14 +281,8 @@ export default {
if (valid) { if (valid) {
const tempData = Object.assign({}, this.temp) const tempData = Object.assign({}, this.temp)
tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464 tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
updateArticle(tempData).then(() => { addKey(tempData).then(() => {
for (const v of this.list) { this.getList()
if (v.id === this.temp.id) {
const index = this.list.indexOf(v)
this.list.splice(index, 1, this.temp)
break
}
}
this.dialogFormVisible = false this.dialogFormVisible = false
this.$notify({ this.$notify({
title: 'Success', title: 'Success',
......
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 sign in to comment