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

9
package-lock.json generated
View File

@@ -9,6 +9,9 @@
"dayjs": "^1.11.19", "dayjs": "^1.11.19",
"mp-html": "^2.5.2", "mp-html": "^2.5.2",
"sm-crypto": "^0.3.13" "sm-crypto": "^0.3.13"
},
"devDependencies": {
"crypto-js": "^4.2.0"
} }
}, },
"node_modules/@dcloudio/uni-ui": { "node_modules/@dcloudio/uni-ui": {
@@ -16,6 +19,12 @@
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz", "resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz",
"integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw==" "integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw=="
}, },
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==",
"dev": true
},
"node_modules/dayjs": { "node_modules/dayjs": {
"version": "1.11.19", "version": "1.11.19",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",

View File

@@ -391,6 +391,12 @@
computed, computed,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
const props = defineProps({
content: {
type: String,
},
})
const emit = defineEmits(['init-data']) const emit = defineEmits(['init-data'])
// 页面元素 // 页面元素
const { const {
@@ -441,7 +447,7 @@
editorCtx.value = res.context editorCtx.value = res.context
// 初始化HTML内容 // 初始化HTML内容
editorCtx.value.setContents({//赋值 editorCtx.value.setContents({//赋值
html: editorContent.html html: props.content?props.content:editorContent.html
}) })
}).exec() }).exec()
// #endif // #endif

View File

