qy-vue-plugins 0.1.22 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/chunks/RenderFilterItem.vue_vue_type_script_setup_true_lang-C7LewC3j.js +104 -0
  2. package/dist/chunks/RenderFilterItem.vue_vue_type_script_setup_true_lang-D0A4wGEy.js +1 -0
  3. package/dist/chunks/{RenderFormItem.vue_vue_type_style_index_0_lang-LijDQik_.js → RenderFormItem.vue_vue_type_style_index_0_lang-D0DvBwFO.js} +1 -1
  4. package/dist/chunks/{RenderFormItem.vue_vue_type_style_index_0_lang-CGxnSN-x.js → RenderFormItem.vue_vue_type_style_index_0_lang-DiJ0BtfN.js} +1 -1
  5. package/dist/chunks/{imageReview.vue_vue_type_style_index_0_lang-B-S4Gh6W.js → imageReview.vue_vue_type_style_index_0_lang-BrTPEr6_.js} +1 -1
  6. package/dist/chunks/{imageReview.vue_vue_type_style_index_0_lang-CJi-hvC0.js → imageReview.vue_vue_type_style_index_0_lang-DmbHpPMb.js} +1 -1
  7. package/dist/chunks/utils-CYV5FAZZ.js +24 -0
  8. package/dist/chunks/utils-DdJHKOsc.js +1 -0
  9. package/dist/manageTable/RenderFilterItem.cjs +1 -0
  10. package/dist/manageTable/RenderFilterItem.mjs +4 -0
  11. package/dist/manageTable/RenderFormItem.cjs +1 -1
  12. package/dist/manageTable/RenderFormItem.mjs +1 -1
  13. package/dist/manageTable/imageReview.cjs +1 -1
  14. package/dist/manageTable/imageReview.mjs +1 -1
  15. package/dist/manageTable/index.cjs +1 -1
  16. package/dist/manageTable/index.mjs +1 -1
  17. package/dist/manageTable/manageTable.cjs +1 -1
  18. package/dist/manageTable/manageTable.mjs +291 -220
  19. package/dist/qy-vue-plugins.css +1 -1
  20. package/dist/types/manageTable/components/RenderFilterItem.vue.d.ts +15 -0
  21. package/dist/types/manageTable/utils.d.ts +2 -0
  22. package/dist/types/manageTable-components-RenderFilterItem.d.ts +4 -0
  23. package/dist/types/types/manageTable.d.ts +9 -2
  24. package/package/manageTable/utils.ts +50 -0
  25. package/package.json +2 -2
  26. package/dist/chunks/utils-DIRgjeAd.js +0 -10
  27. package/dist/chunks/utils-rH1yoZOz.js +0 -1
