qymljy 2 年之前
父節點
當前提交
70241c62c9

+ 21 - 9
src/HManagement/notice/dataAnalysis/index.vue

@@ -1,13 +1,24 @@
 <template>
   <div>
-    <div class="tabs normal-panel normal-margin">
-      <el-tabs v-model="activeName">
-        <el-tab-pane label="经销商分析" name="first"></el-tab-pane>
-        <el-tab-pane label="团队内部分析" name="second"></el-tab-pane>
-      </el-tabs>
-    </div>
-    <agent v-if="activeName === 'first'"></agent>
-    <group v-else></group>
+    <el-drawer
+        title="我是标题"
+        :visible.sync="drawer"
+        :with-header="false"
+        direction="rtl"
+        size="90%"
+        append-to-body>
+      <div class="detail__panel">
+        <div class="tabs normal-panel normal-margin">
+          <el-tabs v-model="activeName">
+            <el-tab-pane label="经销商分析" name="first"></el-tab-pane>
+            <el-tab-pane label="团队内部分析" name="second"></el-tab-pane>
+          </el-tabs>
+        </div>
+        <agent v-if="activeName === 'first'"></agent>
+        <group v-else></group>
+      </div>
+    </el-drawer>
+
   </div>
 </template>
 
@@ -22,7 +33,8 @@ export default {
   },
   data () {
     return {
-      activeName:'first'
+      activeName:'first',
+      drawer:true
     }
   },
   created () {

+ 29 - 6
src/HManagement/notice/index.vue

@@ -2,14 +2,28 @@
   <div>
     <basicLayout
         ref="list"
-        :oldFormPath="{
-        edit:'HManagement/notice/list/modules/edit.vue',
-        add:'HManagement/notice/list/modules/add.vue'
-        }"
+        :oldFormPath="{add:'HManagement/notice/list/modules'}"
         tableName="noticeTable"
         idName="sat_noticeid"
+        :apiId="{query:20221101094903,del:20221101095103}"
+        >
     >
-
+      <template v-slot:tbList="scope">
+        <div v-if="scope.data.column.columnname === 'status'">
+          <span v-if="scope.data.column.data.isontop === 1" style="color:#FF3B30">置顶</span>
+          <div v-else>
+            <span v-if="scope.data.column.data[scope.data.column.columnname] === '发布'" style="color:#52C41A">{{scope.data.column.data[scope.data.column.columnname]}}</span>
+            <span v-else>{{scope.data.column.data[scope.data.column.columnname]}}</span>
+          </div>
+        </div>
+        <div v-else>{{scope.data.column.data[scope.data.column.columnname]}}</div>
+      </template>
+      <template v-slot:tbOpreation="scope">
+        <edit :id="scope.data.data.sat_noticeid" @updateSuccess="onSuccess"></edit>
+        <el-button class="inline-16" v-if="tool.checkAuth($route.name,'data_analysis')" type="text" size="small" @click="$router.push({path:'/notice_analysis',query:{id:scope.data.data.sat_noticeid}})">数据分析</el-button>
+<!--        <el-button v-if="tool.checkAuth($route.name,'data_analysis')" type="text" size="small" @click="$router.push({path:'/notice_edit',query:{id:scope.data.data.sat_noticeid}})">详情</el-button>-->
+        <message class="inline-16" v-if="tool.checkAuth($route.name,'read')" :data="scope.data.data" @onSuccess="onSuccess"></message>
+      </template>
     </basicLayout>
 <!--    <div class="container normal-panel normal-margin">
       <el-button type="primary" icon="el-icon-plus" v-if="tool.checkAuth($route.name,'insert')" size="small" @click="$router.push({path:'/notice_add'})">新 建</el-button>
@@ -45,13 +59,22 @@ import message from './list/modules/message.vue'
 
 import onDel from './list/modules/delete.vue'
 
