Browse Source

no message

master
xpz2018 8 months ago
parent
commit
8894dfb594
9 changed files with 123 additions and 123 deletions
  1. 4
      src/components/Icon/Icon.vue
  2. 2
      src/components/OssUpload/src/index.vue
  3. 6
      src/views/clue/components/modal.vue
  4. 42
      src/views/clue/customer/data.ts
  5. 6
      src/views/clue/customer/index.vue
  6. 39
      src/views/sys/workbench/components/GrowCard.vue
  7. 4
      src/views/sys/workbench/components/WorkbenchHeader.vue
  8. 132
      src/views/sys/workbench/data.ts
  9. 11
      src/views/sys/workbench/index.vue

4
src/components/Icon/Icon.vue

@ -18,8 +18,8 @@
import { ref, watch, onMounted, nextTick, unref, computed, CSSProperties } from 'vue'
import SvgIcon from './src/SvgIcon.vue'
import Iconify from '@purge-icons/generated'
import { isString } from '@/utils/is'
import { propTypes } from '@/utils/propTypes'
import { isString } from '/@/utils/is'
import { propTypes } from '/@/utils/propTypes'
const SVG_END_WITH_FLAG = '|svg'

2
src/components/OssUpload/src/index.vue

@ -255,7 +255,7 @@
const check = await handleRemove(item)
if (!check) return
const file: any = fileList.value.splice(index, 1)
emits('remove', file)
emits('remove', {file, index})
}
</script>

6
src/views/clue/components/modal.vue