@@ -0,0 +1,104 @@
1
+ import { defineComponent as A, watch as f, ref as C, onMounted as h, createElementBlock as i, createCommentVNode as w, unref as t, openBlock as u, Fragment as m, createBlock as r, withCtx as v, renderList as y, withKeys as E } from "vue";
2
+ import { ElDatePicker as B, ElSelect as b, ElOption as c, ElOptionGroup as O, ElCascader as U, ElInput as j } from "element-plus";
3
+ const K = /* @__PURE__ */ A({
4
+ __name: "RenderFilterItem",
5
+ props: {
6
+ field: {},
7
+ modelValue: {}
8
+ },
9
+ emits: ["change", "update:modelValue"],
10
+ setup(k, { expose: _, emit: g }) {
11
+ const p = k;
12
+ f(
13
+ () => p.modelValue,
14
+ (V) => {
15
+ l.value = V[e.property + "__like"];
16
+ }
17
+ );
18
+ const l = C(null), e = p.field, d = g, n = () => {
19
+ e && (e.property != "projectId" ? d("update:modelValue", { [e.property + "__like"]: l.value }) : d("update:modelValue", { [e.property + "__in"]: l.value.length ? l.value.join() : null }), d("change"));
20
+ };
21
+ return f(l, () => {
22
+ e && (e.property != "projectId" ? d("update:modelValue", { [e.property + "__like"]: l.value }) : d("update:modelValue", { [e.property + "__in"]: l.value.length ? l.value.join() : null }));
23
+ }), _({
24
+ ButtonClick: () => {
25
+ n();
26
+ }
27
+ }), h(() => {
28
+ setTimeout(() => {
29
+ e && (e.property == "modelValue" ? l.value = p.modelValue[e.property + "__in"] : l.value = p.modelValue[e.property + "__like"]);
30
+ }, 100);
31
+ }), (V, o) => t(e) ? (u(), i(m, { key: 0 }, [
32
+ t(e).filterAble && t(e).filterAble == "date" ? (u(), r(t(B), {
33
+ key: 0,
34
+ modelValue: l.value,
35
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => l.value = a),
36
+ type: "daterange",
37
+ placeholder: "选择日期时间",
38
+ style: { width: "100%" },
39
+ "value-format": "X",
40
+ onChange: n
41
+ }, null, 8, ["modelValue"])) : t(e).filterAble && t(e).filterAble == "singleSelect" ? (u(), r(t(b), {
42
+ key: 1,
43
+ modelValue: l.value,
44
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => l.value = a),
45
+ style: { width: "100%" },
46
+ onChange: n,
47
+ clearable: ""
48
+ }, {
49
+ default: v(() => [
50
+ (u(!0), i(m, null, y(t(e).selectOptions, (a) => (u(), r(t(c), {
51
+ key: a.label,
52
+ label: a.label,
53
+ value: a.value
54
+ }, null, 8, ["label", "value"]))), 128))
55
+ ]),
56
+ _: 1
57
+ }, 8, ["modelValue"])) : t(e).filterAble && t(e).filterAble == "selectGroup" ? (u(), r(t(b), {
58
+ key: 2,
59
+ modelValue: l.value,
60
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => l.value = a),
61
+ style: { width: "100%" },
62
+ onChange: n,
63
+ clearable: ""
64
+ }, {
65
+ default: v(() => [
66
+ (u(!0), i(m, null, y(t(e).selectOptions, (a) => (u(), r(t(O), {
67
+ key: a.label,
68
+ label: a.label
69
+ }, {
70
+ default: v(() => [
71
+ (u(!0), i(m, null, y(a.children, (s) => (u(), r(t(c), {
72
+ key: s.label,
73
+ label: s.label,
74
+ value: s.value
75
+ }, null, 8, ["label", "value"]))), 128))
76
+ ]),
77
+ _: 2
78
+ }, 1032, ["label"]))), 128))
79
+ ]),
80
+ _: 1
81
+ }, 8, ["modelValue"])) : t(e).filterAble && t(e).filterAble == "cascader" ? (u(), r(t(U), {
82
+ key: 3,
83
+ modelValue: l.value,
84
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => l.value = a),
85
+ options: t(e).selectOptions,
86
+ placeholder: "请选择",
87
+ style: { width: "100%" },
88
+ onChange: n,
89
+ clearable: ""
90
+ }, null, 8, ["modelValue", "options"])) : (u(), r(t(j), {
91
+ key: 4,
92
+ modelValue: l.value,
93
+ "onUpdate:modelValue": o[4] || (o[4] = (a) => l.value = a),
94
+ placeholder: "请输入要搜索的关键字",
95
+ clearable: "",
96
+ onKeyup: E(n, ["enter", "native"]),
97
+ onClear: n
98
+ }, null, 8, ["modelValue"]))
99
+ ], 64)) : w("", !0);
100
+ }
101
+ });
102
+ export {
103
+ K as _
104
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),a=require("element-plus"),k=e.defineComponent({__name:"RenderFilterItem",props:{field:{},modelValue:{}},emits:["change","update:modelValue"],setup(i,{expose:f,emit:s}){const p=i;e.watch(()=>p.modelValue,c=>{t.value=c[l.property+"__like"]});const t=e.ref(null),l=p.field,u=s,n=()=>{l&&(l.property!="projectId"?u("update:modelValue",{[l.property+"__like"]:t.value}):u("update:modelValue",{[l.property+"__in"]:t.value.length?t.value.join():null}),u("change"))};return e.watch(t,()=>{l&&(l.property!="projectId"?u("update:modelValue",{[l.property+"__like"]:t.value}):u("update:modelValue",{[l.property+"__in"]:t.value.length?t.value.join():null}))}),f({ButtonClick:()=>{n()}}),e.onMounted(()=>{setTimeout(()=>{l&&(l.property=="modelValue"?t.value=p.modelValue[l.property+"__in"]:t.value=p.modelValue[l.property+"__like"])},100)}),(c,r)=>e.unref(l)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(l).filterAble&&e.unref(l).filterAble=="date"?(e.openBlock(),e.createBlock(e.unref(a.ElDatePicker),{key:0,modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=o=>t.value=o),type:"daterange",placeholder:"选择日期时间",style:{width:"100%"},"value-format":"X",onChange:n},null,8,["modelValue"])):e.unref(l).filterAble&&e.unref(l).filterAble=="singleSelect"?(e.openBlock(),e.createBlock(e.unref(a.ElSelect),{key:1,modelValue:t.value,"onUpdate:modelValue":r[1]||(r[1]=o=>t.value=o),style:{width:"100%"},onChange:n,clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).selectOptions,o=>(e.openBlock(),e.createBlock(e.unref(a.ElOption),{key:o.label,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.unref(l).filterAble&&e.unref(l).filterAble=="selectGroup"?(e.openBlock(),e.createBlock(e.unref(a.ElSelect),{key:2,modelValue:t.value,"onUpdate:modelValue":r[2]||(r[2]=o=>t.value=o),style:{width:"100%"},onChange:n,clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).selectOptions,o=>(e.openBlock(),e.createBlock(e.unref(a.ElOptionGroup),{key:o.label,label:o.label},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.children,d=>(e.openBlock(),e.createBlock(e.unref(a.ElOption),{key:d.label,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])):e.unref(l).filterAble&&e.unref(l).filterAble=="cascader"?(e.openBlock(),e.createBlock(e.unref(a.ElCascader),{key:3,modelValue:t.value,"onUpdate:modelValue":r[3]||(r[3]=o=>t.value=o),options:e.unref(l).selectOptions,placeholder:"请选择",style:{width:"100%"},onChange:n,clearable:""},null,8,["modelValue","options"])):(e.openBlock(),e.createBlock(e.unref(a.ElInput),{key:4,modelValue:t.value,"onUpdate:modelValue":r[4]||(r[4]=o=>t.value=o),placeholder:"请输入要搜索的关键字",clearable:"",onKeyup:e.withKeys(n,["enter","native"]),onClear:n},null,8,["modelValue"]))],64)):e.createCommentVNode("",!0)}});exports._sfc_main=k;
@@ -3,7 +3,7 @@ import { Plus as Ne, Calendar as Le } from "@element-plus/icons-vue";
3
3
  import Oe from "../manageTable/Block.mjs";
4
4
  import { dayjs as M, ElAutocomplete as Be, ElInput as A, ElSelect as z, ElOption as J, ElOptionGroup as Ie, ElDialog as B, ElUpload as _, ElIcon as ee, ElButton as L, ElEmpty as Pe, ElDatePicker as le, ElCascader as je, ElSwitch as qe, ElMessage as ae } from "element-plus";
5
5
  import { u as Fe, s as Re } from "./ProvideKeys-jhgDnhL_.js";
6
- import { h as I, b as Me, c as Ae } from "./utils-DIRgjeAd.js";
6
+ import { h as I, b as Me, c as Ae } from "./utils-CYV5FAZZ.js";
7
7
  const s = [];
8
8
  for (let t = 0; t < 256; ++t)
9
9
  s.push((t + 256).toString(16).slice(1));
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),O=require("@element-plus/icons-vue"),re=require("../manageTable/Block.cjs"),n=require("element-plus"),F=require("./ProvideKeys-BPenLFlD.js"),v=require("./utils-rH1yoZOz.js"),d=[];for(let o=0;o<256;++o)d.push((o+256).toString(16).slice(1));function ne(o,i=0){return(d[o[i+0]]+d[o[i+1]]+d[o[i+2]]+d[o[i+3]]+"-"+d[o[i+4]]+d[o[i+5]]+"-"+d[o[i+6]]+d[o[i+7]]+"-"+d[o[i+8]]+d[o[i+9]]+"-"+d[o[i+10]]+d[o[i+11]]+d[o[i+12]]+d[o[i+13]]+d[o[i+14]]+d[o[i+15]]).toLowerCase()}let U;const ie=new Uint8Array(16);function de(){if(!U){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");U=crypto.getRandomValues.bind(crypto)}return U(ie)}const se=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),q={randomUUID:se};function I(o,i,y){var u;if(q.randomUUID&&!o)return q.randomUUID();o=o||{};const p=o.random??((u=o.rng)==null?void 0:u.call(o))??de();if(p.length<16)throw new Error("Random bytes length must be >= 16");return p[6]=p[6]&15|64,p[8]=p[8]&63|128,ne(p)}const ce={class:"fromItem_style"},pe={class:"value"},fe={class:"link"},me={class:"voice-list",style:{"margin-top":"20px"}},ve=["src"],ye={style:{display:"flex","justify-content":"center",width:"auto"}},ke=["src"],Ve=e.defineComponent({__name:"RenderFormItem",props:{field:{type:Object,required:!0},data:null},emits:["change"],setup(o,{emit:i}){const y=e.inject(F.uploadFileKey),p=e.inject(F.speciesNameQueryKey);console.log("speciesList",p);const u=o,w=e.ref(!1),k=e.ref(!1),T=e.ref(),a=e.ref(null),P=e.computed(()=>u.field.layoutType=="singleSelect"),j=e.computed(()=>u.field.layoutType=="input"),M=e.computed(()=>u.field.layoutType=="number"),R=e.computed(()=>u.field.layoutType=="selectGroup"),E=e.computed(()=>u.field.layoutType=="multipleSelect"),A=e.computed(()=>u.field.layoutType=="textArea"),z=e.computed(()=>u.field.layoutType=="imageList"),J=e.computed(()=>u.field.layoutType=="voiceList"),$=e.computed(()=>u.field.layoutType=="cascader"),C=e.computed(()=>u.field.layoutType=="datePicker"||u.field.layout=="datePicker"),G=e.computed(()=>u.field.layoutType=="dateTimePicker"),Y=e.computed(()=>u.field.layoutType=="quadratChart"),D=e.computed(()=>(console.log("props.field.layoutType",u.field.layoutType),u.field.layoutType=="switch"));if(u.field.property)if(u.field.type=="custom"){if(a.value="",u.data.extra&&Object.keys(JSON.parse(u.data.extra)).length>0)if(a.value=JSON.parse(u.data.extra)[u.field.property],E.value)try{a.value=a.value!=""?a.value.split(/[,,、]/):[]}catch{a.value=[]}else C.value&&(a.value=a.value?n.dayjs(a.value).unix():n.dayjs().unix())}else if(D.value)a.value=u.data[u.field.property]==1;else if(E.value)try{let r=u.data[u.field.property];a.value=r!=""?r.split(/[,,、]/):[]}catch{a.value=[]}else a.value=u.data[u.field.property];if(u.field.propertyGroup){var S=[];u.field.propertyGroup.forEach(r=>{S.push(u.data[r])}),a.value=S}const V=i,c=()=>{u.field.type=="custom"&&C.value?V("change",n.dayjs(a.value*1e3).format("YYYY-MM-DD")):u.field.property=="speciesName"?V("change",{speciesName:a.value,latinName:b.value.canorical_me}):V("change",E.value?a.value.join("、"):a.value)},f=e.ref([]);if(u.field.layoutType=="imageList"&&(k.value=!0,a.value)){a.value=v.html_entity_decode(a.value);var x=JSON.parse(v.html_entity_decode(a.value));x.forEach(r=>{f.value.push({name:r.name,url:v.buildOriginUrl(r.url),imagePath:r.imagePath||"",id:r.id||"pc-"+I(),title:r.title||null,remark:r.remark||null,disabled:r.disabled||null})})}const K=r=>{T.value=r.url,w.value=!0},Q=()=>{a.value=JSON.stringify(f.value.map(r=>({...r,url:v.clearOssUrl(r.url)}))),c()},X=(r,t)=>{var l=new FormData;return l.append("file",r.file),l.append("type",t),y?y(l).then(s=>{f.value.forEach(m=>{m.uid==r.file.uid&&(console.log(m.uid,r.file.uid),m.url=s.info.url)})}).catch(s=>{n.ElMessage.error(s)}):Promise.reject(new Error("uploadFile function is not provided"))},g=e.ref(!1),h=e.ref([]);if(u.field.layoutType=="voiceList"&&(g.value=!0,a.value)){a.value=v.html_entity_decode(a.value);var x=JSON.parse(v.html_entity_decode(a.value));x.forEach(t=>{h.value.push(t)})}const H=(r,t)=>{var l=new FormData;l.append("file",r.file),l.append("type",t);const s=new FileReader;var m=0;return s.onload=function(B){const oe=new Blob([B.target.result]),ue=URL.createObjectURL(oe),L=new Audio(ue);L.addEventListener("loadedmetadata",function(){m=Math.round(L.duration/1e3)})},s.readAsArrayBuffer(r.file),y?y(l).then(B=>{h.value.push({name:r.file.name,url:B.info.url,id:"pc-"+I(),duration:m})}).catch(B=>{n.ElMessage.error(B.msg)}):Promise.reject(new Error("uploadFile function is not provided"))},W=()=>{a.value=JSON.stringify(h.value),c()},N=e.ref(!1);u.field.layoutType=="quadratChart"&&(N.value=!0);const Z=r=>{var t;(t=u.field.propertyGroup)==null||t.forEach((l,s)=>{a.value[l]=r[s]}),c()},_=()=>{c()};e.watch(()=>u.field,()=>{}),e.watch(f,()=>{});const ee=()=>{V("change",a.value?1:0)},le=async r=>{if(!p)throw new Error("speciesList is not provided");return(await p({species_name:r,page_size:100})).data},te=(r,t)=>{le(r).then(l=>{t(l)})},b=e.ref({}),ae=r=>{a.value=r.speciesC,b.value=r,V("change",{speciesName:a.value,latinName:b.value.canoricalMe})};return(r,t)=>(e.openBlock(),e.createElementBlock("div",ce,[j.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[u.field.property=="speciesName"?(e.openBlock(),e.createBlock(e.unref(n.ElAutocomplete),{key:0,modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=l=>a.value=l),"fetch-suggestions":te,"popper-class":"my-autocomplete",placeholder:o.field.placeholder,debounce:500,onBlur:c,onSelect:ae},{default:e.withCtx(({item:l})=>[e.createElementVNode("div",pe,e.toDisplayString(l.speciesC),1),e.createElementVNode("span",fe,e.toDisplayString(l.canoricalMe),1)]),_:1},8,["modelValue","placeholder"])):(e.openBlock(),e.createBlock(e.unref(n.ElInput),{key:1,modelValue:a.value,"onUpdate:modelValue":t[1]||(t[1]=l=>a.value=l),placeholder:o.field.placeholder,onBlur:c,class:e.normalizeClass({"input-latin-name":u.field.property=="latinName"})},null,8,["modelValue","placeholder","class"]))],64)):P.value?(e.openBlock(),e.createBlock(e.unref(n.ElSelect),{key:1,modelValue:a.value,"onUpdate:modelValue":t[2]||(t[2]=l=>a.value=l),placeholder:o.field.placeholder,onBlur:c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.field.selectOptions,l=>(e.openBlock(),e.createBlock(e.unref(n.ElOption),{key:l.label,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])):M.value?(e.openBlock(),e.createBlock(e.unref(n.ElInput),{key:2,modelValue:a.value,"onUpdate:modelValue":t[3]||(t[3]=l=>a.value=l),type:"number",placeholder:o.field.placeholder,onBlur:c},null,8,["modelValue","placeholder"])):R.value?(e.openBlock(),e.createBlock(e.unref(n.ElSelect),{key:3,modelValue:a.value,"onUpdate:modelValue":t[4]||(t[4]=l=>a.value=l),placeholder:o.field.placeholder,onBlur:c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.field.selectOptions,l=>(e.openBlock(),e.createBlock(e.unref(n.ElOptionGroup),{key:l.label,label:l.label},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.children,s=>(e.openBlock(),e.createBlock(e.unref(n.ElOption),{key:s.label,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","placeholder"])):E.value?(e.openBlock(),e.createBlock(e.unref(n.ElSelect),{key:4,modelValue:a.value,"onUpdate:modelValue":t[5]||(t[5]=l=>a.value=l),placeholder:o.field.placeholder,multiple:"","collapse-tags":"","collapse-tags-tooltip":"",onBlur:c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.field.selectOptions,l=>(e.openBlock(),e.createBlock(e.unref(n.ElOption),{key:l.label,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])):A.value?(e.openBlock(),e.createBlock(e.unref(n.ElInput),{key:5,type:"textarea",modelValue:a.value,"onUpdate:modelValue":t[6]||(t[6]=l=>a.value=l),placeholder:o.field.placeholder,onBlur:c},null,8,["modelValue","placeholder"])):z.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[t[22]||(t[22]=e.createTextVNode(" 编辑中 ")),e.createVNode(e.unref(n.ElDialog),{center:"",modelValue:k.value,"onUpdate:modelValue":t[10]||(t[10]=l=>k.value=l),title:"图片管理","append-to-body":"",onClose:Q},{footer:e.withCtx(()=>[e.createVNode(e.unref(n.ElButton),{onClick:t[8]||(t[8]=l=>k.value=!1)},{default:e.withCtx(()=>t[20]||(t[20]=[e.createTextVNode("取 消")])),_:1,__:[20]}),e.createVNode(e.unref(n.ElButton),{type:"primary",onClick:t[9]||(t[9]=l=>k.value=!1)},{default:e.withCtx(()=>t[21]||(t[21]=[e.createTextVNode("确 定")])),_:1,__:[21]})]),default:e.withCtx(()=>[e.createVNode(e.unref(n.ElUpload),{"on-preview":K,style:{margin:"10px 0 0 0"},"file-list":f.value,"onUpdate:fileList":t[7]||(t[7]=l=>f.value=l),action:"","http-request":l=>X(l,"1"),accept:"image/*","list-type":"picture-card"},{default:e.withCtx(()=>[e.createVNode(e.unref(n.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(O.Plus))]),_:1})]),_:1},8,["file-list","http-request"])]),_:1},8,["modelValue"])],64)):J.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[t[26]||(t[26]=e.createTextVNode(" 编辑中 ")),e.createVNode(e.unref(n.ElDialog),{center:"",modelValue:g.value,"onUpdate:modelValue":t[13]||(t[13]=l=>g.value=l),title:"声音管理","append-to-body":"",onClose:W},{footer:e.withCtx(()=>[e.createVNode(e.unref(n.ElButton),{onClick:t[11]||(t[11]=l=>g.value=!1)},{default:e.withCtx(()=>t[24]||(t[24]=[e.createTextVNode("取 消")])),_:1,__:[24]}),e.createVNode(e.unref(n.ElButton),{type:"primary",onClick:t[12]||(t[12]=l=>g.value=!1)},{default:e.withCtx(()=>t[25]||(t[25]=[e.createTextVNode("确 定")])),_:1,__:[25]})]),default:e.withCtx(()=>[e.createElementVNode("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("div",{key:s},[e.createElementVNode("audio",{src:l.url,controls:""},null,8,ve)]))),128)),h.value.length==0?(e.openBlock(),e.createBlock(e.unref(n.ElEmpty),{key:0,description:"没有声音文件"})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(n.ElUpload),{action:"","http-request":l=>H(l,"2"),"show-file-list":!1,accept:"audio/mpeg,audio/wav,audio/ogg,audio/flac,audio/mp3"},{default:e.withCtx(()=>[e.createVNode(e.unref(n.ElButton),{type:"primary",style:{"margin-top":"10px"},size:"default"},{default:e.withCtx(()=>t[23]||(t[23]=[e.createTextVNode("上传声音文件")])),_:1,__:[23]})]),_:1},8,["http-request"])]),_:1},8,["modelValue"])],64)):C.value?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),{key:8,modelValue:a.value,"onUpdate:modelValue":t[14]||(t[14]=l=>a.value=l),type:"date",placeholder:o.field.placeholder,"value-format":"X",onBlur:c},null,8,["modelValue","placeholder"])):G.value?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),{key:9,modelValue:a.value,"onUpdate:modelValue":t[15]||(t[15]=l=>a.value=l),type:"datetime",placeholder:o.field.placeholder,"value-format":"X",onBlur:c},null,8,["modelValue","placeholder"])):$.value?(e.openBlock(),e.createBlock(e.unref(n.ElCascader),{key:10,modelValue:a.value,"onUpdate:modelValue":t[16]||(t[16]=l=>a.value=l),options:o.field.selectOptions,placeholder:o.field.placeholder,onChange:Z},null,8,["modelValue","options","placeholder"])):Y.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[e.createVNode(e.unref(n.ElIcon),{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(O.Calendar))]),_:1}),e.createVNode(e.unref(n.ElDialog),{center:"",modelValue:N.value,"onUpdate:modelValue":t[17]||(t[17]=l=>N.value=l),title:"查看完成度","append-to-body":"",width:"650px",onClose:_},{default:e.withCtx(()=>[e.createVNode(re.default,{data:o.data},null,8,["data"])]),_:1},8,["modelValue"])],64)):D.value?(e.openBlock(),e.createBlock(e.unref(n.ElSwitch),{key:12,modelValue:a.value,"onUpdate:modelValue":t[18]||(t[18]=l=>a.value=l),onChange:ee},null,8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(n.ElDialog),{center:"",modelValue:w.value,"onUpdate:modelValue":t[19]||(t[19]=l=>w.value=l),"append-to-body":"","close-icon":"true"},{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createElementVNode("img",{src:T.value,alt:"",style:{height:"700px","object-fit":"contain"}},null,8,ke)])]),_:1},8,["modelValue"])]))}});exports._sfc_main=Ve;
1
+ "use strict";const e=require("vue"),O=require("@element-plus/icons-vue"),re=require("../manageTable/Block.cjs"),n=require("element-plus"),F=require("./ProvideKeys-BPenLFlD.js"),v=require("./utils-DdJHKOsc.js"),d=[];for(let o=0;o<256;++o)d.push((o+256).toString(16).slice(1));function ne(o,i=0){return(d[o[i+0]]+d[o[i+1]]+d[o[i+2]]+d[o[i+3]]+"-"+d[o[i+4]]+d[o[i+5]]+"-"+d[o[i+6]]+d[o[i+7]]+"-"+d[o[i+8]]+d[o[i+9]]+"-"+d[o[i+10]]+d[o[i+11]]+d[o[i+12]]+d[o[i+13]]+d[o[i+14]]+d[o[i+15]]).toLowerCase()}let U;const ie=new Uint8Array(16);function de(){if(!U){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");U=crypto.getRandomValues.bind(crypto)}return U(ie)}const se=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),q={randomUUID:se};function I(o,i,y){var u;if(q.randomUUID&&!o)return q.randomUUID();o=o||{};const p=o.random??((u=o.rng)==null?void 0:u.call(o))??de();if(p.length<16)throw new Error("Random bytes length must be >= 16");return p[6]=p[6]&15|64,p[8]=p[8]&63|128,ne(p)}const ce={class:"fromItem_style"},pe={class:"value"},fe={class:"link"},me={class:"voice-list",style:{"margin-top":"20px"}},ve=["src"],ye={style:{display:"flex","justify-content":"center",width:"auto"}},ke=["src"],Ve=e.defineComponent({__name:"RenderFormItem",props:{field:{type:Object,required:!0},data:null},emits:["change"],setup(o,{emit:i}){const y=e.inject(F.uploadFileKey),p=e.inject(F.speciesNameQueryKey);console.log("speciesList",p);const u=o,w=e.ref(!1),k=e.ref(!1),T=e.ref(),a=e.ref(null),P=e.computed(()=>u.field.layoutType=="singleSelect"),j=e.computed(()=>u.field.layoutType=="input"),M=e.computed(()=>u.field.layoutType=="number"),R=e.computed(()=>u.field.layoutType=="selectGroup"),E=e.computed(()=>u.field.layoutType=="multipleSelect"),A=e.computed(()=>u.field.layoutType=="textArea"),z=e.computed(()=>u.field.layoutType=="imageList"),J=e.computed(()=>u.field.layoutType=="voiceList"),$=e.computed(()=>u.field.layoutType=="cascader"),C=e.computed(()=>u.field.layoutType=="datePicker"||u.field.layout=="datePicker"),G=e.computed(()=>u.field.layoutType=="dateTimePicker"),Y=e.computed(()=>u.field.layoutType=="quadratChart"),D=e.computed(()=>(console.log("props.field.layoutType",u.field.layoutType),u.field.layoutType=="switch"));if(u.field.property)if(u.field.type=="custom"){if(a.value="",u.data.extra&&Object.keys(JSON.parse(u.data.extra)).length>0)if(a.value=JSON.parse(u.data.extra)[u.field.property],E.value)try{a.value=a.value!=""?a.value.split(/[,,、]/):[]}catch{a.value=[]}else C.value&&(a.value=a.value?n.dayjs(a.value).unix():n.dayjs().unix())}else if(D.value)a.value=u.data[u.field.property]==1;else if(E.value)try{let r=u.data[u.field.property];a.value=r!=""?r.split(/[,,、]/):[]}catch{a.value=[]}else a.value=u.data[u.field.property];if(u.field.propertyGroup){var S=[];u.field.propertyGroup.forEach(r=>{S.push(u.data[r])}),a.value=S}const V=i,c=()=>{u.field.type=="custom"&&C.value?V("change",n.dayjs(a.value*1e3).format("YYYY-MM-DD")):u.field.property=="speciesName"?V("change",{speciesName:a.value,latinName:b.value.canorical_me}):V("change",E.value?a.value.join("、"):a.value)},f=e.ref([]);if(u.field.layoutType=="imageList"&&(k.value=!0,a.value)){a.value=v.html_entity_decode(a.value);var x=JSON.parse(v.html_entity_decode(a.value));x.forEach(r=>{f.value.push({name:r.name,url:v.buildOriginUrl(r.url),imagePath:r.imagePath||"",id:r.id||"pc-"+I(),title:r.title||null,remark:r.remark||null,disabled:r.disabled||null})})}const K=r=>{T.value=r.url,w.value=!0},Q=()=>{a.value=JSON.stringify(f.value.map(r=>({...r,url:v.clearOssUrl(r.url)}))),c()},X=(r,t)=>{var l=new FormData;return l.append("file",r.file),l.append("type",t),y?y(l).then(s=>{f.value.forEach(m=>{m.uid==r.file.uid&&(console.log(m.uid,r.file.uid),m.url=s.info.url)})}).catch(s=>{n.ElMessage.error(s)}):Promise.reject(new Error("uploadFile function is not provided"))},g=e.ref(!1),h=e.ref([]);if(u.field.layoutType=="voiceList"&&(g.value=!0,a.value)){a.value=v.html_entity_decode(a.value);var x=JSON.parse(v.html_entity_decode(a.value));x.forEach(t=>{h.value.push(t)})}const H=(r,t)=>{var l=new FormData;l.append("file",r.file),l.append("type",t);const s=new FileReader;var m=0;return s.onload=function(B){const oe=new Blob([B.target.result]),ue=URL.createObjectURL(oe),L=new Audio(ue);L.addEventListener("loadedmetadata",function(){m=Math.round(L.duration/1e3)})},s.readAsArrayBuffer(r.file),y?y(l).then(B=>{h.value.push({name:r.file.name,url:B.info.url,id:"pc-"+I(),duration:m})}).catch(B=>{n.ElMessage.error(B.msg)}):Promise.reject(new Error("uploadFile function is not provided"))},W=()=>{a.value=JSON.stringify(h.value),c()},N=e.ref(!1);u.field.layoutType=="quadratChart"&&(N.value=!0);const Z=r=>{var t;(t=u.field.propertyGroup)==null||t.forEach((l,s)=>{a.value[l]=r[s]}),c()},_=()=>{c()};e.watch(()=>u.field,()=>{}),e.watch(f,()=>{});const ee=()=>{V("change",a.value?1:0)},le=async r=>{if(!p)throw new Error("speciesList is not provided");return(await p({species_name:r,page_size:100})).data},te=(r,t)=>{le(r).then(l=>{t(l)})},b=e.ref({}),ae=r=>{a.value=r.speciesC,b.value=r,V("change",{speciesName:a.value,latinName:b.value.canoricalMe})};return(r,t)=>(e.openBlock(),e.createElementBlock("div",ce,[j.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[u.field.property=="speciesName"?(e.openBlock(),e.createBlock(e.unref(n.ElAutocomplete),{key:0,modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=l=>a.value=l),"fetch-suggestions":te,"popper-class":"my-autocomplete",placeholder:o.field.placeholder,debounce:500,onBlur:c,onSelect:ae},{default:e.withCtx(({item:l})=>[e.createElementVNode("div",pe,e.toDisplayString(l.speciesC),1),e.createElementVNode("span",fe,e.toDisplayString(l.canoricalMe),1)]),_:1},8,["modelValue","placeholder"])):(e.openBlock(),e.createBlock(e.unref(n.ElInput),{key:1,modelValue:a.value,"onUpdate:modelValue":t[1]||(t[1]=l=>a.value=l),placeholder:o.field.placeholder,onBlur:c,class:e.normalizeClass({"input-latin-name":u.field.property=="latinName"})},null,8,["modelValue","placeholder","class"]))],64)):P.value?(e.openBlock(),e.createBlock(e.unref(n.ElSelect),{key:1,modelValue:a.value,"onUpdate:modelValue":t[2]||(t[2]=l=>a.value=l),placeholder:o.field.placeholder,onBlur:c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.field.selectOptions,l=>(e.openBlock(),e.createBlock(e.unref(n.ElOption),{key:l.label,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])):M.value?(e.openBlock(),e.createBlock(e.unref(n.ElInput),{key:2,modelValue:a.value,"onUpdate:modelValue":t[3]||(t[3]=l=>a.value=l),type:"number",placeholder:o.field.placeholder,onBlur:c},null,8,["modelValue","placeholder"])):R.value?(e.openBlock(),e.createBlock(e.unref(n.ElSelect),{key:3,modelValue:a.value,"onUpdate:modelValue":t[4]||(t[4]=l=>a.value=l),placeholder:o.field.placeholder,onBlur:c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.field.selectOptions,l=>(e.openBlock(),e.createBlock(e.unref(n.ElOptionGroup),{key:l.label,label:l.label},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.children,s=>(e.openBlock(),e.createBlock(e.unref(n.ElOption),{key:s.label,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","placeholder"])):E.value?(e.openBlock(),e.createBlock(e.unref(n.ElSelect),{key:4,modelValue:a.value,"onUpdate:modelValue":t[5]||(t[5]=l=>a.value=l),placeholder:o.field.placeholder,multiple:"","collapse-tags":"","collapse-tags-tooltip":"",onBlur:c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.field.selectOptions,l=>(e.openBlock(),e.createBlock(e.unref(n.ElOption),{key:l.label,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])):A.value?(e.openBlock(),e.createBlock(e.unref(n.ElInput),{key:5,type:"textarea",modelValue:a.value,"onUpdate:modelValue":t[6]||(t[6]=l=>a.value=l),placeholder:o.field.placeholder,onBlur:c},null,8,["modelValue","placeholder"])):z.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[t[22]||(t[22]=e.createTextVNode(" 编辑中 ")),e.createVNode(e.unref(n.ElDialog),{center:"",modelValue:k.value,"onUpdate:modelValue":t[10]||(t[10]=l=>k.value=l),title:"图片管理","append-to-body":"",onClose:Q},{footer:e.withCtx(()=>[e.createVNode(e.unref(n.ElButton),{onClick:t[8]||(t[8]=l=>k.value=!1)},{default:e.withCtx(()=>t[20]||(t[20]=[e.createTextVNode("取 消")])),_:1,__:[20]}),e.createVNode(e.unref(n.ElButton),{type:"primary",onClick:t[9]||(t[9]=l=>k.value=!1)},{default:e.withCtx(()=>t[21]||(t[21]=[e.createTextVNode("确 定")])),_:1,__:[21]})]),default:e.withCtx(()=>[e.createVNode(e.unref(n.ElUpload),{"on-preview":K,style:{margin:"10px 0 0 0"},"file-list":f.value,"onUpdate:fileList":t[7]||(t[7]=l=>f.value=l),action:"","http-request":l=>X(l,"1"),accept:"image/*","list-type":"picture-card"},{default:e.withCtx(()=>[e.createVNode(e.unref(n.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(O.Plus))]),_:1})]),_:1},8,["file-list","http-request"])]),_:1},8,["modelValue"])],64)):J.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[t[26]||(t[26]=e.createTextVNode(" 编辑中 ")),e.createVNode(e.unref(n.ElDialog),{center:"",modelValue:g.value,"onUpdate:modelValue":t[13]||(t[13]=l=>g.value=l),title:"声音管理","append-to-body":"",onClose:W},{footer:e.withCtx(()=>[e.createVNode(e.unref(n.ElButton),{onClick:t[11]||(t[11]=l=>g.value=!1)},{default:e.withCtx(()=>t[24]||(t[24]=[e.createTextVNode("取 消")])),_:1,__:[24]}),e.createVNode(e.unref(n.ElButton),{type:"primary",onClick:t[12]||(t[12]=l=>g.value=!1)},{default:e.withCtx(()=>t[25]||(t[25]=[e.createTextVNode("确 定")])),_:1,__:[25]})]),default:e.withCtx(()=>[e.createElementVNode("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("div",{key:s},[e.createElementVNode("audio",{src:l.url,controls:""},null,8,ve)]))),128)),h.value.length==0?(e.openBlock(),e.createBlock(e.unref(n.ElEmpty),{key:0,description:"没有声音文件"})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(n.ElUpload),{action:"","http-request":l=>H(l,"2"),"show-file-list":!1,accept:"audio/mpeg,audio/wav,audio/ogg,audio/flac,audio/mp3"},{default:e.withCtx(()=>[e.createVNode(e.unref(n.ElButton),{type:"primary",style:{"margin-top":"10px"},size:"default"},{default:e.withCtx(()=>t[23]||(t[23]=[e.createTextVNode("上传声音文件")])),_:1,__:[23]})]),_:1},8,["http-request"])]),_:1},8,["modelValue"])],64)):C.value?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),{key:8,modelValue:a.value,"onUpdate:modelValue":t[14]||(t[14]=l=>a.value=l),type:"date",placeholder:o.field.placeholder,"value-format":"X",onBlur:c},null,8,["modelValue","placeholder"])):G.value?(e.openBlock(),e.createBlock(e.unref(n.ElDatePicker),{key:9,modelValue:a.value,"onUpdate:modelValue":t[15]||(t[15]=l=>a.value=l),type:"datetime",placeholder:o.field.placeholder,"value-format":"X",onBlur:c},null,8,["modelValue","placeholder"])):$.value?(e.openBlock(),e.createBlock(e.unref(n.ElCascader),{key:10,modelValue:a.value,"onUpdate:modelValue":t[16]||(t[16]=l=>a.value=l),options:o.field.selectOptions,placeholder:o.field.placeholder,onChange:Z},null,8,["modelValue","options","placeholder"])):Y.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[e.createVNode(e.unref(n.ElIcon),{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(O.Calendar))]),_:1}),e.createVNode(e.unref(n.ElDialog),{center:"",modelValue:N.value,"onUpdate:modelValue":t[17]||(t[17]=l=>N.value=l),title:"查看完成度","append-to-body":"",width:"650px",onClose:_},{default:e.withCtx(()=>[e.createVNode(re.default,{data:o.data},null,8,["data"])]),_:1},8,["modelValue"])],64)):D.value?(e.openBlock(),e.createBlock(e.unref(n.ElSwitch),{key:12,modelValue:a.value,"onUpdate:modelValue":t[18]||(t[18]=l=>a.value=l),onChange:ee},null,8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(n.ElDialog),{center:"",modelValue:w.value,"onUpdate:modelValue":t[19]||(t[19]=l=>w.value=l),"append-to-body":"","close-icon":"true"},{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createElementVNode("img",{src:T.value,alt:"",style:{height:"700px","object-fit":"contain"}},null,8,ke)])]),_:1},8,["modelValue"])]))}});exports._sfc_main=Ve;
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),d=require("@element-plus/icons-vue"),s=require("./utils-rH1yoZOz.js"),o=require("element-plus"),m={class:"image_Tag_style"},_={class:"image_box"},f={class:"image-item"},g=["src"],v=e.defineComponent({__name:"imageReview",setup(p,{expose:c}){const r=e.ref(!1),a=e.ref([]),u=n=>{r.value=!0,a.value=n},i=n=>{let l=document.createElement("a");var t=new MouseEvent("click");l.href=n,l.dispatchEvent(t),l.remove()};return c({open:u}),(n,l)=>(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(e.unref(o.ElDialog),{center:"",modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=t=>r.value=t),"show-close":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElCarousel),{height:"38rem"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.filter(t=>t.url),t=>(e.openBlock(),e.createBlock(e.unref(o.ElCarouselItem),{autoplay:!1,key:t.url},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createElementVNode("div",{class:"image_style",style:e.normalizeStyle("background:url("+e.unref(s.buildOriginUrl)(t.url)+") no-repeat top center;")},null,4),e.createElementVNode("div",f,[e.createElementVNode("img",{src:e.unref(s.buildOriginUrl)(t.url),alt:"",class:"image"},null,8,g)]),e.createVNode(e.unref(o.ElButton),{size:"large",class:"button_style",icon:e.unref(d.Download),circle:"",onClick:E=>i(t.url)},null,8,["icon","onClick"])])]),_:2},1024))),128))]),_:1})]),_:1},8,["modelValue"])]))}});exports._sfc_main=v;
1
+ "use strict";const e=require("vue"),d=require("@element-plus/icons-vue"),s=require("./utils-DdJHKOsc.js"),o=require("element-plus"),m={class:"image_Tag_style"},_={class:"image_box"},f={class:"image-item"},g=["src"],v=e.defineComponent({__name:"imageReview",setup(p,{expose:c}){const r=e.ref(!1),a=e.ref([]),u=n=>{r.value=!0,a.value=n},i=n=>{let l=document.createElement("a");var t=new MouseEvent("click");l.href=n,l.dispatchEvent(t),l.remove()};return c({open:u}),(n,l)=>(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(e.unref(o.ElDialog),{center:"",modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=t=>r.value=t),"show-close":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ElCarousel),{height:"38rem"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.filter(t=>t.url),t=>(e.openBlock(),e.createBlock(e.unref(o.ElCarouselItem),{autoplay:!1,key:t.url},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createElementVNode("div",{class:"image_style",style:e.normalizeStyle("background:url("+e.unref(s.buildOriginUrl)(t.url)+") no-repeat top center;")},null,4),e.createElementVNode("div",f,[e.createElementVNode("img",{src:e.unref(s.buildOriginUrl)(t.url),alt:"",class:"image"},null,8,g)]),e.createVNode(e.unref(o.ElButton),{size:"large",class:"button_style",icon:e.unref(d.Download),circle:"",onClick:E=>i(t.url)},null,8,["icon","onClick"])])]),_:2},1024))),128))]),_:1})]),_:1},8,["modelValue"])]))}});exports._sfc_main=v;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, ref as u, createElementBlock as m, openBlock as n, createVNode as s, unref as l, withCtx as i, Fragment as v, renderList as h, createBlock as E, createElementVNode as a, normalizeStyle as k } from "vue";
2
2
  import { Download as y } from "@element-plus/icons-vue";
