Shannon_mu 3 yıl önce
ebeveyn
işleme
cedbc15018

+ 1 - 1
operationSupport/public/index.html

@@ -14,7 +14,7 @@
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
   <link rel="icon" href="<%= BASE_URL %>favicon.ico" type="image/x-icon" />
-  <link rel="stylesheet" href="//at.alicdn.com/t/font_2251662_6zkesvj5bwe.css">
+  <link rel="stylesheet" href="//at.alicdn.com/t/font_2251662_01meg93yw7ur.css">
   <title>智慧社区管理平台</title>
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">

+ 48 - 43
operationSupport/src/views/communityoperation/advertisingManagement/index.vue

@@ -20,7 +20,7 @@
 
             <div class="search-icon">
                 <el-tooltip class="item" effect="light" placement="bottom" content="新增">
-                    <i class="zoniot_font zoniot-icon-tianjia2" @click="addOrEdit('add')"></i>
+                    <i class="zoniot_font zoniot-icon-tianjia2" @click="add()"></i>
                 </el-tooltip>
             </div>
         </div>
@@ -36,9 +36,18 @@
             >
                 <template slot-scope="scope" slot="opt">
                     <div class="opt">
-                        <el-tooltip effect="light" placement="bottom" content="编辑">
-                            <i class="zoniot_font zoniot-icon-bianji" @click="addOrEdit('edit', scope.row)"></i>
+                        <el-tooltip effect="light" placement="bottom" content="详情">
+                            <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetail(scope.row)"></i>
                         </el-tooltip>
+                        <el-tooltip effect="light" placement="bottom" content="终止">
+                            <i
+                                class="zoniot_font zoniot-icon-zhongzhi redText"
+                                v-if="scope.row.adStatus !== 3"
+                                @click="Scrap(scope.row.id)"
+                            ></i>
+                            <i v-else class="zoniot_font zoniot-icon-zhongzhi ashText"></i>
+                        </el-tooltip>
+
                         <el-tooltip effect="light" placement="bottom" content="删除">
                             <i class="zoniot_font zoniot-icon-shanchu redText" @click="deluserbyidFn(scope.row.id)"></i>
                         </el-tooltip>
