|
|
@ -45,6 +45,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import _ from 'lodash' |
|
|
|
import _ from 'lodash' |
|
|
|
|
|
|
|
import i18n from '@/module/i18n' |
|
|
|
import { mapActions } from 'vuex' |
|
|
|
import { mapActions } from 'vuex' |
|
|
|
import { filtTypeArr } from '../_source/common' |
|
|
|
import { filtTypeArr } from '../_source/common' |
|
|
|
import mNoType from '../details/_source/noType' |
|
|
|
import mNoType from '../details/_source/noType' |
|
|
@ -78,6 +79,7 @@ |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
...mapActions('resource', ['getViewResources', 'updateContent']), |
|
|
|
...mapActions('resource', ['getViewResources', 'updateContent']), |
|
|
|
ok () { |
|
|
|
ok () { |
|
|
|
|
|
|
|
if (this._validation()) { |
|
|
|
this.spinnerLoading = true |
|
|
|
this.spinnerLoading = true |
|
|
|
this.updateContent({ |
|
|
|
this.updateContent({ |
|
|
|
id: this.$route.params.id, |
|
|
|
id: this.$route.params.id, |
|
|
@ -92,6 +94,14 @@ |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
this.spinnerLoading = false |
|
|
|
this.spinnerLoading = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
_validation () { |
|
|
|
|
|
|
|
if (editor.doc.size>3000) { |
|
|
|
|
|
|
|
this.$message.warning(`${i18n.$t('Resource content cannot exceed 3000 lines')}`) |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true |
|
|
|
}, |
|
|
|
}, |
|
|
|
close () { |
|
|
|
close () { |
|
|
|
this.$router.push({ name: 'file' }) |
|
|
|
this.$router.push({ name: 'file' }) |
|
|
@ -101,7 +111,7 @@ |
|
|
|
this.getViewResources({ |
|
|
|
this.getViewResources({ |
|
|
|
id: this.$route.params.id, |
|
|
|
id: this.$route.params.id, |
|
|
|
skipLineNum: 0, |
|
|
|
skipLineNum: 0, |
|
|
|
limit: 2000 |
|
|
|
limit: 3000 |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
this.name = res.data.alias.split('.')[0] |
|
|
|
this.name = res.data.alias.split('.')[0] |
|
|
|
if (!res.data) { |
|
|
|
if (!res.data) { |
|
|
|