3
- import { b as d } from "./utils-DIRgjeAd.js";
3
+ import { b as d } from "./utils-CYV5FAZZ.js";
4
4
  import { ElDialog as w, ElCarousel as C, ElCarouselItem as b, ElButton as x } from "element-plus";
5
5
  const V = { class: "image_Tag_style" }, B = { class: "image_box" }, L = { class: "image-item" }, z = ["src"], M = /* @__PURE__ */ f({
6
6
  __name: "imageReview",
@@ -0,0 +1,24 @@
1
+ const f = (r) => r ? r.indexOf("oss-cn") > -1 ? r + "!origin" : r : "", i = (r) => r ? r.indexOf("oss-cn") > -1 ? r.replace("!origin", "").replace("!thumb500", "") : r : "";
2
+ function c(r) {
3
+ var t = new DOMParser(), u = t.parseFromString("<!doctype html><body>" + r, "text/html");
4
+ return u.body.textContent;
5
+ }
6
+ function h(r, t, u) {
7
+ if (!t || t.length == 0)
8
+ return r;
9
+ var o = [];
10
+ u != "row-data" ? t.forEach((e) => {
11
+ o.push(...e.fields);
12
+ }) : o = t;
13
+ var n = [];
14
+ return r.forEach((e) => {
15
+ const s = o.find((p) => e.propertyGroup ? e.propertyGroup.indexOf(p.property) != -1 : p.property === e.property);
16
+ s && s.isShow == 1 ? n.push({ ...e, ...s }) : s || n.push(e);
17
+ }), o = o.filter((e) => e.isShow == !0 && e.type == "custom"), console.log("_customFormData", o), o.length > 0 && n.push(...o), console.log("mergeCustomFormSubTable", n), n;
18
+ }
19
+ export {
20
+ f as b,
21
+ i as c,
22
+ c as h,
23
+ h as m
24
+ };
@@ -0,0 +1 @@
1
+ "use strict";const p=r=>r?r.indexOf("oss-cn")>-1?r+"!origin":r:"",l=r=>r?r.indexOf("oss-cn")>-1?r.replace("!origin","").replace("!thumb500",""):r:"";function c(r){var o=new DOMParser,u=o.parseFromString("<!doctype html><body>"+r,"text/html");return u.body.textContent}function f(r,o,u){if(!o||o.length==0)return r;var t=[];u!="row-data"?o.forEach(e=>{t.push(...e.fields)}):t=o;var n=[];return r.forEach(e=>{const s=t.find(i=>e.propertyGroup?e.propertyGroup.indexOf(i.property)!=-1:i.property===e.property);s&&s.isShow==1?n.push({...e,...s}):s||n.push(e)}),t=t.filter(e=>e.isShow==!0&&e.type=="custom"),console.log("_customFormData",t),t.length>0&&n.push(...t),console.log("mergeCustomFormSubTable",n),n}exports.buildOriginUrl=p;exports.clearOssUrl=l;exports.html_entity_decode=c;exports.mergeCustomFormSubTable=f;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/RenderFilterItem.vue_vue_type_script_setup_true_lang-D0A4wGEy.js");exports.default=e._sfc_main;
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "../chunks/RenderFilterItem.vue_vue_type_script_setup_true_lang-C7LewC3j.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/RenderFormItem.vue_vue_type_style_index_0_lang-CGxnSN-x.js");exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/RenderFormItem.vue_vue_type_style_index_0_lang-DiJ0BtfN.js");exports.default=e._sfc_main;
@@ -1,4 +1,4 @@
1
- import { _ as f } from "../chunks/RenderFormItem.vue_vue_type_style_index_0_lang-LijDQik_.js";
1
+ import { _ as f } from "../chunks/RenderFormItem.vue_vue_type_style_index_0_lang-D0DvBwFO.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/imageReview.vue_vue_type_style_index_0_lang-B-S4Gh6W.js");exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/imageReview.vue_vue_type_style_index_0_lang-BrTPEr6_.js");exports.default=e._sfc_main;
@@ -1,4 +1,4 @@
1
- import { _ as f } from "../chunks/imageReview.vue_vue_type_style_index_0_lang-CJi-hvC0.js";
1
+ import { _ as f } from "../chunks/imageReview.vue_vue_type_style_index_0_lang-DmbHpPMb.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./manageTable.cjs"),s=require("../chunks/imageReview.vue_vue_type_style_index_0_lang-B-S4Gh6W.js"),r=require("../chunks/ProvideKeys-BPenLFlD.js"),t=require("../chunks/EventKeys-D78tN5KT.js");exports.MangerTable=e.default;exports.default=e.default;exports.imageReview=s._sfc_main;exports.speciesNameQueryKey=r.speciesNameQueryKey;exports.filterEventBus=t.filterEventBus;exports.sortEventBus=t.sortEventBus;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./manageTable.cjs"),s=require("../chunks/imageReview.vue_vue_type_style_index_0_lang-BrTPEr6_.js"),r=require("../chunks/ProvideKeys-BPenLFlD.js"),t=require("../chunks/EventKeys-D78tN5KT.js");exports.MangerTable=e.default;exports.default=e.default;exports.imageReview=s._sfc_main;exports.speciesNameQueryKey=r.speciesNameQueryKey;exports.filterEventBus=t.filterEventBus;exports.sortEventBus=t.sortEventBus;
@@ -1,5 +1,5 @@
1
1
  import r from "./manageTable.mjs";
