新增修改信息

main
wangxia 2 years ago
parent 752a72bf35
commit 2d2aad731b

@ -193,26 +193,10 @@
// debugger // debugger
// editor.setDocument("text/lake", ' '); // editor.setDocument("text/lake", ' ');
console.log("event", event); console.log("event", event);
if (event.data.jobInfoYuQue) { var data = event.data;
editor.setDocument("text/lake", event.data.jobInfoYuQue); // 然后就可以获得vue传过来的数据
}else if(event.data.jobInfo){ console.log("从vue中获得的数据", data);
let arr = event.data.jobInfo.split("\n"); editor.setDocument("text/lake", data);
console.log(arr);
// let arr = event.data.trim().split("\n");
let newArr = [];
arr.forEach((item, index) => {
if (index >= 1) {
let item1 = "<p>" + item + "</p>";
newArr.push(item1);
}
});
var data = newArr.join(" ");
desp = data.replace(/[*]+/g, "");
console.log(desp);
// 然后就可以获得vue传过来的数据
console.log("从vue中获得的数据", event);
editor.setDocument("text/lake", desp);
}
// var data = event.data.replace(/\n/g, "<br />"); // var data = event.data.replace(/\n/g, "<br />");
// desp = data.replace(/[*]+/g, ''); // desp = data.replace(/[*]+/g, '');
}, },

@ -1,4 +1,5 @@
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router' import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import noticeData from './modules/message.js';
const router = createRouter({ const router = createRouter({
@ -53,9 +54,9 @@ const router = createRouter({
meta: { meta: {
title: '消息通知', title: '消息通知',
}, },
component: () => import("../views/homePage/message.vue") component: () => import("../views/message/index.vue")
} }
] ].concat(noticeData)
}, },
{ {
path: '/login', path: '/login',

@ -0,0 +1,21 @@
let data = [
{
path: "/merchantManagement/messageAdd",
name: "messageAdd",
meta: {
title: '新增通知',
},
groupName: '消息通知',
component: () => import("../../views/message/add.vue")
},
{
path: "/merchantManagement/messageEdit",
name: "messageEdit",
meta: {
title: '编辑通知',
},
groupName: '消息通知',
component: () => import("../../views/message/add.vue")
},
];
export default data;

@ -79,6 +79,12 @@ watch(
} else if (val.name == "recruit") { } else if (val.name == "recruit") {
secondTitle.value = "配置详情"; secondTitle.value = "配置详情";
firstTitle.value = "小程序配置"; firstTitle.value = "小程序配置";
} else if (val.name == "messageAdd") {
secondTitle.value = "新增通知";
firstTitle.value = "消息通知";
} else if (val.name == "messageEdit") {
secondTitle.value = "编辑通知";
firstTitle.value = "消息通知";
} }
}, },
{ {
@ -113,6 +119,8 @@ const pushFirstPage = () => {
router.push("/merchantManagement/downstream"); router.push("/merchantManagement/downstream");
} else if (firstTitle.value == "小程序配置") { } else if (firstTitle.value == "小程序配置") {
router.push("/merchantManagement/miniProgramList"); router.push("/merchantManagement/miniProgramList");
} else if (firstTitle.value == "消息通知") {
router.push("/merchantManagement/message");
} }
}; };
</script> </script>

@ -57,7 +57,7 @@
</div> </div>
<a-divider class="g_mt_0 g_mb_20" /> <a-divider class="g_mt_0 g_mb_20" />
<div class="g_flex_row_between g_pl_24 g_pr_24 g_pb_20"> <div class="g_flex_row_between g_pl_24 g_pr_24 g_pb_20">
<a-table sticky :columns="columns" :data-source="gpjgList" size="middle" @change="tableChange" :pagination="false" class="g_clear_scroll" :scroll="{ x: '500px' }"> <a-table :columns="columns" :data-source="gpjgList" size="middle" @change="tableChange" :pagination="false" class="g_clear_scroll" :scroll="{ x: '500px' }">
<template #headerCell="{ column }"> <template #headerCell="{ column }">
<template v-if="column.key === 'name'"> <template v-if="column.key === 'name'">
<div class="g_fw_600">姓名</div> <div class="g_fw_600">姓名</div>
@ -76,7 +76,7 @@
</div> </div>
<a-divider class="g_mt_0 g_mb_20" /> <a-divider class="g_mt_0 g_mb_20" />
<div class="g_flex_row_between g_pl_24 g_pr_24 g_pb_20"> <div class="g_flex_row_between g_pl_24 g_pr_24 g_pb_20">
<a-table sticky :columns="columns1" :data-source="zzkgList" size="middle" @change="tableChange" :pagination="false" class="g_clear_scroll" :scroll="{ x: '500px' }"> <a-table :columns="columns1" :data-source="zzkgList" size="middle" @change="tableChange" :pagination="false" class="g_clear_scroll" :scroll="{ x: '500px' }">
<template #headerCell="{ column }"> <template #headerCell="{ column }">
<template v-if="column.key === 'name'"> <template v-if="column.key === 'name'">
<div class="g_fw_600">姓名</div> <div class="g_fw_600">姓名</div>
@ -90,6 +90,7 @@
</a-table> </a-table>
</div> </div>
</div> </div>
</div> </div>
</template> </template>

