Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	vite.config.ts
This commit is contained in:
XieYongHong 2023-07-03 18:09:21 +08:00
commit d1ff921f6f
11 changed files with 185 additions and 82 deletions

View File

@ -1,11 +1,9 @@
<template>
<div class="box">
<div class="box-item" v-if="pageIndex > 0">
<j-button
@click="onLeft"
shape="circle"
class="box-item-action"
>+{{ pageIndex * showLength }}</j-button>
<div class="box-item-action" @click="onLeft">
<AIcon type="LeftOutlined" />
</div>
</div>
<div class="box-item" v-for="item in getData" :key="item.id">
<slot name="card" v-bind="item"></slot>
@ -14,11 +12,9 @@
<slot name="add"></slot>
</div>
<div class="box-item" v-if="(pageIndex + 1) * showLength < data.length">
<j-button
shape="circle"
class="box-item-action"
@click="onRight"
>+{{ data.length - (pageIndex + 1) * showLength }}</j-button>
<div class="box-item-action" @click="onRight">
<AIcon type="RightOutlined" />
</div>
</div>
</div>
</template>
@ -70,6 +66,16 @@ const onLeft = () => {
margin: 5px;
.box-item {
margin-left: 10px;
.box-item-action {
width: 12px;
background-color: #F7F8FA;
padding: 15px 0;
text-align: center;
font-size: 12px;
color: #666666;
cursor: pointer;
}
}
}
</style>

View File