@@ -6,9 +6,9 @@
<input class="input-con" v-model="fromValue.title" placeholder="请输入标题" /> <input class="input-con" v-model="fromValue.title" placeholder="请输入标题" />
</view> </view>
<view class="content-input"> <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="请输入联系人" /> --> <!-- <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>
<view class="content-input"> <view class="content-input">
<view class="input-titile">备注</view> <view class="input-titile">备注</view>
@@ -47,13 +47,20 @@ let fromValue = reactive({
status:'0', status:'0',
}); });
let type=ref('add') 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(() => { onShow(() => {
getDetail()
// 通过事件总线接收技能选择结果 // 通过事件总线接收技能选择结果
// uni.$on('skillSelected', handleSkillSelected); // uni.$on('skillSelected', handleSkillSelected);
}); });
@@ -65,10 +72,14 @@ onShow(() => {
// 监听字典数据加载完成,自动更新学历显示 // 监听字典数据加载完成,自动更新学历显示
const receiveInitData = (initData) => { const receiveInitData = (initData) => {
fromValue.content=initData.value; if(initData.value=="<p><br></p>"){
}else{
fromValue.content=initData.value;
}
console.log('子组件初始化数据:', initData) console.log('子组件初始化数据:', initData)
} }
function getDetail(){ function getInfo(){
// if(userInfo.userId){ // if(userInfo.userId){
$api.myRequest("/train/public/train/organ/getTrainByUnifiedSocialCreditCode", { $api.myRequest("/train/public/train/organ/getTrainByUnifiedSocialCreditCode", {
tags: "913700001630477270", tags: "913700001630477270",
@@ -80,13 +91,32 @@ function getDetail(){
fromValue.entProvince = res.data.organProvince; fromValue.entProvince = res.data.organProvince;
fromValue.entCounty = res.data.organCounty; fromValue.entCounty = res.data.organCounty;
fromValue.entCity = res.data.organCity; fromValue.entCity = res.data.organCity;
shows.value=true;
} }
}) })
// }else{ // }else{
// $api.msg('请先登录'); // $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;
shows.value=true;
}
})
}
const confirm = () => { const confirm = () => {
if (!fromValue.title) { if (!fromValue.title) {
@@ -98,6 +128,7 @@ const confirm = () => {
const params = { const params = {
...fromValue, ...fromValue,
}; };
debugger
if(type.value=='add'){ if(type.value=='add'){
$api.myRequest('/train/public/announcement/add', { $api.myRequest('/train/public/announcement/add', {
...fromValue, ...fromValue,

View File

@@ -46,8 +46,8 @@
<div class="flooter"> <div class="flooter">
<div v-if="item.status == '0' && item.shenhe == '1'" @click="handlePublishClick(scope.row,2)" >发布</div> <div v-if="item.status == '0' && item.shenhe == '1'" @click="handlePublishClick(scope.row,2)" >发布</div>
<div v-else @click="handlePublishClick(item,0)" >取消发布</div> <div v-else @click="handlePublishClick(item,0)" >取消发布</div>
<div>查看</div> <!-- <div>查看</div> -->
<div v-if="item.status == '0'" @click="handleEditClick(item)">编辑</div> <div v-if="item.status == '0'" @click="handleOperation(item)">编辑</div>
<div v-if="item.status == '0'" @click="handleDeleteClick(item)">删除</div> <div v-if="item.status == '0'" @click="handleDeleteClick(item)">删除</div>
</div> </div>
</div> </div>
@@ -166,8 +166,11 @@ function handleDeleteClick(row) {
}); });
} }
function handleOperation(row) { function handleOperation(row) {
navTo(`/packageB/notice/evaluateAnnouncement/evaluateEdit`); if(row){
// navTo(`/packageB/institution/trainingInstitutionDetail?organId=${row.organId}`); navTo(`/packageB/notice/evaluateAnnouncement/evaluateEdit?id=${row.id}`);
}else{
navTo(`/packageB/notice/evaluateAnnouncement/evaluateEdit`);
}
} }
</script> </script>

View File

@@ -6,9 +6,9 @@
<input class="input-con" v-model="fromValue.title" placeholder="请输入标题" /> <input class="input-con" v-model="fromValue.title" placeholder="请输入标题" />
</view> </view>
<view class="content-input"> <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="请输入联系人" /> --> <!-- <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>
<view class="content-input"> <view class="content-input">
<view class="input-titile">备注</view> <view class="input-titile">备注</view>
@@ -38,6 +38,7 @@ const dictStore = useDictStore();
const { dictLabel, oneDictData, complete: dictComplete, getDictSelectOption } = dictStore; const { dictLabel, oneDictData, complete: dictComplete, getDictSelectOption } = dictStore;
let fromValue = reactive({ let fromValue = reactive({
id:'',
title: '', title: '',
content:'', content:'',
remark:'', remark:'',
@@ -47,13 +48,20 @@ let fromValue = reactive({
status:'0', status:'0',
}); });
let type=ref('add') 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(() => { onShow(() => {
getDetail()
// 通过事件总线接收技能选择结果 // 通过事件总线接收技能选择结果
// uni.$on('skillSelected', handleSkillSelected); // uni.$on('skillSelected', handleSkillSelected);
}); });
@@ -65,10 +73,14 @@ onShow(() => {
// 监听字典数据加载完成,自动更新学历显示 // 监听字典数据加载完成,自动更新学历显示
const receiveInitData = (initData) => { const receiveInitData = (initData) => {
fromValue.content=initData.value; if(initData.value=="<p><br></p>"){
}else{
fromValue.content=initData.value;
}
console.log('子组件初始化数据:', initData) console.log('子组件初始化数据:', initData)
} }
function getDetail(){ function getInfo(){
// if(userInfo.userId){ // if(userInfo.userId){
$api.myRequest("/train/public/train/organ/getTrainByUnifiedSocialCreditCode", { $api.myRequest("/train/public/train/organ/getTrainByUnifiedSocialCreditCode", {
tags: "913700001630477270", tags: "913700001630477270",
@@ -80,13 +92,36 @@ function getDetail(){
fromValue.entProvince = res.data.organProvince; fromValue.entProvince = res.data.organProvince;
fromValue.entCounty = res.data.organCounty; fromValue.entCounty = res.data.organCounty;
fromValue.entCity = res.data.organCity; fromValue.entCity = res.data.organCity;
shows.value=true;
} }
}) })
// }else{ // }else{
// $api.msg('请先登录'); // $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 = () => { const confirm = () => {
if (!fromValue.title) { if (!fromValue.title) {

View File

@@ -46,8 +46,8 @@
<div class="flooter"> <div class="flooter">
<div v-if="item.status == '0' && item.shenhe == '1'" @click="handlePublishClick(scope.row,2)" >发布</div> <div v-if="item.status == '0' && item.shenhe == '1'" @click="handlePublishClick(scope.row,2)" >发布</div>
<div v-else @click="handlePublishClick(item,0)" >取消发布</div> <div v-else @click="handlePublishClick(item,0)" >取消发布</div>
<div>查看</div> <!-- <div>查看</div> -->
<div v-if="item.status == '0'" @click="handleEditClick(item)">编辑</div> <div v-if="item.status == '0'" @click="handleOperation(item)">编辑</div>
<div v-if="item.status == '0'" @click="handleDeleteClick(item)">删除</div> <div v-if="item.status == '0'" @click="handleDeleteClick(item)">删除</div>
</div> </div>
</div> </div>
@@ -166,8 +166,11 @@ function handleDeleteClick(row) {
}); });
} }
function handleOperation(row) { function handleOperation(row) {
navTo(`/packageB/notice/trainingAnnouncement/postedEdit`); if(row){
// navTo(`/packageB/institution/trainingInstitutionDetail?organId=${row.organId}`); navTo(`/packageB/notice/trainingAnnouncement/postedEdit?id=${row.id}`);
}else{
navTo(`/packageB/notice/trainingAnnouncement/postedEdit`);
}
} }
</script> </script>

View File

@@ -50,6 +50,34 @@
</view> </view>
<view class="service-status">已开启</view> <view class="service-status">已开启</view>
</view> </view>
<view class="service-item btn-feel" @click="handleInstitutionClick(1)">
<view class="service-left">
<uni-icons type="compose" size="20" color="#256BFA"></uni-icons>
<text class="service-text">培训机构维护</text>
</view>
<view class="service-status">修改</view>
</view>
<view class="service-item btn-feel" @click="handleInstitutionClick(2)">
<view class="service-left">
<uni-icons type="compose" size="20" color="#256BFA"></uni-icons>
<text class="service-text">评价机构维护</text>
</view>
<view class="service-status">修改</view>
</view>
<view class="service-item btn-feel" @click="handleInstitutionClick(3)">
<view class="service-left">
<uni-icons type="paperplane" size="20" color="#256BFA"></uni-icons>
<text class="service-text">培训公告发布</text>
</view>
<view class="service-status">发布</view>
</view>
<view class="service-item btn-feel" @click="handleInstitutionClick(4)">
<view class="service-left">
<uni-icons type="paperplane" size="20" color="#256BFA"></uni-icons>
<text class="service-text">评价公告发布</text>
</view>
<view class="service-status">发布</view>
</view>
</view> </view>
<!-- 退出登录按钮 --> <!-- 退出登录按钮 -->
@@ -91,7 +119,17 @@ const companyInfo = reactive({
function goToCompanyInfo() { function goToCompanyInfo() {
navTo('/pages/mine/company-info'); navTo('/pages/mine/company-info');
} }
function handleInstitutionClick(i){
if(i==1){
navTo('/packageB/institution/trainingInstitutionMaintenance');
}else if(i==2){
navTo('/packageB/institution/evaluationAgencyMaintenance');
}else if(i==3){
navTo('/packageB/notice/trainingAnnouncement/postedList');
}else if(i==4){
navTo('/packageB/notice/evaluateAnnouncement/evaluateList');
}
}
// 跳转到消息页面 // 跳转到消息页面
function goToMessage() { function goToMessage() {
navTo('/pages/msglog/msglog'); navTo('/pages/msglog/msglog');