+import edit from './list/modules/edit'
+
+
 export default {
+  data(){
+    return {
+
+    }
+  },
   components:{
     list,
     release,
     topping,
     message,
-    onDel
+    onDel,
+    edit
   },
   methods:{
     onSuccess () {

+ 1 - 1
src/HManagement/notice/list/list.vue

@@ -49,7 +49,7 @@ export default {
   data () {
     return {
       params:{
-        "classname": "webmanage.saletool.notice.notice",
+        "id": "20221101094903",
         "method": "queryNoticeList",
         "content": {
           "pageNumber": 1,

+ 22 - 4
src/HManagement/notice/list/modules/add.vue

@@ -1,6 +1,19 @@
 <template>
   <div>
-    <p>创建通告中....</p>
+    <el-button size="small" type="primary"  @click="show(drawer=true)">新 增</el-button>
+    <!--    <p>创建通告中....</p>-->
+    <el-drawer
+        title="我是标题"
+        :visible.sync="drawer"
+        :with-header="false"
+        :wrapper-closable="false"
+        direction="rtl"
+        size="90%"
+        append-to-body>
+      <div class="detail__panel">
+
+      </div>
+    </el-drawer>
   </div>
 </template>
 
@@ -10,6 +23,7 @@ export default {
   },
   data () {
     return {
+      drawer:false,
       defaultData:{},
       folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
       form:{
@@ -29,16 +43,20 @@ export default {
     onChecked () {},
     async onSubmit () {
       const res = await this.$api.requested({
-        "classname": "webmanage.saletool.notice.notice",
+        "id": "20221101094803",
         "method": "insertormodify_notice",
         "content": this.form
       })
-      res.code === 1?this.$router.replace({path:'/notice_edit',query:{id:res.data.sat_noticeid}}):''
+      res.code === 1?this.$router.push({path:'/notice_add',query:{id:res.data.sat_noticeid}}):''
     },
+    show(){
+      this.drawer = false
+      this.onSubmit()
+    }
 
   },
   mounted () {
-    this.onSubmit()
+    /*this.onSubmit()*/
   }
 }
 

+ 51 - 0
src/HManagement/notice/list/modules/addCopy.vue

@@ -0,0 +1,51 @@
+<template>
+  <div>
+    <el-button size="small" type="primary" @click="show">新 增</el-button>
+<!--    <p>创建通告中....</p>-->
+  </div>
+</template>
+
+<script>
+export default {
+  components:{
+  },
+  data () {
+    return {
+      defaultData:{},
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      form:{
+        "sat_noticeid":0,
+        "sat_notice_classid": 0,
+        "title": "",
+        "summary": "",
+        "content": "",
+        "issecret": 1,
+        "begdate":(new Date()).toLocaleDateString(),
+        "enddate":(new Date()).toLocaleDateString(),
+        "isontop":0
+      }
+    }
+  },
+  methods:{
+    onChecked () {},
+    async onSubmit () {
+      const res = await this.$api.requested({
+        "id": "20221101094803",
+        "method": "insertormodify_notice",
+        "content": this.form
+      })
+      res.code === 1?this.$router.replace({path:'/notice_edit',query:{id:res.data.sat_noticeid}}):''
+    },
+    show(){
+      this.onSubmit()
+    }
+
+  },
+  mounted () {
+    /*this.onSubmit()*/
+  }
+}
+
+</script>
+<style>
+</style>

+ 280 - 0
src/HManagement/notice/list/modules/addCopy1.vue

@@ -0,0 +1,280 @@
+<template>
+  <div>
+    <el-button size="small" type="primary" @click="drawer=true">新 增</el-button>
+    <el-drawer
+        title="我是标题"
+        :visible.sync="drawer"
+        :with-header="false"
+        direction="rtl"
+        size="90%"
+        append-to-body>
+      <div class="detail__panel">
+        <div class="container normal-panel normal-margin sticky">
+<!--          <el-button v-show="save"  type="warning" size="small" icon="el-icon-s-claim" @click="onSubmit()" >保 存</el-button>-->
+          <el-button v-show="edit" type="primary" size="small" icon="el-icon-s-claim" @click="onEdit()" >编 辑</el-button>
+        </div>
+        <div style="overflow-x:hidden">
+          <el-row :gutter="16">
+            <el-col :span="13">
+              <div class="container normal-panel normal-margin">
+                <p class="normal-title normal-margin">通告设置</p>
+                <el-row :gutter="16">
+                  <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="left" size="small">
+                    <el-col :span="24">
+                      <el-form-item label="标题" prop="title">
+                        <el-input v-model="form.title"></el-input>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="导语" prop="summary">
+                        <el-input v-model="form.summary"></el-input>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-form-item label="板块" prop="sat_notice_classid">
+                        <el-select v-model="form.sat_notice_classid" placeholder="请选择">
+                          <el-option v-for="item in options" :key="item.sat_notice_classid" :label="item.classname"
+                                     :value="item.sat_notice_classid">
+                          </el-option>
+                        </el-select>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-form-item label="生效日期" prop="begdate">
+                        <el-date-picker style="width:100%" v-model="form.begdate" value-format="yyyy-MM-dd" type="date"
+                                        placeholder="生效日期">
+                        </el-date-picker>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-form-item label="截止日期" prop="enddate">
+                        <el-date-picker style="width:100%" v-model="form.enddate" value-format="yyyy-MM-dd" type="date"
+                                        placeholder="截止日期">
+                        </el-date-picker>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="是否置顶">
+                        <el-radio-group v-model="form.isontop">
+                          <el-radio :label="1">置顶</el-radio>
+                          <el-radio :label="0">不置顶</el-radio>
+                        </el-radio-group>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="通告封面">
+                        <previewImage v-if="form.cover" style="width:256px" :image="image" :deletebtn="true"
+                                      @onSuccess="clearCover"></previewImage>
+                        <upload v-else btntype="image" :folderid="folderid" accept=".JPG,.PNG"
+                                :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'cover' }"
+                                @onSuccess="onCoverSubmit"></upload>
+                        <p class="info">注:建议上传图片大小130x80像素,大小不超过2M,格式为JPG/PNG</p>
+                      </el-form-item>
+                    </el-col>
+                  </el-form>
+                </el-row>
+              </div>
+              <div class="container normal-panel normal-margin">
+                <attachmentList :attinfos="attinfo_video" @onSuccess="queryNoticeMain" :onlyread="store.state.pageOnlyRead">
+                  <p slot="title">视频附件</p>
+                  <upload slot="upload" accept=".mp4,.ogg,.webm" :folderid="folderid"
+                          :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'default' }"
+                          @onSuccess="onUploadSuccess"></upload>
+                </attachmentList>
+              </div>
+              <div class="container normal-panel normal-margin">
+                <attachmentList :attinfos="attinfo_attachment" @onSuccess="queryNoticeMain" :onlyread="store.state.pageOnlyRead">
+                  <upload slot="upload" :folderid="folderid"
+                          :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'default' }"
+                          @onSuccess="onUploadSuccess"></upload>
+                </attachmentList>
+              </div>
+              <div class="container normal-panel normal-margin">
+                <myEditor ref="editor" :content="form.content" :id="form.sat_noticeid"></myEditor>
+              </div>
+            </el-col>
+            <el-col :span="11">
+              <div class="container normal-panel normal-margin">
+                <!--                <scopeOfauth :defaultData="defaultData" appidname="sat_noticeid" obiectName="sat_notice" :dataid="$route.query.id"
+                                             @onChecked="onChecked"></scopeOfauth>-->
+                <scopeOfauth :defaultData="defaultData" appidname="sat_noticeid" obiectName="sat_notice" :dataid="id"
+                             @onChecked="onChecked"></scopeOfauth>
+              </div>
+            </el-col>
+          </el-row>
+        </div>
+<!--        <router-view v-if = "drawer"/>-->
+      </div>
+    </el-drawer>
+<!--    <p>创建通告中....</p>-->
+  </div>
+</template>
+
+<script>
+import upload from '@/components/upload/hw_obs_upload.vue'
+import previewImage from '@/components/previewImage/index.vue'
+import attachmentList from '@/components/attachment_list/index.vue'
+import scopeOfauth from '@/components/scopeOfAuthority/index.vue'
+import myEditor from '@/components/my-editor/Editor.vue'
+import store from '@/store'
+export default {
+  components:{
+    upload,
+    previewImage,
+    attachmentList,
+    scopeOfauth,
+    myEditor,
+
+  },
+  data () {
+    return {
+      store,
+      defaultData:{},
+      drawer:false,
+      edit:true,
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      form:{
+        "sat_noticeid":0,
+        "sat_notice_classid": 0,
+        "title": "",
+        "summary": "",
+        "content": "",
+        "issecret": 1,
+        "begdate":(new Date()).toLocaleDateString(),
+        "enddate":(new Date()).toLocaleDateString(),
+        "isontop":0
+      },
+      rules: {
+        title: [
+          { required: true, message: '请输入课程名称', trigger: 'blur' },
+        ],
+        begdate: [
+          { required: true, message: '请选择生效日期', trigger: 'change' }
+        ],
+        enddate: [
+          { required: true, message: '请选择截止日期', trigger: 'change' }
+        ],
+        sat_notice_classid: [
+          { required: true, message: '请选择版块', trigger: 'change' }
+        ],
+        summary: [
+          { required: true, message: '请输入导语', trigger: 'blur' },
+        ],
+      },
+      image: {},
+      authData: {},
+      attinfo_video: [],
+      attinfo_attachment: [],
+      options: [],
+    }
+  },
+  methods:{
+    // onChecked () {},
+    async onSubmit () {
+      const res = await this.$api.requested({
+        "id": "20221101094803",
+        "method": "insertormodify_notice",
+        "content": this.form
+      })
+      res.code === 1?this.$router.replace({path:'/notice_edit',query:{id:res.data.sat_noticeid}}):''
+    },
+    // 通告板块
+    async queryNoticeClass() {
+      const res = await this.$api.requested({
+        "id": "20221101094603",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 1000,
+          "where": {
+            "condition": ""
+          }
+        }
+      })
+      console.log("板块")
+      console.log(res)
+      this.options = res.data
+      this.form.sat_notice_classid = res.data[0].sat_notice_classid
+    },
+    // 获取封面信息
+    async queryFileLink() {
+      this.dialogEditVisible = true
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "queryFileLink",
+        "content": {
+          "ownertable": 'sat_notice',
+          "ownerid": this.form.sat_noticeid,
+          "usetype": 'cover'//传空返回有所
+        }
+      })
+      res.data[0] ? this.image = res.data[0] : this.image = { url: '' }
+    },
+    onCoverSubmit(res) {
+      this.form.cover = JSON.parse(res.attinfos).data[0].url
+      this.image = JSON.parse(res.attinfos).data[0]
+    },
+    clearCover() {
+      this.form.cover = null
+      this.image = {}
+    },
+    // 获取保存授权范围数据
+    onChecked(param) {
+      this.authData = param
+    },
+    // 新增授权范围
+    async insertCoursewareauth() {
+      const res = await this.$api.requested({
+        // "classname": "webmanage.saletool.notice.noticeauth",
+        // "method": "createNoticeAuth",
+        "id":20221101142003,
+        "content": this.authData
+      })
+      console.log("新增")
+      res.code === 0 ? this.$notify({
+        title: '失败',
+        message: res.data,
+        type: 'error'
+      }) : ''
+    },
+    // 查询授权信息
+    async query_auth() {
+      const res = await this.$api.requested({
+        "id":20221101142303,
+        "content": {
+          "sat_noticeid": this.id,
+        }
+      })
+      console.log("查询授权")
+      this.defaultData = res.data
+    },
+    onshow(){
+      this.$router.replace({path:'notice_mag_list',query:{id:this.id}})
+      this.queryNoticeMain()
+      this.query_auth()
+      this.edit = true
+      this.save = false
+    },
+    onEdit(){
+      this.edit = false
+      // this.save = true
+    },
+    show(){
+      /*this.onSubmit()*/
+    }
+
+  },
+  mounted () {
+    /*this.onSubmit()*/
+  }
+}
+
+</script>
+<style>
+.detail__panel{
+  background:#f1f2f3;
+  overflow-y: scroll;
+  font-size: 14px;
+  color:#666;
+  height:100vh;
+}
+</style>

+ 323 - 0
src/HManagement/notice/list/modules/add_notice.vue

@@ -0,0 +1,323 @@
+<template>
+  <div>
+    <el-drawer
+        title="我是标题"
+        :visible.sync="drawer"
+        :with-header="false"
+        :wrapper-closable="false"
+        direction="rtl"
+        size="90%"
+        append-to-body>
+      <div class="detail__panel">
+        <div class="container normal-panel normal-margin sticky">
+          <el-button   type="warning" size="small" icon="el-icon-s-claim" @click="onSubmit()" >保 存</el-button>
+          <el-button   size="small" icon="el-icon-s-claim" @click="cancel()" >取消</el-button>
+        </div>
+        <div style="overflow-x:hidden">
+          <el-row :gutter="16">
+            <el-col :span="13">
+              <div class="container normal-panel normal-margin">
+                <p class="normal-title normal-margin">通告设置</p>
+                <el-row :gutter="16">
+                  <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="left" size="small">
+                    <el-col :span="24">
+                      <el-form-item label="标题" prop="title">
+                        <el-input v-model="form.title"></el-input>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="导语" prop="summary">
+                        <el-input v-model="form.summary"></el-input>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-form-item label="板块" prop="sat_notice_classid">
+                        <el-select v-model="form.sat_notice_classid" placeholder="请选择">
+                          <el-option v-for="item in options" :key="item.sat_notice_classid" :label="item.classname"
+                                     :value="item.sat_notice_classid">
+                          </el-option>
+                        </el-select>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-form-item label="生效日期" prop="begdate">
+                        <el-date-picker style="width:100%" v-model="form.begdate" value-format="yyyy-MM-dd" type="date"
+                                        placeholder="生效日期">
+                        </el-date-picker>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-form-item label="截止日期" prop="enddate">
+                        <el-date-picker style="width:100%" v-model="form.enddate" value-format="yyyy-MM-dd" type="date"
+                                        placeholder="截止日期">
+                        </el-date-picker>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="是否置顶">
+                        <el-radio-group v-model="form.isontop">
+                          <el-radio :label="1">置顶</el-radio>
+                          <el-radio :label="0">不置顶</el-radio>
+                        </el-radio-group>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="通告封面">
+                        <previewImage v-if="form.cover" style="width:256px" :image="image" :deletebtn="true"
+                                      @onSuccess="clearCover"></previewImage>
+                        <upload v-else btntype="image" :folderid="folderid" accept=".JPG,.PNG"
+                                :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'cover' }"
+                                @onSuccess="onCoverSubmit"></upload>
+                        <p class="info">注:建议上传图片大小130x80像素,大小不超过2M,格式为JPG/PNG</p>
+                      </el-form-item>
+                    </el-col>
+                  </el-form>
+                </el-row>
+              </div>
+              <div class="container normal-panel normal-margin">
+                <attachmentList :attinfos="attinfo_video" @onSuccess="queryNoticeMain" :onlyread="store.state.pageOnlyRead">
+                  <p slot="title">视频附件</p>
+                  <upload slot="upload" accept=".mp4,.ogg,.webm" :folderid="folderid"
+                          :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'default' }"
+                          @onSuccess="onUploadSuccess"></upload>
+                </attachmentList>
+              </div>
+              <div class="container normal-panel normal-margin">
+                <attachmentList :attinfos="attinfo_attachment" @onSuccess="queryNoticeMain" :onlyread="store.state.pageOnlyRead">
+                  <upload slot="upload" :folderid="folderid"
+                          :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'default' }"
+                          @onSuccess="onUploadSuccess"></upload>
+                </attachmentList>
+              </div>
+              <div class="container normal-panel normal-margin">
+                <myEditor ref="editor" :content="form.content" :id="form.sat_noticeid"></myEditor>
+              </div>
+            </el-col>
+            <el-col :span="11">
+              <div class="container normal-panel normal-margin">
+                <!--                <scopeOfauth :defaultData="defaultData" appidname="sat_noticeid" obiectName="sat_notice" :dataid="$route.query.id"
+                                             @onChecked="onChecked"></scopeOfauth>-->
+                <scopeOfauth :defaultData="defaultData" appidname="sat_noticeid" obiectName="sat_notice" :dataid="$route.query.id"
+                             @onChecked="onChecked"></scopeOfauth>
+              </div>
+            </el-col>
+          </el-row>
+        </div>
+        <!--        <router-view v-if = "drawer"/>-->
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import upload from '@/components/upload/hw_obs_upload.vue'
+import previewImage from '@/components/previewImage/index.vue'
+import attachmentList from '@/components/attachment_list/index.vue'
+import scopeOfauth from '@/components/scopeOfAuthority/index.vue'
+import myEditor from '@/components/my-editor/Editor.vue'
+import store from '@/store'
+export default {
+  name: "add_notice",
+  components: {
+    upload,
+    previewImage,
+    attachmentList,
+    scopeOfauth,
+    myEditor
+  },
+  props:["id"],
+  data() {
+    return {
+      store,
+      folderid: JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      rules: {
+        title: [
+          { required: true, message: '请输入课程名称', trigger: 'blur' },
+        ],
+        begdate: [
+          { required: true, message: '请选择生效日期', trigger: 'change' }
+        ],
+        enddate: [
+          { required: true, message: '请选择截止日期', trigger: 'change' }
+        ],
+        sat_notice_classid: [
+          { required: true, message: '请选择版块', trigger: 'change' }
+        ],
+        summary: [
+          { required: true, message: '请输入导语', trigger: 'blur' },
+        ],
+      },
+      form: {
+        "title": "",
+        "notes": "",
+        "istextrequired": 1,
+        "isattrequired": 1,
+        "onceonly": 1,
+        "sat_submiteditmodelid": "0",
+        "begdate": "",
+        "enddate": "",
+        "issecret": false
+      },
+      defaultData: {},
+      image: {},
+      authData: {},
+      attinfo_video: [],
+      attinfo_attachment: [],
+      options: [],
+      drawer:false
+    }
+  },
+  methods: {
+    onUploadSuccess() {
+      this.form.status !== '新建' ? this.queryNoticeMain() : this.onSubmit()
+    },
+    onSubmit() {
+      this.$refs['form'].validate(async (valid) => {
+        if (!valid) return false;
+        this.form.content = this.$refs.editor.html
+        const res = await this.$api.requested({
+          "id": "20221101094803",
+          "method": "insertormodify_notice",
+          "content": this.form
+        })
+
+        this.insertCoursewareauth()
+        this.queryNoticeMain()
+        this.drawer = false
+        this.$emit("updateSuccess")
+        this.$router.go(-1)
+      });
+    },
+    //通告详情
+    async queryNoticeMain() {
+      const res = await this.$api.requested({
+        "id": "20221101095003",
+        // "method": "queryNoticeMain",
+        "content": {
+          "sat_noticeid": this.$route.query.id
+        }
+      })
+      this.attinfo_video = res.data.attinfos.filter(e => {
+        if (e.postfix === 'mp4' || e.postfix === 'ogg' || e.postfix === 'webm') {
+          return e
+        }
+      })
+      this.attinfo_attachment = res.data.attinfos.filter(e => {
+        if (e.postfix !== 'mp4' && e.postfix !== 'ogg' && e.postfix !== 'webm') {
+          return e
+        }
+      })
+      this.form = Object.assign({}, this.form, res.data)
+      this.form.status !== '新建'?this.$store.dispatch('pageOnlyRead',true):this.$store.dispatch('pageOnlyRead',false)
+      this.queryFileLink()
+      this.queryNoticeClass()
+    },
+    // 通告板块
+    async queryNoticeClass() {
+      const res = await this.$api.requested({
+        "id": "20221101094603",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 1000,
+          "where": {
+            "condition": ""
+          }
+        }
+      })
+      console.log("板块")
+      console.log(res)
+      this.options = res.data
+      this.form.sat_notice_classid = res.data[0].sat_notice_classid
+    },
+    // 获取封面信息
+    async queryFileLink() {
+      this.dialogEditVisible = true
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "queryFileLink",
+        "content": {
+          "ownertable": 'sat_notice',
+          "ownerid": this.form.sat_noticeid,
+          "usetype": 'cover'//传空返回有所
+        }
+      })
+      res.data[0] ? this.image = res.data[0] : this.image = { url: '' }
+    },
+    onCoverSubmit(res) {
+      this.form.cover = JSON.parse(res.attinfos).data[0].url
+      this.image = JSON.parse(res.attinfos).data[0]
+    },
+    clearCover() {
+      this.form.cover = null
+      this.image = {}
+    },
+    // 获取保存授权范围数据
+    onChecked(param) {
+      this.authData = param
+    },
+    // 新增授权范围
+    async insertCoursewareauth() {
+      const res = await this.$api.requested({
+        // "classname": "webmanage.saletool.notice.noticeauth",
+        // "method": "createNoticeAuth",
+        "id":20221101142003,
+        "content": this.authData
+      })
+      console.log("新增")
+      res.code === 0 ? this.$notify({
+        title: '失败',
+        message: res.data,
+        type: 'error'
+      }) : ''
+    },
+    // 查询授权信息
+    async query_auth() {
+      const res = await this.$api.requested({
+        "id":20221101142303,
+        "content": {
+          "sat_noticeid": this.$route.query.id,
+        }
+      })
+      console.log("查询授权")
+      this.defaultData = res.data
+    },
+    onshow(){
+     /* this.$router.replace({path:'notice_mag_list',query:{id:this.$route.query.id}})*/
+      this.queryNoticeMain()
+      this.query_auth()
+      /*this.edit = true
+      this.save = false*/
+    },
+    /*onEdit(){
+      this.edit = false
+      this.save = true
+    },*/
+    async cancel(){
+      this.drawer = false
+      console.log(this.$route.query.id)
+      const res = this.$api.requested({
+        "id":"20221101095103",
+        "content":{
+          "sat_noticeids": [this.$route.query.id]
+        }
+      })
+      this.$router.go(-1)
+    }
+  },
+  mounted() {
+    this.drawer = true
+    this.queryNoticeMain()
+    this.query_auth()
+  }
+}
+</script>
+
+<style scoped>
+.detail__panel{
+  background:#f1f2f3;
+  overflow-y: scroll;
+  font-size: 14px;
+  color:#666;
+  height:100vh;
+}
+</style>

