💄 优化表格布局,支持分页固定

This commit is contained in:
lbw 2023-03-03 14:53:11 +08:00
parent c73a99f5a7
commit af762e67aa
48 changed files with 1797 additions and 1923 deletions

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('audit.auditName')" prop="auditName">
@ -57,7 +57,7 @@
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</el-card>
</div>
</div>
</template>

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('client.clientId')" prop="clientId">
@ -65,8 +65,7 @@
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" />
</el-card>
</div>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList()" />
</div>

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card shadow="hover" class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<div class="mb15">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item prop="deptName">
@ -44,8 +44,8 @@
</template>
</el-table-column>
</el-table>
</el-card>
<dept-form ref="deptDialogRef" @refresh="getDataList()" />
</div>
<dept-form ref="deptDialogRef" @refresh="getDataList()" />
<upload-excel ref="excelUploadRef" :title="$t('sysdept.importTip')" url="/admin/dept/import"
temp-url="/admin/sys-file/local/file/dept.xlsx" @refreshDataList="getDataList" />
</div>

View File

@ -1,6 +1,6 @@
<template>
<el-drawer v-model="visible" :title="$t('sysdict.dictItem')" size="80%">
<el-card shadow="hover" class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="dictformRef.openDialog(null,state.queryForm)">
@ -31,7 +31,7 @@
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination">
</pagination>
</el-row>
</el-card>
</div>
<dict-form ref="dictformRef" @refresh="getDataList"></dict-form>
</el-drawer>

View File

@ -1,15 +1,16 @@
<template>
<div class="layout-padding">
<el-card shadow="hover" class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('sysdict.dictType')" prop="dictType">
<el-input :placeholder="$t('sysdict.inputDictTypeTip')" v-model="state.queryForm.dictType" style="max-width: 180px" />
<el-input :placeholder="$t('sysdict.inputDictTypeTip')" v-model="state.queryForm.dictType"
style="max-width: 180px"/>
</el-form-item>
<el-form-item :label="$t('sysdict.systemFlag')" prop="systemFlag">
<el-select v-model="state.queryForm.systemFlag" clearable>
<el-option v-for="(item, index) in dict_type" :label="item.label" :value="item.value"
:key="index"></el-option>
:key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item class="ml2">
@ -26,43 +27,48 @@
{{ $t('common.addBtn') }}
</el-button>
<el-button :disabled="multiple" icon="Delete" type="primary" class="ml10" v-auth="'sys_dict_del'"
@click="handleDelete(selectObjs)">
@click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<el-button class="ml10" icon="refresh-left" type="primary" @click="handleRefreshCache()">
{{ $t('common.refreshCacheBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"
@selection-change="handleSelectionChange">
@selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" :selectable='handleSelectable' width="50">
</el-table-column>
<el-table-column type="index" :label="$t('sysdict.index')" width="80" />
<el-table-column type="index" :label="$t('sysdict.index')" width="80"/>
<el-table-column :label="$t('sysdict.dictType')" show-overflow-tooltip>
<template #default="scope">
<el-button text type="primary" @click="showDictITem(scope.row)">{{ scope.row.dictType }}</el-button>
</template>
</el-table-column>
<el-table-column prop="description" :label="$t('sysdict.description')" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="description" :label="$t('sysdict.description')" show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="systemFlag" :label="$t('sysdict.systemFlag')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dict_type" :value="scope.row.systemFlag"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="remarks" :label="$t('sysdict.remarks')" show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" :label="$t('sysdict.createTime')" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="createTime" :label="$t('sysdict.createTime')" show-overflow-tooltip
sortable></el-table-column>
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button text type="primary" @click="showDictITem(scope.row)">{{ $t('sysdict.dictItem') }}</el-button>
<el-button text type="primary" @click="onOpenEditDic('edit', scope.row)">{{ $t('common.editBtn') }}</el-button>
<el-button text type="primary" @click="onOpenEditDic('edit', scope.row)">{{
$t('common.editBtn')
}}
</el-button>
<el-tooltip :content="$t('sysdict.deleteDisabledTip')" :disabled="scope.row.systemFlag === 1"
placement="top">
placement="top">
<span style="margin-left: 12px">
<el-button text type="primary" :disabled="scope.row.systemFlag !== 1"
@click="handleDelete([scope.row.id])">
@click="handleDelete([scope.row.id])">
{{ $t('common.delBtn') }}
</el-button>
</span>
@ -70,24 +76,25 @@
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</el-card>
<DicDialog ref="dicDialogRef" @refresh="getDataList()" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination"/>
</div>
<DicDialog ref="dicDialogRef" @refresh="getDataList()"/>
<dict-item-dialog ref="dictItemDialogRef"></dict-item-dialog>
</div>
</template>
<script setup lang="ts" name="systemDic">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObj, fetchList, refreshCache } from "/@/api/admin/dict";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useDict } from "/@/hooks/dict";
import { useI18n } from "vue-i18n";
const { dict_type } = useDict('dict_type')
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, fetchList, refreshCache} from "/@/api/admin/dict";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useDict} from "/@/hooks/dict";
import {useI18n} from "vue-i18n";
const {dict_type} = useDict('dict_type')
//
const DicDialog = defineAsyncComponent(() => import('./form.vue'));
const DictItemDialog = defineAsyncComponent(() => import('./dictItem/index.vue'))
const { t } = useI18n()
const {t} = useI18n()
//
const dicDialogRef = ref();
const dictItemDialogRef = ref()
@ -139,22 +146,22 @@ const handleSelectionChange = (objs: any) => {
multiple.value = !objs.length
}
//
const handleRefreshCache = () =>{
refreshCache().then(() =>{
useMessage().success('同步成功')
const handleRefreshCache = () => {
refreshCache().then(() => {
useMessage().success('同步成功')
})
}
//
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)
.then(() => {
delObj(ids).then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
})
};
</script>

View File

@ -1,19 +1,19 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('i18n.name')" prop="name">
<el-input :placeholder="t('i18n.inputKeyTip')" style="max-width: 180px"
v-model="state.queryForm.name"/>
v-model="state.queryForm.name" />
</el-form-item>
<el-form-item :label="$t('i18n.zhCn')" prop="zh-cn">
<el-input :placeholder="t('i18n.inputZhCnTip')" style="max-width: 180px"
v-model="state.queryForm.zhCn"/>
v-model="state.queryForm.zhCn" />
</el-form-item>
<el-form-item :label="$t('i18n.en')" prop="en">
<el-input :placeholder="t('i18n.inputEnTip')" style="max-width: 180px"
v-model="state.queryForm.en"/>
v-model="state.queryForm.en" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
@ -27,128 +27,127 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" formDialogRef icon="folder-add"
type="primary"
v-auth="'admin_i18n_add'">
type="primary" v-auth="'admin_i18n_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" formDialogRef icon="Download" type="primary"
v-auth="'admin_i18n_export'">
v-auth="'admin_i18n_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef icon="Delete"
type="primary" v-auth="'admin_i18n_del'">
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef
icon="Delete" type="primary" v-auth="'admin_i18n_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
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('i18n.name')" prop="name" show-overflow-tooltip/>
<el-table-column :label="t('i18n.zhCn')" prop="zhCn" show-overflow-tooltip/>
<el-table-column :label="t('i18n.en')" prop="en" show-overflow-tooltip/>
<el-table-column :label="t('i18n.createBy')" prop="createBy" show-overflow-tooltip/>
<el-table-column :label="t('i18n.createTime')" prop="createTime" show-overflow-tooltip/>
style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60" />
<el-table-column type="index" :label="t('file.index')" width="80" />
<el-table-column :label="t('i18n.name')" prop="name" show-overflow-tooltip />
<el-table-column :label="t('i18n.zhCn')" prop="zhCn" show-overflow-tooltip />
<el-table-column :label="t('i18n.en')" prop="en" show-overflow-tooltip />
<el-table-column :label="t('i18n.createBy')" prop="createBy" show-overflow-tooltip />
<el-table-column :label="t('i18n.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="'admin_i18n_edit'">{{
$t('common.editBtn')
v-auth="'admin_i18n_edit'">{{
$t('common.editBtn')
}}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary" v-auth="'admin_i18n_del'">
{{
$t('common.delBtn')
$t('common.delBtn')
}}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</el-card>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="systemSysI18n" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, fetchList} from "/@/api/admin/i18n";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObj, fetchList } from "/@/api/admin/i18n";
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: {
name: '',
zhCn: '',
en: ''
},
pageList: fetchList,
descs: ['create_time']
})
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
name: '',
zhCn: '',
en: ''
},
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 = () => {
//
const resetQuery = () => {
//
queryRef.value.resetFields()
//
state.queryForm!.descs = []
state.queryForm!.ascs = []
//
selectObjs.value = []
getDataList()
}
queryRef.value.resetFields()
//
state.queryForm!.descs = []
state.queryForm!.ascs = []
//
selectObjs.value = []
getDataList()
}
// excel
const exportExcel = () => {
downBlobFile('/admin/i18n/export', state.queryForm, 'i18n.xlsx')
}
// excel
const exportExcel = () => {
downBlobFile('/admin/i18n/export', state.queryForm, 'i18n.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)
})
};
})
};
</script>

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view" shadow="hover">
<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('syslog.logType')" prop="logType">
@ -138,4 +138,4 @@ const handleDelete = (ids: string[]) => {
})
})
};
</script>
</script>

View File

