| | |
| | | prodCode: string; |
| | | isDefault: boolean; |
| | | } |
| | | |
| | | /** |
| | | * @description: å·¥èºè·¯çº¿æ å½¢ |
| | | * @return {*} |
| | | */ |
| | | export interface MesRotTree { |
| | | org: string; |
| | | pid: string; |
| | | tid: string; |
| | | id: string; |
| | | code: string; |
| | | name: string; |
| | | type: string; |
| | | seq: string; |
| | | } |
| | |
| | | * @param {T} data |
| | | * @param {string} parentField ç¶å段å |
| | | * @param {string} idField å¯ä¸keyåæ®µå |
| | | * @param {string} pid_val ç¶idå¼ |
| | | * @param {string} pid ç¶idå¼ |
| | | * @return {*} |
| | | */ |
| | | export function convertToTree<T>(data: T[], parentField: string, idField: string, pid?: string) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * @Description: 产åå·¥èºè·¯çº¿Store |
| | | * @Author: Ben Lin |
| | | * @version: |
| | | * @Date: 2024-06-18 15:09:47 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-10-08 16:10:48 |
| | | */ |
| | | import { defineStore } from 'pinia'; |
| | | import { store } from '@/store'; |
| | | import { useI18n } from '@/hooks/web/useI18n'; |
| | | import { useMessage } from '@/hooks/web/useMessage'; |
| | | import { h } from 'vue'; |
| | | import { MesRotTree } from '/@/api/tigerapi/model/mesModel'; |
| | | |
| | | interface ProdRouteState { |
| | | curProdRotTree: Nullable<MesRotTree>; |
| | | rotList: MesRotTree[]; |
| | | } |
| | | |
| | | export const useProdRouteStore = defineStore({ |
| | | id: 'app-prodrot', |
| | | state: (): ProdRouteState => ({ |
| | | curProdRotTree: null, |
| | | rotList: [], |
| | | }), |
| | | getters: { |
| | | getCurProdRotTree(state): MesRotTree | null { |
| | | return state.curProdRotTree; |
| | | }, |
| | | getRotList(state): MesRotTree[] { |
| | | return state.rotList; |
| | | }, |
| | | }, |
| | | actions: { |
| | | getRotList(roleList: MesRotTree[]) { |
| | | this.rotList = roleList; |
| | | }, |
| | | setUserInfo(info: MesRotTree | null) { |
| | | this.curProdRotTree = info; |
| | | }, |
| | | resetState() { |
| | | this.curProdRotTree = null; |
| | | this.rotList = []; |
| | | }, |
| | | /** |
| | | * @description: 设置é»è®¤å·¥èºè·¯çº¿ |
| | | * @return {*} |
| | | */ |
| | | setDefaulRoute() { |
| | | const { createConfirm } = useMessage(); |
| | | const { t } = useI18n(); |
| | | createConfirm({ |
| | | iconType: 'warning', |
| | | title: () => h('span', t('sys.app.logoutTip')), |
| | | content: () => h('span', t('sys.app.logoutMessage')), |
| | | onOk: async () => { |
| | | // 主å¨ç»åºï¼ä¸å¸¦redirectå°å |
| | | // await this.logout(true); |
| | | }, |
| | | }); |
| | | }, |
| | | }, |
| | | }); |
| | | |
| | | // Need to be used outside the setup |
| | | export function useProdRouteWithOut() { |
| | | return useProdRouteStore(store); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * @Description: èªå®ä¹äºç»´ç Store |
| | | * @Author: Ben Lin |
| | | * @version: |
| | | * @Date: 2024-06-18 15:09:47 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-10-09 22:27:39 |
| | | */ |
| | | import { defineStore } from 'pinia'; |
| | | import { store } from '@/store'; |
| | | |
| | | interface QrhisState { |
| | | hisData: string[]; |
| | | } |
| | | |
| | | export const useQrhisStore = defineStore({ |
| | | id: 'app-Qrhis', |
| | | state: (): QrhisState => ({ |
| | | hisData: [], |
| | | }), |
| | | getters: { |
| | | gethisData(state): string[] { |
| | | return state.hisData; |
| | | }, |
| | | }, |
| | | actions: { |
| | | sethisData(val: string[]) { |
| | | this.hisData = val; |
| | | }, |
| | | resetState() { |
| | | this.hisData = []; |
| | | }, |
| | | }, |
| | | persist: { |
| | | key: 'HONGHU_NX__DEVELOPMENT__hisData', //åå¨åç§° |
| | | storage: sessionStorage, // å卿¹å¼ |
| | | paths: ['hisData'], //æå® state ä¸åªäºæ°æ®éè¦è¢«æä¹
åã[] è¡¨ç¤ºä¸æä¹
åä»»ä½ç¶æï¼undefined æ null 表示æä¹
åæ´ä¸ª state |
| | | }, |
| | | }); |
| | |
| | | * @version: |
| | | * @Date: 2024-06-18 15:09:47 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-24 16:17:11 |
| | | * @LastEditTime: 2024-10-07 17:01:32 |
| | | */ |
| | | import type { UserInfo } from '#/store'; |
| | | import type { ErrorMessageMode } from '#/axios'; |
| | |
| | | import { PageEnum } from '@/enums/pageEnum'; |
| | | import { ROLES_KEY, TOKEN_KEY, USER_INFO_KEY } from '@/enums/cacheEnum'; |
| | | import { getAuthCache, setAuthCache } from '@/utils/auth'; |
| | | import { GetUserInfoModel, LoginParams } from '@/api/sys/model/userModel'; |
| | | import { doLogout, getTgUserInfo, getUserInfo, loginApi } from '@/api/sys/user'; |
| | | import { GetUserInfoModel } from '@/api/sys/model/userModel'; |
| | | import { doLogout, getTgUserInfo, loginApi } from '@/api/sys/user'; |
| | | import { useI18n } from '@/hooks/web/useI18n'; |
| | | import { useMessage } from '@/hooks/web/useMessage'; |
| | | import { router } from '@/router'; |
| | | import { usePermissionStore } from '@/store/modules/permission'; |
| | | import { RouteRecordRaw } from 'vue-router'; |
| | | import { PAGE_NOT_FOUND_ROUTE } from '@/router/routes/basic'; |
| | | import { isArray } from '@/utils/is'; |
| | | import { h } from 'vue'; |
| | | import { AccountInfo } from '/@/api/tigerapi/model/systemModel'; |
| | |
| | | * @version: |
| | | * @Date: 2024-06-20 12:13:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-10-06 16:55:15 |
| | | * @LastEditTime: 2024-10-07 16:52:03 |
| | | --> |
| | | <template> |
| | | <Card :title="GetTitle(props.configType)['navTitle']"> |
| | |
| | | function RvItemSuccess(d, u) {} |
| | | |
| | | /** |
| | | * @description: |
| | | * @description: å¼å
³æ¹åäºä»¶ |
| | | * @param {*} d |
| | | * @return {*} |
| | | */ |
| | |
| | | <template> |
| | | |
| | | <PageWrapper title="çæäºç»´ç "> |
| | | <div class="mb-4 pt-4" style="background-color: white; width: 99%;"> |
| | | <PageWrapper title="çæäºç»´ç " contentFullHeight contentClass="flex"> |
| | | <template #headerContent> |
| | | <BasicForm @register="register"> |
| | | <template #search="{ field }"> |
| | | <Button v-if="field" style="margin-left: 0;" @click="onSearch">çæ</Button> |
| | | <Button v-if="field" style="margin-left: 0" @click="onSearch">çæ</Button> |
| | | </template> |
| | | </BasicForm> |
| | | </template> |
| | | <div class="w-1/4 xl:w-1/5 p-3" style="background-color: white"> |
| | | <a-list size="small" bordered :data-source="hisData"> |
| | | <template #renderItem="{ item }"> |
| | | <a-list-item> |
| | | <a-list-item-meta description=""> |
| | | <template #title> |
| | | <span @click="showQr(item)">{{ item }}</span> |
| | | </template> |
| | | </a-list-item-meta> |
| | | </a-list-item> |
| | | </template> |
| | | <template #header> |
| | | <div>åå²è®°å½</div> |
| | | </template> |
| | | <!-- <template #footer> |
| | | <div>Footer</div> |
| | | </template> --> |
| | | </a-list> |
| | | </div> |
| | | |
| | | <div class="flex flex-wrap" v-if="show"> |
| | | <div class="w-3/4 xl:w-4/5 p-5" v-if="show"> |
| | | <!-- <CollapseContainer title="äºç»´ç " class="text-center qrcode-demo-item"></CollapseContainer> --> |
| | | <div class="mb-4 pt-4 text-center" style="background-color: white; width: 99%;"> |
| | | <div class="mb-4 pt-4 text-center" style="width: 99%; background-color: white"> |
| | | <QrCode |
| | | :value="qrCodeUrl" |
| | | :width="390" |
| | |
| | | </PageWrapper> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { ref } from 'vue'; |
| | | import { onMounted, ref } from 'vue'; |
| | | import { List, ListItem, ListItemMeta } from 'ant-design-vue'; |
| | | import { QrCode } from '/@/components/Qrcode/index'; |
| | | import LogoImg from '/@/assets/images/logo.png'; |
| | | import { CollapseContainer } from '/@/components/Container/index'; |
| | |
| | | import { PageWrapper } from '/@/components/Page'; |
| | | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
| | | import { Button } from '/@/components/Button'; |
| | | import { useQrhisStore } from '/@/store/modules/qrhis'; |
| | | import { storeToRefs } from 'pinia'; |
| | | |
| | | const AList = List; |
| | | const AListItem = ListItem; |
| | | const AListItemMeta = ListItemMeta; |
| | | const schemas: FormSchema[] = [ |
| | | { |
| | | field: 'SN', |
| | |
| | | colProps: { |
| | | span: 8, |
| | | }, |
| | | |
| | | },{ |
| | | }, |
| | | { |
| | | field: '0', |
| | | component: 'Input', |
| | | slot: 'search', |
| | | colProps: { |
| | | span: 4, |
| | | }, |
| | | } |
| | | }, |
| | | ]; |
| | | |
| | | let qrDatas:any[] = [] |
| | | const useQrhis = useQrhisStore(); |
| | | const { hisData } = storeToRefs(useQrhis); |
| | | const { createMessage } = useMessage(); |
| | | const show = ref(false) |
| | | const show = ref(false); |
| | | const qrCodeUrl = ref(''); |
| | | const [ |
| | | register, |
| | | { validateFields, clearValidate, getFieldsValue, resetFields, setFieldsValue }, |
| | | ] = useForm({ |
| | | const [register, { validateFields, clearValidate, getFieldsValue, resetFields, setFieldsValue }] = |
| | | useForm({ |
| | | showSubmitButton: false, |
| | | showResetButton: false, |
| | | labelWidth: 80, |
| | |
| | | if(barcode.SN!=''){ |
| | | show.value=true; |
| | | qrCodeUrl.value=barcode.SN; |
| | | useQrhis.gethisData.push(barcode.SN); |
| | | qrDatas = useQrhis.gethisData |
| | | useQrhis.sethisData(qrDatas); |
| | | // var apiAction = await GetQrCode(barcode.SN) |
| | | // if(apiAction.IsSuccessed){ |
| | | // show.value=true; |
| | |
| | | show.value=false; |
| | | createMessage.error('è¾å
¥çæ¡ç 为空'); |
| | | } |
| | | |
| | | } |
| | | async function showQr(code: string) { |
| | | if (code != '') { |
| | | show.value = true; |
| | | qrCodeUrl.value = code; |
| | | } else { |
| | | show.value = false; |
| | | createMessage.error('è¾å
¥çæ¡ç 为空'); |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |