linwenxin 1 år sedan
förälder
incheckning
1447123b45

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
public/base64.min.js


+ 5 - 0
public/index.html

@@ -17,6 +17,11 @@
     type="text/javascript"
     charset="utf-8"
   ></script>
+  <script
+    src="./base64.min.js"
+    type="text/javascript"
+    charset="utf-8"
+  ></script>
     <title><%= webpackConfig.name %></title>
     <style></style>
   </head>

+ 16 - 0
src/components/file-upload/index.vue

@@ -24,6 +24,11 @@
             <i v-if="isEdit" class="el-icon-delete" @click="deleteImage(item.url)" />
           </div>
         </div>
+        <div style="display: flex;justify-content: space-around;">
+          <el-link v-if="viewOnline && (checkFileType(item.url) != 'file')" @click="getBase64(item.url)"
+            type="primary">查看</el-link>
+          <el-link v-if="download" :href="item.url" type="primary">下载</el-link>
+        </div>
       </div>
       <template v-if="isEdit">
         <div v-if="limit">
@@ -96,6 +101,14 @@ export default {
       type: Boolean,
       default: true
     },
+    viewOnline: {
+      type: Boolean,
+      default: true
+    },
+    download: {
+      type: Boolean,
+      default: true
+    },
   },
   data() {
     return {
@@ -168,6 +181,9 @@ export default {
     // })
   },
   methods: {
+    getBase64(url) {
+      window.open(this.$xdocUrl + encodeURIComponent(Base64.encode(url)), '_blank')
+    },
     getUUID() {
       return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
         return (c === 'x' ? (Math.random() * 16) | 0 : 'r&0x3' | '0x8').toString(16)

+ 107 - 5
src/views/setting/notification/announcement/index.vue

@@ -23,6 +23,17 @@
 				<el-button v-if="formDialogType < 2" size="mini" type="primary" @click="formConfirm('YES')">发布</el-button>
 			</div>
 		</el-dialog>
+		<el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog2"
+			:show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
+			<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+				<zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
+					:form-data="formData" :form-items="formItems2">
+				</zj-form-module>
+			</zj-form-container>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="mini" @click="formCancel">取 消</el-button>
+			</div>
+		</el-dialog>
 	</template-page>
 </template>
 
@@ -65,6 +76,7 @@ export default {
 			formDialogType: 0,
 			formDialogTitles: ["新增", "编辑", "详情"],
 			formDialog: false,
+			formDialog2: false,
 			formData: {
 				type: "A",
 				title: "",
@@ -84,7 +96,6 @@ export default {
 			return []
 		},
 		formItems() {
-			console.log(this.$store.state.app)
 			return [{
 				md: 24,
 				isShow: true,
@@ -184,6 +195,96 @@ export default {
 					)
 				}
 			}]
+		},
+		formItems2() {
+			return [{
+				md: 24,
+				isShow: true,
+				name: 'slot-component',
+				formItemAttributes: {
+					prop: 'type',
+					label: '',
+					'label-width': "0px"
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return <div>类型:{({ A: "活动", B: "公告" })[value]}</div>
+				}
+			},
+			{
+				md: 24,
+				isShow: true,
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', disabled: true },
+				formItemAttributes: {
+					prop: 'title',
+					label: '',
+					'label-width': "0px"
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return <div>标题:{value}</div>
+				}
+			},
+			{
+				md: 24,
+				isShow: true,
+				name: 'slot-component',
+				formItemAttributes: {
+					prop: 'content',
+					label: '',
+					'label-width': "0px"
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return <div domPropsInnerHTML={value}></div>
+				}
+			},
+			{
+				md: 24,
+				isShow: true,
+				name: 'slot-component',
+				formItemAttributes: {
+					prop: 'files',
+					label: '',
+					'label-width': "0px"
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return (
+						<ImageUpload fileList={this.formData.files} uid="idcardUpUrl_drawing_aiuh888" limit={100} isEdit={false} />
+					)
+				}
+			},
+			{
+				md: 24,
+				isShow: JSON.parse(localStorage.getItem("greemall_user")).type == 2,
+				name: 'slot-component',
+				formItemAttributes: {
+					prop: 'adminWebsitIds',
+					label: '',
+					'label-width': "0px"
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return <div>{this.websitList.filter(item => !!~value.indexOf(item.companyWechatId)).map(item => <el-tag style="margin-right:5px">{item.companyName}</el-tag>)}</div>
+				},
+			},
+			{
+				md: 24,
+				isShow: JSON.parse(localStorage.getItem("greemall_user")).type != 2,
+				name: 'slot-component',
+				options: this.workerList,
+				formItemAttributes: {
+					prop: 'workerIds',
+					label: '',
+					'label-width': "0px"
+				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return <div>{this.workerList.filter(item => !!~value.indexOf(item.id)).map(item => <el-tag style="margin-right:5px">{item.nickName}</el-tag>)}</div>
+				},
+			}]
 		}
 	},
 	methods: {
@@ -243,7 +344,7 @@ export default {
 							})) : []
 						})
 						this.formDialogType = 2
-						this.openForm()
+						this.openForm('formDialog2')
 					})
 				}}>查看</el-button>
 				{row.status == "NO" ? <el-popconfirm
@@ -268,16 +369,16 @@ export default {
 			this.formDialogType = 0
 			this.openForm()
 		},
-		openForm() {
+		openForm(key = 'formDialog') {
 			if (JSON.parse(localStorage.getItem("greemall_user")).type == 2) {
 				getListaa({ pageNum: 1, pageSize: -1, type: 1 }).then((res) => {
 					this.websitList = res.data.records
-					this.formDialog = true;
+					this[key] = true;
 				})
 			} else {
 				memberListPageV2({ "pageNum": 1, "pageSize": -1, "params": [] }).then(res => {
 					this.workerList = res.data.records
-					this.formDialog = true;
+					this[key] = true;
 				})
 			}
 		},
@@ -285,6 +386,7 @@ export default {
 			this.$refs.formRef.$refs.inlineForm.clearValidate()
 			this.$data.formData = this.$options.data().formData
 			this.formDialog = false
+			this.formDialog2 = false
 			this.websitList = []
 		},
 		formConfirm(status) {

+ 32 - 86
src/views/setting/notification/systemMessage/index.vue

@@ -2,17 +2,15 @@
 	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
 		:operationColumnWidth="200" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
 		:column-parsing="columnParsing" :operation="operation" :exportList="exportList">
-		<el-dialog title="" width="800px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
+		<el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog2"
 			:show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
 			<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
 				<zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
-					:form-data="formData" :form-items="formItems">
+					:form-data="formData" :form-items="formItems2">
 				</zj-form-module>
 			</zj-form-container>
 			<div slot="footer" class="dialog-footer">
 				<el-button size="mini" @click="formCancel">取 消</el-button>
-				<el-button v-if="formDialogType < 2" size="mini" type="primary" @click="formConfirm('NO')">保存</el-button>
-				<el-button v-if="formDialogType < 2" size="mini" type="primary" @click="formConfirm('YES')">发布</el-button>
 			</div>
 		</el-dialog>
 	</template-page>
@@ -32,16 +30,7 @@ export default {
 	data() {
 		return {
 			// 事件组合
-			optionsEvensGroup: [
-				[
-					[
-						{
-							name: '新建',
-							click: this.addData
-						}
-					],
-				],
-			],
+			optionsEvensGroup: [],
 			// 表格属性
 			tableAttributes: {
 				// 启用勾选列
@@ -57,6 +46,7 @@ export default {
 			formDialogType: 0,
 			formDialogTitles: ["新增", "编辑", "详情"],
 			formDialog: false,
+			formDialog2: false,
 			formData: {
 				type: "A",
 				title: "",
@@ -75,73 +65,34 @@ export default {
 		moreParameters() {
 			return []
 		},
-		formItems() {
-			console.log(this.$store.state.app)
+		formItems2() {
 			return [{
 				md: 24,
 				isShow: true,
-				name: 'el-radio',
-				options: [
-					{
-						label: `活动`,
-						value: "A"
-					},
-					{
-						label: `公告`,
-						value: "B"
-					}],
-				attributes: { filterable: true, placeholder: '请选择', disabled: this.formDialogType == 2 },
+				name: 'slot-component',
 				formItemAttributes: {
-					label: '类型',
 					prop: 'type',
-					rules: [...required]
+					label: '',
+					'label-width': "0px"
 				},
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return <div>类型:{({ A: "活动", B: "公告" })[value]}</div>
+				}
 			},
 			{
 				md: 24,
 				isShow: true,
-				name: 'el-input',
-				attributes: { placeholder: '请输入', disabled: this.formDialogType == 2 },
+				name: 'slot-component',
+				attributes: { placeholder: '请输入', disabled: true },
 				formItemAttributes: {
-					label: '标题',
 					prop: 'title',
-					rules: [...required]
-				}
-			},
-			{
-				md: 24,
-				isShow: this.formDialogType < 2 && JSON.parse(localStorage.getItem("greemall_user")).type == 2,
-				name: 'zj-paging-pull-down',
-				options: this.websitList,
-				attributes: {
-					valueKey: "companyWechatId",
-					labelKey: "companyName",
-					size: 'mini',
-					placeholder: '请选择',
-					multiple: true
+					label: '',
+					'label-width': "0px"
 				},
-				formItemAttributes: {
-					label: '选择商户',
-					prop: 'adminWebsitIds',
-					rules: [...required]
-				}
-			},
-			{
-				md: 24,
-				isShow: this.formDialogType < 2 && JSON.parse(localStorage.getItem("greemall_user")).type != 2,
-				name: 'zj-paging-pull-down',
-				options: this.workerList,
-				attributes: {
-					valueKey: "id",
-					labelKey: "nickName",
-					size: 'mini',
-					placeholder: '请选择',
-					multiple: true
-				},
-				formItemAttributes: {
-					label: '选择师傅',
-					prop: 'workerIds',
-					rules: [...required]
+				render: (h, { props, onInput }) => {
+					var { value } = props
+					return <div>标题:{value}</div>
 				}
 			},
 			{
@@ -149,15 +100,13 @@ export default {
 				isShow: true,
 				name: 'slot-component',
 				formItemAttributes: {
-					label: '附件',
-					prop: 'files',
-					rules: []
+					prop: 'content',
+					label: '',
+					'label-width': "0px"
 				},
 				render: (h, { props, onInput }) => {
 					var { value } = props
-					return (
-						<ImageUpload fileList={this.formData.files} uid="idcardUpUrl_drawing_aiuh" limit={100} isEdit={this.formDialogType !== 2} />
-					)
+					return <div domPropsInnerHTML={value}></div>
 				}
 			},
 			{
@@ -165,14 +114,14 @@ export default {
 				isShow: true,
 				name: 'slot-component',
 				formItemAttributes: {
-					label: '内容',
-					prop: 'content',
-					rules: [...required]
+					prop: 'files',
+					label: '',
+					'label-width': "0px"
 				},
 				render: (h, { props, onInput }) => {
 					var { value } = props
 					return (
-						<v-quill-editor value={value} onInput={onInput} disabled={this.formDialogType == 2} />
+						<ImageUpload fileList={this.formData.files} uid="idcardUpUrl_drawing_aiuh888" limit={100} isEdit={false} />
 					)
 				}
 			}]
@@ -206,25 +155,21 @@ export default {
 							})) : []
 						})
 						this.formDialogType = 2
-						this.openForm()
+						this.openForm('formDialog2')
 					})
 				}}>查看</el-button>
 			</div>)
 		},
-		addData() {
-			this.formDialogType = 0
-			this.openForm()
-		},
-		openForm() {
+		openForm(key = 'formDialog') {
 			if (JSON.parse(localStorage.getItem("greemall_user")).type == 2) {
 				getListaa({ pageNum: 1, pageSize: -1, type: 1 }).then((res) => {
 					this.websitList = res.data.records
-					this.formDialog = true;
+					this[key] = true;
 				})
 			} else {
 				memberListPageV2({ "pageNum": 1, "pageSize": -1, "params": [] }).then(res => {
 					this.workerList = res.data.records
-					this.formDialog = true;
+					this[key] = true;
 				})
 			}
 		},
@@ -232,6 +177,7 @@ export default {
 			this.$refs.formRef.$refs.inlineForm.clearValidate()
 			this.$data.formData = this.$options.data().formData
 			this.formDialog = false
+			this.formDialog2 = false
 			this.websitList = []
 		},
 	}

Vissa filer visades inte eftersom för många filer har ändrats