@ -0,0 +1,73 @@
<template>
<div class="g_flex_row_center">
<div class="m-job-detail g_pt_24" style="width: 780px">
<div class="g_flex_row_center flex_center g_mb_16">
<div class="g_fs_14">标题</div>
<div class="g_mt_0 g_br_6 g_flex_1" style="border: 1px solid #d9d9d9">
<a-input v-model:value="currentInfo.title"></a-input>
</div>
</div>
<div class="g_flex_row_center">
<div class="g_fs_14">内容</div>
<div class="g_mt_0 g_br_6 g_flex_1" style="border: 1px solid #d9d9d9">
<iframe src="../../../public/static/editor.html" width="100%" height="500px" frameborder="0" ref="iframeDom" style="border-top-left-radius: 6px"></iframe>
</div>
</div>
<div class="g_flex_row_start g_mt_24 g_ml_42">
<a-button class="g_mr_16" @click="cancel"></a-button>
<a-button type="primary">发布</a-button>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, getCurrentInstance, watch, onBeforeUnmount } from "vue";
const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G;
import { useRouter, useRoute } from "vue-router";
const router = useRouter(); //
const route = useRoute();
import { useStore } from "@/stores/counter";
const storeJS = useStore();
let currentInfo = ref({});
onMounted(() => {
console.log(route);
let newList = [{}, {}, {}];
newList.forEach((item, index) => {
item.rank = index + 1;
item.title = "常用发票主体信息" + index;
item.content = "默认主体:郑州伯才科技有限公司 单位名称:郑州伯才科技有限公司 纳税人识别号91410100MA9L4HDT0L 地址:河南自贸试验区郑州" + index;
item.time = "2024-03-11 13:04:24";
});
if (route.query.id) {
currentInfo.value = newList[Number(route.query.id)];
}
initData();
});
const iframeDom = ref();
window.addEventListener("message", (val) => {
// console.log(val.data);
if (val.data.lake) {
currentInfo.value.desc_yq = val.data.lake;
currentInfo.value.desc = val.data.html;
}
});
const initData = () => {
// iframeDom.value.contentWindow.postMessage("");
iframeDom.value.onload = function () {
console.log(route);
if (route.name == "messageEdit") {
iframeDom.value.contentWindow.postMessage(currentInfo.value.content);
} else {
iframeDom.value.contentWindow.postMessage("");
}
};
};
const cancel = ()=>{
router.back()
}
</script>
<style lang="less" scoped></style>