+ 186 - 109
src/HManagement/notice/list/modules/edit.vue

@@ -1,96 +1,114 @@
 <template>
-  <div>
-    <div class="container normal-panel normal-margin sticky">
-      <el-button :disabled="store.state.pageOnlyRead" type="warning" size="small" icon="el-icon-s-claim" @click="onSubmit((res)=>tool.showMessage(res))" :loading="store.state.loading">保 存</el-button>
-    </div>
-    <div style="overflow-x:hidden">
-      <el-row :gutter="16">
-        <el-col :span="13">
-          <div class="container normal-panel normal-margin">
-            <p class="normal-title normal-margin">通告设置</p>
-            <el-row :gutter="16">
-              <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="left" size="small">
-                <el-col :span="24">
-                  <el-form-item label="标题" prop="title">
-                    <el-input v-model="form.title"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="24">
-                  <el-form-item label="导语" prop="summary">
-                    <el-input v-model="form.summary"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="板块" prop="sat_notice_classid">
-                    <el-select v-model="form.sat_notice_classid" placeholder="请选择">
-                      <el-option v-for="item in options" :key="item.sat_notice_classid" :label="item.classname"
-                        :value="item.sat_notice_classid">
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="生效日期" prop="begdate">
-                    <el-date-picker style="width:100%" v-model="form.begdate" value-format="yyyy-MM-dd" type="date"
-                      placeholder="生效日期">
-                    </el-date-picker>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="截止日期" prop="enddate">
-                    <el-date-picker style="width:100%" v-model="form.enddate" value-format="yyyy-MM-dd" type="date"
-                      placeholder="截止日期">
-                    </el-date-picker>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="24">
-                  <el-form-item label="是否置顶">
-                    <el-radio-group v-model="form.isontop">
-                      <el-radio :label="1">置顶</el-radio>
-                      <el-radio :label="0">不置顶</el-radio>
-                    </el-radio-group>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="24">
-                  <el-form-item label="通告封面">
-                    <previewImage v-if="form.cover" style="width:256px" :image="image" :deletebtn="true"
-                      @onSuccess="clearCover"></previewImage>
-                    <upload v-else btntype="image" :folderid="folderid" accept=".JPG,.PNG"
-                      :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'cover' }"
-                      @onSuccess="onCoverSubmit"></upload>
-                    <p class="info">注:建议上传图片大小130x80像素,大小不超过2M,格式为JPG/PNG</p>
-                  </el-form-item>
-                </el-col>
-              </el-form>
-            </el-row>
-          </div>
-          <div class="container normal-panel normal-margin">
-            <attachmentList :attinfos="attinfo_video" @onSuccess="queryNoticeMain" :onlyread="store.state.pageOnlyRead">
-              <p slot="title">视频附件</p>
-              <upload slot="upload" accept=".mp4,.ogg,.webm" :folderid="folderid"
-                :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'default' }"
-                @onSuccess="onUploadSuccess"></upload>
-            </attachmentList>
-          </div>
-          <div class="container normal-panel normal-margin">
-            <attachmentList :attinfos="attinfo_attachment" @onSuccess="queryNoticeMain" :onlyread="store.state.pageOnlyRead">
-              <upload slot="upload" :folderid="folderid"
-                :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'default' }"
-                @onSuccess="onUploadSuccess"></upload>
-            </attachmentList>
-          </div>
-          <div class="container normal-panel normal-margin">
-            <myEditor ref="editor" :content="form.content" :id="form.sat_noticeid"></myEditor>
-          </div>
-        </el-col>
-        <el-col :span="11">
-          <div class="container normal-panel normal-margin">
-            <scopeOfauth :defaultData="defaultData" appidname="sat_noticeid" obiectName="sat_notice" :dataid="$route.query.id"
-              @onChecked="onChecked"></scopeOfauth>
-          </div>
-        </el-col>
-      </el-row>
-    </div>
+  <div class="inline-16">
+    <el-button size="small" type="text" @click="onshow(drawer=true)">详情</el-button>
+    <el-drawer
+        title="我是标题"
+        :visible.sync="drawer"
+        :with-header="false"
+        direction="rtl"
+        size="90%"
+        append-to-body>
+      <div class="detail__panel">
+        <div class="container normal-panel normal-margin sticky">
+          <el-button v-show="save"  type="warning" size="small"  @click="onSubmit()" >保 存</el-button>
+          <el-button v-show="edit" type="primary" size="small"  @click="onEdit()" >编 辑</el-button>
+          <release v-show="release" class="inline-16" v-if="tool.checkAuth($route.name,'update') && status"  :data="form" @onSuccess="onSuccess"></release>
+          <topping v-show="top" v-if="tool.checkAuth($route.name,'update') && status" :data="form" @onSuccess="onSuccess"></topping>
+        </div>
+        <div style="overflow-x:hidden">
+          <el-row :gutter="16">
+            <el-col :span="13">
+              <div class="container normal-panel normal-margin">
+                <p class="normal-title normal-margin">通告设置</p>
+                <el-row :gutter="16">
+                  <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="left" size="small" :disabled="edit">
+                    <el-col :span="24">
+                      <el-form-item label="标题" prop="title">
+                        <el-input v-model="form.title"></el-input>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="导语" prop="summary">
+                        <el-input v-model="form.summary"></el-input>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-form-item label="板块" prop="sat_notice_classid">
+                        <el-select v-model="form.sat_notice_classid" placeholder="请选择">
+                          <el-option v-for="item in options" :key="item.sat_notice_classid" :label="item.classname"
+                                     :value="item.sat_notice_classid">
+                          </el-option>
+                        </el-select>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-form-item label="生效日期" prop="begdate">
+                        <el-date-picker style="width:100%" v-model="form.begdate" value-format="yyyy-MM-dd" type="date"
+                                        placeholder="生效日期">
+                        </el-date-picker>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="8">
+                      <el-form-item label="截止日期" prop="enddate">
+                        <el-date-picker style="width:100%" v-model="form.enddate" value-format="yyyy-MM-dd" type="date"
+                                        placeholder="截止日期">
+                        </el-date-picker>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="是否置顶">
+                        <el-radio-group v-model="form.isontop">
+                          <el-radio :label="1">置顶</el-radio>
+                          <el-radio :label="0">不置顶</el-radio>
+                        </el-radio-group>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                      <el-form-item label="通告封面">
+                        <previewImage v-if="form.cover" style="width:256px" :image="image" :deletebtn="true"
+                                      @onSuccess="clearCover"></previewImage>
+                        <upload v-else btntype="image" :folderid="folderid" accept=".JPG,.PNG"
+                                :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'cover' }"
+                                @onSuccess="onCoverSubmit"></upload>
+                        <p class="info">注:建议上传图片大小130x80像素,大小不超过2M,格式为JPG/PNG</p>
+                      </el-form-item>
+                    </el-col>
+                  </el-form>
+                </el-row>
+              </div>
+              <div class="container normal-panel normal-margin">
+                <attachmentList :attinfos="attinfo_video" @onSuccess="queryNoticeMain" :onlyread="store.state.pageOnlyRead" >
+                  <p slot="title">视频附件</p>
+                  <upload slot="upload" accept=".mp4,.ogg,.webm" :folderid="folderid"
+                          :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'default' }"
+                          @onSuccess="onUploadSuccess"></upload>
+                </attachmentList>
+              </div>
+              <div class="container normal-panel normal-margin">
+                <attachmentList :attinfos="attinfo_attachment" @onSuccess="queryNoticeMain" :onlyread="store.state.pageOnlyRead" >
+                  <upload slot="upload" :folderid="folderid"
+                          :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'default' }"
+                          @onSuccess="onUploadSuccess"></upload>
+                </attachmentList>
+              </div>
+              <div class="container normal-panel normal-margin">
+                <myEditor ref="editor" :content="form.content" :id="form.sat_noticeid"></myEditor>
+              </div>
+            </el-col>
+            <el-col :span="11">
+              <div class="container normal-panel normal-margin">
+<!--                <scopeOfauth :defaultData="defaultData" appidname="sat_noticeid" obiectName="sat_notice" :dataid="$route.query.id"
+                             @onChecked="onChecked"></scopeOfauth>-->
+                <scopeOfauth :defaultData="defaultData" appidname="sat_noticeid" obiectName="sat_notice" :dataid="id"
+                             @onChecked="onChecked"></scopeOfauth>
+              </div>
+            </el-col>
+          </el-row>
+        </div>
+        <!--        <router-view v-if = "drawer"/>-->
+      </div>
+    </el-drawer>
+
   </div>
 </template>
 
@@ -101,17 +119,27 @@ import attachmentList from '@/components/attachment_list/index.vue'
 import scopeOfauth from '@/components/scopeOfAuthority/index.vue'
 import myEditor from '@/components/my-editor/Editor.vue'
 import store from '@/store'
+import release from './release'
+import topping from './tp.vue'
 export default {
   components: {
     upload,
     previewImage,
     attachmentList,
     scopeOfauth,
-    myEditor
+    myEditor,
+    release,
+    topping
   },
+  props:["id"],
   data() {
     return {
       store,
+      edit:true,
+      save:false,
+      status:false,
+      release:true,
+      top:true,
       folderid: JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
       rules: {
         title: [
@@ -147,33 +175,36 @@ export default {
       attinfo_video: [],
       attinfo_attachment: [],
       options: [],
+      drawer:false
     }
   },
   methods: {
     onUploadSuccess() {
       this.form.status !== '新建' ? this.queryNoticeMain() : this.onSubmit()
     },
-    onSubmit(callbcak) {
+    onSubmit() {
       this.$refs['form'].validate(async (valid) => {
         if (!valid) return false;
         this.form.content = this.$refs.editor.html
         const res = await this.$api.requested({
-          "classname": "webmanage.saletool.notice.notice",
+          "id": "20221101094803",
           "method": "insertormodify_notice",
           "content": this.form
         })
-        callbcak?callbcak(res):''
+
         this.insertCoursewareauth()
         this.queryNoticeMain()
+        this.drawer = false
+        this.$emit("updateSuccess")
       });
     },
     //通告详情
     async queryNoticeMain() {
       const res = await this.$api.requested({
-        "classname": "webmanage.saletool.notice.notice",
-        "method": "queryNoticeMain",
+        "id": "20221101095003",
+        // "method": "queryNoticeMain",
         "content": {
-          "sat_noticeid": this.$route.query.id
+          "sat_noticeid": this.id
         }
       })
       this.attinfo_video = res.data.attinfos.filter(e => {
@@ -190,12 +221,14 @@ export default {
       this.form.status !== '新建'?this.$store.dispatch('pageOnlyRead',true):this.$store.dispatch('pageOnlyRead',false)
       this.queryFileLink()
       this.queryNoticeClass()
+      console.log("获取通告详细数据")
+      console.log(this.form)
+      this.status = true
     },
     // 通告板块
     async queryNoticeClass() {
       const res = await this.$api.requested({
-        "classname": "webmanage.saletool.notice.noticeclass",
-        "method": "queryNoticeClass",
+        "id": "20221101094603",
         "content": {
           "pageNumber": 1,
           "pageSize": 1000,
@@ -204,6 +237,8 @@ export default {
           }
         }
       })
+      console.log("板块")
+      console.log(res)
       this.options = res.data
       this.form.sat_notice_classid = res.data[0].sat_notice_classid
     },
@@ -219,7 +254,12 @@ export default {
           "usetype": 'cover'//传空返回有所
         }
       })
-      res.data[0] ? this.image = res.data[0] : this.image = { url: '' }
+      console.log("封面信息")
+      console.log(res)
+      this.image = res.data[0]
+      console.log("获取封面")
+      console.log(this.image)
+      /*res.data[0] ? this.image = res.data[0].url : this.image = { url: '' }*/
     },
     onCoverSubmit(res) {
       this.form.cover = JSON.parse(res.attinfos).data[0].url
@@ -236,10 +276,12 @@ export default {
     // 新增授权范围
     async insertCoursewareauth() {
       const res = await this.$api.requested({
-        "classname": "webmanage.saletool.notice.noticeauth",
-        "method": "createNoticeAuth",
+        // "classname": "webmanage.saletool.notice.noticeauth",
+        // "method": "createNoticeAuth",
+        "id":20221101142003,
         "content": this.authData
       })
+      console.log("新增")
       res.code === 0 ? this.$notify({
         title: '失败',
         message: res.data,
@@ -249,21 +291,56 @@ export default {
     // 查询授权信息
     async query_auth() {
       const res = await this.$api.requested({
-        "classname": "webmanage.saletool.notice.noticeauth",
-        "method": "queryNoticeAuth",
+        "id":20221101142303,
         "content": {
-          "sat_noticeid": this.$route.query.id,
+          "sat_noticeid": this.id,
         }
       })
+      console.log("查询授权")
       this.defaultData = res.data
     },
+    onshow(){
+      this.$router.replace({path:'notice_mag_list',query:{id:this.id}})
+      this.queryNoticeMain()
+      this.query_auth()
+      this.edit = true
+      this.save = false
+    },
+    onEdit(){
+      this.edit = false
+      this.save = true
+      this.release = false
+      this.top = false
+    },
+    handleCommand(command){
+      console.log(command)
+      if (command === 'analysis'){
+        this.dataAnalysis()
+      }else if(command === 'release'){
+
+      }
+    },
+    dataAnalysis(){
+      console.log("数据分析")
+      this.$router.push({path:'notice_analysis',query:{id:this.id}})
+    },
+    onSuccess(){
+      this.drawer = false
+      this.$emit("updateSuccess")
+    }
   },
   mounted() {
-    this.queryNoticeMain()
-    this.query_auth()
+    this.status = false
   }
 }
 
 </script>
 <style>
+.detail__panel{
+  background:#f1f2f3;
+  overflow-y: scroll;
+  font-size: 14px;
+  color:#666;
+  height:100vh;
+}
 </style>

+ 34 - 14
src/HManagement/notice/list/modules/message.vue

@@ -1,20 +1,40 @@
 <template>
   <div>
     <el-button type="text" size="mini" @click="query_message(dialogTableVisible = true)">查看留言</el-button>
-    <el-dialog title="留言信息" :visible.sync="dialogTableVisible">
-       <!-- 表格主题 -->
-      <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true">
-        <template v-slot:customcol="scope">
-          <div v-if="scope.column.columnname === 'usertype'">
-            <p v-if="scope.column.data.usertype === 1">企业员工</p>
-            <p v-else-if="scope.column.data.usertype === 21">经销商</p>
-            <p v-else-if="scope.column.data.usertype === 22">经销商员工</p>
-            <p v-else>未知</p>
-          </div>
-          <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
-        </template>
-      </tableLayout>
-    </el-dialog>
+    <el-drawer
+        title="我是标题"
+        :visible.sync="dialogTableVisible"
+        :with-header="false"
+        direction="rtl"
+        size="90%"
+        append-to-body>
+      <div class="detail__panel">
+        <basicLayout
+            ref="list"
+            formPath=""
+            tableName="tableMessage"
+            idName="sat_noticeid"
+            :apiId="{query:20221101095703,del:''}"
+        >
+
+        </basicLayout>
+<!--        <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true">
+          <template v-slot:customcol="scope">
+            <div v-if="scope.column.columnname === 'usertype'">
+              <p v-if="scope.column.data.usertype === 1">企业员工</p>
+              <p v-else-if="scope.column.data.usertype === 21">经销商</p>
+              <p v-else-if="scope.column.data.usertype === 22">经销商员工</p>
+              <p v-else>未知</p>
+            </div>
+            <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
+          </template>
+        </tableLayout>-->
+      </div>
+    </el-drawer>
+<!--    <el-dialog title="留言信息" :visible.sync="dialogTableVisible">
+       &lt;!&ndash; 表格主题 &ndash;&gt;
+
+    </el-dialog>-->
   </div>
 </template>
 

+ 75 - 5
src/HManagement/notice/list/modules/release.vue

@@ -1,6 +1,8 @@
 <template>
-  <div class="inline-16">
-    <el-button type="text" size="mini" @click="releaseNotice">{{data.status === '发布'?'取消发布':'发布'}}</el-button>
+  <div style="margin-left: 1%">
+<!--    <el-button type="text" size="mini" @click="releaseNotice">{{data.status === '发布'?'取消发布':'发布'}}</el-button>-->
+    <el-button v-show="release" type="primary" size="small"  @click="open">发布</el-button>
+    <el-button v-show="unRelease" type="primary" size="small"  @click="unOpen">取消发布</el-button>
   </div>
 </template>
 
@@ -8,13 +10,17 @@
 export default {
   props:['data'],
   data () {
-    return {}
+    return {
+      release:false,
+      unRelease:false
+    }
   },
   methods:{
     async releaseNotice () {
       const res = await this.$api.requested({
-        "classname": "webmanage.saletool.notice.notice",
-        "method": this.data.status === "发布"?"undercarriage":"release",
+        // "classname": "webmanage.saletool.notice.notice",
+        // "method": this.data.status === "发布"?"undercarriage":"release",
+        "id":"20221101095203",
         "content": {
           "sat_noticeids":[this.data.sat_noticeid]
         }
@@ -34,6 +40,70 @@ export default {
           type: 'error'
         });
       }
+    },
+    async unReleaseNotice () {
+      const res = await this.$api.requested({
+        // "classname": "webmanage.saletool.notice.notice",
+        // "method": this.data.status === "发布"?"undercarriage":"release",
+        "id":"20221101095303",
+        "content": {
+          "sat_noticeids":[this.data.sat_noticeid]
+        }
+      })
+      console.log(res)
+      if (res.code === 1) {
+        this.$notify({
+          title: '成功',
+          message: this.data.status === "发布"?'下架成功':'发布成功',
+          type: 'success'
+        });
+        this.$emit('onSuccess')
+      } else {
+        this.$notify({
+          title: '失败',
+          message: res.data,
+          type: 'error'
+        });
+      }
+    },
+    open() {
+      this.$confirm('确定发布此通告嘛?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.releaseNotice()
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消发布'
+        });
+      });
+    },
+    unOpen(){
+      this.$confirm('确定取消发布此通告嘛?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.unReleaseNotice()
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消操作'
+        });
+      });
+    }
+  },
+  mounted() {
+    console.log("发布状态数据")
+    console.log(this.data)
+    if (this.data.status === "新建"){
+      this.release = true
+      this.unRelease = false
+    }else{
+      this.release = false
+      this.unRelease = true
     }
   }
 }

+ 60 - 4
src/HManagement/notice/list/modules/tp.vue

@@ -1,6 +1,8 @@
 <template>
   <div class="inline-16">
-    <el-button type="text" size="mini" @click="releaseNotice">{{data.isontop === 0?'置顶':'取消置顶'}}</el-button>
+<!--    <el-button type="text" size="mini" @click="releaseNotice">{{data.isontop === 0?'置顶':'取消置顶'}}</el-button>-->
+    <el-button v-show="top" type="primary" size="small"  @click="open">置顶</el-button>
+    <el-button v-show="unTop" type="primary" size="small"  @click="unOpen">取消置顶</el-button>
   </div>
 </template>
 
@@ -8,13 +10,17 @@
 export default {
   props:['data'],
   data () {
-    return {}
+    return {
+      top:false,
+      unTop:false
+    }
   },
   methods:{
     async releaseNotice () {
       const res = await this.$api.requested({
-        "classname": "webmanage.saletool.notice.notice",
-        "method": this.data.isontop === 0?"topping":"cancelTopping",
+        /*"classname": "webmanage.saletool.notice.notice",
+        "method": this.data.isontop === 0?"topping":"cancelTopping",*/
+        "id":"20221101095403",
         "content": {
           "sat_noticeid":this.data.sat_noticeid
         }
@@ -22,6 +28,56 @@ export default {
       this.tool.showMessage(res,()=>{
         this.$emit('onSuccess')
       })
+    },
+    async unReleaseNotice () {
+      const res = await this.$api.requested({
+        /*"classname": "webmanage.saletool.notice.notice",
+        "method": this.data.isontop === 0?"topping":"cancelTopping",*/
+        "id":"20221101095503",
+        "content": {
+          "sat_noticeid":this.data.sat_noticeid
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.$emit('onSuccess')
+      })
+    },
+    open() {
+      this.$confirm('确定置顶此通告嘛?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.releaseNotice()
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消发布'
+        });
+      });
+    },
+    unOpen(){
+      this.$confirm('确定取消置顶此通告嘛?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.unReleaseNotice()
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消操作'
+        });
+      });
+    }
+  },
+  mounted() {
+    if (this.data.isontop === 0){
+      this.top = true
+      this.unTop = false
+    }else{
+      this.top = false
+      this.unTop = true
     }
   }
 }

+ 80 - 7
src/HManagement/notice/pate/index.vue

@@ -1,6 +1,36 @@
 <template>
   <div>
-    <list ref="list">
+    <basicLayout
+        ref="list"
+        :oldFormPath="{add:'HManagement/notice/pate/modules'}"
+        tableName="tablePate"
+        idName="sat_notice_classid"
+        :apiId="{query:20221101094603,del:20221101094703}"
+    >
+      <template v-slot:tbList="scope">
+        <div v-if="scope.data.column.columnname === 'classname'">
+          <el-input v-if="act_cus === scope.data.column.data.sat_notice_classid" size="mini" v-model="scope.data.column.data.classname" placeholder="输入版块名称"></el-input>
+          <p v-else>{{ scope.data.column.data.classname }} <i class="el-icon-edit"></i></p>
+        </div>
+        <div v-else-if="scope.data.column.columnname === 'issecret'">
+          <el-switch
+              :disabled="act_cus !== scope.data.column.data.sat_notice_classid"
+              v-model="scope.data.column.data.issecret"
+              active-color="#ff4949"
+              inactive-color="#ccc"
+              :active-value="1"
+              :inactive-value="0">
+          </el-switch>
+        </div>
+        <div v-else>
+          {{scope.data.column.data[[scope.data.column.columnname]]}}
+        </div>
+      </template>
+      <template v-slot:tbOpreation="scope">
+        <edit class="inline-16" :data="scope.data.data" @onSuccess="$refs.list.listData" @onEdit="onEdit"></edit>
+      </template>
+    </basicLayout>
+<!--    <list ref="list">
       <add v-if="tool.checkAuth($route.name,'insert')" slot="add" @addClick="addClick"></add>
       <template v-if="tool.checkAuth($route.name,'delete')" v-slot:del="scope">
         <ondel :data="scope.data.data" @onSuccess="$refs.list.queryTypeList()"></ondel>
@@ -8,31 +38,74 @@
       <template v-if="tool.checkAuth($route.name,'update')" v-slot:edit="scope">
         <edit class="inline-16" :data="scope.data.data" @onSuccess="$refs.list.queryTypeList()" @onEdit="onEdit"></edit>
       </template>
-    </list>
+    </list>-->
   </div>
-</template>onSuccess
+</template>
 
 <script>
 import list from './modules/list.vue'
 import add from './modules/add.vue'
 import edit from './modules/edit.vue'
 
-import ondel from './modules/del.vue'
 
 export default {
+  data(){
+    return {
+      act_cus:0,
+      pateList:[],
+      params:{
+        "id": "20221101094603",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 10,
+          "where":{
+            "condition":""
+          }
+        }
+      },
+    }
+  },
   components:{
     list,
     add,
     edit,
-    ondel
   },
   methods: {
     addClick () {
       this.$refs.list.addPate()
     },
     onEdit (data) {
-      this.$refs.list.cellClick(data)
-    }
+      this.cellClick(data)
+    },
+    cellClick (row) {
+      this.act_cus = row.sat_notice_classid
+    },
+    // 新增或更新版块
+    updatePate (row) {
+      this.$api.requested({
+        /*"classname": "webmanage.saletool.notice.noticeclass",
+        "method": "insertormodify_noticeclass",*/
+        "id":"20221101094503",
+        "content": row
+      }).then((res)=>{
+        this.tool.showMessage(res)
+        res.code === 1?this.act_cus = 0:''
+        this.$refs.list.listData()
+      })
+    },
+    // 插入新增行
+    addPate () {
+      this.act_cus = 0
+      this.pateList.unshift({
+        sat_notice_classid:0,
+        classname:"",
+        // issystem:0,
+        // fisused:1,
+        issecret:0,
+        fcolor:'#ccc',
+      })
+    },
+
   }
 }
 

