fix style && some warning

This commit is contained in:
2025-02-05 17:33:11 +08:00
parent 14191e4f1e
commit c0672f2487
5 changed files with 102 additions and 98 deletions

View File

@@ -12,87 +12,94 @@
field-name="files"
></q-uploader>
</div>
</template>
<script setup lang="ts">
import { createUploaderComponent, useQuasar } from 'quasar';
import { useQuasar } from 'quasar';
import { useAuthStore } from 'src/stores/useAuthStore';
import { ref } from 'vue';
const $q=useQuasar();
const authStore = useAuthStore();
const emit =defineEmits(['uploaded']);
/**
const $q = useQuasar();
const authStore = useAuthStore();
const emit = defineEmits(['uploaded']);
interface Props {
title?: string;
uploadUrl?: string;
}
const headers = ref([
{ name: 'Authorization', value: 'Bearer ' + authStore.token },
]);
const props = withDefaults(defineProps<Props>(), {
title: '設計書から導入する(Excel)',
uploadUrl: `${process.env.KAB_BACKEND_URL}api/v1/createappfromexcel?format=1`,
});
/**
* ファイルアップロードを拒否する時の処理
* @param rejectedEntries
*/
function onRejected (rejectedEntries:any) {
function onRejected(rejectedEntries: any) {
// Notify plugin needs to be installed
// https://quasar.dev/quasar-plugins/notify#Installation
$q.notify({
type: 'negative',
message: 'Excelファイルを選択してください。'
})
}
message: 'Excelファイルを選択してください。',
});
}
/**
/**
* ファイルアップロード成功時の処理
*/
function onUploadFinished({xhr}:{xhr:XMLHttpRequest}){
let msg='ファイルのアップロードが完了しました。';
if(xhr && xhr.response){
msg=`${msg} (${xhr.responseText})`;
function onUploadFinished({ xhr }: { xhr: XMLHttpRequest }) {
let msg = 'ファイルのアップロードが完了しました。';
if (xhr && xhr.response) {
msg = `${msg} (${xhr.responseText})`;
}
$q.notify({
type: 'positive',
caption:'通知',
message: msg
caption: '通知',
message: msg,
});
setTimeout(() => {
emit('uploaded',xhr.responseText);
emit('uploaded', xhr.responseText);
}, 2000);
}
}
/**
/**
* 例外発生時、responseからエラー情報を取得する
* @param xhr
*/
function getResponseError(xhr:XMLHttpRequest){
try{
function getResponseError(xhr: XMLHttpRequest) {
try {
const resp = JSON.parse(xhr.responseText);
return 'detail' in resp ? resp.detail:'';
}catch(err){
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){
function onFailed({
files,
xhr,
}: {
files: readonly any[];
xhr: XMLHttpRequest;
}) {
let msg = 'ファイルアップロードが失敗しました。';
if (xhr && xhr.status) {
const detail = getResponseError(xhr);
msg=`${msg} (${xhr.status }:${detail})`
msg = `${msg} (${xhr.status}:${detail})`;
}
$q.notify({
type:'negative',
message:msg
});
}
interface Props {
title: string;
uploadUrl:string;
}
const headers = ref([{name:'Authorization',value:'Bearer ' + authStore.token}]);
const props = withDefaults(defineProps<Props>(), {
title:'設計書から導入する(Excel)',
uploadUrl: `${process.env.KAB_BACKEND_URL}api/v1/createappfromexcel?format=1`
type: 'negative',
message: msg,
});
}
</script>
<style lang="scss">
</style>
<style lang="scss"></style>

View File

@@ -1,6 +1,5 @@
<template>
<q-page>
<div class="q-pa-md">
<div class="q-gutter-sm row items-start">
<q-breadcrumbs>
@@ -16,28 +15,26 @@
</template>
<script setup lang="ts">
import {ref} from 'vue'
import { ref } from 'vue';
import DocUploader from 'components/DocUpload.vue';
import AppInfo from 'components/AppInfo.vue';
import { AppSeed } from 'src/components/models';
interface AppInfo {
app:string,
revision:string
app: string;
revision: string;
}
const appseed = withDefaults( defineProps<AppSeed>(),{
app:''
const appseed = withDefaults(defineProps<AppSeed>(), {
app: '',
});
// const appseed = defineProps<AppSeed>();
const props = ref(appseed);
function onAppUploaded(responseText :string){
let json:AppInfo = JSON.parse(responseText);
props.value=json;
function onAppUploaded(responseText: string) {
let json: AppInfo = JSON.parse(responseText);
props.value = json;
}
</script>

View File

@@ -61,7 +61,7 @@ import { useAuthStore } from 'stores/useAuthStore';
let email = ref('');
let password = ref('');
let visibility = ref(false);
let passwordFieldType = ref('password');
let passwordFieldType = ref<'text'|'password'>('password');
let visibilityIcon = ref('visibility');
const required = (val:string) => {
return (val && val.length > 0 || '必須項目')

View File

@@ -309,7 +309,7 @@ const deleteDomain = () => {
editId.value = 0; // set in removeRow()
};
function editRow(row) {
function editRow(row: any) {
isCreate.value = false
editId.value = row.id;
// tenantid.value = row.tenantid;

View File

@@ -16,7 +16,7 @@ const routes: RouteRecordRaw[] = [
path: '/',
component: () => import('layouts/MainLayout.vue'),
children: [
{ path: '', component: () => import('pages/IndexPage.vue') },
{ path: '', component: () => import('pages/IndexPage.vue'), props: { app: '' } },
{ path: 'ruleEditor', component: () => import('pages/RuleEditor.vue') },
{ path: 'flow', component: () => import('pages/testFlow.vue') },
{ path: 'FlowChartTest', component: () => import('pages/FlowChartTest.vue') },