2
- import { _ as o } from "../chunks/imageReview.vue_vue_type_style_index_0_lang-CJi-hvC0.js";
2
+ import { _ as o } from "../chunks/imageReview.vue_vue_type_style_index_0_lang-DmbHpPMb.js";
3
3
  import { s as f } from "../chunks/ProvideKeys-jhgDnhL_.js";
4
4
  import { f as p, s as i } from "../chunks/EventKeys-Cy8iJb0N.js";
5
5
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),te=require("../chunks/imageReview.vue_vue_type_style_index_0_lang-B-S4Gh6W.js"),re=require("../chunks/CreateData.vue_vue_type_script_setup_true_lang-XAwFLbts.js"),ae=require("./SortItem.cjs"),le=require("../chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-Dr79MAHt.js"),ne=require("./FilterItem.cjs"),oe=require("../chunks/RenderFormItem.vue_vue_type_style_index_0_lang-CGxnSN-x.js"),ie=require("../chunks/utils-rH1yoZOz.js"),l=require("element-plus"),g=require("@element-plus/icons-vue"),p=require("../chunks/ProvideKeys-BPenLFlD.js"),se=require("vuedraggable"),ue=require("../chunks/_plugin-vue_export-helper-BHFhmbuH.js"),de={class:"manage-table"},ce={class:"table-header"},pe={class:"left"},fe={class:"field-sort"},ye={class:"field-sort-header"},ge={class:"menus-popover-sort"},he={class:"el-button el-button--primary is-plain",type:"primary",role:"button",style:{"border-radius":"var(--el-border-radius-base)",width:"95px"}},ve={class:"table-body"},me={key:4,class:"latin-name"},ke=e.defineComponent({name:"ManageTable",__name:"manageTable",props:{tableHeight:{},fieldList:{},buildThumbUrl:{type:Function},onSortChange:{type:Function},saveData:{type:Function},records:{},dataType:{},category:{},layerName:{},projectId:{},researchStandard:{},uploadFile:{type:Function},exportHandel:{type:Function},rowDataOptions:{type:Function},researchDataOptions:{type:Function},queryResearchDataOptions:{type:Function},deleteResearchDataOptions:{type:Function},deleteRowDataOptions:{type:Function},researchDataQuery:{type:Function}},setup(n,{expose:T}){const O=e.ref({prop:"createDate",order:"descending"}),C=e.ref(!1);var v=e.ref({});const N=e.ref(),E=e.ref(),f=e.ref([]),s=e.ref([]),R=e.ref([]),S=e.ref(),y=e.ref(!1),h=e.reactive({rowID:null,index:null}),j=(a,r,t,c)=>{y.value&&(h.rowID=a.id,h.index=r.getColumnIndex())},i=e.ref([]),_=a=>{i.value=a},V=e.computed(()=>[...f.value.map(a=>a.property),...s.value]),G=a=>{if(V.value.indexOf(a.property)>-1)return!0;if(!a.property&&a.propertyGroup)return V.value.indexOf(a.propertyGroup.join("_"))>-1},I=e.computed(()=>{const a=[];return u.value.forEach(r=>{r.property?s.value.indexOf(r.property)>-1&&a.push(r):r.propertyGroup&&s.value.indexOf(r.propertyGroup.join("_"))>-1&&a.push(r)}),[...f.value,...a]}),M=a=>a.unit?`${a.title}(${a.unit})`:a.title,q=(a,r)=>{if(a.extra)try{return JSON.parse(a.extra)[r]}catch{return""}return""},L=()=>{n.exportHandel?n.exportHandel(JSON.parse(JSON.stringify(i.value))):l.ElMessage.warning("暂不支持导出")},H=a=>{var r;try{(r=N.value)==null||r.open(JSON.parse(a))}catch{}},z=a=>a.id;n.uploadFile&&e.provide(p.uploadFileKey,n.uploadFile),n.rowDataOptions&&e.provide(p.apiRowDataOptionsKey,n.rowDataOptions),n.researchDataOptions&&e.provide(p.apiResearchDataOptionsKey,n.researchDataOptions),n.queryResearchDataOptions&&e.provide(p.queryResearchDataOptionsKey,n.queryResearchDataOptions),e.provide(p.projectIdKey,n.projectId),e.provide(p.researchStandardKey,n.researchStandard),n.researchDataQuery&&e.provide(p.apiResearchDataQueryKey,n.researchDataQuery);const K=()=>{var a;n.dataType=="row-data"?(a=E.value)==null||a.showDialog(n.category,n.layerName):l.ElMessage.warning("暂不支持新增")},$=()=>{if(i.value.length==0){l.ElMessage.warning("请先选择数据");return}var a=n.dataType=="row-data"?n.deleteRowDataOptions:n.deleteResearchDataOptions;a?l.ElMessageBox.confirm(`是否要删除这${i.value.length}条调查数据?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{a&&a({ids:i.value.map(r=>r.id)}).then(r=>{let t=0,c=new Set,o=0;Object.entries(r.data).forEach(([Ce,x])=>{(x.ykk_code||x.code)!=1e4?(t++,c.add(x.msg)):o++});let d=[];o>0&&d.push(`成功删除${o}条`),t>0&&(d.push(`失败${t}条`),d.push("失败原因:"+Array.from(c).join(",")+"。")),l.ElNotification({title:"提示",message:"共选择"+i.value.length+"条数据,"+d.join(","),type:"warning"})})}).catch(()=>{}):l.ElMessage.warning("暂不支持删除")},U=()=>{if(n.dataType=="row-data"){if(["soilResearchCollect","waterResearchCollect","plantResearchCollect","fungusResearchCollect"].indexOf(n.category)>-1){l.ElMessage.warning("暂不支持复制");return}if(i.value.length==0){l.ElMessage.warning("请先选择数据");return}var a=n.dataType=="row-data"?n.rowDataOptions:n.researchDataOptions;a?l.ElMessageBox.confirm(`是否要复制这${i.value.length}条调查数据?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{C.value=!0;for(let r=0;r<i.value.length;r++){const t=Object.assign({},i.value[r]);delete t.id,t.createDate=l.dayjs().unix(),a&&await a([t])}C.value=!1,l.ElMessage.success("复制成功")}).catch(()=>{}):l.ElMessage.warning("暂不支持复制")}else l.ElMessage.warning("暂不支持复制")},b=e.ref(),A=()=>{var a;if(["vegetationResearchCollect","humanActivity","naturalDisaster"].indexOf(n.category)>-1){l.ElMessage.warning("暂不支持替换");return}if(i.value.length==0){l.ElMessage.warning("请先选择数据");return}if(n.dataType=="row-data"){(a=b.value)==null||a.showDialog(n.category,i.value);return}else{l.ElMessage.warning("暂不支持替换");return}},w=e.ref(),P=()=>{var a;(a=w.value)==null||a.showDialog(n.fieldList.filter(r=>r.sortAble),"createDate")},J=e.ref([]),Q=a=>{J.value=a},B=e.ref(),W=()=>{var a;(a=B.value)==null||a.showDialog(n.fieldList.filter(r=>r.filterAble))},X=a=>{v.value=a},m=e.ref(!0),D=e.ref(!1),k=e.ref(!1),u=e.ref([]),Y=a=>{if(a){const r=u.value.map(t=>t.property?t.property:t.propertyGroup?t.propertyGroup.join("_"):"xxx");r&&r.length>0&&(s.value=r)}else{const r=u.value.filter(t=>t.fixed).map(t=>t.property?t.property:t.propertyGroup?t.propertyGroup.join("_"):"xxx");s.value=r,F(s.value)}k.value=!1},F=a=>{let r=[];u.value.forEach(t=>{t.property?r.push({filedName:t.property,check:a.indexOf(t.property)!=-1}):r.push({filedName:(t.propertyGroup??[]).join("_"),check:a.indexOf((t.propertyGroup??[]).join("_"))!=-1})})},Z=a=>{const r=a.length;m.value=r===u.value.length,k.value=r>0&&r<u.value.length,F(a)},ee=()=>{let a=[];u.value.forEach(r=>{a.push({filedName:r.property,check:s.value.indexOf(r.property)!=-1})})};return e.watch(()=>n.fieldList,a=>{u.value=a.filter(t=>t.isShow&&!t.fixed).map(t=>({...t,property:t.property||(t.propertyGroup?t.propertyGroup.join("_"):"")}));const r=a.map(t=>t.property?t.property:t.propertyGroup?t.propertyGroup.join("_"):"");r&&r.length>0&&(s.value=r),console.log("displayFieldList.value",u.value),f.value=a.filter(t=>t.fixed).map(t=>({...t,property:t.property||(t.propertyGroup?t.propertyGroup.join("_"):"")})),console.log("fixedFieldList.value",f.value)},{immediate:!0}),T({showFields:s,fixedFieldList:f}),(a,r)=>(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",ce,[e.createElementVNode("div",pe,[e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:L},{default:e.withCtx(()=>r[6]||(r[6]=[e.createElementVNode("i",{class:"icon bjh-export"},null,-1),e.createTextVNode("导出")])),_:1,__:[6]}),a.category!="photoResearch"?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:"primary",plain:"",onClick:K},{default:e.withCtx(()=>r[7]||(r[7]=[e.createElementVNode("i",{class:"icon bjh-add"},null,-1),e.createTextVNode("增加 ")])),_:1,__:[7]})):e.createCommentVNode("",!0),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:$},{default:e.withCtx(()=>r[8]||(r[8]=[e.createElementVNode("i",{class:"icon bjh-delete"},null,-1),e.createTextVNode("删除")])),_:1,__:[8]}),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:U},{default:e.withCtx(()=>r[9]||(r[9]=[e.createElementVNode("i",{class:"icon bjh-copy"},null,-1),e.createTextVNode("复制")])),_:1,__:[9]}),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:A},{default:e.withCtx(()=>r[10]||(r[10]=[e.createElementVNode("i",{class:"icon bjh-replace"},null,-1),e.createTextVNode("替换")])),_:1,__:[10]}),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:P},{default:e.withCtx(()=>r[11]||(r[11]=[e.createElementVNode("i",{class:"icon bjh-paixu2 active"},null,-1),e.createTextVNode("排序 ")])),_:1,__:[11]}),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:W},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(["icon",{"bjh-shaixuan2":Object.keys(e.unref(v)).length==0,"bjh-shaixuan1 active":Object.keys(e.unref(v)).length>0}])},null,2),r[12]||(r[12]=e.createTextVNode("筛选 "))]),_:1,__:[12]}),e.createVNode(e.unref(l.ElPopover),{placement:"bottom",width:225,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{size:"default",type:"primary",plain:"",style:{width:"95px"}},{default:e.withCtx(()=>[r[13]||(r[13]=e.createElementVNode("i",{class:"icon bjh-display"},null,-1)),r[14]||(r[14]=e.createTextVNode("显示")),e.createVNode(e.unref(l.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(g.CaretBottom))]),_:1})]),_:1,__:[13,14]})]),default:e.withCtx(()=>[e.createElementVNode("div",fe,[e.createElementVNode("div",ye,[e.createVNode(e.unref(l.ElCheckbox),{modelValue:m.value,"onUpdate:modelValue":r[0]||(r[0]=t=>m.value=t),indeterminate:k.value,onChange:Y},{default:e.withCtx(()=>r[15]||(r[15]=[e.createTextVNode("全选")])),_:1,__:[15]},8,["modelValue","indeterminate"])]),e.createVNode(e.unref(l.ElCheckboxGroup),{modelValue:s.value,"onUpdate:modelValue":r[4]||(r[4]=t=>s.value=t),onChange:Z},{default:e.withCtx(()=>[e.createVNode(e.unref(se),{modelValue:u.value,"onUpdate:modelValue":r[1]||(r[1]=t=>u.value=t),onStart:r[2]||(r[2]=t=>D.value=!0),onEnd:r[3]||(r[3]=t=>D.value=!1),"item-key":"title",onChange:ee,animation:400,"fallback-tolerance":100,"scroll-sensitivity":100},{item:e.withCtx(({element:t})=>[e.createElementVNode("div",ge,[r[16]||(r[16]=e.createElementVNode("span",{class:"icon bjh-ketuodong"},null,-1)),t.property?(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:0,value:t.property},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:1,value:t.propertyGroup.join("_")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1032,["value"]))])]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])])]),_:1}),e.createElementVNode("label",he,[r[17]||(r[17]=e.createTextVNode(" 编辑 ")),e.createVNode(e.unref(l.ElSwitch),{size:"small",modelValue:y.value,"onUpdate:modelValue":r[5]||(r[5]=t=>y.value=t)},null,8,["modelValue"])])]),r[18]||(r[18]=e.createElementVNode("div",{class:"right"},null,-1))]),e.createElementVNode("div",ve,[e.createVNode(e.unref(l.ElTable),{ref_key:"dataTableRef",ref:S,onSortChange:a.onSortChange,"header-row-class-name":"table-header",data:a.records,"default-sort":O.value,border:!0,stripe:"","row-key":z,style:{width:"100%"},height:a.tableHeight,onCellClick:j,onSelectionChange:_},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElTableColumn),{type:"selection",width:"55","reserve-selection":!0}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(t,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.property},[G(t)?(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:0,fixed:t.fixed,sortable:t.sortAble,prop:t.property,label:M(t),width:t.width||150},{default:e.withCtx(({row:o})=>[y.value&&h.rowID===o.id&&h.index===c+1&&!t.disable?(e.openBlock(),e.createBlock(oe._sfc_main,{key:t.title+"-"+o.id,field:t,data:o,onChange:d=>a.saveData(d,o,t)},null,8,["field","data","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[R.value.indexOf(t.property)!==-1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(q(o,t.property)),1)],64)):t.property==="imageList"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o[t.property]&&o[t.property].length>10?(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:0,size:"20",onClick:d=>y.value?null:H(o[t.property]),color:"green"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.Picture))]),_:2},1032,["onClick"])):(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:1,size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.CirclePlus))]),_:1}))],64)):t.property==="voiceList"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[o[t.property]&&o[t.property].length>10?(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:0,size:"20",color:"green"},{default:e.withCtx(()=>r[19]||(r[19]=[e.createElementVNode("i",{class:"icon bjh-audio_ico02"},null,-1)])),_:1,__:[19]})):(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:1,size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.CirclePlus))]),_:1}))],64)):t.property==="quadratChart"?(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:3,size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.Calendar))]),_:1})):t.property==="latinName"?(e.openBlock(),e.createElementBlock("p",me,e.toDisplayString(o[t.property]),1)):t.property==="previewImage"?(e.openBlock(),e.createBlock(e.unref(l.ElImage),{key:5,src:a.buildThumbUrl?a.buildThumbUrl(t.render?t.render(o[t.property],o,c):o[t.property]):"",fit:"cover","preview-src-list":[e.unref(ie.buildOriginUrl)(t.render?t.render(o[t.property],o,c):o[t.property])],"preview-teleported":!0,lazy:!0,style:{width:"100px",height:"100px"}},null,8,["src","preview-src-list"])):t.propertyGroup?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createTextVNode(e.toDisplayString(t.propertyGroup.map(d=>o[d]).join("/")),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[t.render?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.render(o[t.property],o,c)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(o[t.property]),1)],64))],64))],64))]),_:2},1032,["fixed","sortable","prop","label","width"])):e.createCommentVNode("",!0)],64))),128))]),_:1},8,["onSortChange","data","default-sort","height"])]),e.createVNode(te._sfc_main,{ref_key:"imageTagRef",ref:N},null,512),e.createVNode(re._sfc_main,{ref_key:"createDataRef",ref:E},null,512),e.createVNode(le._sfc_main,{ref_key:"replaceSpeciesNameDialogRef",ref:b},null,512),e.createVNode(ae.default,{ref_key:"sortRef",ref:w,onCallback:Q},null,512),e.createVNode(ne.default,{ref_key:"filterRef",ref:B,onCallback:X},null,512)]))}}),xe=ue._export_sfc(ke,[["__scopeId","data-v-d5ac1ed9"]]);exports.default=xe;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),se=require("../chunks/imageReview.vue_vue_type_style_index_0_lang-BrTPEr6_.js"),de=require("../chunks/CreateData.vue_vue_type_script_setup_true_lang-XAwFLbts.js"),ce=require("./SortItem.cjs"),pe=require("../chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-Dr79MAHt.js"),fe=require("./FilterItem.cjs"),ye=require("../chunks/RenderFormItem.vue_vue_type_style_index_0_lang-DiJ0BtfN.js"),he=require("../chunks/RenderFilterItem.vue_vue_type_script_setup_true_lang-D0A4wGEy.js"),_=require("../chunks/utils-DdJHKOsc.js"),l=require("element-plus"),g=require("@element-plus/icons-vue"),y=require("../chunks/ProvideKeys-BPenLFlD.js"),ge=require("vuedraggable"),ve=require("../chunks/EventKeys-D78tN5KT.js"),me=require("../chunks/_plugin-vue_export-helper-BHFhmbuH.js"),ke={class:"manage-table"},xe={class:"table-header"},Ce={class:"left"},Ee={class:"field-sort"},Ve={class:"field-sort-header"},Ne={class:"menus-popover-sort"},we={class:"el-button el-button--primary is-plain",type:"primary",role:"button",style:{"border-radius":"var(--el-border-radius-base)",width:"95px"}},be={class:"right"},Be={class:"select_input_wrapper"},Fe={style:{width:"150px"}},De={class:"table-body"},Te={key:4,class:"latin-name"},Se=e.defineComponent({name:"ManageTable",__name:"manageTable",props:{tableHeight:{},fieldList:{},buildThumbUrl:{type:Function},onSortChange:{type:Function},saveData:{type:Function},records:{},dataType:{},category:{},layerName:{},projectId:{},researchStandard:{},customFields:{default:()=>[]},uploadFile:{type:Function},exportHandel:{type:Function},rowDataOptions:{type:Function},researchDataOptions:{type:Function},queryResearchDataOptions:{type:Function},deleteResearchDataOptions:{type:Function},deleteRowDataOptions:{type:Function},researchDataQuery:{type:Function},showMap:{type:Function}},setup(o,{expose:M}){const G=e.ref({prop:"createDate",order:"descending"}),w=e.ref(!1);var x=e.ref({});const h=e.ref(""),m=e.ref({}),b=e.ref(),B=e.ref(),p=e.ref([]),s=e.ref([]),q=e.ref(),v=e.ref(!1),k=e.reactive({rowID:null,index:null}),I=()=>{o.showMap?o.showMap(u.value):l.ElMessage.warning("暂不支持地图查看")},L=(a,r,t,c)=>{v.value&&(k.rowID=a.id,k.index=r.getColumnIndex())},u=e.ref([]),H=a=>{u.value=a},F=e.computed(()=>[...p.value.map(a=>a.property),...s.value]),K=a=>{if(F.value.indexOf(a.property)>-1)return!0;if(!a.property&&a.propertyGroup)return F.value.indexOf(a.propertyGroup.join("_"))>-1},U=e.computed(()=>{const a=[];return i.value.forEach(r=>{r.property?s.value.indexOf(r.property)>-1&&a.push(r):r.propertyGroup&&s.value.indexOf(r.propertyGroup.join("_"))>-1&&a.push(r)}),[...p.value,...a]}),z=a=>a.unit?`${a.title}(${a.unit})`:a.title,$=(a,r)=>{if(a.extra)try{return JSON.parse(a.extra)[r]}catch{return""}return""},A=()=>{o.exportHandel?o.exportHandel(JSON.parse(JSON.stringify(u.value))):l.ElMessage.warning("暂不支持导出")},P=a=>{var r;try{(r=b.value)==null||r.open(JSON.parse(a))}catch{}},Q=a=>a.id;o.uploadFile&&e.provide(y.uploadFileKey,o.uploadFile),o.rowDataOptions&&e.provide(y.apiRowDataOptionsKey,o.rowDataOptions),o.researchDataOptions&&e.provide(y.apiResearchDataOptionsKey,o.researchDataOptions),o.queryResearchDataOptions&&e.provide(y.queryResearchDataOptionsKey,o.queryResearchDataOptions),e.provide(y.projectIdKey,o.projectId),e.provide(y.researchStandardKey,o.researchStandard),o.researchDataQuery&&e.provide(y.apiResearchDataQueryKey,o.researchDataQuery);const J=()=>{var a;o.dataType=="row-data"?(a=B.value)==null||a.showDialog(o.category,o.layerName):l.ElMessage.warning("暂不支持新增")},W=()=>{D()},D=()=>{console.log("filterForm.value",m.value),ve.filterEventBus.emit(m.value)},X=()=>{if(u.value.length==0){l.ElMessage.warning("请先选择数据");return}var a=o.dataType=="row-data"?o.deleteRowDataOptions:o.deleteResearchDataOptions;a?l.ElMessageBox.confirm(`是否要删除这${u.value.length}条调查数据?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{a&&a({ids:u.value.map(r=>r.id)}).then(r=>{let t=0,c=new Set,n=0;Object.entries(r.data).forEach(([Re,N])=>{(N.ykk_code||N.code)!=1e4?(t++,c.add(N.msg)):n++});let d=[];n>0&&d.push(`成功删除${n}条`),t>0&&(d.push(`失败${t}条`),d.push("失败原因:"+Array.from(c).join(",")+"。")),l.ElNotification({title:"提示",message:"共选择"+u.value.length+"条数据,"+d.join(","),type:"warning"})})}).catch(()=>{}):l.ElMessage.warning("暂不支持删除")},Y=()=>{if(o.dataType=="row-data"){if(["soilResearchCollect","waterResearchCollect","plantResearchCollect","fungusResearchCollect"].indexOf(o.category)>-1){l.ElMessage.warning("暂不支持复制");return}if(u.value.length==0){l.ElMessage.warning("请先选择数据");return}var a=o.dataType=="row-data"?o.rowDataOptions:o.researchDataOptions;a?l.ElMessageBox.confirm(`是否要复制这${u.value.length}条调查数据?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{w.value=!0;for(let r=0;r<u.value.length;r++){const t=Object.assign({},u.value[r]);delete t.id,t.createDate=l.dayjs().unix(),a&&await a([t])}w.value=!1,l.ElMessage.success("复制成功")}).catch(()=>{}):l.ElMessage.warning("暂不支持复制")}else l.ElMessage.warning("暂不支持复制")},T=e.ref(),Z=()=>{var a;if(["vegetationResearchCollect","humanActivity","naturalDisaster"].indexOf(o.category)>-1){l.ElMessage.warning("暂不支持替换");return}if(u.value.length==0){l.ElMessage.warning("请先选择数据");return}if(o.dataType=="row-data"){(a=T.value)==null||a.showDialog(o.category,u.value);return}else{l.ElMessage.warning("暂不支持替换");return}},S=e.ref(),ee=()=>{var a;(a=S.value)==null||a.showDialog(o.fieldList.filter(r=>r.sortAble),"createDate")},te=e.ref([]),re=a=>{te.value=a},O=e.ref(),ae=()=>{var a;(a=O.value)==null||a.showDialog(o.fieldList.filter(r=>r.filterAble))},le=a=>{x.value=a},C=e.ref(!0),R=e.ref(!1),E=e.ref(!1),i=e.ref([]),oe=a=>{if(a){const r=i.value.map(t=>t.property?t.property:t.propertyGroup?t.propertyGroup.join("_"):"xxx");r&&r.length>0&&(s.value=r)}else{const r=i.value.filter(t=>t.fixed).map(t=>t.property?t.property:t.propertyGroup?t.propertyGroup.join("_"):"xxx");s.value=r,j(s.value)}E.value=!1},j=a=>{let r=[];i.value.forEach(t=>{t.property?r.push({filedName:t.property,check:a.indexOf(t.property)!=-1}):r.push({filedName:(t.propertyGroup??[]).join("_"),check:a.indexOf((t.propertyGroup??[]).join("_"))!=-1})})},ne=a=>{const r=a.length;C.value=r===i.value.length,E.value=r>0&&r<i.value.length,j(a)},f=e.ref([]),ie=a=>{p.value.length=0,i.value.length=0,f.value.length=0,a.forEach(r=>{r!=null&&r.fixed?p.value.push(r):i.value.push(r),r!=null&&r.isQuickFilter&&f.value.push(r)}),console.log("quickFilterFields.value",f.value),f.value.length>0?h.value=f.value[0].property:h.value="",s.value=i.value.filter(r=>r.isShow&&!r.fixed).map(r=>r.property||(r.propertyGroup?r.propertyGroup.join("_"):""))},V=e.ref([]),ue=()=>{let a=[];i.value.forEach(r=>{a.push({filedName:r.property,check:s.value.indexOf(r.property)!=-1})})};return e.watchEffect(()=>{console.log("customFields",o.customFields),ie(_.mergeCustomFormSubTable(o.fieldList,o.customFields,o.dataType))}),e.watch(()=>o.fieldList,a=>{i.value=a.filter(t=>t.isShow&&!t.fixed).map(t=>({...t,property:t.property||(t.propertyGroup?t.propertyGroup.join("_"):"")}));const r=a.map(t=>t.property?t.property:t.propertyGroup?t.propertyGroup.join("_"):"");r&&r.length>0&&(s.value=r),console.log("displayFieldList.value",i.value),p.value=a.filter(t=>t.fixed).map(t=>({...t,property:t.property||(t.propertyGroup?t.propertyGroup.join("_"):"")})),console.log("fixedFieldList.value",p.value)},{immediate:!0}),e.watch(()=>o.customFields,()=>{o.customFields.forEach(a=>{a.fields.forEach(r=>{r.type=="custom"&&V.value.push(r.property)})}),console.log("allCustomField.value",V.value)},{immediate:!0}),M({showFields:s,fixedFieldList:p}),(a,r)=>(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",xe,[e.createElementVNode("div",Ce,[e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:A},{default:e.withCtx(()=>r[8]||(r[8]=[e.createElementVNode("i",{class:"icon bjh-export"},null,-1),e.createTextVNode("导出")])),_:1,__:[8]}),a.category!="photoResearch"?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:"primary",plain:"",onClick:J},{default:e.withCtx(()=>r[9]||(r[9]=[e.createElementVNode("i",{class:"icon bjh-add"},null,-1),e.createTextVNode("增加 ")])),_:1,__:[9]})):e.createCommentVNode("",!0),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:X},{default:e.withCtx(()=>r[10]||(r[10]=[e.createElementVNode("i",{class:"icon bjh-delete"},null,-1),e.createTextVNode("删除")])),_:1,__:[10]}),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:Y},{default:e.withCtx(()=>r[11]||(r[11]=[e.createElementVNode("i",{class:"icon bjh-copy"},null,-1),e.createTextVNode("复制")])),_:1,__:[11]}),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:Z},{default:e.withCtx(()=>r[12]||(r[12]=[e.createElementVNode("i",{class:"icon bjh-replace"},null,-1),e.createTextVNode("替换")])),_:1,__:[12]}),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:ee},{default:e.withCtx(()=>r[13]||(r[13]=[e.createElementVNode("i",{class:"icon bjh-paixu2 active"},null,-1),e.createTextVNode("排序 ")])),_:1,__:[13]}),e.createVNode(e.unref(l.ElButton),{type:"primary",plain:"",onClick:ae},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(["icon",{"bjh-shaixuan2":Object.keys(e.unref(x)).length==0,"bjh-shaixuan1 active":Object.keys(e.unref(x)).length>0}])},null,2),r[14]||(r[14]=e.createTextVNode("筛选 "))]),_:1,__:[14]}),e.createVNode(e.unref(l.ElPopover),{placement:"bottom",width:225,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{size:"default",type:"primary",plain:"",style:{width:"95px"}},{default:e.withCtx(()=>[r[15]||(r[15]=e.createElementVNode("i",{class:"icon bjh-display"},null,-1)),r[16]||(r[16]=e.createTextVNode("显示")),e.createVNode(e.unref(l.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(g.CaretBottom))]),_:1})]),_:1,__:[15,16]})]),default:e.withCtx(()=>[e.createElementVNode("div",Ee,[e.createElementVNode("div",Ve,[e.createVNode(e.unref(l.ElCheckbox),{modelValue:C.value,"onUpdate:modelValue":r[0]||(r[0]=t=>C.value=t),indeterminate:E.value,onChange:oe},{default:e.withCtx(()=>r[17]||(r[17]=[e.createTextVNode("全选")])),_:1,__:[17]},8,["modelValue","indeterminate"])]),e.createVNode(e.unref(l.ElCheckboxGroup),{modelValue:s.value,"onUpdate:modelValue":r[4]||(r[4]=t=>s.value=t),onChange:ne},{default:e.withCtx(()=>[e.createVNode(e.unref(ge),{modelValue:i.value,"onUpdate:modelValue":r[1]||(r[1]=t=>i.value=t),onStart:r[2]||(r[2]=t=>R.value=!0),onEnd:r[3]||(r[3]=t=>R.value=!1),"item-key":"title",onChange:ue,animation:400,"fallback-tolerance":100,"scroll-sensitivity":100},{item:e.withCtx(({element:t})=>[e.createElementVNode("div",Ne,[r[18]||(r[18]=e.createElementVNode("span",{class:"icon bjh-ketuodong"},null,-1)),t.property?(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:0,value:t.property},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:1,value:t.propertyGroup.join("_")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1032,["value"]))])]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])])]),_:1}),e.createElementVNode("label",we,[r[19]||(r[19]=e.createTextVNode(" 编辑 ")),e.createVNode(e.unref(l.ElSwitch),{size:"small",modelValue:v.value,"onUpdate:modelValue":r[5]||(r[5]=t=>v.value=t)},null,8,["modelValue"])])]),e.createElementVNode("div",be,[e.createVNode(e.unref(l.ElButton),{onClick:I,type:"primary",plain:""},{default:e.withCtx(()=>r[20]||(r[20]=[e.createElementVNode("i",{class:"icon bjh-mapView"},null,-1),e.createTextVNode(" 地图查看")])),_:1,__:[20]}),e.createElementVNode("div",Be,[e.createVNode(e.unref(l.ElSelect),{modelValue:h.value,"onUpdate:modelValue":r[6]||(r[6]=t=>h.value=t),placeholder:"请选择筛选项",style:{width:"110px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,t=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{label:t.title,value:t.property},null,8,["label","value"]))),256))]),_:1},8,["modelValue"]),e.createElementVNode("div",Fe,[(e.openBlock(),e.createBlock(he._sfc_main,{ref:"renderFilterRef",modelValue:m.value,"onUpdate:modelValue":r[7]||(r[7]=t=>m.value=t),field:f.value.find(t=>t.property==h.value),key:h.value,onChange:W},null,8,["modelValue","field"]))]),e.createVNode(e.unref(l.ElButton),{icon:e.unref(g.Search),onClick:D,type:"primary",plain:""},null,8,["icon"])])])]),e.createElementVNode("div",De,[e.createVNode(e.unref(l.ElTable),{ref_key:"dataTableRef",ref:q,onSortChange:a.onSortChange,"header-row-class-name":"table-header",data:a.records,"default-sort":G.value,border:!0,stripe:"","row-key":Q,style:{width:"100%"},height:a.tableHeight,onCellClick:L,onSelectionChange:H},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElTableColumn),{type:"selection",width:"55","reserve-selection":!0}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(t,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.property},[K(t)?(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:0,fixed:t.fixed,sortable:t.sortAble,prop:t.property,label:z(t),width:t.width||150},{default:e.withCtx(({row:n})=>[v.value&&k.rowID===n.id&&k.index===c+1&&!t.disable?(e.openBlock(),e.createBlock(ye._sfc_main,{key:t.title+"-"+n.id,field:t,data:n,onChange:d=>a.saveData(d,n,t)},null,8,["field","data","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[V.value.indexOf(t.property)!==-1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString($(n,t.property)),1)],64)):t.property==="imageList"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[t.property]&&n[t.property].length>10?(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:0,size:"20",onClick:d=>v.value?null:P(n[t.property]),color:"green"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.Picture))]),_:2},1032,["onClick"])):(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:1,size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.CirclePlus))]),_:1}))],64)):t.property==="voiceList"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[t.property]&&n[t.property].length>10?(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:0,size:"20",color:"green"},{default:e.withCtx(()=>r[21]||(r[21]=[e.createElementVNode("i",{class:"icon bjh-audio_ico02"},null,-1)])),_:1,__:[21]})):(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:1,size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.CirclePlus))]),_:1}))],64)):t.property==="quadratChart"?(e.openBlock(),e.createBlock(e.unref(l.ElIcon),{key:3,size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.Calendar))]),_:1})):t.property==="latinName"?(e.openBlock(),e.createElementBlock("p",Te,e.toDisplayString(n[t.property]),1)):t.property==="previewImage"?(e.openBlock(),e.createBlock(e.unref(l.ElImage),{key:5,src:a.buildThumbUrl?a.buildThumbUrl(t.render?t.render(n[t.property],n,c):n[t.property]):"",fit:"cover","preview-src-list":[e.unref(_.buildOriginUrl)(t.render?t.render(n[t.property],n,c):n[t.property])],"preview-teleported":!0,lazy:!0,style:{width:"100px",height:"100px"}},null,8,["src","preview-src-list"])):t.propertyGroup?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createTextVNode(e.toDisplayString(t.propertyGroup.map(d=>n[d]).join("/")),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[t.render?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.render(n[t.property],n,c)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n[t.property]),1)],64))],64))],64))]),_:2},1032,["fixed","sortable","prop","label","width"])):e.createCommentVNode("",!0)],64))),128))]),_:1},8,["onSortChange","data","default-sort","height"])]),e.createVNode(se._sfc_main,{ref_key:"imageTagRef",ref:b},null,512),e.createVNode(de._sfc_main,{ref_key:"createDataRef",ref:B},null,512),e.createVNode(pe._sfc_main,{ref_key:"replaceSpeciesNameDialogRef",ref:T},null,512),e.createVNode(ce.default,{ref_key:"sortRef",ref:S,onCallback:re},null,512),e.createVNode(fe.default,{ref_key:"filterRef",ref:O,onCallback:le},null,512)]))}}),Oe=me._export_sfc(Se,[["__scopeId","data-v-2f819238"]]);exports.default=Oe;