diff --git a/.env.dev b/.env.dev index fe19dd37..815c2638 100644 --- a/.env.dev +++ b/.env.dev @@ -10,4 +10,6 @@ VUE_APP_MESSAGE_CENTER ='http://gtech-gateway.dcin-test.digitalyili.com/apigtech #VUE_APP_SOCKETURL = 'wss://planetg-java.test.automark.cc/survey_sync' VUE_APP_SOCKETURL = 'wss://ylst-api-uat.dctest.digitalyili.com/survey_sync' -VUE_APP_JSONPURL = 'https://iam-uat.dctest.digitalyili.com/idp/restful/getIDPToken' \ No newline at end of file +VUE_APP_JSONPURL = 'https://iam-uat.dctest.digitalyili.com/idp/restful/getIDPToken' + +VUE_APP_YQRURL = 'https://ocp-uat-ain.digitalyili.com' diff --git a/.env.prod b/.env.prod index a96414d7..ff8db3e9 100644 --- a/.env.prod +++ b/.env.prod @@ -10,3 +10,6 @@ VUE_APP_MESSAGE_CENTER ='http://gtech-gateway.cxpin.digitalyili.com/apigtech/mes VUE_APP_LOGIN = 'https://yip.digitalyili.com//login' VUE_APP_SOCKETURL = 'wss://ylst-api.xapi.digitalyili.com/survey_sync' VUE_APP_JSONPURL = 'https://iam.digitalyili.com/idp/restful/getIDPToken' + +VUE_APP_YQRURL = 'https://ocp.digitalyili.com' + diff --git a/.env.sit b/.env.sit index 66cee0a7..ee134abb 100644 --- a/.env.sit +++ b/.env.sit @@ -13,3 +13,6 @@ VUE_APP_LOGIN = 'https://yip-uat.dctest.digitalyili.com/login' VUE_APP_SOCKETURL = 'wss://ylst-api-uat.dctest.digitalyili.com/survey_sync' VUE_APP_JSONPURL = 'https://iam-uat.dctest.digitalyili.com/idp/restful/getIDPToken' + +VUE_APP_YQRURL = 'https://ocp-uat-ain.digitalyili.com' + diff --git a/.env.uat b/.env.uat index 73da6714..81e45e41 100644 --- a/.env.uat +++ b/.env.uat @@ -13,3 +13,5 @@ VUE_APP_LOGIN = 'https://yip-uat.dctest.digitalyili.com/login' VUE_APP_SOCKETURL = 'wss://ylst-api-uat.dctest.digitalyili.com/survey_sync' VUE_APP_JSONPURL = 'https://iam-uat.dctest.digitalyili.com/idp/restful/getIDPToken' + +VUE_APP_YQRURL = 'https://ocp-uat-ain.digitalyili.com' diff --git a/src/assets/img/business_wechat.png b/src/assets/img/business_wechat.png new file mode 100644 index 00000000..4f2d14b1 Binary files /dev/null and b/src/assets/img/business_wechat.png differ diff --git a/src/components/Tinymce.vue b/src/components/Tinymce.vue index 6b1b4712..4ac3df20 100644 --- a/src/components/Tinymce.vue +++ b/src/components/Tinymce.vue @@ -24,7 +24,7 @@ > - + @@ -266,6 +266,7 @@ import { useStore } from "vuex"; import { useRoute } from "vue-router"; import { nodeHandle } from "../views/planetDesign/Design/js/util.js"; import { baseOss } from "../config.js"; +import * as cheerio from 'cheerio'; export default { name: "Tinymce", components: { Editor }, @@ -322,13 +323,29 @@ export default { type: Boolean, default: false, }, + isLinkContent: { + type: Boolean, + default: false, + }, + // 固定插入地址 + isFixation: { + type: Boolean, + default: false, + }, + // 最大数量 + maxNum: { + type: Number, + default: NaN + } }, setup(props, context) { const store = useStore(); const route = useRoute(); const sn = computed(() => route.query.sn || ""); + const fixation = ref(props.isFixation) const { linkAddress, linkText, linkDialogVisible, linkDiglogOkHandle } = - linkDialog(); + linkDialog(fixation,store.state.throw.hrefUrl); + const { d3Address, d3Width, @@ -371,13 +388,27 @@ export default { quesList, quoteList, quoteDialogVisible, + isLinkContent: props.isLinkContent, }; const { content, init, editorId, fileInput } = initTinymce(dataJson); const { fileChange } = imageHandle(editorId, props.isImageStyle, sn); + const legendFormat = (str)=>{ + if(str){ + const $ = cheerio.load(str) + const text = $.text().trim() + return text + } + return str + } onMounted(() => { tinymce.init(init); }); watch(content, (val, oldVal) => { + let num = legendFormat(content.value).length + if(num>=props.maxNum) { + message.warning(`最大输入字数为${props.maxNum}`) + return + } context.emit("update:editorData", content.value); }); watch( @@ -413,6 +444,8 @@ export default { addQuoListHandle, fileChange, delQuoListHandle, + store, + fixation }; }, }; @@ -447,6 +480,7 @@ function initTinymce(data) { quoteDialogVisible, isImageStyle, sn, + isLinkContent, } = data; const content = ref(""); const fileInput = ref(null); @@ -464,7 +498,7 @@ function initTinymce(data) { plugins: ["autoresize", "paste"], toolbar_mode: "wrap", toolbar_persist: true, - toolbar: + toolbar: isLinkContent ? "linkButton" : "bold italic underline fontsizeselect quoteButton imgButton linkButton moreButton", fontsize_formats: "12px 14px 16px 18px 20px 22px 24px 26px 28px", images_upload_handler: (blobInfo, success, failure, progress) => {}, @@ -528,6 +562,23 @@ function initTinymce(data) { context.emit("more", content.value); }, }); + editor.ui.registry.addIcon("linkIcon", link); + editor.ui.registry.addButton("linkButton", { + icon: "linkIcon", + onAction: function (e) { + const wrapperNode = tinymce.editors[editor.id].selection.getNode(); + const content = tinymce.editors[editor.id].selection.getContent(); + const contentNode = document.createElement("div"); + contentNode.innerHTML = content; + linkText.value = contentNode.innerText; + if (wrapperNode.tagName.toLowerCase() === "a") { + tinymce.editors[editor.id].selection.select(wrapperNode, true); + linkText.value = wrapperNode.innerText; + linkAddress.value = wrapperNode.href || ""; + } + linkDialogVisible.value = true; + }, + }); commonFunc(editor); editor.on("init", (e) => { // 等页面渲染完毕,给工具栏绑定拖拽事件并且全选内容 @@ -671,10 +722,13 @@ function initTinymce(data) { /** * 插入链接弹框crud */ -function linkDialog() { +function linkDialog(fixation,hrefUrl) { const linkAddress = ref(""); const linkText = ref(""); // 用于显示 const linkDialogVisible = ref(false); + if(fixation.value) { + linkAddress.value = hrefUrl + } const linkDiglogOkHandle = (id) => { if (!linkAddress.value || !linkText.value) { message.info("请输入文字和链接地址"); diff --git a/src/config.js b/src/config.js index 9be32366..4a3d3413 100644 --- a/src/config.js +++ b/src/config.js @@ -6,4 +6,5 @@ module.exports = { loginUrl: process.env.VUE_APP_LOGIN, socketUrl: process.env.VUE_APP_SOCKETURL, jsonpUrl: process.env.VUE_APP_JSONPURL, + jqrUrl: process.env.VUE_APP_YQRURL, }; diff --git a/src/router/index.js b/src/router/index.js index 51e611cf..0148df70 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -275,6 +275,12 @@ const constantRoutes = [ meta: { showPreview: false, showPublish: false, keepAlive: true, showShare: true }, component: () => import(/* webpackChunkName: "publish" */ '@/views/Publish/launch-center/launch-task/create') }, + { + path: 'enterprise-weChat', + name: 'enterprise-weChat', + meta: { showPreview: false, showPublish: false, keepAlive: true, showShare: true, permission:'super_admin_flag' }, + component: () => import(/* webpackChunkName: "publish" */ '@/views/Publish/launch-center/launch-task/enterpriseWeChat') + }, // { // path: "link", // name: "link", @@ -424,6 +430,16 @@ router.beforeEach((to, from, next) => { // window.parent.location.href = 'https://yip-uat.dctest.digitalyili.com/login'; } } + if(!to.meta.permission) { + next() + return + } + if(!JSON.parse(localStorage.getItem('plantUserInfo'))[to.meta.permission]) { + next({ + path:'/error/404', + }) + return + } next() }) export default router diff --git a/src/store/modules/throw.js b/src/store/modules/throw.js new file mode 100644 index 00000000..23e7c402 --- /dev/null +++ b/src/store/modules/throw.js @@ -0,0 +1,15 @@ +export default { + namespaced: true, + state: { + // 企微投放链接地址 + hrefUrl: '', + }, + getters: {}, + mutations: {}, + actions: { + changeHrefUrl ({ state }, url) { + state.hrefUrl = url + }, + }, + }; + \ No newline at end of file diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index bc78fb0d..3ae91e92 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -59,6 +59,7 @@ export default defineComponent({ localStorage.setItem("plantUserInfo", JSON.stringify(data)); localStorage.setItem("plantId", JSON.stringify(data.id)); console.log(store.state.common.userInfo) + store.commit("common/M_COMMON_SET_USERINFO", JSON.stringify(data)); } catch (error) { message.error( error.data?.message || error.message || "服务器错误" diff --git a/src/views/Publish/launch-center/api/php.js b/src/views/Publish/launch-center/api/php.js index 24f502f6..e4e93c75 100644 --- a/src/views/Publish/launch-center/api/php.js +++ b/src/views/Publish/launch-center/api/php.js @@ -69,6 +69,21 @@ export function applications (params) { }) } +/* 企微投放-人群包列表 */ +export function getActLists (params) { + return request({ + url: `/console/release_task/actLists`, + method: 'GET', + params + }) +} - +/* 企微投放-链接 */ +export function getPublishUrl (sn,params) { + return request({ + url: `/console/deliverys/surveys/${sn}/publish_url`, + method: 'GET', + params, + }) +} diff --git a/src/views/Publish/launch-center/components/QuestionTinymceOption.vue b/src/views/Publish/launch-center/components/QuestionTinymceOption.vue new file mode 100644 index 00000000..ee830596 --- /dev/null +++ b/src/views/Publish/launch-center/components/QuestionTinymceOption.vue @@ -0,0 +1,284 @@ + + + + + diff --git a/src/views/Publish/launch-center/components/basicInformation.vue b/src/views/Publish/launch-center/components/basicInformation.vue index 7f98653d..de562502 100644 --- a/src/views/Publish/launch-center/components/basicInformation.vue +++ b/src/views/Publish/launch-center/components/basicInformation.vue @@ -189,6 +189,7 @@ export default { url: data?.url || file?.name, name: file?.name, attachmentId: data?.attachmentId || file?.name, + fileType: file?.type == 'image/jpeg' || file?.type == 'image/jpg' || file?.type == 'image/png' ? 1 : 2 }, ]; isUpload.value = false; diff --git a/src/views/Publish/launch-center/components/createQuantityLimit.vue b/src/views/Publish/launch-center/components/createQuantityLimit.vue index be05a078..43c626d3 100644 --- a/src/views/Publish/launch-center/components/createQuantityLimit.vue +++ b/src/views/Publish/launch-center/components/createQuantityLimit.vue @@ -168,7 +168,8 @@ export default { // } // return sampleQuotaValue > 0 ? sampleQuotaValue : undefined; // }; - const columns = reactive([ + const columns = ref([]); + const routineColumns = ref([ { name: "systemChineseName", title: "投放渠道", @@ -198,8 +199,30 @@ export default { slots: { title: "numTitle", customRender: "num" }, align: "right", }, - ]); - + ]) + const microColumns = ref([ + { + title: "投放渠道", + dataIndex: "applicationChineseName", + width: "50%", + key: "applicationChineseName", + }, + { + title: "已有样本数量", + dataIndex: "answer_samples", + align: "center", + width: "25%", + slots: { customRender: "answer_samples" }, + key: "answer_samples", + }, + { + dataIndex: "num", + key: "num", + align: "center", + slots: { title: "numTitle", customRender: "num" }, + align: "right", + }, + ]) onMounted(() => { // getNum(); // getList(); @@ -229,7 +252,18 @@ export default { sampleQuotaSum.value = getSum(); }; - const showModal = (pid) => { + const showModal = (pid,type) => { + if(type===1) { + columns.value = [] + routineColumns.value.map(item=>{ + columns.value.push(item) + }) + }else{ + columns.value = [] + microColumns.value.map(item=>{ + columns.value.push(item) + }) + } id.value = pid; visible.value = true; console.log("showModal", pid); diff --git a/src/views/Publish/launch-center/components/enterpriseBasicInformation.vue b/src/views/Publish/launch-center/components/enterpriseBasicInformation.vue new file mode 100644 index 00000000..31081e19 --- /dev/null +++ b/src/views/Publish/launch-center/components/enterpriseBasicInformation.vue @@ -0,0 +1,216 @@ + + + + + diff --git a/src/views/Publish/launch-center/components/enterpriseQuantityLimitTable.vue b/src/views/Publish/launch-center/components/enterpriseQuantityLimitTable.vue new file mode 100644 index 00000000..060e437d --- /dev/null +++ b/src/views/Publish/launch-center/components/enterpriseQuantityLimitTable.vue @@ -0,0 +1,318 @@ + + + + + diff --git a/src/views/Publish/launch-center/launch-task/create.vue b/src/views/Publish/launch-center/launch-task/create.vue index c23c4d9e..e595c6d5 100644 --- a/src/views/Publish/launch-center/launch-task/create.vue +++ b/src/views/Publish/launch-center/launch-task/create.vue @@ -135,7 +135,6 @@ export default { }); return; } - Modal.confirm({ title: "提示", content: "确定后,该投放任务将无法修改(除样本数量限制),可在投放中心查询业务进度", @@ -164,6 +163,7 @@ export default { { receiverCode: s.systemAdministratorPhone, receiverName: s.systemAdministrator, + receiverPhone: s.systemAdministratorPhone, }, ]), }; @@ -252,6 +252,7 @@ export default { .link-container { padding: 32px 24px; background: #fff; + box-shadow: 0px 0px 6px 0px rgb(0 0 0 / 10%); .title { font-size: 16px; font-weight: bold; diff --git a/src/views/Publish/launch-center/launch-task/enterpriseWeChat.vue b/src/views/Publish/launch-center/launch-task/enterpriseWeChat.vue new file mode 100644 index 00000000..73dbd285 --- /dev/null +++ b/src/views/Publish/launch-center/launch-task/enterpriseWeChat.vue @@ -0,0 +1,323 @@ + + + + + + \ No newline at end of file diff --git a/src/views/Publish/launch-center/launch-task/index.vue b/src/views/Publish/launch-center/launch-task/index.vue index 101e45a3..2fa2d1b0 100644 --- a/src/views/Publish/launch-center/launch-task/index.vue +++ b/src/views/Publish/launch-center/launch-task/index.vue @@ -1,7 +1,7 @@