@ -1,27 +1,27 @@
<template>
<div class="layout-padding">
<el-card shadow="hover">
<div class="layout-padding-auto layout-padding-view">
<div class="mb15">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('sysmenu.name')" prop="menuName" >
<el-input :placeholder="$t('sysmenu.inputNameTip')" style="max-width: 180px"
clearable v-model="state.queryForm.menuName"/>
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" class="ml10" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="onOpenAddMenu" v-auth="'sys_menu_add'">
{{ $t('common.addBtn') }}
</el-button>
</el-form-item>
</el-form>
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('sysmenu.name')" prop="menuName">
<el-input :placeholder="$t('sysmenu.inputNameTip')" style="max-width: 180px" clearable
v-model="state.queryForm.menuName" />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" class="ml10" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="onOpenAddMenu"
v-auth="'sys_menu_add'">
{{ $t('common.addBtn') }}
</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%" row-key="path"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column prop="name" :label="$t('sysmenu.name')" show-overflow-tooltip></el-table-column>
<el-table-column prop="sortOrder" :label="$t('sysmenu.sortOrder')"
show-overflow-tooltip></el-table-column>
<el-table-column prop="sortOrder" :label="$t('sysmenu.sortOrder')" show-overflow-tooltip></el-table-column>
<el-table-column prop="icon" :label="$t('sysmenu.icon')" show-overflow-tooltip>
<template #default="scope">
<SvgIcon :name="scope.row.icon" />
@ -45,14 +45,14 @@
:show-overflow-tooltip="true"></el-table-column>
<el-table-column :label="$t('common.action')" show-overflow-tooltip width="200">
<template #default="scope">
<el-button text type="primary" @click="onOpenAddMenu('add',scope.row)" v-auth="'sys_menu_add'"> {{
<el-button text type="primary" @click="onOpenAddMenu('add', scope.row)" v-auth="'sys_menu_add'"> {{
$t('common.addBtn')
}}</el-button>
<el-button text type="primary" @click="onOpenEditMenu('edit', scope.row)"
v-auth="'sys_menu_edit'">{{ $t('common.editBtn') }}</el-button>
<el-tooltip :content="$t('sysmenu.deleteDisabledTip')"
:disabled="!deleteMenuDisabled(scope.row)" placement="top">
<el-tooltip :content="$t('sysmenu.deleteDisabledTip')" :disabled="!deleteMenuDisabled(scope.row)"
placement="top">
<span style="margin-left: 12px">
<el-button text type="primary" :disabled="deleteMenuDisabled(scope.row)"
@click="onTabelRowDel(scope.row)" v-auth="'sys_menu_del'">
@ -63,7 +63,7 @@
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<MenuDialog ref="menuDialogRef" @refresh="getDataList()" />
</div>
</template>
@ -90,8 +90,8 @@ const {
} = useTable(state)
//
const onOpenAddMenu = (type: string,row?: any) => {
menuDialogRef.value.openDialog(type,row);
const onOpenAddMenu = (type: string, row?: any) => {
menuDialogRef.value.openDialog(type, row);
};
//
const onOpenEditMenu = (type: string, row: any) => {

View File

@ -1,12 +1,12 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('param.systemFlag')" class="ml2" prop="systemFlag">
<el-select :placeholder="t('param.inputsystemFlagTip')" v-model="state.queryForm.systemFlag">
<el-option :key="index" :label="item.label" :value="item.value"
v-for="(item, index) in dict_type"></el-option>
v-for="(item, index) in dict_type"></el-option>
</el-select>
</el-form-item>
<el-form-item class="ml2">
@ -20,39 +20,37 @@
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add"
type="primary">
<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(selectObjs)" class="ml10" icon="Delete"
type="primary">
type="primary">
{{ $t('common.delBtn') }}
</el-button>
<el-button @click="handleRefreshCache()" class="ml10" icon="refresh-left"
type="primary">
<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>
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" style="width: 100%"
v-loading="state.loading">
v-loading="state.loading">
<el-table-column :selectable='handleSelectable' align="center" type="selection" width="50">
</el-table-column>
<el-table-column :label="t('param.index')" type="index" width="80"/>
<el-table-column :label="t('param.publicName')" prop="publicName" show-overflow-tooltip/>
<el-table-column :label="t('param.publicKey')" prop="publicKey" show-overflow-tooltip/>
<el-table-column :label="t('param.publicValue')" prop="publicValue" show-overflow-tooltip/>
<el-table-column :label="t('param.index')" type="index" width="80" />
<el-table-column :label="t('param.publicName')" prop="publicName" show-overflow-tooltip />
<el-table-column :label="t('param.publicKey')" prop="publicKey" show-overflow-tooltip />
<el-table-column :label="t('param.publicValue')" prop="publicValue" show-overflow-tooltip />
<el-table-column :label="t('param.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('param.createTime')" prop="createTime" show-overflow-tooltip/>
<el-table-column :label="t('param.createTime')" prop="createTime" show-overflow-tooltip />
<el-table-column :label="t('param.systemFlag')" prop="systemFlag" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dict_type" :value="scope.row.systemFlag"></dict-tag>
@ -62,109 +60,108 @@
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.publicId)" text type="primary">{{
$t('common.editBtn')
}}
}}
</el-button>
<el-tooltip :content="$t('sysdict.deleteDisabledTip')" :disabled="scope.row.systemFlag === 1"
placement="top">
<span style="margin-left: 12px">
<el-button :disabled="scope.row.systemFlag !== 1" @click="handleDelete([scope.row.publicId])" text
type="primary">
{{ $t('common.delBtn') }}
</el-button>
</span>
placement="top">
<span style="margin-left: 12px">
<el-button :disabled="scope.row.systemFlag !== 1"
@click="handleDelete([scope.row.publicId])" text type="primary">
{{ $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"/>
</el-card>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="systemSysPublicParam" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, fetchList, refreshCache} from "/@/api/admin/param";
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/param";
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 {dict_type, status_type} = useDict('dict_type', 'status_type')
//
const formDialogRef = ref()
//
const queryRef = ref()
const showSearch = ref(true)
//
const selectObjs = ref([]) as any
const multiple = ref(true)
const { dict_type, status_type } = useDict('dict_type', 'status_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: {
systemFlag: ''
},
pageList: fetchList,
descs: ['create_time']
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
systemFlag: ''
},
pageList: fetchList,
descs: ['create_time']
})
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleSelectable = (row: any) => {
//
return row.systemFlag !== '1'
}
// excel
const exportExcel = () => {
downBlobFile('/admin/param/export', state.queryForm, 'param.xlsx')
}
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.publicId)
});
multiple.value = !objs.length
}
const handleRefreshCache = () => {
refreshCache().then(() => {
useMessage().success('同步成功')
})
}
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleSelectable = (row: any) => {
//
return row.systemFlag !== '1'
}
// excel
const exportExcel = () => {
downBlobFile('/admin/param/export', state.queryForm, 'param.xlsx')
}
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.publicId)
});
multiple.value = !objs.length
}
const handleRefreshCache = () => {
refreshCache().then(() => {
useMessage().success('同步成功')
})
}
//
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,11 +1,11 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('post.postName')" prop="postName">
<el-input :placeholder="$t('post.inputpostNameTip')" style="max-width: 180px"
v-model="state.queryForm.postName"/>
v-model="state.queryForm.postName" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
@ -18,122 +18,119 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
v-auth="'sys_post_add'">
v-auth="'sys_post_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="excelUploadRef.show()" class="ml10" icon="upload-filled" type="primary"
v-auth="'sys_post_add'">
v-auth="'sys_post_add'">
{{ $t('common.importBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary"
v-auth="'sys_post_export'">
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary" v-auth="'sys_post_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary"
v-auth="'sys_post_del'">
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary" v-auth="'sys_post_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
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('post.index')" type="index" width="80"/>
<el-table-column :label="t('post.postCode')" prop="postCode" show-overflow-tooltip/>
<el-table-column :label="t('post.postName')" prop="postName" show-overflow-tooltip/>
<el-table-column :label="t('post.postSort')" prop="postSort" show-overflow-tooltip/>
<el-table-column :label="t('post.remark')" prop="remark" show-overflow-tooltip/>
v-loading="state.loading">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="t('post.index')" type="index" width="80" />
<el-table-column :label="t('post.postCode')" prop="postCode" show-overflow-tooltip />
<el-table-column :label="t('post.postName')" prop="postName" show-overflow-tooltip />
<el-table-column :label="t('post.postSort')" prop="postSort" show-overflow-tooltip />
<el-table-column :label="t('post.remark')" prop="remark" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.postId)" text type="primary"
v-auth="'sys_post_edit'">{{ $t('common.editBtn') }}
v-auth="'sys_post_edit'">{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.postId])" text type="primary"
v-auth="'sys_post_del'">{{
<el-button @click="handleDelete([scope.row.postId])" text type="primary" v-auth="'sys_post_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>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
<!-- 导入excel -->
<upload-excel :title="$t('post.importPostTip')" @refreshDataList="getDataList" ref="excelUploadRef"
temp-url="/admin/sys-file/local/file/post.xlsx" url="/admin/post/import"/>
temp-url="/admin/sys-file/local/file/post.xlsx" url="/admin/post/import" />
</div>
</template>
<script lang="ts" name="systemPost" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, fetchList} from "/@/api/admin/post";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObj, fetchList } from "/@/api/admin/post";
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 excelUploadRef = ref()
//
const queryRef = ref()
const showSearch = ref(true)
//
const selectObjs = ref([]) as any
const multiple = ref(true)
//
const formDialogRef = ref()
const excelUploadRef = 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()
getDataList()
}
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
// excel
const exportExcel = () => {
downBlobFile('/admin/post/export', state.queryForm, 'post.xlsx')
}
// excel
const exportExcel = () => {
downBlobFile('/admin/post/export', state.queryForm, 'post.xlsx')
}
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.postId)
});
multiple.value = !objs.length
}
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.postId)
});
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,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card shadow="hover" class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row shadow="hover" v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('sysrole.roleName')" prop="roleName">
@ -43,7 +43,7 @@
<el-table-column prop="roleName" :label="$t('sysrole.roleName')" show-overflow-tooltip></el-table-column>
<el-table-column prop="roleCode" :label="$t('sysrole.roleCode')" show-overflow-tooltip></el-table-column>
<el-table-column prop="roleDesc" :label="$t('sysrole.roleDesc')" show-overflow-tooltip></el-table-column>
<el-table-column prop="data_authority" :label="$t('sysrole.data_authority')" show-overflow-tooltip>
<el-table-column prop="data_authority" :label="$t('sysrole.data_authority')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dictType" :value="scope.row.dsType"></dict-tag>
</template>
@ -51,8 +51,8 @@
<el-table-column prop="createTime" :label="$t('sysrole.createTime')" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button text type="primary" v-auth="'sys_role_edit'"
@click="roleDialogRef.openDialog(scope.row.roleId)">{{ $t('common.editBtn') }}</el-button>
<el-button text type="primary" v-auth="'sys_role_edit'" @click="roleDialogRef.openDialog(scope.row.roleId)">{{
$t('common.editBtn') }}</el-button>
<el-button text type="primary" v-auth="'sys_role_del'" @click="permessionRef.openDialog(scope.row)">{{
$t('sysrole.permissionTip')
@ -72,7 +72,7 @@
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</el-card>
</div>
<!-- 角色编辑新增 -->
<role-dialog ref="roleDialogRef" @refresh="getDataList()" />

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form ref="queryRef" :inline="true" :model="state.queryForm">
<el-form-item :label="t('social.type')" class="ml2" prop="type">
@ -26,8 +26,8 @@
<el-button class="ml10" icon="Download" type="primary" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button v-auth="'sys_social_details_del'" :disabled="multiple" class="ml10" icon="Delete"
type="primary" @click="handleDelete(selectObjs)">
<el-button v-auth="'sys_social_details_del'" :disabled="multiple" class="ml10" icon="Delete" type="primary"
@click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@ -60,7 +60,7 @@
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" />
</el-card>
</div>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList()" />

View File

@ -1,11 +1,11 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<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"/>
v-model="state.queryForm.name" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
@ -18,36 +18,35 @@
<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'">
v-auth="'admin_systenant_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary"
v-auth="'admin_systenant_add'">
v-auth="'admin_systenant_add'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary"
v-auth="'admin_systenant_del'">
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'">
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>
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/>
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>
@ -66,117 +65,116 @@
<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')
v-auth="'admin_systenant_edit'">{{
$t('common.editBtn')
}}
</el-button>
<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>
</span>
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>
</span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</el-card>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<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"/>
temp-url="/admin/sys-file/local/file/tenant.xlsx" url="/admin/tenant/import" />
<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,14 +1,14 @@
<template>
<el-drawer v-model="visible" title="租户套餐" size="80%">
<el-card shadow="hover" class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="tenantMenuDialogRef.openDialog()"
v-auth="'admin_systenantmenu_add'">
v-auth="'admin_systenantmenu_add'">
{{ $t('common.addBtn') }}
</el-button>
<right-toolbar :search='false' class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
@ -20,12 +20,11 @@
<dict-tag :options="status_type" :value="scope.row.status"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('tenantmenu.createTime')"
show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" :label="$t('tenantmenu.createTime')" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button text type="primary" @click="tenantMenuDialogRef.openDialog(scope.row.id)"
v-auth="'admin_systenantmenu_edit'"> {{
<el-button text type="primary" @click="tenantMenuDialogRef.openDialog(scope.row.id)"
v-auth="'admin_systenantmenu_edit'"> {{
$t('common.editBtn')
}}
</el-button>
@ -38,16 +37,16 @@
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination">
</pagination>
<tenant-menu-dialog ref="tenantMenuDialogRef" @refresh="getDataList"></tenant-menu-dialog>
</el-card>
</div>
</el-drawer>
</template>
<script setup lang="ts" name="tenant-menu">
import {BasicTableProps, useTable} from "/@/hooks/table";
import { fetchList,delObj } from "/@/api/admin/tenant-menu";
import {useDict} from "/@/hooks/dict";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj } from "/@/api/admin/tenant-menu";
import { useDict } from "/@/hooks/dict";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
const { t } = useI18n()
const TenantMenuDialog = defineAsyncComponent(() => import('./form.vue'))
@ -86,6 +85,4 @@ defineExpose({
});
</script>
<style scoped>
</style>
<style scoped></style>

View File

@ -1,7 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<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('systoken.username')" prop="username">
@ -53,7 +52,7 @@
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination">
</pagination>
</el-card>
</div>
</div>
</template>

View File

@ -8,7 +8,7 @@
</el-card>
</el-col>
<el-col :span="20" :xs="24">
<el-card shadow="hover" class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('sysuser.username')" prop="username">
@ -70,8 +70,7 @@
<dict-tag :options="lock_flag" :value="scope.row.lockFlag"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('sysuser.createTime')"
show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" :label="$t('sysuser.createTime')" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button text type="primary" @click="userDialogRef.openDialog(scope.row.userId)"
@ -95,8 +94,7 @@
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination">
</pagination>
</el-card>
</div>
</el-col>
</el-row>

View File

@ -1,9 +1,9 @@
<template>
<div class="layout-padding">
<el-card shadow="hover">
<div class="layout-padding-auto layout-padding-view">
<div @keyup.enter="getDataList" class="mb15">
<el-input :placeholder="$t('appmenu.inputNameTip')" style="max-width: 180px"
v-model="state.queryForm.menuName"></el-input>
v-model="state.queryForm.menuName"></el-input>
<el-button @click="getDataList" class="ml10" icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
@ -11,18 +11,16 @@
{{ $t('common.addBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary"
v-auth="'sys_post_del'">
v-auth="'sys_post_del'">
{{ $t('common.delBtn') }}
</el-button>
</div>
<el-table :data="state.dataList" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" @selection-change="handleSelectionChange" row-key="path"
style="width: 100%"
v-loading="state.loading">
<el-table-column align="center" type="selection" width="50"/>
<el-table :data="state.dataList" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
@selection-change="handleSelectionChange" row-key="path" style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="$t('appmenu.name')" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('appmenu.sortOrder')" prop="sortOrder"
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('appmenu.sortOrder')" prop="sortOrder" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('appmenu.path')" prop="path" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('appmenu.menuType')" show-overflow-tooltip>
<template #default="scope">
@ -37,85 +35,85 @@
</template>
</el-table-column>
<el-table-column :label="$t('appmenu.permission')" :show-overflow-tooltip="true"
prop="permission"></el-table-column>
prop="permission"></el-table-column>
<el-table-column :label="$t('common.action')" show-overflow-tooltip width="200">
<template #default="scope">
<el-button @click="onOpenAddMenu('add',scope.row)" text type="primary" v-auth="'sys_menu_add'">
<el-button @click="onOpenAddMenu('add', scope.row)" text type="primary" v-auth="'sys_menu_add'">
{{
$t('common.addBtn')
$t('common.addBtn')
}}
</el-button>
<el-button @click="onOpenEditMenu('edit', scope.row)" text type="primary"
v-auth="'sys_menu_edit'">{{ $t('common.editBtn') }}
v-auth="'sys_menu_edit'">{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary" v-auth="'sys_menu_del'">{{
$t('common.delBtn')
}}
}}
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<MenuDialog @refresh="getDataList()" ref="menuDialogRef"/>
</div>
<MenuDialog @refresh="getDataList()" ref="menuDialogRef" />
</div>
</template>
<script lang="ts" name="systemMenu" setup>
import {delObj, pageList} from '/@/api/app/appmenu'
import {BasicTableProps, useTable} from "/@/hooks/table";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
//
const MenuDialog = defineAsyncComponent(() => import('./form.vue'));
const {t} = useI18n();
import { delObj, pageList } from '/@/api/app/appmenu'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
//
const MenuDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n();
//
const menuDialogRef = ref<InstanceType<typeof MenuDialog>>();
const state: BasicTableProps = reactive<BasicTableProps>({
pageList: pageList, // H
queryForm: {
menuName: ''
},
isPage: false
//
const menuDialogRef = ref<InstanceType<typeof MenuDialog>>();
const state: BasicTableProps = reactive<BasicTableProps>({
pageList: pageList, // H
queryForm: {
menuName: ''
},
isPage: false
});
//
const selectObjs = ref([]) as any
const multiple = ref(true)
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.id)
});
multiple.value = !objs.length
}
//
const selectObjs = ref([]) as any
const multiple = ref(true)
//
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 {
getDataList,
} = useTable(state)
const {
getDataList,
} = useTable(state)
//
const onOpenAddMenu = (type: string, row: any) => {
menuDialogRef.value.openDialog(type, row);
};
//
const onOpenEditMenu = (type: string, row: any) => {
menuDialogRef.value.openDialog(type, row);
};
//
const onOpenAddMenu = (type: string, row: any) => {
menuDialogRef.value.openDialog(type, row);
};
//
const onOpenEditMenu = (type: string, row: any) => {
menuDialogRef.value.openDialog(type, row);
};
</script>

View File

@ -1,11 +1,11 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<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('approle.roleName')" prop="roleName">
<el-input :placeholder="$t('approle.inputRoleNameTip')" style="max-width: 180px"
v-model="state.queryForm.roleName"/>
v-model="state.queryForm.roleName" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
@ -18,143 +18,138 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="roleDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
v-auth="'app_approle_add'">
v-auth="'app_approle_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="excelUploadRef.show()" class="ml10" icon="upload-filled" type="primary"
v-auth="'app_approle_export'">
v-auth="'app_approle_export'">
{{ $t('common.importBtn') }}
</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="'app_approle_del'">
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary" v-auth="'app_approle_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
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('approle.index')" type="index" width="80"/>
<el-table-column :label="$t('approle.roleName')" prop="roleName"
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('approle.roleCode')" prop="roleCode"
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('approle.roleDesc')" prop="roleDesc"
show-overflow-tooltip></el-table-column>
v-loading="state.loading">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="$t('approle.index')" type="index" width="80" />
<el-table-column :label="$t('approle.roleName')" prop="roleName" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('approle.roleCode')" prop="roleCode" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('approle.roleDesc')" prop="roleDesc" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('approle.createTime')" prop="createTime"
show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="roleDialogRef.openDialog(scope.row.roleId)" text type="primary"
v-auth="'app_approle_edit'">{{ $t('common.editBtn') }}
v-auth="'app_approle_edit'">{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.roleId])" text type="primary"
v-auth="'app_approle_del'">{{
$t('common.delBtn')
v-auth="'app_approle_del'">{{
$t('common.delBtn')
}}
</el-button>
<el-button @click="permessionRef.openDialog(scope.row)" text type="primary"
v-auth="'app_approle_perm'">{{
$t('approle.permissionTip')
v-auth="'app_approle_perm'">{{
$t('approle.permissionTip')
}}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</el-card>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 角色编辑新增 -->
<role-dialog @refresh="getDataList()" ref="roleDialogRef"/>
<role-dialog @refresh="getDataList()" ref="roleDialogRef" />
<!-- 导入角色 -->
<upload-excel :title="$t('sysuser.importUserTip')" @refreshDataList="getDataList" ref="excelUploadRef"
temp-url="/admin/sys-file/local/file/role.xlsx" url="/admin/role/import"/>
temp-url="/admin/sys-file/local/file/role.xlsx" url="/admin/role/import" />
<!-- 授权 -->
<permession ref="permessionRef"/>
<permession ref="permessionRef" />
</div>
</template>
<script lang="ts" name="systemRole" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, fetchList} from "/@/api/app/approle";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObj, fetchList } from "/@/api/app/approle";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
//
const RoleDialog = defineAsyncComponent(() => import('./form.vue'));
const Permession = defineAsyncComponent(() => import('./permession.vue'))
const {t} = useI18n()
//
const RoleDialog = defineAsyncComponent(() => import('./form.vue'));
const Permession = defineAsyncComponent(() => import('./permession.vue'))
const { t } = useI18n()
//
const roleDialogRef = ref()
const permessionRef = ref()
const excelUploadRef = ref()
const queryRef = ref()
const showSearch = ref(true)
// rows
const selectObjs = ref([]) as any
//
const roleDialogRef = ref()
const permessionRef = ref()
const excelUploadRef = 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: {
roleName: ''
},
pageList: fetchList ,// H
descs: ['create_time']
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
roleName: ''
},
pageList: fetchList,// H
descs: ['create_time']
});
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.roleId)
});
multiple.value = !objs.length
}
// excel
const exportExcel = () => {
downBlobFile('/admin/approle/export', state.queryForm, 'approle.xlsx')
}
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.roleId)
});
multiple.value = !objs.length
}
// excel
const exportExcel = () => {
downBlobFile('/admin/approle/export', state.queryForm, 'approle.xlsx')
}
//
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,12 +1,12 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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>
v-for="(item, index) in app_social_type"></el-option>
</el-select>
</el-form-item>
<el-form-item class="ml2">
@ -21,129 +21,127 @@
<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'">
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'">
<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>
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"/>
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('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') }}
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')
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"/>
</el-card>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<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 = () => {
//
const resetQuery = () => {
//
queryRef.value.resetFields()
//
selectObjs.value = []
getDataList()
}
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,16 +1,15 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<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('appuser.username')" prop="username">
<el-input :placeholder="$t('appuser.inputUsernameTip')" @keyup.enter="getDataList"
clearable
style="width: 240px" v-model="state.queryForm.username"/>
<el-input :placeholder="$t('appuser.inputUsernameTip')" @keyup.enter="getDataList" clearable
style="width: 240px" v-model="state.queryForm.username" />
</el-form-item>
<el-form-item :label="$t('appuser.phone')" prop="phone">
<el-input :placeholder="$t('appuser.inputPhoneTip')" @keyup.enter="getDataList" clearable
style="width: 240px" v-model="state.queryForm.phone"/>
style="width: 240px" v-model="state.queryForm.phone" />
</el-form-item>
<el-form-item>
<el-button @click="getDataList" icon="Search" type="primary">{{ $t('common.queryBtn') }}
@ -22,37 +21,35 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="userDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
v-auth="'sys_user_add'">
v-auth="'sys_user_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="excelUploadRef.show()" class="ml10" icon="upload-filled" type="primary"
v-auth="'sys_user_add'">
v-auth="'sys_user_add'">
{{ $t('common.importBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary"
v-auth="'sys_user_export'">
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary" v-auth="'sys_user_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary"
v-auth="'sys_user_del'">
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary" v-auth="'sys_user_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
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('appuser.index')" type="index" width="80"/>
<el-table-column :label="$t('appuser.username')" prop="username"
show-overflow-tooltip></el-table-column>
v-loading="state.loading">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="$t('appuser.index')" type="index" width="80" />
<el-table-column :label="$t('appuser.username')" prop="username" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('appuser.name')" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('appuser.phone')" prop="phone" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('appuser.role')" show-overflow-tooltip>
<template #default="scope">
<el-tag :key="index" type="success" v-for="(item, index) in scope.row.roleList">{{ item.roleName
}}
}}
</el-tag>
</template>
</el-table-column>
@ -62,16 +59,15 @@
</template>
</el-table-column>
<el-table-column :label="$t('appuser.createTime')" prop="createTime"
show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="userDialogRef.openDialog(scope.row.userId)" text type="primary"
v-auth="'sys_user_edit'"> {{
$t('common.editBtn')
v-auth="'sys_user_edit'"> {{
$t('common.editBtn')
}}
</el-button>
<el-button @click="handleDelete([scope.row.userId])" text type="primary"
v-auth="'sys_user_del'">
<el-button @click="handleDelete([scope.row.userId])" text type="primary" v-auth="'sys_user_del'">
{{ $t('common.delBtn') }}
</el-button>
</template>
@ -81,89 +77,89 @@
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination">
</pagination>
</el-card>
<user-form @refresh="getDataList()" ref="userDialogRef"/>
</div>
<user-form @refresh="getDataList()" ref="userDialogRef" />
<upload-excel :title="$t('appuser.importUserTip')" @refreshDataList="getDataList" ref="excelUploadRef"
temp-url="/admin/sys-file/local/file/user.xlsx" url="/admin/user/import"/>
temp-url="/admin/sys-file/local/file/user.xlsx" url="/admin/user/import" />
</div>
</template>
<script lang="ts" name="systemUser" setup>
import {delObj, fetchList} from '/@/api/app/appuser'
import {BasicTableProps, useTable} from '/@/hooks/table'
import {useDict} from '/@/hooks/dict'
import {useMessage, useMessageBox} from '/@/hooks/message'
import {useI18n} from 'vue-i18n'
import { delObj, fetchList } from '/@/api/app/appuser'
import { BasicTableProps, useTable } from '/@/hooks/table'
import { useDict } from '/@/hooks/dict'
import { useMessage, useMessageBox } from '/@/hooks/message'
import { useI18n } from 'vue-i18n'
//
const UserForm = defineAsyncComponent(() => import('./form.vue'));
//
const UserForm = defineAsyncComponent(() => import('./form.vue'));
const {lock_flag} = useDict('lock_flag')
const {t} = useI18n()
const { lock_flag } = useDict('lock_flag')
const { t } = useI18n()
//
const userDialogRef = ref();
const excelUploadRef = ref();
const queryRef = ref();
const showSearch = ref(true)
//
const userDialogRef = ref();
const excelUploadRef = ref();
const queryRef = ref();
const showSearch = ref(true)
// rows
const selectObjs = ref([]) as any;
//
const multiple = ref(true);
// rows
const selectObjs = ref([]) as any;
//
const multiple = ref(true);
// API
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
username: '',
phone: ''
},
pageList: fetchList,
descs: ['create_time']
// API
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
username: '',
phone: ''
},
pageList: fetchList,
descs: ['create_time']
});
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.userId)
});
multiple.value = !objs.length
}
// excel
const exportExcel = () => {
downBlobFile('/admin/appuser/export', state.queryForm, 'users.xlsx')
}
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.userId)
});
multiple.value = !objs.length
}
// excel
const exportExcel = () => {
downBlobFile('/admin/appuser/export', state.queryForm, 'users.xlsx')
}
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText')).then(() => {
//
delObj(ids).then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'))
}).catch(err => {
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 => {
useMessage().error(err.msg)
})
};
})
};
</script>

