{"version":3,"sources":["webpack:///./src/components/heritageUnit/form/four/volume/form.vue?e3c9","webpack:///./src/components/heritageUnit/form/four/volume/form.vue?8f4a","webpack:///./src/components/heritageUnit/form/four/volume/form.vue?5b5a","webpack:///./src/components/heritageUnit/form/four/volume/form.vue","webpack:///./src/components/heritageUnit/form/four/volume/form.vue?3a41"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","categoryName","showDialog","close","onSubmit","ref","form","rules","model","value","callback","$$v","expandNames","expression","slot","staticClass","_v","$set","loading","_e","Id","AttachType","AttachGuid","fileExt","on","onFileClick","onFileChange","staticRenderFns","getFormRules","Name","required","message","trigger","name","refTarget","Object","assign","f","TempGuid","window","eventBus","$on","info","targetId","setData","data","$off","$refs","formData","resetFields","closeDialog","open","AttachId","setTimeout","$emit","validate","valid","obj","$message","type","then","response","msg","IsError","DataId","sendData","dangerouslyUseHTMLString","Message","console","log","attInfo","file","AttInfo","fileName","substr","lastIndexOf","categories","Key","item","find","v","Category","default","components","FormDialog","singleFile","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,cAAc,CAACE,MAAM,CAAC,KAAO,QAAQ,MAAQ,QAAQ,MAAQN,EAAIO,aAAa,KAAK,QAAUP,EAAIQ,WAAW,MAAQR,EAAIS,MAAM,OAAST,EAAIU,WAAW,CAACN,EAAG,UAAU,CAACO,IAAI,WAAWL,MAAM,CAAC,MAAQN,EAAIY,KAAK,cAAc,QAAQ,cAAc,GAAG,MAAQZ,EAAIa,QAAQ,CAACT,EAAG,cAAc,CAACU,MAAM,CAACC,MAAOf,EAAe,YAAEgB,SAAS,SAAUC,GAAMjB,EAAIkB,YAAYD,GAAKE,WAAW,gBAAgB,CAACf,EAAG,mBAAmB,CAACE,MAAM,CAAC,KAAO,SAAS,CAACF,EAAG,WAAW,CAACgB,KAAK,SAAS,CAAChB,EAAG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,IAAK,IAAKhD,KAAM,OAClB,CAAEgD,IAAK,IAAKhD,KAAM,OAClB,CAAEgD,IAAK,IAAKhD,KAAM,QAEhBiD,EAAOF,EAAWG,MAAK,SAAAC,GAAC,OAAIA,EAAEH,KAAO,EAAKvE,KAAK2E,YACnD,OAAOH,EAAOA,EAAKjD,KAAO,OAjC9B,GAAgD,QAK9C,gBADC,eAAK,CAAEqD,QAAS,Q,kCAJE,EAAkB,gBAHtC,eAAU,CACTC,WAAY,CAAEC,WAAA,OAAYC,aAAA,SAEP,WC/Dkb,I,wBCQncC,EAAY,eACd,EACA7F,EACAkC,GACA,EACA,KACA,WACA,MAIa,aAAA2D,E,6CCnBf,yBAAwiB,EAAG,G","file":"js/chunk-12ea9390.efbc4b64.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('form-dialog',{attrs:{\"size\":\"small\",\"width\":\"750px\",\"title\":_vm.categoryName+'维护',\"visible\":_vm.showDialog,\"close\":_vm.close,\"submit\":_vm.onSubmit}},[_c('el-form',{ref:\"formData\",attrs:{\"model\":_vm.form,\"label-width\":\"100px\",\"status-icon\":\"\",\"rules\":_vm.rules}},[_c('el-collapse',{model:{value:(_vm.expandNames),callback:function ($$v) {_vm.expandNames=$$v},expression:\"expandNames\"}},[_c('el-collapse-item',{attrs:{\"name\":\"info\"}},[_c('template',{slot:\"title\"},[_c('i',{staticClass:\"el-icon-collapse-plus-minus\"}),_vm._v(\" 基本信息\\n \")]),_c('div',[_c('el-row',{attrs:{\"gutter\":20}},[_c('el-col',{attrs:{\"span\":20}},[_c('el-form-item',{attrs:{\"label\":\"提名\",\"prop\":\"Name\"}},[_c('el-input',{attrs:{\"maxlength\":\"100\"},model:{value:(_vm.form.Name),callback:function ($$v) {_vm.$set(_vm.form, \"Name\", $$v)},expression:\"form.Name\"}})],1)],1)],1),_c('el-row',{attrs:{\"gutter\":20}},[_c('el-col',{attrs:{\"span\":20}},[_c('el-form-item',{attrs:{\"label\":\"备注\",\"prop\":\"Description\"}},[_c('el-input',{attrs:{\"type\":\"textarea\",\"rows\":\"7\",\"maxlength\":\"500\",\"placeholder\":\"\"},model:{value:(_vm.form.Description),callback:function ($$v) {_vm.$set(_vm.form, \"Description\", $$v)},expression:\"form.Description\"}})],1)],1)],1),_c('el-row',{attrs:{\"gutter\":20}},[_c('el-col',{attrs:{\"span\":20}},[_c('el-form-item',{attrs:{\"label\":\"附件\",\"prop\":\"AttachPath\"}},[(!_vm.loading)?_c('single-file',{ref:\"sfAttach\",attrs:{\"referId\":_vm.form.Id,\"referType\":_vm.form.AttachType,\"tempGuid\":_vm.form.AttachGuid,\"fileExt\":_vm.fileExt},on:{\"fileClick\":_vm.onFileClick,\"fileChange\":_vm.onFileChange}}):_vm._e()],1)],1)],1)],1)],2)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Watch, Prop } from 'vue-property-decorator'\r\nimport {\r\n FourVolumeData, emptyFourVolume, putVolume\r\n} from '@/api/heritageUnit/unitFour'\r\nimport { UploadOptData, thumbnailServer } from '@/api/common/upload'\r\nimport { showVaildMsg } from '@/configs/validate'\r\nimport * as attApi from '@/api/common/attach'\r\nimport { newGuid } from '@/configs/functions'\r\nimport singleFile from '@/components/upload/singleFile.vue'\r\nimport { imageFormat } from '@/configs/fileTypes'\r\nimport Element from 'element-ui'\r\nimport FormDialog from '@/components/dialog/formDialog.vue'\r\n\r\nconst getFormRules = (form: { [key: string]: string }) => {\r\n return {\r\n Name: [{ required: true, message: '请输入提名', trigger: 'blur' }]\r\n }\r\n}\r\n@Component({\r\n components: { FormDialog, singleFile }\r\n})\r\nexport default class UnitFourVolumeForm extends Vue {\r\n public name = 'UnitFourVolumeForm'\r\n public expandNames: string[] = ['info']\r\n // 关闭窗口,在 dialog 的 :before-close属性中触发,然后调用父级中的方法\r\n @Prop({ default: null })\r\n public closeDialog!: () => void\r\n public showDialog: boolean = false\r\n\r\n public fileExt = imageFormat + '.doc.docx.pdf'\r\n /*\r\n 主卷:101调查发掘 102防治监测 103文物展示 104电子文件 199续补卷 新加的:105文字卷 106保护规划及保护工程方案\r\n 副卷:201行政管理 202法律文书 203大事记 299续补卷\r\n 备考卷:301参考资料 302论文卷 303图书卷 399续补卷\r\n */\r\n get categoryName(): String {\r\n var categories = [\r\n { Key: 101, Name: '调查发掘' },\r\n { Key: 102, Name: '防治监测' },\r\n { Key: 103, Name: '文物展示' },\r\n { Key: 104, Name: '电子文件' },\r\n { Key: 105, Name: '文字卷' },\r\n { Key: 106, Name: '保护规划及保护工程方案' },\r\n { Key: 199, Name: '续补卷' },\r\n { Key: 201, Name: '行政管理' },\r\n { Key: 202, Name: '法律文书' },\r\n { Key: 203, Name: '大事记' },\r\n { Key: 299, Name: '续补卷' },\r\n { Key: 301, Name: '参考资料' },\r\n { Key: 302, Name: '论文卷' },\r\n { Key: 303, Name: '图书卷' },\r\n { Key: 399, Name: '续补卷' }\r\n ]\r\n var item = categories.find(v => v.Key == this.form.Category)\r\n return item ? item.Name : ''\r\n }\r\n public refTarget: string = ''\r\n public form: FourVolumeData = Object.assign({}, emptyFourVolume)\r\n public rules = getFormRules(this.form)\r\n\r\n public $refs!: {\r\n formData: Element.Form\r\n }\r\n public getFileUrl(f: attApi.AttachInfo) {\r\n return thumbnailServer(f.Id, f.TempGuid, f.Name)\r\n }\r\n public created() {\r\n // this.rules = getFormRules(this.form)\r\n }\r\n public loading: boolean = false\r\n public mounted() {\r\n window.eventBus.$on('openUnitFourVolumeForm', (info: any) => {\r\n this.refTarget = info.targetId\r\n this.setData(info.data)\r\n })\r\n }\r\n public beforeDestroy() {\r\n window.eventBus.$off('openUnitFourVolumeForm')\r\n }\r\n public open() {\r\n this.showDialog = true\r\n }\r\n public close() {\r\n this.showDialog = false\r\n this.$refs.formData.resetFields()\r\n if (this.closeDialog) {\r\n this.closeDialog()\r\n }\r\n }\r\n public setData(info: FourVolumeData) {\r\n this.open()\r\n this.loading = true\r\n if (info.AttachId == 0 && info.AttachGuid == '') {\r\n info.AttachGuid = newGuid()\r\n }\r\n this.form = Object.assign({}, info)\r\n\r\n setTimeout(() => {\r\n this.loading = false\r\n }, 500)\r\n }\r\n public sendData(data: FourVolumeData) {\r\n window.eventBus.$emit('submitUnitFourVolumeForm', {\r\n targetId: this.refTarget,\r\n data: data\r\n })\r\n }\r\n public onSubmit() {\r\n this.$refs.formData.validate((valid: boolean, obj: any) => {\r\n if (valid) {\r\n var f = Object.assign({}, this.form)\r\n if (f.AttachId == 0) {\r\n this.$message({\r\n message: `请上传图片!`,\r\n type: 'warning'\r\n })\r\n return false\r\n } else {\r\n putVolume(f.Id, f).then(\r\n (response: { data: any }) => {\r\n const data = response.data\r\n const msg = f.Id > 0 ? '保存' : '创建'\r\n if (data && !data.IsError) {\r\n this.$message({\r\n message: `${msg}成功`,\r\n type: 'success'\r\n })\r\n //如果是新增,需要获取新增后的Id\r\n f.Id = data.DataId\r\n this.sendData(f)\r\n this.close()\r\n } else {\r\n this.$message({\r\n dangerouslyUseHTMLString: true, message: `${data.Message}`,\r\n type: 'warning'\r\n })\r\n }\r\n },\r\n (data: any) => {\r\n console.log(data)\r\n }\r\n )\r\n }\r\n } else {\r\n showVaildMsg(this.$message, obj)\r\n }\r\n })\r\n }\r\n public onFileChange(data: { opts: UploadOptData, file: attApi.AttachInfo }) {\r\n var attInfo = data.file\r\n this.form.AttInfo = attInfo\r\n this.form.AttachId = attInfo.Id\r\n if (this.form.Name == '') {\r\n const fileName = attInfo.Name\r\n //去掉后缀名\r\n var name = fileName.substr(0, fileName.lastIndexOf('.'))\r\n this.form.Name = name\r\n }\r\n }\r\n public onFileClick(data: { opts: UploadOptData, file: attApi.AttachInfo }) {\r\n console.log('onFileClick', data)\r\n }\r\n\r\n}\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./form.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./form.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./form.vue?vue&type=template&id=c153ff1c&scoped=true&\"\nimport script from \"./form.vue?vue&type=script&lang=ts&\"\nexport * from \"./form.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./form.vue?vue&type=style&index=0&id=c153ff1c&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"c153ff1c\",\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./form.vue?vue&type=style&index=0&id=c153ff1c&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./form.vue?vue&type=style&index=0&id=c153ff1c&scoped=true&lang=css&\""],"sourceRoot":""}