首页 > 其他分享 >【滨州学院】通过学生学号查询辅导员JS-miniui

【滨州学院】通过学生学号查询辅导员JS-miniui

时间:2023-07-06 16:46:19浏览次数:37  
标签:function mini 辅导员 miniui get arr JS item data

表单内容:

  1 <div id="complex" class="mini-complex" style="background: rgb(255, 255, 255); padding: 2px 20px 10px; box-shadow: rgb(144, 144, 144) 0px 0px 5px; margin: 10px auto 12px; font-size: 14px; font-family: Microsoft YaHei; text-align: center; position: relative;" type="1">
  2     <p>
  3         <br/>
  4     </p>
  5     <p style="margin-bottom: 25px;">
  6         <strong><span style="font-size: 24px;">学生实习报备流程</span></strong>
  7     </p>
  8     <p style="margin-bottom: 25px;">
  9         <strong><span style="font-size: 24px;"></span></strong>
 10     </p>
 11     <table style="table-layout: fixed;border-collapse:collapse;border:2px solid black;" data-sort="sortDisabled" align="center">
 12         <tbody>
 13             <tr class="firstRow">
 14                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="129.33333333333334" valign="middle" align="center">
 15                     指导教师姓名
 16                 </td>
 17                 <td style="border-color: rgb(38, 38, 38);" width="145.33333333333334" valign="middle" align="center">
 18                     <input class="mini-textbox" choosevalue="CURRENTUSER" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="0" enfield="ZDJSXM" cnfield="指导教师姓名" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{&quot;id&quot;:&quot;ZDJSXM&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;,&quot;emptytext&quot;:&quot;&quot;}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" emptytext=""/><br/>
 19                 </td>
 20                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="109.33333333333333" valign="middle" align="center">
 21                     指导教师工号
 22                 </td>
 23                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="186.33333333333334" valign="middle" align="center">
 24                     <input class="mini-textbox" choosevalue="CURRENTUSERID" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="1" enfield="ZDJSGH" cnfield="指导教师工号" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{&quot;id&quot;:&quot;ZDJSGH&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;,&quot;emptytext&quot;:&quot;&quot;}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" emptytext="" linkageurl="/queryservice/query.htm?snumber=CXZDJSXX&amp;ZDJSGH=INPUTVALUE" datasourceurl="" relatefield_1="cnfield=指导教师姓名;enfield=ZDJSXM;datatype=value;icon=;key=ZDJSXM;" relatefield_2="cnfield=联系电话;enfield=LXDH;datatype=value;icon=;key=LXDH;" relatefield_3="cnfield=专业负责人;enfield=ZYFZR;datatype=data;icon=;key=;"/><br/>
 25                 </td>
 26             </tr>
 27             <tr>
 28                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="129.33333333333334" valign="middle" align="center">
 29                     所在单位
 30                 </td>
 31                 <td style="border-color: rgb(38, 38, 38);" width="145.33333333333334" valign="middle" align="center">
 32                     <input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="2" enfield="SZDW" cnfield="所在单位" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{&quot;id&quot;:&quot;SZDW&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;,&quot;emptytext&quot;:&quot;&quot;}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" emptytext="" datasourceurl="/queryservice/query.htm?snumber=CXBMMC&amp;HUMANCODE=STARTID" urlkey="DWMC"/><br/>
 33                 </td>
 34                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="101.33333333333333" valign="middle" align="center">
 35                     备案日期
 36                 </td>
 37                 <td style="border-color: rgb(38, 38, 38);" width="187.33333333333334" valign="middle" align="center">
 38                     <input class="mini-datepicker" choosevalue="OPTIONDATE" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="3" enfield="BARQ" cnfield="备案日期" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" showtime="false" tagtype="mini-datepicker" datetimetype="mini-datepicker" mindate="" maxdate="" data-options="{&quot;minDate&quot;:&quot;&quot;,&quot;maxDate&quot;:&quot;&quot;,&quot;showStyle&quot;:&quot;rung&quot;,&quot;dateScope&quot;:&quot;false&quot;,&quot;manyDateScope&quot;:&quot;false&quot;,&quot;nowDateAfter&quot;:&quot;false&quot;,&quot;dateFixedScope&quot;:&quot;false&quot;,&quot;workDate&quot;:&quot;false&quot;,&quot;emptytext&quot;:&quot;&quot;}" showsignaturedateformat="rung" type="mini-datepicker" ziti="MicrosoftYaHei" zihao="fourteen" emptytext=""/><br/>
 39                 </td>
 40             </tr>
 41             <tr>
 42                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="129.33333333333334" valign="middle" align="center">
 43                     联系电话
 44                 </td>
 45                 <td style="border-color: rgb(38, 38, 38);" width="145.33333333333334" valign="middle" align="center">
 46                     <input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="4" enfield="LXDH" cnfield="联系电话" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{&quot;id&quot;:&quot;LXDH&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen"/><br/>
 47                 </td>
 48                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="109.33333333333333" valign="middle" align="center">
 49                     专业负责人
 50                 </td>
 51                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="188.33333333333334" valign="middle" align="center">
 52                     <input class="mini-combobox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="5" enfield="ZYFZR" cnfield="专业负责人" adaptive="true" multiselect="false" style="width: 100%; height: 100% !important ;" showclearbutton="false" allowlimitvalue="false" textfield="ZYFZR" valuefield="ZYFZRGH" valuefromselect="true" data-options="{&quot;id&quot;:&quot;ZYFZR&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;}"/><br/>
 53                 </td>
 54             </tr>
 55             <tr>
 56                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="129.33333333333334" valign="middle" align="center">
 57                     实习课程号
 58                 </td>
 59                 <td style="border-color: rgb(38, 38, 38);" width="140.33333333333334" valign="middle" align="center">
 60                     <input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="6" enfield="SXKCH" cnfield="实习课程号" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{&quot;id&quot;:&quot;SXKCH&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen" datasourceurl="" linkageurl="/queryservice/query.htm?snumber=CXSXKCXX&amp;SXKCH=INPUTVALUE" value="" relatefield_1="cnfield=实习课程名;enfield=SXKCM;datatype=value;icon=;key=SXKCM;"/><br/>
 61                 </td>
 62                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="109.33333333333333" valign="middle" align="center">
 63                     实习课程名
 64                 </td>
 65                 <td style="border-color: rgb(38, 38, 38);" width="188.33333333333334" valign="middle" align="center">
 66                     <input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="7" enfield="SXKCM" cnfield="实习课程名" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{&quot;id&quot;:&quot;SXKCM&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;}" type="mini-textbox" ziti="MicrosoftYaHei" zihao="fourteen"/><br/>
 67                 </td>
 68             </tr>
 69             <tr>
 70                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="269" valign="middle" height="27" align="center">
 71                     学生所在二级学院
 72                 </td>
 73                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" rowspan="1" colspan="3" valign="middle" height="27" align="center">
 74                     <input class="mini-combobox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="8" enfield="SZXY" cnfield="学生所在二级学院" adaptive="true" multiselect="false" style="width: 100%; height: 100% !important ;" showclearbutton="false" allowlimitvalue="false" textfield="ORGNAME" valuefield="ORGNAME" valuefromselect="true" data-options="{&quot;id&quot;:&quot;SZXY&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;}" datasourceurl="/queryservice/query.htm?snumber=CXXSXY"/><br/>
 75                 </td>
 76             </tr>
 77             <tr>
 78                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" rowspan="1" colspan="4" valign="middle" height="27" align="center">
 79                     <strong>实习学生名单</strong><br/>
 80                 </td>
 81             </tr>
 82             <tr>
 83                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" rowspan="1" colspan="4" valign="middle" height="27" align="center">
 84                     <img src="../../resources/images/flow/datagrid.png" datagrid_style="width: 100%; height: 200px;" datagrid_class="mini-datagrid" datagrid_idfield="id" datagrid_showpager="false" datagrid_fldorder="9" datagrid_cnfield="实习学生名单" datagrid_enfield="SXXSMD" showaddbtn="true" showdelbtn="true" showinbtn="false" showupbtn="true" showdownbtn="true" maxgridrows="500" loadcontext="true" shownumber="false" adaptive="true" datagridfield_1="class=mini-textbox;field=XH;name=学号;required=true;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;vtype=undefined;choosevalue=other;" stylewidth="80" stylewidthtype="%" fieldname_1="学号" datagridfield_2="class=mini-textbox;field=XM;name=姓名;required=false;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;vtype=undefined;choosevalue=other;" fieldname_2="姓名" required="true" datagridfield_3="class=mini-textbox;field=ZY;name=专业;required=false;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;vtype=undefined;choosevalue=other;" fieldname_3="专业" datagridfield_4="class=mini-textbox;field=BJ;name=班级;required=false;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;vtype=undefined;choosevalue=other;" fieldname_4="班级" datagridfield_5="class=mini-combobox;field=SXXZ;name=实习性质;align=left;required=true;multiselect=false;allowinput=true;allowsort=true;datasourcetype=data;data=[{&quot;id&quot;:&quot;分散&quot;,&quot;text&quot;:&quot;分散&quot;,&quot;_id&quot;:1,&quot;_uid&quot;:1,&quot;_state&quot;:&quot;modified&quot;},{&quot;id&quot;:&quot;集中&quot;,&quot;text&quot;:&quot;集中&quot;,&quot;_id&quot;:2,&quot;_uid&quot;:2,&quot;_state&quot;:&quot;modified&quot;}];valuefield=id;textfield=text;fromEnfield=;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;choosevalue=other;" name="未定义列" field="HT44EB6B" data="[{&quot;id&quot;:&quot;是&quot;,&quot;text&quot;:&quot;是&quot;,&quot;_id&quot;:1,&quot;_uid&quot;:1,&quot;_state&quot;:&quot;modified&quot;},{&quot;id&quot;:&quot;否&quot;,&quot;text&quot;:&quot;否&quot;,&quot;_id&quot;:2,&quot;_uid&quot;:2,&quot;_state&quot;:&quot;modified&quot;}]" fieldname_5="实习性质" datagridfield_6="class=mini-combobox;field=SFLX;name=是否离校;align=left;required=false;multiselect=false;allowinput=true;allowsort=true;datasourcetype=data;data=[{&quot;id&quot;:&quot;是&quot;,&quot;text&quot;:&quot;是&quot;,&quot;_id&quot;:1,&quot;_uid&quot;:1,&quot;_state&quot;:&quot;modified&quot;},{&quot;id&quot;:&quot;否&quot;,&quot;text&quot;:&quot;否&quot;,&quot;_id&quot;:2,&quot;_uid&quot;:2,&quot;_state&quot;:&quot;modified&quot;}];valuefield=id;textfield=text;fromEnfield=;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;choosevalue=other;" fieldname_6="是否离校" datagridfield_7="class=mini-textbox;field=SXDWMC;name=实习单位名称;required=false;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;vtype=undefined;choosevalue=other;" fieldname_7="实习单位名称" datagridfield_8="class=mini-textbox;field=SXDWDZ;name=实习单位地址(省市县区);required=false;align=left;allowinput=true;allowsort=true;maxLength=200;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;vtype=undefined;choosevalue=other;" fieldname_8="实习单位地址(省市县区)" datagridfield_9="class=mini-datepicker;field=SXKSSJ;name=实习开始时间;align=left;required=false;allowinput=true;allowsort=true;showdatetime=1;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;choosevalue=OPTIONDATE;" fieldname_9="实习开始时间" datagridfield_10="class=mini-datepicker;field=SXJSSJ;name=实习结束时间;align=left;required=false;allowinput=true;allowsort=true;showdatetime=1;emptytext=;stylewidth=80;stylewidthtype=%;linkageurl=;reactionData=%5B%5D;choosevalue=other;" fieldname_10="实习结束时间" fieldname_11="备注" data-options="{&quot;shownumber&quot;:&quot;false&quot;,&quot;mingridrows&quot;:1,&quot;showinbtn&quot;:&quot;false&quot;,&quot;showupbtn&quot;:&quot;true&quot;}" mingridrows="1"/><br/>
 85                 </td>
 86             </tr>
 87             <tr>
 88                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="269" valign="middle" height="27" align="center">
 89                     辅导员
 90                 </td>
 91                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="269" valign="middle" height="27" align="center">
 92                     <input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="1" datasourcetype="url" fldorder="10" enfield="FDYXM" cnfield="辅导员" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{&quot;id&quot;:&quot;FDYXM&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;}"/><br/>
 93                 </td>
 94                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="269" valign="middle" height="27" align="center">
 95                     发起时间<br/>
 96                 </td>
 97                 <td style="border-color: rgb(38, 38, 38); word-break: break-all;" width="269" valign="middle" height="27" align="center">
 98                     <input class="mini-datepicker" choosevalue="OPRTIONTIME" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="0" datasourcetype="url" fldorder="11" enfield="FQSJ" cnfield="发起时间" adaptive="true" multiselect="false" style="width: 100%;" showclearbutton="false" allowlimitvalue="false" showtime="true" tagtype="mini-datepicker" datetimetype="mini-datetimepicker" mindate="" maxdate="" data-options="{&quot;minDate&quot;:&quot;&quot;,&quot;maxDate&quot;:&quot;&quot;,&quot;showStyle&quot;:&quot;chineseDateTime&quot;,&quot;dateScope&quot;:&quot;false&quot;,&quot;manyDateScope&quot;:&quot;false&quot;,&quot;nowDateAfter&quot;:&quot;false&quot;,&quot;dateFixedScope&quot;:&quot;false&quot;,&quot;workDate&quot;:&quot;false&quot;,&quot;emptytext&quot;:&quot;&quot;}" showsignaturedateformat="chineseDateTime" emptytext=""/><br/>
 99                 </td>
100             </tr>
101         </tbody>
102     </table><input class="mini-textbox" choosevalue="other" required="true" fieldtype="ordinary" allowinput="true" isshowonlist="0" datasourcetype="url" fldorder="100" enfield="FDYGH" cnfield="辅导员审批" adaptive="true" multiselect="false" showclearbutton="false" allowlimitvalue="false" maxlength="200" data-options="{&quot;id&quot;:&quot;FDYGH&quot;,&quot;type&quot;:&quot;COUNTDAY&quot;}" style="width: 100%;"/>
103     <p style="margin-bottom: 25px; text-align: left;">
104         <img class="flow-javascript" src="../../style/flow/img/javascript.png" choosevalue="other" enfield="HTA261E6" cnfield="脚本控件" style="width: 18px; height: 18px; display: block;" method="$(function () {
105     mini.get(&#39;ZDJSGH&#39;).on(&#39;valuechanged&#39;, valueChanged);
106     mini.get(&#39;ZYFZR&#39;).on(&#39;valuechanged&#39;, valueChanged);
107     mini.get(&#39;SXKCH&#39;).on(&#39;valuechanged&#39;, valueChanged);
108     mini.get(&#39;SZXY&#39;).on(&#39;valuechanged&#39;, valueChanged);
109     var arr = [], arrOfDel = [] , indexArr = 0
110     async function getInputValue(data) {
111         if(data.length == 0){
112             mini.get(&#39;FDYXM&#39;).setValue(&#39;&#39;)
113             mini.get(&#39;FDYGH&#39;).setValue(&#39;&#39;)
114             return
115         }
116         data = data.map(item =&gt; item.BJ)
117         data.forEach(async (item, index) =&gt; {
118             await getData(data, item, index)
119             console.log(indexArr , [...new Set(data)].length)
120             if(indexArr == [...new Set(data)].length){
121                 mini.get(&#39;FDYXM&#39;).setValue([...new Set(arr.map(item =&gt; item[&#39;HUMANNAME&#39;]))].join(&#39;,&#39;))
122                 mini.get(&#39;FDYGH&#39;).setValue([...new Set(arr.map(item =&gt; item[&#39;HUMANCODE&#39;]))].join(&#39;,&#39;))
123                 arr = []
124                 indexArr = 0
125             }
126         })
127     }
128     function getData(array, data, index) {
129         return new Promise(function (resolve, reject) {
130             if ((index &gt; 0 &amp;&amp; array.filter((item, i) =&gt; i &lt; index).some(item =&gt; item == data))) { 
131                 return reject()
132             }
133             $.ajax({
134                 methods: &#39;GET&#39;,
135                 url: &quot;${basePath}queryservice/query.htm?snumber=CXFDY&amp;orgname=&quot; + data,
136                 success: function (res) {
137                     indexArr++
138                     arr = arr.concat(JSON.parse(res))
139                     resolve()
140                 },
141                 error: function (err) {
142                     reject(err)
143                 }
144             })
145         })
146     }
147     function valueChanged() {
148         var ZDJSGH = mini.get(&#39;ZDJSGH&#39;).getValue();
149         var ZYFZR = mini.get(&#39;ZYFZR&#39;).getValue();
150         var SXKCH = mini.get(&#39;SXKCH&#39;).getValue();
151         var SZXY = mini.get(&#39;SZXY&#39;).getValue();
152         $.ajax({
153             url: &quot;${basePath}queryservice/query.htm?snumber=CXSXXSXX&amp;ZDJSGH=&quot; + ZDJSGH + &quot;&amp;ZYFZRGH=&quot; + ZYFZR + &quot;&amp;SXKCH=&quot; + SXKCH + &quot;&amp;SZXY=&quot; + SZXY,
154             dataType: &quot;json&quot;,
155             success: function (data) {
156                 if (Array.isArray(data)) {
157                     arrOfDel = JSON.parse(JSON.stringify(data))
158                     mini.get(&#39;SXXSMD&#39;).setData(data);
159                     getInputValue(data)
160                 } else {
161                     arrOfDel = []
162                     arr = []
163                     indexArr = 0
164                     mini.get(&#39;FDYXM&#39;).setValue(&#39;&#39;)
165                     mini.get(&#39;FDYGH&#39;).setValue(&#39;&#39;)
166                     mini.get(&#39;SXXSMD&#39;).setData([]);
167                 }
168             },
169         });
170     }
171     $(&#39;#delbar_SXXSMD&#39;).click(function () {
172         if (mini.get(&#39;SXXSMD&#39;).getData().length == arrOfDel.length) return
173         else indexArr = 0; arr = []; getInputValue(mini.get(&#39;SXXSMD&#39;).getData())
174     })
175 })"/><br/>
176     </p>
177 </div>

表单JS-MINIUI:

$(function () {
    mini.get('ZDJSGH').on('valuechanged', valueChanged);
    mini.get('ZYFZR').on('valuechanged', valueChanged);
    mini.get('SXKCH').on('valuechanged', valueChanged);
    mini.get('SZXY').on('valuechanged', valueChanged);
    var arr = [], arrOfDel = [] , indexArr = 0
    async function getInputValue(data) {
        if(data.length == 0){
            mini.get('FDYXM').setValue('')
            mini.get('FDYGH').setValue('')
            return
        }
        data = data.map(item => item.BJ)
        data.forEach(async (item, index) => {
            await getData(data, item, index)
            console.log(indexArr , [...new Set(data)].length)
            if(indexArr == [...new Set(data)].length){
                mini.get('FDYXM').setValue([...new Set(arr.map(item => item['HUMANNAME']))].join(','))
                mini.get('FDYGH').setValue([...new Set(arr.map(item => item['HUMANCODE']))].join(','))
                arr = []
                indexArr = 0
            }
        })
    }
    function getData(array, data, index) {
        return new Promise(function (resolve, reject) {
            if ((index > 0 && array.filter((item, i) => i < index).some(item => item == data))) { 
                return reject()
            }
            $.ajax({
                methods: 'GET',
                url: "${basePath}queryservice/query.htm?snumber=CXFDY&orgname=" + data,
                success: function (res) {
                    indexArr++
                    arr = arr.concat(JSON.parse(res))
                    resolve()
                },
                error: function (err) {
                    reject(err)
                }
            })
        })
    }
    function valueChanged() {
        var ZDJSGH = mini.get('ZDJSGH').getValue();
        var ZYFZR = mini.get('ZYFZR').getValue();
        var SXKCH = mini.get('SXKCH').getValue();
        var SZXY = mini.get('SZXY').getValue();
        $.ajax({
            url: "${basePath}queryservice/query.htm?snumber=CXSXXSXX&ZDJSGH=" + ZDJSGH + "&ZYFZRGH=" + ZYFZR + "&SXKCH=" + SXKCH + "&SZXY=" + SZXY,
            dataType: "json",
            success: function (data) {
                if (Array.isArray(data)) {
                    arrOfDel = JSON.parse(JSON.stringify(data))
                    mini.get('SXXSMD').setData(data);
                    getInputValue(data)
                } else {
                    arrOfDel = []
                    arr = []
                    indexArr = 0
                    mini.get('FDYXM').setValue('')
                    mini.get('FDYGH').setValue('')
                    mini.get('SXXSMD').setData([]);
                }
            },
        });
    }
    $('#delbar_SXXSMD').click(function () {
        if (mini.get('SXXSMD').getData().length == arrOfDel.length) return
        else indexArr = 0; arr = []; getInputValue(mini.get('SXXSMD').getData())
    })
})

 截图:

 

标签:function,mini,辅导员,miniui,get,arr,JS,item,data
From: https://www.cnblogs.com/xiaoweihongyan/p/17532595.html

相关文章

  • 前端基础-js篇(一)
    1.usestrict (1)ES5规范增加了新的语言特性并且修改了一些已经存在的特性。为了保证旧的功能还能够使用,大部分的修改是默认不生效的。(2)需要一个特殊的指令—— "usestrict" 来明确地激活这些特性。(3)当它处于脚本文件的顶部时,则整个脚本文件都将以“现代”模式进行工作。"u......
  • js的中的函数(二)
    构造函数JavaScript中,一个函数除了作为普通意义的函数外,还可以被用来定义为构造函数。什么是构造函数?就是可以用来生成一个对象的函数。例如:functionStudent(name,age,city,address){//this指向构造函数生成的对象this.name=name;this.age=ag......
  • 第九篇 - SpringBoot统一结果封装Json数据
    前面几节学习了SpringBoot和Vue的结合,以及Vue跳转到另一个Vue页面。这节学习SpringBootcontroller返回Json数据格式封装。参考链接:https://zhuanlan.zhihu.com/p/347233348第一步:在entity文件夹下新建一个ResultVo类。 ResultVo.javapackagecom.example.demo.entity;p......
  • 认识soui4js(第5篇):使用扩展控件
    无论内置控件多么丰富,也不可能满足用户所有需求。总有时候用户需要自己扩展控件。soui4js推荐使用C++来扩展控件,然后通过实现一个js模块来提供js使用。扩展控件通常涉及到图形上下文的频繁交互,如果使用js来实现,效率上会大打折扣。使用C++,没了C++和js的相互调用。使用起来就和C++......
  • GIS融合之路(五)给CesiumJS加上体积云(Volumetric Cloud)和高度雾(Height Fog)
    同样在这篇文章开始前重申一下,山海鲸并没有使用ThreeJS引擎。但由于ThreeJS引擎使用广泛,下文中直接用ThreeJS同CesiumJS的整合方案代替山海鲸中3D引擎和CesiumJS整合。系列传送门:同样在这篇文章开始前重申一下,山海鲸并没有使用ThreeJS引擎。但由于ThreeJS引擎使用广泛,下文中直接......
  • 2023年7月最新全国省市区县和乡镇街道行政区划矢量边界坐标经纬度地图数据 shp geojso
    发现个可以免费下载全国 geojson 数据的网站,推荐一下。支持全国、省级、市级、区/县级、街道/乡镇级以及各级的联动数据,支持导入矢量地图渲染框架中使用,例如:D3、Echarts等geojson数据下载地址:https://geojson.hxkj.vip该项目github地址:https://github.com/TangSY/echarts-m......
  • scala class、Map、List 转换成Json(Gson、json4s、JSONUtil)
    实例代码importcn.hutool.json.JSONUtilimportcom.google.gson.GsonobjectEntitytoJsonTest{defmain(args:Array[String]):Unit={valgson=newGsonvalpeople=JJ("gl",12,List("basketball","baseball"),......
  • js 实现文件下载并重命名
    JavaScript实现文件下载并重命名 第一种是HTML官网中的方法<ahref="/images/liang.jpg"download="文件名称">HTML5中a标签提供了一个filename属性,可以下载成指定的download属性名称这种同源访问是没有问题的,但一跨域就不行了,试了其它方法,不是报跨域错误,就是在当......
  • md5.js
    直接引入md5.js需要注意:(不然加密的md5不会变)md5(blob.byteLength)import{md5}from"@/utils/md5.js";/* *JavaScriptMD51.0.1 *https://github.com/blueimp/JavaScript-MD5 * *Copyright2011,SebastianTschan *https://blueimp.net * *License......
  • package.json指南
    一、属性name定义项目的名称,不能以"."和"_"开头,不能包含大写字母version定义项目的版本号,格式为:大版本号.次版本号.修订号description项目的描述二、配置dependencies生产环境的依赖包如果不使用脱字符(^),安装的版本号固定;如果使用,则能安装当前大版本的最新版本,在......