@ -65,7 +65,7 @@
</TabPane>
<TabPane key="3" tab="线索影像">
<div style="padding: 16px;">
<OssUpload v-model="uploadList" :multiple="true" :if-custom-render="true" />
<OssUpload v-model="uploadList" @remove="onUploadRemove" :multiple="true" :if-custom-render="true" />
</div>
</TabPane>
</Tabs>
@ -199,6 +199,10 @@
}
}
function onUploadRemove({file, index}){
uploadList.value.splice(index, 1)
}
const { createMessage } = useMessage()
const emits = defineEmits(['success'])
async function handleOk() {

42
src/views/clue/customer/data.ts

@ -2,7 +2,7 @@ import { useAddressData } from '/@/hooks/common'
import { ref } from 'vue'
import dayjs, { Dayjs } from 'dayjs'
import { FormSchema } from '/@/components/Form'
import { genderList, followTypeList, followStageList, paymentList, marriageList, storeAppointmentStatus } from '/@/enums/customerEnum'
import { genderList, channelList, followStageList, paymentList, marriageList, storeAppointmentStatus } from '/@/enums/customerEnum'
import {
getIncomeList,
getNationList,
@ -62,6 +62,16 @@ export const basicSchema: FormSchema[] = [
}
},
},
{
field: 'channelType',
label: '渠道来源',
defaultValue: 1,
colProps: { span: 8 },
component: 'Select',
componentProps: {
options: channelList,
},
},
{ field: 'age', label: '年龄', component: 'InputNumber', colProps: { span: 8 }, },
{ field: 'height', label: '身高(cm)', component: 'InputNumber', colProps: { span: 8 }, },
{ field: 'weight', label: '体重(kg)', component: 'InputNumber', colProps: { span: 8 }, },
@ -137,21 +147,21 @@ export const basicSchema: FormSchema[] = [
},
},
},
{
field: 'domicilePlace',
label: '户口所在地',
component: 'Cascader',
colProps: { span: 8 },
componentProps: () => {
return {
options: domicilePlaceList.value,
onChange: (_: any, v: any) => {
basicInfoMoreData.value.domicilePlaceProvinceName = v?.[0]?.label
basicInfoMoreData.value.domicilePlaceCityName = v?.[1]?.label
},
}
},
},
// {
// field: 'domicilePlace',
// label: '户口所在地',
// component: 'Cascader',
// colProps: { span: 8 },
// componentProps: () => {
// return {
// options: domicilePlaceList.value,
// onChange: (_: any, v: any) => {
// basicInfoMoreData.value.domicilePlaceProvinceName = v?.[0]?.label
// basicInfoMoreData.value.domicilePlaceCityName = v?.[1]?.label
// },
// }
// },
// },
{
field: 'hometown',
label: '家乡',

6
src/views/clue/customer/index.vue

@ -147,7 +147,7 @@
</TabPane>
<TabPane key="3" tab="线索影像">
<div style="padding: 16px;">
<OssUpload v-model="uploadList" :multiple="true" :if-custom-render="true" />
<OssUpload v-model="uploadList" @remove="onUploadRemove" :multiple="true" :if-custom-render="true" />
</div>
</TabPane>
</Tabs>
@ -357,6 +357,10 @@
await editClueRecord({id: details.value.id, profilePhoto: value, phone: details.value.phone, weChatId: details.value.weChatId})
details.value.profilePhoto = value
}
function onUploadRemove({file, index}){
uploadList.value.splice(index, 1)
}
//
const [registerForm3, { getFieldsValue: getFieldsValue3, setFieldsValue: setFieldsValue3 }] =
useForm({

39
src/views/sys/workbench/components/GrowCard.vue

@ -0,0 +1,39 @@
<template>
<div class="md:flex">
<template v-for="(item, index) in growCardList" :key="item.title">
<Card
size="small"
:loading="loading"
:title="item.title"
class="md:w-1/4 w-full !md:mt-0"
:class="{ '!md:mr-4': index + 1 < 4, '!mt-4': index > 0 }"
>
<template #extra>
<Tag :color="item.color">{{ item.action }}</Tag>
</template>
<div class="py-4 px-4 flex justify-between items-center">
<CountTo prefix="$" :startVal="1" :endVal="item.value" class="text-2xl" />
<Icon :icon="item.icon" :size="40" />
</div>
<div class="p-2 px-4 flex justify-between">
<span>{{ item.title }}</span>
<CountTo prefix="$" :startVal="1" :endVal="item.total" />
</div>
</Card>
</template>
</div>
</template>
<script lang="ts" setup>
import { CountTo } from '/@/components/CountTo'
import Icon from '/@/components/Icon/Icon.vue'
import { Tag, Card } from 'ant-design-vue'
import { growCardList } from '../data'
defineProps({
loading: {
type: Boolean,
},
})
</script>

4
src/views/sys/workbench/components/WorkbenchHeader.vue

@ -1,5 +1,5 @@
<template>
<div class="lg:flex" style="background-color: white;padding: 16px;">
<div class="lg:flex" style="background-color: white;padding: 16px;">
<Avatar :src="userinfo.avatar || headerImg" :size="72" class="!mx-auto !block" />
<div class="md:ml-6 flex flex-col justify-center md:mt-0 mt-2">
<h1 class="md:text-lg text-md">早安, {{ userinfo.realName }}, 开始您一天的工作吧</h1>
@ -8,7 +8,7 @@
<div class="flex flex-1 justify-end md:mt-0 mt-4">
<Button type="link" @click="exportExcel"><template #icon><Icon icon="ant-design:edit-twotone" size="16px" style="margin-right: -4px;"/></template>下载线索导入模板</Button>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { computed } from 'vue';

132
src/views/sys/workbench/data.ts

@ -1,109 +1,43 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
export interface GrowCardItem {
icon: string;
title: string;
value: number;
total: number;
color: string;
action: string;
}
export const columns: BasicColumn[] = [
export const growCardList: GrowCardItem[] = [
{
title: '菜单名称',
dataIndex: 'name',
width: 300,
align: 'left',
title: '访问数',
icon: 'visit-count|svg',
value: 2000,
total: 120000,
color: 'green',
action: '月',
},
{
title: '权限标识',
dataIndex: 'permission',
width: 180,
title: '成交额',
icon: 'total-sales|svg',
value: 20000,
total: 500000,
color: 'blue',
action: '月',
},
{
title: '路由地址',
dataIndex: 'path',
title: '下载数',
icon: 'download-count|svg',
value: 8000,
total: 120000,
color: 'orange',
action: '周',
},
{
title: '组件',
dataIndex: 'component',
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 240,
title: '成交数',
icon: 'transaction|svg',
value: 5000,
total: 50000,
color: 'purple',
action: '年',
},
];
const isDir = (type: string) => type === '1';
const isMenu = (type: string) => type === '2';
const isButton = (type: number) => type === 3;
export const searchFormSchema: FormSchema[] = [
// {
// field: 'menuName',
// label: '菜单名称',
// component: 'Input',
// colProps: { span: 8 },
// },
{
field: 'status',
label: '状态',
component: 'Select',
componentProps: {
options: [
{ label: '启用', value: '0' },
{ label: '停用', value: '1' },
],
},
colProps: { span: 8 },
},
];
export const formSchema: FormSchema[] = [
{
field: 'type',
label: '菜单类型',
component: 'RadioButtonGroup',
defaultValue: 1,
componentProps: {
options: [
{ label: '目录', value: 1 },
{ label: '菜单', value: 2 },
// { label: '按钮', value: '3' },
],
},
colProps: { lg: 24, md: 24 },
},
{
field: 'name',
label: '菜单名称',
component: 'Input',
required: true,
},
{
field: 'parentId',
label: '上级菜单',
component: 'TreeSelect',
componentProps: {
replaceFields: {
title: 'name',
value: 'id',
key: 'id',
},
getPopupContainer: () => document.body,
},
},
{
field: 'path',
label: '路由地址',
component: 'Input',
required: true,
ifShow: ({ values }) => !isButton(values.type),
},
// {
// field: 'component',
// label: '组件路径',
// component: 'Input',
// ifShow: ({ values }) => isMenu(values.type),
// },
// {
// field: 'permission',
// label: '权限标识',
// component: 'Input',
// ifShow: ({ values }) => !isDir(values.type),
// },
];

11
src/views/sys/workbench/index.vue

@ -1,9 +1,18 @@
<template>
<div>
<WorkbenchHeader />
<!-- <div class="p-4">
<GrowCard :loading="loading" class="enter-y" />
</div> -->
</div>
</template>
<script lang="ts" setup>
import { nextTick } from 'vue';
import { nextTick, ref } from 'vue';
import WorkbenchHeader from './components/WorkbenchHeader.vue';
import GrowCard from './components/GrowCard.vue';
const loading = ref(true);
setTimeout(() => {
loading.value = false;
}, 1000);
</script>
Loading…
Cancel
Save