feat:首页联调

This commit is contained in:
du.meimei
2025-03-12 18:20:30 +08:00
parent 0b5d08e3b9
commit e30652902e
31 changed files with 450 additions and 282 deletions

4
auto-imports.d.ts vendored
View File

@@ -5,6 +5,4 @@
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {
}
declare global {}

11
components.d.ts vendored
View File

@@ -10,28 +10,20 @@ declare module 'vue' {
Contenteditable: typeof import('./src/components/contenteditable.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
'Van-': typeof import('vant/es')['-']
VanActionSheet: typeof import('vant/es')['ActionSheet']
VanButton: typeof import('vant/es')['Button']
VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup']
VanCheck: typeof import('vant/es')['Check']
VanCheckbo: typeof import('vant/es')['Checkbo']
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']
@@ -39,9 +31,10 @@ declare module 'vue' {
VanSearch: typeof import('vant/es')['Search']
VanStepper: typeof import('vant/es')['Stepper']
VanSwitch: typeof import('vant/es')['Switch']
VanTab: typeof import('vant/es')['Tab']
VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem']
VanTimePicker: typeof import('vant/es')['TimePicker']
VanTabs: typeof import('vant/es')['Tabs']
YLPicker: typeof import('./src/components/YLPicker.vue')['default']
YLSelect: typeof import('./src/components/YLSelect.vue')['default']
}

View File

@@ -4,7 +4,7 @@ import { onMounted } from 'vue';
import appBridge from '@/assets/js/appBridge';
import utils from '@/assets/js/common';
onMounted(async() => {
onMounted(async () => {
if (utils.getParameter('digitalYiliToken')) {
// 隐藏/显示 header
appBridge.setHeaderShown(false);

View File

@@ -17,3 +17,18 @@ export function consoleSurveys(params) {
}
});
}
export function getListScene(params) {
return request({
url: 'console/list_scene',
method: 'get',
params
});
}
//
export function getSurveyTemplates(params) {
return request({
url: '/console/survey_templates',
method: 'get',
params
});
}

View File

@@ -31,4 +31,4 @@ export function getCheckSurvey(sn) {
url: `/console/check_survey_test/${sn}`,
method: 'get'
});
}
}

View File

@@ -1,25 +1,25 @@
export default {
/** ****************** ReactNative通信 ********************/
/**
* 生成唯一ID
* @returns {string} 唯一ID
*/
* 生成唯一ID
* @returns {string} 唯一ID
*/
generateUniqueId() {
return `cb_${Date.now()}_${Math.floor(Math.random() * 1000)}`;
},
/**
* @desc 检查是否在ReactNative环境中
* @returns {Boolean} 是否在ReactNative WebView中
*/
* @desc 检查是否在ReactNative环境中
* @returns {Boolean} 是否在ReactNative WebView中
*/
isInReactNative() {
return typeof window !== 'undefined' && !!window.ReactNativeWebView;
},
/**
* @desc 发送消息到ReactNative
* @param {Object} message 消息对象
* @returns {Boolean} 发送是否成功
*/
* @desc 发送消息到ReactNative
* @param {Object} message 消息对象
* @returns {Boolean} 发送是否成功
*/
postMessageToRN(data) {
if (!this.isInReactNative()) {
return false;
@@ -33,10 +33,10 @@ export default {
},
/**
* @desc 控制头部导航栏显示/隐藏
* @param {Boolean} visible 是否显示导航栏
* @returns {Boolean} 操作是否成功
*/
* @desc 控制头部导航栏显示/隐藏
* @param {Boolean} visible 是否显示导航栏
* @returns {Boolean} 操作是否成功
*/
setHeaderShown(visible = false) {
return this.postMessageToRN({
type: 'headerShown',
@@ -45,9 +45,9 @@ export default {
},
/**
* @desc 关闭当前页面,触发返回操作
* @returns {Boolean} 操作是否成功
*/
* @desc 关闭当前页面,触发返回操作
* @returns {Boolean} 操作是否成功
*/
navigateBack() {
return this.postMessageToRN({
type: 'back'
@@ -55,10 +55,10 @@ export default {
},
/**
* @desc 设置头部导航栏标题
* @param {String} title 标题文本
* @returns {Boolean} 操作是否成功
*/
* @desc 设置头部导航栏标题
* @param {String} title 标题文本
* @returns {Boolean} 操作是否成功
*/
setTitle(title) {
if (title) {
return this.postMessageToRN({
@@ -69,10 +69,10 @@ export default {
},
/**
* @desc 设置系统状态栏明暗主题
* @param {String} style 主题风格,'light'为浅色,'dark'为深色
* @returns {Boolean} 操作是否成功
*/
* @desc 设置系统状态栏明暗主题
* @param {String} style 主题风格,'light'为浅色,'dark'为深色
* @returns {Boolean} 操作是否成功
*/
setStatusBarStyle(style = 'light') {
return this.postMessageToRN({
type: 'statusBar',
@@ -81,10 +81,10 @@ export default {
},
/**
* @desc 跳转到APP页面
* @param {String} url APP内页面路由
* @returns {Boolean} 操作是否成功
*/
* @desc 跳转到APP页面
* @param {String} url APP内页面路由
* @returns {Boolean} 操作是否成功
*/
navigateToAppPage(url) {
return this.postMessageToRN({
type: 'navigate',
@@ -123,9 +123,9 @@ export default {
// },
/**
* @desc 禁用原生返回Android
* @returns {Boolean} 操作是否成功
*/
* @desc 禁用原生返回Android
* @returns {Boolean} 操作是否成功
*/
takeOverAndroidBack() {
return this.postMessageToRN({
type: 'takeOverAndroidBack'
@@ -133,10 +133,10 @@ export default {
},
/**
* @desc 跳转到手机浏览器中打开页面
* @param {String} url 要打开的URL
* @returns {Boolean} 操作是否成功
*/
* @desc 跳转到手机浏览器中打开页面
* @param {String} url 要打开的URL
* @returns {Boolean} 操作是否成功
*/
openInBrowser(url) {
return this.postMessageToRN({
type: 'openLink',
@@ -145,10 +145,10 @@ export default {
},
/**
* @desc 使用原生扫码工具
* @param {Function} callback 扫码结果回调函数
* @returns {Boolean} 操作是否成功
*/
* @desc 使用原生扫码工具
* @param {Function} callback 扫码结果回调函数
* @returns {Boolean} 操作是否成功
*/
scanCode(callback) {
const cbId = this.generateUniqueId();
window[cbId] = callback;
@@ -159,16 +159,16 @@ export default {
},
/**
* @desc 分享链接到微信
* @param {Object} options 分享选项
* @param {String} options.title 分享标题
* @param {String} options.description 分享副标题
* @param {String} options.thumbImageUrl 缩略图URL
* @param {String} options.webpageUrl 网页链接
* @param {Number} options.scene 分享场景0为微信好友1为朋友圈
* @param {Function} callback 分享结果回调函数
* @returns {Boolean} 操作是否成功
*/
* @desc 分享链接到微信
* @param {Object} options 分享选项
* @param {String} options.title 分享标题
* @param {String} options.description 分享副标题
* @param {String} options.thumbImageUrl 缩略图URL
* @param {String} options.webpageUrl 网页链接
* @param {Number} options.scene 分享场景0为微信好友1为朋友圈
* @param {Function} callback 分享结果回调函数
* @returns {Boolean} 操作是否成功
*/
shareToWeChat(options, callback) {
const cbId = this.generateUniqueId();
window[cbId] = callback;
@@ -184,16 +184,16 @@ export default {
},
/**
* @desc 分享视频到抖音
* @param {Object} options 分享选项
* @param {String} options.title 分享标题
* @param {String} options.shortTitle 抖音短标题
* @param {Array<String>} options.videos 视频地址数组
* @param {Boolean} options.isPublish 是否直接跳转到发布页
* @param {Boolean} options.tip 是否显示APP自带的提示与loading
* @param {Function} callback 分享结果回调函数
* @returns {Boolean} 操作是否成功
*/
* @desc 分享视频到抖音
* @param {Object} options 分享选项
* @param {String} options.title 分享标题
* @param {String} options.shortTitle 抖音短标题
* @param {Array<String>} options.videos 视频地址数组
* @param {Boolean} options.isPublish 是否直接跳转到发布页
* @param {Boolean} options.tip 是否显示APP自带的提示与loading
* @param {Function} callback 分享结果回调函数
* @returns {Boolean} 操作是否成功
*/
shareVideoToDouyin(options, callback) {
const cbId = this.generateUniqueId();
window[cbId] = callback;
@@ -209,10 +209,10 @@ export default {
},
/**
* @desc 唤起抖音
* @param {Function} callback 操作结果回调函数
* @returns {Boolean} 操作是否成功
*/
* @desc 唤起抖音
* @param {Function} callback 操作结果回调函数
* @returns {Boolean} 操作是否成功
*/
openDouyin(callback) {
const cbId = this.generateUniqueId();
window[cbId] = callback;
@@ -223,11 +223,11 @@ export default {
},
/**
* @desc 分享文本到微博
* @param {String} content 要分享的文本内容
* @param {Function} callback 分享结果回调函数
* @returns {Boolean} 操作是否成功
*/
* @desc 分享文本到微博
* @param {String} content 要分享的文本内容
* @param {Function} callback 分享结果回调函数
* @returns {Boolean} 操作是否成功
*/
shareTextToWeibo(content, callback) {
const cbId = this.generateUniqueId();
window[cbId] = callback;
@@ -239,11 +239,11 @@ export default {
},
/**
* @desc 保存到相册
* @param {String} src 媒体资源URL图片或视频
* @param {Function} callback 保存结果回调函数
* @returns {Boolean} 操作是否成功
*/
* @desc 保存到相册
* @param {String} src 媒体资源URL图片或视频
* @param {Function} callback 保存结果回调函数
* @returns {Boolean} 操作是否成功
*/
save2Album(src, callback) {
const cbId = this.generateUniqueId();
window[cbId] = callback;
@@ -255,11 +255,11 @@ export default {
},
/**
* @desc 请求安卓权限
* @param {String} permission 权限名称,如'android.permission.CAMERA'
* @param {Function} callback 请求结果回调函数
* @returns {Boolean} 操作是否成功
*/
* @desc 请求安卓权限
* @param {String} permission 权限名称,如'android.permission.CAMERA'
* @param {Function} callback 请求结果回调函数
* @returns {Boolean} 操作是否成功
*/
requestAndroidPermission(permission, callback) {
const cbId = this.generateUniqueId();
window[cbId] = callback;
@@ -270,14 +270,14 @@ export default {
});
},
/**
* @desc 获取新的认证令牌
* @param {Function} callback 获取结果回调函数,参数格式为:
* {status: 0|1, msg: string, data: string}
* status: 0成功1失败
* msg: 错误信息
* data: 新token
* @returns {Boolean} 操作是否成功
*/
* @desc 获取新的认证令牌
* @param {Function} callback 获取结果回调函数,参数格式为:
* {status: 0|1, msg: string, data: string}
* status: 0成功1失败
* msg: 错误信息
* data: 新token
* @returns {Boolean} 操作是否成功
*/
getNewAuthToken(callback) {
const cbId = this.generateUniqueId();
window[cbId] = callback;

View File

@@ -16,11 +16,10 @@ export default {
*/
_string2json(value) {
try {
value = JSON.parse(value);
return JSON.parse(value);
} catch (e) {
// 以后再说
}
return value;
},
/**

View File

@@ -167,8 +167,8 @@ const getMaxDateLimit = computed(() => {
props.format
);
const tempStr = '0000-12-31 23:59:59';
const result
= props.maxDate.length !== 0 && thisMax.length > props.maxDate.length
const result =
props.maxDate.length !== 0 && thisMax.length > props.maxDate.length
? thisMax.slice(0, props.maxDate.length) + tempStr.slice(props.maxDate.length)
: thisMax;
return result.slice(0, props.format.length);
@@ -191,8 +191,8 @@ function onChange({ selectedValues, columnIndex }) {
renderMinuteColumns,
renderSecondColumns
];
updateColumns[columnIndex]
&& updateColumns[columnIndex](changeValue, getMinDateLimit.value, getMaxDateLimit.value, false);
updateColumns[columnIndex] &&
updateColumns[columnIndex](changeValue, getMinDateLimit.value, getMaxDateLimit.value, false);
}
// 渲染全部列

View File

@@ -4,11 +4,11 @@
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src:
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix')
format('embedded-opentype'),
format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont')
format('svg');
format('svg');
src:
url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff2?t=1741575060989') format('woff2'),
url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff?t=1741575060989') format('woff'),

View File

@@ -4,11 +4,11 @@
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src:
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix')
format('embedded-opentype'),
format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont')
format('svg');
format('svg');
}
.logo {

View File

@@ -51,12 +51,14 @@ const router = createRouter({
name: 'preview',
meta: {},
component: Preview
}, {
},
{
path: '/create',
name: 'create',
meta: { title: '问卷编辑' },
component: () => import('../views/Survey/views/Create/Index.vue')
}, {
},
{
path: '/publish',
name: 'publish',
meta: { title: '问卷发布' },

View File

@@ -42,10 +42,10 @@ service.interceptors.request.use(
service.interceptors.response.use(
(response) => {
if (
response.status === 200
|| response.status === 201
|| response.status === 202
|| response.status === 204
response.status === 200 ||
response.status === 201 ||
response.status === 202 ||
response.status === 204
) {
if (response.config.method === 'put') {
// message.success('保存中...');

View File

@@ -50,8 +50,8 @@
<martrix-question
v-if="
element.question_type === 8 ||
element.question_type === 9 ||
element.question_type === 10
element.question_type === 9 ||
element.question_type === 10
"
:element="computedElement(element)"
:index="index"

View File

@@ -1,6 +1,5 @@
<script setup lang="ts">
import PreviewIndex from './Index.vue';
</script>
<template>
@@ -13,4 +12,4 @@ import PreviewIndex from './Index.vue';
<preview-index :filterGap="true"></preview-index>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped></style>

View File

@@ -117,23 +117,23 @@ const openMoveModel = (item, index) => {
// 上下移动
const optionMove = (action) => {
switch (action.action) {
case 'up':
if (activeIndex.value === 0) {
moveShow.value = false;
return false;
}
// 向上移动
element.value.splice(activeIndex.value - 1, 0, element.value.splice(activeIndex.value, 1)[0]);
activeIndex.value -= 1;
break;
case 'down':
if (activeIndex.value === element.value.length - 1) {
moveShow.value = false;
return false;
}
element.value.splice(activeIndex.value + 1, 0, element.value.splice(activeIndex.value, 1)[0]);
activeIndex.value += 1;
break;
case 'up':
if (activeIndex.value === 0) {
moveShow.value = false;
return false;
}
// 向上移动
element.value.splice(activeIndex.value - 1, 0, element.value.splice(activeIndex.value, 1)[0]);
activeIndex.value -= 1;
break;
case 'down':
if (activeIndex.value === element.value.length - 1) {
moveShow.value = false;
return false;
}
element.value.splice(activeIndex.value + 1, 0, element.value.splice(activeIndex.value, 1)[0]);
activeIndex.value += 1;
break;
}
};

View File

@@ -233,8 +233,8 @@ const getSkipTypeText = (skipType) => {
const ls = [];
logics.map((item) => {
if (
item.skip_type === skipType
&& item.question_index === activeQuestion.value.question_index
item.skip_type === skipType &&
item.question_index === activeQuestion.value.question_index
) {
ls.push(item);
}
@@ -250,13 +250,13 @@ const getSkipTypeText = (skipType) => {
const questionSetting = (type) => {
switch (type) {
case 'before':
questionBeforeShow.value = true;
case 'before':
questionBeforeShow.value = true;
break;
case 'after':
questionBeforeShow.value = true;
break;
break;
case 'after':
questionBeforeShow.value = true;
break;
}
skipType.value = type === 'before' ? 1 : 0;
};

View File

@@ -108,9 +108,9 @@ function isSurplus() {
return false;
} else {
return (
parseFloat(((localConfig.value.max - localConfig.value.min) * 1000).toFixed(4, 10))
% parseFloat((localConfig.value.score_interval * 1000).toFixed(4, 10))
=== 0
parseFloat(((localConfig.value.max - localConfig.value.min) * 1000).toFixed(4, 10)) %
parseFloat((localConfig.value.score_interval * 1000).toFixed(4, 10)) ===
0
);
}
}

View File

@@ -77,4 +77,4 @@ function handleFileUpload() {
width: 100%;
height: 50px;
}
</style>
</style>

View File

@@ -16,14 +16,14 @@ const { element } = defineProps<{ element: MatrixSurveyQuestion }>();
*/
const tableInputTypeMapping = (/** regx?: any */) => {
switch (element.question_type) {
case 8:
return 'text';
case 9:
return 'radio';
case 10:
return 'checkbox';
default:
return 'radio';
case 8:
return 'text';
case 9:
return 'radio';
case 10:
return 'checkbox';
default:
return 'radio';
}
};

View File

@@ -11,7 +11,8 @@
class="iconfont active-icon"
:style="{ marginRight: isLastPage ? '0' : '16px' }"
@click="activePage"
>&#xe86c;</i>
>&#xe86c;</i
>
<template v-if="!isLastPage">
<i class="iconfont moverQues" style="margin-right: 16px">&#xe71b;</i>
<i class="iconfont" @click="deleteHandle">&#xe6c5;</i>

View File

@@ -1,58 +1,58 @@
interface Config {
is_required: number;
min_number: number;
max_number: number;
min_size: number;
max_size: number;
file_type: string;
float_window: number;
float_window_content: string;
popup_window: number;
popup_window_content: string;
is_show: any[];
quick_type: number;
is_required: number;
min_number: number;
max_number: number;
min_size: number;
max_size: number;
file_type: string;
float_window: number;
float_window_content: string;
popup_window: number;
popup_window_content: string;
is_show: any[];
quick_type: number;
}
interface LogicConfig {
expect: string;
order: number;
type: number;
stay_time: string;
expect: string;
order: number;
type: number;
stay_time: string;
}
interface Permissions {
id: null;
question_id: null;
parent_question_id: null;
disable_update: null;
disable_option_update: null;
disable_copy: null;
disable_delete: null;
delete_group_keep_one: null;
disable_copy_delete: null;
disable_copy_update: null;
id: null;
question_id: null;
parent_question_id: null;
disable_update: null;
disable_option_update: null;
disable_copy: null;
disable_delete: null;
delete_group_keep_one: null;
disable_copy_delete: null;
disable_copy_update: null;
}
interface FileUploadQuestion {
id: string;
title: string;
stem: string;
other: string | null;
question_index: number;
question_type: number;
config: Config;
created_at: string | null;
created_user_id: number | null;
updated_user_id: number | null;
survey_id: number;
logic_config: LogicConfig;
options: any[];
associate: any[];
logics_has: number | null;
last_option_index: number;
question_code: string;
question_value: string | null;
question_tag: string | null;
planet_id: string | null;
permissions: Permissions | null;
id: string;
title: string;
stem: string;
other: string | null;
question_index: number;
question_type: number;
config: Config;
created_at: string | null;
created_user_id: number | null;
updated_user_id: number | null;
survey_id: number;
logic_config: LogicConfig;
options: any[];
associate: any[];
logics_has: number | null;
last_option_index: number;
question_code: string;
question_value: string | null;
question_tag: string | null;
planet_id: string | null;
permissions: Permissions | null;
}

View File

@@ -8,7 +8,7 @@ import utils from '@/assets/js/common';
import { getUserInfo } from '@/api/common/index.js';
import { showFailToast } from 'vant';
onMounted(async() => {
onMounted(async () => {
if (utils.getParameter('digitalYiliToken')) {
const query = {
xToken: utils.getParameter('digitalYiliToken')

View File

@@ -1,8 +1,7 @@
<script setup lang="ts">
// import { ref } from 'vue';
import { consoleSurveys } from '@/api/home/index.js';
<script setup>
import { ref, onMounted } from 'vue';
import { consoleSurveys, getQuestionList } from '@/api/home/index.js';
import { snQuestions, saveQuestions } from '@/api/design/index.js';
import { surveys } from './Hooks/useRequestHooks';
import { useRouter } from 'vue-router';
import { useCounterStore } from '@/stores/counter';
import { storeToRefs } from 'pinia';
@@ -11,6 +10,7 @@ const counterStore = useCounterStore();
const store = storeToRefs(counterStore);
const router = useRouter();
const surveys = ref([]);
const createdQuestion = (item) => {
const query = {
@@ -44,6 +44,28 @@ const createdQuestion = (item) => {
}
});
};
// 添加获取问卷列表的方法
const getList = () => {
getQuestionList().then((res) => {
if (res.data.code === 0) {
if (res.data.data) {
res.data.data.forEach((item) => {
if (item.parentCode && item.parentCode === 1) {
surveys.value.push(item);
}
});
surveys.value.push({});
}
}
});
};
// 在组件挂载时调用
onMounted(() => {
getList();
});
</script>
<template>
@@ -57,7 +79,7 @@ const createdQuestion = (item) => {
class="survey"
@click="createdQuestion(survey)"
>
<img width="45px" :src="survey.icon" alt=" " />
<img :src="survey.image" alt="" width="40" />
<span>{{ survey.title }}</span>
</van-col>
</van-row>

View File

@@ -1,11 +1,3 @@
<script setup lang="ts">
import { ref, h } from 'vue';
import { tables } from './hooks/useMarketHooks';
import TestComponent from './components/TestComponent.vue';
const activeComponet = ref(h(TestComponent, { cn: '报名签到' }));
</script>
<template>
<!-- 模板 -->
<div class="market">
@@ -15,15 +7,63 @@ const activeComponet = ref(h(TestComponent, { cn: '报名签到' }));
</div>
<div class="market_table">
<div v-for="item in tables" :key="item.title" @click="activeComponet = item.component">
<div v-for="item in tables" :key="item.title" @click="getMarketInfo(item)">
{{ item.title }}
</div>
</div>
<van-cell class="market_items">
<component :is="activeComponet" />
<market-item :info="marketInfo"></market-item>
<!-- <component :is="TestComponent" />-->
</van-cell>
<p class="more">-更多模板期待您的探索-</p>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import MarketItem from './components/MarketItem.vue';
import { getListScene, getSurveyTemplates } from '@/api/home';
interface SceneItem {
parentCode: number;
title: string;
component: any;
code: number;
}
const tables = ref<SceneItem[]>([]);
const marketInfo = ref([]);
const getTableList = async () => {
const res = await getListScene();
if (res.data.code === 0) {
res.data.data.forEach((item: SceneItem) => {
if (item.parentCode && item.parentCode === 1) {
tables.value.push(item);
}
});
getMarketInfo(tables.value[0]);
}
};
const getMarketInfo = async (item: SceneItem) => {
const params = {
page: 1,
per_page: 10,
group_id: 0,
is_public: 1,
scene_code_info: item.code,
sort: 'quote_nums, desc'
};
const res = await getSurveyTemplates(params);
if (res.data.code === 0) {
marketInfo.value = res.data.data;
}
};
onMounted(() => {
getTableList();
});
</script>
<style scoped>
.market {
@@ -70,5 +110,12 @@ const activeComponet = ref(h(TestComponent, { cn: '报名签到' }));
background-color: white;
}
}
.more {
margin: 10px 0;
color: #666;
font-size: 14px;
text-align: center;
}
}
</style>

View File

@@ -0,0 +1,57 @@
<template>
<van-row :gutter="12">
<van-col v-for="(item, index) in info" :key="index" :span="12" class="market-item">
<div class="content">
<div class="title">
<span>{{ item.title }}</span>
<img
src="https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u42.svg"
/>
</div>
<div class="desc">
<span>引用{{ item.quote_nums }}</span> |
<span>创建人: {{ item.creator }}</span>
</div>
</div>
</van-col>
</van-row>
</template>
<script setup lang="ts">
const { info } = defineProps({
info: {
type: Object,
required: true,
default: () => ({})
}
});
</script>
<style lang="scss" scoped>
.market-item {
margin-bottom: 12px;
.content {
padding: 12px;
border-radius: 8px;
background: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
.title {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
img {
width: 20px;
height: 20px;
}
}
.desc {
color: #666;
font-size: 12px;
}
}
}
</style>

View File

@@ -1,36 +0,0 @@
<script setup lang="ts">
const { cn } = defineProps({
cn: {
type: String,
required: false,
deault: 'default'
}
});
</script>
<template>
<van-row :gutter="4">
<van-col
v-for="item in 2"
:key="item"
:span="10"
style="
display: flex;
flex-direction: column;
align-items: start;
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
"
>
<div style="display: flex; align-items: center; justify-content: space-evenly; width: 100%">
<span>{{ cn }} 模板</span>
<img
src="https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u42.svg?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64"
/>
</div>
<div><span>引用10次</span> | <span>创建人: 张三</span></div>
</van-col>
</van-row>
</template>
<style lang="sass" scoped></style>

View File

@@ -1,4 +1,4 @@
import TestComponent from '../components/TestComponent.vue';
import TestComponent from '../components/MarketItem.vue';
import { h } from 'vue';
export const tables = [

View File

@@ -3,7 +3,9 @@
<div v-for="item in 10" :key="item" class="template">
<img src="https://picsum.photos/131/128" width="110" height="100" alt="" />
<span>报名/签到模板</span>
<span style="color: rgb(127, 127, 127)">报名签到 | 引用 {{ item }} | 创建人: {{ '张三' }}</span>
<span style="color: rgb(127, 127, 127)"
>报名签到 | 引用 {{ item }} | 创建人: {{ '张三' }}</span
>
</div>
</div>
</template>

View File

@@ -457,14 +457,14 @@ const questionEvent = (item) => {
options:
item.json.options.length > 0
? item.json.options.map((item) => {
return item.map((it) => {
return {
...it,
// 主键生成
id: uuidv4()
};
});
})
return item.map((it) => {
return {
...it,
// 主键生成
id: uuidv4()
};
});
})
: []
})
);
@@ -597,8 +597,8 @@ const previewQuestion = () => {
router.push({ name: 'preview', query: { ...route.query } });
};
onMounted(async() => {
await getQuestionDetail(); // 等待接口返回数据
onMounted(async () => {
await getQuestionDetail();
});
</script>

View File

@@ -84,7 +84,7 @@ interface PublishInfo {
const publishInfo = ref<PublishInfo>({} as PublishInfo);
type OperateItem = (typeof operateList)[0];
onMounted(async() => {
onMounted(async () => {
getQrcode('Xxgdr5EN')
.then((res) => {
if (res.data) {
@@ -99,17 +99,17 @@ onMounted(async() => {
const operateBtn = (item: OperateItem) => {
console.log(item);
switch (item.type) {
case 'shareLink':
shareLink();
break;
case 'copyLink':
copyLink();
break;
case 'qrCode':
downLoadImg();
break;
default:
break;
case 'shareLink':
shareLink();
break;
case 'copyLink':
copyLink();
break;
case 'qrCode':
downLoadImg();
break;
default:
break;
}
};
// 复制链接

View File

@@ -0,0 +1,69 @@
// vite.config.ts
import {
defineConfig,
loadEnv
} from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/vite/dist/node/index.js';
import vue from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/@vitejs/plugin-vue/dist/index.mjs';
import { fileURLToPath, URL } from 'node:url';
import vueJsx from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs';
import AutoImport from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/unplugin-auto-import/dist/vite.js';
import Components from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/unplugin-vue-components/dist/vite.js';
import { VantResolver } from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/unplugin-vue-components/dist/resolvers.js';
import postCssPxToRem from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/postcss-pxtorem/index.js';
var __vite_injected_original_import_meta_url =
'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/vite.config.ts';
var vite_config_default = defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
const proxyUrl = env.VITE_APP_BASEURL;
const proxyUrlDelivery = env.VITE_APP_DELIVERY_BASEURL;
return {
// 必须 return 配置对象
server: {
host: '0.0.0.0',
port: 3e3,
proxy: {
'/backend-api': {
target: proxyUrl,
changeOrigin: true,
pathRewrite: {
'^/backend-api': ''
// 路径重写
},
// bypass: (req) => req.headers.accept?.indexOf('html') !== -1, // 跳过 HTML 请求
cookieDomainRewrite: 'localhost'
},
'/request-java': {
target: `${proxyUrlDelivery}/api`,
changeOrigin: true,
pathRewrite: { '^/request-java': '' }
}
}
},
css: {
postcss: {
plugins: [
postCssPxToRem({
rootValue: 37.5,
propList: ['*']
})
]
},
preprocessorOptions: {
scss: { api: 'modern-compiler' }
}
},
plugins: [
vue(),
vueJsx(),
AutoImport({ resolvers: [VantResolver()] }),
Components({ resolvers: [VantResolver()] })
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', __vite_injected_original_import_meta_url))
}
}
};
});
export { vite_config_default as default };
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJFOlxcXFx5aWppYW9mdVxcXFx5aWxpXFxcXEdJVFxcXFx5bHN0LXN1cnZleS1oNVwiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRTpcXFxceWlqaWFvZnVcXFxceWlsaVxcXFxHSVRcXFxceWxzdC1zdXJ2ZXktaDVcXFxcdml0ZS5jb25maWcudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0U6L3lpamlhb2Z1L3lpbGkvR0lUL3lsc3Qtc3VydmV5LWg1L3ZpdGUuY29uZmlnLnRzXCI7Ly8gdml0ZS5jb25maWcudHNcclxuaW1wb3J0IHsgZGVmaW5lQ29uZmlnLCBsb2FkRW52IH0gZnJvbSAndml0ZSc7IC8vIFx1NEVDRSB2aXRlIFx1NUJGQ1x1NTE2NSBsb2FkRW52XHJcbmltcG9ydCB2dWUgZnJvbSAnQHZpdGVqcy9wbHVnaW4tdnVlJztcclxuaW1wb3J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gIHBvcnQ6IDMwMDAsXHJcbiAgICAgIHByb3h5OiB7XHJcbiAgICAgICAgJy9iYWNrZW5kLWFwaSc6IHtcclxuICAgICAgICAgIHRhcmdldDogcHJveHlVcmwsXHJcbiAgICAgICAgICBjaGFuZ2VPcmlnaW46IHRydWUsXHJcbiAgICAgICAgICBwYXRoUmV3cml0ZToge1xyXG4gICAgICAgICAgICAnXi9iYWNrZW5kLWFwaSc6ICcnIC8vIFx1OERFRlx1NUY4NFx1OTFDRFx1NTE5OVxyXG4gICAgICAgICAgfSxcclxuICAgICAgICAgIC8vIGJ5cGFzczogKHJlcSkgPT4gcmVxLmhlYWRlcnMuYWNjZXB0Py5pbmRleE9mKCdodG1sJykgIT09IC0xLCAvLyBcdThERjNcdThGQzcgSFRNTCBcdThCRjdcdTZDNDJcclxuICAgICAgICAgIGNvb2tpZURvbWFpblJld3JpdGU6ICdsb2NhbGhvc3QnXHJcbiAgICAgICAgfSxcclxuICAgICAgICAnL3JlcXVlc3QtamF2YSc6IHtcclxuICAgICAgICAgIHRhcmdldDogYCR7cHJveHlVcmxEZWxpdmVyeX0vYXBpYCxcclxuICAgICAgICAgIGNoYW5nZU9yaWdpbjogdHJ1ZSxcclxuICAgICAgICAgIHBhdGhSZXdyaXRlOiB7ICdeL3JlcXVlc3QtamF2YSc6ICcnIH1cclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH0sXHJcbiAgICBjc3M6IHtcclxuICAgICAgcG9zdGNzczoge1xyXG4gICAgICAgIHBsdWdpbnM6IFtcclxuICAgICAgICAgIHBvc3RDc3NQeFRvUmVtKHtcclxuICAgICAgICAgICAgcm9vdFZhbHVlOiAzNy41LFxyXG4gICAgICAgICAgICBwcm9wTGlzdDogWycqJ11cclxuICAgICAgICAgIH0pXHJcbiAgICAgICAgXVxyXG4gICAgICB9LFxyXG4gICAgICBwcmVwcm9jZXNzb3JPcHRpb25zOiB7XHJcbiAgICAgICAgc2NzczogeyBhcGk6ICdtb2Rlcm4tY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