Commit eb76699b authored by xhx's avatar xhx

fix

parents fd225a99 1b068704
VUE_APP_MODE=normal VUE_APP_MODE=normal
\ No newline at end of file NODE_ENV=production
\ No newline at end of file
VUE_APP_MODE=platform VUE_APP_MODE=platform
\ No newline at end of file NODE_ENV=production
\ No newline at end of file
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"platform": "vue-cli-service serve --mode platform", "platform": "vue-cli-service serve --mode platform",
"normal": "vue-cli-service serve --mode normal", "normal": "vue-cli-service serve --mode normal",
"buildPlatform": "vue-cli-service build --mode platform", "buildPlatform": "vue-cli-service build --mode platform --report",
"buildNormal": "vue-cli-service build --mode normal", "buildNormal": "vue-cli-service build --mode normal --report",
"buildLive": "vue-cli-service build --mode live", "buildLive": "vue-cli-service build --mode live",
"bdPlatform": "npm run buildPlatform & bash deployPlatform.sh", "bdPlatform": "npm run buildPlatform & bash deployPlatform.sh",
"bdNormal": "npm run buildNormal & bash deployNormal.sh", "bdNormal": "npm run buildNormal & bash deployNormal.sh",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<script> <script>
console.log('v.0.1.3'); console.log('v.0.1.6');
</script> </script>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from 'vue' import Vue from "vue";
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN' import zh_CN from "ant-design-vue/lib/locale-provider/zh_CN";
import moment from 'moment' import moment from "moment";
import 'moment/locale/zh-cn' import "moment/locale/zh-cn";
moment.locale('zh-cn') moment.locale("zh-cn");
import { import {
DatePicker, DatePicker,
...@@ -29,7 +29,7 @@ import { ...@@ -29,7 +29,7 @@ import {
Spin, Spin,
Pagination, Pagination,
ConfigProvider, ConfigProvider,
} from 'ant-design-vue' } from "ant-design-vue";
Vue.use(DatePicker) Vue.use(DatePicker)
.use(Button) .use(Button)
.use(Table) .use(Table)
...@@ -44,13 +44,16 @@ Vue.use(DatePicker) ...@@ -44,13 +44,16 @@ Vue.use(DatePicker)
.use(Spin) .use(Spin)
.use(Pagination) .use(Pagination)
.use(ConfigProvider) .use(ConfigProvider)
.use(FormModel) .use(FormModel);
export default Vue.extend({ export default Vue.extend({
data() { data() {
return { return {
zh_CN, zh_CN,
} };
}, },
}) });
</script> </script>
<style lang="scss">
@import "./assets/sass/main.scss";
</style>
\ No newline at end of file
This diff is collapsed.
This image diff could not be displayed because it is too large. You can view the blob instead.
.editor { @import './variables.scss';
.ProseMirror{
min-height: 400px; .el-tiptap-editor {
word-wrap: break-word;
white-space: break-spaces;
$root: &;
> * {
box-sizing: border-box;
} }
.ProseMirror img.ProseMirror-selectednode {
outline: 3px solid #68cef8; p {
margin-bottom: 0;
margin-top: 0;
outline: none;
line-height: 40px;
min-height: 40px;
} }
position: relative;
max-width: 70%;
margin: 0 auto 5rem auto;
&__content { h1,
overflow-wrap: break-word; h2,
word-wrap: break-word; h3,
word-break: break-word; h4,
h5 {
margin-top: 20px;
margin-bottom: 20px;
* { &:first-child {
caret-color: currentColor; margin-top: 0;
} }
pre { &:last-child {
padding: 0.7rem 1rem; margin-bottom: 0;
border-radius: 5px;
background: $color-black;
color: $color-white;
font-size: 0.8rem;
overflow-x: auto;
code {
display: block;
}
} }
}
p code { ul,
padding: 0.2rem 0.4rem; ol {
border-radius: 5px; counter-reset: none;
font-size: 0.8rem; list-style-type: none;
font-weight: bold; margin-bottom: 0;
background: rgba($color-black, 0.1); margin-left: 24px;
color: rgba($color-black, 0.8); margin-top: 0;
padding-bottom: 5px;
padding-left: 0;
padding-top: 5px;
}
ol li > p {
margin: 0;
&:first-child::before {
content: counter(el-tiptap-counter) '.' !important;
display: inline-block;
left: -5px;
line-height: 1;
margin-left: -24px;
position: relative;
text-align: right;
top: 0;
width: 24px;
} }
}
ul, ul li > p {
ol { &:first-child::before {
padding-left: 1rem; content: '\2022';
text-align: center;
display: inline-block;
left: -5px;
line-height: 1;
margin-left: -24px;
position: relative;
text-align: right;
top: 0;
width: 24px;
} }
}
ol {
counter-reset: el-tiptap-counter;
li > p, li > p:first-child::before {
li > ol, counter-increment: el-tiptap-counter;
li > ul {
margin: 0;
} }
}
a {
color: $primary-color;
cursor: pointer;
}
blockquote {
border-left: 5px solid #edf2fc;
border-radius: 2px;
color: $regular-text-color;
margin: 10px 0;
padding-left: 1em;
}
code {
background-color: $lighter-primary-color;
border-radius: 4px;
color: $primary-color;
display: inline-block;
font-size: 14px;
font-weight: 700;
padding: 0 8px;
}
a { pre {
background-color: $primary-text-color;
color: $lighter-primary-color;
font-size: 16px;
overflow-x: auto;
padding: 14px 20px;
margin: 10px 0;
border-radius: 5px;
code {
background-color: transparent;
border-radius: 0;
color: inherit; color: inherit;
display: block;
font-family: 'Menlo,Monaco,Consolas,Courier,monospace';
font-size: inherit;
font-weight: normal;
padding: 0;
} }
}
blockquote { ul[data-type='todo_list'] {
border-left: 3px solid rgba($color-black, 0.1); margin-left: 5px;
color: rgba($color-black, 0.8);
padding-left: 0.8rem;
font-style: italic;
p { .todo-item {
margin: 0; display: flex;
} flex-direction: row;
} justify-content: flex-start;
margin-bottom: 0;
img { &[data-text-align='right'] {
max-width: 100%; justify-content: flex-end !important;
border-radius: 3px; }
}
table { &[data-text-align='center'] {
border-collapse: collapse; justify-content: center !important;
table-layout: fixed;
width: 100%;
margin: 0;
overflow: hidden;
td,
th {
min-width: 1em;
border: 2px solid $color-grey;
padding: 3px 5px;
vertical-align: top;
box-sizing: border-box;
position: relative;
> * {
margin-bottom: 0;
}
} }
th { &[data-text-align='justify'] {
font-weight: bold; text-align: space-between !important;
text-align: left;
} }
.selectedCell:after { .todo-content {
z-index: 2; padding-left: 10px;
position: absolute;
content: ''; > p {
left: 0; font-size: 16px;
right: 0;
top: 0; &:last-of-type {
bottom: 0; margin-bottom: 0;
background: rgba(200, 200, 255, 0.4); }
pointer-events: none; }
} }
.column-resize-handle { &--done {
position: absolute; > .todo-checkbox {
right: -2px; color: $primary-color;
top: 0; }
bottom: 0;
width: 4px; > .todo-content > p {
z-index: 20; color: $primary-color;
background-color: #adf; text-decoration: line-through;
pointer-events: none; }
} }
} }
}
hr {
margin-top: 20px;
margin-bottom: 20px;
}
@for $i from 1 through 7 /* max-indent */ {
$indent-margin-base: 30px;
.tableWrapper { *[data-indent='#{$i}'] {
margin: 1em 0; margin-left: $indent-margin-base * $i !important;
overflow-x: auto;
} }
}
th {
font-weight: 500;
text-align: left;
}
.resize-cursor { .column-resize-handle {
cursor: ew-resize; background-color: $light-primary-color;
cursor: col-resize; bottom: 0;
pointer-events: none;
position: absolute;
right: -2px;
top: 0;
width: 4px;
z-index: 20;
}
.resize-cursor {
cursor: ew-resize;
cursor: col-resize;
}
h1 {
font-size: 1.4rem !important;
font-weight: 300 !important;
line-height: 1.5rem !important;
letter-spacing: -0.01562em !important;
}
h2 {
font-size: 1.2rem !important;
font-weight: 300 !important;
line-height: 1.5rem !important;
letter-spacing: -0.01562em !important;
}
h3 {
font-size: 1rem !important;
font-weight: 300 !important;
line-height: 1.5rem !important;
letter-spacing: -0.01562em !important;
}
> * + * {
margin-top: 0.75em;
}
ul,
ol {
padding: 0 1rem;
}
li {
line-height: 2em !important;
}
h1,
h2,
h3,
h4,
h5,
h6 {
line-height: 1.1;
}
code {
background-color: rgba(#616161, 0.1);
color: #616161;
}
pre {
background: #0d0d0d;
color: #fff;
font-family: 'JetBrainsMono', monospace;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
code {
color: inherit;
padding: 0;
background: none;
font-size: 0.8rem;
}
}
mark {
background-color: #faf594;
}
img {
max-width: 100%;
height: auto;
}
hr {
margin: 1rem 0;
}
blockquote {
padding-left: 1rem;
border-left: 2px solid rgba(#0d0d0d, 0.1);
}
hr {
border: none;
border-top: 2px solid rgba(#0d0d0d, 0.1);
margin: 2rem 0;
}
ul[data-type='taskList'] {
list-style: none;
padding: 0;
li {
display: flex;
align-items: center;
> label {
flex: 0 0 auto;
margin-right: 0.5rem;
user-select: none;
}
> div {
flex: 1 1 auto;
}
} }
} }
} }
$color-black: #000000; $color-black: #000000;
$color-white: #ffffff; $color-white: #ffffff;
$color-grey: #dddddd; $color-grey: #dddddd;
$black-color: #000;
$white-color: #fff;
$light-background-color: #f5f7fA;
$primary-color: #409eff;
$light-primary-color: #b3d8ff;
$lighter-primary-color: #d9ecff;
$extra-light-primary-color: #ecf5ff;
$danger-color: #f56c6c;
$primary-text-color: #303133;
$regular-text-color: #606266;
$placeholder-text-color: #c0c4cc;
$border-color: #dcdfe6;
$lighter-border-color: #ebeef5;
\ No newline at end of file
<template> <template>
<div class="border border-gray-300 p-3 rounded" > <div class="border border-gray-300 p-3 rounded">
<EditorMenuBar :editor="editor" /> <EditorMenuBar :editor="editor" />
<editor-content :editor="editor" class="editor__content" /> <editor-content
:editor="editor"
class="editor editor__content el-tiptap-editor"
/>
</div> </div>
</template> </template>
...@@ -25,14 +28,16 @@ export default Vue.extend({ ...@@ -25,14 +28,16 @@ export default Vue.extend({
text: { text: {
type: String, type: String,
required: true, required: true,
default:'' default: "",
}, },
}, },
watch:{ watch: {
text(newV,oldV){ text(newV, oldV) {
this.editor.commands.setContent(newV) this.editor.commands.setContent(newV, false, {
preserveWhitespace: "full",
});
this.$emit("update:editorContent", newV); this.$emit("update:editorContent", newV);
} },
}, },
data() { data() {
let editor: any = undefined; let editor: any = undefined;
...@@ -42,14 +47,19 @@ export default Vue.extend({ ...@@ -42,14 +47,19 @@ export default Vue.extend({
}, },
mounted() { mounted() {
this.editor = new Editor({ this.editor = new Editor({
parseOptions: {
preserveWhitespace: "full",
},
onUpdate: () => { onUpdate: () => {
const content = this.editor.getHTML(); const content = this.editor.getHTML();
this.$emit("update:editorContent", content); this.$emit("update:editorContent", content);
}, },
extensions: [StarterKit, Timage], extensions: [StarterKit, Timage],
autofocus: "start", autofocus: "start",
}) });
this.editor.commands.setContent(this.text) this.editor.commands.setContent(this.text, false, {
preserveWhitespace: "full",
});
}, },
beforeDestroy() { beforeDestroy() {
this.editor.destroy(); this.editor.destroy();
......
...@@ -325,6 +325,6 @@ export default Vue.extend({ ...@@ -325,6 +325,6 @@ export default Vue.extend({
background-image: url(../../assets/login_background.png); background-image: url(../../assets/login_background.png);
} }
.adminlogin_background { .adminlogin_background {
background-image: url(../../assets/adminLogin_bg.png); background-image: url(../../assets/adminLogin_bg.jpeg);
} }
</style> </style>
\ No newline at end of file
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
<div> <div>
<p class="text-2xl font-bold mb-5">{{ title }}</p> <p class="text-2xl font-bold mb-5">{{ title }}</p>
{{ $route.query.id }} {{ $route.query.id }}
<p class="text-gray-400">新增时间:{{ time | formatDate }}</p> <p class="text-gray-400">操作时间:{{ time | formatDate }}</p>
<img v-if="imageUrl" :src="imageUrl" class="mx-auto my-5" /> <img v-if="imageUrl" :src="imageUrl" class="mx-auto my-5" />
<p class="text-left p-5" v-html="content">{{ content }}</p> <div class="text-left p-5 el-tiptap-editor editor" v-html="content">
{{ content }}
</div>
</div> </div>
</template> </template>
...@@ -28,7 +30,7 @@ export default Vue.extend({ ...@@ -28,7 +30,7 @@ export default Vue.extend({
async mounted() { async mounted() {
const item: eActivityItem = JSON.parse(this.$route.query.record as string); const item: eActivityItem = JSON.parse(this.$route.query.record as string);
this.title = item.title; this.title = item.title;
this.time = item.created_at; this.time = item.update_at;
this.content = item.content; this.content = item.content;
this.file_name = item.file_name; this.file_name = item.file_name;
if (this.file_name) { if (this.file_name) {
......
...@@ -205,7 +205,7 @@ export default Vue.extend({ ...@@ -205,7 +205,7 @@ export default Vue.extend({
rules: { rules: {
name: [{ required: true, message: '请输入名称', trigger: 'blur' }], name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
fileList: [ fileList: [
{ required: true, message: '请上传文件', trigger: 'change' }, { required: true, message: '请上传图片', trigger: 'change' },
], ],
}, },
PAGE_SIZE, PAGE_SIZE,
......
...@@ -244,13 +244,15 @@ export default Vue.extend({ ...@@ -244,13 +244,15 @@ export default Vue.extend({
}, },
//发布 //发布
onSubmit() { onSubmit() {
(this.$refs.ruleForm as FormModel).validate(valid => { (this.$refs.ruleForm as FormModel).validate(valid => {
if (valid) { if (valid) {
this.show = false
// if(this.total<10 && this.total+this.forms.length<=10){
this.show = false
for(let i=0;i<this.forms.length;i++){ for(let i=0;i<this.forms.length;i++){
FAQService.getInstance(). AddQueAns({ if( !this.forms[i].question ){
message.error('第'+i+'个问题为空')
}else{
FAQService.getInstance(). AddQueAns({
answer:this.forms[i].answer, answer:this.forms[i].answer,
question: this.forms[i].question question: this.forms[i].question
}).then((ret) => { }).then((ret) => {
...@@ -258,26 +260,12 @@ export default Vue.extend({ ...@@ -258,26 +260,12 @@ export default Vue.extend({
this.fetchList() this.fetchList()
} }
}) })
}
} }
// }else if(this.total<10&&this.total+this.forms.length>10){
// this.show = false
// for(let i=0;i<10-this.total;i++){
// FAQService.getInstance(). AddQueAns({
// answer:this.forms[i].answer,
// question: this.forms[i].question
// }).then((ret) => {
// if (ret.code === 200) {
// this.fetchList()
// }
// })
// }
// }else{
// this.show = true
// this.$message.error('数据数量超出限制!', 3);
// }
this.resetForm() this.resetForm()
} else { } else {
console.log('error submit!!'); message.error('error submit!!')
return false; return false;
} }
}); });
......
export enum eBarChart{ export enum eBarChart{
login_dau="login_dau", login_dau="login_dau",
not_login_dau="total_dau " not_login_dau="total_dau"
} }
\ No newline at end of file
...@@ -131,6 +131,9 @@ export default Vue.extend({ ...@@ -131,6 +131,9 @@ export default Vue.extend({
this.initEchart(); this.initEchart();
this.queryRealtime(); this.queryRealtime();
}, },
beforeDestroy(){
this.myChart && echarts.dispose(this.myChart)
},
methods: { methods: {
handleChangeTimeRange(e: any) { handleChangeTimeRange(e: any) {
this.timeRange = e.target!.value; this.timeRange = e.target!.value;
...@@ -170,7 +173,7 @@ export default Vue.extend({ ...@@ -170,7 +173,7 @@ export default Vue.extend({
ret.data.map((data) => { ret.data.map((data) => {
// 真实数据 // 真实数据
this.option.series[0].data.push(data.value); this.option.series[0].data.push(data.value);
this.option.xAxis.data.push(formatDate(data.time)); this.option.xAxis.data.push(formatDate(data.time * 1000));
}); });
console.log('y',this.option.series[0].data,'x',this.option.xAxis.data); console.log('y',this.option.series[0].data,'x',this.option.xAxis.data);
......
...@@ -8,39 +8,28 @@ ...@@ -8,39 +8,28 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from 'vue' import Vue from "vue";
import News from '@/service/News/index' import News from "@/service/News/index";
import Filter from '@/filter/index' import Filter from "@/filter/index";
const news = new News() const news = new News();
export default Vue.extend({ export default Vue.extend({
data(){ data() {
return{ return {
title:'', title: "",
time:'', time: "",
name:'', name: "",
content:'' content: "",
} };
}, },
filters: { filters: {
format(value: string) { format(value: string) {
return Filter.formatDate(value) return Filter.formatDate(value);
} },
}, },
methods: { methods: {
getDetails() { getDetails() {
// const type = this.$route.query.type
// const uuid = this.$route.query.key as string
// const request = +type === 1 ? 'searchPolicy' : 'searchNews'
// news[request](uuid).then(res => {
// console.log(res)
// const { data } = res
// this.time = data.created_at
// this.name = data.writer
// this.content = data.content
// this.title = data.title
// })
const _str = this.$route.query.msg as string const _str = this.$route.query.msg as string
const msg = JSON.parse(_str) const msg = JSON.parse(_str)
this.time = msg.update_at this.time = msg.update_at
...@@ -50,8 +39,7 @@ export default Vue.extend({ ...@@ -50,8 +39,7 @@ export default Vue.extend({
} }
}, },
created() { created() {
this.getDetails() this.getDetails();
} },
});
})
</script> </script>
\ No newline at end of file
...@@ -134,9 +134,10 @@ export default Vue.extend({ ...@@ -134,9 +134,10 @@ export default Vue.extend({
this.form.imageUrl = res.file_name ? new FileService().getImageSrc(res.file_name) : '' this.form.imageUrl = res.file_name ? new FileService().getImageSrc(res.file_name) : ''
this.form.summary = res.desc this.form.summary = res.desc
this.form.editableContent = res.content this.form.editableContent = res.content
this.form.content = res.content.replace(/(<p>|<\/p>)+/g,'') this.form.content = res.content
console.log('res', res) // this.form.content = res.content.replace(/(<p>|<\/p>)+/g,'')
console.log('imageUrl', this.form.imageUrl) console.log(this.form.content);
// console.log('imageUrl', this.form.imageUrl)
}, },
getContent(value:string){ getContent(value:string){
this.form.content = value this.form.content = value
......
const colors = require('tailwindcss/colors') const colors = require('tailwindcss/colors')
module.exports = { module.exports = {
purge: [], purge: [
'./src/**/*.html',
'./src/**/*.js',
'./src/**/*.vue',
],
presets: [], presets: [],
darkMode: false, // or 'media' or 'class' darkMode: false, // or 'media' or 'class'
theme: { theme: {
......
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 to comment