Skip to content

[INT] first run #4143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion mock/article.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
const Mock = require('mockjs')
const Random = Mock.Random;

const List = []
const count = 100

const baseContent = '<p>I am testing data, I am testing data.</p><p><img src="https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943"></p>'
const image_uri = 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3'

for (let i = 0; i < count; i++) {
// List.push(Mock.mock({
// id: '@increment',
// timestamp: +Mock.Random.date('T'),
// author: '@first',
// reviewer: '@first',
// title: '@title(5, 10)',
// content_short: 'mock data',
// content: baseContent,
// forecast: '@float(0, 100, 2, 2)',
// importance: '@integer(1, 3)',
// 'type|1': ['CN', 'US', 'JP', 'EU'],
// 'status|1': ['published', 'draft'],
// display_time: '@datetime',
// comment_disabled: true,
// pageviews: '@integer(300, 5000)',
// image_uri,
// platforms: ['a-platform']
// }))
List.push(Mock.mock({
id: '@increment',
timestamp: +Mock.Random.date('T'),
author: '@first',
'location|1': ['丰县', '沛县', '睢宁县', '云龙区', '鼓楼区', '泉山区', '铜山区', '贾汪区'],
'name|1': ['拖拉机', '无人机', '推土机', '抽水机', '除草机器人'],
PurchaseDate: '@datetime',
'state|1': ['使用中', '维修中', '未使用', '已报废'],
'brand': '@id',
description: Random.sentence(),
owner: '@cname',
reviewer: '@first',
title: '@title(5, 10)',
content_short: 'mock data',
Expand Down
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
"test:ci": "npm run lint && npm run test:unit"
},
"dependencies": {
"@babel/core": "^7.21.0",
"@toast-ui/editor": "^3.1.3",
"axios": "0.18.1",
"body-parser": "^1.20.2",
"cache-loader": "^4.1.0",
"clipboard": "2.0.4",
"codemirror": "5.45.0",
"core-js": "3.6.5",
"core-js": "^3.29.0",
"driver.js": "0.9.5",
"dropzone": "5.5.1",
"echarts": "4.2.1",
Expand All @@ -31,19 +35,22 @@
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"regenerator-runtime": "^0.13.11",
"screenfull": "4.2.0",
"script-loader": "0.7.2",
"sortablejs": "1.8.4",
"tui-editor": "1.3.3",
"svg-baker-runtime": "^1.4.7",
"vue": "2.6.10",
"vue-count-to": "1.0.13",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vue-style-loader": "^4.1.3",
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"xlsx": "0.14.1"
},
"devDependencies": {
"@babel/runtime": "^7.21.0",
"@vue/cli-plugin-babel": "4.4.4",
"@vue/cli-plugin-eslint": "4.4.4",
"@vue/cli-plugin-unit-jest": "4.4.4",
Expand All @@ -70,7 +77,8 @@
"serve-static": "1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"vue-template-compiler": "2.6.10"
"vue-template-compiler": "2.6.10",
"webpack": "^4.0.0"
},
"browserslist": [
"> 1%",
Expand Down
17 changes: 11 additions & 6 deletions src/components/MarkdownEditor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@

<script>
// deps for editor
import 'codemirror/lib/codemirror.css' // codemirror
import 'tui-editor/dist/tui-editor.css' // editor ui
import 'tui-editor/dist/tui-editor-contents.css' // editor content
// import 'codemirror/lib/codemirror.css' // codemirror
// import 'tui-editor/dist/tui-editor.css' // editor ui
// import 'tui-editor/dist/tui-editor-contents.css' // editor content

import Editor from 'tui-editor'
import 'codemirror/lib/codemirror.css'
import '@toast-ui/editor/dist/toastui-editor.css'
import Editor from '@toast-ui/editor'
import defaultOptions from './default-options'

// import Editor from 'tui-editor'
// import defaultOptions from './default-options'

export default {
name: 'MarkdownEditor',
props: {
Expand Down Expand Up @@ -101,10 +106,10 @@ export default {
this.editor.off('change')
this.editor.remove()
},
setValue(value) {
setMarkdown(value) {
this.editor.setValue(value)
},
getValue() {
getMarkdown() {
return this.editor.getValue()
},
setHtml(value) {
Expand Down
Loading