格式化相关代码

This commit is contained in:
lbw 2023-03-11 18:12:59 +08:00
parent 8d9d473716
commit 1063d68063
24 changed files with 1797 additions and 1861 deletions

140
auto-imports.d.ts vendored
View File

@ -1,73 +1,73 @@
// Generated by 'unplugin-auto-import'
export {}
export {};
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const createPinia: typeof import('pinia')['createPinia']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const defineStore: typeof import('pinia')['defineStore']
const effectScope: typeof import('vue')['effectScope']
const getActivePinia: typeof import('pinia')['getActivePinia']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const mapActions: typeof import('pinia')['mapActions']
const mapGetters: typeof import('pinia')['mapGetters']
const mapState: typeof import('pinia')['mapState']
const mapStores: typeof import('pinia')['mapStores']
const mapWritableState: typeof import('pinia')['mapWritableState']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const resolveDirective: typeof import('vue')['resolveDirective']
const setActivePinia: typeof import('pinia')['setActivePinia']
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const storeToRefs: typeof import('pinia')['storeToRefs']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useLink: typeof import('vue-router')['useLink']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useSlots: typeof import('vue')['useSlots']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
const EffectScope: typeof import('vue')['EffectScope'];
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'];
const computed: typeof import('vue')['computed'];
const createApp: typeof import('vue')['createApp'];
const createPinia: typeof import('pinia')['createPinia'];
const customRef: typeof import('vue')['customRef'];
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'];
const defineComponent: typeof import('vue')['defineComponent'];
const defineStore: typeof import('pinia')['defineStore'];
const effectScope: typeof import('vue')['effectScope'];
const getActivePinia: typeof import('pinia')['getActivePinia'];
const getCurrentInstance: typeof import('vue')['getCurrentInstance'];
const getCurrentScope: typeof import('vue')['getCurrentScope'];
const h: typeof import('vue')['h'];
const inject: typeof import('vue')['inject'];
const isProxy: typeof import('vue')['isProxy'];
const isReactive: typeof import('vue')['isReactive'];
const isReadonly: typeof import('vue')['isReadonly'];
const isRef: typeof import('vue')['isRef'];
const mapActions: typeof import('pinia')['mapActions'];
const mapGetters: typeof import('pinia')['mapGetters'];
const mapState: typeof import('pinia')['mapState'];
const mapStores: typeof import('pinia')['mapStores'];
const mapWritableState: typeof import('pinia')['mapWritableState'];
const markRaw: typeof import('vue')['markRaw'];
const nextTick: typeof import('vue')['nextTick'];
const onActivated: typeof import('vue')['onActivated'];
const onBeforeMount: typeof import('vue')['onBeforeMount'];
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'];
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'];
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'];
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'];
const onDeactivated: typeof import('vue')['onDeactivated'];
const onErrorCaptured: typeof import('vue')['onErrorCaptured'];
const onMounted: typeof import('vue')['onMounted'];
const onRenderTracked: typeof import('vue')['onRenderTracked'];
const onRenderTriggered: typeof import('vue')['onRenderTriggered'];
const onScopeDispose: typeof import('vue')['onScopeDispose'];
const onServerPrefetch: typeof import('vue')['onServerPrefetch'];
const onUnmounted: typeof import('vue')['onUnmounted'];
const onUpdated: typeof import('vue')['onUpdated'];
const provide: typeof import('vue')['provide'];
const reactive: typeof import('vue')['reactive'];
const readonly: typeof import('vue')['readonly'];
const ref: typeof import('vue')['ref'];
const resolveComponent: typeof import('vue')['resolveComponent'];
const resolveDirective: typeof import('vue')['resolveDirective'];
const setActivePinia: typeof import('pinia')['setActivePinia'];
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'];
const shallowReactive: typeof import('vue')['shallowReactive'];
const shallowReadonly: typeof import('vue')['shallowReadonly'];
const shallowRef: typeof import('vue')['shallowRef'];
const storeToRefs: typeof import('pinia')['storeToRefs'];
const toRaw: typeof import('vue')['toRaw'];
const toRef: typeof import('vue')['toRef'];
const toRefs: typeof import('vue')['toRefs'];
const triggerRef: typeof import('vue')['triggerRef'];
const unref: typeof import('vue')['unref'];
const useAttrs: typeof import('vue')['useAttrs'];
const useCssModule: typeof import('vue')['useCssModule'];
const useCssVars: typeof import('vue')['useCssVars'];
const useLink: typeof import('vue-router')['useLink'];
const useRoute: typeof import('vue-router')['useRoute'];
const useRouter: typeof import('vue-router')['useRouter'];
const useSlots: typeof import('vue')['useSlots'];
const watch: typeof import('vue')['watch'];
const watchEffect: typeof import('vue')['watchEffect'];
const watchPostEffect: typeof import('vue')['watchPostEffect'];
const watchSyncEffect: typeof import('vue')['watchSyncEffect'];
}

View File

@ -1,47 +1,47 @@
import request from '/@/utils/request';
export function fetchList(query) {
return request({
url: '/act/leave-bill/page',
method: 'get',
params: query
})
return request({
url: '/act/leave-bill/page',
method: 'get',
params: query,
});
}
export function addObj(obj) {
return request({
url: '/act/leave-bill',
method: 'post',
data: obj
})
return request({
url: '/act/leave-bill',
method: 'post',
data: obj,
});
}
export function getObj(id) {
return request({
url: '/act/leave-bill/' + id,
method: 'get'
})
return request({
url: '/act/leave-bill/' + id,
method: 'get',
});
}
export function submit(id) {
return request({
url: '/act/leave-bill/submit/' + id,
method: 'get'
})
return request({
url: '/act/leave-bill/submit/' + id,
method: 'get',
});
}
export function delObj(ids?: Object) {
return request({
url: '/act/leave-bill',
method: 'delete',
data: ids
})
return request({
url: '/act/leave-bill',
method: 'delete',
data: ids,
});
}
export function putObj(obj) {
return request({
url: '/act/leave-bill/',
method: 'put',
data: obj
})
return request({
url: '/act/leave-bill/',
method: 'put',
data: obj,
});
}

View File

@ -1,24 +1,24 @@
import request from '/@/utils/request';
export function fetchList(query) {
return request({
url: '/act/process',
method: 'get',
params: query
})
return request({
url: '/act/process',
method: 'get',
params: query,
});
}
export function delObj(ids?: Object) {
return request({
url: '/act/process',
method: 'delete',
data: ids
})
return request({
url: '/act/process',
method: 'delete',
data: ids,
});
}
export function status(id, type) {
return request({
url: '/act/process/status/' + id + '/' + type,
method: 'put'
})
return request({
url: '/act/process/status/' + id + '/' + type,
method: 'put',
});
}

View File