@ -89,7 +89,11 @@ const clickBind = (id: string) => {
*/
function getSsoBinds() {
getSsoBinds_api().then((resp: any) => {
if (resp.status === 200) bindList.value = resp.result;
if (resp.status === 200) {
bindList.value = resp.result.filter((item: any) => {
return !item.features.includes('ssoUnsupportedRedirect')
})
}
});
}

View File

@ -262,7 +262,7 @@ const onSave = (dt: any) => {
.box-item {
margin-left: 10px;
.box-item-img {
width: 60px;
width: 50px;
display: flex;
justify-content: center;
align-items: center;

View File

@ -19,18 +19,20 @@
Hi, {{ user.userInfos?.name }}
</div>
<div class="person-header-item-info-right-info">
<div>
<j-tag
<!-- <div class="tag-box">
<div
v-for="i in user.userInfos?.orgList || []"
:key="i?.id"
>{{ i?.name }}</j-tag
class="tag"
>{{ i?.name }}</div
>
</div>
<div>
<j-tag
</div> -->
<div class="tag-box">
<div
v-for="i in user.userInfos?.roleList || []"
:key="i?.id"
>{{ i?.name }}</j-tag
class="tag"
><j-ellipsis>{{ i?.name }}</j-ellipsis></div
>
</div>
</div>
@ -216,8 +218,17 @@ onUnmounted(() => {
font-weight: 500;
}
.person-header-item-info-right-info {
div {
margin: 5px 0;
.tag-box {
margin-top: 15px;
display: flex;
.tag {
background-color: #F7F8FA;
border-radius: 32px;
margin-right: 8px;
padding: 0 14px;
color: #333333;
}
}
}
}

View File

@ -39,7 +39,7 @@
:options="msgType"
v-model="formData.provider"
@change="handleProviderChange"
:disabled="route.query.provider"
:disabled="flag"
/>
</j-form-item>
<!-- 钉钉 -->
@ -340,6 +340,7 @@ import Doc from './doc/index';
const router = useRouter();
const route = useRoute();
const useForm = Form.useForm;
const flag = ref<boolean>(false)
//
const msgType = ref([
@ -550,7 +551,7 @@ const handleSubmit = () => {
}
if (res?.success) {
message.success('保存成功');
if (route.query.notifyType) {
if (route.query?.notifyType) {
// @ts-ignore
window?.onTabSaveSuccess(res.result);
setTimeout(() => window.close(), 300);
@ -569,10 +570,14 @@ const handleSubmit = () => {
watchEffect(() => {
if(route.query?.notifyType) {
formData.value.type = route.query.notifyType as string
}
if(route.query?.provider) {
formData.value.provider = route.query.provider as string
formData.value.type = route.query.notifyType as string;
if(route.query.notifyType === 'dingTalk') {
formData.value.provider = 'dingTalkMessage';
flag.value = true
} else {
flag.value = false
}
handleTypeChange()
}
})
</script>

View File

@ -42,6 +42,7 @@
:options="msgType"
v-model="formData.provider"
@change="handleProviderChange"
:disabled="flag"
/>
</j-form-item>
<j-form-item
@ -65,6 +66,7 @@
v-model:value="formData.configId"
placeholder="请选择绑定配置"
@change="handleConfigChange"
:disabled="flag"
>
<j-select-option
v-for="(item, index) in configList"
@ -767,6 +769,8 @@ const router = useRouter();
const route = useRoute();
const useForm = Form.useForm;
const formRef = ref()
const flag = ref<boolean>(false)
//
const msgType = ref([
{
@ -854,7 +858,12 @@ const resetPublicFiles = () => {
break;
}
formData.value.configId = undefined;
if(route.query?.notifierId){
formData.value.configId = route.query?.notifierId as string
flag.value = true
} else {
formData.value.configId = undefined;
}
formData.value.variableDefinitions = [];
handleMessageTypeChange();
// console.log('formData.value.template: ', formData.value.template);
@ -868,7 +877,7 @@ watch(
formData.value.provider =
route.params.id !== ':id'
? formData.value.provider
: msgType.value[0].value;
: msgType.value?.[0]?.value;
if (val !== 'email') getConfigList();
@ -1239,7 +1248,13 @@ const handleSubmit = () => {
if (res?.success) {
message.success('保存成功');
router.back();
if (route.query?.notifyType) {
// @ts-ignore
window?.onTabSaveSuccess(res.result);
setTimeout(() => window.close(), 300);
} else {
router.back();
}
}
})
.catch((err) => {
@ -1249,4 +1264,21 @@ const handleSubmit = () => {
btnLoading.value = false;
});
};
watchEffect(() => {
if(route.query?.notifyType) {
formData.value.type = route.query.notifyType as string;
if(route.query.notifyType === 'dingTalk') {
formData.value.provider = 'dingTalkMessage';
flag.value = true
} else {
flag.value = false
}
handleTypeChange()
}
if(route.query?.notifierId){
formData.value.configId = route.query?.notifierId as string
flag.value = true
}
})
</script>

View File

@ -14,6 +14,19 @@
/>
</j-tooltip>
</div>
<div class="child-item-left-auth" :class="{ disabled: !checked }">
<j-tooltip :title="!update ? '暂无权限,请联系管理员' : ''">
<j-button
:disabled="!update || !checked"
type="text"
@click="onAuth"
>
<span v-if="!auth.length" class="child-item-left-auth-lock" ><AIcon type="LockFilled" /></span>
<span v-else class="child-item-left-auth-key"><AIcon type="KeyOutlined" /></span>
<span class="child-item-left-auth-text">权限控制</span>
</j-button>
</j-tooltip>
</div>
</div>
<div class="child-item-right" :class="{ disabled: !checked }">
<MCarousel :data="data?.channels">
@ -99,24 +112,6 @@
</div>
<div class="box-item-text"></div>
</div>
<div class="child-item-right-auth">
<j-tooltip :title="!update ? '暂无权限,请联系管理员' : ''">
<j-button
:disabled="!update"
type="text"
@click="onAuth"
>
<div
class="child-item-right-auth-btn"
:class="{ active: auth.length }"
>
<AIcon type="UserOutlined" />
<span>权限控制</span>
</div>
</j-button>
</j-tooltip>
</div>
</div>
</div>
</j-spin>
@ -299,7 +294,17 @@ const onAction = (e: boolean) => {
{
name: '站内信',
channelProvider: 'inside-mail',
grant: {},
grant: {
role: {
idList: [],
},
permissions: [
{
id: 'alarm-config',
actions: ['query'],
},
],
},
},
],
};
@ -407,11 +412,40 @@ const onSave = (_data: any) => {
div {
display: flex;
margin-right: 30px;
margin-right: 24px;
flex-direction: column;
justify-content: center;
align-items: center;
}
.child-item-left-auth {
// margin-left: 20px;
:deep(.ant-btn) {
height: 78px;
}
.child-item-left-auth-text {
color: #666666;
}
.child-item-left-auth-key {
color: #00C800;
font-size: 18px;
margin-right: 10px;
}
.child-item-left-auth-lock{
color: @primary-color;
font-size: 18px;
margin-right: 10px;
}
&.disabled {
.child-item-left-auth-key, .child-item-left-auth-lock {
color: #666666 !important;
}
}
}
}
.child-item-right {
@ -448,28 +482,6 @@ const onSave = (_data: any) => {
align-items: center;
}
.child-item-right-auth {
margin-left: 20px;
:deep(.ant-btn) {
height: 78px;
}
.child-item-right-auth-btn {
height: 78px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
&:hover {
color: @primary-color-hover;
}
&.active {
color: @primary-color;
}
}
}
&.disabled {
filter: grayscale(100%);
}

View File

@ -11,13 +11,13 @@
<AIcon type="InfoCircleOutlined" />
钉钉群机器人类型的配置在当前页面将被过滤
</div>
<!-- <PermissionButton
<PermissionButton
@click="onAdd"
type="primary"
:hasPermission="['notice/Config:add']"
>
新增
</PermissionButton> -->
</PermissionButton>
</div>
<div style="height: 400px; overflow-y: auto">
<JProTable
@ -27,6 +27,7 @@
:bodyStyle="{
padding: 0,
}"
ref="tableRef"
:alertRender="false"
:params="params"
:gridColumn="2"
@ -111,6 +112,7 @@ const getMethodTxt = (type: string) => {
const params = ref<Record<string, any>>({});
const _selectedRowKeys = ref<string[]>([]);
const tableRef = ref<any>();
const columns = [
{
@ -187,9 +189,12 @@ const handleClick = (dt: any) => {
};
const onAdd = () => {
const tab: any = window.open(`${origin}/#/iot/notice/Config/detail/:id?notifyType=${noticeType.get(props.notifyType)}&provider=${props.notifyType === 'notifier-dingTalk' ? 'dingTalkRobotWebHook' : ''}`);
const tab: any = window.open(`${origin}/#/iot/notice/Config/detail/:id?notifyType=${noticeType.get(props.notifyType)}`);
tab.onTabSaveSuccess = (value: any) => {
console.log(value)
_selectedRowKeys.value = [value.id];
emit('update:value', value.id);
emit('change', { provider: value?.provider, value: value.id });
tableRef.value?.reload()
};
};

View File

@ -6,9 +6,18 @@
@search="handleSearch"
class="action-search"
/>
<div class="alert">
<AIcon type="InfoCircleOutlined" />
已规定固定收信人的模板在当前页面将被过滤
<div class="header">
<div class="alert">
<AIcon type="InfoCircleOutlined" />
已规定固定收信人的模板在当前页面将被过滤
</div>
<PermissionButton
@click="onAdd"
type="primary"
:hasPermission="['notice/Template:add']"
>
新增
</PermissionButton>
</div>
<div style="height: 400px; overflow-y: auto">
<JProTable
@ -18,6 +27,7 @@
:bodyStyle="{
padding: 0,
}"
ref="tableRef"
:alertRender="false"
:params="params"
:gridColumn="2"
@ -84,7 +94,7 @@
<script lang="ts" setup>
import TemplateApi from '@/api/notice/template';
import { MSG_TYPE, NOTICE_METHOD } from '@/views/notice/const';
import { _variableMap } from '../../../data';
import { noticeType, _variableMap } from '../../../data';
const props = defineProps({
notifierId: {
type: String,
@ -94,6 +104,10 @@ const props = defineProps({
type: String,
default: '',
},
notifyType: {
type: String,
default: '',
},
});
const emit = defineEmits(['update:value', 'change', 'update:detail']);
@ -106,6 +120,8 @@ const getMethodTxt = (type: string) => {
return NOTICE_METHOD.find((f) => f.value === type)?.label;
};
const tableRef = ref<any>();
const params = ref<Record<string, any>>({});
const _selectedRowKeys = ref<string[]>([]);
@ -184,6 +200,17 @@ const handleData = async (e: any) => {
};
};
const onAdd = () => {
const tab: any = window.open(`${origin}/#/iot/notice/Template/detail/:id?notifyType=${noticeType.get(props.notifyType)}&notifierId=${props.notifierId}`);
tab.onTabSaveSuccess = (value: any) => {
_selectedRowKeys.value = [value.id];
emit('update:value', value.id);
emit('change', { templateName: value?.name, value: value?.id });
emit('update:detail', value);
tableRef.value?.reload()
};
};
watch(
() => props.value,
(newValue) => {

View File

@ -27,6 +27,7 @@
<template v-if="current === 2">
<NotifyTemplate
:value="formModel.channelConfiguration.templateId"
:notifyType="formModel.channelProvider"
:notifierId="formModel.channelConfiguration.notifierId"
@change="onTemplateChange"
/>

View File

@ -94,10 +94,10 @@ export default defineConfig(({ mode}) => {
[env.VITE_APP_BASE_API]: {
// target: 'http://192.168.32.226:8844',
// target: 'http://192.168.32.244:8881',
// target: 'http://192.168.32.163:8844', //张季本地
// target: 'http://192.168.32.163:8844', //张季本地
// target: 'http://120.77.179.54:8844', // 120测试
target: 'http://192.168.33.46:8844', // 本地开发环境
ws: 'ws://120.77.179.54:8844',
ws: 'ws://192.168.33.46:8844',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}