@ -8,8 +8,8 @@
</div> </div>
</div> </div>
<div> <div>
<!-- @click="openAdd" --> <!-- @click="openAdd" -->
<a-button type="primary" :icon="h(PlusOutlined)">新增内容</a-button> <a-button type="primary" @click="openAdd('add')" :icon="h(PlusOutlined)">新增内容</a-button>
<!-- <a-button type="" class="g_border_d g_ml_16" @click="handleToForm('add', { id: 0 })" :icon="h(DownloadOutlined)">导出模版</a-button> --> <!-- <a-button type="" class="g_border_d g_ml_16" @click="handleToForm('add', { id: 0 })" :icon="h(DownloadOutlined)">导出模版</a-button> -->
<!-- <!--
<a-dropdown :trigger="['click']"> <a-dropdown :trigger="['click']">
@ -58,7 +58,7 @@
> >
报名 报名
</div> --> </div> -->
<div class="btn g_c_main g_fs_14 g_cursor_point g_mr_13" @click="handleToForm('edit', record)">编辑</div> <div class="btn g_c_main g_fs_14 g_cursor_point g_mr_13" @click="openAdd('edit', record)">编辑</div>
<div class="btn g_c_main g_fs_14 g_cursor_point" @click="handleDel(record)"></div> <div class="btn g_c_main g_fs_14 g_cursor_point" @click="handleDel(record)"></div>
</div> </div>
</template> </template>
@ -74,9 +74,7 @@
</div> </div>
</div> </div>
<!-- <a-modal v-model:open="modalInfo.isShow"
<!-- <a-modal v-model:open="modalInfo.isShow"
:title="modalInfo.title" :title="modalInfo.title"
width="640px" width="640px"
centered centered
@ -115,37 +113,28 @@
</template> </template>
</a-modal> --> </a-modal> -->
<a-modal v-model:open="showAdd" :title="modalInfo.title" style="width: 734px" :destroyOnClose="true"> <a-modal v-model:open="showAdd" :title="modalInfo.title" style="width: 734px" :destroyOnClose="true">
<div class="g_pt_30 modal-box"> <div class="g_pt_30 modal-box">
<a-form :model="modalInfo.form" <a-form :model="modalInfo.form" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off" style="width: 80%" class="g_ml_51">
name="basic" <a-form-item label="姓名" name="name" required>
:label-col="{ span: 6 }" <a-input style="width: 100%" placeholder="请输入姓名" v-model:value="modalInfo.form.name" />
:wrapper-col="{ span: 18 }" </a-form-item>
autocomplete="off" <a-form-item label="电话" name="name" required>
style="width: 80%;" <a-input style="width: 100%" placeholder="请输入电话" v-model:value="modalInfo.form.username" />
class="g_ml_51" </a-form-item>
> <a-form-item label="身份证号" name="name">
<a-form-item label="姓名" name="name" required> <a-input style="width: 100%" placeholder="请输入身份证号" v-model:value="modalInfo.form.idcard" />
<a-input style="width: 100%" placeholder="请输入姓名" v-model:value="modalInfo.form.name" /> </a-form-item>
</a-form-item>
<a-form-item label="电话" name="name" required> <a-form-item label="备注" name="desp">
<a-input style="width: 100%" placeholder="请输入电话" v-model:value="modalInfo.form.username" /> <a-textarea :rows="6" style="width: 100%" placeholder="请输入备注" v-model:value="modalInfo.form.description" />
</a-form-item> </a-form-item>
<a-form-item label="身份证号" name="name"> </a-form>
<a-input style="width: 100%" placeholder="请输入身份证号" v-model:value="modalInfo.form.idcard" /> </div>
</a-form-item> <template #footer>
<a-button @click="showAdd = false">关闭</a-button>
<a-form-item label="备注" name="desp"> <a-button @click="submitForm" type="primary">确定</a-button>
<a-textarea :rows='6' style="width: 100%" placeholder="请输入备注" v-model:value="modalInfo.form.description" /> </template>
</a-form-item>
</a-form>
</div>
<template #footer>
<a-button @click="showAdd = false" >关闭</a-button>
<a-button @click="submitForm" type="primary">确定</a-button>
</template>
</a-modal> </a-modal>
</div> </div>
</template> </template>
@ -155,7 +144,7 @@ import { ref, onMounted, getCurrentInstance, h, watch } from "vue";
import { PlusOutlined, EllipsisOutlined, UploadOutlined, DownOutlined } from "@ant-design/icons-vue"; import { PlusOutlined, EllipsisOutlined, UploadOutlined, DownOutlined } from "@ant-design/icons-vue";
import { Modal, message } from "ant-design-vue"; import { Modal, message } from "ant-design-vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { getUserListApi, updateUserStatusApi, addUserApi, delUserApi,updateUserApi } from "../../api/userList/userList"; import { getUserListApi, updateUserStatusApi, addUserApi, delUserApi, updateUserApi } from "../../api/userList/userList";
import { DownloadOutlined } from "@ant-design/icons-vue"; import { DownloadOutlined } from "@ant-design/icons-vue";
import idCardPanel from "../components/upload/image.vue"; import idCardPanel from "../components/upload/image.vue";
@ -183,69 +172,64 @@ const handleChangeSearch = (e) => {
} }
}; };
const modalInfo = ref({ const modalInfo = ref({
title:'新增用户', title: "新增用户",
id:0, id: 0,
form:{ form: {
name:"", name: "",
username:'', username: "",
idcard:'', idcard: "",
description:'' description: "",
} },
}) });
const submitForm = ()=>{ const submitForm = () => {
let url = '',params = {}; let url = "",
params = {};
params = { params = {
name:modalInfo.value.form.name, name: modalInfo.value.form.name,
username:modalInfo.value.form.username, username: modalInfo.value.form.username,
idcard:modalInfo.value.form.idcard, idcard: modalInfo.value.form.idcard,
description:modalInfo.value.form.description, description: modalInfo.value.form.description,
password:'123456', password: "123456",
id:modalInfo.value.id id: modalInfo.value.id,
};
if (!commonJS.regular(modalInfo.value.form.username, "tel")) {
message.warning("请输入正确的手机号");
return false;
} }
if (modalInfo.value.id) {
if (!commonJS.regular(modalInfo.value.form.username, 'tel')) { delete params.password;
message.warning('请输入正确的手机号') updateUserApi(params).then((res) => {
return false showAdd.value = false;
} message.success("修改成功");
getTable();
});
if(modalInfo.value.id){ } else {
delete params.password; addUserApi(params).then((res) => {
updateUserApi(params).then((res)=>{ showAdd.value = false;
showAdd.value = false; message.success("新增成功");
message.success("修改成功"); getTable();
getTable(); });
}); }
}else{ };
addUserApi(params).then((res)=>{
showAdd.value = false;
message.success("新增成功");
getTable();
});
}
}
const handleToForm = ($type, $data) => { const handleToForm = ($type, $data) => {
showAdd.value = true; showAdd.value = true;
console.log($data.id); console.log($data.id);
modalInfo.value = { modalInfo.value = {
isShow:true, isShow: true,
title:'修改用户', title: "修改用户",
form:{ form: {
name:$data.name, name: $data.name,
username:$data.username, username: $data.username,
idcard:$data.idcard, idcard: $data.idcard,
description:$data.description, description: $data.description,
}, },
id:$data.id id: $data.id,
} };
// updateUserApi({ // updateUserApi({
// description: "", // description: "",
// idcard: "123123123123123123", // idcard: "123123123123123123",
// name: "", // name: "",
@ -277,8 +261,6 @@ const handleToForm = ($type, $data) => {
// } // }
}; };
/* #################### 表格事件 #################### */ /* #################### 表格事件 #################### */
const tableData = ref({ const tableData = ref({
keyword: "", keyword: "",
@ -299,26 +281,31 @@ const getTable = () => {
tableData.value = { ...res.data, keyword: tableData.value.keyword, page: res.data.current, limit: res.data.size }; tableData.value = { ...res.data, keyword: tableData.value.keyword, page: res.data.current, limit: res.data.size };
tableData.value.records.forEach((item, index) => { tableData.value.records.forEach((item, index) => {
item.rank = index + 1; item.rank = index + 1;
item.title = '常用发票主体信息'; item.title = "常用发票主体信息";
item.content = "默认主体:郑州伯才科技有限公司 单位名称:郑州伯才科技有限公司 纳税人识别号91410100MA9L4HDT0L 地址:河南自贸试验区郑州"; item.content = "默认主体:郑州伯才科技有限公司 单位名称:郑州伯才科技有限公司 纳税人识别号91410100MA9L4HDT0L 地址:河南自贸试验区郑州";
item.time = "2024-03-11 13:04:24"; item.time = "2024-03-11 13:04:24";
}); });
}); });
}; };
const openAdd = () =>{ const openAdd = (_type,_record) => {
showAdd.value = true if(_type == 'add'){
modalInfo.value.title = "新增用户" router.push({
modalInfo.value.id = 0; path: "messageAdd",
modalInfo.value = { // query: {
form:{ // type: "add",
name:"", // },
username:'', });
idcard:'', } else {
description:'' router.push({
} path: "messageEdit",
} query: {
id: _record.rank,
},
});
} }
};
const columns = ref([ const columns = ref([
{ {
title: "序号", title: "序号",
@ -408,7 +395,6 @@ const handleApplication = (record) => {
}); });
}; };
const handleDel = ($data) => { const handleDel = ($data) => {
commonJS.gConfirmModal( commonJS.gConfirmModal(
"删除", "删除",
@ -440,9 +426,8 @@ const handleModalSize = ($page, $size) => {
</script> </script>
<style lang="less"> <style lang="less">
.ant-table-cell:empty::before {
.ant-table-cell:empty::before{ content: "-";
content: "-";
} }
.p-manage-myJob { .p-manage-myJob {
position: relative; position: relative;
Loading…
Cancel
Save