This commit is contained in:
Timer
2026-03-26 01:47:35 +08:00
parent b745bb8482
commit 1cd6750710

View File

@ -62,7 +62,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
selelct_4.val('').trigger("change");
//TODO 代码有冲突
// Initialize job dropdown with all jobs
onValueChange();
key = setInterval(() => {
// console.log(document.getElementById('objUserName'))
if ($('#objUserId').val() != old) {
@ -172,9 +173,17 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
function onValueChange() {
// console.log($('#objUserId').val())
$.post(ext.contextPath + "/user/getJsonJobByUser.do?userId=" + $('#objUserId').val(), function (data) {
$.get(ext.contextPath + "/user/getJsonJob.do", function (data) {
// Transform data to Select2 format: {id, text}
var transformedData = [];
$.each(data, function(index, item) {
transformedData.push({
id: item.id,
text: item.name
});
});
$("#jobId").select2({
data: data,
data: transformedData,
cache: false,
placeholder: '请选择',//默认文字提示
// allowClear: true,//允许清空