Browse Source

广告管理

devilhell 2 years ago
parent
commit
abc1c79868

+ 73 - 8
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/api/adSomeelse.js

@@ -2,7 +2,7 @@
  * @Author: wangj
  * @Date: 2023-02-27 20:58:17
  * @LastEditors: @EXtreeDesigner
- * @LastEditTime: 2023-03-04 15:21:19
+ * @LastEditTime: 2023-03-05 16:40:18
  * @FilePath: \imcs-ui\src\api\adSomeelse.js
  * @Description: 异常中心-设备异常、广告管理、优惠券管理
  */
@@ -35,18 +35,37 @@ const apiList = {
     url: `/authority/advertisementCustomer`,
     method: 'DELETE'
   },
-  preview: {
+  // 广告管理
+  ad: {
+    url: `/authority/advertisement/page`,
+    method: 'POST'
+  },
+  adadc:{
+    url: `/authority/advertisementCustomer/query`,
+    method: 'POST'
+  },
+  uploade: {
     method: 'POST',
-    url: `/msgs/msgsCenterInfo/preview`
+    url: `/file/attachment/upload`,
+    formData:1
+    // url:'/api/file/attachment/upload'
   },
-  export: {
+  epuip: {
     method: 'POST',
-    url: `/msgs/msgsCenterInfo/export`
+    url: `/authority/productionResource/page`
   },
-  import: {
+  adadd: {
     method: 'POST',
-    url: `/msgs/msgsCenterInfo/import`
-  }
+    url: `/authority/advertisement`
+  },
+  adedit: {
+    method: 'PUT',
+    url: `/authority/advertisement`
+  },
+  addelete: {
+    url: `/authority/advertisement`,
+    method: 'DELETE'
+  },
 }
 
 export const bug = {
@@ -90,4 +109,50 @@ export const adc = {
       data
     })
   }
+}
+
+export const ad = {
+  page (data) {
+    return axiosApi({
+      ...apiList.ad,
+      data,
+    })
+  },
+  adc (data) {
+    return axiosApi({
+      ...apiList.adadc,
+      data,
+    })
+  },
+  uploade(data) {
+    return axiosApi({
+      ...apiList.uploade,
+      data,
+    })
+  },
+  // uploade:apiList.uploade.url,
+  epuip(data) {
+    return axiosApi({
+      ...apiList.epuip,
+      data,
+    })
+  },
+  save (data) {
+    return axiosApi({
+      ...apiList.adadd,
+      data,
+    })
+  },
+  update (data) {
+    return axiosApi({
+      ...apiList.adedit,
+      data,
+    })
+  },
+  delete (data) {
+    return axiosApi({
+      ...apiList.addelete,
+      data
+    })
+  }
 }

+ 24 - 1
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/lang/zh/adsel.js

@@ -2,7 +2,7 @@
  * @Author: wangj
  * @Date: 2023-03-02 17:41:19
  * @LastEditors: @EXtreeDesigner
- * @LastEditTime: 2023-03-04 14:26:48
+ * @LastEditTime: 2023-03-05 13:05:00
  * @FilePath: \imcs-ui\src\lang\zh\adsel.js
  * @Description: ad and somthing else:广告、异常、优惠券
  */
@@ -45,4 +45,27 @@ export default {
       ,'状态'
     ]
   }
+  ,ad:{
+    // 廣告管理
+    status:'状态'
+    ,statusList:['全部','待播放','已失效']
+    ,table:[
+      '广告名称'
+      ,'客户'
+      ,'设备场地'
+      ,'投放设备'
+      ,'投放开始时间'
+      ,'投放结束时间'
+      ,'设备所属企业'
+    ]
+    ,check:"播放视频"
+    ,add:[
+      '广告名称'
+      ,'广告客户'
+      ,'广告视频'
+      ,'投放设备'
+      ,'投放开始时间'
+      ,'投放结束时间'
+    ]
+  }
 }

+ 469 - 0
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/ad/ad/Index.vue

