From 4f047b8b5941f9c49f2ccc7dbc2e4c0745ef70e6 Mon Sep 17 00:00:00 2001 From: "liu.huiying@ebiz-digits.com" Date: Wed, 12 Mar 2025 11:38:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:app=E5=B5=8C=E5=A5=97h5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 3 + .env.development | 3 + src/App.vue | 12 + src/api/common/index.js | 10 + src/api/survey/index.js | 34 +++ src/assets/css/main.scss | 10 - src/assets/js/appBridge.js | 289 ++++++++++++++++++ src/assets/js/common.js | 164 ++++++++++ src/components/contenteditable.vue | 1 - src/config.js | 2 + src/main.ts | 11 +- src/views/Design/Index.vue | 11 - .../ActionCompoents/QuestionAction.vue | 7 - .../Design/components/ChooseQuestion.vue | 72 ++++- src/views/Home/Index.vue | 30 ++ src/views/Survey/views/Create/Index.vue | 99 ++---- src/views/Survey/views/Publish/Index.vue | 48 ++- 17 files changed, 698 insertions(+), 108 deletions(-) create mode 100644 src/api/common/index.js create mode 100644 src/api/survey/index.js create mode 100644 src/assets/js/appBridge.js create mode 100644 src/assets/js/common.js diff --git a/.env b/.env index 91b536c..beb75d4 100644 --- a/.env +++ b/.env @@ -8,3 +8,6 @@ VITE_APP_MESSAGE_CENTER=http://gtech-gateway.dcin-test.digitalyili.com/apigtech/ VITE_APP_SOCKETURL=wss://yls-api-uat.dctest.digitalyili.com/survey_sync VITE_APP_JSONPURL=https://iam-uat.dctest.digitalyili.com/idp/restful/getIDPToken VITE_APP_YQRURL=https://ocp-uat-ain.digitalyili.com +# VITE_APP_BASE_APPURL=https://ycsb-gw-uat.dcin-test.digitalyili.com +# VITE_APP_APPKEY=62f495a0f7854e4e46ebbf40 +# VITE_APP_APPID=m5c66hlce3 diff --git a/.env.development b/.env.development index b5cc42d..4a6493c 100644 --- a/.env.development +++ b/.env.development @@ -8,3 +8,6 @@ VITE_APP_MESSAGE_CENTER=http://gtech-gateway.dcin-test.digitalyili.com/apigtech/ VITE_APP_SOCKETURL=wss://yls-api-uat.dctest.digitalyili.com/survey_sync VITE_APP_JSONPURL=https://iam-uat.dctest.digitalyili.com/idp/restful/getIDPToken VITE_APP_YQRURL=https://ocp-uat-ain.digitalyili.com +# VITE_APP_BASE_APPURL=https://ycsb-gw-uat.dcin-test.digitalyili.com +# VITE_APP_APPKEY=62f495a0f7854e4e46ebbf40 +# VITE_APP_APPID=m5c66hlce3 diff --git a/src/App.vue b/src/App.vue index d1fd5a8..b9a868b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,17 @@ - - @@ -298,14 +295,6 @@ const actionFun = { } }; -// emit 事件 - -const emitFun = { - move: (ev) => { - console.log(ev); - } -}; - onMounted(() => { questionInfo.value = store.questionsInfo.value; }); diff --git a/src/views/Design/components/ActionCompoents/QuestionAction.vue b/src/views/Design/components/ActionCompoents/QuestionAction.vue index 43440c2..a9fce0c 100644 --- a/src/views/Design/components/ActionCompoents/QuestionAction.vue +++ b/src/views/Design/components/ActionCompoents/QuestionAction.vue @@ -158,8 +158,6 @@ const deleteQuestion = () => { }); }; -// emit -const emit = defineEmits(['move', 'copy']); // 打开题目弹窗 const openQuestionActionModel = () => { show.value = true; @@ -168,7 +166,6 @@ const openQuestionActionModel = () => { const openQuestionSettingModel = () => { questionShow.value = true; }; - // 题目上下移动 const questionMove = (action) => { if (action.action === 'down') { @@ -178,8 +175,6 @@ const questionMove = (action) => { const temp = questions.value[props.questionIndex]; questions.value.splice(props.questionIndex, 1); questions.value.splice(props.questionIndex + 1, 0, temp); - - emit('move', 'down'); } else if (action.action === 'up') { if (props.questionIndex === 0) { return; @@ -187,7 +182,6 @@ const questionMove = (action) => { const temp = questions.value[props.questionIndex]; questions.value.splice(props.questionIndex, 1); questions.value.splice(props.questionIndex - 1, 0, temp); - emit('move', 'up'); } else { // 复制 题目 生成新的id 更新最新的 last index const temp = questions.value[props.questionIndex]; @@ -197,7 +191,6 @@ const questionMove = (action) => { question_index: questionsInfo.value.survey.last_question_index + 1 }); questionsInfo.value.survey.last_question_index += 1; - emit('copy', 'down'); } }; diff --git a/src/views/Design/components/ChooseQuestion.vue b/src/views/Design/components/ChooseQuestion.vue index 1efbc81..2a8eef2 100644 --- a/src/views/Design/components/ChooseQuestion.vue +++ b/src/views/Design/components/ChooseQuestion.vue @@ -17,10 +17,20 @@ v-model:data="element" :questions="questions" :questionIndex="index" - @move="emit('move', $event)" - @copy="emit('copy', $event)" > + + + + + + + + + + + + @@ -49,14 +59,70 @@ const props = defineProps({ } }); const element = ref(props.element); + // 选中题目后出现的操作 -const emit = defineEmits(['getChooseQuestionId', 'move', 'copy']); +// const questionAction = ref([ +// { +// icon: '', +// name: '编辑', +// key: 'edit', +// class: '' +// }, +// { +// icon: '', +// name: '复制', +// key: 'copy', +// class: '' +// }, +// { +// icon: '', +// name: '移动', +// key: 'moveUp', +// class: 'moverQues' +// }, +// // { +// // icon:'', +// // name:'下移', +// // key:'moveDown', +// // class:'' +// // }, +// { +// icon: '', +// name: '删除', +// key: 'delete', +// class: '' +// } +// ]); +const emit = defineEmits(['getChooseQuestionId']); // 选中题目 const chooseItem = () => { // 使用从 defineProps 接收的 element 对象 emit('getChooseQuestionId', props.element); }; + +// const itemAction = (item) => { +// switch (item.key) { +// case 'edit': +// // vue router跳转到/edit +// +// router.push({ +// path: '/design/edit', +// query: { +// id: props.element.id +// } +// }); +// break; +// case 'copy': +// break; +// case 'moveUp': +// break; +// case 'moveDown': +// break; +// case 'delete': +// break; +// } +// };