fix style && some warning
This commit is contained in:
@@ -1,98 +1,105 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<q-uploader
|
<q-uploader
|
||||||
style="max-width: 400px"
|
style="max-width: 400px"
|
||||||
:url="uploadUrl"
|
:url="uploadUrl"
|
||||||
:label="title"
|
:label="title"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
accept=".xlsx"
|
accept=".xlsx"
|
||||||
v-on:rejected="onRejected"
|
v-on:rejected="onRejected"
|
||||||
v-on:uploaded="onUploadFinished"
|
v-on:uploaded="onUploadFinished"
|
||||||
v-on:failed="onFailed"
|
v-on:failed="onFailed"
|
||||||
field-name="files"
|
field-name="files"
|
||||||
></q-uploader>
|
></q-uploader>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { createUploaderComponent, useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useAuthStore } from 'src/stores/useAuthStore';
|
import { useAuthStore } from 'src/stores/useAuthStore';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
const $q=useQuasar();
|
|
||||||
const authStore = useAuthStore();
|
|
||||||
const emit =defineEmits(['uploaded']);
|
|
||||||
/**
|
|
||||||
* ファイルアップロードを拒否する時の処理
|
|
||||||
* @param rejectedEntries
|
|
||||||
*/
|
|
||||||
function onRejected (rejectedEntries:any) {
|
|
||||||
// Notify plugin needs to be installed
|
|
||||||
// https://quasar.dev/quasar-plugins/notify#Installation
|
|
||||||
$q.notify({
|
|
||||||
type: 'negative',
|
|
||||||
message: 'Excelファイルを選択してください。'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
const $q = useQuasar();
|
||||||
* ファイルアップロード成功時の処理
|
const authStore = useAuthStore();
|
||||||
*/
|
const emit = defineEmits(['uploaded']);
|
||||||
function onUploadFinished({xhr}:{xhr:XMLHttpRequest}){
|
|
||||||
let msg='ファイルのアップロードが完了しました。';
|
|
||||||
if(xhr && xhr.response){
|
|
||||||
msg=`${msg} (${xhr.responseText})`;
|
|
||||||
}
|
|
||||||
$q.notify({
|
|
||||||
type: 'positive',
|
|
||||||
caption:'通知',
|
|
||||||
message: msg
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
emit('uploaded',xhr.responseText);
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
interface Props {
|
||||||
* 例外発生時、responseからエラー情報を取得する
|
title?: string;
|
||||||
* @param xhr
|
uploadUrl?: string;
|
||||||
*/
|
}
|
||||||
function getResponseError(xhr:XMLHttpRequest){
|
|
||||||
try{
|
|
||||||
const resp = JSON.parse(xhr.responseText);
|
|
||||||
return 'detail' in resp ? resp.detail:'';
|
|
||||||
}catch(err){
|
|
||||||
return xhr.responseText;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
const headers = ref([
|
||||||
*
|
{ name: 'Authorization', value: 'Bearer ' + authStore.token },
|
||||||
* @param info ファイルアップロード失敗時の処理
|
]);
|
||||||
*/
|
|
||||||
function onFailed({files,xhr}:{files: readonly any[],xhr:XMLHttpRequest}){
|
|
||||||
let msg ='ファイルアップロードが失敗しました。';
|
|
||||||
if(xhr && xhr.status){
|
|
||||||
const detail = getResponseError(xhr);
|
|
||||||
msg=`${msg} (${xhr.status }:${detail})`
|
|
||||||
}
|
|
||||||
$q.notify({
|
|
||||||
type:'negative',
|
|
||||||
message:msg
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Props {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
title: string;
|
title: '設計書から導入する(Excel)',
|
||||||
uploadUrl:string;
|
uploadUrl: `${process.env.KAB_BACKEND_URL}api/v1/createappfromexcel?format=1`,
|
||||||
}
|
});
|
||||||
|
|
||||||
const headers = ref([{name:'Authorization',value:'Bearer ' + authStore.token}]);
|
/**
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
* ファイルアップロードを拒否する時の処理
|
||||||
title:'設計書から導入する(Excel)',
|
* @param rejectedEntries
|
||||||
uploadUrl: `${process.env.KAB_BACKEND_URL}api/v1/createappfromexcel?format=1`
|
*/
|
||||||
|
function onRejected(rejectedEntries: any) {
|
||||||
|
// Notify plugin needs to be installed
|
||||||
|
// https://quasar.dev/quasar-plugins/notify#Installation
|
||||||
|
$q.notify({
|
||||||
|
type: 'negative',
|
||||||
|
message: 'Excelファイルを選択してください。',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
});
|
/**
|
||||||
|
* ファイルアップロード成功時の処理
|
||||||
|
*/
|
||||||
|
function onUploadFinished({ xhr }: { xhr: XMLHttpRequest }) {
|
||||||
|
let msg = 'ファイルのアップロードが完了しました。';
|
||||||
|
if (xhr && xhr.response) {
|
||||||
|
msg = `${msg} (${xhr.responseText})`;
|
||||||
|
}
|
||||||
|
$q.notify({
|
||||||
|
type: 'positive',
|
||||||
|
caption: '通知',
|
||||||
|
message: msg,
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
emit('uploaded', xhr.responseText);
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 例外発生時、responseからエラー情報を取得する
|
||||||
|
* @param xhr
|
||||||
|
*/
|
||||||
|
function getResponseError(xhr: XMLHttpRequest) {
|
||||||
|
try {
|
||||||
|
const resp = JSON.parse(xhr.responseText);
|
||||||
|
return 'detail' in resp ? resp.detail : '';
|
||||||
|
} catch (err) {
|
||||||
|
return xhr.responseText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param info ファイルアップロード失敗時の処理
|
||||||
|
*/
|
||||||
|
function onFailed({
|
||||||
|
files,
|
||||||
|
xhr,
|
||||||
|
}: {
|
||||||
|
files: readonly any[];
|
||||||
|
xhr: XMLHttpRequest;
|
||||||
|
}) {
|
||||||
|
let msg = 'ファイルアップロードが失敗しました。';
|
||||||
|
if (xhr && xhr.status) {
|
||||||
|
const detail = getResponseError(xhr);
|
||||||
|
msg = `${msg} (${xhr.status}:${detail})`;
|
||||||
|
}
|
||||||
|
$q.notify({
|
||||||
|
type: 'negative',
|
||||||
|
message: msg,
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss"></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-page>
|
<q-page>
|
||||||
|
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<div class="q-gutter-sm row items-start">
|
<div class="q-gutter-sm row items-start">
|
||||||
<q-breadcrumbs>
|
<q-breadcrumbs>
|
||||||
<q-breadcrumbs-el icon="home" label="ホーム" />
|
<q-breadcrumbs-el icon="home" label="ホーム" />
|
||||||
</q-breadcrumbs>
|
</q-breadcrumbs>
|
||||||
</div>
|
</div>
|
||||||
<div class="q-gutter-sm row items-start">
|
<div class="q-gutter-sm row items-start">
|
||||||
<doc-uploader @uploaded="onAppUploaded"></doc-uploader>
|
<doc-uploader @uploaded="onAppUploaded"></doc-uploader>
|
||||||
</div>
|
</div>
|
||||||
@@ -16,28 +15,26 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref} from 'vue'
|
import { ref } from 'vue';
|
||||||
import DocUploader from 'components/DocUpload.vue';
|
import DocUploader from 'components/DocUpload.vue';
|
||||||
import AppInfo from 'components/AppInfo.vue';
|
import AppInfo from 'components/AppInfo.vue';
|
||||||
import { AppSeed } from 'src/components/models';
|
import { AppSeed } from 'src/components/models';
|
||||||
|
|
||||||
interface AppInfo {
|
interface AppInfo {
|
||||||
app:string,
|
app: string;
|
||||||
revision:string
|
revision: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const appseed = withDefaults( defineProps<AppSeed>(),{
|
const appseed = withDefaults(defineProps<AppSeed>(), {
|
||||||
app:''
|
app: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
// const appseed = defineProps<AppSeed>();
|
// const appseed = defineProps<AppSeed>();
|
||||||
|
|
||||||
const props = ref(appseed);
|
const props = ref(appseed);
|
||||||
|
|
||||||
function onAppUploaded(responseText :string){
|
function onAppUploaded(responseText: string) {
|
||||||
let json:AppInfo = JSON.parse(responseText);
|
let json: AppInfo = JSON.parse(responseText);
|
||||||
props.value=json;
|
props.value = json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ import { useAuthStore } from 'stores/useAuthStore';
|
|||||||
let email = ref('');
|
let email = ref('');
|
||||||
let password = ref('');
|
let password = ref('');
|
||||||
let visibility = ref(false);
|
let visibility = ref(false);
|
||||||
let passwordFieldType = ref('password');
|
let passwordFieldType = ref<'text'|'password'>('password');
|
||||||
let visibilityIcon = ref('visibility');
|
let visibilityIcon = ref('visibility');
|
||||||
const required = (val:string) => {
|
const required = (val:string) => {
|
||||||
return (val && val.length > 0 || '必須項目')
|
return (val && val.length > 0 || '必須項目')
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ const deleteDomain = () => {
|
|||||||
editId.value = 0; // set in removeRow()
|
editId.value = 0; // set in removeRow()
|
||||||
};
|
};
|
||||||
|
|
||||||
function editRow(row) {
|
function editRow(row: any) {
|
||||||
isCreate.value = false
|
isCreate.value = false
|
||||||
editId.value = row.id;
|
editId.value = row.id;
|
||||||
// tenantid.value = row.tenantid;
|
// tenantid.value = row.tenantid;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const routes: RouteRecordRaw[] = [
|
|||||||
path: '/',
|
path: '/',
|
||||||
component: () => import('layouts/MainLayout.vue'),
|
component: () => import('layouts/MainLayout.vue'),
|
||||||
children: [
|
children: [
|
||||||
{ path: '', component: () => import('pages/IndexPage.vue') },
|
{ path: '', component: () => import('pages/IndexPage.vue'), props: { app: '' } },
|
||||||
{ path: 'ruleEditor', component: () => import('pages/RuleEditor.vue') },
|
{ path: 'ruleEditor', component: () => import('pages/RuleEditor.vue') },
|
||||||
{ path: 'flow', component: () => import('pages/testFlow.vue') },
|
{ path: 'flow', component: () => import('pages/testFlow.vue') },
|
||||||
{ path: 'FlowChartTest', component: () => import('pages/FlowChartTest.vue') },
|
{ path: 'FlowChartTest', component: () => import('pages/FlowChartTest.vue') },
|
||||||
|
|||||||
Reference in New Issue
Block a user