Z vor 1 Jahr
Ursprung
Commit
ad0baa765c

+ 12 - 0
api/common.js

@@ -78,3 +78,15 @@ export async function listAllUserBind() {
 	}
 	return Promise.reject(new Error(res.message))
 }
+/**
+ * 获取部门所有父级
+ *
+ */
+export async function getParentIdListByDeptId(id) {
+	const res = await get(Vue.prototype.apiUrl + `/main/group/getParentIdListById/${id}`)
+
+	if (res.code == 0) {
+		return res.data
+	}
+	return Promise.reject(new Error(res.message))
+}

+ 11 - 2
hybrid/html/a.html

@@ -14,12 +14,18 @@
 				--van-nav-bar-title-text-color: rgb(255, 255, 255);
 				--van-nav-bar-icon-color: rgb(255, 255, 255);
 			}
+			:root#app{
+			   background: #4298fd0d;
+			}
+		::v-deep.fm-form-item{
+			     magin-bottom:10px .!important;
+			}
 		</style>
 		<div id="app">
 			<van-nav-bar height='100rpx' @click-left="onClickLeft"
 				style="background-color: rgb(21, 122, 44);color: rgb(255, 255, 255);" :title="title" left-arrow
 				:safe-area-inset-top='true' :placeholder='true' :fixed='true'></van-nav-bar>
-			<fm-generate-vant-form style='height: 75vh !important;overflow: auto;' v-if='isFlag' :data="jsonData"
+			<fm-generate-vant-form style='height: 81vh !important;overflow: auto;background: #a3a6ad1c;' v-if='isFlag' :data="jsonData"
 				:value="form.valueJson" ref="generateForm" :edit='isEdit'>
 			</fm-generate-vant-form>
 			<div>
@@ -94,8 +100,11 @@
 								}
 								if (item.type == "deptCascader") {
 									item.type = 'cascader'
+									/* item.isPathValue = false */
 									if (item.options.isDefaultLoginUser) {
-										this.form.valueJson[item.model] = [params.userInfo.groupId];
+										/* this.form.valueJson[item.model] = [1,1765997946953797633]; */
+										this.form.valueJson[item.model] = params.userInfo.groupIdList;
+									
 									}
 
 								}

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
hybrid/html/vue-form-making/index.css


+ 11 - 3
pages/home/wt/components/formParser/routerView.vue

@@ -5,6 +5,9 @@
 </template>
 
 <script>
+	import {
+		getParentIdListByDeptId
+	} from '@/api/common.js'
 	export default{
 		data(){
 			return{
@@ -12,11 +15,10 @@
 				webViewUrl:''
 			}
 		},
-		onLoad(option = {}) {
+		async onLoad(option = {}) {
 			let headers = {};
 			const value = uni.getStorageSync("token"); //取存本地的token
 			const apiInfo = uni.getStorageSync("apiInfo"); //取存本地的token
-			console.log(apiInfo,'=====')
 			  headers = {
 			    "content-type": "application/json",
 			    "zoomwin-token": value,
@@ -25,10 +27,16 @@
 				serverInfo : apiInfo.protocal? apiInfo.protocal+ apiInfo.hostname+':'+apiInfo.port+'/api' :'',
 			  };
 			  //http://192.168.1.105:18086
-		  setTimeout(()=>{
 			  const params =  JSON.parse(option.params)
 			  params.userInfo = uni.getStorageSync("userInfo")
 			  let html = params.type =='add'? 'a.html':'c.html'
+			  try{
+				   params.userInfo.groupIdList = await getParentIdListByDeptId(params.userInfo.groupId)
+			  }catch{
+				  params.userInfo.groupIdList = []
+			  }
+			   console.log(params.userInfo.groupIdList)
+		  setTimeout(()=>{
 			  this.webViewUrl = `/hybrid/html/${html}?params=${JSON.stringify(params)}&headers=${JSON.stringify(headers)}`
 			  this.isShow = true
 		  })

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.