提交 ed8bbafb authored 作者: 刘旭's avatar 刘旭

同步代码

上级 f72cb234
<script setup lang="ts"> <script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'; import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
</script> </script>
<style lang="scss" scoped> <style lang="scss">
@import './static/iconfont/iconfont.css'; @import './static/iconfont/iconfont.css';
@import 'vk-uview-ui/index.scss'; @import 'vk-uview-ui/index.scss';
@import './scss/common.scss';
page {
background-color: #f6f6f6;
}
.uni-tabbar { .uni-tabbar {
max-width: 420px; max-width: 420px;
...@@ -15,4 +12,9 @@ page { ...@@ -15,4 +12,9 @@ page {
border-left: #f6f6f6 solid 1px; border-left: #f6f6f6 solid 1px;
border-right: #f6f6f6 solid 1px; border-right: #f6f6f6 solid 1px;
} }
page {
background: #F7F7F7;
}
</style> </style>
...@@ -13,6 +13,12 @@ export const getMetadataList = () => request('/lowcodeplatform-system/center/met ...@@ -13,6 +13,12 @@ export const getMetadataList = () => request('/lowcodeplatform-system/center/met
// 获取元数据 // 获取元数据
export const getMetadata = (formId: string) => export const getMetadata = (formId: string) =>
request('/lowcodeplatform-system/center/metadata/detail', 'GET', { formId }); request('/lowcodeplatform-system/center/metadata/detail', 'GET', { formId });
export const getUserParameter = (formId: string) =>
request('/lowcodeplatform-system/center/business/getUserParameter', 'GET', { formId });
export const saveUserParameter = (data: any) =>
request('/lowcodeplatform-system/center/business/saveUserParameter', 'POST', data);
// 获取序列号扫描数据 // 获取序列号扫描数据
export const getDataBySerialNumber = (data: any) => export const getDataBySerialNumber = (data: any) =>
...@@ -25,3 +31,11 @@ export const getPrintData = (data: any) => ...@@ -25,3 +31,11 @@ export const getPrintData = (data: any) =>
// 获取打印信息 // 获取打印信息
export const createBusiness = (data: any) => export const createBusiness = (data: any) =>
request('/lowcodeplatform-system/center/business/createBatch', 'POST', data); request('/lowcodeplatform-system/center/business/createBatch', 'POST', data);
// 获取序列化
export const getByBillNo = (data: any) =>
request('/wms-system/serialNumber/getByBillNo', 'GET', data);
// 获取条码规则
export const getAnalysis = (data: any) =>
request('/wms-system/barcode/analysis', 'GET', data);
\ No newline at end of file
<template> <template>
<u-navbar back-text="" :title="title" :back-icon-name="backIconName" title-color="#000000" <u-navbar back-text="" :title="title" :back-icon-name="backIconName" title-color="#ffffff"
:background="{ background: '#f8f8f8' }" title-width="400"> :background="{ background }" title-width="400" height="48" back-icon-color="#ffffff">
<template #right> <template #right>
<u-icon :name="iconName" :size="44" style="padding: 14rpx 14rpx 14rpx 24rpx;" /> // #ifdef APP-PLUS
<u-icon :name="iconName" :size="22" color="#ffffff"
style="padding: 14rpx 14rpx 14rpx 24rpx; padding-top: 14px;" @tap="handleRight" />
// #endif
// #ifdef H5
<u-icon :name="iconName" :size="44" color="#ffffff" style="padding: 14rpx 14rpx 14rpx 24rpx;"
@tap="handleRight" />
// #endif
</template> </template>
</u-navbar> </u-navbar>
<u-action-sheet :list="sheetList" v-model="sheetShow" @click="onConfirm" />
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { ref } from 'vue' import { ref } from 'vue';
const props = defineProps({ const props = defineProps({
title: { title: {
type: String, type: String,
...@@ -21,19 +30,44 @@ const props = defineProps({ ...@@ -21,19 +30,44 @@ const props = defineProps({
iconName: { iconName: {
type: String, type: String,
default: '' default: ''
},
background: {
type: String,
default: 'f8f8f8'
},
sheetList: {
type: Object,
default: []
} }
}) })
const emits = defineEmits(['handleRight'])
const sheetShow = ref(false)
const handleRight = () => {
sheetShow.value = true
// emits('handleRight')
}
const onConfirm = (index: number) => {
const item = props.sheetList[index]
switch (item.options.operate) {
case 'save':
uni.navigateTo({
url: '/pages/setting/options?data=' + encodeURIComponent(JSON.stringify(item))
})
break;
}
}
</script> </script>
<style lang = "scss" scoped> <style lang = "scss" scoped>
// :deep(.u-line-1) {
// font-weight: normal;
// font-size: 14px;
// }
:deep(.u-line-1) { :deep(.u-line-1) {
font-weight: bold !important; font-weight: bold !important;
font-size: 16px !important; font-size: 16px !important;
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS
:deep(.uicon-nav-back:before) { :deep(.uicon-nav-back:before) {
font-size: 44rpx; font-size: 44rpx;
......
...@@ -10,36 +10,46 @@ ...@@ -10,36 +10,46 @@
{ {
"path": "pages/login/index", "path": "pages/login/index",
"style": { "style": {
"navigationBarTitleText": "登录" "navigationBarTitleText": "登录",
"navigationBarBackgroundColor": "#3cbafd",
"navigationBarTextStyle": "white"
} }
}, },
{ {
"path": "pages/home/index", "path": "pages/home/index",
"style": { "style": {
"navigationBarTitleText": "主页" "navigationBarTitleText": "主页",
"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/apply/index", "path": "pages/apply/index",
"style": { "style": {
"navigationBarTitleText": "应用" "navigationBarTitleText": "应用",
"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/setting/index", "path": "pages/setting/index",
"style": { "style": {
"navigationBarTitleText": "设置", "navigationBarTitleText": "个人信息",
"navigationBarBackgroundColor": "#f6f6f6" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/apply/formDataPage", "path": "pages/setting/options",
"style": { "style": {
"navigationBarBackgroundColor": "#f6f6f6",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/apply/formDataPage",
"style": {
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#3cbafd"
}
},
{
"path": "pages/apply/formDetail", "path": "pages/apply/formDetail",
"style": { "style": {
"navigationBarBackgroundColor": "#f6f6f6", "navigationBarBackgroundColor": "#f6f6f6",
...@@ -64,26 +74,26 @@ ...@@ -64,26 +74,26 @@
"tabBar": { "tabBar": {
"selectedColor": "#333", "selectedColor": "#333",
"color": "#707070", "color": "#707070",
"backgroundColor": "#f6f6f6", "backgroundColor": "#FFFFFF",
"borderStyle": "white", "borderStyle": "white",
"height": "50px", "height": "50px",
"list": [ "list": [
{ {
"pagePath": "pages/home/index", "pagePath": "pages/home/index",
"iconPath": "/static/tabbar/home.png", "iconPath": "/static/tabbar/home.png",
"selectedIconPath": "/static/tabbar/home_fill.png", "selectedIconPath": "/static/tabbar/homefill.png",
"text": "主页" "text": "主页"
}, },
{ {
"pagePath": "pages/apply/index", "pagePath": "pages/apply/index",
"iconPath": "/static/tabbar/apply.png", "iconPath": "/static/tabbar/apply.png",
"selectedIconPath": "/static/tabbar/apply_fill.png", "selectedIconPath": "/static/tabbar/applyfill.png",
"text": "应用" "text": "应用"
}, },
{ {
"pagePath": "pages/setting/index", "pagePath": "pages/setting/index",
"iconPath": "/static/tabbar/setting.png", "iconPath": "/static/tabbar/setting.png",
"selectedIconPath": "/static/tabbar/setting_fill.png", "selectedIconPath": "/static/tabbar/settingfill.png",
"text": "设置" "text": "设置"
} }
] ]
...@@ -91,7 +101,7 @@ ...@@ -91,7 +101,7 @@
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#fff",
"backgroundColor": "#F8F8F8" "backgroundColor": "#ccc"
} }
} }
<template> <template>
<vk-header :title="title" back-icon-name="nav-back" /> <headers :title="title" back-icon-name="nav-back" background="#3cbafd"/>
<form-list-item ref="formListRef" :business-list="businessList" /> <form-list-item ref="formListRef" :business-list="businessList" />
</template> </template>
...@@ -9,8 +9,8 @@ import { onLoad, onShow } from '@dcloudio/uni-app'; ...@@ -9,8 +9,8 @@ import { onLoad, onShow } from '@dcloudio/uni-app';
import { getBusinessList } from '@/api/apply' import { getBusinessList } from '@/api/apply'
import { useFormData } from '@/store/modules/formData'; import { useFormData } from '@/store/modules/formData';
import { sLoading, hLoading } from '@/utils/util' import { sLoading, hLoading } from '@/utils/util'
import vkHeader from '@/components/header/index.vue' import headers from '@/components/header/index.vue'
import FormListItem from './component/FormListItem.vue'; import FormListItem from './components/FormListItem.vue';
const title = ref('') const title = ref('')
const store = useFormData() const store = useFormData()
......
<template> <template>
<vk-header :title="title" back-icon-name="nav-back" /> <vk-header :title="title" back-icon-name="nav-back" background="#3cbafd" />
<!-- <view style="display: flex;"> <!-- <view style="display: flex;"> -->
<button @tap="initSerialNumberData({ serialNumber: 'A031', curFormId: 'WMS_InStock' })">A3031</button> <!-- <button @tap="initSerialNumberData({ serialNumber: 'A043', curFormId: 'WMS_UpStock' })">A3031</button> -->
<button @tap="initSerialNumberData({ serialNumber: 'A033', curFormId: 'WMS_InStock' })">A3033</button> <!-- <button @tap="initSerialNumberData({ serialNumber: 'A033', curFormId: 'WMS_InStock' })">A3033</button>
<button @tap="initSerialNumberData({ serialNumber: 'A035', curFormId: 'WMS_InStock' })">A3035</button> <button @tap="initSerialNumberData({ serialNumber: 'A035', curFormId: 'WMS_InStock' })">A3035</button>
<button @tap="initSerialNumberData({ serialNumber: 'A037', curFormId: 'WMS_InStock' })">A3037</button> <button @tap="initSerialNumberData({ serialNumber: 'A037', curFormId: 'WMS_InStock' })">A3037</button> -->
</view> --> <!-- </view> -->
<view class="header"> <view class="header">
<view class="scan-input"> <view class="scan-input">
...@@ -89,10 +89,10 @@ ...@@ -89,10 +89,10 @@
<script setup lang="ts"> <script setup lang="ts">
import { nextTick, ref } from 'vue'; import { nextTick, ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
import { getMetadata, getDataBySerialNumber, createBusiness } from '@/api/apply'; import { getMetadata, getDataBySerialNumber, createBusiness, getAnalysis } from '@/api/apply';
import vkHeader from '@/components/header/index.vue'; import vkHeader from '@/components/header/index.vue';
import detailForm from './component/detailForm.vue'; import detailForm from './components/detailForm.vue';
import scanInput from './component/scanInput.vue'; import scanInput from './components/scanInput.vue';
const pageData = ref(); const pageData = ref();
const title = ref(); const title = ref();
...@@ -111,12 +111,35 @@ const list = ref([] as any); ...@@ -111,12 +111,35 @@ const list = ref([] as any);
const saveList = ref([] as any) const saveList = ref([] as any)
const handleInput = async (e: any) => { const handleInput = async (e: any) => {
console.log(e, 'e'); let barcodeList = uni.getStorageSync('barcodeList')
if (!barcodeList) {
barcodeList = []
const { data: res } = await getAnalysis({ billNo: e.split(',')[0] })
barcodeList.push({ list: res.data, number: e.split(',')[0] })
uni.setStorageSync('barcodeList', JSON.stringify(barcodeList));
} else {
barcodeList = JSON.parse(barcodeList)
if (!barcodeList.some((item: any) => item.number == e.split(',')[0])) {
const { data: res } = await getAnalysis({ billNo: e.split(',')[0] })
barcodeList.push({ list: res.data, number: e.split(',')[0] })
uni.setStorageSync('barcodeList', JSON.stringify(barcodeList));
}
}
// console.log(barcodeList, 'barcodeList');
let serialNumber = ''
barcodeList.map((item: any) => {
if (item.number == e.split(',')[0]) {
const index = item.list.filter((filt: any) => filt.field == 'FSerialID')[0]?.seq
if (index) serialNumber = e.split(',')[index]
}
})
nextTick(() => { nextTick(() => {
inputValue.value = e; inputValue.value = e;
}); });
const { permTag: curFormId } = JSON.parse(uni.getStorageSync('pageData')); const { permTag: curFormId } = JSON.parse(uni.getStorageSync('pageData'));
const data = { serialNumber: e, curFormId } let data = { serialNumber, curFormId }
initSerialNumberData(data) initSerialNumberData(data)
}; };
...@@ -210,6 +233,7 @@ const metadata = ref(); ...@@ -210,6 +233,7 @@ const metadata = ref();
const metadataList = ref([] as any); const metadataList = ref([] as any);
const initSerialNumberData = async (data: any) => { const initSerialNumberData = async (data: any) => {
console.log(data, 'sss');
// let data = { serialNumber: 'A031', curFormId: 'WMS_InStock' } // let data = { serialNumber: 'A031', curFormId: 'WMS_InStock' }
if (list.value.some((item: any) => item.serialNumber === data.serialNumber)) return uni.showToast({ if (list.value.some((item: any) => item.serialNumber === data.serialNumber)) return uni.showToast({
title: '已存在该扫描记录', title: '已存在该扫描记录',
......
<template> <template>
<headers title='WMS工作台' background="#3cbafd"/>
<block v-for="res in menuList" :key="res.path"> <block v-for="res in menuList" :key="res.path">
<view class="card" v-show="res.children?.length"> <view class="card" v-show="res.children?.length">
<h3 class="card-text">{{ res.title }}</h3> <h4 class="card-text">{{ res.title }}</h4>
<u-grid :col="4" :border="false"> <u-grid :col="4" :border="false">
<u-grid-item v-for="item in res.children" :custom-style="{ 'text-align': 'center' }" <u-grid-item v-for="item in res.children" :custom-style="{ 'text-align': 'center' }"
@tap="tapGridItem(item)"> @tap="tapGridItem(item)">
...@@ -14,8 +15,9 @@ ...@@ -14,8 +15,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref, onMounted } from 'vue';
import { getMenuTree } from '@/api/apply'; import { getMenuTree } from '@/api/apply';
import headers from '@/components/header/index.vue'
const menuList = ref(); const menuList = ref();
const tapGridItem = (row: any) => { const tapGridItem = (row: any) => {
...@@ -25,6 +27,7 @@ const tapGridItem = (row: any) => { ...@@ -25,6 +27,7 @@ const tapGridItem = (row: any) => {
}); });
}; };
// 过滤未发布的菜单 // 过滤未发布的菜单
const handleMenuTree = (list: any[]) => { const handleMenuTree = (list: any[]) => {
let newList: any[] = []; let newList: any[] = [];
...@@ -45,33 +48,11 @@ const init = async () => { ...@@ -45,33 +48,11 @@ const init = async () => {
menuList.value = handleMenuTree(res.data); menuList.value = handleMenuTree(res.data);
} }
}; };
init();
onMounted(() => {
init();
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.card {
box-sizing: border-box;
margin: 16rpx;
border-radius: 8rpx;
border: 1px solid #e4e7ed;
background-color: #ffffff;
overflow: hidden;
color: #303133;
transition: 0.3s;
box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.05);
.card-text {
padding: 20rpx;
}
.grid-text {
font-size: 28rpx;
margin-top: 4rpx;
color: #303133;
padding: 0 10rpx;
white-space: 'nowrap';
text-overflow: 'ellipsis';
overflow: 'hidden';
}
}
</style> </style>
...@@ -221,7 +221,7 @@ const getCharacteristics = async () => { ...@@ -221,7 +221,7 @@ const getCharacteristics = async () => {
// 遍历特征值列表,获取写、读、通知特征值ID和服务ID // 遍历特征值列表,获取写、读、通知特征值ID和服务ID
for (let i = 0; i < characteristics.length; i++) { for (let i = 0; i < characteristics.length; i++) {
const { uuid, properties } = characteristics[i]; const { uuid, properties } = characteristics[i];
console.log(uuid, properties, 'characteristics[i]'); // console.log(uuid, properties, 'characteristics[i]');
if (!notifyCharacter.value && properties.notify) { if (!notifyCharacter.value && properties.notify) {
blueTooth.BLEInformation.notifyCharaterId = uuid; blueTooth.BLEInformation.notifyCharaterId = uuid;
......
<template> <template>
<headers title='首页' background="#3cbafd" />
<view class="wrap"> <view class="wrap">
<u-swiper :list="list" :height="swiperHeight"></u-swiper> <u-swiper :list="list" :height="swiperHeight"></u-swiper>
</view> </view>
<u-button type="primary" @tap="toBlueTooth">连接蓝牙</u-button> <!-- <u-button type="primary" @tap="toBlueTooth">连接蓝牙</u-button> -->
<u-grid :col="4" :border="true">
<u-grid-item v-for="item in menuList" @tap="tapGridItem(item)">
<u-icon :name="item.icon" :size="46"></u-icon>
<view class="grid-text">{{ item.title }}</view>
</u-grid-item>
</u-grid>
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { getMenuTree } from '@/api/apply';
import headers from '@/components/header/index.vue'
const list = [{ const list = [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg', image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
...@@ -20,10 +29,35 @@ const list = [{ ...@@ -20,10 +29,35 @@ const list = [{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg', image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳' title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}] }]
const menuList = ref()
const toBlueTooth = () => uni.navigateTo({ url: '/pages/blueTooth/index' }) const toBlueTooth = () => uni.navigateTo({ url: '/pages/blueTooth/index' })
let swiperHeight = ref('250') let swiperHeight = ref('250')
const tapGridItem = (row: any) => {
console.log(row);
uni.setStorageSync('pageData', JSON.stringify(row));
uni.navigateTo({
url: '/pages/apply/formDetail'
});
};
// 过滤常用菜单
const handleMenuTree = (list: any[]) => {
let newList: any[] = [];
list.map((item: any) => {
item.children.map((item: any) => {
if (item.publish && item.often) {
newList.push(item);
}
})
});
return newList;
};
const init = async () => {
const { data: res } = await getMenuTree();
if (res.code === 200) {
menuList.value = handleMenuTree(res.data);
}
};
onMounted(() => { onMounted(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS
...@@ -33,6 +67,7 @@ onMounted(() => { ...@@ -33,6 +67,7 @@ onMounted(() => {
// #ifdef H5 // #ifdef H5
swiperHeight.value = '500' swiperHeight.value = '500'
// #endif // #endif
init();
}) })
</script> </script>
...@@ -41,4 +76,10 @@ onMounted(() => { ...@@ -41,4 +76,10 @@ onMounted(() => {
.wrap { .wrap {
margin-bottom: 20px; margin-bottom: 20px;
} }
.grid-text {
font-size: 28rpx;
margin-top: 4rpx;
color: #303133;
}
</style> </style>
\ No newline at end of file
...@@ -64,7 +64,7 @@ onMounted(() => loginFormRef.value?.setRules(loginFormRules)) ...@@ -64,7 +64,7 @@ onMounted(() => loginFormRef.value?.setRules(loginFormRules))
<style lang="scss" scoped> <style lang="scss" scoped>
.getCaptcha { .getCaptcha {
width: 400rpx; width: 500rpx;
background-color: rgb(253, 243, 208); background-color: rgb(253, 243, 208);
color: $u-tips-color; color: $u-tips-color;
border: none; border: none;
......
...@@ -23,8 +23,7 @@ import loginForm from './components/loginForm.vue'; ...@@ -23,8 +23,7 @@ import loginForm from './components/loginForm.vue';
.login-container { .login-container {
box-sizing: border-box; box-sizing: border-box;
margin: 20% auto 0; padding-top: 20%;
padding: 0 10%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
......
<template>
<u-popup v-model="props.show" mode="bottom" height="90%" @close="handleClose">
<view>出淤泥而不染,濯清涟而不妖</view>
</u-popup>
</template>
<script setup lang='ts'>
import { ref } from 'vue'
const props = defineProps({
show: {
type: Boolean,
default: false
},
list: {
type: Array,
default: []
}
})
const emits = defineEmits(['update:show'])
const handleClose = () => {
emits('update:show', false)
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template> <template>
<u-button type="primary" @click="logout">退出登录</u-button> <headers title='个人信息' background="#3cbafd" iconName="setting" :sheetList="menuList" />
<view class="logout">
<view class="card">
<u-cell-group :border="false">
<u-cell-item v-for="(item, index) in metaList" :key="item.key" icon="" :title="item.label"
:border-bottom="index === metaList.length - 1 ? false : true" />
</u-cell-group>
</view>
<u-button type="primary" @click="setUserInfo" size="mini">修改信息</u-button>
<u-button type="primary" @click="logout" size="mini">退出登录</u-button>
</view>
<setForm v-model:show="show" :list="metaList" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { onMounted, ref } from 'vue';
import { useGlobalStore } from '@/store/useStore'; import { useGlobalStore } from '@/store/useStore';
import { useUserParams } from '@/store/modules/userParameter';
import { getMetadata, getUserParameter } from '@/api/apply';
import setForm from './components/setForm.vue';
import headers from '../../components/header/index.vue'
const golbalStore = useGlobalStore() const golbalStore = useGlobalStore()
const userParams = useUserParams()
const metaList = ref([] as any[])
const menuList = ref()
const show = ref(false)
const setUserInfo = () => {
show.value = true
}
const logout = () => { const logout = () => {
uni.reLaunch({ uni.reLaunch({
...@@ -15,7 +39,45 @@ const logout = () => { ...@@ -15,7 +39,45 @@ const logout = () => {
} }
}) })
} }
const init = async () => {
const { data: res } = await getMetadata('BAS_UserParam')
if (res.code === 200) {
const list = JSON.parse(res.data.formJson).list.filter((item: any) => item.type === 'menu_bar')[0]
list.options.list.map((item: any) => item.text = item.label)
menuList.value = list.options.list
metaList.value = JSON.parse(res.data.formJson).list.filter((item: any) => item.type !== 'menu_bar')
userParams.setMetaList(JSON.parse(res.data.formJson))
console.log(menuList.value);
const { data: params } = await getUserParameter(JSON.parse(res.data.formJson).config.formId)
console.log(params);
}
}
onMounted(() => {
init()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.logout {
width: 100%;
text-align: center;
// padding: 20px 0;
display: flex;
flex-direction: column;
.u-btn {
width: 240rpx;
margin-bottom: 20rpx;
}
}
</style>
<style>
.u-status-bar {
height: var(--status-bar-height);
width: 100%;
}
</style> </style>
<template>
<headers :title='title' background="#3cbafd" back-icon-name="nav-back" />
<u-form label-width="180" style="padding: 20rpx;">
<block v-for="item in list">
<u-form-item v-if="item.type === 'input'" :label="item.label">
<u-input v-model="item.options.defaultValue" />
</u-form-item>
<u-form-item v-if="item.type === 'basic_data'" :label="item.label" @tap="handleSelect(item)">
{{ item.options.defaultValue ? item.options.defaultValue : '请选择' }}
<u-select v-model="item.show" :list="selectOptions" @confirm="onConfirm($event, item)" />
</u-form-item>
</block>
</u-form>
<u-button @tap="save" type="primary">{{ title }}</u-button>
</template>
<script setup lang='ts'>
import { onLoad } from '@dcloudio/uni-app';
import { computed, ref } from 'vue'
import { useUserParams } from '@/store/modules/userParameter';
import { saveUserParameter, getBusinessList } from '@/api/apply'
import headers from '@/components/header/index.vue'
const title = ref('')
const userParams = useUserParams()
const metaList: any = computed(() => userParams.metaDataGet)
const list = ref()
const selectOptions = ref([] as any[])
onLoad((options: any) => {
const data = JSON.parse(options.data)
title.value = data.label
list.value = metaList.value.list
})
const onConfirm = (e: any, row: any) => {
row.options.defaultValue = JSON.parse(JSON.stringify(e[0].value))
}
const handleSelect = (row: any) => {
if (row.options.filterCriteria) filterCriteria(row)
setTimeout(() => {
row.show = true
}, 100);
}
const filterCriteria = (element: any) => {
let params = JSON.parse(element.options.filterCriteria)
const obj = {
formId: element.options.remoteFunc,
filters: [params]
}
initStructureData(obj, element)
}
const initStructureData = async (obj: object, element: any) => {
const { data: res } = await getBusinessList(obj)
if (res.code === 200) {
let label: any = element.options.props.label;
let value: any = element.options.props.value;
selectOptions.value = []
res.data.dataList.map((item: any) => {
let labelStr = "";
if (item[label])
labelStr = item[label]
if (item[value])
if (item[label])
labelStr += " | " + item[value]
else labelStr = item[value]
let obj = { label: labelStr, value: item["id"] }
selectOptions.value.push(obj)
})
}
}
const save = async () => {
let list = {} as any
metaList.value.list.map((item: any) => {
if (item.type !== 'menu_bar') {
list[item.model] = item.options.defaultValue
}
})
let obj = {
formId: metaList.value.config.formId,
list
}
const { data: res } = await saveUserParameter(obj)
if (res.code === 200) {
uni.showToast({
title: title + '成功!',
icon: 'none'
})
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
.card {
box-sizing: border-box;
margin: 16rpx;
padding: 16rpx;
border-radius: 8rpx;
border: 1px solid #e4e7ed;
background-color: #ffffff;
overflow: hidden;
color: #303133;
transition: 0.3s;
box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.05);
.card-text {
padding: 20rpx;
}
.grid-text {
font-size: 28rpx;
margin-top: 4rpx;
color: #303133;
padding: 0 10rpx;
white-space: 'nowrap';
text-overflow: 'ellipsis';
overflow: 'hidden';
}
}
\ No newline at end of file
import { defineStore } from "pinia";
export const useUserParams = defineStore({
id: 'userParams',
state: () => ({
metaData: []
}),
getters: {
metaDataGet: (state) => state.metaData
},
actions: {
setMetaList(metaData: any) {
this.metaData = metaData
}
}
})
\ No newline at end of file
...@@ -7,15 +7,23 @@ export const useGlobalStore = defineStore({ ...@@ -7,15 +7,23 @@ export const useGlobalStore = defineStore({
state() { state() {
return { return {
token: '', token: '',
statusBarHeight: 0
} }
}, },
getters: { getters: {
}, },
actions: { actions: {
setToken(token: string) { setToken(token: string) {
this.token = token this.token = token
}, },
async setStatusBarHeight() {
let that = this
await uni.getSystemInfo({
success(res: any) {
that.statusBarHeight = res.statusBarHeight || 0;
}
});
}
}, },
persist: piniaPersistOption('globalStore') persist: piniaPersistOption('globalStore')
}) })
......
/**
* 根据system提取对应的formID
*/
\ No newline at end of file
...@@ -8,7 +8,6 @@ export const createNew = () => { ...@@ -8,7 +8,6 @@ export const createNew = () => {
jpPrinter.name = '蓝牙打印机' jpPrinter.name = '蓝牙打印机'
jpPrinter.init = function () { } jpPrinter.init = function () { }
jpPrinter.
jpPrinter.addCommand = function (content: any) { jpPrinter.addCommand = function (content: any) {
//将指令转成数组装起 //将指令转成数组装起
var code = new TextEncoder('gb18030', { var code = new TextEncoder('gb18030', {
......
...@@ -45,11 +45,11 @@ export default defineConfig({ ...@@ -45,11 +45,11 @@ export default defineConfig({
https: false, // 默认用http方式 https: false, // 默认用http方式
proxy: { proxy: {
'/lowcodeplatform-system': { '/lowcodeplatform-system': {
target: 'http://192.168.0.46', target: 'http://192.168.0.58',
// target: 'http://192.168.0.8', // target: 'http://192.168.0.8',
}, },
'/wms-system': { '/wms-system': {
target: 'http://192.168.0.46', target: 'http://192.168.0.58',
// target: 'http://192.168.0.8', // target: 'http://192.168.0.8',
}, },
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论