Compare commits
19 Commits
59843de257
...
dev-dataSc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d393275529 | ||
|
|
91966b402e | ||
|
|
8b9affd8e8 | ||
|
|
26e1f9a181 | ||
|
|
9d2ae9b0b4 | ||
| 2706b4f3ef | |||
|
|
026453ba2a | ||
|
|
3edfa51d3c | ||
| bbc5ef3471 | |||
| f5f0b4ac42 | |||
|
|
6fc69bc42a | ||
| 735aa22f95 | |||
| 3824642338 | |||
| e30b3e3908 | |||
| ec1c68dbc8 | |||
| 973792d196 | |||
| 68594b62b8 | |||
| 96edc4e21e | |||
| 78746d3a2d |
121
src/api/index.ts
Normal file
121
src/api/index.ts
Normal file
@@ -0,0 +1,121 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获取集团外协管理数据
|
||||
export const getOutsourcingManagementData = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_wx_jt', data })
|
||||
}
|
||||
|
||||
// 获取集团风险管理数据
|
||||
export const getRiskManagementData = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_fx_jt', data })
|
||||
}
|
||||
|
||||
// 数据看板-隐患管理-集团(天) /jeelowcode/report-data/list/kb_yh_jt_d
|
||||
export const getHiddenDangerManagementData = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yh_jt_d', data })
|
||||
}
|
||||
|
||||
// 数据看板-隐患管理-集团(周) /jeelowcode/report-data/list/kb_yh_jt_w
|
||||
export const getHiddenDangerManagementDataWeek = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yh_jt_w', data })
|
||||
}
|
||||
|
||||
// 数据看板-隐患管理-集团(月) /jeelowcode/report-data/list/kb_yh_jt_m
|
||||
export const getHiddenDangerManagementDataMonth = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yh_jt_m', data })
|
||||
}
|
||||
|
||||
// 数据看板-高危作业-集团 /jeelowcode/report-data/list/kb_gw_jt
|
||||
export const getHighRiskManagementData = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_gw_jt', data })
|
||||
}
|
||||
|
||||
// 数据看板-应急预案-集团 /jeelowcode/report-data/list/kb_yj_jt
|
||||
export const getEmergencyPlanManagementData = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yj_jt', data })
|
||||
}
|
||||
|
||||
// 数据看板-培训-集团 /jeelowcode/report-data/list/kb_px_jt
|
||||
export const getTrainingManagementData = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_px_jt', data })
|
||||
}
|
||||
|
||||
// 数据看板-外协管理-区域 /jeelowcode/report-data/list/kb_wx_qy
|
||||
export const getOutsourcingManagementDataRegion = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_wx_qy', data })
|
||||
}
|
||||
|
||||
// 数据看板-外协管理-园区 /jeelowcode/report-data/list/kb_wx_yq
|
||||
export const getOutsourcingManagementDataPark = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_wx_yq', data })
|
||||
}
|
||||
|
||||
// 数据看板-风险管理-区域 /jeelowcode/report-data/list/kb_fx_qy
|
||||
export const getRiskManagementDataRegion = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_fx_qy', data })
|
||||
}
|
||||
|
||||
// 数据看板-风险管理-园区 /jeelowcode/report-data/list/kb_fx_yq
|
||||
export const getRiskManagementDataPark = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_fx_yq', data })
|
||||
}
|
||||
|
||||
// 数据看板-隐患管理-区域(天) /jeelowcode/report-data/list/kb_yh_qy_d
|
||||
export const getHiddenDangerManagementDataRegion = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yh_qy_d', data })
|
||||
}
|
||||
|
||||
// 数据看板-隐患管理-区域(周) /jeelowcode/report-data/list/kb_yh_qy_w
|
||||
export const getHiddenDangerManagementDataRegionWeek = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yh_qy_w', data })
|
||||
}
|
||||
|
||||
// 数据看板-隐患管理-区域(月) /jeelowcode/report-data/list/kb_yh_qy_m
|
||||
export const getHiddenDangerManagementDataRegionMonth = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yh_qy_m', data })
|
||||
}
|
||||
|
||||
// 数据看板-隐患管理-园区(天)
|
||||
export const getHiddenDangerManagementDataPark = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_gw_qy_d', data })
|
||||
}
|
||||
|
||||
// 数据看板-隐患管理-园区(周) /jeelowcode/report-data/list/kb_yh_yq_w
|
||||
export const getHiddenDangerManagementDataParkWeek = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yh_yq_w', data })
|
||||
}
|
||||
|
||||
// 数据看板-隐患管理-园区(月) /jeelowcode/report-data/list/kb_yh_yq_m
|
||||
export const getHiddenDangerManagementDataParkMonth = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yh_yq_m', data })
|
||||
}
|
||||
|
||||
// 数据看板-高危作业-区域 /jeelowcode/report-data/list/kb_gw_dq
|
||||
export const getHighRiskManagementDataRegion = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_gw_dq', data })
|
||||
}
|
||||
|
||||
// 数据看板-高危作业-园区 /jeelowcode/report-data/list/kb_gw_yq
|
||||
export const getHighRiskManagementDataPark = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_gw_yq', data })
|
||||
}
|
||||
|
||||
// 数据看板-应急预案-区域 /jeelowcode/report-data/list/kb_yj_dq
|
||||
export const getEmergencyPlanManagementDataRegion = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yj_dq', data })
|
||||
}
|
||||
|
||||
// 数据看板-应急预案-园区 /jeelowcode/report-data/list/kb_yj_yq
|
||||
export const getEmergencyPlanManagementDataPark = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_yj_yq', data })
|
||||
}
|
||||
|
||||
// 数据看板-安全培训-区域 /jeelowcode/report-data/list/kb_px_qy
|
||||
export const getTrainingManagementDataRegion = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_px_qy', data })
|
||||
}
|
||||
|
||||
// 数据看板-安全培训-园区 /jeelowcode/report-data/list/kb_px_yq
|
||||
export const getTrainingManagementDataPark = (data) => {
|
||||
return request.post({ url: '/jeelowcode/report-data/list/kb_px_yq', data })
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
<ContentWrap>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
|
||||
<div v-for="taskAssignRule in props?.taskAssignRules" :key="taskAssignRule.taskDefinitionKey">
|
||||
<el-divider content-position="left">{{ taskAssignRule?.taskDefinitionName }}</el-divider>
|
||||
<el-form-item :label="taskAssignRule.taskDefinitionName+'候选人'"
|
||||
<el-divider content-position="left">审批节点:{{ taskAssignRule?.taskDefinitionName }}</el-divider>
|
||||
<el-form-item :label="'候选人'"
|
||||
:prop="taskAssignRule.taskDefinitionKey"
|
||||
label-width="200">
|
||||
label-width="122">
|
||||
<UserSelect
|
||||
v-model="formData[taskAssignRule.taskDefinitionKey]"
|
||||
:column="userSelectColumn"
|
||||
@@ -103,3 +103,5 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -402,9 +402,9 @@ const dictSelectScope = {
|
||||
"type": "dicTableSelect",
|
||||
"controlType": "select",
|
||||
"label": "表格选择框",
|
||||
"fixedSearch":{
|
||||
"approveStatusName":"已审批"
|
||||
},
|
||||
// "fixedSearch":{
|
||||
// "approveStatusName":"已审批"
|
||||
// },
|
||||
"separator": " | ",
|
||||
"multiple": true,
|
||||
"display": true,
|
||||
@@ -447,9 +447,9 @@ const distSelectColumn = {
|
||||
"display": true,
|
||||
"span": 12,
|
||||
"disabled": false,
|
||||
"fixedSearch":{
|
||||
"approveStatusName":"已审批"
|
||||
},
|
||||
// "fixedSearch":{
|
||||
// "approveStatusName":"已审批"
|
||||
// },
|
||||
"required": false,
|
||||
"hideLabel": false,
|
||||
"i18nCode": "fields_7897245",
|
||||
|
||||
@@ -34,7 +34,7 @@ const dicObj = {
|
||||
{ label: '邮箱', value: 'email' }, { label: '性别', value: 'sex' }, { label: '岗位', value: 'post' }, { label: '部门', value: 'deptName' }
|
||||
],
|
||||
userFindType: [{ label: '全部用户', value: 'all' }, { label: '本级用户', value: 'now' }, { label: '本级及下级用户', value: 'sub' }],
|
||||
deptFindType: [{ label: '全部部门', value: 'all' }, { label: '本级部门', value: 'now' }, { label: '本级及下级部门', value: 'sub' }, { label: '外协单位', value: 'out' }],
|
||||
deptFindType: [{ label: '全部部门', value: 'all' }, { label: '本级部门', value: 'now' }, { label: '本级及下级部门', value: 'sub' }, { label: '外协单位', value: 'out' }, { label: '内部单位', value: 'internal' }],
|
||||
customControlType: [{ label: '未全局注册', value: false }, { label: '已全局注册', value: true }],
|
||||
regionType: [{ label: '全球-国家', value: 'gj' }, { label: '中国-省市区', value: 'ssq' }, { label: '中国-省市', value: 'ss' }, { label: '中国-省', value: 's' }],
|
||||
dictTextFormatter: [
|
||||
|
||||
@@ -7,7 +7,8 @@ import {
|
||||
MapChart,
|
||||
PictorialBarChart,
|
||||
RadarChart,
|
||||
GaugeChart
|
||||
GaugeChart,
|
||||
CandlestickChart
|
||||
} from 'echarts/charts'
|
||||
|
||||
import {
|
||||
@@ -41,7 +42,8 @@ echarts.use([
|
||||
CanvasRenderer,
|
||||
PictorialBarChart,
|
||||
RadarChart,
|
||||
GaugeChart
|
||||
GaugeChart,
|
||||
CandlestickChart
|
||||
])
|
||||
|
||||
export default echarts
|
||||
|
||||
@@ -57,6 +57,17 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
name: 'Home',
|
||||
meta: {},
|
||||
children: [
|
||||
// {
|
||||
// path: 'index',
|
||||
// component: () => import('@/views/Home/Index10.vue'),
|
||||
// name: 'Index',
|
||||
// meta: {
|
||||
// title: t('router.home'),
|
||||
// icon: 'ep:home-filled',
|
||||
// noCache: false,
|
||||
// affix: true
|
||||
// }
|
||||
// },
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/Home/Index10.vue'),
|
||||
@@ -67,6 +78,30 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
noCache: false,
|
||||
affix: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'region', // 区域数据看板
|
||||
component: () => import('@/views/Home/Index12.vue'),
|
||||
name: 'RegionIndex',
|
||||
meta: {
|
||||
title: '区域视角数据看板',
|
||||
icon: 'ep:home-filled',
|
||||
noCache: false,
|
||||
hidden: true,
|
||||
affix: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'park', // 园区数据看板
|
||||
component: () => import('@/views/Home/Index13.vue'),
|
||||
name: 'ParkIndex',
|
||||
meta: {
|
||||
title: '园区视角数据看板',
|
||||
icon: 'ep:home-filled',
|
||||
hidden: true,
|
||||
noCache: false,
|
||||
affix: true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1928
src/views/Home/Index12.vue
Normal file
1928
src/views/Home/Index12.vue
Normal file
File diff suppressed because it is too large
Load Diff
1884
src/views/Home/Index13.vue
Normal file
1884
src/views/Home/Index13.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,56 +1,31 @@
|
||||
<template>
|
||||
<el-form
|
||||
v-show="getShow"
|
||||
ref="formLogin"
|
||||
:model="loginData.loginForm"
|
||||
:rules="LoginRules"
|
||||
class="login-form login-form-default"
|
||||
label-position="top"
|
||||
label-width="120px"
|
||||
size="large"
|
||||
>
|
||||
<el-form v-show="getShow" ref="formLogin" :model="loginData.loginForm" :rules="LoginRules"
|
||||
class="login-form login-form-default" label-position="top" label-width="120px" size="large">
|
||||
<el-row style="margin-right: -10px; margin-left: -10px">
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item>
|
||||
<LoginFormTitle style="width: 100%"/>
|
||||
<LoginFormTitle style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName">
|
||||
<el-input
|
||||
v-model="loginData.loginForm.tenantName"
|
||||
:placeholder="t('login.tenantNamePlaceholder')"
|
||||
:prefix-icon="iconHouse"
|
||||
link
|
||||
type="primary"
|
||||
/>
|
||||
<el-input v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')"
|
||||
:prefix-icon="iconHouse" link type="primary" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="loginData.loginForm.username"
|
||||
:placeholder="t('login.usernamePlaceholder')"
|
||||
:prefix-icon="iconAvatar"
|
||||
/>
|
||||
<el-input v-model="loginData.loginForm.username" :placeholder="t('login.usernamePlaceholder')"
|
||||
:prefix-icon="iconAvatar" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
v-model="loginData.loginForm.password"
|
||||
:placeholder="t('login.passwordPlaceholder')"
|
||||
:prefix-icon="iconLock"
|
||||
show-password
|
||||
type="password"
|
||||
@keyup.enter="getCode()"
|
||||
/>
|
||||
<el-input v-model="loginData.loginForm.password" :placeholder="t('login.passwordPlaceholder')"
|
||||
:prefix-icon="iconLock" show-password type="password" @keyup.enter="getCode()" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="24"
|
||||
style="padding-right: 10px; padding-left: 10px; margin-top: -20px; margin-bottom: -20px"
|
||||
>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px; margin-top: -20px; margin-bottom: -20px">
|
||||
<el-form-item>
|
||||
<el-row justify="space-between" style="width: 100%">
|
||||
<el-col :span="6">
|
||||
@@ -66,26 +41,21 @@
|
||||
</el-col>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px" class="login-btn-col">
|
||||
<el-form-item>
|
||||
<XButton
|
||||
:loading="loginLoading"
|
||||
:title="t('login.login')"
|
||||
class="w-[100%]"
|
||||
type="primary"
|
||||
@click="getCode()"
|
||||
/>
|
||||
<XButton :loading="loginLoading" :title="t('login.login')" class="w-[100%]" type="primary"
|
||||
@click="getCode()" />
|
||||
<div v-if="loginType == 'easy'" class="w-100% mt-6px flex justify-end">
|
||||
<el-dropdown @command="easyCommand">
|
||||
<div class="mt--2px cursor-pointer">
|
||||
<el-text type="primary">
|
||||
<span class="text-14px">{{ t('login.otherLogin') }}</span>
|
||||
<Icon :size="16" icon="iconamoon:arrow-down-2-light"/>
|
||||
<Icon :size="16" icon="iconamoon:arrow-down-2-light" />
|
||||
</el-text>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<template v-for="item in easyDropdownList" :key="item.label">
|
||||
<el-dropdown-item :command="item">
|
||||
<Icon :size="16" :icon="item.icon"/>
|
||||
<Icon :size="16" :icon="item.icon" />
|
||||
<span>{{ item.label }}</span>
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
@@ -95,13 +65,8 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<Verify
|
||||
ref="verify"
|
||||
:captchaType="captchaType"
|
||||
:imgSize="{ width: '400px', height: '200px' }"
|
||||
mode="pop"
|
||||
@success="handleLogin"
|
||||
/>
|
||||
<Verify ref="verify" :captchaType="captchaType" :imgSize="{ width: '400px', height: '200px' }" mode="pop"
|
||||
@success="handleLogin" />
|
||||
<template v-if="!loginType">
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<!-- <el-form-item>
|
||||
@@ -123,19 +88,12 @@
|
||||
</el-row>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider>
|
||||
<el-divider content-position="center">{{ t('login.otherLogin') }}</el-divider>
|
||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||
<el-form-item>
|
||||
<div class="w-[100%] flex justify-center">
|
||||
<Icon
|
||||
v-for="(item, key) in socialList"
|
||||
:key="key"
|
||||
:icon="item.icon"
|
||||
:size="50"
|
||||
class="anticon cursor-pointer"
|
||||
color="#999"
|
||||
@click="doSocialLogin(item.type)"
|
||||
/>
|
||||
<Icon v-for="(item, key) in socialList" :key="key" :icon="item.icon" :size="50"
|
||||
class="anticon cursor-pointer" color="#999" @click="doSocialLogin(item.type)" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -144,18 +102,18 @@
|
||||
</el-form>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import {ElLoading} from 'element-plus'
|
||||
import { ElLoading } from 'element-plus'
|
||||
import LoginFormTitle from './LoginFormTitle.vue'
|
||||
import type {RouteLocationNormalizedLoaded} from 'vue-router'
|
||||
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
||||
|
||||
import {useIcon} from '@/hooks/web/useIcon'
|
||||
import { useIcon } from '@/hooks/web/useIcon'
|
||||
|
||||
import * as authUtil from '@/utils/auth'
|
||||
import {usePermissionStore} from '@/store/modules/permission'
|
||||
import { usePermissionStore } from '@/store/modules/permission'
|
||||
import * as LoginApi from '@/api/login'
|
||||
import {LoginStateEnum, useFormValid, useLoginState} from './useLogin'
|
||||
import { LoginStateEnum, useFormValid, useLoginState } from './useLogin'
|
||||
|
||||
defineOptions({name: 'LoginForm'})
|
||||
defineOptions({ name: 'LoginForm' })
|
||||
|
||||
interface Props {
|
||||
loginType?: 'easy'
|
||||
@@ -163,15 +121,15 @@ interface Props {
|
||||
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const {t} = useI18n()
|
||||
const { t } = useI18n()
|
||||
const message = useMessage()
|
||||
const iconHouse = useIcon({icon: 'ep:house'})
|
||||
const iconAvatar = useIcon({icon: 'ep:avatar'})
|
||||
const iconLock = useIcon({icon: 'ep:lock'})
|
||||
const iconHouse = useIcon({ icon: 'ep:house' })
|
||||
const iconAvatar = useIcon({ icon: 'ep:avatar' })
|
||||
const iconLock = useIcon({ icon: 'ep:lock' })
|
||||
const formLogin = ref()
|
||||
const {validForm} = useFormValid(formLogin)
|
||||
const {setLoginState, getLoginState} = useLoginState()
|
||||
const {currentRoute, push} = useRouter()
|
||||
const { validForm } = useFormValid(formLogin)
|
||||
const { setLoginState, getLoginState } = useLoginState()
|
||||
const { currentRoute, push } = useRouter()
|
||||
const permissionStore = usePermissionStore()
|
||||
const redirect = ref<string>('')
|
||||
const loginLoading = ref(false)
|
||||
@@ -203,7 +161,7 @@ const socialList = [
|
||||
// { icon: 'ant-design:dingtalk-circle-filled', type: 20 },
|
||||
// { icon: 'ant-design:github-filled', type: 0 },
|
||||
// { icon: 'ant-design:alipay-circle-filled', type: 0 },
|
||||
{icon: 'bx:planet', type: 100},
|
||||
{ icon: 'bx:planet', type: 100 },
|
||||
]
|
||||
|
||||
const easyDropdownList = [
|
||||
@@ -219,15 +177,15 @@ const easyDropdownList = [
|
||||
type: LoginStateEnum.QR_CODE,
|
||||
code: 'page'
|
||||
},
|
||||
{label: t('login.btnWechat'), icon: 'ant-design:wechat-filled', type: 30, code: 'url'},
|
||||
{ label: t('login.btnWechat'), icon: 'ant-design:wechat-filled', type: 30, code: 'url' },
|
||||
{
|
||||
label: t('login.btnDingtalk'),
|
||||
icon: 'ant-design:dingtalk-circle-filled',
|
||||
type: 20,
|
||||
code: 'url'
|
||||
},
|
||||
{label: t('login.btnGitHub'), icon: 'ant-design:github-filled', type: 0, code: 'url'},
|
||||
{label: t('login.btnAlipay'), icon: 'ant-design:alipay-circle-filled', type: 0, code: 'url'}
|
||||
{ label: t('login.btnGitHub'), icon: 'ant-design:github-filled', type: 0, code: 'url' },
|
||||
{ label: t('login.btnAlipay'), icon: 'ant-design:alipay-circle-filled', type: 0, code: 'url' }
|
||||
]
|
||||
|
||||
const easyCommand = (row) => {
|
||||
@@ -308,9 +266,14 @@ const handleLogin = async (params) => {
|
||||
if (redirect.value.indexOf('sso') !== -1) {
|
||||
window.location.href = window.location.href.replace('/login?redirect=', '')
|
||||
} else {
|
||||
push({path: redirect.value || permissionStore.addRouters[0].path})
|
||||
push({ path: redirect.value || permissionStore.addRouters[0].path })
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
catch (e) {
|
||||
loginLoading.value = false
|
||||
loading.value?.close()
|
||||
}
|
||||
finally {
|
||||
loginLoading.value = false
|
||||
loading.value?.close()
|
||||
}
|
||||
@@ -327,7 +290,7 @@ const doSocialLogin = async (type: number) => {
|
||||
await getTenantId()
|
||||
// 如果获取不到,则需要弹出提示,进行处理
|
||||
if (!authUtil.getTenantId()) {
|
||||
await message.prompt('请输入租户名称', t('common.reminder')).then(async ({value}) => {
|
||||
await message.prompt('请输入租户名称', t('common.reminder')).then(async ({ value }) => {
|
||||
const res = await LoginApi.getTenantIdByName(value)
|
||||
authUtil.setTenantId(res)
|
||||
})
|
||||
@@ -356,7 +319,7 @@ watch(
|
||||
}
|
||||
)
|
||||
onMounted(() => {
|
||||
if(redirect.value && import.meta.env.VITE_DEFAULT_SSO =='true'){
|
||||
if (redirect.value && import.meta.env.VITE_DEFAULT_SSO == 'true') {
|
||||
//默认
|
||||
doSocialLogin(100)
|
||||
}
|
||||
|
||||
@@ -50,11 +50,11 @@
|
||||
<Icon icon="ep:position" />
|
||||
委派
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleSign(item)">
|
||||
<Icon icon="ep:plus" />
|
||||
加签
|
||||
</el-button>
|
||||
-->
|
||||
<el-button type="primary" @click="handleSign(item)">
|
||||
<Icon icon="ep:plus" />
|
||||
加签
|
||||
</el-button>
|
||||
-->
|
||||
<el-button type="warning" @click="handleBack(item)">
|
||||
<Icon icon="ep:back" />
|
||||
回退
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
/>
|
||||
</template>
|
||||
<template #menu-left>
|
||||
<el-button type="primary" v-hasPermi="['bpm:process-instance:query']" @click="handleCreate">
|
||||
<el-button type="primary" v-hasPermi="['bpm:process-instance:create']" @click="handleCreate">
|
||||
<Icon icon="ep:plus" class="mr-5px"/>
|
||||
发起流程
|
||||
</el-button>
|
||||
@@ -48,7 +48,7 @@
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
v-hasPermi="['bpm:process-instance:cancel']"
|
||||
v-hasPermi="['bpm:process-instance:query']"
|
||||
@click="handleDetail(row)"
|
||||
>
|
||||
详情
|
||||
@@ -56,8 +56,8 @@
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
v-if="row.result === 1"
|
||||
v-hasPermi="['bpm:process-instance:query']"
|
||||
v-if="row.result === 1|| row.result === 2"
|
||||
v-hasPermi="['bpm:process-instance:cancel']"
|
||||
@click="handleCancel(row)"
|
||||
>
|
||||
取消
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
>
|
||||
<template #menu-left="{ size }">
|
||||
<el-button type="primary" :size="size" @click="menuLeftHandle('aiCreated')">
|
||||
<Icon :size="14" icon="jam:magic-f" />
|
||||
<Icon :size="14" icon="jam:magic-f"/>
|
||||
<span class="ml-3px!">AI建表</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -51,12 +51,12 @@
|
||||
@click="menuLeftHandle('btn')"
|
||||
class="mr-10px"
|
||||
>
|
||||
<Icon :size="14" icon="teenyicons:button-outline" />
|
||||
<Icon :size="14" icon="teenyicons:button-outline"/>
|
||||
<span class="ml-3px!">自定义按钮</span>
|
||||
</el-button>
|
||||
<el-dropdown @command="menuLeftHandle" v-hasPermi="['jeelowcode:web']">
|
||||
<el-button type="primary" :size="size">
|
||||
<Icon :size="14" icon="teenyicons:webpack-outline" />
|
||||
<Icon :size="14" icon="teenyicons:webpack-outline"/>
|
||||
<span class="ml-3px!">前端增强</span>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
@@ -74,7 +74,7 @@
|
||||
@click="menuLeftHandle('sql')"
|
||||
v-hasPermi="['jeelowcode:sql']"
|
||||
>
|
||||
<Icon :size="14" icon="devicon-plain:sqldeveloper" />
|
||||
<Icon :size="14" icon="devicon-plain:sqldeveloper"/>
|
||||
<span class="ml-3px!">SQL增强</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -83,9 +83,20 @@
|
||||
@click="menuLeftHandle('java')"
|
||||
v-hasPermi="['jeelowcode:java']"
|
||||
>
|
||||
<Icon :size="14" icon="hugeicons:java" />
|
||||
<Icon :size="14" icon="hugeicons:java"/>
|
||||
<span class="ml-3px!">JAVA增强</span>
|
||||
</el-button>
|
||||
<!-- 批量同步 -->
|
||||
<el-button
|
||||
type="primary"
|
||||
:size="size"
|
||||
@click="handleBatchSync"
|
||||
v-hasPermi="['jeelowcode:dbform:sync']"
|
||||
>
|
||||
<Icon :size="14" icon="simple-icons:oracle"/>
|
||||
<span class="ml-3px!">批量同步</span>
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
<template #menu="{ size, row }">
|
||||
<div class="flex justify-center flex-items-center">
|
||||
@@ -107,7 +118,7 @@
|
||||
<div class="mt--2px cursor-pointer">
|
||||
<el-text :size="size" type="primary">
|
||||
更多
|
||||
<Icon :size="16" icon="iconamoon:arrow-down-2-light" />
|
||||
<Icon :size="16" icon="iconamoon:arrow-down-2-light"/>
|
||||
</el-text>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
@@ -190,7 +201,8 @@
|
||||
@click="openDataOrigin"
|
||||
:disabled="!tableForm.dataOrigin"
|
||||
>
|
||||
<Icon :size="14" icon="lucide:text-search"></Icon> <span>数据源SQL配置</span>
|
||||
<Icon :size="14" icon="lucide:text-search"></Icon>
|
||||
<span>数据源SQL配置</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -211,10 +223,12 @@
|
||||
<span>表格扩展配置</span>
|
||||
</el-button>
|
||||
<el-button @click="sortPopup = true">
|
||||
<Icon :size="14" icon="mdi:sort"></Icon> <span>默认排序</span>
|
||||
<Icon :size="14" icon="mdi:sort"></Icon>
|
||||
<span>默认排序</span>
|
||||
</el-button>
|
||||
<el-button @click="searchPopup = true">
|
||||
<Icon :size="14" icon="lucide:text-search"></Icon> <span>默认搜索</span>
|
||||
<Icon :size="14" icon="lucide:text-search"></Icon>
|
||||
<span>默认搜索</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -300,7 +314,7 @@
|
||||
</template>
|
||||
<template #optionCondition="{ row }">
|
||||
<template v-for="item in row.optionCondition" :key="item.key">
|
||||
<el-tag v-if="item.value !== 0" size="small"> {{ item.label }}{{ item.value }} </el-tag>
|
||||
<el-tag v-if="item.value !== 0" size="small"> {{ item.label }}{{ item.value }}</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</avue-crud>
|
||||
@@ -417,7 +431,8 @@
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="copySampleStr(key)"
|
||||
>点击复制</el-button
|
||||
>点击复制
|
||||
</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@@ -462,32 +477,32 @@ import {
|
||||
DataOriginOption,
|
||||
AuthConfig
|
||||
} from './components'
|
||||
import { TipView } from '../general/components/index'
|
||||
import {TipView} from '../general/components/index'
|
||||
import * as TableApi from '@/api/design/table'
|
||||
import * as JsApi from '@/api/design/table/jsEnhance'
|
||||
import { dicObj, pageOption, tableInfoOption } from './designData'
|
||||
import { scssEnhanceExample, controlInitExample } from '@/components/LowDesign/src/utils/example'
|
||||
import { formattingLengStr } from '@/utils/lowDesign'
|
||||
import {dicObj, pageOption, tableInfoOption} from './designData'
|
||||
import {scssEnhanceExample, controlInitExample} from '@/components/LowDesign/src/utils/example'
|
||||
import {formattingLengStr} from '@/utils/lowDesign'
|
||||
import controlPath from '@/components/LowDesign/src/controlPath'
|
||||
import useMEDialog from '@/hooks/design/useMEDialog'
|
||||
import useCopyText from '@/hooks/design/useCopyText'
|
||||
import { ElButton, ElLoading } from 'element-plus'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { useRenderVxeColumn } from '../general/components/useRenderVxeColumn'
|
||||
import { useGroup } from '@/hooks/design/useGroup'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {ElButton, ElLoading} from 'element-plus'
|
||||
import {cloneDeep} from 'lodash-es'
|
||||
import {useRenderVxeColumn} from '../general/components/useRenderVxeColumn'
|
||||
import {useGroup} from '@/hooks/design/useGroup'
|
||||
import {checkPermi} from '@/utils/permission'
|
||||
import {ElMessage} from 'element-plus'
|
||||
|
||||
defineOptions({ name: 'TableDesign' })
|
||||
defineOptions({name: 'TableDesign'})
|
||||
|
||||
const { MEDialog, MEData, openMEDialog } = useMEDialog()
|
||||
const { copyText } = useCopyText()
|
||||
const {MEDialog, MEData, openMEDialog} = useMEDialog()
|
||||
const {copyText} = useCopyText()
|
||||
useRenderVxeColumn()
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const router = useRouter() // 路由
|
||||
const { t } = useI18n() // 国际化
|
||||
const { getCurrPermi } = useCrudPermi()
|
||||
const {t} = useI18n() // 国际化
|
||||
const {getCurrPermi} = useCrudPermi()
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const saveLoading = ref(false)
|
||||
@@ -555,7 +570,7 @@ const authPopup = ref({
|
||||
show: false,
|
||||
vBind: {}
|
||||
})
|
||||
const aiCreatedObj = ref({ popup: false, loading: false, describe: '', timer: null as any })
|
||||
const aiCreatedObj = ref({popup: false, loading: false, describe: '', timer: null as any})
|
||||
|
||||
const basicPopup = ref({
|
||||
show: false,
|
||||
@@ -580,9 +595,9 @@ const samplePopup = ref(false)
|
||||
const permission = getCurrPermi(['jeelowcode:dbform'])
|
||||
|
||||
const tableConfigList = [
|
||||
{ label: '表格选择', prop: 'tableSelect', valClass: 'w-75px!' },
|
||||
{ label: '搜索样式', prop: 'searchStyle', valClass: 'w-100px!' },
|
||||
{ label: '操作栏样式', prop: 'operateMenuStyle', labelWidth: '90px', valClass: 'w-100px!' },
|
||||
{label: '表格选择', prop: 'tableSelect', valClass: 'w-75px!'},
|
||||
{label: '搜索样式', prop: 'searchStyle', valClass: 'w-100px!'},
|
||||
{label: '操作栏样式', prop: 'operateMenuStyle', labelWidth: '90px', valClass: 'w-100px!'},
|
||||
{
|
||||
label: '操作栏最大横排数',
|
||||
prop: 'maxMenuNum',
|
||||
@@ -598,7 +613,7 @@ const tableConfigList = [
|
||||
showKey: 'tableType',
|
||||
showVal: 1,
|
||||
valClass: 'w-114px!',
|
||||
changeFun: ({ value }) => {
|
||||
changeFun: ({value}) => {
|
||||
let dicData = cloneDeep(dicObj.tableConfig)
|
||||
if (value == 'card') {
|
||||
dicData = dicData.filter(
|
||||
@@ -632,8 +647,8 @@ const tableConfigList = [
|
||||
showVal: 'expand',
|
||||
valClass: 'w-90px!'
|
||||
},
|
||||
{ label: '树表样式', prop: 'treeStyle', showKey: 'tableType', showVal: 2 },
|
||||
{ label: '树表模式', prop: 'treeMode', showKey: 'tableType', showVal: 2 }
|
||||
{label: '树表样式', prop: 'treeStyle', showKey: 'tableType', showVal: 2},
|
||||
{label: '树表模式', prop: 'treeMode', showKey: 'tableType', showVal: 2}
|
||||
]
|
||||
|
||||
const menuMoreList = [
|
||||
@@ -642,14 +657,14 @@ const menuMoreList = [
|
||||
type: 'sync',
|
||||
isShow: (row) => row.isDbSync == 'N' && checkPermi(['jeelowcode:dbform:sync'])
|
||||
},
|
||||
{ label: '功能测试', type: 'test' },
|
||||
{ label: '路由地址', type: 'address' },
|
||||
{ label: '接口地址', type: 'apiUrl' },
|
||||
{ label: '租户权限配置', type: 'auth' },
|
||||
{ label: '复制表', type: 'copy', isShow: () => checkPermi(['jeelowcode:dbform:create']) },
|
||||
{ label: 'js增强解锁', type: 'jsUnlock', isShow: () => checkPermi(['jeelowcode:web']) },
|
||||
{ label: 'scss增强解锁', type: 'scssUnlock', isShow: () => checkPermi(['jeelowcode:web']) },
|
||||
{ label: '删除', type: 'del', isShow: () => checkPermi(['jeelowcode:dbform:delete']) }
|
||||
{label: '功能测试', type: 'test'},
|
||||
{label: '路由地址', type: 'address'},
|
||||
{label: '接口地址', type: 'apiUrl'},
|
||||
{label: '租户权限配置', type: 'auth'},
|
||||
{label: '复制表', type: 'copy', isShow: () => checkPermi(['jeelowcode:dbform:create'])},
|
||||
{label: 'js增强解锁', type: 'jsUnlock', isShow: () => checkPermi(['jeelowcode:web'])},
|
||||
{label: 'scss增强解锁', type: 'scssUnlock', isShow: () => checkPermi(['jeelowcode:web'])},
|
||||
{label: '删除', type: 'del', isShow: () => checkPermi(['jeelowcode:dbform:delete'])}
|
||||
]
|
||||
|
||||
useCrudHeight(crudRef)
|
||||
@@ -747,8 +762,8 @@ const tableFormVerify = (type) => {
|
||||
customFormRef.value.validate((bool, done, msg) => {
|
||||
done()
|
||||
if (!bool) return reject(msg)
|
||||
const { tableName, tableType, tableClassify } = tableForm.value
|
||||
const subTable = { bool: true, len: 0 }
|
||||
const {tableName, tableType, tableClassify} = tableForm.value
|
||||
const subTable = {bool: true, len: 0}
|
||||
if (tableClassify == 2 && tableName && tableName.indexOf('view_') != 0) {
|
||||
message.warning('视图表的表名请以 view_ 开头')
|
||||
return reject('message')
|
||||
@@ -813,7 +828,7 @@ const tableFormVerify = (type) => {
|
||||
|
||||
if (messageText) {
|
||||
handleVerifyError(tabKey, item._X_ROW_KEY, index)
|
||||
ElMessage({ dangerouslyUseHTMLString: true, message: messageText })
|
||||
ElMessage({dangerouslyUseHTMLString: true, message: messageText})
|
||||
errText = 'message'
|
||||
break
|
||||
}
|
||||
@@ -846,7 +861,7 @@ const tableFormVerify = (type) => {
|
||||
: ''
|
||||
}
|
||||
if (key == 'summaryList') {
|
||||
const { sqlType, sqlValue } = item.summaryJson
|
||||
const {sqlType, sqlValue} = item.summaryJson
|
||||
itemObj.summaryType = 'bottom'
|
||||
itemObj.summarySql = sqlType == 'custom' ? sqlValue : sqlType
|
||||
itemObj.summaryJson = JSON.stringify(item.summaryJson)
|
||||
@@ -938,7 +953,7 @@ const contrastEditData = (infoData) => {
|
||||
}
|
||||
|
||||
const setApiDetailData = (data) => {
|
||||
apiDetailData.value = { delIdVo: {} }
|
||||
apiDetailData.value = {delIdVo: {}}
|
||||
for (const key in data) {
|
||||
let listKey = key
|
||||
if (['summaryBottomList', 'summaryTopList'].includes(listKey)) listKey = 'summaryList'
|
||||
@@ -990,9 +1005,9 @@ const menuLeftHandle = (type) => {
|
||||
if (aiCreatedObj.value.timer) clearInterval(aiCreatedObj.value.timer)
|
||||
}
|
||||
}
|
||||
const menuHandle = async ({ type, row, index }) => {
|
||||
const menuHandle = async ({type, row, index}) => {
|
||||
if (type == 'edit') crudRef.value.rowEdit(row, index)
|
||||
else if (type == 'test') router.push({ path: '/low/table/test/' + row.id })
|
||||
else if (type == 'test') router.push({path: '/low/table/test/' + row.id})
|
||||
else if (type == 'sync') syncDbTable(row)
|
||||
else if (type == 'address') showAddress(row)
|
||||
else if (type == 'apiUrl') showApiUrl(row)
|
||||
@@ -1002,7 +1017,7 @@ const menuHandle = async ({ type, row, index }) => {
|
||||
else if (type == 'auth') {
|
||||
authPopup.value = {
|
||||
show: true,
|
||||
vBind: { dbformId: row.id, tableName: row.tableName, tableDescribe: row.tableDescribe }
|
||||
vBind: {dbformId: row.id, tableName: row.tableName, tableDescribe: row.tableDescribe}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1014,7 +1029,7 @@ const syncDbTable = (row) => {
|
||||
title: '同步数据库',
|
||||
width: '400px',
|
||||
isCenter: true,
|
||||
dialogParams: { alignCenter: true },
|
||||
dialogParams: {alignCenter: true},
|
||||
footerBtn: [
|
||||
{
|
||||
name: '取 消',
|
||||
@@ -1023,7 +1038,7 @@ const syncDbTable = (row) => {
|
||||
{
|
||||
name: '确 定',
|
||||
loading: true,
|
||||
params: { type: 'primary' },
|
||||
params: {type: 'primary'},
|
||||
clickFun: async (done) => {
|
||||
if (syncData.value.value == 'force') {
|
||||
await message.prompt(
|
||||
@@ -1086,7 +1101,7 @@ const showApiUrl = async (row) => {
|
||||
value: `/jeelowcode/${isOpen ? 'open' : 'dbform-data'}/save/batch/${row.id}`,
|
||||
tipText: '接口参数格式:data:[ { 新增的数据... },{ ... } ]'
|
||||
},
|
||||
{ label: '编辑数据[put]', value: `/jeelowcode/dbform-data/edit/${row.id}` },
|
||||
{label: '编辑数据[put]', value: `/jeelowcode/dbform-data/edit/${row.id}`},
|
||||
{
|
||||
label: '批量编辑数据[put]',
|
||||
value: `/jeelowcode/dbform-data/edit/batch/${row.id}`,
|
||||
@@ -1107,19 +1122,19 @@ const showApiUrl = async (row) => {
|
||||
let list: VNode[] = []
|
||||
apiList.forEach((item) => {
|
||||
list.push(
|
||||
h('div', { style: { marginBottom: '10px', border: ' 1px solid #eee', padding: '10px' } }, [
|
||||
h('div', {style: {marginBottom: '10px', border: ' 1px solid #eee', padding: '10px'}}, [
|
||||
h('div', [
|
||||
h('span', { style: { fontWeight: 600, fontSize: '14px' } }, item.label + ':'),
|
||||
h('span', {style: {fontWeight: 600, fontSize: '14px'}}, item.label + ':'),
|
||||
h(
|
||||
ElButton,
|
||||
{ size: 'small', type: 'primary', onClick: () => copyText(item.value) },
|
||||
{size: 'small', type: 'primary', onClick: () => copyText(item.value)},
|
||||
() => '复制'
|
||||
)
|
||||
]),
|
||||
h('div', { style: { fontSize: '12px' } }, item.value),
|
||||
h('div', {style: {fontSize: '12px'}}, item.value),
|
||||
h(
|
||||
'div',
|
||||
{ style: { display: !!item.tipText, fontSize: '12px', color: '#E6A23C' } },
|
||||
{style: {display: !!item.tipText, fontSize: '12px', color: '#E6A23C'}},
|
||||
item.tipText
|
||||
)
|
||||
])
|
||||
@@ -1127,11 +1142,11 @@ const showApiUrl = async (row) => {
|
||||
})
|
||||
message.alert('', '接口地址', {
|
||||
message: () => {
|
||||
return h('div', { width: '360px' }, list)
|
||||
return h('div', {width: '360px'}, list)
|
||||
},
|
||||
confirmButtonText: '关闭',
|
||||
dangerouslyUseHTMLString: true,
|
||||
customStyle: { width: '384px' }
|
||||
customStyle: {width: '384px'}
|
||||
})
|
||||
}
|
||||
const copyDbTable = (row) => {
|
||||
@@ -1146,7 +1161,7 @@ const copyDbTable = (row) => {
|
||||
if (!RExp.test(value)) return '表名只能使用小写字母、数字、下划线,并以字母开头'
|
||||
}
|
||||
})
|
||||
.then(async ({ value }) => {
|
||||
.then(async ({value}) => {
|
||||
loading.value = true
|
||||
const bool = await TableApi.verifyDbName(value)
|
||||
if (bool) {
|
||||
@@ -1169,7 +1184,7 @@ const unlockEnhance = (type, row) => {
|
||||
|
||||
const openWebEnhance = async (enhanceType) => {
|
||||
loading.value = true
|
||||
jsEnhanceData.value = { jsJson: '' }
|
||||
jsEnhanceData.value = {jsJson: ''}
|
||||
const dbformId = tableSelect.value[0].id
|
||||
const detailData = await JsApi.getJsDetail({
|
||||
dbformId,
|
||||
@@ -1217,7 +1232,7 @@ const openWebEnhance = async (enhanceType) => {
|
||||
},
|
||||
footerBtn: [
|
||||
{
|
||||
params: { type: 'primary' },
|
||||
params: {type: 'primary'},
|
||||
name: '保 存',
|
||||
icon: 'mingcute:save-line',
|
||||
loading: true,
|
||||
@@ -1228,7 +1243,7 @@ const openWebEnhance = async (enhanceType) => {
|
||||
}
|
||||
},
|
||||
{
|
||||
params: { type: 'success' },
|
||||
params: {type: 'success'},
|
||||
name: '保存并关闭',
|
||||
icon: 'mingcute:save-line',
|
||||
loading: true,
|
||||
@@ -1257,11 +1272,11 @@ const openWebEnhance = async (enhanceType) => {
|
||||
}
|
||||
if (enhanceType == 'js') {
|
||||
params['providerType'] = 'tableJsEnhance'
|
||||
params['otherParams'] = { type: 'simple', width: '300px', tipKeyList: ['TableJsEnhance'] }
|
||||
params['otherParams'] = {type: 'simple', width: '300px', tipKeyList: ['TableJsEnhance']}
|
||||
params['language'] = 'javascript'
|
||||
params['headerBtn'] = [
|
||||
{
|
||||
params: { type: 'success' },
|
||||
params: {type: 'success'},
|
||||
name: '控件使用示例',
|
||||
icon: 'jam:code-sample',
|
||||
clickFun: async () => (samplePopup.value = true)
|
||||
@@ -1279,7 +1294,7 @@ const openWebEnhance = async (enhanceType) => {
|
||||
}
|
||||
}
|
||||
|
||||
openMEDialog({ params, prop: 'jsJson' }, jsEnhanceData.value)
|
||||
openMEDialog({params, prop: 'jsJson'}, jsEnhanceData.value)
|
||||
isUnload.value = true
|
||||
}
|
||||
const handleWebEnhance = (dbformId, enhanceType) => {
|
||||
@@ -1301,16 +1316,16 @@ const handleWebEnhance = (dbformId, enhanceType) => {
|
||||
})
|
||||
}
|
||||
|
||||
const cellStyle = ({ row, columnIndex }) => {
|
||||
const cellStyle = ({row, columnIndex}) => {
|
||||
if (columnIndex == 6) {
|
||||
return { color: row.isDbSync == 'Y' ? '#67C23A' : '#F56C6C' }
|
||||
return {color: row.isDbSync == 'Y' ? '#67C23A' : '#F56C6C'}
|
||||
}
|
||||
if (columnIndex == 5) {
|
||||
let color = ''
|
||||
if (row.tableClassify == 1) color = '#409EFF'
|
||||
else if (row.tableClassify == 2) color = '#909399'
|
||||
else if (row.tableClassify == 3) color = '#E6A23C'
|
||||
return { color }
|
||||
return {color}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1327,7 +1342,7 @@ const radioClick = (row) => {
|
||||
|
||||
const setTreeLabelDicData = (dicData) => {
|
||||
if (dicData.length == 0) {
|
||||
dicData = [{ label: '请先添加字段', value: 'low', disabled: true }]
|
||||
dicData = [{label: '请先添加字段', value: 'low', disabled: true}]
|
||||
}
|
||||
customFormRef.value.updateDic('treeLabelField', dicData)
|
||||
}
|
||||
@@ -1354,7 +1369,7 @@ const openDataOrigin = () => {
|
||||
})
|
||||
const filedData = [...tableInfoRef.value.infoData.basics, ...tableInfoRef.value.tableInfoDefault]
|
||||
dataOriginPopup.value.viewField = filedData.map((item) => {
|
||||
return { label: item.fieldName, value: item.fieldCode }
|
||||
return {label: item.fieldName, value: item.fieldCode}
|
||||
})
|
||||
dataOriginPopup.value.show = true
|
||||
}
|
||||
@@ -1391,14 +1406,14 @@ const analysisDataOrigin = async () => {
|
||||
return item
|
||||
})
|
||||
}
|
||||
let { infoData } = tableInfoOption.formattingInitData(analysisData)
|
||||
let {infoData} = tableInfoOption.formattingInitData(analysisData)
|
||||
infoData = infoData.map((item) => {
|
||||
for (const key in item) {
|
||||
if (item[key] === null || item[key] === undefined || key == 'fieldList_id') {
|
||||
delete item[key]
|
||||
}
|
||||
}
|
||||
return { ...cloneDeep(tableInfoOption.infoDefaultData.basics), ...item }
|
||||
return {...cloneDeep(tableInfoOption.infoDefaultData.basics), ...item}
|
||||
})
|
||||
setInfoBasics(infoData)
|
||||
message.success('解析成功')
|
||||
@@ -1422,11 +1437,11 @@ const getSqlFormConfig = async () => {
|
||||
(item) => !tableInfoOption.disabledArr.includes(item.fieldCode) || item.fieldCode == 'pid'
|
||||
)
|
||||
fieldList = fieldList.map((item) => {
|
||||
return { ...cloneDeep(tableInfoOption.infoDefaultData.basics), ...item }
|
||||
return {...cloneDeep(tableInfoOption.infoDefaultData.basics), ...item}
|
||||
})
|
||||
setInfoBasics(fieldList)
|
||||
message.success('生成成功')
|
||||
let { tableName } = customFormOption.value.column
|
||||
let {tableName} = customFormOption.value.column
|
||||
tableName['disabled'] = true
|
||||
})
|
||||
.finally(() => (sqlFormLoading.value = false))
|
||||
@@ -1457,7 +1472,7 @@ const handleAiCreatedTable = async () => {
|
||||
(item) => !tableInfoOption.disabledArr.includes(item.fieldCode) || item.fieldCode == 'pid'
|
||||
)
|
||||
data.fieldModelList = data.fieldModelList.map((item) => {
|
||||
return { ...cloneDeep(tableInfoOption.infoDefaultData.basics), ...item }
|
||||
return {...cloneDeep(tableInfoOption.infoDefaultData.basics), ...item}
|
||||
})
|
||||
aiCreatedObj.value.popup = false
|
||||
crudRef.value.rowAdd()
|
||||
@@ -1499,7 +1514,7 @@ const getTableData = async () => {
|
||||
if (typeof item[key] == 'number') {
|
||||
let val: number | string = item[key]
|
||||
if (['jsCou', 'scssCou'].includes(key)) val = val > 0 ? '√' : val
|
||||
item.optionCondition.push({ label: couKey[key], value: val, key })
|
||||
item.optionCondition.push({label: couKey[key], value: val, key})
|
||||
}
|
||||
}
|
||||
return item
|
||||
@@ -1524,7 +1539,8 @@ const searchChange = (params, done) => {
|
||||
|
||||
/** 清空按钮操作 */
|
||||
const resetChange = () => {
|
||||
searchChange({}, () => {})
|
||||
searchChange({}, () => {
|
||||
})
|
||||
}
|
||||
|
||||
const sizeChange = (pageSize) => {
|
||||
@@ -1542,7 +1558,7 @@ const beforeOpen = async (done, type) => {
|
||||
isTableInfo.value = false
|
||||
const groupData = cloneDeep(treeData.value)
|
||||
customFormOption.value.column.groupDbformId.dicData = groupData[0].children
|
||||
const { tableName, subTableListStr } = customFormOption.value.column
|
||||
const {tableName, subTableListStr} = customFormOption.value.column
|
||||
if (['edit', 'view'].includes(type) && tableForm.value.id) {
|
||||
loading.value = true
|
||||
const data = await TableApi.getDbDetail(tableForm.value.id, ['all'])
|
||||
@@ -1550,7 +1566,7 @@ const beforeOpen = async (done, type) => {
|
||||
data.dbForm.tableConfig = data.dbForm.tableConfig?.split(',') || []
|
||||
data.dbForm.dataConfig = data.dbForm.dataConfig?.split(',') || []
|
||||
editInfoData.value = data
|
||||
tableForm.value = { ...data.dbForm }
|
||||
tableForm.value = {...data.dbForm}
|
||||
tableName['disabled'] = true
|
||||
tableName['rules'] = []
|
||||
subTableListStr['display'] = tableForm.value.tableType == 3 && tableForm.value.subTableListStr
|
||||
@@ -1585,7 +1601,7 @@ const beforeOpen = async (done, type) => {
|
||||
searchStyle: 'default'
|
||||
}
|
||||
tableName['disabled'] = false
|
||||
tableName['rules'] = [{ validator: pageOption.tableName_required, trigger: 'blur' }] as any
|
||||
tableName['rules'] = [{validator: pageOption.tableName_required, trigger: 'blur'}] as any
|
||||
subTableListStr['display'] = false
|
||||
if (groupValue.value) tableForm.value.groupDbformId = groupValue.value
|
||||
authValue.value = ''
|
||||
@@ -1648,8 +1664,8 @@ const rowSave = async (formData, done, loading) => {
|
||||
const form = handleApiFormData(formData)
|
||||
tableFormVerify('add')
|
||||
.then(async (infoData: object) => {
|
||||
const elLoading = ElLoading.service({ fullscreen: true })
|
||||
let bool = await TableApi.saveDbData({ dbForm: { ...form }, ...infoData }).catch(() => false)
|
||||
const elLoading = ElLoading.service({fullscreen: true})
|
||||
let bool = await TableApi.saveDbData({dbForm: {...form}, ...infoData}).catch(() => false)
|
||||
if (bool) {
|
||||
message.success(t('common.createSuccess'))
|
||||
resetChange()
|
||||
@@ -1662,7 +1678,7 @@ const rowSave = async (formData, done, loading) => {
|
||||
let key = Object.keys(error)[0]
|
||||
message.info(error[key][0].message)
|
||||
} else if (error !== 'message') {
|
||||
message.alert(error, '请修改', { dangerouslyUseHTMLString: true })
|
||||
message.alert(error, '请修改', {dangerouslyUseHTMLString: true})
|
||||
}
|
||||
loading()
|
||||
})
|
||||
@@ -1680,7 +1696,7 @@ const rowUpdate = async (formData, index?, done?, loading?) => {
|
||||
const form = handleApiFormData(formData)
|
||||
tableFormVerify('edit')
|
||||
.then(async (infoData: object) => {
|
||||
let bool = await TableApi.updateDbData({ dbForm: { ...form }, ...infoData }).catch(
|
||||
let bool = await TableApi.updateDbData({dbForm: {...form}, ...infoData}).catch(
|
||||
() => false
|
||||
)
|
||||
if (bool) {
|
||||
@@ -1702,7 +1718,7 @@ const rowUpdate = async (formData, index?, done?, loading?) => {
|
||||
let key = Object.keys(error)[0]
|
||||
message.info(error[key][0].message)
|
||||
} else if (error !== 'message') {
|
||||
message.alert(error, '请修改', { dangerouslyUseHTMLString: true })
|
||||
message.alert(error, '请修改', {dangerouslyUseHTMLString: true})
|
||||
}
|
||||
loading()
|
||||
})
|
||||
@@ -1738,13 +1754,35 @@ const rowDel = async (form) => {
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getTableData()
|
||||
} catch {}
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
const beforeUnload = (event) => {
|
||||
if (isUnload.value) return (event.returnValue = '您确定要关闭页面吗?')
|
||||
}
|
||||
|
||||
/** 批量同步 **/
|
||||
const handleBatchSync = async () => {
|
||||
// 首先需要查询有没有需要同步的表单,如果没有则提示消息并结束,如果有则打开弹窗
|
||||
let searchObj = {
|
||||
isDbSync: 'N',
|
||||
pageNo: tablePage.value.currentPage,
|
||||
pageSize: -1
|
||||
}
|
||||
const data = await TableApi.getDbList(searchObj)
|
||||
if (data?.records?.length > 0) {
|
||||
// 将data.records取出来,每个记录的id作为row.id,并且发起普通同步
|
||||
const promises = data.records.map((row) => TableApi.asyncDbData(row.id, 'default'))
|
||||
await Promise.all(promises).catch(() => message.alert('同步失败'))
|
||||
// 刷新列表
|
||||
getTableData()
|
||||
} else {
|
||||
// 没有需要同步的表单,提示信息并结束方法
|
||||
message.info('没有需要同步的表单')
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(async () => {
|
||||
window.addEventListener('beforeunload', beforeUnload)
|
||||
|
||||
@@ -32,7 +32,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
// 本地跨域代理. 目前注释的原因:暂时没有用途,server 端已经支持跨域
|
||||
proxy: {
|
||||
['/admin-api']: {
|
||||
target: env.VITE_BASE_URL,
|
||||
target: 'http://10.28.117.100:48080',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(new RegExp(`^/admin-api`), ''),
|
||||
|
||||
Reference in New Issue
Block a user