View File

@ -1,27 +1,27 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true">
<el-form-item :label="$t('job.jobName')" prop="jobName">
<el-input v-model="state.queryForm.jobName" :placeholder="$t('job.inputjobNameTip')" clearable
style="width: 240px" @keyup.enter="getDataList" />
style="width: 240px" @keyup.enter="getDataList" />
</el-form-item>
<el-form-item :label="$t('job.jobGroup')" prop="jobGroup">
<el-input v-model="state.queryForm.jobGroup" :placeholder="$t('job.inputjobGroupTip')" clearable
style="width: 240px" @keyup.enter="getDataList" />
style="width: 240px" @keyup.enter="getDataList" />
</el-form-item>
<el-form-item :label="t('job.jobStatus')" prop="jobStatus">
<el-select v-model="state.queryForm.jobStatus" :placeholder="t('job.inputjobStatusTip')">
<el-option v-for="(item, index) in job_status" :key="index" :label="item.label"
:value="item.value"></el-option>
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="t('job.jobExecuteStatus')" prop="jobExecuteStatus">
<el-select v-model="state.queryForm.jobExecuteStatus" :placeholder="t('job.inputjobExecuteStatusTip')">
<el-option v-for="(item, index) in job_execute_status" :key="index" :label="item.label"
:value="item.value"></el-option>
:value="item.value"></el-option>
</el-select>
</el-form-item>
@ -39,20 +39,19 @@
<el-button class="ml10" icon="Download" type="primary" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" class="ml10" icon="Delete" type="primary"
@click="handleDelete(undefined)">
<el-button :disabled="multiple" class="ml10" icon="Delete" type="primary" @click="handleDelete(undefined)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="50"/>
<el-table-column :label="t('job.index')" type="index" width="80" fixed="left"/>
<el-table-column :label="t('job.jobName')" prop="jobName" show-overflow-tooltip width="120" fixed="left"/>
<el-table-column :label="t('job.jobGroup')" prop="jobGroup" show-overflow-tooltip width="120"/>
@selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="t('job.index')" type="index" width="80" fixed="left" />
<el-table-column :label="t('job.jobName')" prop="jobName" show-overflow-tooltip width="120" fixed="left" />
<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>
@ -64,20 +63,20 @@
</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.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.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>
@ -92,38 +91,40 @@
<el-button size="small" text type="primary" @click="handleShutDownJob(scope.row)">暂停</el-button>
<el-button size="small" text type="primary" @click="handleEditJob(scope.row)">{{ $t('common.editBtn') }}</el-button>
<el-button size="small" text type="primary" @click="handleEditJob(scope.row)">{{ $t('common.editBtn')
}}</el-button>
<el-button size="small" text type="primary" @click="handleRunJob(scope.row)">执行</el-button>
<el-button size="small" text type="primary" @click="handleDelete(scope.row)">{{$t('common.delBtn') }}</el-button>
<el-button size="small" text type="primary" @click="handleDelete(scope.row)">{{ $t('common.delBtn')
}}</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
</el-card>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" />
</div>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList()"/>
<form-dialog ref="formDialogRef" @refresh="getDataList()" />
<job-log ref="jobLogRef"></job-log>
</div>
</template>
<script lang="ts" name="systemSysJob" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, fetchList, startJobRa, runJobRa, shutDownJobRa} 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, startJobRa, runJobRa, shutDownJobRa } 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 { t } = useI18n()
//
const {job_status, job_execute_status,misfire_policy,job_type} = useDict('job_status', 'job_execute_status','misfire_policy','job_type')
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()
@ -178,15 +179,15 @@ const handleEditJob = (row: any) => {
const jobStatus = row.jobStatus;
if (jobStatus === "1" || jobStatus === "3") {
formDialogRef.value.openDialog(row.jobId)
}else {
} else {
useMessage().error("运行中定时任务不可修改,请先暂停后操作")
}
}
const handleStartJob = (row: any) =>{
const handleStartJob = (row: any) => {
const jobStatus = row.jobStatus;
if (jobStatus === "1" || jobStatus === "3"){
if (jobStatus === "1" || jobStatus === "3") {
useMessageBox().confirm("即将发布或启动(任务名称:" + row.jobName + "), 是否继续?").then(() => {
startJobRa(row.jobId).then(() => {
getDataList();
@ -195,7 +196,7 @@ const handleStartJob = (row: any) =>{
useMessage().error(err.msg)
})
})
}else{
} else {
useMessage().error("定时任务已运行");
}
@ -212,7 +213,7 @@ const handleShutDownJob = (row: any) => {
useMessage().error(err.msg)
})
})
}else {
} else {
useMessage().error("已暂停,不要重复操作")
}
}
@ -239,14 +240,14 @@ const handleDelete = (row: any) => {
});
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)
})
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,6 +1,6 @@
<template>
<el-dialog v-model="visible" :close-on-click-modal="false" fullscreen title="运行日志" draggable>
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row>
<div class="mb8" style="width: 100%">
<el-button formDialogRef :disabled="multiple" icon="Delete" type="primary" class="ml10" v-auth="'sys_log_del'"
@ -38,7 +38,7 @@
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</el-card>
</div>
</el-dialog>
</template>
@ -111,6 +111,4 @@ defineExpose({
});
</script>
<style scoped>
</style>
<style scoped></style>

View File

@ -1,59 +0,0 @@
<template>
<div class="layout-padding">
<el-card shadow="hover">
<el-form ref="dataFormRef" :model="dataForm" label-width="100px">
<el-row :gutter="20">
<el-col :span="12" class="mb20">
<el-form-item label="用户名" prop="username">
<el-input v-model="dataForm.username" placeholder="请输入用户名"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="图片" prop="username">
<upload-img v-model="dataForm.image"></upload-img>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="文件" prop="username">
<upload-file v-model="dataForm.fileList"></upload-file>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="文件" prop="username">
<upload-file v-model="dataForm.fileList" type="simple"></upload-file>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="富文本" prop="text">
<editor v-model:get-html="dataForm.text"></editor>
</el-form-item>
</el-col>
</el-row>
</el-form>
{{dataForm}}
</el-card>
</div>
</template>
<script setup lang="ts" name="form-demo">
const dataForm = reactive({
username: '',
fileList: '',
image: '',
text: ''
})
onMounted(() => {
Object.assign(dataForm,{
"username": "123123",
"fileList": "/admin/sys-file/local/f3f2513c46e74448b33f8fbc54a079ec.pdf",
"image": "/admin/sys-file/local/b7d73a0fb7404ab9baf09a496291bec6.jpg"
})
})
</script>
<style scoped>
</style>

View File

