产品库工程目录调整

This commit is contained in:
aixianling
2021-11-17 17:13:52 +08:00
parent 9ebcd19f0a
commit eea22bacc7
6 changed files with 37 additions and 35 deletions

View File

@@ -1,225 +0,0 @@
<template>
<div class="AppInterview">
<ai-top-fixed>
<div flex>
<ai-date placeholder="日期选择" mode="range" @change="handleDateSearch"/>
<u-search placeholder="请输入标题" :show-action="false" v-model="search.title" @search="current=1,getList()"/>
</div>
</ai-top-fixed>
<template v-if="list.length>0">
<ai-card v-for="(e,index) in list" :key="index" @click.native="goDetail(e.id,1)">
<template #custom>
<div flex>
<b class="fill">{{ e.title }}</b>
</div>
<div flex v-if="!!e.fileList" class="wrap">
<ai-image v-for="(op,i) in e.fileList.slice(0,3)" :src="op.accessUrl" preview :key="i"/>
</div>
<div class="bottom">{{ e.createTime }}</div>
</template>
<template #menu>
<div class="menu" @tap.stop="goDetail(e.id)">编辑</div>
<div class="menu" @tap.stop="handleDelete(e.id)">删除</div>
</template>
</ai-card>
<u-loadmore :status="loadmore" color="#999" font-size="24"
margin-top="32" margin-bottom="80"/>
</template>
<div class="no-message" v-else>
<image src="https://cdn.cunwuyun.cn/wxAdmin/img/message.png"/>
<p>您还未添加过入户调查走访<br>点击<b>新增按钮</b>试试吧~</p>
</div>
<ai-fixed-btn>
<div class="addBtn iconfont iconfont-iconfangda" @tap="gotoAdd()"/>
</ai-fixed-btn>
</div>
</template>
<script>
import AiSelect from "../../components/AiSelect";
import AiTopFixed from "../../components/AiTopFixed";
import AiCard from "../../components/AiCard";
import AiImage from "../../components/AiImage";
import AiDate from "../../components/AiDate";
import AiFixedBtn from "../../components/AiFixedBtn";
export default {
name: "AppInterview",
label: "调查走访",
components: {AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect},
data() {
return {
search: {title: ""},
list: [],
current: 1,
pages: 0
}
},
computed: {
loadmore() {
return this.pages <= this.current ? 'loading ' : 'nomore'
}
},
onShow() {
this.current = 1;
this.getList()
},
onReachBottom() {
this.current++;
this.getList()
},
methods: {
getList() {
this.$http.post('/app/appinterview/list-xcx', null, {
params: {
current: this.current,
size: 10,
...this.search
}
}).then(res => {
if (res?.data) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
goDetail(id, readonly) {
let url = `./detail?id=${id}`
readonly && (url += "&detail=1")
uni.navigateTo({url})
},
gotoAdd() {
uni.navigateTo({url: `./detail`})
},
handleDelete(ids) {
this.$confirm("是否要删除该调查走访").then(() => {
this.$http.post("/app/appinterview/delete", null, {
params: {ids}
}).then(res => {
if (res?.code == 0) {
this.$u.toast("删除成功!")
this.getList()
}
})
})
},
handleDateSearch(v) {
this.search.startTime = v.startDate
this.search.endTime = v.endDate || v.startDate
this.current = 1
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.AppInterview {
width: 100%;
min-height: 100%;
box-sizing: border-box;
position: absolute;
background: #fff;
.no-message {
margin-top: 140px;
text-align: center;
color: #888;
font-size: 30px;
b {
font-size: 32px;
color: $uni-color-primary;
padding: 0 8px;
}
image {
width: 320px;
height: 240px;
}
}
::v-deep .AiCard {
width: 100%;
min-height: 160px;
background: #FFFFFF;
padding: 32px 32px 0;
box-sizing: border-box;
display: flex;
flex-direction: column;
position: relative;
b {
display: block;
width: 100%;
font-size: 30px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #333;
margin-right: 60px;
margin-bottom: 20px;
}
.iconfont-iconMore {
color: #666;
position: absolute;
right: 32px;
top: 32px;
}
.bottom {
font-size: 24px;
color: #999999;
padding: 24px 0;
border-bottom: 1px solid rgba(221, 221, 221, .4);
}
.AiImage {
width: 30%;
margin-bottom: 8px;
margin-right: 8px;
image {
width: 100%;
height: 218px;
}
}
}
.addBtn {
width: 96px;
height: 96px;
flex-shrink: 0;
background: $uni-color-primary;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
font-size: 48px;
color: #fff;
border-radius: 50%;
justify-content: center;
align-items: center;
display: flex;
}
.menu {
text-align: center;
line-height: 80px;
width: 192px;
height: 80px;
font-size: 28px;
font-weight: 400;
color: #333333;
}
::v-deep .u-search {
margin-bottom: 0 !important;
padding-left: 146px;
box-shadow: none;
.u-content {
padding-left: 50px;
box-sizing: border-box;
}
}
}
</style>

View File

@@ -1,184 +0,0 @@
<template>
<div class="interviewDetail">
<template v-if="isEdit">
<u-form ref="interviewForm" label-position="top" :rules="rules" :model="form">
<u-form-item label="调查走访事项" prop="title" required>
<u-input v-model="form.title" placeholder="请输入最多30字" maxlength="30"/>
</u-form-item>
<u-form-item label="调查走访内容" prop="content">
<ai-textarea v-model="form.content" placeholder="请输入最多500字" :maxlength="500"/>
</u-form-item>
<u-form-item label="图片最多9张">
<ai-uploader multiple :limit="9" :def.sync="form.fileList" action="/admin/file/add2"/>
</u-form-item>
</u-form>
<div bottom>
<u-button type="primary" @tap="submitForm">保存</u-button>
</div>
</template>
<template v-else>
<div class="headerPane">
<b>{{ form.title }}</b>
<div>记录时间{{ form.createTime }}</div>
</div>
<div class="contentPane">
<div v-html="form.content"/>
<div flex class="wrap">
<ai-image v-for="(op,i) in form.fileList" :src="op.accessUrl" preview :key="i"/>
</div>
</div>
</template>
<ai-back/>
</div>
</template>
<script>
import UButton from "../../uview/components/u-button/u-button";
import AiUploader from "../../components/AiUploader";
import UInput from "../../uview/components/u-input/u-input";
import AiImage from "../../components/AiImage";
import AiTextarea from "../../components/AiTextarea";
import UFormItem from "../../uview/components/u-form-item/u-form-item";
import AiBack from "../../components/AiBack";
export default {
name: 'interviewDetail',
components: {AiBack, UFormItem, AiTextarea, AiImage, UInput, AiUploader, UButton},
computed: {
isEdit() {
let flag = this.$route.query?.detail != 1
!flag && uni.setNavigationBarTitle({title: "走访详情"})
return flag
},
rules() {
return {
title: [{required: true, message: '请输入 调查走访事项'}],
// content: [{required: true, message: '请输入 调查走访内容'}],
}
}
},
data() {
return {
form: {
fileList: []
}
}
},
created() {
this.searchDetail();
},
methods: {
submitForm() {
this.$refs.interviewForm?.validate(v => {
if (v) {
this.$http.post(`/app/appinterview/add-xcx`, {
...this.form
}).then(res => {
if (res?.code == 0) {
this.$u.toast("提交成功!")
uni.navigateBack()
}
})
}
})
},
searchDetail() {
let {id} = this.$route.query
id && this.$http.post(`/app/appinterview/queryDetailById`, null, {
params: {id}
}).then(res => {
if (res?.data) {
this.form = {...res.data};
}
})
},
}
}
</script>
<style lang="scss" scoped>
.interviewDetail {
background: #F3F6F9;
min-height: 100%;
.u-form {
width: 100%;
height: 100%;
overflow-y: auto;
background-color: #f3f6f9;
position: relative;
padding: 0 0 188px;
box-sizing: border-box;
font-size: 30px;
::v-deep textarea {
width: 100%;
}
::v-deep .u-form-item {
margin-bottom: 16px;
.u-form-item--left__content__label {
font-weight: 400;
}
div[flex] {
width: 100%;
}
}
}
div[bottom] {
z-index: 99;
padding: 0;
height: 112px;
.u-btn {
height: 100%;
border-radius: 0;
}
}
::v-deep .headerPane {
width: 100%;
background: #3975C6;
color: #fff;
padding: 24px 32px 32px;
box-sizing: border-box;
font-size: 28px;
b {
display: block;
font-size: 40px;
line-height: 64px;
letter-spacing: 2px;
margin-bottom: 16px;
}
}
::v-deep .contentPane {
padding: 32px;
width: 100%;
box-sizing: border-box;
font-size: 32px;
font-weight: 400;
color: #666;
line-height: 56px;
.wrap {
margin-top: 32px;
}
.AiImage {
width: 31%;
margin-bottom: 16px;
margin-right: 16px;
image {
width: 100%;
height: 218px;
}
}
}
}
</style>

View File

@@ -10,7 +10,7 @@
<b v-for="app in apps" :key="app.key" @tap="redirectTo(app.path)">{{ app.name }}</b>
</div>
</section>
</template>
</template>0
<script>
import {mapActions, mapState} from 'vuex'
@@ -22,14 +22,15 @@ export default {
components: {UTag, AiResult},
inject: ['root'],
computed: {
...mapState(['token', 'apps', 'openUser', 'user']),
...mapState(['token', 'openUser', 'user']),
currentApp() {
return this.apps.find(e => e.key == this.$route.query.app) || {}
}
},
data() {
return {
result: {}
result: {},
apps: []
}
},
methods: {
@@ -38,16 +39,30 @@ export default {
let {query, hash} = this.$route
delete query.app
uni.navigateTo({
url: `/pages${path}`, success: () => {
url: `/apps${path}`, success: () => {
this.$router.push({query, hash})
},
fail: err => {
console.error(err)
}
})
},
handleLogin() {
uni.navigateTo({url: "./login"})
},
getApps() {
this.apps = []
let applications = require.context('../apps', true, /\.(\/.+)\/App[^\/]+\.vue$/)
applications.keys().map(path => {
if (applications(path).default) {
let {name: key, appName: name} = applications(path).default
this.apps.push({key, name, path: path.replace(/^\.(.+).vue$/g, '$1')})
}
})
}
},
created() {
this.getApps()
this.result = {
tips: "欢迎进入开发应用",
}