@ -30,11 +30,10 @@ export function doTask(obj) {
});
}
export function delObj(ids?:Object) {
return request({
url: '/act/task',
method: 'delete',
data: ids
})
export function delObj(ids?: Object) {
return request({
url: '/act/task',
method: 'delete',
data: ids,
});
}

View File

@ -1,135 +1,134 @@
<!-- excel 导入组件 -->
<template>
<el-dialog :title="prop.title" v-model="state.upload.open" :close-on-click-modal="false" draggable>
<el-upload
ref="uploadRef"
:limit="1"
accept=".xlsx, .xls"
:headers="headers"
:action="other.adaptationUrl(url)"
:disabled="state.upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:on-error="handleFileError"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
{{ $t('excel.operationNotice') }}
<em>{{ $t('excel.clickUpload') }}</em>
</div>
<template #tip>
<div class="el-upload__tip text-center">
<span>{{ $t('excel.fileFormat') }}</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="downExcelTemp" v-if="tempUrl"
>{{ $t('excel.downloadTemplate') }}
</el-link>
</div>
</template>
</el-upload>
<template #footer>
<el-button type="primary" @click="submitFileForm">{{ $t('common.confirmButtonText') }}</el-button>
<el-button @click="state.upload.open = false">{{ $t('common.cancelButtonText') }}</el-button>
</template>
</el-dialog>
<el-dialog :title="prop.title" v-model="state.upload.open" :close-on-click-modal="false" draggable>
<el-upload
ref="uploadRef"
:limit="1"
accept=".xlsx, .xls"
:headers="headers"
:action="other.adaptationUrl(url)"
:disabled="state.upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:on-error="handleFileError"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
{{ $t('excel.operationNotice') }}
<em>{{ $t('excel.clickUpload') }}</em>
</div>
<template #tip>
<div class="el-upload__tip text-center">
<span>{{ $t('excel.fileFormat') }}</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="downExcelTemp" v-if="tempUrl"
>{{ $t('excel.downloadTemplate') }}
</el-link>
</div>
</template>
</el-upload>
<template #footer>
<el-button type="primary" @click="submitFileForm">{{ $t('common.confirmButtonText') }}</el-button>
<el-button @click="state.upload.open = false">{{ $t('common.cancelButtonText') }}</el-button>
</template>
</el-dialog>
<!--校验失败错误数据-->
<el-dialog :title="$t('common.validationFailureData')" v-model="state.errorVisible">
<el-table :data="state.errorData">
<el-table-column property="lineNum" :label="$t('excel.lineNumbers')" width="100"></el-table-column>
<el-table-column property="errors" :label="$t('excel.misDescription')" show-overflow-tooltip>
<template v-slot="scope">
<el-tag type="danger" v-for="error in scope.row.errors" :key="error">{{ error }}</el-tag>
</template>
</el-table-column>
</el-table>
</el-dialog>
<!--校验失败错误数据-->
<el-dialog :title="$t('common.validationFailureData')" v-model="state.errorVisible">
<el-table :data="state.errorData">
<el-table-column property="lineNum" :label="$t('excel.lineNumbers')" width="100"></el-table-column>
<el-table-column property="errors" :label="$t('excel.misDescription')" show-overflow-tooltip>
<template v-slot="scope">
<el-tag type="danger" v-for="error in scope.row.errors" :key="error">{{ error }}</el-tag>
</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script setup lang="ts" name="upload-excel">
import {useMessage} from '/@/hooks/message';
import { useMessage } from '/@/hooks/message';
import other from '/@/utils/other';
import {Session} from '/@/utils/storage';
import { Session } from '/@/utils/storage';
const emit = defineEmits(['sizeChange', 'refreshDataList']);
const prop = defineProps({
url: {
type: String,
},
title: {
type: String,
},
tempUrl: {
type: String,
},
url: {
type: String,
},
title: {
type: String,
},
tempUrl: {
type: String,
},
});
const uploadRef = ref();
const state = reactive({
errorVisible: false,
errorData: [],
dialog: {
title: '',
isShowDialog: false,
},
upload: {
open: false,
isUploading: false,
},
errorVisible: false,
errorData: [],
dialog: {
title: '',
isShowDialog: false,
},
upload: {
open: false,
isUploading: false,
},
});
const downExcelTemp = () => {
other.downBlobFile(other.adaptationUrl(prop.tempUrl), {}, 'temp.xlsx');
other.downBlobFile(other.adaptationUrl(prop.tempUrl), {}, 'temp.xlsx');
};
const handleFileUploadProgress = () => {
state.upload.isUploading = true;
state.upload.isUploading = true;
};
const handleFileError = () => {
useMessage().error('上传失败,数据格式不合法!');
state.upload.open = false;
useMessage().error('上传失败,数据格式不合法!');
state.upload.open = false;
};
const handleFileSuccess = (response: any) => {
state.upload.isUploading = false;
state.upload.open = false;
uploadRef.value.clearFiles();
state.upload.isUploading = false;
state.upload.open = false;
uploadRef.value.clearFiles();
//
if (response.code === 1) {
useMessage().error('导入失败,以下数据不合法');
state.errorVisible = true;
state.errorData = response.data;
uploadRef.value.clearFiles();
//
emit('refreshDataList');
} else {
useMessage().success(response.msg ? response.msg : '导入成功');
//
emit('refreshDataList');
}
//
if (response.code === 1) {
useMessage().error('导入失败,以下数据不合法');
state.errorVisible = true;
state.errorData = response.data;
uploadRef.value.clearFiles();
//
emit('refreshDataList');
} else {
useMessage().success(response.msg ? response.msg : '导入成功');
//
emit('refreshDataList');
}
};
const submitFileForm = () => {
uploadRef.value.submit();
uploadRef.value.submit();
};
const show = () => {
state.upload.isUploading = false;
state.upload.open = true;
state.upload.isUploading = false;
state.upload.open = true;
};
const headers = computed(() => {
return {
Authorization: 'Bearer ' + Session.getToken(),
'TENANT-ID': Session.getTenant(),
};
return {
Authorization: 'Bearer ' + Session.getToken(),
'TENANT-ID': Session.getTenant(),
};
});
//
defineExpose({
show,
show,
});
</script>

View File

@ -26,7 +26,7 @@
import { useMessage } from '/@/hooks/message';
import { Session } from '/@/utils/storage';
import { watch } from 'vue';
import other from "/@/utils/other";
import other from '/@/utils/other';
const imageUrl = ref('');
const fileUpload = ref();

View File

@ -1,15 +1,15 @@
export default {
excel: {
downloadTemplate :"downloading the template",
fileFormat:"only xls, xlsx format files are allowed",
operationNotice:"Drag the file here and",
clickUpload:"click upload",
lineNumbers:"line numbers",
misDescription:"misDescription",
validationFailureData:"validation failure data",
pleaseUpload:"please upload",
size:"size not exceeding",
format:"format",
file:"file"
downloadTemplate: 'downloading the template',
fileFormat: 'only xls, xlsx format files are allowed',
operationNotice: 'Drag the file here and',
clickUpload: 'click upload',
lineNumbers: 'line numbers',
misDescription: 'misDescription',
validationFailureData: 'validation failure data',
pleaseUpload: 'please upload',
size: 'size not exceeding',
format: 'format',
file: 'file',
},
};

View File

@ -1,15 +1,15 @@
export default {
excel: {
downloadTemplate :"下载模板",
fileFormat:"仅允许导入xls、xlsx格式文件。",
operationNotice:"将文件拖到此处,或",
clickUpload:"点击上传",
lineNumbers:"行号",
misDescription:"错误描述",
validationFailureData:"校验失败数据",
pleaseUpload:"请上传",
size:"大小不超过",
format:"格式为",
file:"的文件",
downloadTemplate: '下载模板',
fileFormat: '仅允许导入xls、xlsx格式文件。',
operationNotice: '将文件拖到此处,或',
clickUpload: '点击上传',
lineNumbers: '行号',
misDescription: '错误描述',
validationFailureData: '校验失败数据',
pleaseUpload: '请上传',
size: '大小不超过',
format: '格式为',
file: '的文件',
},
};

View File

@ -60,7 +60,7 @@
<script setup lang="ts" name="upload-file">
import { useMessage } from '/@/hooks/message';
import { Local, Session } from '/@/utils/storage';
import other from "/@/utils/other";
import other from '/@/utils/other';
const props = defineProps({
modelValue: [String, Array],
//

View File

@ -3,8 +3,7 @@
<div v-loading="mainLoading" class="msg-main">
<div id="msg-div" class="msg-div">
<div v-if="!tableLoading">
<div v-if="loadMore" class="el-table__empty-block" @click="loadingMore"><span
class="el-table__empty-text">点击加载更多</span></div>
<div v-if="loadMore" class="el-table__empty-block" @click="loadingMore"><span class="el-table__empty-text">点击加载更多</span></div>
<div v-if="!loadMore" class="el-table__empty-block"><span class="el-table__empty-text">没有更多了</span></div>
</div>
<div v-for="item in tableData" :key="item.id" class="execution" id="msgTable">
@ -50,22 +49,28 @@
<svg-icon name="local-wx-video" :size="80" @click="loadVideo(item)"></svg-icon>
</div>
<div v-if="item.repType === 'location'">
<el-link type="primary" target="_blank" :href="
'https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&pointx=' +
item.repLocationY +
'&pointy=' +
item.repLocationX +
'&name=' +
item.repContent +
'&ref=joolun'
">
<img :src="
'https://apis.map.qq.com/ws/staticmap/v2/?zoom=10&markers=color:blue|label:A|' +
item.repLocationX +
',' +
<el-link
type="primary"
target="_blank"
:href="
'https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&pointx=' +
item.repLocationY +
'&key=PFFBZ-RBM3V-IEEPP-UH6KE-6QUQE-C4BVJ&size=250*180'
" />
'&pointy=' +
item.repLocationX +
'&name=' +
item.repContent +
'&ref=joolun'
"
>
<img
:src="
'https://apis.map.qq.com/ws/staticmap/v2/?zoom=10&markers=color:blue|label:A|' +
item.repLocationX +
',' +
item.repLocationY +
'&key=PFFBZ-RBM3V-IEEPP-UH6KE-6QUQE-C4BVJ&size=250*180'
"
/>
<p />
<i class="el-icon-map-location"></i>{{ item.repContent }}
</el-link>
@ -144,7 +149,7 @@ const sendMsg = () => {
if (objData.value.repType === 'news') {
if (JSON.parse(objData.value.content).length > 1) {
useMessage().error('图文消息条数限制在1条以内已默认发送第一条');
objData.value.content = (JSON.parse(objData.value.content))[0];
objData.value.content = JSON.parse(objData.value.content)[0];
}
}
sendLoading.value = true;
@ -161,10 +166,10 @@ const sendMsg = () => {
tableData.value = [];
getData().then(() => {
//box-containeroverflowdivdiv
var scrollTarget = document.getElementById("msgTable");
var scrollTarget = document.getElementById('msgTable');
//scrollTarget.scrollHeightdomscrollTop
scrollTarget.scrollTop = scrollTarget.scrollHeight;
})
});
})
.finally(() => {
sendLoading.value = false;
@ -175,7 +180,6 @@ const sendMsg = () => {
const tableData = ref([] as any);
const tableLoading = ref(false);
const openDialog = (data: any) => {
wxData.wxUserId = data.wxUserId;
wxData.appId = data.appId;

View File

@ -18,8 +18,8 @@
<div v-if="!objData.repUrl" style="width: 100%">
<el-row style="text-align: center">
<el-col :span="12" class="col-select">
<el-button type="success" @click="openMaterial({ type: 'image', accountId: props.objData.appId })">素材库选择<i
class="fansel-icon--right"></i>
<el-button type="success" @click="openMaterial({ type: 'image', accountId: props.objData.appId })"
>素材库选择<i class="fansel-icon--right"></i>
</el-button>
</el-col>
<el-col :span="12" class="col-add">
@ -45,8 +45,8 @@
<div v-if="!objData.repName" style="width: 100%">
<el-row style="text-align: center">
<el-col :span="12" class="col-select">
<el-button type="success" @click="openMaterial({ type: 'voice', accountId: props.objData.appId })">素材库选择<i
class="fansel-icon--right"></i>
<el-button type="success" @click="openMaterial({ type: 'voice', accountId: props.objData.appId })"
>素材库选择<i class="fansel-icon--right"></i>
</el-button>
</el-col>
<el-col :span="12" class="col-add">
@ -66,11 +66,10 @@
<el-row style="text-align: center">
<el-col :span="12" class="col-select">
<a v-if="objData.repUrl" target="_blank" :href="objData.repUrl">
<SvgIcon name="local-wx-video" :size="45" />
</a></el-col>
<SvgIcon name="local-wx-video" :size="45" /> </a
></el-col>
<el-col :span="12" class="col-add">
<el-button type="success" @click="openMaterial({ type: 'video', accountId: props.objData.appId })">素材库选择
</el-button>
<el-button type="success" @click="openMaterial({ type: 'video', accountId: props.objData.appId })">素材库选择 </el-button>
</el-col>
</el-row>
</el-tab-pane>
@ -87,8 +86,8 @@
<div v-if="!objData.content" style="width: 100%">
<el-row style="text-align: center">
<el-col :span="24" class="col-select2">
<el-button type="success" @click="openMaterial({ type: 'news', accountId: props.objData.appId })">素材库选择<i
class="fansel-icon--right"></i>
<el-button type="success" @click="openMaterial({ type: 'news', accountId: props.objData.appId })"
>素材库选择<i class="fansel-icon--right"></i>
</el-button>
</el-col>
</el-row>

View File

@ -189,9 +189,7 @@ const dataRules = ref({
encFlag: [{ required: true, message: '是否开启密码加密传输', trigger: 'blur' }],
onlineQuantity: [{ required: true, message: '是否允许同时在线', trigger: 'blur' }],
autoapprove: [{ required: true, message: '自动放行不能为空', trigger: 'blur' }],
webServerRedirectUri: [
{ required: true, message: '回调地址不能为空', trigger: 'blur' }
],
webServerRedirectUri: [{ required: true, message: '回调地址不能为空', trigger: 'blur' }],
});
//

View File

@ -1,158 +1,147 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('client.clientId')" prop="clientId">
<el-input :placeholder="$t('client.clientId')" style="max-width: 180px"
v-model="state.queryForm.clientId"/>
</el-form-item>
<el-form-item :label="$t('client.clientSecret')" prop="clientSecret">
<el-input :placeholder="$t('client.clientSecret')" style="max-width: 180px"
v-model="state.queryForm.clientSecret"/>
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
v-auth="'sys_client_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary"
v-auth="'sys_client_del'">
{{ $t('common.delBtn') }}
</el-button>
<el-button @click="handleRefreshCache()" class="ml10" icon="refresh-left" type="primary">
{{ $t('common.refreshCacheBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%"
v-loading="state.loading">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('client.index')" type="index" width="80"/>
<el-table-column :label="t('client.clientId')" prop="clientId" show-overflow-tooltip/>
<el-table-column :label="t('client.clientSecret')" prop="clientSecret" show-overflow-tooltip/>
<el-table-column :label="t('client.scope')" prop="scope" show-overflow-tooltip/>
<el-table-column :label="t('client.authorizedGrantTypes')" prop="authorizedGrantTypes"
show-overflow-tooltip width="200px">
<template #default="scope">
<dict-tag :options="grant_types" :value="scope.row.authorizedGrantTypes"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('client.accessTokenValidity')" prop="accessTokenValidity"
show-overflow-tooltip/>
<el-table-column :label="t('client.refreshTokenValidity')" prop="refreshTokenValidity"
show-overflow-tooltip/>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.clientId)" text type="primary"
v-auth="'sys_client_add'"
>{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary" v-auth="'sys_client_del'">
{{ $t('common.delBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
</div>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('client.clientId')" prop="clientId">
<el-input :placeholder="$t('client.clientId')" style="max-width: 180px" v-model="state.queryForm.clientId" />
</el-form-item>
<el-form-item :label="$t('client.clientSecret')" prop="clientSecret">
<el-input :placeholder="$t('client.clientSecret')" style="max-width: 180px" v-model="state.queryForm.clientSecret" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'sys_client_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary" v-auth="'sys_client_del'">
{{ $t('common.delBtn') }}
</el-button>
<el-button @click="handleRefreshCache()" class="ml10" icon="refresh-left" type="primary">
{{ $t('common.refreshCacheBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('client.index')" type="index" width="80" />
<el-table-column :label="t('client.clientId')" prop="clientId" show-overflow-tooltip />
<el-table-column :label="t('client.clientSecret')" prop="clientSecret" show-overflow-tooltip />
<el-table-column :label="t('client.scope')" prop="scope" show-overflow-tooltip />
<el-table-column :label="t('client.authorizedGrantTypes')" prop="authorizedGrantTypes" show-overflow-tooltip width="200px">
<template #default="scope">
<dict-tag :options="grant_types" :value="scope.row.authorizedGrantTypes"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('client.accessTokenValidity')" prop="accessTokenValidity" show-overflow-tooltip />
<el-table-column :label="t('client.refreshTokenValidity')" prop="refreshTokenValidity" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.clientId)" text type="primary" v-auth="'sys_client_add'"
>{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary" v-auth="'sys_client_del'">
{{ $t('common.delBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="systemSysOauthClientDetails" setup>
import {BasicTableProps, useTable} from '/@/hooks/table';
import {delObj, fetchList, refreshCache} from '/@/api/admin/client';
import {useMessage, useMessageBox} from '/@/hooks/message';
import {useDict} from '/@/hooks/dict';
import {useI18n} from 'vue-i18n';
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchList, refreshCache } from '/@/api/admin/client';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { useI18n } from 'vue-i18n';
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const {t} = useI18n();
//
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
//
const {grant_types} = useDict('grant_types');
//
const formDialogRef = ref();
const queryRef = ref();
//
const showSearch = ref(true);
//
const selectObjs = ref([]) as any;
const multiple = ref(true);
const { grant_types } = useDict('grant_types');
//
const formDialogRef = ref();
const queryRef = ref();
//
const showSearch = ref(true);
//
const selectObjs = ref([]) as any;
const multiple = ref(true);
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
descs: ['id'],
});
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
descs: ['id'],
});
// table hook
const {getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile} = useTable(state);
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile } = useTable(state);
//
const handleRefreshCache = () => {
refreshCache().then(() => {
useMessage().success('同步成功');
});
};
//
const handleRefreshCache = () => {
refreshCache().then(() => {
useMessage().success('同步成功');
});
};
const resetQuery = () => {
queryRef.value.resetFields();
// state.queryForm = {};
selectObjs.value = [];
getDataList();
};
const resetQuery = () => {
queryRef.value.resetFields();
// state.queryForm = {};
selectObjs.value = [];
getDataList();
};
// excel
const exportExcel = () => {
downBlobFile('/admin/client/export', state.queryForm, 'client.xlsx');
};
// excel
const exportExcel = () => {
downBlobFile('/admin/client/export', state.queryForm, 'client.xlsx');
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
multiple.value = !objs.length;
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
multiple.value = !objs.length;
};
//
const handleDelete = (ids: string[]) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
//
const handleDelete = (ids: string[]) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
</script>

View File

@ -1,184 +1,174 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" shadow="hover" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('tenant.name')" prop="name">
<el-input :placeholder="$t('tenant.inputnameTip')" style="max-width: 180px"
v-model="state.queryForm.name"/>
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
v-auth="'admin_systenant_add'">
{{ $t('common.addBtn') }}
</el-button>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" shadow="hover" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('tenant.name')" prop="name">
<el-input :placeholder="$t('tenant.inputnameTip')" style="max-width: 180px" v-model="state.queryForm.name" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'admin_systenant_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary"
v-auth="'admin_systenant_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary" v-auth="'admin_systenant_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary" v-auth="'admin_systenant_del'">
{{ $t('common.delBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary" v-auth="'admin_systenant_del'">
{{ $t('common.delBtn') }}
</el-button>
<el-button @click="handleTenantMenu()" class="ml10" type="primary"
v-auth="'admin_systenant_tenantmenu'">
{{ $t('tenantmenu.name') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%"
v-loading="state.loading">
<el-table-column :selectable="handleSelectable" align="center" type="selection" width="50"/>
<el-table-column :label="t('tenant.index')" type="index" width="80"/>
<el-table-column :label="t('tenant.name')" prop="name" show-overflow-tooltip/>
<el-table-column :label="t('tenant.code')" prop="code" show-overflow-tooltip/>
<el-table-column :label="t('tenant.tenantDomain')" prop="tenantDomain" show-overflow-tooltip/>
<el-table-column :label="t('tenant.startTime')" prop="startTime" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseDate(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="t('tenant.endTime')" prop="endTime" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseDate(scope.row.endTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="t('tenant.status')" prop="status" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="status_type" :value="scope.row.status"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.id)" text type="primary"
v-auth="'admin_systenant_edit'"
>{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleTenantMenu()" class="ml10" type="primary" v-auth="'admin_systenant_tenantmenu'">
{{ $t('tenantmenu.name') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%" v-loading="state.loading">
<el-table-column :selectable="handleSelectable" align="center" type="selection" width="50" />
<el-table-column :label="t('tenant.index')" type="index" width="80" />
<el-table-column :label="t('tenant.name')" prop="name" show-overflow-tooltip />
<el-table-column :label="t('tenant.code')" prop="code" show-overflow-tooltip />
<el-table-column :label="t('tenant.tenantDomain')" prop="tenantDomain" show-overflow-tooltip />
<el-table-column :label="t('tenant.startTime')" prop="startTime" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseDate(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="t('tenant.endTime')" prop="endTime" show-overflow-tooltip>
<template #default="scope">
<span>{{ parseDate(scope.row.endTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="t('tenant.status')" prop="status" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="status_type" :value="scope.row.status"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.id)" text type="primary" v-auth="'admin_systenant_edit'"
>{{ $t('common.editBtn') }}
</el-button>
<el-tooltip :content="$t('tenant.deleteDisabledTip')" :disabled="scope.row.id !== '1'"
placement="top">
<el-tooltip :content="$t('tenant.deleteDisabledTip')" :disabled="scope.row.id !== '1'" placement="top">
<span style="margin-left: 12px">
<el-button :disabled="scope.row.id === '1'" @click="handleDelete([scope.row.id])" text
type="primary" v-auth="'admin_systenant_del'"
>{{ $t('common.delBtn') }}
<el-button :disabled="scope.row.id === '1'" @click="handleDelete([scope.row.id])" text type="primary" v-auth="'admin_systenant_del'"
>{{ $t('common.delBtn') }}
</el-button>
</span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</div>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<!-- 导入excel -->
<upload-excel
:title="$t('tenant.importTenantTip')"
@refreshDataList="getDataList"
ref="excelUploadRef"
temp-url="/admin/sys-file/local/file/tenant.xlsx"
url="/admin/tenant/import"
/>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
<!-- 导入excel -->
<upload-excel
:title="$t('tenant.importTenantTip')"
@refreshDataList="getDataList"
ref="excelUploadRef"
temp-url="/admin/sys-file/local/file/tenant.xlsx"
url="/admin/tenant/import"
/>
<tenant-menu ref="TenantMenuRef"></tenant-menu>
</div>
<tenant-menu ref="TenantMenuRef"></tenant-menu>
</div>
</template>
<script lang="ts" name="systemTenant" setup>
import {BasicTableProps, useTable} from '/@/hooks/table';
import {delObj, fetchPage} from '/@/api/admin/tenant';
import {useMessage, useMessageBox} from '/@/hooks/message';
import {useI18n} from 'vue-i18n';
import {useDict} from '/@/hooks/dict';
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchPage } from '/@/api/admin/tenant';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
import { useDict } from '/@/hooks/dict';
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const TenantMenu = defineAsyncComponent(() => import('./tenantMenu/index.vue'));
const {t} = useI18n();
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const TenantMenu = defineAsyncComponent(() => import('./tenantMenu/index.vue'));
const { t } = useI18n();
//
const formDialogRef = ref();
const excelUploadRef = ref();
const TenantMenuRef = ref();
//
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]) as any;
const multiple = ref(true);
//
const formDialogRef = ref();
const excelUploadRef = ref();
const TenantMenuRef = ref();
//
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]) as any;
const multiple = ref(true);
//
const {status_type} = useDict('status_type');
//
const { status_type } = useDict('status_type');
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchPage,
});
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchPage,
});
// table hook
const {getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile} = useTable(state);
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile } = useTable(state);
//
const resetQuery = () => {
queryRef.value.resetFields();
getDataList();
};
//
const resetQuery = () => {
queryRef.value.resetFields();
getDataList();
};
//
const handleSelectable = (row: any) => {
return row.id !== '1';
};
//
const handleSelectable = (row: any) => {
return row.id !== '1';
};
// excel
const exportExcel = () => {
downBlobFile('/admin/tenant/export', state.queryForm, 'tenant.xlsx');
};
// excel
const exportExcel = () => {
downBlobFile('/admin/tenant/export', state.queryForm, 'tenant.xlsx');
};
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
multiple.value = !objs.length;
};
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
multiple.value = !objs.length;
};
//
const handleDelete = (ids: string[]) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
//
const handleDelete = (ids: string[]) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
const handleTenantMenu = () => {
TenantMenuRef.value.open();
};
const handleTenantMenu = () => {
TenantMenuRef.value.open();
};
</script>

View File

@ -1,224 +1,221 @@
<template>
<el-dialog :close-on-click-modal="false" :title="state.ruleForm.menuId ? $t('common.editBtn') : $t('common.addBtn')"
draggable v-model="visible">
<el-form :model="state.ruleForm" :rules="dataRules" label-width="90px" ref="dataFormRef" v-loading="loading">
<el-row :gutter="20">
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysmenu.menuType')" prop="menType">
<el-radio-group v-model="state.ruleForm.menuType">
<el-radio-button label="0">页面</el-radio-button>
<el-radio-button label="1">按钮</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysmenu.parentId')" prop="parentId">
<el-tree-select
:data="state.parentData"
:props="{ value: 'id', label: 'name', children: 'children' }"
check-strictly
class="w100"
clearable
default-expand-all
placeholder="请选择上级菜单"
v-model="state.ruleForm.parentId"
>
</el-tree-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysmenu.name')" prop="name">
<el-input :placeholder="$t('sysmenu.inputMenuNameTip')" clearable
v-model="state.ruleForm.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20" v-if="state.ruleForm.menuType !== '1'">
<el-form-item :label="$t('sysmenu.path')" prop="path">
<el-input :placeholder="$t('sysmenu.inputPathTip')" v-model="state.ruleForm.path"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20" v-if="state.ruleForm.menuType == '1'">
<el-form-item :label="$t('sysmenu.permission')" prop="permission">
<el-input :placeholder="$t('sysmenu.inputPermissionTip')" maxlength="50"
v-model="state.ruleForm.permission"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysmenu.sortOrder')" prop="sortOrder">
<el-input-number :min="0" controls-position="right" v-model="state.ruleForm.sortOrder"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20" v-if="state.ruleForm.menuType !== '1'">
<el-form-item :label="$t('sysmenu.visible')" prop="visible">
<el-radio-group v-model="state.ruleForm.visible">
<el-radio-button label="1">显示</el-radio-button>
<el-radio-button label="0">隐藏</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-dialog :close-on-click-modal="false" :title="state.ruleForm.menuId ? $t('common.editBtn') : $t('common.addBtn')" draggable v-model="visible">
<el-form :model="state.ruleForm" :rules="dataRules" label-width="90px" ref="dataFormRef" v-loading="loading">
<el-row :gutter="20">
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysmenu.menuType')" prop="menType">
<el-radio-group v-model="state.ruleForm.menuType">
<el-radio-button label="0">页面</el-radio-button>
<el-radio-button label="1">按钮</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysmenu.parentId')" prop="parentId">
<el-tree-select
:data="state.parentData"
:props="{ value: 'id', label: 'name', children: 'children' }"
check-strictly
class="w100"
clearable
default-expand-all
placeholder="请选择上级菜单"
v-model="state.ruleForm.parentId"
>
</el-tree-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysmenu.name')" prop="name">
<el-input :placeholder="$t('sysmenu.inputMenuNameTip')" clearable v-model="state.ruleForm.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20" v-if="state.ruleForm.menuType !== '1'">
<el-form-item :label="$t('sysmenu.path')" prop="path">
<el-input :placeholder="$t('sysmenu.inputPathTip')" v-model="state.ruleForm.path" />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20" v-if="state.ruleForm.menuType == '1'">
<el-form-item :label="$t('sysmenu.permission')" prop="permission">
<el-input :placeholder="$t('sysmenu.inputPermissionTip')" maxlength="50" v-model="state.ruleForm.permission" />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysmenu.sortOrder')" prop="sortOrder">
<el-input-number :min="0" controls-position="right" v-model="state.ruleForm.sortOrder" />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20" v-if="state.ruleForm.menuType !== '1'">
<el-form-item :label="$t('sysmenu.visible')" prop="visible">
<el-radio-group v-model="state.ruleForm.visible">
<el-radio-button label="1">显示</el-radio-button>
<el-radio-button label="0">隐藏</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
<el-button @click="onSubmit" type="primary">{{ $t('common.confirmButtonText') }}</el-button>
</span>
</template>
</el-dialog>
</template>
</el-dialog>
</template>
<script lang="ts" name="systemMenuDialog" setup>
import {addObj, info, pageList, update, validateByName, validatePermission} from '/@/api/app/appmenu';
import {useMessage} from '/@/hooks/message';
import {rule} from '/@/utils/validate';
import { addObj, info, pageList, update, validateByName, validatePermission } from '/@/api/app/appmenu';
import { useMessage } from '/@/hooks/message';
import { rule } from '/@/utils/validate';
// /
const emit = defineEmits(['refresh']);
//
// /
const emit = defineEmits(['refresh']);
//
const visible = ref(false);
const loading = ref(false);
//
const dataFormRef = ref();
const visible = ref(false);
const loading = ref(false);
//
const dataFormRef = ref();
//
const state = reactive({
ruleForm: {
menuId: '',
name: '',
permission: '',
parentId: '',
icon: '',
path: '',
sortOrder: 0,
menuType: '0',
visible: '1',
id: '',
},
parentData: [] as any[], //
});
//
const state = reactive({
ruleForm: {
menuId: '',
name: '',
permission: '',
parentId: '',
icon: '',
path: '',
sortOrder: 0,
menuType: '0',
visible: '1',
id: '',
},
parentData: [] as any[], //
});
//
const getMenuData = () => {
state.parentData = [];
loading.value = true;
pageList()
.then((res) => {
let menu = {
createBy: '',
createTime: '',
delFlag: '',
icon: '',
keepAlive: '',
menuId: '',
menuType: '',
parentId: '',
path: '',
sortOrder: 0,
updateBy: '',
updateTime: '',
visible: '',
id: '-1',
name: '根菜单',
children: [] as any[],
};
menu.children = res.data;
state.parentData.push(menu);
})
.finally(() => {
loading.value = false;
});
};
//
const getMenuData = () => {
state.parentData = [];
loading.value = true;
pageList()
.then((res) => {
let menu = {
createBy: '',
createTime: '',
delFlag: '',
icon: '',
keepAlive: '',
menuId: '',
menuType: '',
parentId: '',
path: '',
sortOrder: 0,
updateBy: '',
updateTime: '',
visible: '',
id: '-1',
name: '根菜单',
children: [] as any[],
};
menu.children = res.data;
state.parentData.push(menu);
})
.finally(() => {
loading.value = false;
});
};
const dataRules = reactive({
name: [
{required: true, message: '菜单名称不能为空', trigger: 'blur'},
{
validator: (rule: any, value: any, callback: any) => {
validateByName(rule, value, callback, state.ruleForm.menuId !== '');
},
trigger: 'blur',
},
],
path: [
{required: true, message: '路由路径不能为空', trigger: 'blur'},
{validate: rule.noChinese, trigger: 'blur'},
],
permission: [
{required: true, message: '权限标识不能为空', trigger: 'blur'},
{validator: rule.validatorLowercase, trigger: 'blur'},
{min: 3, max: 20, message: '长度在 3 到 20 个字符', trigger: 'blur'},
{
validator: (rule: any, value: any, callback: any) => {
validatePermission(rule, value, callback, state.ruleForm.menuId !== '');
},
trigger: 'blur',
},
],
});
//
const openDialog = (type: string, row?: any) => {
if (row?.id && type === 'edit') {
state.ruleForm.id = row.id;
//
loading.value = true;
info(row.id)
.then((res) => {
Object.assign(state.ruleForm, res.data);
})
.finally(() => {
loading.value = false;
});
} else {
// 使
nextTick(() => {
dataFormRef?.value?.resetFields();
state.ruleForm.parentId = row?.id || '-1';
});
}
visible.value = true;
getMenuData();
};
const dataRules = reactive({
name: [
{ required: true, message: '菜单名称不能为空', trigger: 'blur' },
{
validator: (rule: any, value: any, callback: any) => {
validateByName(rule, value, callback, state.ruleForm.menuId !== '');
},
trigger: 'blur',
},
],
path: [
{ required: true, message: '路由路径不能为空', trigger: 'blur' },
{ validate: rule.noChinese, trigger: 'blur' },
],
permission: [
{ required: true, message: '权限标识不能为空', trigger: 'blur' },
{ validator: rule.validatorLowercase, trigger: 'blur' },
{ min: 3, max: 20, message: '长度在 3 到 20 个字符', trigger: 'blur' },
{
validator: (rule: any, value: any, callback: any) => {
validatePermission(rule, value, callback, state.ruleForm.menuId !== '');
},
trigger: 'blur',
},
],
});
//
const openDialog = (type: string, row?: any) => {
if (row?.id && type === 'edit') {
state.ruleForm.id = row.id;
//
loading.value = true;
info(row.id)
.then((res) => {
Object.assign(state.ruleForm, res.data);
})
.finally(() => {
loading.value = false;
});
} else {
// 使
nextTick(() => {
dataFormRef?.value?.resetFields();
state.ruleForm.parentId = row?.id || '-1';
});
}
visible.value = true;
getMenuData();
};
//
const onSubmit = () => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
return false;
}
//
if (state.ruleForm.id) {
loading.value = true;
update(state.ruleForm)
.then(() => {
visible.value = false;
emit('refresh');
})
.catch((err) => {
useMessage().error(err.msg);
})
.finally(() => {
loading.value = false;
});
} else {
loading.value = true;
addObj(state.ruleForm)
.then(() => {
visible.value = false;
emit('refresh');
})
.catch((err) => {
useMessage().error(err.msg);
})
.finally(() => {
loading.value = false;
});
}
});
};
//
const onSubmit = () => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
return false;
}
//
if (state.ruleForm.id) {
loading.value = true;
update(state.ruleForm)
.then(() => {
visible.value = false;
emit('refresh');
})
.catch((err) => {
useMessage().error(err.msg);
})
.finally(() => {
loading.value = false;
});
} else {
loading.value = true;
addObj(state.ruleForm)
.then(() => {
visible.value = false;
emit('refresh');
})
.catch((err) => {
useMessage().error(err.msg);
})
.finally(() => {
loading.value = false;
});
}
});
};
// 使
defineExpose({
openDialog,
});
// 使
defineExpose({
openDialog,
});
</script>

View File

@ -1,166 +1,161 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="t('appsocial.type')" class="ml2" prop="type">
<el-select :placeholder="t('appsocial.inputTypeTip')" v-model="state.queryForm.type">
<el-option :key="index" :label="item.label" :value="item.value"
v-for="(item, index) in app_social_type"></el-option>
</el-select>
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" formDialogRef icon="Refresh">{{ $t('common.resetBtn') }}
</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button
@click="formDialogRef.openDialog()"
class="ml10"
formDialogRef
icon="folder-add"
type="primary"
v-auth="'app_social_details_add'"
>
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" formDialogRef icon="Download" type="primary">
{{ $t('common.exportBtn') }}
</el-button>
<el-button
:disabled="multiple"
@click="handleDelete(selectObjs)"
class="ml10"
formDialogRef
icon="Delete"
type="primary"
v-auth="'app_social_details_del'"
>
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
@selection-change="handleSelectionChange"
@sort-change="sortChangeHandle"
style="width: 100%"
v-loading="state.loading"
>
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('appsocial.index')" type="index" width="80"/>
<el-table-column :label="t('appsocial.type')" prop="type" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="app_social_type" :value="scope.row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('appsocial.remark')" prop="remark" show-overflow-tooltip/>
<el-table-column :label="t('appsocial.appId')" prop="appId" show-overflow-tooltip/>
<el-table-column :label="t('appsocial.appSecret')" prop="appSecret" show-overflow-tooltip/>
<el-table-column :label="t('appsocial.createTime')" prop="createTime" show-overflow-tooltip/>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.id)" text type="primary"
v-auth="'app_social_details_edit'"
>{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary"
v-auth="'app_social_details_del'"
>{{ $t('common.delBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</div>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="t('appsocial.type')" class="ml2" prop="type">
<el-select :placeholder="t('appsocial.inputTypeTip')" v-model="state.queryForm.type">
<el-option :key="index" :label="item.label" :value="item.value" v-for="(item, index) in app_social_type"></el-option>
</el-select>
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" formDialogRef icon="Refresh">{{ $t('common.resetBtn') }} </el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button
@click="formDialogRef.openDialog()"
class="ml10"
formDialogRef
icon="folder-add"
type="primary"
v-auth="'app_social_details_add'"
>
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" formDialogRef icon="Download" type="primary">
{{ $t('common.exportBtn') }}
</el-button>
<el-button
:disabled="multiple"
@click="handleDelete(selectObjs)"
class="ml10"
formDialogRef
icon="Delete"
type="primary"
v-auth="'app_social_details_del'"
>
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
@selection-change="handleSelectionChange"
@sort-change="sortChangeHandle"
style="width: 100%"
v-loading="state.loading"
>
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('appsocial.index')" type="index" width="80" />
<el-table-column :label="t('appsocial.type')" prop="type" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="app_social_type" :value="scope.row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('appsocial.remark')" prop="remark" show-overflow-tooltip />
<el-table-column :label="t('appsocial.appId')" prop="appId" show-overflow-tooltip />
<el-table-column :label="t('appsocial.appSecret')" prop="appSecret" show-overflow-tooltip />
<el-table-column :label="t('appsocial.createTime')" prop="createTime" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.id)" text type="primary" v-auth="'app_social_details_edit'"
>{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary" v-auth="'app_social_details_del'"
>{{ $t('common.delBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="systemAppSocialDetails" setup>
import {BasicTableProps, useTable} from '/@/hooks/table';
import {delObj, fetchList} from '/@/api/app/appsocial';
import {useMessage, useMessageBox} from '/@/hooks/message';
import {useDict} from '/@/hooks/dict';
import {useI18n} from 'vue-i18n';
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchList } from '/@/api/app/appsocial';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { useI18n } from 'vue-i18n';
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const {t} = useI18n();
//
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
//
const {app_social_type} = useDict('app_social_type');
//
const formDialogRef = ref();
//
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]) as any;
const multiple = ref(true);
const { app_social_type } = useDict('app_social_type');
//
const formDialogRef = ref();
//
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]) as any;
const multiple = ref(true);
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
type: '',
},
pageList: fetchList,
descs: ['create_time'],
});
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
type: '',
},
pageList: fetchList,
descs: ['create_time'],
});
// table hook
const {getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile} = useTable(state);
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile } = useTable(state);
//
const resetQuery = () => {
//
queryRef.value.resetFields();
//
selectObjs.value = [];
getDataList();
};
//
const resetQuery = () => {
//
queryRef.value.resetFields();
//
selectObjs.value = [];
getDataList();
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
multiple.value = !objs.length;
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
multiple.value = !objs.length;
};
// excel
const exportExcel = () => {
downBlobFile('/app/appsocial/export', state.queryForm, 'appsocial.xlsx');
};
// excel
const exportExcel = () => {
downBlobFile('/app/appsocial/export', state.queryForm, 'appsocial.xlsx');
};
//
const handleDelete = (ids: any) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
//
const handleDelete = (ids: any) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
</script>

