|
|
|
@ -1,6 +1,8 @@
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import { ref, reactive, onMounted, watch } from "vue";
|
|
|
|
import { ref, reactive, onMounted, watch } from "vue";
|
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
|
|
|
|
|
import ClassicEditor from "ckeditor5-custom-build/build/ckeditor.js";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
|
|
const route = useRoute();
|
|
|
|
const router = useRouter();
|
|
|
|
const router = useRouter();
|
|
|
|
@ -13,6 +15,38 @@ const loading = ref(false);
|
|
|
|
const formRef = ref(null);
|
|
|
|
const formRef = ref(null);
|
|
|
|
const form = ref({});
|
|
|
|
const form = ref({});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化編輯器
|
|
|
|
|
|
|
|
const editor = ClassicEditor;
|
|
|
|
|
|
|
|
const editorConfig = ref({
|
|
|
|
|
|
|
|
simpleUpload: {
|
|
|
|
|
|
|
|
// The URL that the images are uploaded to.
|
|
|
|
|
|
|
|
uploadUrl: 'https://prodio.zltest.com.tw/adminapi/article/uploadImage',
|
|
|
|
|
|
|
|
// // Headers sent along with the XMLHttpRequest to the upload server.
|
|
|
|
|
|
|
|
headers: {
|
|
|
|
|
|
|
|
'X-CSRF-TOKEN': 'CSFR-Token',
|
|
|
|
|
|
|
|
'Authorization' : `${sessionStorage.getItem('token')}`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
image: {
|
|
|
|
|
|
|
|
resize: true,
|
|
|
|
|
|
|
|
toolbar: [
|
|
|
|
|
|
|
|
"imageTextAlternative",
|
|
|
|
|
|
|
|
"|",
|
|
|
|
|
|
|
|
"imageStyle:alignLeft",
|
|
|
|
|
|
|
|
"imageStyle:alignRight",
|
|
|
|
|
|
|
|
"|",
|
|
|
|
|
|
|
|
"imageStyle:alignBlockLeft",
|
|
|
|
|
|
|
|
"imageStyle:block",
|
|
|
|
|
|
|
|
"imageStyle:alignBlockRight",
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
styles: [
|
|
|
|
|
|
|
|
'full',
|
|
|
|
|
|
|
|
'alignLeft',
|
|
|
|
|
|
|
|
'alignRight',
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
onMounted(async () => {
|
|
|
|
let res = await getConfig();
|
|
|
|
let res = await getConfig();
|
|
|
|
if (res.code === 200) {
|
|
|
|
if (res.code === 200) {
|
|
|
|
@ -97,8 +131,8 @@ const submitForm = (formEl) => {
|
|
|
|
<el-form-item label="產品與服務" prop="products">
|
|
|
|
<el-form-item label="產品與服務" prop="products">
|
|
|
|
<el-input type="textarea" :rows="3" v-model="form.products" />
|
|
|
|
<el-input type="textarea" :rows="3" v-model="form.products" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="企業永續發展" prop="development">
|
|
|
|
<el-form-item label="首頁下方區塊" prop="development">
|
|
|
|
<el-input type="textarea" :rows="3" v-model="form.development" />
|
|
|
|
<ckeditor :editor="editor" v-model="form.development" :config="editorConfig"></ckeditor>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<div class="demo-drawer__footer" style="text-align: right;">
|
|
|
|
<div class="demo-drawer__footer" style="text-align: right;">
|
|
|
|
@ -112,4 +146,8 @@ const submitForm = (formEl) => {
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.ck-editor__editable_inline) {
|
|
|
|
|
|
|
|
width: 70vw;
|
|
|
|
|
|
|
|
height: 111px;
|
|
|
|
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|