This commit is contained in:
2026-02-25 15:13:47 +08:00
parent 6d7d06cd2a
commit 57568a3a7c
7 changed files with 151 additions and 26 deletions

View File

@@ -6,9 +6,9 @@
<input class="input-con" v-model="fromValue.title" placeholder="请输入标题" />
</view>
<view class="content-input">
<view class="input-titile"><text class="input-required">*</text>联系人</view>
<view class="input-titile"><text class="input-required">*</text>内容</view>
<!-- <input class="input-con" v-model="fromValue.contactName" placeholder="请输入联系人" /> -->
<unieditor @init-data="receiveInitData"/>
<unieditor v-if="shows" @init-data="receiveInitData" :content="fromValue.content"/>
</view>
<view class="content-input">
<view class="input-titile">备注</view>
@@ -38,6 +38,7 @@ const dictStore = useDictStore();
const { dictLabel, oneDictData, complete: dictComplete, getDictSelectOption } = dictStore;
let fromValue = reactive({
id:'',
title: '',
content:'',
remark:'',
@@ -47,13 +48,20 @@ let fromValue = reactive({
status:'0',
});
let type=ref('add')
onLoad((options = {}) => {
let id=ref('')
let shows=ref(false)
onLoad((options) => {
id.value=options.id
if(options.id){
type.value='edit'
getDetail()
}else{
getInfo()
}
});
// 监听页面显示,接收从技能查询页面返回的数据
onShow(() => {
getDetail()
// 通过事件总线接收技能选择结果
// uni.$on('skillSelected', handleSkillSelected);
});
@@ -65,10 +73,14 @@ onShow(() => {
// 监听字典数据加载完成,自动更新学历显示
const receiveInitData = (initData) => {
fromValue.content=initData.value;
if(initData.value=="<p><br></p>"){
}else{
fromValue.content=initData.value;
}
console.log('子组件初始化数据:', initData)
}
function getDetail(){
function getInfo(){
// if(userInfo.userId){
$api.myRequest("/train/public/train/organ/getTrainByUnifiedSocialCreditCode", {
tags: "913700001630477270",
@@ -80,13 +92,36 @@ function getDetail(){
fromValue.entProvince = res.data.organProvince;
fromValue.entCounty = res.data.organCounty;
fromValue.entCity = res.data.organCity;
shows.value=true;
}
})
// }else{
// $api.msg('请先登录');
// }
}
function getDetail(){
$api.myRequest("/train/public/announcement/selectById", {
id: id.value,
}, "GET", 9100, {
Authorization: `Bearer ${uni.getStorageSync('token')}`,
'Content-Type': "application/x-www-form-urlencoded"
}).then((res) => {
if (res.code === 200) {
fromValue.id = res.data.id;
fromValue.title = res.data.title;
fromValue.content= res.data.content;
fromValue.remark= res.data.remark;
fromValue.entProvince = res.data.entProvince;
fromValue.entCounty = res.data.entCounty;
fromValue.entCity = res.data.entCity;
// fromValue = {
// ...fromValue,
// ...res.data,
// };
shows.value=true;
}
})
}
const confirm = () => {
if (!fromValue.title) {