@@ -79,7 +88,7 @@ export default {
             cols: [
                 {
                     label: '广告编号',
-                    prop: 'communityId'
+                    prop: 'id'
                 },
                 {
                     label: '广告名称',
@@ -154,23 +163,9 @@ export default {
                 .catch(function () {});
         },
         deluserbyidFn(id) {
-            let ids = [];
-            if (!!id) {
-                ids = [id];
-            } else {
-                if (!this.selectRow.length) {
-                    this.$message.error('您尚未选择要删除的记录,请选择后再操作批量删除');
-                    return;
-                }
-                this.selectRow.forEach((v) => {
-                    ids.push(v.id);
-                });
-            }
-
-            const h = this.$createElement;
             this.$msgBox(`删除`, '删除后将无法恢复,请问是否继续?')
                 .then(() => {
-                    this.$http.post('/sc-community/device/delete', ids).then(({ status, data, msg }) => {
+                    this.$http.post(`/sc-community-web/advertising/delete/${id}`).then(({ status, data, msg }) => {
                         if (0 === status) {
                             this.$message({
                                 type: 'success',
@@ -182,40 +177,50 @@ export default {
                 })
                 .catch(() => {});
         },
+        lookDetail({ id }) {
+            new Promise((resolve) => {
+                this.$store.dispatch('addPopup', {
+                    url: '/communityoperation/advertisingManagement/setpPage/details.vue',
+                    width: '665px',
+                    height: '700px',
+                    props: {
+                        callback: resolve,
+                        id
+                    },
+                    notip: true,
+                    showCancelButton: true,
+                    showConfirmButton: true,
+                    title: '查看详情'
+                });
+            }).then(() => {
+                this.mixins_search();
+            });
+        },
         Scrap(id) {
-            this.$msgBox(`确认提示`, '设备报废后将无法正常接收数据,请问是否继续?')
+            this.$msgBox(`是否确定终止对应的广告?`, '广告终止后无法在移动端播放')
                 .then(() => {
-                    this.$http
-                        .post('/sc-community/device/deviceScrapInterface', { id: id, deviceStatus: 5 })
-                        .then(({ status, data, msg }) => {
-                            if (0 === status) {
-                                this.$message({
-                                    type: 'success',
-                                    message: '报废成功!'
-                                });
-                                this.mixins_search();
-                            }
-                        });
+                    this.$http.post(`/sc-community-web/advertising/expiry/${id}`).then(({ status, data, msg }) => {
+                        if (0 === status) {
+                            this.$message({
+                                type: 'success',
+                                message: '终止成功!'
+                            });
+                            this.mixins_search();
+                        }
+                    });
                 })
                 .catch(() => {});
         },
-        addOrEdit(todo, data = {}) {
+        add() {
             new Promise((resolve) => {
-                let title = '添加设备';
-                if (todo !== 'add') {
-                    title = '修改设备';
-                }
                 this.$store.dispatch('addPopup', {
-                    url: '/deviceManagement/popups/addDeviceManagement.vue',
-                    width: '500px',
-                    height: '400px',
+                    url: '/communityoperation/advertisingManagement/setpPage/add.vue',
+                    width: '665px',
+                    height: '700px',
                     props: {
-                        data,
-                        todo,
-                        productOptions: this.productOptions,
                         callback: resolve
                     },
-                    title: title
+                    title: '新增广告'
                 });
             }).then(() => {
                 this.mixins_search();

+ 260 - 0
operationSupport/src/views/communityoperation/advertisingManagement/setpPage/add.vue

@@ -0,0 +1,260 @@
+<template>
+    <div class="formContent">
+        <el-form ref="form" :model="formData" :rules="rules" label-width="85px">
+            <div class="formContent-item_title">广告信息</div>
+            <el-form-item label="广告名称" prop="name">
+                <el-input v-model="formData.name" clearable placeholder="请输入广告标题名称"></el-input>
+            </el-form-item>
+            <el-form-item label="主题图片" prop="cover">
+                <div class="clickUpload">
+                    <div class="clickUpText" @click="clickUpload()">
+                        <img class="dataImg" v-if="!!formData.cover" :src="formData.cover" />
+                        <template v-else>
+                            <el-button size="small" type="primary">点击上传</el-button>
+                        </template>
+                    </div>
+                    <div class="ashText">图片像素为1080 px * 540 px,jpg/png/图片格式,文件大小在2M内</div>
+                    <el-upload
+                        style="display: none"
+                        :headers="token"
+                        ref="upload"
+                        limit="1"
+                        action="/sc-community/upload/uploadFile"
+                        :on-success="uploadsuccess"
+                        :before-upload="beforeAvatarUpload"
+                        :auto-upload="true"
+                        name="file"
+                    >
+                    </el-upload>
+                </div>
+            </el-form-item>
+            <el-form-item label="广告链接">
+                <el-input v-model="formData.link" clearable placeholder="请输入广告页面的链接地址"></el-input>
+            </el-form-item>
+            <div class="formContent-item_title">投放社区</div>
+            <el-form-item label="投放小区" prop="communityIds" :rules="communityRules(formData.communityIds)">
+                <div class="formComtent">
+                    <el-checkbox class="allComm" :indeterminate="checkAccessControl" v-model="checkAll" @change="handleCheckAllChange"
+                        >全部</el-checkbox
+                    >
+                    <el-checkbox-group v-model="formData.communityIds" @change="handleCheckedChange">
+                        <el-checkbox class="commItem" v-for="(item, index) in organList" :label="item.id" :key="index">{{
+                            item.communityName
+                        }}</el-checkbox>
+                    </el-checkbox-group>
+                </div>
+            </el-form-item>
+            <div class="formContent-item_title">投放时间</div>
+            <el-form-item label="巡更日期" prop="startDate">
+                <el-date-picker
+                    class="width100"
+                    v-model="effectiveDate"
+                    value-format="yyyy-MM-dd"
+                    type="daterange"
+                    range-separator="至"
+                    start-placeholder="选择开始日期"
+                    end-placeholder="选择结束日期"
+                    @change="effectiveDateToggle"
+                    :editable="false"
+                ></el-date-picker>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+export default {
+    props: ['params'],
+    data() {
+        return {
+            formData: {
+                communityIds: [],
+                cover: '',
+                endTime: '',
+                link: '',
+                name: '',
+                startTime: ''
+            },
+            checkAll: false,
+            checkAccessControl: false,
+            organList: [],
+            effectiveDate: [],
+            token: {
+                [localStorage.getItem('SC_token') && 'Authorization']: 'Bearer ' + localStorage.getItem('SC_token')
+            },
+            rules: {
+                name: [this.$valid.inputRequired('广告名称')],
+                cover: [
+                    {
+                        required: true,
+                        message: `图片不能为空`,
+                        trigger: 'change',
+                        validator(rule, value, cb) {
+                            if (!value) {
+                                cb(new Error());
+                            } else {
+                                cb();
+                            }
+                        }
+                    }
+                ]
+            }
+        };
+    },
+    methods: {
+        uploadsuccess(response, file, fileList) {
+            this.$refs.upload.clearFiles();
+            if (0 === response.status) {
+                this.formData.cover = response.data;
+            }
+        },
+        beforeAvatarUpload(file) {
+            const isJPG = ['image/jpg', 'image/png'].includes(file.type);
+            const isLt2M = file.size / 1024 / 1024 < 2;
+
+            if (!isJPG) {
+                this.$message.error('上传图片只能是 JPG,PNG 格式!');
+            }
+            if (!isLt2M) {
+                this.$message.error('上传图片大小不能超过 2MB!');
+            }
+            return isLt2M;
+        },
+        clickUpload() {
+            this.$refs['upload'].$refs['upload-inner'].handleClick();
+        },
+        effectiveDateToggle(va) {
+            let arr = va;
+            if (!arr) {
+                arr = ['', ''];
+            }
+            this.formData.startTime = arr[0];
+            this.formData.endTime = arr[1];
+        },
+        getOrgTreeList() {
+            this.$http.get('/sc-community/assets/community/list').then(({ status, data, msg }) => {
+                if (status === 0 && data) {
+                    this.organList = data;
+                }
+            });
+        },
+        handleCheckAllChange(val) {
+            let checked = this.organList.map((item) => {
+                return item.id;
+            });
+            this.formData.communityIds = val ? checked : [];
+            this.checkAccessControl = false;
+        },
+        handleCheckedChange(val) {
+            let checkedCount = val.length;
+            this.checkAll = checkedCount === this.organList.length;
+            this.checkAccessControl = checkedCount > 0 && checkedCount < this.organList.length;
+        },
+        submit() {
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    var loading = this.$loading();
+                    this.$http
+                        .post('/sc-community/advertising/add', this.formData)
+                        .then(({ status, msg }) => {
+                            if (status == 0) {
+                                this.$message.success(msg);
+                                this.params.callback();
+                                this.$emit('close');
+                            } else {
+                                this.$message.error(msg);
+                            }
+                            loading.close();
+                        })
+                        .catch(() => {
+                            loading.close();
+                        });
+                }
+            });
+        },
+        communityRules(val) {
+            return {
+                required: true,
+                message: `请选择小区`,
+                trigger: 'change',
+                validator(rule, value, cb) {
+                    if (!val.length) {
+                        cb(new Error());
+                    } else {
+                        cb();
+                    }
+                }
+            };
+        }
+    },
+    created() {
+        this.getOrgTreeList();
+    }
+};
+</script>
+<style lang="scss" scoped>
+@import '@assets/css/public-style.scss';
+.formContent {
+    /deep/ .el-form-item__content {
+        font-size: 12px;
+    }
+    .clickUpload {
+        width: 100%;
+        height: rem(270);
+        background: #ffffff;
+        border-radius: 2px;
+        border: 1px solid #e0e1e3;
+        margin-bottom: rem(20);
+        .clickUpText {
+            height: 100%;
+            line-height: rem(270);
+            text-align: center;
+            .dataImg {
+                object-fit: cover;
+                height: 100%;
+                width: 100%;
+            }
+        }
+    }
+    .formComtent {
+        width: 100%;
+        max-height: rem(187);
+        overflow: hidden;
+        border-radius: 2px;
+        border: 1px solid #e0e1e3;
+        .allComm {
+            height: rem(30);
+            background: #f8fcff;
+            border-radius: 2px;
+            width: 100%;
+            padding-left: rem(15);
+        }
+        .commItem {
+            display: block;
+            margin: 0 rem(15);
+        }
+        .el-checkbox-group {
+            overflow: auto;
+            height: calc(100% - #{rem(30)});
+            margin-right: rem(10);
+            &::-webkit-scrollbar {
+                z-index: 11;
+                width: rem(6);
+            }
+            &::-webkit-scrollbar-track,
+            &::-webkit-scrollbar-corner {
+                background: transparent;
+            }
+            &::-webkit-scrollbar-thumb {
+                border-radius: rem(6);
+                width: rem(6);
+                background: #e2e2e2;
+                opacity: 0.5;
+            }
+            &::-webkit-scrollbar-track-piece {
+                background: transparent;
+                width: rem(6);
+            }
+        }
+    }
+}
+</style>

+ 72 - 0
operationSupport/src/views/communityoperation/advertisingManagement/setpPage/details.vue

@@ -0,0 +1,72 @@
+<template>
+    <div class="formContent">
+        <div class="formContent-item_title">广告信息</div>
+        <div class="formLabelList">
+            <div class="label">广告名称:</div>
+            <div class="text">{{ formData.name }}</div>
+        </div>
+        <div class="formLabelList">
+            <div class="label">主题图片:</div>
+            <div class="text">
+                <el-image :src="formData.cover" fit="cover"> </el-image>
+            </div>
+        </div>
+        <div class="formLabelList">
+            <div class="label">广告链接:</div>
+            <div class="text">{{ formData.link }}</div>
+        </div>
+        <div class="formContent-item_title">投放对象</div>
+        <div class="formLabelList">
+            <div class="label">投放小区:</div>
+            <div class="text">{{ formData.communityNames }}</div>
+        </div>
+        <div class="formContent-item_title">投放时间</div>
+        <div class="formLabelList">
+            <div class="label">投放日期:</div>
+            <div class="text">{{ formData.startTime || '--' }} 至 {{ formData.endTime || '--' }}</div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    props: ['params'],
+    data() {
+        return {
+            formData: {}
+        };
+    },
+    methods: {
+        getData(id) {
+            this.$http.get(`/sc-community/advertising/find/${id}`).then(({ status, msg, data }) => {
+                if (status == 0) {
+                    this.formData = data;
+                } else {
+                    this.$message.error(msg);
+                }
+            });
+        }
+    },
+    created() {
+        this.getData(this.params.id);
+    }
+};
+</script>
+<style lang="scss" scoped>
+@import '@assets/css/public-style.scss';
+.formContent {
+    .formLabelList {
+        display: flex;
+        line-height: rem(30);
+        margin-bottom: rem(25);
+        .label {
+            width: rem(80);
+        }
+        .text {
+            .el-image {
+                width: rem(540);
+                height: rem(270);
+            }
+        }
+    }
+}
+</style>

+ 7 - 3
operationSupport/src/views/newWorkBench/components/commonFunctions.vue

@@ -44,9 +44,13 @@ export default {
         },
         getData() {
             this.$http.get('/sc-community/workbenchMenuUsed/list').then(({ data, status, msg }) => {
-                if (status == 0 && !!data) {
-                    this.thisObj = data[0];
-                    this.modelArrs = this.modelArr.filter((item) => JSON.parse(data[0].menuIds).some((ele) => ele.id == item.id));
+                if (status == 0) {
+                    if (!!data[0]) {
+                        this.thisObj = data[0];
+                        this.modelArrs = this.modelArr.filter((item) => JSON.parse(data[0].menuIds).some((ele) => ele.id == item.id));
+                    } else {
+                        this.modelArrs = this.modelArr;
+                    }
                 } else {
                     this.modelArrs = this.modelArr;
                 }

+ 2 - 2
operationSupport/src/views/newWorkBench/components/satisfaction.vue

@@ -7,8 +7,8 @@
                     <el-option v-for="(item, index) in communityList" :label="item.communityName" :value="item.id" :key="index"></el-option>
                 </el-select>
                 <el-select v-model="mixins_query.type" placeholder="所有服务" clearable class="saveColumn-select" @change="getData">
-                    <el-option label="运维工单" :value="1"></el-option>
-                    <el-option label="投诉建议" :value="2"></el-option>
+                    <el-option label="投诉建议" :value="1"></el-option>
+                    <el-option label="运维工单" :value="2"></el-option>
                 </el-select>
                 <el-date-picker
                     value-format="yyyy"