@@ -0,0 +1,469 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <span>
+        <span> {{ $t("ad.table.0") }}: </span>
+        <span>
+          <el-input
+            class="search-item"
+            v-model="queryParams.model.adName"
+            :placeholder="$t('ad.table.0')"
+          />
+        </span>
+
+        <span> {{ $t("ad.status") }}: </span>
+        <span>
+          <el-select
+            v-model="queryParams.model.adStatus"
+            :placeholder="$t('ad.status')"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.name"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </span>
+      </span>
+      <!--操作按钮-->
+      <span>
+        <el-button @click="search" plain type="primary">
+          {{ $t("table.search") }}
+        </el-button>
+        <el-button @click="reset" plain type="warning">
+          {{ $t("table.reset") }}
+        </el-button>
+      </span>
+    </div>
+
+    <!--    添加修改删除-->
+    <el-row class="filter-container">
+      <el-col>
+        <!--添加按钮,调用add方法-->
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="medium"
+          @click="add"
+          >{{ $t("common.add") }}</el-button
+        >
+      </el-col>
+    </el-row>
+
+    <el-table
+      :data="tableData.records"
+      :key="tableKey"
+      @cell-click="cellClick"
+      @filter-change="filterChange"
+      @selection-change="onSelectChange"
+      @sort-change="sortChange"
+      border
+      fit
+      row-key="id"
+      ref="table"
+      style="width: 100%"
+      v-loading="loading"
+    >
+      <el-table-column
+        align="center"
+        type="index"
+        width="40px"
+        :reserve-selection="true"
+      />
+      <!-- 广告名称 -->
+      <el-table-column
+        :label="$t('ad.table.0')"
+        :show-overflow-tooltip="true"
+        align="center"
+        prop="adName"
+        min-width="200px"
+      >
+        <template slot-scope="scope">
+          <span>{{ scope.row.adName }}</span>
+        </template>
+      </el-table-column>
+      <!-- 客户 -->
+      <el-table-column
+        :label="$t('ad.table.1')"
+        :show-overflow-tooltip="true"
+        align="center"
+        prop="advertisementCustomer"
+        min-width="100px"
+      >
+        <template slot-scope="scope">
+          <span>{{ scope.row.advertisementCustomer&&scope.row.advertisementCustomer.customerName }}</span>
+        </template>
+      </el-table-column>
+      <!-- 设备场地 -->
+      <el-table-column
+        :label="$t('ad.table.2')"
+        :show-overflow-tooltip="true"
+        align="center"
+        prop="advertisementEquList"
+        min-width="150px"
+      >
+        <template slot-scope="scope">
+          <span>{{ scope.row.advertisementEquList.map(e => e.placeName).join() }}</span>
+        </template>
+      </el-table-column>
+      <!-- 投放设备 -->
+      <el-table-column
+        :label="$t('ad.table.3')"
+        :show-overflow-tooltip="true"
+        align="center"
+        prop="advertisementEquList"
+        min-width="500px"
+
+      >
+        <template slot-scope="scope">
+          <span>{{ scope.row.advertisementEquList.map(e => e.equName).join() }}</span>
+        </template>
+      </el-table-column>
+      <!-- 投放开始时间 -->
+      <el-table-column
+        :label="$t('ad.table.4')"
+        :show-overflow-tooltip="true"
+        align="center"
+        prop="deliveryStartTime"
+        min-width="100px"
+      >
+        <template slot-scope="scope">
+          <span>{{ scope.row.deliveryStartTime }}</span>
+        </template>
+      </el-table-column>
+      <!-- 投放结束时间 -->
+      <el-table-column
+        :label="$t('ad.table.5')"
+        :show-overflow-tooltip="true"
+        align="center"
+        prop="deliveryEndTime"
+        min-width="100px"
+      >
+        <template slot-scope="scope">
+          <span>{{ scope.row.deliveryEndTime }}</span>
+        </template>
+      </el-table-column>
+      <!-- 设备所属企业 -->
+      <el-table-column
+        :label="$t('ad.table.6')"
+        :show-overflow-tooltip="true"
+        align="center"
+        prop="advertisementEquList"
+        min-width="100px"
+      >
+        <template slot-scope="scope">
+          <span>{{ scope.row.advertisementEquList.map(e => e.companyName).join() }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        :label="$t('table.operation')"
+        align="center"
+        column-key="operation"
+        class-name="small-padding fixed-width"
+        min-width="100px"
+      >
+        <template slot-scope="{ row }">
+          <i
+            class="el-icon-view table-operation"
+            :title="$t('ad.check')"
+            style="color: #2db7f5"
+            v-if="row.adVideo"
+            @click="showVedio(row.adVideo)"
+          />
+          <i
+            @click="edit(row)"
+            class="el-icon-edit table-operation"
+            :title="$t('common.edit')"
+            style="color: #2db7f5"
+          />
+          <i
+            @click="singleDelete(row)"
+            class="el-icon-delete table-operation"
+            :title="$t('common.delete')"
+            style="color: #f50"
+          />
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      :limit.sync="queryParams.size"
+      :page.sync="queryParams.current"
+      :total="Number(tableData.total)"
+      @pagination="fetch"
+      v-show="tableData.total > 0"
+    />
+    <place-edit
+      :dialog-visible="dialog.isVisible"
+      :type="dialog.type"
+      @close="editClose"
+      @success="editSuccess"
+      ref="edit"
+    />
+    <place-import
+      ref="import"
+      :dialog-visible="fileImport.isVisible"
+      :type="fileImport.type"
+      :action="fileImport.action"
+      accept=".xls,.xlsx"
+      @close="importClose"
+      @success="importSuccess"
+    />
+    <el-dialog
+      :close-on-click-modal="false"
+      :close-on-press-escape="true"
+      title="预览"
+      width="80%"
+      top="50px"
+      :visible.sync="preview.isVisible"
+      v-el-drag-dialog
+    >
+    <video style="width:100%" controls autoplay :src="vediourl"></video>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Pagination from "@/components/Pagination";
+import elDragDialog from "@/directive/el-drag-dialog";
+import PlaceEdit from "./components/Edit";
+import { ad } from "@/api/adSomeelse";
+import PlaceImport from "@/components/zuihou/Import";
+import {
+  loadEnums,
+  initDicts,
+  initQueryParams,
+} from "@/utils/commons";
+
+export default {
+  name: "PlaceManage",
+  directives: { elDragDialog },
+  components: { Pagination, PlaceEdit, PlaceImport },
+  data() {
+    return {
+      selectedOptions: [],
+      options: [
+        {
+          value: "",
+          name: this.$t("ad.statusList.0"),
+        },
+        {
+          value: "1",
+          name: this.$t("ad.statusList.1"),
+        },
+        {
+          value: "0",
+          name: this.$t("ad.statusList.2"),
+        },
+      ],
+      form: {
+        provinces: "",
+        pCode: "",
+        city: "",
+        cCode: "",
+        area: "",
+        aCode: "",
+      },
+
+      // 编辑
+      dialog: {
+        isVisible: false,
+        type: "add",
+      },
+      // 预览
+      preview: {
+        isVisible: false,
+        context: "",
+      },
+      // 导入
+      fileImport: {
+        isVisible: false,
+        type: "import",
+        action: `${process.env.VUE_APP_BASE_API}/place/place/import`,
+      },
+      tableKey: 0,
+      queryParams: initQueryParams(),
+      selection: [],
+      loading: false,
+      tableData: {
+        total: 0,
+      },
+      // 枚举
+      enums: {},
+      // 字典
+      dicts: {},
+      vediourl:''
+    };
+  },
+  computed: {},
+  watch: {},
+  mounted() {
+    this.fetch();
+
+    // 初始化字典和枚举
+    const enumList = [];
+    const dictList = [];
+    loadEnums(enumList, this.enums, "place");
+    initDicts(dictList, this.dicts);
+  },
+  methods: {
+    editOne() {
+      if (!this.selection.length) {
+        this.$message({
+          message: this.$t("tips.noDataSelected"),
+          type: "warning",
+        });
+        return;
+      }
+      if (this.selection.length > 1) {
+        this.$message({
+          message: this.$t("tips.mustOne"),
+          type: "warning",
+        });
+        return;
+      }
+      this.edit(this.selection[0]);
+    },
+
+    editClose() {
+      this.dialog.isVisible = false;
+    },
+    editSuccess() {
+      this.search();
+    },
+    onSelectChange(selection) {
+      this.selection = selection;
+    },
+    search() {
+      this.fetch({
+        ...this.queryParams,
+      });
+    },
+    reset() {
+      this.queryParams = initQueryParams();
+      this.selectedOptions = [];
+      this.$refs.table.clearSort();
+      this.$refs.table.clearFilter();
+      this.search();
+    },
+    showVedio(url) {
+      this.vediourl = url
+      this.$nextTick(()=>{
+        this.preview.isVisible = true
+      })
+    },
+    importSuccess() {
+      this.search();
+    },
+    importClose() {
+      this.fileImport.isVisible = false;
+    },
+    singleDelete(row) {
+      this.$refs.table.clearSelection();
+      this.$refs.table.toggleRowSelection(row, true);
+      this.batchDelete();
+    },
+    batchDelete() {
+      if (!this.selection.length) {
+        this.$message({
+          message: this.$t("tips.noDataSelected"),
+          type: "warning",
+        });
+        return;
+      }
+      this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
+        confirmButtonText: this.$t("common.confirm"),
+        cancelButtonText: this.$t("common.cancel"),
+        type: "warning",
+      })
+        .then(() => {
+          const ids = this.selection.map((u) => u.id);
+          this.delete(ids);
+        })
+        .catch(() => {
+          this.clearSelections();
+        });
+    },
+    clearSelections() {
+      this.$refs.table.clearSelection();
+    },
+    delete(ids) {
+      ad.delete({ ids: ids }).then((response) => {
+        const res = response.data;
+        if (res.isSuccess) {
+          this.$message({
+            message: this.$t("tips.deleteSuccess"),
+            type: "success",
+          });
+          this.search();
+        }
+      });
+    },
+    add() {
+      this.dialog.type = "add";
+      this.dialog.isVisible = true;
+      this.$refs.edit.setPlace(false);
+      // this.selectedOptions=[];
+    },
+    edit(row) {
+      // this.$refs.edit.setPlace({row, enums: this.enums, dicts: this.dicts});
+      this.$refs.edit.setPlace({ row });
+      this.dialog.type = "edit";
+      this.dialog.isVisible = true;
+    },
+    fetch(params = {}) {
+      this.loading = true;
+      this.queryParams.current = params.current
+        ? params.current
+        : this.queryParams.current;
+      this.queryParams.size = params.size ? params.size : this.queryParams.size;
+      ad
+        .page(this.queryParams)
+        .then((response) => {
+          const res = response.data;
+          if (res.isSuccess) {
+            this.tableData = res.data;
+          }
+        })
+        .finally(() => (this.loading = false));
+    },
+    sortChange(val) {
+      this.queryParams.sort = val.prop;
+      this.queryParams.order = val.order;
+      if (this.queryParams.sort) {
+        this.search();
+      }
+    },
+    filterChange(filters) {
+      for (const key in filters) {
+        if (key.includes(".")) {
+          const val = {};
+          val[key.split(".")[1]] = filters[key][0];
+          this.queryParams.model[key.split(".")[0]] = val;
+        } else {
+          this.queryParams.model[key] = filters[key][0];
+        }
+      }
+      this.search();
+    },
+    cellClick(row, column) {
+      if (column["columnKey"] === "operation") {
+        return;
+      }
+      let flag = false;
+      this.selection.forEach((item) => {
+        if (item.id === row.id) {
+          flag = true;
+          this.$refs.table.toggleRowSelection(row);
+        }
+      });
+
+      if (!flag) {
+        this.$refs.table.toggleRowSelection(row, true);
+      }
+    },
+  },
+};
+</script>
+<style lang="scss" scoped></style>

