Commit f16e723bc75b73dccad544f505d8772552fd9006
Merge branch 'sqy_dev' into 'main'
'fix:将分析页代码与工作台互换' See merge request huang/yun-teng-iot-front!16
Showing
20 changed files
with
211 additions
and
91 deletions
src/views/dashboard/analysis/components/DynamicInfo.vue
renamed from
src/views/dashboard/workbench/components/DynamicInfo.vue
src/views/dashboard/analysis/components/ProjectCard.vue
renamed from
src/views/dashboard/workbench/components/ProjectCard.vue
src/views/dashboard/analysis/components/QuickNav.vue
renamed from
src/views/dashboard/workbench/components/QuickNav.vue
src/views/dashboard/analysis/components/SaleRadar.vue
renamed from
src/views/dashboard/workbench/components/SaleRadar.vue
src/views/dashboard/analysis/components/WorkbenchHeader.vue
renamed from
src/views/dashboard/workbench/components/WorkbenchHeader.vue
src/views/dashboard/analysis/components/data.ts
renamed from
src/views/dashboard/workbench/components/data.ts
| 1 | 1 | <template> |
| 2 | - <div class="p-4 md:flex"> | |
| 3 | - <div class="md:w-7/10 w-full !mr-4 enter-y"> | |
| 4 | - <GrowCard :loading="loading" class="enter-y" /> | |
| 5 | - <SiteAnalysis class="!my-4 enter-y" :loading="loading" /> | |
| 6 | - <div class="md:flex enter-y"> | |
| 7 | - <Card title="核心流程指南" style="width: 100%"> | |
| 8 | - <img alt="核心流程指南" src="../../../assets/images/flow.png" /> | |
| 2 | + <PageWrapper> | |
| 3 | + <template #headerContent> <WorkbenchHeader /> </template> | |
| 4 | + <div class="lg:flex"> | |
| 5 | + <div class="lg:w-7/10 w-full !mr-4 enter-y"> | |
| 6 | + <ProjectCard :loading="loading" class="enter-y" /> | |
| 7 | + <DynamicInfo :loading="loading" class="!my-4 enter-y" /> | |
| 8 | + </div> | |
| 9 | + <div class="lg:w-3/10 w-full enter-y"> | |
| 10 | + <QuickNav :loading="loading" class="enter-y" /> | |
| 11 | + | |
| 12 | + <Card class="!my-4 enter-y" :loading="loading"> | |
| 13 | + <img class="xl:h-50 h-30 mx-auto" src="../../../assets/svg/illustration.svg" /> | |
| 9 | 14 | </Card> |
| 15 | + | |
| 16 | + <SaleRadar :loading="loading" class="enter-y" /> | |
| 10 | 17 | </div> |
| 11 | 18 | </div> |
| 12 | - <div class="md:w-3/10 w-full enter-y"> | |
| 13 | - <HelpDoc /> | |
| 14 | - </div> | |
| 15 | - </div> | |
| 19 | + <BasicModal | |
| 20 | + @register="register" | |
| 21 | + v-bind="$attrs" | |
| 22 | + :mask="true" | |
| 23 | + :showCancelBtn="false" | |
| 24 | + :showOkBtn="false" | |
| 25 | + :canFullscreen="false" | |
| 26 | + :closable="false" | |
| 27 | + :maskStyle="maskColor" | |
| 28 | + :height="600" | |
| 29 | + :width="1500" | |
| 30 | + :maskClosable="false" | |
| 31 | + title="请修改密码" | |
| 32 | + :helpMessage="['请您修改密码']" | |
| 33 | + > | |
| 34 | + <PasswordDialog /> | |
| 35 | + </BasicModal> | |
| 36 | + </PageWrapper> | |
| 16 | 37 | </template> |
| 17 | 38 | <script lang="ts" setup> |
| 18 | - import { ref } from 'vue'; | |
| 19 | - import GrowCard from './components/GrowCard.vue'; | |
| 20 | - import SiteAnalysis from './components/SiteAnalysis.vue'; | |
| 39 | + import PasswordDialog from '/@/views/system/password/index.vue'; | |
| 40 | + import { BasicModal, useModal } from '/@/components/Modal'; | |
| 41 | + import { getAuthCache } from '/@/utils/auth'; | |
| 42 | + import { USER_INFO_KEY } from '/@/enums/cacheEnum'; | |
| 43 | + import { ref, onMounted } from 'vue'; | |
| 21 | 44 | import { Card } from 'ant-design-vue'; |
| 22 | - import HelpDoc from './components/HelpDoc.vue'; | |
| 23 | - const loading = ref(true); | |
| 45 | + import { PageWrapper } from '/@/components/Page'; | |
| 46 | + import WorkbenchHeader from './components/WorkbenchHeader.vue'; | |
| 47 | + import ProjectCard from './components/ProjectCard.vue'; | |
| 48 | + import QuickNav from './components/QuickNav.vue'; | |
| 49 | + import DynamicInfo from './components/DynamicInfo.vue'; | |
| 50 | + import SaleRadar from './components/SaleRadar.vue'; | |
| 51 | + | |
| 52 | + const maskColor = ref({ backgroundColor: 'grey' }); | |
| 53 | + const statusModel = ref(false); | |
| 54 | + const [register, { openModal }] = useModal(); | |
| 55 | + onMounted(() => { | |
| 56 | + const userInfo: object = getAuthCache(USER_INFO_KEY); | |
| 57 | + if (userInfo.needSetPwd == true) { | |
| 58 | + statusModel.value = true; | |
| 59 | + openModal(statusModel.value); | |
| 60 | + } else if (userInfo.needSetPwd == false) { | |
| 61 | + openModal(statusModel.value); | |
| 62 | + } | |
| 63 | + }); | |
| 64 | + //Yunteng123456!!! | |
| 65 | + //Password123456! | |
| 66 | + //System123456! | |
| 67 | + //Testrole123456! | |
| 68 | + const loading = ref(false); | |
| 24 | 69 | setTimeout(() => { |
| 25 | 70 | loading.value = false; |
| 26 | 71 | }, 1500); | ... | ... |
src/views/dashboard/workbench/components/GrowCard.vue
renamed from
src/views/dashboard/analysis/components/GrowCard.vue
src/views/dashboard/workbench/components/HelpDoc.vue
renamed from
src/views/dashboard/analysis/components/HelpDoc.vue
src/views/dashboard/workbench/components/SiteAnalysis.vue
renamed from
src/views/dashboard/analysis/components/SiteAnalysis.vue
src/views/dashboard/workbench/components/VisitAnalysis.vue
renamed from
src/views/dashboard/analysis/components/VisitAnalysis.vue
src/views/dashboard/workbench/components/VisitAnalysisBar.vue
renamed from
src/views/dashboard/analysis/components/VisitAnalysisBar.vue
src/views/dashboard/workbench/components/props.ts
renamed from
src/views/dashboard/analysis/components/props.ts
src/views/dashboard/workbench/data.ts
renamed from
src/views/dashboard/analysis/data.ts
| 1 | 1 | <template> |
| 2 | - <PageWrapper> | |
| 3 | - <template #headerContent> <WorkbenchHeader /> </template> | |
| 4 | - <div class="lg:flex"> | |
| 5 | - <div class="lg:w-7/10 w-full !mr-4 enter-y"> | |
| 6 | - <ProjectCard :loading="loading" class="enter-y" /> | |
| 7 | - <DynamicInfo :loading="loading" class="!my-4 enter-y" /> | |
| 8 | - </div> | |
| 9 | - <div class="lg:w-3/10 w-full enter-y"> | |
| 10 | - <QuickNav :loading="loading" class="enter-y" /> | |
| 11 | - | |
| 12 | - <Card class="!my-4 enter-y" :loading="loading"> | |
| 13 | - <img class="xl:h-50 h-30 mx-auto" src="../../../assets/svg/illustration.svg" /> | |
| 2 | + <div class="p-4 md:flex"> | |
| 3 | + <div class="md:w-7/10 w-full !mr-4 enter-y"> | |
| 4 | + <GrowCard :loading="loading" class="enter-y" /> | |
| 5 | + <SiteAnalysis class="!my-4 enter-y" :loading="loading" /> | |
| 6 | + <div class="md:flex enter-y"> | |
| 7 | + <Card title="核心流程指南" style="width: 100%"> | |
| 8 | + <img alt="核心流程指南" src="../../../assets/images/flow.png" /> | |
| 14 | 9 | </Card> |
| 15 | - | |
| 16 | - <SaleRadar :loading="loading" class="enter-y" /> | |
| 17 | 10 | </div> |
| 18 | 11 | </div> |
| 19 | - <BasicModal | |
| 20 | - @register="register" | |
| 21 | - v-bind="$attrs" | |
| 22 | - :mask="true" | |
| 23 | - :showCancelBtn="false" | |
| 24 | - :showOkBtn="false" | |
| 25 | - :canFullscreen="false" | |
| 26 | - :closable="false" | |
| 27 | - :maskStyle="maskColor" | |
| 28 | - :height="600" | |
| 29 | - :width="1500" | |
| 30 | - :maskClosable="false" | |
| 31 | - title="请修改密码" | |
| 32 | - :helpMessage="['请您修改密码']" | |
| 33 | - > | |
| 34 | - <PasswordDialog /> | |
| 35 | - </BasicModal> | |
| 36 | - </PageWrapper> | |
| 12 | + <div class="md:w-3/10 w-full enter-y"> | |
| 13 | + <HelpDoc /> | |
| 14 | + </div> | |
| 15 | + </div> | |
| 37 | 16 | </template> |
| 38 | 17 | <script lang="ts" setup> |
| 39 | - import PasswordDialog from '/@/views/system/password/index.vue'; | |
| 40 | - import { BasicModal, useModal } from '/@/components/Modal'; | |
| 41 | - import { getAuthCache } from '/@/utils/auth'; | |
| 42 | - import { USER_INFO_KEY } from '/@/enums/cacheEnum'; | |
| 43 | - import { ref, onMounted } from 'vue'; | |
| 18 | + import { ref } from 'vue'; | |
| 19 | + import GrowCard from './components/GrowCard.vue'; | |
| 20 | + import SiteAnalysis from './components/SiteAnalysis.vue'; | |
| 44 | 21 | import { Card } from 'ant-design-vue'; |
| 45 | - import { PageWrapper } from '/@/components/Page'; | |
| 46 | - import WorkbenchHeader from './components/WorkbenchHeader.vue'; | |
| 47 | - import ProjectCard from './components/ProjectCard.vue'; | |
| 48 | - import QuickNav from './components/QuickNav.vue'; | |
| 49 | - import DynamicInfo from './components/DynamicInfo.vue'; | |
| 50 | - import SaleRadar from './components/SaleRadar.vue'; | |
| 51 | - | |
| 52 | - const maskColor = ref({ backgroundColor: 'grey' }); | |
| 53 | - const statusModel = ref(false); | |
| 54 | - const [register, { openModal }] = useModal(); | |
| 55 | - onMounted(() => { | |
| 56 | - const userInfo: object = getAuthCache(USER_INFO_KEY); | |
| 57 | - if (userInfo.needSetPwd == true) { | |
| 58 | - statusModel.value = true; | |
| 59 | - openModal(statusModel.value); | |
| 60 | - } else if (userInfo.needSetPwd == false) { | |
| 61 | - openModal(statusModel.value); | |
| 62 | - } | |
| 63 | - }); | |
| 64 | - //Yunteng123456!!! | |
| 65 | - //Password123456! | |
| 66 | - //System123456! | |
| 67 | - //Testrole123456! | |
| 68 | - const loading = ref(false); | |
| 22 | + import HelpDoc from './components/HelpDoc.vue'; | |
| 23 | + const loading = ref(true); | |
| 69 | 24 | setTimeout(() => { |
| 70 | 25 | loading.value = false; |
| 71 | 26 | }, 1500); | ... | ... |
| ... | ... | @@ -20,6 +20,7 @@ |
| 20 | 20 | import { getEnterPriseDetail, updateEnterPriseDetail } from '/@/api/oem/index'; |
| 21 | 21 | import { Loading } from '/@/components/Loading'; |
| 22 | 22 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 23 | + import { getTownChild } from '/@/api/oem/index'; | |
| 23 | 24 | export default defineComponent({ |
| 24 | 25 | components: { |
| 25 | 26 | Card, |
| ... | ... | @@ -32,7 +33,7 @@ |
| 32 | 33 | loading: false, |
| 33 | 34 | tip: '拼命加载中...', |
| 34 | 35 | }); |
| 35 | - const [registerForm, { getFieldsValue, setFieldsValue }] = useForm({ | |
| 36 | + const [registerForm, { getFieldsValue, setFieldsValue, updateSchema }] = useForm({ | |
| 36 | 37 | labelWidth: 80, |
| 37 | 38 | schemas, |
| 38 | 39 | showResetButton: false, |
| ... | ... | @@ -59,11 +60,128 @@ |
| 59 | 60 | createMessage.error('更新信息失败'); |
| 60 | 61 | } |
| 61 | 62 | }; |
| 63 | + | |
| 62 | 64 | onMounted(async () => { |
| 63 | 65 | const res = await getEnterPriseDetail(); |
| 66 | + console.log(res); | |
| 67 | + updateCityData(res.codeProv, res.codeCity, res.codeCoun); | |
| 64 | 68 | setFieldsValue(res); |
| 65 | 69 | }); |
| 66 | 70 | |
| 71 | + async function updateCityData(codeProv: string, codeCity: string, codeCoun: string) { | |
| 72 | + const nameCity = await getTownChild('codeProv', codeProv); | |
| 73 | + const nameCoun = await getTownChild('codeCity', codeCity); | |
| 74 | + const nameTown = await getTownChild('codeCoun', codeCoun); | |
| 75 | + nameCity.forEach((item) => { | |
| 76 | + item.label = item.nameCity; | |
| 77 | + item.value = item.codeCity; | |
| 78 | + }); | |
| 79 | + nameCoun.forEach((item) => { | |
| 80 | + item.label = item.nameCoun; | |
| 81 | + item.value = item.codeCoun; | |
| 82 | + }); | |
| 83 | + nameTown.forEach((item) => { | |
| 84 | + item.label = item.nameTown; | |
| 85 | + item.value = item.codeTown; | |
| 86 | + }); | |
| 87 | + updateSchema({ | |
| 88 | + field: 'nameTown', | |
| 89 | + componentProps: { | |
| 90 | + options: nameTown, | |
| 91 | + }, | |
| 92 | + }); | |
| 93 | + updateSchema({ | |
| 94 | + field: 'nameCoun', | |
| 95 | + componentProps: { | |
| 96 | + options: nameCoun, | |
| 97 | + async onChange(value) { | |
| 98 | + if (value === undefined) { | |
| 99 | + setFieldsValue({ | |
| 100 | + nameTown: undefined, | |
| 101 | + }); | |
| 102 | + updateSchema({ | |
| 103 | + field: 'nameTown', | |
| 104 | + componentProps: { | |
| 105 | + options: [], | |
| 106 | + }, | |
| 107 | + }); | |
| 108 | + } | |
| 109 | + let nameTown = await getTownChild('codeCoun', value); | |
| 110 | + console.log(111); | |
| 111 | + nameTown.forEach((item) => { | |
| 112 | + item.label = item.nameTown; | |
| 113 | + item.value = item.codeTown; | |
| 114 | + }); | |
| 115 | + setFieldsValue({ | |
| 116 | + nameTown: undefined, | |
| 117 | + }); | |
| 118 | + updateSchema({ | |
| 119 | + field: 'nameTown', | |
| 120 | + componentProps: { | |
| 121 | + placeholder: '请选择街道/城镇', | |
| 122 | + options: nameTown, | |
| 123 | + }, | |
| 124 | + }); | |
| 125 | + }, | |
| 126 | + }, | |
| 127 | + }); | |
| 128 | + updateSchema({ | |
| 129 | + field: 'nameCity', | |
| 130 | + componentProps: ({ formModel }) => { | |
| 131 | + return { | |
| 132 | + options: nameCity, | |
| 133 | + onChange: async (value) => { | |
| 134 | + let nameCoun = await getTownChild('codeCity', value); | |
| 135 | + if (value === undefined) { | |
| 136 | + formModel.nameCoun = undefined; // reset city value | |
| 137 | + formModel.nameTown = undefined; | |
| 138 | + nameCoun = []; | |
| 139 | + updateSchema({ | |
| 140 | + field: 'nameTown', | |
| 141 | + componentProps: { | |
| 142 | + options: [], | |
| 143 | + }, | |
| 144 | + }); | |
| 145 | + } | |
| 146 | + nameCoun.forEach((item) => { | |
| 147 | + item.label = item.nameCoun; | |
| 148 | + item.value = item.codeCoun; | |
| 149 | + }); | |
| 150 | + formModel.nameCoun = undefined; // reset city value | |
| 151 | + formModel.nameTown = undefined; | |
| 152 | + updateSchema({ | |
| 153 | + field: 'nameCoun', | |
| 154 | + componentProps: { | |
| 155 | + // 请选择区 | |
| 156 | + options: nameCoun, | |
| 157 | + async onChange(value) { | |
| 158 | + let nameTown = await getTownChild('codeCoun', value); | |
| 159 | + if (value === undefined) { | |
| 160 | + formModel.nameTown = undefined; | |
| 161 | + nameTown = []; | |
| 162 | + } | |
| 163 | + nameTown.forEach((item) => { | |
| 164 | + item.label = item.nameTown; | |
| 165 | + item.value = item.codeTown; | |
| 166 | + }); | |
| 167 | + | |
| 168 | + formModel.nameTown = undefined; | |
| 169 | + updateSchema({ | |
| 170 | + field: 'nameTown', | |
| 171 | + componentProps: { | |
| 172 | + placeholder: '请选择街道/城镇', | |
| 173 | + options: nameTown, | |
| 174 | + }, | |
| 175 | + }); | |
| 176 | + }, | |
| 177 | + }, | |
| 178 | + }); | |
| 179 | + }, | |
| 180 | + }; | |
| 181 | + }, | |
| 182 | + }); | |
| 183 | + } | |
| 184 | + | |
| 67 | 185 | return { |
| 68 | 186 | registerForm, |
| 69 | 187 | compState, | ... | ... |
| ... | ... | @@ -51,6 +51,7 @@ export const schemas: FormSchema[] = [ |
| 51 | 51 | field: 'synopsis', |
| 52 | 52 | component: 'InputTextArea', |
| 53 | 53 | label: '公司简介', |
| 54 | + | |
| 54 | 55 | colProps: { |
| 55 | 56 | span: 24, |
| 56 | 57 | }, |
| ... | ... | @@ -116,6 +117,9 @@ export const schemas: FormSchema[] = [ |
| 116 | 117 | }, |
| 117 | 118 | }); |
| 118 | 119 | } |
| 120 | + formModel.nameCity = undefined; // reset city value | |
| 121 | + formModel.nameCoun = undefined; | |
| 122 | + formModel.nameTown = undefined; | |
| 119 | 123 | updateSchema({ |
| 120 | 124 | field: 'nameCity', |
| 121 | 125 | componentProps: () => { |
| ... | ... | @@ -146,14 +150,20 @@ export const schemas: FormSchema[] = [ |
| 146 | 150 | // 请选择区 |
| 147 | 151 | options: nameCoun, |
| 148 | 152 | async onChange(value) { |
| 149 | - let nameTown = await getTownChild('codeCoun', value); | |
| 153 | + const nameTown = await getTownChild('codeCoun', value); | |
| 150 | 154 | nameTown.forEach((item) => { |
| 151 | 155 | item.label = item.nameTown; |
| 152 | 156 | item.value = item.codeTown; |
| 153 | 157 | }); |
| 154 | 158 | if (value === undefined) { |
| 155 | 159 | formModel.nameTown = undefined; |
| 156 | - nameTown = []; | |
| 160 | + updateSchema({ | |
| 161 | + field: 'nameTown', | |
| 162 | + componentProps: { | |
| 163 | + placeholder: '请选择街道/城镇', | |
| 164 | + options: [], | |
| 165 | + }, | |
| 166 | + }); | |
| 157 | 167 | } |
| 158 | 168 | updateSchema({ |
| 159 | 169 | field: 'nameTown', |
| ... | ... | @@ -177,7 +187,6 @@ export const schemas: FormSchema[] = [ |
| 177 | 187 | field: 'nameCity', |
| 178 | 188 | component: 'Select', |
| 179 | 189 | label: '', |
| 180 | - | |
| 181 | 190 | colProps: { |
| 182 | 191 | span: 5, |
| 183 | 192 | style: { |
| ... | ... | @@ -213,13 +222,6 @@ export const schemas: FormSchema[] = [ |
| 213 | 222 | placeholder: '请选择街道/城镇', |
| 214 | 223 | }, |
| 215 | 224 | }, |
| 216 | - | |
| 217 | - // { | |
| 218 | - // field: 'nameProv', | |
| 219 | - // label: '所在城市', | |
| 220 | - // component: 'Cascader', | |
| 221 | - // }, | |
| 222 | - | |
| 223 | 225 | { |
| 224 | 226 | field: 'address', |
| 225 | 227 | component: 'Input', | ... | ... |
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | import EnterpriseInfo from './components/EnterpriseInfo.vue'; |
| 24 | 24 | import CVIDraw from './components/CVIDraw.vue'; |
| 25 | 25 | import AppDraw from './components/AppDraw.vue'; |
| 26 | - const activeKey = ref('APP定制'); | |
| 26 | + const activeKey = ref('企业信息'); | |
| 27 | 27 | </script> |
| 28 | 28 | |
| 29 | 29 | <style lang="less" scoped> | ... | ... |