提交 c2a3aedb 作者: wk

应用迁移

父级 cf895e49
......@@ -245,6 +245,10 @@ const params = {
getObjList: {
url: "/plat/api/v1/common_check/check_object/obj_list",
method: "get"
},
getOrgTree: {
url: "/api/v1/org/node/get_org_tree",
method: "post"
}
}
......
......@@ -81,7 +81,7 @@
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue';
import OSSUtil from '../../common/oss/ossUtil.js';
import OSSUtil from "../../common/oss/ossUtil.js"
export default {
components: {
uniPopup
......@@ -281,7 +281,7 @@
},
videoItem: function(video) {
uni.navigateTo({
url: `../../pages/play-video-page/play-video-page?url=${video.url}`
url: `/pages/gallery/playVideo/playVideo?url=${video.url}`
})
},
uploadVideo: async function(video) {
......
......@@ -265,8 +265,7 @@
"path": "pages/gallery/nextProcessPage/nextProcessPage",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
"enablePullDownRefresh": false
}
}, {
......@@ -362,9 +361,72 @@
"navigationStyle": "custom"
}
}, {
"path": "pages/gallery/app/originalIndex/originalIndex",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/gallery/app/checkObjList/checkObjList",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/gallery/app/createCheck/createCheck",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/gallery/app/checkObjDetail/checkObjDetail",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/gallery/app/checkRecord/checkRecord",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/gallery/app/modeFormList/modeFormList",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/gallery/app/addBusinessData/addBusinessData",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/gallery/app/addForm/addForm",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/gallery/app/qrcodeList/qrcodeList",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/gallery/app/originalIndex/originalIndex",
"path" : "pages/gallery/app/modeList/modeList",
"style" :
{
"navigationBarTitleText": "",
......@@ -373,7 +435,7 @@
}
,{
"path" : "pages/gallery/app/checkObjList/checkObjList",
"path" : "pages/gallery/app/processFormDetail/processFormDetail",
"style" :
{
"navigationBarTitleText": "",
......@@ -382,7 +444,17 @@
}
,{
"path" : "pages/gallery/app/createCheck/createCheck",
"path" : "pages/mine/changeOrg/changeOrg",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
,{
"path" : "pages/gallery/app/editAloneForm/editAloneForm",
"style" :
{
"navigationBarTitleText": "",
......@@ -391,7 +463,7 @@
}
,{
"path" : "pages/gallery/app/checkObjDetail/checkObjDetail",
"path" : "pages/gallery/app/editRecordDetail/editRecordDetail",
"style" :
{
"navigationBarTitleText": "",
......@@ -400,7 +472,7 @@
}
,{
"path" : "pages/gallery/app/checkRecord/checkRecord",
"path" : "pages/gallery/app/selectUserPage/selectUserPage",
"style" :
{
"navigationBarTitleText": "",
......@@ -412,8 +484,8 @@
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#59A3FE",
"backgroundColor": "#59A3FE"
"navigationBarBackgroundColor": "#3B73FE",
"backgroundColor": "#3B73FE"
},
"uniIdRouter": {},
"tabBar": {
......
......@@ -149,5 +149,9 @@
justify-content: center;
align-items: center;
}
.content {
background-color: #fff;
}
}
</style>
......@@ -7,7 +7,8 @@
<view class="create-check-checker-title-sign" style="color: #FF0000;">*</view>
<view class="create-check-checker-title-desc"
style="font-size: 16px;color: #333333;margin-left: 10rpx;flex: 1;font-weight: bold;">记录对象</view>
<image src="../../static/icon_scan.png" style="width: 40rpx;height: 40rpx;" @click="clickScan">
<image src="../../../../static/icon_scan.png" style="width: 40rpx;height: 40rpx;"
@click="clickScan">
</image>
</view>
......@@ -17,7 +18,7 @@
<input placeholder="输入记录对象"
style="flex: 1;font-size: 14px;color: #333333;margin-left: 10px;" v-model="inputValue"
@click.stop="" />
<image src="../../static/icon_down_arrow.png"></image>
<image src="../../../../static/icon_down_arrow.png"></image>
</view>
</label>
</picker>
......@@ -42,7 +43,7 @@
</view>
</uni-grid-item>
<image style="width: 144rpx;height: 144rpx;margin: 20rpx;"
src="../../static/icon_take_photo.png" @click="selectImage(index)"></image>
src="../../../../static/icon_take_photo.png" @click="selectImage(index)"></image>
</uni-grid>
</view>
<!-- 弹窗选择单选 -->
......@@ -60,7 +61,7 @@
<view style="flex: 1;font-size: 14px;color: #333333;margin-left: 10px;">
{{item.current_value||""}}
</view>
<image src="../../static/icon_down_arrow.png"></image>
<image src="../../../../sstatic/icon_down_arrow.png"></image>
</view>
</label>
</picker>
......@@ -121,7 +122,7 @@
components: [],
inputValue: "",
checkItemId: "",
defaultUrl: "../../static/icon_take_photo.png",
defaultUrl: "../../../../static/icon_take_photo.png",
imageList: [],
windowHeight: "400px",
popupData: [],
......
<template>
<view style="display: flex;flex-direction: column;padding: 32rpx;background-color: #FFFFFF;">
<view v-for="(item,index) in mRecords" :key="index"
style="margin: 20rpx 0;display: flex;flex-direction: column;">
<text class="text-black-normal">{{item.user_name}}</text>
<text class="text-black-normal" style="margin-top: 20rpx;">{{item.edit_at}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
obj_no: "",
check_record_id: "",
mRecords: []
}
},
onLoad: function(options) {
this.obj_no = options.obj_no
console.log("检查对象编码", this.obj_no);
this.getFormDetail()
},
methods: {
getFormDetail: function() {
this.$http.get({
url: "/api/v1/common_check/check_record/form_detail_list",
data: {
"obj_no": this.obj_no
},
header: {
"access_token": this.getToken()
}
}).then((res) => {
let result = res.data
console.log("表单详情", result);
if (result.code == 0) {
this.check_record_id = result.data.list[0].check_record_id
uni.setNavigationBarTitle({
title: result.data.list[0].check_item_name
})
this.getRecordDetail()
} else {
this.showFail(result.msg)
}
})
},
getRecordDetail: function() {
this.$http.post({
url: "/api/v1/common_check/check_record/get_editors",
data: {
ids: [{
"id": this.check_record_id
}]
},
header: {
access_token: this.getToken()
}
}).then((res) => {
let result = res.data
console.log("修改人记录", result);
if (result.code == 0) {
this.mRecords = result.data[0].editors
} else {
this.$toast.showToast(result.msg)
}
})
}
}
}
</script>
<style>
</style>
<template>
<view style="margin-top: 32rpx;">
<view v-for="(item,index) in models" :key="index" class="model-item" @click="itemClick(index)">
<view class="model-item-title">
{{item.module_name}}
</view>
<image src="../../static/right-arrow-ic.png" style="width: 20rpx;height: 36rpx;"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
appId: "",
models: [],
appInfo: {}
}
},
onLoad(option) {
this.appId = option.check_tpl_id
uni.setNavigationBarTitle({
title: option.title
})
this.getModelList()
},
methods: {
getModelList() {
this.$http.get({
url: "/web/v1/common_check/check_tpl/tpl_detail",
data: {
"check_tpl_id": this.appId
},
header: {
"access_token": this.getToken()
}
}).then((res) => {
console.log("应用信息", res.data);
this.appInfo = res.data.data
this.models = res.data.data.tpl_config
})
},
itemClick(index) {
uni.navigateTo({
url: `/pages/gallery/app/modeFormList/modeFormList?business_type=${this.appInfo.business_type}&check_tpl_id=${this.appId}&check_module_id=${this.models[index].check_module_id}&title=${this.models[index].module_name}&is_edit=${this.models[index].is_edit}&showCfg=${JSON.stringify(this.models[index].show_cfg)}`
})
}
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
.model-item {
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
padding: 32rpx;
margin-bottom: 2rpx;
}
.model-item-title {
font-size: 32rpx;
color: #333333;
flex: 1;
}
</style>
<template>
<view style="margin-top: 32rpx;">
<view v-for="(item,index) in formList" :key="index" class="qrcode-item">
<view class="qrcode-item-title single-text">
{{item.show_obj_list[0].show_obj_name}}:{{item.show_obj_list[0].real_value}}
</view>
<view style="display: flex;flex-direction: row;align-items: center;" @click="showQrcode(index)">
<image src="../../static/qrcode-blue.png" style="width: 30rpx;height: 30rpx;"></image>
<view class="text-blue" style="margin-left: 20rpx;">查看</view>
</view>
</view>
<view class="model-view" :style="showModal?'':'display:none;'">
<view class="model-out-box">
<view class="text-black-normal">{{curTitle}}</view>
<view class="model-content">
<canvas canvas-id="qrcode" style="margin: 40rpx;"></canvas>
</view>
<view style="display: flex;flex-direction: row;width: 100%;">
<view class="btn-dialog-grey" @click="cancel">取消</view>
<view class="btn-dialog-blue" @click="saveQrcode">保存图片</view>
</view>
</view>
</view>
</view>
</template>
<script>
import uQRCode from "../../../../components/tki-qrcode/qrcode.js"
export default {
data() {
return {
projectId: "",
appId: "",
checkModuleId: "",
formList: [],
showModal: false,
curTitle: "",
curIndex: -1,
qrcodeSrc: "",
//分页属性
page: 1,
pageSize: 20,
isPage: 1,
totalPage: 1
}
},
onLoad: function(option) {
this.projectId = option.project_id
this.checkModuleId = option.check_module_id
this.appId = option.check_tpl_id
uni.setNavigationBarTitle({
title: option.title
})
this.getFormList()
},
onPullDownRefresh: function() {
this.page = 1
this.getFormList()
},
onReachBottom: function() {
if (this.page < this.totalPage) {
this.page++
this.getFormList()
}
},
methods: {
getFormList: function() {
this.$http.get({
url: "/api/v1/common_check/check_object/form_list",
data: {
"project_id": this.projectId,
"business_type": 2,
"check_tpl_id": this.appId,
"check_module_id": this.checkModuleId,
"is_page": this.isPage,
"page": this.page,
"page_size": this.pageSize,
},
header: {
"access_token": this.getToken()
}
}).then((res) => {
uni.stopPullDownRefresh()
console.log("表单列表", res.data.data);
this.formList = res.data.data.list
this.totalPage = res.data.data.total_page
})
},
showQrcode(index) {
this.curTitle = this.formList[index].show_obj_name
this.curIndex = index
this.showModal = true
this.$nextTick(function() {
this.cancvsQrcode(this.formList[index].obj_no)
})
},
cancvsQrcode(text) {
uQRCode.make({
canvasId: 'qrcode',
componentInstance: this,
text: text,
size: 160,
margin: 10,
backgroundColor: '#ffffff',
foregroundColor: '#000000',
fileType: 'jpg',
correctLevel: uQRCode.errorCorrectLevel.H,
success: res => {
console.log(res)
this.qrcodeSrc = res
},
fail: error => {
console.log(error)
}
})
},
cancel() {
this.curTitle = ""
this.curIndex = -1
this.showModal = false
},
saveQrcode() {
// #ifndef H5
this.save(this.qrcodeSrc)
// #endif
// #ifdef H5
let _t = this;
uni.downloadFile({
url: this.qrcodeSrc,
success: (res) => {
if (res.statusCode === 200) {
let file = res.tempFilePath;
_t.save(file)
}
}
});
// #endif
},
save(url) {
let _this = this;
uni.saveImageToPhotosAlbum({
filePath: url,
success: () => {
uni.hideLoading();
uni.showToast({
title: "图片已保存到相册"
});
},
fail: () => {
uni.hideLoading();
uni.showToast({
title: "图片保存失败"
});
}
});
}
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
.qrcode-item {
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
padding: 32rpx;
margin-bottom: 2rpx;
}
.qrcode-item-title {
font-size: 32rpx;
color: #333333;
flex: 1;
}
.model-view {
position: fixed;
top: 0;
z-index: 1;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
background-color: rgba(0, 0, 0, 0.4);
}
.model-out-box {
width: 600rpx;
height: 600rpx;
background-color: #FFFFFF;
border-radius: 20rpx;
margin-top: 45%;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 32rpx 0 0 0;
align-items: center;
}
.model-content {
width: 400rpx;
height: 400rpx;
border-radius: 10rpx;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.btn-dialog-grey {
display: flex;
flex: 1;
height: 100rpx;
font-size: 32rpx;
color: #333333;
align-items: center;
border-top: 2rpx solid rgba(0, 0, 0, 0.1);
border-right: 2rpx solid rgba(0, 0, 0, 0.1);
justify-content: center;
}
.btn-dialog-blue {
display: flex;
flex: 1;
height: 100rpx;
font-size: 32rpx;
color: #1890FF;
border-top: 2rpx solid rgba(0, 0, 0, 0.1);
align-items: center;
justify-content: center;
}
</style>
<template>
<view>
<view class="search-form-parent">
<view class="search-form">
<image src="../../static/search-icon.png" style="width: 40rpx;height: 40rpx;"></image>
<input placeholder="搜索人员" placeholder-class="search-placeholder" class="search-input" v-model="key"
@input="search" />
</view>
</view>
<view class="text-grey-black-normal"
style="align-items: center;display: flex;flex-direction: row;padding: 32rpx;">已选中{{selectIds.length}}
</view>
<view class="text-grey-black-normal"
style="align-items: center;display: flex;flex-direction: row;padding: 32rpx;" v-if="user_way==1">按岗位选择
</view>
<ly-tree :ready="ready" :treeData="treeData" nodeKey="unique_id" :props="options" :showCheckbox="ready"
:defaultCheckedKeys="selectPost" :checkOnClickNode="ready" :checkOnlyLeaf="ready"
@node-click="handleNodeClick" ref="LyTree" v-if="user_way==1">
</ly-tree>
<view class="text-grey-black-normal"
style="align-items: center;display: flex;flex-direction: row;padding: 32rpx;" v-if="user_way==1">按人员选择
</view>
<view style="display: flex;padding: 32rpx;background-color: #FFFFFF;flex-direction: column;">
<view v-for="(user,index) in users" :key="index">
<view class="select-user-item" @click="itemClick(index)">
<view class="user-item" v-if="isSpecial()">
{{user.user_group_name}}
</view>
<view class="user-item" v-else>{{user.user_name}}({{user.job_name||""}})</view>
<image
:src="selectIds.indexOf(user.user_id)!=-1?'../../static/cb-big-sel.png':'../../static/cb-big.png'"
style="width: 48rpx;height: 48rpx;"></image>
</view>
</view>
</view>
<view style="height:150rpx;"></view>
<view class="uni-group-button">
<button class="uni-blue-button" @click="toSubmit">确认</button>
</view>
</view>
</template>
<script>
import LyTree from '@/components/ly-tree/ly-tree.vue'
export default {
components: {
LyTree
},
data() {
return {
user_way: 2, //2按项目 1 按公司 3按班组选
total: 0,
users: [],
projectId: "",
companyId: uni.getStorageSync("user_info").comp_id,
selected: [],
selectIds: [], //标记选中
selectPost: [], //记录选中的岗位id
type: 1,
key: "",
index: -1,
treeData: [],
ready: false,
options: {
// 这里的label就可以使用函数进行自定义的渲染了
label: 'name',
children: 'children_list', // 指把数据中的‘childs’当做children当做子节点数据
id: 'id'
},
nodes: {
label: 'group_name',
children: 'children_list', // 指把数据中的‘childs’当做children当做子节点数据
id: 'group_id'
}
}
},
onLoad: function(option) {
this.user_way = option.user_way
this.selectPost = JSON.parse(option.selectPost)
this.selected = JSON.parse(option.selected)
this.projectId = option.project_id
console.log("选中人员", this.selected);
this.type = option.type
//控件时候需要
this.index = option.index
if (this.selected && this.selected.length > 0) {
for (var i = 0; i < this.selected.length; i++) {
if (this.selectIds.indexOf(this.selected[i].user_id) == -1) {
this.selectIds.push(this.selected[i].user_id)
}
}
}
},
onShow: function() {
if (this.user_way == 1) {
this.getObsTree()
//获取公司人员
this.getCompanyUserList()
} else {
if ("焊口检查" == uni.getStorageSync("business_name")) {
this.getGroupUser()
} else {
this.getUserList()
}
}
},
methods: {
isSpecial: function() {
return '焊口检查' == uni.getStorageSync("business_name")
},
getGroupUser: function() {
this.$http.consoleGet({
url: "/intecons/api/v1/weld/middle_user/box_list",
data: {
"group_id": uni.getStorageSync("group_id"),
"project_id": this.projectId
},
header: {
"access_token": this.getToken()
}
}).then((res) => {
console.log("人员列表", res.data.data);
this.users = res.data.data.list
})
},
handleNodeClick: function(e) {
console.log(e);
if (e.checked) {
this.selectPost.push(e.key)
//确定的时候获取岗位下的人
this.getJobUser(e, 1)
} else {
let index = this.selectPost.indexOf(e.key)
if (index != -1) {
this.selectPost.splice(index, 1)
//删除选中
this.getJobUser(e, 2)
}
}
},
getNodeType: function(unique_id) {
if (unique_id.indexOf('-') != -1) {
let array = unique_id.split("-")
return array[1]
}
return unique_id
},
getJobUser: function(e, type) {
this.$http.consoleGet({
url: "/adminc/v1/organization_manage/p_job_user/get_job_user_list",
data: {
"company_id": this.companyId,
"node_type": 3,
"job_id": this.getNodeType(e.key),
"is_page": 0
},
header: {
"access_token": this.getToken()
}
}).then((res) => {
console.log("岗位人员", res.data.data);
let users = res.data.data.list
if (users && users.length > 0) {
if (type == 1) {
for (var i = 0; i < users.length; i++) {
let index = this.selectIds.indexOf(users[i].user_id)
if (index == -1) {
this.selectIds.push(users[i].user_id)
}
}
} else {
let indexs = []
for (var i = 0; i < users.length; i++) {
let index = this.selectIds.indexOf(users[i].user_id)
if (index != -1) {
this.selectIds.splice(index, 1)
}
}
}
} else {
uni.showToast({
title: "该岗位下没有人员",
icon: "none"
})
}
})
},
getCompanyUserList: function() {
this.$http.consolePost({
url: "/api/v1/user/user/get_dept_job_user_list_by_ids",
data: {
"ids": this.companyId,
"type": 4,
"is_page": 0
},
header: {
"access_token": this.getToken()
}
}).then((res) => {
console.log("公司人员列表", res.data.data);
this.users = res.data.data.list
// this.isSelected()
})
},
getObsTree: function() {
this.$http.consoleGet({
url: "/adminc/v1/organization_manage/o_org/get_obs_tree",
data: {
"company_id": this.companyId,
},
header: {
"access_token": this.getToken()
}
}).then((res) => {
console.log("岗位树形", res.data.data);
this.treeData = res.data.data
this.ready = true;
})
},
search: function(e) {
this.getUserList()
},
isSelected: function() {
if (this.users && this.users.length > 0) {
for (var i = 0; i < this.users.length; i++) {
let user = this.users[i]
let checked = false
for (var i = 0; i < this.selected.length; i++) {
if (this.selected[i].user_id == user.user_id) {
checked = true
}
}
user.checked = checked
this.$set(this.users, i, user)
}
}
},
getUserList: function() {
this.$http.get({
url: "/api/v1/project/project_user_list",
data: {
"project_id": this.projectId,
"user_name": this.key
},
header: {
"access_token": this.getToken()
}
}).then((res) => {
console.log("人员列表", res.data.data);
this.users = res.data.data.list
})
},
itemClick: function(index) {
let user = this.users[index]
let keyIndex = this.selectIds.indexOf(user.user_id)
if (keyIndex != -1) {
this.selectIds.splice(keyIndex, 1)
} else {
this.selectIds.push(user.user_id)
}
if (user.checked) {
this.selectIds.splice()
user.checked = false
this.total--
} else {
user.checked = true
this.total++
}
this.$set(this.users, index, user)
},
toSubmit: function() {
this.selected = []
for (var i = 0; i < this.users.length; i++) {
let user = this.users[i]
if (this.selectIds.indexOf(user.user_id) != -1) {
let checked = false
for (var j = 0; j < this.selected.length; j++) {
if (this.selected[j].user_id == user.user_id) {
checked = true
}
}
if (!checked) {
this.selected.push(user)
}
}
}
console.log(this.selected);
uni.$emit("selectUser", {
type: this.type,
index: this.index,
selected: this.selected,
selectPost: this.selectPost
})
uni.navigateBack({
delta: 1
})
}
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
.select-user-parent {
display: flex;
margin-top: 32rpx;
padding: 32rpx;
flex-direction: column;
background-color: #FFFFFF;
}
.select-user-item {
display: flex;
flex-direction: row;
padding: 20rpx 0;
align-items: center;
}
.user-item {
font-size: 28rpx;
color: #333333;
flex: 1;
}
.uni-group-button {
display: flex;
flex-direction: row;
border-top: 2rpx solid rgba(0, 0, 0, 0.1);
padding: 0px 32rpx;
height: 144rpx;
background-color: #FFFFFF;
align-items: center;
position: fixed;
z-index: 998;
right: 0;
left: 0;
bottom: 0;
}
</style>
......@@ -118,11 +118,11 @@
})
} else if (result.data.business_type ==
2) { //独立模式 需要获取模块数量 如果只有一个模块 自动跳转表单页面 "体验嘛 呵呵"
that.toAlone(model, result.data)
this.toAlone(model, result.data)
} else if (result.data.business_type == 3 || result.data.business_type == 4) { //流程模式
this.models = result.data.tpl_config
uni.navigateTo({
url: `../model-form-list-page/model-form-list-page?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}`
url: `/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}`
})
} else if (result.data.business_type == 5) {
this.currentModel = result.data.tpl_config[0]
......@@ -130,7 +130,7 @@
this.$refs.bottomDialog.handleShow()
} else { //之前的默认
uni.navigateTo({
url: `../index/index?check_tpl_id=${model.source_id}&title=${result.data.tpl_name}`
url: `/pages/gallery/app/originalIndex/originalIndex?check_tpl_id=${model.source_id}&title=${result.data.tpl_name}`
})
}
} else {
......@@ -138,6 +138,19 @@
}
})
},
toAlone(model, info) {
this.models = info.tpl_config
if (this.models.length == 1) {
let is_model_edit = this.models[0].is_edit
uni.navigateTo({
url: `/pages/gallery/app/modeFormList/modeFormList?business_type=2&check_tpl_id=${model.source_id}&check_module_id=${this.models[0].check_module_id}&title=${this.models[0].module_name}&is_edit=${is_model_edit}&showCfg=${JSON.stringify(this.models[0].show_cfg)}`
})
} else {
uni.navigateTo({
url: `/pages/gallery/app/modeList/modeList?check_tpl_id=${model.source_id}&title=${info.tpl_name}`
})
}
},
tabChange(e) {
this.current = e
},
......
......@@ -450,7 +450,7 @@
if (audio.icon) {
return audio.icon
} else {
return "../../static/record-ic.png"
return "../../../static/record-ic.png"
}
},
playAudio: function(audio, k, index, m) {
......
......@@ -13,25 +13,30 @@
<view class="app-list">
<view class="menu-item" v-for="(item,index) in selList" :key="index">
<view class="logo-content">
<image src="../../../static/ic-sjzg.png" class="logo"></image>
<image
:src="'https://release-console.oss-cn-hangzhou.aliyuncs.com/intecons/uniimage/'+item.logo+'.png'"
class="logo"></image>
<image src="../../../static/delete-ic.png" class="del" @click="toDel(index)"></image>
</view>
<view class="text">积分商城</view>
<view class="text">{{nameLengthDeal(item.app_name)}}</view>
</view>
</view>
</view>
</view>
<v-tabs :tabs="tabs" :scroll="true" :value="current" @change="tabChange"></v-tabs>
<view class="app-list-content">
<view class="app-content" v-for="(item,index) in appList">
<view class="app-content" v-for="(item,index) in apps[current].list">
<view class="title">便捷服务</view>
<view class="app-list">
<view class="menu-item" v-for="(app,appIndex) in selList" :key="appIndex">
<view class="menu-item" v-for="(app,appIndex) in item.data" :key="appIndex">
<view class="logo-content">
<image src="../../../static/ic-sjzg.png" class="logo"></image>
<image src="../../../static/add-ic.png" class="del" @click="toAdd(item)"></image>
<image
:src="'https://release-console.oss-cn-hangzhou.aliyuncs.com/intecons/uniimage/'+app.logo+'.png'"
class="logo"></image>
<image src="../../../static/add-ic.png" class="del" @click="toAdd(app,index,appIndex)">
</image>
</view>
<view class="text">积分商城</view>
<view class="text">{{nameLengthDeal(app.app_name)}}</view>
</view>
</view>
</view>
......@@ -41,20 +46,39 @@
<script>
import Api from "../../../api/api.js"
import StringUtils from "../../../common/stringUtils.js"
export default {
data() {
return {
selList: [{}],
appList: [{}],
groups: [],
appList: [], //过滤已选中
apps: [{
app_menu: 1,
list: []
}, {
app_menu: 2,
list: []
}, {
app_menu: 3,
list: []
}],
current: 0,
tabs: ["生活服务", "综合办公", "岗位工作"],
groups: []
requestParam: {
page: 1,
per_page: 500,
authed: 1,
showed: 1,
app_endpoint: 2,
is_publish: 1,
app_sort: 1
},
}
},
onLoad() {
//获取当前设置常用应用
this.getDefaultApp()
//获取所有的应用
},
methods: {
tabChange(e) {
......@@ -67,10 +91,12 @@
} else {
this.$toast.showToast(result.msg)
}
//获取所有的应用
this.getAppGroup()
})
},
sureConfig() {
if (thsi.selList.length == 0) {
if (this.selList.length == 0) {
this.$toast.showToast("请设置常用应用")
return
}
......@@ -94,15 +120,18 @@
}
})
},
toAdd(item) {
toAdd(item, index, appIndex) {
if (this.selList.length == 4) {
this.$toast.showToast("常用应用最多设置4个")
} else {
item.ydt_logo = item.logo
this.selList.push(item)
this.apps[this.current].list[index].data.splice(appIndex, 1)
}
},
toDel(index) {
this.selList.splice(index, 1)
this.getAppGroup()
},
toDef() {
this.getDefaultApp()
......@@ -113,6 +142,7 @@
"code_type": "applicationGroup"
}
}).then((result) => {
console.log("应用分组", result);
if (result.code == 0) {
let list = result.data[0].sub_data
this.groups = []
......@@ -138,31 +168,40 @@
})
},
getAppList: function() {
let that = this
Api.getAppList({
data: this.requestParam
data: this.requestParam,
header: {
'access_token': uni.getStorageSync('token') || ''
}
}).then((result) => {
if (result.code === 0) {
let list = result.data.list
that.apps = that.sortGroup(list)
console.log(that.apps);
if (that.groups.length > 0) {
for (var i = 0; i < that.apps.length; i++) {
for (var j = 0; j < that.groups.length; j++) {
if (that.groups[j].key == that.apps[i].app_group) {
that.apps[i].group_name = that.groups[j].val
list.forEach((item, index) => {
this.selList.forEach((sel) => {
if (item.app_id == sel.app_id) {
list.splice(index, 1)
}
})
})
//先根据菜单分组
this.apps = this.menuSort(list)
//再根据类型分组
this.apps.forEach((item) => {
item.list = this.sortGroup(item.list)
if (this.groups.length > 0) {
for (var i = 0; i < item.list.length; i++) {
for (var j = 0; j < this.groups.length; j++) {
if (this.groups[j].key == item.list[i].app_group) {
item.list[i].group_name = this.groups[j].val
}
}
}
}
})
console.log("应用分组之后", this.apps);
} else {
if (result.code === -1) {
this.$toast.showToast(result.msg)
if (result.action === 'Laravel_public_permission_fail') {
that.refreshToken()
}
}
}
})
},
......@@ -174,7 +213,8 @@
if (!map[app.app_group]) {
dest.push({
app_group: app.app_group,
data: [app]
data: [app],
app
});
map[app.app_group] = app;
} else {
......@@ -189,6 +229,32 @@
}
return dest
},
menuSort(arr) {
var map = {},
dest = [];
for (var i = 0; i < arr.length; i++) {
var app = arr[i];
if (!map[app.app_menu]) {
dest.push({
app_menu: app.app_menu,
list: [app]
});
map[app.app_menu] = app;
} else {
for (var j = 0; j < dest.length; j++) {
var dj = dest[j];
if (dj.app_menu == app.app_menu) {
dj.list.push(app);
break;
}
}
}
}
return dest
},
nameLengthDeal(name) {
return StringUtils.stringLength(name, 4)
}
}
}
</script>
......
......@@ -53,7 +53,8 @@
<view :class="isLineVisil(index)?'app-name-left':'app-name-right'">
{{nameLengthDeal(app.app_name)}}
</view>
<image class="app-logo" src="../../static/ic-score-logo.png"></image>
<image class="app-logo" src="../../static/ic-score-logo.png">
</image>
<view class="line" v-if="isLineVisil(index)"></view>
</view>
</uni-grid-item>
......
<template>
<view class="content">
<titleBar title="切换组织"></titleBar>
</view>
</template>
<script>
import Api from "../../../api/api.js"
export default {
data() {
return {
}
},
onLoad() {
this.getOrgTree()
},
methods: {
getOrgTree() {
Api.getOrgTree().then((result) => {
console.log("组织树", result);
})
}
}
}
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
}
</style>
......@@ -40,7 +40,7 @@
<view class="version-content">
<text class="text">当前版本:v1.0.0</text>
</view>
<view class="btn-org">
<view class="btn-org" @click="linkTo('/pages/mine/changeOrg/changeOrg')">
<text class="text">切换组织</text>
</view>
<view class="btn-logout" @click="toLinkLogin">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment