峰峰执法平台简易案件程序板块 pad端
yang
2022-10-17 4107256a8d1fa9a2db0969122bfc760994b12421
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<template>
  <el-main>
    <el-form :model="form" label-width="140px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="行政处罚决定书文号">
            <el-input v-model="form.name"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="公开情况">
            <el-checkbox-group v-model="form.checkList">
              <el-checkbox label="0"></el-checkbox>
              <el-checkbox label="1"></el-checkbox>
              <el-checkbox label="2"></el-checkbox>
            </el-checkbox-group>
          </el-form-item>
        </el-col>
      </el-row>
 
      <el-row>
        <el-col :span="24">
          <el-form-item label="公开网站">
            <el-input v-model="form.name"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-form-item label="网站公开情况截图">
          <el-upload
            action="/admin/sys-file/upload"
            list-type="picture-card"
            :headers="headers"
            :file-list="fileList"
            accept="image/png, image/jpeg"
            :on-preview="handlePictureCardPreview"
            :on-success="handleAvatarSuccess"
            :on-remove="handleRemove">
            <i class="el-icon-plus"></i>
          </el-upload>
          <el-dialog v-dialogDrag append-to-body :visible.sync="dialogVisible">
            <img width="100%" :src="dialogImageUrl" alt="">
          </el-dialog>
        </el-form-item>
      </el-row>
    </el-form>
    <div style="text-align: center">
      <el-button v-if="isFinish!='2'" plain @click="dataFormSubmit('0')">保存</el-button>
      <el-button v-if="isFinish!='2'" type="warning" plain @click="dataFormSubmit('1')">定稿</el-button>
      <el-button type="primary" plain @click="viewVord(form)">预览</el-button>
      <el-button type="success" plain @click="downloadWord(form)">下载</el-button>
    </div>
    <WordView ref="wordInfo" :isShowYulan="showView" @cancel="cancelWord"></WordView>
  </el-main>
</template>
 
<script>
    import WordView from "@/views/News/word-view";
    export default {
        name: "administrativeOpenSituation",
        props: ['isShowYulan','id','isFinish','processId','title'],
        components: {
            WordView
        },
        data() {
            return {
                form: {
                    name:'',
                    time:'',
                    checkList:['1']
                },
                showView: false,
                headers: {
                    'TENANT-ID': this.$store.getters.userInfo.tenantId,
                    Authorization: 'Bearer ' + this.$store.getters.access_token
                },
                dialogVisible:false,
                fileList:[],
                dialogImageUrl:''
            }
        },
        methods: {
            dataFormSubmit(type) {
 
            },
            viewVord(data) {
                this.showView = true;
                this.$nextTick(() => {
                    // this.$refs.wordInfo.init(data,"/wordes/criminalCasesLetter.docx")
                })
            },
            downloadWord(data) {
 
            },
            cancelWord() {
                this.showView = false;
            },
 
            /***图片上传****/
            fileChange(fileList) { //设置phone
                let temp_str = ''
                if(fileList.length > 0) {
                    for (let i = 0; i < fileList.length; i++) {
                        if(fileList[i].response) {
                            if(fileList[i].response.code == 0) {
                                if(i == 0) {
                                    temp_str += fileList[i].response.data.url
                                }else {
                                    temp_str += ',' + fileList[i].response.data.url
                                }
                            }
                        }else {
                            if( i == 0) {
                                temp_str += fileList[i].url
                            }else {
                                temp_str += ',' + fileList[i].url
                            }
                        }
                    }
                }
 
            },
            handleAvatarSuccess(response, file, fileList) {  //文件上传成功时的钩子
                console.log(response,'response')
                console.log(file,'file')
                console.log(fileList,'fileList')
                this.fileChange(fileList)
 
            },
            handleRemove(file, fileList) {  //文件列表移除文件时的钩子
                this.fileChange(fileList)
            },
            handlePictureCardPreview(file) { //点击文件列表中已上传的文件时的钩子
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            },
 
        }
    }
</script>
 
<style lang="scss" scoped>
  .avatar-uploader-box{
    width: 100px;
    height: 100px;
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
</style>