diff --git a/.env b/.env
new file mode 100644
index 0000000..91b536c
--- /dev/null
+++ b/.env
@@ -0,0 +1,10 @@
+# .env
+VITE_APP_BASE_URL=http://192.168.8.165:15011/
+VITE_APP_ENV=development
+VITE_APP_CURRENTMODE=dev
+VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
+VITE_APP_DELIVERY_BASEURL=https://javaxq.test.automark.cc/
+VITE_APP_MESSAGE_CENTER=http://gtech-gateway.dcin-test.digitalyili.com/apigtech/message-send-center/
+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
diff --git a/.env.development b/.env.development
index e8d30fa..b5cc42d 100644
--- a/.env.development
+++ b/.env.development
@@ -1,2 +1,10 @@
-VITE_APP_BASE_URL = '/'
-VITE_APP_ENV = 'development'
+# .env.development
+VITE_APP_BASEURL=http://192.168.8.165:15011/
+VITE_APP_ENV=development
+VITE_APP_CURRENTMODE=dev
+VITE_APP_BASEOSS=https://diaoyan-files.automark.cc
+VITE_APP_DELIVERY_BASEURL=https://javaxq.test.automark.cc/
+VITE_APP_MESSAGE_CENTER=http://gtech-gateway.dcin-test.digitalyili.com/apigtech/message-send-center/
+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
diff --git a/.env.production b/.env.production
deleted file mode 100644
index 9e37b5c..0000000
--- a/.env.production
+++ /dev/null
@@ -1,2 +0,0 @@
-VITE_APP_BASE_URL = 'https://xx.digitalyili.com'
-VITE_APP_ENV = 'prod'
diff --git a/.env.sit b/.env.sit
deleted file mode 100644
index b62dff6..0000000
--- a/.env.sit
+++ /dev/null
@@ -1,2 +0,0 @@
-VITE_APP_BASE_URL = 'https://sit.xx.digitalyili.com'
-VITE_APP_ENV = 'sit'
diff --git a/.env.uat b/.env.uat
deleted file mode 100644
index c4b9b8b..0000000
--- a/.env.uat
+++ /dev/null
@@ -1,2 +0,0 @@
-VITE_APP_BASE_URL = 'https://uat.xx.digitalyili.com'
-VITE_APP_ENV = 'uat'
diff --git a/auto-imports.d.ts b/auto-imports.d.ts
index b0b0357..9d24007 100644
--- a/auto-imports.d.ts
+++ b/auto-imports.d.ts
@@ -5,4 +5,6 @@
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
-declare global {}
+declare global {
+
+}
diff --git a/components.d.ts b/components.d.ts
index f15d4ea..edf019e 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -19,11 +19,18 @@ declare module 'vue' {
VanCheckbox: typeof import('vant/es')['Checkbox']
VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
VanCol: typeof import('vant/es')['Col']
+ VanDatePicker: typeof import('vant/es')['DatePicker']
+ VanDatetimePicker: typeof import('vant/es')['DatetimePicker']
VanDialog: typeof import('vant/es')['Dialog']
VanDivider: typeof import('vant/es')['Divider']
+ VanFiel: typeof import('vant/es')['Fiel']
VanField: typeof import('vant/es')['Field']
+ VanGrid: typeof import('vant/es')['Grid']
+ VanGridItem: typeof import('vant/es')['GridItem']
VanIcon: typeof import('vant/es')['Icon']
VanNavBar: typeof import('vant/es')['NavBar']
+ VanPicker: typeof import('vant/es')['Picker']
+ VanPikcer: typeof import('vant/es')['Pikcer']
VanPopup: typeof import('vant/es')['Popup']
VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup']
@@ -33,6 +40,8 @@ declare module 'vue' {
VanSwitch: typeof import('vant/es')['Switch']
VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem']
+ VanTimePicker: typeof import('vant/es')['TimePicker']
+ YLPicker: typeof import('./src/components/YLPicker.vue')['default']
YLSelect: typeof import('./src/components/YLSelect.vue')['default']
}
}
diff --git a/package-lock.json b/package-lock.json
index 393a4ca..24957ab 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,12 +9,15 @@
"version": "0.0.0",
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
+ "axios": "^1.8.2",
+ "dotenv": "^16.4.7",
"element-plus": "^2.7.8",
"lodash": "^4.17.21",
"pinia": "^2.1.7",
"sortablejs": "^1.15.6",
"uuid": "^11.1.0",
"vant": "^4.9.17",
+ "vite-plugin-vue": "^0.0.1",
"vue": "^3.4.29",
"vue-router": "^4.3.3",
"vuex": "^4.1.0"
@@ -4782,6 +4785,11 @@
"resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz",
"integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg=="
},
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
+ },
"node_modules/available-typed-arrays": {
"version": "1.0.7",
"resolved": "https://registry.npmmirror.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
@@ -4797,6 +4805,16 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/axios": {
+ "version": "1.8.2",
+ "resolved": "https://registry.npmmirror.com/axios/-/axios-1.8.2.tgz",
+ "integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==",
+ "dependencies": {
+ "follow-redirects": "^1.15.6",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -4974,7 +4992,6 @@
},
"node_modules/call-bind-apply-helpers": {
"version": "1.0.2",
- "dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
@@ -5100,6 +5117,17 @@
"integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==",
"dev": true
},
+ "node_modules/combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz",
@@ -5311,6 +5339,14 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
"node_modules/detect-libc": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-1.0.3.tgz",
@@ -5404,9 +5440,19 @@
"url": "https://github.com/fb55/domutils?sponsor=1"
}
},
+ "node_modules/dotenv": {
+ "version": "16.4.7",
+ "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.4.7.tgz",
+ "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
"node_modules/dunder-proto": {
"version": "1.0.1",
- "dev": true,
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.1",
@@ -5548,7 +5594,6 @@
},
"node_modules/es-define-property": {
"version": "1.0.1",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
@@ -5556,7 +5601,6 @@
},
"node_modules/es-errors": {
"version": "1.3.0",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
@@ -5591,7 +5635,6 @@
},
"node_modules/es-object-atoms": {
"version": "1.1.1",
- "dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0"
@@ -5602,7 +5645,6 @@
},
"node_modules/es-set-tostringtag": {
"version": "2.1.0",
- "dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
@@ -6614,6 +6656,25 @@
"integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",
"dev": true
},
+ "node_modules/follow-redirects": {
+ "version": "1.15.9",
+ "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.9.tgz",
+ "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ }
+ },
"node_modules/for-each": {
"version": "0.3.5",
"resolved": "https://registry.npmmirror.com/for-each/-/for-each-0.3.5.tgz",
@@ -6629,6 +6690,20 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/form-data": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.2.tgz",
+ "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "es-set-tostringtag": "^2.1.0",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -6652,7 +6727,6 @@
},
"node_modules/function-bind": {
"version": "1.1.2",
- "dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
@@ -6697,7 +6771,6 @@
},
"node_modules/get-intrinsic": {
"version": "1.3.0",
- "dev": true,
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.2",
@@ -6720,7 +6793,6 @@
},
"node_modules/get-proto": {
"version": "1.0.1",
- "dev": true,
"license": "MIT",
"dependencies": {
"dunder-proto": "^1.0.1",
@@ -6914,7 +6986,6 @@
},
"node_modules/gopd": {
"version": "1.2.0",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
@@ -6978,7 +7049,6 @@
},
"node_modules/has-symbols": {
"version": "1.1.0",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
@@ -6989,7 +7059,6 @@
},
"node_modules/has-tostringtag": {
"version": "1.0.2",
- "dev": true,
"license": "MIT",
"dependencies": {
"has-symbols": "^1.0.3"
@@ -7003,7 +7072,6 @@
},
"node_modules/hasown": {
"version": "2.0.2",
- "dev": true,
"license": "MIT",
"dependencies": {
"function-bind": "^1.1.2"
@@ -7826,7 +7894,6 @@
},
"node_modules/math-intrinsics": {
"version": "1.1.0",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
@@ -7908,6 +7975,25 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
"node_modules/minimatch": {
"version": "9.0.3",
"resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.3.tgz",
@@ -8662,6 +8748,11 @@
"react-is": "^16.13.1"
}
},
+ "node_modules/proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
"node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz",
@@ -10450,6 +10541,12 @@
}
}
},
+ "node_modules/vite-plugin-vue": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmmirror.com/vite-plugin-vue/-/vite-plugin-vue-0.0.1.tgz",
+ "integrity": "sha512-PhAy+v+t6W3JAeqFxf6w/hGyURZ2qvrJMS/HTeCPLnfllz+O5wNP49TcAb4MROeif93kKIOigtDFJowaLuU+0w==",
+ "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."
+ },
"node_modules/vscode-uri": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.1.0.tgz",
diff --git a/package.json b/package.json
index e66227f..a2c9510 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
- "dev": "vite",
+ "dev": "vite --mode development",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "vite build",
@@ -15,13 +15,14 @@
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"axios": "^1.8.2",
+ "dotenv": "^16.4.7",
"element-plus": "^2.7.8",
"lodash": "^4.17.21",
- "lodash-es": "^4.17.21",
"pinia": "^2.1.7",
"sortablejs": "^1.15.6",
"uuid": "^11.1.0",
"vant": "^4.9.17",
+ "vite-plugin-vue": "^0.0.1",
"vue": "^3.4.29",
"vue-router": "^4.3.3",
"vuex": "^4.1.0"
diff --git a/src/api/design/index.js b/src/api/design/index.js
new file mode 100644
index 0000000..a01a619
--- /dev/null
+++ b/src/api/design/index.js
@@ -0,0 +1,31 @@
+import request from '@/utils/request.js';
+export function snQuestions(params) {
+ return request({
+ url: `/console/surveys/${params.sn}/questions`,
+ method: 'get'
+ });
+}
+// 操作编辑
+export function saveQuestion(params) {
+ return request({
+ url: `console/surveys/${params.sn}/questions`,
+ method: 'post',
+ data: params
+ });
+}
+export function sync(params) {
+ return request({
+ url: `console/surveys/${params.sn}/sync`,
+ method: 'post',
+ data: params
+ });
+}
+export function questionDetails(params) {
+ // let sn = params.sn;
+ // delete params.sn;
+ return request({
+ url: `console/surveys/${params.sn}/details`,
+ method: 'post',
+ data: params
+ });
+}
diff --git a/src/api/home/index.js b/src/api/home/index.js
new file mode 100644
index 0000000..ba0fa30
--- /dev/null
+++ b/src/api/home/index.js
@@ -0,0 +1,19 @@
+import request from '@/utils/request.js';
+
+export function getQuestionList(params) {
+ return request({
+ url: '/console/template/list_shortcut',
+ method: 'get',
+ params
+ });
+}
+export function consoleSurveys(params) {
+ return request({
+ url: '/console/surveys',
+ method: 'post',
+ data: {
+ ...params,
+ source: '1'
+ }
+ });
+}
diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss
index 9c41435..603da52 100644
--- a/src/assets/css/main.scss
+++ b/src/assets/css/main.scss
@@ -1,6 +1,7 @@
@import 'base';
@import '../../fonts/iconfont.css';
@import 'vant';
+@import '../../fonts/moblie/iconfont.css';
a,
.green {
diff --git a/src/components/YLPicker.vue b/src/components/YLPicker.vue
new file mode 100644
index 0000000..1e98e52
--- /dev/null
+++ b/src/components/YLPicker.vue
@@ -0,0 +1,689 @@
+
+
+
+
+
【样本量要求≥60】
', - pages: [ - [24, 27, 26, 1], - [2, 3, 4, 5, 6, 7], - [8, 9, 10, 11, 12, 13, 14], - [15, 16, 17, 18, 19, 20, 21], - [28, 22] - ], - sn: '8YXK4kW5', + id: 9577, + introduction: '123
', + pages: [[]], + sn: 'oxywX8W6', status: 0, - title: - '液态奶产品研究标准化问卷-概念测试(内测标准版)
', - detail_pages: [ - [24, 27, 26, 1], - [2, 3, 4, 5, 6, 7], - [8, 9, 10, 11, 12, 13, 14], - [15, 16, 17, 18, 19, 20, 21], - [28, 22] - ], + title: '报名签到问卷 ', + detail_pages: [], group_pages: [], is_one_page_one_question: 0, last_question_index: 0, is_three_d_permissions: 0, is_dept: 1, - last_title: 'Q5', - project_name: '概念诊断问卷示例-0227', + last_title: 'Q0', + project_name: '报名签到问卷 ', quota_end_content: '
很抱歉,本次调研不太适合您的情况,感谢您的参与!
', quota_end_url: '', @@ -52,225 +37,27 @@ export const useCommonStore = defineStore('common', { end_jump_status: 0, end_jump_standing_time: 0, success_end_content: - '
您已完成本次调研,感谢您的参与!
\n【成功完成】
', + '
您已完成本次调研,感谢您的参与!
\n【成功完成】
', success_end_url: '', success_end_url_select: 0, success_standing_time: 0, - template_type: 300, - local_pages: [ - { - pages: [], - is_short_time: 0, - short_time: '', - is_show: 0, - use_type: 0 - }, - { - pages: [], - is_short_time: 0, - short_time: '', - is_show: 0, - use_type: 0 - }, - { - pages: [], - is_short_time: 0, - short_time: '', - is_show: 0, - use_type: 0 - }, - { - pages: [], - is_short_time: 0, - short_time: '', - is_show: 0, - use_type: 0 - }, - { - pages: [], - is_short_time: 0, - short_time: '', - is_show: 0, - use_type: 0 - } - ] + template_type: 0, + local_pages: [] }, - logics: [ - { - logic: [ - { - value: '', - location: 0, - date: '', - time: '', - type: 0, - row_type: 0, - cell_type: 0, - logic: 'if', - operator: '=', - is_answer: 1, - is_select: 0, - row_index: 0, - cell_index: 0, - question_type: 1, - question_index: 24, - relation_question_index: 0, - relation_question_row_index: 0, - relation_question_cell_index: 0, - is_option_group: 0, - option_index: 1, - skip_type: null, - question_id: null - } - ], - skip_question_index: 27, - skip_type: 0, - id: 472148, - question_index: 24, - question_id: '17852294' - }, - { - logic: [ - { - value: '', - location: 0, - date: '', - time: '', - type: 0, - row_type: 0, - cell_type: 0, - logic: 'if', - operator: '=', - is_answer: 1, - is_select: 0, - row_index: 0, - cell_index: 0, - question_type: 1, - question_index: 24, - relation_question_index: 0, - relation_question_row_index: 0, - relation_question_cell_index: 0, - is_option_group: 0, - option_index: 0, - skip_type: null, - question_id: null - } - ], - skip_type: 0, - id: 472149, - question_index: 24, - question_id: '17852294' - }, - { - logic: [ - { - value: '', - location: 0, - date: '', - time: '', - type: 0, - row_type: 0, - cell_type: 0, - logic: 'if', - operator: '=', - is_answer: 1, - is_select: 0, - row_index: 0, - cell_index: 0, - question_type: 1, - question_index: 24, - relation_question_index: 0, - relation_question_row_index: 0, - relation_question_cell_index: 0, - is_option_group: 0, - option_index: 0, - skip_type: null, - question_id: null - } - ], - skip_type: 0, - id: 472151, - question_index: 24, - question_id: '17852294' - }, - { - logic: [ - { - logic: 'if', - question_index: 30, - question_type: 1, - is_answer: 1, - operator: '=', - option_index: 2, - relation_question_index: 0, - type: 0, - is_option_group: 0, - group_index: null - }, - { - logic: 'and', - question_index: 30, - question_type: 1, - is_answer: 1, - operator: '=', - option_index: 1, - relation_question_index: 0, - type: 0, - is_option_group: 1, - group_index: 1 - } - ], - skip_question_index: 0, - skip_type: 1, - id: 472152, - question_index: 24, - question_id: '17852294' - }, - { - logic: [ - { - logic: 'if', - question_index: 30, - question_type: 1, - is_answer: 0, - operator: '=', - option_index: 0, - relation_question_index: 0, - type: 0 - } - ], - skip_type: 1, - id: '28fe4d64-81eb-4937-a082-c519ac74374f', - question_index: 24, - question_id: '17852294' - }, - { - logic: [ - { - operator: '=', - is_answer: 1, - question_type: 1, - logic: 'always' - } - ], - skip_type: 1, - id: '459f781f-8db0-4663-b2d1-9ddad627078e', - question_index: 24, - question_id: '17852294' - } - ], + logics: [], questions: [], cycle_pages: null - } as QuestionsInfo + } }), actions: { - async fetchQuestionInfo(questionInfo: string) { + async fetchQuestionInfo(questionInfo) { + console.log(questionInfo, 456); try { if (!questionInfo) return; const info = JSON.parse(questionInfo); if (info?.questions?.length) { - info.questions.forEach((page:any) => { + info.questions.forEach((page) => { // 使用 UUID 生成唯一 ID if (page?.page) { page.pageId = page.pageId || uuidv4(); @@ -282,21 +69,10 @@ export const useCommonStore = defineStore('common', { // 未来扩展 } }, - setQuestionInfo(questionInfo: QuestionsInfo) { + setQuestionInfo(questionInfo) { + console.log(questionInfo, 9998); + console.log(this); this.questionsInfo = questionInfo; - }, - /** - * web 端测试问卷地址 `/api/api/console/surveys/RWNK9BYp/questions` - * 做了个测试,后面再改 - */ - fetchSurveyQuestion() { - http.get(surveyQuestion).then(res => { - // console.log('http get request:',res.data.data); - this.setQuestionInfo(res.data.data); - });/* .catch(res=>{ - // console.log('catch',res); - this.setQuestionInfo(res); - }) */ } }, getters: { diff --git a/src/utils/QuestionJsons/FileUpload.js b/src/utils/QuestionJsons/FileUpload.js new file mode 100644 index 0000000..868a7a8 --- /dev/null +++ b/src/utils/QuestionJsons/FileUpload.js @@ -0,0 +1,29 @@ +export default { + id: '', + question_type: 18, + question_index: 41, + stem: '请上传文件', + title: 'Q14', + options: [], + last_option_index: 0, + config: { + is_required: 1, + quick_type: 0, + is_show: [], + select_random: 0, + min_number: 1, + max_number: 1, + min_size: 0, + max_size: 1, + is_file: 0, + file_type: '0' + }, + associate: [], + question_code: '', + logic_config: { + order: 0, + type: 0, + expect: '', + stay_time: '' + } +}; diff --git a/src/utils/QuestionJsons/MartrixQuestion.js b/src/utils/QuestionJsons/MartrixQuestion.js index 5da73ce..583eccf 100644 --- a/src/utils/QuestionJsons/MartrixQuestion.js +++ b/src/utils/QuestionJsons/MartrixQuestion.js @@ -1,14 +1,14 @@ export default { // JSON 需要修改 id: '', - question_type: 5, + question_type: '', question_index: '', - stem: '请完成打分', + stem: '请每行选择一个选项', title: '', options: [ [ { - id: 'e46f51b1-bfd8-4d9c-becc-4fb7d175a6f4', + id: '', is_fixed: 0, is_other: 0, is_remove_other: 0, @@ -25,6 +25,83 @@ export default { type: 0, cascade: [], config: [] + }, + { + id: '', + is_fixed: 0, + is_other: 0, + is_remove_other: 0, + option: '选项2
', + option_config: { + image_url: [], + title: '', + instructions: [], + option_type: 0, + limit_right_content: '' + }, + option_index: 1, + parent_id: 0, + type: 0, + cascade: [], + config: [] + } + ], + [ + { + option: '列标签1
', + id: '1049201', + type: 2, + is_other: 0, + is_fixed: 0, + is_remove_other: 0, + created_at: null, + created_user_id: null, + parent_id: null, + option_index: 3, + list_id: 74491, + option_code: '', + option_config: { + title: '', + instructions: [], + price: 0, + gradient: '', + image_url: [], + option_type: 0, + type: 0, + limit_right_content: '', + child_area: null, + binding_goods_id: '' + }, + disable_option_update: null, + cascade: [] + }, + { + option: '列标签2
', + id: '1049202', + type: 2, + is_other: 0, + is_fixed: 0, + is_remove_other: 0, + created_at: null, + created_user_id: null, + parent_id: null, + option_index: 4, + list_id: 74491, + option_code: '', + option_config: { + title: '', + instructions: [], + price: 0, + gradient: '', + image_url: [], + option_type: 0, + type: 0, + limit_right_content: '', + child_area: null, + binding_goods_id: '' + }, + disable_option_update: null, + cascade: [] } ] ], diff --git a/src/utils/QuestionJsons/NPS.js b/src/utils/QuestionJsons/NPS.js new file mode 100644 index 0000000..0f305ef --- /dev/null +++ b/src/utils/QuestionJsons/NPS.js @@ -0,0 +1,54 @@ +export default { + id: '', + question_type: 106, + question_index: 0, + stem: '您向朋友或同事推荐我们的可能性多大?', + title: '', + options: [ + [ + { + id: 'b68d45eb-d833-4b25-b0aa-2fde1310e88d', + is_fixed: 0, + is_other: 0, + is_remove_other: 0, + option: '选项1
', + option_config: { + image_url: [], + title: '', + instructions: [], + option_type: 0, + limit_right_content: '' + }, + option_index: 1, + parent_id: 0, + type: 0, + cascade: [], + config: [] + } + ] + ], + last_option_index: 0, + config: { + is_required: 1, + quick_type: 0, + is_show: [], + version: 2, + prompt_left: '不可能', + prompt_right: '极有可能', + prompt_center: '', + max: 10, + min: 0, + score_interval: 1, + score_type: 0, + score_way: 1, + prompt_score: 2 + }, + associate: [], + question_code: '', + logic_config: { + order: 0, + type: 0, + expect: '', + stay_time: '' + } +}; diff --git a/src/utils/QuestionJsons/SignQuestion.js b/src/utils/QuestionJsons/SignQuestion.js new file mode 100644 index 0000000..c8e11da --- /dev/null +++ b/src/utils/QuestionJsons/SignQuestion.js @@ -0,0 +1,37 @@ +export default { + id: '17852690', + title: 'Q7', + stem: '请留下您的姓名', + other: '', + question_index: 10, + question_type: 22, + config: { + is_required: 1, + select_random: 0, + float_window: 0, + float_window_content: '', + popup_window: 0, + popup_window_content: '', + is_show: [], + quick_type: 0 + }, + created_at: '2025-03-06T15:51:13', + created_user_id: 1281, + updated_user_id: null, + survey_id: 9482, + logic_config: { + expect: '', + order: 0, + type: 0, + stay_time: '' + }, + options: [], + associate: [], + logics_has: null, + last_option_index: 0, + question_code: '', + question_value: '', + question_tag: '', + planet_id: '', + permissions: null +}; diff --git a/src/utils/QuestionJsons/TextWithImages.js b/src/utils/QuestionJsons/TextWithImages.js new file mode 100644 index 0000000..1c8d613 --- /dev/null +++ b/src/utils/QuestionJsons/TextWithImages.js @@ -0,0 +1,22 @@ +export default { + id: '', + question_type: '', + question_index: 0, + stem: '请认真阅读以下内容', + title: '', + options: [], + last_option_index: 0, + config: { + is_required: 1, + quick_type: 0, + is_show: [] + }, + associate: [], + question_code: '', + logic_config: { + order: 0, + type: 0, + expect: '', + stay_time: '' + } +}; diff --git a/src/utils/importJsons.js b/src/utils/importJsons.js index b952229..66ff0ab 100644 --- a/src/utils/importJsons.js +++ b/src/utils/importJsons.js @@ -4,3 +4,7 @@ export { default as checkbox } from './QuestionJsons/Checkbox.js'; export { default as completion } from './QuestionJsons/Completion.js'; export { default as rate } from './QuestionJsons/Rate.js'; export { default as martrixQuestion } from './QuestionJsons/MartrixQuestion.js'; +export { default as fileUpload } from './QuestionJsons/FileUpload.js'; +export { default as textWithImages } from './QuestionJsons/TextWithImages.js'; +export { default as signQuestion } from './QuestionJsons/SignQuestion.js'; +export { default as nps } from './QuestionJsons/NPS.js'; diff --git a/src/utils/request.js b/src/utils/request.js new file mode 100644 index 0000000..16fd215 --- /dev/null +++ b/src/utils/request.js @@ -0,0 +1,91 @@ +import axios from 'axios'; + +// import router from '@/router/index'; +// import { A_COMMON_CLEAR_TOKEN } from '@/stores/constance/constance.common.js'; + +import * as config from '@/config.js'; +// import {proxyUrl} from config.default +const NODE_ENV = import.meta.env.VITE_APP_ENV; +const baseURL = NODE_ENV === 'production' ? config.default.proxyUrl : 'http://192.168.8.165:15011/'; + +// axios.defaults.withCredentials = true; + +// create an axios instance +const service = axios.create({ + baseURL: `${baseURL}`, // url = base url + request url + // withCredentials: true, // send cookies when cross-domain requests + timeout: 30000 // request timeout +}); + +// request interceptor +service.interceptors.request.use( + (config) => { + if (!config.headers) { + config.headers.Accept = 'application/json'; + } + config.headers.Authorization = `${localStorage.getItem('plantToken')}`; + if (!config.headers.remoteIp) { + config.baseURL += '/api'; + } + delete config.headers.host; + config.headers.remoteIp = localStorage.getItem('plantIp') || '127.0.0.1'; + // if (store.state.common.token) { + // config.headers['Login-Type'] = 'pc'; + // config.headers.Authorization = `Bearer ${store.state.common.token}`; + // } + return config; + }, + (error) => Promise.reject(error) +); + +// response interceptor +service.interceptors.response.use( + (response) => { + if ( + response.status === 200 + || response.status === 201 + || response.status === 202 + || response.status === 204 + ) { + if (response.config.method === 'put') { + // message.success('保存中...'); + } + return Promise.resolve(response); + } + // return Promise.reject(/* new Error(response.message || 'Error') */); + } + // (error) => { + // // for debug + // if (error.response.status === 401) { + // const query = router.currentRoute.value.query; + // //关闭已弹出的所有弹框,防止弹框重叠 + // // Modal.destroyAll(); + // store.dispatch(A_COMMON_CLEAR_TOKEN); + // window.parent.postMessage( + // { + // code: '301', + // params: {} + // }, + // '*' + // ); + // store.commit('common/M_COMMON_SET_TOKEN_UNAUTHORIZED', false); + // } else if (error.response.status === 403) { + // router.push({ + // path: '/error/403' + // }); + // } else if (error.response.status === 404) { + // router.push({ + // path: '/error/404' + // }); + // } else if (error.response.status === 500) { + // router.push({ + // path: '/error/500' + // }); + // } else { + // // message.error(error.response.data?.message || '服务器错误'); + // } + // return Promise.reject(error.response); + // } +); + +export default service; diff --git a/src/views/Design/Index.vue b/src/views/Design/Index.vue index 52a7248..434861e 100644 --- a/src/views/Design/Index.vue +++ b/src/views/Design/Index.vue @@ -14,8 +14,6 @@ :questions="questionInfo.questions" :index="index" :chooseQuestionId="chooseQuestionId" - :show-actions="!preview" - style="margin: 10px 0" @get-choose-question-id="getChooseQuestionId" > @@ -89,7 +87,11 @@| + + | + + + + | +
|---|---|
| + + + | ++ + + | +
{{ element.config.prompt_left }}
diff --git a/src/views/Design/components/Questions/Rate.vue b/src/views/Design/components/Questions/Rate.vue index cedcc02..642c8b3 100644 --- a/src/views/Design/components/Questions/Rate.vue +++ b/src/views/Design/components/Questions/Rate.vue @@ -19,7 +19,11 @@{{ item.name }}
-