mirror of
				https://github.com/nsnail/NetAdmin.git
				synced 2025-10-31 03:19:26 +08:00 
			
		
		
		
	| @@ -12,7 +12,7 @@ | |||||||
|                             <el-button |                             <el-button | ||||||
|                                 v-loading="loading" |                                 v-loading="loading" | ||||||
|                                 :icon="item.icon" |                                 :icon="item.icon" | ||||||
|                                 :title="item.title" |                                 :title="$t(item.title)" | ||||||
|                                 :type="item.type" |                                 :type="item.type" | ||||||
|                                 @click.native.stop |                                 @click.native.stop | ||||||
|                                 size="small"></el-button> |                                 size="small"></el-button> | ||||||
| @@ -22,7 +22,7 @@ | |||||||
|                         v-else |                         v-else | ||||||
|                         v-loading="loading" |                         v-loading="loading" | ||||||
|                         :icon="item.icon" |                         :icon="item.icon" | ||||||
|                         :title="item.title" |                         :title="$t(item.title)" | ||||||
|                         :type="item.type" |                         :type="item.type" | ||||||
|                         @click="click(item, row, vue)" |                         @click="click(item, row, vue)" | ||||||
|                         size="small"> |                         size="small"> | ||||||
|   | |||||||
| @@ -2,12 +2,14 @@ export default { | |||||||
|     buttons: [ |     buttons: [ | ||||||
|         { |         { | ||||||
|             icon: 'el-icon-view', |             icon: 'el-icon-view', | ||||||
|  |             title: '查看', | ||||||
|             click: async (row, vue) => { |             click: async (row, vue) => { | ||||||
|                 vue.dialog.save = { row, mode: 'view' } |                 vue.dialog.save = { row, mode: 'view' } | ||||||
|             }, |             }, | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|             icon: 'el-icon-edit', |             icon: 'el-icon-edit', | ||||||
|  |             title: '编辑', | ||||||
|             click: async (row, vue) => { |             click: async (row, vue) => { | ||||||
|                 vue.dialog.save = { row, mode: 'edit' } |                 vue.dialog.save = { row, mode: 'edit' } | ||||||
|             }, |             }, | ||||||
|   | |||||||
| @@ -1,6 +1,5 @@ | |||||||
| <template> | <template> | ||||||
|     <article v-if="doc" v-loading="loading" class="article"> |     <article v-if="doc" v-loading="loading" class="article"> | ||||||
|         <h1>{{ doc.title }}</h1> |  | ||||||
|         <section |         <section | ||||||
|             :class="this.$TOOL.data.get('APP_SET_DARK') || this.$CONFIG.APP_SET_DARK ? 'aie-theme-dark' : 'aie-theme-light'" |             :class="this.$TOOL.data.get('APP_SET_DARK') || this.$CONFIG.APP_SET_DARK ? 'aie-theme-dark' : 'aie-theme-light'" | ||||||
|             ref="editor"></section> |             ref="editor"></section> | ||||||
| @@ -12,10 +11,11 @@ | |||||||
| import { AiEditor } from 'aieditor' | import { AiEditor } from 'aieditor' | ||||||
| import 'aieditor/dist/style.css' | import 'aieditor/dist/style.css' | ||||||
| import { defineAsyncComponent } from 'vue' | import { defineAsyncComponent } from 'vue' | ||||||
| const notFound = defineAsyncComponent(() => import('@/layout/other/404.vue')) |  | ||||||
| import sysConfig from '@/config' | import sysConfig from '@/config' | ||||||
| import tool from '@/utils/tool' | import tool from '@/utils/tool' | ||||||
|  |  | ||||||
|  | const notFound = defineAsyncComponent(() => import('@/layout/other/404.vue')) | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
|     components: { notFound }, |     components: { notFound }, | ||||||
|     data() { |     data() { | ||||||
| @@ -31,11 +31,9 @@ export default { | |||||||
|         if (this.doc) { |         if (this.doc) { | ||||||
|             document.title = this.doc.title |             document.title = this.doc.title | ||||||
|             const aiEditor = new AiEditor({ |             const aiEditor = new AiEditor({ | ||||||
|  |                 editable: false, | ||||||
|                 element: this.$refs.editor, |                 element: this.$refs.editor, | ||||||
|                 content: this.doc.body, |                 content: `<h1 style="text-align:center">${this.doc.title}</h1>${this.doc.body}`, | ||||||
|                 onChange: (body) => { |  | ||||||
|                     this.doc.body = body.getHtml() |  | ||||||
|                 }, |  | ||||||
|             }) |             }) | ||||||
|             aiEditor.changeLang(this.$TOOL.data.get('APP_SET_LANG') || sysConfig.APP_SET_LANG) |             aiEditor.changeLang(this.$TOOL.data.get('APP_SET_LANG') || sysConfig.APP_SET_LANG) | ||||||
|         } else { |         } else { | ||||||
| @@ -51,11 +49,17 @@ export default { | |||||||
|     display: flex; |     display: flex; | ||||||
|     height: 100%; |     height: 100%; | ||||||
|     flex-direction: column; |     flex-direction: column; | ||||||
|  |  | ||||||
|     > h1 { |     > h1 { | ||||||
|         padding: 1rem; |         padding: 1rem; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     > section { |     > section { | ||||||
|         flex: 1; |         flex: 1; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | .article:deep(.aie-container) { | ||||||
|  |     border: none; | ||||||
|  | } | ||||||
| </style> | </style> | ||||||
| @@ -106,22 +106,32 @@ | |||||||
|                     </template> |                     </template> | ||||||
|                 </el-table-column> |                 </el-table-column> | ||||||
|                 <na-col-operation |                 <na-col-operation | ||||||
|                     :buttons=" |                     :buttons="[ | ||||||
|                         naColOperation.buttons.concat([ |                         { | ||||||
|                             { |                             icon: 'el-icon-view', | ||||||
|                                 icon: 'el-icon-share', |                             title: '查看', | ||||||
|                                 click: share, |                             click: viewClick, | ||||||
|                                 title: '删除文档', |                         }, | ||||||
|  |                         { | ||||||
|  |                             icon: 'el-icon-edit', | ||||||
|  |                             title: '编辑', | ||||||
|  |                             click: async (row, vue) => { | ||||||
|  |                                 vue.dialog.save = { row, mode: 'edit' } | ||||||
|                             }, |                             }, | ||||||
|                             { |                         }, | ||||||
|                                 icon: 'el-icon-delete', |                         { | ||||||
|                                 confirm: true, |                             icon: 'el-icon-share', | ||||||
|                                 title: '删除文档', |                             click: share, | ||||||
|                                 click: rowDel, |                             title: '分享文档', | ||||||
|                                 type: 'danger', |                         }, | ||||||
|                             }, |                         { | ||||||
|                         ]) |                             icon: 'el-icon-delete', | ||||||
|                     " |                             confirm: true, | ||||||
|  |                             title: '删除文档', | ||||||
|  |                             click: rowDel, | ||||||
|  |                             type: 'danger', | ||||||
|  |                         }, | ||||||
|  |                     ]" | ||||||
|                     :vue="this" |                     :vue="this" | ||||||
|                     width="180" /> |                     width="180" /> | ||||||
|             </sc-table> |             </sc-table> | ||||||
| @@ -171,6 +181,9 @@ export default { | |||||||
|     }, |     }, | ||||||
|     inject: ['reload'], |     inject: ['reload'], | ||||||
|     methods: { |     methods: { | ||||||
|  |         viewClick(row) { | ||||||
|  |             window.open(window.location.origin + `/guest/view-doc/${row.id}`) | ||||||
|  |         }, | ||||||
|         filterChange(data) { |         filterChange(data) { | ||||||
|             Object.entries(data).forEach(([key, value]) => { |             Object.entries(data).forEach(([key, value]) => { | ||||||
|                 this.$refs.search.form.dy[key] = value === 'true' ? true : value === 'false' ? false : value |                 this.$refs.search.form.dy[key] = value === 'true' ? true : value === 'false' ? false : value | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 GitHub
						GitHub