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

This commit is contained in:
xieyonghong 2023-02-22 13:38:52 +08:00
commit 643067656d
11 changed files with 68 additions and 84 deletions

View File

@ -1,5 +1,5 @@
<template>
<div class="page-container">
<page-container>
<a-row :gutter="24">
<a-col :span="6">
<TopCard
@ -42,7 +42,7 @@
/>
</a-col>
</a-row>
</div>
</page-container>
</template>
<script setup lang="ts">
@ -200,10 +200,7 @@ const getPlayCount = async (params: any) => {
</script>
<style lang="less" scoped>
.page-container {
padding: 24px;
.dash-board-bottom {
margin-top: 24px;
}
.dash-board-bottom {
margin-top: 24px;
}
</style>

View File

@ -1,6 +1,6 @@
<!-- 通知模板详情 -->
<template>
<div class="page-container">
<page-container>
<a-card>
<a-row :gutter="24">
<a-col :span="12">
@ -241,7 +241,7 @@
:channel="formData.channel"
@close="getProductList"
/>
</div>
</page-container>
</template>
<script setup lang="ts">
@ -353,7 +353,8 @@ const saveProductVis = ref(false);
const getDetail = async () => {
const res = await DeviceApi.detail(route.query.id as string);
// console.log('res: ', res);
formData.value = res.result;
// formData.value = res.result;
Object.assign(formData.value, res.result);
formData.value.channel = res.result.provider;
};
@ -366,8 +367,7 @@ onMounted(() => {
*/
const btnLoading = ref<boolean>(false);
const handleSubmit = () => {
const form = useForm(formData.value, formRules.value);
form.validate()
validate()
.then(async () => {
btnLoading.value = true;
let res;
@ -392,8 +392,4 @@ const handleSubmit = () => {
<style lang="less" scoped>
@import './index.less';
.page-container {
background: #f0f2f5;
padding: 24px;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="page-container">
<page-container>
<Search
:columns="columns"
target="notice-config"
@ -126,7 +126,7 @@
</a-space>
</template>
</JTable>
</div>
</page-container>
</template>
<script setup lang="ts">
@ -320,9 +320,3 @@ const getActions = (
return actions;
};
</script>
<style lang="less" scoped>
.page-container {
background: #f0f2f5;
padding: 24px;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="page-container">
<page-container>
<a-row :gutter="24">
<a-col :span="14">
<BootCard
@ -21,7 +21,7 @@
/>
</a-col>
</a-row>
</div>
</page-container>
</template>
<script setup lang="ts">
@ -96,9 +96,3 @@ const deviceStepDetails: recommendList[] = [
},
];
</script>
<style lang="less" scoped>
.page-container {
padding: 24px;
}
</style>

View File

@ -1,6 +1,6 @@
<!-- 通知配置详情 -->
<template>
<div class="page-container">
<page-container>
<a-card>
<a-row>
<a-col :span="10">
@ -273,7 +273,7 @@
</a-col>
</a-row>
</a-card>
</div>
</page-container>
</template>
<script setup lang="ts">
@ -427,8 +427,8 @@ const clearValid = () => {
const getDetail = async () => {
if (route.params.id === ':id') return;
const res = await configApi.detail(route.params.id as string);
// console.log('res: ', res);
formData.value = res.result;
// formData.value = res.result;
Object.assign(formData.value, res.result);
// console.log('formData.value: ', formData.value);
};
getDetail();
@ -438,8 +438,7 @@ getDetail();
*/
const btnLoading = ref<boolean>(false);
const handleSubmit = () => {
const form = useForm(formData.value, formRules.value);
form.validate()
validate()
.then(async () => {
// console.log('formData.value: ', formData.value);
btnLoading.value = true;
@ -463,10 +462,3 @@ const handleSubmit = () => {
});
};
</script>
<style lang="less" scoped>
.page-container {
background: #f0f2f5;
padding: 24px;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="page-container">
<page-container>
<Search
:columns="columns"
target="notice-config"
@ -166,7 +166,7 @@
<Debug v-model:visible="debugVis" :data="currentConfig" />
<Log v-model:visible="logVis" :data="currentConfig" />
<SyncUser v-model:visible="syncVis" :data="currentConfig" />
</div>
</page-container>
</template>
<script setup lang="ts">
@ -426,9 +426,3 @@ const getActions = (
}
};
</script>
<style lang="less" scoped>
.page-container {
background: #f0f2f5;
padding: 24px;
}
</style>

View File

@ -5,6 +5,7 @@
placeholder="请选择收信部门"
style="width: 100%"
:allowClear="true"
v-model:value="_value"
/>
</template>
@ -17,10 +18,16 @@ type Emits = {
const emit = defineEmits<Emits>();
const props = defineProps({
toParty: { type: String, default: '' },
type: { type: String, default: '' },
configId: { type: String, default: '' },
});
const _value = computed({
get: () => props.toParty,
set: (val: string) => emit('update:toParty', val),
});
const options = ref([]);
const queryData = async () => {
const { result } = await templateApi.getDept(props.type, props.configId);

View File

@ -5,6 +5,7 @@
placeholder="请选择标签推送,多个标签用,号分隔"
style="width: 100%"
:allowClear="true"
v-model:value="_value"
/>
</template>
@ -17,10 +18,16 @@ type Emits = {
const emit = defineEmits<Emits>();
const props = defineProps({
toTag: { type: String, default: '' },
type: { type: String, default: '' },
configId: { type: String, default: '' },
});
const _value = computed({
get: () => props.toTag,
set: (val: string) => emit('update:toTag', val),
});
const options = ref([]);
const queryData = async () => {
const { result } = await templateApi.getTags(props.configId);

View File

@ -5,6 +5,7 @@
placeholder="请选择收信人"
style="width: 100%"
:allowClear="true"
v-model:value="_value"
/>
</template>
@ -17,10 +18,16 @@ type Emits = {
const emit = defineEmits<Emits>();
const props = defineProps({
toUser: { type: String, default: '' },
type: { type: String, default: '' },
configId: { type: String, default: '' },
});
const _value = computed({
get: () => props.toUser,
set: (val: string) => emit('update:toUser', val),
});
const options = ref([]);
const queryData = async () => {
const { result } = await templateApi.getUser(props.type, props.configId);

View File

@ -1,6 +1,6 @@
<!-- 通知模板详情 -->
<template>
<div class="page-container">
<page-container>
<a-card>
<a-row>
<a-col :span="10">
@ -169,7 +169,9 @@
(e) => handleChange(e)
"
>
<AIcon type="UploadOutlined" />
<AIcon
type="UploadOutlined"
/>
</a-upload>
</template>
</a-input>
@ -201,7 +203,7 @@
<a-col :span="12">
<a-form-item label="收信人">
<ToUser
v-model:to-user="
v-model:toUser="
formData.template.toUser
"
:type="formData.type"
@ -212,7 +214,7 @@
<a-col :span="12">
<a-form-item label="收信部门">
<ToOrg
v-model:to-user="
v-model:toParty="
formData.template.toParty
"
:type="formData.type"
@ -223,7 +225,7 @@
</a-row>
<a-form-item label="标签推送">
<ToTag
v-model:to-user="formData.template.toTag"
v-model:toTag="formData.template.toTag"
:type="formData.type"
:config-id="formData.configId"
/>
@ -471,7 +473,7 @@
</a-col>
</a-row>
</a-card>
</div>
</page-container>
</template>
<script setup lang="ts">
@ -633,11 +635,15 @@ const clearValid = () => {
*/
const getDetail = async () => {
const res = await templateApi.detail(route.params.id as string);
// console.log('res: ', res);
formData.value = res.result;
// formData.value = res.result;
Object.assign(formData.value, res.result);
// console.log('formData.value: ', formData.value);
if (formData.value.type === 'sms') {
getTemplateList();
getSignsList();
}
};
// getDetail();
/**
* 获取绑定配置
@ -656,7 +662,7 @@ getConfigList();
/**
* link消息类型 图片链接
*/
const handleChange = (info: UploadChangeParam) => {
const handleChange = (info: UploadChangeParam) => {
if (info.file.status === 'done') {
formData.value.template.link.picUrl = info.file.response?.result;
}
@ -680,7 +686,6 @@ const getTemplateList = async () => {
);
templateList.value = result;
};
getTemplateList();
/**
* 获取签名
@ -690,7 +695,10 @@ const getSignsList = async () => {
const { result } = await templateApi.getSigns(formData.value.configId);
signsList.value = result;
};
getSignsList();
onMounted(() => {
if (route.params.id) getDetail();
});
/**
* 表单提交
@ -698,11 +706,12 @@ getSignsList();
const btnLoading = ref<boolean>(false);
const handleSubmit = () => {
if (formData.value.type === 'email') delete formData.value.configId;
if (formData.value.template.messageType === 'markdown') delete formData.value.template.link
if (formData.value.template.messageType === 'link') delete formData.value.template.markdown
if (formData.value.template.messageType === 'markdown')
delete formData.value.template.link;
if (formData.value.template.messageType === 'link')
delete formData.value.template.markdown;
// console.log('formData.value: ', formData.value);
const form = useForm(formData.value, formRules.value);
form.validate()
validate()
.then(async () => {
formData.value.template.ttsCode =
formData.value.template.templateCode;
@ -737,10 +746,3 @@ const handleSubmit = () => {
// );
// test
</script>
<style lang="less" scoped>
.page-container {
background: #f0f2f5;
padding: 24px;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="page-container">
<page-container>
<Search
:columns="columns"
target="notice-config"
@ -152,7 +152,7 @@
<Debug v-model:visible="debugVis" :data="currentConfig" />
<Log v-model:visible="logVis" :data="currentConfig" />
</div>
</page-container>
</template>
<script setup lang="ts">
@ -383,9 +383,3 @@ const getActions = (
return actions;
};
</script>
<style lang="less" scoped>
.page-container {
background: #f0f2f5;
padding: 24px;
}
</style>