+ 41 - 0
src/HManagement/notice/pate/indexCopy.vue

@@ -0,0 +1,41 @@
+<template>
+  <div>
+    <list ref="list">
+      <add v-if="tool.checkAuth($route.name,'insert')" slot="add" @addClick="addClick"></add>
+      <template v-if="tool.checkAuth($route.name,'delete')" v-slot:del="scope">
+        <ondel :data="scope.data.data" @onSuccess="$refs.list.queryTypeList()"></ondel>
+      </template>
+      <template v-if="tool.checkAuth($route.name,'update')" v-slot:edit="scope">
+        <edit class="inline-16" :data="scope.data.data" @onSuccess="$refs.list.queryTypeList()" @onEdit="onEdit"></edit>
+      </template>
+    </list>
+  </div>
+</template>
+
+<script>
+import list from './modules/list.vue'
+import add from './modules/add.vue'
+import edit from './modules/edit.vue'
+
+import ondel from './modules/del.vue'
+
+export default {
+  components:{
+    list,
+    add,
+    edit,
+    ondel
+  },
+  methods: {
+    addClick () {
+      this.$refs.list.addPate()
+    },
+    onEdit (data) {
+      this.$refs.list.cellClick(data)
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 2 - 2
src/HManagement/notice/pate/modules/add.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="container normal-panel normal-margin">
+  <div >
     <el-button icon="el-icon-plus" type="primary" size="small" @click="addPate">新 建</el-button>
   </div>
 </template>
@@ -12,7 +12,7 @@ export default {
   methods:{
     addPate () {
       this.$emit('addClick')
-    }
+    },
   }
 }
 

+ 4 - 3
src/HManagement/notice/pate/modules/del.vue

@@ -15,10 +15,11 @@ export default {
     deleteRow () {
       var that = this
       this.$api.requested({
-        "classname": "webmanage.saletool.notice.noticeclass",
-        "method": "delete",
+        // "classname": "webmanage.saletool.notice.noticeclass",
+        // "method": "delete",
+        "id":"20221101094703",
         "content": {
-          "sat_notice_classid":this.data.sat_notice_classid
+          "sat_notice_classids":[this.data.sat_notice_classid]
         }
       }).then((res)=>{
         this.tool.showMessage(res)

+ 4 - 4
src/HManagement/notice/pate/modules/list.vue

@@ -65,8 +65,7 @@ export default {
       pateList:[],
       formInline:{},
       params:{
-        "classname": "webmanage.saletool.notice.noticeclass",
-        "method": "queryNoticeClass",
+        "id": "20221101094603",
         "content": {
           "pageNumber": 1,
           "pageSize": 10,
@@ -120,8 +119,9 @@ export default {
     // 新增或更新版块
     updatePate (row) {
       this.$api.requested({
-        "classname": "webmanage.saletool.notice.noticeclass",
-        "method": "insertormodify_noticeclass",
+        /*"classname": "webmanage.saletool.notice.noticeclass",
+        "method": "insertormodify_noticeclass",*/
+        "id":"20221101094503",
         "content": row
       }).then((res)=>{
         this.tool.showMessage(res)

+ 4 - 4
src/router/HManagement.js

@@ -171,7 +171,7 @@ const HManagement = [
     path: '/notice_mag_list',
     name: 'noticemag',
     meta: {
-      title: '通告管理',
+      title: '通告发布',
       ast_nav: true
     },
     component: () => import(/* webpackChunkName: "about" */ '@/HManagement/notice/index.vue')
@@ -179,11 +179,11 @@ const HManagement = [
     path: '/notice_add',
     name: 'noticemag',
     meta: {
-      title: '编辑通告',
+      title: '新增通告',
       ast_nav:true,
       keeproute:true
     },
-    component: () => import(/* webpackChunkName: "about" */ '@/HManagement/notice/list/modules/add.vue')
+    component: () => import(/* webpackChunkName: "about" */ '@/HManagement/notice/list/modules/add_notice')
   }, {
     path: '/notice_edit',
     name: 'noticemag',
@@ -200,7 +200,7 @@ const HManagement = [
       title: '通告板块',
       ast_nav: true
     },
-    component: () => import(/* webpackChunkName: "about" */ '@/HManagement/notice/pate/index.vue')
+    component: () => import(/* webpackChunkName: "about" */ '@/HManagement/notice/pate/index')
   }, {
     path: '/notice_analysis',
     name: 'noticemag',