场景化优化
This commit is contained in:
@@ -9,7 +9,7 @@ import { jsonp } from "vue-jsonp";
|
|||||||
import { jsonpUrl } from "../config.js";
|
import { jsonpUrl } from "../config.js";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import Creative from "./route.creative"; // 创作中心路由
|
import Creative from "./route.creative"; // 创作中心路由
|
||||||
|
import MarketList from "@/views/TempMarket/components/TempMarketLayout"
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
|
|
||||||
const constantRoutes = [
|
const constantRoutes = [
|
||||||
@@ -45,7 +45,12 @@ const constantRoutes = [
|
|||||||
component: () => import(/* webpackChunkName: 'home' */ '@views/Home/Index.vue'),
|
component: () => import(/* webpackChunkName: 'home' */ '@views/Home/Index.vue'),
|
||||||
children: [...ProjectManage, ...TemplateMarket, ...Contact, ...DocumentLibrary, ...DataStatistics, ...Creative]
|
children: [...ProjectManage, ...TemplateMarket, ...Contact, ...DocumentLibrary, ...DataStatistics, ...Creative]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/market',
|
||||||
|
name: 'Market',
|
||||||
|
meta: { title: '模板库' },
|
||||||
|
component: MarketList,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/edit-creative-scene',
|
path: '/edit-creative-scene',
|
||||||
name: 'editCreativeScene',
|
name: 'editCreativeScene',
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
class="search-layout"
|
class="search-layout"
|
||||||
>
|
>
|
||||||
<div style="display: flex;">
|
<div style="display: flex;">
|
||||||
|
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
||||||
|
<a-input class="custom-input" placeholder="请输入问卷名称" v-model:value="ruleForm.project_name" />
|
||||||
|
</a-form-item>
|
||||||
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="ruleForm.scene_code_info"
|
v-model:value="ruleForm.scene_code_info"
|
||||||
@@ -27,7 +30,6 @@
|
|||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
||||||
<a-space>
|
|
||||||
<a-select
|
<a-select
|
||||||
mode="tags"
|
mode="tags"
|
||||||
v-model:value="ruleForm.tags"
|
v-model:value="ruleForm.tags"
|
||||||
@@ -52,42 +54,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
|
||||||
<a-space>
|
|
||||||
<a-select
|
|
||||||
mode="multiple"
|
|
||||||
v-model:value="ruleForm.template_tags"
|
|
||||||
placeholder="请选择模板标签"
|
|
||||||
:max-tag-count="1"
|
|
||||||
:filter-option="false"
|
|
||||||
:not-found-content="fetching ? undefined : null"
|
|
||||||
@search="fetchUser"
|
|
||||||
class="custom-select"
|
|
||||||
>
|
|
||||||
<a-select-option
|
|
||||||
:value="item.id"
|
|
||||||
:label="item.title"
|
|
||||||
v-for="item in templateTagsList"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<div style="display: flex; justify-content: space-between">
|
|
||||||
<span :style="countColor(item.color)" :title="item.title">{{
|
|
||||||
item.title
|
|
||||||
}}</span>
|
|
||||||
</div>
|
|
||||||
</a-select-option>
|
|
||||||
<!-- <a-select-option v-for="item in tagsList" :key="item.id">
|
|
||||||
{{ item.title }}
|
|
||||||
</a-select-option> -->
|
|
||||||
</a-select>
|
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
||||||
<a-space>
|
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="ruleForm.status"
|
v-model:value="ruleForm.status"
|
||||||
style="border-radius: 4px;"
|
style="border-radius: 4px;"
|
||||||
@@ -107,73 +77,97 @@
|
|||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
|
||||||
<a-space>
|
|
||||||
<a-select
|
|
||||||
mode="multiple"
|
|
||||||
label-in-value
|
|
||||||
:max-tag-count="1"
|
|
||||||
v-model:value="ruleForm.owner_id"
|
|
||||||
placeholder="请选择所有者"
|
|
||||||
:filter-option="false"
|
|
||||||
:not-found-content="fetching ? undefined : null"
|
|
||||||
@search="fetchUser"
|
|
||||||
class="custom-select"
|
|
||||||
>
|
|
||||||
<!-- <template v-if="fetching" #notFoundContent>-->
|
|
||||||
<!-- <a-spin size="small" />-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<a-select-option v-for="item in userList" :key="item.id">
|
|
||||||
{{ item.nickname }}
|
|
||||||
</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<a-form-item style="width: 220px;margin-right: 16px;">
|
<a-form-item style="width: 220px;margin-right: 16px;">
|
||||||
<a-space>
|
|
||||||
<a-range-picker
|
<a-range-picker
|
||||||
v-model:value="ruleForm.created_at"
|
v-model:value="ruleForm.created_at"
|
||||||
:placeholder="['创建开始日期', '结束日期']"
|
:placeholder="['创建开始日期', '结束日期']"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
class="custom-date-picker"/>
|
class="custom-date-picker"/>
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div style="display: flex">-->
|
||||||
|
<!-- <a-form-item style="min-width: 150px;margin-right: 16px;">-->
|
||||||
|
<!-- <a-select-->
|
||||||
|
<!-- mode="multiple"-->
|
||||||
|
<!-- v-model:value="ruleForm.template_tags"-->
|
||||||
|
<!-- placeholder="请选择模板标签"-->
|
||||||
|
<!-- :max-tag-count="1"-->
|
||||||
|
<!-- :filter-option="false"-->
|
||||||
|
<!-- :not-found-content="fetching ? undefined : null"-->
|
||||||
|
<!-- @search="fetchUser"-->
|
||||||
|
<!-- class="custom-select"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a-select-option-->
|
||||||
|
<!-- :value="item.id"-->
|
||||||
|
<!-- :label="item.title"-->
|
||||||
|
<!-- v-for="item in templateTagsList"-->
|
||||||
|
<!-- :key="item.id"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <div style="display: flex; justify-content: space-between">-->
|
||||||
|
<!-- <span :style="countColor(item.color)" :title="item.title">{{-->
|
||||||
|
<!-- item.title-->
|
||||||
|
<!-- }}</span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </a-select-option>-->
|
||||||
|
<!-- <!– <a-select-option v-for="item in tagsList" :key="item.id">-->
|
||||||
|
<!-- {{ item.title }}-->
|
||||||
|
<!-- </a-select-option> –>-->
|
||||||
|
<!-- </a-select>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <div style="display: flex">-->
|
||||||
|
<!-- <a-form-item style="min-width: 150px;margin-right: 16px;">-->
|
||||||
|
<!-- <a-select-->
|
||||||
|
<!-- mode="multiple"-->
|
||||||
|
<!-- label-in-value-->
|
||||||
|
<!-- :max-tag-count="1"-->
|
||||||
|
<!-- v-model:value="ruleForm.owner_id"-->
|
||||||
|
<!-- placeholder="请选择所有者"-->
|
||||||
|
<!-- :filter-option="false"-->
|
||||||
|
<!-- :not-found-content="fetching ? undefined : null"-->
|
||||||
|
<!-- @search="fetchUser"-->
|
||||||
|
<!-- class="custom-select"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <!– <template v-if="fetching" #notFoundContent>–>-->
|
||||||
|
<!-- <!– <a-spin size="small" />–>-->
|
||||||
|
<!-- <!– </template>–>-->
|
||||||
|
<!-- <a-select-option v-for="item in userList" :key="item.id">-->
|
||||||
|
<!-- {{ item.nickname }}-->
|
||||||
|
<!-- </a-select-option>-->
|
||||||
|
<!-- </a-select>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <div style="display: flex">-->
|
||||||
|
<!-- <a-form-item style="width: 220px;margin-right: 16px;">-->
|
||||||
|
<!-- <a-range-picker-->
|
||||||
|
<!-- v-model:value="ruleForm.updated_at"-->
|
||||||
|
<!-- @change="handleUpdated"-->
|
||||||
|
<!-- :placeholder="['编辑开始日期', '结束日期']"-->
|
||||||
|
<!-- class="custom-date-picker"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </div>-->
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<a-form-item style="width: 220px;margin-right: 16px;">
|
|
||||||
<a-space>
|
|
||||||
<a-range-picker
|
|
||||||
v-model:value="ruleForm.updated_at"
|
|
||||||
@change="handleUpdated"
|
|
||||||
:placeholder="['编辑开始日期', '结束日期']"
|
|
||||||
class="custom-date-picker"
|
|
||||||
/>
|
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
|
||||||
</div>
|
|
||||||
<div style="display: flex">
|
|
||||||
<a-form-item style="min-width: 150px;margin-right: 16px;">
|
|
||||||
<a-space>
|
|
||||||
<a-input class="custom-input" placeholder="请输入问卷名称" v-model:value="ruleForm.project_name" />
|
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item class="button">
|
<a-form-item class="button">
|
||||||
<a-button style="margin-right: 16px;" ghost type="primary" @click="onSubmit">查询</a-button>
|
<a-button style="margin-right: 16px;" ghost type="primary" @click="onSubmit">查询</a-button>
|
||||||
<a-button ghost type="primary" @click="cancel">重置</a-button>
|
<a-button style="margin-right: 16px;" ghost type="primary" @click="cancel">重置</a-button>
|
||||||
|
<a-button ghost type="primary" @click="filter">更多筛选</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</a-form>
|
</a-form>
|
||||||
|
<a-modal v-model:visible="visible" title="筛选" :footer="null">
|
||||||
|
<ScreenBox :info="ruleForm" @cancel="visible = false" @update="update" />
|
||||||
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { defineComponent, ref, onBeforeMount } from 'vue';
|
import { defineComponent, ref, onBeforeMount } from 'vue';
|
||||||
import { debounce } from 'lodash-es';
|
import { debounce } from 'lodash-es';
|
||||||
import {getUserList, getTagsList, getSceneList} from '../api';
|
import {getUserList, getTagsList, getSceneList} from '../api';
|
||||||
import {message} from "ant-design-vue";
|
import {message} from "ant-design-vue";
|
||||||
|
import ScreenBox from "./ScreenBox";
|
||||||
|
|
||||||
const statusOptions = [
|
const statusOptions = [
|
||||||
{ label: '编辑中', value: 0 },
|
{ label: '编辑中', value: 0 },
|
||||||
@@ -187,7 +181,12 @@ export default defineComponent({
|
|||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
ScreenBox,
|
||||||
|
// SearchOutlined
|
||||||
|
},
|
||||||
setup(props, context) {
|
setup(props, context) {
|
||||||
|
const visible = ref();
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const ruleForm = ref({
|
const ruleForm = ref({
|
||||||
owner_id: undefined,
|
owner_id: undefined,
|
||||||
@@ -222,26 +221,26 @@ export default defineComponent({
|
|||||||
/** 搜索用户防抖 */
|
/** 搜索用户防抖 */
|
||||||
const fetchUser = debounce(value => {
|
const fetchUser = debounce(value => {
|
||||||
lastFetchId += 1;
|
lastFetchId += 1;
|
||||||
userList.value = [];
|
// userList.value = [];
|
||||||
fetching.value = true;
|
fetching.value = true;
|
||||||
tagsList.value = [];
|
tagsList.value = [];
|
||||||
getUsers(value);
|
// getUsers(value);
|
||||||
}, 500);
|
}, 500);
|
||||||
/** 获取用户列表 */
|
/** 获取用户列表 */
|
||||||
const getUsers = async (val)=> {
|
// const getUsers = async (val)=> {
|
||||||
try {
|
// try {
|
||||||
const { data } = await getUserList({nickname: val || ''});
|
// const { data } = await getUserList({nickname: val || ''});
|
||||||
const fetchId = lastFetchId;
|
// const fetchId = lastFetchId;
|
||||||
if (fetchId !== lastFetchId) {
|
// if (fetchId !== lastFetchId) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
userList.value = data;
|
// userList.value = data;
|
||||||
} catch(error) {
|
// } catch(error) {
|
||||||
context.message.error(
|
// context.message.error(
|
||||||
error.data?.message || error.message || "服务器错误"
|
// error.data?.message || error.message || "服务器错误"
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// 标签颜色
|
// 标签颜色
|
||||||
const countColor = (value) => {
|
const countColor = (value) => {
|
||||||
let style = {}
|
let style = {}
|
||||||
@@ -361,23 +360,23 @@ export default defineComponent({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 获取项目标签列表 */
|
// /** 获取项目标签列表 */
|
||||||
const getTemplateTagList = async () => {
|
// const getTemplateTagList = async () => {
|
||||||
try {
|
// try {
|
||||||
const { data } = await getTagsList({
|
// const { data } = await getTagsList({
|
||||||
type: 2
|
// type: 2
|
||||||
});
|
// });
|
||||||
const fetchId = lastFetchId;
|
// const fetchId = lastFetchId;
|
||||||
if (fetchId !== lastFetchId) {
|
// if (fetchId !== lastFetchId) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
templateTagsList.value = data;
|
// templateTagsList.value = data;
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
context.message.error(
|
// context.message.error(
|
||||||
error.data?.message || error.message || "服务器错误"
|
// error.data?.message || error.message || "服务器错误"
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
const getScenes = async () => {
|
const getScenes = async () => {
|
||||||
const data = await getSceneList();
|
const data = await getSceneList();
|
||||||
if (data?.code) {
|
if (data?.code) {
|
||||||
@@ -439,11 +438,21 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
context.emit('update', ruleForm.value);
|
context.emit('update', ruleForm.value);
|
||||||
};
|
};
|
||||||
|
const filter = () => {
|
||||||
|
visible.value = true;
|
||||||
|
}
|
||||||
|
function update(val) {
|
||||||
|
ruleForm.value = val;
|
||||||
|
console.log(12233,ruleForm.value);
|
||||||
|
// context.emit("update", ruleForm.value);
|
||||||
|
visible.value = false;
|
||||||
|
onSubmit();
|
||||||
|
}
|
||||||
onBeforeMount(()=> {
|
onBeforeMount(()=> {
|
||||||
getUsers();
|
// getUsers();
|
||||||
getTagList();
|
getTagList();
|
||||||
getScenes();
|
getScenes();
|
||||||
getTemplateTagList();
|
// getTemplateTagList();
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
formRef,
|
formRef,
|
||||||
@@ -460,6 +469,9 @@ export default defineComponent({
|
|||||||
scenesList,
|
scenesList,
|
||||||
statusOptions,
|
statusOptions,
|
||||||
templateTagsList,
|
templateTagsList,
|
||||||
|
filter,
|
||||||
|
visible,
|
||||||
|
update,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const emit = defineEmits(['create']);
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 1px #DFDFDF solid;
|
border: 1px #DFDFDF solid;
|
||||||
height: 246px;
|
height: 265px;
|
||||||
img{
|
img{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 132px;
|
height: 132px;
|
||||||
|
|||||||
@@ -5,47 +5,47 @@
|
|||||||
:label-col="labelCol"
|
:label-col="labelCol"
|
||||||
:wrapper-col="wrapperCol"
|
:wrapper-col="wrapperCol"
|
||||||
>
|
>
|
||||||
<a-form-item label="状态">
|
<!-- <a-form-item label="状态">-->
|
||||||
<a-checkbox-group
|
<!-- <a-checkbox-group-->
|
||||||
v-model:value="ruleForm.status"
|
<!-- v-model:value="ruleForm.status"-->
|
||||||
:options="statusOptions"
|
<!-- :options="statusOptions"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</a-form-item>
|
<!-- </a-form-item>-->
|
||||||
<a-form-item label="问卷标签">
|
<!-- <a-form-item label="问卷标签">-->
|
||||||
<a-select
|
<!-- <a-select-->
|
||||||
mode="multiple"
|
<!-- mode="multiple"-->
|
||||||
v-model:value="ruleForm.tags"
|
<!-- v-model:value="ruleForm.tags"-->
|
||||||
placeholder="选择问卷标签"
|
<!-- placeholder="选择问卷标签"-->
|
||||||
:filter-option="false"
|
<!-- :filter-option="false"-->
|
||||||
:not-found-content="fetching ? undefined : null"
|
<!-- :not-found-content="fetching ? undefined : null"-->
|
||||||
@search="fetchUser"
|
<!-- @search="fetchUser"-->
|
||||||
class="custom-select"
|
<!-- class="custom-select"-->
|
||||||
>
|
<!-- >-->
|
||||||
<!-- <template v-if="fetching" #notFoundContent>
|
<!-- <!– <template v-if="fetching" #notFoundContent>-->
|
||||||
<a-spin size="small" />
|
<!-- <a-spin size="small" />-->
|
||||||
</template> -->
|
<!-- </template> –>-->
|
||||||
<a-select-option
|
<!-- <a-select-option-->
|
||||||
:value="item.id"
|
<!-- :value="item.id"-->
|
||||||
:label="item.title"
|
<!-- :label="item.title"-->
|
||||||
v-for="item in tagsList"
|
<!-- v-for="item in tagsList"-->
|
||||||
:key="item.id"
|
<!-- :key="item.id"-->
|
||||||
>
|
<!-- >-->
|
||||||
<div style="display: flex; justify-content: space-between">
|
<!-- <div style="display: flex; justify-content: space-between">-->
|
||||||
<span :style="countColor(item.color)" :title="item.title">{{
|
<!-- <span :style="countColor(item.color)" :title="item.title">{{-->
|
||||||
item.title
|
<!-- item.title-->
|
||||||
}}</span>
|
<!-- }}</span>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</a-select-option>
|
<!-- </a-select-option>-->
|
||||||
<!-- <a-select-option v-for="item in tagsList" :key="item.id">
|
<!-- <!– <a-select-option v-for="item in tagsList" :key="item.id">-->
|
||||||
{{ item.title }}
|
<!-- {{ item.title }}-->
|
||||||
</a-select-option> -->
|
<!-- </a-select-option> –>-->
|
||||||
</a-select>
|
<!-- </a-select>-->
|
||||||
</a-form-item>
|
<!-- </a-form-item>-->
|
||||||
<a-form-item label="模板标签">
|
<a-form-item label="模板标签">
|
||||||
<a-select
|
<a-select
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
v-model:value="ruleForm.templateTags"
|
v-model:value="ruleForm.template_tags"
|
||||||
placeholder="选择问卷标签"
|
placeholder="选择模板标签"
|
||||||
:filter-option="false"
|
:filter-option="false"
|
||||||
:not-found-content="fetching ? undefined : null"
|
:not-found-content="fetching ? undefined : null"
|
||||||
@search="fetchUser"
|
@search="fetchUser"
|
||||||
@@ -87,13 +87,13 @@
|
|||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="创建时间">
|
<!-- <a-form-item label="创建时间">-->
|
||||||
<a-range-picker
|
<!-- <a-range-picker-->
|
||||||
v-model:value="ruleForm.created_at"
|
<!-- v-model:value="ruleForm.created_at"-->
|
||||||
@change="handleCreated"
|
<!-- @change="handleCreated"-->
|
||||||
class="custom-date-picker"
|
<!-- class="custom-date-picker"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</a-form-item>
|
<!-- </a-form-item>-->
|
||||||
<a-form-item label="编辑时间">
|
<a-form-item label="编辑时间">
|
||||||
<a-range-picker
|
<a-range-picker
|
||||||
v-model:value="ruleForm.updated_at"
|
v-model:value="ruleForm.updated_at"
|
||||||
@@ -113,15 +113,15 @@
|
|||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { defineComponent, reactive, ref, onBeforeMount } from "vue";
|
import { defineComponent, reactive, ref, onBeforeMount, watch } from "vue";
|
||||||
import { debounce } from "lodash-es";
|
import { debounce } from "lodash-es";
|
||||||
import { getUserList, getTagsList } from "../api";
|
import { getUserList, getTagsList } from "../api";
|
||||||
|
|
||||||
const statusOptions = [
|
// const statusOptions = [
|
||||||
{ label: "编辑中", value: 0 },
|
// { label: "编辑中", value: 0 },
|
||||||
{ label: "收集中", value: 1 },
|
// { label: "收集中", value: 1 },
|
||||||
{ label: "已结束", value: 2 },
|
// { label: "已结束", value: 2 },
|
||||||
];
|
// ];
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
info: {
|
info: {
|
||||||
@@ -129,34 +129,30 @@ export default defineComponent({
|
|||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(props, context) {
|
setup(props, context) {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const ruleForm = reactive({
|
const ruleForm = ref(props.info);
|
||||||
status: [0],
|
// ruleForm.value = props.info;
|
||||||
owner_id: undefined,
|
|
||||||
created_at: "",
|
|
||||||
updated_at: "",
|
|
||||||
tags: [],
|
|
||||||
templateTags: [],
|
|
||||||
});
|
|
||||||
let lastFetchId = 0;
|
let lastFetchId = 0;
|
||||||
const fetching = ref(false);
|
const fetching = ref(false);
|
||||||
const userList = ref([]);
|
const userList = ref([]);
|
||||||
const tagsList = ref([]);
|
// const tagsList = ref([]);
|
||||||
const templateTagsList = ref([]);
|
const templateTagsList = ref([]);
|
||||||
const handleCreated = (value, dateString) => {
|
// const handleCreated = (value, dateString) => {
|
||||||
console.log("dateString", dateString);
|
// console.log("dateString", dateString);
|
||||||
ruleForm.created_at = dateString;
|
// ruleForm.created_at = dateString;
|
||||||
};
|
// };
|
||||||
const handleUpdated = (value, dateString) => {
|
const handleUpdated = (value, dateString) => {
|
||||||
ruleForm.updated_at = dateString;
|
ruleForm.value.updated_at = dateString;
|
||||||
};
|
};
|
||||||
/** 搜索用户防抖 */
|
/** 搜索用户防抖 */
|
||||||
const fetchUser = debounce((value) => {
|
const fetchUser = debounce((value) => {
|
||||||
lastFetchId += 1;
|
lastFetchId += 1;
|
||||||
userList.value = [];
|
userList.value = [];
|
||||||
fetching.value = true;
|
fetching.value = true;
|
||||||
tagsList.value = [];
|
templateTagsList.value = [];
|
||||||
|
// tagsList.value = [];
|
||||||
getUsers(value);
|
getUsers(value);
|
||||||
}, 500);
|
}, 500);
|
||||||
/** 获取用户列表 */
|
/** 获取用户列表 */
|
||||||
@@ -175,21 +171,21 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
/** 获取项目标签列表 */
|
/** 获取项目标签列表 */
|
||||||
const getTagList = async () => {
|
// const getTagList = async () => {
|
||||||
try {
|
// try {
|
||||||
const { data } = await getTagsList();
|
// const { data } = await getTagsList();
|
||||||
console.log(data);
|
// console.log(data);
|
||||||
const fetchId = lastFetchId;
|
// const fetchId = lastFetchId;
|
||||||
if (fetchId !== lastFetchId) {
|
// if (fetchId !== lastFetchId) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
tagsList.value = data;
|
// tagsList.value = data;
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
context.message.error(
|
// context.message.error(
|
||||||
error.data?.message || error.message || "服务器错误"
|
// error.data?.message || error.message || "服务器错误"
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
/** 获取项目标签列表 */
|
/** 获取项目标签列表 */
|
||||||
const getTemplateTagList = async () => {
|
const getTemplateTagList = async () => {
|
||||||
try {
|
try {
|
||||||
@@ -317,24 +313,7 @@ export default defineComponent({
|
|||||||
formRef.value
|
formRef.value
|
||||||
.validate()
|
.validate()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const params = {
|
context.emit("update", ruleForm.value);
|
||||||
owner_id: ruleForm.owner_id
|
|
||||||
? ruleForm.owner_id.map((e) => e.key).join(",")
|
|
||||||
: "",
|
|
||||||
status: ruleForm.status ? ruleForm.status.join(",") : "",
|
|
||||||
created_at: ruleForm.created_at
|
|
||||||
? ruleForm.created_at.join(",")
|
|
||||||
: "",
|
|
||||||
updated_at: ruleForm.updated_at
|
|
||||||
? ruleForm.updated_at.join(",")
|
|
||||||
: "",
|
|
||||||
tags: ruleForm.tags ? ruleForm.tags.join(",") : "",
|
|
||||||
templates_tags: ruleForm.templateTags
|
|
||||||
? ruleForm.templateTags.join(",")
|
|
||||||
: "",
|
|
||||||
};
|
|
||||||
console.log("values", params);
|
|
||||||
context.emit("update", params);
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log("error", error);
|
console.log("error", error);
|
||||||
@@ -342,22 +321,25 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
getUsers();
|
getUsers();
|
||||||
getTagList();
|
// getTagList();
|
||||||
getTemplateTagList();
|
getTemplateTagList();
|
||||||
});
|
});
|
||||||
|
watch(() => props.info, (val) => {
|
||||||
|
ruleForm.value = val;
|
||||||
|
},{immediate:true})
|
||||||
return {
|
return {
|
||||||
formRef,
|
formRef,
|
||||||
ruleForm,
|
ruleForm,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
fetchUser,
|
fetchUser,
|
||||||
handleCreated,
|
// handleCreated,
|
||||||
handleUpdated,
|
handleUpdated,
|
||||||
statusOptions,
|
// statusOptions,
|
||||||
labelCol: { style: { width: "150px" } },
|
labelCol: { style: { width: "150px" } },
|
||||||
wrapperCol: { span: 14 },
|
wrapperCol: { span: 14 },
|
||||||
userList,
|
userList,
|
||||||
fetching,
|
fetching,
|
||||||
tagsList,
|
// tagsList,
|
||||||
templateTagsList,
|
templateTagsList,
|
||||||
countColor,
|
countColor,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -60,13 +60,13 @@
|
|||||||
:key="child.code"
|
:key="child.code"
|
||||||
:cardWidth="cardWidth"
|
:cardWidth="cardWidth"
|
||||||
@create="createProfessionalSurvey"/>
|
@create="createProfessionalSurvey"/>
|
||||||
<div :style="`width:${cardWidth}px;height:246px;content:''`"
|
<div :style="`width:${cardWidth}px;height:260px;content:''`"
|
||||||
v-if="cardCount-item.children.slice(0 + cardCount * professionalCurrentPage,cardCount + cardCount * professionalCurrentPage).length > 0" />
|
v-if="cardCount-item.children.slice(0 + cardCount * professionalCurrentPage,cardCount + cardCount * professionalCurrentPage).length > 0" />
|
||||||
<div :style="`width:${cardWidth}px;height:246px;content:''`"
|
<div :style="`width:${cardWidth}px;height:260px;content:''`"
|
||||||
v-if="cardCount-item.children.slice(0 + cardCount * professionalCurrentPage,cardCount + cardCount * professionalCurrentPage).length > 1" />
|
v-if="cardCount-item.children.slice(0 + cardCount * professionalCurrentPage,cardCount + cardCount * professionalCurrentPage).length > 1" />
|
||||||
<div :style="`width:${cardWidth}px;height:246px;content:''`"
|
<div :style="`width:${cardWidth}px;height:260px;content:''`"
|
||||||
v-if="cardCount-item.children.slice(0 + cardCount * professionalCurrentPage,cardCount + cardCount * professionalCurrentPage).length > 2" />
|
v-if="cardCount-item.children.slice(0 + cardCount * professionalCurrentPage,cardCount + cardCount * professionalCurrentPage).length > 2" />
|
||||||
<div :style="`width:${cardWidth}px;height:246px;content:''`"
|
<div :style="`width:${cardWidth}px;height:260px;content:''`"
|
||||||
v-if="cardCount-item.children.slice(0 + cardCount * professionalCurrentPage,cardCount + cardCount * professionalCurrentPage).length > 3" />
|
v-if="cardCount-item.children.slice(0 + cardCount * professionalCurrentPage,cardCount + cardCount * professionalCurrentPage).length > 3" />
|
||||||
|
|
||||||
<div v-if="professionalCurrentPage > 0" class="back-button" @click="professionalPrev">
|
<div v-if="professionalCurrentPage > 0" class="back-button" @click="professionalPrev">
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<TempMarketModal v-model:visible="tempVisible"></TempMarketModal>
|
<!-- <TempMarketModal v-model:visible="tempVisible"></TempMarketModal>-->
|
||||||
<a-modal
|
<a-modal
|
||||||
v-model:visible="visible"
|
v-model:visible="visible"
|
||||||
:title="groupInfo.sn ? '重命名问卷' : '新建问卷'"
|
:title="groupInfo.sn ? '重命名问卷' : '新建问卷'"
|
||||||
@@ -270,24 +270,26 @@ function normalizeScenes(list) {
|
|||||||
if (!parent.children) {
|
if (!parent.children) {
|
||||||
parent.children = [];
|
parent.children = [];
|
||||||
}
|
}
|
||||||
if(item.title === '报名'){
|
if(item.title !== '其他场景'){
|
||||||
item.color = '#68AF47';
|
if(item.title === '报名'){
|
||||||
}else if(item.title === '签到'){
|
item.color = '#68AF47';
|
||||||
item.color = '#68AF47';
|
}else if(item.title === '签到'){
|
||||||
}else if(item.title === '投票'){
|
item.color = '#68AF47';
|
||||||
item.color = '#73C0DE';
|
}else if(item.title === '投票'){
|
||||||
}else if(item.title === '打分评估'){
|
item.color = '#73C0DE';
|
||||||
item.color = '#F47A26';
|
}else if(item.title === '打分评估'){
|
||||||
}else if(item.title === '考试测评'){
|
item.color = '#F47A26';
|
||||||
item.color = '#1C6FFF';
|
}else if(item.title === '考试测评'){
|
||||||
}else if(item.title === '满意度'){
|
item.color = '#1C6FFF';
|
||||||
item.color = '#EE6666';
|
}else if(item.title === '满意度'){
|
||||||
}else if(item.title === 'NPS'){
|
item.color = '#EE6666';
|
||||||
item.color = '#68AF47';
|
}else if(item.title === 'NPS'){
|
||||||
}else{
|
item.color = '#68AF47';
|
||||||
item.color = '';
|
}else{
|
||||||
|
item.color = '';
|
||||||
|
}
|
||||||
|
parent.children.push(item);
|
||||||
}
|
}
|
||||||
parent.children.push(item);
|
|
||||||
list.splice(index, 1);
|
list.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,7 +328,10 @@ function createCustom(item) {
|
|||||||
|
|
||||||
function moreTemplate(){
|
function moreTemplate(){
|
||||||
console.log('模板中心');
|
console.log('模板中心');
|
||||||
tempVisible.value = true;
|
// tempVisible.value = true;
|
||||||
|
router.push({
|
||||||
|
path: '/market',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createNormalSurvey(item){
|
function createNormalSurvey(item){
|
||||||
@@ -613,16 +618,16 @@ function professionalPrev(){
|
|||||||
margin: 0 auto 12px;
|
margin: 0 auto 12px;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #70B936;
|
color: #68AF47;
|
||||||
}
|
}
|
||||||
|
|
||||||
.desc {
|
.desc {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
font-size: 12px;
|
font-size: 13px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #262626;
|
color: #000000;
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -309,14 +309,14 @@ const columns = [
|
|||||||
slots: {
|
slots: {
|
||||||
customRender: "tag",
|
customRender: "tag",
|
||||||
},
|
},
|
||||||
width: 200,
|
width: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "问卷状态",
|
title: "问卷状态",
|
||||||
key: "status",
|
key: "status",
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
// align: "center",
|
// align: "center",
|
||||||
width: 100,
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
slots: {
|
slots: {
|
||||||
customRender: "status",
|
customRender: "status",
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ const list = ref([
|
|||||||
])
|
])
|
||||||
const activeKey = ref(1);
|
const activeKey = ref(1);
|
||||||
function back() {
|
function back() {
|
||||||
emits('back');
|
router.back();
|
||||||
|
// emits('back');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ async function getScenes() {
|
|||||||
list.value = [];
|
list.value = [];
|
||||||
data?.data.forEach(item => {
|
data?.data.forEach(item => {
|
||||||
if(item.parentCode > 0){
|
if(item.parentCode > 0){
|
||||||
|
if(item.parentCode === 1 && item.title === '其他场景'){
|
||||||
|
item.title = '日常-其他场景';
|
||||||
|
}
|
||||||
|
if(item.parentCode === 2 && item.title === '其他场景'){
|
||||||
|
item.title = '专业-其他场景';
|
||||||
|
}
|
||||||
list.value.push(item);
|
list.value.push(item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ const columns = [
|
|||||||
key: "quote_nums",
|
key: "quote_nums",
|
||||||
dataIndex: "quote_nums",
|
dataIndex: "quote_nums",
|
||||||
// align: "center",
|
// align: "center",
|
||||||
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "模板标签",
|
title: "模板标签",
|
||||||
@@ -502,10 +503,11 @@ export default defineComponent({
|
|||||||
const ProjectGroupList = ref([]);
|
const ProjectGroupList = ref([]);
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
page.value = props.pageIndex ? props.pageIndex : 1;
|
page.value = props.pageIndex ? props.pageIndex : 1;
|
||||||
const { data } = await getSurveySorts(1);
|
// const { data } = await getSurveySorts(1);
|
||||||
if (data) {
|
// if (data) {
|
||||||
search.value.sort = data.sort || "";
|
// search.value.sort = data.sort || "";
|
||||||
}
|
// }
|
||||||
|
search.value.sort = 'quote_nums,desc';
|
||||||
getTemplates();
|
getTemplates();
|
||||||
getGroupData();
|
getGroupData();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user