flx:新增头部返回指定路由
This commit is contained in:
parent
7cdec9c568
commit
11a9766ad6
7
App.vue
7
App.vue
@ -20,9 +20,16 @@ export default {
|
||||
|
||||
// console.log(JSON.stringify(arg), "登录用户");
|
||||
if (arg.data.page) {
|
||||
if(arg.data.current) {
|
||||
uni.reLaunch({
|
||||
url: arg.data.page + "?current=" + arg.data.current,
|
||||
});
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: arg.data.page,
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: "/pages/submit/submit",
|
||||
|
||||
@ -5,7 +5,10 @@
|
||||
<text class="w-click-input-value">{{_value}}</text>
|
||||
</slot>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
@ -29,7 +32,11 @@
|
||||
//自定义取名函数
|
||||
valueFunc: Function,
|
||||
placeholder: String,
|
||||
disabled: Boolean
|
||||
disabled: Boolean,
|
||||
isColse: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
})
|
||||
|
||||
const showVal = computed(() => {
|
||||
@ -54,7 +61,9 @@
|
||||
})
|
||||
|
||||
const emits = defineEmits(['update:modelValue'])
|
||||
|
||||
const onClose = () => {
|
||||
emits('customEvent')
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
<uni-search-bar v-if="isSearch" bgColor="#fff" v-model="searchValue" class="search" radius="5"
|
||||
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 || '请选择'" />
|
||||
<!-- <van-pagination v-model="pageInfo.pageNo" :total-items="Number(pageInfo.total)" :items-per-page="pageInfo.pageSize" @change="pagechange" /> -->
|
||||
</picker>
|
||||
@ -191,6 +191,11 @@
|
||||
const onCancel = () => {
|
||||
isSearch.value = false;
|
||||
}
|
||||
const customEventClear = (e) => {
|
||||
console.log('关闭',e)
|
||||
index.value = "";
|
||||
__value.value = "";
|
||||
}
|
||||
const isSearchFn = () => {
|
||||
//.box获取class为box的元素,如果使用的id= 'box' 则使用'#box'
|
||||
// uni.createSelectorQuery().in(this).select('.picker').boundingClientRect(data => {
|
||||
|
||||
@ -86,28 +86,35 @@
|
||||
const arrListCode = [{
|
||||
code: 'wf66f6451c48b718d0aaf27522',
|
||||
name: '安全检查',
|
||||
path: '/pages/projectEnd/safeSame/index'
|
||||
path: '/pages/projectEnd/safeSame/index',
|
||||
routePath: '/pages/projectEnd/safeSame/list'
|
||||
}, {
|
||||
code: "wf67072b923afc947a1a819313",
|
||||
name: '质量检查',
|
||||
path: '/pages/projectEnd/qualityManage/index'
|
||||
path: '/pages/projectEnd/qualityManage/index',
|
||||
routePath: '/pages/projectEnd/qualityManage/list'
|
||||
},{
|
||||
code: "wf670a4a6c2384bf3e58f62681",
|
||||
name: '质量监督',
|
||||
path: '/pages/projectEnd/qualitySurveillance/index'
|
||||
path: '/pages/projectEnd/qualitySurveillance/index',
|
||||
routePath: '/pages/projectEnd/qualitySurveillance/list'
|
||||
},{
|
||||
code: "wf670735f73afc947a1a819314",
|
||||
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";
|
||||
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) {
|
||||
pathUrl = find.path;
|
||||
pathUrl = pages[0].options.code ? find.path : find.routePath;
|
||||
}
|
||||
|
||||
console.log('pathUrl', pathUrl)
|
||||
if(window.plus) {
|
||||
webUni.webView.postMessage({
|
||||
|
||||
@ -190,7 +190,7 @@ export function getFormValText(obj) {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user