flx:新增头部返回指定路由

This commit is contained in:
Rain_ 2025-04-11 14:22:37 +08:00
parent 7cdec9c568
commit 11a9766ad6
5 changed files with 186 additions and 158 deletions

View File

@ -20,9 +20,16 @@ export default {
// console.log(JSON.stringify(arg), ""); // console.log(JSON.stringify(arg), "");
if (arg.data.page) { if (arg.data.page) {
if(arg.data.current) {
uni.reLaunch({ uni.reLaunch({
url: arg.data.page + "?current=" + arg.data.current, url: arg.data.page + "?current=" + arg.data.current,
}); });
} else {
uni.reLaunch({
url: arg.data.page,
});
}
} else { } else {
uni.reLaunch({ uni.reLaunch({
url: "/pages/submit/submit", url: "/pages/submit/submit",

View File

@ -5,7 +5,10 @@
<text class="w-click-input-value">{{_value}}</text> <text class="w-click-input-value">{{_value}}</text>
</slot> </slot>
<text v-else style="color: #999;" class="w-click-input-value">{{props.placeholder}}</text> <text v-else style="color: #999;" class="w-click-input-value">{{props.placeholder}}</text>
<uni-icons v-show="!disabled" v-if="!props.readonly" type="right" :size="20" color="#999"></uni-icons> <label v-if="isColse && !props.readonly" @click.stop="onClose">
<uni-icons v-show="!disabled" type="close" :size="20" color="#999"></uni-icons>
</label>
<uni-icons v-show="!disabled" v-if="!props.readonly && !isColse" type="right" :size="20" color="#999"></uni-icons>
</view> </view>
</template> </template>
@ -29,7 +32,11 @@
// //
valueFunc: Function, valueFunc: Function,
placeholder: String, placeholder: String,
disabled: Boolean disabled: Boolean,
isColse: {
type: Boolean,
default: false
},
}) })
const showVal = computed(() => { const showVal = computed(() => {
@ -54,7 +61,9 @@
}) })
const emits = defineEmits(['update:modelValue']) const emits = defineEmits(['update:modelValue'])
const onClose = () => {
emits('customEvent')
}
</script> </script>

View File

@ -23,7 +23,7 @@
<uni-search-bar v-if="isSearch" bgColor="#fff" v-model="searchValue" class="search" radius="5" <uni-search-bar v-if="isSearch" bgColor="#fff" v-model="searchValue" class="search" radius="5"
placeholder="请输入" clearButton="auto" cancelButton="none" @input="searchChange" /> placeholder="请输入" clearButton="auto" cancelButton="none" @input="searchChange" />
<click-input @click="isSearchFn()" :value="(modelValue || []).length > 0 ? dataOptions[index]:null" <click-input :isColse="true" @click="isSearchFn()" @customEvent="customEventClear" :value="(modelValue || []).length > 0 ? dataOptions[index]:null"
index="name" :placeholder="formProps.placeholder || '请选择'" /> index="name" :placeholder="formProps.placeholder || '请选择'" />
<!-- <van-pagination v-model="pageInfo.pageNo" :total-items="Number(pageInfo.total)" :items-per-page="pageInfo.pageSize" @change="pagechange" /> --> <!-- <van-pagination v-model="pageInfo.pageNo" :total-items="Number(pageInfo.total)" :items-per-page="pageInfo.pageSize" @change="pagechange" /> -->
</picker> </picker>
@ -191,6 +191,11 @@
const onCancel = () => { const onCancel = () => {
isSearch.value = false; isSearch.value = false;
} }
const customEventClear = (e) => {
console.log('关闭',e)
index.value = "";
__value.value = "";
}
const isSearchFn = () => { const isSearchFn = () => {
//.boxclassbox使id= 'box' 使'#box' //.boxclassbox使id= 'box' 使'#box'
// uni.createSelectorQuery().in(this).select('.picker').boundingClientRect(data => { // uni.createSelectorQuery().in(this).select('.picker').boundingClientRect(data => {

View File

@ -86,28 +86,35 @@
const arrListCode = [{ const arrListCode = [{
code: 'wf66f6451c48b718d0aaf27522', code: 'wf66f6451c48b718d0aaf27522',
name: '安全检查', name: '安全检查',
path: '/pages/projectEnd/safeSame/index' path: '/pages/projectEnd/safeSame/index',
routePath: '/pages/projectEnd/safeSame/list'
}, { }, {
code: "wf67072b923afc947a1a819313", code: "wf67072b923afc947a1a819313",
name: '质量检查', name: '质量检查',
path: '/pages/projectEnd/qualityManage/index' path: '/pages/projectEnd/qualityManage/index',
routePath: '/pages/projectEnd/qualityManage/list'
},{ },{
code: "wf670a4a6c2384bf3e58f62681", code: "wf670a4a6c2384bf3e58f62681",
name: '质量监督', name: '质量监督',
path: '/pages/projectEnd/qualitySurveillance/index' path: '/pages/projectEnd/qualitySurveillance/index',
routePath: '/pages/projectEnd/qualitySurveillance/list'
},{ },{
code: "wf670735f73afc947a1a819314", code: "wf670735f73afc947a1a819314",
name: '文明施工', name: '文明施工',
path: '/pages/projectEnd/civilConstruction/constructionProblemRecord/index' path: '/pages/projectEnd/civilConstruction/constructionProblemRecord/index',
routePath: '/pages/projectEnd/civilConstruction/constructionProblemRecord/list'
}] }]
let pathUrl = "/pages/projectEnd/projectIndex/projectIndex"; let pathUrl = "/pages/projectEnd/projectIndex/projectIndex";
console.log('pages', pages) console.log('pages', pages)
const find = arrListCode.find(item => pages[0].options.code && pages[0].options.code.includes(item.code)); console.log('prevPage',pages, pages[0].options.code)
// console.log('prevPage',pages, pages[0].options.code) // routeName
const find = arrListCode.find(item => pages[0].options.code && pages[0].options.code.includes(item.code) || pages[0].options.routeName && pages[0].options.routeName.includes(item.name));
if(find) { if(find) {
pathUrl = find.path; pathUrl = pages[0].options.code ? find.path : find.routePath;
} }
console.log('pathUrl', pathUrl) console.log('pathUrl', pathUrl)
if(window.plus) { if(window.plus) {
webUni.webView.postMessage({ webUni.webView.postMessage({

View File

@ -190,7 +190,7 @@ export function getFormValText(obj) {
} }
export function showItem(item, val) { export function showItem(item, val) {
return !(item.perm === 'R' && isEm(val)) || item.perm === 'H' return !(item.perm === 'R' && isEm(val)) && item.perm !== 'H'
} }
function isEm(val) { function isEm(val) {