src/api/tigerapi/model/mesModel.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/api/tigerapi/system.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/store/modules/prodRoute.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/store/modules/qrhis.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/store/modules/user.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/tigerprojects/wms/createqrcode/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/tigerapi/model/mesModel.ts
@@ -507,3 +507,18 @@ 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; } src/api/tigerapi/system.ts
@@ -289,7 +289,7 @@ * @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) { src/store/modules/prodRoute.ts
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,69 @@ /* * @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); } src/store/modules/qrhis.ts
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,39 @@ /* * @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 }, }); src/store/modules/user.ts
@@ -4,7 +4,7 @@ * @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'; @@ -14,14 +14,11 @@ 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'; src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue
@@ -4,7 +4,7 @@ * @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']"> @@ -163,7 +163,7 @@ function RvItemSuccess(d, u) {} /** * @description: * @description: å¼å ³æ¹åäºä»¶ * @param {*} d * @return {*} */ src/views/tigerprojects/wms/createqrcode/index.vue
@@ -1,17 +1,34 @@ <template> <PageWrapper title="çæäºç»´ç "> <div class="mb-4 pt-4" style="background-color: white; width: 99%;"> <BasicForm @register="register"> <template #search="{ field }"> <Button v-if="field" style="margin-left: 0;" @click="onSearch">çæ</Button> <PageWrapper title="çæäºç»´ç " contentFullHeight contentClass="flex"> <template #headerContent> <BasicForm @register="register"> <template #search="{ field }"> <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" @@ -27,85 +44,103 @@ </div> </PageWrapper> </template> <script lang="ts" setup> import { ref } from 'vue'; import { QrCode } from '/@/components/Qrcode/index'; import LogoImg from '/@/assets/images/logo.png'; import { CollapseContainer } from '/@/components/Container/index'; import { GetQrCode } from '/@/api/tigerapi/wms/qrcode'; import { useMessage } from '/@/hooks/web/useMessage'; import { PageWrapper } from '/@/components/Page'; import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; import { Button } from '/@/components/Button'; <script lang="ts" setup> 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 { GetQrCode } from '/@/api/tigerapi/wms/qrcode'; import { useMessage } from '/@/hooks/web/useMessage'; 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 schemas: FormSchema[] = [ { field: 'SN', const AList = List; const AListItem = ListItem; const AListItemMeta = ListItemMeta; const schemas: FormSchema[] = [ { field: 'SN', component: 'Input', label: 'SN', colProps: { span: 8, }, },{ field: '0', component: 'Input', slot: 'search', colProps: { span: 4, }, } ]; }, { field: '0', component: 'Input', slot: 'search', colProps: { span: 4, }, }, ]; const { createMessage } = useMessage(); const show = ref(false) const qrCodeUrl = ref(''); const [ register, { validateFields, clearValidate, getFieldsValue, resetFields, setFieldsValue }, ] = useForm({ let qrDatas:any[] = [] const useQrhis = useQrhisStore(); const { hisData } = storeToRefs(useQrhis); const { createMessage } = useMessage(); const show = ref(false); const qrCodeUrl = ref(''); const [register, { validateFields, clearValidate, getFieldsValue, resetFields, setFieldsValue }] = useForm({ showSubmitButton: false, showResetButton: false, labelWidth: 80, schemas, canResize:true, canResize: true, actionColOptions: { span: 12, }, }); function onQrcodeDone({ ctx }: any) { if (ctx instanceof CanvasRenderingContext2D) { // é¢å¤ç»å¶ ctx.fillStyle = 'black'; ctx.font = '16px "微软é é»"'; ctx.textBaseline = 'bottom'; ctx.textAlign = 'center'; ctx.fillText('ä½ å¸ ä½ å æ«', 200, 380, 200); function onQrcodeDone({ ctx }: any) { if (ctx instanceof CanvasRenderingContext2D) { // é¢å¤ç»å¶ ctx.fillStyle = 'black'; ctx.font = '16px "微软é é»"'; ctx.textBaseline = 'bottom'; ctx.textAlign = 'center'; ctx.fillText('ä½ å¸ ä½ å æ«', 200, 380, 200); } } } async function onSearch({ ctx }: any) { var barcode=getFieldsValue(); if(barcode.SN!=''){ show.value=true; qrCodeUrl.value=barcode.SN; // var apiAction = await GetQrCode(barcode.SN) // if(apiAction.IsSuccessed){ // show.value=true; // qrCodeUrl.value=apiAction.Message // } // else{ // //show.value=false; // show.value=true; // qrCodeUrl.value=barcode.SN; // //createMessage.error('æ¡ç ç³»ç»ä¸åå¨'); // } }else{ show.value=false; createMessage.error('è¾å ¥çæ¡ç 为空'); } } async function onSearch({ ctx }: any) { var barcode = getFieldsValue(); 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; // qrCodeUrl.value=apiAction.Message // } // else{ // //show.value=false; // show.value=true; // qrCodeUrl.value=barcode.SN; // //createMessage.error('æ¡ç ç³»ç»ä¸åå¨'); // } } else { 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> .qrcode-demo-item {