+ 388 - 0
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/ad/ad/components/Edit.vue

@@ -0,0 +1,388 @@
+<!--
+ * @Author: wangj
+ * @Date: 2023-02-19 13:54:14
+ * @LastEditors: @EXtreeDesigner
+ * @LastEditTime: 2023-03-05 23:55:15
+ * @FilePath: \imcs-ui\src\views\zuihou\ad\ad\components\Edit.vue
+ * @Description: 
+-->
+<template>
+  <el-dialog
+    :close-on-click-modal="false"
+    :close-on-press-escape="true"
+    :title="title"
+    :type="type"
+    :visible.sync="isVisible"
+    :width="width"
+    top="50px"
+    v-el-drag-dialog
+  >
+    <el-form
+      :model="place"
+      :rules="rules"
+      label-position="right"
+      label-width="180px"
+      ref="form"
+    >
+    <!-- 广告名称 -->
+      <el-form-item :label="$t('ad.add.0')" prop="adName">
+        <el-input v-model.trim="place.adName" :placeholder="$t('ad.add.0')" />
+      </el-form-item>
+      <!-- 广告客户 -->
+      <el-form-item :label="$t('ad.add.1')" prop="customerId">
+          <el-select
+            class="from-item"
+            v-model="place.customerId"
+            :placeholder="$t('ad.add.1')"
+          >
+            <el-option
+              v-for="item in adcList"
+              :key="item.id"
+              :label="item.customerName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+      </el-form-item>
+      <!-- 广告视频 -->
+      <el-form-item :label="$t('ad.add.2')" prop="contactPhone">
+        <el-upload
+          :name="'target'"
+          :accept="'.mp4'"
+          :http-request="handleUpload"
+          :limit="1"
+          :on-remove="clearfile"
+          :file-list="fileList">
+          <el-button size="small" type="primary">点击上传</el-button>
+        </el-upload>
+      </el-form-item>
+      <!-- 投放设备 -->
+      <el-form-item :label="$t('ad.add.3')" prop="plcEvnType">
+        <el-cascader
+        v-model="place.advertisementEquList"
+        :props="{ multiple: true }"
+        class="from-item"
+        :options="epuipList"
+        clearable
+        ></el-cascader>
+      </el-form-item>
+      <!-- 投放开始时间 -->
+      <el-form-item :label="$t('ad.add.4')" prop="plcStatus">
+        <template>
+          <el-date-picker
+            :value-format="'yyyy-MM-dd hh:mm:ss'"
+            v-model="place.deliveryStartTime"
+            class="from-item"
+            type="datetime"
+            placeholder="选择投放开始时间">
+          </el-date-picker>
+        </template>
+      </el-form-item>
+      <!-- 投放结束时间 -->
+      <el-form-item :label="$t('ad.add.5')" prop="plcStatus">
+        <template>
+          <el-date-picker
+            :value-format="'yyyy-MM-dd hh:mm:ss'"
+            v-model="place.deliveryEndTime"
+            class="from-item"
+            type="datetime"
+            placeholder="选择投放结束时间">
+          </el-date-picker>
+        </template>
+      </el-form-item>
+    </el-form>
+    <div class="dialog-footer" slot="footer">
+      <el-button @click="isVisible = false" plain type="warning">
+        {{ $t("common.cancel") }}
+      </el-button>
+      <el-button
+        @click="submitForm"
+        :disabled="confirmDisabled"
+        plain
+        type="primary"
+      >
+        {{ $t("common.confirm") }}
+      </el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+import elDragDialog from "@/directive/el-drag-dialog";
+import { ad } from "@/api/adSomeelse";
+import { Loading } from 'element-ui';
+import {regionData, CodeToText, TextToCode} from 'element-china-area-data';
+export default {
+  name: "PlaceEdit",
+  directives: { elDragDialog },
+  components: {},
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+    type: {
+      type: String,
+      default: "add",
+    },
+  },
+  data() {
+    const fileList = []
+    const uploadcheck = (rule, value, callback) => {
+          callback();
+        // if (fileList.length === 1) {
+        //   callback();
+        // } else {
+        //   callback(new Error('请上传广告视频'));
+        // }
+      };
+    return {
+      confirmDisabled: false,
+      place: this.initPlace(),
+      screenWidth: 0,
+      width: this.initWidth(),
+      rules: {
+        adName: [
+          {
+            required: true,
+            message: this.$t("rules.require"),
+            trigger: "blur",
+          },
+        ],
+        customerId: [
+          {
+            required: true,
+            message: this.$t("rules.require"),
+            trigger: "visible-change",
+          },
+        ],
+        contactPhone: [
+          { validator: uploadcheck, trigger: 'change' }
+        ],
+      },
+      adcList:[],
+      upLoadUrl:ad.uploade,
+      fileList,
+      epuipList:[],
+    };
+  },
+  computed: {
+    isVisible: {
+      get() {
+        return this.dialogVisible;
+      },
+      set() {
+        this.close();
+        this.reset();
+      },
+    },
+    title() {
+      return this.$t("common." + this.type);
+    },
+    res: function () {
+      const r = JSON.parse(JSON.stringify(this.place));
+      r.advertisementEquList = this.place.advertisementEquList.map(e => {
+        return {
+          deliveryEquId:e[2]
+        }
+      });
+      r.adVideo = this.fileList[0]
+      return r;
+    },
+  },
+  created(){
+    // 广告客户
+    ad.adc({"customerStatus": "1"}).then(e => {
+      if (e.status == 200 && e.data.code === 0){
+        this.adcList = e.data.data
+      }
+    })
+    // 设备列表
+    ad.epuip({
+      "size": 99999,
+      "current": 1,
+      "sort": "id",
+      "order": "descending",
+      "model": {},
+      "map": {},
+      "timeRange": null
+    }).then(e =>{
+      if (e.status == 200 && e.data.code === 0){
+        const tree = {}
+        e.data.data.records.forEach((equip,index) => {
+          // 区域
+          if (!tree[equip.areaIds]){
+            tree[equip.areaIds] = {}
+          }
+          // 场地
+          if (!tree[equip.areaIds][equip.placeId]){
+            tree[equip.areaIds][equip.placeId] = {label:equip.placeName,children:[]}
+          }
+          // 设备
+          tree[equip.areaIds][equip.placeId].children.push({value:equip.id, label:equip.name})
+        })
+        for (let areaIds in tree){
+          const area = tree[areaIds]
+          this.epuipList.push({
+            value:areaIds,
+            label:areaIds.split(',').map(e => CodeToText[e]).join('-'),
+            children:(area=>{
+              const areaList = []
+              for (let placeid in area){
+                const place = area[placeid]
+                areaList.push({
+                  value:placeid,
+                  ...place
+                })
+              }
+              return areaList
+            })(area)
+          })
+        }
+      }
+    })
+  },
+  mounted() {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth();
+      })();
+    };
+  },
+  methods: {
+    setPlace(e){
+      if (e){
+        const {row} = e
+        this.place = JSON.parse(JSON.stringify(row))
+        this.place.customerId = row.advertisementCustomer && row.advertisementCustomer.id;
+        this.place.advertisementEquList = row.advertisementEquList.map(e => {
+          return [e.areaIds, e.placeId, e.deliveryEquId]
+        })
+        this.fileList.push(row.adVideo)
+      }else{
+        this.place = this.initPlace()
+      }
+    },
+    initPlace() {
+      return {
+        id: "",
+        customerId: "",
+        adName: "",
+        advertisementEquList:[],
+        deliveryStartTime: "",
+        deliveryEndTime: "",
+      };
+    },
+    clearfile(){
+      this.fileList = []
+    },
+    handleUpload(e){
+      if (!this.fileList[0]){
+        this.fileList.pop()
+      }
+      if (this.fileList.length === 0){
+        const loadingInstance = Loading.service({text:'正在上传'});
+        ad.uploade({
+          file:e.file,
+          bizld: '业务主键',
+          bizType:'ADVERTISEMENT_AD_VIDEO',
+          isSingle:true
+        }).then(e => {
+          if (e.status === 200 && e.data.code === 0){
+            this.fileList.push(e.data.data.url)
+            loadingInstance.close();
+            this.$message({
+              message: '上传成功!',
+              type: 'success'
+            });
+          }
+        })
+      }else{
+        this.$message({
+        message: '只能上传一个文件',
+        type: 'warning'
+      });
+      }
+    },
+    initWidth() {
+      this.screenWidth = document.body.clientWidth;
+      if (this.screenWidth < 991) {
+        return "90%";
+      } else if (this.screenWidth < 1400) {
+        return "45%";
+      } else {
+        return "800px";
+      }
+    },
+    close() {
+      this.$emit("close");
+    },
+    reset() {
+      // 先清除校验,再清除表单,不然有奇怪的bug
+      this.$refs.form.clearValidate();
+      this.$refs.form.resetFields();
+      this.confirmDisabled = false;
+      this.place = this.initPlace();
+    },
+    submitForm() {
+      const vm = this;
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          vm.editSubmit();
+        } else {
+          return false;
+        }
+      });
+    },
+    editSubmit() {
+      const vm = this;
+      if (vm.type === "edit") {
+        vm.update();
+      } else {
+        vm.save();
+      }
+    },
+    save() {
+      const vm = this;
+
+      vm.confirmDisabled = true;
+      ad
+        .save(this.res)
+        .then((response) => {
+          const res = response.data;
+          if (res.isSuccess) {
+            vm.isVisible = false;
+            vm.$message({
+              message: vm.$t("tips.createSuccess"),
+              type: "success",
+            });
+            vm.$emit("success");
+          }
+        })
+        .finally(() => (vm.confirmDisabled = false));
+    },
+    update() {
+      const vm = this;
+      vm.confirmDisabled = true;
+      ad
+        .update(this.res)
+        .then((response) => {
+          const res = response.data;
+          if (res.isSuccess) {
+            vm.isVisible = false;
+            vm.$message({
+              message: this.$t("tips.updateSuccess"),
+              type: "success",
+            });
+            vm.$emit("success");
+          }
+        })
+        .finally(() => (vm.confirmDisabled = false));
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.from-item {
+  width: 100%;
+}
+</style>

+ 7 - 8
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/ad/client/Index.vue

@@ -78,7 +78,7 @@
         :show-overflow-tooltip="true"
         align="center"
         prop="customerName"
-        width=""
+        min-width="200px"
       >
         <template slot-scope="scope">
           <span>{{ scope.row.customerName }}</span>
@@ -90,7 +90,7 @@
         :show-overflow-tooltip="true"
         align="center"
         prop="contactName"
-        width=""
+        min-width="100px"
       >
         <template slot-scope="scope">
           <span>{{ scope.row.contactName }}</span>
@@ -102,7 +102,7 @@
         :show-overflow-tooltip="true"
         align="center"
         prop="contactPhone"
-        width=""
+        min-width="150px"
       >
         <template slot-scope="scope">
           <span>{{ scope.row.contactPhone }}</span>
@@ -114,10 +114,11 @@
         :show-overflow-tooltip="true"
         align="center"
         prop="customerRemark"
-        width=""
+        min-width="500px"
+
       >
         <template slot-scope="scope">
-          <span>{{ scope.row.customerRemark}}</span>
+          <span style="white-space: normal">{{ scope.row.customerRemark}}</span>
         </template>
       </el-table-column>
       <el-table-column
@@ -125,7 +126,7 @@
         align="center"
         column-key="operation"
         class-name="small-padding fixed-width"
-        width="100px"
+        min-width="100px"
       >
         <template slot-scope="{ row }">
           <i
@@ -186,11 +187,9 @@
 import Pagination from "@/components/Pagination";
 import elDragDialog from "@/directive/el-drag-dialog";
 import PlaceEdit from "./components/Edit";
-import placeApi from "@/api/Place.js";
 import { adc } from "@/api/adSomeelse";
 import PlaceImport from "@/components/zuihou/Import";
 import {
-  downloadFile,
   loadEnums,
   initDicts,
   initQueryParams,

+ 2 - 1
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/ad/client/components/Edit.vue

@@ -2,7 +2,7 @@
  * @Author: wangj
  * @Date: 2023-02-19 13:54:14
  * @LastEditors: @EXtreeDesigner
- * @LastEditTime: 2023-03-04 17:50:38
+ * @LastEditTime: 2023-03-04 18:19:51
  * @FilePath: \imcs-ui\src\views\zuihou\ad\client\components\Edit.vue
  * @Description: 
 -->
@@ -50,6 +50,7 @@
           type="textarea"
           v-model="place.customerRemark"
           :placeholder="$t('_ad.add.3')"
+          maxlength="255"
         />
       </el-form-item>
       <!-- 状态 -->