View File

@ -1,282 +1,265 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" ref="queryRef">
<el-form-item :label="$t('job.jobName')" prop="jobName">
<el-input
:placeholder="$t('job.inputjobNameTip')"
@keyup.enter="getDataList"
clearable
style="width: 240px"
v-model="state.queryForm.jobName"
/>
</el-form-item>
<el-form-item :label="$t('job.jobGroup')" prop="jobGroup">
<el-input
:placeholder="$t('job.inputjobGroupTip')"
@keyup.enter="getDataList"
clearable
style="width: 240px"
v-model="state.queryForm.jobGroup"
/>
</el-form-item>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" ref="queryRef">
<el-form-item :label="$t('job.jobName')" prop="jobName">
<el-input
:placeholder="$t('job.inputjobNameTip')"
@keyup.enter="getDataList"
clearable
style="width: 240px"
v-model="state.queryForm.jobName"
/>
</el-form-item>
<el-form-item :label="$t('job.jobGroup')" prop="jobGroup">
<el-input
:placeholder="$t('job.inputjobGroupTip')"
@keyup.enter="getDataList"
clearable
style="width: 240px"
v-model="state.queryForm.jobGroup"
/>
</el-form-item>
<el-form-item :label="t('job.jobStatus')" prop="jobStatus">
<el-select :placeholder="t('job.inputjobStatusTip')" v-model="state.queryForm.jobStatus">
<el-option :key="index" :label="item.label" :value="item.value"
v-for="(item, index) in job_status"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('job.jobExecuteStatus')" prop="jobExecuteStatus">
<el-select :placeholder="t('job.inputjobExecuteStatusTip')"
v-model="state.queryForm.jobExecuteStatus">
<el-option :key="index" :label="item.label" :value="item.value"
v-for="(item, index) in job_execute_status"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('job.jobStatus')" prop="jobStatus">
<el-select :placeholder="t('job.inputjobStatusTip')" v-model="state.queryForm.jobStatus">
<el-option :key="index" :label="item.label" :value="item.value" v-for="(item, index) in job_status"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('job.jobExecuteStatus')" prop="jobExecuteStatus">
<el-select :placeholder="t('job.inputjobExecuteStatusTip')" v-model="state.queryForm.jobExecuteStatus">
<el-option :key="index" :label="item.label" :value="item.value" v-for="(item, index) in job_execute_status"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList" icon="Search" type="primary">{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(undefined)" class="ml10" icon="Delete"
type="primary">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%"
v-loading="state.loading">
<el-table-column align="center" type="selection" width="50"/>
<el-table-column :label="t('job.index')" fixed="left" type="index" width="80"/>
<el-table-column :label="t('job.jobName')" fixed="left" prop="jobName" show-overflow-tooltip
width="120"/>
<el-table-column :label="t('job.jobGroup')" prop="jobGroup" show-overflow-tooltip width="120"/>
<el-table-column :label="t('job.jobStatus')" prop="jobStatus" show-overflow-tooltip width="120">
<template #default="scope">
<dict-tag :options="job_status" :value="scope.row.jobStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('job.jobExecuteStatus')" prop="jobExecuteStatus" show-overflow-tooltip
width="120">
<template #default="scope">
<dict-tag :options="job_execute_status" :value="scope.row.jobExecuteStatus"></dict-tag>
</template>
</el-table-column>
<el-form-item>
<el-button @click="getDataList" icon="Search" type="primary">{{ $t('common.queryBtn') }} </el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(undefined)" class="ml10" icon="Delete" type="primary">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="t('job.index')" fixed="left" type="index" width="80" />
<el-table-column :label="t('job.jobName')" fixed="left" prop="jobName" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.jobGroup')" prop="jobGroup" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.jobStatus')" prop="jobStatus" show-overflow-tooltip width="120">
<template #default="scope">
<dict-tag :options="job_status" :value="scope.row.jobStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('job.jobExecuteStatus')" prop="jobExecuteStatus" show-overflow-tooltip width="120">
<template #default="scope">
<dict-tag :options="job_execute_status" :value="scope.row.jobExecuteStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('job.startTime')" prop="startTime" show-overflow-tooltip width="120"/>
<el-table-column :label="t('job.startTime')" prop="startTime" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.previousTime')" prop="previousTime" show-overflow-tooltip width="120"/>
<el-table-column :label="t('job.nextTime')" prop="nextTime" show-overflow-tooltip width="120"/>
<el-table-column :label="t('job.jobType')" prop="jobType" show-overflow-tooltip width="120">
<template #default="scope">
<dict-tag :options="job_type" :value="scope.row.jobType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('job.executePath')" prop="executePath" show-overflow-tooltip width="120"/>
<el-table-column :label="t('job.className')" prop="className" show-overflow-tooltip width="120"/>
<el-table-column :label="t('job.methodName')" prop="methodName" show-overflow-tooltip width="120"/>
<el-table-column :label="t('job.methodParamsValue')" prop="methodParamsValue" show-overflow-tooltip
width="120"/>
<el-table-column :label="t('job.cronExpression')" prop="cronExpression" show-overflow-tooltip
width="120"/>
<el-table-column :label="t('job.misfirePolicy')" prop="misfirePolicy" show-overflow-tooltip width="200">
<template #default="scope">
<dict-tag :options="misfire_policy" :value="scope.row.misfirePolicy"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('job.previousTime')" prop="previousTime" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.nextTime')" prop="nextTime" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.jobType')" prop="jobType" show-overflow-tooltip width="120">
<template #default="scope">
<dict-tag :options="job_type" :value="scope.row.jobType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('job.executePath')" prop="executePath" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.className')" prop="className" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.methodName')" prop="methodName" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.methodParamsValue')" prop="methodParamsValue" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.cronExpression')" prop="cronExpression" show-overflow-tooltip width="120" />
<el-table-column :label="t('job.misfirePolicy')" prop="misfirePolicy" show-overflow-tooltip width="200">
<template #default="scope">
<dict-tag :options="misfire_policy" :value="scope.row.misfirePolicy"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('common.action')" fixed="right" width="300">
<template #default="scope">
<el-button @click="handleJobLog(scope.row)" text type="primary">日志</el-button>
<el-table-column :label="$t('common.action')" fixed="right" width="300">
<template #default="scope">
<el-button @click="handleJobLog(scope.row)" text type="primary">日志</el-button>
<el-button @click="handleStartJob(scope.row)" text type="primary"
v-if="scope.row.jobStatus !== '2'">启动
</el-button>
<el-button @click="handleStartJob(scope.row)" text type="primary" v-if="scope.row.jobStatus !== '2'">启动 </el-button>
<el-button @click="handleShutDownJob(scope.row)" text type="primary"
v-if="scope.row.jobStatus === '2'">暂停
</el-button>
<el-button @click="handleShutDownJob(scope.row)" text type="primary" v-if="scope.row.jobStatus === '2'">暂停 </el-button>
<el-button @click="handleEditJob(scope.row)" text type="primary">{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleEditJob(scope.row)" text type="primary">{{ $t('common.editBtn') }} </el-button>
<el-button @click="handleRunJob(scope.row)" text type="primary">执行</el-button>
<el-button @click="handleRunJob(scope.row)" text type="primary">执行</el-button>
<el-button @click="handleDelete(scope.row)" text type="primary">{{ $t('common.delBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</div>
<el-button @click="handleDelete(scope.row)" text type="primary">{{ $t('common.delBtn') }} </el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<job-log ref="jobLogRef"></job-log>
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
<job-log ref="jobLogRef"></job-log>
</div>
</template>
<script lang="ts" name="systemSysJob" setup>
import {BasicTableProps, useTable} from '/@/hooks/table';
import {delObj, fetchList, runJobRa, shutDownJobRa, startJobRa} from '/@/api/daemon/job';
import {useMessage, useMessageBox} from '/@/hooks/message';
import {useDict} from '/@/hooks/dict';
import {useI18n} from 'vue-i18n';
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchList, runJobRa, shutDownJobRa, startJobRa } from '/@/api/daemon/job';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { useI18n } from 'vue-i18n';
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const JobLog = defineAsyncComponent(() => import('./job-log.vue'));
const {t} = useI18n();
//
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const JobLog = defineAsyncComponent(() => import('./job-log.vue'));
const { t } = useI18n();
//
const {job_status, job_execute_status, misfire_policy, job_type} = useDict('job_status', 'job_execute_status', 'misfire_policy', 'job_type');
//
const formDialogRef = ref();
const jobLogRef = ref();
//
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]);
const multiple = ref(true);
const { job_status, job_execute_status, misfire_policy, job_type } = useDict('job_status', 'job_execute_status', 'misfire_policy', 'job_type');
//
const formDialogRef = ref();
const jobLogRef = ref();
//
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]);
const multiple = ref(true);
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
jobName: '',
jobGroup: '',
jobStatus: '',
jobExecuteStatus: '',
},
pageList: fetchList,
});
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
jobName: '',
jobGroup: '',
jobStatus: '',
jobExecuteStatus: '',
},
pageList: fetchList,
});
// table hook
const {getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile} = useTable(state);
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile } = useTable(state);
//
const resetQuery = () => {
queryRef.value.resetFields();
getDataList();
};
//
const resetQuery = () => {
queryRef.value.resetFields();
getDataList();
};
//
const handleSelectionChange = (val: any) => {
selectObjs.value = val;
multiple.value = !val.length;
};
//
const handleSelectionChange = (val: any) => {
selectObjs.value = val;
multiple.value = !val.length;
};
// excel
const exportExcel = () => {
downBlobFile('/daemon/sys-job/export', state.queryForm, 'job.xlsx');
};
// excel
const exportExcel = () => {
downBlobFile('/daemon/sys-job/export', state.queryForm, 'job.xlsx');
};
const handleJobLog = (row: any) => {
jobLogRef.value.openDialog(row.jobId);
};
const handleJobLog = (row: any) => {
jobLogRef.value.openDialog(row.jobId);
};
const handleEditJob = (row: any) => {
const jobStatus = row.jobStatus;
if (jobStatus === '1' || jobStatus === '3') {
formDialogRef.value.openDialog(row.jobId);
} else {
useMessage().error('运行中定时任务不可修改,请先暂停后操作');
}
};
const handleEditJob = (row: any) => {
const jobStatus = row.jobStatus;
if (jobStatus === '1' || jobStatus === '3') {
formDialogRef.value.openDialog(row.jobId);
} else {
useMessage().error('运行中定时任务不可修改,请先暂停后操作');
}
};
const handleStartJob = (row: any) => {
const jobStatus = row.jobStatus;
if (jobStatus === '1' || jobStatus === '3') {
useMessageBox()
.confirm('即将发布或启动(任务名称:' + row.jobName + '), 是否继续?')
.then(() => {
startJobRa(row.jobId)
.then(() => {
getDataList();
useMessage().success(t('common.optSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
} else {
useMessage().error('定时任务已运行');
}
};
const handleStartJob = (row: any) => {
const jobStatus = row.jobStatus;
if (jobStatus === '1' || jobStatus === '3') {
useMessageBox()
.confirm('即将发布或启动(任务名称:' + row.jobName + '), 是否继续?')
.then(() => {
startJobRa(row.jobId)
.then(() => {
getDataList();
useMessage().success(t('common.optSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
} else {
useMessage().error('定时任务已运行');
}
};
const handleShutDownJob = (row: any) => {
const jobStatus = row.jobStatus;
if (jobStatus === '2') {
useMessageBox()
.confirm('即将暂停(任务名称:' + row.jobName + '), 是否继续?')
.then(() => {
shutDownJobRa(row.jobId)
.then(() => {
getDataList();
useMessage().success(t('common.optSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
} else {
useMessage().error('已暂停,不要重复操作');
}
};
const handleShutDownJob = (row: any) => {
const jobStatus = row.jobStatus;
if (jobStatus === '2') {
useMessageBox()
.confirm('即将暂停(任务名称:' + row.jobName + '), 是否继续?')
.then(() => {
shutDownJobRa(row.jobId)
.then(() => {
getDataList();
useMessage().success(t('common.optSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
} else {
useMessage().error('已暂停,不要重复操作');
}
};
const handleRunJob = (row: any) => {
useMessageBox()
.confirm('立刻执行一次任务(任务名称:' + row.jobName + '), 是否继续?')
.then(() => {
runJobRa(row.jobId)
.then(() => {
getDataList();
useMessage().success(t('common.optSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
const handleRunJob = (row: any) => {
useMessageBox()
.confirm('立刻执行一次任务(任务名称:' + row.jobName + '), 是否继续?')
.then(() => {
runJobRa(row.jobId)
.then(() => {
getDataList();
useMessage().success(t('common.optSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
//
const handleDelete = (row: any) => {
if (!row) {
selectObjs.value.forEach((val: any) => {
handleDelete(val);
});
return;
}
useMessageBox()
.confirm(t('common.delConfirmText') + '(任务名称:' + row.jobName + ')')
.then(() => {
delObj(row.jobId)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
//
const handleDelete = (row: any) => {
if (!row) {
selectObjs.value.forEach((val: any) => {
handleDelete(val);
});
return;
}
useMessageBox()
.confirm(t('common.delConfirmText') + '(任务名称:' + row.jobName + ')')
.then(() => {
delObj(row.jobId)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
</script>

View File

@ -1,140 +1,130 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('template.id')" prop="id">
<el-input :placeholder="t('template.inputIdTip')" style="max-width: 180px"
v-model="state.queryForm.id"/>
</el-form-item>
<el-form-item :label="$t('template.templateName')" prop="templateName">
<el-input :placeholder="t('template.inputTemplateNameTip')" style="max-width: 180px"
v-model="state.queryForm.templateName"/>
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" formDialogRef icon="Refresh">{{ $t('common.resetBtn') }}
</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
v-auth="'codegen_template_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary"
v-auth="'codegen_template_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary" v-auth="'codegen_template_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%"
v-loading="state.loading">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('template.index')" type="index" width="80"/>
<el-table-column :label="t('template.templateName')" prop="templateName" show-overflow-tooltip/>
<el-table-column :label="t('template.generatorPath')" prop="generatorPath" show-overflow-tooltip/>
<el-table-column :label="t('template.desc')" prop="templateDesc" show-overflow-tooltip/>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.id)" text type="primary"
v-auth="'codegen_template_edit'"
>{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary"
v-auth="'codegen_template_del'"
>{{ $t('common.delBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</div>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('template.id')" prop="id">
<el-input :placeholder="t('template.inputIdTip')" style="max-width: 180px" v-model="state.queryForm.id" />
</el-form-item>
<el-form-item :label="$t('template.templateName')" prop="templateName">
<el-input :placeholder="t('template.inputTemplateNameTip')" style="max-width: 180px" v-model="state.queryForm.templateName" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" formDialogRef icon="Refresh">{{ $t('common.resetBtn') }} </el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'codegen_template_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary" v-auth="'codegen_template_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary" v-auth="'codegen_template_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('template.index')" type="index" width="80" />
<el-table-column :label="t('template.templateName')" prop="templateName" show-overflow-tooltip />
<el-table-column :label="t('template.generatorPath')" prop="generatorPath" show-overflow-tooltip />
<el-table-column :label="t('template.desc')" prop="templateDesc" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.id)" text type="primary" v-auth="'codegen_template_edit'"
>{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary" v-auth="'codegen_template_del'"
>{{ $t('common.delBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="systemGenTemplate" setup>
import {BasicTableProps, useTable} from '/@/hooks/table';
import {delObjs, fetchList} from '/@/api/gen/template';
import {useMessage, useMessageBox} from '/@/hooks/message';
import {useI18n} from 'vue-i18n';
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObjs, fetchList } from '/@/api/gen/template';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const {t} = useI18n();
//
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
//
//
const formDialogRef = ref();
//
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]) as any;
const multiple = ref(true);
//
const formDialogRef = ref();
//
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]) as any;
const multiple = ref(true);
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
});
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
});
// table hook
const {getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile} = useTable(state);
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile } = useTable(state);
//
const resetQuery = () => {
//
queryRef.value.resetFields();
//
selectObjs.value = [];
getDataList();
};
//
const resetQuery = () => {
//
queryRef.value.resetFields();
//
selectObjs.value = [];
getDataList();
};
// excel
const exportExcel = () => {
downBlobFile('/gen/template/export', state.queryForm, 'template.xlsx');
};
// excel
const exportExcel = () => {
downBlobFile('/gen/template/export', state.queryForm, 'template.xlsx');
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
multiple.value = !objs.length;
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
multiple.value = !objs.length;
};
//
const handleDelete = (ids: string[]) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObjs(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
//
const handleDelete = (ids: string[]) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObjs(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
</script>

View File

@ -1,147 +1,151 @@
<template>
<el-dialog :close-on-click-modal="false" :title="form.leaveId ? $t('common.editBtn') : $t('common.addBtn')"
draggable v-model="visible">
<el-form :model="form" :rules="dataRules" formDialogRef label-width="90px" ref="dataFormRef"
v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item :label="t('leave.username')" prop="username">
<el-input :placeholder="t('leave.inputUsernameTip')" disabled v-model="form.username"/>
</el-form-item>
</el-col>
<el-dialog :close-on-click-modal="false" :title="form.leaveId ? $t('common.editBtn') : $t('common.addBtn')" draggable v-model="visible">
<el-form :model="form" :rules="dataRules" formDialogRef label-width="90px" ref="dataFormRef" v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item :label="t('leave.username')" prop="username">
<el-input :placeholder="t('leave.inputUsernameTip')" disabled v-model="form.username" />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.days')" prop="days">
<el-input-number :max="1000" :min="1" :placeholder="t('leave.inputDaysTip')"
v-model="form.days"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.days')" prop="days">
<el-input-number :max="1000" :min="1" :placeholder="t('leave.inputDaysTip')" v-model="form.days"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.leaveTime')" prop="leaveTime">
<el-date-picker
:placeholder="t('leave.inputLeaveTimeTip')"
:value-format="dateTimeStr"
type="datetime"
v-model="form.leaveTime"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.leaveTime')" prop="leaveTime">
<el-date-picker :placeholder="t('leave.inputLeaveTimeTip')" :value-format="dateTimeStr"
type="datetime"
v-model="form.leaveTime"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item :label="t('leave.content')" prop="content">
<editor :placeholder="t('leave.inputContentTip')" v-model:get-html="form.content"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
<el-button @click="onSubmit" type="primary">{{ $t('common.confirmButtonText') }}</el-button>
</span>
</template>
</el-dialog>
<el-col :span="24" class="mb20">
<el-form-item :label="t('leave.content')" prop="content">
<editor :placeholder="t('leave.inputContentTip')" v-model:get-html="form.content" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
<el-button @click="onSubmit" type="primary">{{ $t('common.confirmButtonText') }}</el-button>
</span>
</template>
</el-dialog>
</template>
<script lang="ts" name="OaLeaveBillDialog" setup>
import {useMessage} from "/@/hooks/message";
import {addObj, getObj, putObj} from '../../../api/oa/leave-bill'
import {useI18n} from "vue-i18n"
import {useUserInfo} from "/@/stores/userInfo";
import { useMessage } from '/@/hooks/message';
import { addObj, getObj, putObj } from '../../../api/oa/leave-bill';
import { useI18n } from 'vue-i18n';
import { useUserInfo } from '/@/stores/userInfo';
const emit = defineEmits(['refresh']);
const emit = defineEmits(['refresh']);
const { t } = useI18n();
const {t} = useI18n();
//
const dataFormRef = ref();
const visible = ref(false);
const loading = ref(false);
//
const dataFormRef = ref();
const visible = ref(false)
const loading = ref(false)
//
const form = reactive({
leaveId: '',
username: '',
days: 0,
content: '',
leaveTime: '',
});
//
const form = reactive({
leaveId: '',
username: '',
days: 0,
content: '',
leaveTime: '',
});
//
const dataRules = ref({
username: [{ required: true, message: '用户名不能为空', trigger: 'blur' }],
days: [{ required: true, message: '请假天数不能为空', trigger: 'blur' }],
content: [{ required: true, message: '事由不能为空', trigger: 'blur' }],
leaveTime: [{ required: true, message: '时间不能为空', trigger: 'blur' }],
});
//
const dataRules = ref({
username: [{required: true, message: '用户名不能为空', trigger: 'blur'}],
days: [{required: true, message: '请假天数不能为空', trigger: 'blur'}],
content: [{required: true, message: '事由不能为空', trigger: 'blur'}],
leaveTime: [{required: true, message: '时间不能为空', trigger: 'blur'}],
})
//
const openDialog = (id: string) => {
visible.value = true;
form.leaveId = '';
//
const openDialog = (id: string) => {
visible.value = true
form.leaveId = ''
//
if (dataFormRef.value) {
dataFormRef.value.resetFields();
}
//
if (dataFormRef.value) {
dataFormRef.value.resetFields()
}
// oaLeaveBill
if (id) {
form.leaveId = id;
getoaLeaveBillData(id);
} else {
form.username = useUserInfo().userInfos.user.username;
}
};
// oaLeaveBill
if (id) {
form.leaveId = id
getoaLeaveBillData(id)
} else {
form.username = useUserInfo().userInfos.user.username
}
};
//
const onSubmit = () => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
return false;
}
//
if (form.leaveId) {
loading.value = true;
putObj(form)
.then(() => {
useMessage().success(t('common.editSuccessText'));
visible.value = false; //
emit('refresh');
})
.catch((err: any) => {
useMessage().error(err.msg);
})
.finally(() => {
loading.value = false;
});
} else {
loading.value = true;
addObj(form)
.then(() => {
useMessage().success(t('common.addSuccessText'));
visible.value = false; //
emit('refresh');
})
.catch((err: any) => {
useMessage().error(err.msg);
})
.finally(() => {
loading.value = false;
});
}
});
};
//
const onSubmit = () => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
return false
}
//
if (form.leaveId) {
loading.value = true
putObj(form).then(() => {
useMessage().success(t('common.editSuccessText'))
visible.value = false //
emit('refresh')
}).catch((err: any) => {
useMessage().error(err.msg)
}).finally(() => {
loading.value = false
})
} else {
loading.value = true
addObj(form).then(() => {
useMessage().success(t('common.addSuccessText'))
visible.value = false //
emit('refresh')
}).catch((err: any) => {
useMessage().error(err.msg)
}).finally(() => {
loading.value = false
})
}
})
}
//
const getoaLeaveBillData = (id: string) => {
//
loading.value = true;
getObj(id)
.then((res: any) => {
Object.assign(form, res.data);
})
.finally(() => {
loading.value = false;
});
};
//
const getoaLeaveBillData = (id: string) => {
//
loading.value = true
getObj(id).then((res: any) => {
Object.assign(form, res.data)
}).finally(() => {
loading.value = false
})
};
//
defineExpose({
openDialog
});
</script>
//
defineExpose({
openDialog,
});
</script>

View File

@ -1,169 +1,171 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('leave.username')" prop="username">
<el-input :placeholder="t('leave.inputUsernameTip')" style="max-width: 180px"
v-model="state.queryForm.username"/>
</el-form-item>
<el-form-item :label="t('leave.state')" class="ml2" prop="state">
<el-select :placeholder="t('leave.inputStateTip')" v-model="state.queryForm.state">
<el-option :key="index" :label="item.label" :value="item.value"
v-for="(item, index) in leave_status"></el-option>
</el-select>
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" formDialogRef icon="search" type="primary"
v-auth="'oa_leave_bill_view'">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" formDialogRef icon="Refresh">{{ $t('common.resetBtn') }}
</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" formDialogRef icon="folder-add"
type="primary" v-auth="'oa_leave_bill_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" formDialogRef icon="Download" type="primary"
v-auth="'oa_leave_bill_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef
icon="Delete"
type="primary" v-auth="'oa_leave_bill_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" @sort-change="sortChangeHandle"
style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('leave.index')" type="index" width="80"/>
<el-table-column :label="t('leave.leaveId')" prop="leaveId" show-overflow-tooltip/>
<el-table-column :label="t('leave.username')" prop="username" show-overflow-tooltip/>
<el-table-column :label="t('leave.days')" prop="days" show-overflow-tooltip/>
<el-table-column :label="t('leave.state')" prop="state" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="leave_status" :value="scope.row.state"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('leave.leaveTime')" prop="leaveTime" show-overflow-tooltip/>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="handleSubmit(scope.row)" text type="primary" v-if="scope.row.state === '0'">
提交
</el-button>
<el-button @click="formDialogRef.openDialog(scope.row.leaveId)" text type="primary"
v-auth="'oa_leave_bill_edit'">{{
$t('common.editBtn')
}}
</el-button>
<el-button @click="handleDelete([scope.row.leaveId])" text type="primary"
v-auth="'oa_leave_bill_del'">{{
$t('common.delBtn')
}}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</el-card>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('leave.username')" prop="username">
<el-input :placeholder="t('leave.inputUsernameTip')" style="max-width: 180px" v-model="state.queryForm.username" />
</el-form-item>
<el-form-item :label="t('leave.state')" class="ml2" prop="state">
<el-select :placeholder="t('leave.inputStateTip')" v-model="state.queryForm.state">
<el-option :key="index" :label="item.label" :value="item.value" v-for="(item, index) in leave_status"></el-option>
</el-select>
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" formDialogRef icon="search" type="primary" v-auth="'oa_leave_bill_view'">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" formDialogRef icon="Refresh">{{ $t('common.resetBtn') }} </el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" formDialogRef icon="folder-add" type="primary" v-auth="'oa_leave_bill_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" formDialogRef icon="Download" type="primary" v-auth="'oa_leave_bill_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button
:disabled="multiple"
@click="handleDelete(selectObjs)"
class="ml10"
formDialogRef
icon="Delete"
type="primary"
v-auth="'oa_leave_bill_del'"
>
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
@selection-change="handleSelectionChange"
@sort-change="sortChangeHandle"
style="width: 100%"
v-loading="state.loading"
>
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('leave.index')" type="index" width="80" />
<el-table-column :label="t('leave.leaveId')" prop="leaveId" show-overflow-tooltip />
<el-table-column :label="t('leave.username')" prop="username" show-overflow-tooltip />
<el-table-column :label="t('leave.days')" prop="days" show-overflow-tooltip />
<el-table-column :label="t('leave.state')" prop="state" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="leave_status" :value="scope.row.state"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('leave.leaveTime')" prop="leaveTime" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="handleSubmit(scope.row)" text type="primary" v-if="scope.row.state === '0'"> 提交 </el-button>
<el-button @click="formDialogRef.openDialog(scope.row.leaveId)" text type="primary" v-auth="'oa_leave_bill_edit'"
>{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.leaveId])" text type="primary" v-auth="'oa_leave_bill_del'"
>{{ $t('common.delBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</el-card>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList(false)" ref="formDialogRef"/>
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList(false)" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="systemOaLeaveBill" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, fetchList, submit} from "/@/api/oa/leave-bill";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useDict} from '/@/hooks/dict';
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, fetchList, submit } from '/@/api/oa/leave-bill';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { useI18n } from 'vue-i18n';
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const {t} = useI18n()
//
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
//
const {leave_status} = useDict('leave_status')
//
const formDialogRef = ref()
//
const queryRef = ref()
const showSearch = ref(true)
//
const selectObjs = ref([]) as any
const multiple = ref(true)
const { leave_status } = useDict('leave_status');
//
const formDialogRef = ref();
//
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]) as any;
const multiple = ref(true);
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
})
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
});
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
downBlobFile
} = useTable(state)
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile } = useTable(state);
//
const resetQuery = () => {
//
queryRef.value.resetFields()
//
selectObjs.value = []
getDataList()
}
//
const resetQuery = () => {
//
queryRef.value.resetFields();
//
selectObjs.value = [];
getDataList();
};
// excel
const exportExcel = () => {
downBlobFile('/act/leave-bill/export', state.queryForm, 'leave.xlsx')
}
// excel
const exportExcel = () => {
downBlobFile('/act/leave-bill/export', state.queryForm, 'leave.xlsx');
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.leaveId)
});
console.log(selectObjs)
multiple.value = !objs.length
}
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.leaveId);
});
console.log(selectObjs);
multiple.value = !objs.length;
};
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
//
const handleDelete = (ids: string[]) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
const handleSubmit = (row) => {
useMessageBox().confirm(t('common.optConfirmText'))
.then(() => {
submit(row.leaveId).then(() => {
getDataList(false);
useMessage().success(t('common.optSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
}
const handleSubmit = (row) => {
useMessageBox()
.confirm(t('common.optConfirmText'))
.then(() => {
submit(row.leaveId)
.then(() => {
getDataList(false);
useMessage().success(t('common.optSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
</script>

View File

@ -1,146 +1,131 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<el-row class="mb8" shadow="hover" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('model.category')" prop="category">
<el-input :placeholder="$t('model.inputCategoryTip')" style="max-width: 180px"
v-model="state.queryForm.category"/>
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary"
v-auth="'oa_model_view'">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
v-auth="'oa_model_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary" v-auth="'oa_model_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%"
v-loading="state.loading">
<el-table-column align="center" type="selection" width="50"/>
<el-table-column :label="$t('model.index')" type="index" width="80"/>
<el-table-column :label="$t('model.name')" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.key')" prop="key" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.category')" prop="category" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.version')" prop="version" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.createTime')" prop="createTime"
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.lastUpdateTime')" prop="lastUpdateTime"
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button @click="handleView(scope.row.id)" text type="primary" v-auth="'oa_model_view'">模型图
</el-button>
<el-button @click="handleDeploy(scope.row.id)" text type="primary" v-auth="'oa_model_add'">
部署
</el-button>
<el-button @click="handleDelete([scope.row.roleId])" text type="primary"
v-auth="'oa_model_del'">{{
$t('common.delBtn')
}}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</el-card>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<el-row class="mb8" shadow="hover" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('model.category')" prop="category">
<el-input :placeholder="$t('model.inputCategoryTip')" style="max-width: 180px" v-model="state.queryForm.category" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary" v-auth="'oa_model_view'">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'oa_model_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary" v-auth="'oa_model_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
@queryTable="getDataList"
class="ml10"
style="float: right; margin-right: 20px"
v-model:showSearch="showSearch"
></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="$t('model.index')" type="index" width="80" />
<el-table-column :label="$t('model.name')" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.key')" prop="key" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.category')" prop="category" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.version')" prop="version" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.createTime')" prop="createTime" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('model.lastUpdateTime')" prop="lastUpdateTime" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button @click="handleView(scope.row.id)" text type="primary" v-auth="'oa_model_view'">模型图 </el-button>
<el-button @click="handleDeploy(scope.row.id)" text type="primary" v-auth="'oa_model_add'"> 部署 </el-button>
<el-button @click="handleDelete([scope.row.roleId])" text type="primary" v-auth="'oa_model_del'">{{ $t('common.delBtn') }} </el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</el-card>
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
</div>
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="model" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, deploy, fetchList} from "/@/api/oa/model";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from '/@/hooks/table';
import { delObj, deploy, fetchList } from '/@/api/oa/model';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const {t} = useI18n()
const router = useRouter()
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
const router = useRouter();
//
const formDialogRef = ref();
const queryRef = ref();
const showSearch = ref(true);
// rows
const selectObjs = ref([]) as any;
//
const formDialogRef = ref()
const queryRef = ref()
const showSearch = ref(true)
// rows
const selectObjs = ref([]) as any
//
const multiple = ref(true);
//
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
category: '',
},
pageList: fetchList, // H
});
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
category: ''
},
pageList: fetchList // H
});
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle } = useTable(state);
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields();
getDataList();
};
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.id);
});
multiple.value = !objs.length;
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.id)
});
multiple.value = !objs.length
}
//
const handleDelete = (ids: string[]) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids).then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
const handleDeploy = (id: string) => {
deploy(id).then(() => {
useMessage().success(t('common.optSuccessText'));
})
}
const handleView = (id: string) => {
router.push({
path: "/oa/model/detail",
query: {id: id},
});
}
const handleDeploy = (id: string) => {
deploy(id).then(() => {
useMessage().success(t('common.optSuccessText'));
});
};
const handleView = (id: string) => {
router.push({
path: '/oa/model/detail',
query: { id: id },
});
};
</script>

View File

@ -1,136 +1,139 @@
<template>
<el-dialog :title="form.taskId ? $t('common.editBtn') : $t('common.addBtn')" v-model="visible"
:close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item :label="t('leave.username')" prop="username">
<el-input v-model="form.username" :placeholder="t('leave.inputUsernameTip')" disabled />
</el-form-item>
</el-col>
<el-dialog :title="form.taskId ? $t('common.editBtn') : $t('common.addBtn')" v-model="visible" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item :label="t('leave.username')" prop="username">
<el-input v-model="form.username" :placeholder="t('leave.inputUsernameTip')" disabled />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.days')" prop="days">
<el-input-number :min="1" :max="1000" v-model="form.days" :placeholder="t('leave.inputDaysTip')"
disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.days')" prop="days">
<el-input-number :min="1" :max="1000" v-model="form.days" :placeholder="t('leave.inputDaysTip')" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.leaveTime')" prop="leaveTime">
<el-date-picker type="datetime" :placeholder="t('leave.inputLeaveTimeTip')" v-model="form.leaveTime"
:value-format="dateTimeStr" disabled></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="t('leave.leaveTime')" prop="leaveTime">
<el-date-picker
type="datetime"
:placeholder="t('leave.inputLeaveTimeTip')"
v-model="form.leaveTime"
:value-format="dateTimeStr"
disabled
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item :label="t('task.content')" prop="content">
<div v-html="form.content"></div>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item :label="t('task.content')" prop="content">
<div v-html="form.content"></div>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item :label="t('task.comment')" prop="comment">
<editor v-model:get-html="form.comment" :placeholder="t('task.inputCommentTip')" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" v-for="flag in form.flagList" :key="flag"
@click="handleTask(flag)">{{ flag }}
</el-button>
</span>
</template>
</el-dialog>
<el-col :span="24" class="mb20">
<el-form-item :label="t('task.comment')" prop="comment">
<editor v-model:get-html="form.comment" :placeholder="t('task.inputCommentTip')" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" v-for="flag in form.flagList" :key="flag" @click="handleTask(flag)">{{ flag }} </el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="OaLeaveBillDialog">
import { useMessage } from "/@/hooks/message";
import { doTask, fetchDetail } from '/@/api/oa/task'
import { useI18n } from "vue-i18n"
import { useUserInfo } from "/@/stores/userInfo";
import { useMessage } from '/@/hooks/message';
import { doTask, fetchDetail } from '/@/api/oa/task';
import { useI18n } from 'vue-i18n';
import { useUserInfo } from '/@/stores/userInfo';
const emit = defineEmits(['refresh']);
const { t } = useI18n();
//
const dataFormRef = ref();
const visible = ref(false)
const loading = ref(false)
const visible = ref(false);
const loading = ref(false);
//
const form = reactive({
taskId: '',
taskName: '',
username: '',
comment: '',
days: 0,
content: '',
createTime: '',
time: '',
flagList: [],
taskFlag: '',
taskId: '',
taskName: '',
username: '',
comment: '',
days: 0,
content: '',
createTime: '',
time: '',
flagList: [],
taskFlag: '',
});
//
const dataRules = ref({
comment: [{ required: true, message: '批注不能为空', trigger: 'blur' }]
})
comment: [{ required: true, message: '批注不能为空', trigger: 'blur' }],
});
//
const openDialog = (id: string) => {
visible.value = true
form.taskId = ''
visible.value = true;
form.taskId = '';
//
if (dataFormRef.value) {
dataFormRef.value.resetFields()
}
//
if (dataFormRef.value) {
dataFormRef.value.resetFields();
}
// oaLeaveBill
if (id) {
form.taskId = id
getTaskById(id)
} else {
form.username = useUserInfo().userInfos.user.username
}
// oaLeaveBill
if (id) {
form.taskId = id;
getTaskById(id);
} else {
form.username = useUserInfo().userInfos.user.username;
}
};
//
const handleTask = (result) => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
return false
}
loading.value = true
form.taskFlag = result
doTask(form).then(() => {
useMessage().success(t('common.optSuccessText'))
visible.value = false
emit('refresh')
})
})
}
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
return false;
}
loading.value = true;
form.taskFlag = result;
doTask(form).then(() => {
useMessage().success(t('common.optSuccessText'));
visible.value = false;
emit('refresh');
});
});
};
//
const getTaskById = (id: string) => {
//
loading.value = true
fetchDetail(id).then((res: any) => {
Object.assign(form, res.data)
form.comment = res.data.comment ? res.data.comment : ''
}).catch((err) => {
useMessage().error('操作失败')
}).finally(() => {
loading.value = false
})
//
loading.value = true;
fetchDetail(id)
.then((res: any) => {
Object.assign(form, res.data);
form.comment = res.data.comment ? res.data.comment : '';
})
.catch((err) => {
useMessage().error('操作失败');
})
.finally(() => {
loading.value = false;
});
};
//
defineExpose({
openDialog
openDialog,
});
</script>
</script>

View File

@ -1,19 +1,19 @@
export default {
task: {
index: 'index',
taskId: 'taskId',
taskName: 'taskName',
time: 'time',
comment: 'comment',
content: 'content',
cancel:'cancel ',
inputTaskNameTip: 'input Task Name',
inputCommentTip: 'input comment'
},
comment: {
index: 'index',
userId: 'userId',
fullMessage: 'fullMessage',
time: 'time'
}
}
task: {
index: 'index',
taskId: 'taskId',
taskName: 'taskName',
time: 'time',
comment: 'comment',
content: 'content',
cancel: 'cancel ',
inputTaskNameTip: 'input Task Name',
inputCommentTip: 'input comment',
},
comment: {
index: 'index',
userId: 'userId',
fullMessage: 'fullMessage',
time: 'time',
},
};

View File

@ -1,20 +1,19 @@
export default {
task: {
index: '序号',
taskId: 'ID',
taskName: '任务名称',
time: '提交时间',
comment: '批注',
content: '事由',
cancel: '作废',
inputTaskNameTip: '请输入任务名称',
inputCommentTip: '请输入批注名称',
},
comment: {
index: '序号',
userId: '用户',
fullMessage: '批注',
time: '时间'
}
}
task: {
index: '序号',
taskId: 'ID',
taskName: '任务名称',
time: '提交时间',
comment: '批注',
content: '事由',
cancel: '作废',
inputTaskNameTip: '请输入任务名称',
inputCommentTip: '请输入批注名称',
},
comment: {
index: '序号',
userId: '用户',
fullMessage: '批注',
time: '时间',
},
};