@ -8,14 +8,13 @@
<div class="left-item-animation left-item-title">{{ $t('noAccess.accessTitle') }}</div>
<div class="left-item-animation left-item-msg">{{ $t('noAccess.accessMsg') }}</div>
<div class="left-item-animation left-item-btn">
<el-button type="primary" round @click="onSetAuth">{{ $t('noAccess.accessBtn') }}</el-button>
<el-button type="primary" round @click="onSetAuth">{{ $t('noAccess.accessBtn') }}</el-button>
</div>
</div>
</div>
<div class="right">
<img
src="https://img-blog.csdnimg.cn/3333f265772a4fa89287993500ecbf96.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAbHl0LXRvcA==,size_16,color_FFFFFF,t_70,g_se,x_16"
/>
src="https://img-blog.csdnimg.cn/3333f265772a4fa89287993500ecbf96.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAbHl0LXRvcA==,size_16,color_FFFFFF,t_70,g_se,x_16" />
</div>
</div>
</div>
@ -36,16 +35,19 @@ const onSetAuth = () => {
<style scoped lang="scss">
.error {
height: 100%;
.error-flex {
margin: auto;
display: flex;
height: 350px;
width: 900px;
.left {
flex: 1;
height: 100%;
align-items: center;
display: flex;
.left-item {
.left-item-animation {
opacity: 0;
@ -53,33 +55,39 @@ const onSetAuth = () => {
animation-duration: 0.5s;
animation-fill-mode: forwards;
}
.left-item-num {
color: var(--el-color-info);
font-size: 55px;
}
.left-item-title {
font-size: 20px;
color: var(--el-text-color-primary);
margin: 15px 0 5px 0;
animation-delay: 0.1s;
}
.left-item-msg {
color: var(--el-text-color-secondary);
font-size: 12px;
margin-bottom: 30px;
animation-delay: 0.2s;
}
.left-item-btn {
animation-delay: 0.2s;
}
}
}
.right {
flex: 1;
opacity: 0;
animation-name: error-img;
animation-duration: 2s;
animation-fill-mode: forwards;
img {
width: 100%;
height: 100%;

View File

@ -8,14 +8,13 @@
<div class="left-item-animation left-item-title">{{ $t('notFound.foundTitle') }}</div>
<div class="left-item-animation left-item-msg">{{ $t('notFound.foundMsg') }}</div>
<div class="left-item-animation left-item-btn">
<el-button type="primary" round @click="onGoHome">{{ $t('notFound.foundBtn') }}</el-button>
<el-button type="primary" round @click="onGoHome">{{ $t('notFound.foundBtn') }}</el-button>
</div>
</div>
</div>
<div class="right">
<img
src="https://img-blog.csdnimg.cn/9eb1d85a417f4ed1ba7107f149ce3da1.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAbHl0LXRvcA==,size_16,color_FFFFFF,t_70,g_se,x_16"
/>
src="https://img-blog.csdnimg.cn/9eb1d85a417f4ed1ba7107f149ce3da1.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAbHl0LXRvcA==,size_16,color_FFFFFF,t_70,g_se,x_16" />
</div>
</div>
</div>
@ -37,16 +36,19 @@ const onGoHome = () => {
<style scoped lang="scss">
.error {
height: 100%;
.error-flex {
margin: auto;
display: flex;
height: 350px;
width: 900px;
.left {
flex: 1;
height: 100%;
align-items: center;
display: flex;
.left-item {
.left-item-animation {
opacity: 0;
@ -54,33 +56,39 @@ const onGoHome = () => {
animation-duration: 0.5s;
animation-fill-mode: forwards;
}
.left-item-num {
color: var(--el-color-info);
font-size: 55px;
}
.left-item-title {
font-size: 20px;
color: var(--el-text-color-primary);
margin: 15px 0 5px 0;
animation-delay: 0.1s;
}
.left-item-msg {
color: var(--el-text-color-secondary);
font-size: 12px;
margin-bottom: 30px;
animation-delay: 0.2s;
}
.left-item-btn {
animation-delay: 0.2s;
}
}
}
.right {
flex: 1;
opacity: 0;
animation-name: error-img;
animation-duration: 2s;
animation-fill-mode: forwards;
img {
width: 100%;
height: 100%;

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('datasourceconf.dsName')" prop="dsName">
@ -59,7 +59,7 @@
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</el-card>
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef" />

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<v-form-designer ref="vfDesignerRef" :banned-widgets="bannedWidgets" :designer-config="designerConfig">
<template #customToolButtons>
<el-button link type="primary" @click="exportJsonConfig">
@ -8,7 +8,7 @@
</el-button>
</template>
</v-form-designer>
</el-card>
</div>
</div>
</template>

View File

@ -1,11 +1,11 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('fieldtype.columnType')" prop="columnType">
<el-input :placeholder="$t('fieldtype.inputcolumnTypeTip')" formDialogRef
style="max-width: 180px" v-model="state.queryForm.columnType"/>
<el-input :placeholder="$t('fieldtype.inputcolumnTypeTip')" formDialogRef style="max-width: 180px"
v-model="state.queryForm.columnType" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
@ -25,112 +25,111 @@
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(undefined)" class="ml10" icon="Delete"
type="primary">
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>
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('fieldtype.index')" type="index" width="80"/>
<el-table-column :label="t('fieldtype.columnType')" prop="columnType" show-overflow-tooltip/>
<el-table-column :label="t('fieldtype.attrType')" prop="attrType" show-overflow-tooltip/>
<el-table-column :label="t('fieldtype.packageName')" prop="packageName" show-overflow-tooltip/>
<el-table-column :label="t('fieldtype.createTime')" prop="createTime" show-overflow-tooltip/>
v-loading="state.loading">
<el-table-column align="center" type="selection" width="50" />
<el-table-column :label="t('fieldtype.index')" type="index" width="80" />
<el-table-column :label="t('fieldtype.columnType')" prop="columnType" show-overflow-tooltip />
<el-table-column :label="t('fieldtype.attrType')" prop="attrType" show-overflow-tooltip />
<el-table-column :label="t('fieldtype.packageName')" prop="packageName" show-overflow-tooltip />
<el-table-column :label="t('fieldtype.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">{{
$t('common.editBtn')
}}
}}
</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"/>
</el-card>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="systemFieldType" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, fetchList} from "/@/api/gen/fieldtype";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObj, fetchList } from "/@/api/gen/fieldtype";
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([])
const multiple = ref(true)
//
const formDialogRef = ref()
//
const queryRef = ref()
const showSearch = ref(true)
//
const selectObjs = ref([])
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
descs: ['create_time']
})
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
descs: ['create_time']
})
// 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
}
// excel
const exportExcel = () => {
downBlobFile('/gen/fieldtype/export', state.queryForm, 'fieldtype.xlsx')
}
//
const handleDelete = (row: any) => {
if (!row) {
selectObjs.value.forEach((val: any) => {
handleDelete(val)
});
return
}
//
const handleSelectionChange = (val: any) => {
selectObjs.value = val
multiple.value = !val.length
}
// excel
const exportExcel = () => {
downBlobFile('/gen/fieldtype/export', state.queryForm, 'fieldtype.xlsx')
}
//
const handleDelete = (row: any) => {
if (!row) {
selectObjs.value.forEach((val: any) => {
handleDelete(val)
});
return
}
useMessageBox().confirm(t('common.delConfirmText') + row.id)
.then(() => {
delObj(row.id).then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
useMessageBox().confirm(t('common.delConfirmText') + row.id)
.then(() => {
delObj(row.id).then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
};
})
};
</script>

View File

@ -1,11 +1,11 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<div class="layout-padding-auto layout-padding-view">
<el-steps :active="active" finish-status="success" simple style="margin-top: 20px">
<el-step title="基础信息" />
<el-step title="数据修改" />
</el-steps>
</el-card>
</div>
<el-card class="layout-padding-auto" style="margin-top: 20px" shadow="hover" v-if="active === 0">
<generator ref="generatorRef" :tableName="tableName" :dsName="dsName"></generator>
</el-card>

View File

@ -1,15 +1,15 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('group.id')" prop="id">
<el-input :placeholder="t('group.inputIdTip')" style="max-width: 180px"
v-model="state.queryForm.id"/>
v-model="state.queryForm.id" />
</el-form-item>
<el-form-item :label="$t('group.groupName')" prop="groupName">
<el-input :placeholder="t('group.inputGroupNameTip')" style="max-width: 180px"
v-model="state.queryForm.groupName"/>
v-model="state.queryForm.groupName" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
@ -23,117 +23,114 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" formDialogRef icon="folder-add"
type="primary"
v-auth="'codegen_group_add'">
type="primary" v-auth="'codegen_group_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" formDialogRef icon="Download" type="primary"
v-auth="'codegen_group_export'">
v-auth="'codegen_group_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef icon="Delete"
type="primary" v-auth="'codegen_group_del'">
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef
icon="Delete" type="primary" v-auth="'codegen_group_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
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('group.index')" type="index" width="80"/>
<el-table-column :label="t('group.groupName')" prop="groupName" show-overflow-tooltip/>
<el-table-column :label="t('group.groupDesc')" prop="groupDesc" show-overflow-tooltip/>
style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('group.index')" type="index" width="80" />
<el-table-column :label="t('group.groupName')" prop="groupName" show-overflow-tooltip />
<el-table-column :label="t('group.groupDesc')" prop="groupDesc" 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_group_edit'">{{ $t('common.editBtn') }}
v-auth="'codegen_group_edit'">{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary"
v-auth="'codegen_group_del'">{{
<el-button @click="handleDelete([scope.row.id])" text type="primary" v-auth="'codegen_group_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>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<form-dialog @refresh="getDataList()" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="systemGenGroup" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObjs, fetchList} from "/@/api/gen/group";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObjs, fetchList } from "/@/api/gen/group";
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,
sortChangeHandle,
downBlobFile
} = useTable(state)
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
//
const resetQuery = () => {
//
queryRef.value.resetFields()
//
selectObjs.value = []
getDataList()
}
queryRef.value.resetFields()
//
selectObjs.value = []
getDataList()
}
// excel
const exportExcel = () => {
downBlobFile('/codegen/group/export', state.queryForm, 'group.xlsx')
}
// excel
const exportExcel = () => {
downBlobFile('/codegen/group/export', state.queryForm, 'group.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

@ -46,7 +46,7 @@
<el-form-item label="代码风格" prop="style">
<el-select v-model="dataForm.style">
<el-option :key="index" :label="item.groupName" :value="item.id"
v-for="(item, index) in groupDataList"></el-option>
v-for="(item, index) in groupDataList"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -82,137 +82,137 @@
</template>
<script lang="ts" setup>
import {useI18n} from 'vue-i18n';
import {putObj, useTableApi} from '/@/api/gen/table'
import {useMessage} from '/@/hooks/message';
import {list as groupList} from '/@/api/gen/group'
import { useI18n } from 'vue-i18n';
import { putObj, useTableApi } from '/@/api/gen/table'
import { useMessage } from '/@/hooks/message';
import { list as groupList } from '/@/api/gen/group'
const props = defineProps({
tableName: {
type: String
},
dsName: {
type: String
}
})
const props = defineProps({
tableName: {
type: String
},
dsName: {
type: String
}
})
const emit = defineEmits(['refreshDataList'])
const {t} = useI18n()
const emit = defineEmits(['refreshDataList'])
const { t } = useI18n()
const visible = ref(false)
const loading = ref(false)
const dataFormRef = ref()
const dataForm = reactive({
id: '',
generatorType: 0,
formLayout: 1,
backendPath: '',
frontendPath: '',
packageName: '',
email: '',
author: '',
version: '',
moduleName: '',
functionName: '',
className: '',
tableComment: '',
tableName: '' as string,
dsName: '' as string,
style: '', // element-plus
})
const visible = ref(false)
const loading = ref(false)
const dataFormRef = ref()
const dataForm = reactive({
id: '',
generatorType: 0,
formLayout: 1,
backendPath: '',
frontendPath: '',
packageName: '',
email: '',
author: '',
version: '',
moduleName: '',
functionName: '',
className: '',
tableComment: '',
tableName: '' as string,
dsName: '' as string,
style: '', // element-plus
})
const groupDataList = ref([])
const groupDataList = ref([])
const openDialog = (dName: string, tName: string) => {
visible.value = true
dataForm.id = ''
dataForm.tableName = tName
dataForm.dsName = dName
const openDialog = (dName: string, tName: string) => {
visible.value = true
dataForm.id = ''
dataForm.tableName = tName
dataForm.dsName = dName
//
if (dataFormRef.value) {
dataFormRef.value.resetFields()
}
getTable(dName, tName)
//
if (dataFormRef.value) {
dataFormRef.value.resetFields()
}
const getTable = (dsName: string, tableName: string) => {
loading.value = true
useTableApi(dsName, tableName).then(res => {
Object.assign(dataForm, res.data)
let list = res.data.groupList
dataForm.style = list[0].id
getTable(dName, tName)
}
}).finally(() => {
loading.value = false
})
}
const getTable = (dsName: string, tableName: string) => {
loading.value = true
useTableApi(dsName, tableName).then(res => {
Object.assign(dataForm, res.data)
let list = res.data.groupList
dataForm.style = list[0].id
const dataRules = ref({
tableName: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
tableComment: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
className: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
packageName: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
author: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
moduleName: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
functionName: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
generatorType: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
formLayout: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
backendPath: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
frontendPath: [{required: true, message: '必填项不能为空', trigger: 'blur'}],
style: [{required: true, message: '必填项不能为空', trigger: 'blur'}]
}).finally(() => {
loading.value = false
})
}
//
const submitHandle = () => {
return new Promise((resolve, reject) => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
reject()
return false
}
loading.value = true
putObj(dataForm).then(() => {
visible.value = false
emit('refreshDataList')
useMessage().success(t('common.optSuccessText'))
resolve(dataForm)
}).finally(() => {
loading.value = false
})
const dataRules = ref({
tableName: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
tableComment: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
className: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
packageName: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
author: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
moduleName: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
functionName: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
generatorType: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
formLayout: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
backendPath: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
frontendPath: [{ required: true, message: '必填项不能为空', trigger: 'blur' }],
style: [{ required: true, message: '必填项不能为空', trigger: 'blur' }]
})
//
const submitHandle = () => {
return new Promise((resolve, reject) => {
dataFormRef.value.validate((valid: boolean) => {
if (!valid) {
reject()
return false
}
loading.value = true
putObj(dataForm).then(() => {
visible.value = false
emit('refreshDataList')
useMessage().success(t('common.optSuccessText'))
resolve(dataForm)
}).finally(() => {
loading.value = false
})
})
}
const genGroupList = () => {
groupList().then(res => {
groupDataList.value = res.data
})
}
onMounted(() => {
//
if (dataFormRef.value) {
dataFormRef.value.resetFields()
}
dataForm.id = ''
dataForm.tableName = String(props.tableName)
dataForm.dsName = String(props.dsName)
getTable(dataForm.dsName, dataForm.tableName)
genGroupList()
})
}
defineExpose({
openDialog,
submitHandle
const genGroupList = () => {
groupList().then(res => {
groupDataList.value = res.data
})
}
onMounted(() => {
//
if (dataFormRef.value) {
dataFormRef.value.resetFields()
}
dataForm.id = ''
dataForm.tableName = String(props.tableName)
dataForm.dsName = String(props.dsName)
getTable(dataForm.dsName, dataForm.tableName)
genGroupList()
})
defineExpose({
openDialog,
submitHandle
})
</script>
<style lang="scss" scoped>
.generator-code .el-dialog__body {
padding: 15px 30px 0 20px;
}
.generator-code .el-dialog__body {
padding: 15px 30px 0 20px;
}
</style>

View File

@ -1,11 +1,11 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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="数据源" prop="name">
<el-select @change="getDataList" placeholder="请选择数据源" style="width: 100%"
v-model="state.queryForm.dsName">
v-model="state.queryForm.dsName">
<el-option label="默认数据源" value="master"></el-option>
<el-option :key="ds.id" :label="ds.name" :value="ds.name" v-for="ds in datasourceList">
</el-option>
@ -13,7 +13,7 @@
</el-form-item>
<el-form-item :label="$t('table.tableName')" prop="tableName">
<el-input :placeholder="$t('table.inputtableNameTip')" style="max-width: 180px"
v-model="state.queryForm.tableName"/>
v-model="state.queryForm.tableName" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" icon="search" type="primary">
@ -29,121 +29,119 @@
{{ $t('common.exportBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" style="width: 100%" v-loading="state.loading">
<el-table-column :label="t('table.index')" type="index" width="80"/>
<el-table-column :label="t('table.tableName')" prop="tableName" show-overflow-tooltip/>
<el-table-column :label="t('table.tableDesc')" prop="tableComment" show-overflow-tooltip/>
<el-table-column :label="t('table.createTime')" prop="createTime" show-overflow-tooltip/>
<el-table-column :label="t('table.index')" type="index" width="80" />
<el-table-column :label="t('table.tableName')" prop="tableName" show-overflow-tooltip />
<el-table-column :label="t('table.tableDesc')" prop="tableComment" show-overflow-tooltip />
<el-table-column :label="t('table.createTime')" prop="createTime" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button @click="syncTable(state.queryForm.dsName, scope.row.tableName)" text type="primary">
{{
$t('gen.syncBtn')
$t('gen.syncBtn')
}}
</el-button>
<el-button @click="openGen(scope.row)" text type="primary">{{
$t('gen.genBtn')
}}
}}
</el-button>
<el-button @click="openDesign(scope.row)" text type="primary">{{
$t('gen.designBtn')
}}
}}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</el-card>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
</div>
</template>
<script lang="ts" name="systemTable" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {fetchList, useSyncTableApi} from "/@/api/gen/table";
import {list} from '/@/api/gen/datasource'
import {useMessage} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import {useRouter} from 'vue-router';
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, useSyncTableApi } from "/@/api/gen/table";
import { list } from '/@/api/gen/datasource'
import { useMessage } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
import { useRouter } from 'vue-router';
//
const router = useRouter();
//
const router = useRouter();
//
const {t} = useI18n()
//
const { t } = useI18n()
//
const queryRef = ref()
const showSearch = ref(true)
//
const datasourceList = ref()
//
const queryRef = ref()
const showSearch = ref(true)
//
const datasourceList = ref()
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
dsName: 'master'
},
pageList: fetchList,
createdIsNeed: false,
descs: ['create_time']
})
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
dsName: 'master'
},
pageList: fetchList,
createdIsNeed: false,
descs: ['create_time']
})
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
downBlobFile
} = useTable(state)
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
downBlobFile
} = useTable(state)
//
onMounted(() => {
list().then(res => {
datasourceList.value = res.data
//
state.queryForm.dsName = datasourceList.value[0].name
getDataList()
})
})
const openGen = (row) => {
router.push({
path: '/gen/gener/index',
query: {
tableName: row.tableName,
dsName: state.queryForm.dsName
}
})
}
const openDesign = (row) => {
router.push({
path: '/gen/design/index',
query: {
tableName: row.tableName,
dsName: state.queryForm.dsName
}
})
}
//
const syncTable = (dsName: string, tableName: string) => {
useSyncTableApi(dsName, tableName).then(() => {
useMessage().success(t('common.optSuccessText'));
})
}
//
const resetQuery = () => {
queryRef.value.resetFields()
//
onMounted(() => {
list().then(res => {
datasourceList.value = res.data
//
state.queryForm.dsName = datasourceList.value[0].name
getDataList()
}
})
})
// excel
const exportExcel = () => {
downBlobFile('/gen/table/export', state.queryForm, 'table.xlsx')
}
const openGen = (row) => {
router.push({
path: '/gen/gener/index',
query: {
tableName: row.tableName,
dsName: state.queryForm.dsName
}
})
}
const openDesign = (row) => {
router.push({
path: '/gen/design/index',
query: {
tableName: row.tableName,
dsName: state.queryForm.dsName
}
})
}
//
const syncTable = (dsName: string, tableName: string) => {
useSyncTableApi(dsName, tableName).then(() => {
useMessage().success(t('common.optSuccessText'));
})
}
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
// excel
const exportExcel = () => {
downBlobFile('/gen/table/export', state.queryForm, 'table.xlsx')
}
</script>

View File

@ -14,7 +14,7 @@
<el-tab-pane v-for="item in previewCodegen"
:label="item.codePath.substring(item.codePath.lastIndexOf('/') + 1)" :name="item.codePath"
:key="item.codePath">
<highlightjs autodetect :code="item.code" />
<highlightjs autodetect :code="item.code" />
</el-tab-pane>
</el-tabs>
</el-col>
@ -57,7 +57,7 @@ const getGenCodeFile = (id: string) => {
const files = handleFiles(fileTreeOriginal)
preview.fileTree = handleTree(files, 'id', 'parentId', 'children', '/')
}).finally(() => {
loading.value = false
loading.value = false
})
}

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" ref="queryRef" @keyup.enter="getDataList">
<el-form-item :label="$t('template.id')" prop="id">
@ -22,16 +22,16 @@
</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'">
<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'">
<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"
@ -59,7 +59,7 @@
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</el-card>
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef" />

View File

@ -1,40 +1,33 @@
<template>
<div class="home-container layout-pd">
<el-row :gutter="15" class="home-card-three">
<el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8">
<div class="home-card-item">
<div class="home-card-item-title">快捷导航工具</div>
<div class="home-monitor">
<div class="flex-warp">
<div class="flex-warp-item" v-for="(v, k) in favoriteRoutes" :key="k">
<div class="flex-warp-item-box">
<div class="flex-margin">
<i :class="v.meta.icon"></i>
<el-tag :key="v.path" @click="HandleRoute(v)" class="mx-1" closable :type="v.path" @close="handleCloseFavorite(v)">{{ $t(v.name) }}</el-tag>
</div>
</div>
</div>
</div>
</div>
</div>
</el-col>
<el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16" class="home-media">
<div class="home-card-item">
<div style="height: 100%" ref="homeBarRef"></div>
</div>
</el-col>
</el-row>
<el-row :gutter="15" class="home-card-three">
<el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8">
<div class="home-card-item">
<div class="home-card-item-title">快捷导航工具</div>
<div class="home-monitor">
<div class="flex-warp">
<div class="flex-warp-item" v-for="(v, k) in favoriteRoutes" :key="k">
<div class="flex-warp-item-box">
<div class="flex-margin">
<i :class="v.meta.icon"></i>
<el-tag :key="v.path" @click="HandleRoute(v)" class="mx-1" closable :type="v.path"
@close="handleCloseFavorite(v)">{{ $t(v.name) }}</el-tag>
</div>
</div>
</div>
</div>
</div>
</div>
</el-col>
<el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16" class="home-media">
<div class="home-card-item">
<div style="height: 100%" ref="homeBarRef"></div>
</div>
</el-col>
</el-row>
<el-row :gutter="15" class="home-card-one mb15">
<el-col
:xs="24"
:sm="12"
:md="12"
:lg="6"
:xl="6"
v-for="(v, k) in state.homeOne"
:key="k"
:class="{ 'home-media home-media-lg': k > 1, 'home-media-sm': k === 1 }"
>
<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-for="(v, k) in state.homeOne" :key="k"
:class="{ 'home-media home-media-lg': k > 1, 'home-media-sm': k === 1 }">
<div class="home-card-item flex">
<div class="flex-margin flex w100" :class="` home-one-animation${k}`">
<div class="flex-auto">
@ -79,7 +72,7 @@ const homeBarRef = ref();
const storesTagsViewRoutes = useTagsViewRoutes();
const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);
const { isTagsViewCurrenFull,favoriteRoutes } = storeToRefs(storesTagsViewRoutes);
const { isTagsViewCurrenFull, favoriteRoutes } = storeToRefs(storesTagsViewRoutes);
const state = reactive({
global: {
homeChartOne: null,
@ -134,11 +127,11 @@ const state = reactive({
});
const HandleRoute = (item: any) => {
router.push(item.path)
router.push(item.path)
}
const handleCloseFavorite = (item: any) => {
storesTagsViewRoutes.delFavoriteRoutes(item)
storesTagsViewRoutes.delFavoriteRoutes(item)
}
@ -497,8 +490,10 @@ watch(
<style scoped lang="scss">
$homeNavLengh: 8;
.home-container {
overflow: hidden;
.home-card-one,
.home-card-two,
.home-card-three {
@ -512,19 +507,23 @@ $homeNavLengh: 8;
background: var(--el-color-white);
color: var(--el-text-color-primary);
border: 1px solid var(--next-border-color-light);
&:hover {
box-shadow: 0 2px 12px var(--next-color-dark-hover);
transition: all ease 0.3s;
}
&-icon {
width: 70px;
height: 70px;
border-radius: 100%;
flex-shrink: 1;
i {
color: var(--el-text-color-placeholder);
}
}
&-title {
font-size: 15px;
font-weight: bold;
@ -532,6 +531,7 @@ $homeNavLengh: 8;
}
}
}
.home-card-one {
@for $i from 0 through 3 {
.home-one-animation#{$i} {
@ -543,18 +543,22 @@ $homeNavLengh: 8;
}
}
}
.home-card-two,
.home-card-three {
.home-card-item {
height: 400px;
width: 100%;
overflow: hidden;
.home-monitor {
height: 100%;
.flex-warp-item {
width: 25%;
height: 56px;
display: flex;
.flex-warp-item-box {
margin: auto;
text-align: center;
@ -564,11 +568,13 @@ $homeNavLengh: 8;
background: var(--next-bg-color);
cursor: pointer;
transition: all 0.3s ease;
&:hover {
background: var(--el-color-primary-light-9);
transition: all 0.3s ease;
}
}
@for $i from 0 through $homeNavLengh {
.home-animation#{$i} {
opacity: 0;

View File

@ -1,15 +1,15 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-form-item :label="$t('fans.nickname')" prop="nickname">
<el-input v-model="state.queryForm.nickname"
style="max-width: 180px"/>
<el-input v-model="state.queryForm.nickname" style="max-width: 180px" />
</el-form-item>
<el-form-item :label="$t('fans.wxAccountName')" prop="wxAccountAppid">
<el-select v-model="state.queryForm.wxAccountAppid" :placeholder="$t('fans.wxAccountName')" clearable class="w100">
<el-option v-for="item in accountList" :key="item.appid" :label="item.name" :value="item.appid"/>
<el-select v-model="state.queryForm.wxAccountAppid" :placeholder="$t('fans.wxAccountName')" clearable
class="w100">
<el-option v-for="item in accountList" :key="item.appid" :label="item.name" :value="item.appid" />
</el-select>
</el-form-item>
<el-form-item class="ml2">
@ -24,27 +24,27 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button v-auth="'mp_fans_export'" class="ml10" formDialogRef icon="Download" type="primary"
@click="exportExcel">
@click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%"
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('fans.index')" type="index" width="80"/>
<el-table-column :label="t('fans.id')" prop="id" show-overflow-tooltip/>
<el-table-column :label="t('fans.openid')" prop="openid" show-overflow-tooltip/>
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('fans.index')" type="index" width="80" />
<el-table-column :label="t('fans.id')" prop="id" show-overflow-tooltip />
<el-table-column :label="t('fans.openid')" prop="openid" show-overflow-tooltip />
<el-table-column :label="t('fans.subscribeStatus')" prop="subscribeStatus" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="subscribe" :value="scope.row.subscribeStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('fans.subscribeTime')" prop="subscribeTime" show-overflow-tooltip/>
<el-table-column :label="t('fans.nickname')" prop="nickname" show-overflow-tooltip/>
<el-table-column :label="t('fans.language')" prop="language" show-overflow-tooltip/>
<el-table-column :label="t('fans.subscribeTime')" prop="subscribeTime" show-overflow-tooltip />
<el-table-column :label="t('fans.nickname')" prop="nickname" show-overflow-tooltip />
<el-table-column :label="t('fans.language')" prop="language" show-overflow-tooltip />
<el-table-column :label="t('fans.tagIds')" prop="tagIds" show-overflow-tooltip width="200">
<template #default="scope">
<span v-for="(tag, index) in scope.row.tagList" :key="index">
@ -52,40 +52,40 @@
</span>
</template>
</el-table-column>
<el-table-column :label="t('fans.remark')" prop="remark" show-overflow-tooltip/>
<el-table-column :label="t('fans.wxAccountName')" prop="wxAccountName" show-overflow-tooltip/>
<el-table-column :label="t('fans.remark')" prop="remark" show-overflow-tooltip />
<el-table-column :label="t('fans.wxAccountName')" prop="wxAccountName" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button text type="primary"
@click="formDialogRef.openDialog(scope.row,state.queryForm.wxAccountAppid)">{{ $t('common.editBtn') }}
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row, state.queryForm.wxAccountAppid)">{{
$t('common.editBtn') }}
</el-button>
<el-button text type="primary" @click="handleDelete([scope.row.id])">{{
$t('common.delBtn')
}}
$t('common.delBtn')
}}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" />
<form-dialog ref="formDialogRef" @refresh="getDataList"></form-dialog>
</el-card>
</div>
</div>
</template>
<script lang="ts" name="systemWxAccountFans" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObjs, fetchList, sync} from "/@/api/mp/wx-account-fans";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObjs, fetchList, sync } from "/@/api/mp/wx-account-fans";
import { fetchAccountList } from '/@/api/mp/wx-account'
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import {useDict} from "/@/hooks/dict";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
import { useDict } from "/@/hooks/dict";
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const { subscribe } = useDict('subscribe')
//
const {t} = useI18n()
const { t } = useI18n()
//
//
@ -117,24 +117,24 @@ const accountList = ref([])
const getAccountList = () => {
fetchAccountList().then(res => {
accountList.value = res.data
if(accountList.value.length > 0){
if (accountList.value.length > 0) {
state.queryForm.wxAccountAppid = accountList.value[0].appid
getDataList()
}
})
}
watch(() => state.queryForm.wxAccountAppid,() => {
watch(() => state.queryForm.wxAccountAppid, () => {
getDataList()
})
const asyncFans = () => {
if(state.queryForm.wxAccountAppid){
if (state.queryForm.wxAccountAppid) {
sync(state.queryForm.wxAccountAppid).then(() => {
useMessage().success("已开始从微信同步粉丝信息,建议等待后查询")
getDataList()
})
}else{
} else {
useMessage().error("请选择公众号")
}
}
@ -169,13 +169,13 @@ const handleSelectionChange = (objs: any) => {
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
</script>

View File

@ -1,15 +1,16 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-form-item :label="$t('wxAccountTag.tag')" prop="tag">
<el-input v-model="state.queryForm.tag" :placeholder="t('wxAccountTag.inputTagTip')"
style="max-width: 180px"/>
style="max-width: 180px" />
</el-form-item>
<el-form-item :label="$t('wxAccountTag.wxAccountAppid')" prop="wxAccountAppid">
<el-select v-model="state.queryForm.wxAccountAppid" :placeholder="t('wxAccountTag.inputWxAccountAppidTip')" clearable class="w100">
<el-option v-for="item in accountList" :key="item.appid" :label="item.name" :value="item.appid"/>
<el-select v-model="state.queryForm.wxAccountAppid" :placeholder="t('wxAccountTag.inputWxAccountAppidTip')"
clearable class="w100">
<el-option v-for="item in accountList" :key="item.appid" :label="item.name" :value="item.appid" />
</el-select>
</el-form-item>
<el-form-item class="ml2">
@ -23,55 +24,56 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button v-auth="'mp_wx_account_tag_add'" class="ml10" formDialogRef icon="folder-add" type="primary"
@click="formDialogRef.openDialog(null,state.queryForm.wxAccountAppid)">
@click="formDialogRef.openDialog(null, state.queryForm.wxAccountAppid)">
{{ $t('common.addBtn') }}
</el-button>
<el-button v-auth="'mp_wx_account_tag_export'" class="ml10" formDialogRef icon="Download" type="primary"
@click="exportExcel">
@click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button v-auth="'mp_wx_account_tag_del'" :disabled="multiple" class="ml10" formDialogRef icon="Delete"
type="primary" @click="handleDelete(selectObjs)">
type="primary" @click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%"
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('wxAccountTag.index')" type="index" width="80"/>
<el-table-column :label="t('wxAccountTag.tag')" prop="tag" show-overflow-tooltip/>
<el-table-column :label="t('wxAccountTag.wxAccountId')" prop="wxAccountId" show-overflow-tooltip/>
<el-table-column :label="t('wxAccountTag.wxAccountName')" prop="wxAccountName" show-overflow-tooltip/>
<el-table-column :label="t('wxAccountTag.wxAccountAppid')" prop="wxAccountAppid" show-overflow-tooltip/>
<el-table-column :label="t('wxAccountTag.tagId')" prop="tagId" show-overflow-tooltip/>
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('wxAccountTag.index')" type="index" width="80" />
<el-table-column :label="t('wxAccountTag.tag')" prop="tag" show-overflow-tooltip />
<el-table-column :label="t('wxAccountTag.wxAccountId')" prop="wxAccountId" show-overflow-tooltip />
<el-table-column :label="t('wxAccountTag.wxAccountName')" prop="wxAccountName" show-overflow-tooltip />
<el-table-column :label="t('wxAccountTag.wxAccountAppid')" prop="wxAccountAppid" show-overflow-tooltip />
<el-table-column :label="t('wxAccountTag.tagId')" prop="tagId" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row,state.queryForm.wxAccountAppid)">{{ $t('common.editBtn') }}</el-button>
<el-button text type="primary" @click="handleDelete(scope.row)">{{$t('common.delBtn') }}</el-button>
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row, state.queryForm.wxAccountAppid)">{{
$t('common.editBtn') }}</el-button>
<el-button text type="primary" @click="handleDelete(scope.row)">{{ $t('common.delBtn') }}</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
</el-card>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" />
</div>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)"/>
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
</div>
</template>
<script lang="ts" name="systemWxAccountTag" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObjs, getPage} from "/@/api/mp/wx-account-tag";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import {fetchAccountList} from "/@/api/mp/wx-account";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObjs, getPage } from "/@/api/mp/wx-account-tag";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
import { fetchAccountList } from "/@/api/mp/wx-account";
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const {t} = useI18n()
const { t } = useI18n()
//
//
@ -94,7 +96,7 @@ const accountList = ref([])
const getAccountList = () => {
fetchAccountList().then(res => {
accountList.value = res.data
if(accountList.value.length > 0){
if (accountList.value.length > 0) {
state.queryForm.wxAccountAppid = accountList.value[0].appid
getDataList()
}
@ -105,7 +107,7 @@ onMounted(() => {
getAccountList()
})
watch(() => state.queryForm.wxAccountAppid,() => {
watch(() => state.queryForm.wxAccountAppid, () => {
getDataList()
})
@ -143,16 +145,16 @@ const handleSelectionChange = (objs: any) => {
//
const handleDelete = (row: any) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObjs({
id: row.id,
wxAccountAppid: row.wxAccountAppid
}).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
.then(() => {
delObjs({
id: row.id,
wxAccountAppid: row.wxAccountAppid
}).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
</script>

View File

@ -1,15 +1,14 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form ref="queryRef" :inline="true" :model="state.queryForm">
<el-form-item :label="$t('account.name')" prop="name">
<el-input v-model="state.queryForm.name" :placeholder="t('account.inputNameTip')"
style="max-width: 180px"/>
<el-input v-model="state.queryForm.name" :placeholder="t('account.inputNameTip')" style="max-width: 180px" />
</el-form-item>
<el-form-item :label="$t('account.account')" prop="account">
<el-input v-model="state.queryForm.account" :placeholder="t('account.inputAccountTip')"
style="max-width: 180px"/>
style="max-width: 180px" />
</el-form-item>
<el-form-item class="ml2">
<el-button formDialogRef icon="search" type="primary" @click="getDataList">
@ -22,32 +21,32 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button v-auth="'mp_wxaccount_add'" class="ml10" formDialogRef icon="folder-add" type="primary"
@click="formDialogRef.openDialog()">
@click="formDialogRef.openDialog()">
{{ $t('common.addBtn') }}
</el-button>
<el-button v-auth="'mp_wxaccount_export'" class="ml10" formDialogRef icon="Download" type="primary"
@click="exportExcel">
@click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button v-auth="'mp_wxaccount_del'" :disabled="multiple" class="ml10" formDialogRef icon="Delete"
type="primary" @click="handleDelete(selectObjs)">
type="primary" @click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%"
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('account.index')" type="index" width="80"/>
<el-table-column :label="t('account.name')" prop="name" show-overflow-tooltip/>
<el-table-column :label="t('account.account')" prop="account" show-overflow-tooltip/>
<el-table-column :label="t('account.appid')" prop="appid" show-overflow-tooltip/>
<el-table-column :label="t('account.appsecret')" prop="appsecret" show-overflow-tooltip/>
<el-table-column :label="t('account.url')" prop="url" show-overflow-tooltip/>
<el-table-column :label="t('account.token')" prop="token" show-overflow-tooltip/>
<el-table-column :label="t('account.aeskey')" prop="aeskey" show-overflow-tooltip/>
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('account.index')" type="index" width="80" />
<el-table-column :label="t('account.name')" prop="name" show-overflow-tooltip />
<el-table-column :label="t('account.account')" prop="account" show-overflow-tooltip />
<el-table-column :label="t('account.appid')" prop="appid" show-overflow-tooltip />
<el-table-column :label="t('account.appsecret')" prop="appsecret" show-overflow-tooltip />
<el-table-column :label="t('account.url')" prop="url" show-overflow-tooltip />
<el-table-column :label="t('account.token')" prop="token" show-overflow-tooltip />
<el-table-column :label="t('account.aeskey')" prop="aeskey" show-overflow-tooltip />
<el-table-column :label="t('account.qrUrl')" prop="qrUrl" show-overflow-tooltip>
<template #default="scope">
<a target="_blank" :href="scope.row.qrUrl"><img :src="scope.row.qrUrl" style="width: 100px"></a>
@ -55,41 +54,43 @@
</el-table-column>
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button v-auth="'mp_wxaccount_edit'" text type="primary" @click="formDialogRef.openDialog(scope.row.id)">{{ $t('common.editBtn') }}</el-button>
<el-button v-auth="'mp_wxaccount_del'" text type="primary" @click="handleDelete([scope.row.id])">{{$t('common.delBtn') }}</el-button>
<el-button text type="primary" @click="access(scope.row,scope.index)">接入</el-button>
<el-button text type="primary" @click="generate(scope.row,scope.index)">二维码</el-button>
<el-button text type="primary" @click="quota(scope.row,scope.index)">quota</el-button>
<el-button v-auth="'mp_wxaccount_edit'" text type="primary" @click="formDialogRef.openDialog(scope.row.id)">{{
$t('common.editBtn') }}</el-button>
<el-button v-auth="'mp_wxaccount_del'" text type="primary" @click="handleDelete([scope.row.id])">{{
$t('common.delBtn') }}</el-button>
<el-button text type="primary" @click="access(scope.row, scope.index)">接入</el-button>
<el-button text type="primary" @click="generate(scope.row, scope.index)">二维码</el-button>
<el-button text type="primary" @click="quota(scope.row, scope.index)">quota</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
</el-card>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" />
</div>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)"/>
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<el-dialog v-model="dialogFormVisible" title="接入">
<el-input v-model="wxurl" readonly>
<template #append>
<el-button @click="copyText(wxurl)">复制链接</el-button>
</template>
</el-input>
<el-input v-model="wxurl" readonly>
<template #append>
<el-button @click="copyText(wxurl)">复制链接</el-button>
</template>
</el-input>
</el-dialog>
</div>
</template>
<script lang="ts" name="systemWxAccount" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {clearQuota, delObjs, fetchList, generateQr} from "/@/api/mp/wx-account";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { clearQuota, delObjs, fetchList, generateQr } from "/@/api/mp/wx-account";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
import commonFunction from '/@/utils/commonFunction';
const { copyText } = commonFunction();
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const {t} = useI18n()
const { t } = useI18n()
//
//
@ -140,21 +141,21 @@ const handleSelectionChange = (objs: any) => {
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
const dialogFormVisible = ref(false)
const wxurl = ref("")
const access = (row: any) => {
dialogFormVisible.value = true
wxurl.value = row.url + '/mp/' + row.appid + '/portal'
dialogFormVisible.value = true
wxurl.value = row.url + '/mp/' + row.appid + '/portal'
}
const generate = (row: any) => {

View File

@ -3,126 +3,113 @@
<el-row :gutter="20">
<el-col :span="4" :xs="24">
<el-card class="layout-padding-auto" shadow="hover">
<query-tree :query="deptData.queryList"
@node-click="handleNodeClick"/>
<query-tree :query="deptData.queryList" @node-click="handleNodeClick" />
</el-card>
</el-col>
<el-col :md="20">
<el-card class="layout-padding-auto" shadow="hover">
<div class="layout-padding-auto layout-padding-view">
<el-tabs v-model="type" @tab-click="handleClick">
<el-tab-pane name="1" label="1">
<template #label>关注时回复</template>
<el-row>
<div class="mb8" style="width: 100%">
<el-button class="ml10" icon="folder-add" type="primary" @click="handleAdd">
{{ $t('common.addBtn') }}
</el-button>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%" @sort-change="sortChangeHandle">
<el-table-column label="序号" type="index" width="80"/>
<el-table-column label="回复消息类型" prop="repType" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicDataRepType" :value="scope.row.repType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="操作" prop="action" show-overflow-tooltip>
<template #default="scope">
<el-button
link
icon="el-icon-edit"
@click="handleEdit(scope.row)">编辑
<el-tab-pane name="1" label="1">
<template #label>关注时回复</template>
<el-row>
<div class="mb8" style="width: 100%">
<el-button class="ml10" icon="folder-add" type="primary" @click="handleAdd">
{{ $t('common.addBtn') }}
</el-button>
<el-button
link
icon="el-icon-delete"
@click="handleDel(scope.row)">删除
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%"
@sort-change="sortChangeHandle">
<el-table-column label="序号" type="index" width="80" />
<el-table-column label="回复消息类型" prop="repType" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicDataRepType" :value="scope.row.repType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="操作" prop="action" show-overflow-tooltip>
<template #default="scope">
<el-button link icon="el-icon-edit" @click="handleEdit(scope.row)">编辑
</el-button>
<el-button link icon="el-icon-delete" @click="handleDel(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" />
</el-tab-pane>
<el-tab-pane name="2" label="2">
<template #label>消息回复</template>
<el-row>
<div class="mb8" style="width: 100%">
<el-button class="ml10" icon="folder-add" type="primary" @click="handleAdd">
{{ $t('common.addBtn') }}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
</el-tab-pane>
<el-tab-pane name="2" label="2">
<template #label>消息回复</template>
<el-row>
<div class="mb8" style="width: 100%">
<el-button class="ml10" icon="folder-add" type="primary" @click="handleAdd">
{{ $t('common.addBtn') }}
</el-button>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%" @sort-change="sortChangeHandle">
<el-table-column label="序号" type="index" width="80"/>
<el-table-column label="请求消息类型" prop="reqType" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicDataReqType" :value="scope.row.reqType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="回复消息类型" prop="repType" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicDataRepType" :value="scope.row.repType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="操作" prop="action" show-overflow-tooltip>
<template #default="scope">
<el-button
icon="el-icon-edit"
link
@click="handleEdit(scope.row)">编辑
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%"
@sort-change="sortChangeHandle">
<el-table-column label="序号" type="index" width="80" />
<el-table-column label="请求消息类型" prop="reqType" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicDataReqType" :value="scope.row.reqType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="回复消息类型" prop="repType" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicDataRepType" :value="scope.row.repType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="操作" prop="action" show-overflow-tooltip>
<template #default="scope">
<el-button icon="el-icon-edit" link @click="handleEdit(scope.row)">编辑
</el-button>
<el-button icon="el-icon-delete" link @click="handleDel(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" />
</el-tab-pane>
<el-tab-pane name="3" label="3">
<template #label>关键词回复</template>
<el-row>
<div class="mb8" style="width: 100%">
<el-button class="ml10" icon="folder-add" type="primary" @click="handleAdd">
{{ $t('common.addBtn') }}
</el-button>
<el-button
icon="el-icon-delete"
link
@click="handleDel(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
</el-tab-pane>
<el-tab-pane name="3" label="3">
<template #label>关键词回复</template>
<el-row>
<div class="mb8" style="width: 100%">
<el-button class="ml10" icon="folder-add" type="primary" @click="handleAdd">
{{ $t('common.addBtn') }}
</el-button>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%" @sort-change="sortChangeHandle">
<el-table-column label="序号" type="index" width="80"/>
<el-table-column label="关键词" prop="reqKey" show-overflow-tooltip>
</el-table-column>
<el-table-column label="匹配类型" prop="repMate" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicRepMate" :value="scope.row.repMate"></dict-tag>
</template>
</el-table-column>
<el-table-column label="匹配类型" prop="repMate" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicDataRepType" :value="scope.row.repType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="操作" prop="action" show-overflow-tooltip>
<template #default="scope">
<el-button
icon="el-icon-edit"
link
@click="handleEdit(scope.row)">编辑
</el-button>
<el-button
icon="el-icon-delete"
link
@click="handleDel(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%"
@sort-change="sortChangeHandle">
<el-table-column label="序号" type="index" width="80" />
<el-table-column label="关键词" prop="reqKey" show-overflow-tooltip>
</el-table-column>
<el-table-column label="匹配类型" prop="repMate" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicRepMate" :value="scope.row.repMate"></dict-tag>
</template>
</el-table-column>
<el-table-column label="匹配类型" prop="repMate" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dicDataRepType" :value="scope.row.repType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="操作" prop="action" show-overflow-tooltip>
<template #default="scope">
<el-button icon="el-icon-edit" link @click="handleEdit(scope.row)">编辑
</el-button>
<el-button icon="el-icon-delete" link @click="handleDel(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" />
</el-tab-pane>
</el-tabs>
</div>
</el-col>
</el-row>
<el-dialog :title="handleType === 'add' ? '新增回复消息' : '修改回复消息'" v-model="dialog1Visible" width="50%">
@ -130,12 +117,8 @@
<el-form-item v-if="type === '2'" label="请求消息类型">
<el-select v-model="objData.reqType" placeholder="请选择">
<template v-for="item in dicDataReqType">
<el-option
v-if="item.value !== 'event'"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled">
<el-option v-if="item.value !== 'event'" :key="item.value" :label="item.label" :value="item.value"
:disabled="item.disabled">
</el-option>
</template>
@ -143,11 +126,7 @@
</el-form-item>
<el-form-item v-if="type === '3'" label="匹配类型">
<el-select v-model="objData.repMate" placeholder="请选择" style="width: 100px">
<el-option
v-for="item in dicRepMate"
:key="item.value"
:label="item.label"
:value="item.value">
<el-option v-for="item in dicRepMate" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
@ -158,7 +137,7 @@
<WxReply v-if="hackResetWxReplySelect" :obj-data="objData"></WxReply>
</el-form-item>
</el-form>
<template #footer >
<template #footer>
<el-button @click="dialog1Visible = false"> </el-button>
<el-button type="primary" @click="handleSubmit"> </el-button>
</template>
@ -168,10 +147,10 @@
<script setup lang="ts" name="wx-auto-reply">
import {fetchAccountList} from "/@/api/mp/wx-account";
import {BasicTableProps, useTable} from "/@/hooks/table";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {getPage,delObj,addObj,putObj} from '/@/api/mp/wx-auto-reply'
import { fetchAccountList } from "/@/api/mp/wx-account";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { getPage, delObj, addObj, putObj } from '/@/api/mp/wx-auto-reply'
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'))
@ -297,7 +276,7 @@ const handleEdit = (row: any) => {
const handleDel = (row) => {
useMessageBox().confirm("是否确认删除此数据?").then(() => {
delObj(row.id).then(() =>{
delObj(row.id).then(() => {
useMessage().success("删除成功")
getDataList()
})
@ -342,6 +321,4 @@ const handleAdd = () => {
</script>
<style scoped>
</style>
<style scoped></style>

View File

@ -1,20 +1,20 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-form-item :label="$t('wxFansMsg.appName')" prop="wxAccountAppid">
<el-select v-model="state.queryForm.wxAccountAppid" :placeholder="$t('fans.appName')" clearable class="w100">
<el-option v-for="item in accountList" :key="item.appid" :label="item.name" :value="item.appid"/>
<el-option v-for="item in accountList" :key="item.appid" :label="item.name" :value="item.appid" />
</el-select>
</el-form-item>
<el-form-item :label="$t('wxFansMsg.nickName')" prop="nickName">
<el-input v-model="state.queryForm.nickName" :placeholder="t('wxFansMsg.inputNickNameTip')"
style="max-width: 180px"/>
style="max-width: 180px" />
</el-form-item>
<el-form-item :label="$t('wxFansMsg.repType')" prop="repType">
<el-select v-model="state.queryForm.repType" :placeholder="$t('wxFansMsg.repType')" clearable class="w100">
<el-option v-for="item in repType" :key="item.value" :label="item.label" :value="item.value"/>
<el-option v-for="item in repType" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item class="ml2">
@ -28,37 +28,43 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button v-auth="'mp_wxFansMsg_export'" class="ml10" formDialogRef icon="Download" type="primary"
@click="exportExcel">
@click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button v-auth="'mp_wxmsg_del'" :disabled="multiple" class="ml10" formDialogRef icon="Delete"
type="primary" @click="handleDelete(selectObjs)">
<el-button v-auth="'mp_wxmsg_del'" :disabled="multiple" class="ml10" formDialogRef icon="Delete" type="primary"
@click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" style="width: 100%"
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('wxFansMsg.index')" type="index" width="80"/>
<el-table-column :label="t('wxFansMsg.appName')" prop="appName" show-overflow-tooltip/>
<el-table-column :label="t('wxFansMsg.repType')" prop="repType" show-overflow-tooltip/>
<el-table-column :label="t('wxFansMsg.openId')" prop="openId" show-overflow-tooltip/>
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('wxFansMsg.index')" type="index" width="80" />
<el-table-column :label="t('wxFansMsg.appName')" prop="appName" show-overflow-tooltip />
<el-table-column :label="t('wxFansMsg.repType')" prop="repType" show-overflow-tooltip />
<el-table-column :label="t('wxFansMsg.openId')" prop="openId" show-overflow-tooltip />
<el-table-column :label="t('wxFansMsg.repContent')" prop="repContent" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'subscribe'"><el-tag type="success" size="mini">关注</el-tag></div>
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'unsubscribe'"><el-tag type="danger" size="mini">取消关注</el-tag></div>
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'CLICK'"><el-tag size="mini">点击菜单</el-tag>{{ scope.row.repName }}</div>
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'VIEW'"><el-tag size="mini">点击菜单链接</el-tag>{{ scope.row.repUrl }}</div>
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'scancode_waitmsg'"><el-tag size="mini">扫码结果</el-tag>{{ scope.row.repContent }}</div>
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'subscribe'"><el-tag type="success"
size="mini">关注</el-tag></div>
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'unsubscribe'"><el-tag type="danger"
size="mini">取消关注</el-tag></div>
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'CLICK'"><el-tag
size="mini">点击菜单</el-tag>{{ scope.row.repName }}</div>
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'VIEW'"><el-tag
size="mini">点击菜单链接</el-tag>{{ scope.row.repUrl }}</div>
<div v-if="scope.row.repType === 'event' && scope.row.repEvent === 'scancode_waitmsg'"><el-tag
size="mini">扫码结果</el-tag>{{ scope.row.repContent }}</div>
<div v-if="scope.row.repType === 'text'">{{ scope.row.repContent }}</div>
<div v-if="scope.row.repType === 'image'">
<a target="_blank" :href="scope.row.repUrl"><img :src="scope.row.repUrl" style="width: 100px"></a>
</div>
<div v-if="['video','voice','link','shortvideo'].includes(scope.row.repType)">
<el-tag>链接</el-tag><a :href="scope.row.repUrl" target="_blank">{{ scope.row.repName }}</a></div>
<div v-if="['video', 'voice', 'link', 'shortvideo'].includes(scope.row.repType)">
<el-tag>链接</el-tag><a :href="scope.row.repUrl" target="_blank">{{ scope.row.repName }}</a>
</div>
</template>
</el-table-column>
<el-table-column :label="t('wxFansMsg.readFlag')" prop="readFlag" show-overflow-tooltip>
@ -66,33 +72,33 @@
<dict-tag :options="readFlag" :value="scope.row.readFlag"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('wxFansMsg.createTime')" prop="createTime" show-overflow-tooltip/>
<el-table-column :label="t('wxFansMsg.createTime')" prop="createTime" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button link type="primary" @click="wxMsgDo(scope.row,scope.index)">消息</el-button>
<el-button link type="primary" @click="wxMsgDo(scope.row, scope.index)">消息</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
</el-card>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" />
</div>
<wx-msg ref="WxmsgRef"></wx-msg>
</div>
</template>
<script lang="ts" name="systemWxMsg" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObjs, fetchList} from "/@/api/mp/wx-fans-msg";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useDict} from '/@/hooks/dict';
import {useI18n} from "vue-i18n";
import {fetchAccountList} from "/@/api/mp/wx-account";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObjs, fetchList } from "/@/api/mp/wx-fans-msg";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useDict } from '/@/hooks/dict';
import { useI18n } from "vue-i18n";
import { fetchAccountList } from "/@/api/mp/wx-account";
const WxMsg = defineAsyncComponent(() => import("/@/components/wechart/wx-msg/index.vue"))
const {t} = useI18n()
const { t } = useI18n()
//
const {repType} = useDict('repType')
const { repType } = useDict('repType')
const readFlag = ref([
{
@ -142,14 +148,14 @@ const accountList = ref([])
const getAccountList = () => {
fetchAccountList().then(res => {
accountList.value = res.data
if(accountList.value.length > 0){
if (accountList.value.length > 0) {
state.queryForm.wxAccountAppid = accountList.value[0].appid
getDataList()
}
})
}
watch(() => state.queryForm.wxAccountAppid,() => {
watch(() => state.queryForm.wxAccountAppid, () => {
getDataList()
})
@ -174,14 +180,14 @@ const handleSelectionChange = (objs: any) => {
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
const wxMsgDo = (row) => {

View File

@ -3,17 +3,17 @@
<el-row :gutter="20">
<el-col :md="4">
<el-card class="layout-padding-auto" shadow="hover">
<query-tree :query="deptData.queryList"
@node-click="handleNodeClick"/>
<query-tree :query="deptData.queryList" @node-click="handleNodeClick" />
</el-card>
</el-col>
<el-col :span="20">
<el-card class="layout-padding-auto" shadow="hover">
<div class="layout-padding-auto layout-padding-view">
<el-tabs v-model="materialType" @tab-click="handleClick">
<el-tab-pane name="image" label="image">
<template #label><i class="el-icon-picture"></i> 图片</template>
<div class="add_but">
<wx-file-upload @success="getDataList" :uploadData="uploadData" :type="['image/jpeg','image/png','image/gif','image/bmp','image/jpg']"></wx-file-upload>
<wx-file-upload @success="getDataList" :uploadData="uploadData"
:type="['image/jpeg', 'image/png', 'image/gif', 'image/bmp', 'image/jpg']"></wx-file-upload>
</div>
<div v-loading="state.loading" class="waterfall">
<div v-for="item in state.dataList" :key="item.id" class="waterfall-item">
@ -26,53 +26,35 @@
</el-row>
</div>
</div>
<div v-if="state.dataList.length <=0 && !state.loading" class="el-table__empty-block">
<div v-if="state.dataList.length <= 0 && !state.loading" class="el-table__empty-block">
<span class="el-table__empty-text">暂无数据</span>
</div>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" />
</el-tab-pane>
<el-tab-pane name="voice" label="voice">
<template #label><i class="el-icon-microphone"></i> 语音</template>
<div class="add_but">
<wx-file-upload @success="getDataList" :uploadData="uploadData"></wx-file-upload>
</div>
<el-table
v-loading="state.loading"
:data="state.dataList"
stripe
border>
<el-table-column
prop="mediaId"
label="media_id">
<el-table v-loading="state.loading" :data="state.dataList" stripe border>
<el-table-column prop="mediaId" label="media_id">
</el-table-column>
<el-table-column
prop="name"
label="名称">
<el-table-column prop="name" label="名称">
</el-table-column>
<el-table-column
prop="updateTime"
label="更新时间">
<el-table-column prop="updateTime" label="更新时间">
</el-table-column>
<el-table-column
fixed="right"
label="操作">
<el-table-column fixed="right" label="操作">
<template v-slot="scope">
<el-button
type="text"
icon="el-icon-download"
plain
@click="handleDown(scope.row)">下载
<el-button type="text" icon="el-icon-download" plain @click="handleDown(scope.row)">下载
</el-button>
<el-button
type="text"
icon="el-icon-delete"
plain
@click="delMaterial(scope.row)">删除
<el-button type="text" icon="el-icon-delete" plain @click="delMaterial(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" />
</el-tab-pane>
<el-tab-pane name="video" label="video">
<template #label><i class="el-icon-video-play"></i> 视频</template>
@ -80,21 +62,15 @@
<el-button type="primary" @click="handleAddVideo">新建</el-button>
</div>
<el-dialog title="新建视频" v-model="dialogVideoVisible">
<wx-file-upload @success="getDataList" :uploadData="uploadData" :auto-upload="false" ref="uploadFileVideo" :type="['video/mp4']"></wx-file-upload>
<el-form
ref="uploadForm"
:model="uploadData"
v-loading="addMaterialLoading"
:rules="uploadRules">
<wx-file-upload @success="getDataList" :uploadData="uploadData" :auto-upload="false" ref="uploadFileVideo"
:type="['video/mp4']"></wx-file-upload>
<el-form ref="uploadForm" :model="uploadData" v-loading="addMaterialLoading" :rules="uploadRules">
<el-form-item label="标题" prop="title">
<el-input v-model="uploadData.title" placeholder="标题将展示在相关播放页面,建议填写清晰、准确、生动的标题"></el-input>
</el-form-item>
<el-form-item label="描述" prop="introduction">
<el-input
v-model="uploadData.introduction"
:rows="3"
type="textarea"
placeholder="介绍语将展示在相关播放页面,建议填写简洁明确、有信息量的内容"></el-input>
<el-input v-model="uploadData.introduction" :rows="3" type="textarea"
placeholder="介绍语将展示在相关播放页面,建议填写简洁明确、有信息量的内容"></el-input>
</el-form-item>
</el-form>
<template #footer>
@ -102,26 +78,14 @@
<el-button type="primary" @click="subVideo"> </el-button>
</template>
</el-dialog>
<el-table
v-loading="state.loading"
:data="state.dataList"
stripe
border>
<el-table-column
prop="mediaId"
label="media_id">
<el-table v-loading="state.loading" :data="state.dataList" stripe border>
<el-table-column prop="mediaId" label="media_id">
</el-table-column>
<el-table-column
prop="name"
label="名称">
<el-table-column prop="name" label="名称">
</el-table-column>
<el-table-column
prop="updateTime"
label="更新时间">
<el-table-column prop="updateTime" label="更新时间">
</el-table-column>
<el-table-column
fixed="right"
label="操作">
<el-table-column fixed="right" label="操作">
<template v-slot="scope">
<el-button type="text" icon="el-icon-view" @click="handleInfo(scope.row)">查看
</el-button>
@ -130,7 +94,8 @@
</template>
</el-table-column>
</el-table>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"/>
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" />
</el-tab-pane>
<el-tab-pane name="news" label="news">
<template #label><i class="el-icon-news"></i> 图文</template>
@ -139,10 +104,7 @@
</div>
<news-form ref="dialogNewsRef" @ok="getDataList"></news-form>
<div v-loading="state.loading" class="waterfall">
<div
v-for="item in state.dataList"
:key="item.id"
class="waterfall-item">
<div v-for="item in state.dataList" :key="item.id" class="waterfall-item">
<wx-news :obj-data="item.content.newsItem"></wx-news>
<el-row class="ope-row">
<el-button type="primary" icon="el-icon-edit" circle @click="handleEditNews(item)"></el-button>
@ -150,25 +112,23 @@
</el-row>
</div>
</div>
<div v-if="state.dataList.length <=0 && !state.loading" class="el-table__empty-block">
<div v-if="state.dataList.length <= 0 && !state.loading" class="el-table__empty-block">
<span class="el-table__empty-text">暂无数据</span>
</div>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</el-col>
</el-row>
</div>
</template>
<script setup lang="ts" name="wx-material">
import { fetchAccountList } from "/@/api/mp/wx-account";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObj, getMaterialVideo, getPage} from '/@/api/mp/wx-material'
import { useMessage, useMessageBox } from "/@/hooks/message";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObj, getMaterialVideo, getPage } from '/@/api/mp/wx-material'
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'))
const NewsForm = defineAsyncComponent(() => import("./components/news-form.vue"))
@ -203,7 +163,7 @@ const handleNodeClick = (data: any) => {
}
const handleClick = (tab) => {
const handleClick = (tab) => {
if (checkAppId.value) {
// getPage(this.page)
} else {
@ -241,7 +201,7 @@ const delMaterial = (item: any) => {
id: item.mediaId,
appId: checkAppId.value
}).then(() => {
getDataList()
getDataList()
})
})
}
@ -295,7 +255,7 @@ const handleAddNews = () => {
const handleEditNews = (item) => {
dialogNewsRef.value.openDialog({
accountId: checkAppId.value,
},JSON.parse(JSON.stringify(item.content.newsItem)),item.mediaId,'edit')
}, JSON.parse(JSON.stringify(item.content.newsItem)), item.mediaId, 'edit')
}
const handleInfo = (row) => {
@ -424,6 +384,7 @@ p {
.waterfall {
column-count: 3;
}
p {
color: red;
}
@ -433,6 +394,7 @@ p {
.waterfall {
column-count: 2;
}
p {
color: orange;
}

View File

@ -3,12 +3,11 @@
<el-row :gutter="20">
<el-col :span="4" :xs="24">
<el-card class="layout-padding-auto" shadow="hover">
<query-tree :query="deptData.queryList"
@node-click="handleNodeClick"/>
<query-tree :query="deptData.queryList" @node-click="handleNodeClick" />
</el-card>
</el-col>
<el-col :span="20">
<el-card class="layout-padding-auto" shadow="hover">
<div class="layout-padding-auto layout-padding-view">
<div v-loading="loading" class="public-account-management clearfix">
<div class="left">
<div class="weixin-hd">
@ -24,16 +23,16 @@
<template v-for="(subItem, k) in item.children">
<div v-if="item.children" :key="k" class="subtitle menu_bottom">
<div :class="{ active: isSubMenuActive === i + '' + k }" class="menu_subItem"
@click="subMenuClick(subItem, i, k)">
@click="subMenuClick(subItem, i, k)">
{{ subItem.name }}
</div>
</div>
</template>
<!-- 二级菜单加号 当长度 小于 5 才显示二级菜单的加号 -->
<div v-if="!item.children || item.children.length < 5" class="menu_bottom menu_addicon"
@click="addSubMenu(i, item)">
@click="addSubMenu(i, item)">
<el-icon>
<el-icon-plus/>
<el-icon-plus />
</el-icon>
</div>
</div>
@ -41,7 +40,7 @@
<!-- 一级菜单加号 -->
<div v-if="menuList.length < 3" class="menu_bottom menu_addicon" @click="addMenu">
<el-icon>
<el-icon-plus/>
<el-icon-plus />
</el-icon>
</div>
</div>
@ -59,17 +58,17 @@
</div>
<div>
<span>菜单名称</span>
<el-input v-model="tempObj.name" class="input_width" clearable placeholder="请输入菜单名称"/>
<el-input v-model="tempObj.name" class="input_width" clearable placeholder="请输入菜单名称" />
</div>
<div v-if="showConfigureContent">
<div class="menu_content">
<span>菜单标识</span>
<el-input v-model="tempObj.menuKey" class="input_width" clearable placeholder="请输入菜单 KEY"/>
<el-input v-model="tempObj.menuKey" class="input_width" clearable placeholder="请输入菜单 KEY" />
</div>
<div class="menu_content">
<span>菜单内容</span>
<el-select v-model="tempObj.type" class="menu_option" clearable placeholder="请选择">
<el-option v-for="item in menuOptions" :key="item.value" :label="item.label" :value="item.value"/>
<el-option v-for="item in menuOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div class="configur_content" v-if="tempObj.type === 'view'">
@ -79,12 +78,13 @@
<div class="configur_content" v-if="tempObj.type === 'miniprogram'">
<div class="applet">
<span>小程序的 appid </span>
<el-input class="input_width" v-model="tempObj.miniProgramAppId" placeholder="请输入小程序的appid" clearable />
<el-input class="input_width" v-model="tempObj.miniProgramAppId" placeholder="请输入小程序的appid"
clearable />
</div>
<div class="applet">
<span>小程序的页面路径</span>
<el-input class="input_width" v-model="tempObj.miniProgramPagePath"
placeholder="请输入小程序的页面路径pages/index" clearable />
placeholder="请输入小程序的页面路径pages/index" clearable />
</div>
<div class="applet">
<span>小程序的备用网页</span>
@ -109,29 +109,29 @@
</el-col>
</el-row>
</div>
<wx-material-select ref="dialogNewsRef" @selectMaterial="selectMaterial" />
<wx-material-select ref="dialogNewsRef" @selectMaterial="selectMaterial" />
</el-row>
</div>
<div class="configur_content" v-if="tempObj.type === 'click' || tempObj.type === 'scancode_waitmsg'">
<wx-reply :objData="tempObj" v-if="hackResetWxReplySelect"/>
<wx-reply :objData="tempObj" v-if="hackResetWxReplySelect" />
</div>
</div>
</div>
</div>
</div>
</el-card>
</div>
</el-col>
</el-row>
</div>
</template>
<script lang="ts" name="wx-menu" setup>
import { saveObj,getObj } from '/@/api/mp/wx-menu'
import { saveObj, getObj } from '/@/api/mp/wx-menu'
// 使
import {fetchAccountList} from "/@/api/mp/wx-account";
import {useMessage, useMessageBox} from "/@/hooks/message";
import { fetchAccountList } from "/@/api/mp/wx-account";
import { useMessage, useMessageBox } from "/@/hooks/message";
const WxMaterialSelect = defineAsyncComponent(() => import("/@/components/wechart/wx-material-select/main.vue"))
@ -233,12 +233,12 @@ const tempSelfObj = reactive({
secondIndex: '' //
})
const getMenuFun = () => {
const getMenuFun = () => {
getObj(accountId.value).then((res) => {
if (res.data) {
const data = JSON.parse(res.data)
if (data && data.button) {
Object.assign(menuList,data.button)
Object.assign(menuList, data.button)
}
}
})
@ -317,13 +317,13 @@ const addMenu = () => {
const deleteMenu = () => {
useMessageBox().confirm("确定要删除吗?").then(() => {
if(tempSelfObj.grand === '1'){
if (tempSelfObj.grand === '1') {
menuList.splice(tempSelfObj.index, 1)
}else if(tempSelfObj.grand === '2'){
} else if (tempSelfObj.grand === '2') {
menuList[tempSelfObj.index].children.splice(tempSelfObj.secondIndex, 1)
}
useMessage().success("删除成功")
Object.assign(tempObj,{})
Object.assign(tempObj, {})
showRightFlag.value = false
isActive.value = -1
isSubMenuActive.value = '-1'
@ -332,13 +332,13 @@ const deleteMenu = () => {
}
const handleSave = () => {
useMessageBox().confirm("确定要保存该菜单吗?").then(() => {
saveObj(accountId.value, {
button: menuList
}).then(() => {
useMessage().success("保存成功")
});
})
useMessageBox().confirm("确定要保存该菜单吗?").then(() => {
saveObj(accountId.value, {
button: menuList
}).then(() => {
useMessage().success("保存成功")
});
})
}
@ -350,7 +350,7 @@ const deleteMaterial = () => {
const dialogNewsRef = ref()
const openMaterial = () => {
dialogNewsRef.value.openDialog({type: 'news', accountId: accountId.value})
dialogNewsRef.value.openDialog({ type: 'news', accountId: accountId.value })
}
const selectMaterial = (item) => {
@ -448,6 +448,7 @@ div {
padding: 518px 25px 88px;
position: relative;
box-sizing: border-box;
/*第一级菜单*/
.menu_main {
.menu_bottom {
@ -517,6 +518,7 @@ div {
}
}
}
/*右边菜单内容*/
.right {
float: left;
@ -526,14 +528,17 @@ div {
margin-left: 20px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
.configure_page {
.delete_btn {
text-align: right;
margin-bottom: 15px;
}
.menu_content {
margin-top: 20px;
}
.configur_content {
margin-top: 20px;
background-color: #fff;
@ -569,6 +574,7 @@ div {
}
}
}
.el-input {
width: 70%;
margin-right: 2%;
@ -581,21 +587,25 @@ div {
text-align: right;
margin-right: 25px;
}
.select-item {
width: 280px;
padding: 10px;
margin: 0 auto 10px auto;
border: 1px solid #eaeaea;
}
.select-item2 {
padding: 10px;
margin: 0 auto 10px auto;
border: 1px solid #eaeaea;
}
.ope-row {
padding-top: 10px;
text-align: center;
}
.item-name {
font-size: 12px;
overflow: hidden;

View File

@ -1,26 +1,17 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<div class="layout-padding-auto layout-padding-view">
<el-row>
<div class="mb8" style="width: 100%">
<el-date-picker
v-model="beginTime"
class="input_width"
placeholder="选择开始时间"
@change="check">
<el-date-picker v-model="beginTime" class="input_width" placeholder="选择开始时间" @change="check">
</el-date-picker>
<el-date-picker
v-model="endTime"
class="input_width"
placeholder="选择结束时间"
@change="check">
<el-date-picker v-model="endTime" class="input_width" placeholder="选择结束时间" @change="check">
</el-date-picker>
</div>
</el-row>
<el-row >
<el-row>
<el-col :span="4" :xs="24">
<query-tree :query="deptData.queryList"
@node-click="handleNodeClick"/>
<query-tree :query="deptData.queryList" @node-click="handleNodeClick" />
</el-col>
<el-col :span="20">
<el-row :gutter="15" class="home-card-two mb15">
@ -51,15 +42,15 @@
</el-row>
</el-col>
</el-row>
</el-card>
</div>
</div>
</template>
<script setup lang="ts" name="wx-statistics">
import {useMessage} from "/@/hooks/message";
import {fetchAccountList, fetchStatistics} from "/@/api/mp/wx-account";
import {markRaw} from "vue";
import { useMessage } from "/@/hooks/message";
import { fetchAccountList, fetchStatistics } from "/@/api/mp/wx-account";
import { markRaw } from "vue";
import * as echarts from "echarts";
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'))
@ -67,7 +58,7 @@ const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/ind
const beginTime = ref(new Date().getTime() - 3600 * 1000 * 24 * 7)
const endTime = ref(new Date().getTime() - 3600 * 1000 * 24)
const check = () => {
const check = () => {
const start = new Date(beginTime.value)
const end = new Date(endTime.value)
if (end.getTime() >= new Date().getTime()) {
@ -202,7 +193,7 @@ const interfaceSummary = () => {
const LintData = ref([
[],[],[],[],[],[],[],[]
[], [], [], [], [], [], [], []
])
@ -222,7 +213,7 @@ const initdata = () => {
</script>
<style scoped>
.home-card-item{
.home-card-item {
width: 100%;
height: 400px;
border-radius: 4px;
@ -234,5 +225,4 @@ const initdata = () => {
border: 1px solid var(--next-border-color-light);
margin-top: 20px;
}
</style>

View File

@ -1,16 +1,16 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('channel.channelName')" prop="channelName">
<el-input :placeholder="t('channel.inputChannelNameTip')" style="max-width: 180px"
v-model="state.queryForm.channelName"/>
v-model="state.queryForm.channelName" />
</el-form-item>
<el-form-item :label="t('channel.state')" prop="state">
<el-select v-model="state.queryForm.state">
<el-option :key="item.value" :label="item.label" :value="item.value"
v-for="item in status_type">
v-for="item in status_type">
</el-option>
</el-select>
</el-form-item>
@ -26,133 +26,129 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="formDialogRef.openDialog()" class="ml10" formDialogRef icon="folder-add"
type="primary"
v-auth="'pay_channel_add'">
type="primary" v-auth="'pay_channel_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" formDialogRef icon="Download" type="primary"
v-auth="'pay_channel_export'">
v-auth="'pay_channel_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef
icon="Delete"
type="primary" v-auth="'pay_channel_del'">
icon="Delete" type="primary" v-auth="'pay_channel_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" @sort-change="sortChangeHandle"
border max-height="300" style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('channel.index')" fixed type="index" width="80"/>
<el-table-column :label="t('channel.appId')" prop="appId" show-overflow-tooltip width="160"/>
<el-table-column :label="t('channel.channelName')" prop="channelName" show-overflow-tooltip
width="100"/>
<el-table-column :label="t('channel.mchId')" prop="mchId" show-overflow-tooltip width="120"/>
border max-height="300" style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('channel.index')" fixed type="index" width="80" />
<el-table-column :label="t('channel.appId')" prop="appId" show-overflow-tooltip width="160" />
<el-table-column :label="t('channel.channelName')" prop="channelName" show-overflow-tooltip width="100" />
<el-table-column :label="t('channel.mchId')" prop="mchId" show-overflow-tooltip width="120" />
<el-table-column :label="t('channel.state')" prop="state" show-overflow-tooltip width="100">
<template #default="scope">
<dict-tag :options="status_type" :value="scope.row.state"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('channel.returnUrl')" prop="returnUrl" show-overflow-tooltip width="200"/>
<el-table-column :label="t('channel.notifyUrl')" prop="notifyUrl" show-overflow-tooltip width="200"/>
<el-table-column :label="t('channel.remark')" prop="remark" show-overflow-tooltip width="120"/>
<el-table-column :label="t('channel.param')" prop="param" show-overflow-tooltip width="160"/>
<el-table-column :label="t('channel.createTime')" prop="createTime" show-overflow-tooltip width="180"/>
<el-table-column :label="t('channel.returnUrl')" prop="returnUrl" show-overflow-tooltip width="200" />
<el-table-column :label="t('channel.notifyUrl')" prop="notifyUrl" show-overflow-tooltip width="200" />
<el-table-column :label="t('channel.remark')" prop="remark" show-overflow-tooltip width="120" />
<el-table-column :label="t('channel.param')" prop="param" show-overflow-tooltip width="160" />
<el-table-column :label="t('channel.createTime')" prop="createTime" show-overflow-tooltip width="180" />
<el-table-column :label="$t('common.action')" fixed="right" width="150">
<template #default="scope">
<el-button @click="formDialogRef.openDialog(scope.row.id)" text type="primary"
v-auth="'pay_channel_edit'">{{ $t('common.editBtn') }}
v-auth="'pay_channel_edit'">{{ $t('common.editBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" text type="primary" v-auth="'pay_channel_del'">
{{
$t('common.delBtn')
$t('common.delBtn')
}}
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination"/>
</el-card>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList(false)" ref="formDialogRef"/>
<form-dialog @refresh="getDataList(false)" ref="formDialogRef" />
</div>
</template>
<script lang="ts" name="systemPayChannel" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObjs, fetchList} from "/@/api/pay/channel";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import {useDict} from "/@/hooks/dict";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObjs, fetchList } from "/@/api/pay/channel";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
import { useDict } from "/@/hooks/dict";
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const {t} = useI18n()
//
const {status_type} = useDict('status_type')
//
const formDialogRef = ref()
//
const queryRef = ref()
const showSearch = ref(true)
//
const selectObjs = ref([]) as any
const multiple = ref(true)
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const { t } = useI18n()
//
const { status_type } = useDict('status_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: {},
pageList: fetchList,
descs: ['create_time']
})
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
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 = () => {
//
const resetQuery = () => {
//
queryRef.value.resetFields()
//
selectObjs.value = []
getDataList()
}
queryRef.value.resetFields()
//
selectObjs.value = []
getDataList()
}
// excel
const exportExcel = () => {
downBlobFile('/admin/channel/export', state.queryForm, 'channel.xlsx')
}
// excel
const exportExcel = () => {
downBlobFile('/admin/channel/export', state.queryForm, 'channel.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(false);
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(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
};
})
};
</script>

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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">
@ -13,7 +13,7 @@
<el-form-item :label="$t('order.payOrderId')" prop="payOrderId">
<el-input :placeholder="t('order.inputPayOrderIdTip')" style="max-width: 180px"
v-model="state.queryForm.payOrderId"/>
v-model="state.queryForm.payOrderId" />
</el-form-item>
<el-form-item class="ml2">
<el-button @click="getDataList" formDialogRef icon="search" type="primary">
@ -27,56 +27,55 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="exportExcel" class="ml10" formDialogRef icon="Download" type="primary"
v-auth="'pay_order_export'">
v-auth="'pay_order_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef
icon="Delete" type="primary" v-auth="'pay_order_del'">
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef icon="Delete"
type="primary" v-auth="'pay_order_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" @sort-change="sortChangeHandle"
border style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('order.index')" type="index" width="80"/>
<el-table-column :label="t('order.goodsId')" prop="goodsId" show-overflow-tooltip/>
<el-table-column :label="t('order.goodsName')" prop="goodsName" show-overflow-tooltip/>
<el-table-column :label="t('order.amount')" prop="amount" show-overflow-tooltip/>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" @sort-change="sortChangeHandle" border
style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('order.index')" type="index" width="80" />
<el-table-column :label="t('order.goodsId')" prop="goodsId" show-overflow-tooltip />
<el-table-column :label="t('order.goodsName')" prop="goodsName" show-overflow-tooltip />
<el-table-column :label="t('order.amount')" prop="amount" show-overflow-tooltip />
<el-table-column :label="t('order.status')" prop="status" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="dictType" :value="scope.row.status"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('order.payOrderId')" prop="payOrderId" show-overflow-tooltip/>
<el-table-column :label="t('order.createTime')" prop="createTime" show-overflow-tooltip/>
<el-table-column :label="t('order.payOrderId')" prop="payOrderId" show-overflow-tooltip />
<el-table-column :label="t('order.createTime')" prop="createTime" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button @click="handleDelete([scope.row.goodsOrderId])" text type="primary"
v-auth="'pay_order_del'">{{
$t('common.delBtn')
}}
<el-button @click="handleDelete([scope.row.goodsOrderId])" text type="primary" v-auth="'pay_order_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>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
</div>
</template>
<script lang="ts" name="systemPayGoodsOrder" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObjs, fetchList} from "/@/api/pay/goods";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObjs, fetchList } from "/@/api/pay/goods";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
//
const {t} = useI18n()
const { t } = useI18n()
//
const queryRef = ref()
const showSearch = ref(true)
@ -143,13 +142,13 @@ const handleSelectionChange = (objs: any) => {
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
</script>

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('record.notifyId')" prop="notifyId">
@ -54,7 +54,7 @@
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</el-card>
</div>
</div>
</template>

View File

@ -1,6 +1,6 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('refund.refundOrderId')" prop="refundOrderId">
@ -60,7 +60,7 @@
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</el-card>
</div>
</div>
</template>

View File

@ -1,11 +1,11 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<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('trade.orderId')" prop="orderId">
<el-input :placeholder="t('trade.inputOrderIdTip')" style="max-width: 180px"
v-model="state.queryForm.orderId"/>
v-model="state.queryForm.orderId" />
</el-form-item>
<el-form-item :label="t('trade.status')" prop="status">
@ -27,69 +27,66 @@
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="exportExcel" class="ml10" formDialogRef icon="Download" type="primary"
v-auth="'pay_trade_export'">
v-auth="'pay_trade_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef
icon="Delete" type="primary" v-auth="'pay_trade_del'">
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" formDialogRef icon="Delete"
type="primary" v-auth="'pay_trade_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" @sort-change="sortChangeHandle"
border style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60"/>
<el-table-column :label="t('trade.index')" fixed type="index" width="80"/>
<el-table-column :label="t('trade.orderId')" prop="orderId" show-overflow-tooltip width="120"/>
<el-table-column :label="t('trade.channelId')" prop="channelId" show-overflow-tooltip width="120"/>
<el-table-column :label="t('trade.channelMchId')" prop="channelMchId" show-overflow-tooltip width="120"/>
<el-table-column :label="t('trade.channelOrderNo')" prop="channelOrderNo" show-overflow-tooltip
width="120"/>
<el-table-column :label="t('trade.body')" prop="body" show-overflow-tooltip width="120"/>
<el-table-column :label="t('trade.amount')" prop="amount" show-overflow-tooltip width="120"/>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" @sort-change="sortChangeHandle" border
style="width: 100%" v-loading="state.loading">
<el-table-column align="center" type="selection" width="60" />
<el-table-column :label="t('trade.index')" fixed type="index" width="80" />
<el-table-column :label="t('trade.orderId')" prop="orderId" show-overflow-tooltip width="120" />
<el-table-column :label="t('trade.channelId')" prop="channelId" show-overflow-tooltip width="120" />
<el-table-column :label="t('trade.channelMchId')" prop="channelMchId" show-overflow-tooltip width="120" />
<el-table-column :label="t('trade.channelOrderNo')" prop="channelOrderNo" show-overflow-tooltip width="120" />
<el-table-column :label="t('trade.body')" prop="body" show-overflow-tooltip width="120" />
<el-table-column :label="t('trade.amount')" prop="amount" show-overflow-tooltip width="120" />
<el-table-column :label="t('trade.status')" prop="status" show-overflow-tooltip width="120">
<template #default="scope">
<dict-tag :options="dictType" :value="scope.row.status"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="t('trade.clientIp')" prop="clientIp" show-overflow-tooltip width="120"/>
<el-table-column :label="t('trade.paySuccTime')" prop="paySuccTime" show-overflow-tooltip width="120"/>
<el-table-column :label="t('trade.createTime')" prop="createTime" show-overflow-tooltip width="160"/>
<el-table-column :label="t('trade.clientIp')" prop="clientIp" show-overflow-tooltip width="120" />
<el-table-column :label="t('trade.paySuccTime')" prop="paySuccTime" show-overflow-tooltip width="120" />
<el-table-column :label="t('trade.createTime')" prop="createTime" show-overflow-tooltip width="160" />
<el-table-column :label="$t('common.action')" fixed="right" width="150">
<template #default="scope">
<el-button @click="refundDialogRef.openDialog(scope.row.orderId)" text type="primary"
v-if="scope.row.status === '1'"
v-auth="'pay_trade_del'">{{
v-if="scope.row.status === '1'" v-auth="'pay_trade_del'">{{
$t('trade.refundBtn')
}}
</el-button>
<el-button @click="handleDelete([scope.row.orderId])" text type="primary"
v-auth="'pay_trade_del'">{{
$t('common.delBtn')
}}
<el-button @click="handleDelete([scope.row.orderId])" text type="primary" v-auth="'pay_trade_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>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
</div>
<refund-dialog @refresh="getDataList(false)" ref="refundDialogRef"/>
<refund-dialog @refresh="getDataList(false)" ref="refundDialogRef" />
</div>
</template>
<script lang="ts" name="systemPayTradeOrder" setup>
import {BasicTableProps, useTable} from "/@/hooks/table";
import {delObjs, fetchList} from "/@/api/pay/trade";
import {useMessage, useMessageBox} from "/@/hooks/message";
import {useI18n} from "vue-i18n";
import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObjs, fetchList } from "/@/api/pay/trade";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
//
const RefundDialog = defineAsyncComponent(() => import('./refund.vue'));
const {t} = useI18n()
const { t } = useI18n()
//
//
@ -163,13 +160,13 @@ const handleSelectionChange = (objs: any) => {
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
.then(() => {
delObjs(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
</script>