232 lines
7.6 KiB
Plaintext
232 lines
7.6 KiB
Plaintext
品质
|
|
<script setup lang="ts">
|
|
import HomeHead from '@/views/home/components/HomeHead.vue'
|
|
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
|
|
import { useDate } from '@/views/home/hooks/useDate'
|
|
import {NForm,NFormItem,NInput,NModal,NButton,useMessage} from 'naive-ui'
|
|
import zhCn from "element-plus/lib/locale/lang/zh-cn";
|
|
import UserPage from '@/views/home/intelligence/process/UserPages.vue'
|
|
import Editor from '@/views/home/intelligence/components/TinyECE.vue'
|
|
import {addPageInv} from '@/api/daikin/base'
|
|
const message = useMessage()
|
|
const { day, week } = useDate()
|
|
const { push } = useRouter()
|
|
|
|
let rules = {
|
|
title: {
|
|
required: false,
|
|
message: '请输入标题',
|
|
trigger: 'blur'
|
|
},
|
|
actName:{
|
|
required: false,
|
|
message: '请输入名称',
|
|
trigger: 'blur'
|
|
},
|
|
actSTime: {
|
|
required: false,
|
|
message: '请选择开始',
|
|
trigger: 'blur'
|
|
},
|
|
actETime: {
|
|
required: false,
|
|
message: '请选择结束',
|
|
trigger: 'blur'
|
|
},
|
|
position:{
|
|
required: false,
|
|
message: '请输入职务',
|
|
trigger: 'blur'
|
|
},
|
|
|
|
}
|
|
const showModals =ref(false)
|
|
const showModal = ref(false)
|
|
const dataList = ref()
|
|
const handleChild = (data)=>{
|
|
const { showModal: show, multipleSelection } = data
|
|
showModal.value = unref(show)
|
|
dataList.value = unref(multipleSelection)
|
|
}
|
|
const CloseThis = (data)=>{
|
|
showModal.value = data
|
|
}
|
|
|
|
const handleClose = (tag: any) => {
|
|
|
|
dataList.value.splice(dataList.value.indexOf(tag), 1)
|
|
console.log( dataList.value)
|
|
}
|
|
|
|
const formValue = ref({
|
|
title:'',
|
|
content:'',
|
|
actName:'',
|
|
actSTime:'',
|
|
actETime:'',
|
|
position:'',
|
|
userIdList:[],
|
|
})
|
|
|
|
const editorContent =ref()
|
|
function escapeHTML(html: string): string {
|
|
const tempElement = document.createElement('div');
|
|
tempElement.textContent = html;
|
|
return tempElement.innerHTML;
|
|
}
|
|
// 获取子组件传过来的值
|
|
const handleChild2 = (data: string) => {
|
|
editorContent.value = data
|
|
}
|
|
|
|
async function sure() {
|
|
const cont = editorContent.value
|
|
const content = escapeHTML(cont)
|
|
const {title, actName, actSTime, actETime,position } = formValue.value
|
|
|
|
|
|
const starTime = new Date(actSTime).getTime()
|
|
const endTime = new Date(actETime).getTime()
|
|
console.log(starTime,endTime)
|
|
let userIdList: any[] =[]
|
|
if(!dataList.value){
|
|
message.success("请选择要提醒的对象")
|
|
return
|
|
}
|
|
dataList.value.forEach((i: { userId: any })=>{
|
|
userIdList.push(i.userId)
|
|
})
|
|
console.log(formValue.value,dataList,content)
|
|
if(userIdList.length<0) return
|
|
let formdata = new FormData();
|
|
formdata.append("title",title);
|
|
formdata.append("actName",actName);
|
|
formdata.append("actSTime",starTime);
|
|
formdata.append("actETime",endTime);
|
|
formdata.append("content",content);
|
|
formdata.append("position",position);
|
|
formdata.append("userIdList",userIdList);
|
|
const { msg, code } = await addPageInv(formdata,{headers: {'Content-Type': 'application/form-data'}})
|
|
if (code === 200) {
|
|
message.success("添加成功")
|
|
}
|
|
else { message.success(msg); }
|
|
}
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<HomeHead class="top">
|
|
<template #content>
|
|
<!-- <HomeHeadSearch /> -->
|
|
</template>
|
|
</HomeHead>
|
|
<div class="h-full relative flex flex-col">
|
|
<div class="font-600 flex items-end mt27px">
|
|
<div class="text-36px">邀请</div>
|
|
<div class="text-18px ml40px mr25px">{{ day }}</div>
|
|
<div class="text-18px">{{ week }}</div>
|
|
</div>
|
|
<div class="g-wrapper flex-1 mt30px p30px">
|
|
<n-form ref="formRef" :label-width="300" :model="formValue" :rules="rules" size="medium"
|
|
require-mark-placement="left">
|
|
<n-form-item label="标题" path="title">
|
|
<n-input v-model:value="formValue.title" placeholder="" />
|
|
</n-form-item>
|
|
<n-form-item label="活动名称" path="actName">
|
|
<n-input v-model:value="formValue.actName" placeholder="" />
|
|
</n-form-item>
|
|
<n-form-item label="职位" path="position">
|
|
<n-input v-model:value="formValue.position" placeholder="" />
|
|
</n-form-item>
|
|
<n-form-item label="开始时间" path="actSTime">
|
|
<el-config-provider :locale="zhCn">
|
|
<el-date-picker v-model="formValue.actSTime" type="datetime" placeholder="请选择时间" format="YYYY/MM/DD HH:mm:ss"/>
|
|
</el-config-provider>
|
|
</n-form-item>
|
|
<n-form-item label="结束时间" path="actETime">
|
|
<el-config-provider :locale="zhCn">
|
|
<el-date-picker v-model="formValue.actETime" type="datetime" placeholder="请选择时间" format="YYYY/MM/DD HH:mm:ss"/>
|
|
</el-config-provider>
|
|
</n-form-item>
|
|
<n-form-item label="内容" path="content" class="text-#000">
|
|
<Editor @getChildData="handleChild2"></Editor>
|
|
</n-form-item>
|
|
|
|
</n-form>
|
|
|
|
<n-form-item>
|
|
<div>
|
|
<n-button @click="showModals = true"> 文本内容预览</n-button>
|
|
</div>
|
|
</n-form-item>
|
|
<n-button @click="showModal = true">
|
|
情报公开范围
|
|
</n-button>
|
|
<div class="mt15px h100px overflow-y-auto">
|
|
<el-tag v-for="i in dataList" :key="i" class="mx-1" closable :disable-transitions="false"
|
|
@close="handleClose(i)" type="info" size="large">
|
|
{{ i.nickName }}
|
|
</el-tag>
|
|
</div>
|
|
|
|
<n-button attr-type="button" @click="sure" style="background-color: #3870E5; border-radius: 5px; color: #fff;margin-left: 10px;margin-top: 20px; padding: 0 20px;">
|
|
提交
|
|
</n-button>
|
|
</div>
|
|
|
|
</div>
|
|
<n-modal v-model:show="showModal">
|
|
<UserPage @clickChild="handleChild" @CloseThis="CloseThis"></UserPage>
|
|
</n-modal>
|
|
<n-modal v-model:show="showModals">
|
|
<div class=" flex w80% p30px bg-#fff my40px rounded-30px">
|
|
|
|
<div class=" overflow-y-auto h800px container" v-html="editorContent"></div>
|
|
</div>
|
|
</n-modal>
|
|
|
|
|
|
<div class="absolute flex flex-col w-full h-full z-200 top-0 left-0 text-center bg-red justify-center items-center" style="background-color: rgba(255,255,255,0.8);">
|
|
<img src="@/assets/images/chah.png"/>
|
|
<br>
|
|
<div class="text-#5683DB text-36px">【做成中,敬请期待】</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped lang="less">
|
|
|
|
.top {
|
|
position: absolute;
|
|
right: 30px;
|
|
top: -92px;
|
|
}
|
|
|
|
.g-wrapper {
|
|
border-radius: 18px;
|
|
border: 1px solid #E7EBF5;
|
|
box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
|
|
overflow: auto;
|
|
height: 800px;
|
|
background-color: #fff;
|
|
.timeline {
|
|
font-size: 20px;
|
|
font-weight: bold;
|
|
color: #142142;
|
|
|
|
.one {
|
|
position: relative;
|
|
.year{
|
|
left: -132px;
|
|
top: -14px;
|
|
color: #003CB7;
|
|
font-size: 26px;
|
|
font-weight: normal;
|
|
text-align: center;
|
|
line-height: 50px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|