智慧保安互联网APP
shuishen
2021-07-30 7a6c4667321b17c964834b5dc089b18805e5606c
部分文件修改
9 files modified
1 files added
218 ■■■■ changed files
components/seeImges/seeImges.vue 13 ●●●● patch | view | raw | blame | history
pages/dispatch/imgissue.vue 89 ●●●● patch | view | raw | blame | history
pages/report/initiate.vue 23 ●●●●● patch | view | raw | blame | history
pages/securityStaff/exhibition.vue 54 ●●●● patch | view | raw | blame | history
pages/securityStaff/information.vue 30 ●●●●● patch | view | raw | blame | history
pages/user/profile.vue 1 ●●●● patch | view | raw | blame | history
static/images/upload.png patch | view | raw | blame | history
static/scss/index.scss 1 ●●●● patch | view | raw | blame | history
static/style/app.scss 5 ●●●●● patch | view | raw | blame | history
utils/func.js 2 ●●● patch | view | raw | blame | history
components/seeImges/seeImges.vue
@@ -95,10 +95,10 @@
<style lang="scss" scoped>
    .seeImgs {
        width: 100%;
        height: 4.3rem;
        width: auto;
        height: auto;
        // border: 1px solid #0000FF;
        white-space: nowrap;
        white-space: pre-wrap;
        box-sizing: border-box;
        overflow: auto;
        // display: flex;
@@ -109,15 +109,14 @@
        .imgs {
            display: inline-block;
            padding-top: 0.5rem;
            width: 4rem;
            height: 4rem;
            padding: 0 0.2rem 0 0.2rem;
            margin: 0 0.2rem 0 0.2rem;
            padding: 0 0.1rem 0 0.1rem;
            margin: 0 0.3rem 0 0.3rem;
            // border-right: 1px solid rgba($color: #000000, $alpha: 0.5);
            position: relative;
            // border: 1px solid #0000FF;
            top: 0.22rem;
            top: 0.3rem;
            image {
                width: 100%;
pages/dispatch/imgissue.vue
@@ -7,9 +7,12 @@
                    <u-input type='textarea' v-model="form.content" placeholder="请输入指令内容" />
                </u-form-item>
                <u-form-item label-position='top' label="指令相关图片">
                    <u-upload :action="action" :file-list="fileList" max-count='1'></u-upload>
                <u-form-item label-position='top' label="指令相关图片" class='imgissue-upload'>
                    <!-- <u-upload :action="action" :file-list="fileList" max-count='1'></u-upload> -->
                    <seeImgs :imgs="imgs" :videos="[]" @del="delImg" :type="'imgs'"></seeImgs>
                    <image style="width: 4rem; height: 4rem; display: block;" @tap="takePhoto" src="../../static/images/upload.png" mode=""></image>
                </u-form-item>
            </u-form>
            <view>
@@ -23,27 +26,32 @@
</template>
<script>
    import seeImgs from '../../components/seeImges/seeImges.vue';
    export default {
        components: {
            seeImgs
        },
        data() {
            return {
                action: 'http://192.168.0.108:81/blade-resource/oss/endpoint/put-file',
                fileList:[{
                fileList: [{
                    url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
                }],
                form: {
                    content: '',
                },
                rules: {
                    content: [{
                        min: 5,
                        required: true,
                        message: '指令内容不能少于5个字',
                        trigger: ['change', 'blur'],
                    }]
                }
                },
                imgs: [],
            };
        },
        onLoad() {
@@ -57,7 +65,7 @@
            this.$refs.uForm.setRules(this.rules);
        },
        methods: {
            initiateClick() {
                this.$refs.uForm.validate(valid => {
                    if (valid) {
@@ -67,12 +75,13 @@
                            data: {
                                // 接收
                                receiveDirectiveIds: this.$store.state
                                .UserData.user_id,
                                    .UserData.user_id,
                                // 发送
                                sendDirectiveId: this.$store.state
                                .UserData.user_id,
                                    .UserData.user_id,
                                content: this.form.content,
                                sendTime: "2021-07-22 12:00:00",
                            },
                            success: (res) => {
                                if (res.data.msg == "操作成功") {
@@ -88,7 +97,63 @@
                        console.log('验证失败');
                    }
                });
            }
            },
            //图片删除
            delImg(index) {
                this.imgs.splice(index, 1);
            },
            //图片上传
            takePhoto() {
                var that = this;
                uni.chooseImage({
                    count: 3, //可选择数量,默认9
                    sizeType: ['compressed', 'original'], //上传压缩图,原图
                    sourceType: ['album', 'camera'], //从相册选择或从使用相机
                    success: async (res) => {
                        for (var i = 0; i < res.tempFiles.length; i++) {
                            if (res.tempFiles[i].size > 10 * 1024 * 1000) { //上传图片大小限制
                                uni.showToast({
                                    title: "照片大小不能超过10MB",
                                    icon: "none"
                                })
                                return
                            }
                        }
                        var tempFilePath = res.tempFilePaths;
                        // try {
                        uni.showLoading({
                            title: "上传中...",
                            mask: true
                        })
                        var that = this;
                        // 循环调用uni.uploadFile ,因微信小程序只支持单文件上传
                        for (var i = 0; i < tempFilePath.length; i++) {
                            uni.uploadFile({
                                // url: 'https://web.byisf.com/api/blade-jfpts/depl/put-depl', //仅为示例,非真实的接口地址
                                url: 'http://192.168.0.108:81/blade-resource/oss/endpoint/put-file',
                                filePath: tempFilePath[i],
                                name: 'file',
                                formData: {
                                    'user': 'test' // 上传附带参数
                                },
                                success: (data) => {
                                    uni.showToast({
                                        title: '上传图片成功!',
                                        duration: 1000
                                    });
                                    // 根据接口具体返回格式   赋值具体对应url
                                    that.imgs.push({
                                        id: i,
                                        src: JSON.parse(data.data).data
                                    })
                                }
                            });
                        }
                    }
                });
            },
        }
    };
</script>
pages/report/initiate.vue
@@ -19,6 +19,12 @@
                <u-form-item label-position='top' prop="content" label="汇报内容" :required="true">
                    <u-input type='textarea' v-model="form.content" placeholder="请输入汇报内容" />
                </u-form-item>
                <u-form-item label-position='top' prop="typeText" label="接收人" :required="true">
                    <u-input v-model="form.typeText" type="select" placeholder="请选择接收人" :border="false"
                        @click="recipientClick" />
                    <u-select v-model="recipientShow" mode="single-column" :list="typeList" @confirm="typeConfirm">
                    </u-select>
                </u-form-item>
            </u-form>
            <view>
@@ -37,6 +43,9 @@
            return {
                categoryShow: false,
                typeShow: false,
                recipientShow: false,
                categoryList: [{
                        value: '1',
                        label: '保安向保安汇报'
@@ -106,7 +115,21 @@
                this.categoryShow = true;
            },
            typeClick() {
                this.typeShow = true;
            },
            recipientClick() {
                if (this.form.category == '') {
                    uni.showToast({
                        title: '请选择汇报类别',
                        icon: 'none',
                        duration: 2000
                    });
                    return;
                } else {
                    this.recipientShow = true;
                }
            },
            categoryConfirm(e) {
                this.form.category = e[0].value
pages/securityStaff/exhibition.vue
@@ -31,10 +31,6 @@
</template>
<script>
    import {
        data
    } from './data.js'
    import axios from 'axios'
    export default {
        data() {
            return {
@@ -55,35 +51,35 @@
        methods: {
            getDataList() {
                var d = []
                axios({
                uni.request({
                    url: this.$store.state.piAPI + '/blade-user/page',
                    method: 'get',
                }).then(res => {
                    console.log(res.data.data.records);
                    var b = res.data.data.records;
                    for (var k in b) {
                        d.push({
                            name: b[k].realName,
                            age: b[k].sexName,
                            obj: b[k].deptName,
                            honor: '扶老奶奶过马路',
                            punishment: '不看红绿灯',
                            imgSrc:b[k].avatar,
                            cardid:b[k].cardid,
                            baoanzheng: "赣06284538",
                        })
                    data: {
                    },
                    success: (res) => {
                        var b = res.data.data.records;
                        for (var k in b) {
                            d.push({
                                name: b[k].realName,
                                age: b[k].sexName,
                                obj: b[k].deptName,
                                honor: '扶老奶奶过马路',
                                punishment: '不看红绿灯',
                                imgSrc: b[k].avatar,
                                cardid: b[k].cardid,
                                baoanzheng: "赣06284538",
                            })
                        }
                        this.outDataList = d;
                        console.log(d)
                        setTimeout(() => {
                            this.securityStaffList = this.outDataList;
                            this.loading = false;
                        }, 1000)
                    }
                    this.outDataList = d;
                    console.log(d)
                    setTimeout(() => {
                        this.securityStaffList = this.outDataList;
                        this.loading = false;
                    }, 1000)
                })
                // this.outDataList = data;
            },
            customSearch() {
pages/securityStaff/information.vue
@@ -114,7 +114,6 @@
</template>
<script>
    import axios from "axios"
    export default {
        data() {
            return {
@@ -150,18 +149,23 @@
                        cardid: this.datalist.cardid
                    },
                    that = this;
                axios({
                    url: url,
                    params: data
                }).then(res => {
                    var d = res.data.data;
                    var a = []
                    // for(var k = 1 ;k < 30; k++){
                        a.push(...d)
                    // }
                    console.log(d);
                    that.cylist = a;
                })
                    uni.request({
                        url: url,
                        method: 'get',
                        data: data,
                        success: (res) => {
                            var d = res.data.data;
                            var a = []
                            // for(var k = 1 ;k < 30; k++){
                                a.push(...d)
                            // }
                            console.log(d);
                            that.cylist = a;
                        }
                    })
            }
        },
        mounted() {
pages/user/profile.vue
@@ -76,7 +76,6 @@
                        id: this.detail.user_id
                    },
                    success: (res) => {
                        console.log(res, 885858884488)
                        if (res.data.msg == "操作成功") {
                            that.$refs.uToast.show({
                                title: '修改成功',
static/images/upload.png
static/scss/index.scss
@@ -1,4 +1,5 @@
// 页面开头公共样式
.content {
    padding-top: var(--status-bar-height);
    }
static/style/app.scss
@@ -79,3 +79,8 @@
    background-color: $u-content-color;
}
/* end--演示页面使用的统一样式--end */
.imgissue-upload {
        .u-form-item--right__content__slot  {
            flex-wrap: wrap !important;
        }
}
utils/func.js
@@ -6,7 +6,7 @@
        vm.$u.vuex('userInfo', userInfo)
        vm.$u.vuex('accessToken', userInfo.access_token)
        vm.$u.vuex('isLogin', true)
        console.log(vm)
        vm.loging = false
        uni.switchTab({
            url: '/pages/home/home'
        })